@servicelabsco/nestjs-utility-services 1.2.108 → 1.2.109
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/config/entity.constants.d.ts +2 -0
- package/dist/config/entity.constants.js +2 -0
- package/dist/config/entity.constants.js.map +1 -1
- package/dist/config/source.hash.d.ts +2 -0
- package/dist/config/source.hash.js +2 -0
- package/dist/config/source.hash.js.map +1 -1
- package/dist/migrations/1734632235444-CreateRecurringQueryTable.d.ts +5 -0
- package/dist/migrations/1734632235444-CreateRecurringQueryTable.js +22 -0
- package/dist/migrations/1734632235444-CreateRecurringQueryTable.js.map +1 -0
- package/dist/system/dtos/index.d.ts +1 -0
- package/dist/system/dtos/index.js +1 -0
- package/dist/system/dtos/index.js.map +1 -1
- package/dist/system/dtos/recurring.query.attributes.dto.d.ts +3 -0
- package/dist/system/dtos/recurring.query.attributes.dto.js +8 -0
- package/dist/system/dtos/recurring.query.attributes.dto.js.map +1 -0
- package/dist/system/entities/index.d.ts +1 -0
- package/dist/system/entities/index.js +1 -0
- package/dist/system/entities/index.js.map +1 -1
- package/dist/system/entities/recurring.query.entity.d.ts +10 -0
- package/dist/system/entities/recurring.query.entity.js +46 -0
- package/dist/system/entities/recurring.query.entity.js.map +1 -0
- package/dist/system/es6.classes.d.ts +8 -4
- package/dist/system/es6.classes.js +12 -2
- package/dist/system/es6.classes.js.map +1 -1
- package/dist/system/jobs/execute.recurring.query.job.d.ts +10 -0
- package/dist/system/jobs/{clean.scheduled.event.job.js → execute.recurring.query.job.js} +19 -16
- package/dist/system/jobs/execute.recurring.query.job.js.map +1 -0
- package/dist/system/jobs/index.d.ts +3 -1
- package/dist/system/jobs/index.js +3 -1
- package/dist/system/jobs/index.js.map +1 -1
- package/dist/system/jobs/recurring.query.job.d.ts +15 -0
- package/dist/system/jobs/recurring.query.job.js +52 -0
- package/dist/system/jobs/recurring.query.job.js.map +1 -0
- package/dist/system/jobs/scheduled.event.job.d.ts +3 -3
- package/dist/system/jobs/scheduled.event.job.js +14 -12
- package/dist/system/jobs/scheduled.event.job.js.map +1 -1
- package/dist/system/jobs/{clean.scheduled.event.job.d.ts → set.recurring.query.event.job.d.ts} +8 -5
- package/dist/system/jobs/set.recurring.query.event.job.js +81 -0
- package/dist/system/jobs/set.recurring.query.event.job.js.map +1 -0
- package/dist/system/jobs/set.scheduled.event.job.d.ts +3 -0
- package/dist/system/jobs/set.scheduled.event.job.js +42 -2
- package/dist/system/jobs/set.scheduled.event.job.js.map +1 -1
- package/dist/system/libraries/code.evaluator.d.ts +2 -2
- package/dist/system/libraries/code.evaluator.js.map +1 -1
- package/dist/system/services/es6.jobs.service.d.ts +7 -3
- package/dist/system/services/es6.jobs.service.js +14 -6
- package/dist/system/services/es6.jobs.service.js.map +1 -1
- package/dist/system/services/scheduled.event.service.d.ts +4 -6
- package/dist/system/services/scheduled.event.service.js +21 -58
- package/dist/system/services/scheduled.event.service.js.map +1 -1
- package/dist/system/subscribers/index.d.ts +1 -0
- package/dist/system/subscribers/index.js +1 -0
- package/dist/system/subscribers/index.js.map +1 -1
- package/dist/system/subscribers/recurring.query.subscriber.d.ts +12 -0
- package/dist/system/subscribers/recurring.query.subscriber.js +47 -0
- package/dist/system/subscribers/recurring.query.subscriber.js.map +1 -0
- package/dist/system/subscribers/scheduled.event.subscriber.d.ts +2 -1
- package/dist/system/subscribers/scheduled.event.subscriber.js +7 -0
- package/dist/system/subscribers/scheduled.event.subscriber.js.map +1 -1
- package/package.json +1 -1
- package/dist/system/jobs/clean.scheduled.event.job.js.map +0 -1
@@ -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 __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.RecurringQueryJob = void 0;
|
13
|
+
const common_1 = require("@nestjs/common");
|
14
|
+
const date_fns_1 = require("date-fns");
|
15
|
+
const common_job_1 = require("../../common/libraries/common.job");
|
16
|
+
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
17
|
+
const recurring_query_entity_1 = require("../entities/recurring.query.entity");
|
18
|
+
const scheduled_event_service_1 = require("../services/scheduled.event.service");
|
19
|
+
const set_recurring_query_event_job_1 = require("./set.recurring.query.event.job");
|
20
|
+
const SourceHash = require("../../config/source.hash");
|
21
|
+
let RecurringQueryJob = class RecurringQueryJob extends common_job_1.CommonJob {
|
22
|
+
constructor(queueService, scheduledEventService, setRecurringQueryEventJob) {
|
23
|
+
super('0a4afb675c0a9e20782a12f7f6e870c2');
|
24
|
+
this.queueService = queueService;
|
25
|
+
this.scheduledEventService = scheduledEventService;
|
26
|
+
this.setRecurringQueryEventJob = setRecurringQueryEventJob;
|
27
|
+
}
|
28
|
+
async handle(event) {
|
29
|
+
await this.setSchedule(event);
|
30
|
+
}
|
31
|
+
async setSchedule(event) {
|
32
|
+
const trackingColumns = ['timing', 'active'];
|
33
|
+
if (!this.isColumnUpdated(event, trackingColumns))
|
34
|
+
return;
|
35
|
+
await this.cleanRecord(event);
|
36
|
+
return this.setRecurringQueryEventJob.dispatch(event.entity.id);
|
37
|
+
}
|
38
|
+
async cleanRecord(event) {
|
39
|
+
await this.scheduledEventService.deleteActiveEvents({ source_type: SourceHash.scheduledEvent, source_id: event.entity.id });
|
40
|
+
const r = await recurring_query_entity_1.RecurringQueryEntity.first(event.entity.id);
|
41
|
+
r.last_scheduled_time = (0, date_fns_1.subMinutes)(new Date(), 1);
|
42
|
+
return r.save();
|
43
|
+
}
|
44
|
+
};
|
45
|
+
exports.RecurringQueryJob = RecurringQueryJob;
|
46
|
+
exports.RecurringQueryJob = RecurringQueryJob = __decorate([
|
47
|
+
(0, common_1.Injectable)(),
|
48
|
+
__metadata("design:paramtypes", [queue_service_1.QueueService,
|
49
|
+
scheduled_event_service_1.ScheduledEventService,
|
50
|
+
set_recurring_query_event_job_1.SetRecurringQueryEventJob])
|
51
|
+
], RecurringQueryJob);
|
52
|
+
//# sourceMappingURL=recurring.query.job.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"recurring.query.job.js","sourceRoot":"","sources":["../../../src/system/jobs/recurring.query.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAsC;AAEtC,kEAA8D;AAC9D,gFAA4E;AAC5E,+EAA0E;AAC1E,iFAA4E;AAC5E,mFAA4E;AAC5E,uDAAwD;AAEjD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,sBAAS;IAC5C,YACuB,YAA0B,EAC5B,qBAA4C,EAC1C,yBAAoD;QAEvE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAJvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC1C,8BAAyB,GAAzB,yBAAyB,CAA2B;IAG3E,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAA6C;QACtD,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA6C;QACnE,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC;YAAE,OAAO;QAE1D,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA6C;QACnE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAE5H,MAAM,CAAC,GAAG,MAAM,6CAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC,CAAC,mBAAmB,GAAG,IAAA,qBAAU,EAAC,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAElD,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;CACJ,CAAA;AA5BY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAG4B,4BAAY;QACL,+CAAqB;QACf,yDAAyB;GAJlE,iBAAiB,CA4B7B"}
|
@@ -2,13 +2,13 @@ import { DatabaseEventDto } from '../../common/dtos/database.event.dto';
|
|
2
2
|
import { CommonJob } from '../../common/libraries/common.job';
|
3
3
|
import { QueueService } from '../../platformUtility/services/queue.service';
|
4
4
|
import { ScheduledEventEntity } from '../entities/scheduled.event.entity';
|
5
|
-
import {
|
5
|
+
import { ScheduledEventService } from '../services/scheduled.event.service';
|
6
6
|
import { SetScheduledEventJob } from './set.scheduled.event.job';
|
7
7
|
export declare class ScheduledEventJob extends CommonJob {
|
8
8
|
protected readonly queueService: QueueService;
|
9
|
-
private readonly
|
9
|
+
private readonly scheduledEventService;
|
10
10
|
private readonly setScheduledEventJob;
|
11
|
-
constructor(queueService: QueueService,
|
11
|
+
constructor(queueService: QueueService, scheduledEventService: ScheduledEventService, setScheduledEventJob: SetScheduledEventJob);
|
12
12
|
handle(event: DatabaseEventDto<ScheduledEventEntity>): Promise<void>;
|
13
13
|
private setSchedule;
|
14
14
|
private cleanRecord;
|
@@ -13,38 +13,40 @@ exports.ScheduledEventJob = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const common_job_1 = require("../../common/libraries/common.job");
|
15
15
|
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
16
|
-
const
|
16
|
+
const scheduled_event_entity_1 = require("../entities/scheduled.event.entity");
|
17
|
+
const scheduled_event_service_1 = require("../services/scheduled.event.service");
|
17
18
|
const set_scheduled_event_job_1 = require("./set.scheduled.event.job");
|
19
|
+
const SourceHash = require("../../config/source.hash");
|
20
|
+
const date_fns_1 = require("date-fns");
|
18
21
|
let ScheduledEventJob = class ScheduledEventJob extends common_job_1.CommonJob {
|
19
|
-
constructor(queueService,
|
22
|
+
constructor(queueService, scheduledEventService, setScheduledEventJob) {
|
20
23
|
super('bb97644f2c505dc135d01f4c6959ec1f');
|
21
24
|
this.queueService = queueService;
|
22
|
-
this.
|
25
|
+
this.scheduledEventService = scheduledEventService;
|
23
26
|
this.setScheduledEventJob = setScheduledEventJob;
|
24
27
|
}
|
25
28
|
async handle(event) {
|
26
|
-
await this.cleanRecord(event);
|
27
29
|
await this.setSchedule(event);
|
28
30
|
}
|
29
31
|
async setSchedule(event) {
|
30
|
-
|
32
|
+
const trackingColumns = ['event_id', 'parameter', 'timing', 'active', 'start_time', 'end_time'];
|
33
|
+
if (!this.isColumnUpdated(event, trackingColumns))
|
31
34
|
return;
|
35
|
+
await this.cleanRecord(event);
|
32
36
|
return this.setScheduledEventJob.dispatch(event.entity.id);
|
33
37
|
}
|
34
38
|
async cleanRecord(event) {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
return;
|
40
|
-
return this.cleanScheduledEventJob.dispatch(event.entity.id);
|
39
|
+
await this.scheduledEventService.deleteActiveEvents({ source_type: SourceHash.scheduledEvent, source_id: event.entity.id });
|
40
|
+
const r = await scheduled_event_entity_1.ScheduledEventEntity.first(event.entity.id);
|
41
|
+
r.last_scheduled_time = (0, date_fns_1.subMinutes)(new Date(), 1);
|
42
|
+
return r.save();
|
41
43
|
}
|
42
44
|
};
|
43
45
|
exports.ScheduledEventJob = ScheduledEventJob;
|
44
46
|
exports.ScheduledEventJob = ScheduledEventJob = __decorate([
|
45
47
|
(0, common_1.Injectable)(),
|
46
48
|
__metadata("design:paramtypes", [queue_service_1.QueueService,
|
47
|
-
|
49
|
+
scheduled_event_service_1.ScheduledEventService,
|
48
50
|
set_scheduled_event_job_1.SetScheduledEventJob])
|
49
51
|
], ScheduledEventJob);
|
50
52
|
//# sourceMappingURL=scheduled.event.job.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,kEAA8D;AAC9D,gFAA4E;
|
1
|
+
{"version":3,"file":"scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,kEAA8D;AAC9D,gFAA4E;AAC5E,+EAA0E;AAC1E,iFAA4E;AAC5E,uEAAiE;AACjE,uDAAwD;AACxD,uCAAsC;AAG/B,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,sBAAS;IAC5C,YACuB,YAA0B,EAC5B,qBAA4C,EAC5C,oBAA0C;QAE3D,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAJvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,yBAAoB,GAApB,oBAAoB,CAAsB;IAG/D,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAA6C;QACtD,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA6C;QACnE,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAChG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC;YAAE,OAAO;QAE1D,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA6C;QACnE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAE5H,MAAM,CAAC,GAAG,MAAM,6CAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC,CAAC,mBAAmB,GAAG,IAAA,qBAAU,EAAC,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAElD,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;CACJ,CAAA;AA5BY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAG4B,4BAAY;QACL,+CAAqB;QACtB,8CAAoB;GAJtD,iBAAiB,CA4B7B"}
|
package/dist/system/jobs/{clean.scheduled.event.job.d.ts → set.recurring.query.event.job.d.ts}
RENAMED
@@ -1,11 +1,14 @@
|
|
1
1
|
import { CommonJob } from '../../common/libraries/common.job';
|
2
2
|
import { QueueService } from '../../platformUtility/services/queue.service';
|
3
3
|
import { ScheduledEventService } from '../services/scheduled.event.service';
|
4
|
-
|
5
|
-
export declare class CleanScheduledEventJob extends CommonJob {
|
4
|
+
export declare class SetRecurringQueryEventJob extends CommonJob {
|
6
5
|
protected readonly queueService: QueueService;
|
7
6
|
private readonly scheduledEventService;
|
8
|
-
|
9
|
-
constructor(queueService: QueueService, scheduledEventService: ScheduledEventService
|
10
|
-
handle(
|
7
|
+
protected timeout: number;
|
8
|
+
constructor(queueService: QueueService, scheduledEventService: ScheduledEventService);
|
9
|
+
handle(): Promise<void>;
|
10
|
+
private handleAllActiveJobs;
|
11
|
+
private handleJob;
|
12
|
+
private getEligibleScheduledEvents;
|
13
|
+
private setNewEvent;
|
11
14
|
}
|
@@ -0,0 +1,81 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.SetRecurringQueryEventJob = void 0;
|
13
|
+
const common_1 = require("@nestjs/common");
|
14
|
+
const date_fns_1 = require("date-fns");
|
15
|
+
const typeorm_1 = require("typeorm");
|
16
|
+
const common_job_1 = require("../../common/libraries/common.job");
|
17
|
+
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
18
|
+
const event_detail_entity_1 = require("../entities/event.detail.entity");
|
19
|
+
const event_queue_entity_1 = require("../entities/event.queue.entity");
|
20
|
+
const recurring_query_entity_1 = require("../entities/recurring.query.entity");
|
21
|
+
const scheduled_event_service_1 = require("../services/scheduled.event.service");
|
22
|
+
const SourceHash = require("../../config/source.hash");
|
23
|
+
let SetRecurringQueryEventJob = class SetRecurringQueryEventJob extends common_job_1.CommonJob {
|
24
|
+
constructor(queueService, scheduledEventService) {
|
25
|
+
super('6f2c6980763ef0de2b4b7ee850319f6b');
|
26
|
+
this.queueService = queueService;
|
27
|
+
this.scheduledEventService = scheduledEventService;
|
28
|
+
this.timeout = 300000;
|
29
|
+
}
|
30
|
+
async handle() {
|
31
|
+
return this.handleAllActiveJobs();
|
32
|
+
}
|
33
|
+
async handleAllActiveJobs() {
|
34
|
+
const scheduledJobs = await this.getEligibleScheduledEvents();
|
35
|
+
const event = await event_detail_entity_1.EventDetailEntity.findOne({ where: { identifier: SourceHash.recurringQueryEvent } });
|
36
|
+
const startDate = (0, date_fns_1.subMinutes)(new Date(), 1);
|
37
|
+
const endDate = (0, date_fns_1.addYears)(new Date(), 1);
|
38
|
+
for (const scheduledJob of scheduledJobs) {
|
39
|
+
await this.handleJob(scheduledJob, startDate, endDate, event);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
async handleJob(job, startDate, endDate, event) {
|
43
|
+
const source = { source_type: SourceHash.recurringQuery, source_id: job.id };
|
44
|
+
const dates = await this.scheduledEventService.getSchedules(source, job.timing, startDate, endDate);
|
45
|
+
if (!dates?.length)
|
46
|
+
return job;
|
47
|
+
for (const date of dates) {
|
48
|
+
await this.setNewEvent(job, date, event);
|
49
|
+
}
|
50
|
+
job.last_scheduled_time = dates.pop();
|
51
|
+
return job.save();
|
52
|
+
}
|
53
|
+
async getEligibleScheduledEvents() {
|
54
|
+
const d = (0, date_fns_1.addMinutes)(new Date(), 15);
|
55
|
+
return recurring_query_entity_1.RecurringQueryEntity.find({
|
56
|
+
where: {
|
57
|
+
active: true,
|
58
|
+
last_scheduled_time: (0, typeorm_1.LessThanOrEqual)(d),
|
59
|
+
timing: (0, typeorm_1.Not)((0, typeorm_1.IsNull)()),
|
60
|
+
},
|
61
|
+
});
|
62
|
+
}
|
63
|
+
async setNewEvent(job, date, event) {
|
64
|
+
const record = new event_queue_entity_1.EventQueueEntity();
|
65
|
+
record.name = event.name;
|
66
|
+
record.event_id = event.id;
|
67
|
+
record.parameter = job.id.toString();
|
68
|
+
record.scheduled_start_time = date;
|
69
|
+
record.source_type = SourceHash.recurringQuery;
|
70
|
+
record.source_id = job.id;
|
71
|
+
await record.save();
|
72
|
+
return record;
|
73
|
+
}
|
74
|
+
};
|
75
|
+
exports.SetRecurringQueryEventJob = SetRecurringQueryEventJob;
|
76
|
+
exports.SetRecurringQueryEventJob = SetRecurringQueryEventJob = __decorate([
|
77
|
+
(0, common_1.Injectable)(),
|
78
|
+
__metadata("design:paramtypes", [queue_service_1.QueueService,
|
79
|
+
scheduled_event_service_1.ScheduledEventService])
|
80
|
+
], SetRecurringQueryEventJob);
|
81
|
+
//# sourceMappingURL=set.recurring.query.event.job.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set.recurring.query.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.recurring.query.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAA4D;AAC5D,qCAAuD;AACvD,kEAA8D;AAC9D,gFAA4E;AAC5E,yEAAoE;AACpE,uEAAkE;AAClE,+EAA0E;AAC1E,iFAA4E;AAC5E,uDAAwD;AAGjD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,sBAAS;IAGvD,YACoB,YAA0B,EAC5B,qBAA4C;QAE7D,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAJpD,YAAO,GAAW,MAAM,CAAC;IAOnC,CAAC;IAMD,KAAK,CAAC,MAAM;QACX,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACnC,CAAC;IAQO,KAAK,C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AC,GAAG,IAAA,qBAAU,EAAC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAErC,OAAO,6CAAoB,CAAC,IAAI,CAAC;YAChC,KAAK,EAAE;gBACN,MAAM,EAAE,IAAI;gBACZ,mBAAmB,EAAE,IAAA,yBAAe,EAAC,CAAC,CAAC;gBACvC,MAAM,EAAE,IAAA,aAAG,EAAC,IAAA,gBAAM,GAAE,CAAC;aACrB;SACD,CAAC,CAAC;IACJ,CAAC;IAUO,KAAK,CAAC,WAAW,CAAC,GAAyB,EAAE,IAAU,EAAE,KAAwB;QACxF,MAAM,MAAM,GAAG,IAAI,qCAAgB,EAAE,CAAC;QAEtC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC;QAE3B,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;QAEnC,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC;QAC/C,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,CAAC;QAE1B,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAEpB,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAA;AArGY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAKsB,4BAAY;QACL,+CAAqB;GALlD,yBAAyB,CAqGrC"}
|
@@ -8,4 +8,7 @@ export declare class SetScheduledEventJob extends CommonJob {
|
|
8
8
|
constructor(queueService: QueueService, scheduledEventService: ScheduledEventService);
|
9
9
|
handle(): Promise<void>;
|
10
10
|
private handleAllActiveJobs;
|
11
|
+
private handleJob;
|
12
|
+
private getEligibleScheduledEvents;
|
13
|
+
private setNewEvent;
|
11
14
|
}
|
@@ -11,9 +11,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.SetScheduledEventJob = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
|
+
const date_fns_1 = require("date-fns");
|
15
|
+
const typeorm_1 = require("typeorm");
|
14
16
|
const common_job_1 = require("../../common/libraries/common.job");
|
17
|
+
const date_util_1 = require("../../common/libraries/date.util");
|
15
18
|
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
19
|
+
const event_queue_entity_1 = require("../entities/event.queue.entity");
|
20
|
+
const scheduled_event_entity_1 = require("../entities/scheduled.event.entity");
|
16
21
|
const scheduled_event_service_1 = require("../services/scheduled.event.service");
|
22
|
+
const SourceHash = require("../../config/source.hash");
|
17
23
|
let SetScheduledEventJob = class SetScheduledEventJob extends common_job_1.CommonJob {
|
18
24
|
constructor(queueService, scheduledEventService) {
|
19
25
|
super('40d4fd2c9c09856b54d90643c5f03171');
|
@@ -25,11 +31,45 @@ let SetScheduledEventJob = class SetScheduledEventJob extends common_job_1.Commo
|
|
25
31
|
return this.handleAllActiveJobs();
|
26
32
|
}
|
27
33
|
async handleAllActiveJobs() {
|
28
|
-
const scheduledJobs = await this.
|
34
|
+
const scheduledJobs = await this.getEligibleScheduledEvents();
|
29
35
|
for (const scheduledJob of scheduledJobs) {
|
30
|
-
await this.
|
36
|
+
await this.handleJob(scheduledJob);
|
31
37
|
}
|
32
38
|
}
|
39
|
+
async handleJob(job) {
|
40
|
+
const source = { source_type: SourceHash.scheduledEvent, source_id: job.id };
|
41
|
+
const dates = await this.scheduledEventService.getSchedules(source, job.timing, job.start_time, job.end_time);
|
42
|
+
if (!dates?.length)
|
43
|
+
return job;
|
44
|
+
for (const date of dates) {
|
45
|
+
await this.setNewEvent(job, date);
|
46
|
+
}
|
47
|
+
job.last_scheduled_time = dates.pop();
|
48
|
+
return job.save();
|
49
|
+
}
|
50
|
+
async getEligibleScheduledEvents() {
|
51
|
+
const d = (0, date_fns_1.addMinutes)(new Date(), 15);
|
52
|
+
return scheduled_event_entity_1.ScheduledEventEntity.find({
|
53
|
+
relations: ['event'],
|
54
|
+
where: {
|
55
|
+
active: true,
|
56
|
+
end_time: (0, typeorm_1.Not)((0, typeorm_1.LessThan)(date_util_1.DateUtil.getDateTime())),
|
57
|
+
last_scheduled_time: (0, typeorm_1.LessThanOrEqual)(d),
|
58
|
+
},
|
59
|
+
});
|
60
|
+
}
|
61
|
+
async setNewEvent(job, date) {
|
62
|
+
const record = new event_queue_entity_1.EventQueueEntity();
|
63
|
+
record.name = job.event.name;
|
64
|
+
record.event_id = job.event_id;
|
65
|
+
record.parameter = job.parameter;
|
66
|
+
record.payload = job.payload || {};
|
67
|
+
record.scheduled_start_time = date;
|
68
|
+
record.source_type = SourceHash.scheduledEvent;
|
69
|
+
record.source_id = job.id;
|
70
|
+
await record.save();
|
71
|
+
return record;
|
72
|
+
}
|
33
73
|
};
|
34
74
|
exports.SetScheduledEventJob = SetScheduledEventJob;
|
35
75
|
exports.SetScheduledEventJob = SetScheduledEventJob = __decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"set.scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,gFAA4E;AAC5E,iFAA4E;
|
1
|
+
{"version":3,"file":"set.scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAsC;AACtC,qCAAyD;AACzD,kEAA8D;AAC9D,gEAA4D;AAC5D,gFAA4E;AAC5E,uEAAkE;AAClE,+EAA0E;AAC1E,iFAA4E;AAC5E,uDAAwD;AAGjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAS;IAG/C,YACuB,YAA0B,EAC5B,qBAA4C;QAE7D,KAAK,CAAC,kCAAkC,CAAC,CAAC;Q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H,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,IAAA,aAAG,EAAC,IAAA,kBAAQ,EAAC,oBAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC/C,mBAAmB,EAAE,IAAA,yBAAe,EAAC,CAAC,CAAC;aAC1C;SACJ,CAAC,CAAC;IACP,CAAC;IASO,KAAK,CAAC,WAAW,CAAC,GAAyB,EAAE,IAAU;QAC3D,MAAM,MAAM,GAAG,IAAI,qCAAgB,EAAE,CAAC;QAEtC,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAE/B,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QACjC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;QAEnC,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC;QAC/C,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,CAAC;QAE1B,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAEpB,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAlGY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAK4B,4BAAY;QACL,+CAAqB;GALxD,oBAAoB,CAkGhC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"code.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/code.evaluator.ts"],"names":[],"mappings":";;;AAAA,8EAA0E;AAE1E,MAAa,aAAa;IAQtB,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,
|
1
|
+
{"version":3,"file":"code.evaluator.js","sourceRoot":"","sources":["../../../src/system/libraries/code.evaluator.ts"],"names":[],"mappings":";;;AAAA,8EAA0E;AAE1E,MAAa,aAAa;IAQtB,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAiC;QAC3D,MAAM,EAAE,GAAG,IAAI,CAAC;QAChB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,CAAC;QAC3B,MAAM,GAAG,GAAG,OAAO,EAAE,EAAE,CAAC;QAExB,MAAM,IAAI,GAAG;;kBAEH,MAAM;;SAEf,CAAC;QAEF,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAQO,SAAS,CAAC,UAAkB;QAChC,OAAO,kCAAe,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAQO,UAAU,CAAC,UAAkB;QACjC,OAAO,kCAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IAUO,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,IAAS,EAAE,QAAgB,CAAC;QACtE,MAAM,GAAG,GAAG,kCAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,aAAa,UAAU,YAAY,CAAC,CAAC;YACjD,OAAO;QACX,CAAC;QAED,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;CACJ;AA3DD,sCA2DC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { CleanScheduledEventJob } from '../jobs/clean.scheduled.event.job';
|
2
1
|
import { ClientCredentialJob } from '../jobs/client.credential.job';
|
3
2
|
import { ClientJob } from '../jobs/client.job';
|
4
3
|
import { CodeFixLogJob } from '../jobs/code.fix.log.job';
|
@@ -8,17 +7,20 @@ import { CommentJob } from '../jobs/comment.job';
|
|
8
7
|
import { CredentialIpJob } from '../jobs/credential.ip.job';
|
9
8
|
import { DocumentJob } from '../jobs/document.job';
|
10
9
|
import { ExecuteCodeFixJob } from '../jobs/execute.code.fix.job';
|
10
|
+
import { ExecuteRecurringQueryJob } from '../jobs/execute.recurring.query.job';
|
11
11
|
import { MailEventJob } from '../jobs/mail.event.job';
|
12
12
|
import { MailRecipientJob } from '../jobs/mail.recipient.job';
|
13
13
|
import { MailValidationJob } from '../jobs/mail.validation.job';
|
14
14
|
import { MobileValidationJob } from '../jobs/mobile.validation.job';
|
15
15
|
import { ModelScannerJob } from '../jobs/model.scanner.job';
|
16
16
|
import { PropertyJob } from '../jobs/property.job';
|
17
|
+
import { RecurringQueryJob } from '../jobs/recurring.query.job';
|
17
18
|
import { RefreshPropertyCacheJob } from '../jobs/refresh.property.cache.job';
|
18
19
|
import { RelationshipMapperJob } from '../jobs/relationship.mapper.job';
|
19
20
|
import { ReportColumnSyncJob } from '../jobs/report.column.sync.job';
|
20
21
|
import { ScheduledEventJob } from '../jobs/scheduled.event.job';
|
21
22
|
import { SetEventQueueJob } from '../jobs/set.event.queue.job';
|
23
|
+
import { SetRecurringQueryEventJob } from '../jobs/set.recurring.query.event.job';
|
22
24
|
import { SetScheduledEventJob } from '../jobs/set.scheduled.event.job';
|
23
25
|
import { SmsMessageJob } from '../jobs/sms.message.job';
|
24
26
|
import { SqsPollingJob } from '../jobs/sqs.polling.job';
|
@@ -27,7 +29,6 @@ import { UserGroupMemberJob } from '../jobs/user.group.member.job';
|
|
27
29
|
import { UserGroupPermissionJob } from '../jobs/user.group.permission.job';
|
28
30
|
import { UserGroupRoleJob } from '../jobs/user.group.role.job';
|
29
31
|
export declare class Es6JobsService {
|
30
|
-
private readonly cleanScheduledEventJob;
|
31
32
|
private readonly clientCredentialJob;
|
32
33
|
private readonly clientJob;
|
33
34
|
private readonly codeFixLogJob;
|
@@ -37,17 +38,20 @@ export declare class Es6JobsService {
|
|
37
38
|
private readonly credentialIpJob;
|
38
39
|
private readonly documentJob;
|
39
40
|
private readonly executeCodeFixJob;
|
41
|
+
private readonly executeRecurringQueryJob;
|
40
42
|
private readonly mailEventJob;
|
41
43
|
private readonly mailRecipientJob;
|
42
44
|
private readonly mailValidationJob;
|
43
45
|
private readonly mobileValidationJob;
|
44
46
|
private readonly modelScannerJob;
|
45
47
|
private readonly propertyJob;
|
48
|
+
private readonly recurringQueryJob;
|
46
49
|
private readonly refreshPropertyCacheJob;
|
47
50
|
private readonly relationshipMapperJob;
|
48
51
|
private readonly reportColumnSyncJob;
|
49
52
|
private readonly scheduledEventJob;
|
50
53
|
private readonly setEventQueueJob;
|
54
|
+
private readonly setRecurringQueryEventJob;
|
51
55
|
private readonly setScheduledEventJob;
|
52
56
|
private readonly smsMessageJob;
|
53
57
|
private readonly sqsPollingJob;
|
@@ -56,7 +60,7 @@ export declare class Es6JobsService {
|
|
56
60
|
private readonly userGroupPermissionJob;
|
57
61
|
private readonly userGroupRoleJob;
|
58
62
|
private jobs;
|
59
|
-
constructor(
|
63
|
+
constructor(clientCredentialJob: ClientCredentialJob, clientJob: ClientJob, codeFixLogJob: CodeFixLogJob, codeFixScriptJob: CodeFixScriptJob, columnMapperJob: ColumnMapperJob, commentJob: CommentJob, credentialIpJob: CredentialIpJob, documentJob: DocumentJob, executeCodeFixJob: ExecuteCodeFixJob, executeRecurringQueryJob: ExecuteRecurringQueryJob, mailEventJob: MailEventJob, mailRecipientJob: MailRecipientJob, mailValidationJob: MailValidationJob, mobileValidationJob: MobileValidationJob, modelScannerJob: ModelScannerJob, propertyJob: PropertyJob, recurringQueryJob: RecurringQueryJob, refreshPropertyCacheJob: RefreshPropertyCacheJob, relationshipMapperJob: RelationshipMapperJob, reportColumnSyncJob: ReportColumnSyncJob, scheduledEventJob: ScheduledEventJob, setEventQueueJob: SetEventQueueJob, setRecurringQueryEventJob: SetRecurringQueryEventJob, setScheduledEventJob: SetScheduledEventJob, smsMessageJob: SmsMessageJob, sqsPollingJob: SqsPollingJob, syncAllCodeJob: SyncAllCodeJob, userGroupMemberJob: UserGroupMemberJob, userGroupPermissionJob: UserGroupPermissionJob, userGroupRoleJob: UserGroupRoleJob);
|
60
64
|
alignJobs(): void;
|
61
65
|
setJobs(): void;
|
62
66
|
}
|
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.Es6JobsService = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
|
-
const clean_scheduled_event_job_1 = require("../jobs/clean.scheduled.event.job");
|
15
14
|
const client_credential_job_1 = require("../jobs/client.credential.job");
|
16
15
|
const client_job_1 = require("../jobs/client.job");
|
17
16
|
const code_fix_log_job_1 = require("../jobs/code.fix.log.job");
|
@@ -21,17 +20,20 @@ const comment_job_1 = require("../jobs/comment.job");
|
|
21
20
|
const credential_ip_job_1 = require("../jobs/credential.ip.job");
|
22
21
|
const document_job_1 = require("../jobs/document.job");
|
23
22
|
const execute_code_fix_job_1 = require("../jobs/execute.code.fix.job");
|
23
|
+
const execute_recurring_query_job_1 = require("../jobs/execute.recurring.query.job");
|
24
24
|
const mail_event_job_1 = require("../jobs/mail.event.job");
|
25
25
|
const mail_recipient_job_1 = require("../jobs/mail.recipient.job");
|
26
26
|
const mail_validation_job_1 = require("../jobs/mail.validation.job");
|
27
27
|
const mobile_validation_job_1 = require("../jobs/mobile.validation.job");
|
28
28
|
const model_scanner_job_1 = require("../jobs/model.scanner.job");
|
29
29
|
const property_job_1 = require("../jobs/property.job");
|
30
|
+
const recurring_query_job_1 = require("../jobs/recurring.query.job");
|
30
31
|
const refresh_property_cache_job_1 = require("../jobs/refresh.property.cache.job");
|
31
32
|
const relationship_mapper_job_1 = require("../jobs/relationship.mapper.job");
|
32
33
|
const report_column_sync_job_1 = require("../jobs/report.column.sync.job");
|
33
34
|
const scheduled_event_job_1 = require("../jobs/scheduled.event.job");
|
34
35
|
const set_event_queue_job_1 = require("../jobs/set.event.queue.job");
|
36
|
+
const set_recurring_query_event_job_1 = require("../jobs/set.recurring.query.event.job");
|
35
37
|
const set_scheduled_event_job_1 = require("../jobs/set.scheduled.event.job");
|
36
38
|
const sms_message_job_1 = require("../jobs/sms.message.job");
|
37
39
|
const sqs_polling_job_1 = require("../jobs/sqs.polling.job");
|
@@ -41,8 +43,7 @@ const user_group_permission_job_1 = require("../jobs/user.group.permission.job")
|
|
41
43
|
const user_group_role_job_1 = require("../jobs/user.group.role.job");
|
42
44
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
43
45
|
let Es6JobsService = class Es6JobsService {
|
44
|
-
constructor(
|
45
|
-
this.cleanScheduledEventJob = cleanScheduledEventJob;
|
46
|
+
constructor(clientCredentialJob, clientJob, codeFixLogJob, codeFixScriptJob, columnMapperJob, commentJob, credentialIpJob, documentJob, executeCodeFixJob, executeRecurringQueryJob, mailEventJob, mailRecipientJob, mailValidationJob, mobileValidationJob, modelScannerJob, propertyJob, recurringQueryJob, refreshPropertyCacheJob, relationshipMapperJob, reportColumnSyncJob, scheduledEventJob, setEventQueueJob, setRecurringQueryEventJob, setScheduledEventJob, smsMessageJob, sqsPollingJob, syncAllCodeJob, userGroupMemberJob, userGroupPermissionJob, userGroupRoleJob) {
|
46
47
|
this.clientCredentialJob = clientCredentialJob;
|
47
48
|
this.clientJob = clientJob;
|
48
49
|
this.codeFixLogJob = codeFixLogJob;
|
@@ -52,17 +53,20 @@ let Es6JobsService = class Es6JobsService {
|
|
52
53
|
this.credentialIpJob = credentialIpJob;
|
53
54
|
this.documentJob = documentJob;
|
54
55
|
this.executeCodeFixJob = executeCodeFixJob;
|
56
|
+
this.executeRecurringQueryJob = executeRecurringQueryJob;
|
55
57
|
this.mailEventJob = mailEventJob;
|
56
58
|
this.mailRecipientJob = mailRecipientJob;
|
57
59
|
this.mailValidationJob = mailValidationJob;
|
58
60
|
this.mobileValidationJob = mobileValidationJob;
|
59
61
|
this.modelScannerJob = modelScannerJob;
|
60
62
|
this.propertyJob = propertyJob;
|
63
|
+
this.recurringQueryJob = recurringQueryJob;
|
61
64
|
this.refreshPropertyCacheJob = refreshPropertyCacheJob;
|
62
65
|
this.relationshipMapperJob = relationshipMapperJob;
|
63
66
|
this.reportColumnSyncJob = reportColumnSyncJob;
|
64
67
|
this.scheduledEventJob = scheduledEventJob;
|
65
68
|
this.setEventQueueJob = setEventQueueJob;
|
69
|
+
this.setRecurringQueryEventJob = setRecurringQueryEventJob;
|
66
70
|
this.setScheduledEventJob = setScheduledEventJob;
|
67
71
|
this.smsMessageJob = smsMessageJob;
|
68
72
|
this.sqsPollingJob = sqsPollingJob;
|
@@ -76,7 +80,6 @@ let Es6JobsService = class Es6JobsService {
|
|
76
80
|
}
|
77
81
|
alignJobs() {
|
78
82
|
this.jobs = {
|
79
|
-
'6ca64f0c0b9d1a082aa5e0182020ba5b': this.cleanScheduledEventJob,
|
80
83
|
'9eb95214fbbb66f7c32576de46c95d60': this.clientCredentialJob,
|
81
84
|
aec3ee6a7bb90aef7b99e2289f7c22d6: this.clientJob,
|
82
85
|
'22f3e204e242b61c405ded5eb2825441': this.codeFixLogJob,
|
@@ -86,17 +89,20 @@ let Es6JobsService = class Es6JobsService {
|
|
86
89
|
d14e1d233ff74f0c86d160cc3ec9cbfb: this.credentialIpJob,
|
87
90
|
'64c1bbde8bd1bc6355f8fa2d86a171f1': this.documentJob,
|
88
91
|
'66b85ebd2f93d8d9ad74f91dd448fc10': this.executeCodeFixJob,
|
92
|
+
'49da21b3b3be45f66e8f88c55be55ebe': this.executeRecurringQueryJob,
|
89
93
|
'5cfb77227fad03adc54decf4465d2673': this.mailEventJob,
|
90
94
|
'97aad20762421f5972396cc09411f139': this.mailRecipientJob,
|
91
95
|
'469fd6148687123ec4ef17ed0ad5ef87': this.mailValidationJob,
|
92
96
|
fc454d05d19747fdbb8510bbc00f67dd: this.mobileValidationJob,
|
93
97
|
'895d52ea29c17047f690ead67db80c9c': this.modelScannerJob,
|
94
98
|
'5b02b9f5e3aad0a0dbc8982119ced400': this.propertyJob,
|
99
|
+
'0a4afb675c0a9e20782a12f7f6e870c2': this.recurringQueryJob,
|
95
100
|
b7d57d912c9514786071e4e4e804db13: this.refreshPropertyCacheJob,
|
96
101
|
'64724c02cc076f23566976dc765eb6b6': this.relationshipMapperJob,
|
97
102
|
'7676ffc477bc85ccfd8418b70f2377c9': this.reportColumnSyncJob,
|
98
103
|
bb97644f2c505dc135d01f4c6959ec1f: this.scheduledEventJob,
|
99
104
|
eedbbd37e8ca956ab13f24b5028aaa83: this.setEventQueueJob,
|
105
|
+
'6f2c6980763ef0de2b4b7ee850319f6b': this.setRecurringQueryEventJob,
|
100
106
|
'40d4fd2c9c09856b54d90643c5f03171': this.setScheduledEventJob,
|
101
107
|
'568a28e3b79c7a722c9ec0d0b55515c6': this.smsMessageJob,
|
102
108
|
'844b338ab982fd3e1cf1cea14cfc361d': this.sqsPollingJob,
|
@@ -113,8 +119,7 @@ let Es6JobsService = class Es6JobsService {
|
|
113
119
|
exports.Es6JobsService = Es6JobsService;
|
114
120
|
exports.Es6JobsService = Es6JobsService = __decorate([
|
115
121
|
(0, common_1.Injectable)(),
|
116
|
-
__metadata("design:paramtypes", [
|
117
|
-
client_credential_job_1.ClientCredentialJob,
|
122
|
+
__metadata("design:paramtypes", [client_credential_job_1.ClientCredentialJob,
|
118
123
|
client_job_1.ClientJob,
|
119
124
|
code_fix_log_job_1.CodeFixLogJob,
|
120
125
|
code_fix_script_job_1.CodeFixScriptJob,
|
@@ -123,17 +128,20 @@ exports.Es6JobsService = Es6JobsService = __decorate([
|
|
123
128
|
credential_ip_job_1.CredentialIpJob,
|
124
129
|
document_job_1.DocumentJob,
|
125
130
|
execute_code_fix_job_1.ExecuteCodeFixJob,
|
131
|
+
execute_recurring_query_job_1.ExecuteRecurringQueryJob,
|
126
132
|
mail_event_job_1.MailEventJob,
|
127
133
|
mail_recipient_job_1.MailRecipientJob,
|
128
134
|
mail_validation_job_1.MailValidationJob,
|
129
135
|
mobile_validation_job_1.MobileValidationJob,
|
130
136
|
model_scanner_job_1.ModelScannerJob,
|
131
137
|
property_job_1.PropertyJob,
|
138
|
+
recurring_query_job_1.RecurringQueryJob,
|
132
139
|
refresh_property_cache_job_1.RefreshPropertyCacheJob,
|
133
140
|
relationship_mapper_job_1.RelationshipMapperJob,
|
134
141
|
report_column_sync_job_1.ReportColumnSyncJob,
|
135
142
|
scheduled_event_job_1.ScheduledEventJob,
|
136
143
|
set_event_queue_job_1.SetEventQueueJob,
|
144
|
+
set_recurring_query_event_job_1.SetRecurringQueryEventJob,
|
137
145
|
set_scheduled_event_job_1.SetScheduledEventJob,
|
138
146
|
sms_message_job_1.SmsMessageJob,
|
139
147
|
sqs_polling_job_1.SqsPollingJob,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/system/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,
|
1
|
+
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/system/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAAoE;AACpE,mDAA+C;AAC/C,+DAAyD;AACzD,qEAA+D;AAC/D,iEAA4D;AAC5D,qDAAiD;AACjD,iEAA4D;AAC5D,uDAAmD;AACnD,uEAAiE;AACjE,qFAA+E;AAC/E,2DAAsD;AACtD,mEAA8D;AAC9D,qEAAgE;AAChE,yEAAoE;AACpE,iEAA4D;AAC5D,uDAAmD;AACnD,qEAAgE;AAChE,mFAA6E;AAC7E,6EAAwE;AACxE,2EAAqE;AACrE,qEAAgE;AAChE,qEAA+D;AAC/D,yFAAkF;AAClF,6EAAuE;AACvE,6DAAwD;AACxD,6DAAwD;AACxD,iEAA2D;AAC3D,yEAAmE;AACnE,iFAA2E;AAC3E,qEAA+D;AAC/D,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,mBAAwC,EACxC,SAAoB,EACpB,aAA4B,EAC5B,gBAAkC,EAClC,eAAgC,EAChC,UAAsB,EACtB,eAAgC,EAChC,WAAwB,EACxB,iBAAoC,EACpC,wBAAkD,EAClD,Y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AAoB;YAC7D,kCAAkC,EAAE,IAAI,CAAC,aAAa;YACtD,kCAAkC,EAAE,IAAI,CAAC,aAAa;YACtD,kCAAkC,EAAE,IAAI,CAAC,cAAc;YACvD,gCAAgC,EAAE,IAAI,CAAC,kBAAkB;YACzD,kCAAkC,EAAE,IAAI,CAAC,sBAAsB;YAC/D,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;SAC5D,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AArFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAKiC,2CAAmB;QAC7B,sBAAS;QACL,gCAAa;QACV,sCAAgB;QACjB,mCAAe;QACpB,wBAAU;QACL,mCAAe;QACnB,0BAAW;QACL,wCAAiB;QACV,sDAAwB;QACpC,6BAAY;QACR,qCAAgB;QACf,uCAAiB;QACf,2CAAmB;QACvB,mCAAe;QACnB,0BAAW;QACL,uCAAiB;QACX,oDAAuB;QACzB,+CAAqB;QACvB,4CAAmB;QACrB,uCAAiB;QAClB,sCAAgB;QACP,yDAAyB;QAC9B,8CAAoB;QAC3B,+BAAa;QACb,+BAAa;QACZ,kCAAc;QACV,0CAAkB;QACd,kDAAsB;QAC5B,sCAAgB;GAjC9C,cAAc,CAqF1B"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SourceColumnDto } from '../../platformUtility/dtos/source.column.dto';
|
1
2
|
import { SqlService } from '../../platformUtility/services/sql.service';
|
2
3
|
import { EventQueueEntity } from '../entities/event.queue.entity';
|
3
4
|
import { ScheduledEventEntity } from '../entities/scheduled.event.entity';
|
@@ -6,12 +7,9 @@ export declare class ScheduledEventService {
|
|
6
7
|
private readonly propertyService;
|
7
8
|
protected readonly sqlService: SqlService;
|
8
9
|
constructor(propertyService: PropertyService, sqlService: SqlService);
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
deleteActiveEvents(id: number): Promise<EventQueueEntity[]>;
|
13
|
-
setNewEvent(job: ScheduledEventEntity, scheduledTime: Date): Promise<EventQueueEntity>;
|
14
|
-
createEventsForJob(job: ScheduledEventEntity): Promise<ScheduledEventEntity>;
|
10
|
+
getActiveEventsSummary(source: SourceColumnDto): Promise<any>;
|
11
|
+
deleteActiveEvents(source: SourceColumnDto): Promise<EventQueueEntity[]>;
|
12
|
+
getSchedules(source: SourceColumnDto, timing: string, startDate: Date, endDate: Date): Promise<any[]>;
|
15
13
|
getActiveSchedules(): Promise<ScheduledEventEntity[]>;
|
16
14
|
private getScheduleStartTime;
|
17
15
|
private withTimezoneOffset;
|