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,7 @@
1
+ import { ExcelsheetData } from './excelsheet-data.dto';
2
+ export declare class ExcelData {
3
+ filePath: string;
4
+ sheetList: ExcelsheetData[];
5
+ addSheet(sheetData: ExcelsheetData): void;
6
+ addSheetAt(sheetData: ExcelsheetData, position: number): void;
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExcelData = void 0;
4
+ class ExcelData {
5
+ constructor() {
6
+ this.sheetList = [];
7
+ }
8
+ addSheet(sheetData) {
9
+ this.sheetList.push(sheetData);
10
+ }
11
+ addSheetAt(sheetData, position) {
12
+ this.sheetList.splice(position, 0, sheetData);
13
+ }
14
+ }
15
+ exports.ExcelData = ExcelData;
16
+ //# sourceMappingURL=excel-data.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel-data.dto.js","sourceRoot":"","sources":["../../../src/utils/dto/excel-data.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAS;IAAtB;QAEE,cAAS,GAAqB,EAAE,CAAC;IASnC,CAAC;IAPC,QAAQ,CAAC,SAAyB;QAChC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,UAAU,CAAC,SAAyB,EAAE,QAAgB;QACpD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;CACF;AAXD,8BAWC"}
@@ -0,0 +1,5 @@
1
+ export interface ExcelsheetData {
2
+ sheetName: string;
3
+ headers: string[];
4
+ rowList: any[][];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=excelsheet-data.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excelsheet-data.dto.js","sourceRoot":"","sources":["../../../src/utils/dto/excelsheet-data.dto.ts"],"names":[],"mappings":""}
@@ -1,7 +1,9 @@
1
- export declare class ExcelHelperService {
1
+ import { ExcelData } from '../dto/excel-data.dto';
2
+ export declare class ExcelHelper {
2
3
  static getHeader(filePath: string, sheetName: string): string[];
3
4
  static readExcel(filePath: string, rowLevel: string, sheetName: string): string[][];
4
5
  static getRowData(filePath: string, sheetName: string): string[][];
5
6
  static getJSONStringFromList(header: string[], rowData: string[][]): string;
6
7
  static getDataObjectListFromXLS<T>(filePath: string, sheetName: string, classType: new () => T): T[];
8
+ static writeExcel(excelData: ExcelData): void;
7
9
  }
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExcelHelperService = void 0;
3
+ exports.ExcelHelper = void 0;
4
4
  const ExcelJS = require("exceljs");
5
- class ExcelHelperService {
5
+ const XLSX = require("xlsx");
6
+ class ExcelHelper {
6
7
  static getHeader(filePath, sheetName) {
7
8
  const rows = this.readExcel(filePath, 'HEADER', sheetName);
8
9
  return rows.length > 0 ? rows[0] : [];
@@ -39,6 +40,14 @@ class ExcelHelperService {
39
40
  const jsonString = this.getJSONStringFromList(header, rowData);
40
41
  return JSON.parse(jsonString);
41
42
  }
43
+ static writeExcel(excelData) {
44
+ const wb = XLSX.utils.book_new();
45
+ for (const sheetData of excelData.sheetList) {
46
+ const ws = XLSX.utils.aoa_to_sheet([sheetData.headers, ...sheetData.rowList]);
47
+ XLSX.utils.book_append_sheet(wb, ws, sheetData.sheetName || 'Sheet1');
48
+ }
49
+ XLSX.writeFile(wb, excelData.filePath);
50
+ }
42
51
  }
43
- exports.ExcelHelperService = ExcelHelperService;
52
+ exports.ExcelHelper = ExcelHelper;
44
53
  //# sourceMappingURL=excel-helper.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"excel-helper.service.js","sourceRoot":"","sources":["../../../src/utils/service/excel-helper.service.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,MAAa,kBAAkB;IAC7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}
@@ -20,21 +20,21 @@ let LoggingService = class LoggingService {
20
20
  let levelInfo = level.toLowerCase().trim();
21
21
  let logger = new common_1.Logger(serviceName);
22
22
  const fileConfiguration = {
23
- format: winston.format.combine(winston.format.errors({ stzack: true }), winston.format.timestamp({ format: 'DD/MM/YYYY HH:mm:ss' }), winston.format.printf(info => `${info.timestamp} : ${info.level}: ${serviceName}: ${methodName} : ${message} : ${JSON.stringify(parameters) || ""} : ${JSON.stringify(debuginfo) || ""}`)),
23
+ format: winston.format.combine(winston.format.errors({ stzack: true }), winston.format.timestamp({ format: 'DD/MM/YYYY HH:mm:ss' }), winston.format.printf((info) => `${info.timestamp} : ${info.level}: ${serviceName}: ${methodName} : ${message} : ${JSON.stringify(parameters) || ''} : ${JSON.stringify(debuginfo) || ''}`)),
24
24
  transports: [
25
25
  new winston_1.transports.File({
26
- dirname: `/data01/logs/${moment().format("DD-MM-YYYY")}/activity/${moment().format("HH dddd")}`,
26
+ dirname: `/data01/logs/${moment().format('DD-MM-YYYY')}/activity/${moment().format('HH dddd')}`,
27
27
  filename: 'activity.log',
28
- level: `${level}`
29
- })
28
+ level: `${level}`,
29
+ }),
30
30
  ],
31
31
  };
32
32
  const filelogger = winston.createLogger(fileConfiguration);
33
33
  let data = `${message} -- Parameters: ${JSON.stringify(parameters)}`;
34
- if (levelInfo == "debug" || levelInfo == "info") {
34
+ if (levelInfo == 'debug' || levelInfo == 'info') {
35
35
  logger.debug(`${methodName} : ${message} : Parameters :${JSON.stringify(parameters)}: Debug Info: ${JSON.stringify(debuginfo)}`);
36
36
  }
37
- else if (levelInfo == "error") {
37
+ else if (levelInfo == 'error') {
38
38
  logger.error(`${methodName} : ${message} : Parameters :${JSON.stringify(parameters)}: Debug Info: ${JSON.stringify(debuginfo)}`);
39
39
  }
40
40
  filelogger.on('finish', () => { });
@@ -1 +1 @@
1
- {"version":3,"file":"loggingUtil.service.js","sourceRoot":"","sources":["../../../src/utils/service/loggingUtil.service.ts"],"names":[],"mappings":";;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CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CACnH,CAAC;QACJ,CAAC;aAAM,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YAChC,MAAM,CAAC,KAAK,CACV,GAAG,UAAU,MAAM,OAAO,kBAAkB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CACnH,CAAC;QACJ,CAAC;QACD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClC,UAAU,CAAC,GAAG,EAAE,CAAC;IACnB,CAAC;CACF,CAAA;AAhDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;;GACA,cAAc,CAgD1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.module.js","sourceRoot":"","sources":["../../src/utils/utils.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8C;AAC9C,uEAA+D;AAC/D,mFAAqE;AACrE,mEAAwD;AACxD,6EAAqE;AAO9D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IALvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,oCAAc,EAAE,4CAAgB,EAAC,6BAAS,EAAC,0CAAiB,CAAC;QACzE,OAAO,EAAE,CAAC,oCAAc,EAAE,4CAAgB,EAAC,6BAAS,EAAC,0CAAiB,CAAC;KACxE,CAAC;GACW,WAAW,CAAG"}
1
+ {"version":3,"file":"utils.module.js","sourceRoot":"","sources":["../../src/utils/utils.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,uEAA+D;AAC/D,mFAAuE;AACvE,mEAAwD;AACxD,6EAAqE;AAO9D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IALvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,oCAAc,EAAE,4CAAgB,EAAE,6BAAS,EAAE,0CAAiB,CAAC;QAC3E,OAAO,EAAE,CAAC,oCAAc,EAAE,4CAAgB,EAAE,6BAAS,EAAE,0CAAiB,CAAC;KAC1E,CAAC;GACW,WAAW,CAAG"}
package/nest-cli.json CHANGED
@@ -3,6 +3,12 @@
3
3
  "collection": "@nestjs/schematics",
4
4
  "sourceRoot": "src",
5
5
  "compilerOptions": {
6
+ "assets": [
7
+ {
8
+ "include": "../src/resources/*.yaml",
9
+ "outDir": "./dist/"
10
+ }
11
+ ],
6
12
  "deleteOutDir": true
7
13
  }
8
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "0.0.7",
3
+ "version": "1.0.2o",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
File without changes
@@ -10,7 +10,7 @@ import { MySqlConfiguration } from './database.config';
10
10
  TypeOrmModule.forRootAsync({
11
11
  useClass: MySqlConfiguration,
12
12
  }),
13
- ConfigModule.forRoot({isGlobal: true})
13
+ ConfigModule.forRoot({ isGlobal: true }),
14
14
  ],
15
15
  // providers: [MySqlConfiguration],
16
16
  exports: [TypeOrmModule],
@@ -1,17 +1,22 @@
1
1
  import { Injectable } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
2
3
  import { TypeOrmModuleOptions, TypeOrmOptionsFactory } from '@nestjs/typeorm';
3
4
 
4
5
  @Injectable()
5
6
  export class MySqlConfiguration implements TypeOrmOptionsFactory {
6
7
 
8
+ constructor(
9
+ private configService: ConfigService,
10
+ ){}
11
+
7
12
  createTypeOrmOptions(): TypeOrmModuleOptions {
8
13
  return {
9
14
  type: 'mysql',
10
- host: process.env.DB_HOST || '13.234.25.234',
11
- port: parseInt(process.env.DB_PORT || '3306', 10),
12
- username: process.env.DB_USER || 'root',
13
- password: process.env.DB_PASS || 'Rezolut@123',
14
- database: process.env.DB_NAME || 'core',
15
+ host: this.configService.get('DB_HOST')|| '13.234.25.234',
16
+ port: parseInt(this.configService.get('DB_PORT') || '3306', 10),
17
+ username: this.configService.get('DB_USER') || 'root',
18
+ password: this.configService.get('DB_PASS') || 'Rezolut@123',
19
+ database: this.configService.get('DB_NAME') || 'core',
15
20
  entities: [__dirname + '/../module/**/*.entity.{ts,js}'],
16
21
  synchronize: true,
17
22
  autoLoadEntities: true,
@@ -4,7 +4,16 @@ export const ENTITYTYPE_ENTITYMASTER = 'EMS';
4
4
  export const ENTITYTYPE_ROLE = 'ROL';
5
5
  export const ENTITYTYPE_ENTITYTABLE = 'ETB';
6
6
  export const ENTITYTYPE_ENTITYTABLECOLUMN = 'ETC';
7
- export const ENTITYTYPE_PREFERENCEMASTER = 'PRM'
8
- export const masterKey: string = process.env.master_key || '';
9
- export const masterIv: string = process.env.master_iv || '';
10
- export const secretKey: string = process.env.secret_key || '';
7
+ export const ENTITYTYPE_PREFERENCEMASTER = 'PRM';
8
+ export const ENTITYTYPE_VIEWMASTER = 'VMS';
9
+ export const ENTITYTYPE_MEDIA = 'MDA';
10
+
11
+ export const STORAGETYPE_SINGLEJSON = 'singlejson';
12
+ export const STORAGETYPE_COLUMN = 'column';
13
+
14
+ // SECRET KEY
15
+ export const secretKey: string = process.env.secret_key || '';
16
+
17
+ // STATUS
18
+ export const STATUS_ACTIVE = 'ACTIVE';
19
+ export const STATUS_INACTIVE = 'INACTIVE';
@@ -5,6 +5,8 @@ import { UtilsModule } from './utils/utils.module';
5
5
  import { UserModule } from './module/user/user.module';
6
6
  import { EntityModule } from './module/meta/entity.module';
7
7
  import { ModuleModule } from './module/module/module.module';
8
+ import { NotificationModule } from './module/notification/notification.module';
9
+ import { LayoutModule } from './module/layout/layout.module';
8
10
 
9
11
  @Global()
10
12
  @Module({})
@@ -24,6 +26,8 @@ export class CoreModule {
24
26
  UtilsModule,
25
27
  UserModule,
26
28
  ModuleModule,
29
+ NotificationModule,
30
+ LayoutModule,
27
31
  ],
28
32
  exports: [
29
33
  ConfigModule,
@@ -33,6 +37,8 @@ export class CoreModule {
33
37
  UtilsModule,
34
38
  UserModule,
35
39
  ModuleModule,
40
+ NotificationModule,
41
+ LayoutModule,
36
42
  ],
37
43
  };
38
44
  }
@@ -1,4 +1,7 @@
1
- import {applyDecorators, SetMetadata} from "@nestjs/common";
1
+ import { applyDecorators, SetMetadata } from '@nestjs/common';
2
2
 
3
3
  export const Roles = (moduleCode: string, actions: string) =>
4
- applyDecorators(SetMetadata('moduleCode', moduleCode), SetMetadata('actions', actions));
4
+ applyDecorators(
5
+ SetMetadata('moduleCode', moduleCode),
6
+ SetMetadata('actions', actions),
7
+ );
@@ -5,6 +5,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
5
5
  import { JwtStrategy } from './strategies/jwt.strategy';
6
6
  import { JwtAuthService } from './services/jwt.service';
7
7
  import { JwtAuthGuard } from './guards/jwt.guard';
8
+ import { secretKey } from '../../constant/global.constant';
8
9
  import { PassportModule } from '@nestjs/passport';
9
10
  import { UserSession } from '../user/entity/user-session.entity';
10
11
  import { GoogleStrategy } from './strategies/google.strategy';
@@ -15,10 +16,10 @@ import { RolesGuard } from './guards/role.guard';
15
16
  ConfigModule, // ✅ Ensure ConfigModule is imported
16
17
  PassportModule.register({ defaultStrategy: 'jwt' }),
17
18
  JwtModule.registerAsync({
18
- imports: [ConfigModule], // ✅ Ensure ConfigModule is available
19
+ imports: [ConfigModule],
19
20
  inject: [ConfigService],
20
21
  useFactory: async (configService: ConfigService) => ({
21
- secret: configService.get<string>('secret_key', 'defaultSecret'), // ✅ Use ConfigService
22
+ secret: configService.get('SECRET_KEY'),
22
23
  signOptions: { expiresIn: '1800s' },
23
24
  }),
24
25
  }),
@@ -1,4 +1,4 @@
1
- import { Injectable, ExecutionContext } from '@nestjs/common';
1
+ import { ExecutionContext, Injectable } from '@nestjs/common';
2
2
  import { AuthGuard } from '@nestjs/passport';
3
3
 
4
4
  @Injectable()
@@ -1,22 +1,22 @@
1
- import { ExecutionContext, Injectable } from '@nestjs/common';
2
- import { AuthGuard } from '@nestjs/passport';
3
- import { Reflector } from '@nestjs/core';
4
- import { Observable } from 'rxjs';
5
-
6
- @Injectable()
7
- export class JwtAuthGuard extends AuthGuard('jwt') {
8
- constructor(private reflector: Reflector) {
9
- super();
10
- }
11
-
12
- canActivate(
13
- context: ExecutionContext,
14
- ): Promise<boolean> | boolean | Observable<boolean> {
15
- const isPublic = this.reflector.getAllAndOverride('isPublic', [
16
- context.getHandler(),
17
- context.getClass(),
18
- ]);
19
- if (isPublic) return true;
20
- return super.canActivate(context);
21
- }
22
- }
1
+ import { ExecutionContext, Injectable } from '@nestjs/common';
2
+ import { AuthGuard } from '@nestjs/passport';
3
+ import { Reflector } from '@nestjs/core';
4
+ import { Observable } from 'rxjs';
5
+
6
+ @Injectable()
7
+ export class JwtAuthGuard extends AuthGuard('jwt') {
8
+ constructor(private reflector: Reflector) {
9
+ super();
10
+ }
11
+
12
+ canActivate(
13
+ context: ExecutionContext,
14
+ ): Promise<boolean> | boolean | Observable<boolean> {
15
+ const isPublic = this.reflector.getAllAndOverride('isPublic', [
16
+ context.getHandler(),
17
+ context.getClass(),
18
+ ]);
19
+ if (isPublic) return true;
20
+ return super.canActivate(context);
21
+ }
22
+ }
@@ -1,68 +1,68 @@
1
- import {
2
- CanActivate,
3
- ExecutionContext,
4
- ForbiddenException,
5
- Injectable,
6
- UnauthorizedException,
7
- } from '@nestjs/common';
8
- import { Reflector } from '@nestjs/core';
9
- import { UserData } from '../../user/entity/user.entity';
10
- import { InjectEntityManager } from '@nestjs/typeorm';
11
- import { EntityManager } from 'typeorm';
12
-
13
- @Injectable()
14
- export class RolesGuard implements CanActivate {
15
- constructor(
16
- private reflector: Reflector,
17
- @InjectEntityManager() private entityManager: EntityManager,
18
- ) {}
19
-
20
- async canActivate(context: ExecutionContext) {
21
- const request = context
22
- .switchToHttp()
23
- .getRequest<Request & { user: any }>();
24
- const object = request.user;
25
-
26
- const users: UserData = await this.entityManager.query(
27
- `SELECT * FROM cr_user WHERE id = ${object.userId} LIMIT 1`,
28
- );
29
-
30
- const user = users[0];
31
- if (!user || !user['role_id']) {
32
- throw new UnauthorizedException('User not authorized');
33
- }
34
-
35
- const requiredModule = this.reflector.get<string>(
36
- 'moduleCode',
37
- context.getHandler(),
38
- );
39
- const requiredActions = this.reflector.get<string>(
40
- 'actions',
41
- context.getHandler(),
42
- );
43
-
44
- const roleAccess = await this.entityManager.query(
45
- `SELECT *
46
- FROM cr_module_access
47
- WHERE role_id = ${user['role_id']}
48
- AND module_code = '${requiredModule}'`,
49
- );
50
-
51
- if (!roleAccess || roleAccess.length === 0) {
52
- throw new ForbiddenException(
53
- 'Access denied: No permissions found for this module',
54
- );
55
- }
56
-
57
- const hasAccess = roleAccess.some(
58
- (access) =>
59
- requiredActions.includes(access.action_type) &&
60
- access.access_flag === 1,
61
- );
62
-
63
- if (!hasAccess) {
64
- throw new ForbiddenException('Access denied: Insufficient permissions.');
65
- }
66
- return true;
67
- }
68
- }
1
+ import {
2
+ CanActivate,
3
+ ExecutionContext,
4
+ ForbiddenException,
5
+ Injectable,
6
+ UnauthorizedException,
7
+ } from '@nestjs/common';
8
+ import { Reflector } from '@nestjs/core';
9
+ import { UserData } from '../../user/entity/user.entity';
10
+ import { InjectEntityManager } from '@nestjs/typeorm';
11
+ import { EntityManager } from 'typeorm';
12
+
13
+ @Injectable()
14
+ export class RolesGuard implements CanActivate {
15
+ constructor(
16
+ private reflector: Reflector,
17
+ @InjectEntityManager() private entityManager: EntityManager,
18
+ ) {}
19
+
20
+ async canActivate(context: ExecutionContext) {
21
+ const request = context
22
+ .switchToHttp()
23
+ .getRequest<Request & { user: any }>();
24
+ const object = request.user;
25
+
26
+ const users: UserData = await this.entityManager.query(
27
+ `SELECT * FROM cr_user WHERE id = ${object.userId} LIMIT 1`,
28
+ );
29
+
30
+ const user = users[0];
31
+ if (!user || !user['role_id']) {
32
+ throw new UnauthorizedException('User not authorized');
33
+ }
34
+
35
+ const requiredModule = this.reflector.get<string>(
36
+ 'moduleCode',
37
+ context.getHandler(),
38
+ );
39
+ const requiredActions = this.reflector.get<string>(
40
+ 'actions',
41
+ context.getHandler(),
42
+ );
43
+
44
+ const roleAccess = await this.entityManager.query(
45
+ `SELECT *
46
+ FROM cr_module_access
47
+ WHERE role_id = ${user['role_id']}
48
+ AND module_code = '${requiredModule}'`,
49
+ );
50
+
51
+ if (!roleAccess || roleAccess.length === 0) {
52
+ throw new ForbiddenException(
53
+ 'Access denied: No permissions found for this module',
54
+ );
55
+ }
56
+
57
+ const hasAccess = roleAccess.some(
58
+ (access) =>
59
+ requiredActions.includes(access.action_type) &&
60
+ access.access_flag === 1,
61
+ );
62
+
63
+ if (!hasAccess) {
64
+ throw new ForbiddenException('Access denied: Insufficient permissions.');
65
+ }
66
+ return true;
67
+ }
68
+ }
@@ -1,29 +1,29 @@
1
- import { BadRequestException, Injectable } from '@nestjs/common';
2
- import { UserService } from '../../user/service/user.service';
3
- import { JwtService } from '@nestjs/jwt';
4
- import { UserData } from '../../user/entity/user.entity';
5
-
6
- @Injectable()
7
- export class AuthService {
8
- constructor(
9
- private userService: UserService,
10
- private jwtService: JwtService,
11
- ) {}
12
-
13
- async validateUser(email: string, password: string): Promise<UserData> {
14
- const user = await this.userService.findByEmailId(email);
15
- if (!user) {
16
- throw new BadRequestException('User not found');
17
- }
18
- const isMatch: boolean = password === user.password;
19
- if (!isMatch) {
20
- throw new BadRequestException('Password does not match');
21
- }
22
- return user;
23
- }
24
-
25
- async login(user: UserData) {
26
- const payload = { email: user.email_id, id: user.id };
27
- return { access_token: this.jwtService.sign(payload) };
28
- }
29
- }
1
+ import { BadRequestException, Injectable } from '@nestjs/common';
2
+ import { UserService } from '../../user/service/user.service';
3
+ import { JwtService } from '@nestjs/jwt';
4
+ import { UserData } from '../../user/entity/user.entity';
5
+
6
+ @Injectable()
7
+ export class AuthService {
8
+ constructor(
9
+ private userService: UserService,
10
+ private jwtService: JwtService,
11
+ ) {}
12
+
13
+ async validateUser(email: string, password: string): Promise<UserData> {
14
+ const user = await this.userService.findByEmailId(email);
15
+ if (!user) {
16
+ throw new BadRequestException('User not found');
17
+ }
18
+ const isMatch: boolean = password === user.password;
19
+ if (!isMatch) {
20
+ throw new BadRequestException('Password does not match');
21
+ }
22
+ return user;
23
+ }
24
+
25
+ async login(user: UserData) {
26
+ const payload = { email: user.email_id, id: user.id };
27
+ return { access_token: this.jwtService.sign(payload) };
28
+ }
29
+ }
@@ -1,11 +1,11 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { JwtService } from '@nestjs/jwt';
3
-
4
- @Injectable()
5
- export class JwtAuthService {
6
- constructor(private readonly jwtService: JwtService) {}
7
-
8
- generateJwt(payload: any): string {
9
- return this.jwtService.sign(payload);
10
- }
11
- }
1
+ import { Injectable } from '@nestjs/common';
2
+ import { JwtService } from '@nestjs/jwt';
3
+
4
+ @Injectable()
5
+ export class JwtAuthService {
6
+ constructor(private readonly jwtService: JwtService) {}
7
+
8
+ generateJwt(payload: any): string {
9
+ return this.jwtService.sign(payload);
10
+ }
11
+ }
@@ -1,14 +1,17 @@
1
1
  import { Injectable } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
2
3
  import { PassportStrategy } from '@nestjs/passport';
3
4
  import { Strategy, VerifyCallback } from 'passport-google-oauth20';
4
5
 
5
6
  @Injectable()
6
7
  export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
7
- constructor() {
8
+ constructor(
9
+ private configService: ConfigService,
10
+ ) {
8
11
  super({
9
- clientID: process.env.clientID,
10
- clientSecret: process.env.clientSecret,
11
- callbackURL: process.env.callbackURL,
12
+ clientID: configService.get('CLIENT_ID'),
13
+ clientSecret: configService.get('CLIENT_SECRET'),
14
+ callbackURL:configService.get('CALLBACK_URL'),
12
15
  scope: ['email', 'profile'],
13
16
  });
14
17
  }
@@ -1,25 +1,24 @@
1
1
  import { ExtractJwt, Strategy } from 'passport-jwt';
2
2
  import { PassportStrategy } from '@nestjs/passport';
3
3
  import { Injectable, UnauthorizedException } from '@nestjs/common';
4
+ import { secretKey } from '../../../constant/global.constant';
4
5
  import { InjectRepository } from '@nestjs/typeorm';
5
- import { ConfigService } from '@nestjs/config'; // ✅ Import ConfigService
6
- import { UserSession } from '../../../module/user/entity/user-session.entity';
6
+ import { UserSession } from 'src/module/user/entity/user-session.entity';
7
7
  import { Repository } from 'typeorm';
8
+ import { ConfigService } from '@nestjs/config';
8
9
 
9
10
  @Injectable()
10
11
  export class JwtStrategy extends PassportStrategy(Strategy) {
11
12
  constructor(
12
- private readonly configService: ConfigService, // ✅ Inject ConfigService
13
13
  @InjectRepository(UserSession)
14
14
  private userSessionRepository: Repository<UserSession>,
15
+ private configService: ConfigService,
15
16
  ) {
16
17
  super({
17
18
  jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
18
19
  ignoreExpiration: false,
19
- secretOrKey: configService.get<string>('secret_key'), // ✅ Use ConfigService
20
+ secretOrKey:configService.get('SECRET_KEY'),
20
21
  });
21
-
22
- console.log('Loaded JWT Secret:', configService.get<string>('secret_key')); // Debugging
23
22
  }
24
23
 
25
24
  async validate(payload) {