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.
- package/dist/app.module.js +11 -0
- package/dist/app.module.js.map +1 -1
- package/dist/config/bull.config.d.ts +10 -0
- package/dist/config/bull.config.js +66 -0
- package/dist/config/bull.config.js.map +1 -0
- package/dist/config/database.config.js +1 -1
- package/dist/config/database.config.js.map +1 -1
- package/dist/module/entity_json/controller/entity_json.controller.d.ts +8 -0
- package/dist/module/entity_json/controller/entity_json.controller.js +43 -0
- package/dist/module/entity_json/controller/entity_json.controller.js.map +1 -0
- package/dist/module/entity_json/entity_json.module.d.ts +2 -0
- package/dist/module/entity_json/entity_json.module.js +26 -0
- package/dist/module/entity_json/entity_json.module.js.map +1 -0
- package/dist/module/entity_json/service/entity_json.service.d.ts +7 -0
- package/dist/module/entity_json/service/entity_json.service.js +116 -0
- package/dist/module/entity_json/service/entity_json.service.js.map +1 -0
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/integration/service/wrapper.service.d.ts +3 -1
- package/dist/module/integration/service/wrapper.service.js +39 -36
- package/dist/module/integration/service/wrapper.service.js.map +1 -1
- package/dist/module/linked_attributes/controller/linked_attributes.controller.d.ts +5 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js +29 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js.map +1 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.d.ts +9 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js +70 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js.map +1 -0
- package/dist/module/linked_attributes/linked_attributes.module.d.ts +2 -0
- package/dist/module/linked_attributes/linked_attributes.module.js +29 -0
- package/dist/module/linked_attributes/linked_attributes.module.js.map +1 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.d.ts +6 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js +31 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js.map +1 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +5 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js +34 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js.map +1 -0
- package/dist/module/mapper/service/field-mapper.service.js +2 -2
- package/dist/module/mapper/service/field-mapper.service.js.map +1 -1
- package/dist/module/meta/controller/attribute-master.controller.d.ts +10 -1
- package/dist/module/meta/controller/attribute-master.controller.js +27 -2
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/controller/entity-master.controller.d.ts +6 -0
- package/dist/module/meta/controller/entity-master.controller.js +13 -0
- package/dist/module/meta/controller/entity-master.controller.js.map +1 -1
- package/dist/module/meta/entity.module.js +7 -0
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/attribute-master.repository.d.ts +4 -0
- package/dist/module/meta/repository/attribute-master.repository.js +19 -0
- package/dist/module/meta/repository/attribute-master.repository.js.map +1 -1
- package/dist/module/meta/repository/entity-attribute-update.repository.d.ts +6 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js +44 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-master.repository.d.ts +7 -1
- package/dist/module/meta/repository/entity-master.repository.js +24 -2
- package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
- package/dist/module/meta/service/attribute-master.service.d.ts +4 -0
- package/dist/module/meta/service/attribute-master.service.js +3 -0
- package/dist/module/meta/service/attribute-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-attribute-update.service.d.ts +7 -0
- package/dist/module/meta/service/entity-attribute-update.service.js +35 -0
- package/dist/module/meta/service/entity-attribute-update.service.js.map +1 -0
- package/dist/module/meta/service/entity-master.service.d.ts +4 -0
- package/dist/module/meta/service/entity-master.service.js +3 -0
- package/dist/module/meta/service/entity-master.service.js.map +1 -1
- package/dist/module/meta/service/resolver.service.js +2 -2
- package/dist/module/meta/service/resolver.service.js.map +1 -1
- package/dist/module/module/service/module-access.service.js +1 -7
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/workflow/entity/action.entity.d.ts +1 -0
- package/dist/module/workflow/entity/action.entity.js +4 -0
- package/dist/module/workflow/entity/action.entity.js.map +1 -1
- package/dist/module/workflow/repository/action-data.repository.js +1 -0
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.d.ts +3 -1
- package/dist/module/workflow/repository/task.repository.js +6 -1
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +41 -27
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js +23 -21
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/module/workflow-automation/controller/workflow-automation.controller.d.ts +6 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js +16 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js.map +1 -1
- package/dist/module/workflow-automation/entity/workflow-automation.entity.d.ts +2 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js +8 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -1
- package/dist/module/workflow-automation/service/schedule-handler.service.d.ts +16 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js +109 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js.map +1 -0
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.d.ts +1 -1
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +13 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.js +111 -2
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/module/workflow-automation/workflow-automation.module.js +14 -1
- package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -1
- package/dist/module/workflow-schedule/constants/schedule.constants.d.ts +27 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js +31 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js.map +1 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.d.ts +83 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js +220 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js.map +1 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.d.ts +32 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js +163 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.d.ts +35 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js +124 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.d.ts +19 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js +106 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.d.ts +30 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js +113 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js.map +1 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.d.ts +34 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js +118 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js.map +1 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.d.ts +44 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js +3 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js.map +1 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.d.ts +3 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js +3 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js.map +1 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +31 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js +409 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +44 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js +434 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.d.ts +5 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js +52 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js.map +1 -0
- package/dist/table.config.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/loggingUtil.service.d.ts +9 -2
- package/dist/utils/service/loggingUtil.service.js +65 -14
- package/dist/utils/service/loggingUtil.service.js.map +1 -1
- package/dist/utils/utils.module.js +2 -0
- package/dist/utils/utils.module.js.map +1 -1
- package/package.json +9 -4
- package/src/app.module.ts +16 -2
- package/src/config/bull.config.ts +69 -0
- package/src/config/database.config.ts +1 -1
- package/src/module/entity_json/controller/entity_json.controller.ts +47 -0
- package/src/module/entity_json/entity_json.module.ts +13 -0
- package/src/module/entity_json/service/entity_json.service.ts +162 -0
- package/src/module/filter/service/filter.service.ts +0 -2
- package/src/module/integration/service/wrapper.service.ts +248 -41
- package/src/module/linked_attributes/controller/linked_attributes.controller.ts +10 -0
- package/src/module/linked_attributes/entity/linked_attribute.entity.ts +48 -0
- package/src/module/linked_attributes/linked_attributes.module.ts +16 -0
- package/src/module/linked_attributes/repository/linked_attribute.repository.ts +12 -0
- package/src/module/linked_attributes/service/linked_attributes.service.ts +22 -0
- package/src/module/mapper/service/field-mapper.service.ts +12 -7
- package/src/module/meta/controller/attribute-master.controller.ts +20 -0
- package/src/module/meta/controller/entity-master.controller.ts +13 -0
- package/src/module/meta/entity.module.ts +8 -0
- package/src/module/meta/repository/attribute-master.repository.ts +20 -0
- package/src/module/meta/repository/entity-attribute-update.repository.ts +44 -0
- package/src/module/meta/repository/entity-master.repository.ts +30 -0
- package/src/module/meta/service/attribute-master.service.ts +4 -0
- package/src/module/meta/service/entity-attribute-update.service.ts +29 -0
- package/src/module/meta/service/entity-master.service.ts +6 -0
- package/src/module/meta/service/resolver.service.ts +2 -2
- package/src/module/module/service/module-access.service.ts +3 -16
- package/src/module/workflow/entity/action.entity.ts +3 -0
- package/src/module/workflow/repository/action-data.repository.ts +1 -0
- package/src/module/workflow/repository/task.repository.ts +8 -0
- package/src/module/workflow/service/task.service.ts +47 -38
- package/src/module/workflow/service/workflow-meta.service.ts +47 -33
- package/src/module/workflow-automation/SCHEDULING_GUIDE.md +145 -0
- package/src/module/workflow-automation/controller/workflow-automation.controller.ts +22 -0
- package/src/module/workflow-automation/entity/workflow-automation.entity.ts +5 -0
- package/src/module/workflow-automation/service/schedule-handler.service.ts +149 -0
- package/src/module/workflow-automation/service/workflow-automation-engine.service.ts +1 -1
- package/src/module/workflow-automation/service/workflow-automation.service.ts +163 -2
- package/src/module/workflow-automation/workflow-automation.module.ts +14 -1
- package/src/module/workflow-schedule/INSTALLATION.md +244 -0
- package/src/module/workflow-schedule/MULTI_PROJECT_GUIDE.md +196 -0
- package/src/module/workflow-schedule/README.md +422 -0
- package/src/module/workflow-schedule/constants/schedule.constants.ts +48 -0
- package/src/module/workflow-schedule/controller/workflow-schedule.controller.ts +255 -0
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_GUIDE.md +510 -0
- package/src/module/workflow-schedule/docs/CLAUDE_CODE_PROMPT.md +362 -0
- package/src/module/workflow-schedule/docs/RUN_CLAUDE_CODE.sh +68 -0
- package/src/module/workflow-schedule/dto/create-schedule.dto.ts +147 -0
- package/src/module/workflow-schedule/dto/get-execution-logs.dto.ts +119 -0
- package/src/module/workflow-schedule/dto/update-schedule.dto.ts +96 -0
- package/src/module/workflow-schedule/entities/scheduled-workflow.entity.ts +148 -0
- package/src/module/workflow-schedule/entities/workflow-execution-log.entity.ts +154 -0
- package/src/module/workflow-schedule/interfaces/schedule-job-data.interface.ts +53 -0
- package/src/module/workflow-schedule/interfaces/workflow-schedule-options.interface.ts +12 -0
- package/src/module/workflow-schedule/processors/schedule.processor.ts +584 -0
- package/src/module/workflow-schedule/service/workflow-schedule.service.ts +600 -0
- package/src/module/workflow-schedule/workflow-schedule.module.ts +67 -0
- package/src/resources/dev.properties.yaml +1 -1
- package/src/utils/service/loggingUtil.service.ts +70 -16
- package/src/utils/utils.module.ts +2 -0
|
@@ -0,0 +1,434 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var WorkflowScheduleService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.WorkflowScheduleService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const bull_1 = require("@nestjs/bull");
|
|
21
|
+
const cronParser = require("cron-parser");
|
|
22
|
+
const scheduled_workflow_entity_1 = require("../entities/scheduled-workflow.entity");
|
|
23
|
+
const workflow_execution_log_entity_1 = require("../entities/workflow-execution-log.entity");
|
|
24
|
+
const schedule_constants_1 = require("../constants/schedule.constants");
|
|
25
|
+
let WorkflowScheduleService = WorkflowScheduleService_1 = class WorkflowScheduleService {
|
|
26
|
+
constructor(scheduledWorkflowRepository, executionLogRepository, scheduleQueue, dataSource) {
|
|
27
|
+
this.scheduledWorkflowRepository = scheduledWorkflowRepository;
|
|
28
|
+
this.executionLogRepository = executionLogRepository;
|
|
29
|
+
this.scheduleQueue = scheduleQueue;
|
|
30
|
+
this.dataSource = dataSource;
|
|
31
|
+
this.logger = new common_1.Logger(WorkflowScheduleService_1.name);
|
|
32
|
+
}
|
|
33
|
+
async createSchedule(createScheduleDto, loggedInUser) {
|
|
34
|
+
this.logger.log(`Creating schedule for workflow ${createScheduleDto.workflow_id} by user ${loggedInUser.id}`);
|
|
35
|
+
try {
|
|
36
|
+
this.validateCronExpression(createScheduleDto.cron_expression, createScheduleDto.timezone);
|
|
37
|
+
const nextExecutionAt = this.calculateNextExecution(createScheduleDto.cron_expression, createScheduleDto.timezone || schedule_constants_1.DEFAULT_TIMEZONE);
|
|
38
|
+
const schedule = this.scheduledWorkflowRepository.create({
|
|
39
|
+
workflow_id: createScheduleDto.workflow_id,
|
|
40
|
+
workflow_name: createScheduleDto.workflow_name,
|
|
41
|
+
name: createScheduleDto.name,
|
|
42
|
+
description: createScheduleDto.description,
|
|
43
|
+
cron_expression: createScheduleDto.cron_expression,
|
|
44
|
+
timezone: createScheduleDto.timezone || schedule_constants_1.DEFAULT_TIMEZONE,
|
|
45
|
+
start_date: createScheduleDto.start_date ? new Date(createScheduleDto.start_date) : null,
|
|
46
|
+
end_date: createScheduleDto.end_date ? new Date(createScheduleDto.end_date) : null,
|
|
47
|
+
max_executions: createScheduleDto.max_executions,
|
|
48
|
+
execution_count: 0,
|
|
49
|
+
next_execution_at: nextExecutionAt,
|
|
50
|
+
schedule_status: schedule_constants_1.SCHEDULE_STATUS_ACTIVE,
|
|
51
|
+
retry_config: createScheduleDto.retry_config || {
|
|
52
|
+
maxRetries: schedule_constants_1.DEFAULT_MAX_RETRIES,
|
|
53
|
+
retryDelay: schedule_constants_1.DEFAULT_RETRY_DELAY,
|
|
54
|
+
backoffMultiplier: schedule_constants_1.DEFAULT_BACKOFF_MULTIPLIER,
|
|
55
|
+
},
|
|
56
|
+
metadata: createScheduleDto.metadata || {},
|
|
57
|
+
is_enabled: createScheduleDto.is_enabled !== false,
|
|
58
|
+
organization_id: createScheduleDto.organization_id || loggedInUser.organization_id,
|
|
59
|
+
enterprise_id: createScheduleDto.enterprise_id || loggedInUser.enterprise_id,
|
|
60
|
+
level_id: createScheduleDto.level_id || loggedInUser.level_id,
|
|
61
|
+
level_type: createScheduleDto.level_type || loggedInUser.level_type,
|
|
62
|
+
appcode: createScheduleDto.appcode || loggedInUser.appcode,
|
|
63
|
+
created_by: loggedInUser.id,
|
|
64
|
+
created_date: new Date(),
|
|
65
|
+
status: createScheduleDto.status || 'ACTIVE',
|
|
66
|
+
entity_type: 'WFSC',
|
|
67
|
+
});
|
|
68
|
+
const savedSchedule = await this.scheduledWorkflowRepository.save(schedule);
|
|
69
|
+
if (savedSchedule.is_enabled && savedSchedule.schedule_status === schedule_constants_1.SCHEDULE_STATUS_ACTIVE) {
|
|
70
|
+
await this.scheduleJob(savedSchedule, loggedInUser);
|
|
71
|
+
}
|
|
72
|
+
this.logger.log(`Schedule created successfully with ID: ${savedSchedule.id}`);
|
|
73
|
+
return savedSchedule;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
this.logger.error(`Failed to create schedule: ${error.message}`, error.stack);
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async updateSchedule(updateScheduleDto, loggedInUser) {
|
|
81
|
+
this.logger.log(`Updating schedule ${updateScheduleDto.id} by user ${loggedInUser.id}`);
|
|
82
|
+
try {
|
|
83
|
+
const schedule = await this.scheduledWorkflowRepository.findOne({
|
|
84
|
+
where: { id: updateScheduleDto.id },
|
|
85
|
+
});
|
|
86
|
+
if (!schedule) {
|
|
87
|
+
throw new common_1.NotFoundException(`Scheduled workflow not found with ID: ${updateScheduleDto.id}`);
|
|
88
|
+
}
|
|
89
|
+
if (updateScheduleDto.cron_expression) {
|
|
90
|
+
this.validateCronExpression(updateScheduleDto.cron_expression, updateScheduleDto.timezone || schedule.timezone);
|
|
91
|
+
}
|
|
92
|
+
if (updateScheduleDto.workflow_id !== undefined) {
|
|
93
|
+
schedule.workflow_id = updateScheduleDto.workflow_id;
|
|
94
|
+
}
|
|
95
|
+
if (updateScheduleDto.workflow_name !== undefined) {
|
|
96
|
+
schedule.workflow_name = updateScheduleDto.workflow_name;
|
|
97
|
+
}
|
|
98
|
+
if (updateScheduleDto.name !== undefined) {
|
|
99
|
+
schedule.name = updateScheduleDto.name;
|
|
100
|
+
}
|
|
101
|
+
if (updateScheduleDto.description !== undefined) {
|
|
102
|
+
schedule.description = updateScheduleDto.description;
|
|
103
|
+
}
|
|
104
|
+
if (updateScheduleDto.cron_expression !== undefined) {
|
|
105
|
+
schedule.cron_expression = updateScheduleDto.cron_expression;
|
|
106
|
+
schedule.next_execution_at = this.calculateNextExecution(updateScheduleDto.cron_expression, updateScheduleDto.timezone || schedule.timezone);
|
|
107
|
+
}
|
|
108
|
+
if (updateScheduleDto.timezone !== undefined) {
|
|
109
|
+
schedule.timezone = updateScheduleDto.timezone;
|
|
110
|
+
}
|
|
111
|
+
if (updateScheduleDto.start_date !== undefined) {
|
|
112
|
+
schedule.start_date = updateScheduleDto.start_date
|
|
113
|
+
? new Date(updateScheduleDto.start_date)
|
|
114
|
+
: null;
|
|
115
|
+
}
|
|
116
|
+
if (updateScheduleDto.end_date !== undefined) {
|
|
117
|
+
schedule.end_date = updateScheduleDto.end_date ? new Date(updateScheduleDto.end_date) : null;
|
|
118
|
+
}
|
|
119
|
+
if (updateScheduleDto.max_executions !== undefined) {
|
|
120
|
+
schedule.max_executions = updateScheduleDto.max_executions;
|
|
121
|
+
}
|
|
122
|
+
if (updateScheduleDto.schedule_status !== undefined) {
|
|
123
|
+
schedule.schedule_status = updateScheduleDto.schedule_status;
|
|
124
|
+
}
|
|
125
|
+
if (updateScheduleDto.retry_config !== undefined) {
|
|
126
|
+
schedule.retry_config = updateScheduleDto.retry_config;
|
|
127
|
+
}
|
|
128
|
+
if (updateScheduleDto.actions !== undefined) {
|
|
129
|
+
schedule.actions = updateScheduleDto.actions;
|
|
130
|
+
}
|
|
131
|
+
if (updateScheduleDto.metadata !== undefined) {
|
|
132
|
+
schedule.metadata = updateScheduleDto.metadata;
|
|
133
|
+
}
|
|
134
|
+
if (updateScheduleDto.is_enabled !== undefined) {
|
|
135
|
+
schedule.is_enabled = updateScheduleDto.is_enabled;
|
|
136
|
+
}
|
|
137
|
+
if (updateScheduleDto.status !== undefined) {
|
|
138
|
+
schedule.status = updateScheduleDto.status;
|
|
139
|
+
}
|
|
140
|
+
schedule.modified_by = loggedInUser.id;
|
|
141
|
+
schedule.modified_date = new Date();
|
|
142
|
+
const updatedSchedule = await this.scheduledWorkflowRepository.save(schedule);
|
|
143
|
+
if (schedule.job_id) {
|
|
144
|
+
await this.removeJob(schedule.job_id);
|
|
145
|
+
}
|
|
146
|
+
if (updatedSchedule.is_enabled && updatedSchedule.schedule_status === schedule_constants_1.SCHEDULE_STATUS_ACTIVE) {
|
|
147
|
+
await this.scheduleJob(updatedSchedule, loggedInUser);
|
|
148
|
+
}
|
|
149
|
+
this.logger.log(`Schedule updated successfully: ${updatedSchedule.id}`);
|
|
150
|
+
return updatedSchedule;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
this.logger.error(`Failed to update schedule: ${error.message}`, error.stack);
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async getScheduleById(scheduleId, loggedInUser) {
|
|
158
|
+
const schedule = await this.scheduledWorkflowRepository.findOne({
|
|
159
|
+
where: {
|
|
160
|
+
id: scheduleId,
|
|
161
|
+
organization_id: loggedInUser.organization_id,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
if (!schedule) {
|
|
165
|
+
throw new common_1.NotFoundException(`Scheduled workflow not found with ID: ${scheduleId}`);
|
|
166
|
+
}
|
|
167
|
+
return schedule;
|
|
168
|
+
}
|
|
169
|
+
async getAllSchedules(page = 1, size = 10, filters = {}, loggedInUser) {
|
|
170
|
+
const skip = (page - 1) * size;
|
|
171
|
+
const whereConditions = {
|
|
172
|
+
organization_id: loggedInUser.organization_id,
|
|
173
|
+
};
|
|
174
|
+
if (filters.workflow_id) {
|
|
175
|
+
whereConditions.workflow_id = filters.workflow_id;
|
|
176
|
+
}
|
|
177
|
+
if (filters.schedule_status) {
|
|
178
|
+
whereConditions.schedule_status = filters.schedule_status;
|
|
179
|
+
}
|
|
180
|
+
if (filters.is_enabled !== undefined) {
|
|
181
|
+
whereConditions.is_enabled = filters.is_enabled;
|
|
182
|
+
}
|
|
183
|
+
const [data, total] = await this.scheduledWorkflowRepository.findAndCount({
|
|
184
|
+
where: whereConditions,
|
|
185
|
+
skip,
|
|
186
|
+
take: size,
|
|
187
|
+
order: { created_date: 'DESC' },
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
data,
|
|
191
|
+
total,
|
|
192
|
+
page,
|
|
193
|
+
size,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async pauseSchedule(scheduleId, loggedInUser) {
|
|
197
|
+
this.logger.log(`Pausing schedule ${scheduleId} by user ${loggedInUser.id}`);
|
|
198
|
+
const schedule = await this.getScheduleById(scheduleId, loggedInUser);
|
|
199
|
+
if (schedule.schedule_status === schedule_constants_1.SCHEDULE_STATUS_PAUSED) {
|
|
200
|
+
throw new common_1.BadRequestException('Schedule is already paused');
|
|
201
|
+
}
|
|
202
|
+
schedule.schedule_status = schedule_constants_1.SCHEDULE_STATUS_PAUSED;
|
|
203
|
+
schedule.modified_by = loggedInUser.id;
|
|
204
|
+
schedule.modified_date = new Date();
|
|
205
|
+
const updatedSchedule = await this.scheduledWorkflowRepository.save(schedule);
|
|
206
|
+
if (schedule.job_id) {
|
|
207
|
+
await this.removeJob(schedule.job_id);
|
|
208
|
+
updatedSchedule.job_id = null;
|
|
209
|
+
await this.scheduledWorkflowRepository.save(updatedSchedule);
|
|
210
|
+
}
|
|
211
|
+
this.logger.log(`Schedule paused successfully: ${scheduleId}`);
|
|
212
|
+
return updatedSchedule;
|
|
213
|
+
}
|
|
214
|
+
async resumeSchedule(scheduleId, loggedInUser) {
|
|
215
|
+
this.logger.log(`Resuming schedule ${scheduleId} by user ${loggedInUser.id}`);
|
|
216
|
+
const schedule = await this.getScheduleById(scheduleId, loggedInUser);
|
|
217
|
+
if (schedule.schedule_status !== schedule_constants_1.SCHEDULE_STATUS_PAUSED) {
|
|
218
|
+
throw new common_1.BadRequestException('Schedule is not paused');
|
|
219
|
+
}
|
|
220
|
+
schedule.schedule_status = schedule_constants_1.SCHEDULE_STATUS_ACTIVE;
|
|
221
|
+
schedule.modified_by = loggedInUser.id;
|
|
222
|
+
schedule.modified_date = new Date();
|
|
223
|
+
schedule.next_execution_at = this.calculateNextExecution(schedule.cron_expression, schedule.timezone);
|
|
224
|
+
const updatedSchedule = await this.scheduledWorkflowRepository.save(schedule);
|
|
225
|
+
if (updatedSchedule.is_enabled) {
|
|
226
|
+
await this.scheduleJob(updatedSchedule, loggedInUser);
|
|
227
|
+
}
|
|
228
|
+
this.logger.log(`Schedule resumed successfully: ${scheduleId}`);
|
|
229
|
+
return updatedSchedule;
|
|
230
|
+
}
|
|
231
|
+
async deleteSchedule(scheduleId, loggedInUser) {
|
|
232
|
+
this.logger.log(`Deleting schedule ${scheduleId} by user ${loggedInUser.id}`);
|
|
233
|
+
const schedule = await this.getScheduleById(scheduleId, loggedInUser);
|
|
234
|
+
if (schedule.job_id) {
|
|
235
|
+
await this.removeJob(schedule.job_id);
|
|
236
|
+
}
|
|
237
|
+
schedule.schedule_status = schedule_constants_1.SCHEDULE_STATUS_INACTIVE;
|
|
238
|
+
schedule.status = 'INACTIVE';
|
|
239
|
+
schedule.is_enabled = false;
|
|
240
|
+
schedule.modified_by = loggedInUser.id;
|
|
241
|
+
schedule.modified_date = new Date();
|
|
242
|
+
await this.scheduledWorkflowRepository.save(schedule);
|
|
243
|
+
this.logger.log(`Schedule deleted successfully: ${scheduleId}`);
|
|
244
|
+
}
|
|
245
|
+
async triggerManualExecution(scheduleId, loggedInUser, metadata) {
|
|
246
|
+
this.logger.log(`Manual trigger for schedule ${scheduleId} by user ${loggedInUser.id}`);
|
|
247
|
+
const schedule = await this.getScheduleById(scheduleId, loggedInUser);
|
|
248
|
+
const jobData = {
|
|
249
|
+
scheduleId: schedule.id,
|
|
250
|
+
workflowId: schedule.workflow_id,
|
|
251
|
+
workflowName: schedule.workflow_name,
|
|
252
|
+
organizationId: schedule.organization_id,
|
|
253
|
+
enterpriseId: schedule.enterprise_id,
|
|
254
|
+
levelId: schedule.level_id,
|
|
255
|
+
levelType: schedule.level_type,
|
|
256
|
+
appcode: schedule.appcode,
|
|
257
|
+
createdBy: loggedInUser.id,
|
|
258
|
+
triggeredBy: 'MANUAL',
|
|
259
|
+
triggeredAt: new Date(),
|
|
260
|
+
metadata: metadata || {},
|
|
261
|
+
};
|
|
262
|
+
const job = await this.scheduleQueue.add(schedule_constants_1.EXECUTE_SCHEDULED_WORKFLOW_JOB, jobData, {
|
|
263
|
+
attempts: schedule.retry_config?.maxRetries || schedule_constants_1.DEFAULT_MAX_RETRIES,
|
|
264
|
+
backoff: {
|
|
265
|
+
type: 'exponential',
|
|
266
|
+
delay: schedule.retry_config?.retryDelay || schedule_constants_1.DEFAULT_RETRY_DELAY,
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
const executionLog = this.executionLogRepository.create({
|
|
270
|
+
schedule_id: schedule.id,
|
|
271
|
+
workflow_id: schedule.workflow_id,
|
|
272
|
+
job_id: job.id.toString(),
|
|
273
|
+
execution_status: 'PENDING',
|
|
274
|
+
triggered_by: 'MANUAL',
|
|
275
|
+
triggered_by_user_id: loggedInUser.id,
|
|
276
|
+
organization_id: schedule.organization_id,
|
|
277
|
+
enterprise_id: schedule.enterprise_id,
|
|
278
|
+
created_by: loggedInUser.id,
|
|
279
|
+
created_date: new Date(),
|
|
280
|
+
entity_type: 'WFEL',
|
|
281
|
+
status: 'ACTIVE',
|
|
282
|
+
});
|
|
283
|
+
const savedLog = await this.executionLogRepository.save(executionLog);
|
|
284
|
+
this.logger.log(`Manual execution triggered for schedule ${scheduleId}, job ID: ${job.id}`);
|
|
285
|
+
return {
|
|
286
|
+
executionLogId: savedLog.id,
|
|
287
|
+
jobId: job.id.toString(),
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
async getExecutionLogs(getExecutionLogsDto, loggedInUser) {
|
|
291
|
+
const page = getExecutionLogsDto.page || 1;
|
|
292
|
+
const size = getExecutionLogsDto.size || 10;
|
|
293
|
+
const skip = (page - 1) * size;
|
|
294
|
+
const whereConditions = {
|
|
295
|
+
organization_id: getExecutionLogsDto.organization_id || loggedInUser.organization_id,
|
|
296
|
+
};
|
|
297
|
+
if (getExecutionLogsDto.schedule_id) {
|
|
298
|
+
whereConditions.schedule_id = getExecutionLogsDto.schedule_id;
|
|
299
|
+
}
|
|
300
|
+
if (getExecutionLogsDto.workflow_id) {
|
|
301
|
+
whereConditions.workflow_id = getExecutionLogsDto.workflow_id;
|
|
302
|
+
}
|
|
303
|
+
if (getExecutionLogsDto.execution_status) {
|
|
304
|
+
whereConditions.execution_status = getExecutionLogsDto.execution_status;
|
|
305
|
+
}
|
|
306
|
+
if (getExecutionLogsDto.execution_statuses && getExecutionLogsDto.execution_statuses.length > 0) {
|
|
307
|
+
whereConditions.execution_status = (0, typeorm_2.In)(getExecutionLogsDto.execution_statuses);
|
|
308
|
+
}
|
|
309
|
+
if (getExecutionLogsDto.triggered_by) {
|
|
310
|
+
whereConditions.triggered_by = getExecutionLogsDto.triggered_by;
|
|
311
|
+
}
|
|
312
|
+
if (getExecutionLogsDto.triggered_by_user_id) {
|
|
313
|
+
whereConditions.triggered_by_user_id = getExecutionLogsDto.triggered_by_user_id;
|
|
314
|
+
}
|
|
315
|
+
if (getExecutionLogsDto.start_date && getExecutionLogsDto.end_date) {
|
|
316
|
+
whereConditions.created_date = (0, typeorm_2.Between)(new Date(getExecutionLogsDto.start_date), new Date(getExecutionLogsDto.end_date));
|
|
317
|
+
}
|
|
318
|
+
const [data, total] = await this.executionLogRepository.findAndCount({
|
|
319
|
+
where: whereConditions,
|
|
320
|
+
skip,
|
|
321
|
+
take: size,
|
|
322
|
+
order: {
|
|
323
|
+
[getExecutionLogsDto.sortBy || 'created_date']: getExecutionLogsDto.sortOrder || 'DESC',
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
return {
|
|
327
|
+
data,
|
|
328
|
+
total,
|
|
329
|
+
page,
|
|
330
|
+
size,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
async getExecutionStats(scheduleId, loggedInUser) {
|
|
334
|
+
const schedule = await this.getScheduleById(scheduleId, loggedInUser);
|
|
335
|
+
const stats = await this.dataSource.query(`SELECT
|
|
336
|
+
COUNT(*) as total_executions,
|
|
337
|
+
SUM(CASE WHEN execution_status = 'COMPLETED' THEN 1 ELSE 0 END) as successful_executions,
|
|
338
|
+
SUM(CASE WHEN execution_status = 'FAILED' THEN 1 ELSE 0 END) as failed_executions,
|
|
339
|
+
SUM(CASE WHEN execution_status = 'PENDING' THEN 1 ELSE 0 END) as pending_executions,
|
|
340
|
+
SUM(CASE WHEN execution_status = 'RUNNING' THEN 1 ELSE 0 END) as running_executions,
|
|
341
|
+
AVG(duration_ms) as average_duration_ms,
|
|
342
|
+
SUM(total_records) as total_records_processed
|
|
343
|
+
FROM cr_wf_execution_log
|
|
344
|
+
WHERE schedule_id = ?`, [scheduleId]);
|
|
345
|
+
const result = stats[0];
|
|
346
|
+
const successRate = result.total_executions > 0
|
|
347
|
+
? (result.successful_executions / result.total_executions) * 100
|
|
348
|
+
: 0;
|
|
349
|
+
return {
|
|
350
|
+
schedule_id: scheduleId,
|
|
351
|
+
schedule_name: schedule.name,
|
|
352
|
+
total_executions: parseInt(result.total_executions),
|
|
353
|
+
successful_executions: parseInt(result.successful_executions),
|
|
354
|
+
failed_executions: parseInt(result.failed_executions),
|
|
355
|
+
pending_executions: parseInt(result.pending_executions),
|
|
356
|
+
running_executions: parseInt(result.running_executions),
|
|
357
|
+
average_duration_ms: parseFloat(result.average_duration_ms) || 0,
|
|
358
|
+
total_records_processed: parseInt(result.total_records_processed) || 0,
|
|
359
|
+
success_rate_percentage: parseFloat(successRate.toFixed(2)),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
async scheduleJob(schedule, loggedInUser) {
|
|
363
|
+
const jobData = {
|
|
364
|
+
scheduleId: schedule.id,
|
|
365
|
+
workflowId: schedule.workflow_id,
|
|
366
|
+
workflowName: schedule.workflow_name,
|
|
367
|
+
organizationId: schedule.organization_id,
|
|
368
|
+
enterpriseId: schedule.enterprise_id,
|
|
369
|
+
levelId: schedule.level_id,
|
|
370
|
+
levelType: schedule.level_type,
|
|
371
|
+
appcode: schedule.appcode,
|
|
372
|
+
createdBy: loggedInUser.id,
|
|
373
|
+
triggeredBy: 'SCHEDULE',
|
|
374
|
+
triggeredAt: new Date(),
|
|
375
|
+
metadata: schedule.metadata || {},
|
|
376
|
+
};
|
|
377
|
+
const job = await this.scheduleQueue.add(schedule_constants_1.EXECUTE_SCHEDULED_WORKFLOW_JOB, jobData, {
|
|
378
|
+
repeat: {
|
|
379
|
+
cron: '*/1 * * * *',
|
|
380
|
+
tz: schedule.timezone,
|
|
381
|
+
startDate: schedule.start_date || undefined,
|
|
382
|
+
endDate: schedule.end_date || undefined,
|
|
383
|
+
},
|
|
384
|
+
attempts: schedule.retry_config?.maxRetries || schedule_constants_1.DEFAULT_MAX_RETRIES,
|
|
385
|
+
backoff: {
|
|
386
|
+
type: 'exponential',
|
|
387
|
+
delay: schedule.retry_config?.retryDelay || schedule_constants_1.DEFAULT_RETRY_DELAY,
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
schedule.job_id = job.id.toString();
|
|
391
|
+
await this.scheduledWorkflowRepository.save(schedule);
|
|
392
|
+
this.logger.log(`Job scheduled with ID: ${job.id} for schedule ${schedule.id}`);
|
|
393
|
+
}
|
|
394
|
+
async removeJob(jobId) {
|
|
395
|
+
try {
|
|
396
|
+
const job = await this.scheduleQueue.getJob(jobId);
|
|
397
|
+
if (job) {
|
|
398
|
+
await job.remove();
|
|
399
|
+
this.logger.log(`Job removed: ${jobId}`);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
catch (error) {
|
|
403
|
+
this.logger.warn(`Failed to remove job ${jobId}: ${error.message}`);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
validateCronExpression(cronExpression, timezone) {
|
|
407
|
+
try {
|
|
408
|
+
cronParser.CronExpressionParser.parse(cronExpression, { tz: timezone });
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
throw new common_1.BadRequestException(`Invalid cron expression: ${cronExpression}. Error: ${error.message}`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
calculateNextExecution(cronExpression, timezone) {
|
|
415
|
+
try {
|
|
416
|
+
const interval = cronParser.CronExpressionParser.parse(cronExpression, { tz: timezone });
|
|
417
|
+
return interval.next().toDate();
|
|
418
|
+
}
|
|
419
|
+
catch (error) {
|
|
420
|
+
this.logger.error(`Failed to calculate next execution: ${error.message}`);
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
exports.WorkflowScheduleService = WorkflowScheduleService;
|
|
426
|
+
exports.WorkflowScheduleService = WorkflowScheduleService = WorkflowScheduleService_1 = __decorate([
|
|
427
|
+
(0, common_1.Injectable)(),
|
|
428
|
+
__param(0, (0, typeorm_1.InjectRepository)(scheduled_workflow_entity_1.ScheduledWorkflow)),
|
|
429
|
+
__param(1, (0, typeorm_1.InjectRepository)(workflow_execution_log_entity_1.WorkflowExecutionLog)),
|
|
430
|
+
__param(2, (0, bull_1.InjectQueue)(schedule_constants_1.WORKFLOW_SCHEDULE_QUEUE)),
|
|
431
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
432
|
+
typeorm_2.Repository, Object, typeorm_2.DataSource])
|
|
433
|
+
], WorkflowScheduleService);
|
|
434
|
+
//# sourceMappingURL=workflow-schedule.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-schedule.service.js","sourceRoot":"","sources":["../../../../src/module/workflow-schedule/service/workflow-schedule.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,6CAAmD;AACnD,qCAA8D;AAC9D,uCAA2C;AAE3C,0CAA0C;AAE1C,qFAA0E;AAC1E,6FAAiF;AAKjF,wEAUyC;AAQlC,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YAEE,2BAA2E,EAE3E,sBAAyE,EAEzE,aAAsD,EACrC,UAAsB;QALtB,gCAA2B,GAA3B,2BAA2B,CAA+B;QAE1D,2BAAsB,GAAtB,sBAAsB,CAAkC;QAExD,kBAAa,GAAb,aAAa,CAAwB;QACrC,eAAU,GAAV,UAAU,CAAY;QATxB,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAUhE,CAAC;IAKJ,KAAK,CAAC,cAAc,CAClB,iBAAoC,EACpC,YAAsB;QAEtB,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,kCAAkC,iBAAiB,CAAC,WAAW,YAAY,YAAY,CAAC,EAAE,EAAE,CAC7F,CAAC;QAEF,IAAI,CAAC;YAEH,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,eAAe,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YAG3F,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';
|
|
2
|
+
import { WorkflowScheduleModuleOptions } from './interfaces/workflow-schedule-options.interface';
|
|
3
|
+
export declare class WorkflowScheduleModule {
|
|
4
|
+
static forRoot(options?: WorkflowScheduleModuleOptions): DynamicModule;
|
|
5
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
var WorkflowScheduleModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.WorkflowScheduleModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
13
|
+
const bull_1 = require("@nestjs/bull");
|
|
14
|
+
const scheduled_workflow_entity_1 = require("./entities/scheduled-workflow.entity");
|
|
15
|
+
const workflow_execution_log_entity_1 = require("./entities/workflow-execution-log.entity");
|
|
16
|
+
const workflow_schedule_service_1 = require("./service/workflow-schedule.service");
|
|
17
|
+
const workflow_schedule_controller_1 = require("./controller/workflow-schedule.controller");
|
|
18
|
+
const schedule_processor_1 = require("./processors/schedule.processor");
|
|
19
|
+
const schedule_constants_1 = require("./constants/schedule.constants");
|
|
20
|
+
const workflow_automation_module_1 = require("../workflow-automation/workflow-automation.module");
|
|
21
|
+
let WorkflowScheduleModule = WorkflowScheduleModule_1 = class WorkflowScheduleModule {
|
|
22
|
+
static forRoot(options = {}) {
|
|
23
|
+
const { is_workflow = false } = options;
|
|
24
|
+
const providers = [workflow_schedule_service_1.WorkflowScheduleService];
|
|
25
|
+
if (is_workflow) {
|
|
26
|
+
providers.push(schedule_processor_1.ScheduleProcessor);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
module: WorkflowScheduleModule_1,
|
|
30
|
+
global: true,
|
|
31
|
+
imports: [
|
|
32
|
+
typeorm_1.TypeOrmModule.forFeature([scheduled_workflow_entity_1.ScheduledWorkflow, workflow_execution_log_entity_1.WorkflowExecutionLog]),
|
|
33
|
+
bull_1.BullModule.registerQueue({
|
|
34
|
+
name: schedule_constants_1.WORKFLOW_SCHEDULE_QUEUE,
|
|
35
|
+
}),
|
|
36
|
+
(0, common_1.forwardRef)(() => workflow_automation_module_1.WorkflowAutomationModule),
|
|
37
|
+
],
|
|
38
|
+
providers,
|
|
39
|
+
controllers: [
|
|
40
|
+
workflow_schedule_controller_1.WorkflowScheduleController,
|
|
41
|
+
],
|
|
42
|
+
exports: [
|
|
43
|
+
workflow_schedule_service_1.WorkflowScheduleService,
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.WorkflowScheduleModule = WorkflowScheduleModule;
|
|
49
|
+
exports.WorkflowScheduleModule = WorkflowScheduleModule = WorkflowScheduleModule_1 = __decorate([
|
|
50
|
+
(0, common_1.Module)({})
|
|
51
|
+
], WorkflowScheduleModule);
|
|
52
|
+
//# sourceMappingURL=workflow-schedule.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-schedule.module.js","sourceRoot":"","sources":["../../../src/module/workflow-schedule/workflow-schedule.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAmE;AACnE,6CAAgD;AAChD,uCAA0C;AAC1C,oFAAyE;AACzE,4FAAgF;AAChF,mFAA8E;AAC9E,4FAAuF;AACvF,wEAAoE;AACpE,uEAAyE;AACzE,kGAA6F;AAatF,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IASjC,MAAM,CAAC,OAAO,CAAC,UAAyC,EAAE;QACxD,MAAM,EAAE,WAAW,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAGxC,MAAM,SAAS,GAAU,CAAC,mDAAuB,CAAC,CAAC;QAGnD,IAAI,WAAW,EAAE,CAAC;YAChB,SAAS,CAAC,IAAI,CAAC,sCAAiB,CAAC,CAAC;QACpC,CAAC;QAED,OAAO;YACL,MAAM,EAAE,wBAAsB;YAC9B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;gBAEP,uBAAa,CAAC,UAAU,CAAC,CAAC,6CAAiB,EAAE,oDAAoB,CAAC,CAAC;gBAGnE,iBAAU,CAAC,aAAa,CAAC;oBACvB,IAAI,EAAE,4CAAuB;iBAC9B,CAAC;gBACF,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qDAAwB,CAAC;aAC3C;YACD,SAAS;YACT,WAAW,EAAE;gBAEX,yDAA0B;aAC3B;YACD,OAAO,EAAE;gBAEP,mDAAuB;aACxB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA5CY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,sBAAsB,CA4ClC"}
|
package/dist/table.config.d.ts
CHANGED
|
@@ -35,6 +35,6 @@ import { UserData } from "./module/user/entity/user.entity";
|
|
|
35
35
|
import { TemplateAttach } from "./module/workflow/entity/template-attach-mapper.entity";
|
|
36
36
|
import { WorkFlowData } from "./module/workflow/entity/workflow-data.entity";
|
|
37
37
|
import { WorkflowLevelMappingEntity } from "./module/workflow/entity/workflow-level-mapping.entity";
|
|
38
|
-
export declare const frameworkTables: (typeof ListMasterItems | typeof ListMasterData | typeof SavedFilterMaster | typeof SavedFilterDetail | typeof EntityTable | typeof EntityTableColumn | typeof MediaData | typeof PreferenceMaster | typeof
|
|
38
|
+
export declare const frameworkTables: (typeof ListMasterItems | typeof ListMasterData | typeof EntityRelation | typeof SavedFilterMaster | typeof SavedFilterDetail | typeof EntityTable | typeof EntityTableColumn | typeof MediaData | typeof PreferenceMaster | typeof IntegrationConfig | typeof UserIntegration | typeof IntegrationEntityMapper | typeof FieldMapper | typeof FieldLovMapper | typeof IntegrationSource | typeof Mapper | typeof NotificationData | typeof LayoutPreference | typeof DashboardPageData)[];
|
|
39
39
|
export declare const workflowTables: (typeof TemplateAttach | typeof WorkflowLevelMappingEntity | typeof WorkFlowData)[];
|
|
40
40
|
export declare const SSOTables: (typeof UserData | typeof Role | typeof ModuleAccess | typeof OrganizationData | typeof UserRoleMapping | typeof AppMaster | typeof UserSession | typeof OrganizationAppMapping | typeof ModuleData | typeof ModuleAction | typeof MenuData | typeof Otp | typeof HeaderSection | typeof HeaderItems | typeof EnterpriseData)[];
|