@fecommunity/reactpress-server 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +325 -56
- package/bin/reactpress-server.js +6 -50
- package/dist/app.module.js +30 -18
- package/dist/app.module.js.map +1 -1
- package/dist/filters/http-exception.filter.js +1 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/generate-swagger.d.ts +1 -1
- package/dist/generate-swagger.js +11 -12
- package/dist/generate-swagger.js.map +1 -1
- package/dist/interceptors/transform.interceptor.d.ts +6 -2
- package/dist/interceptors/transform.interceptor.js +5 -10
- package/dist/interceptors/transform.interceptor.js.map +1 -1
- package/dist/logger/index.js +4 -5
- package/dist/logger/index.js.map +1 -1
- package/dist/main.d.ts +1 -3
- package/dist/main.js +23 -47
- package/dist/main.js.map +1 -1
- package/dist/modules/article/article.controller.d.ts +2 -7
- package/dist/modules/article/article.controller.js +48 -103
- package/dist/modules/article/article.controller.js.map +1 -1
- package/dist/modules/article/article.entity.d.ts +0 -4
- package/dist/modules/article/article.entity.js +41 -61
- package/dist/modules/article/article.entity.js.map +1 -1
- package/dist/modules/article/article.module.js +3 -18
- package/dist/modules/article/article.module.js.map +1 -1
- package/dist/modules/article/article.service.d.ts +2 -16
- package/dist/modules/article/article.service.js +29 -151
- package/dist/modules/article/article.service.js.map +1 -1
- package/dist/modules/auth/auth.controller.js +11 -11
- package/dist/modules/auth/auth.controller.js.map +1 -1
- package/dist/modules/auth/auth.module.js +4 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/auth.service.js +7 -8
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/jwt-auth.guard.js +3 -4
- package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
- package/dist/modules/auth/jwt.strategy.js +3 -4
- package/dist/modules/auth/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/roles.guard.js +2 -2
- package/dist/modules/auth/roles.guard.js.map +1 -1
- package/dist/modules/category/category.controller.js +20 -21
- package/dist/modules/category/category.controller.js.map +1 -1
- package/dist/modules/category/category.entity.js +13 -13
- package/dist/modules/category/category.entity.js.map +1 -1
- package/dist/modules/category/category.module.js +1 -1
- package/dist/modules/category/category.module.js.map +1 -1
- package/dist/modules/category/category.service.js +4 -5
- package/dist/modules/category/category.service.js.map +1 -1
- package/dist/modules/comment/comment.controller.js +20 -24
- package/dist/modules/comment/comment.controller.js.map +1 -1
- package/dist/modules/comment/comment.entity.js +31 -31
- package/dist/modules/comment/comment.entity.js.map +1 -1
- package/dist/modules/comment/comment.module.js +2 -11
- package/dist/modules/comment/comment.module.js.map +1 -1
- package/dist/modules/comment/comment.service.d.ts +1 -5
- package/dist/modules/comment/comment.service.js +16 -43
- package/dist/modules/comment/comment.service.js.map +1 -1
- package/dist/modules/comment/html.d.ts +1 -1
- package/dist/modules/comment/html.js +3 -3
- package/dist/modules/comment/html.js.map +1 -1
- package/dist/modules/file/file.controller.d.ts +1 -1
- package/dist/modules/file/file.controller.js +20 -22
- package/dist/modules/file/file.controller.js.map +1 -1
- package/dist/modules/file/file.entity.d.ts +0 -7
- package/dist/modules/file/file.entity.js +15 -20
- package/dist/modules/file/file.entity.js.map +1 -1
- package/dist/modules/file/file.module.js +4 -16
- package/dist/modules/file/file.module.js.map +1 -1
- package/dist/modules/file/file.service.d.ts +1 -6
- package/dist/modules/file/file.service.js +38 -88
- package/dist/modules/file/file.service.js.map +1 -1
- package/dist/modules/install/install.controller.js +5 -5
- package/dist/modules/install/install.controller.js.map +1 -1
- package/dist/modules/install/install.module.js +1 -1
- package/dist/modules/install/install.module.js.map +1 -1
- package/dist/modules/install/install.service.js +2 -2
- package/dist/modules/install/install.service.js.map +1 -1
- package/dist/modules/knowledge/knowledge.controller.js +33 -35
- package/dist/modules/knowledge/knowledge.controller.js.map +1 -1
- package/dist/modules/knowledge/knowledge.entity.js +33 -33
- package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
- package/dist/modules/knowledge/knowledge.module.js +1 -1
- package/dist/modules/knowledge/knowledge.module.js.map +1 -1
- package/dist/modules/knowledge/knowledge.service.js +11 -12
- package/dist/modules/knowledge/knowledge.service.js.map +1 -1
- package/dist/modules/page/page.controller.js +23 -24
- package/dist/modules/page/page.controller.js.map +1 -1
- package/dist/modules/page/page.entity.js +27 -27
- package/dist/modules/page/page.entity.js.map +1 -1
- package/dist/modules/page/page.module.js +1 -1
- package/dist/modules/page/page.module.js.map +1 -1
- package/dist/modules/page/page.service.js +12 -12
- package/dist/modules/page/page.service.js.map +1 -1
- package/dist/modules/search/search.controller.js +12 -12
- package/dist/modules/search/search.controller.js.map +1 -1
- package/dist/modules/search/search.entity.js +13 -13
- package/dist/modules/search/search.entity.js.map +1 -1
- package/dist/modules/search/search.module.js +1 -1
- package/dist/modules/search/search.module.js.map +1 -1
- package/dist/modules/search/search.service.js +2 -2
- package/dist/modules/search/search.service.js.map +1 -1
- package/dist/modules/setting/setting.constant.d.ts +4 -5
- package/dist/modules/setting/setting.constant.js +20 -5
- package/dist/modules/setting/setting.constant.js.map +1 -1
- package/dist/modules/setting/setting.controller.js +11 -11
- package/dist/modules/setting/setting.controller.js.map +1 -1
- package/dist/modules/setting/setting.entity.d.ts +0 -3
- package/dist/modules/setting/setting.entity.js +49 -64
- package/dist/modules/setting/setting.entity.js.map +1 -1
- package/dist/modules/setting/setting.module.js +2 -2
- package/dist/modules/setting/setting.module.js.map +1 -1
- package/dist/modules/setting/setting.service.d.ts +2 -13
- package/dist/modules/setting/setting.service.js +24 -169
- package/dist/modules/setting/setting.service.js.map +1 -1
- package/dist/modules/smtp/mail.util.d.ts +6 -7
- package/dist/modules/smtp/mail.util.js +9 -5
- package/dist/modules/smtp/mail.util.js.map +1 -1
- package/dist/modules/smtp/smtp.controller.d.ts +0 -3
- package/dist/modules/smtp/smtp.controller.js +14 -27
- package/dist/modules/smtp/smtp.controller.js.map +1 -1
- package/dist/modules/smtp/smtp.entity.js +15 -15
- package/dist/modules/smtp/smtp.entity.js.map +1 -1
- package/dist/modules/smtp/smtp.module.js +2 -2
- package/dist/modules/smtp/smtp.module.js.map +1 -1
- package/dist/modules/smtp/smtp.service.d.ts +0 -14
- package/dist/modules/smtp/smtp.service.js +12 -40
- package/dist/modules/smtp/smtp.service.js.map +1 -1
- package/dist/modules/tag/tag.controller.js +22 -24
- package/dist/modules/tag/tag.controller.js.map +1 -1
- package/dist/modules/tag/tag.entity.js +12 -12
- package/dist/modules/tag/tag.entity.js.map +1 -1
- package/dist/modules/tag/tag.module.js +1 -1
- package/dist/modules/tag/tag.module.js.map +1 -1
- package/dist/modules/tag/tag.service.js +4 -5
- package/dist/modules/tag/tag.service.js.map +1 -1
- package/dist/modules/user/user.controller.js +28 -39
- package/dist/modules/user/user.controller.js.map +1 -1
- package/dist/modules/user/user.entity.js +22 -22
- package/dist/modules/user/user.entity.js.map +1 -1
- package/dist/modules/user/user.module.js +2 -2
- package/dist/modules/user/user.module.js.map +1 -1
- package/dist/modules/user/user.service.js +14 -18
- package/dist/modules/user/user.service.js.map +1 -1
- package/dist/modules/view/view.controller.js +19 -20
- package/dist/modules/view/view.controller.js.map +1 -1
- package/dist/modules/view/view.entity.js +24 -24
- package/dist/modules/view/view.entity.js.map +1 -1
- package/dist/modules/view/view.module.js +1 -1
- package/dist/modules/view/view.module.js.map +1 -1
- package/dist/modules/view/view.service.js +4 -4
- package/dist/modules/view/view.service.js.map +1 -1
- package/dist/public/favicon.png +0 -0
- package/dist/starter.d.ts +1 -3
- package/dist/starter.js +14 -202
- package/dist/starter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +15957 -1
- package/dist/utils/date.util.js +1 -1
- package/dist/utils/date.util.js.map +1 -1
- package/dist/utils/markdown.util.js +1 -1
- package/dist/utils/markdown.util.js.map +1 -1
- package/dist/utils/oss/aliyun-oss-client.d.ts +1 -3
- package/dist/utils/oss/aliyun-oss-client.js +0 -5
- package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
- package/dist/utils/oss/oss-client.d.ts +1 -3
- package/dist/utils/oss/oss-client.js.map +1 -1
- package/dist/utils/oss.util.d.ts +1 -3
- package/dist/utils/oss.util.js +1 -6
- package/dist/utils/oss.util.js.map +1 -1
- package/dist/utils/uniqueid.util.js +1 -1
- package/dist/utils/uniqueid.util.js.map +1 -1
- package/dist/utils/upload.util.d.ts +2 -6
- package/dist/utils/upload.util.js +8 -23
- package/dist/utils/upload.util.js.map +1 -1
- package/dist/utils/user.util.d.ts +0 -1
- package/dist/utils/user.util.js +2 -6
- package/dist/utils/user.util.js.map +1 -1
- package/package.json +32 -36
- package/public/favicon.png +0 -0
- package/dist/common/api-messages.d.ts +0 -41
- package/dist/common/api-messages.js +0 -45
- package/dist/common/api-messages.js.map +0 -1
- package/dist/database/typeorm-options.d.ts +0 -3
- package/dist/database/typeorm-options.js +0 -71
- package/dist/database/typeorm-options.js.map +0 -1
- package/dist/modules/api-key/api-key.controller.d.ts +0 -14
- package/dist/modules/api-key/api-key.controller.js +0 -63
- package/dist/modules/api-key/api-key.controller.js.map +0 -1
- package/dist/modules/api-key/api-key.entity.d.ts +0 -11
- package/dist/modules/api-key/api-key.entity.js +0 -63
- package/dist/modules/api-key/api-key.entity.js.map +0 -1
- package/dist/modules/api-key/api-key.guard.d.ts +0 -7
- package/dist/modules/api-key/api-key.guard.js +0 -39
- package/dist/modules/api-key/api-key.guard.js.map +0 -1
- package/dist/modules/api-key/api-key.module.d.ts +0 -2
- package/dist/modules/api-key/api-key.module.js +0 -28
- package/dist/modules/api-key/api-key.module.js.map +0 -1
- package/dist/modules/api-key/api-key.service.d.ts +0 -15
- package/dist/modules/api-key/api-key.service.js +0 -81
- package/dist/modules/api-key/api-key.service.js.map +0 -1
- package/dist/modules/article/article-revision.entity.d.ts +0 -11
- package/dist/modules/article/article-revision.entity.js +0 -53
- package/dist/modules/article/article-revision.entity.js.map +0 -1
- package/dist/modules/article/article-slug.util.d.ts +0 -2
- package/dist/modules/article/article-slug.util.js +0 -19
- package/dist/modules/article/article-slug.util.js.map +0 -1
- package/dist/modules/article/scheduled-publish.service.d.ts +0 -13
- package/dist/modules/article/scheduled-publish.service.js +0 -65
- package/dist/modules/article/scheduled-publish.service.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
- package/dist/modules/bootstrap/bootstrap.constants.js +0 -171
- package/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
- package/dist/modules/bootstrap/bootstrap.service.js +0 -183
- package/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
- package/dist/modules/bootstrap/install-locale.d.ts +0 -2
- package/dist/modules/bootstrap/install-locale.js +0 -11
- package/dist/modules/bootstrap/install-locale.js.map +0 -1
- package/dist/modules/extension/extension.module.d.ts +0 -9
- package/dist/modules/extension/extension.module.js +0 -52
- package/dist/modules/extension/extension.module.js.map +0 -1
- package/dist/modules/extension/plugin-loader.service.d.ts +0 -12
- package/dist/modules/extension/plugin-loader.service.js +0 -96
- package/dist/modules/extension/plugin-loader.service.js.map +0 -1
- package/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
- package/dist/modules/extension/plugin-registry.bridge.js +0 -44
- package/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
- package/dist/modules/extension/plugin.controller.d.ts +0 -22
- package/dist/modules/extension/plugin.controller.js +0 -155
- package/dist/modules/extension/plugin.controller.js.map +0 -1
- package/dist/modules/extension/plugin.service.d.ts +0 -54
- package/dist/modules/extension/plugin.service.js +0 -414
- package/dist/modules/extension/plugin.service.js.map +0 -1
- package/dist/modules/extension/preview-draft.store.d.ts +0 -13
- package/dist/modules/extension/preview-draft.store.js +0 -41
- package/dist/modules/extension/preview-draft.store.js.map +0 -1
- package/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
- package/dist/modules/extension/theme-registry.bridge.js +0 -68
- package/dist/modules/extension/theme-registry.bridge.js.map +0 -1
- package/dist/modules/extension/theme.controller.d.ts +0 -66
- package/dist/modules/extension/theme.controller.js +0 -301
- package/dist/modules/extension/theme.controller.js.map +0 -1
- package/dist/modules/extension/theme.service.d.ts +0 -140
- package/dist/modules/extension/theme.service.js +0 -1039
- package/dist/modules/extension/theme.service.js.map +0 -1
- package/dist/modules/file/content-image-scan.util.d.ts +0 -52
- package/dist/modules/file/content-image-scan.util.js +0 -222
- package/dist/modules/file/content-image-scan.util.js.map +0 -1
- package/dist/modules/file/file-optimization.controller.d.ts +0 -12
- package/dist/modules/file/file-optimization.controller.js +0 -79
- package/dist/modules/file/file-optimization.controller.js.map +0 -1
- package/dist/modules/file/file-optimization.service.d.ts +0 -36
- package/dist/modules/file/file-optimization.service.js +0 -387
- package/dist/modules/file/file-optimization.service.js.map +0 -1
- package/dist/modules/file/file-optimization.types.d.ts +0 -66
- package/dist/modules/file/file-optimization.types.js +0 -5
- package/dist/modules/file/file-optimization.types.js.map +0 -1
- package/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
- package/dist/modules/file/image-optimizer-plugin.guard.js +0 -33
- package/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
- package/dist/modules/health/health.controller.d.ts +0 -11
- package/dist/modules/health/health.controller.js +0 -55
- package/dist/modules/health/health.controller.js.map +0 -1
- package/dist/modules/health/health.module.d.ts +0 -2
- package/dist/modules/health/health.module.js +0 -20
- package/dist/modules/health/health.module.js.map +0 -1
- package/dist/modules/hook/hook.module.d.ts +0 -2
- package/dist/modules/hook/hook.module.js +0 -22
- package/dist/modules/hook/hook.module.js.map +0 -1
- package/dist/modules/hook/hook.service.d.ts +0 -26
- package/dist/modules/hook/hook.service.js +0 -105
- package/dist/modules/hook/hook.service.js.map +0 -1
- package/dist/modules/webhook/webhook.controller.d.ts +0 -12
- package/dist/modules/webhook/webhook.controller.js +0 -63
- package/dist/modules/webhook/webhook.controller.js.map +0 -1
- package/dist/modules/webhook/webhook.entity.d.ts +0 -9
- package/dist/modules/webhook/webhook.entity.js +0 -54
- package/dist/modules/webhook/webhook.entity.js.map +0 -1
- package/dist/modules/webhook/webhook.module.d.ts +0 -2
- package/dist/modules/webhook/webhook.module.js +0 -27
- package/dist/modules/webhook/webhook.module.js.map +0 -1
- package/dist/modules/webhook/webhook.service.d.ts +0 -16
- package/dist/modules/webhook/webhook.service.js +0 -100
- package/dist/modules/webhook/webhook.service.js.map +0 -1
- package/dist/node-polyfills.d.ts +0 -18
- package/dist/node-polyfills.js +0 -24
- package/dist/node-polyfills.js.map +0 -1
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16.png +0 -0
- package/dist/public/favicon-32.png +0 -0
- package/dist/public/favicon-48.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/icon-192.png +0 -0
- package/dist/public/icon-512.png +0 -0
- package/dist/public/logo-200.png +0 -0
- package/dist/public/logo-400.png +0 -0
- package/dist/public/logo.png +0 -0
- package/dist/public/logo.svg +0 -7
- package/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils/html-sanitize.util.d.ts +0 -1
- package/dist/utils/html-sanitize.util.js +0 -33
- package/dist/utils/html-sanitize.util.js.map +0 -1
- package/dist/utils/image-processor.util.d.ts +0 -23
- package/dist/utils/image-processor.util.js +0 -88
- package/dist/utils/image-processor.util.js.map +0 -1
- package/dist/utils/local-api-quiet.util.d.ts +0 -1
- package/dist/utils/local-api-quiet.util.js +0 -8
- package/dist/utils/local-api-quiet.util.js.map +0 -1
- package/dist/utils/project-root.util.d.ts +0 -2
- package/dist/utils/project-root.util.js +0 -42
- package/dist/utils/project-root.util.js.map +0 -1
- package/dist/utils/query-whitelist.util.d.ts +0 -1
- package/dist/utils/query-whitelist.util.js +0 -100
- package/dist/utils/query-whitelist.util.js.map +0 -1
- package/dist/utils/theme-placeholder-cover.d.ts +0 -7
- package/dist/utils/theme-placeholder-cover.js +0 -94
- package/dist/utils/theme-placeholder-cover.js.map +0 -1
- package/dist/utils/upload-url.util.d.ts +0 -4
- package/dist/utils/upload-url.util.js +0 -34
- package/dist/utils/upload-url.util.js.map +0 -1
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16.png +0 -0
- package/public/favicon-32.png +0 -0
- package/public/favicon-48.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/logo-200.png +0 -0
- package/public/logo-400.png +0 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +0 -7
- package/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
|
@@ -16,18 +16,14 @@ exports.ArticleController = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const jwt_1 = require("@nestjs/jwt");
|
|
18
18
|
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
-
const api_messages_1 = require("../../common/api-messages");
|
|
20
|
-
const api_key_guard_1 = require("../api-key/api-key.guard");
|
|
21
|
-
const api_key_service_1 = require("../api-key/api-key.service");
|
|
22
19
|
const jwt_auth_guard_1 = require("../auth/jwt-auth.guard");
|
|
23
20
|
const roles_guard_1 = require("../auth/roles.guard");
|
|
24
21
|
const user_service_1 = require("../user/user.service");
|
|
25
22
|
const article_entity_1 = require("./article.entity");
|
|
26
23
|
const article_service_1 = require("./article.service");
|
|
27
24
|
let ArticleController = class ArticleController {
|
|
28
|
-
constructor(articleService,
|
|
25
|
+
constructor(articleService, jwtService, userService) {
|
|
29
26
|
this.articleService = articleService;
|
|
30
|
-
this.apiKeyService = apiKeyService;
|
|
31
27
|
this.jwtService = jwtService;
|
|
32
28
|
this.userService = userService;
|
|
33
29
|
}
|
|
@@ -37,18 +33,6 @@ let ArticleController = class ArticleController {
|
|
|
37
33
|
findAll(queryParams) {
|
|
38
34
|
return this.articleService.findAll(queryParams);
|
|
39
35
|
}
|
|
40
|
-
findHeadless(req, queryParams) {
|
|
41
|
-
if (!this.apiKeyService.hasScope(req.apiKey, 'read')) {
|
|
42
|
-
throw new common_1.ForbiddenException(api_messages_1.ApiMsg.API_KEY_MISSING_READ);
|
|
43
|
-
}
|
|
44
|
-
return this.articleService.findAll(Object.assign(Object.assign({}, queryParams), { status: 'publish' }));
|
|
45
|
-
}
|
|
46
|
-
listRevisions(id) {
|
|
47
|
-
return this.articleService.listRevisions(id);
|
|
48
|
-
}
|
|
49
|
-
restoreRevision(id, revisionId) {
|
|
50
|
-
return this.articleService.restoreRevision(id, revisionId);
|
|
51
|
-
}
|
|
52
36
|
findArticlesByCategory(category, queryParams) {
|
|
53
37
|
return this.articleService.findArticlesByCategory(category, queryParams);
|
|
54
38
|
}
|
|
@@ -61,9 +45,8 @@ let ArticleController = class ArticleController {
|
|
|
61
45
|
getArchives() {
|
|
62
46
|
return this.articleService.getArchives();
|
|
63
47
|
}
|
|
64
|
-
recommend(articleId
|
|
65
|
-
|
|
66
|
-
return this.articleService.recommend(articleId, size);
|
|
48
|
+
recommend(articleId) {
|
|
49
|
+
return this.articleService.recommend(articleId);
|
|
67
50
|
}
|
|
68
51
|
async findById(req, id, status) {
|
|
69
52
|
let token = req.headers.authorization;
|
|
@@ -98,154 +81,116 @@ let ArticleController = class ArticleController {
|
|
|
98
81
|
}
|
|
99
82
|
};
|
|
100
83
|
__decorate([
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
__param(0,
|
|
84
|
+
swagger_1.ApiResponse({ status: 200, description: '创建文章', type: [article_entity_1.Article] }),
|
|
85
|
+
common_1.Post(),
|
|
86
|
+
roles_guard_1.Roles('admin'),
|
|
87
|
+
common_1.UseGuards(jwt_auth_guard_1.JwtAuthGuard),
|
|
88
|
+
__param(0, common_1.Body()),
|
|
106
89
|
__metadata("design:type", Function),
|
|
107
90
|
__metadata("design:paramtypes", [Object]),
|
|
108
91
|
__metadata("design:returntype", void 0)
|
|
109
92
|
], ArticleController.prototype, "create", null);
|
|
110
93
|
__decorate([
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
__param(0,
|
|
94
|
+
common_1.Get(),
|
|
95
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
96
|
+
__param(0, common_1.Query()),
|
|
114
97
|
__metadata("design:type", Function),
|
|
115
98
|
__metadata("design:paramtypes", [Object]),
|
|
116
99
|
__metadata("design:returntype", void 0)
|
|
117
100
|
], ArticleController.prototype, "findAll", null);
|
|
118
101
|
__decorate([
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
(0, common_1.
|
|
122
|
-
__param(0, (0, common_1.Request)()),
|
|
123
|
-
__param(1, (0, common_1.Query)()),
|
|
124
|
-
__metadata("design:type", Function),
|
|
125
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
126
|
-
__metadata("design:returntype", void 0)
|
|
127
|
-
], ArticleController.prototype, "findHeadless", null);
|
|
128
|
-
__decorate([
|
|
129
|
-
(0, common_1.Get)(':id/revisions'),
|
|
130
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
131
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
132
|
-
__param(0, (0, common_1.Param)('id')),
|
|
133
|
-
__metadata("design:type", Function),
|
|
134
|
-
__metadata("design:paramtypes", [String]),
|
|
135
|
-
__metadata("design:returntype", void 0)
|
|
136
|
-
], ArticleController.prototype, "listRevisions", null);
|
|
137
|
-
__decorate([
|
|
138
|
-
(0, common_1.Post)(':id/revisions/:revisionId/restore'),
|
|
139
|
-
(0, roles_guard_1.Roles)('admin'),
|
|
140
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
141
|
-
__param(0, (0, common_1.Param)('id')),
|
|
142
|
-
__param(1, (0, common_1.Param)('revisionId')),
|
|
143
|
-
__metadata("design:type", Function),
|
|
144
|
-
__metadata("design:paramtypes", [String, String]),
|
|
145
|
-
__metadata("design:returntype", void 0)
|
|
146
|
-
], ArticleController.prototype, "restoreRevision", null);
|
|
147
|
-
__decorate([
|
|
148
|
-
(0, common_1.Get)('/category/:id'),
|
|
149
|
-
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
150
|
-
__param(0, (0, common_1.Param)('id')),
|
|
151
|
-
__param(1, (0, common_1.Query)()),
|
|
102
|
+
common_1.Get('/category/:id'),
|
|
103
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
104
|
+
__param(0, common_1.Param('id')), __param(1, common_1.Query()),
|
|
152
105
|
__metadata("design:type", Function),
|
|
153
106
|
__metadata("design:paramtypes", [Object, Object]),
|
|
154
107
|
__metadata("design:returntype", void 0)
|
|
155
108
|
], ArticleController.prototype, "findArticlesByCategory", null);
|
|
156
109
|
__decorate([
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
__param(0,
|
|
160
|
-
__param(1, (0, common_1.Query)()),
|
|
110
|
+
common_1.Get('/tag/:id'),
|
|
111
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
112
|
+
__param(0, common_1.Param('id')), __param(1, common_1.Query()),
|
|
161
113
|
__metadata("design:type", Function),
|
|
162
114
|
__metadata("design:paramtypes", [Object, Object]),
|
|
163
115
|
__metadata("design:returntype", void 0)
|
|
164
116
|
], ArticleController.prototype, "findArticlesByTag", null);
|
|
165
117
|
__decorate([
|
|
166
|
-
|
|
167
|
-
|
|
118
|
+
common_1.Get('/all/recommend'),
|
|
119
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
168
120
|
__metadata("design:type", Function),
|
|
169
121
|
__metadata("design:paramtypes", []),
|
|
170
122
|
__metadata("design:returntype", void 0)
|
|
171
123
|
], ArticleController.prototype, "getRecommendArticles", null);
|
|
172
124
|
__decorate([
|
|
173
|
-
|
|
174
|
-
|
|
125
|
+
common_1.Get('/archives'),
|
|
126
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
175
127
|
__metadata("design:type", Function),
|
|
176
128
|
__metadata("design:paramtypes", []),
|
|
177
129
|
__metadata("design:returntype", Promise)
|
|
178
130
|
], ArticleController.prototype, "getArchives", null);
|
|
179
131
|
__decorate([
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
__param(0,
|
|
183
|
-
__param(1, (0, common_1.Query)('pageSize')),
|
|
132
|
+
common_1.Get('/recommend'),
|
|
133
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
134
|
+
__param(0, common_1.Query('articleId')),
|
|
184
135
|
__metadata("design:type", Function),
|
|
185
|
-
__metadata("design:paramtypes", [Object
|
|
136
|
+
__metadata("design:paramtypes", [Object]),
|
|
186
137
|
__metadata("design:returntype", void 0)
|
|
187
138
|
], ArticleController.prototype, "recommend", null);
|
|
188
139
|
__decorate([
|
|
189
|
-
|
|
190
|
-
__param(0, (
|
|
191
|
-
__param(1, (0, common_1.Param)('id')),
|
|
192
|
-
__param(2, (0, common_1.Query)('status')),
|
|
140
|
+
common_1.Get(':id'),
|
|
141
|
+
__param(0, common_1.Request()), __param(1, common_1.Param('id')), __param(2, common_1.Query('status')),
|
|
193
142
|
__metadata("design:type", Function),
|
|
194
143
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
195
144
|
__metadata("design:returntype", Promise)
|
|
196
145
|
], ArticleController.prototype, "findById", null);
|
|
197
146
|
__decorate([
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
__param(0,
|
|
201
|
-
__param(1, (0, common_1.Body)()),
|
|
147
|
+
common_1.Post(':id/checkPassword'),
|
|
148
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
149
|
+
__param(0, common_1.Param('id')), __param(1, common_1.Body()),
|
|
202
150
|
__metadata("design:type", Function),
|
|
203
151
|
__metadata("design:paramtypes", [Object, Object]),
|
|
204
152
|
__metadata("design:returntype", void 0)
|
|
205
153
|
], ArticleController.prototype, "checkPassword", null);
|
|
206
154
|
__decorate([
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
__param(0,
|
|
155
|
+
common_1.Post(':id/views'),
|
|
156
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
157
|
+
__param(0, common_1.Param('id')),
|
|
210
158
|
__metadata("design:type", Function),
|
|
211
159
|
__metadata("design:paramtypes", [Object]),
|
|
212
160
|
__metadata("design:returntype", void 0)
|
|
213
161
|
], ArticleController.prototype, "updateViewsById", null);
|
|
214
162
|
__decorate([
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
__param(0, (
|
|
218
|
-
__param(1, (0, common_1.Body)('type')),
|
|
163
|
+
common_1.Post(':id/likes'),
|
|
164
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
165
|
+
__param(0, common_1.Param('id')), __param(1, common_1.Body('type')),
|
|
219
166
|
__metadata("design:type", Function),
|
|
220
167
|
__metadata("design:paramtypes", [Object, Object]),
|
|
221
168
|
__metadata("design:returntype", void 0)
|
|
222
169
|
], ArticleController.prototype, "updateLikesById", null);
|
|
223
170
|
__decorate([
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
__param(0,
|
|
229
|
-
__param(1, (0, common_1.Body)()),
|
|
171
|
+
common_1.Patch(':id'),
|
|
172
|
+
roles_guard_1.Roles('admin'),
|
|
173
|
+
common_1.UseGuards(jwt_auth_guard_1.JwtAuthGuard),
|
|
174
|
+
common_1.HttpCode(common_1.HttpStatus.OK),
|
|
175
|
+
__param(0, common_1.Param('id')), __param(1, common_1.Body()),
|
|
230
176
|
__metadata("design:type", Function),
|
|
231
177
|
__metadata("design:paramtypes", [Object, Object]),
|
|
232
178
|
__metadata("design:returntype", void 0)
|
|
233
179
|
], ArticleController.prototype, "updateById", null);
|
|
234
180
|
__decorate([
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
__param(0,
|
|
181
|
+
common_1.Delete(':id'),
|
|
182
|
+
roles_guard_1.Roles('admin'),
|
|
183
|
+
common_1.UseGuards(jwt_auth_guard_1.JwtAuthGuard),
|
|
184
|
+
__param(0, common_1.Param('id')),
|
|
239
185
|
__metadata("design:type", Function),
|
|
240
186
|
__metadata("design:paramtypes", [Object]),
|
|
241
187
|
__metadata("design:returntype", void 0)
|
|
242
188
|
], ArticleController.prototype, "deleteById", null);
|
|
243
189
|
ArticleController = __decorate([
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
190
|
+
swagger_1.ApiTags('Article'),
|
|
191
|
+
common_1.Controller('article'),
|
|
192
|
+
common_1.UseGuards(roles_guard_1.RolesGuard),
|
|
247
193
|
__metadata("design:paramtypes", [article_service_1.ArticleService,
|
|
248
|
-
api_key_service_1.ApiKeyService,
|
|
249
194
|
jwt_1.JwtService,
|
|
250
195
|
user_service_1.UserService])
|
|
251
196
|
], ArticleController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.controller.js","sourceRoot":"","sources":["../../../src/modules/article/article.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"article.controller.js","sourceRoot":"","sources":["../../../src/modules/article/article.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAawB;AACxB,qCAAyC;AACzC,6CAAuD;AAEvD,2DAAsD;AACtD,qDAAwD;AAExD,uDAAmD;AACnD,qDAA2C;AAC3C,uDAAmD;AAKnD,IAAa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CAAC,EAAE,CAAC;IACP,WAAA,cAAK,CAAC,IAAI,CAAC,CAAA;;;;wDAE3B;AAOD;IAFC,aAAI,CAAC,WAAW,CAAC;IACjB,iBAAQ,CAAC,mBAAU,CAAC,EAAE,CAAC;IACP,WAAA,cAAK,CAAC,IAAI,CAAC,CAAA,EAAM,WAAA,aAAI,CAAC,MAAM,CAAC,CAAA;;;;wDAE7C;AAWD;IAJC,cAAK,CAAC,KAAK,CAAC;IACZ,mBAAK,CAAC,OAAO,CAAC;IACd,kBAAS,CAAC,6BAAY,CAAC;IACvB,iBAAQ,CAAC,mBAAU,CAAC,EAAE,CAAC;IACZ,WAAA,cAAK,CAAC,IAAI,CAAC,CAAA,EAAM,WAAA,aAAI,EAAE,CAAA;;;;mDAElC;AASD;IAHC,eAAM,CAAC,KAAK,CAAC;IACb,mBAAK,CAAC,OAAO,CAAC;IACd,kBAAS,CAAC,6BAAY,CAAC;IACZ,WAAA,cAAK,CAAC,IAAI,CAAC,CAAA;;;;mDAEtB;AArJU,iBAAiB;IAH7B,iBAAO,CAAC,SAAS,CAAC;IAClB,mBAAU,CAAC,SAAS,CAAC;IACrB,kBAAS,CAAC,wBAAU,CAAC;qCAGe,gCAAc;QAElB,gBAAU;QACT,0BAAW;GALhC,iBAAiB,CAsJ7B;AAtJY,8CAAiB"}
|
|
@@ -5,9 +5,6 @@ export declare class Article {
|
|
|
5
5
|
title: string;
|
|
6
6
|
cover: string;
|
|
7
7
|
summary: string;
|
|
8
|
-
slug: string;
|
|
9
|
-
seoKeywords: string;
|
|
10
|
-
seoDescription: string;
|
|
11
8
|
content: string;
|
|
12
9
|
html: string;
|
|
13
10
|
toc: string;
|
|
@@ -21,7 +18,6 @@ export declare class Article {
|
|
|
21
18
|
needPassword: boolean;
|
|
22
19
|
isCommentable: boolean;
|
|
23
20
|
publishAt: Date;
|
|
24
|
-
scheduledPublishAt: Date;
|
|
25
21
|
createAt: Date;
|
|
26
22
|
updateAt: Date;
|
|
27
23
|
}
|
|
@@ -17,115 +17,95 @@ const tag_entity_1 = require("../tag/tag.entity");
|
|
|
17
17
|
let Article = class Article {
|
|
18
18
|
};
|
|
19
19
|
__decorate([
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
swagger_1.ApiProperty(),
|
|
21
|
+
typeorm_1.PrimaryGeneratedColumn('uuid'),
|
|
22
22
|
__metadata("design:type", String)
|
|
23
23
|
], Article.prototype, "id", void 0);
|
|
24
24
|
__decorate([
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
swagger_1.ApiProperty(),
|
|
26
|
+
typeorm_1.Column(),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
28
|
], Article.prototype, "title", void 0);
|
|
29
29
|
__decorate([
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
swagger_1.ApiProperty(),
|
|
31
|
+
typeorm_1.Column({ default: null }),
|
|
32
32
|
__metadata("design:type", String)
|
|
33
33
|
], Article.prototype, "cover", void 0);
|
|
34
34
|
__decorate([
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
swagger_1.ApiProperty(),
|
|
36
|
+
typeorm_1.Column({ type: 'text', default: null }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], Article.prototype, "summary", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], Article.prototype, "slug", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, swagger_1.ApiProperty)({ description: 'SEO 关键词,逗号分隔' }),
|
|
46
|
-
(0, typeorm_1.Column)({ type: 'text', default: null }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], Article.prototype, "seoKeywords", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, swagger_1.ApiProperty)({ description: 'SEO 描述(meta description)' }),
|
|
51
|
-
(0, typeorm_1.Column)({ type: 'text', default: null }),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], Article.prototype, "seoDescription", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, swagger_1.ApiProperty)(),
|
|
56
|
-
(0, typeorm_1.Column)({ type: 'text', default: null }),
|
|
40
|
+
swagger_1.ApiProperty(),
|
|
41
|
+
typeorm_1.Column({ type: 'mediumtext', default: null, charset: 'utf8mb4' }),
|
|
57
42
|
__metadata("design:type", String)
|
|
58
43
|
], Article.prototype, "content", void 0);
|
|
59
44
|
__decorate([
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
swagger_1.ApiProperty(),
|
|
46
|
+
typeorm_1.Column({ type: 'mediumtext', default: null, charset: 'utf8mb4' }),
|
|
62
47
|
__metadata("design:type", String)
|
|
63
48
|
], Article.prototype, "html", void 0);
|
|
64
49
|
__decorate([
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
swagger_1.ApiProperty(),
|
|
51
|
+
typeorm_1.Column({ type: 'mediumtext', default: null }),
|
|
67
52
|
__metadata("design:type", String)
|
|
68
53
|
], Article.prototype, "toc", void 0);
|
|
69
54
|
__decorate([
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
swagger_1.ApiProperty(),
|
|
56
|
+
typeorm_1.ManyToOne(() => category_entity_1.Category, (category) => category.articles, { cascade: true }),
|
|
57
|
+
typeorm_1.JoinTable(),
|
|
73
58
|
__metadata("design:type", category_entity_1.Category)
|
|
74
59
|
], Article.prototype, "category", void 0);
|
|
75
60
|
__decorate([
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
swagger_1.ApiProperty(),
|
|
62
|
+
typeorm_1.ManyToMany(() => tag_entity_1.Tag, (tag) => tag.articles, { cascade: true }),
|
|
63
|
+
typeorm_1.JoinTable(),
|
|
79
64
|
__metadata("design:type", Array)
|
|
80
65
|
], Article.prototype, "tags", void 0);
|
|
81
66
|
__decorate([
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
swagger_1.ApiProperty(),
|
|
68
|
+
typeorm_1.Column('simple-enum', { enum: ['draft', 'publish'] }),
|
|
84
69
|
__metadata("design:type", String)
|
|
85
70
|
], Article.prototype, "status", void 0);
|
|
86
71
|
__decorate([
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
swagger_1.ApiProperty(),
|
|
73
|
+
typeorm_1.Column({ type: 'int', default: 0 }),
|
|
89
74
|
__metadata("design:type", Number)
|
|
90
75
|
], Article.prototype, "views", void 0);
|
|
91
76
|
__decorate([
|
|
92
|
-
|
|
93
|
-
|
|
77
|
+
swagger_1.ApiProperty(),
|
|
78
|
+
typeorm_1.Column({ type: 'int', default: 0 }),
|
|
94
79
|
__metadata("design:type", Number)
|
|
95
80
|
], Article.prototype, "likes", void 0);
|
|
96
81
|
__decorate([
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
swagger_1.ApiProperty(),
|
|
83
|
+
typeorm_1.Column({ type: 'boolean', default: false }),
|
|
99
84
|
__metadata("design:type", Boolean)
|
|
100
85
|
], Article.prototype, "isRecommended", void 0);
|
|
101
86
|
__decorate([
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
swagger_1.ApiProperty(),
|
|
88
|
+
typeorm_1.Column({ type: 'text', default: null, select: false }),
|
|
104
89
|
__metadata("design:type", String)
|
|
105
90
|
], Article.prototype, "password", void 0);
|
|
106
91
|
__decorate([
|
|
107
|
-
|
|
108
|
-
|
|
92
|
+
swagger_1.ApiProperty(),
|
|
93
|
+
typeorm_1.Column({ type: 'boolean', default: false }),
|
|
109
94
|
__metadata("design:type", Boolean)
|
|
110
95
|
], Article.prototype, "needPassword", void 0);
|
|
111
96
|
__decorate([
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
swagger_1.ApiProperty(),
|
|
98
|
+
typeorm_1.Column({ type: 'boolean', default: true }),
|
|
114
99
|
__metadata("design:type", Boolean)
|
|
115
100
|
], Article.prototype, "isCommentable", void 0);
|
|
116
101
|
__decorate([
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
swagger_1.ApiProperty(),
|
|
103
|
+
typeorm_1.Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
119
104
|
__metadata("design:type", Date)
|
|
120
105
|
], Article.prototype, "publishAt", void 0);
|
|
121
106
|
__decorate([
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
__metadata("design:type", Date)
|
|
125
|
-
], Article.prototype, "scheduledPublishAt", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
(0, swagger_1.ApiProperty)(),
|
|
128
|
-
(0, typeorm_1.CreateDateColumn)({
|
|
107
|
+
swagger_1.ApiProperty(),
|
|
108
|
+
typeorm_1.CreateDateColumn({
|
|
129
109
|
type: 'datetime',
|
|
130
110
|
comment: '创建时间',
|
|
131
111
|
name: 'create_at',
|
|
@@ -133,8 +113,8 @@ __decorate([
|
|
|
133
113
|
__metadata("design:type", Date)
|
|
134
114
|
], Article.prototype, "createAt", void 0);
|
|
135
115
|
__decorate([
|
|
136
|
-
|
|
137
|
-
|
|
116
|
+
swagger_1.ApiProperty(),
|
|
117
|
+
typeorm_1.UpdateDateColumn({
|
|
138
118
|
type: 'datetime',
|
|
139
119
|
comment: '更新时间',
|
|
140
120
|
name: 'update_at',
|
|
@@ -142,7 +122,7 @@ __decorate([
|
|
|
142
122
|
__metadata("design:type", Date)
|
|
143
123
|
], Article.prototype, "updateAt", void 0);
|
|
144
124
|
Article = __decorate([
|
|
145
|
-
|
|
125
|
+
typeorm_1.Entity()
|
|
146
126
|
], Article);
|
|
147
127
|
exports.Article = Article;
|
|
148
128
|
//# sourceMappingURL=article.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.entity.js","sourceRoot":"","sources":["../../../src/modules/article/article.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCASiB;AAEjB,iEAAuD;AACvD,kDAAwC;
|
|
1
|
+
{"version":3,"file":"article.entity.js","sourceRoot":"","sources":["../../../src/modules/article/article.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;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IAAI;yCAAC;AArFJ,OAAO;IADnB,gBAAM,EAAE;GACI,OAAO,CAsFnB;AAtFY,0BAAO"}
|
|
@@ -9,35 +9,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.ArticleModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
-
const api_key_module_1 = require("../api-key/api-key.module");
|
|
13
12
|
const auth_module_1 = require("../auth/auth.module");
|
|
14
|
-
const category_entity_1 = require("../category/category.entity");
|
|
15
13
|
const category_module_1 = require("../category/category.module");
|
|
16
|
-
const tag_entity_1 = require("../tag/tag.entity");
|
|
17
14
|
const tag_module_1 = require("../tag/tag.module");
|
|
18
15
|
const user_module_1 = require("../user/user.module");
|
|
19
|
-
const webhook_module_1 = require("../webhook/webhook.module");
|
|
20
|
-
const bootstrap_service_1 = require("../bootstrap/bootstrap.service");
|
|
21
16
|
const article_controller_1 = require("./article.controller");
|
|
22
17
|
const article_entity_1 = require("./article.entity");
|
|
23
18
|
const article_service_1 = require("./article.service");
|
|
24
|
-
const article_revision_entity_1 = require("./article-revision.entity");
|
|
25
|
-
const scheduled_publish_service_1 = require("./scheduled-publish.service");
|
|
26
19
|
let ArticleModule = class ArticleModule {
|
|
27
20
|
};
|
|
28
21
|
ArticleModule = __decorate([
|
|
29
|
-
|
|
30
|
-
imports: [
|
|
31
|
-
typeorm_1.TypeOrmModule.forFeature([article_entity_1.Article, article_revision_entity_1.ArticleRevision, category_entity_1.Category, tag_entity_1.Tag]),
|
|
32
|
-
category_module_1.CategoryModule,
|
|
33
|
-
tag_module_1.TagModule,
|
|
34
|
-
user_module_1.UserModule,
|
|
35
|
-
auth_module_1.AuthModule,
|
|
36
|
-
api_key_module_1.ApiKeyModule,
|
|
37
|
-
webhook_module_1.WebhookModule,
|
|
38
|
-
],
|
|
22
|
+
common_1.Module({
|
|
23
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([article_entity_1.Article]), category_module_1.CategoryModule, tag_module_1.TagModule, user_module_1.UserModule, auth_module_1.AuthModule],
|
|
39
24
|
exports: [article_service_1.ArticleService],
|
|
40
|
-
providers: [article_service_1.ArticleService
|
|
25
|
+
providers: [article_service_1.ArticleService],
|
|
41
26
|
controllers: [article_controller_1.ArticleController],
|
|
42
27
|
})
|
|
43
28
|
], ArticleModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.module.js","sourceRoot":"","sources":["../../../src/modules/article/article.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,
|
|
1
|
+
{"version":3,"file":"article.module.js","sourceRoot":"","sources":["../../../src/modules/article/article.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,qDAAiD;AACjD,iEAA6D;AAC7D,kDAA8C;AAC9C,qDAAiD;AACjD,6DAAyD;AACzD,qDAA2C;AAC3C,uDAAmD;AAQnD,IAAa,aAAa,GAA1B,MAAa,aAAa;CAAG,CAAA;AAAhB,aAAa;IANzB,eAAM,CAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,EAAE,gCAAc,EAAE,sBAAS,EAAE,wBAAU,EAAE,wBAAU,CAAC;QACjG,OAAO,EAAE,CAAC,gCAAc,CAAC;QACzB,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,WAAW,EAAE,CAAC,sCAAiB,CAAC;KACjC,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa"}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
2
|
import { CategoryService } from '../category/category.service';
|
|
3
|
-
import { HookService } from '../hook/hook.service';
|
|
4
3
|
import { TagService } from '../tag/tag.service';
|
|
5
|
-
import { WebhookService } from '../webhook/webhook.service';
|
|
6
4
|
import { Article } from './article.entity';
|
|
7
|
-
import { ArticleRevision } from './article-revision.entity';
|
|
8
5
|
export declare class ArticleService {
|
|
9
6
|
private readonly articleRepository;
|
|
10
|
-
private readonly revisionRepository;
|
|
11
7
|
private readonly tagService;
|
|
12
8
|
private readonly categoryService;
|
|
13
|
-
|
|
14
|
-
private readonly hookService;
|
|
15
|
-
constructor(articleRepository: Repository<Article>, revisionRepository: Repository<ArticleRevision>, tagService: TagService, categoryService: CategoryService, webhookService: WebhookService, hookService: HookService);
|
|
16
|
-
private saveRevision;
|
|
17
|
-
private notifyPublished;
|
|
18
|
-
private applyPublishFilters;
|
|
19
|
-
private normalizeSeoPayload;
|
|
20
|
-
private applyPublishFilterPatch;
|
|
21
|
-
private assertSlugAvailable;
|
|
9
|
+
constructor(articleRepository: Repository<Article>, tagService: TagService, categoryService: CategoryService);
|
|
22
10
|
create(article: Partial<Article>): Promise<Article>;
|
|
23
11
|
findAll(queryParams: any): Promise<[Article[], number]>;
|
|
24
12
|
findArticlesByCategory(category: any, queryParams: any): Promise<(number | Article[])[]>;
|
|
@@ -34,11 +22,9 @@ export declare class ArticleService {
|
|
|
34
22
|
}>;
|
|
35
23
|
findById(id: any, status?: any, isAdmin?: boolean): Promise<Article>;
|
|
36
24
|
updateById(id: any, article: Partial<Article>): Promise<Article>;
|
|
37
|
-
listRevisions(articleId: string): Promise<ArticleRevision[]>;
|
|
38
|
-
restoreRevision(articleId: string, revisionId: string): Promise<Article>;
|
|
39
25
|
updateViewsById(id: any): Promise<Article>;
|
|
40
26
|
updateLikesById(id: any, type: any): Promise<Article>;
|
|
41
27
|
deleteById(id: any): Promise<Article>;
|
|
42
28
|
search(keyword: any): Promise<Article[]>;
|
|
43
|
-
recommend(articleId?: any
|
|
29
|
+
recommend(articleId?: any): Promise<Article[]>;
|
|
44
30
|
}
|