rez_core 0.0.7 → 1.0.2-o

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 (286) hide show
  1. package/.idea/250218_nodejs_core.iml +12 -0
  2. package/.idea/codeStyles/Project.xml +59 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/dataSources.xml +12 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/prettier.xml +6 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/data/master.xlsx +0 -0
  9. package/dist/app.module.d.ts +0 -2
  10. package/dist/app.module.js +0 -31
  11. package/dist/app.module.js.map +1 -1
  12. package/dist/config/config.module.js +1 -1
  13. package/dist/config/config.module.js.map +1 -1
  14. package/dist/config/database.config.d.ts +3 -0
  15. package/dist/config/database.config.js +14 -6
  16. package/dist/config/database.config.js.map +1 -1
  17. package/dist/constant/global.constant.d.ts +6 -2
  18. package/dist/constant/global.constant.js +7 -3
  19. package/dist/constant/global.constant.js.map +1 -1
  20. package/dist/core.module.js +6 -0
  21. package/dist/core.module.js.map +1 -1
  22. package/dist/decorators/roles.decorator.js.map +1 -1
  23. package/dist/main.js +2 -1
  24. package/dist/main.js.map +1 -1
  25. package/dist/module/auth/auth.module.js +1 -1
  26. package/dist/module/auth/auth.module.js.map +1 -1
  27. package/dist/module/auth/guards/role.guard.js +3 -3
  28. package/dist/module/auth/strategies/google.strategy.d.ts +3 -1
  29. package/dist/module/auth/strategies/google.strategy.js +7 -5
  30. package/dist/module/auth/strategies/google.strategy.js.map +1 -1
  31. package/dist/module/auth/strategies/jwt.strategy.d.ts +4 -4
  32. package/dist/module/auth/strategies/jwt.strategy.js +8 -9
  33. package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
  34. package/dist/module/enterprise/enterprise.module.js +1 -1
  35. package/dist/module/enterprise/enterprise.module.js.map +1 -1
  36. package/dist/module/enterprise/service/organization.service.d.ts +9 -7
  37. package/dist/module/enterprise/service/organization.service.js +35 -14
  38. package/dist/module/enterprise/service/organization.service.js.map +1 -1
  39. package/dist/module/layout/controller/layout.controller.d.ts +11 -0
  40. package/dist/module/layout/controller/layout.controller.js +61 -0
  41. package/dist/module/layout/controller/layout.controller.js.map +1 -0
  42. package/dist/module/layout/dto/header.dto.d.ts +0 -0
  43. package/dist/module/layout/dto/header.dto.js +1 -0
  44. package/dist/module/layout/dto/header.dto.js.map +1 -0
  45. package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
  46. package/dist/module/layout/entity/header-items.entity.js +52 -0
  47. package/dist/module/layout/entity/header-items.entity.js.map +1 -0
  48. package/dist/module/layout/entity/header-section.entity.d.ts +7 -0
  49. package/dist/module/layout/entity/header-section.entity.js +40 -0
  50. package/dist/module/layout/entity/header-section.entity.js.map +1 -0
  51. package/dist/module/layout/layout.module.d.ts +2 -0
  52. package/dist/module/layout/layout.module.js +30 -0
  53. package/dist/module/layout/layout.module.js.map +1 -0
  54. package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
  55. package/dist/module/layout/repository/header-items.repository.js +36 -0
  56. package/dist/module/layout/repository/header-items.repository.js.map +1 -0
  57. package/dist/module/layout/repository/header-section.repository.d.ts +7 -0
  58. package/dist/module/layout/repository/header-section.repository.js +36 -0
  59. package/dist/module/layout/repository/header-section.repository.js.map +1 -0
  60. package/dist/module/layout/service/header-section.service.d.ts +8 -0
  61. package/dist/module/layout/service/header-section.service.js +37 -0
  62. package/dist/module/layout/service/header-section.service.js.map +1 -0
  63. package/dist/module/meta/controller/entity.controller.d.ts +1 -0
  64. package/dist/module/meta/controller/entity.controller.js +37 -1
  65. package/dist/module/meta/controller/entity.controller.js.map +1 -1
  66. package/dist/module/meta/entity/base-entity.entity.d.ts +1 -2
  67. package/dist/module/meta/entity/base-entity.entity.js +1 -2
  68. package/dist/module/meta/entity/base-entity.entity.js.map +1 -1
  69. package/dist/module/meta/entity/entity-master.entity.d.ts +1 -0
  70. package/dist/module/meta/entity/entity-master.entity.js +4 -0
  71. package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
  72. package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -1
  73. package/dist/module/meta/entity/entity-table.entity.d.ts +1 -0
  74. package/dist/module/meta/entity/entity-table.entity.js +4 -0
  75. package/dist/module/meta/entity/entity-table.entity.js.map +1 -1
  76. package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
  77. package/dist/module/meta/entity/media-data.entity.js +55 -0
  78. package/dist/module/meta/entity/media-data.entity.js.map +1 -0
  79. package/dist/module/meta/entity.module.js +15 -1
  80. package/dist/module/meta/entity.module.js.map +1 -1
  81. package/dist/module/meta/repository/entity-table-column.repository.js +2 -2
  82. package/dist/module/meta/repository/entity-table.repository.d.ts +1 -0
  83. package/dist/module/meta/repository/entity-table.repository.js +9 -0
  84. package/dist/module/meta/repository/entity-table.repository.js.map +1 -1
  85. package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
  86. package/dist/module/meta/repository/media-data.repository.js +55 -0
  87. package/dist/module/meta/repository/media-data.repository.js.map +1 -0
  88. package/dist/module/meta/service/entity-list.service.d.ts +3 -1
  89. package/dist/module/meta/service/entity-list.service.js +26 -3
  90. package/dist/module/meta/service/entity-list.service.js.map +1 -1
  91. package/dist/module/meta/service/entity-service-impl.service.d.ts +13 -5
  92. package/dist/module/meta/service/entity-service-impl.service.js +92 -15
  93. package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
  94. package/dist/module/meta/service/entity-table-column.service.d.ts +1 -0
  95. package/dist/module/meta/service/entity-table-column.service.js +4 -0
  96. package/dist/module/meta/service/entity-table-column.service.js.map +1 -1
  97. package/dist/module/meta/service/entity-table.service.d.ts +1 -0
  98. package/dist/module/meta/service/entity-table.service.js +3 -0
  99. package/dist/module/meta/service/entity-table.service.js.map +1 -1
  100. package/dist/module/meta/service/entity.service.d.ts +3 -1
  101. package/dist/module/meta/service/media-data.service.d.ts +9 -0
  102. package/dist/module/meta/service/media-data.service.js +36 -0
  103. package/dist/module/meta/service/media-data.service.js.map +1 -0
  104. package/dist/module/meta/service/preference.service.d.ts +1 -5
  105. package/dist/module/meta/service/preference.service.js +3 -11
  106. package/dist/module/meta/service/preference.service.js.map +1 -1
  107. package/dist/module/module/entity/menu.entity.d.ts +1 -2
  108. package/dist/module/module/entity/menu.entity.js +1 -2
  109. package/dist/module/module/entity/menu.entity.js.map +1 -1
  110. package/dist/module/module/entity/module.entity.d.ts +1 -2
  111. package/dist/module/module/entity/module.entity.js +1 -2
  112. package/dist/module/module/entity/module.entity.js.map +1 -1
  113. package/dist/module/module/module.module.js +2 -2
  114. package/dist/module/module/module.module.js.map +1 -1
  115. package/dist/module/module/repository/menu.repository.js +3 -3
  116. package/dist/module/module/repository/menu.repository.js.map +1 -1
  117. package/dist/module/module/repository/module-access.repository.js +31 -20
  118. package/dist/module/module/repository/module-access.repository.js.map +1 -1
  119. package/dist/module/module/service/menu.service.js +2 -2
  120. package/dist/module/module/service/menu.service.js.map +1 -1
  121. package/dist/module/module/service/module-access.service.js.map +1 -1
  122. package/dist/module/notification/controller/otp.controller.d.ts +17 -0
  123. package/dist/module/notification/controller/otp.controller.js +67 -0
  124. package/dist/module/notification/controller/otp.controller.js.map +1 -0
  125. package/dist/module/notification/entity/otp.entity.d.ts +10 -0
  126. package/dist/module/notification/entity/otp.entity.js +52 -0
  127. package/dist/module/notification/entity/otp.entity.js.map +1 -0
  128. package/dist/module/notification/notification.module.d.ts +2 -0
  129. package/dist/module/notification/notification.module.js +27 -0
  130. package/dist/module/notification/notification.module.js.map +1 -0
  131. package/dist/module/notification/repository/otp.repository.d.ts +9 -0
  132. package/dist/module/notification/repository/otp.repository.js +44 -0
  133. package/dist/module/notification/repository/otp.repository.js.map +1 -0
  134. package/dist/module/notification/service/otp.service.d.ts +16 -0
  135. package/dist/module/notification/service/otp.service.js +66 -0
  136. package/dist/module/notification/service/otp.service.js.map +1 -0
  137. package/dist/module/user/controller/login.controller.d.ts +1 -3
  138. package/dist/module/user/controller/login.controller.js +0 -1
  139. package/dist/module/user/controller/login.controller.js.map +1 -1
  140. package/dist/module/user/dto/create-user.dto.js.map +1 -1
  141. package/dist/module/user/entity/role.entity.js.map +1 -1
  142. package/dist/module/user/repository/user-role-mapping.repository.js +4 -1
  143. package/dist/module/user/repository/user-role-mapping.repository.js.map +1 -1
  144. package/dist/module/user/repository/user.repository.js.map +1 -1
  145. package/dist/module/user/service/login.service.d.ts +12 -4
  146. package/dist/module/user/service/login.service.js +24 -9
  147. package/dist/module/user/service/login.service.js.map +1 -1
  148. package/dist/module/user/service/role.service.d.ts +1 -5
  149. package/dist/module/user/service/role.service.js +3 -10
  150. package/dist/module/user/service/role.service.js.map +1 -1
  151. package/dist/module/user/service/user-session.service.d.ts +1 -3
  152. package/dist/module/user/service/user-session.service.js +1 -1
  153. package/dist/module/user/service/user-session.service.js.map +1 -1
  154. package/dist/module/user/service/user.service.d.ts +7 -8
  155. package/dist/module/user/service/user.service.js +13 -17
  156. package/dist/module/user/service/user.service.js.map +1 -1
  157. package/dist/module/user/user.module.js +1 -0
  158. package/dist/module/user/user.module.js.map +1 -1
  159. package/dist/resources/dev.properties.yaml +15 -0
  160. package/dist/resources/properties.module.d.ts +2 -0
  161. package/dist/resources/properties.module.js +25 -0
  162. package/dist/resources/properties.module.js.map +1 -0
  163. package/dist/resources/properties.yaml.d.ts +2 -0
  164. package/dist/resources/properties.yaml.js +10 -0
  165. package/dist/resources/properties.yaml.js.map +1 -0
  166. package/dist/resources/uat.properties.yaml +15 -0
  167. package/dist/tsconfig.build.tsbuildinfo +1 -1
  168. package/dist/utils/dto/excel-data.dto.d.ts +7 -0
  169. package/dist/utils/dto/excel-data.dto.js +16 -0
  170. package/dist/utils/dto/excel-data.dto.js.map +1 -0
  171. package/dist/utils/dto/excelsheet-data.dto.d.ts +5 -0
  172. package/dist/utils/dto/excelsheet-data.dto.js +3 -0
  173. package/dist/utils/dto/excelsheet-data.dto.js.map +1 -0
  174. package/dist/utils/service/excel-helper.service.d.ts +3 -1
  175. package/dist/utils/service/excel-helper.service.js +12 -3
  176. package/dist/utils/service/excel-helper.service.js.map +1 -1
  177. package/dist/utils/service/loggingUtil.service.js +6 -6
  178. package/dist/utils/service/loggingUtil.service.js.map +1 -1
  179. package/dist/utils/utils.module.js.map +1 -1
  180. package/nest-cli.json +6 -0
  181. package/package.json +1 -1
  182. package/src/app.module.ts +0 -0
  183. package/src/config/config.module.ts +1 -1
  184. package/src/config/database.config.ts +10 -5
  185. package/src/constant/global.constant.ts +13 -4
  186. package/src/core.module.ts +6 -0
  187. package/src/decorators/roles.decorator.ts +5 -2
  188. package/src/module/auth/auth.module.ts +3 -2
  189. package/src/module/auth/guards/google-auth.guard.ts +1 -1
  190. package/src/module/auth/guards/jwt.guard.ts +22 -22
  191. package/src/module/auth/guards/role.guard.ts +68 -68
  192. package/src/module/auth/services/auth.service.ts +29 -29
  193. package/src/module/auth/services/jwt.service.ts +11 -11
  194. package/src/module/auth/strategies/google.strategy.ts +7 -4
  195. package/src/module/auth/strategies/jwt.strategy.ts +5 -6
  196. package/src/module/auth/strategies/local.strategy.ts +13 -13
  197. package/src/module/dev/dev.module.ts +12 -12
  198. package/src/module/dev/service/dev.service.ts +7 -7
  199. package/src/module/enterprise/enterprise.module.ts +2 -3
  200. package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
  201. package/src/module/enterprise/entity/organization.entity.ts +80 -80
  202. package/src/module/enterprise/service/organization.service.ts +48 -13
  203. package/src/module/layout/controller/layout.controller.ts +32 -0
  204. package/src/module/layout/dto/header.dto.ts +0 -0
  205. package/src/module/layout/entity/header-items.entity.ts +28 -0
  206. package/src/module/layout/entity/header-section.entity.ts +19 -0
  207. package/src/module/layout/layout.module.ts +17 -0
  208. package/src/module/layout/repository/header-items.repository.ts +18 -0
  209. package/src/module/layout/repository/header-section.repository.ts +18 -0
  210. package/src/module/layout/service/header-section.service.ts +26 -0
  211. package/src/module/master/controller/master.controller.ts +22 -22
  212. package/src/module/meta/controller/entity.controller.ts +56 -3
  213. package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
  214. package/src/module/meta/entity/attribute-master.entity.ts +67 -67
  215. package/src/module/meta/entity/base-entity.entity.ts +2 -3
  216. package/src/module/meta/entity/entity-master.entity.ts +3 -0
  217. package/src/module/meta/entity/entity-table-column.entity.ts +1 -1
  218. package/src/module/meta/entity/entity-table.entity.ts +4 -2
  219. package/src/module/meta/entity/media-data.entity.ts +32 -0
  220. package/src/module/meta/entity/preference.entity.ts +65 -65
  221. package/src/module/meta/entity.module.ts +15 -1
  222. package/src/module/meta/repository/attribute-master.repository.ts +28 -28
  223. package/src/module/meta/repository/entity-table-column.repository.ts +3 -3
  224. package/src/module/meta/repository/entity-table.repository.ts +14 -0
  225. package/src/module/meta/repository/media-data.repository.ts +50 -0
  226. package/src/module/meta/repository/preference.repository.ts +20 -20
  227. package/src/module/meta/service/entity-list.service.ts +36 -7
  228. package/src/module/meta/service/entity-service-impl.service.ts +138 -20
  229. package/src/module/meta/service/entity-table-column.service.ts +14 -1
  230. package/src/module/meta/service/entity-table.service.ts +8 -1
  231. package/src/module/meta/service/entity.service.ts +13 -1
  232. package/src/module/meta/service/media-data.service.ts +44 -0
  233. package/src/module/meta/service/preference.service.ts +2 -17
  234. package/src/module/module/controller/menu.controller.ts +15 -15
  235. package/src/module/module/controller/module-access.controller.ts +1 -1
  236. package/src/module/module/entity/menu.entity.ts +10 -11
  237. package/src/module/module/entity/module-access.entity.ts +22 -22
  238. package/src/module/module/entity/module-action.entity.ts +19 -19
  239. package/src/module/module/entity/module.entity.ts +9 -10
  240. package/src/module/module/module.module.ts +2 -4
  241. package/src/module/module/repository/menu.repository.ts +7 -10
  242. package/src/module/module/repository/module-access.repository.ts +57 -42
  243. package/src/module/module/service/menu.service.ts +9 -10
  244. package/src/module/module/service/module-access.service.ts +8 -3
  245. package/src/module/notification/controller/otp.controller.ts +41 -0
  246. package/src/module/notification/entity/otp.entity.ts +28 -0
  247. package/src/module/notification/notification.module.ts +14 -0
  248. package/src/module/notification/repository/otp.repository.ts +27 -0
  249. package/src/module/notification/service/otp.service.ts +56 -0
  250. package/src/module/user/controller/login.controller.ts +2 -1
  251. package/src/module/user/controller/user.controller.ts +28 -28
  252. package/src/module/user/dto/create-user.dto.ts +43 -43
  253. package/src/module/user/dto/update-user.dto.ts +4 -4
  254. package/src/module/user/entity/role.entity.ts +1 -1
  255. package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
  256. package/src/module/user/entity/user-session.entity.ts +61 -61
  257. package/src/module/user/entity/user.entity.ts +35 -35
  258. package/src/module/user/repository/role.repository.ts +16 -16
  259. package/src/module/user/repository/user-role-mapping.repository.ts +9 -3
  260. package/src/module/user/repository/user.repository.ts +2 -2
  261. package/src/module/user/repository/userSession.repository.ts +33 -33
  262. package/src/module/user/service/login.service.ts +25 -8
  263. package/src/module/user/service/role.service.ts +2 -13
  264. package/src/module/user/service/user-role-mapping.service.ts +1 -1
  265. package/src/module/user/service/user-session.service.ts +2 -2
  266. package/src/module/user/service/user.service.ts +16 -27
  267. package/src/module/user/user.module.ts +1 -1
  268. package/src/resources/dev.properties.yaml +15 -0
  269. package/src/resources/properties.module.ts +12 -0
  270. package/src/resources/properties.yaml.ts +11 -0
  271. package/src/resources/uat.properties.yaml +15 -0
  272. package/src/utils/dto/excel-data.dto.ts +14 -0
  273. package/src/utils/dto/excelsheet-data.dto.ts +5 -0
  274. package/src/utils/service/clockIDGenUtil.service.ts +1 -1
  275. package/src/utils/service/dateUtil.service.ts +1 -1
  276. package/src/utils/service/encryptUtil.service.ts +97 -97
  277. package/src/utils/service/excel-helper.service.ts +14 -1
  278. package/src/utils/service/excelUtil.service.ts +15 -15
  279. package/src/utils/service/loggingUtil.service.ts +48 -48
  280. package/src/utils/service/reflection-helper.service.ts +53 -53
  281. package/src/utils/utils.module.ts +7 -7
  282. package/.env +0 -6
  283. package/dist/constant/status.constant.d.ts +0 -4
  284. package/dist/constant/status.constant.js +0 -9
  285. package/dist/constant/status.constant.js.map +0 -1
  286. package/src/constant/status.constant.ts +0 -3
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,59 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <HTMLCodeStyleSettings>
4
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
+ </HTMLCodeStyleSettings>
6
+ <JSCodeStyleSettings version="0">
7
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
+ <option name="USE_DOUBLE_QUOTES" value="false" />
10
+ <option name="FORCE_QUOTE_STYlE" value="true" />
11
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
12
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
+ </JSCodeStyleSettings>
15
+ <TypeScriptCodeStyleSettings version="0">
16
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
+ <option name="USE_DOUBLE_QUOTES" value="false" />
19
+ <option name="FORCE_QUOTE_STYlE" value="true" />
20
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
21
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
+ </TypeScriptCodeStyleSettings>
24
+ <VueCodeStyleSettings>
25
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
+ </VueCodeStyleSettings>
28
+ <codeStyleSettings language="HTML">
29
+ <option name="SOFT_MARGINS" value="80" />
30
+ <indentOptions>
31
+ <option name="INDENT_SIZE" value="2" />
32
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
+ <option name="TAB_SIZE" value="2" />
34
+ </indentOptions>
35
+ </codeStyleSettings>
36
+ <codeStyleSettings language="JavaScript">
37
+ <option name="SOFT_MARGINS" value="80" />
38
+ <indentOptions>
39
+ <option name="INDENT_SIZE" value="2" />
40
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
+ <option name="TAB_SIZE" value="2" />
42
+ </indentOptions>
43
+ </codeStyleSettings>
44
+ <codeStyleSettings language="TypeScript">
45
+ <option name="SOFT_MARGINS" value="80" />
46
+ <indentOptions>
47
+ <option name="INDENT_SIZE" value="2" />
48
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
+ <option name="TAB_SIZE" value="2" />
50
+ </indentOptions>
51
+ </codeStyleSettings>
52
+ <codeStyleSettings language="Vue">
53
+ <option name="SOFT_MARGINS" value="80" />
54
+ <indentOptions>
55
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
+ </indentOptions>
57
+ </codeStyleSettings>
58
+ </code_scheme>
59
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
4
+ <data-source source="LOCAL" name="@localhost" uuid="9a102608-c415-4802-970e-769555981800">
5
+ <driver-ref>mysql.8</driver-ref>
6
+ <synchronize>true</synchronize>
7
+ <jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
8
+ <jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
9
+ <working-dir>$ProjectFileDir$</working-dir>
10
+ </data-source>
11
+ </component>
12
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="AUTOMATIC" />
5
+ </component>
6
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/data/master.xlsx CHANGED
Binary file
@@ -1,2 +0,0 @@
1
- export declare class AppModule {
2
- }
@@ -1,32 +1 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AppModule = void 0;
10
- const common_1 = require("@nestjs/common");
11
- const config_module_1 = require("./config/config.module");
12
- const enterprise_module_1 = require("./module/enterprise/enterprise.module");
13
- const utils_module_1 = require("./utils/utils.module");
14
- const user_module_1 = require("./module/user/user.module");
15
- const entity_module_1 = require("./module/meta/entity.module");
16
- const module_module_1 = require("./module/module/module.module");
17
- let AppModule = class AppModule {
18
- };
19
- exports.AppModule = AppModule;
20
- exports.AppModule = AppModule = __decorate([
21
- (0, common_1.Module)({
22
- imports: [
23
- entity_module_1.EntityModule,
24
- config_module_1.DatabaseModule,
25
- enterprise_module_1.EnterpriseModule,
26
- utils_module_1.UtilsModule,
27
- user_module_1.UserModule,
28
- module_module_1.ModuleModule,
29
- ],
30
- })
31
- ], AppModule);
32
1
  //# sourceMappingURL=app.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0DAAwD;AACxD,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAYtD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAVrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,8BAAc;YACd,oCAAgB;YAChB,0BAAW;YACX,wBAAU;YACV,4BAAY;SACb;KACF,CAAC;GACW,SAAS,CAAG"}
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":""}
@@ -21,7 +21,7 @@ exports.DatabaseModule = DatabaseModule = __decorate([
21
21
  typeorm_1.TypeOrmModule.forRootAsync({
22
22
  useClass: database_config_1.MySqlConfiguration,
23
23
  }),
24
- config_1.ConfigModule.forRoot({ isGlobal: true })
24
+ config_1.ConfigModule.forRoot({ isGlobal: true }),
25
25
  ],
26
26
  exports: [typeorm_1.TypeOrmModule],
27
27
  })
@@ -1 +1 @@
1
- {"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,6CAAgD;AAEhD,2CAA4C;AAC5C,uDAAuD;AAahD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAX1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,YAAY,CAAC;gBACzB,QAAQ,EAAE,oCAAkB;aAC7B,CAAC;YACF,qBAAY,CAAC,OAAO,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;SACvC;QAED,OAAO,EAAE,CAAC,uBAAa,CAAC;KACzB,CAAC;GACW,cAAc,CAAG"}
1
+ {"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,6CAAgD;AAEhD,2CAA4C;AAC5C,uDAAuD;AAahD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAX1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,YAAY,CAAC;gBACzB,QAAQ,EAAE,oCAAkB;aAC7B,CAAC;YACF,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACzC;QAED,OAAO,EAAE,CAAC,uBAAa,CAAC;KACzB,CAAC;GACW,cAAc,CAAG"}
@@ -1,4 +1,7 @@
1
+ import { ConfigService } from '@nestjs/config';
1
2
  import { TypeOrmModuleOptions, TypeOrmOptionsFactory } from '@nestjs/typeorm';
2
3
  export declare class MySqlConfiguration implements TypeOrmOptionsFactory {
4
+ private configService;
5
+ constructor(configService: ConfigService);
3
6
  createTypeOrmOptions(): TypeOrmModuleOptions;
4
7
  }
@@ -5,18 +5,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.MySqlConfiguration = void 0;
10
13
  const common_1 = require("@nestjs/common");
14
+ const config_1 = require("@nestjs/config");
11
15
  let MySqlConfiguration = class MySqlConfiguration {
16
+ constructor(configService) {
17
+ this.configService = configService;
18
+ }
12
19
  createTypeOrmOptions() {
13
20
  return {
14
21
  type: 'mysql',
15
- host: process.env.DB_HOST || '13.234.25.234',
16
- port: parseInt(process.env.DB_PORT || '3306', 10),
17
- username: process.env.DB_USER || 'root',
18
- password: process.env.DB_PASS || 'Rezolut@123',
19
- database: process.env.DB_NAME || 'core',
22
+ host: this.configService.get('DB_HOST') || '13.234.25.234',
23
+ port: parseInt(this.configService.get('DB_PORT') || '3306', 10),
24
+ username: this.configService.get('DB_USER') || 'root',
25
+ password: this.configService.get('DB_PASS') || 'Rezolut@123',
26
+ database: this.configService.get('DB_NAME') || 'core',
20
27
  entities: [__dirname + '/../module/**/*.entity.{ts,js}'],
21
28
  synchronize: true,
22
29
  autoLoadEntities: true,
@@ -25,6 +32,7 @@ let MySqlConfiguration = class MySqlConfiguration {
25
32
  };
26
33
  exports.MySqlConfiguration = MySqlConfiguration;
27
34
  exports.MySqlConfiguration = MySqlConfiguration = __decorate([
28
- (0, common_1.Injectable)()
35
+ (0, common_1.Injectable)(),
36
+ __metadata("design:paramtypes", [config_1.ConfigService])
29
37
  ], MySqlConfiguration);
30
38
  //# sourceMappingURL=database.config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"database.config.js","sourceRoot":"","sources":["../../src/config/database.config.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAIrC,IAAM,kBAAkB,GAAxB,M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Aa;YAC5D,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM;YACrD,QAAQ,EAAE,CAAC,SAAS,GAAG,gCAAgC,CAAC;YACxD,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,IAAI;SACvB,CAAC;IACJ,CAAC;CACF,CAAA;AAnBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAIc,sBAAa;GAH3B,kBAAkB,CAmB9B"}
@@ -4,6 +4,10 @@ export declare const ENTITYTYPE_ROLE = "ROL";
4
4
  export declare const ENTITYTYPE_ENTITYTABLE = "ETB";
5
5
  export declare const ENTITYTYPE_ENTITYTABLECOLUMN = "ETC";
6
6
  export declare const ENTITYTYPE_PREFERENCEMASTER = "PRM";
7
- export declare const masterKey: string;
8
- export declare const masterIv: string;
7
+ export declare const ENTITYTYPE_VIEWMASTER = "VMS";
8
+ export declare const ENTITYTYPE_MEDIA = "MDA";
9
+ export declare const STORAGETYPE_SINGLEJSON = "singlejson";
10
+ export declare const STORAGETYPE_COLUMN = "column";
9
11
  export declare const secretKey: string;
12
+ export declare const STATUS_ACTIVE = "ACTIVE";
13
+ export declare const STATUS_INACTIVE = "INACTIVE";
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.secretKey = exports.masterIv = exports.masterKey = exports.ENTITYTYPE_PREFERENCEMASTER = exports.ENTITYTYPE_ENTITYTABLECOLUMN = exports.ENTITYTYPE_ENTITYTABLE = exports.ENTITYTYPE_ROLE = exports.ENTITYTYPE_ENTITYMASTER = exports.ENTITYTYPE_USER = void 0;
3
+ exports.STATUS_INACTIVE = exports.STATUS_ACTIVE = exports.secretKey = exports.STORAGETYPE_COLUMN = exports.STORAGETYPE_SINGLEJSON = exports.ENTITYTYPE_MEDIA = exports.ENTITYTYPE_VIEWMASTER = exports.ENTITYTYPE_PREFERENCEMASTER = exports.ENTITYTYPE_ENTITYTABLECOLUMN = exports.ENTITYTYPE_ENTITYTABLE = exports.ENTITYTYPE_ROLE = exports.ENTITYTYPE_ENTITYMASTER = exports.ENTITYTYPE_USER = void 0;
4
4
  exports.ENTITYTYPE_USER = 'USR';
5
5
  exports.ENTITYTYPE_ENTITYMASTER = 'EMS';
6
6
  exports.ENTITYTYPE_ROLE = 'ROL';
7
7
  exports.ENTITYTYPE_ENTITYTABLE = 'ETB';
8
8
  exports.ENTITYTYPE_ENTITYTABLECOLUMN = 'ETC';
9
9
  exports.ENTITYTYPE_PREFERENCEMASTER = 'PRM';
10
- exports.masterKey = process.env.master_key || '';
11
- exports.masterIv = process.env.master_iv || '';
10
+ exports.ENTITYTYPE_VIEWMASTER = 'VMS';
11
+ exports.ENTITYTYPE_MEDIA = 'MDA';
12
+ exports.STORAGETYPE_SINGLEJSON = 'singlejson';
13
+ exports.STORAGETYPE_COLUMN = 'column';
12
14
  exports.secretKey = process.env.secret_key || '';
15
+ exports.STATUS_ACTIVE = 'ACTIVE';
16
+ exports.STATUS_INACTIVE = 'INACTIVE';
13
17
  //# sourceMappingURL=global.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,CAAA;AACnC,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;AACjD,QAAA,QAAQ,GAAW,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;AAC/C,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,CAAC;AACpC,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,gBAAgB,GAAG,KAAK,CAAC;AAEzB,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAG9B,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;AAGjD,QAAA,aAAa,GAAG,QAAQ,CAAC;AACzB,QAAA,eAAe,GAAG,UAAU,CAAC"}
@@ -15,6 +15,8 @@ const utils_module_1 = require("./utils/utils.module");
15
15
  const user_module_1 = require("./module/user/user.module");
16
16
  const entity_module_1 = require("./module/meta/entity.module");
17
17
  const module_module_1 = require("./module/module/module.module");
18
+ const notification_module_1 = require("./module/notification/notification.module");
19
+ const layout_module_1 = require("./module/layout/layout.module");
18
20
  let CoreModule = CoreModule_1 = class CoreModule {
19
21
  static forRootAsync(dbModule) {
20
22
  if (!dbModule) {
@@ -30,6 +32,8 @@ let CoreModule = CoreModule_1 = class CoreModule {
30
32
  utils_module_1.UtilsModule,
31
33
  user_module_1.UserModule,
32
34
  module_module_1.ModuleModule,
35
+ notification_module_1.NotificationModule,
36
+ layout_module_1.LayoutModule,
33
37
  ],
34
38
  exports: [
35
39
  config_1.ConfigModule,
@@ -39,6 +43,8 @@ let CoreModule = CoreModule_1 = class CoreModule {
39
43
  utils_module_1.UtilsModule,
40
44
  user_module_1.UserModule,
41
45
  module_module_1.ModuleModule,
46
+ notification_module_1.NotificationModule,
47
+ layout_module_1.LayoutModule,
42
48
  ],
43
49
  };
44
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,2CAA8C;AAC9C,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAItD,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,YAAY,CAAC,QAAuB;QACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE;gBACP,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gBACxC,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;aACb;YACD,OAAO,EAAE;gBACP,qBAAY;gBACZ,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CAEF,CAAA;AA7BY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CA6BtB"}
1
+ {"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,2CAA8C;AAC9C,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAC7D,mFAA+E;AAC/E,iEAA6D;AAItD,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,YAAY,CAAC,QAAuB;QACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE;gBACP,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gBACxC,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;gBACZ,wCAAkB;gBAClB,4BAAY;aACb;YACD,OAAO,EAAE;gBACP,qBAAY;gBACZ,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;gBACZ,wCAAkB;gBAClB,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CAEF,CAAA;AAjCY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAiCtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"roles.decorator.js","sourceRoot":"","sources":["../../src/decorators/roles.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA4D;AAErD,MAAM,KAAK,GAAG,CAAC,UAAkB,EAAE,OAAe,EAAE,EAAE,CACzD,IAAA,wBAAe,EAAC,IAAA,oBAAW,EAAC,YAAY,EAAE,UAAU,CAAC,EAAE,IAAA,oBAAW,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAD/E,QAAA,KAAK,SAC0E"}
1
+ {"version":3,"file":"roles.decorator.js","sourceRoot":"","sources":["../../src/decorators/roles.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAEvD,MAAM,KAAK,GAAG,CAAC,UAAkB,EAAE,OAAe,EAAE,EAAE,CAC3D,IAAA,wBAAe,EACb,IAAA,oBAAW,EAAC,YAAY,EAAE,UAAU,CAAC,EACrC,IAAA,oBAAW,EAAC,SAAS,EAAE,OAAO,CAAC,CAChC,CAAC;AAJS,QAAA,KAAK,SAId"}
package/dist/main.js CHANGED
@@ -23,6 +23,7 @@ async function bootstrap() {
23
23
  exceptionFactory: (errors) => {
24
24
  const firstError = errors[0];
25
25
  return new common_1.BadRequestException({
26
+ success: false,
26
27
  field: firstError.property,
27
28
  message: firstError.constraints
28
29
  ? Object.values(firstError.constraints)[0]
@@ -30,7 +31,7 @@ async function bootstrap() {
30
31
  });
31
32
  },
32
33
  }));
33
- await app.listen(process.env.PORT ?? 3000);
34
+ await app.listen(3000);
34
35
  }
35
36
  bootstrap();
36
37
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAqE;AACrE,+CAA2C;AAC3C,6CAAgD;AAChD,mCAAgC;AAGhC,IAAA,eAAM,GAAE,CAAC;AAET,KAAK,UAAU,SAAS;IAEtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAClC,wBAAU,CAAC,YAAY,CACrB,uBAAa,CAAC,YAAY,CAAC;QACzB,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;YACjB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,WAAW;YACxC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI;YACzC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,gBAAgB,EAAE,IAAI;YACtB,WAAW,EAAE,IAAI;SAClB,CAAC;KACH,CAAC,CACH,CACF,CAAC;IAEF,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,gBAAgB,EAAE,CAAC,MAAM,E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H,CACF,CAAC;IAEF,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,OAAO,IAAI,4BAAmB,CAAC;gBAC7B,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,UAAU,CAAC,QAAQ;gBAC1B,OAAO,EAAE,UAAU,CAAC,WAAW;oBAC7B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;oBAC1C,CAAC,CAAC,eAAe;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CACH,CAAC;IAEF,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,EAAE,CAAC"}
@@ -30,7 +30,7 @@ exports.AuthModule = AuthModule = __decorate([
30
30
  imports: [config_1.ConfigModule],
31
31
  inject: [config_1.ConfigService],
32
32
  useFactory: async (configService) => ({
33
- secret: configService.get('secret_key', 'defaultSecret'),
33
+ secret: configService.get('SECRET_KEY'),
34
34
  signOptions: { expiresIn: '1800s' },
35
35
  }),
36
36
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;AAClD,+CAAkD;AAClD,4EAAiE;AACjE,kEAA8D;AAC9D,oDAAiD;AAyB1C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAvBtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY;YACZ,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACnD,eAAS,CAAC,aAAa,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACnD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAS,YAAY,EAAE,eAAe,CAAC;oBAChE,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;iBACpC,CAAC;aACH,CAAC;YACF,uBAAa,CAAC,UAAU,CAAC,CAAC,iCAAW,CAAC,CAAC;SACxC;QACD,SAAS,EAAE;YACT,4BAAc;YACd,0BAAW;YACX,wBAAY;YACZ,gCAAc;YACd,uBAAU;SACX;QACD,OAAO,EAAE,CAAC,4BAAc,EAAE,wBAAY,EAAE,uBAAU,CAAC;KACpD,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;AAElD,+CAAkD;AAClD,4EAAiE;AACjE,kEAA8D;AAC9D,oDAAiD;AAyB1C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAvBtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY;YACZ,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACnD,eAAS,CAAC,aAAa,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACnD,MAAM,EAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;oBACxC,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;iBACpC,CAAC;aACH,CAAC;YACF,uBAAa,CAAC,UAAU,CAAC,CAAC,iCAAW,CAAC,CAAC;SACxC;QACD,SAAS,EAAE;YACT,4BAAc;YACd,0BAAW;YACX,wBAAY;YACZ,gCAAc;YACd,uBAAU;SACX;QACD,OAAO,EAAE,CAAC,4BAAc,EAAE,wBAAY,EAAE,uBAAU,CAAC;KACpD,CAAC;GACW,UAAU,CAAG"}
@@ -34,9 +34,9 @@ let RolesGuard = class RolesGuard {
34
34
  }
35
35
  const requiredModule = this.reflector.get('moduleCode', context.getHandler());
36
36
  const requiredActions = this.reflector.get('actions', context.getHandler());
37
- const roleAccess = await this.entityManager.query(`SELECT *
38
- FROM cr_module_access
39
- WHERE role_id = ${user['role_id']}
37
+ const roleAccess = await this.entityManager.query(`SELECT *
38
+ FROM cr_module_access
39
+ WHERE role_id = ${user['role_id']}
40
40
  AND module_code = '${requiredModule}'`);
41
41
  if (!roleAccess || roleAccess.length === 0) {
42
42
  throw new common_1.ForbiddenException('Access denied: No permissions found for this module');
@@ -1,7 +1,9 @@
1
+ import { ConfigService } from '@nestjs/config';
1
2
  import { VerifyCallback } from 'passport-google-oauth20';
2
3
  declare const GoogleStrategy_base: new (...args: any) => any;
3
4
  export declare class GoogleStrategy extends GoogleStrategy_base {
4
- constructor();
5
+ private configService;
6
+ constructor(configService: ConfigService);
5
7
  validate(accessToken: string, refreshToken: string, profile: any, done: VerifyCallback): Promise<any>;
6
8
  }
7
9
  export {};
@@ -11,16 +11,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GoogleStrategy = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
+ const config_1 = require("@nestjs/config");
14
15
  const passport_1 = require("@nestjs/passport");
15
16
  const passport_google_oauth20_1 = require("passport-google-oauth20");
16
17
  let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrategy)(passport_google_oauth20_1.Strategy, 'google') {
17
- constructor() {
18
+ constructor(configService) {
18
19
  super({
19
- clientID: process.env.clientID,
20
- clientSecret: process.env.clientSecret,
21
- callbackURL: process.env.callbackURL,
20
+ clientID: configService.get('CLIENT_ID'),
21
+ clientSecret: configService.get('CLIENT_SECRET'),
22
+ callbackURL: configService.get('CALLBACK_URL'),
22
23
  scope: ['email', 'profile'],
23
24
  });
25
+ this.configService = configService;
24
26
  }
25
27
  async validate(accessToken, refreshToken, profile, done) {
26
28
  const { emails, name } = profile;
@@ -31,6 +33,6 @@ let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrateg
31
33
  exports.GoogleStrategy = GoogleStrategy;
32
34
  exports.GoogleStrategy = GoogleStrategy = __decorate([
33
35
  (0, common_1.Injectable)(),
34
- __metadata("design:paramtypes", [])
36
+ __metadata("design:paramtypes", [config_1.ConfigService])
35
37
  ], GoogleStrategy);
36
38
  //# sourceMappingURL=google.strategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"google.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/google.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,qEAAmE;AAG5D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,IAAA,2BAAgB,EAAC,kCAAQ,EAAE,QAAQ,CAAC;IACtE;QACE,KAAK,CAAC;YACJ,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;YAC9B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;YACtC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;YACpC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,WAAmB,EACnB,YAAoB,EACpB,OAAY,EACZ,IAAoB;QAGpB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE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yB1B"}
@@ -1,11 +1,11 @@
1
- import { ConfigService } from '@nestjs/config';
2
- import { UserSession } from '../../../module/user/entity/user-session.entity';
1
+ import { UserSession } from 'src/module/user/entity/user-session.entity';
3
2
  import { Repository } from 'typeorm';
3
+ import { ConfigService } from '@nestjs/config';
4
4
  declare const JwtStrategy_base: new (...args: any) => any;
5
5
  export declare class JwtStrategy extends JwtStrategy_base {
6
- private readonly configService;
7
6
  private userSessionRepository;
8
- constructor(configService: ConfigService, userSessionRepository: Repository<UserSession>);
7
+ private configService;
8
+ constructor(userSessionRepository: Repository<UserSession>, configService: ConfigService);
9
9
  validate(payload: any): Promise<{
10
10
  userId: any;
11
11
  sessionToken: any;
@@ -17,19 +17,18 @@ const passport_jwt_1 = require("passport-jwt");
17
17
  const passport_1 = require("@nestjs/passport");
18
18
  const common_1 = require("@nestjs/common");
19
19
  const typeorm_1 = require("@nestjs/typeorm");
20
- const config_1 = require("@nestjs/config");
21
- const user_session_entity_1 = require("../../../module/user/entity/user-session.entity");
20
+ const user_session_entity_1 = require("../../user/entity/user-session.entity");
22
21
  const typeorm_2 = require("typeorm");
22
+ const config_1 = require("@nestjs/config");
23
23
  let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) {
24
- constructor(configService, userSessionRepository) {
24
+ constructor(userSessionRepository, configService) {
25
25
  super({
26
26
  jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
27
27
  ignoreExpiration: false,
28
- secretOrKey: configService.get('secret_key'),
28
+ secretOrKey: configService.get('SECRET_KEY'),
29
29
  });
30
- this.configService = configService;
31
30
  this.userSessionRepository = userSessionRepository;
32
- console.log('Loaded JWT Secret:', configService.get('secret_key'));
31
+ this.configService = configService;
33
32
  }
34
33
  async validate(payload) {
35
34
  const { userId, sessionToken } = payload;
@@ -47,8 +46,8 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
47
46
  exports.JwtStrategy = JwtStrategy;
48
47
  exports.JwtStrategy = JwtStrategy = __decorate([
49
48
  (0, common_1.Injectable)(),
50
- __param(1, (0, typeorm_1.InjectRepository)(user_session_entity_1.UserSession)),
51
- __metadata("design:paramtypes", [config_1.ConfigService,
52
- typeorm_2.Repository])
49
+ __param(0, (0, typeorm_1.InjectRepository)(user_session_entity_1.UserSession)),
50
+ __metadata("design:paramtypes", [typeorm_2.Repository,
51
+ config_1.ConfigService])
53
52
  ], JwtStrategy);
54
53
  //# sourceMappingURL=jwt.strategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAoD;AACpD,+CAAoD;AACpD,2CAAmE;AACnE,6CAAmD;AACnD,2CAA+C;AAC/C,yFAA8E;AAC9E,qCAAqC;AAG9B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YACmB,aAA4B,EAErC,qBAA8C;QAEtD,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAS,YAAY,CAAC;SACrD,CAAC,CAAC;QARc,kBAAa,GAAb,aAAa,CAAe;QAErC,0BAAqB,GAArB,qBAAqB,CAAyB;QAQtD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,aAAa,CAAC,GAAG,CAAS,YAAY,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAO;QACpB,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QAGzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;YAC3D,KAAK,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;SACrC,CAAC,CAA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AEH,IACE,CAAC,WAAW;YACZ,WAAW,CAAC,oBAAoB;YAChC,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,IAAI,IAAI,EAAE,EAC9C,CAAC;YACD,MAAM,IAAI,8BAAqB,CAAC,4BAA4B,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AA/BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,iCAAW,CAAC,CAAA;qCACC,oBAAU;QAClB,sBAAa;GAJ3B,WAAW,CA+BvB"}
@@ -18,7 +18,7 @@ exports.EnterpriseModule = EnterpriseModule = __decorate([
18
18
  (0, common_1.Module)({
19
19
  imports: [typeorm_1.TypeOrmModule.forFeature([organization_entity_1.OrganizationData])],
20
20
  providers: [organization_service_1.OrganizationService],
21
- exports: [organization_service_1.OrganizationService]
21
+ exports: [organization_service_1.OrganizationService],
22
22
  })
23
23
  ], EnterpriseModule);
24
24
  //# sourceMappingURL=enterprise.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,yEAAqE;AACrE,sEAAgE;AAOzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,sCAAgB,CAAC,CAAC,CAAC;QACvD,SAAS,EAAC,CAAC,0CAAmB,CAAC;QAC/B,OAAO,EAAC,CAAC,0CAAmB,CAAC;KAC9B,CAAC;GACW,gBAAgB,CAAG"}
1
+ {"version":3,"file":"enterprise.module.js","sourceRoot":"","sources":["../../../src/module/enterprise/enterprise.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,yEAAqE;AACrE,sEAAgE;AAOzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,sCAAgB,CAAC,CAAC,CAAC;QACvD,SAAS,EAAE,CAAC,0CAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,0CAAmB,CAAC;KAC/B,CAAC;GACW,gBAAgB,CAAG"}
@@ -1,11 +1,13 @@
1
- import { Repository } from 'typeorm';
1
+ import { EntityManager, Repository } from 'typeorm';
2
2
  import { OrganizationData } from '../entity/organization.entity';
3
+ import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
3
4
  export declare class OrganizationService {
4
5
  private readonly organizationRepository;
5
- constructor(organizationRepository: Repository<OrganizationData>);
6
- create(organizationDto: Partial<OrganizationData>): Promise<OrganizationData>;
7
- findAll(): Promise<OrganizationData[]>;
8
- findOne(id: number): Promise<OrganizationData | null>;
9
- update(id: number, organizationDto: Partial<OrganizationData>): Promise<OrganizationData | null>;
10
- remove(id: number): Promise<void>;
6
+ private readonly idGen;
7
+ constructor(organizationRepository: Repository<OrganizationData>, idGen: ClockIDGenService);
8
+ create(organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData>;
9
+ findAll(manager?: EntityManager): Promise<OrganizationData[]>;
10
+ findOne(id: number, manager?: EntityManager): Promise<OrganizationData | null>;
11
+ update(id: number, organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData | null>;
12
+ remove(id: number, manager?: EntityManager): Promise<void>;
11
13
  }
@@ -17,32 +17,53 @@ const common_1 = require("@nestjs/common");
17
17
  const typeorm_1 = require("@nestjs/typeorm");
18
18
  const typeorm_2 = require("typeorm");
19
19
  const organization_entity_1 = require("../entity/organization.entity");
20
+ const clockIDGenUtil_service_1 = require("../../../utils/service/clockIDGenUtil.service");
20
21
  let OrganizationService = class OrganizationService {
21
- constructor(organizationRepository) {
22
+ constructor(organizationRepository, idGen) {
22
23
  this.organizationRepository = organizationRepository;
24
+ this.idGen = idGen;
23
25
  }
24
- async create(organizationDto) {
25
- const organization = this.organizationRepository.create(organizationDto);
26
- return await this.organizationRepository.save(organization);
26
+ async create(organizationDto, manager) {
27
+ const repo = manager
28
+ ? manager.getRepository(organization_entity_1.OrganizationData)
29
+ : this.organizationRepository;
30
+ organizationDto.code = this.idGen.idGenerator('ORG');
31
+ organizationDto.status = 'ACTIVE';
32
+ organizationDto.created_date = new Date();
33
+ const organization = repo.create(organizationDto);
34
+ return await repo.save(organization);
27
35
  }
28
- async findAll() {
29
- return await this.organizationRepository.find();
36
+ async findAll(manager) {
37
+ const repo = manager
38
+ ? manager.getRepository(organization_entity_1.OrganizationData)
39
+ : this.organizationRepository;
40
+ return await repo.find();
30
41
  }
31
- async findOne(id) {
32
- return await this.organizationRepository.findOne({ where: { id } });
42
+ async findOne(id, manager) {
43
+ const repo = manager
44
+ ? manager.getRepository(organization_entity_1.OrganizationData)
45
+ : this.organizationRepository;
46
+ return await repo.findOne({ where: { id } });
33
47
  }
34
- async update(id, organizationDto) {
35
- await this.organizationRepository.update(id, organizationDto);
36
- return this.findOne(id);
48
+ async update(id, organizationDto, manager) {
49
+ const repo = manager
50
+ ? manager.getRepository(organization_entity_1.OrganizationData)
51
+ : this.organizationRepository;
52
+ await repo.update(id, organizationDto);
53
+ return await repo.findOne({ where: { id } });
37
54
  }
38
- async remove(id) {
39
- await this.organizationRepository.delete(id);
55
+ async remove(id, manager) {
56
+ const repo = manager
57
+ ? manager.getRepository(organization_entity_1.OrganizationData)
58
+ : this.organizationRepository;
59
+ await repo.delete(id);
40
60
  }
41
61
  };
42
62
  exports.OrganizationService = OrganizationService;
43
63
  exports.OrganizationService = OrganizationService = __decorate([
44
64
  (0, common_1.Injectable)(),
45
65
  __param(0, (0, typeorm_1.InjectRepository)(organization_entity_1.OrganizationData)),
46
- __metadata("design:paramtypes", [typeorm_2.Repository])
66
+ __metadata("design:paramtypes", [typeorm_2.Repository,
67
+ clockIDGenUtil_service_1.ClockIDGenService])
47
68
  ], OrganizationService);
48
69
  //# sourceMappingURL=organization.service.js.map