@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.
Files changed (340) hide show
  1. package/README.md +325 -56
  2. package/bin/reactpress-server.js +6 -50
  3. package/dist/app.module.js +30 -18
  4. package/dist/app.module.js.map +1 -1
  5. package/dist/filters/http-exception.filter.js +1 -1
  6. package/dist/filters/http-exception.filter.js.map +1 -1
  7. package/dist/generate-swagger.d.ts +1 -1
  8. package/dist/generate-swagger.js +11 -12
  9. package/dist/generate-swagger.js.map +1 -1
  10. package/dist/interceptors/transform.interceptor.d.ts +6 -2
  11. package/dist/interceptors/transform.interceptor.js +5 -10
  12. package/dist/interceptors/transform.interceptor.js.map +1 -1
  13. package/dist/logger/index.js +4 -5
  14. package/dist/logger/index.js.map +1 -1
  15. package/dist/main.d.ts +1 -3
  16. package/dist/main.js +23 -47
  17. package/dist/main.js.map +1 -1
  18. package/dist/modules/article/article.controller.d.ts +2 -7
  19. package/dist/modules/article/article.controller.js +48 -103
  20. package/dist/modules/article/article.controller.js.map +1 -1
  21. package/dist/modules/article/article.entity.d.ts +0 -4
  22. package/dist/modules/article/article.entity.js +41 -61
  23. package/dist/modules/article/article.entity.js.map +1 -1
  24. package/dist/modules/article/article.module.js +3 -18
  25. package/dist/modules/article/article.module.js.map +1 -1
  26. package/dist/modules/article/article.service.d.ts +2 -16
  27. package/dist/modules/article/article.service.js +29 -151
  28. package/dist/modules/article/article.service.js.map +1 -1
  29. package/dist/modules/auth/auth.controller.js +11 -11
  30. package/dist/modules/auth/auth.controller.js.map +1 -1
  31. package/dist/modules/auth/auth.module.js +4 -4
  32. package/dist/modules/auth/auth.module.js.map +1 -1
  33. package/dist/modules/auth/auth.service.js +7 -8
  34. package/dist/modules/auth/auth.service.js.map +1 -1
  35. package/dist/modules/auth/jwt-auth.guard.js +3 -4
  36. package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
  37. package/dist/modules/auth/jwt.strategy.js +3 -4
  38. package/dist/modules/auth/jwt.strategy.js.map +1 -1
  39. package/dist/modules/auth/roles.guard.js +2 -2
  40. package/dist/modules/auth/roles.guard.js.map +1 -1
  41. package/dist/modules/category/category.controller.js +20 -21
  42. package/dist/modules/category/category.controller.js.map +1 -1
  43. package/dist/modules/category/category.entity.js +13 -13
  44. package/dist/modules/category/category.entity.js.map +1 -1
  45. package/dist/modules/category/category.module.js +1 -1
  46. package/dist/modules/category/category.module.js.map +1 -1
  47. package/dist/modules/category/category.service.js +4 -5
  48. package/dist/modules/category/category.service.js.map +1 -1
  49. package/dist/modules/comment/comment.controller.js +20 -24
  50. package/dist/modules/comment/comment.controller.js.map +1 -1
  51. package/dist/modules/comment/comment.entity.js +31 -31
  52. package/dist/modules/comment/comment.entity.js.map +1 -1
  53. package/dist/modules/comment/comment.module.js +2 -11
  54. package/dist/modules/comment/comment.module.js.map +1 -1
  55. package/dist/modules/comment/comment.service.d.ts +1 -5
  56. package/dist/modules/comment/comment.service.js +16 -43
  57. package/dist/modules/comment/comment.service.js.map +1 -1
  58. package/dist/modules/comment/html.d.ts +1 -1
  59. package/dist/modules/comment/html.js +3 -3
  60. package/dist/modules/comment/html.js.map +1 -1
  61. package/dist/modules/file/file.controller.d.ts +1 -1
  62. package/dist/modules/file/file.controller.js +20 -22
  63. package/dist/modules/file/file.controller.js.map +1 -1
  64. package/dist/modules/file/file.entity.d.ts +0 -7
  65. package/dist/modules/file/file.entity.js +15 -20
  66. package/dist/modules/file/file.entity.js.map +1 -1
  67. package/dist/modules/file/file.module.js +4 -16
  68. package/dist/modules/file/file.module.js.map +1 -1
  69. package/dist/modules/file/file.service.d.ts +1 -6
  70. package/dist/modules/file/file.service.js +38 -88
  71. package/dist/modules/file/file.service.js.map +1 -1
  72. package/dist/modules/install/install.controller.js +5 -5
  73. package/dist/modules/install/install.controller.js.map +1 -1
  74. package/dist/modules/install/install.module.js +1 -1
  75. package/dist/modules/install/install.module.js.map +1 -1
  76. package/dist/modules/install/install.service.js +2 -2
  77. package/dist/modules/install/install.service.js.map +1 -1
  78. package/dist/modules/knowledge/knowledge.controller.js +33 -35
  79. package/dist/modules/knowledge/knowledge.controller.js.map +1 -1
  80. package/dist/modules/knowledge/knowledge.entity.js +33 -33
  81. package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
  82. package/dist/modules/knowledge/knowledge.module.js +1 -1
  83. package/dist/modules/knowledge/knowledge.module.js.map +1 -1
  84. package/dist/modules/knowledge/knowledge.service.js +11 -12
  85. package/dist/modules/knowledge/knowledge.service.js.map +1 -1
  86. package/dist/modules/page/page.controller.js +23 -24
  87. package/dist/modules/page/page.controller.js.map +1 -1
  88. package/dist/modules/page/page.entity.js +27 -27
  89. package/dist/modules/page/page.entity.js.map +1 -1
  90. package/dist/modules/page/page.module.js +1 -1
  91. package/dist/modules/page/page.module.js.map +1 -1
  92. package/dist/modules/page/page.service.js +12 -12
  93. package/dist/modules/page/page.service.js.map +1 -1
  94. package/dist/modules/search/search.controller.js +12 -12
  95. package/dist/modules/search/search.controller.js.map +1 -1
  96. package/dist/modules/search/search.entity.js +13 -13
  97. package/dist/modules/search/search.entity.js.map +1 -1
  98. package/dist/modules/search/search.module.js +1 -1
  99. package/dist/modules/search/search.module.js.map +1 -1
  100. package/dist/modules/search/search.service.js +2 -2
  101. package/dist/modules/search/search.service.js.map +1 -1
  102. package/dist/modules/setting/setting.constant.d.ts +4 -5
  103. package/dist/modules/setting/setting.constant.js +20 -5
  104. package/dist/modules/setting/setting.constant.js.map +1 -1
  105. package/dist/modules/setting/setting.controller.js +11 -11
  106. package/dist/modules/setting/setting.controller.js.map +1 -1
  107. package/dist/modules/setting/setting.entity.d.ts +0 -3
  108. package/dist/modules/setting/setting.entity.js +49 -64
  109. package/dist/modules/setting/setting.entity.js.map +1 -1
  110. package/dist/modules/setting/setting.module.js +2 -2
  111. package/dist/modules/setting/setting.module.js.map +1 -1
  112. package/dist/modules/setting/setting.service.d.ts +2 -13
  113. package/dist/modules/setting/setting.service.js +24 -169
  114. package/dist/modules/setting/setting.service.js.map +1 -1
  115. package/dist/modules/smtp/mail.util.d.ts +6 -7
  116. package/dist/modules/smtp/mail.util.js +9 -5
  117. package/dist/modules/smtp/mail.util.js.map +1 -1
  118. package/dist/modules/smtp/smtp.controller.d.ts +0 -3
  119. package/dist/modules/smtp/smtp.controller.js +14 -27
  120. package/dist/modules/smtp/smtp.controller.js.map +1 -1
  121. package/dist/modules/smtp/smtp.entity.js +15 -15
  122. package/dist/modules/smtp/smtp.entity.js.map +1 -1
  123. package/dist/modules/smtp/smtp.module.js +2 -2
  124. package/dist/modules/smtp/smtp.module.js.map +1 -1
  125. package/dist/modules/smtp/smtp.service.d.ts +0 -14
  126. package/dist/modules/smtp/smtp.service.js +12 -40
  127. package/dist/modules/smtp/smtp.service.js.map +1 -1
  128. package/dist/modules/tag/tag.controller.js +22 -24
  129. package/dist/modules/tag/tag.controller.js.map +1 -1
  130. package/dist/modules/tag/tag.entity.js +12 -12
  131. package/dist/modules/tag/tag.entity.js.map +1 -1
  132. package/dist/modules/tag/tag.module.js +1 -1
  133. package/dist/modules/tag/tag.module.js.map +1 -1
  134. package/dist/modules/tag/tag.service.js +4 -5
  135. package/dist/modules/tag/tag.service.js.map +1 -1
  136. package/dist/modules/user/user.controller.js +28 -39
  137. package/dist/modules/user/user.controller.js.map +1 -1
  138. package/dist/modules/user/user.entity.js +22 -22
  139. package/dist/modules/user/user.entity.js.map +1 -1
  140. package/dist/modules/user/user.module.js +2 -2
  141. package/dist/modules/user/user.module.js.map +1 -1
  142. package/dist/modules/user/user.service.js +14 -18
  143. package/dist/modules/user/user.service.js.map +1 -1
  144. package/dist/modules/view/view.controller.js +19 -20
  145. package/dist/modules/view/view.controller.js.map +1 -1
  146. package/dist/modules/view/view.entity.js +24 -24
  147. package/dist/modules/view/view.entity.js.map +1 -1
  148. package/dist/modules/view/view.module.js +1 -1
  149. package/dist/modules/view/view.module.js.map +1 -1
  150. package/dist/modules/view/view.service.js +4 -4
  151. package/dist/modules/view/view.service.js.map +1 -1
  152. package/dist/public/favicon.png +0 -0
  153. package/dist/starter.d.ts +1 -3
  154. package/dist/starter.js +14 -202
  155. package/dist/starter.js.map +1 -1
  156. package/dist/tsconfig.build.tsbuildinfo +15957 -1
  157. package/dist/utils/date.util.js +1 -1
  158. package/dist/utils/date.util.js.map +1 -1
  159. package/dist/utils/markdown.util.js +1 -1
  160. package/dist/utils/markdown.util.js.map +1 -1
  161. package/dist/utils/oss/aliyun-oss-client.d.ts +1 -3
  162. package/dist/utils/oss/aliyun-oss-client.js +0 -5
  163. package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
  164. package/dist/utils/oss/oss-client.d.ts +1 -3
  165. package/dist/utils/oss/oss-client.js.map +1 -1
  166. package/dist/utils/oss.util.d.ts +1 -3
  167. package/dist/utils/oss.util.js +1 -6
  168. package/dist/utils/oss.util.js.map +1 -1
  169. package/dist/utils/uniqueid.util.js +1 -1
  170. package/dist/utils/uniqueid.util.js.map +1 -1
  171. package/dist/utils/upload.util.d.ts +2 -6
  172. package/dist/utils/upload.util.js +8 -23
  173. package/dist/utils/upload.util.js.map +1 -1
  174. package/dist/utils/user.util.d.ts +0 -1
  175. package/dist/utils/user.util.js +2 -6
  176. package/dist/utils/user.util.js.map +1 -1
  177. package/package.json +32 -36
  178. package/public/favicon.png +0 -0
  179. package/dist/common/api-messages.d.ts +0 -41
  180. package/dist/common/api-messages.js +0 -45
  181. package/dist/common/api-messages.js.map +0 -1
  182. package/dist/database/typeorm-options.d.ts +0 -3
  183. package/dist/database/typeorm-options.js +0 -71
  184. package/dist/database/typeorm-options.js.map +0 -1
  185. package/dist/modules/api-key/api-key.controller.d.ts +0 -14
  186. package/dist/modules/api-key/api-key.controller.js +0 -63
  187. package/dist/modules/api-key/api-key.controller.js.map +0 -1
  188. package/dist/modules/api-key/api-key.entity.d.ts +0 -11
  189. package/dist/modules/api-key/api-key.entity.js +0 -63
  190. package/dist/modules/api-key/api-key.entity.js.map +0 -1
  191. package/dist/modules/api-key/api-key.guard.d.ts +0 -7
  192. package/dist/modules/api-key/api-key.guard.js +0 -39
  193. package/dist/modules/api-key/api-key.guard.js.map +0 -1
  194. package/dist/modules/api-key/api-key.module.d.ts +0 -2
  195. package/dist/modules/api-key/api-key.module.js +0 -28
  196. package/dist/modules/api-key/api-key.module.js.map +0 -1
  197. package/dist/modules/api-key/api-key.service.d.ts +0 -15
  198. package/dist/modules/api-key/api-key.service.js +0 -81
  199. package/dist/modules/api-key/api-key.service.js.map +0 -1
  200. package/dist/modules/article/article-revision.entity.d.ts +0 -11
  201. package/dist/modules/article/article-revision.entity.js +0 -53
  202. package/dist/modules/article/article-revision.entity.js.map +0 -1
  203. package/dist/modules/article/article-slug.util.d.ts +0 -2
  204. package/dist/modules/article/article-slug.util.js +0 -19
  205. package/dist/modules/article/article-slug.util.js.map +0 -1
  206. package/dist/modules/article/scheduled-publish.service.d.ts +0 -13
  207. package/dist/modules/article/scheduled-publish.service.js +0 -65
  208. package/dist/modules/article/scheduled-publish.service.js.map +0 -1
  209. package/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
  210. package/dist/modules/bootstrap/bootstrap.constants.js +0 -171
  211. package/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
  212. package/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
  213. package/dist/modules/bootstrap/bootstrap.service.js +0 -183
  214. package/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
  215. package/dist/modules/bootstrap/install-locale.d.ts +0 -2
  216. package/dist/modules/bootstrap/install-locale.js +0 -11
  217. package/dist/modules/bootstrap/install-locale.js.map +0 -1
  218. package/dist/modules/extension/extension.module.d.ts +0 -9
  219. package/dist/modules/extension/extension.module.js +0 -52
  220. package/dist/modules/extension/extension.module.js.map +0 -1
  221. package/dist/modules/extension/plugin-loader.service.d.ts +0 -12
  222. package/dist/modules/extension/plugin-loader.service.js +0 -96
  223. package/dist/modules/extension/plugin-loader.service.js.map +0 -1
  224. package/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
  225. package/dist/modules/extension/plugin-registry.bridge.js +0 -44
  226. package/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
  227. package/dist/modules/extension/plugin.controller.d.ts +0 -22
  228. package/dist/modules/extension/plugin.controller.js +0 -155
  229. package/dist/modules/extension/plugin.controller.js.map +0 -1
  230. package/dist/modules/extension/plugin.service.d.ts +0 -54
  231. package/dist/modules/extension/plugin.service.js +0 -414
  232. package/dist/modules/extension/plugin.service.js.map +0 -1
  233. package/dist/modules/extension/preview-draft.store.d.ts +0 -13
  234. package/dist/modules/extension/preview-draft.store.js +0 -41
  235. package/dist/modules/extension/preview-draft.store.js.map +0 -1
  236. package/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
  237. package/dist/modules/extension/theme-registry.bridge.js +0 -68
  238. package/dist/modules/extension/theme-registry.bridge.js.map +0 -1
  239. package/dist/modules/extension/theme.controller.d.ts +0 -66
  240. package/dist/modules/extension/theme.controller.js +0 -301
  241. package/dist/modules/extension/theme.controller.js.map +0 -1
  242. package/dist/modules/extension/theme.service.d.ts +0 -140
  243. package/dist/modules/extension/theme.service.js +0 -1039
  244. package/dist/modules/extension/theme.service.js.map +0 -1
  245. package/dist/modules/file/content-image-scan.util.d.ts +0 -52
  246. package/dist/modules/file/content-image-scan.util.js +0 -222
  247. package/dist/modules/file/content-image-scan.util.js.map +0 -1
  248. package/dist/modules/file/file-optimization.controller.d.ts +0 -12
  249. package/dist/modules/file/file-optimization.controller.js +0 -79
  250. package/dist/modules/file/file-optimization.controller.js.map +0 -1
  251. package/dist/modules/file/file-optimization.service.d.ts +0 -36
  252. package/dist/modules/file/file-optimization.service.js +0 -387
  253. package/dist/modules/file/file-optimization.service.js.map +0 -1
  254. package/dist/modules/file/file-optimization.types.d.ts +0 -66
  255. package/dist/modules/file/file-optimization.types.js +0 -5
  256. package/dist/modules/file/file-optimization.types.js.map +0 -1
  257. package/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
  258. package/dist/modules/file/image-optimizer-plugin.guard.js +0 -33
  259. package/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
  260. package/dist/modules/health/health.controller.d.ts +0 -11
  261. package/dist/modules/health/health.controller.js +0 -55
  262. package/dist/modules/health/health.controller.js.map +0 -1
  263. package/dist/modules/health/health.module.d.ts +0 -2
  264. package/dist/modules/health/health.module.js +0 -20
  265. package/dist/modules/health/health.module.js.map +0 -1
  266. package/dist/modules/hook/hook.module.d.ts +0 -2
  267. package/dist/modules/hook/hook.module.js +0 -22
  268. package/dist/modules/hook/hook.module.js.map +0 -1
  269. package/dist/modules/hook/hook.service.d.ts +0 -26
  270. package/dist/modules/hook/hook.service.js +0 -105
  271. package/dist/modules/hook/hook.service.js.map +0 -1
  272. package/dist/modules/webhook/webhook.controller.d.ts +0 -12
  273. package/dist/modules/webhook/webhook.controller.js +0 -63
  274. package/dist/modules/webhook/webhook.controller.js.map +0 -1
  275. package/dist/modules/webhook/webhook.entity.d.ts +0 -9
  276. package/dist/modules/webhook/webhook.entity.js +0 -54
  277. package/dist/modules/webhook/webhook.entity.js.map +0 -1
  278. package/dist/modules/webhook/webhook.module.d.ts +0 -2
  279. package/dist/modules/webhook/webhook.module.js +0 -27
  280. package/dist/modules/webhook/webhook.module.js.map +0 -1
  281. package/dist/modules/webhook/webhook.service.d.ts +0 -16
  282. package/dist/modules/webhook/webhook.service.js +0 -100
  283. package/dist/modules/webhook/webhook.service.js.map +0 -1
  284. package/dist/node-polyfills.d.ts +0 -18
  285. package/dist/node-polyfills.js +0 -24
  286. package/dist/node-polyfills.js.map +0 -1
  287. package/dist/public/apple-touch-icon.png +0 -0
  288. package/dist/public/favicon-16.png +0 -0
  289. package/dist/public/favicon-32.png +0 -0
  290. package/dist/public/favicon-48.png +0 -0
  291. package/dist/public/favicon.ico +0 -0
  292. package/dist/public/icon-192.png +0 -0
  293. package/dist/public/icon-512.png +0 -0
  294. package/dist/public/logo-200.png +0 -0
  295. package/dist/public/logo-400.png +0 -0
  296. package/dist/public/logo.png +0 -0
  297. package/dist/public/logo.svg +0 -7
  298. package/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  299. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  300. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  301. package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  302. package/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  303. package/dist/tsconfig.tsbuildinfo +0 -1
  304. package/dist/utils/html-sanitize.util.d.ts +0 -1
  305. package/dist/utils/html-sanitize.util.js +0 -33
  306. package/dist/utils/html-sanitize.util.js.map +0 -1
  307. package/dist/utils/image-processor.util.d.ts +0 -23
  308. package/dist/utils/image-processor.util.js +0 -88
  309. package/dist/utils/image-processor.util.js.map +0 -1
  310. package/dist/utils/local-api-quiet.util.d.ts +0 -1
  311. package/dist/utils/local-api-quiet.util.js +0 -8
  312. package/dist/utils/local-api-quiet.util.js.map +0 -1
  313. package/dist/utils/project-root.util.d.ts +0 -2
  314. package/dist/utils/project-root.util.js +0 -42
  315. package/dist/utils/project-root.util.js.map +0 -1
  316. package/dist/utils/query-whitelist.util.d.ts +0 -1
  317. package/dist/utils/query-whitelist.util.js +0 -100
  318. package/dist/utils/query-whitelist.util.js.map +0 -1
  319. package/dist/utils/theme-placeholder-cover.d.ts +0 -7
  320. package/dist/utils/theme-placeholder-cover.js +0 -94
  321. package/dist/utils/theme-placeholder-cover.js.map +0 -1
  322. package/dist/utils/upload-url.util.d.ts +0 -4
  323. package/dist/utils/upload-url.util.js +0 -34
  324. package/dist/utils/upload-url.util.js.map +0 -1
  325. package/public/apple-touch-icon.png +0 -0
  326. package/public/favicon-16.png +0 -0
  327. package/public/favicon-32.png +0 -0
  328. package/public/favicon-48.png +0 -0
  329. package/public/favicon.ico +0 -0
  330. package/public/icon-192.png +0 -0
  331. package/public/icon-512.png +0 -0
  332. package/public/logo-200.png +0 -0
  333. package/public/logo-400.png +0 -0
  334. package/public/logo.png +0 -0
  335. package/public/logo.svg +0 -7
  336. package/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  337. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  338. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  339. package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  340. package/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
@@ -15,133 +15,118 @@ const typeorm_1 = require("typeorm");
15
15
  let Setting = class Setting {
16
16
  };
17
17
  __decorate([
18
- (0, swagger_1.ApiProperty)(),
19
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
18
+ swagger_1.ApiProperty(),
19
+ typeorm_1.PrimaryGeneratedColumn('uuid'),
20
20
  __metadata("design:type", String)
21
21
  ], Setting.prototype, "id", void 0);
22
22
  __decorate([
23
- (0, swagger_1.ApiProperty)(),
24
- (0, typeorm_1.Column)({ type: 'text', default: null }),
23
+ swagger_1.ApiProperty(),
24
+ typeorm_1.Column({ type: 'text', default: null }),
25
25
  __metadata("design:type", String)
26
26
  ], Setting.prototype, "i18n", void 0);
27
27
  __decorate([
28
- (0, swagger_1.ApiProperty)(),
29
- (0, typeorm_1.Column)({ type: 'text', default: null }),
28
+ swagger_1.ApiProperty(),
29
+ typeorm_1.Column({ type: 'text', default: null }),
30
30
  __metadata("design:type", String)
31
31
  ], Setting.prototype, "globalSetting", void 0);
32
32
  __decorate([
33
- (0, swagger_1.ApiProperty)(),
34
- (0, typeorm_1.Column)({ type: 'text', default: null }),
33
+ swagger_1.ApiProperty(),
34
+ typeorm_1.Column({ type: 'text', default: null }),
35
35
  __metadata("design:type", String)
36
36
  ], Setting.prototype, "systemUrl", void 0);
37
37
  __decorate([
38
- (0, swagger_1.ApiProperty)(),
39
- (0, typeorm_1.Column)({ type: 'text', default: null }),
38
+ swagger_1.ApiProperty(),
39
+ typeorm_1.Column({ type: 'text', default: null }),
40
40
  __metadata("design:type", String)
41
41
  ], Setting.prototype, "systemTitle", void 0);
42
42
  __decorate([
43
- (0, swagger_1.ApiProperty)(),
44
- (0, typeorm_1.Column)({ type: 'text', default: null }),
43
+ swagger_1.ApiProperty(),
44
+ typeorm_1.Column({ type: 'text', default: null }),
45
45
  __metadata("design:type", String)
46
46
  ], Setting.prototype, "systemSubTitle", void 0);
47
47
  __decorate([
48
- (0, swagger_1.ApiProperty)(),
49
- (0, typeorm_1.Column)({ type: 'text', default: null }),
48
+ swagger_1.ApiProperty(),
49
+ typeorm_1.Column({ type: 'text', default: null }),
50
50
  __metadata("design:type", String)
51
51
  ], Setting.prototype, "systemLogo", void 0);
52
52
  __decorate([
53
- (0, swagger_1.ApiProperty)(),
54
- (0, typeorm_1.Column)({ type: 'text', default: null }),
53
+ swagger_1.ApiProperty(),
54
+ typeorm_1.Column({ type: 'text', default: null }),
55
55
  __metadata("design:type", String)
56
56
  ], Setting.prototype, "systemBg", void 0);
57
57
  __decorate([
58
- (0, swagger_1.ApiProperty)(),
59
- (0, typeorm_1.Column)({ type: 'text', default: null }),
58
+ swagger_1.ApiProperty(),
59
+ typeorm_1.Column({ type: 'text', default: null }),
60
60
  __metadata("design:type", String)
61
61
  ], Setting.prototype, "systemFavicon", void 0);
62
62
  __decorate([
63
- (0, swagger_1.ApiProperty)(),
64
- (0, typeorm_1.Column)({ type: 'text', default: null }),
63
+ swagger_1.ApiProperty(),
64
+ typeorm_1.Column({ type: 'text', default: null }),
65
65
  __metadata("design:type", String)
66
66
  ], Setting.prototype, "systemNoticeInfo", void 0);
67
67
  __decorate([
68
- (0, swagger_1.ApiProperty)(),
69
- (0, typeorm_1.Column)({ type: 'text', default: null }),
68
+ swagger_1.ApiProperty(),
69
+ typeorm_1.Column({ type: 'text', default: null }),
70
70
  __metadata("design:type", String)
71
71
  ], Setting.prototype, "systemFooterInfo", void 0);
72
72
  __decorate([
73
- (0, swagger_1.ApiProperty)(),
74
- (0, typeorm_1.Column)({ type: 'text', default: null }),
75
- __metadata("design:type", String)
76
- ], Setting.prototype, "aboutUsGithubUrl", void 0);
77
- __decorate([
78
- (0, swagger_1.ApiProperty)(),
79
- (0, typeorm_1.Column)({ type: 'text', default: null }),
80
- __metadata("design:type", String)
81
- ], Setting.prototype, "aboutUsCommentQr", void 0);
82
- __decorate([
83
- (0, swagger_1.ApiProperty)(),
84
- (0, typeorm_1.Column)({ type: 'text', default: null }),
85
- __metadata("design:type", String)
86
- ], Setting.prototype, "aboutUsWechatQr", void 0);
87
- __decorate([
88
- (0, swagger_1.ApiProperty)(),
89
- (0, typeorm_1.Column)({ type: 'text', default: null }),
73
+ swagger_1.ApiProperty(),
74
+ typeorm_1.Column({ type: 'text', default: null }),
90
75
  __metadata("design:type", String)
91
76
  ], Setting.prototype, "adminSystemUrl", void 0);
92
77
  __decorate([
93
- (0, swagger_1.ApiProperty)(),
94
- (0, typeorm_1.Column)({ type: 'text', default: null }),
78
+ swagger_1.ApiProperty(),
79
+ typeorm_1.Column({ type: 'text', default: null }),
95
80
  __metadata("design:type", String)
96
81
  ], Setting.prototype, "baiduAnalyticsId", void 0);
97
82
  __decorate([
98
- (0, swagger_1.ApiProperty)(),
99
- (0, typeorm_1.Column)({ type: 'text', default: null }),
83
+ swagger_1.ApiProperty(),
84
+ typeorm_1.Column({ type: 'text', default: null }),
100
85
  __metadata("design:type", String)
101
86
  ], Setting.prototype, "googleAnalyticsId", void 0);
102
87
  __decorate([
103
- (0, swagger_1.ApiProperty)(),
104
- (0, typeorm_1.Column)({ type: 'text', default: null }),
88
+ swagger_1.ApiProperty(),
89
+ typeorm_1.Column({ type: 'text', default: null }),
105
90
  __metadata("design:type", String)
106
91
  ], Setting.prototype, "seoKeyword", void 0);
107
92
  __decorate([
108
- (0, swagger_1.ApiProperty)(),
109
- (0, typeorm_1.Column)({ type: 'text', default: null }),
93
+ swagger_1.ApiProperty(),
94
+ typeorm_1.Column({ type: 'text', default: null }),
110
95
  __metadata("design:type", String)
111
96
  ], Setting.prototype, "seoDesc", void 0);
112
97
  __decorate([
113
- (0, swagger_1.ApiProperty)(),
114
- (0, typeorm_1.Column)({ type: 'text', default: null }),
98
+ swagger_1.ApiProperty(),
99
+ typeorm_1.Column({ type: 'text', default: null }),
115
100
  __metadata("design:type", String)
116
101
  ], Setting.prototype, "oss", void 0);
117
102
  __decorate([
118
- (0, swagger_1.ApiProperty)(),
119
- (0, typeorm_1.Column)({ type: 'text', default: null }),
103
+ swagger_1.ApiProperty(),
104
+ typeorm_1.Column({ type: 'text', default: null }),
120
105
  __metadata("design:type", String)
121
106
  ], Setting.prototype, "smtpHost", void 0);
122
107
  __decorate([
123
- (0, swagger_1.ApiProperty)(),
124
- (0, typeorm_1.Column)({ type: 'text', default: null }),
108
+ swagger_1.ApiProperty(),
109
+ typeorm_1.Column({ type: 'text', default: null }),
125
110
  __metadata("design:type", String)
126
111
  ], Setting.prototype, "smtpPort", void 0);
127
112
  __decorate([
128
- (0, swagger_1.ApiProperty)(),
129
- (0, typeorm_1.Column)({ type: 'text', default: null }),
113
+ swagger_1.ApiProperty(),
114
+ typeorm_1.Column({ type: 'text', default: null }),
130
115
  __metadata("design:type", String)
131
116
  ], Setting.prototype, "smtpUser", void 0);
132
117
  __decorate([
133
- (0, swagger_1.ApiProperty)(),
134
- (0, typeorm_1.Column)({ type: 'text', default: null }),
118
+ swagger_1.ApiProperty(),
119
+ typeorm_1.Column({ type: 'text', default: null }),
135
120
  __metadata("design:type", String)
136
121
  ], Setting.prototype, "smtpPass", void 0);
137
122
  __decorate([
138
- (0, swagger_1.ApiProperty)(),
139
- (0, typeorm_1.Column)({ type: 'text', default: null }),
123
+ swagger_1.ApiProperty(),
124
+ typeorm_1.Column({ type: 'text', default: null }),
140
125
  __metadata("design:type", String)
141
126
  ], Setting.prototype, "smtpFromUser", void 0);
142
127
  __decorate([
143
- (0, swagger_1.ApiProperty)(),
144
- (0, typeorm_1.CreateDateColumn)({
128
+ swagger_1.ApiProperty(),
129
+ typeorm_1.CreateDateColumn({
145
130
  type: 'datetime',
146
131
  comment: '创建时间',
147
132
  name: 'create_at',
@@ -149,8 +134,8 @@ __decorate([
149
134
  __metadata("design:type", Date)
150
135
  ], Setting.prototype, "createAt", void 0);
151
136
  __decorate([
152
- (0, swagger_1.ApiProperty)(),
153
- (0, typeorm_1.UpdateDateColumn)({
137
+ swagger_1.ApiProperty(),
138
+ typeorm_1.UpdateDateColumn({
154
139
  type: 'datetime',
155
140
  comment: '更新时间',
156
141
  name: 'update_at',
@@ -158,7 +143,7 @@ __decorate([
158
143
  __metadata("design:type", Date)
159
144
  ], Setting.prototype, "updateAt", void 0);
160
145
  Setting = __decorate([
161
- (0, typeorm_1.Entity)()
146
+ typeorm_1.Entity()
162
147
  ], Setting);
163
148
  exports.Setting = Setting;
164
149
  //# sourceMappingURL=setting.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../../src/modules/setting/setting.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAAqG;AAG9F,IAAM,OAAO,GAAb,MAAM,OAAO;CAoHnB,CAAA;AAnHC;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACpB;AAEX;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qCAC3B;AAEb;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CAClB;AAEtB;IAAC,IAAA,qBAAW,G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B;AAEjB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACvB;AAEjB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CACnB;AAErB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,WAAW;KAClB,CAAC;8BACQ,IAAI;yCAAC;AAEf;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,WAAW;KAClB,CAAC;8BACQ,IAAI;yCAAC;AAnHJ,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CAoHnB;AApHY,0BAAO"}
1
+ {"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../../src/modules/setting/setting.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qCAAqG;AAGrG,IAAa,OAAO,GAApB,MAAa,OAAO;CAwGnB,CAAA;AArGC;IAFC,qBAAW,EAAE;IACb,gCAAsB,CAAC,MAAM,CAAC;;mCACpB;AAIX;IAFC,qBAAW,EAAE;IACb,gBAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qCAC3B;AAIb;IAFC,qBAAW,EAAE;IACb,gBAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CAClB;AAItB;IAFC,qBAAW,EAAE;IACb,gBAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;0CACtB;AAIlB;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  SettingModule = __decorate([
20
- (0, common_1.Module)({
21
- imports: [typeorm_1.TypeOrmModule.forFeature([setting_entity_1.Setting]), (0, common_1.forwardRef)(() => user_module_1.UserModule), (0, common_1.forwardRef)(() => auth_module_1.AuthModule)],
20
+ common_1.Module({
21
+ imports: [typeorm_1.TypeOrmModule.forFeature([setting_entity_1.Setting]), common_1.forwardRef(() => user_module_1.UserModule), common_1.forwardRef(() => auth_module_1.AuthModule)],
22
22
  exports: [setting_service_1.SettingService],
23
23
  providers: [setting_service_1.SettingService],
24
24
  controllers: [setting_controller_1.SettingController],
@@ -1 +1 @@
1
- {"version":3,"file":"setting.module.js","sourceRoot":"","sources":["../../../src/modules/setting/setting.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAEhD,qDAAiD;AACjD,qDAAiD;AACjD,6DAAyD;AACzD,qDAA2C;AAC3C,uDAAmD;AAQ5C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IANzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,CAAC;QAC1G,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
+ {"version":3,"file":"setting.module.js","sourceRoot":"","sources":["../../../src/modules/setting/setting.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAEhD,qDAAiD;AACjD,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,mBAAU,CAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,EAAE,mBAAU,CAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,CAAC;QAC1G,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,21 +1,10 @@
1
- import { OnModuleInit } from '@nestjs/common';
2
- import { ConfigService } from '@nestjs/config';
3
1
  import { Repository } from 'typeorm';
4
2
  import { Setting } from './setting.entity';
5
- export declare class SettingService implements OnModuleInit {
3
+ export declare class SettingService {
6
4
  private readonly settingRepository;
7
- private readonly configService;
8
- constructor(settingRepository: Repository<Setting>, configService: ConfigService);
9
- onModuleInit(): void;
10
- private runInitializers;
11
- getSettingRow(): Promise<Setting>;
12
- private settingRowScore;
13
- private ensureSettingRow;
5
+ constructor(settingRepository: Repository<Setting>);
14
6
  initI18n(): Promise<void>;
15
7
  initGlobalConfig(): Promise<void>;
16
- initSystemSettings(): Promise<void>;
17
- migrateLegacyAppearance(): Promise<void>;
18
- initThemeConfigurations(): Promise<void>;
19
8
  findAll(innerInvoke?: boolean, isAdmin?: boolean): Promise<Setting>;
20
9
  update(setting: Partial<Setting>): Promise<Setting>;
21
10
  }
@@ -13,76 +13,22 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.SettingService = void 0;
16
- const extension_1 = require("../../../../toolkit/dist/theme/extension");
17
16
  const common_1 = require("@nestjs/common");
18
- const config_1 = require("@nestjs/config");
19
17
  const typeorm_1 = require("@nestjs/typeorm");
20
18
  const merge = require("deepmerge");
21
19
  const typeorm_2 = require("typeorm");
22
20
  const setting_constant_1 = require("./setting.constant");
23
21
  const setting_entity_1 = require("./setting.entity");
24
- const bootstrap_constants_1 = require("../bootstrap/bootstrap.constants");
25
- const install_locale_1 = require("../bootstrap/install-locale");
26
- const THEMES_WITH_CONFIGURATION = ['reactpress-theme-starter'];
27
- function trimUrl(url) {
28
- return url.replace(/\/+$/, '');
29
- }
30
22
  let SettingService = class SettingService {
31
- constructor(settingRepository, configService) {
23
+ constructor(settingRepository) {
32
24
  this.settingRepository = settingRepository;
33
- this.configService = configService;
34
- }
35
- onModuleInit() {
36
- void this.runInitializers();
37
- }
38
- async runInitializers() {
39
- try {
40
- await this.initI18n();
41
- await this.initGlobalConfig();
42
- await this.initSystemSettings();
43
- await this.migrateLegacyAppearance();
44
- await this.initThemeConfigurations();
45
- }
46
- catch (error) {
47
- console.error('[SettingService] initialization failed:', error);
48
- }
49
- }
50
- async getSettingRow() {
51
- return this.ensureSettingRow();
52
- }
53
- settingRowScore(row) {
54
- var _a, _b, _c;
55
- return ((((_a = row.globalSetting) === null || _a === void 0 ? void 0 : _a.trim()) ? 4 : 0) +
56
- (((_b = row.i18n) === null || _b === void 0 ? void 0 : _b.trim()) ? 2 : 0) +
57
- (((_c = row.systemTitle) === null || _c === void 0 ? void 0 : _c.trim()) ? 1 : 0));
58
- }
59
- async ensureSettingRow() {
60
- const items = await this.settingRepository.find({ order: { createAt: 'ASC' } });
61
- if (items.length === 0) {
62
- return this.settingRepository.save(this.settingRepository.create({}));
63
- }
64
- if (items.length === 1)
65
- return items[0];
66
- const sorted = [...items].sort((a, b) => this.settingRowScore(b) - this.settingRowScore(a));
67
- const primary = Object.assign({}, sorted[0]);
68
- for (const row of sorted.slice(1)) {
69
- for (const key of Object.keys(row)) {
70
- if (key === 'id' || key === 'createAt' || key === 'updateAt')
71
- continue;
72
- const val = row[key];
73
- const current = primary[key];
74
- if (val != null && String(val).trim() !== '' && (current == null || String(current).trim() === '')) {
75
- primary[key] = val;
76
- }
77
- }
78
- }
79
- const saved = await this.settingRepository.save(primary);
80
- await this.settingRepository.remove(sorted.slice(1));
81
- return saved;
25
+ this.initI18n();
26
+ this.initGlobalConfig();
82
27
  }
83
28
  async initI18n() {
84
29
  try {
85
- const target = await this.ensureSettingRow();
30
+ const items = await this.settingRepository.find();
31
+ const target = (items && items[0]) || {};
86
32
  let data = {};
87
33
  try {
88
34
  if (target.i18n) {
@@ -110,142 +56,51 @@ let SettingService = class SettingService {
110
56
  }
111
57
  }
112
58
  async initGlobalConfig() {
113
- var _a;
114
- const target = await this.ensureSettingRow();
59
+ const items = await this.settingRepository.find();
60
+ const target = (items && items[0]) || {};
115
61
  let data = {};
116
62
  try {
117
63
  if (target.globalSetting) {
118
64
  data = JSON.parse(target.globalSetting);
119
65
  }
120
66
  }
121
- catch (_b) {
67
+ catch (e) {
122
68
  data = {};
123
69
  }
124
- const themeState = (0, extension_1.getThemeStateFromGlobalSetting)(data);
125
- const defaultTheme = (0, extension_1.getThemeStateFromGlobalSetting)(setting_constant_1.settings);
126
- const mergedTheme = Object.assign(Object.assign(Object.assign({}, defaultTheme), themeState), { mods: Object.assign(Object.assign({}, defaultTheme.mods), themeState.mods), installedThemes: ((_a = themeState.installedThemes) === null || _a === void 0 ? void 0 : _a.length) > 0 ? themeState.installedThemes : defaultTheme.installedThemes });
127
- const mergedSettings = Object.assign(Object.assign({}, data), { theme: mergedTheme });
70
+ const mergedSettings = merge({}, setting_constant_1.settings, data);
128
71
  const mergedSettingsString = JSON.stringify(mergedSettings);
129
72
  if (!target.globalSetting || target.globalSetting !== mergedSettingsString) {
130
73
  target.globalSetting = mergedSettingsString;
131
74
  await this.settingRepository.save(target);
132
75
  }
133
76
  }
134
- async initSystemSettings() {
135
- const locale = (0, install_locale_1.resolveInstallLocale)(this.configService.get('REACTPRESS_LANG') || this.configService.get('LANG'));
136
- const clientSiteUrl = this.configService.get('CLIENT_SITE_URL', 'http://localhost:3001');
137
- const urlDefaults = {
138
- systemUrl: clientSiteUrl,
139
- adminSystemUrl: `${trimUrl(clientSiteUrl)}/admin/`,
140
- };
141
- const target = await this.ensureSettingRow();
142
- let changed = false;
143
- const merged = Object.assign(Object.assign({}, (0, bootstrap_constants_1.getSystemSettingSeedDefaults)(locale)), urlDefaults);
144
- for (const [key, defaultValue] of Object.entries(merged)) {
145
- const current = target[key];
146
- if (current != null && String(current).trim() !== '')
147
- continue;
148
- target[key] = defaultValue;
149
- changed = true;
150
- }
151
- if (!changed)
152
- return;
153
- await this.settingRepository.save(target);
154
- console.log(`[SettingService] system settings seeded with built-in defaults (${locale})`);
155
- }
156
- async migrateLegacyAppearance() {
157
- const target = await this.ensureSettingRow();
158
- if (!target.id && !target.globalSetting)
159
- return;
160
- let gs = {};
161
- try {
162
- if (target.globalSetting) {
163
- gs = JSON.parse(target.globalSetting);
164
- }
165
- }
166
- catch (_a) {
167
- gs = {};
168
- }
169
- const { global, changed } = (0, extension_1.migrateLegacyAppearanceToThemeMods)(gs, target);
170
- if (changed) {
171
- target.globalSetting = JSON.stringify(global);
172
- await this.settingRepository.save(target);
173
- console.log('[SettingService] legacy appearance migrated to theme mods');
174
- }
175
- }
176
- async initThemeConfigurations() {
177
- const target = await this.ensureSettingRow();
178
- let gs = {};
179
- try {
180
- if (target.globalSetting) {
181
- gs = JSON.parse(target.globalSetting);
182
- }
183
- }
184
- catch (_a) {
185
- gs = {};
186
- }
187
- const themeState = (0, extension_1.getThemeStateFromGlobalSetting)(gs);
188
- const activeTheme = themeState.activeTheme || 'hello-world';
189
- const config = gs.config && typeof gs.config === 'object'
190
- ? Object.assign({}, gs.config)
191
- : {};
192
- let changed = false;
193
- for (const themeId of THEMES_WITH_CONFIGURATION) {
194
- const seed = (0, extension_1.getThemeConfigurationSeed)(themeId, 'zh');
195
- if (!seed)
196
- continue;
197
- const current = config[themeId];
198
- const merged = merge({}, seed, current && typeof current === 'object' ? current : {});
199
- const mergedStr = JSON.stringify(merged);
200
- const prevStr = JSON.stringify(current !== null && current !== void 0 ? current : {});
201
- if (mergedStr !== prevStr) {
202
- config[themeId] = merged;
203
- changed = true;
204
- }
205
- }
206
- if (!gs.config && Object.keys(config).length) {
207
- changed = true;
208
- }
209
- if (changed) {
210
- gs.config = config;
211
- target.globalSetting = JSON.stringify(gs);
212
- await this.settingRepository.save(target);
213
- console.log(`[SettingService] theme config seeded (active: ${activeTheme})`);
214
- }
215
- }
216
77
  async findAll(innerInvoke = false, isAdmin = false) {
217
- const res = await this.ensureSettingRow().catch(() => null);
78
+ const data = await this.settingRepository.find();
79
+ const res = data[0];
218
80
  if (!res) {
219
81
  return {};
220
82
  }
221
- if (isAdmin && !innerInvoke) {
83
+ if (innerInvoke || isAdmin) {
222
84
  return res;
223
85
  }
224
- const effective = (0, extension_1.resolveEffectiveSettingRow)(res);
225
- if (innerInvoke) {
226
- return effective;
227
- }
228
- return (0, extension_1.buildPublicSettingView)(effective);
86
+ const filterRes = setting_constant_1.UNPROTECTED_KEYS.reduce((a, c) => {
87
+ a[c] = res[c];
88
+ return a;
89
+ }, {});
90
+ return filterRes;
229
91
  }
230
92
  async update(setting) {
231
- var _a;
232
- const old = await this.ensureSettingRow();
233
- const sanitized = (0, extension_1.pickSystemSettingPatch)(setting);
234
- if ('smtpPass' in sanitized && !String((_a = sanitized.smtpPass) !== null && _a !== void 0 ? _a : '').trim()) {
235
- delete sanitized.smtpPass;
236
- }
237
- if (Object.keys(sanitized).length === 0) {
238
- return old !== null && old !== void 0 ? old : {};
239
- }
240
- const updatedTag = await this.settingRepository.merge(old, sanitized);
93
+ const old = await this.settingRepository.find();
94
+ const updatedTag = old && old[0]
95
+ ? await this.settingRepository.merge(old[0], setting)
96
+ : await this.settingRepository.create(setting);
241
97
  return this.settingRepository.save(updatedTag);
242
98
  }
243
99
  };
244
100
  SettingService = __decorate([
245
- (0, common_1.Injectable)(),
246
- __param(0, (0, typeorm_1.InjectRepository)(setting_entity_1.Setting)),
247
- __metadata("design:paramtypes", [typeorm_2.Repository,
248
- config_1.ConfigService])
101
+ common_1.Injectable(),
102
+ __param(0, typeorm_1.InjectRepository(setting_entity_1.Setting)),
103
+ __metadata("design:paramtypes", [typeorm_2.Repository])
249
104
  ], SettingService);
250
105
  exports.SettingService = SettingService;
251
106
  //# sourceMappingURL=setting.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setting.service.js","sourceRoot":"","sources":["../../../src/modules/setting/setting.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wEAOyD;AACzD,2CAA0D;AAC1D,2CAA+C;AAC/C,6CAAmD;AACnD,mCAAmC;AACnC,qCAAqC;AAErC,yDAAoD;AACpD,qDAA2C;AAC3C,0EAAgF;AAChF,gEAAmE;AAEnE,MAAM,yBAAyB,GAAG,CAAC,0BAA0B,CAAU,CAAC;AAExE,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,iBAAsC,EACtC,aAA4B;QAD5B,sBAAiB,GAAjB,iBAAiB,CAAqB;QACtC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,YAAY;QACV,KAAK,IAAI,CAAC,eAAe,EAAE,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,IAAI;YACF,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAChC,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;SACtC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;SACjE;IACH,CAAC;IAGD,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,gBAA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ass: string;
6
- };
7
- export declare const sendEmail: (message: Record<string, unknown>, { host, port, user, pass }: SmtpTransportConfig) => Promise<unknown>;
1
+ export declare const sendEmail: (message: any, { host, port, user, pass }: {
2
+ host: any;
3
+ port: any;
4
+ user: any;
5
+ pass: any;
6
+ }) => Promise<unknown>;
@@ -5,14 +5,18 @@ const nodemailer = require('nodemailer');
5
5
  const sendEmail = (message, { host, port, user, pass }) => {
6
6
  if (!host || !port || !user || !pass) {
7
7
  console.log('邮箱配置不正确,无法发送邮件');
8
- return Promise.reject(new Error('SMTP configuration is incomplete'));
8
+ return null;
9
9
  }
10
- const portNum = Number(port);
11
- const secure = portNum === 465;
12
- const transport = nodemailer.createTransport(Object.assign({ host, port: portNum, secure, auth: {
10
+ const transport = nodemailer.createTransport({
11
+ host,
12
+ port,
13
+ secureConnection: true,
14
+ secure: true,
15
+ auth: {
13
16
  user,
14
17
  pass,
15
- } }, (portNum === 587 ? { requireTLS: true } : {})));
18
+ },
19
+ });
16
20
  return new Promise((resolve, reject) => {
17
21
  transport.sendMail(message, function (err, info) {
18
22
  if (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"mail.util.js","sourceRoot":"","sources":["../../../src/modules/smtp/mail.util.ts"],"names":[],"mappings":";;;AACA,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AASlC,MAAM,SAAS,GAAG,CACvB,OAAgC,EAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAuB,EAC/C,EAAE;IACF,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE;QACpC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC9B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;KACtE;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,MAAM,GAA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EAAE;YACJ,IAAI;YACJ,IAAI;SACL;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAS,GAAG,EAAE,IAAI;YAC5C,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC3B,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,CAAC;aACf;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB"}
@@ -4,9 +4,6 @@ export declare class SMTPController {
4
4
  private readonly smtpService;
5
5
  constructor(smtpService: SMTPService);
6
6
  create(data: any): Promise<SMTP>;
7
- testSend(data: any): Promise<{
8
- ok: true;
9
- }>;
10
7
  findAll(queryParam: any): Promise<[SMTP[], number]>;
11
8
  deleteById(id: any): Promise<SMTP>;
12
9
  }