@fecommunity/reactpress-server 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +325 -56
- package/bin/reactpress-server.js +6 -50
- package/dist/app.module.js +30 -18
- package/dist/app.module.js.map +1 -1
- package/dist/filters/http-exception.filter.js +1 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/generate-swagger.d.ts +1 -1
- package/dist/generate-swagger.js +11 -12
- package/dist/generate-swagger.js.map +1 -1
- package/dist/interceptors/transform.interceptor.d.ts +6 -2
- package/dist/interceptors/transform.interceptor.js +5 -10
- package/dist/interceptors/transform.interceptor.js.map +1 -1
- package/dist/logger/index.js +4 -5
- package/dist/logger/index.js.map +1 -1
- package/dist/main.d.ts +1 -3
- package/dist/main.js +23 -47
- package/dist/main.js.map +1 -1
- package/dist/modules/article/article.controller.d.ts +2 -7
- package/dist/modules/article/article.controller.js +48 -103
- package/dist/modules/article/article.controller.js.map +1 -1
- package/dist/modules/article/article.entity.d.ts +0 -4
- package/dist/modules/article/article.entity.js +41 -61
- package/dist/modules/article/article.entity.js.map +1 -1
- package/dist/modules/article/article.module.js +3 -18
- package/dist/modules/article/article.module.js.map +1 -1
- package/dist/modules/article/article.service.d.ts +2 -16
- package/dist/modules/article/article.service.js +29 -151
- package/dist/modules/article/article.service.js.map +1 -1
- package/dist/modules/auth/auth.controller.js +11 -11
- package/dist/modules/auth/auth.controller.js.map +1 -1
- package/dist/modules/auth/auth.module.js +4 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/auth.service.js +7 -8
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/jwt-auth.guard.js +3 -4
- package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
- package/dist/modules/auth/jwt.strategy.js +3 -4
- package/dist/modules/auth/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/roles.guard.js +2 -2
- package/dist/modules/auth/roles.guard.js.map +1 -1
- package/dist/modules/category/category.controller.js +20 -21
- package/dist/modules/category/category.controller.js.map +1 -1
- package/dist/modules/category/category.entity.js +13 -13
- package/dist/modules/category/category.entity.js.map +1 -1
- package/dist/modules/category/category.module.js +1 -1
- package/dist/modules/category/category.module.js.map +1 -1
- package/dist/modules/category/category.service.js +4 -5
- package/dist/modules/category/category.service.js.map +1 -1
- package/dist/modules/comment/comment.controller.js +20 -24
- package/dist/modules/comment/comment.controller.js.map +1 -1
- package/dist/modules/comment/comment.entity.js +31 -31
- package/dist/modules/comment/comment.entity.js.map +1 -1
- package/dist/modules/comment/comment.module.js +2 -11
- package/dist/modules/comment/comment.module.js.map +1 -1
- package/dist/modules/comment/comment.service.d.ts +1 -5
- package/dist/modules/comment/comment.service.js +16 -43
- package/dist/modules/comment/comment.service.js.map +1 -1
- package/dist/modules/comment/html.d.ts +1 -1
- package/dist/modules/comment/html.js +3 -3
- package/dist/modules/comment/html.js.map +1 -1
- package/dist/modules/file/file.controller.d.ts +1 -1
- package/dist/modules/file/file.controller.js +20 -22
- package/dist/modules/file/file.controller.js.map +1 -1
- package/dist/modules/file/file.entity.d.ts +0 -7
- package/dist/modules/file/file.entity.js +15 -20
- package/dist/modules/file/file.entity.js.map +1 -1
- package/dist/modules/file/file.module.js +4 -16
- package/dist/modules/file/file.module.js.map +1 -1
- package/dist/modules/file/file.service.d.ts +1 -6
- package/dist/modules/file/file.service.js +38 -88
- package/dist/modules/file/file.service.js.map +1 -1
- package/dist/modules/install/install.controller.js +5 -5
- package/dist/modules/install/install.controller.js.map +1 -1
- package/dist/modules/install/install.module.js +1 -1
- package/dist/modules/install/install.module.js.map +1 -1
- package/dist/modules/install/install.service.js +2 -2
- package/dist/modules/install/install.service.js.map +1 -1
- package/dist/modules/knowledge/knowledge.controller.js +33 -35
- package/dist/modules/knowledge/knowledge.controller.js.map +1 -1
- package/dist/modules/knowledge/knowledge.entity.js +33 -33
- package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
- package/dist/modules/knowledge/knowledge.module.js +1 -1
- package/dist/modules/knowledge/knowledge.module.js.map +1 -1
- package/dist/modules/knowledge/knowledge.service.js +11 -12
- package/dist/modules/knowledge/knowledge.service.js.map +1 -1
- package/dist/modules/page/page.controller.js +23 -24
- package/dist/modules/page/page.controller.js.map +1 -1
- package/dist/modules/page/page.entity.js +27 -27
- package/dist/modules/page/page.entity.js.map +1 -1
- package/dist/modules/page/page.module.js +1 -1
- package/dist/modules/page/page.module.js.map +1 -1
- package/dist/modules/page/page.service.js +12 -12
- package/dist/modules/page/page.service.js.map +1 -1
- package/dist/modules/search/search.controller.js +12 -12
- package/dist/modules/search/search.controller.js.map +1 -1
- package/dist/modules/search/search.entity.js +13 -13
- package/dist/modules/search/search.entity.js.map +1 -1
- package/dist/modules/search/search.module.js +1 -1
- package/dist/modules/search/search.module.js.map +1 -1
- package/dist/modules/search/search.service.js +2 -2
- package/dist/modules/search/search.service.js.map +1 -1
- package/dist/modules/setting/setting.constant.d.ts +4 -5
- package/dist/modules/setting/setting.constant.js +20 -5
- package/dist/modules/setting/setting.constant.js.map +1 -1
- package/dist/modules/setting/setting.controller.js +11 -11
- package/dist/modules/setting/setting.controller.js.map +1 -1
- package/dist/modules/setting/setting.entity.d.ts +0 -3
- package/dist/modules/setting/setting.entity.js +49 -64
- package/dist/modules/setting/setting.entity.js.map +1 -1
- package/dist/modules/setting/setting.module.js +2 -2
- package/dist/modules/setting/setting.module.js.map +1 -1
- package/dist/modules/setting/setting.service.d.ts +2 -13
- package/dist/modules/setting/setting.service.js +24 -169
- package/dist/modules/setting/setting.service.js.map +1 -1
- package/dist/modules/smtp/mail.util.d.ts +6 -7
- package/dist/modules/smtp/mail.util.js +9 -5
- package/dist/modules/smtp/mail.util.js.map +1 -1
- package/dist/modules/smtp/smtp.controller.d.ts +0 -3
- package/dist/modules/smtp/smtp.controller.js +14 -27
- package/dist/modules/smtp/smtp.controller.js.map +1 -1
- package/dist/modules/smtp/smtp.entity.js +15 -15
- package/dist/modules/smtp/smtp.entity.js.map +1 -1
- package/dist/modules/smtp/smtp.module.js +2 -2
- package/dist/modules/smtp/smtp.module.js.map +1 -1
- package/dist/modules/smtp/smtp.service.d.ts +0 -14
- package/dist/modules/smtp/smtp.service.js +12 -40
- package/dist/modules/smtp/smtp.service.js.map +1 -1
- package/dist/modules/tag/tag.controller.js +22 -24
- package/dist/modules/tag/tag.controller.js.map +1 -1
- package/dist/modules/tag/tag.entity.js +12 -12
- package/dist/modules/tag/tag.entity.js.map +1 -1
- package/dist/modules/tag/tag.module.js +1 -1
- package/dist/modules/tag/tag.module.js.map +1 -1
- package/dist/modules/tag/tag.service.js +4 -5
- package/dist/modules/tag/tag.service.js.map +1 -1
- package/dist/modules/user/user.controller.js +28 -39
- package/dist/modules/user/user.controller.js.map +1 -1
- package/dist/modules/user/user.entity.js +22 -22
- package/dist/modules/user/user.entity.js.map +1 -1
- package/dist/modules/user/user.module.js +2 -2
- package/dist/modules/user/user.module.js.map +1 -1
- package/dist/modules/user/user.service.js +14 -18
- package/dist/modules/user/user.service.js.map +1 -1
- package/dist/modules/view/view.controller.js +19 -20
- package/dist/modules/view/view.controller.js.map +1 -1
- package/dist/modules/view/view.entity.js +24 -24
- package/dist/modules/view/view.entity.js.map +1 -1
- package/dist/modules/view/view.module.js +1 -1
- package/dist/modules/view/view.module.js.map +1 -1
- package/dist/modules/view/view.service.js +4 -4
- package/dist/modules/view/view.service.js.map +1 -1
- package/dist/public/favicon.png +0 -0
- package/dist/starter.d.ts +1 -3
- package/dist/starter.js +14 -202
- package/dist/starter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +15957 -1
- package/dist/utils/date.util.js +1 -1
- package/dist/utils/date.util.js.map +1 -1
- package/dist/utils/markdown.util.js +1 -1
- package/dist/utils/markdown.util.js.map +1 -1
- package/dist/utils/oss/aliyun-oss-client.d.ts +1 -3
- package/dist/utils/oss/aliyun-oss-client.js +0 -5
- package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
- package/dist/utils/oss/oss-client.d.ts +1 -3
- package/dist/utils/oss/oss-client.js.map +1 -1
- package/dist/utils/oss.util.d.ts +1 -3
- package/dist/utils/oss.util.js +1 -6
- package/dist/utils/oss.util.js.map +1 -1
- package/dist/utils/uniqueid.util.js +1 -1
- package/dist/utils/uniqueid.util.js.map +1 -1
- package/dist/utils/upload.util.d.ts +2 -6
- package/dist/utils/upload.util.js +8 -23
- package/dist/utils/upload.util.js.map +1 -1
- package/dist/utils/user.util.d.ts +0 -1
- package/dist/utils/user.util.js +2 -6
- package/dist/utils/user.util.js.map +1 -1
- package/package.json +32 -36
- package/public/favicon.png +0 -0
- package/dist/common/api-messages.d.ts +0 -41
- package/dist/common/api-messages.js +0 -45
- package/dist/common/api-messages.js.map +0 -1
- package/dist/database/typeorm-options.d.ts +0 -3
- package/dist/database/typeorm-options.js +0 -71
- package/dist/database/typeorm-options.js.map +0 -1
- package/dist/modules/api-key/api-key.controller.d.ts +0 -14
- package/dist/modules/api-key/api-key.controller.js +0 -63
- package/dist/modules/api-key/api-key.controller.js.map +0 -1
- package/dist/modules/api-key/api-key.entity.d.ts +0 -11
- package/dist/modules/api-key/api-key.entity.js +0 -63
- package/dist/modules/api-key/api-key.entity.js.map +0 -1
- package/dist/modules/api-key/api-key.guard.d.ts +0 -7
- package/dist/modules/api-key/api-key.guard.js +0 -39
- package/dist/modules/api-key/api-key.guard.js.map +0 -1
- package/dist/modules/api-key/api-key.module.d.ts +0 -2
- package/dist/modules/api-key/api-key.module.js +0 -28
- package/dist/modules/api-key/api-key.module.js.map +0 -1
- package/dist/modules/api-key/api-key.service.d.ts +0 -15
- package/dist/modules/api-key/api-key.service.js +0 -81
- package/dist/modules/api-key/api-key.service.js.map +0 -1
- package/dist/modules/article/article-revision.entity.d.ts +0 -11
- package/dist/modules/article/article-revision.entity.js +0 -53
- package/dist/modules/article/article-revision.entity.js.map +0 -1
- package/dist/modules/article/article-slug.util.d.ts +0 -2
- package/dist/modules/article/article-slug.util.js +0 -19
- package/dist/modules/article/article-slug.util.js.map +0 -1
- package/dist/modules/article/scheduled-publish.service.d.ts +0 -13
- package/dist/modules/article/scheduled-publish.service.js +0 -65
- package/dist/modules/article/scheduled-publish.service.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
- package/dist/modules/bootstrap/bootstrap.constants.js +0 -171
- package/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
- package/dist/modules/bootstrap/bootstrap.service.js +0 -183
- package/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
- package/dist/modules/bootstrap/install-locale.d.ts +0 -2
- package/dist/modules/bootstrap/install-locale.js +0 -11
- package/dist/modules/bootstrap/install-locale.js.map +0 -1
- package/dist/modules/extension/extension.module.d.ts +0 -9
- package/dist/modules/extension/extension.module.js +0 -52
- package/dist/modules/extension/extension.module.js.map +0 -1
- package/dist/modules/extension/plugin-loader.service.d.ts +0 -12
- package/dist/modules/extension/plugin-loader.service.js +0 -96
- package/dist/modules/extension/plugin-loader.service.js.map +0 -1
- package/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
- package/dist/modules/extension/plugin-registry.bridge.js +0 -44
- package/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
- package/dist/modules/extension/plugin.controller.d.ts +0 -22
- package/dist/modules/extension/plugin.controller.js +0 -155
- package/dist/modules/extension/plugin.controller.js.map +0 -1
- package/dist/modules/extension/plugin.service.d.ts +0 -54
- package/dist/modules/extension/plugin.service.js +0 -414
- package/dist/modules/extension/plugin.service.js.map +0 -1
- package/dist/modules/extension/preview-draft.store.d.ts +0 -13
- package/dist/modules/extension/preview-draft.store.js +0 -41
- package/dist/modules/extension/preview-draft.store.js.map +0 -1
- package/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
- package/dist/modules/extension/theme-registry.bridge.js +0 -68
- package/dist/modules/extension/theme-registry.bridge.js.map +0 -1
- package/dist/modules/extension/theme.controller.d.ts +0 -66
- package/dist/modules/extension/theme.controller.js +0 -301
- package/dist/modules/extension/theme.controller.js.map +0 -1
- package/dist/modules/extension/theme.service.d.ts +0 -140
- package/dist/modules/extension/theme.service.js +0 -1039
- package/dist/modules/extension/theme.service.js.map +0 -1
- package/dist/modules/file/content-image-scan.util.d.ts +0 -52
- package/dist/modules/file/content-image-scan.util.js +0 -222
- package/dist/modules/file/content-image-scan.util.js.map +0 -1
- package/dist/modules/file/file-optimization.controller.d.ts +0 -12
- package/dist/modules/file/file-optimization.controller.js +0 -79
- package/dist/modules/file/file-optimization.controller.js.map +0 -1
- package/dist/modules/file/file-optimization.service.d.ts +0 -36
- package/dist/modules/file/file-optimization.service.js +0 -387
- package/dist/modules/file/file-optimization.service.js.map +0 -1
- package/dist/modules/file/file-optimization.types.d.ts +0 -66
- package/dist/modules/file/file-optimization.types.js +0 -5
- package/dist/modules/file/file-optimization.types.js.map +0 -1
- package/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
- package/dist/modules/file/image-optimizer-plugin.guard.js +0 -33
- package/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
- package/dist/modules/health/health.controller.d.ts +0 -11
- package/dist/modules/health/health.controller.js +0 -55
- package/dist/modules/health/health.controller.js.map +0 -1
- package/dist/modules/health/health.module.d.ts +0 -2
- package/dist/modules/health/health.module.js +0 -20
- package/dist/modules/health/health.module.js.map +0 -1
- package/dist/modules/hook/hook.module.d.ts +0 -2
- package/dist/modules/hook/hook.module.js +0 -22
- package/dist/modules/hook/hook.module.js.map +0 -1
- package/dist/modules/hook/hook.service.d.ts +0 -26
- package/dist/modules/hook/hook.service.js +0 -105
- package/dist/modules/hook/hook.service.js.map +0 -1
- package/dist/modules/webhook/webhook.controller.d.ts +0 -12
- package/dist/modules/webhook/webhook.controller.js +0 -63
- package/dist/modules/webhook/webhook.controller.js.map +0 -1
- package/dist/modules/webhook/webhook.entity.d.ts +0 -9
- package/dist/modules/webhook/webhook.entity.js +0 -54
- package/dist/modules/webhook/webhook.entity.js.map +0 -1
- package/dist/modules/webhook/webhook.module.d.ts +0 -2
- package/dist/modules/webhook/webhook.module.js +0 -27
- package/dist/modules/webhook/webhook.module.js.map +0 -1
- package/dist/modules/webhook/webhook.service.d.ts +0 -16
- package/dist/modules/webhook/webhook.service.js +0 -100
- package/dist/modules/webhook/webhook.service.js.map +0 -1
- package/dist/node-polyfills.d.ts +0 -18
- package/dist/node-polyfills.js +0 -24
- package/dist/node-polyfills.js.map +0 -1
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16.png +0 -0
- package/dist/public/favicon-32.png +0 -0
- package/dist/public/favicon-48.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/icon-192.png +0 -0
- package/dist/public/icon-512.png +0 -0
- package/dist/public/logo-200.png +0 -0
- package/dist/public/logo-400.png +0 -0
- package/dist/public/logo.png +0 -0
- package/dist/public/logo.svg +0 -7
- package/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils/html-sanitize.util.d.ts +0 -1
- package/dist/utils/html-sanitize.util.js +0 -33
- package/dist/utils/html-sanitize.util.js.map +0 -1
- package/dist/utils/image-processor.util.d.ts +0 -23
- package/dist/utils/image-processor.util.js +0 -88
- package/dist/utils/image-processor.util.js.map +0 -1
- package/dist/utils/local-api-quiet.util.d.ts +0 -1
- package/dist/utils/local-api-quiet.util.js +0 -8
- package/dist/utils/local-api-quiet.util.js.map +0 -1
- package/dist/utils/project-root.util.d.ts +0 -2
- package/dist/utils/project-root.util.js +0 -42
- package/dist/utils/project-root.util.js.map +0 -1
- package/dist/utils/query-whitelist.util.d.ts +0 -1
- package/dist/utils/query-whitelist.util.js +0 -100
- package/dist/utils/query-whitelist.util.js.map +0 -1
- package/dist/utils/theme-placeholder-cover.d.ts +0 -7
- package/dist/utils/theme-placeholder-cover.js +0 -94
- package/dist/utils/theme-placeholder-cover.js.map +0 -1
- package/dist/utils/upload-url.util.d.ts +0 -4
- package/dist/utils/upload-url.util.js +0 -34
- package/dist/utils/upload-url.util.js.map +0 -1
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16.png +0 -0
- package/public/favicon-32.png +0 -0
- package/public/favicon-48.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/logo-200.png +0 -0
- package/public/logo-400.png +0 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +0 -7
- package/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-registry.bridge.js","sourceRoot":"","sources":["../../../src/modules/extension/plugin-registry.bridge.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,qEAAmE;AACnE,yEAAmF;AAEnF,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1C,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;QACvE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,SAAS;QACnC,IAAI,CAAC,IAAA,2BAAe,EAAC,KAAK,CAAC,IAAI,CAAC;YAAE,SAAS;QAC3C,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,EAAE;YACnE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC7B;KACF;IACD,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAgB,sBAAsB,CAAC,IAAI,GAAG,IAAA,sCAAkB,GAAE;;IAChE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEtD,IAAI,YAAY,GAAa,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC1B,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAEtD,CAAC;YACF,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAA,GAAG,CAAC,UAAU,0CAAE,KAAK,CAAC;gBACjD,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CACzB,CAAC,EAAE,EAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,QAAQ,IAAI,IAAA,2BAAe,EAAC,EAAE,CAAC,CACpE;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QAAC,WAAM;YACN,YAAY,GAAG,EAAE,CAAC;SACnB;KACF;IAED,MAAM,UAAU,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,YAAY,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AAvBD,wDAuBC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PluginLoaderService } from './plugin-loader.service';
|
|
2
|
-
import { PluginService } from './plugin.service';
|
|
3
|
-
export declare class PluginController {
|
|
4
|
-
private readonly pluginService;
|
|
5
|
-
private readonly pluginLoader;
|
|
6
|
-
constructor(pluginService: PluginService, pluginLoader: PluginLoaderService);
|
|
7
|
-
list(): Promise<import("./plugin.service").PluginListItem[]>;
|
|
8
|
-
state(): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
9
|
-
getLocale(id: string, locale: string): Promise<{
|
|
10
|
-
pluginId: string;
|
|
11
|
-
locale: string;
|
|
12
|
-
messages: import("@fecommunity/reactpress-toolkit/plugin/extension").PluginAdminLocaleMessages;
|
|
13
|
-
}>;
|
|
14
|
-
getOne(id: string): Promise<import("./plugin.service").PluginListItem>;
|
|
15
|
-
install(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
16
|
-
activate(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
17
|
-
deactivate(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
18
|
-
uninstall(id: string): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
19
|
-
updateConfig(id: string, body: {
|
|
20
|
-
config?: Record<string, unknown>;
|
|
21
|
-
}): Promise<import("@fecommunity/reactpress-toolkit/plugin/extension").SitePluginState>;
|
|
22
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PluginController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const jwt_auth_guard_1 = require("../auth/jwt-auth.guard");
|
|
19
|
-
const roles_guard_1 = require("../auth/roles.guard");
|
|
20
|
-
const plugin_loader_service_1 = require("./plugin-loader.service");
|
|
21
|
-
const plugin_service_1 = require("./plugin.service");
|
|
22
|
-
let PluginController = class PluginController {
|
|
23
|
-
constructor(pluginService, pluginLoader) {
|
|
24
|
-
this.pluginService = pluginService;
|
|
25
|
-
this.pluginLoader = pluginLoader;
|
|
26
|
-
}
|
|
27
|
-
list() {
|
|
28
|
-
return this.pluginService.listPlugins();
|
|
29
|
-
}
|
|
30
|
-
state() {
|
|
31
|
-
return this.pluginService.getPluginState();
|
|
32
|
-
}
|
|
33
|
-
getLocale(id, locale) {
|
|
34
|
-
return this.pluginService.getPluginAdminLocale(id, locale);
|
|
35
|
-
}
|
|
36
|
-
getOne(id) {
|
|
37
|
-
return this.pluginService.getPlugin(id);
|
|
38
|
-
}
|
|
39
|
-
async install(id) {
|
|
40
|
-
return this.pluginService.installPlugin(id);
|
|
41
|
-
}
|
|
42
|
-
async activate(id) {
|
|
43
|
-
const state = await this.pluginService.activatePlugin(id);
|
|
44
|
-
await this.pluginLoader.reloadPlugin(id);
|
|
45
|
-
return state;
|
|
46
|
-
}
|
|
47
|
-
async deactivate(id) {
|
|
48
|
-
await this.pluginLoader.unloadPlugin(id);
|
|
49
|
-
return this.pluginService.deactivatePlugin(id);
|
|
50
|
-
}
|
|
51
|
-
async uninstall(id) {
|
|
52
|
-
return this.pluginService.uninstallPlugin(id);
|
|
53
|
-
}
|
|
54
|
-
async updateConfig(id, body) {
|
|
55
|
-
var _a;
|
|
56
|
-
const state = await this.pluginService.updatePluginConfig(id, (_a = body === null || body === void 0 ? void 0 : body.config) !== null && _a !== void 0 ? _a : {});
|
|
57
|
-
const current = await this.pluginService.getPluginState();
|
|
58
|
-
if (current.activePlugins.includes(id)) {
|
|
59
|
-
await this.pluginLoader.reloadPlugin(id);
|
|
60
|
-
}
|
|
61
|
-
return state;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, common_1.Get)(),
|
|
66
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
67
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
68
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'List registered and installed plugins' }),
|
|
69
|
-
__metadata("design:type", Function),
|
|
70
|
-
__metadata("design:paramtypes", []),
|
|
71
|
-
__metadata("design:returntype", void 0)
|
|
72
|
-
], PluginController.prototype, "list", null);
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, common_1.Get)('state'),
|
|
75
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
76
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
77
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Current plugin activation state' }),
|
|
78
|
-
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", []),
|
|
80
|
-
__metadata("design:returntype", void 0)
|
|
81
|
-
], PluginController.prototype, "state", null);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, common_1.Get)(':id/locales/:locale'),
|
|
84
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
85
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
86
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Admin locale strings bundled with the plugin' }),
|
|
87
|
-
__param(0, (0, common_1.Param)('id')),
|
|
88
|
-
__param(1, (0, common_1.Param)('locale')),
|
|
89
|
-
__metadata("design:type", Function),
|
|
90
|
-
__metadata("design:paramtypes", [String, String]),
|
|
91
|
-
__metadata("design:returntype", void 0)
|
|
92
|
-
], PluginController.prototype, "getLocale", null);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, common_1.Get)(':id'),
|
|
95
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
96
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
97
|
-
__param(0, (0, common_1.Param)('id')),
|
|
98
|
-
__metadata("design:type", Function),
|
|
99
|
-
__metadata("design:paramtypes", [String]),
|
|
100
|
-
__metadata("design:returntype", void 0)
|
|
101
|
-
], PluginController.prototype, "getOne", null);
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, common_1.Post)(':id/install'),
|
|
104
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
105
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
106
|
-
__param(0, (0, common_1.Param)('id')),
|
|
107
|
-
__metadata("design:type", Function),
|
|
108
|
-
__metadata("design:paramtypes", [String]),
|
|
109
|
-
__metadata("design:returntype", Promise)
|
|
110
|
-
], PluginController.prototype, "install", null);
|
|
111
|
-
__decorate([
|
|
112
|
-
(0, common_1.Post)(':id/activate'),
|
|
113
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
114
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
115
|
-
__param(0, (0, common_1.Param)('id')),
|
|
116
|
-
__metadata("design:type", Function),
|
|
117
|
-
__metadata("design:paramtypes", [String]),
|
|
118
|
-
__metadata("design:returntype", Promise)
|
|
119
|
-
], PluginController.prototype, "activate", null);
|
|
120
|
-
__decorate([
|
|
121
|
-
(0, common_1.Post)(':id/deactivate'),
|
|
122
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
123
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
124
|
-
__param(0, (0, common_1.Param)('id')),
|
|
125
|
-
__metadata("design:type", Function),
|
|
126
|
-
__metadata("design:paramtypes", [String]),
|
|
127
|
-
__metadata("design:returntype", Promise)
|
|
128
|
-
], PluginController.prototype, "deactivate", null);
|
|
129
|
-
__decorate([
|
|
130
|
-
(0, common_1.Delete)(':id'),
|
|
131
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
132
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
133
|
-
__param(0, (0, common_1.Param)('id')),
|
|
134
|
-
__metadata("design:type", Function),
|
|
135
|
-
__metadata("design:paramtypes", [String]),
|
|
136
|
-
__metadata("design:returntype", Promise)
|
|
137
|
-
], PluginController.prototype, "uninstall", null);
|
|
138
|
-
__decorate([
|
|
139
|
-
(0, common_1.Put)(':id/config'),
|
|
140
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
141
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
|
|
142
|
-
__param(0, (0, common_1.Param)('id')),
|
|
143
|
-
__param(1, (0, common_1.Body)()),
|
|
144
|
-
__metadata("design:type", Function),
|
|
145
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
146
|
-
__metadata("design:returntype", Promise)
|
|
147
|
-
], PluginController.prototype, "updateConfig", null);
|
|
148
|
-
PluginController = __decorate([
|
|
149
|
-
(0, swagger_1.ApiTags)('Extension'),
|
|
150
|
-
(0, common_1.Controller)('extension/plugins'),
|
|
151
|
-
__metadata("design:paramtypes", [plugin_service_1.PluginService,
|
|
152
|
-
plugin_loader_service_1.PluginLoaderService])
|
|
153
|
-
], PluginController);
|
|
154
|
-
exports.PluginController = PluginController;
|
|
155
|
-
//# sourceMappingURL=plugin.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.controller.js","sourceRoot":"","sources":["../../../src/modules/extension/plugin.controller.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { PluginAdminLocaleMessages, PluginManifest, SitePluginState } from '@fecommunity/reactpress-toolkit/plugin/extension';
|
|
2
|
-
import type { PluginContext } from '@fecommunity/reactpress-toolkit/plugin/server';
|
|
3
|
-
import { Repository } from 'typeorm';
|
|
4
|
-
import { SettingService } from '../setting/setting.service';
|
|
5
|
-
import { Setting } from '../setting/setting.entity';
|
|
6
|
-
export interface PluginListItem extends PluginManifest {
|
|
7
|
-
source: 'local' | 'installed';
|
|
8
|
-
installed: boolean;
|
|
9
|
-
active: boolean;
|
|
10
|
-
loadError?: string;
|
|
11
|
-
config?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
export declare class PluginService {
|
|
14
|
-
private readonly settingRepository;
|
|
15
|
-
private readonly settingService;
|
|
16
|
-
private readonly logger;
|
|
17
|
-
private static readonly COPY_SKIP_NAMES;
|
|
18
|
-
private static readonly COPY_SKIP_REL_PATHS;
|
|
19
|
-
constructor(settingRepository: Repository<Setting>, settingService: SettingService);
|
|
20
|
-
private pluginsRoot;
|
|
21
|
-
private templatesDir;
|
|
22
|
-
runtimeDir(): string;
|
|
23
|
-
private getSettingRow;
|
|
24
|
-
private parseGlobalSetting;
|
|
25
|
-
getPluginState(): Promise<SitePluginState>;
|
|
26
|
-
private savePluginState;
|
|
27
|
-
readManifest(pluginDir: string): PluginManifest | null;
|
|
28
|
-
readRuntimeManifest(pluginId: string): PluginManifest | null;
|
|
29
|
-
resolveServerModulePath(pluginId: string, moduleRel: string): string | null;
|
|
30
|
-
private listLocalPlugins;
|
|
31
|
-
private listInstalledPlugins;
|
|
32
|
-
private isRuntimePluginEntry;
|
|
33
|
-
listPlugins(): Promise<PluginListItem[]>;
|
|
34
|
-
getPlugin(id: string): Promise<PluginListItem>;
|
|
35
|
-
getPluginAdminLocale(pluginId: string, locale: string): Promise<{
|
|
36
|
-
pluginId: string;
|
|
37
|
-
locale: string;
|
|
38
|
-
messages: PluginAdminLocaleMessages;
|
|
39
|
-
}>;
|
|
40
|
-
private pluginLocaleSearchDirs;
|
|
41
|
-
installPlugin(id: string): Promise<SitePluginState>;
|
|
42
|
-
activatePlugin(id: string): Promise<SitePluginState>;
|
|
43
|
-
deactivatePlugin(id: string): Promise<SitePluginState>;
|
|
44
|
-
uninstallPlugin(id: string): Promise<SitePluginState>;
|
|
45
|
-
updatePluginConfig(id: string, config: Record<string, unknown>): Promise<SitePluginState>;
|
|
46
|
-
createPluginContext(pluginId: string, manifest: PluginManifest): Promise<PluginContext>;
|
|
47
|
-
recordLoadError(pluginId: string, message: string): Promise<void>;
|
|
48
|
-
clearLoadError(pluginId: string): Promise<void>;
|
|
49
|
-
private validatePluginDependencies;
|
|
50
|
-
private ensurePluginInstalled;
|
|
51
|
-
private materializeRuntimePlugin;
|
|
52
|
-
private copyDir;
|
|
53
|
-
private removeDir;
|
|
54
|
-
}
|
|
@@ -1,414 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var PluginService_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.PluginService = void 0;
|
|
17
|
-
const extension_1 = require("../../../../toolkit/dist/plugin/extension");
|
|
18
|
-
const node_1 = require("../../../../toolkit/dist/plugin/node");
|
|
19
|
-
const extension_2 = require("../../../../toolkit/dist/plugin/extension");
|
|
20
|
-
const server_1 = require("../../../../toolkit/dist/plugin/server");
|
|
21
|
-
const common_1 = require("@nestjs/common");
|
|
22
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
23
|
-
const fs = require("fs");
|
|
24
|
-
const path = require("path");
|
|
25
|
-
const typeorm_2 = require("typeorm");
|
|
26
|
-
const project_root_util_1 = require("../../utils/project-root.util");
|
|
27
|
-
const setting_service_1 = require("../setting/setting.service");
|
|
28
|
-
const setting_entity_1 = require("../setting/setting.entity");
|
|
29
|
-
const plugin_registry_bridge_1 = require("./plugin-registry.bridge");
|
|
30
|
-
const PLUGIN_RUNTIME_REL = path.join('.reactpress', 'plugins');
|
|
31
|
-
function projectRoot() {
|
|
32
|
-
return (0, project_root_util_1.resolveProjectRoot)();
|
|
33
|
-
}
|
|
34
|
-
let PluginService = PluginService_1 = class PluginService {
|
|
35
|
-
constructor(settingRepository, settingService) {
|
|
36
|
-
this.settingRepository = settingRepository;
|
|
37
|
-
this.settingService = settingService;
|
|
38
|
-
this.logger = new common_1.Logger(PluginService_1.name);
|
|
39
|
-
}
|
|
40
|
-
pluginsRoot() {
|
|
41
|
-
return path.join(projectRoot(), 'plugins');
|
|
42
|
-
}
|
|
43
|
-
templatesDir() {
|
|
44
|
-
return this.pluginsRoot();
|
|
45
|
-
}
|
|
46
|
-
runtimeDir() {
|
|
47
|
-
return path.join(projectRoot(), PLUGIN_RUNTIME_REL);
|
|
48
|
-
}
|
|
49
|
-
async getSettingRow() {
|
|
50
|
-
return this.settingService.getSettingRow();
|
|
51
|
-
}
|
|
52
|
-
parseGlobalSetting(row) {
|
|
53
|
-
if (!row.globalSetting)
|
|
54
|
-
return {};
|
|
55
|
-
try {
|
|
56
|
-
return JSON.parse(row.globalSetting);
|
|
57
|
-
}
|
|
58
|
-
catch (_a) {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async getPluginState() {
|
|
63
|
-
const row = await this.getSettingRow();
|
|
64
|
-
return (0, extension_2.getPluginStateFromGlobalSetting)(this.parseGlobalSetting(row));
|
|
65
|
-
}
|
|
66
|
-
async savePluginState(patch) {
|
|
67
|
-
const row = await this.getSettingRow();
|
|
68
|
-
const merged = (0, extension_2.mergePluginStateIntoGlobalSetting)(this.parseGlobalSetting(row), patch);
|
|
69
|
-
row.globalSetting = JSON.stringify(merged);
|
|
70
|
-
await this.settingRepository.save(row);
|
|
71
|
-
return merged.plugins;
|
|
72
|
-
}
|
|
73
|
-
readManifest(pluginDir) {
|
|
74
|
-
const manifestPath = path.join(pluginDir, 'plugin.json');
|
|
75
|
-
if (!fs.existsSync(manifestPath))
|
|
76
|
-
return null;
|
|
77
|
-
try {
|
|
78
|
-
const raw = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
79
|
-
const parsed = (0, extension_2.parsePluginManifest)(raw);
|
|
80
|
-
if (parsed)
|
|
81
|
-
return parsed;
|
|
82
|
-
const id = path.basename(pluginDir);
|
|
83
|
-
return (0, extension_2.parsePluginManifest)(Object.assign({ id, name: id, version: '1.0.0' }, raw));
|
|
84
|
-
}
|
|
85
|
-
catch (_a) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
readRuntimeManifest(pluginId) {
|
|
90
|
-
const dir = path.join(this.runtimeDir(), pluginId);
|
|
91
|
-
return this.readManifest(dir);
|
|
92
|
-
}
|
|
93
|
-
resolveServerModulePath(pluginId, moduleRel) {
|
|
94
|
-
if (!(0, extension_2.isValidPluginId)(pluginId))
|
|
95
|
-
return null;
|
|
96
|
-
const pluginRoot = path.join(this.runtimeDir(), pluginId);
|
|
97
|
-
return (0, extension_2.resolvePluginServerModulePath)(pluginRoot, moduleRel);
|
|
98
|
-
}
|
|
99
|
-
listLocalPlugins() {
|
|
100
|
-
const { local } = (0, plugin_registry_bridge_1.readPluginsPackageMeta)(projectRoot());
|
|
101
|
-
const manifests = [];
|
|
102
|
-
for (const id of local) {
|
|
103
|
-
const manifest = this.readManifest(path.join(this.templatesDir(), id));
|
|
104
|
-
if (manifest)
|
|
105
|
-
manifests.push(manifest);
|
|
106
|
-
}
|
|
107
|
-
return manifests;
|
|
108
|
-
}
|
|
109
|
-
listInstalledPlugins() {
|
|
110
|
-
const dir = this.runtimeDir();
|
|
111
|
-
if (!fs.existsSync(dir))
|
|
112
|
-
return [];
|
|
113
|
-
return fs
|
|
114
|
-
.readdirSync(dir, { withFileTypes: true })
|
|
115
|
-
.filter((d) => this.isRuntimePluginEntry(dir, d))
|
|
116
|
-
.map((d) => this.readManifest(path.join(dir, d.name)))
|
|
117
|
-
.filter((m) => m !== null);
|
|
118
|
-
}
|
|
119
|
-
isRuntimePluginEntry(parentDir, entry) {
|
|
120
|
-
if (entry.isDirectory())
|
|
121
|
-
return true;
|
|
122
|
-
if (!entry.isSymbolicLink())
|
|
123
|
-
return false;
|
|
124
|
-
try {
|
|
125
|
-
return fs.statSync(path.join(parentDir, entry.name)).isDirectory();
|
|
126
|
-
}
|
|
127
|
-
catch (_a) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async listPlugins() {
|
|
132
|
-
const state = await this.getPluginState();
|
|
133
|
-
const installedSet = new Set(state.installedPlugins);
|
|
134
|
-
const activeSet = new Set(state.activePlugins);
|
|
135
|
-
const byId = new Map();
|
|
136
|
-
const add = (manifest, source) => {
|
|
137
|
-
const installed = installedSet.has(manifest.id);
|
|
138
|
-
const entry = state.entries[manifest.id];
|
|
139
|
-
byId.set(manifest.id, Object.assign(Object.assign({}, manifest), { source: installed ? 'installed' : source, installed, active: activeSet.has(manifest.id), loadError: entry === null || entry === void 0 ? void 0 : entry.loadError, config: entry === null || entry === void 0 ? void 0 : entry.config }));
|
|
140
|
-
};
|
|
141
|
-
for (const m of this.listLocalPlugins()) {
|
|
142
|
-
add(m, 'local');
|
|
143
|
-
}
|
|
144
|
-
for (const m of this.listInstalledPlugins()) {
|
|
145
|
-
add(m, 'installed');
|
|
146
|
-
}
|
|
147
|
-
return Array.from(byId.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
148
|
-
}
|
|
149
|
-
async getPlugin(id) {
|
|
150
|
-
const items = await this.listPlugins();
|
|
151
|
-
const found = items.find((p) => p.id === id);
|
|
152
|
-
if (!found)
|
|
153
|
-
throw new common_1.NotFoundException(`Plugin "${id}" not found`);
|
|
154
|
-
return found;
|
|
155
|
-
}
|
|
156
|
-
async getPluginAdminLocale(pluginId, locale) {
|
|
157
|
-
if (!(0, extension_2.isValidPluginId)(pluginId)) {
|
|
158
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${pluginId}"`);
|
|
159
|
-
}
|
|
160
|
-
const dirs = this.pluginLocaleSearchDirs(pluginId);
|
|
161
|
-
if (dirs.length === 0) {
|
|
162
|
-
throw new common_1.NotFoundException(`Plugin "${pluginId}" not found`);
|
|
163
|
-
}
|
|
164
|
-
const safeLocale = /^[a-z]{2}(?:-[a-z]{2})?$/i.test(locale) ? locale : 'en';
|
|
165
|
-
for (const dir of dirs) {
|
|
166
|
-
const messages = (0, node_1.readPluginAdminLocaleFile)(dir, safeLocale);
|
|
167
|
-
if (messages) {
|
|
168
|
-
return { pluginId, locale: safeLocale, messages };
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return { pluginId, locale: safeLocale, messages: {} };
|
|
172
|
-
}
|
|
173
|
-
pluginLocaleSearchDirs(pluginId) {
|
|
174
|
-
const seen = new Set();
|
|
175
|
-
const ordered = [];
|
|
176
|
-
const push = (dir) => {
|
|
177
|
-
if (!dir || seen.has(dir))
|
|
178
|
-
return;
|
|
179
|
-
seen.add(dir);
|
|
180
|
-
ordered.push(dir);
|
|
181
|
-
};
|
|
182
|
-
const template = path.join(this.templatesDir(), pluginId);
|
|
183
|
-
if (fs.existsSync(template)) {
|
|
184
|
-
push(template);
|
|
185
|
-
}
|
|
186
|
-
const runtime = path.join(this.runtimeDir(), pluginId);
|
|
187
|
-
if (fs.existsSync(runtime)) {
|
|
188
|
-
push(runtime);
|
|
189
|
-
}
|
|
190
|
-
return ordered;
|
|
191
|
-
}
|
|
192
|
-
async installPlugin(id) {
|
|
193
|
-
var _a;
|
|
194
|
-
if (!(0, extension_2.isValidPluginId)(id)) {
|
|
195
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${id}"`);
|
|
196
|
-
}
|
|
197
|
-
const templatePath = path.join(this.templatesDir(), id);
|
|
198
|
-
if (!fs.existsSync(templatePath)) {
|
|
199
|
-
throw new common_1.NotFoundException(`Plugin template "${id}" not found`);
|
|
200
|
-
}
|
|
201
|
-
const manifest = this.readManifest(templatePath);
|
|
202
|
-
if (!manifest) {
|
|
203
|
-
throw new common_1.BadRequestException(`Plugin "${id}" has invalid plugin.json`);
|
|
204
|
-
}
|
|
205
|
-
const targetDir = path.join(this.runtimeDir(), id);
|
|
206
|
-
fs.mkdirSync(this.runtimeDir(), { recursive: true });
|
|
207
|
-
if (fs.existsSync(targetDir)) {
|
|
208
|
-
this.removeDir(targetDir);
|
|
209
|
-
}
|
|
210
|
-
this.materializeRuntimePlugin(templatePath, targetDir);
|
|
211
|
-
const state = await this.getPluginState();
|
|
212
|
-
const installedPlugins = state.installedPlugins.includes(id)
|
|
213
|
-
? state.installedPlugins
|
|
214
|
-
: [...state.installedPlugins, id];
|
|
215
|
-
const entries = Object.assign({}, state.entries);
|
|
216
|
-
entries[id] = Object.assign({ version: manifest.version, source: 'local' }, ((_a = entries[id]) !== null && _a !== void 0 ? _a : {}));
|
|
217
|
-
return this.savePluginState({ installedPlugins, entries });
|
|
218
|
-
}
|
|
219
|
-
async activatePlugin(id) {
|
|
220
|
-
var _a;
|
|
221
|
-
if (!(0, extension_2.isValidPluginId)(id)) {
|
|
222
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${id}"`);
|
|
223
|
-
}
|
|
224
|
-
await this.ensurePluginInstalled(id);
|
|
225
|
-
const manifest = this.readRuntimeManifest(id);
|
|
226
|
-
if (!manifest) {
|
|
227
|
-
throw new common_1.NotFoundException(`Plugin "${id}" not found in runtime`);
|
|
228
|
-
}
|
|
229
|
-
const state = await this.getPluginState();
|
|
230
|
-
this.validatePluginDependencies(id, manifest, state);
|
|
231
|
-
const activePlugins = state.activePlugins.includes(id) ? state.activePlugins : [...state.activePlugins, id];
|
|
232
|
-
const entries = Object.assign({}, state.entries);
|
|
233
|
-
entries[id] = Object.assign(Object.assign({}, ((_a = entries[id]) !== null && _a !== void 0 ? _a : { version: manifest.version, source: 'local' })), { version: manifest.version, activatedAt: new Date().toISOString(), loadError: undefined });
|
|
234
|
-
return this.savePluginState({ activePlugins, entries });
|
|
235
|
-
}
|
|
236
|
-
async deactivatePlugin(id) {
|
|
237
|
-
if (!(0, extension_2.isValidPluginId)(id)) {
|
|
238
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${id}"`);
|
|
239
|
-
}
|
|
240
|
-
const state = await this.getPluginState();
|
|
241
|
-
const activePlugins = state.activePlugins.filter((pid) => pid !== id);
|
|
242
|
-
return this.savePluginState({ activePlugins });
|
|
243
|
-
}
|
|
244
|
-
async uninstallPlugin(id) {
|
|
245
|
-
if (!(0, extension_2.isValidPluginId)(id)) {
|
|
246
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${id}"`);
|
|
247
|
-
}
|
|
248
|
-
const state = await this.getPluginState();
|
|
249
|
-
if (state.activePlugins.includes(id)) {
|
|
250
|
-
throw new common_1.BadRequestException(`Deactivate plugin "${id}" before uninstalling`);
|
|
251
|
-
}
|
|
252
|
-
const targetDir = path.join(this.runtimeDir(), id);
|
|
253
|
-
if (fs.existsSync(targetDir)) {
|
|
254
|
-
this.removeDir(targetDir);
|
|
255
|
-
}
|
|
256
|
-
const installedPlugins = state.installedPlugins.filter((pid) => pid !== id);
|
|
257
|
-
const entries = Object.assign({}, state.entries);
|
|
258
|
-
delete entries[id];
|
|
259
|
-
return this.savePluginState({ installedPlugins, entries });
|
|
260
|
-
}
|
|
261
|
-
async updatePluginConfig(id, config) {
|
|
262
|
-
var _a, _b, _c;
|
|
263
|
-
if (!(0, extension_2.isValidPluginId)(id)) {
|
|
264
|
-
throw new common_1.BadRequestException(`Invalid plugin id "${id}"`);
|
|
265
|
-
}
|
|
266
|
-
const state = await this.getPluginState();
|
|
267
|
-
if (!state.installedPlugins.includes(id)) {
|
|
268
|
-
throw new common_1.NotFoundException(`Plugin "${id}" is not installed`);
|
|
269
|
-
}
|
|
270
|
-
const manifest = this.readRuntimeManifest(id);
|
|
271
|
-
const validation = (0, extension_2.validatePluginSettings)((_a = manifest === null || manifest === void 0 ? void 0 : manifest.settings) === null || _a === void 0 ? void 0 : _a.schema, config);
|
|
272
|
-
if (!validation.valid) {
|
|
273
|
-
throw new common_1.BadRequestException((_b = validation.message) !== null && _b !== void 0 ? _b : 'Invalid plugin configuration');
|
|
274
|
-
}
|
|
275
|
-
const entries = Object.assign({}, state.entries);
|
|
276
|
-
const current = (_c = entries[id]) !== null && _c !== void 0 ? _c : { version: '0.0.0', source: 'local' };
|
|
277
|
-
entries[id] = Object.assign(Object.assign({}, current), { config });
|
|
278
|
-
return this.savePluginState({ entries });
|
|
279
|
-
}
|
|
280
|
-
async createPluginContext(pluginId, manifest) {
|
|
281
|
-
var _a;
|
|
282
|
-
const state = await this.getPluginState();
|
|
283
|
-
const entry = state.entries[pluginId];
|
|
284
|
-
return {
|
|
285
|
-
id: pluginId,
|
|
286
|
-
version: manifest.version,
|
|
287
|
-
config: (_a = entry === null || entry === void 0 ? void 0 : entry.config) !== null && _a !== void 0 ? _a : {},
|
|
288
|
-
logger: {
|
|
289
|
-
log: (message) => this.logger.log(`[${pluginId}] ${message}`),
|
|
290
|
-
warn: (message) => this.logger.warn(`[${pluginId}] ${message}`),
|
|
291
|
-
error: (message) => this.logger.error(`[${pluginId}] ${message}`),
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
async recordLoadError(pluginId, message) {
|
|
296
|
-
var _a;
|
|
297
|
-
const state = await this.getPluginState();
|
|
298
|
-
const entries = Object.assign({}, state.entries);
|
|
299
|
-
const current = (_a = entries[pluginId]) !== null && _a !== void 0 ? _a : { version: '0.0.0', source: 'local' };
|
|
300
|
-
entries[pluginId] = Object.assign(Object.assign({}, current), { loadError: message });
|
|
301
|
-
await this.savePluginState({ entries });
|
|
302
|
-
}
|
|
303
|
-
async clearLoadError(pluginId) {
|
|
304
|
-
const state = await this.getPluginState();
|
|
305
|
-
const entry = state.entries[pluginId];
|
|
306
|
-
if (!(entry === null || entry === void 0 ? void 0 : entry.loadError))
|
|
307
|
-
return;
|
|
308
|
-
const entries = Object.assign({}, state.entries);
|
|
309
|
-
entries[pluginId] = Object.assign(Object.assign({}, entry), { loadError: undefined });
|
|
310
|
-
await this.savePluginState({ entries });
|
|
311
|
-
}
|
|
312
|
-
validatePluginDependencies(id, manifest, state) {
|
|
313
|
-
var _a;
|
|
314
|
-
const required = (_a = manifest.requiresPlugins) !== null && _a !== void 0 ? _a : [];
|
|
315
|
-
for (const dep of required) {
|
|
316
|
-
if (!(0, extension_2.isValidPluginId)(dep)) {
|
|
317
|
-
throw new common_1.BadRequestException(`Plugin "${id}" declares invalid dependency "${dep}"`);
|
|
318
|
-
}
|
|
319
|
-
if (!state.activePlugins.includes(dep) && dep !== id) {
|
|
320
|
-
throw new common_1.BadRequestException(`Plugin "${id}" requires active plugin "${dep}"`);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
async ensurePluginInstalled(id) {
|
|
325
|
-
var _a, _b;
|
|
326
|
-
const runtimePath = path.join(this.runtimeDir(), id);
|
|
327
|
-
if (!fs.existsSync(runtimePath)) {
|
|
328
|
-
await this.installPlugin(id);
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
const state = await this.getPluginState();
|
|
332
|
-
if (state.installedPlugins.includes(id))
|
|
333
|
-
return;
|
|
334
|
-
const manifest = (_a = this.readRuntimeManifest(id)) !== null && _a !== void 0 ? _a : this.readManifest(path.join(this.templatesDir(), id));
|
|
335
|
-
if (!manifest) {
|
|
336
|
-
throw new common_1.BadRequestException(`Plugin "${id}" has invalid plugin.json`);
|
|
337
|
-
}
|
|
338
|
-
const installedPlugins = [...state.installedPlugins, id];
|
|
339
|
-
const entries = Object.assign({}, state.entries);
|
|
340
|
-
entries[id] = Object.assign({ version: manifest.version, source: 'local' }, ((_b = entries[id]) !== null && _b !== void 0 ? _b : {}));
|
|
341
|
-
await this.savePluginState({ installedPlugins, entries });
|
|
342
|
-
}
|
|
343
|
-
materializeRuntimePlugin(templatePath, targetDir) {
|
|
344
|
-
const forceCopy = process.env.REACTPRESS_PLUGIN_RUNTIME_COPY === '1' || process.env.NODE_ENV === 'production';
|
|
345
|
-
if (!forceCopy) {
|
|
346
|
-
const linkTarget = path.relative(path.dirname(targetDir), templatePath);
|
|
347
|
-
fs.symlinkSync(linkTarget, targetDir, 'dir');
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
this.copyDir(templatePath, targetDir);
|
|
351
|
-
}
|
|
352
|
-
copyDir(src, dest, relFromRoot = '') {
|
|
353
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
354
|
-
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
355
|
-
if (!relFromRoot && PluginService_1.COPY_SKIP_NAMES.has(entry.name))
|
|
356
|
-
continue;
|
|
357
|
-
const relPath = relFromRoot ? path.posix.join(relFromRoot, entry.name) : entry.name;
|
|
358
|
-
if (PluginService_1.COPY_SKIP_REL_PATHS.has(relPath))
|
|
359
|
-
continue;
|
|
360
|
-
const from = path.join(src, entry.name);
|
|
361
|
-
const to = path.join(dest, entry.name);
|
|
362
|
-
if (entry.isSymbolicLink()) {
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
else if (entry.isDirectory()) {
|
|
366
|
-
this.copyDir(from, to, relPath);
|
|
367
|
-
}
|
|
368
|
-
else if (entry.isFile()) {
|
|
369
|
-
fs.copyFileSync(from, to);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
removeDir(dir) {
|
|
374
|
-
if (!fs.existsSync(dir))
|
|
375
|
-
return;
|
|
376
|
-
const stat = fs.lstatSync(dir);
|
|
377
|
-
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
378
|
-
fs.unlinkSync(dir);
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
382
|
-
const full = path.join(dir, entry.name);
|
|
383
|
-
if (entry.isSymbolicLink()) {
|
|
384
|
-
fs.unlinkSync(full);
|
|
385
|
-
}
|
|
386
|
-
else if (entry.isDirectory()) {
|
|
387
|
-
this.removeDir(full);
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
fs.unlinkSync(full);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
fs.rmdirSync(dir);
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
PluginService.COPY_SKIP_NAMES = new Set([
|
|
397
|
-
'node_modules',
|
|
398
|
-
'.git',
|
|
399
|
-
'.turbo',
|
|
400
|
-
'coverage',
|
|
401
|
-
'.reactpress',
|
|
402
|
-
'.cache',
|
|
403
|
-
'package-lock.json',
|
|
404
|
-
'tsconfig.json',
|
|
405
|
-
]);
|
|
406
|
-
PluginService.COPY_SKIP_REL_PATHS = new Set(['src/server', 'src/admin']);
|
|
407
|
-
PluginService = PluginService_1 = __decorate([
|
|
408
|
-
(0, common_1.Injectable)(),
|
|
409
|
-
__param(0, (0, typeorm_1.InjectRepository)(setting_entity_1.Setting)),
|
|
410
|
-
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
411
|
-
setting_service_1.SettingService])
|
|
412
|
-
], PluginService);
|
|
413
|
-
exports.PluginService = PluginService;
|
|
414
|
-
//# sourceMappingURL=plugin.service.js.map
|