@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.
Files changed (312) hide show
  1. package/dist/app.module.js +9 -46
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/common/api-messages.d.ts +9 -0
  4. package/dist/common/api-messages.js +9 -0
  5. package/dist/common/api-messages.js.map +1 -1
  6. package/dist/database/typeorm-options.d.ts +3 -0
  7. package/dist/database/typeorm-options.js +60 -0
  8. package/dist/database/typeorm-options.js.map +1 -0
  9. package/dist/filters/http-exception.filter.js +1 -1
  10. package/dist/filters/http-exception.filter.js.map +1 -1
  11. package/dist/generate-swagger.js +11 -11
  12. package/dist/generate-swagger.js.map +1 -1
  13. package/dist/interceptors/transform.interceptor.d.ts +2 -6
  14. package/dist/interceptors/transform.interceptor.js +10 -5
  15. package/dist/interceptors/transform.interceptor.js.map +1 -1
  16. package/dist/logger/index.js +5 -4
  17. package/dist/logger/index.js.map +1 -1
  18. package/dist/main.js +44 -23
  19. package/dist/main.js.map +1 -1
  20. package/dist/modules/api-key/api-key.controller.js +9 -9
  21. package/dist/modules/api-key/api-key.controller.js.map +1 -1
  22. package/dist/modules/api-key/api-key.entity.js +16 -16
  23. package/dist/modules/api-key/api-key.entity.js.map +1 -1
  24. package/dist/modules/api-key/api-key.guard.js +3 -4
  25. package/dist/modules/api-key/api-key.guard.js.map +1 -1
  26. package/dist/modules/api-key/api-key.module.js +1 -1
  27. package/dist/modules/api-key/api-key.module.js.map +1 -1
  28. package/dist/modules/api-key/api-key.service.js +3 -3
  29. package/dist/modules/api-key/api-key.service.js.map +1 -1
  30. package/dist/modules/article/article-revision.entity.js +9 -9
  31. package/dist/modules/article/article-revision.entity.js.map +1 -1
  32. package/dist/modules/article/article-slug.util.d.ts +2 -0
  33. package/dist/modules/article/article-slug.util.js +19 -0
  34. package/dist/modules/article/article-slug.util.js.map +1 -0
  35. package/dist/modules/article/article.controller.d.ts +1 -1
  36. package/dist/modules/article/article.controller.js +71 -60
  37. package/dist/modules/article/article.controller.js.map +1 -1
  38. package/dist/modules/article/article.entity.d.ts +3 -0
  39. package/dist/modules/article/article.entity.js +58 -43
  40. package/dist/modules/article/article.entity.js.map +1 -1
  41. package/dist/modules/article/article.module.js +7 -4
  42. package/dist/modules/article/article.module.js.map +1 -1
  43. package/dist/modules/article/article.service.d.ts +9 -3
  44. package/dist/modules/article/article.service.js +98 -30
  45. package/dist/modules/article/article.service.js.map +1 -1
  46. package/dist/modules/article/scheduled-publish.service.js +3 -3
  47. package/dist/modules/article/scheduled-publish.service.js.map +1 -1
  48. package/dist/modules/auth/auth.controller.js +11 -11
  49. package/dist/modules/auth/auth.controller.js.map +1 -1
  50. package/dist/modules/auth/auth.module.js +4 -4
  51. package/dist/modules/auth/auth.module.js.map +1 -1
  52. package/dist/modules/auth/auth.service.js +5 -5
  53. package/dist/modules/auth/auth.service.js.map +1 -1
  54. package/dist/modules/auth/jwt-auth.guard.js +3 -3
  55. package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
  56. package/dist/modules/auth/jwt.strategy.js +3 -3
  57. package/dist/modules/auth/jwt.strategy.js.map +1 -1
  58. package/dist/modules/auth/roles.guard.js +2 -2
  59. package/dist/modules/auth/roles.guard.js.map +1 -1
  60. package/dist/modules/bootstrap/bootstrap.constants.d.ts +20 -0
  61. package/dist/modules/bootstrap/bootstrap.constants.js +171 -0
  62. package/dist/modules/bootstrap/bootstrap.constants.js.map +1 -0
  63. package/dist/modules/bootstrap/bootstrap.service.d.ts +22 -0
  64. package/dist/modules/bootstrap/bootstrap.service.js +183 -0
  65. package/dist/modules/bootstrap/bootstrap.service.js.map +1 -0
  66. package/dist/modules/bootstrap/install-locale.d.ts +2 -0
  67. package/dist/modules/bootstrap/install-locale.js +11 -0
  68. package/dist/modules/bootstrap/install-locale.js.map +1 -0
  69. package/dist/modules/category/category.controller.js +21 -20
  70. package/dist/modules/category/category.controller.js.map +1 -1
  71. package/dist/modules/category/category.entity.js +13 -13
  72. package/dist/modules/category/category.entity.js.map +1 -1
  73. package/dist/modules/category/category.module.js +1 -1
  74. package/dist/modules/category/category.module.js.map +1 -1
  75. package/dist/modules/category/category.service.js +3 -3
  76. package/dist/modules/category/category.service.js.map +1 -1
  77. package/dist/modules/comment/comment.controller.js +24 -20
  78. package/dist/modules/comment/comment.controller.js.map +1 -1
  79. package/dist/modules/comment/comment.entity.js +31 -31
  80. package/dist/modules/comment/comment.entity.js.map +1 -1
  81. package/dist/modules/comment/comment.module.js +2 -2
  82. package/dist/modules/comment/comment.module.js.map +1 -1
  83. package/dist/modules/comment/comment.service.d.ts +3 -1
  84. package/dist/modules/comment/comment.service.js +31 -14
  85. package/dist/modules/comment/comment.service.js.map +1 -1
  86. package/dist/modules/comment/html.d.ts +1 -1
  87. package/dist/modules/comment/html.js +3 -3
  88. package/dist/modules/comment/html.js.map +1 -1
  89. package/dist/modules/extension/extension.module.d.ts +9 -0
  90. package/dist/modules/extension/extension.module.js +50 -0
  91. package/dist/modules/extension/extension.module.js.map +1 -0
  92. package/dist/modules/extension/plugin-loader.service.d.ts +12 -0
  93. package/dist/modules/extension/plugin-loader.service.js +96 -0
  94. package/dist/modules/extension/plugin-loader.service.js.map +1 -0
  95. package/dist/modules/extension/plugin-registry.bridge.d.ts +3 -0
  96. package/dist/modules/extension/plugin-registry.bridge.js +44 -0
  97. package/dist/modules/extension/plugin-registry.bridge.js.map +1 -0
  98. package/dist/modules/extension/plugin.controller.d.ts +22 -0
  99. package/dist/modules/extension/plugin.controller.js +155 -0
  100. package/dist/modules/extension/plugin.controller.js.map +1 -0
  101. package/dist/modules/extension/plugin.service.d.ts +52 -0
  102. package/dist/modules/extension/plugin.service.js +391 -0
  103. package/dist/modules/extension/plugin.service.js.map +1 -0
  104. package/dist/modules/extension/preview-draft.store.d.ts +13 -0
  105. package/dist/modules/extension/preview-draft.store.js +41 -0
  106. package/dist/modules/extension/preview-draft.store.js.map +1 -0
  107. package/dist/modules/extension/theme-registry.bridge.d.ts +56 -0
  108. package/dist/modules/extension/theme-registry.bridge.js +46 -0
  109. package/dist/modules/extension/theme-registry.bridge.js.map +1 -0
  110. package/dist/modules/extension/theme.controller.d.ts +66 -0
  111. package/dist/modules/extension/theme.controller.js +301 -0
  112. package/dist/modules/extension/theme.controller.js.map +1 -0
  113. package/dist/modules/extension/theme.service.d.ts +140 -0
  114. package/dist/modules/extension/theme.service.js +1039 -0
  115. package/dist/modules/extension/theme.service.js.map +1 -0
  116. package/dist/modules/file/file-optimization.controller.d.ts +12 -0
  117. package/dist/modules/file/file-optimization.controller.js +79 -0
  118. package/dist/modules/file/file-optimization.controller.js.map +1 -0
  119. package/dist/modules/file/file-optimization.service.d.ts +36 -0
  120. package/dist/modules/file/file-optimization.service.js +385 -0
  121. package/dist/modules/file/file-optimization.service.js.map +1 -0
  122. package/dist/modules/file/file-optimization.types.d.ts +66 -0
  123. package/dist/modules/file/file-optimization.types.js +5 -0
  124. package/dist/modules/file/file-optimization.types.js.map +1 -0
  125. package/dist/modules/file/file.controller.d.ts +1 -1
  126. package/dist/modules/file/file.controller.js +22 -20
  127. package/dist/modules/file/file.controller.js.map +1 -1
  128. package/dist/modules/file/file.entity.d.ts +7 -0
  129. package/dist/modules/file/file.entity.js +20 -15
  130. package/dist/modules/file/file.entity.js.map +1 -1
  131. package/dist/modules/file/file.module.js +16 -4
  132. package/dist/modules/file/file.module.js.map +1 -1
  133. package/dist/modules/file/file.service.d.ts +5 -1
  134. package/dist/modules/file/file.service.js +70 -24
  135. package/dist/modules/file/file.service.js.map +1 -1
  136. package/dist/modules/file/image-optimizer-plugin.guard.d.ts +7 -0
  137. package/dist/modules/file/image-optimizer-plugin.guard.js +33 -0
  138. package/dist/modules/file/image-optimizer-plugin.guard.js.map +1 -0
  139. package/dist/modules/health/health.controller.js +7 -9
  140. package/dist/modules/health/health.controller.js.map +1 -1
  141. package/dist/modules/health/health.module.js +1 -1
  142. package/dist/modules/health/health.module.js.map +1 -1
  143. package/dist/modules/hook/hook.module.d.ts +2 -0
  144. package/dist/modules/hook/hook.module.js +22 -0
  145. package/dist/modules/hook/hook.module.js.map +1 -0
  146. package/dist/modules/hook/hook.service.d.ts +26 -0
  147. package/dist/modules/hook/hook.service.js +105 -0
  148. package/dist/modules/hook/hook.service.js.map +1 -0
  149. package/dist/modules/install/install.controller.js +5 -5
  150. package/dist/modules/install/install.controller.js.map +1 -1
  151. package/dist/modules/install/install.module.js +1 -1
  152. package/dist/modules/install/install.module.js.map +1 -1
  153. package/dist/modules/install/install.service.js +2 -2
  154. package/dist/modules/install/install.service.js.map +1 -1
  155. package/dist/modules/knowledge/knowledge.controller.js +35 -33
  156. package/dist/modules/knowledge/knowledge.controller.js.map +1 -1
  157. package/dist/modules/knowledge/knowledge.entity.js +33 -33
  158. package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
  159. package/dist/modules/knowledge/knowledge.module.js +1 -1
  160. package/dist/modules/knowledge/knowledge.module.js.map +1 -1
  161. package/dist/modules/knowledge/knowledge.service.js +10 -10
  162. package/dist/modules/knowledge/knowledge.service.js.map +1 -1
  163. package/dist/modules/page/page.controller.js +24 -23
  164. package/dist/modules/page/page.controller.js.map +1 -1
  165. package/dist/modules/page/page.entity.js +27 -27
  166. package/dist/modules/page/page.entity.js.map +1 -1
  167. package/dist/modules/page/page.module.js +1 -1
  168. package/dist/modules/page/page.module.js.map +1 -1
  169. package/dist/modules/page/page.service.js +11 -12
  170. package/dist/modules/page/page.service.js.map +1 -1
  171. package/dist/modules/search/search.controller.js +12 -12
  172. package/dist/modules/search/search.controller.js.map +1 -1
  173. package/dist/modules/search/search.entity.js +13 -13
  174. package/dist/modules/search/search.entity.js.map +1 -1
  175. package/dist/modules/search/search.module.js +1 -1
  176. package/dist/modules/search/search.module.js.map +1 -1
  177. package/dist/modules/search/search.service.js +2 -2
  178. package/dist/modules/search/search.service.js.map +1 -1
  179. package/dist/modules/setting/setting.constant.d.ts +4 -2
  180. package/dist/modules/setting/setting.constant.js +3 -19
  181. package/dist/modules/setting/setting.constant.js.map +1 -1
  182. package/dist/modules/setting/setting.controller.js +11 -11
  183. package/dist/modules/setting/setting.controller.js.map +1 -1
  184. package/dist/modules/setting/setting.entity.d.ts +3 -0
  185. package/dist/modules/setting/setting.entity.js +64 -49
  186. package/dist/modules/setting/setting.entity.js.map +1 -1
  187. package/dist/modules/setting/setting.module.js +2 -2
  188. package/dist/modules/setting/setting.module.js.map +1 -1
  189. package/dist/modules/setting/setting.service.d.ts +13 -2
  190. package/dist/modules/setting/setting.service.js +169 -24
  191. package/dist/modules/setting/setting.service.js.map +1 -1
  192. package/dist/modules/smtp/mail.util.d.ts +7 -6
  193. package/dist/modules/smtp/mail.util.js +5 -9
  194. package/dist/modules/smtp/mail.util.js.map +1 -1
  195. package/dist/modules/smtp/smtp.controller.d.ts +3 -0
  196. package/dist/modules/smtp/smtp.controller.js +27 -14
  197. package/dist/modules/smtp/smtp.controller.js.map +1 -1
  198. package/dist/modules/smtp/smtp.entity.js +15 -15
  199. package/dist/modules/smtp/smtp.entity.js.map +1 -1
  200. package/dist/modules/smtp/smtp.module.js +2 -2
  201. package/dist/modules/smtp/smtp.module.js.map +1 -1
  202. package/dist/modules/smtp/smtp.service.d.ts +14 -0
  203. package/dist/modules/smtp/smtp.service.js +39 -12
  204. package/dist/modules/smtp/smtp.service.js.map +1 -1
  205. package/dist/modules/tag/tag.controller.js +24 -22
  206. package/dist/modules/tag/tag.controller.js.map +1 -1
  207. package/dist/modules/tag/tag.entity.js +12 -12
  208. package/dist/modules/tag/tag.entity.js.map +1 -1
  209. package/dist/modules/tag/tag.module.js +1 -1
  210. package/dist/modules/tag/tag.module.js.map +1 -1
  211. package/dist/modules/tag/tag.service.js +3 -3
  212. package/dist/modules/tag/tag.service.js.map +1 -1
  213. package/dist/modules/user/user.controller.js +36 -26
  214. package/dist/modules/user/user.controller.js.map +1 -1
  215. package/dist/modules/user/user.entity.js +22 -22
  216. package/dist/modules/user/user.entity.js.map +1 -1
  217. package/dist/modules/user/user.module.js +2 -2
  218. package/dist/modules/user/user.module.js.map +1 -1
  219. package/dist/modules/user/user.service.js +7 -4
  220. package/dist/modules/user/user.service.js.map +1 -1
  221. package/dist/modules/view/view.controller.js +20 -19
  222. package/dist/modules/view/view.controller.js.map +1 -1
  223. package/dist/modules/view/view.entity.js +24 -24
  224. package/dist/modules/view/view.entity.js.map +1 -1
  225. package/dist/modules/view/view.module.js +1 -1
  226. package/dist/modules/view/view.module.js.map +1 -1
  227. package/dist/modules/view/view.service.js +4 -4
  228. package/dist/modules/view/view.service.js.map +1 -1
  229. package/dist/modules/webhook/webhook.controller.js +9 -9
  230. package/dist/modules/webhook/webhook.controller.js.map +1 -1
  231. package/dist/modules/webhook/webhook.entity.js +13 -13
  232. package/dist/modules/webhook/webhook.entity.js.map +1 -1
  233. package/dist/modules/webhook/webhook.module.js +1 -1
  234. package/dist/modules/webhook/webhook.module.js.map +1 -1
  235. package/dist/modules/webhook/webhook.service.d.ts +1 -1
  236. package/dist/modules/webhook/webhook.service.js +7 -4
  237. package/dist/modules/webhook/webhook.service.js.map +1 -1
  238. package/dist/public/apple-touch-icon.png +0 -0
  239. package/dist/public/favicon-16.png +0 -0
  240. package/dist/public/favicon-32.png +0 -0
  241. package/dist/public/favicon-48.png +0 -0
  242. package/dist/public/favicon.ico +0 -0
  243. package/dist/public/favicon.png +0 -0
  244. package/dist/public/icon-192.png +0 -0
  245. package/dist/public/icon-512.png +0 -0
  246. package/dist/public/logo-200.png +0 -0
  247. package/dist/public/logo-400.png +0 -0
  248. package/dist/public/logo.png +0 -0
  249. package/dist/public/logo.svg +7 -0
  250. package/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  251. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  252. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  253. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  254. package/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  255. package/dist/starter.d.ts +2 -1
  256. package/dist/starter.js +200 -13
  257. package/dist/starter.js.map +1 -1
  258. package/dist/tsconfig.build.tsbuildinfo +1 -16966
  259. package/dist/tsconfig.tsbuildinfo +1 -0
  260. package/dist/utils/date.util.js +1 -1
  261. package/dist/utils/date.util.js.map +1 -1
  262. package/dist/utils/html-sanitize.util.d.ts +1 -0
  263. package/dist/utils/html-sanitize.util.js +33 -0
  264. package/dist/utils/html-sanitize.util.js.map +1 -0
  265. package/dist/utils/image-processor.util.d.ts +23 -0
  266. package/dist/utils/image-processor.util.js +88 -0
  267. package/dist/utils/image-processor.util.js.map +1 -0
  268. package/dist/utils/local-api-quiet.util.d.ts +1 -0
  269. package/dist/utils/local-api-quiet.util.js +8 -0
  270. package/dist/utils/local-api-quiet.util.js.map +1 -0
  271. package/dist/utils/markdown.util.js +1 -1
  272. package/dist/utils/markdown.util.js.map +1 -1
  273. package/dist/utils/oss/aliyun-oss-client.d.ts +3 -1
  274. package/dist/utils/oss/aliyun-oss-client.js +5 -0
  275. package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
  276. package/dist/utils/oss/oss-client.d.ts +3 -1
  277. package/dist/utils/oss/oss-client.js.map +1 -1
  278. package/dist/utils/oss.util.d.ts +3 -1
  279. package/dist/utils/oss.util.js +5 -1
  280. package/dist/utils/oss.util.js.map +1 -1
  281. package/dist/utils/project-root.util.d.ts +2 -0
  282. package/dist/utils/project-root.util.js +42 -0
  283. package/dist/utils/project-root.util.js.map +1 -0
  284. package/dist/utils/query-whitelist.util.d.ts +1 -0
  285. package/dist/utils/query-whitelist.util.js +100 -0
  286. package/dist/utils/query-whitelist.util.js.map +1 -0
  287. package/dist/utils/uniqueid.util.js +1 -1
  288. package/dist/utils/uniqueid.util.js.map +1 -1
  289. package/dist/utils/upload.util.d.ts +6 -2
  290. package/dist/utils/upload.util.js +23 -8
  291. package/dist/utils/upload.util.js.map +1 -1
  292. package/dist/utils/user.util.d.ts +1 -0
  293. package/dist/utils/user.util.js +6 -2
  294. package/dist/utils/user.util.js.map +1 -1
  295. package/package.json +8 -9
  296. package/public/apple-touch-icon.png +0 -0
  297. package/public/favicon-16.png +0 -0
  298. package/public/favicon-32.png +0 -0
  299. package/public/favicon-48.png +0 -0
  300. package/public/favicon.ico +0 -0
  301. package/public/favicon.png +0 -0
  302. package/public/icon-192.png +0 -0
  303. package/public/icon-512.png +0 -0
  304. package/public/logo-200.png +0 -0
  305. package/public/logo-400.png +0 -0
  306. package/public/logo.png +0 -0
  307. package/public/logo.svg +7 -0
  308. package/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  309. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  310. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  311. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  312. package/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
@@ -11,74 +11,35 @@ const reactpress_toolkit_1 = require("../../toolkit/dist");
11
11
  const common_1 = require("@nestjs/common");
12
12
  const config_1 = require("@nestjs/config");
13
13
  const typeorm_1 = require("@nestjs/typeorm");
14
- const article_entity_1 = require("./modules/article/article.entity");
14
+ const typeorm_options_1 = require("./database/typeorm-options");
15
+ const api_key_module_1 = require("./modules/api-key/api-key.module");
15
16
  const article_module_1 = require("./modules/article/article.module");
16
17
  const auth_module_1 = require("./modules/auth/auth.module");
17
- const category_entity_1 = require("./modules/category/category.entity");
18
18
  const category_module_1 = require("./modules/category/category.module");
19
- const comment_entity_1 = require("./modules/comment/comment.entity");
20
19
  const comment_module_1 = require("./modules/comment/comment.module");
21
- const file_entity_1 = require("./modules/file/file.entity");
20
+ const extension_module_1 = require("./modules/extension/extension.module");
22
21
  const file_module_1 = require("./modules/file/file.module");
23
- const knowledge_entity_1 = require("./modules/knowledge/knowledge.entity");
22
+ const health_module_1 = require("./modules/health/health.module");
23
+ const hook_module_1 = require("./modules/hook/hook.module");
24
24
  const knowledge_module_1 = require("./modules/knowledge/knowledge.module");
25
- const page_entity_1 = require("./modules/page/page.entity");
26
25
  const page_module_1 = require("./modules/page/page.module");
27
- const search_entity_1 = require("./modules/search/search.entity");
28
26
  const search_module_1 = require("./modules/search/search.module");
29
- const setting_entity_1 = require("./modules/setting/setting.entity");
30
27
  const setting_module_1 = require("./modules/setting/setting.module");
31
- const smtp_entity_1 = require("./modules/smtp/smtp.entity");
32
28
  const smtp_module_1 = require("./modules/smtp/smtp.module");
33
- const tag_entity_1 = require("./modules/tag/tag.entity");
34
29
  const tag_module_1 = require("./modules/tag/tag.module");
35
- const user_entity_1 = require("./modules/user/user.entity");
36
30
  const user_module_1 = require("./modules/user/user.module");
37
- const view_entity_1 = require("./modules/view/view.entity");
38
31
  const view_module_1 = require("./modules/view/view.module");
39
- const api_key_entity_1 = require("./modules/api-key/api-key.entity");
40
- const api_key_module_1 = require("./modules/api-key/api-key.module");
41
- const article_revision_entity_1 = require("./modules/article/article-revision.entity");
42
- const health_module_1 = require("./modules/health/health.module");
43
- const webhook_entity_1 = require("./modules/webhook/webhook.entity");
44
32
  const webhook_module_1 = require("./modules/webhook/webhook.module");
45
33
  let AppModule = class AppModule {
46
34
  };
47
35
  AppModule = __decorate([
48
- common_1.Module({
36
+ (0, common_1.Module)({
49
37
  imports: [
50
38
  config_1.ConfigModule.forRoot({ isGlobal: true, envFilePath: [reactpress_toolkit_1.config.file] }),
51
39
  typeorm_1.TypeOrmModule.forRootAsync({
52
40
  imports: [config_1.ConfigModule],
53
41
  inject: [config_1.ConfigService],
54
- useFactory: async (configService) => ({
55
- type: 'mysql',
56
- entities: [
57
- user_entity_1.User,
58
- file_entity_1.File,
59
- knowledge_entity_1.Knowledge,
60
- article_entity_1.Article,
61
- article_revision_entity_1.ArticleRevision,
62
- category_entity_1.Category,
63
- tag_entity_1.Tag,
64
- comment_entity_1.Comment,
65
- setting_entity_1.Setting,
66
- smtp_entity_1.SMTP,
67
- page_entity_1.Page,
68
- view_entity_1.View,
69
- search_entity_1.Search,
70
- api_key_entity_1.ApiKey,
71
- webhook_entity_1.Webhook,
72
- ],
73
- host: configService.get('DB_HOST', '0.0.0.0'),
74
- port: configService.get('DB_PORT', 3306),
75
- username: configService.get('DB_USER', 'root'),
76
- password: configService.get('DB_PASSWD', 'root'),
77
- database: configService.get('DB_DATABASE', 'reactpress'),
78
- charset: 'utf8mb4',
79
- timezone: '+08:00',
80
- synchronize: true,
81
- }),
42
+ useFactory: async (configService) => (0, typeorm_options_1.createTypeOrmOptions)(configService),
82
43
  }),
83
44
  user_module_1.UserModule,
84
45
  file_module_1.FileModule,
@@ -94,8 +55,10 @@ AppModule = __decorate([
94
55
  view_module_1.ViewModule,
95
56
  search_module_1.SearchModule,
96
57
  health_module_1.HealthModule,
58
+ hook_module_1.HookModule,
97
59
  api_key_module_1.ApiKeyModule,
98
60
  webhook_module_1.WebhookModule,
61
+ extension_module_1.ExtensionModule,
99
62
  ],
100
63
  controllers: [],
101
64
  providers: [],
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,2DAAyD;AACzD,2CAAwC;AACxC,2CAA6D;AAC7D,6CAAgD;AAEhD,qEAA2D;AAE3D,qEAAiE;AAEjE,4DAAwD;AACxD,wEAA8D;AAE9D,wEAAoE;AACpE,qEAA2D;AAE3D,qEAAiE;AACjE,4DAAkD;AAElD,4DAAwD;AACxD,2EAAiE;AAEjE,2EAAuE;AACvE,4DAAkD;AAElD,4DAAwD;AAExD,kEAAwD;AACxD,kEAA8D;AAC9D,qEAA2D;AAE3D,qEAAiE;AACjE,4DAAkD;AAElD,4DAAwD;AACxD,yDAA+C;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BAClB,CAAC;aACH,CAAC;YACF,wBAAU;YACV,wBAAU;YACV,sBAAS;YACT,8BAAa;YACb,kCAAe;YACf,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,4BAAY;YACZ,4BAAY;YACZ,6BAAY;YACZ,8BAAa;SACd;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"}
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,2DAAyD;AACzD,2CAAwC;AACxC,2CAA6D;AAC7D,6CAAgD;AAEhD,gEAAkE;AAClE,qEAAgE;AAEhE,qEAAiE;AAEjE,4DAAwD;AAExD,wEAAoE;AAEpE,qEAAiE;AACjE,2EAAuE;AAEvE,4DAAwD;AACxD,kEAA8D;AAC9D,4DAAwD;AAExD,2EAAuE;AAEvE,4DAAwD;AAExD,kEAA8D;AAE9D,qEAAiE;AAEjE,4DAAwD;AAExD,yDAAqD;AAErD,4DAAwD;AAExD,4DAAwD;AACxD,qEAAiE;AAgC1D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IA9BrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,2BAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACpE,uBAAa,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,IAAA,sCAAoB,EAAC,aAAa,CAAC;aACxF,CAAC;YACF,wBAAU;YACV,wBAAU;YACV,sBAAS;YACT,8BAAa;YACb,kCAAe;YACf,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,4BAAY;YACZ,4BAAY;YACZ,wBAAU;YACV,6BAAY;YACZ,8BAAa;YACb,kCAAe;SAChB;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"}
@@ -6,17 +6,24 @@ export declare const ApiMsg: {
6
6
  readonly API_KEY_MISSING_READ: "API Key missing read permission";
7
7
  readonly MISSING_PARAMS: "Missing required parameters";
8
8
  readonly EMAIL_SEND_FAILED: "Failed to send email";
9
+ readonly EMAIL_CONFIG_INCOMPLETE: "SMTP configuration is incomplete";
10
+ readonly EMAIL_TEST_SENT: "Test email sent successfully";
9
11
  readonly OSS_CONFIG_INCOMPLETE: "OSS configuration is incomplete";
10
12
  readonly WEBHOOK_NOT_FOUND: "Webhook not found";
11
13
  readonly USERNAME_PASSWORD_REQUIRED: "Username and password are required";
14
+ readonly EMAIL_REQUIRED: "Email is required";
15
+ readonly EMAIL_INVALID: "Please enter a valid email address";
16
+ readonly ADMIN_CONSOLE_ACCESS_REQUIRED: "Please contact an administrator for access authorization";
12
17
  readonly USERNAME_INVALID: "Username cannot contain spaces or invalid characters";
13
18
  readonly USER_EXISTS: "User already exists";
14
19
  readonly INVALID_CREDENTIALS: "Invalid username or password";
15
20
  readonly USER_LOCKED: "User is locked and cannot sign in";
21
+ readonly TOO_MANY_LOGIN_ATTEMPTS: "Too many login attempts, please try again later";
16
22
  readonly FORBIDDEN: "You do not have permission for this action";
17
23
  readonly UNAUTHORIZED: "Unauthorized";
18
24
  readonly FORBIDDEN_ACTION: "Forbidden";
19
25
  readonly ARTICLE_TITLE_EXISTS: "Article title already exists";
26
+ readonly ARTICLE_SLUG_EXISTS: "Article slug already exists";
20
27
  readonly REVISION_NOT_FOUND: "Revision not found";
21
28
  readonly TAG_EXISTS: "Tag already exists";
22
29
  readonly CATEGORY_EXISTS: "Category already exists";
@@ -29,4 +36,6 @@ export declare const ApiMsg: {
29
36
  readonly EMAIL_NEW_COMMENT: "New comment notification";
30
37
  readonly EMAIL_COMMENT_REPLY: "Comment reply notification";
31
38
  readonly EMAIL_GITHUB_LOGIN: "GitHub sign-in notification";
39
+ readonly EMAIL_TEST_SUBJECT: "ReactPress SMTP test email";
40
+ readonly EMAIL_TEST_HTML: "This is a test email from your ReactPress site. If you received this message, SMTP is configured correctly.";
32
41
  };
@@ -9,17 +9,24 @@ exports.ApiMsg = {
9
9
  API_KEY_MISSING_READ: 'API Key missing read permission',
10
10
  MISSING_PARAMS: 'Missing required parameters',
11
11
  EMAIL_SEND_FAILED: 'Failed to send email',
12
+ EMAIL_CONFIG_INCOMPLETE: 'SMTP configuration is incomplete',
13
+ EMAIL_TEST_SENT: 'Test email sent successfully',
12
14
  OSS_CONFIG_INCOMPLETE: 'OSS configuration is incomplete',
13
15
  WEBHOOK_NOT_FOUND: 'Webhook not found',
14
16
  USERNAME_PASSWORD_REQUIRED: 'Username and password are required',
17
+ EMAIL_REQUIRED: 'Email is required',
18
+ EMAIL_INVALID: 'Please enter a valid email address',
19
+ ADMIN_CONSOLE_ACCESS_REQUIRED: 'Please contact an administrator for access authorization',
15
20
  USERNAME_INVALID: 'Username cannot contain spaces or invalid characters',
16
21
  USER_EXISTS: 'User already exists',
17
22
  INVALID_CREDENTIALS: 'Invalid username or password',
18
23
  USER_LOCKED: 'User is locked and cannot sign in',
24
+ TOO_MANY_LOGIN_ATTEMPTS: 'Too many login attempts, please try again later',
19
25
  FORBIDDEN: 'You do not have permission for this action',
20
26
  UNAUTHORIZED: 'Unauthorized',
21
27
  FORBIDDEN_ACTION: 'Forbidden',
22
28
  ARTICLE_TITLE_EXISTS: 'Article title already exists',
29
+ ARTICLE_SLUG_EXISTS: 'Article slug already exists',
23
30
  REVISION_NOT_FOUND: 'Revision not found',
24
31
  TAG_EXISTS: 'Tag already exists',
25
32
  CATEGORY_EXISTS: 'Category already exists',
@@ -32,5 +39,7 @@ exports.ApiMsg = {
32
39
  EMAIL_NEW_COMMENT: 'New comment notification',
33
40
  EMAIL_COMMENT_REPLY: 'Comment reply notification',
34
41
  EMAIL_GITHUB_LOGIN: 'GitHub sign-in notification',
42
+ EMAIL_TEST_SUBJECT: 'ReactPress SMTP test email',
43
+ EMAIL_TEST_HTML: 'This is a test email from your ReactPress site. If you received this message, SMTP is configured correctly.',
35
44
  };
36
45
  //# sourceMappingURL=api-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-messages.js","sourceRoot":"","sources":["../../src/common/api-messages.ts"],"names":[],"mappings":";;;AACa,QAAA,MAAM,GAAG;IACpB,WAAW,EAAE,uBAAuB;IACpC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,iCAAiC;IACvD,cAAc,EAAE,6BAA6B;IAC7C,iBAAiB,EAAE,sBAAsB;IACzC,qBAAqB,EAAE,iCAAiC;IACxD,iBAAiB,EAAE,mBAAmB;IAEtC,0BAA0B,EAAE,oCAAoC;IAChE,gBAAgB,EAAE,sDAAsD;IACxE,WAAW,EAAE,qBAAqB;IAClC,mBAAmB,EAAE,8BAA8B;IACnD,WAAW,EAAE,mCAAmC;IAChD,SAAS,EAAE,4CAA4C;IACvD,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,WAAW;IAE7B,oBAAoB,EAAE,8BAA8B;IACpD,kBAAkB,EAAE,oBAAoB;IAExC,UAAU,EAAE,oBAAoB;IAChC,eAAe,EAAE,yBAAyB;IAC1C,WAAW,EAAE,qBAAqB;IAClC,gBAAgB,EAAE,+BAA+B;IACjD,yBAAyB,EAAE,2BAA2B;IACtD,mBAAmB,EAAE,2CAA2C;IAEhE,oBAAoB,EAAE,uCAAuC;IAC7D,qBAAqB,EAAE,6CAA6C;IAEpE,iBAAiB,EAAE,0BAA0B;IAC7C,mBAAmB,EAAE,4BAA4B;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GAA6G;CACvG,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigService } from '@nestjs/config';
2
+ import { TypeOrmModuleOptions } from '@nestjs/typeorm';
3
+ export declare function createTypeOrmOptions(configService: ConfigService): TypeOrmModuleOptions;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTypeOrmOptions = void 0;
4
+ const api_key_entity_1 = require("../modules/api-key/api-key.entity");
5
+ const article_entity_1 = require("../modules/article/article.entity");
6
+ const article_revision_entity_1 = require("../modules/article/article-revision.entity");
7
+ const category_entity_1 = require("../modules/category/category.entity");
8
+ const comment_entity_1 = require("../modules/comment/comment.entity");
9
+ const file_entity_1 = require("../modules/file/file.entity");
10
+ const knowledge_entity_1 = require("../modules/knowledge/knowledge.entity");
11
+ const page_entity_1 = require("../modules/page/page.entity");
12
+ const search_entity_1 = require("../modules/search/search.entity");
13
+ const setting_entity_1 = require("../modules/setting/setting.entity");
14
+ const smtp_entity_1 = require("../modules/smtp/smtp.entity");
15
+ const tag_entity_1 = require("../modules/tag/tag.entity");
16
+ const user_entity_1 = require("../modules/user/user.entity");
17
+ const view_entity_1 = require("../modules/view/view.entity");
18
+ const webhook_entity_1 = require("../modules/webhook/webhook.entity");
19
+ const ENTITIES = [
20
+ user_entity_1.User,
21
+ file_entity_1.File,
22
+ knowledge_entity_1.Knowledge,
23
+ article_entity_1.Article,
24
+ article_revision_entity_1.ArticleRevision,
25
+ category_entity_1.Category,
26
+ tag_entity_1.Tag,
27
+ comment_entity_1.Comment,
28
+ setting_entity_1.Setting,
29
+ smtp_entity_1.SMTP,
30
+ page_entity_1.Page,
31
+ view_entity_1.View,
32
+ search_entity_1.Search,
33
+ api_key_entity_1.ApiKey,
34
+ webhook_entity_1.Webhook,
35
+ ];
36
+ function createTypeOrmOptions(configService) {
37
+ const dbType = String(configService.get('DB_TYPE') || 'mysql').toLowerCase();
38
+ if (dbType === 'sqlite') {
39
+ return {
40
+ type: 'sqlite',
41
+ database: configService.get('DB_DATABASE') || 'reactpress.db',
42
+ entities: ENTITIES,
43
+ synchronize: true,
44
+ };
45
+ }
46
+ return {
47
+ type: 'mysql',
48
+ entities: ENTITIES,
49
+ host: configService.get('DB_HOST', '0.0.0.0'),
50
+ port: configService.get('DB_PORT', 3306),
51
+ username: configService.get('DB_USER', 'root'),
52
+ password: configService.get('DB_PASSWD', 'root'),
53
+ database: configService.get('DB_DATABASE', 'reactpress'),
54
+ charset: 'utf8mb4',
55
+ timezone: '+08:00',
56
+ synchronize: true,
57
+ };
58
+ }
59
+ exports.createTypeOrmOptions = createTypeOrmOptions;
60
+ //# sourceMappingURL=typeorm-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-options.js","sourceRoot":"","sources":["../../src/database/typeorm-options.ts"],"names":[],"mappings":";;;AAGA,sEAA2D;AAC3D,sEAA4D;AAC5D,wFAA6E;AAC7E,yEAA+D;AAC/D,sEAA4D;AAC5D,6DAAmD;AACnD,4EAAkE;AAClE,6DAAmD;AACnD,mEAAyD;AACzD,sEAA4D;AAC5D,6DAAmD;AACnD,0DAAgD;AAChD,6DAAmD;AACnD,6DAAmD;AACnD,sEAA4D;AAE5D,MAAM,QAAQ,GAAG;IACf,kBAAI;IACJ,kBAAI;IACJ,4BAAS;IACT,wBAAO;IACP,yCAAe;IACf,0BAAQ;IACR,gBAAG;IACH,wBAAO;IACP,wBAAO;IACP,kBAAI;IACJ,kBAAI;IACJ,kBAAI;IACJ,sBAAM;IACN,uBAAM;IACN,wBAAO;CACR,CAAC;AAEF,SAAgB,oBAAoB,CAAC,aAA4B;IAC/D,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAE7E,IAAI,MAAM,KAAK,QAAQ,EAAE;QACvB,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,eAAe;YAC7D,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,IAAI;SAClB,CAAC;KACH;IAED,OAAO;QACL,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC;QAC7C,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,EAAE,IAAI,CAAC;QAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;QAC9C,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC;QAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC;QACxD,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC;AAxBD,oDAwBC"}
@@ -30,7 +30,7 @@ let HttpExceptionFilter = class HttpExceptionFilter {
30
30
  }
31
31
  };
32
32
  HttpExceptionFilter = __decorate([
33
- common_1.Catch(common_1.HttpException)
33
+ (0, common_1.Catch)(common_1.HttpException)
34
34
  ], HttpExceptionFilter);
35
35
  exports.HttpExceptionFilter = HttpExceptionFilter;
36
36
  //# sourceMappingURL=http-exception.filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkG;AAElG,sCAAwC;AAGxC,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC9B,KAAK,CAAC,SAAwB,EAAE,IAAmB;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,CAA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C,CAAC,mBAAU,CAAC,qBAAqB,CAAC;QAC7G,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC;QAC3D,MAAM,aAAa,GAAG;YACpB,UAAU,EAAE,MAAM;YAClB,GAAG;YACH,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,IAAI;SACX,CAAC;QAGF,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;QACnE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7B,oBAAW,CAAC,KAAK,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAtBY,mBAAmB;IAD/B,IAAA,cAAK,EAAC,sBAAa,CAAC;GACR,mBAAmB,CAsB/B;AAtBY,kDAAmB"}
@@ -25,26 +25,26 @@ async function generateSwaggerJson() {
25
25
  .build();
26
26
  console.log('🔨 Generating Swagger document...');
27
27
  const document = swagger_1.SwaggerModule.createDocument(app, swaggerConfig);
28
- const outputPath = path_1.join(__dirname, '../public/swagger.json');
29
- const publicDir = path_1.join(__dirname, '../public');
30
- if (!fs_1.existsSync(publicDir)) {
28
+ const outputPath = (0, path_1.join)(__dirname, '../public/swagger.json');
29
+ const publicDir = (0, path_1.join)(__dirname, '../public');
30
+ if (!(0, fs_1.existsSync)(publicDir)) {
31
31
  console.log('📁 Creating public directory...');
32
32
  require('fs').mkdirSync(publicDir, { recursive: true });
33
33
  }
34
- if (fs_1.existsSync(outputPath)) {
34
+ if ((0, fs_1.existsSync)(outputPath)) {
35
35
  console.log('🗑️ Removing existing swagger.json file...');
36
- fs_1.unlinkSync(outputPath);
36
+ (0, fs_1.unlinkSync)(outputPath);
37
37
  }
38
38
  console.log('💾 Writing Swagger JSON to file...');
39
- fs_1.writeFileSync(outputPath, JSON.stringify(document, null, 2));
39
+ (0, fs_1.writeFileSync)(outputPath, JSON.stringify(document, null, 2));
40
40
  console.log(`✅ Success! Swagger JSON generated at: ${outputPath}`);
41
41
  console.log('🎉 Swagger generation process completed successfully');
42
42
  process.exit(0);
43
43
  }
44
44
  catch (error) {
45
45
  console.error('❌ Error during Swagger generation:', error.message);
46
- const existingPath = path_1.join(__dirname, '../public/swagger.json');
47
- if (fs_1.existsSync(existingPath)) {
46
+ const existingPath = (0, path_1.join)(__dirname, '../public/swagger.json');
47
+ if ((0, fs_1.existsSync)(existingPath)) {
48
48
  console.log('ℹ️ Using existing swagger.json file');
49
49
  console.log('🎉 Swagger generation process completed successfully');
50
50
  process.exit(0);
@@ -57,10 +57,10 @@ async function generateSwaggerJson() {
57
57
  finally {
58
58
  }
59
59
  }
60
- generateSwaggerJson().catch(e => {
60
+ generateSwaggerJson().catch((e) => {
61
61
  console.error('💥 Unhandled error in generateSwaggerJson:', e.message);
62
- const existingPath = path_1.join(__dirname, '../public/swagger.json');
63
- if (fs_1.existsSync(existingPath)) {
62
+ const existingPath = (0, path_1.join)(__dirname, '../public/swagger.json');
63
+ if ((0, fs_1.existsSync)(existingPath)) {
64
64
  console.log('ℹ️ Using existing swagger.json file');
65
65
  console.log('🎉 Swagger generation process completed successfully');
66
66
  process.exit(0);
@@ -1 +1 @@
1
- {"version":3,"file":"generate-swagger.js","sourceRoot":"","sources":["../src/generate-swagger.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAiE;AACjE,2BAA2D;AAC3D,+BAA4B;AAC5B,6CAAyC;AAEzC,KAAK,UAAU,mBAAmB;IAChC,IAAI,GAAG,CAAC;IACR,IAAI;QACF,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;QAGtD,GAAG,GAAG,MAAM,kBAAW,CAAC,wBAAwB,CAAC,sBAAS,EAAE;YAC1D,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;SAC1B,CAAC,CAAC;QAGH,MAAM,aAAa,GAAG,GAAG,CAAC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ACF;YAAS;KAGT;AACH,CAAC;AAGD,mBAAmB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IAChC,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IAGvE,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;IAC/D,IAAI,IAAA,eAAU,EAAC,YAAY,CAAC,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAC,CAAC"}
@@ -1,9 +1,5 @@
1
1
  import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
2
2
  import { Observable } from 'rxjs';
3
- interface Response<T> {
4
- data: T;
3
+ export declare class TransformInterceptor implements NestInterceptor {
4
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
5
5
  }
6
- export declare class TransformInterceptor<T> implements NestInterceptor<T, Response<T>> {
7
- intercept(context: ExecutionContext, next: CallHandler<T>): Observable<Response<T>>;
8
- }
9
- export {};
@@ -12,25 +12,30 @@ const operators_1 = require("rxjs/operators");
12
12
  const logger_1 = require("../logger");
13
13
  let TransformInterceptor = class TransformInterceptor {
14
14
  intercept(context, next) {
15
- return next.handle().pipe(operators_1.map((data) => {
15
+ const request = context.switchToHttp().getRequest();
16
+ const url = String((request === null || request === void 0 ? void 0 : request.originalUrl) || (request === null || request === void 0 ? void 0 : request.url) || '');
17
+ if (/\/health\/?(\?|$)/i.test(url)) {
18
+ return next.handle();
19
+ }
20
+ return next.handle().pipe((0, operators_1.map)((data) => {
16
21
  const ctx = context.switchToHttp();
17
22
  const response = ctx.getResponse();
18
- const request = ctx.getRequest();
23
+ const req = ctx.getRequest();
19
24
  const statusCode = response.statusCode;
20
- const url = request.originalUrl;
25
+ const path = req.originalUrl;
21
26
  const res = {
22
27
  statusCode,
23
28
  msg: null,
24
29
  success: true,
25
30
  data,
26
31
  };
27
- logger_1.responseLogger.info(url, res);
32
+ logger_1.responseLogger.info(path, res);
28
33
  return res;
29
34
  }));
30
35
  }
31
36
  };
32
37
  TransformInterceptor = __decorate([
33
- common_1.Injectable()
38
+ (0, common_1.Injectable)()
34
39
  ], TransformInterceptor);
35
40
  exports.TransformInterceptor = TransformInterceptor;
36
41
  //# sourceMappingURL=transform.interceptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform.interceptor.js","sourceRoot":"","sources":["../../src/interceptors/transform.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAE5F,8CAAqC;AAErC,sCAA2C;AAO3C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC/B,SAAS,CAAC,OAAyB,EAAE,IAAoB;QACvD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACvB,eAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACX,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;YAEjC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YACvC,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC;YAChC,MAAM,GAAG,GAAG;gBACV,UAAU;gBACV,GAAG,EAAE,IAAI;gBACT,OAAO,EAAE,IAAI;gBACb,IAAI;aACL,CAAC;YACF,uBAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC9B,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AArBY,oBAAoB;IADhC,mBAAU,EAAE;GACA,oBAAoB,CAqBhC;AArBY,oDAAoB"}
1
+ {"version":3,"file":"transform.interceptor.js","sourceRoot":"","sources":["../../src/interceptors/transform.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAE5F,8CAAqC;AAErC,sCAA2C;AAUpC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACpD,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,MAAM,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAA,IAAI,EAAE,CAAC,CAAC;QAC/D,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAClC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;SACtB;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACvB,IAAA,eAAG,EAAC,CAAC,IAAI,EAAE,EAAE;YACX,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;YAE7B,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YACvC,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC;YAC7B,MAAM,GAAG,GAAyB;gBAChC,UAAU;gBACV,GAAG,EAAE,IAAI;gBACT,OAAO,EAAE,IAAI;gBACb,IAAI;aACL,CAAC;YACF,uBAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAC/B,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AA3BY,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CA2BhC;AA3BY,oDAAoB"}
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.errorLogger = exports.responseLogger = exports.requestLogger = void 0;
4
5
  const fs = require("fs-extra");
5
6
  const log4js = require("log4js");
6
7
  const path_1 = require("path");
7
- const LOG_DIR_NAME = '../../logs';
8
- fs.ensureDirSync(path_1.join(__dirname, LOG_DIR_NAME));
8
+ const LOG_DIR = ((_a = process.env.REACTPRESS_SERVER_LOG_DIR) === null || _a === void 0 ? void 0 : _a.trim()) || (0, path_1.join)(__dirname, '../../logs');
9
+ fs.ensureDirSync(LOG_DIR);
9
10
  void ['request', 'response', 'error'].forEach((t) => {
10
- fs.ensureDirSync(path_1.join(__dirname, LOG_DIR_NAME, t));
11
+ fs.ensureDirSync((0, path_1.join)(LOG_DIR, t));
11
12
  });
12
- const resolvePath = (dir, filename) => path_1.join(__dirname, LOG_DIR_NAME, dir, filename);
13
+ const resolvePath = (dir, filename) => (0, path_1.join)(LOG_DIR, dir, filename);
13
14
  const commonCinfig = {
14
15
  type: 'dateFile',
15
16
  pattern: '-yyyy-MM-dd.log',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAiC;AACjC,+BAA4B;AAE5B,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;IAClD,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,SAAS,EAAE,YAAY,EAAE,C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AC,EAAE,KAAK,EAAE,MAAM,EAAE;QACpD,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;KAC/C;CACF,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC5C,QAAA,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC9C,QAAA,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC"}
package/dist/main.js CHANGED
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("fs");
4
- const path_1 = require("path");
5
- const express = require("express");
6
3
  const bodyParser = require("body-parser");
7
- const open = require("open");
4
+ const express = require("express");
5
+ const fs = require("fs");
8
6
  const net = require("net");
7
+ const open = require("open");
8
+ const path_1 = require("path");
9
+ const local_api_quiet_util_1 = require("./utils/local-api-quiet.util");
9
10
  const INSTALLATION_PORT = 3002;
10
11
  const MAX_PORT_ATTEMPTS = 10;
11
12
  const serverState = {
12
13
  server: null,
13
14
  isClosing: false,
14
- isListening: false
15
+ isListening: false,
15
16
  };
16
17
  const checkPort = (port) => {
17
18
  return new Promise((resolve) => {
@@ -108,11 +109,23 @@ const main = async () => {
108
109
  try {
109
110
  setupSignalHandlers();
110
111
  const projectRoot = getProjectRoot();
111
- const envPath = path_1.join(projectRoot, '.env');
112
- console.log(`[ReactPress] Checking for environment file at: ${envPath}`);
113
- console.log(`[ReactPress] Project root determined to be: ${projectRoot}`);
112
+ const envPath = (0, path_1.join)(projectRoot, '.env');
113
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
114
+ console.log(`[ReactPress] Checking for environment file at: ${envPath}`);
115
+ }
116
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
117
+ console.log(`[ReactPress] Project root determined to be: ${projectRoot}`);
118
+ }
114
119
  if (fs.existsSync(envPath)) {
115
- console.log('[ReactPress] Environment file exists, starting main application');
120
+ if (process.env.REACTPRESS_API_ENTRY === 'starter') {
121
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
122
+ console.log('[ReactPress] API dev uses nest starter entry; skip main bootstrap (see server npm run dev)');
123
+ }
124
+ return;
125
+ }
126
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
127
+ console.log('[ReactPress] Environment file exists, starting main application');
128
+ }
116
129
  await startMainApplication();
117
130
  return;
118
131
  }
@@ -129,11 +142,15 @@ const main = async () => {
129
142
  };
130
143
  const getProjectRoot = () => {
131
144
  if (process.env.REACTPRESS_ORIGINAL_CWD) {
132
- console.log(`[ReactPress] Using original working directory from npx execution: ${process.env.REACTPRESS_ORIGINAL_CWD}`);
145
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
146
+ console.log(`[ReactPress] Using original working directory from npx execution: ${process.env.REACTPRESS_ORIGINAL_CWD}`);
147
+ }
133
148
  return process.env.REACTPRESS_ORIGINAL_CWD;
134
149
  }
135
150
  const projectRoot = process.cwd();
136
- console.log(`[ReactPress] Using current working directory as project root: ${projectRoot}`);
151
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
152
+ console.log(`[ReactPress] Using current working directory as project root: ${projectRoot}`);
153
+ }
137
154
  return projectRoot;
138
155
  };
139
156
  const runInstallationWizard = async () => {
@@ -142,9 +159,9 @@ const runInstallationWizard = async () => {
142
159
  const app = express();
143
160
  app.use(bodyParser.json({ limit: '10mb' }));
144
161
  app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }));
145
- app.use('/public', express.static(path_1.join(__dirname, '../public')));
162
+ app.use('/public', express.static((0, path_1.join)(__dirname, '../public')));
146
163
  app.get('/', (req, res) => {
147
- res.sendFile(path_1.join(__dirname, '../public/index.html'));
164
+ res.sendFile((0, path_1.join)(__dirname, '../public/index.html'));
148
165
  });
149
166
  app.post('/test-db', async (req, res) => {
150
167
  try {
@@ -155,7 +172,7 @@ const runInstallationWizard = async () => {
155
172
  port: parseInt(port) || 3306,
156
173
  user,
157
174
  password,
158
- database
175
+ database,
159
176
  });
160
177
  await connection.execute('SELECT 1');
161
178
  await connection.end();
@@ -164,7 +181,7 @@ const runInstallationWizard = async () => {
164
181
  catch (error) {
165
182
  res.status(400).json({
166
183
  success: false,
167
- message: `Database connection failed: ${error.message}`
184
+ message: `Database connection failed: ${error.message}`,
168
185
  });
169
186
  }
170
187
  });
@@ -174,7 +191,7 @@ const runInstallationWizard = async () => {
174
191
  if (!db || !site) {
175
192
  return res.status(400).json({
176
193
  success: false,
177
- message: 'Missing configuration data'
194
+ message: 'Missing configuration data',
178
195
  });
179
196
  }
180
197
  const mysql = await Promise.resolve().then(() => require('mysql2/promise'));
@@ -183,7 +200,7 @@ const runInstallationWizard = async () => {
183
200
  port: parseInt(db.port) || 3306,
184
201
  user: db.user,
185
202
  password: db.password,
186
- database: db.database
203
+ database: db.database,
187
204
  });
188
205
  await connection.execute('SELECT 1');
189
206
  await connection.end();
@@ -201,12 +218,12 @@ CLIENT_SITE_URL=${site.clientUrl || 'http://localhost:3001'}
201
218
  SERVER_SITE_URL=${site.serverUrl || 'http://localhost:3002'}
202
219
  `.trim();
203
220
  const projectRoot = getProjectRoot();
204
- const envPath = path_1.join(projectRoot, '.env');
221
+ const envPath = (0, path_1.join)(projectRoot, '.env');
205
222
  fs.writeFileSync(envPath, envContent, 'utf8');
206
223
  res.json({
207
224
  success: true,
208
225
  message: 'Installation completed! Server will restart.',
209
- serverUrl: site.serverUrl || 'http://localhost:3002'
226
+ serverUrl: site.serverUrl || 'http://localhost:3002',
210
227
  });
211
228
  res.on('finish', async () => {
212
229
  try {
@@ -222,7 +239,7 @@ SERVER_SITE_URL=${site.serverUrl || 'http://localhost:3002'}
222
239
  catch (error) {
223
240
  res.status(400).json({
224
241
  success: false,
225
- message: `Installation failed: ${error.message}`
242
+ message: `Installation failed: ${error.message}`,
226
243
  });
227
244
  }
228
245
  });
@@ -242,10 +259,12 @@ SERVER_SITE_URL=${site.serverUrl || 'http://localhost:3002'}
242
259
  };
243
260
  const startMainApplication = async () => {
244
261
  try {
245
- console.log('[ReactPress] Starting main application...');
262
+ if (!(0, local_api_quiet_util_1.isLocalApiQuiet)()) {
263
+ console.log('[ReactPress] Starting main application...');
264
+ }
246
265
  await safelyCloseServer();
247
266
  global.isInstalling = false;
248
- await new Promise(resolve => setTimeout(resolve, 1000));
267
+ await new Promise((resolve) => setTimeout(resolve, 1000));
249
268
  const { bootstrap } = await Promise.resolve().then(() => require('./starter'));
250
269
  if (typeof bootstrap === 'function') {
251
270
  await bootstrap();
@@ -259,5 +278,7 @@ const startMainApplication = async () => {
259
278
  process.exit(1);
260
279
  }
261
280
  };
262
- main();
281
+ if (require.main === module) {
282
+ main();
283
+ }
263
284
  //# sourceMappingURL=main.js.map