rez_core 4.0.184 → 4.0.187

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 (197) hide show
  1. package/dist/app.module.js +11 -0
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/config/bull.config.d.ts +10 -0
  4. package/dist/config/bull.config.js +66 -0
  5. package/dist/config/bull.config.js.map +1 -0
  6. package/dist/config/database.config.js +1 -1
  7. package/dist/config/database.config.js.map +1 -1
  8. package/dist/module/entity_json/controller/entity_json.controller.d.ts +8 -0
  9. package/dist/module/entity_json/controller/entity_json.controller.js +43 -0
  10. package/dist/module/entity_json/controller/entity_json.controller.js.map +1 -0
  11. package/dist/module/entity_json/entity_json.module.d.ts +2 -0
  12. package/dist/module/entity_json/entity_json.module.js +26 -0
  13. package/dist/module/entity_json/entity_json.module.js.map +1 -0
  14. package/dist/module/entity_json/service/entity_json.service.d.ts +7 -0
  15. package/dist/module/entity_json/service/entity_json.service.js +116 -0
  16. package/dist/module/entity_json/service/entity_json.service.js.map +1 -0
  17. package/dist/module/filter/service/filter.service.js.map +1 -1
  18. package/dist/module/integration/service/wrapper.service.d.ts +3 -1
  19. package/dist/module/integration/service/wrapper.service.js +39 -36
  20. package/dist/module/integration/service/wrapper.service.js.map +1 -1
  21. package/dist/module/linked_attributes/controller/linked_attributes.controller.d.ts +5 -0
  22. package/dist/module/linked_attributes/controller/linked_attributes.controller.js +29 -0
  23. package/dist/module/linked_attributes/controller/linked_attributes.controller.js.map +1 -0
  24. package/dist/module/linked_attributes/entity/linked_attribute.entity.d.ts +9 -0
  25. package/dist/module/linked_attributes/entity/linked_attribute.entity.js +70 -0
  26. package/dist/module/linked_attributes/entity/linked_attribute.entity.js.map +1 -0
  27. package/dist/module/linked_attributes/linked_attributes.module.d.ts +2 -0
  28. package/dist/module/linked_attributes/linked_attributes.module.js +29 -0
  29. package/dist/module/linked_attributes/linked_attributes.module.js.map +1 -0
  30. package/dist/module/linked_attributes/repository/linked_attribute.repository.d.ts +6 -0
  31. package/dist/module/linked_attributes/repository/linked_attribute.repository.js +31 -0
  32. package/dist/module/linked_attributes/repository/linked_attribute.repository.js.map +1 -0
  33. package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +5 -0
  34. package/dist/module/linked_attributes/service/linked_attributes.service.js +34 -0
  35. package/dist/module/linked_attributes/service/linked_attributes.service.js.map +1 -0
  36. package/dist/module/mapper/service/field-mapper.service.js +2 -2
  37. package/dist/module/mapper/service/field-mapper.service.js.map +1 -1
  38. package/dist/module/meta/controller/attribute-master.controller.d.ts +10 -1
  39. package/dist/module/meta/controller/attribute-master.controller.js +27 -2
  40. package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
  41. package/dist/module/meta/controller/entity-master.controller.d.ts +6 -0
  42. package/dist/module/meta/controller/entity-master.controller.js +13 -0
  43. package/dist/module/meta/controller/entity-master.controller.js.map +1 -1
  44. package/dist/module/meta/entity.module.js +7 -0
  45. package/dist/module/meta/entity.module.js.map +1 -1
  46. package/dist/module/meta/repository/attribute-master.repository.d.ts +4 -0
  47. package/dist/module/meta/repository/attribute-master.repository.js +19 -0
  48. package/dist/module/meta/repository/attribute-master.repository.js.map +1 -1
  49. package/dist/module/meta/repository/entity-attribute-update.repository.d.ts +6 -0
  50. package/dist/module/meta/repository/entity-attribute-update.repository.js +44 -0
  51. package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -0
  52. package/dist/module/meta/repository/entity-master.repository.d.ts +7 -1
  53. package/dist/module/meta/repository/entity-master.repository.js +24 -2
  54. package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
  55. package/dist/module/meta/service/attribute-master.service.d.ts +4 -0
  56. package/dist/module/meta/service/attribute-master.service.js +3 -0
  57. package/dist/module/meta/service/attribute-master.service.js.map +1 -1
  58. package/dist/module/meta/service/entity-attribute-update.service.d.ts +7 -0
  59. package/dist/module/meta/service/entity-attribute-update.service.js +35 -0
  60. package/dist/module/meta/service/entity-attribute-update.service.js.map +1 -0
  61. package/dist/module/meta/service/entity-master.service.d.ts +4 -0
  62. package/dist/module/meta/service/entity-master.service.js +3 -0
  63. package/dist/module/meta/service/entity-master.service.js.map +1 -1
  64. package/dist/module/meta/service/resolver.service.js +2 -2
  65. package/dist/module/meta/service/resolver.service.js.map +1 -1
  66. package/dist/module/module/service/module-access.service.js +1 -7
  67. package/dist/module/module/service/module-access.service.js.map +1 -1
  68. package/dist/module/workflow/entity/action.entity.d.ts +1 -0
  69. package/dist/module/workflow/entity/action.entity.js +4 -0
  70. package/dist/module/workflow/entity/action.entity.js.map +1 -1
  71. package/dist/module/workflow/repository/action-data.repository.js +1 -0
  72. package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
  73. package/dist/module/workflow/repository/task.repository.d.ts +3 -1
  74. package/dist/module/workflow/repository/task.repository.js +6 -1
  75. package/dist/module/workflow/repository/task.repository.js.map +1 -1
  76. package/dist/module/workflow/service/task.service.js +41 -27
  77. package/dist/module/workflow/service/task.service.js.map +1 -1
  78. package/dist/module/workflow/service/workflow-meta.service.js +23 -21
  79. package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
  80. package/dist/module/workflow-automation/controller/workflow-automation.controller.d.ts +6 -0
  81. package/dist/module/workflow-automation/controller/workflow-automation.controller.js +16 -0
  82. package/dist/module/workflow-automation/controller/workflow-automation.controller.js.map +1 -1
  83. package/dist/module/workflow-automation/entity/workflow-automation.entity.d.ts +2 -0
  84. package/dist/module/workflow-automation/entity/workflow-automation.entity.js +8 -0
  85. package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
  86. package/dist/module/workflow-automation/service/schedule-handler.service.d.ts +16 -0
  87. package/dist/module/workflow-automation/service/schedule-handler.service.js +109 -0
  88. package/dist/module/workflow-automation/service/schedule-handler.service.js.map +1 -0
  89. package/dist/module/workflow-automation/service/workflow-automation-engine.service.d.ts +1 -1
  90. package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
  91. package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +13 -1
  92. package/dist/module/workflow-automation/service/workflow-automation.service.js +111 -2
  93. package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
  94. package/dist/module/workflow-automation/workflow-automation.module.js +14 -1
  95. package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
  96. package/dist/module/workflow-schedule/constants/schedule.constants.d.ts +27 -0
  97. package/dist/module/workflow-schedule/constants/schedule.constants.js +31 -0
  98. package/dist/module/workflow-schedule/constants/schedule.constants.js.map +1 -0
  99. package/dist/module/workflow-schedule/controller/workflow-schedule.controller.d.ts +83 -0
  100. package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js +220 -0
  101. package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js.map +1 -0
  102. package/dist/module/workflow-schedule/dto/create-schedule.dto.d.ts +32 -0
  103. package/dist/module/workflow-schedule/dto/create-schedule.dto.js +163 -0
  104. package/dist/module/workflow-schedule/dto/create-schedule.dto.js.map +1 -0
  105. package/dist/module/workflow-schedule/dto/get-execution-logs.dto.d.ts +35 -0
  106. package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js +124 -0
  107. package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js.map +1 -0
  108. package/dist/module/workflow-schedule/dto/update-schedule.dto.d.ts +19 -0
  109. package/dist/module/workflow-schedule/dto/update-schedule.dto.js +106 -0
  110. package/dist/module/workflow-schedule/dto/update-schedule.dto.js.map +1 -0
  111. package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.d.ts +30 -0
  112. package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js +113 -0
  113. package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js.map +1 -0
  114. package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.d.ts +34 -0
  115. package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js +118 -0
  116. package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js.map +1 -0
  117. package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.d.ts +44 -0
  118. package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js +3 -0
  119. package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js.map +1 -0
  120. package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.d.ts +3 -0
  121. package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js +3 -0
  122. package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js.map +1 -0
  123. package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +31 -0
  124. package/dist/module/workflow-schedule/processors/schedule.processor.js +409 -0
  125. package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -0
  126. package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +44 -0
  127. package/dist/module/workflow-schedule/service/workflow-schedule.service.js +434 -0
  128. package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -0
  129. package/dist/module/workflow-schedule/workflow-schedule.module.d.ts +5 -0
  130. package/dist/module/workflow-schedule/workflow-schedule.module.js +52 -0
  131. package/dist/module/workflow-schedule/workflow-schedule.module.js.map +1 -0
  132. package/dist/table.config.d.ts +1 -1
  133. package/dist/tsconfig.build.tsbuildinfo +1 -1
  134. package/dist/utils/service/loggingUtil.service.d.ts +9 -2
  135. package/dist/utils/service/loggingUtil.service.js +65 -14
  136. package/dist/utils/service/loggingUtil.service.js.map +1 -1
  137. package/dist/utils/utils.module.js +2 -0
  138. package/dist/utils/utils.module.js.map +1 -1
  139. package/package.json +9 -4
  140. package/src/app.module.ts +16 -2
  141. package/src/config/bull.config.ts +69 -0
  142. package/src/config/database.config.ts +1 -1
  143. package/src/module/entity_json/controller/entity_json.controller.ts +47 -0
  144. package/src/module/entity_json/entity_json.module.ts +13 -0
  145. package/src/module/entity_json/service/entity_json.service.ts +162 -0
  146. package/src/module/filter/service/filter.service.ts +0 -2
  147. package/src/module/integration/service/wrapper.service.ts +248 -41
  148. package/src/module/linked_attributes/controller/linked_attributes.controller.ts +10 -0
  149. package/src/module/linked_attributes/entity/linked_attribute.entity.ts +48 -0
  150. package/src/module/linked_attributes/linked_attributes.module.ts +16 -0
  151. package/src/module/linked_attributes/repository/linked_attribute.repository.ts +12 -0
  152. package/src/module/linked_attributes/service/linked_attributes.service.ts +22 -0
  153. package/src/module/mapper/service/field-mapper.service.ts +12 -7
  154. package/src/module/meta/controller/attribute-master.controller.ts +20 -0
  155. package/src/module/meta/controller/entity-master.controller.ts +13 -0
  156. package/src/module/meta/entity.module.ts +8 -0
  157. package/src/module/meta/repository/attribute-master.repository.ts +20 -0
  158. package/src/module/meta/repository/entity-attribute-update.repository.ts +44 -0
  159. package/src/module/meta/repository/entity-master.repository.ts +30 -0
  160. package/src/module/meta/service/attribute-master.service.ts +4 -0
  161. package/src/module/meta/service/entity-attribute-update.service.ts +29 -0
  162. package/src/module/meta/service/entity-master.service.ts +6 -0
  163. package/src/module/meta/service/resolver.service.ts +2 -2
  164. package/src/module/module/service/module-access.service.ts +3 -16
  165. package/src/module/workflow/entity/action.entity.ts +3 -0
  166. package/src/module/workflow/repository/action-data.repository.ts +1 -0
  167. package/src/module/workflow/repository/task.repository.ts +8 -0
  168. package/src/module/workflow/service/task.service.ts +47 -38
  169. package/src/module/workflow/service/workflow-meta.service.ts +47 -33
  170. package/src/module/workflow-automation/SCHEDULING_GUIDE.md +145 -0
  171. package/src/module/workflow-automation/controller/workflow-automation.controller.ts +22 -0
  172. package/src/module/workflow-automation/entity/workflow-automation.entity.ts +5 -0
  173. package/src/module/workflow-automation/service/schedule-handler.service.ts +149 -0
  174. package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +1 -1
  175. package/src/module/workflow-automation/service/workflow-automation.service.ts +163 -2
  176. package/src/module/workflow-automation/workflow-automation.module.ts +14 -1
  177. package/src/module/workflow-schedule/INSTALLATION.md +244 -0
  178. package/src/module/workflow-schedule/MULTI_PROJECT_GUIDE.md +196 -0
  179. package/src/module/workflow-schedule/README.md +422 -0
  180. package/src/module/workflow-schedule/constants/schedule.constants.ts +48 -0
  181. package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +255 -0
  182. package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +510 -0
  183. package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +362 -0
  184. package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +68 -0
  185. package/src/module/workflow-schedule/dto/create-schedule.dto.ts +147 -0
  186. package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +119 -0
  187. package/src/module/workflow-schedule/dto/update-schedule.dto.ts +96 -0
  188. package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +148 -0
  189. package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +154 -0
  190. package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +53 -0
  191. package/src/module/workflow-schedule/interfaces/workflow-schedule-options.interface.ts +12 -0
  192. package/src/module/workflow-schedule/processors/schedule.processor.ts +584 -0
  193. package/src/module/workflow-schedule/service/workflow-schedule.service.ts +600 -0
  194. package/src/module/workflow-schedule/workflow-schedule.module.ts +67 -0
  195. package/src/resources/dev.properties.yaml +1 -1
  196. package/src/utils/service/loggingUtil.service.ts +70 -16
  197. package/src/utils/utils.module.ts +2 -0
@@ -1,4 +1,11 @@
1
+ import { ConfigService } from '@nestjs/config';
1
2
  export declare class LoggingService {
2
- constructor();
3
- log(level: string, serviceName: string, methodName: string, message: string, parameters?: unknown[], debuginfo?: unknown[]): Promise<void>;
3
+ private readonly configService;
4
+ private readonly logger;
5
+ private readonly graylogUrl;
6
+ private readonly environment;
7
+ constructor(configService: ConfigService);
8
+ log(level: string, serviceName: string, methodName: string, message: string, parameters?: unknown[], debugInfo?: unknown[]): Promise<void>;
9
+ private sendToGraylog;
10
+ private mapLogLevel;
4
11
  }
@@ -8,29 +8,80 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var LoggingService_1;
11
12
  Object.defineProperty(exports, "__esModule", { value: true });
12
13
  exports.LoggingService = void 0;
13
14
  const common_1 = require("@nestjs/common");
14
- let LoggingService = class LoggingService {
15
- constructor() { }
16
- async log(level, serviceName, methodName, message, parameters, debuginfo) {
17
- const levelInfo = level.toLowerCase().trim();
18
- const logger = new common_1.Logger(serviceName);
19
- const logMessage = `${methodName} : ${message} : Parameters :${JSON.stringify(parameters)}: Debug Info: ${JSON.stringify(debuginfo)}`;
20
- if (levelInfo === 'debug' || levelInfo === 'info') {
21
- logger.debug(logMessage);
15
+ const config_1 = require("@nestjs/config");
16
+ const axios_1 = require("axios");
17
+ let LoggingService = LoggingService_1 = class LoggingService {
18
+ constructor(configService) {
19
+ this.configService = configService;
20
+ this.logger = new common_1.Logger(LoggingService_1.name);
21
+ this.graylogUrl =
22
+ this.configService.get('GRAYLOG_URL') ||
23
+ 'http://localhost:12201/gelf';
24
+ this.environment = this.configService.get('PROFILE') || 'dev';
25
+ }
26
+ async log(level, serviceName, methodName, message, parameters, debugInfo) {
27
+ const logLevel = level.toLowerCase().trim();
28
+ const logMessage = `${serviceName}.${methodName}: ${message} | Params: ${JSON.stringify(parameters)} | Debug: ${JSON.stringify(debugInfo)}`;
29
+ switch (logLevel) {
30
+ case 'debug':
31
+ case 'info':
32
+ this.logger.debug(logMessage);
33
+ break;
34
+ case 'warn':
35
+ this.logger.warn(logMessage);
36
+ break;
37
+ case 'error':
38
+ this.logger.error(logMessage);
39
+ break;
40
+ default:
41
+ this.logger.log(logMessage);
22
42
  }
23
- else if (levelInfo === 'error') {
24
- logger.error(logMessage);
43
+ this.sendToGraylog({
44
+ version: '1.1',
45
+ host: serviceName || 'nestjs-app',
46
+ short_message: message,
47
+ full_message: logMessage,
48
+ level: this.mapLogLevel(logLevel),
49
+ _service: serviceName,
50
+ _method: methodName,
51
+ _parameters: parameters,
52
+ _debug: debugInfo,
53
+ _environment: this.environment,
54
+ timestamp: Date.now() / 1000,
55
+ });
56
+ }
57
+ async sendToGraylog(payload) {
58
+ try {
59
+ await axios_1.default.post(this.graylogUrl, payload, {
60
+ headers: { 'Content-Type': 'application/json' },
61
+ timeout: 2000,
62
+ });
25
63
  }
26
- else {
27
- logger.log(logMessage);
64
+ catch (err) {
65
+ this.logger.warn(`Graylog send failed: ${err.message}`);
28
66
  }
29
67
  }
68
+ mapLogLevel(level) {
69
+ const mapping = {
70
+ emerg: 0,
71
+ alert: 1,
72
+ crit: 2,
73
+ error: 3,
74
+ warn: 4,
75
+ notice: 5,
76
+ info: 6,
77
+ debug: 7,
78
+ };
79
+ return mapping[level] ?? 6;
80
+ }
30
81
  };
31
82
  exports.LoggingService = LoggingService;
32
- exports.LoggingService = LoggingService = __decorate([
83
+ exports.LoggingService = LoggingService = LoggingService_1 = __decorate([
33
84
  (0, common_1.Injectable)(),
34
- __metadata("design:paramtypes", [])
85
+ __metadata("design:paramtypes", [config_1.ConfigService])
35
86
  ], LoggingService);
36
87
  //# sourceMappingURL=loggingUtil.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loggingUtil.service.js","sourceRoot":"","sources":["../../../src/utils/service/loggingUtil.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AAG7C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,gBAAe,CAAC;IAEhB,KAAK,CAAC,GAAG,CACP,KAAa,EACb,WAAmB,EACnB,UAAkB,EAClB,OAAe,EACf,UAAsB,EACtB,SAAqB;QAErB,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,WAAW,CAAC,CAAC;QAGvC,MAAM,UAAU,GAAG,GAAG,UAAU,MAAM,OAAO,kBAAkB,IAAI,CAAC,SAAS,CAC3E,UAAU,CACX,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE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KAAa;QAE/B,MAAM,OAAO,GAA2B;YACtC,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;SACT,CAAC;QACF,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAlFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAMiC,sBAAa;GAL9C,cAAc,CAkF1B"}
@@ -13,12 +13,14 @@ const reflection_helper_service_1 = require("./service/reflection-helper.service
13
13
  const excelUtil_service_1 = require("./service/excelUtil.service");
14
14
  const clockIDGenUtil_service_1 = require("./service/clockIDGenUtil.service");
15
15
  const wbsCodeGen_service_1 = require("./service/wbsCodeGen.service");
16
+ const config_1 = require("@nestjs/config");
16
17
  let UtilsModule = class UtilsModule {
17
18
  };
18
19
  exports.UtilsModule = UtilsModule;
19
20
  exports.UtilsModule = UtilsModule = __decorate([
20
21
  (0, common_1.Global)(),
21
22
  (0, common_1.Module)({
23
+ imports: [config_1.ConfigModule],
22
24
  providers: [
23
25
  loggingUtil_service_1.LoggingService,
24
26
  reflection_helper_service_1.ReflectionHelper,
@@ -1 +1 @@
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;AACrE,qEAAiE;AAmB1D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAjBvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,oCAAc;YACd,4CAAgB;YAChB,6BAAS;YACT,0CAAiB;YACjB,sCAAiB;SAClB;QACD,OAAO,EAAE;YACP,oCAAc;YACd,4CAAgB;YAChB,6BAAS;YACT,0CAAiB;YACjB,sCAAiB;SAClB;KACF,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;AACrE,qEAAiE;AACjE,2CAA8C;AAoBvC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAlBvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAY,CAAC;QACvB,SAAS,EAAE;YACT,oCAAc;YACd,4CAAgB;YAChB,6BAAS;YACT,0CAAiB;YACjB,sCAAiB;SAClB;QACD,OAAO,EAAE;YACP,oCAAc;YACd,4CAAgB;YAChB,6BAAS;YACT,0CAAiB;YACjB,sCAAiB;SAClB;KACF,CAAC;GACW,WAAW,CAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.184",
3
+ "version": "4.0.187",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -25,9 +25,10 @@
25
25
  "@microsoft/microsoft-graph-client": "^3.0.7",
26
26
  "@nestjs-modules/mailer": "^2.0.2",
27
27
  "@nestjs/axios": "^4.0.0",
28
- "@nestjs/common": "^11.0.1",
29
- "@nestjs/config": "^4.0.1",
30
- "@nestjs/core": "^11.0.1",
28
+ "@nestjs/bull": "^11.0.4",
29
+ "@nestjs/common": "^11.1.0",
30
+ "@nestjs/config": "^4.0.0",
31
+ "@nestjs/core": "^11.1.0",
31
32
  "@nestjs/jwt": "^11.0.0",
32
33
  "@nestjs/microservices": "^11.1.8",
33
34
  "@nestjs/passport": "^11.0.5",
@@ -40,8 +41,10 @@
40
41
  "aws-sdk": "^2.1692.0",
41
42
  "axios": "^1.9.0",
42
43
  "bcrypt": "^5.1.1",
44
+ "bull": "^4.16.5",
43
45
  "class-transformer": "^0.5.1",
44
46
  "class-validator": "^0.14.1",
47
+ "cron-parser": "^5.4.0",
45
48
  "crypto": "^1.0.1",
46
49
  "crypto-js": "^4.2.0",
47
50
  "dotenv": "^16.4.7",
@@ -60,6 +63,7 @@
60
63
  "passport-jwt": "^4.0.1",
61
64
  "passport-local": "^1.0.0",
62
65
  "pg": "^8.16.3",
66
+ "redis": "^4.7.1",
63
67
  "reflect-metadata": "^0.2.2",
64
68
  "rxjs": "^7.8.1",
65
69
  "twilio": "^5.9.0",
@@ -77,6 +81,7 @@
77
81
  "@nestjs/testing": "^11.0.1",
78
82
  "@swc/cli": "^0.6.0",
79
83
  "@swc/core": "^1.10.7",
84
+ "@types/bull": "^3.15.9",
80
85
  "@types/cron": "^2.0.1",
81
86
  "@types/express": "^5.0.0",
82
87
  "@types/jest": "^29.5.14",
package/src/app.module.ts CHANGED
@@ -20,7 +20,13 @@ import { IntegrationModule } from './module/integration/integration.module';
20
20
  import { ScheduleModule } from '@nestjs/schedule';
21
21
  import { AuthModule } from './module/auth/auth.module';
22
22
  import { MapperModule } from './module/mapper/mapper.module';
23
+ import { BullModule } from '@nestjs/bull';
24
+ import { bullConfigFactory } from './config/bull.config';
25
+ import { WorkflowScheduleModule } from './module/workflow-schedule/workflow-schedule.module';
23
26
  import { MicroserviceClientsModule } from './module/microservice-client/microservice-clients.module';
27
+ import { WorkflowAutomationModule } from './module/workflow-automation/workflow-automation.module';
28
+ import { LinkedAttributesModule } from './module/linked_attributes/linked_attributes.module';
29
+ import { EntityJSONModule } from './module/entity_json/entity_json.module';
24
30
 
25
31
  @Module({
26
32
  imports: [
@@ -45,8 +51,16 @@ import { MicroserviceClientsModule } from './module/microservice-client/microser
45
51
  AuthModule,
46
52
  MapperModule,
47
53
  ScheduleModule.forRoot(),
54
+ // Bull Queue Module for scheduled workflows
55
+ BullModule.forRootAsync(bullConfigFactory),
56
+ // Workflow Schedule Module - Provides scheduling capabilities
57
+ // Set is_workflow: true to run cron processor on this server
58
+ WorkflowScheduleModule.forRoot({ is_workflow: true }),
59
+ // Workflow Automation Module - For on-trigger and scheduled workflows
60
+ WorkflowAutomationModule,
48
61
  MicroserviceClientsModule,
62
+ LinkedAttributesModule,
63
+ EntityJSONModule,
49
64
  ],
50
65
  })
51
- export class AppModule {
52
- }
66
+ export class AppModule {}
@@ -0,0 +1,69 @@
1
+ import { BullModuleOptions, SharedBullConfigurationFactory } from '@nestjs/bull';
2
+ import { Injectable } from '@nestjs/common';
3
+ import { ConfigService } from '@nestjs/config';
4
+
5
+ /**
6
+ * Bull Queue Configuration
7
+ * Configures Redis connection and queue settings for Bull
8
+ */
9
+ @Injectable()
10
+ export class BullConfigService implements SharedBullConfigurationFactory {
11
+ constructor(private configService: ConfigService) {}
12
+
13
+ createSharedConfiguration(): BullModuleOptions {
14
+ return {
15
+ redis: {
16
+ host: this.configService.get<string>('REDIS_HOST', 'localhost'),
17
+ port: this.configService.get<number>('REDIS_PORT', 6379),
18
+ password: this.configService.get<string>('REDIS_PASSWORD'),
19
+ db: this.configService.get<number>('REDIS_DB', 0),
20
+ // Enable offline queue to handle Redis disconnections
21
+ enableOfflineQueue: true,
22
+ // Retry strategy for Redis connection
23
+ retryStrategy: (times: number) => {
24
+ const delay = Math.min(times * 50, 2000);
25
+ return delay;
26
+ },
27
+ // Connection timeout
28
+ connectTimeout: 10000,
29
+ // Keep alive settings
30
+ keepAlive: 30000,
31
+ },
32
+ // Default job options for all queues
33
+ defaultJobOptions: {
34
+ attempts: 3,
35
+ backoff: {
36
+ type: 'exponential',
37
+ delay: 5000,
38
+ },
39
+ removeOnComplete: {
40
+ age: 3600 * 24 * 7, // Keep completed jobs for 7 days
41
+ count: 1000, // Keep max 1000 completed jobs
42
+ },
43
+ removeOnFail: {
44
+ age: 3600 * 24 * 30, // Keep failed jobs for 30 days
45
+ },
46
+ },
47
+ // Queue settings
48
+ settings: {
49
+ // Stalled job checking interval
50
+ stalledInterval: 30000,
51
+ // Maximum stalled count before job is considered failed
52
+ maxStalledCount: 2,
53
+ // Lock duration for jobs
54
+ lockDuration: 300000, // 5 minutes
55
+ // Lock renew time
56
+ lockRenewTime: 150000, // 2.5 minutes
57
+ },
58
+ // Prefix for all queue keys in Redis
59
+ prefix: 'bull',
60
+ };
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Factory function for BullModule.forRootAsync()
66
+ */
67
+ export const bullConfigFactory = {
68
+ useClass: BullConfigService,
69
+ };
@@ -36,7 +36,7 @@ export class PostgresConfiguration implements TypeOrmOptionsFactory {
36
36
  database: this.configService.get('DB_NAME') || 'core',
37
37
  schema: this.configService.get('DB_SCHEMA') || 'package',
38
38
  entities: [__dirname + '/../module/**/*.entity.{ts,js}'],
39
- synchronize: false,
39
+ synchronize: true,
40
40
  autoLoadEntities: true,
41
41
  // Configure pg pool size via `extra.max` (pg uses node-postgres pool)
42
42
  extra: {
@@ -0,0 +1,47 @@
1
+ import {
2
+ Controller,
3
+ Get,
4
+ Param,
5
+ Post,
6
+ Query,
7
+ Req,
8
+ UseGuards,
9
+ } from '@nestjs/common';
10
+ import { EntityJSONService } from '../service/entity_json.service';
11
+ import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
12
+
13
+ @Controller('entity-json')
14
+ export class EntityJSONController {
15
+ constructor(private readonly entityJSONService: EntityJSONService) {}
16
+
17
+ @Get('/:entityType')
18
+ @UseGuards(JwtAuthGuard)
19
+ async getEntityJson(
20
+ @Param('entityType') entityType: string,
21
+ @Req() req: Request & { user: any },
22
+ @Query('mode') mode?: 'flat_json' | 'dropdown',
23
+ ) {
24
+ const loggedInUser = req.user?.userData;
25
+ return this.entityJSONService.getAttributeForFlatJSON(
26
+ entityType,
27
+ loggedInUser,
28
+ mode,
29
+ );
30
+ }
31
+
32
+ // @Post('/update-json/:entityId')
33
+ // @UseGuards(JwtAuthGuard)
34
+ // async updateEntityJson(
35
+ // @Param('entityId') entityId: string,
36
+ // @Query('entityType') entityType: string,
37
+ // @Req() req: Request & { user: any },
38
+ // ) {
39
+ // const loggedInUser = req.user?.userData;
40
+
41
+ // return this.entityJSONService.updateEntityJSON(
42
+ // entityType,
43
+ // Number(entityId),
44
+ // loggedInUser,
45
+ // );
46
+ // }
47
+ }
@@ -0,0 +1,13 @@
1
+ import { Module } from '@nestjs/common';
2
+ import { EntityModule } from '../meta/entity.module';
3
+ import { TypeOrmModule } from '@nestjs/typeorm';
4
+ import { EntityJSONService } from './service/entity_json.service';
5
+ import { EntityJSONController } from './controller/entity_json.controller';
6
+
7
+ @Module({
8
+ imports: [EntityModule, TypeOrmModule.forFeature([])],
9
+ controllers: [EntityJSONController],
10
+ providers: [EntityJSONService],
11
+ exports: [],
12
+ })
13
+ export class EntityJSONModule {}
@@ -0,0 +1,162 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { AttributeMaster } from 'src/module/meta/entity/attribute-master.entity';
3
+ import { EntityRelation } from 'src/module/meta/entity/entity-relation.entity';
4
+ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
5
+ import { DataSource } from 'typeorm';
6
+
7
+ @Injectable()
8
+ export class EntityJSONService extends EntityServiceImpl {
9
+ constructor(private readonly dataSource: DataSource) {
10
+ super();
11
+ }
12
+
13
+ async getAttributeForFlatJSON(
14
+ entityType: string,
15
+ loggedInUser: any,
16
+ flag?: 'flat_json' | 'dropdown',
17
+ ) {
18
+ const orgId = loggedInUser.organization_id;
19
+
20
+ // --------------------------------------------
21
+ // 1. Load Main Entity Attributes
22
+ // --------------------------------------------
23
+ const mainAttributes = await this.dataSource
24
+ .getRepository(AttributeMaster)
25
+ .createQueryBuilder('attr')
26
+ .select(['attr.id', 'attr.name', 'attr.attribute_key'])
27
+ .where('attr.mapped_entity_type = :entityType', { entityType })
28
+ .andWhere('attr.organization_id = :orgId', { orgId })
29
+ .getMany();
30
+
31
+ // --------------------------------------------
32
+ // 2. Load Related Entity Types Once
33
+ // --------------------------------------------
34
+ const relatedEntityTypes = await this.dataSource
35
+ .getRepository(EntityRelation)
36
+ .createQueryBuilder('rel')
37
+ .select(['rel.target_entity_type'])
38
+ .where('rel.source_entity_type = :entityType', { entityType })
39
+ .andWhere('rel.organization_id = :orgId', { orgId })
40
+ .andWhere('rel.relation_type = :relationType', {
41
+ relationType: 'ONE_TO_ONE',
42
+ })
43
+ .getRawMany();
44
+
45
+ const relatedTypesList = relatedEntityTypes.map(
46
+ (x) => x.rel_target_entity_type,
47
+ );
48
+
49
+ // --------------------------------------------
50
+ // 3. Fetch All Related Attributes
51
+ // --------------------------------------------
52
+ const relatedAttributes = relatedTypesList.length
53
+ ? await this.dataSource
54
+ .getRepository(AttributeMaster)
55
+ .createQueryBuilder('attr')
56
+ .select([
57
+ 'attr.id',
58
+ 'attr.name',
59
+ 'attr.attribute_key',
60
+ 'attr.mapped_entity_type',
61
+ ])
62
+ .where('attr.mapped_entity_type IN (:...types)', {
63
+ types: relatedTypesList,
64
+ })
65
+ .andWhere('attr.organization_id = :orgId', { orgId })
66
+ .getMany()
67
+ : [];
68
+
69
+ // --------------------------------------------
70
+ // 4. Fetch Linked Attributes
71
+ // --------------------------------------------
72
+ const linkedAttributes = await this.dataSource
73
+ .getRepository('frm_linked_attribute')
74
+ .createQueryBuilder('fla')
75
+ .innerJoin(
76
+ AttributeMaster,
77
+ 'attr',
78
+ 'fla.applicable_entity_type = attr.mapped_entity_type AND fla.applicable_attribute_key = attr.attribute_key',
79
+ )
80
+ .select([
81
+ 'fla.applicable_entity_type',
82
+ 'attr.id',
83
+ 'attr.name',
84
+ 'attr.attribute_key',
85
+ ])
86
+ .where('attr.organization_id = :orgId', { orgId })
87
+ .getRawMany();
88
+
89
+ // ------------------------------------------------------------------
90
+ // --------------- RETURN FORMAT BASED ON FLAG ------------------
91
+ // ------------------------------------------------------------------
92
+
93
+ // ============================================================
94
+ // MODE 1: flat_json -> return objects grouped by entity_type
95
+ // ============================================================
96
+
97
+ if (flag === 'flat_json') {
98
+ const result: Record<string, null> = {};
99
+
100
+ // MAIN ENTITY ATTRIBUTES
101
+ mainAttributes.forEach((attr) => {
102
+ if (attr.attribute_key) {
103
+ result[attr.attribute_key] = null;
104
+ }
105
+ });
106
+
107
+ // RELATED ENTITY TYPES
108
+ for (const type of relatedTypesList) {
109
+ const attrs = relatedAttributes.filter(
110
+ (a) => a.mapped_entity_type === type,
111
+ );
112
+
113
+ attrs.forEach((attr) => {
114
+ if (attr.attribute_key) {
115
+ result[attr.attribute_key] = null;
116
+ }
117
+ });
118
+ }
119
+
120
+ // LINKED ATTRIBUTES
121
+ linkedAttributes.forEach((link) => {
122
+ if (link.applicable_attribute_key) {
123
+ result[link.applicable_attribute_key] = null;
124
+ }
125
+ });
126
+
127
+ return result;
128
+ }
129
+
130
+ // ============================================================
131
+ // MODE 2: dropdown -> return label/value format
132
+ // ============================================================
133
+
134
+ const dropdown: any[] = [];
135
+
136
+ // main entity
137
+ dropdown.push(
138
+ ...mainAttributes.map((a) => ({
139
+ label: a.name,
140
+ value: a.attribute_key,
141
+ })),
142
+ );
143
+
144
+ // related entities
145
+ dropdown.push(
146
+ ...relatedAttributes.map((a) => ({
147
+ label: a.name,
148
+ value: a.attribute_key,
149
+ })),
150
+ );
151
+
152
+ // linked attributes
153
+ dropdown.push({
154
+ linked_attributes: linkedAttributes.map((a) => ({
155
+ label: a.attr_name,
156
+ value: a.attr_attribute_key,
157
+ })),
158
+ });
159
+
160
+ return dropdown;
161
+ }
162
+ }
@@ -1,8 +1,6 @@
1
1
  import { BadRequestException, Inject, Injectable } from '@nestjs/common';
2
2
  import { AttributeMasterService } from 'src/module/meta/service/attribute-master.service';
3
3
  import { EntityMasterService } from 'src/module/meta/service/entity-master.service';
4
- import { EntityTableColumnService } from 'src/module/meta/service/entity-table-column.service';
5
- import { EntityTableService } from 'src/module/meta/service/entity-table.service';
6
4
  import { DataSource } from 'typeorm';
7
5
  import { FilterCondition, FilterRequestDto } from '../dto/filter-request.dto';
8
6
  import { SavedFilterService } from './saved-filter.service';