private Path saveJsPlugin(@Nullable String fileName, String code) {
        byte[] bytes = code.getBytes(StandardCharsets.UTF_8);
        boolean isCustomFileName = fileName != null;
        if (fileName == null) {
            byte[] digest = MessageDigestPool.getSha1()
                    .digest(bytes);
            fileName = Base16Util.encodeAsString(digest, false);
        }
        Path path = pluginDir.resolve(EXTERNAL_PLUGIN_ARCHIVE_NAME_PREFIX
                + fileName
                + ".js");
        if (Files.exists(path)) {
            if (isCustomFileName) {
                throw new IllegalArgumentException(
                        "The JavaScript plugin file ("
                                + fileName
                                + ") already exists");
            } else {
                return path;
            }
        }
        try {
            Files.write(path,
                    bytes,
                    StandardOpenOption.CREATE,
                    StandardOpenOption.TRUNCATE_EXISTING);
        } catch (Exception e) {
            throw new InputOutputException(
                    "Failed to write the JavaScript plugin to the path: "
                            + path,
                    e);
        }
        return path;
    }
@implNote Start plugins after all beans are ready so that plugins can get any bean when
          starting.
turms-server-common/src/main/java/im/turms/server/common/infra/plugin/PluginManager.java