cc-core-cli 1.0.131 → 1.0.135

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 (467) hide show
  1. package/bin/index.js +4 -4
  2. package/package.json +1 -1
  3. package/template/admin/Dockerfile +4 -7
  4. package/template/admin/config/service-account.json +1 -0
  5. package/template/admin/index.js +67 -0
  6. package/template/admin/next.config.js +66 -0
  7. package/template/admin/package.json +10 -23
  8. package/template/admin/pages/404.js +13 -0
  9. package/template/admin/pages/[...url_key].js +21 -0
  10. package/template/admin/pages/_app.js +16 -0
  11. package/template/admin/pages/_document.js +43 -0
  12. package/template/admin/pages/callback/[channel].js +13 -0
  13. package/template/admin/pages/callback.js +13 -0
  14. package/template/admin/pages/change_password_expired.js +13 -0
  15. package/template/admin/pages/check_session.js +13 -0
  16. package/template/admin/pages/cognito.js +13 -0
  17. package/template/admin/pages/confirmpassword.js +12 -0
  18. package/template/admin/pages/forgotpassword.js +12 -0
  19. package/template/admin/pages/index.js +13 -0
  20. package/template/admin/pages/login.js +13 -0
  21. package/template/admin/pages/maintenance.js +12 -0
  22. package/template/admin/pages/password_expired.js +13 -0
  23. package/template/admin/pages/permission_denied.js +13 -0
  24. package/template/admin/pages/profile.js +14 -0
  25. package/template/admin/pages/register.js +13 -0
  26. package/template/admin/pages/setting/[...setting_url_key].js +13 -0
  27. package/template/admin/pages/setting/entities/[subList]/detail.js +14 -0
  28. package/template/admin/pages/setting/entities/[subList]/detail_compare.js +8 -0
  29. package/template/admin/pages/setting/entities/[subList]/index.js +7 -0
  30. package/template/admin/pages/setting/entities/detail/index.js +14 -0
  31. package/template/admin/pages/setting/entities/index.js +14 -0
  32. package/template/admin/pages/social.js +13 -0
  33. package/template/admin/pages/token_expired.js +12 -0
  34. package/template/admin/public/icon-192x192.png +0 -0
  35. package/template/admin/public/icon-256x256.png +0 -0
  36. package/template/admin/public/icon-384x384.png +0 -0
  37. package/template/admin/public/icon-512x512.png +0 -0
  38. package/template/admin/public/manifest.json +32 -0
  39. package/template/admin/public/private-image-worker.js +7 -10
  40. package/template/admin/public/static/images/adv_settings.svg +130 -0
  41. package/template/admin/public/static/images/aws-cognito.png +0 -0
  42. package/template/admin/public/static/images/azure-ad.svg +1 -0
  43. package/template/admin/public/static/images/bin_icon.svg +1 -0
  44. package/template/admin/public/static/images/color-picker.png +0 -0
  45. package/template/admin/public/static/images/csv_icon.svg +1 -0
  46. package/template/admin/public/static/images/default-file.png +0 -0
  47. package/template/admin/public/static/images/default-img.png +0 -0
  48. package/template/admin/public/static/images/default-map.png +0 -0
  49. package/template/admin/public/static/images/default-profile.png +0 -0
  50. package/template/admin/public/static/images/doc_icon.svg +1 -0
  51. package/template/admin/public/static/images/exe_icon.svg +1 -0
  52. package/template/admin/public/static/images/gif_icon.svg +1 -0
  53. package/template/admin/public/static/images/google.png +0 -0
  54. package/template/admin/public/static/images/icon-youtub.webp +0 -0
  55. package/template/admin/public/static/images/id-connect.png +0 -0
  56. package/template/admin/public/static/images/iso_icon.svg +1 -0
  57. package/template/admin/public/static/images/json_icon.png +0 -0
  58. package/template/admin/public/static/images/lang/af-ZA.svg +41 -0
  59. package/template/admin/public/static/images/lang/ar-AE.svg +38 -0
  60. package/template/admin/public/static/images/lang/ar-BH.svg +36 -0
  61. package/template/admin/public/static/images/lang/ar-DZ.svg +40 -0
  62. package/template/admin/public/static/images/lang/ar-EG.svg +38 -0
  63. package/template/admin/public/static/images/lang/ar-IQ.svg +46 -0
  64. package/template/admin/public/static/images/lang/ar-JO.svg +39 -0
  65. package/template/admin/public/static/images/lang/ar-KW.svg +38 -0
  66. package/template/admin/public/static/images/lang/ar-LB.svg +40 -0
  67. package/template/admin/public/static/images/lang/ar-LY.svg +41 -0
  68. package/template/admin/public/static/images/lang/ar-MA.svg +36 -0
  69. package/template/admin/public/static/images/lang/ar-OM.svg +70 -0
  70. package/template/admin/public/static/images/lang/ar-QA.svg +36 -0
  71. package/template/admin/public/static/images/lang/ar-SA.svg +62 -0
  72. package/template/admin/public/static/images/lang/ar-TN.svg +40 -0
  73. package/template/admin/public/static/images/lang/ar-YE.svg +37 -0
  74. package/template/admin/public/static/images/lang/az-AZ.svg +41 -0
  75. package/template/admin/public/static/images/lang/be-BY.svg +38 -0
  76. package/template/admin/public/static/images/lang/bg-BG.svg +37 -0
  77. package/template/admin/public/static/images/lang/bs-BA.svg +48 -0
  78. package/template/admin/public/static/images/lang/ca-ES.svg +89 -0
  79. package/template/admin/public/static/images/lang/cs-CZ.svg +37 -0
  80. package/template/admin/public/static/images/lang/cy-GB.svg +43 -0
  81. package/template/admin/public/static/images/lang/da-DK.svg +36 -0
  82. package/template/admin/public/static/images/lang/de-AT.svg +39 -0
  83. package/template/admin/public/static/images/lang/de-CH.svg +36 -0
  84. package/template/admin/public/static/images/lang/de-DE.svg +37 -0
  85. package/template/admin/public/static/images/lang/de-LI.svg +45 -0
  86. package/template/admin/public/static/images/lang/de-LU.svg +37 -0
  87. package/template/admin/public/static/images/lang/dv-MV.svg +37 -0
  88. package/template/admin/public/static/images/lang/el-GR.svg +46 -0
  89. package/template/admin/public/static/images/lang/en-AU.svg +51 -0
  90. package/template/admin/public/static/images/lang/en-BZ.svg +196 -0
  91. package/template/admin/public/static/images/lang/en-CA.svg +43 -0
  92. package/template/admin/public/static/images/lang/en-GB.svg +43 -0
  93. package/template/admin/public/static/images/lang/en-IE.svg +37 -0
  94. package/template/admin/public/static/images/lang/en-JM.svg +40 -0
  95. package/template/admin/public/static/images/lang/en-NZ.svg +51 -0
  96. package/template/admin/public/static/images/lang/en-PH.svg +51 -0
  97. package/template/admin/public/static/images/lang/en-SG.svg +44 -0
  98. package/template/admin/public/static/images/lang/en-TT.svg +40 -0
  99. package/template/admin/public/static/images/lang/en-US.svg +88 -0
  100. package/template/admin/public/static/images/lang/en-ZA.svg +41 -0
  101. package/template/admin/public/static/images/lang/en-ZW.svg +50 -0
  102. package/template/admin/public/static/images/lang/es-AR.svg +41 -0
  103. package/template/admin/public/static/images/lang/es-BO.svg +101 -0
  104. package/template/admin/public/static/images/lang/es-CL.svg +38 -0
  105. package/template/admin/public/static/images/lang/es-CO.svg +37 -0
  106. package/template/admin/public/static/images/lang/es-CR.svg +111 -0
  107. package/template/admin/public/static/images/lang/es-DO.svg +103 -0
  108. package/template/admin/public/static/images/lang/es-EC.svg +87 -0
  109. package/template/admin/public/static/images/lang/es-ES.svg +89 -0
  110. package/template/admin/public/static/images/lang/es-GT.svg +109 -0
  111. package/template/admin/public/static/images/lang/es-HN.svg +46 -0
  112. package/template/admin/public/static/images/lang/es-MX.svg +60 -0
  113. package/template/admin/public/static/images/lang/es-NI.svg +82 -0
  114. package/template/admin/public/static/images/lang/es-PA.svg +41 -0
  115. package/template/admin/public/static/images/lang/es-PE.svg +37 -0
  116. package/template/admin/public/static/images/lang/es-PR.svg +43 -0
  117. package/template/admin/public/static/images/lang/es-PY.svg +41 -0
  118. package/template/admin/public/static/images/lang/es-SV.svg +115 -0
  119. package/template/admin/public/static/images/lang/es-UY.svg +75 -0
  120. package/template/admin/public/static/images/lang/es-VE.svg +49 -0
  121. package/template/admin/public/static/images/lang/et-EE.svg +37 -0
  122. package/template/admin/public/static/images/lang/eu-ES.svg +89 -0
  123. package/template/admin/public/static/images/lang/fa-IR.svg +81 -0
  124. package/template/admin/public/static/images/lang/fi-FI.svg +36 -0
  125. package/template/admin/public/static/images/lang/fr-BE.svg +37 -0
  126. package/template/admin/public/static/images/lang/fr-CA.svg +43 -0
  127. package/template/admin/public/static/images/lang/fr-CH.svg +36 -0
  128. package/template/admin/public/static/images/lang/fr-FR.svg +37 -0
  129. package/template/admin/public/static/images/lang/fr-LU.svg +37 -0
  130. package/template/admin/public/static/images/lang/fr-MC.svg +36 -0
  131. package/template/admin/public/static/images/lang/gl-ES.svg +89 -0
  132. package/template/admin/public/static/images/lang/gu-IN.svg +59 -0
  133. package/template/admin/public/static/images/lang/he-IL.svg +37 -0
  134. package/template/admin/public/static/images/lang/hi-IN.svg +59 -0
  135. package/template/admin/public/static/images/lang/hr-BA.svg +48 -0
  136. package/template/admin/public/static/images/lang/hr-HR.svg +101 -0
  137. package/template/admin/public/static/images/lang/hu-HU.svg +37 -0
  138. package/template/admin/public/static/images/lang/hy-AM.svg +37 -0
  139. package/template/admin/public/static/images/lang/id-ID.svg +36 -0
  140. package/template/admin/public/static/images/lang/is-IS.svg +37 -0
  141. package/template/admin/public/static/images/lang/it-CH.svg +36 -0
  142. package/template/admin/public/static/images/lang/it-IT.svg +37 -0
  143. package/template/admin/public/static/images/lang/ja-JP.svg +36 -0
  144. package/template/admin/public/static/images/lang/ka-GE.svg +42 -0
  145. package/template/admin/public/static/images/lang/kk-KZ.svg +72 -0
  146. package/template/admin/public/static/images/lang/kn-IN.svg +59 -0
  147. package/template/admin/public/static/images/lang/ko-KR.svg +57 -0
  148. package/template/admin/public/static/images/lang/kok-IN.svg +59 -0
  149. package/template/admin/public/static/images/lang/ky-KG.svg +54 -0
  150. package/template/admin/public/static/images/lang/lt-LT.svg +37 -0
  151. package/template/admin/public/static/images/lang/lv-LV.svg +36 -0
  152. package/template/admin/public/static/images/lang/mi-NZ.svg +51 -0
  153. package/template/admin/public/static/images/lang/mk-MK.svg +46 -0
  154. package/template/admin/public/static/images/lang/mn-MN.svg +50 -0
  155. package/template/admin/public/static/images/lang/mr-IN.svg +59 -0
  156. package/template/admin/public/static/images/lang/ms-BN.svg +47 -0
  157. package/template/admin/public/static/images/lang/ms-MY.svg +53 -0
  158. package/template/admin/public/static/images/lang/mt-MT.svg +50 -0
  159. package/template/admin/public/static/images/lang/nb-NO.svg +37 -0
  160. package/template/admin/public/static/images/lang/nl-BE.svg +37 -0
  161. package/template/admin/public/static/images/lang/nl-NL.svg +37 -0
  162. package/template/admin/public/static/images/lang/nn-NO.svg +37 -0
  163. package/template/admin/public/static/images/lang/ns-ZA.svg +41 -0
  164. package/template/admin/public/static/images/lang/pa-IN.svg +59 -0
  165. package/template/admin/public/static/images/lang/pl-PL.svg +36 -0
  166. package/template/admin/public/static/images/lang/ps-AR.svg +68 -0
  167. package/template/admin/public/static/images/lang/pt-BR.svg +51 -0
  168. package/template/admin/public/static/images/lang/pt-PT.svg +55 -0
  169. package/template/admin/public/static/images/lang/qu-BO.svg +101 -0
  170. package/template/admin/public/static/images/lang/qu-EC.svg +87 -0
  171. package/template/admin/public/static/images/lang/qu-PE.svg +37 -0
  172. package/template/admin/public/static/images/lang/ro-RO.svg +37 -0
  173. package/template/admin/public/static/images/lang/ru-RU.svg +37 -0
  174. package/template/admin/public/static/images/lang/sa-IN.svg +59 -0
  175. package/template/admin/public/static/images/lang/se-FI.svg +36 -0
  176. package/template/admin/public/static/images/lang/se-NO.svg +37 -0
  177. package/template/admin/public/static/images/lang/se-SE.svg +36 -0
  178. package/template/admin/public/static/images/lang/sk-SK.svg +41 -0
  179. package/template/admin/public/static/images/lang/sl-SI.svg +51 -0
  180. package/template/admin/public/static/images/lang/sq-AL.svg +36 -0
  181. package/template/admin/public/static/images/lang/sr-BA.svg +48 -0
  182. package/template/admin/public/static/images/lang/sr-SP.svg +79 -0
  183. package/template/admin/public/static/images/lang/sv-FI.svg +36 -0
  184. package/template/admin/public/static/images/lang/sv-SE.svg +36 -0
  185. package/template/admin/public/static/images/lang/sw-KE.svg +55 -0
  186. package/template/admin/public/static/images/lang/syr-SY.svg +41 -0
  187. package/template/admin/public/static/images/lang/ta-IN.svg +59 -0
  188. package/template/admin/public/static/images/lang/te-IN.svg +59 -0
  189. package/template/admin/public/static/images/lang/th-TH.svg +40 -0
  190. package/template/admin/public/static/images/lang/tl-PH.svg +51 -0
  191. package/template/admin/public/static/images/lang/tn-ZA.svg +41 -0
  192. package/template/admin/public/static/images/lang/tr-TR.svg +39 -0
  193. package/template/admin/public/static/images/lang/tt-RU.svg +37 -0
  194. package/template/admin/public/static/images/lang/uk-UA.svg +36 -0
  195. package/template/admin/public/static/images/lang/ur-PK.svg +40 -0
  196. package/template/admin/public/static/images/lang/vi-VN.svg +36 -0
  197. package/template/admin/public/static/images/lang/xh-ZA.svg +41 -0
  198. package/template/admin/public/static/images/lang/zh-CN.svg +42 -0
  199. package/template/admin/public/static/images/lang/zh-HK.svg +42 -0
  200. package/template/admin/public/static/images/lang/zh-SG.svg +44 -0
  201. package/template/admin/public/static/images/lang/zh-TW.svg +43 -0
  202. package/template/admin/public/static/images/lang/zu-ZA.svg +41 -0
  203. package/template/admin/public/static/images/logo-company-default.svg +1 -0
  204. package/template/admin/public/static/images/logo.png +0 -0
  205. package/template/admin/public/static/images/m_logo.png +0 -0
  206. package/template/admin/public/static/images/maintenance-icon.png +0 -0
  207. package/template/admin/public/static/images/member_logo.png +0 -0
  208. package/template/admin/public/static/images/pdf_icon.svg +1 -0
  209. package/template/admin/public/static/images/png_icon.svg +1 -0
  210. package/template/admin/public/static/images/security.png +0 -0
  211. package/template/admin/public/static/images/template-bar.svg +820 -0
  212. package/template/admin/public/static/images/template-bubble.png +0 -0
  213. package/template/admin/public/static/images/template-line.png +0 -0
  214. package/template/admin/public/static/images/template-mixed.jpeg +0 -0
  215. package/template/admin/public/static/images/template-pie.png +0 -0
  216. package/template/admin/public/static/images/template-polar-area.png +0 -0
  217. package/template/admin/public/static/images/template-radar.jpg +0 -0
  218. package/template/admin/public/static/images/template-radar.png +0 -0
  219. package/template/admin/public/static/images/template-scatter.png +0 -0
  220. package/template/admin/public/static/images/translation.svg +82 -0
  221. package/template/admin/public/static/images/txt_icon.svg +1 -0
  222. package/template/admin/public/static/images/widget-bubble.png +0 -0
  223. package/template/admin/public/static/images/widget-column.png +0 -0
  224. package/template/admin/public/static/images/widget-combo.png +0 -0
  225. package/template/admin/public/static/images/widget-doughnut.png +0 -0
  226. package/template/admin/public/static/images/widget-line.png +0 -0
  227. package/template/admin/public/static/images/widget-pie.png +0 -0
  228. package/template/admin/public/static/images/widget-scatter.png +0 -0
  229. package/template/admin/public/static/images/widget-summary_box.png +0 -0
  230. package/template/admin/public/static/images/widget-treemap.png +0 -0
  231. package/template/admin/public/static/images/xls_icon.svg +1 -0
  232. package/template/admin/public/static/images/xml_icon.svg +1 -0
  233. package/template/admin/public/static/images/zip_icon.svg +1 -0
  234. package/template/admin/public/static/styles/activity_log.less +157 -0
  235. package/template/admin/public/static/styles/calendar.less +145 -0
  236. package/template/admin/public/static/styles/collections.less +123 -0
  237. package/template/admin/public/static/styles/compute_field.less +250 -0
  238. package/template/admin/public/static/styles/custom-antd.less +80 -0
  239. package/template/admin/public/static/styles/custom_icon.less +556 -0
  240. package/template/admin/public/static/styles/date_search.less +63 -0
  241. package/template/admin/public/static/styles/datepicker.less +323 -0
  242. package/template/admin/public/static/styles/detail.less +2690 -0
  243. package/template/admin/public/static/styles/editTable.less +23 -0
  244. package/template/admin/public/static/styles/entities.less +897 -0
  245. package/template/admin/public/static/styles/filter.less +24 -0
  246. package/template/admin/public/static/styles/filter_new.less +154 -0
  247. package/template/admin/public/static/styles/hook.less +142 -0
  248. package/template/admin/public/static/styles/import_export.less +62 -0
  249. package/template/admin/public/static/styles/input.less +386 -0
  250. package/template/admin/public/static/styles/layout.less +1455 -0
  251. package/template/admin/public/static/styles/login.less +263 -0
  252. package/template/admin/public/static/styles/mainheader.less +32 -0
  253. package/template/admin/public/static/styles/matrix.less +105 -0
  254. package/template/admin/public/static/styles/permission_denied.less +13 -0
  255. package/template/admin/public/static/styles/pipeline.less +84 -0
  256. package/template/admin/public/static/styles/print_template.less +730 -0
  257. package/template/admin/public/static/styles/rabbitmq.less +3 -0
  258. package/template/admin/public/static/styles/restful.less +22 -0
  259. package/template/admin/public/static/styles/setting.less +534 -0
  260. package/template/admin/public/static/styles/style.less +1957 -0
  261. package/template/admin/public/static/styles/system.less +11 -0
  262. package/template/admin/public/static/styles/tree_theme_minimal.less +321 -0
  263. package/template/admin/public/static/styles/versioning_control.less +24 -0
  264. package/template/admin/public/static/styles/wysiwyg.less +8 -0
  265. package/template/admin/theme/main.less +1 -0
  266. package/template/admin/theme/vars.less +41 -0
  267. package/template/admin_v3/src/pages/api/database/[type]/index.ts +23 -0
  268. package/template/admin_v3/src/pages/api/layout_chart_widget/[name]/index.ts +18 -0
  269. package/template/admin_v3/src/pages/api/layout_chart_widget/compare_matrix.ts +17 -0
  270. package/template/admin_v3/src/pages/api/redis/[type]/[connect]/index.ts +20 -0
  271. package/template/admin_v3/src/pages/api/redis/custom.ts +10 -0
  272. package/template/{admin/src/pages/api/entity/schema/index.ts → admin_v3/src/pages/api/setting/module/[code].ts} +12 -5
  273. package/template/admin_v3/src/pages/api/template/[type].ts +21 -0
  274. package/template/{admin/src/pages/api/import_export/execute/index.ts → admin_v3/src/pages/api/template/bulk_print/[id].ts} +4 -2
  275. package/template/admin_v3/src/pages/api/template/print/[id]/[doc_ref].ts +11 -0
  276. package/template/core_v3/Dockerfile +60 -0
  277. package/template/core_v3/_env +12 -0
  278. package/template/core_v3/_gitignore +52 -0
  279. package/template/core_v3/_npmrc +1 -0
  280. package/template/core_v3/buildspec.yml +29 -0
  281. package/template/core_v3/docker-compose.yml +11 -0
  282. package/template/core_v3/jest.config.js +43 -0
  283. package/template/core_v3/newrelic.sh +15 -0
  284. package/template/core_v3/package.json +54 -0
  285. package/template/core_v3/post-install.js +34 -0
  286. package/template/core_v3/sonar-project.properties +27 -0
  287. package/template/core_v3/src/app.controller.ts +39 -0
  288. package/template/core_v3/src/app.module.ts +174 -0
  289. package/template/core_v3/src/app.service.ts +21 -0
  290. package/template/core_v3/src/app_cluster.service.ts +61 -0
  291. package/template/core_v3/src/core/core.controller.ts +444 -0
  292. package/template/core_v3/src/core/core.module.ts +90 -0
  293. package/template/core_v3/src/core/core.service.ts +737 -0
  294. package/template/core_v3/src/core/setting/_settings/about.layout.json +105 -0
  295. package/template/core_v3/src/core/setting/_settings/cache.layout.json +309 -0
  296. package/template/core_v3/src/core/setting/_settings/global_login.json +299 -0
  297. package/template/core_v3/src/core/setting/_settings/header_footer.json +83 -0
  298. package/template/core_v3/src/core/setting/_settings/import_export.layout.json +69 -0
  299. package/template/core_v3/src/core/setting/_settings/list_detail.json +685 -0
  300. package/template/core_v3/src/core/setting/_settings/logs.layout.json +39 -0
  301. package/template/core_v3/src/core/setting/_settings/queue.layout.json +63 -0
  302. package/template/core_v3/src/core/setting/_settings/schedule.layout.json +132 -0
  303. package/template/core_v3/src/core/setting/_settings/security.layout.json +1110 -0
  304. package/template/core_v3/src/core/setting/_settings/storage.layout.json +158 -0
  305. package/template/core_v3/src/core/setting/_settings/swagger.layout.json +128 -0
  306. package/template/core_v3/src/core/setting/_settings/toast.json +344 -0
  307. package/template/core_v3/src/main.ts +308 -0
  308. package/template/core_v3/src/modules/modules.ts +16 -0
  309. package/template/core_v3/src/private.controller.ts +18 -0
  310. package/template/core_v3/storage/documents/index.html +14 -0
  311. package/template/core_v3/storage/public/system/menu/icons/company.svg +1 -0
  312. package/template/core_v3/storage/public/system/menu/icons/deploy.svg +2 -0
  313. package/template/core_v3/storage/public/system/menu/icons/entities.svg +55 -0
  314. package/template/core_v3/storage/public/system/menu/icons/files.svg +1 -0
  315. package/template/core_v3/storage/public/system/menu/icons/gateway.svg +1 -0
  316. package/template/core_v3/storage/public/system/menu/icons/import-export.svg +41 -0
  317. package/template/core_v3/storage/public/system/menu/icons/integration.svg +1 -0
  318. package/template/core_v3/storage/public/system/menu/icons/master_data.svg +53 -0
  319. package/template/core_v3/storage/public/system/menu/icons/modules.svg +79 -0
  320. package/template/core_v3/storage/public/system/menu/icons/monitoring.svg +114 -0
  321. package/template/core_v3/storage/public/system/menu/icons/pipeline.svg +1 -0
  322. package/template/core_v3/storage/public/system/menu/icons/provider.svg +1 -0
  323. package/template/core_v3/storage/public/system/menu/icons/report.svg +69 -0
  324. package/template/core_v3/storage/public/system/menu/icons/schedule.svg +1 -0
  325. package/template/core_v3/storage/public/system/menu/icons/security.svg +1 -0
  326. package/template/core_v3/storage/public/system/menu/icons/storage.svg +1 -0
  327. package/template/core_v3/storage/public/system/menu/icons/template.svg +44 -0
  328. package/template/core_v3/storage/public/system/menu/icons/theme-layout.svg +1 -0
  329. package/template/core_v3/test/__mocks__/cc-core-lib.d.ts +161 -0
  330. package/template/core_v3/test/__mocks__/cc-core-lib.js +311 -0
  331. package/template/core_v3/test/__mocks__/pdf-img-convert.js +5 -0
  332. package/template/core_v3/test/jest.setup.ts +25 -0
  333. package/template/core_v3/tsconfig.build.json +4 -0
  334. package/template/core_v3/tsconfig.json +22 -0
  335. package/template/core_v3/tsconfig.test.json +17 -0
  336. package/template/core_v3/version.json +5 -0
  337. package/template/admin/next-env.d.ts +0 -5
  338. package/template/admin/postcss.config.js +0 -6
  339. package/template/admin/public/images/component/barchart.svg +0 -20
  340. package/template/admin/public/images/component/bubble_chart.svg +0 -17
  341. package/template/admin/public/images/component/button.svg +0 -17
  342. package/template/admin/public/images/component/calendar.svg +0 -63
  343. package/template/admin/public/images/component/checkbox.svg +0 -25
  344. package/template/admin/public/images/component/color_picker.svg +0 -25
  345. package/template/admin/public/images/component/cron_tab.svg +0 -33
  346. package/template/admin/public/images/component/currency.svg +0 -34
  347. package/template/admin/public/images/component/custom_fields.svg +0 -34
  348. package/template/admin/public/images/component/data_table.svg +0 -101
  349. package/template/admin/public/images/component/date_picker.svg +0 -47
  350. package/template/admin/public/images/component/donut.svg +0 -23
  351. package/template/admin/public/images/component/edit_table.svg +0 -96
  352. package/template/admin/public/images/component/entity_field.svg +0 -36
  353. package/template/admin/public/images/component/entity_layout.svg +0 -40
  354. package/template/admin/public/images/component/entity_list.svg +0 -88
  355. package/template/admin/public/images/component/file.svg +0 -36
  356. package/template/admin/public/images/component/hidden_field.svg +0 -34
  357. package/template/admin/public/images/component/image.svg +0 -38
  358. package/template/admin/public/images/component/input.svg +0 -34
  359. package/template/admin/public/images/component/input_icon.svg +0 -13
  360. package/template/admin/public/images/component/input_number.svg +0 -34
  361. package/template/admin/public/images/component/input_translate.svg +0 -47
  362. package/template/admin/public/images/component/json.svg +0 -31
  363. package/template/admin/public/images/component/label.svg +0 -11
  364. package/template/admin/public/images/component/line_chart.svg +0 -19
  365. package/template/admin/public/images/component/matrix_table.svg +0 -34
  366. package/template/admin/public/images/component/mixed_chart.svg +0 -25
  367. package/template/admin/public/images/component/polar_chart.svg +0 -33
  368. package/template/admin/public/images/component/radio.svg +0 -24
  369. package/template/admin/public/images/component/redar_chart.svg +0 -17
  370. package/template/admin/public/images/component/scatter_chart.svg +0 -25
  371. package/template/admin/public/images/component/select.svg +0 -34
  372. package/template/admin/public/images/component/summary_box.svg +0 -31
  373. package/template/admin/public/images/component/switch.svg +0 -12
  374. package/template/admin/public/images/component/translate.svg +0 -35
  375. package/template/admin/public/images/component/tree.svg +0 -78
  376. package/template/admin/public/images/default-profile.png +0 -0
  377. package/template/admin/public/images/empty-data.png +0 -0
  378. package/template/admin/public/images/file.png +0 -0
  379. package/template/admin/public/images/forgot-step-1.png +0 -0
  380. package/template/admin/public/images/forgot-step-2.png +0 -0
  381. package/template/admin/public/images/forgot-step-3.png +0 -0
  382. package/template/admin/public/images/form.png +0 -0
  383. package/template/admin/public/images/info-panel.png +0 -0
  384. package/template/admin/public/images/panel.png +0 -0
  385. package/template/admin/public/images/stack.png +0 -0
  386. package/template/admin/public/images/type-all.png +0 -0
  387. package/template/admin/public/images/type-boolean.png +0 -0
  388. package/template/admin/public/images/type-date.png +0 -0
  389. package/template/admin/public/images/type-file.png +0 -0
  390. package/template/admin/public/images/type-image.png +0 -0
  391. package/template/admin/public/images/type-json.png +0 -0
  392. package/template/admin/public/images/type-number.png +0 -0
  393. package/template/admin/public/images/type-options.png +0 -0
  394. package/template/admin/public/images/type-password.png +0 -0
  395. package/template/admin/public/images/type-related.png +0 -0
  396. package/template/admin/public/images/type-string.png +0 -0
  397. package/template/admin/public/images/type-trash.png +0 -0
  398. package/template/admin/public/images/type-unknown.png +0 -0
  399. package/template/admin/public/images/upload.png +0 -0
  400. package/template/admin/src/pages/[...url_key].tsx +0 -9
  401. package/template/admin/src/pages/_app.tsx +0 -22
  402. package/template/admin/src/pages/activate.tsx +0 -9
  403. package/template/admin/src/pages/api/auth/activate_account/confirm.ts +0 -13
  404. package/template/admin/src/pages/api/auth/activate_account/index.ts +0 -13
  405. package/template/admin/src/pages/api/auth/activate_account/resend.ts +0 -13
  406. package/template/admin/src/pages/api/auth/activate_account/set_password.ts +0 -17
  407. package/template/admin/src/pages/api/auth/authen/confirm.ts +0 -24
  408. package/template/admin/src/pages/api/auth/authen/resend.ts +0 -13
  409. package/template/admin/src/pages/api/auth/callback/index.ts +0 -24
  410. package/template/admin/src/pages/api/auth/forgot_password/confirm.ts +0 -13
  411. package/template/admin/src/pages/api/auth/forgot_password/index.ts +0 -13
  412. package/template/admin/src/pages/api/auth/forgot_password/resend.ts +0 -13
  413. package/template/admin/src/pages/api/auth/forgot_password/reset.ts +0 -17
  414. package/template/admin/src/pages/api/auth/login.ts +0 -24
  415. package/template/admin/src/pages/api/auth/logout.ts +0 -30
  416. package/template/admin/src/pages/api/custom/[...path].ts +0 -16
  417. package/template/admin/src/pages/api/download.ts +0 -79
  418. package/template/admin/src/pages/api/entity/[entity]/[id].ts +0 -46
  419. package/template/admin/src/pages/api/entity/[entity]/delete.ts +0 -18
  420. package/template/admin/src/pages/api/entity/[entity]/find.ts +0 -17
  421. package/template/admin/src/pages/api/entity/[entity]/index.ts +0 -30
  422. package/template/admin/src/pages/api/entity/[entity]/update.ts +0 -18
  423. package/template/admin/src/pages/api/entity/approve/[entity]/[id].ts +0 -19
  424. package/template/admin/src/pages/api/entity/schema/[entity]/index.ts +0 -27
  425. package/template/admin/src/pages/api/entity/schema/[entity]/relate.ts +0 -16
  426. package/template/admin/src/pages/api/import_export/example/index.ts +0 -13
  427. package/template/admin/src/pages/api/import_export/export/index.ts +0 -13
  428. package/template/admin/src/pages/api/import_export/import/index.ts +0 -13
  429. package/template/admin/src/pages/api/import_export/progresses/index.ts +0 -13
  430. package/template/admin/src/pages/api/import_export/verify_progress/index.ts +0 -13
  431. package/template/admin/src/pages/api/language/set.ts +0 -15
  432. package/template/admin/src/pages/api/media/private.ts +0 -49
  433. package/template/admin/src/pages/api/queue/[queue]/count.ts +0 -17
  434. package/template/admin/src/pages/api/queue/[queue]/flush.ts +0 -17
  435. package/template/admin/src/pages/api/queue/[queue]/flushall.ts +0 -16
  436. package/template/admin/src/pages/api/queue/[queue]/index.ts +0 -20
  437. package/template/admin/src/pages/api/queue/index.ts +0 -13
  438. package/template/admin/src/pages/api/redis/index.ts +0 -0
  439. package/template/admin/src/pages/api/setting/[code].ts +0 -21
  440. package/template/admin/src/pages/api/system/config.ts +0 -13
  441. package/template/admin/src/pages/api/system/data_source/[code].ts +0 -17
  442. package/template/admin/src/pages/api/system/endpoint/[method].ts +0 -17
  443. package/template/admin/src/pages/api/system/queue.ts +0 -13
  444. package/template/admin/src/pages/api/system/role.ts +0 -13
  445. package/template/admin/src/pages/api/user/change_password.ts +0 -13
  446. package/template/admin/src/pages/api/user/filter/index.ts +0 -13
  447. package/template/admin/src/pages/api/user/me.ts +0 -24
  448. package/template/admin/src/pages/api/user/register.ts +0 -13
  449. package/template/admin/src/pages/callback/[channel].tsx +0 -9
  450. package/template/admin/src/pages/entity/[entity]/[layout]/[id].tsx +0 -17
  451. package/template/admin/src/pages/entity/[entity]/[layout]/index.tsx +0 -19
  452. package/template/admin/src/pages/forgot_password.tsx +0 -9
  453. package/template/admin/src/pages/index.tsx +0 -7
  454. package/template/admin/src/pages/login.tsx +0 -9
  455. package/template/admin/src/pages/profile.tsx +0 -9
  456. package/template/admin/src/pages/register.tsx +0 -9
  457. package/template/admin/src/pages/setting/entities/[key].tsx +0 -10
  458. package/template/admin/src/pages/setting/entities/index.tsx +0 -10
  459. package/template/admin/src/pages/setting/module/[module]/[layout].tsx +0 -16
  460. package/template/admin/src/pages/setting/modules.tsx +0 -10
  461. package/template/admin/src/styles/global.css +0 -101
  462. package/template/admin/src/styles/workflow.css +0 -40
  463. package/template/admin/src/utils/color.ts +0 -88
  464. package/template/admin/tailwind.config.js +0 -57
  465. package/template/admin/tsconfig.json +0 -36
  466. /package/template/admin/public/{images → static/images}/split.svg +0 -0
  467. /package/template/admin/{src/pages/api/redis/[connect]/index.ts → public/static/styles/custom.less} +0 -0
@@ -0,0 +1,737 @@
1
+ import * as _ from "lodash";
2
+
3
+ import {
4
+ Inject,
5
+ Injectable,
6
+ OnModuleInit,
7
+ } from "@nestjs/common";
8
+ import { ModuleRef } from "@nestjs/core";
9
+
10
+
11
+ import { CUSTOM_MODULES } from "src/modules/modules";
12
+
13
+ import {
14
+ ActivityLogService,
15
+ ApiKeyService,
16
+ AttachmentService,
17
+ AuditLogService,
18
+ CommentDataService,
19
+ CustomFunctionService,
20
+ CompanyService,
21
+ AddressService,
22
+ CountryService,
23
+ ProvinceService,
24
+ DistrictService,
25
+ SubdistrictService,
26
+ TimeZoneService,
27
+ CurrencyService,
28
+ DeployDestinationService,
29
+ DeployPackageService,
30
+ DeployLogService,
31
+ ExecutionLogService,
32
+ ImportExportService,
33
+ ImportExportLogService,
34
+ LanguageService,
35
+ MailSettingService,
36
+ MailLogService,
37
+ MapLocationService,
38
+ ReasonMasterService,
39
+ ReasonOptionService,
40
+ ReasonDataService,
41
+ ScheduleActionService,
42
+ ScheduleLogService,
43
+ SmsService,
44
+ SmsLogService,
45
+ TemplateService,
46
+ TranslateService,
47
+ NotificationLogService,
48
+ ShortlyUrlService,
49
+ LayoutShareWidgetService,
50
+ SearchResultDto,
51
+ UserService,
52
+ UserRoleService,
53
+ UserRolePermissonService,
54
+ UserFilterService,
55
+ VersionDataService,
56
+ WidgetService,
57
+ IBaseModuleSettingService,
58
+ NotificationSubscriptionService,
59
+ NotificationMessageService,
60
+ NotificationMessageQueueService,
61
+ PipelineService,
62
+ PipelineJobService,
63
+ PipelineLogService,
64
+ PrintLogService,
65
+ } from '@shopstack/cc-core-lib/core'
66
+
67
+ const SPECIFY_CUSTOM_MODULES =
68
+ process.env.CUSTOM_MODULES === "" || process.env.CUSTOM_MODULES === undefined
69
+ ? []
70
+ : process.env.CUSTOM_MODULES.split(",");
71
+
72
+ const RUN_CUSTOM_MODULES =
73
+ SPECIFY_CUSTOM_MODULES.length === 0
74
+ ? CUSTOM_MODULES
75
+ : CUSTOM_MODULES.filter(c =>
76
+ SPECIFY_CUSTOM_MODULES.includes(c.module.name)
77
+ );
78
+
79
+ const CUSTOM_SERVICES = _.reduce(
80
+ RUN_CUSTOM_MODULES,
81
+ (r, v) => {
82
+ const moduleName = _.snakeCase(
83
+ `${v.module.name.slice(0, 2).toLowerCase()}${v.module.name.slice(2)}`
84
+ )
85
+ .replace(/_[0-9]*_/g, (m, g1, g2, i) => {
86
+ return m.slice(1);
87
+ })
88
+ .toLowerCase()
89
+ .replace("_module", "");
90
+ for (const service of v.services || []) {
91
+ const serviceName = `${service.name
92
+ .slice(0, 2)
93
+ .toLowerCase()}${service.name.slice(2)}`;
94
+ let key = `${moduleName}_${_.snakeCase(serviceName)
95
+ .replace(/_[0-9]*_/g, (m, g1, g2, i) => {
96
+ return m.slice(1);
97
+ })
98
+ .toLowerCase()
99
+ .replace("_service", "")
100
+ .replace(`${moduleName}_`, "")}`;
101
+ if (key === "sellers_seller_user") {
102
+ key = "sellers_user";
103
+ }
104
+ r[key] = service;
105
+ }
106
+ return r;
107
+ },
108
+ {}
109
+ );
110
+
111
+ const CUSTOM_LOG_SERVICES = _.reduce(
112
+ RUN_CUSTOM_MODULES,
113
+ (r, v) => {
114
+ const moduleName = _.snakeCase(
115
+ `${v.module.name.slice(0, 2).toLowerCase()}${v.module.name.slice(2)}`
116
+ )
117
+ .toLowerCase()
118
+ .replace("_module", "");
119
+ for (const service of v.services || []) {
120
+ const serviceName = _.snakeCase(
121
+ `${service.name.slice(0, 2).toLowerCase()}${service.name.slice(2)}`
122
+ )
123
+ .toLowerCase()
124
+ .replace("_service", "")
125
+ .replace(`${moduleName}_`, "");
126
+ if (serviceName === "log") {
127
+ const key = `${moduleName}_${serviceName}`;
128
+ r[key] = service;
129
+ }
130
+ }
131
+ return r;
132
+ },
133
+ {}
134
+ );
135
+
136
+ const CUSTOM_SETTING_SERVICES = _.reduce(
137
+ RUN_CUSTOM_MODULES,
138
+ (r, v) => {
139
+ const moduleName = _.snakeCase(
140
+ `${v.module.name.slice(0, 2).toLowerCase()}${v.module.name.slice(2)}`
141
+ )
142
+ .toLowerCase()
143
+ .replace("_module", "");
144
+ for (const service of v.services || []) {
145
+ const serviceName = _.snakeCase(
146
+ `${service.name.slice(0, 2).toLowerCase()}${service.name.slice(2)}`
147
+ )
148
+ .toLowerCase()
149
+ .replace("_service", "")
150
+ .replace(`${moduleName}_`, "");
151
+ if (serviceName === "setting") {
152
+ const key = `${moduleName}_${serviceName}`;
153
+ r[key] = service;
154
+ }
155
+ }
156
+ return r;
157
+ },
158
+ {}
159
+ );
160
+
161
+ @Injectable()
162
+ export class CoreService implements OnModuleInit {
163
+ @Inject(ActivityLogService) private readonly _activityLogService: ActivityLogService;
164
+ @Inject(AddressService) private readonly _addressService: AddressService;
165
+ @Inject(ApiKeyService) private readonly _apiKeyService: ApiKeyService;
166
+ @Inject(AttachmentService) private readonly _attachmentService: AttachmentService;
167
+ @Inject(CommentDataService) private readonly _commentDataService: CommentDataService;
168
+ @Inject(CountryService) private readonly _countryService: CountryService;
169
+ @Inject(CompanyService) private readonly _companyService: CompanyService;
170
+ @Inject(CustomFunctionService) private readonly _customFunctionService: CustomFunctionService;
171
+ @Inject(DeployDestinationService) private readonly _deployDestinationService: DeployDestinationService;
172
+ @Inject(DeployLogService) private readonly _deployLogService: DeployLogService;
173
+ @Inject(DeployPackageService) private readonly _deployPackageService: DeployPackageService;
174
+ @Inject(DistrictService) private readonly _districtService: DistrictService;
175
+ @Inject(ExecutionLogService) private readonly _executionLogService: ExecutionLogService;
176
+ @Inject(ImportExportService) private readonly _importExportService: ImportExportService;
177
+ @Inject(ImportExportLogService) private readonly _importExportLogService: ImportExportLogService;
178
+ @Inject(PrintLogService) private readonly _printLogService: PrintLogService;
179
+ @Inject(LanguageService) private readonly _languageService: LanguageService;
180
+ @Inject(LayoutShareWidgetService) private readonly _layoutShareWidgetService: LayoutShareWidgetService;
181
+ @Inject(MailSettingService) private readonly _mailService: MailSettingService;
182
+ @Inject(MailLogService) private readonly _mailLogService: MailLogService;
183
+ @Inject(MapLocationService) private readonly _mapLocationService: MapLocationService;
184
+ @Inject(NotificationSubscriptionService) private readonly _notificationSubscriptionService: NotificationSubscriptionService;
185
+ @Inject(NotificationMessageService) private readonly _notificationMessageService: NotificationMessageService;
186
+ @Inject(NotificationMessageQueueService) private readonly _notificationMessageQueueService: NotificationMessageQueueService;
187
+ @Inject(NotificationLogService) private readonly _notificationLogService: NotificationLogService;
188
+ @Inject(ProvinceService) private readonly _provinceService: ProvinceService;
189
+ @Inject(ReasonDataService) private readonly _reasonDataService: ReasonDataService;
190
+ @Inject(ReasonMasterService) private readonly _reasonMasterService: ReasonMasterService;
191
+ @Inject(ReasonOptionService) private readonly _reasonOptionService: ReasonOptionService;
192
+ @Inject(ScheduleActionService) private readonly _scheduleActionService: ScheduleActionService;
193
+ @Inject(ScheduleLogService) private readonly _scheduleLogService: ScheduleLogService;
194
+ @Inject(ShortlyUrlService) private readonly _shortlyUrlService: ShortlyUrlService;
195
+ @Inject(SmsService) private readonly _smsService: SmsService;
196
+ @Inject(SmsLogService) private readonly _smsLogService: SmsLogService;
197
+ @Inject(SubdistrictService) private readonly _subdistrictService: SubdistrictService;
198
+ @Inject(TemplateService) private readonly _templateService: TemplateService;
199
+ @Inject(TimeZoneService) private readonly _timeZoneService: TimeZoneService;
200
+ @Inject(CurrencyService) private readonly _currencyService: CurrencyService;
201
+ @Inject(TranslateService) private readonly _translateService: TranslateService;
202
+ @Inject(UserFilterService) private readonly _userFilterService: UserFilterService;
203
+ @Inject(UserRoleService) private readonly _userRoleService: UserRoleService;
204
+ @Inject(UserRolePermissonService) private readonly _userRolePermissonService: UserRolePermissonService;
205
+ @Inject(UserService) private readonly _userService: UserService;
206
+ @Inject(VersionDataService) private readonly _versionDataService: VersionDataService;
207
+ @Inject(WidgetService) private readonly _widgetService: WidgetService;
208
+ @Inject(AuditLogService) private readonly _auditLogService: AuditLogService;
209
+ @Inject(PipelineService) private readonly _pipelineService: PipelineService;
210
+ @Inject(PipelineJobService) private readonly _pipelineJobService: PipelineJobService;
211
+ @Inject(PipelineLogService) private readonly _pipelineLogService: PipelineLogService;
212
+
213
+
214
+ private services: any = {};
215
+
216
+ constructor(private moduleRef: ModuleRef) { }
217
+
218
+ async onModuleInit() {
219
+ // console.log(CUSTOM_SERVICES);
220
+ for (const key of Object.keys(CUSTOM_SERVICES)) {
221
+ this.services[key] = await this.moduleRef.get(CUSTOM_SERVICES[key], {
222
+ strict: false
223
+ });
224
+ }
225
+ }
226
+
227
+ private async _getService(entityName: string): Promise<any> {
228
+ switch (entityName) {
229
+ case "activity_log":
230
+ return this._activityLogService;
231
+ case "address":
232
+ return this._addressService;
233
+ case "api_key":
234
+ return this._apiKeyService;
235
+ case "attachment":
236
+ return this._attachmentService;
237
+ case "comment_data":
238
+ return this._commentDataService;
239
+ case "country":
240
+ return this._countryService;
241
+ case "company":
242
+ return this._companyService;
243
+ case "custom_function":
244
+ return this._customFunctionService;
245
+ case "deploy_destination":
246
+ return this._deployDestinationService;
247
+ case "deploy_package":
248
+ return this._deployPackageService;
249
+ case "deploy_log":
250
+ return this._deployLogService;
251
+ case "district":
252
+ return this._districtService;
253
+ case "execution_log":
254
+ return this._executionLogService;
255
+ case "import_export":
256
+ return this._importExportService;
257
+ case "import_export_log":
258
+ return this._importExportLogService;
259
+ case "language":
260
+ return this._languageService;
261
+ case "layout_share_widget":
262
+ return this._layoutShareWidgetService;
263
+ case "mail_setting":
264
+ return this._mailService;
265
+ case "mail_log":
266
+ return this._mailLogService;
267
+ case "map_location":
268
+ return this._mapLocationService;
269
+ case "notification_subscription":
270
+ return this._notificationSubscriptionService;
271
+ case "notification_message":
272
+ return this._notificationMessageService;
273
+ case "notification_message_queue":
274
+ return this._notificationMessageQueueService;
275
+ case "notification_log":
276
+ return this._notificationLogService;
277
+ case "pipeline":
278
+ return this._pipelineService;
279
+ case "pipeline_job":
280
+ return this._pipelineJobService;
281
+ case "pipeline_log":
282
+ return this._pipelineLogService;
283
+ case "province":
284
+ return this._provinceService;
285
+ case "reason_data":
286
+ return this._reasonDataService;
287
+ case "reason_master":
288
+ return this._reasonMasterService;
289
+ case "reason_option":
290
+ return this._reasonOptionService;
291
+ case "schedule_action":
292
+ return this._scheduleActionService;
293
+ case "schedule_log":
294
+ return this._scheduleLogService;
295
+ case "shortly_url":
296
+ return this._shortlyUrlService;
297
+ case "sms":
298
+ return this._smsService;
299
+ case "sms_log":
300
+ return this._smsLogService;
301
+ case "print_log":
302
+ return this._printLogService;
303
+ case "subdistrict":
304
+ return this._subdistrictService;
305
+ case "template":
306
+ return this._templateService;
307
+ case "time_zone":
308
+ return this._timeZoneService;
309
+ case "currency":
310
+ return this._currencyService;
311
+ case "translate":
312
+ return this._translateService;
313
+ case "user":
314
+ return this._userService;
315
+ case "user_role":
316
+ return this._userRoleService;
317
+ case "user_role_permission":
318
+ return this._userRolePermissonService;
319
+ case "user_filter":
320
+ return this._userFilterService;
321
+ case "version_data":
322
+ return this._versionDataService;
323
+ case "widget":
324
+ return this._widgetService;
325
+ case "audit_log":
326
+ return this._auditLogService;
327
+
328
+ default:
329
+ const customService = this.services[entityName];
330
+ if (_.isEmpty(customService)) {
331
+ throw new Error(`Invalid entity ${entityName}.`);
332
+ }
333
+ return customService;
334
+ }
335
+ }
336
+
337
+ public async init(entityName: string): Promise<string> {
338
+ const service = await this._getService(entityName);
339
+ return service.init();
340
+ }
341
+
342
+ public async initData(entityName: string): Promise<void> {
343
+ const service = await this._getService(entityName);
344
+ await service.initData();
345
+ }
346
+
347
+ public async search(
348
+ entityName: string,
349
+ keywords: string,
350
+ filters?: any,
351
+ page: number = 1,
352
+ pageSize: number = 10,
353
+ sort: string = "",
354
+ grouping?: Array<string>,
355
+ noTranslate?: boolean,
356
+ fields?: Array<string>
357
+ ): Promise<SearchResultDto> {
358
+ const service = await this._getService(entityName);
359
+ return service.search(
360
+ keywords,
361
+ filters,
362
+ page,
363
+ pageSize,
364
+ sort,
365
+ grouping,
366
+ noTranslate,
367
+ fields
368
+ );
369
+ }
370
+
371
+ public async searchIds(
372
+ entityName: string,
373
+ keywords: string,
374
+ filters?: any,
375
+ page?: number,
376
+ pagesize?: number,
377
+ sort?: Object
378
+ ): Promise<Array<string>> {
379
+ const service = await this._getService(entityName);
380
+ return service.searchIds(keywords, filters, page, pagesize, sort);
381
+ }
382
+
383
+ public async searchWithLayout(
384
+ entityName: string,
385
+ layoutCode: string,
386
+ keywords: string,
387
+ filters?: any,
388
+ page?: number,
389
+ pageSize?: number,
390
+ sort?: any,
391
+ grouping?: Array<string>,
392
+ isDetail?: boolean
393
+ ): Promise<SearchResultDto> {
394
+ const service = await this._getService(entityName);
395
+ return service.searchWithLayout(
396
+ layoutCode,
397
+ keywords,
398
+ filters,
399
+ page,
400
+ pageSize,
401
+ sort,
402
+ grouping,
403
+ isDetail
404
+ );
405
+ }
406
+
407
+ public async find(
408
+ entityName: string,
409
+ keywords: string,
410
+ filters?: any,
411
+ sort: string = "",
412
+ noTranslate?: boolean,
413
+ fields?: Array<string>
414
+ ): Promise<any> {
415
+ const service = await this._getService(entityName);
416
+ return service.find(keywords, filters, sort, noTranslate, fields);
417
+ }
418
+
419
+ public async findWithLayout(
420
+ entityName: string,
421
+ layoutCode: string,
422
+ keywords: string,
423
+ filters?: any,
424
+ sort?: Object
425
+ ): Promise<any> {
426
+ const service = await this._getService(entityName);
427
+ return service.findWithLayout(layoutCode, keywords, filters, sort);
428
+ }
429
+
430
+ public async findOne(
431
+ entityName: string,
432
+ id: string,
433
+ fields?: Array<string>
434
+ ): Promise<any> {
435
+ const service = await this._getService(entityName);
436
+ return service.findOne(id, fields);
437
+ }
438
+
439
+ public async findOneWithLayout(
440
+ entityName: string,
441
+ layoutCode: string,
442
+ id: string
443
+ ): Promise<any> {
444
+ const service = await this._getService(entityName);
445
+ return service.findOneWithLayout(layoutCode, id);
446
+ }
447
+
448
+ public async count(
449
+ entityName: string,
450
+ filters?: any,
451
+ keywords?: string
452
+ ): Promise<number> {
453
+ const service = await this._getService(entityName);
454
+ return service.count(filters, keywords);
455
+ }
456
+
457
+ public async aggregate(entityName: string, query: string): Promise<any> {
458
+ const service = await this._getService(entityName);
459
+ return service.aggregate(query);
460
+ }
461
+
462
+ public async create(entityName: string, data: any): Promise<any> {
463
+ const service = await this._getService(entityName);
464
+ return service.create(data);
465
+ }
466
+
467
+ public async update(entityName: string, id: string, data: any): Promise<any> {
468
+ const service = await this._getService(entityName);
469
+ return service.update(id, data);
470
+ }
471
+
472
+ public async delete(entityName: string, id: string): Promise<any> {
473
+ const service = await this._getService(entityName);
474
+ return service.delete(id);
475
+ }
476
+
477
+ public async deleteMany(entityName: string, filter: any): Promise<any> {
478
+ const service = await this._getService(entityName);
479
+ return service.deleteMany(filter);
480
+ }
481
+
482
+ public async bulkCreate(entityName: string, data: any[]): Promise<any> {
483
+ const service = await this._getService(entityName);
484
+ return service.bulkCreate(data);
485
+ }
486
+
487
+ public async bulkUpdate(entityName: string, data: any[]): Promise<any> {
488
+ const service = await this._getService(entityName);
489
+ return service.bulkUpdate(data);
490
+ }
491
+
492
+ public async bulkDelete(entityName: string, ids: string[]): Promise<any> {
493
+ const service = await this._getService(entityName);
494
+ return service.bulkDelete(ids);
495
+ }
496
+
497
+ public async prepareGenerateData(
498
+ entityName: string,
499
+ data?: any
500
+ ): Promise<any> {
501
+ const service = await this._getService(entityName);
502
+ return service.prepareGenerateData(data);
503
+ }
504
+
505
+ public async generateData(entityName: string, data?: any): Promise<boolean> {
506
+ const service = await this._getService(entityName);
507
+ return service.generateData(data);
508
+ }
509
+
510
+ public async progressGenerateData(
511
+ entityName: string,
512
+ ref_id: string
513
+ ): Promise<any> {
514
+ const service = await this._getService(entityName);
515
+ return service.progressGenerateData(ref_id);
516
+ }
517
+
518
+ public async approve(
519
+ entityName: string,
520
+ id: string,
521
+ data: any
522
+ ): Promise<any> {
523
+ const service = await this._getService(entityName);
524
+ return service.approve(id, data);
525
+ }
526
+
527
+ public async workflowActions(entityName: string, id: string): Promise<any> {
528
+ const service = await this._getService(entityName);
529
+ return service.workflowActions(id);
530
+ }
531
+
532
+ public async executeWorkflowAction(
533
+ entityName: string,
534
+ id: string,
535
+ body: any
536
+ ): Promise<any> {
537
+ const service = await this._getService(entityName);
538
+ return service.executeWorkflowAction(id, body);
539
+ }
540
+
541
+ public async dataWithLocale(
542
+ entityName: string,
543
+ layout: string,
544
+ id: string,
545
+ locale: string
546
+ ): Promise<any> {
547
+ const service = await this._getService(entityName);
548
+ return service.dataWithLocale(layout, id, locale);
549
+ }
550
+
551
+ public async findWithLocale(
552
+ entityName: string,
553
+ locale: string,
554
+ keywords: string,
555
+ filters?: any,
556
+ sort?: Object
557
+ ): Promise<any> {
558
+ const service = await this._getService(entityName);
559
+ return service.findWithLocale(locale, keywords, filters, sort);
560
+ }
561
+
562
+ public async setDataLocale(
563
+ entityName: string,
564
+ id: string,
565
+ locale: string,
566
+ data: any
567
+ ): Promise<any> {
568
+ const service = await this._getService(entityName);
569
+ return service.setDataLocale(id, locale, data);
570
+ }
571
+
572
+ public async exampleOutputMapping(
573
+ entityName: string,
574
+ data: any
575
+ ): Promise<any> {
576
+ const service = await this._getService(entityName);
577
+ return service.exampleOutputMapping(data);
578
+ }
579
+
580
+ public async searchText(entityName: string, data: any): Promise<any> {
581
+ const service = await this._getService(entityName);
582
+ return service.searchText(data);
583
+ }
584
+
585
+ public async importValidate(
586
+ entityName: string,
587
+ id: string,
588
+ code: string,
589
+ data: any,
590
+ dataText: string,
591
+ originalData,
592
+ filename
593
+ ): Promise<any> {
594
+ const service = await this._getService(entityName);
595
+ return service.importValidate(
596
+ id,
597
+ code,
598
+ data,
599
+ dataText,
600
+ originalData,
601
+ filename
602
+ );
603
+ }
604
+ }
605
+
606
+ @Injectable()
607
+ export class CoreLogService implements OnModuleInit {
608
+ @Inject(ActivityLogService)
609
+ private readonly _activityLogService: ActivityLogService;
610
+ @Inject(DeployLogService)
611
+ private readonly _deployLogService: DeployLogService;
612
+ @Inject(ExecutionLogService)
613
+ private readonly _executionLogService: ExecutionLogService;
614
+ @Inject(ImportExportLogService)
615
+ private readonly _importExportLogService: ImportExportLogService;
616
+ @Inject(PrintLogService)
617
+ private readonly _printLogService: PrintLogService;
618
+ @Inject(MailLogService)
619
+ private readonly _mailLogService: MailLogService;
620
+ @Inject(NotificationLogService)
621
+ private readonly _notificationLogService: NotificationLogService;
622
+ @Inject(ScheduleLogService)
623
+ private readonly _scheduleLogService: ScheduleLogService;
624
+ @Inject(SmsLogService)
625
+ private readonly _smsLogService: SmsLogService;
626
+ @Inject(AuditLogService)
627
+ private readonly _auditLogService: AuditLogService;
628
+ @Inject(PipelineLogService)
629
+ private readonly _pipelineLogService: PipelineLogService;
630
+
631
+
632
+ private services: any = {};
633
+
634
+ constructor(private moduleRef: ModuleRef) { }
635
+
636
+ private _getService(entityName: string): any {
637
+ switch (entityName) {
638
+ case "deploy_log":
639
+ return this._deployLogService;
640
+ case "schedule_log":
641
+ return this._scheduleLogService;
642
+ case "activity_log":
643
+ return this._activityLogService;
644
+ case "import_export_log":
645
+ return this._importExportLogService;
646
+ case "mail_log":
647
+ return this._mailLogService;
648
+ case "sms_log":
649
+ return this._smsLogService;
650
+ case "print_log":
651
+ return this._printLogService;
652
+ case "execution_log":
653
+ return this._executionLogService;
654
+ case "notification_log":
655
+ return this._notificationLogService;
656
+ case "audit_log":
657
+ return this._auditLogService;
658
+ case "pipeline_log":
659
+ return this._pipelineLogService;
660
+ default:
661
+ const customService = this.services[entityName];
662
+ if (_.isEmpty(customService)) {
663
+ throw new Error(`Invalid entity ${entityName}.`);
664
+ }
665
+ return customService;
666
+ }
667
+ }
668
+
669
+ async onModuleInit() {
670
+ // console.log(CUSTOM_LOG_SERVICES);
671
+ for (const key of Object.keys(CUSTOM_LOG_SERVICES)) {
672
+ this.services[key] = await this.moduleRef.get(CUSTOM_LOG_SERVICES[key], {
673
+ strict: false
674
+ });
675
+ }
676
+ }
677
+
678
+ public async purgeLog(entityName: string, setting: any) {
679
+ const service = await this._getService(entityName);
680
+ return service.purgeLog(setting);
681
+ }
682
+ }
683
+
684
+ @Injectable()
685
+ export class CoreSettingService implements OnModuleInit {
686
+ private services: any = {};
687
+
688
+ constructor(private moduleRef: ModuleRef) { }
689
+
690
+ private _getService(entityName: string): IBaseModuleSettingService {
691
+ switch (entityName) {
692
+ default:
693
+ const customService = this.services[entityName];
694
+ if (_.isEmpty(customService)) {
695
+ throw new Error(`Invalid entity ${entityName}.`);
696
+ }
697
+ return customService;
698
+ }
699
+ }
700
+
701
+ async onModuleInit() {
702
+ // console.log(CUSTOM_SETTING_SERVICES);
703
+ for (const key of Object.keys(CUSTOM_SETTING_SERVICES)) {
704
+ this.services[key] = await this.moduleRef.get(
705
+ CUSTOM_SETTING_SERVICES[key],
706
+ {
707
+ strict: false
708
+ }
709
+ );
710
+ }
711
+ }
712
+
713
+ public async getSetting(entityName: string, key?: string): Promise<any> {
714
+ const service = await this._getService(entityName);
715
+ return service.getSetting(key);
716
+ }
717
+ public async setSetting(
718
+ entityName: string,
719
+ data: any,
720
+ key?: string
721
+ ): Promise<any> {
722
+ const service = await this._getService(entityName);
723
+ return service.setSetting(data, key);
724
+ }
725
+
726
+ public async defaultPermission(entityName: string): Promise<any> {
727
+ const service = await this._getService(entityName);
728
+ return service.defaultPermission();
729
+ }
730
+ public async setPermission(
731
+ entityName: string,
732
+ permissoin: any
733
+ ): Promise<any> {
734
+ const service = await this._getService(entityName);
735
+ return service.setPermission(permissoin);
736
+ }
737
+ }