@fecommunity/reactpress-server 4.0.0-beta.9 → 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 +327 -45
- package/bin/reactpress-server.js +6 -14
- package/dist/app.module.js +27 -15
- 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 -1
- package/dist/main.js +23 -45
- 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 -5
- package/dist/modules/file/file.service.js +24 -70
- 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 +12 -16
- 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 +28 -21
- 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 -60
- 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 -50
- 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 -52
- package/dist/modules/extension/plugin.service.js +0 -391
- 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 -46
- 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/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 -385
- 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 -8
- package/dist/utils/theme-placeholder-cover.js +0 -94
- package/dist/utils/theme-placeholder-cover.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,66 +0,0 @@
|
|
|
1
|
-
export declare const IMAGE_OPTIMIZER_PLUGIN_ID = "image-optimizer";
|
|
2
|
-
export interface ImageOptimizeReport {
|
|
3
|
-
total: number;
|
|
4
|
-
alreadyOptimized: number;
|
|
5
|
-
needsOptimization: number;
|
|
6
|
-
skipped: {
|
|
7
|
-
nonImage: number;
|
|
8
|
-
svg: number;
|
|
9
|
-
gif: number;
|
|
10
|
-
missing: number;
|
|
11
|
-
};
|
|
12
|
-
storageBytes: {
|
|
13
|
-
current: number;
|
|
14
|
-
estimatedAfter: number;
|
|
15
|
-
estimatedSaved: number;
|
|
16
|
-
};
|
|
17
|
-
contentRefs: {
|
|
18
|
-
articles: number;
|
|
19
|
-
pages: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export interface OptimizeRunOptions {
|
|
23
|
-
dryRun?: boolean;
|
|
24
|
-
batchSize?: number;
|
|
25
|
-
skipGif?: boolean;
|
|
26
|
-
rewriteContent?: boolean;
|
|
27
|
-
cleanupOriginals?: boolean;
|
|
28
|
-
limit?: number;
|
|
29
|
-
}
|
|
30
|
-
export type OptimizeJobStatus = 'pending' | 'running' | 'completed' | 'failed';
|
|
31
|
-
export interface OptimizeJobItemResult {
|
|
32
|
-
fileId: string;
|
|
33
|
-
originalname: string;
|
|
34
|
-
status: 'success' | 'skipped' | 'failed';
|
|
35
|
-
oldUrl?: string;
|
|
36
|
-
newUrl?: string;
|
|
37
|
-
savedBytes?: number;
|
|
38
|
-
error?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface OptimizeJob {
|
|
41
|
-
id: string;
|
|
42
|
-
status: OptimizeJobStatus;
|
|
43
|
-
dryRun: boolean;
|
|
44
|
-
total: number;
|
|
45
|
-
processed: number;
|
|
46
|
-
succeeded: number;
|
|
47
|
-
failed: number;
|
|
48
|
-
skipped: number;
|
|
49
|
-
savedBytes: number;
|
|
50
|
-
urlMap: Record<string, string>;
|
|
51
|
-
items: OptimizeJobItemResult[];
|
|
52
|
-
rewriteContent: boolean;
|
|
53
|
-
contentRewrite?: {
|
|
54
|
-
articles: number;
|
|
55
|
-
pages: number;
|
|
56
|
-
revisions: number;
|
|
57
|
-
};
|
|
58
|
-
error?: string;
|
|
59
|
-
startedAt: string;
|
|
60
|
-
finishedAt?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface RewriteContentResult {
|
|
63
|
-
articles: number;
|
|
64
|
-
pages: number;
|
|
65
|
-
revisions: number;
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-optimization.types.js","sourceRoot":"","sources":["../../../src/modules/file/file-optimization.types.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
-
import { PluginService } from '../extension/plugin.service';
|
|
3
|
-
export declare class ImageOptimizerPluginGuard implements CanActivate {
|
|
4
|
-
private readonly pluginService;
|
|
5
|
-
constructor(pluginService: PluginService);
|
|
6
|
-
canActivate(_context: ExecutionContext): Promise<boolean>;
|
|
7
|
-
}
|
|
@@ -1,33 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ImageOptimizerPluginGuard = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const plugin_service_1 = require("../extension/plugin.service");
|
|
15
|
-
const file_optimization_types_1 = require("./file-optimization.types");
|
|
16
|
-
let ImageOptimizerPluginGuard = class ImageOptimizerPluginGuard {
|
|
17
|
-
constructor(pluginService) {
|
|
18
|
-
this.pluginService = pluginService;
|
|
19
|
-
}
|
|
20
|
-
async canActivate(_context) {
|
|
21
|
-
const state = await this.pluginService.getPluginState();
|
|
22
|
-
if (!state.activePlugins.includes(file_optimization_types_1.IMAGE_OPTIMIZER_PLUGIN_ID)) {
|
|
23
|
-
throw new common_1.ForbiddenException('Image optimizer plugin is not active');
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
ImageOptimizerPluginGuard = __decorate([
|
|
29
|
-
(0, common_1.Injectable)(),
|
|
30
|
-
__metadata("design:paramtypes", [plugin_service_1.PluginService])
|
|
31
|
-
], ImageOptimizerPluginGuard);
|
|
32
|
-
exports.ImageOptimizerPluginGuard = ImageOptimizerPluginGuard;
|
|
33
|
-
//# sourceMappingURL=image-optimizer-plugin.guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-optimizer-plugin.guard.js","sourceRoot":"","sources":["../../../src/modules/file/image-optimizer-plugin.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+F;AAE/F,gEAA4D;AAC5D,uEAAsE;AAG/D,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D,KAAK,CAAC,WAAW,CAAC,QAA0B;QAC1C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,mDAAyB,CAAC,EAAE;YAC5D,MAAM,IAAI,2BAAkB,CAAC,sCAAsC,CAAC,CAAC;SACtE;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAVY,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEiC,8BAAa;GAD9C,yBAAyB,CAUrC;AAVY,8DAAyB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Connection } from 'typeorm';
|
|
2
|
-
export declare class HealthController {
|
|
3
|
-
private readonly connection;
|
|
4
|
-
constructor(connection: Connection);
|
|
5
|
-
check(): Promise<{
|
|
6
|
-
status: string;
|
|
7
|
-
version: string;
|
|
8
|
-
database: "up" | "down";
|
|
9
|
-
timestamp: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
@@ -1,55 +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.HealthController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
-
const typeorm_2 = require("typeorm");
|
|
20
|
-
let HealthController = class HealthController {
|
|
21
|
-
constructor(connection) {
|
|
22
|
-
this.connection = connection;
|
|
23
|
-
}
|
|
24
|
-
async check() {
|
|
25
|
-
let database = 'down';
|
|
26
|
-
try {
|
|
27
|
-
await this.connection.query('SELECT 1');
|
|
28
|
-
database = 'up';
|
|
29
|
-
}
|
|
30
|
-
catch (_a) {
|
|
31
|
-
database = 'down';
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
status: database === 'up' ? 'ok' : 'degraded',
|
|
35
|
-
version: '3.0.0',
|
|
36
|
-
database,
|
|
37
|
-
timestamp: new Date().toISOString(),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, common_1.Get)(),
|
|
43
|
-
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
44
|
-
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", []),
|
|
46
|
-
__metadata("design:returntype", Promise)
|
|
47
|
-
], HealthController.prototype, "check", null);
|
|
48
|
-
HealthController = __decorate([
|
|
49
|
-
(0, swagger_1.ApiTags)('Health'),
|
|
50
|
-
(0, common_1.Controller)('health'),
|
|
51
|
-
__param(0, (0, typeorm_1.InjectConnection)()),
|
|
52
|
-
__metadata("design:paramtypes", [typeorm_2.Connection])
|
|
53
|
-
], HealthController);
|
|
54
|
-
exports.HealthController = HealthController;
|
|
55
|
-
//# sourceMappingURL=health.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.controller.js","sourceRoot":"","sources":["../../../src/modules/health/health.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,6CAA0C;AAC1C,6CAAmD;AACnD,qCAAqC;AAI9B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAAiD,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAIrE,AAAN,KAAK,CAAC,KAAK;QACT,IAAI,QAAQ,GAAkB,MAAM,CAAC;QACrC,IAAI;YACF,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACxC,QAAQ,GAAG,IAAI,CAAC;SACjB;QAAC,WAAM;YACN,QAAQ,GAAG,MAAM,CAAC;SACnB;QAED,OAAO;YACL,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU;YAC7C,OAAO,EAAE,OAAO;YAChB,QAAQ;YACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC;IACJ,CAAC;CACF,CAAA;AAhBO;IAFL,IAAA,YAAG,GAAE;IACL,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;;;;6CAgBvB;AApBU,gBAAgB;IAF5B,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,mBAAU,EAAC,QAAQ,CAAC;IAEN,WAAA,IAAA,0BAAgB,GAAE,CAAA;qCAA8B,oBAAU;GAD5D,gBAAgB,CAqB5B;AArBY,4CAAgB"}
|
|
@@ -1,20 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.HealthModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const health_controller_1 = require("./health.controller");
|
|
12
|
-
let HealthModule = class HealthModule {
|
|
13
|
-
};
|
|
14
|
-
HealthModule = __decorate([
|
|
15
|
-
(0, common_1.Module)({
|
|
16
|
-
controllers: [health_controller_1.HealthController],
|
|
17
|
-
})
|
|
18
|
-
], HealthModule);
|
|
19
|
-
exports.HealthModule = HealthModule;
|
|
20
|
-
//# sourceMappingURL=health.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../src/modules/health/health.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,2DAAuD;AAKhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IAHxB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,oCAAgB,CAAC;KAChC,CAAC;GACW,YAAY,CAAG;AAAf,oCAAY"}
|
|
@@ -1,22 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.HookModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const hook_service_1 = require("./hook.service");
|
|
12
|
-
let HookModule = class HookModule {
|
|
13
|
-
};
|
|
14
|
-
HookModule = __decorate([
|
|
15
|
-
(0, common_1.Global)(),
|
|
16
|
-
(0, common_1.Module)({
|
|
17
|
-
providers: [hook_service_1.HookService],
|
|
18
|
-
exports: [hook_service_1.HookService],
|
|
19
|
-
})
|
|
20
|
-
], HookModule);
|
|
21
|
-
exports.HookModule = HookModule;
|
|
22
|
-
//# sourceMappingURL=hook.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hook.module.js","sourceRoot":"","sources":["../../../src/modules/hook/hook.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAEhD,iDAA6C;AAOtC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,UAAU;IALtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG;AAAb,gCAAU"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ActionCallback, FilterCallback, HookContext, HookRegistrationOptions } from '@fecommunity/reactpress-toolkit/plugin/server';
|
|
2
|
-
interface LoadedPluginModule {
|
|
3
|
-
pluginId: string;
|
|
4
|
-
module: {
|
|
5
|
-
register?: (hooks: HookService, ctx: unknown) => void | Promise<void>;
|
|
6
|
-
deactivate?: () => void | Promise<void>;
|
|
7
|
-
default?: {
|
|
8
|
-
register?: (hooks: HookService, ctx: unknown) => void | Promise<void>;
|
|
9
|
-
deactivate?: () => void | Promise<void>;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare class HookService {
|
|
14
|
-
private readonly logger;
|
|
15
|
-
private readonly filters;
|
|
16
|
-
private readonly actions;
|
|
17
|
-
private readonly loadedModules;
|
|
18
|
-
applyFilters<T>(name: string, value: T, ctx?: HookContext): Promise<T>;
|
|
19
|
-
doAction(name: string, payload?: unknown, ctx?: HookContext): Promise<void>;
|
|
20
|
-
addFilter<T>(name: string, callback: FilterCallback<T>, options?: HookRegistrationOptions): () => void;
|
|
21
|
-
addAction(name: string, callback: ActionCallback, options?: HookRegistrationOptions): () => void;
|
|
22
|
-
removePluginHooks(pluginId: string): void;
|
|
23
|
-
registerLoadedModule(pluginId: string, module: LoadedPluginModule['module']): void;
|
|
24
|
-
deactivatePluginModule(pluginId: string): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,105 +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 HookService_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HookService = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const server_1 = require("../../../../toolkit/dist/plugin/server");
|
|
13
|
-
let HookService = HookService_1 = class HookService {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.logger = new common_1.Logger(HookService_1.name);
|
|
16
|
-
this.filters = new Map();
|
|
17
|
-
this.actions = new Map();
|
|
18
|
-
this.loadedModules = new Map();
|
|
19
|
-
}
|
|
20
|
-
async applyFilters(name, value, ctx) {
|
|
21
|
-
var _a;
|
|
22
|
-
const list = [...((_a = this.filters.get(name)) !== null && _a !== void 0 ? _a : [])].sort((a, b) => a.priority - b.priority);
|
|
23
|
-
let current = value;
|
|
24
|
-
for (const reg of list) {
|
|
25
|
-
try {
|
|
26
|
-
current = (await reg.callback(current, Object.assign(Object.assign({}, ctx), { pluginId: reg.pluginId })));
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
this.logger.warn(`Filter "${name}" failed${reg.pluginId ? ` (plugin: ${reg.pluginId})` : ''}: ${err instanceof Error ? err.message : String(err)}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return current;
|
|
33
|
-
}
|
|
34
|
-
async doAction(name, payload, ctx) {
|
|
35
|
-
var _a;
|
|
36
|
-
const list = [...((_a = this.actions.get(name)) !== null && _a !== void 0 ? _a : [])].sort((a, b) => a.priority - b.priority);
|
|
37
|
-
for (const reg of list) {
|
|
38
|
-
try {
|
|
39
|
-
await reg.callback(payload, Object.assign(Object.assign({}, ctx), { pluginId: reg.pluginId }));
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
this.logger.warn(`Action "${name}" failed${reg.pluginId ? ` (plugin: ${reg.pluginId})` : ''}: ${err instanceof Error ? err.message : String(err)}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
addFilter(name, callback, options) {
|
|
47
|
-
var _a, _b;
|
|
48
|
-
const reg = {
|
|
49
|
-
callback: callback,
|
|
50
|
-
priority: (_a = options === null || options === void 0 ? void 0 : options.priority) !== null && _a !== void 0 ? _a : 10,
|
|
51
|
-
pluginId: options === null || options === void 0 ? void 0 : options.pluginId,
|
|
52
|
-
};
|
|
53
|
-
const list = (_b = this.filters.get(name)) !== null && _b !== void 0 ? _b : [];
|
|
54
|
-
list.push(reg);
|
|
55
|
-
this.filters.set(name, list);
|
|
56
|
-
return () => {
|
|
57
|
-
var _a;
|
|
58
|
-
const current = (_a = this.filters.get(name)) !== null && _a !== void 0 ? _a : [];
|
|
59
|
-
this.filters.set(name, current.filter((item) => item !== reg));
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
addAction(name, callback, options) {
|
|
63
|
-
var _a, _b;
|
|
64
|
-
const reg = {
|
|
65
|
-
callback,
|
|
66
|
-
priority: (_a = options === null || options === void 0 ? void 0 : options.priority) !== null && _a !== void 0 ? _a : 10,
|
|
67
|
-
pluginId: options === null || options === void 0 ? void 0 : options.pluginId,
|
|
68
|
-
};
|
|
69
|
-
const list = (_b = this.actions.get(name)) !== null && _b !== void 0 ? _b : [];
|
|
70
|
-
list.push(reg);
|
|
71
|
-
this.actions.set(name, list);
|
|
72
|
-
return () => {
|
|
73
|
-
var _a;
|
|
74
|
-
const current = (_a = this.actions.get(name)) !== null && _a !== void 0 ? _a : [];
|
|
75
|
-
this.actions.set(name, current.filter((item) => item !== reg));
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
removePluginHooks(pluginId) {
|
|
79
|
-
for (const [name, list] of this.filters.entries()) {
|
|
80
|
-
this.filters.set(name, list.filter((reg) => reg.pluginId !== pluginId));
|
|
81
|
-
}
|
|
82
|
-
for (const [name, list] of this.actions.entries()) {
|
|
83
|
-
this.actions.set(name, list.filter((reg) => reg.pluginId !== pluginId));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
registerLoadedModule(pluginId, module) {
|
|
87
|
-
this.loadedModules.set(pluginId, { pluginId, module });
|
|
88
|
-
}
|
|
89
|
-
async deactivatePluginModule(pluginId) {
|
|
90
|
-
var _a;
|
|
91
|
-
const loaded = this.loadedModules.get(pluginId);
|
|
92
|
-
if (!loaded)
|
|
93
|
-
return;
|
|
94
|
-
const mod = (_a = loaded.module.default) !== null && _a !== void 0 ? _a : loaded.module;
|
|
95
|
-
if (typeof mod.deactivate === 'function') {
|
|
96
|
-
await mod.deactivate();
|
|
97
|
-
}
|
|
98
|
-
this.loadedModules.delete(pluginId);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
HookService = HookService_1 = __decorate([
|
|
102
|
-
(0, common_1.Injectable)()
|
|
103
|
-
], HookService);
|
|
104
|
-
exports.HookService = HookService;
|
|
105
|
-
//# sourceMappingURL=hook.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hook.service.js","sourceRoot":"","sources":["../../../src/modules/hook/hook.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WebhookService } from './webhook.service';
|
|
2
|
-
export declare class WebhookController {
|
|
3
|
-
private readonly webhookService;
|
|
4
|
-
constructor(webhookService: WebhookService);
|
|
5
|
-
list(): Promise<import("./webhook.entity").Webhook[]>;
|
|
6
|
-
create(body: {
|
|
7
|
-
url: string;
|
|
8
|
-
events: string;
|
|
9
|
-
secret?: string;
|
|
10
|
-
}): Promise<import("./webhook.entity").Webhook>;
|
|
11
|
-
remove(id: string): Promise<import("./webhook.entity").Webhook>;
|
|
12
|
-
}
|
|
@@ -1,63 +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.WebhookController = 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 webhook_service_1 = require("./webhook.service");
|
|
21
|
-
let WebhookController = class WebhookController {
|
|
22
|
-
constructor(webhookService) {
|
|
23
|
-
this.webhookService = webhookService;
|
|
24
|
-
}
|
|
25
|
-
list() {
|
|
26
|
-
return this.webhookService.findAll();
|
|
27
|
-
}
|
|
28
|
-
create(body) {
|
|
29
|
-
return this.webhookService.create(body);
|
|
30
|
-
}
|
|
31
|
-
remove(id) {
|
|
32
|
-
return this.webhookService.remove(id);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, common_1.Get)(),
|
|
37
|
-
__metadata("design:type", Function),
|
|
38
|
-
__metadata("design:paramtypes", []),
|
|
39
|
-
__metadata("design:returntype", void 0)
|
|
40
|
-
], WebhookController.prototype, "list", null);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, common_1.Post)(),
|
|
43
|
-
__param(0, (0, common_1.Body)()),
|
|
44
|
-
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", [Object]),
|
|
46
|
-
__metadata("design:returntype", void 0)
|
|
47
|
-
], WebhookController.prototype, "create", null);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, common_1.Delete)(':id'),
|
|
50
|
-
__param(0, (0, common_1.Param)('id')),
|
|
51
|
-
__metadata("design:type", Function),
|
|
52
|
-
__metadata("design:paramtypes", [String]),
|
|
53
|
-
__metadata("design:returntype", void 0)
|
|
54
|
-
], WebhookController.prototype, "remove", null);
|
|
55
|
-
WebhookController = __decorate([
|
|
56
|
-
(0, swagger_1.ApiTags)('Webhook'),
|
|
57
|
-
(0, common_1.Controller)('webhook'),
|
|
58
|
-
(0, common_1.UseGuards)(roles_guard_1.RolesGuard, jwt_auth_guard_1.JwtAuthGuard),
|
|
59
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
60
|
-
__metadata("design:paramtypes", [webhook_service_1.WebhookService])
|
|
61
|
-
], WebhookController);
|
|
62
|
-
exports.WebhookController = WebhookController;
|
|
63
|
-
//# sourceMappingURL=webhook.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.controller.js","sourceRoot":"","sources":["../../../src/modules/webhook/webhook.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuF;AACvF,6CAA0C;AAE1C,2DAAsD;AACtD,qDAAwD;AACxD,uDAAmD;AAM5C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAG/D,IAAI;QACF,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;IAGD,MAAM,CAAS,IAAsD;QACnE,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAGD,MAAM,CAAc,EAAU;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAdC;IAAC,IAAA,YAAG,GAAE;;;;6CAGL;AAED;IAAC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAEb;AAED;IAAC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;+CAElB;AAhBU,iBAAiB;IAJ7B,IAAA,iBAAO,EAAC,SAAS,CAAC;IAClB,IAAA,mBAAU,EAAC,SAAS,CAAC;IACrB,IAAA,kBAAS,EAAC,wBAAU,EAAE,6BAAY,CAAC;IACnC,IAAA,mBAAK,EAAC,OAAO,CAAC;qCAEgC,gCAAc;GADhD,iBAAiB,CAiB7B;AAjBY,8CAAiB"}
|
|
@@ -1,54 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Webhook = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
|
-
let Webhook = class Webhook {
|
|
16
|
-
};
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, swagger_1.ApiProperty)(),
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], Webhook.prototype, "id", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, swagger_1.ApiProperty)(),
|
|
24
|
-
(0, typeorm_1.Column)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Webhook.prototype, "url", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, swagger_1.ApiProperty)(),
|
|
29
|
-
(0, typeorm_1.Column)({ select: false }),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], Webhook.prototype, "secret", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, swagger_1.ApiProperty)({ description: 'Comma-separated: article.published, comment.created' }),
|
|
34
|
-
(0, typeorm_1.Column)(),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], Webhook.prototype, "events", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, swagger_1.ApiProperty)(),
|
|
39
|
-
(0, typeorm_1.Column)({ default: true }),
|
|
40
|
-
__metadata("design:type", Boolean)
|
|
41
|
-
], Webhook.prototype, "enabled", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.CreateDateColumn)({ name: 'create_at' }),
|
|
44
|
-
__metadata("design:type", Date)
|
|
45
|
-
], Webhook.prototype, "createAt", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.UpdateDateColumn)({ name: 'update_at' }),
|
|
48
|
-
__metadata("design:type", Date)
|
|
49
|
-
], Webhook.prototype, "updateAt", void 0);
|
|
50
|
-
Webhook = __decorate([
|
|
51
|
-
(0, typeorm_1.Entity)('webhooks')
|
|
52
|
-
], Webhook);
|
|
53
|
-
exports.Webhook = Webhook;
|
|
54
|
-
//# sourceMappingURL=webhook.entity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.entity.js","sourceRoot":"","sources":["../../../src/modules/webhook/webhook.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAAqG;AAG9F,IAAM,OAAO,GAAb,MAAM,OAAO;CA0BnB,CAAA;AAzBC;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACpB;AAEX;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;oCACG;AAEZ;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;uCACX;AAEf;IAAC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qDAAqD,EAAE,CAAC;IACnF,IAAA,gBAAM,GAAE;;uCACM;AAEf;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wCACT;AAEjB;IAAC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC9B,IAAI;yCAAC;AAEf;IAAC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC9B,IAAI;yCAAC;AAzBJ,OAAO;IADnB,IAAA,gBAAM,EAAC,UAAU,CAAC;GACN,OAAO,CA0BnB;AA1BY,0BAAO"}
|
|
@@ -1,27 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.WebhookModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
-
const auth_module_1 = require("../auth/auth.module");
|
|
13
|
-
const webhook_controller_1 = require("./webhook.controller");
|
|
14
|
-
const webhook_entity_1 = require("./webhook.entity");
|
|
15
|
-
const webhook_service_1 = require("./webhook.service");
|
|
16
|
-
let WebhookModule = class WebhookModule {
|
|
17
|
-
};
|
|
18
|
-
WebhookModule = __decorate([
|
|
19
|
-
(0, common_1.Module)({
|
|
20
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([webhook_entity_1.Webhook]), auth_module_1.AuthModule],
|
|
21
|
-
controllers: [webhook_controller_1.WebhookController],
|
|
22
|
-
providers: [webhook_service_1.WebhookService],
|
|
23
|
-
exports: [webhook_service_1.WebhookService],
|
|
24
|
-
})
|
|
25
|
-
], WebhookModule);
|
|
26
|
-
exports.WebhookModule = WebhookModule;
|
|
27
|
-
//# sourceMappingURL=webhook.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.module.js","sourceRoot":"","sources":["../../../src/modules/webhook/webhook.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,qDAAiD;AACjD,6DAAyD;AACzD,qDAA2C;AAC3C,uDAAmD;AAQ5C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IANzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,EAAE,wBAAU,CAAC;QAC1D,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
|
-
import { Webhook } from './webhook.entity';
|
|
3
|
-
export type WebhookEvent = 'article.published' | 'comment.created';
|
|
4
|
-
export declare class WebhookService {
|
|
5
|
-
private readonly webhookRepository;
|
|
6
|
-
constructor(webhookRepository: Repository<Webhook>);
|
|
7
|
-
create(data: Partial<Webhook> & {
|
|
8
|
-
secret?: string;
|
|
9
|
-
}): Promise<Webhook>;
|
|
10
|
-
findAll(): Promise<Webhook[]>;
|
|
11
|
-
remove(id: string): Promise<Webhook>;
|
|
12
|
-
private signPayload;
|
|
13
|
-
private deliverOnce;
|
|
14
|
-
private deliverWithRetry;
|
|
15
|
-
dispatch(event: WebhookEvent, payload: Record<string, unknown>): Promise<void>;
|
|
16
|
-
}
|