@fecommunity/reactpress-server 3.0.4 → 4.0.0-beta.0
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/dist/app.module.js +9 -46
- package/dist/app.module.js.map +1 -1
- package/dist/common/api-messages.d.ts +9 -0
- package/dist/common/api-messages.js +9 -0
- package/dist/common/api-messages.js.map +1 -1
- package/dist/database/typeorm-options.d.ts +3 -0
- package/dist/database/typeorm-options.js +60 -0
- package/dist/database/typeorm-options.js.map +1 -0
- package/dist/filters/http-exception.filter.js +1 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/generate-swagger.js +11 -11
- package/dist/generate-swagger.js.map +1 -1
- package/dist/interceptors/transform.interceptor.d.ts +2 -6
- package/dist/interceptors/transform.interceptor.js +10 -5
- package/dist/interceptors/transform.interceptor.js.map +1 -1
- package/dist/logger/index.js +5 -4
- package/dist/logger/index.js.map +1 -1
- package/dist/main.js +44 -23
- package/dist/main.js.map +1 -1
- package/dist/modules/api-key/api-key.controller.js +9 -9
- package/dist/modules/api-key/api-key.controller.js.map +1 -1
- package/dist/modules/api-key/api-key.entity.js +16 -16
- package/dist/modules/api-key/api-key.entity.js.map +1 -1
- package/dist/modules/api-key/api-key.guard.js +3 -4
- package/dist/modules/api-key/api-key.guard.js.map +1 -1
- package/dist/modules/api-key/api-key.module.js +1 -1
- package/dist/modules/api-key/api-key.module.js.map +1 -1
- package/dist/modules/api-key/api-key.service.js +3 -3
- package/dist/modules/api-key/api-key.service.js.map +1 -1
- package/dist/modules/article/article-revision.entity.js +9 -9
- package/dist/modules/article/article-revision.entity.js.map +1 -1
- package/dist/modules/article/article-slug.util.d.ts +2 -0
- package/dist/modules/article/article-slug.util.js +19 -0
- package/dist/modules/article/article-slug.util.js.map +1 -0
- package/dist/modules/article/article.controller.d.ts +1 -1
- package/dist/modules/article/article.controller.js +71 -60
- package/dist/modules/article/article.controller.js.map +1 -1
- package/dist/modules/article/article.entity.d.ts +3 -0
- package/dist/modules/article/article.entity.js +58 -43
- package/dist/modules/article/article.entity.js.map +1 -1
- package/dist/modules/article/article.module.js +7 -4
- package/dist/modules/article/article.module.js.map +1 -1
- package/dist/modules/article/article.service.d.ts +9 -3
- package/dist/modules/article/article.service.js +98 -30
- package/dist/modules/article/article.service.js.map +1 -1
- package/dist/modules/article/scheduled-publish.service.js +3 -3
- package/dist/modules/article/scheduled-publish.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 +5 -5
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/jwt-auth.guard.js +3 -3
- package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
- package/dist/modules/auth/jwt.strategy.js +3 -3
- 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/bootstrap/bootstrap.constants.d.ts +20 -0
- package/dist/modules/bootstrap/bootstrap.constants.js +171 -0
- package/dist/modules/bootstrap/bootstrap.constants.js.map +1 -0
- package/dist/modules/bootstrap/bootstrap.service.d.ts +22 -0
- package/dist/modules/bootstrap/bootstrap.service.js +183 -0
- package/dist/modules/bootstrap/bootstrap.service.js.map +1 -0
- package/dist/modules/bootstrap/install-locale.d.ts +2 -0
- package/dist/modules/bootstrap/install-locale.js +11 -0
- package/dist/modules/bootstrap/install-locale.js.map +1 -0
- package/dist/modules/category/category.controller.js +21 -20
- 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 +3 -3
- package/dist/modules/category/category.service.js.map +1 -1
- package/dist/modules/comment/comment.controller.js +24 -20
- 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 -2
- package/dist/modules/comment/comment.module.js.map +1 -1
- package/dist/modules/comment/comment.service.d.ts +3 -1
- package/dist/modules/comment/comment.service.js +31 -14
- 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/extension/extension.module.d.ts +9 -0
- package/dist/modules/extension/extension.module.js +50 -0
- package/dist/modules/extension/extension.module.js.map +1 -0
- package/dist/modules/extension/plugin-loader.service.d.ts +12 -0
- package/dist/modules/extension/plugin-loader.service.js +96 -0
- package/dist/modules/extension/plugin-loader.service.js.map +1 -0
- package/dist/modules/extension/plugin-registry.bridge.d.ts +3 -0
- package/dist/modules/extension/plugin-registry.bridge.js +44 -0
- package/dist/modules/extension/plugin-registry.bridge.js.map +1 -0
- package/dist/modules/extension/plugin.controller.d.ts +22 -0
- package/dist/modules/extension/plugin.controller.js +155 -0
- package/dist/modules/extension/plugin.controller.js.map +1 -0
- package/dist/modules/extension/plugin.service.d.ts +52 -0
- package/dist/modules/extension/plugin.service.js +391 -0
- package/dist/modules/extension/plugin.service.js.map +1 -0
- package/dist/modules/extension/preview-draft.store.d.ts +13 -0
- package/dist/modules/extension/preview-draft.store.js +41 -0
- package/dist/modules/extension/preview-draft.store.js.map +1 -0
- package/dist/modules/extension/theme-registry.bridge.d.ts +56 -0
- package/dist/modules/extension/theme-registry.bridge.js +46 -0
- package/dist/modules/extension/theme-registry.bridge.js.map +1 -0
- package/dist/modules/extension/theme.controller.d.ts +66 -0
- package/dist/modules/extension/theme.controller.js +301 -0
- package/dist/modules/extension/theme.controller.js.map +1 -0
- package/dist/modules/extension/theme.service.d.ts +140 -0
- package/dist/modules/extension/theme.service.js +1039 -0
- package/dist/modules/extension/theme.service.js.map +1 -0
- package/dist/modules/file/file-optimization.controller.d.ts +12 -0
- package/dist/modules/file/file-optimization.controller.js +79 -0
- package/dist/modules/file/file-optimization.controller.js.map +1 -0
- package/dist/modules/file/file-optimization.service.d.ts +36 -0
- package/dist/modules/file/file-optimization.service.js +385 -0
- package/dist/modules/file/file-optimization.service.js.map +1 -0
- package/dist/modules/file/file-optimization.types.d.ts +66 -0
- package/dist/modules/file/file-optimization.types.js +5 -0
- package/dist/modules/file/file-optimization.types.js.map +1 -0
- package/dist/modules/file/file.controller.d.ts +1 -1
- package/dist/modules/file/file.controller.js +22 -20
- package/dist/modules/file/file.controller.js.map +1 -1
- package/dist/modules/file/file.entity.d.ts +7 -0
- package/dist/modules/file/file.entity.js +20 -15
- package/dist/modules/file/file.entity.js.map +1 -1
- package/dist/modules/file/file.module.js +16 -4
- package/dist/modules/file/file.module.js.map +1 -1
- package/dist/modules/file/file.service.d.ts +5 -1
- package/dist/modules/file/file.service.js +70 -24
- package/dist/modules/file/file.service.js.map +1 -1
- package/dist/modules/file/image-optimizer-plugin.guard.d.ts +7 -0
- package/dist/modules/file/image-optimizer-plugin.guard.js +33 -0
- package/dist/modules/file/image-optimizer-plugin.guard.js.map +1 -0
- package/dist/modules/health/health.controller.js +7 -9
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/health/health.module.js +1 -1
- package/dist/modules/health/health.module.js.map +1 -1
- package/dist/modules/hook/hook.module.d.ts +2 -0
- package/dist/modules/hook/hook.module.js +22 -0
- package/dist/modules/hook/hook.module.js.map +1 -0
- package/dist/modules/hook/hook.service.d.ts +26 -0
- package/dist/modules/hook/hook.service.js +105 -0
- package/dist/modules/hook/hook.service.js.map +1 -0
- 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 +35 -33
- 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 +10 -10
- package/dist/modules/knowledge/knowledge.service.js.map +1 -1
- package/dist/modules/page/page.controller.js +24 -23
- 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 +11 -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 -2
- package/dist/modules/setting/setting.constant.js +3 -19
- 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 +3 -0
- package/dist/modules/setting/setting.entity.js +64 -49
- 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 +13 -2
- package/dist/modules/setting/setting.service.js +169 -24
- package/dist/modules/setting/setting.service.js.map +1 -1
- package/dist/modules/smtp/mail.util.d.ts +7 -6
- package/dist/modules/smtp/mail.util.js +5 -9
- package/dist/modules/smtp/mail.util.js.map +1 -1
- package/dist/modules/smtp/smtp.controller.d.ts +3 -0
- package/dist/modules/smtp/smtp.controller.js +27 -14
- 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 +14 -0
- package/dist/modules/smtp/smtp.service.js +39 -12
- package/dist/modules/smtp/smtp.service.js.map +1 -1
- package/dist/modules/tag/tag.controller.js +24 -22
- 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 +3 -3
- package/dist/modules/tag/tag.service.js.map +1 -1
- package/dist/modules/user/user.controller.js +36 -26
- 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 +7 -4
- package/dist/modules/user/user.service.js.map +1 -1
- package/dist/modules/view/view.controller.js +20 -19
- 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/modules/webhook/webhook.controller.js +9 -9
- package/dist/modules/webhook/webhook.controller.js.map +1 -1
- package/dist/modules/webhook/webhook.entity.js +13 -13
- package/dist/modules/webhook/webhook.entity.js.map +1 -1
- package/dist/modules/webhook/webhook.module.js +1 -1
- package/dist/modules/webhook/webhook.module.js.map +1 -1
- package/dist/modules/webhook/webhook.service.d.ts +1 -1
- package/dist/modules/webhook/webhook.service.js +7 -4
- package/dist/modules/webhook/webhook.service.js.map +1 -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/favicon.png +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 +7 -0
- 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/starter.d.ts +2 -1
- package/dist/starter.js +200 -13
- package/dist/starter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -16966
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/date.util.js +1 -1
- package/dist/utils/date.util.js.map +1 -1
- package/dist/utils/html-sanitize.util.d.ts +1 -0
- package/dist/utils/html-sanitize.util.js +33 -0
- package/dist/utils/html-sanitize.util.js.map +1 -0
- package/dist/utils/image-processor.util.d.ts +23 -0
- package/dist/utils/image-processor.util.js +88 -0
- package/dist/utils/image-processor.util.js.map +1 -0
- package/dist/utils/local-api-quiet.util.d.ts +1 -0
- package/dist/utils/local-api-quiet.util.js +8 -0
- package/dist/utils/local-api-quiet.util.js.map +1 -0
- 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 +3 -1
- package/dist/utils/oss/aliyun-oss-client.js +5 -0
- package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
- package/dist/utils/oss/oss-client.d.ts +3 -1
- package/dist/utils/oss/oss-client.js.map +1 -1
- package/dist/utils/oss.util.d.ts +3 -1
- package/dist/utils/oss.util.js +5 -1
- package/dist/utils/oss.util.js.map +1 -1
- package/dist/utils/project-root.util.d.ts +2 -0
- package/dist/utils/project-root.util.js +42 -0
- package/dist/utils/project-root.util.js.map +1 -0
- package/dist/utils/query-whitelist.util.d.ts +1 -0
- package/dist/utils/query-whitelist.util.js +100 -0
- package/dist/utils/query-whitelist.util.js.map +1 -0
- package/dist/utils/uniqueid.util.js +1 -1
- package/dist/utils/uniqueid.util.js.map +1 -1
- package/dist/utils/upload.util.d.ts +6 -2
- package/dist/utils/upload.util.js +23 -8
- package/dist/utils/upload.util.js.map +1 -1
- package/dist/utils/user.util.d.ts +1 -0
- package/dist/utils/user.util.js +6 -2
- package/dist/utils/user.util.js.map +1 -1
- package/package.json +8 -9
- 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/favicon.png +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 +7 -0
- 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
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -3,7 +3,7 @@ import { FileService } from './file.service';
|
|
|
3
3
|
export declare class FileController {
|
|
4
4
|
private readonly fileService;
|
|
5
5
|
constructor(fileService: FileService);
|
|
6
|
-
uploadFile(file: any, unique: any): Promise<File>;
|
|
6
|
+
uploadFile(file: any, unique: any, scene: any): Promise<File>;
|
|
7
7
|
findAll(queryParam: any): Promise<[File[], number]>;
|
|
8
8
|
findById(id: any): Promise<File>;
|
|
9
9
|
deleteById(id: any): Promise<File>;
|
|
@@ -24,8 +24,8 @@ let FileController = class FileController {
|
|
|
24
24
|
constructor(fileService) {
|
|
25
25
|
this.fileService = fileService;
|
|
26
26
|
}
|
|
27
|
-
uploadFile(file, unique) {
|
|
28
|
-
return this.fileService.uploadFile(file, unique);
|
|
27
|
+
uploadFile(file, unique, scene) {
|
|
28
|
+
return this.fileService.uploadFile(file, unique, scene || 'default');
|
|
29
29
|
}
|
|
30
30
|
findAll(queryParam) {
|
|
31
31
|
return this.fileService.findAll(queryParam);
|
|
@@ -38,46 +38,48 @@ let FileController = class FileController {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
__decorate([
|
|
41
|
-
swagger_1.ApiResponse({ status: 200, description: '上传文件', type: [file_entity_1.File] }),
|
|
42
|
-
common_1.Post('upload'),
|
|
43
|
-
common_1.UseInterceptors(platform_express_1.FileInterceptor('file', {
|
|
41
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: '上传文件', type: [file_entity_1.File] }),
|
|
42
|
+
(0, common_1.Post)('upload'),
|
|
43
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file', {
|
|
44
44
|
limits: {
|
|
45
|
-
|
|
45
|
+
fileSize: 20 * 1024 * 1024,
|
|
46
46
|
},
|
|
47
47
|
})),
|
|
48
|
-
common_1.UseGuards(jwt_auth_guard_1.JwtAuthGuard),
|
|
49
|
-
__param(0,
|
|
48
|
+
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
49
|
+
__param(0, (0, common_1.UploadedFile)()),
|
|
50
|
+
__param(1, (0, common_1.Query)('unique')),
|
|
51
|
+
__param(2, (0, common_1.Query)('scene')),
|
|
50
52
|
__metadata("design:type", Function),
|
|
51
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
53
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
52
54
|
__metadata("design:returntype", void 0)
|
|
53
55
|
], FileController.prototype, "uploadFile", null);
|
|
54
56
|
__decorate([
|
|
55
|
-
common_1.Get(),
|
|
56
|
-
__param(0, common_1.Query()),
|
|
57
|
+
(0, common_1.Get)(),
|
|
58
|
+
__param(0, (0, common_1.Query)()),
|
|
57
59
|
__metadata("design:type", Function),
|
|
58
60
|
__metadata("design:paramtypes", [Object]),
|
|
59
61
|
__metadata("design:returntype", void 0)
|
|
60
62
|
], FileController.prototype, "findAll", null);
|
|
61
63
|
__decorate([
|
|
62
|
-
common_1.Get(':id'),
|
|
63
|
-
__param(0, common_1.Param('id')),
|
|
64
|
+
(0, common_1.Get)(':id'),
|
|
65
|
+
__param(0, (0, common_1.Param)('id')),
|
|
64
66
|
__metadata("design:type", Function),
|
|
65
67
|
__metadata("design:paramtypes", [Object]),
|
|
66
68
|
__metadata("design:returntype", void 0)
|
|
67
69
|
], FileController.prototype, "findById", null);
|
|
68
70
|
__decorate([
|
|
69
|
-
common_1.Delete(':id'),
|
|
70
|
-
roles_guard_1.Roles('admin'),
|
|
71
|
-
common_1.UseGuards(jwt_auth_guard_1.JwtAuthGuard),
|
|
72
|
-
__param(0, common_1.Param('id')),
|
|
71
|
+
(0, common_1.Delete)(':id'),
|
|
72
|
+
(0, roles_guard_1.Roles)('admin'),
|
|
73
|
+
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
74
|
+
__param(0, (0, common_1.Param)('id')),
|
|
73
75
|
__metadata("design:type", Function),
|
|
74
76
|
__metadata("design:paramtypes", [Object]),
|
|
75
77
|
__metadata("design:returntype", void 0)
|
|
76
78
|
], FileController.prototype, "deleteById", null);
|
|
77
79
|
FileController = __decorate([
|
|
78
|
-
swagger_1.ApiTags('File'),
|
|
79
|
-
common_1.Controller('file'),
|
|
80
|
-
common_1.UseGuards(roles_guard_1.RolesGuard),
|
|
80
|
+
(0, swagger_1.ApiTags)('File'),
|
|
81
|
+
(0, common_1.Controller)('file'),
|
|
82
|
+
(0, common_1.UseGuards)(roles_guard_1.RolesGuard),
|
|
81
83
|
__metadata("design:paramtypes", [file_service_1.FileService])
|
|
82
84
|
], FileController);
|
|
83
85
|
exports.FileController = FileController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.controller.js","sourceRoot":"","sources":["../../../src/modules/file/file.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuH;AACvH,+DAA2D;AAC3D,6CAAuD;AAEvD,2DAAsD;AACtD,qDAAwD;AACxD,+CAAqC;AACrC,iDAA6C;
|
|
1
|
+
{"version":3,"file":"file.controller.js","sourceRoot":"","sources":["../../../src/modules/file/file.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuH;AACvH,+DAA2D;AAC3D,6CAAuD;AAEvD,2DAAsD;AACtD,qDAAwD;AACxD,+CAAqC;AACrC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cAAK,EAAC,IAAI,CAAC,CAAA;;;;8CAEpB;AAMD;IAAC,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,mBAAK,EAAC,OAAO,CAAC;IACd,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACZ,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;gDAEtB;AA/CU,cAAc;IAH1B,IAAA,iBAAO,EAAC,MAAM,CAAC;IACf,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,kBAAS,EAAC,wBAAU,CAAC;qCAEsB,0BAAW;GAD1C,cAAc,CAgD1B;AAhDY,wCAAc"}
|
|
@@ -15,38 +15,43 @@ const typeorm_1 = require("typeorm");
|
|
|
15
15
|
let File = class File {
|
|
16
16
|
};
|
|
17
17
|
__decorate([
|
|
18
|
-
swagger_1.ApiProperty(),
|
|
19
|
-
typeorm_1.PrimaryGeneratedColumn('uuid'),
|
|
18
|
+
(0, swagger_1.ApiProperty)(),
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
20
|
__metadata("design:type", String)
|
|
21
21
|
], File.prototype, "id", void 0);
|
|
22
22
|
__decorate([
|
|
23
|
-
swagger_1.ApiProperty(),
|
|
24
|
-
typeorm_1.Column(),
|
|
23
|
+
(0, swagger_1.ApiProperty)(),
|
|
24
|
+
(0, typeorm_1.Column)(),
|
|
25
25
|
__metadata("design:type", String)
|
|
26
26
|
], File.prototype, "originalname", void 0);
|
|
27
27
|
__decorate([
|
|
28
|
-
swagger_1.ApiProperty(),
|
|
29
|
-
typeorm_1.Column(),
|
|
28
|
+
(0, swagger_1.ApiProperty)(),
|
|
29
|
+
(0, typeorm_1.Column)(),
|
|
30
30
|
__metadata("design:type", String)
|
|
31
31
|
], File.prototype, "filename", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
swagger_1.ApiProperty(),
|
|
34
|
-
typeorm_1.Column(),
|
|
33
|
+
(0, swagger_1.ApiProperty)(),
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], File.prototype, "type", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
swagger_1.ApiProperty(),
|
|
39
|
-
typeorm_1.Column(),
|
|
38
|
+
(0, swagger_1.ApiProperty)(),
|
|
39
|
+
(0, typeorm_1.Column)(),
|
|
40
40
|
__metadata("design:type", Number)
|
|
41
41
|
], File.prototype, "size", void 0);
|
|
42
42
|
__decorate([
|
|
43
|
-
swagger_1.ApiProperty(),
|
|
44
|
-
typeorm_1.Column(),
|
|
43
|
+
(0, swagger_1.ApiProperty)(),
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
46
|
], File.prototype, "url", void 0);
|
|
47
47
|
__decorate([
|
|
48
|
-
swagger_1.ApiProperty(),
|
|
49
|
-
typeorm_1.
|
|
48
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], File.prototype, "variants", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, swagger_1.ApiProperty)(),
|
|
54
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
50
55
|
type: 'datetime',
|
|
51
56
|
comment: '创建时间',
|
|
52
57
|
name: 'create_at',
|
|
@@ -54,7 +59,7 @@ __decorate([
|
|
|
54
59
|
__metadata("design:type", Date)
|
|
55
60
|
], File.prototype, "createAt", void 0);
|
|
56
61
|
File = __decorate([
|
|
57
|
-
typeorm_1.Entity()
|
|
62
|
+
(0, typeorm_1.Entity)()
|
|
58
63
|
], File);
|
|
59
64
|
exports.File = File;
|
|
60
65
|
//# sourceMappingURL=file.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../src/modules/file/file.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAAmF;
|
|
1
|
+
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../src/modules/file/file.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAAmF;AAG5E,IAAM,IAAI,GAAV,MAAM,IAAI;CA6ChB,CAAA;AA5CC;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gCAAsB,EAAC,MAAM,CAAC;;gCACpB;AAEX;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;0CACY;AAErB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;sCACQ;AAEjB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;kCACI;AAEb;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;kCACI;AAEb;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;;iCACG;AAEZ;IAAC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCAU9C;AAEF;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,WAAW;KAClB,CAAC;8BACQ,IAAI;sCAAC;AA5CJ,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CA6ChB;AA7CY,oBAAI"}
|
|
@@ -10,17 +10,29 @@ exports.FileModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
12
|
const auth_module_1 = require("../auth/auth.module");
|
|
13
|
+
const extension_module_1 = require("../extension/extension.module");
|
|
14
|
+
const article_revision_entity_1 = require("../article/article-revision.entity");
|
|
15
|
+
const article_entity_1 = require("../article/article.entity");
|
|
16
|
+
const page_entity_1 = require("../page/page.entity");
|
|
13
17
|
const setting_module_1 = require("../setting/setting.module");
|
|
18
|
+
const file_optimization_controller_1 = require("./file-optimization.controller");
|
|
19
|
+
const file_optimization_service_1 = require("./file-optimization.service");
|
|
14
20
|
const file_controller_1 = require("./file.controller");
|
|
15
21
|
const file_entity_1 = require("./file.entity");
|
|
16
22
|
const file_service_1 = require("./file.service");
|
|
23
|
+
const image_optimizer_plugin_guard_1 = require("./image-optimizer-plugin.guard");
|
|
17
24
|
let FileModule = class FileModule {
|
|
18
25
|
};
|
|
19
26
|
FileModule = __decorate([
|
|
20
|
-
common_1.Module({
|
|
21
|
-
imports: [
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
(0, common_1.Module)({
|
|
28
|
+
imports: [
|
|
29
|
+
typeorm_1.TypeOrmModule.forFeature([file_entity_1.File, article_entity_1.Article, article_revision_entity_1.ArticleRevision, page_entity_1.Page]),
|
|
30
|
+
auth_module_1.AuthModule,
|
|
31
|
+
setting_module_1.SettingModule,
|
|
32
|
+
(0, common_1.forwardRef)(() => extension_module_1.ExtensionModule),
|
|
33
|
+
],
|
|
34
|
+
controllers: [file_controller_1.FileController, file_optimization_controller_1.FileOptimizationController],
|
|
35
|
+
providers: [file_service_1.FileService, file_optimization_service_1.FileOptimizationService, image_optimizer_plugin_guard_1.ImageOptimizerPluginGuard],
|
|
24
36
|
})
|
|
25
37
|
], FileModule);
|
|
26
38
|
exports.FileModule = FileModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.module.js","sourceRoot":"","sources":["../../../src/modules/file/file.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"file.module.js","sourceRoot":"","sources":["../../../src/modules/file/file.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAEhD,qDAAiD;AACjD,oEAAgE;AAChE,gFAAqE;AACrE,8DAAoD;AACpD,qDAA2C;AAC3C,8DAA0D;AAC1D,iFAA4E;AAC5E,2EAAsE;AACtE,uDAAmD;AACnD,+CAAqC;AACrC,iDAA6C;AAC7C,iFAA2E;AAYpE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,UAAU;IAVtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,EAAE,wBAAO,EAAE,yCAAe,EAAE,kBAAI,CAAC,CAAC;YAChE,wBAAU;YACV,8BAAa;YACb,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAe,CAAC;SAClC;QACD,WAAW,EAAE,CAAC,gCAAc,EAAE,yDAA0B,CAAC;QACzD,SAAS,EAAE,CAAC,0BAAW,EAAE,mDAAuB,EAAE,wDAAyB,CAAC;KAC7E,CAAC;GACW,UAAU,CAAG;AAAb,gCAAU"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConfigService } from '@nestjs/config';
|
|
2
2
|
import { Repository } from 'typeorm';
|
|
3
|
+
import { ImageScene } from '../../utils/image-processor.util';
|
|
3
4
|
import { SettingService } from '../setting/setting.service';
|
|
4
5
|
import { File } from './file.entity';
|
|
5
6
|
export declare class FileService {
|
|
@@ -9,7 +10,10 @@ export declare class FileService {
|
|
|
9
10
|
private oss;
|
|
10
11
|
private localUpload;
|
|
11
12
|
constructor(fileRepository: Repository<File>, settingService: SettingService, configService: ConfigService);
|
|
12
|
-
|
|
13
|
+
private getUploadBaseUrl;
|
|
14
|
+
private persistBuffer;
|
|
15
|
+
private removeStoredFile;
|
|
16
|
+
uploadFile(file: any, unique: any, scene?: ImageScene): Promise<File>;
|
|
13
17
|
findAll(queryParams: any): Promise<[File[], number]>;
|
|
14
18
|
findById(id: any): Promise<File>;
|
|
15
19
|
findByIds(ids: any): Promise<Array<File>>;
|
|
@@ -30,6 +30,8 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
30
30
|
const path = require("path");
|
|
31
31
|
const typeorm_2 = require("typeorm");
|
|
32
32
|
const date_util_1 = require("../../utils/date.util");
|
|
33
|
+
const image_processor_util_1 = require("../../utils/image-processor.util");
|
|
34
|
+
const query_whitelist_util_1 = require("../../utils/query-whitelist.util");
|
|
33
35
|
const oss_util_1 = require("../../utils/oss.util");
|
|
34
36
|
const uniqueid_util_1 = require("../../utils/uniqueid.util");
|
|
35
37
|
const upload_util_1 = require("../../utils/upload.util");
|
|
@@ -43,21 +45,61 @@ let FileService = class FileService {
|
|
|
43
45
|
this.oss = new oss_util_1.Oss(this.settingService);
|
|
44
46
|
this.localUpload = new upload_util_1.LocalUpload();
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const hasOssConfig = await this.oss.hasOssConfig();
|
|
52
|
-
let url;
|
|
48
|
+
getUploadBaseUrl() {
|
|
49
|
+
return (this.configService.get('SERVER_PUBLIC_UPLOAD_URL') ||
|
|
50
|
+
`${this.configService.get('SERVER_SITE_URL')}/public/uploads`);
|
|
51
|
+
}
|
|
52
|
+
async persistBuffer(filename, buffer, hasOssConfig) {
|
|
53
53
|
if (hasOssConfig) {
|
|
54
|
-
|
|
54
|
+
return this.oss.putFile(filename, buffer);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
await this.localUpload.putFile(filename, buffer);
|
|
57
|
+
return `${this.getUploadBaseUrl()}/${filename}`;
|
|
58
|
+
}
|
|
59
|
+
async removeStoredFile(filename, hasOssConfig) {
|
|
60
|
+
if (hasOssConfig) {
|
|
61
|
+
await this.oss.deleteFile(filename);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
await this.localUpload.deleteFile(filename);
|
|
65
|
+
}
|
|
66
|
+
async uploadFile(file, unique, scene = 'default') {
|
|
67
|
+
let { originalname, mimetype, size, buffer } = file;
|
|
68
|
+
const dataFolder = (0, date_util_1.dateFormat)(new Date(), 'yyyy-MM-dd');
|
|
69
|
+
const ext = path.extname(originalname);
|
|
70
|
+
const hasOssConfig = await this.oss.hasOssConfig();
|
|
71
|
+
if ((0, image_processor_util_1.isProcessableImage)(mimetype)) {
|
|
72
|
+
const baseName = +unique === 1 ? path.basename(originalname, ext) : (0, uniqueid_util_1.uniqueid)();
|
|
73
|
+
const baseFilename = `${dataFolder}/${baseName}.webp`;
|
|
74
|
+
const variantList = (0, image_processor_util_1.variantsForScene)(scene);
|
|
75
|
+
const processedVariants = await (0, image_processor_util_1.processImageVariants)(buffer, variantList);
|
|
76
|
+
const variantsMeta = {};
|
|
77
|
+
for (const [variant, processed] of processedVariants.entries()) {
|
|
78
|
+
const variantFilename = (0, image_processor_util_1.buildVariantFilename)(baseFilename, variant);
|
|
79
|
+
const variantUrl = await this.persistBuffer(variantFilename, processed.buffer, hasOssConfig);
|
|
80
|
+
variantsMeta[variant] = {
|
|
81
|
+
url: variantUrl,
|
|
82
|
+
filename: variantFilename,
|
|
83
|
+
width: processed.width,
|
|
84
|
+
height: processed.height,
|
|
85
|
+
size: processed.size,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const primaryVariant = (0, image_processor_util_1.primaryVariantForScene)(scene);
|
|
89
|
+
const primary = variantsMeta[primaryVariant];
|
|
90
|
+
const newFile = await this.fileRepository.create({
|
|
91
|
+
originalname: `${path.basename(originalname, ext)}.webp`,
|
|
92
|
+
filename: primary.filename,
|
|
93
|
+
url: primary.url,
|
|
94
|
+
type: 'image/webp',
|
|
95
|
+
size: primary.size,
|
|
96
|
+
variants: variantsMeta,
|
|
97
|
+
});
|
|
98
|
+
await this.fileRepository.save(newFile);
|
|
99
|
+
return newFile;
|
|
60
100
|
}
|
|
101
|
+
const filename = +unique === 1 ? `${dataFolder}/${originalname}` : `${dataFolder}/${(0, uniqueid_util_1.uniqueid)()}.${ext}`;
|
|
102
|
+
const url = await this.persistBuffer(filename, buffer, hasOssConfig);
|
|
61
103
|
const newFile = await this.fileRepository.create({
|
|
62
104
|
originalname,
|
|
63
105
|
filename,
|
|
@@ -74,11 +116,10 @@ let FileService = class FileService {
|
|
|
74
116
|
const { page = 1, pageSize = 12 } = queryParams, otherParams = __rest(queryParams, ["page", "pageSize"]);
|
|
75
117
|
query.skip((+page - 1) * +pageSize);
|
|
76
118
|
query.take(+pageSize);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
119
|
+
const filtered = (0, query_whitelist_util_1.filterByWhitelist)('file', queryParams);
|
|
120
|
+
Object.keys(filtered).forEach((key) => {
|
|
121
|
+
query.andWhere(`file.${key} LIKE :${key}`).setParameter(`${key}`, `%${filtered[key]}%`);
|
|
122
|
+
});
|
|
82
123
|
}
|
|
83
124
|
return query.getManyAndCount();
|
|
84
125
|
}
|
|
@@ -90,19 +131,24 @@ let FileService = class FileService {
|
|
|
90
131
|
}
|
|
91
132
|
async deleteById(id) {
|
|
92
133
|
const target = await this.fileRepository.findOne(id);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
await this.oss.deleteFile(target.filename);
|
|
134
|
+
if (!target) {
|
|
135
|
+
throw new common_1.HttpException('File not found', 404);
|
|
96
136
|
}
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
const hasOssConfig = await this.oss.hasOssConfig();
|
|
138
|
+
const filenames = target.variants
|
|
139
|
+
? Object.values(target.variants).map((variant) => variant.filename)
|
|
140
|
+
: (0, image_processor_util_1.isProcessableImage)(target.type)
|
|
141
|
+
? (0, image_processor_util_1.listVariantFilenames)(target.filename)
|
|
142
|
+
: [target.filename];
|
|
143
|
+
for (const filename of filenames) {
|
|
144
|
+
await this.removeStoredFile(filename, hasOssConfig);
|
|
99
145
|
}
|
|
100
146
|
return this.fileRepository.remove(target);
|
|
101
147
|
}
|
|
102
148
|
};
|
|
103
149
|
FileService = __decorate([
|
|
104
|
-
common_1.Injectable(),
|
|
105
|
-
__param(0, typeorm_1.InjectRepository(file_entity_1.File)),
|
|
150
|
+
(0, common_1.Injectable)(),
|
|
151
|
+
__param(0, (0, typeorm_1.InjectRepository)(file_entity_1.File)),
|
|
106
152
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
107
153
|
setting_service_1.SettingService,
|
|
108
154
|
config_1.ConfigService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.service.js","sourceRoot":"","sources":["../../../src/modules/file/file.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,2CAA+C;AAC/C,6CAAmD;AACnD,6BAA6B;AAC7B,qCAAqC;AAErC,qDAAmD;AACnD,mDAA2C;AAC3C,6DAAqD;AACrD,yDAAsD;AACtD,gEAA4D;AAC5D,+CAAqC;
|
|
1
|
+
{"version":3,"file":"file.service.js","sourceRoot":"","sources":["../../../src/modules/file/file.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,2CAA+C;AAC/C,6CAAmD;AACnD,6BAA6B;AAC7B,qCAAqC;AAErC,qDAAmD;AACnD,2EAS0C;AAC1C,2EAAqE;AACrE,mDAA2C;AAC3C,6DAAqD;AACrD,yDAAsD;AACtD,gEAA4D;AAC5D,+CAAqC;AAG9B,IAAM,WAAW,GAAjB,MAAM,WAAW;IAItB,YAEmB,cAAgC,EAChC,cAA8B,EAC9B,aAA4B;QAF5B,mBAAc,GAAd,cAAc,CAAkB;QAChC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb,aAAa,CAAe;QAE7C,IAAI,CAAC,GAAG,GAAG,IAAI,cAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;IACvC,CAAC;IAEO,gBAAgB;QACtB,OAAO,CACL,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,0BAA0B,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AC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;SACrD;QAED,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AAvJY,WAAW;IADvB,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCACU,oBAAU;QACV,gCAAc;QACf,sBAAa;GARpC,WAAW,CAuJvB;AAvJY,kCAAW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -24,10 +24,8 @@ let HealthController = class HealthController {
|
|
|
24
24
|
async check() {
|
|
25
25
|
let database = 'down';
|
|
26
26
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
database = 'up';
|
|
30
|
-
}
|
|
27
|
+
await this.connection.query('SELECT 1');
|
|
28
|
+
database = 'up';
|
|
31
29
|
}
|
|
32
30
|
catch (_a) {
|
|
33
31
|
database = 'down';
|
|
@@ -41,16 +39,16 @@ let HealthController = class HealthController {
|
|
|
41
39
|
}
|
|
42
40
|
};
|
|
43
41
|
__decorate([
|
|
44
|
-
common_1.Get(),
|
|
45
|
-
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
42
|
+
(0, common_1.Get)(),
|
|
43
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
46
44
|
__metadata("design:type", Function),
|
|
47
45
|
__metadata("design:paramtypes", []),
|
|
48
46
|
__metadata("design:returntype", Promise)
|
|
49
47
|
], HealthController.prototype, "check", null);
|
|
50
48
|
HealthController = __decorate([
|
|
51
|
-
swagger_1.ApiTags('Health'),
|
|
52
|
-
common_1.Controller('health'),
|
|
53
|
-
__param(0, typeorm_1.InjectConnection()),
|
|
49
|
+
(0, swagger_1.ApiTags)('Health'),
|
|
50
|
+
(0, common_1.Controller)('health'),
|
|
51
|
+
__param(0, (0, typeorm_1.InjectConnection)()),
|
|
54
52
|
__metadata("design:paramtypes", [typeorm_2.Connection])
|
|
55
53
|
], HealthController);
|
|
56
54
|
exports.HealthController = HealthController;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -12,7 +12,7 @@ const health_controller_1 = require("./health.controller");
|
|
|
12
12
|
let HealthModule = class HealthModule {
|
|
13
13
|
};
|
|
14
14
|
HealthModule = __decorate([
|
|
15
|
-
common_1.Module({
|
|
15
|
+
(0, common_1.Module)({
|
|
16
16
|
controllers: [health_controller_1.HealthController],
|
|
17
17
|
})
|
|
18
18
|
], HealthModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../src/modules/health/health.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,2DAAuD;
|
|
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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|