@servicelabsco/nestjs-utility-services 1.1.54 → 1.1.55
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.controller.d.ts +4 -8
- package/dist/app.controller.js +11 -14
- package/dist/app.controller.js.map +1 -1
- package/dist/app.module.js +3 -1
- package/dist/app.module.js.map +1 -1
- package/dist/auth/auth.module.js +1 -1
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/controllers/auth.controller.d.ts +6 -5
- package/dist/auth/controllers/auth.controller.js +0 -1
- package/dist/auth/controllers/auth.controller.js.map +1 -1
- package/dist/auth/controllers/social.controller.d.ts +6 -4
- package/dist/auth/controllers/social.controller.js.map +1 -1
- package/dist/auth/middlewares/internal.middleware.js +1 -0
- package/dist/auth/middlewares/internal.middleware.js.map +1 -1
- package/dist/common/es6.classes.d.ts +1 -1
- package/dist/common/libraries/common.entity.d.ts +1 -0
- package/dist/common/libraries/common.entity.js +4 -0
- package/dist/common/libraries/common.entity.js.map +1 -1
- package/dist/common/libraries/common.job.d.ts +1 -0
- package/dist/common/libraries/common.job.js +1 -0
- package/dist/common/libraries/common.job.js.map +1 -1
- package/dist/config/entity.constants.d.ts +4 -0
- package/dist/config/entity.constants.js +4 -0
- package/dist/config/entity.constants.js.map +1 -1
- package/dist/migrations/1678730411972-CreatePendingBullJobTable.d.ts +5 -0
- package/dist/migrations/1678730411972-CreatePendingBullJobTable.js +24 -0
- package/dist/migrations/1678730411972-CreatePendingBullJobTable.js.map +1 -0
- package/dist/migrations/1678789489235-CreateFailedBullJobTable.d.ts +5 -0
- package/dist/migrations/1678789489235-CreateFailedBullJobTable.js +27 -0
- package/dist/migrations/1678789489235-CreateFailedBullJobTable.js.map +1 -0
- package/dist/platformUtility/consumers/job.consumer.d.ts +1 -0
- package/dist/platformUtility/consumers/job.consumer.js +14 -0
- package/dist/platformUtility/consumers/job.consumer.js.map +1 -1
- package/dist/platformUtility/controllers/bull.job.controller.js +1 -0
- package/dist/platformUtility/controllers/bull.job.controller.js.map +1 -1
- package/dist/platformUtility/controllers/queue.controller.js.map +1 -1
- package/dist/platformUtility/dtos/failed.bull.job.attributes.dto.d.ts +3 -0
- package/dist/platformUtility/dtos/failed.bull.job.attributes.dto.js +8 -0
- package/dist/platformUtility/dtos/failed.bull.job.attributes.dto.js.map +1 -0
- package/dist/platformUtility/dtos/pending.bull.job.attributes.dto.d.ts +3 -0
- package/dist/platformUtility/dtos/pending.bull.job.attributes.dto.js +8 -0
- package/dist/platformUtility/dtos/pending.bull.job.attributes.dto.js.map +1 -0
- package/dist/platformUtility/entities/failed.bull.job.entity.d.ts +15 -0
- package/dist/platformUtility/entities/failed.bull.job.entity.js +66 -0
- package/dist/platformUtility/entities/failed.bull.job.entity.js.map +1 -0
- package/dist/platformUtility/entities/index.d.ts +2 -0
- package/dist/platformUtility/entities/index.js +19 -0
- package/dist/platformUtility/entities/index.js.map +1 -0
- package/dist/platformUtility/entities/pending.bull.job.entity.d.ts +12 -0
- package/dist/platformUtility/entities/pending.bull.job.entity.js +54 -0
- package/dist/platformUtility/entities/pending.bull.job.entity.js.map +1 -0
- package/dist/platformUtility/es6.classes.d.ts +9 -4
- package/dist/platformUtility/es6.classes.js +10 -1
- package/dist/platformUtility/es6.classes.js.map +1 -1
- package/dist/platformUtility/index.d.ts +1 -0
- package/dist/platformUtility/index.js +1 -0
- package/dist/platformUtility/index.js.map +1 -1
- package/dist/platformUtility/jobs/failed.bull.job.job.d.ts +7 -0
- package/dist/platformUtility/jobs/failed.bull.job.job.js +29 -0
- package/dist/platformUtility/jobs/failed.bull.job.job.js.map +1 -0
- package/dist/platformUtility/jobs/index.d.ts +2 -0
- package/dist/platformUtility/jobs/index.js +2 -0
- package/dist/platformUtility/jobs/index.js.map +1 -1
- package/dist/platformUtility/jobs/load.failed.bull.job.d.ts +9 -0
- package/dist/platformUtility/jobs/load.failed.bull.job.js +54 -0
- package/dist/platformUtility/jobs/load.failed.bull.job.js.map +1 -0
- package/dist/platformUtility/jobs/pending.bull.job.job.d.ts +7 -0
- package/dist/platformUtility/jobs/pending.bull.job.job.js +29 -0
- package/dist/platformUtility/jobs/pending.bull.job.job.js.map +1 -0
- package/dist/platformUtility/jobs/reload.pending.bull.job.d.ts +7 -0
- package/dist/platformUtility/jobs/reload.pending.bull.job.js +39 -0
- package/dist/platformUtility/jobs/reload.pending.bull.job.js.map +1 -0
- package/dist/platformUtility/jobs/test.job.d.ts +0 -1
- package/dist/platformUtility/jobs/test.job.js +0 -4
- package/dist/platformUtility/jobs/test.job.js.map +1 -1
- package/dist/platformUtility/platform.utility.module.js +3 -2
- package/dist/platformUtility/platform.utility.module.js.map +1 -1
- package/dist/platformUtility/services/cache.service.js +0 -1
- package/dist/platformUtility/services/cache.service.js.map +1 -1
- package/dist/platformUtility/services/es6.jobs.service.d.ts +5 -1
- package/dist/platformUtility/services/es6.jobs.service.js +10 -2
- package/dist/platformUtility/services/es6.jobs.service.js.map +1 -1
- package/dist/platformUtility/services/queue.service.d.ts +7 -1
- package/dist/platformUtility/services/queue.service.js +30 -3
- package/dist/platformUtility/services/queue.service.js.map +1 -1
- package/dist/platformUtility/subscribers/base.subscriber.d.ts +1 -1
- package/dist/platformUtility/subscribers/base.subscriber.js +12 -4
- package/dist/platformUtility/subscribers/base.subscriber.js.map +1 -1
- package/dist/platformUtility/subscribers/failed.bull.job.subscriber.d.ts +12 -0
- package/dist/platformUtility/subscribers/failed.bull.job.subscriber.js +40 -0
- package/dist/platformUtility/subscribers/failed.bull.job.subscriber.js.map +1 -0
- package/dist/platformUtility/subscribers/pending.bull.job.subscriber.d.ts +12 -0
- package/dist/platformUtility/subscribers/pending.bull.job.subscriber.js +40 -0
- package/dist/platformUtility/subscribers/pending.bull.job.subscriber.js.map +1 -0
- package/dist/system/controllers/index.d.ts +0 -1
- package/dist/system/controllers/index.js +0 -1
- package/dist/system/controllers/index.js.map +1 -1
- package/dist/system/entities/property.entity.d.ts +1 -0
- package/dist/system/entities/property.entity.js +4 -0
- package/dist/system/entities/property.entity.js.map +1 -1
- package/dist/system/es6.classes.d.ts +4 -5
- package/dist/system/es6.classes.js +0 -2
- package/dist/system/es6.classes.js.map +1 -1
- package/dist/system/jobs/property.job.d.ts +4 -4
- package/dist/system/jobs/property.job.js +5 -13
- package/dist/system/jobs/property.job.js.map +1 -1
- package/dist/system/services/property.service.d.ts +2 -1
- package/dist/system/services/property.service.js +10 -0
- package/dist/system/services/property.service.js.map +1 -1
- package/dist/system/system.module.js +1 -1
- package/dist/system/system.module.js.map +1 -1
- package/package.json +4 -5
@@ -1,12 +1,16 @@
|
|
1
|
+
import { LoadFailedBullJob } from '../jobs/load.failed.bull.job';
|
1
2
|
import { RecordWatcherJob } from '../jobs/record.watcher.job';
|
3
|
+
import { ReloadPendingBullJob } from '../jobs/reload.pending.bull.job';
|
2
4
|
import { TestJob } from '../jobs/test.job';
|
3
5
|
import { LocalPropertyService } from '../../platformUtility/services/local.property.service';
|
4
6
|
export declare class Es6JobsService {
|
7
|
+
private readonly loadFailedBullJob;
|
5
8
|
private readonly recordWatcherJob;
|
9
|
+
private readonly reloadPendingBullJob;
|
6
10
|
private readonly testJob;
|
7
11
|
private readonly localPropertyService;
|
8
12
|
private jobs;
|
9
|
-
constructor(recordWatcherJob: RecordWatcherJob, testJob: TestJob, localPropertyService: LocalPropertyService);
|
13
|
+
constructor(loadFailedBullJob: LoadFailedBullJob, recordWatcherJob: RecordWatcherJob, reloadPendingBullJob: ReloadPendingBullJob, testJob: TestJob, localPropertyService: LocalPropertyService);
|
10
14
|
alignJobs(): void;
|
11
15
|
setJobs(): void;
|
12
16
|
}
|
@@ -11,12 +11,16 @@ 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 load_failed_bull_job_1 = require("../jobs/load.failed.bull.job");
|
14
15
|
const record_watcher_job_1 = require("../jobs/record.watcher.job");
|
16
|
+
const reload_pending_bull_job_1 = require("../jobs/reload.pending.bull.job");
|
15
17
|
const test_job_1 = require("../jobs/test.job");
|
16
18
|
const local_property_service_1 = require("../../platformUtility/services/local.property.service");
|
17
19
|
let Es6JobsService = class Es6JobsService {
|
18
|
-
constructor(recordWatcherJob, testJob, localPropertyService) {
|
20
|
+
constructor(loadFailedBullJob, recordWatcherJob, reloadPendingBullJob, testJob, localPropertyService) {
|
21
|
+
this.loadFailedBullJob = loadFailedBullJob;
|
19
22
|
this.recordWatcherJob = recordWatcherJob;
|
23
|
+
this.reloadPendingBullJob = reloadPendingBullJob;
|
20
24
|
this.testJob = testJob;
|
21
25
|
this.localPropertyService = localPropertyService;
|
22
26
|
this.jobs = {};
|
@@ -25,7 +29,9 @@ let Es6JobsService = class Es6JobsService {
|
|
25
29
|
}
|
26
30
|
alignJobs() {
|
27
31
|
this.jobs = {
|
32
|
+
'6370c1c0c8441652f5fd8e99291c213a': this.loadFailedBullJob,
|
28
33
|
'3873104b5fa6f9569331cfc3103bda43': this.recordWatcherJob,
|
34
|
+
'922b153398482362e7398f0f835827bd': this.reloadPendingBullJob,
|
29
35
|
b20ed62e97fbef22a56c84c4908996a6: this.testJob,
|
30
36
|
};
|
31
37
|
}
|
@@ -36,7 +42,9 @@ let Es6JobsService = class Es6JobsService {
|
|
36
42
|
};
|
37
43
|
Es6JobsService = __decorate([
|
38
44
|
(0, common_1.Injectable)(),
|
39
|
-
__metadata("design:paramtypes", [
|
45
|
+
__metadata("design:paramtypes", [load_failed_bull_job_1.LoadFailedBullJob,
|
46
|
+
record_watcher_job_1.RecordWatcherJob,
|
47
|
+
reload_pending_bull_job_1.ReloadPendingBullJob,
|
40
48
|
test_job_1.TestJob,
|
41
49
|
local_property_service_1.LocalPropertyService])
|
42
50
|
], Es6JobsService);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mEAA8D;AAC9D,+CAA2C;AAC3C,kGAA6F;AAQtF,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,gBAAkC,EAClC,OAAgB,EAChB,oBAA0C;
|
1
|
+
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAiE;AACjE,mEAA8D;AAC9D,6EAAuE;AACvE,+CAA2C;AAC3C,kGAA6F;AAQtF,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,iBAAoC,EACpC,gBAAkC,EAClC,oBAA0C,EAC1C,OAAgB,EAChB,oBAA0C;QAJ1C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,YAAO,GAAP,OAAO,CAAS;QAChB,yBAAoB,GAApB,oBAAoB,CAAsB;QAPvD,SAAI,GAAG,EAAE,CAAC;QASd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,kCAAkC,EAAE,IAAI,CAAC,iBAAiB;YAC1D,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;YACzD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,gCAAgC,EAAE,IAAI,CAAC,OAAO;SACjD,CAAC;IACN,CAAC;IAMD,OAAO;QACH,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,kCAC7B,YAAY,GACZ,IAAI,CAAC,IAAI,EACd,CAAC;IACP,CAAC;CACJ,CAAA;AAtCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK+B,wCAAiB;QAClB,qCAAgB;QACZ,8CAAoB;QACjC,kBAAO;QACM,6CAAoB;GARtD,cAAc,CAsC1B;AAtCY,wCAAc"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Logger } from '@nestjs/common';
|
2
2
|
import { Job, Queue } from 'bull';
|
3
|
+
import { PropertyService } from '../../system/services/property.service';
|
3
4
|
import { QueueOptionsDto } from '../dtos/queue.options.dto';
|
4
5
|
import { LocalPropertyService } from './local.property.service';
|
5
6
|
import { SqsService } from './sqs.service';
|
@@ -7,9 +8,12 @@ export declare class QueueService {
|
|
7
8
|
private readonly businessQueue;
|
8
9
|
private readonly localPropertyService;
|
9
10
|
readonly sqsService: SqsService;
|
11
|
+
private readonly propertyService;
|
10
12
|
data: any;
|
11
13
|
protected logger: Logger;
|
12
|
-
|
14
|
+
private drainPropertyName;
|
15
|
+
private shouldDrain;
|
16
|
+
constructor(businessQueue: Queue, localPropertyService: LocalPropertyService, sqsService: SqsService, propertyService: PropertyService);
|
13
17
|
add(type: string, data: any, options?: QueueOptionsDto): Promise<Job>;
|
14
18
|
addJob(type: string, data: any, options?: QueueOptionsDto, eventId?: number): Promise<Job | any>;
|
15
19
|
addSqsJob(mode: any, payload: any): Promise<any>;
|
@@ -30,4 +34,6 @@ export declare class QueueService {
|
|
30
34
|
removeJob(jobId: number): Promise<void>;
|
31
35
|
private getJobMetadata;
|
32
36
|
isWorkerInstance(): boolean;
|
37
|
+
shouldJobBeDrained(): boolean;
|
38
|
+
setQueueDrainCheck(): Promise<void>;
|
33
39
|
}
|
@@ -18,17 +18,20 @@ const common_1 = require("@nestjs/common");
|
|
18
18
|
const config = require("config");
|
19
19
|
const date_util_1 = require("../../common/libraries/date.util");
|
20
20
|
const platform_constants_1 = require("../../config/platform.constants");
|
21
|
+
const property_service_1 = require("../../system/services/property.service");
|
21
22
|
const operation_exception_1 = require("./../../common/exceptions/operation.exception");
|
22
23
|
const local_property_service_1 = require("./local.property.service");
|
23
24
|
const sqs_service_1 = require("./sqs.service");
|
24
25
|
const queueName = platform_constants_1.default.queue;
|
25
26
|
let QueueService = class QueueService {
|
26
|
-
constructor(businessQueue, localPropertyService, sqsService) {
|
27
|
+
constructor(businessQueue, localPropertyService, sqsService, propertyService) {
|
27
28
|
this.businessQueue = businessQueue;
|
28
29
|
this.localPropertyService = localPropertyService;
|
29
30
|
this.sqsService = sqsService;
|
31
|
+
this.propertyService = propertyService;
|
30
32
|
this.data = {};
|
31
33
|
this.logger = new common_1.Logger('EventQueueManager');
|
34
|
+
this.drainPropertyName = 'bull.queue.should.drain';
|
32
35
|
this.data = {
|
33
36
|
start_time: date_util_1.DateUtil.now(),
|
34
37
|
stats: { completed_jobs: 0, failed_jobs: 0, pending_jobs: 0 },
|
@@ -123,7 +126,8 @@ let QueueService = class QueueService {
|
|
123
126
|
}
|
124
127
|
async retryJob(jobId) {
|
125
128
|
const job = await this.businessQueue.getJob(jobId);
|
126
|
-
|
129
|
+
if (job)
|
130
|
+
await job.retry();
|
127
131
|
return job;
|
128
132
|
}
|
129
133
|
async removeJob(jobId) {
|
@@ -151,12 +155,35 @@ let QueueService = class QueueService {
|
|
151
155
|
const worker = process.env.QUEUE_WORKER_ENABLE || config.get('queue.worker');
|
152
156
|
return worker ? true : false;
|
153
157
|
}
|
158
|
+
shouldJobBeDrained() {
|
159
|
+
return this.shouldDrain || false;
|
160
|
+
}
|
161
|
+
async setQueueDrainCheck() {
|
162
|
+
if (this.shouldDrain !== undefined)
|
163
|
+
return;
|
164
|
+
this.shouldDrain = false;
|
165
|
+
const interval = await this.propertyService.get('bull.queue.drain.check.frequency', 15000);
|
166
|
+
setInterval(async () => {
|
167
|
+
const p = await this.propertyService.getFromDb(this.drainPropertyName, '0');
|
168
|
+
if (p === '1') {
|
169
|
+
if (!this.shouldDrain)
|
170
|
+
this.logger.log(`Enabling draining of jobs from queue to db`);
|
171
|
+
this.shouldDrain = true;
|
172
|
+
}
|
173
|
+
else {
|
174
|
+
if (this.shouldDrain)
|
175
|
+
this.logger.log(`Disabling of draining of jobs from queue to db`);
|
176
|
+
this.shouldDrain = false;
|
177
|
+
}
|
178
|
+
}, +interval);
|
179
|
+
}
|
154
180
|
};
|
155
181
|
QueueService = __decorate([
|
156
182
|
(0, common_1.Injectable)(),
|
157
183
|
__param(0, (0, bull_1.InjectQueue)(queueName)),
|
158
184
|
__metadata("design:paramtypes", [Object, local_property_service_1.LocalPropertyService,
|
159
|
-
sqs_service_1.SqsService
|
185
|
+
sqs_service_1.SqsService,
|
186
|
+
property_service_1.PropertyService])
|
160
187
|
], QueueService);
|
161
188
|
exports.QueueService = QueueService;
|
162
189
|
//# sourceMappingURL=queue.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"queue.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAAoD;AAEpD,iCAAiC;AACjC,gEAA4D;AAC5D,wEAAgE;
|
1
|
+
{"version":3,"file":"queue.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAAoD;AAEpD,iCAAiC;AACjC,gEAA4D;AAC5D,wEAAgE;AAChE,6EAAyE;AAEzE,uFAAmF;AACnF,qEAAgE;AAChE,+CAA2C;AAE3C,MAAM,SAAS,GAAG,4BAAiB,CAAC,KAAK,CAAC;AAQnC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAiBrB,YAC6C,aAAoB,EAC5C,oBAA0C,EAC3C,UAAsB,EACrB,eAAgC;QAHR,kBAAa,GAAb,aAAa,CAAO;QAC5C,yBAAoB,GAApB,oBAAoB,CAAsB;QAC3C,eAAU,GAAV,UAAU,CAAY;QACrB,oBAAe,GAAf,eAAe,CAAiB;QAf9C,SAAI,GAAQ,EAAE,CAAC;QACZ,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,oCAAY"}
|
@@ -6,6 +6,6 @@ export declare class BaseSubscriber extends CommonSubscriber<any> {
|
|
6
6
|
constructor(dataSource: DataSource, recordWatcherJob: RecordWatcherJob);
|
7
7
|
beforeInsert(event: InsertEvent<any>): void;
|
8
8
|
afterInsert(event: InsertEvent<any>): Promise<void>;
|
9
|
-
afterUpdate(event: UpdateEvent<any>): Promise<void>;
|
10
9
|
beforeUpdate(event: UpdateEvent<any>): void;
|
10
|
+
afterUpdate(event: UpdateEvent<any>): Promise<void>;
|
11
11
|
}
|
@@ -33,13 +33,13 @@ let BaseSubscriber = class BaseSubscriber extends common_subscriber_1.CommonSubs
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
async afterInsert(event) {
|
36
|
+
var _a;
|
37
|
+
const shouldWatchRecord = (_a = event === null || event === void 0 ? void 0 : event.entity) === null || _a === void 0 ? void 0 : _a.enableRecordWatcher;
|
38
|
+
if (shouldWatchRecord === false)
|
39
|
+
return;
|
36
40
|
const object = this.getInsertEventData(event);
|
37
41
|
await this.recordWatcherJob.dispatch(object);
|
38
42
|
}
|
39
|
-
async afterUpdate(event) {
|
40
|
-
const object = this.getUpdateEventData(event);
|
41
|
-
await this.recordWatcherJob.dispatch(object);
|
42
|
-
}
|
43
43
|
beforeUpdate(event) {
|
44
44
|
if (!event.entity)
|
45
45
|
return;
|
@@ -48,6 +48,14 @@ let BaseSubscriber = class BaseSubscriber extends common_subscriber_1.CommonSubs
|
|
48
48
|
event.entity.updated_by = auth_1.Auth.id();
|
49
49
|
}
|
50
50
|
}
|
51
|
+
async afterUpdate(event) {
|
52
|
+
var _a;
|
53
|
+
const shouldWatchRecord = (_a = event === null || event === void 0 ? void 0 : event.entity) === null || _a === void 0 ? void 0 : _a.enableRecordWatcher;
|
54
|
+
if (shouldWatchRecord === false)
|
55
|
+
return;
|
56
|
+
const object = this.getUpdateEventData(event);
|
57
|
+
await this.recordWatcherJob.dispatch(object);
|
58
|
+
}
|
51
59
|
};
|
52
60
|
BaseSubscriber = __decorate([
|
53
61
|
(0, typeorm_1.EventSubscriber)(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/base.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgF;AAChF,sDAAmD;AACnD,gFAA4E;AAC5E,gEAA4D;AAC5D,mEAA8D;AASvD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,oCAAqB;IAOrD,YAAY,UAAsB,EAAmB,gBAAkC;QACnF,KAAK,EAAE,CAAC;QADyC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAEnF,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAOD,YAAY,CAAC,KAAuB;QAChC,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO;QAE1B,MAAM,IAAI,GAAG,oBAAQ,CAAC,WAAW,EAAE,CAAC;QAEpC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QAC/B,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QAG/B,IAAI,WAAI,CAAC,KAAK,EAAE,EAAE;YACd,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,WAAI,CAAC,EAAE,EAAE,CAAC;YACpC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,WAAI,CAAC,EAAE,EAAE,CAAC;SACvC;IACL,CAAC;IAQD,KAAK,CAAC,WAAW,CAAC,KAAuB
|
1
|
+
{"version":3,"file":"base.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/base.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgF;AAChF,sDAAmD;AACnD,gFAA4E;AAC5E,gEAA4D;AAC5D,mEAA8D;AASvD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,oCAAqB;IAOrD,YAAY,UAAsB,EAAmB,gBAAkC;QACnF,KAA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,iBAAiB,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,mBAAmB,CAAC;QAC7D,IAAI,iBAAiB,KAAK,KAAK;YAAE,OAAO;QAExC,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AA1EY,cAAc;IAD1B,IAAA,yBAAe,GAAE;qCAQU,oBAAU,EAAqC,qCAAgB;GAP9E,cAAc,CA0E1B;AA1EY,wCAAc"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CommonSubscriber } from '@servicelabsco/nestjs-utility-services';
|
2
|
+
import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
|
3
|
+
import { FailedBullJobEntity } from '../entities/failed.bull.job.entity';
|
4
|
+
import { FailedBullJobJob } from '../jobs/failed.bull.job.job';
|
5
|
+
export declare class FailedBullJobSubscriber extends CommonSubscriber<FailedBullJobEntity> {
|
6
|
+
private readonly dataSource;
|
7
|
+
private readonly failedBullJobJob;
|
8
|
+
constructor(dataSource: DataSource, failedBullJobJob: FailedBullJobJob);
|
9
|
+
listenTo(): typeof FailedBullJobEntity;
|
10
|
+
afterInsert(event: InsertEvent<FailedBullJobEntity>): Promise<void>;
|
11
|
+
afterUpdate(event: UpdateEvent<FailedBullJobEntity>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,40 @@
|
|
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 _a;
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.FailedBullJobSubscriber = void 0;
|
14
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
15
|
+
const typeorm_1 = require("typeorm");
|
16
|
+
const failed_bull_job_entity_1 = require("../entities/failed.bull.job.entity");
|
17
|
+
const failed_bull_job_job_1 = require("../jobs/failed.bull.job.job");
|
18
|
+
let FailedBullJobSubscriber = class FailedBullJobSubscriber extends nestjs_utility_services_1.CommonSubscriber {
|
19
|
+
constructor(dataSource, failedBullJobJob) {
|
20
|
+
super();
|
21
|
+
this.dataSource = dataSource;
|
22
|
+
this.failedBullJobJob = failedBullJobJob;
|
23
|
+
dataSource.subscribers.push(this);
|
24
|
+
}
|
25
|
+
listenTo() {
|
26
|
+
return failed_bull_job_entity_1.FailedBullJobEntity;
|
27
|
+
}
|
28
|
+
async afterInsert(event) {
|
29
|
+
await this.failedBullJobJob.delayedDispatch(this.getEventData(event));
|
30
|
+
}
|
31
|
+
async afterUpdate(event) {
|
32
|
+
await this.failedBullJobJob.delayedDispatch(this.getEventData(event));
|
33
|
+
}
|
34
|
+
};
|
35
|
+
FailedBullJobSubscriber = __decorate([
|
36
|
+
(0, typeorm_1.EventSubscriber)(),
|
37
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource, typeof (_a = typeof failed_bull_job_job_1.FailedBullJobJob !== "undefined" && failed_bull_job_job_1.FailedBullJobJob) === "function" ? _a : Object])
|
38
|
+
], FailedBullJobSubscriber);
|
39
|
+
exports.FailedBullJobSubscriber = FailedBullJobSubscriber;
|
40
|
+
//# sourceMappingURL=failed.bull.job.subscriber.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"failed.bull.job.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/failed.bull.job.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oFAA0E;AAC1E,qCAAgF;AAChF,+EAAyE;AACzE,qEAA+D;AAExD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,0CAAqC;IAC9E,YAA6B,UAAsB,EAAmB,gBAAkC;QACpG,KAAK,EAAE,CAAC;QADiB,eAAU,GAAV,UAAU,CAAY;QAAmB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAEpG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ;QACJ,OAAO,4CAAmB,CAAC;IAC/B,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,KAAuC;QACrD,MAAM,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAuC;QACrD,MAAM,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AAfY,uBAAuB;IADnC,IAAA,yBAAe,GAAE;qCAE2B,oBAAU,sBAAqC,sCAAgB,oBAAhB,sCAAgB;GAD/F,uBAAuB,CAenC;AAfY,0DAAuB"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CommonSubscriber } from '@servicelabsco/nestjs-utility-services';
|
2
|
+
import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
|
3
|
+
import { PendingBullJobEntity } from '../entities/pending.bull.job.entity';
|
4
|
+
import { PendingBullJobJob } from '../jobs/pending.bull.job.job';
|
5
|
+
export declare class PendingBullJobSubscriber extends CommonSubscriber<PendingBullJobEntity> {
|
6
|
+
private readonly dataSource;
|
7
|
+
private readonly pendingBullJobJob;
|
8
|
+
constructor(dataSource: DataSource, pendingBullJobJob: PendingBullJobJob);
|
9
|
+
listenTo(): typeof PendingBullJobEntity;
|
10
|
+
afterInsert(event: InsertEvent<PendingBullJobEntity>): Promise<void>;
|
11
|
+
afterUpdate(event: UpdateEvent<PendingBullJobEntity>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,40 @@
|
|
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 _a;
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.PendingBullJobSubscriber = void 0;
|
14
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
15
|
+
const typeorm_1 = require("typeorm");
|
16
|
+
const pending_bull_job_entity_1 = require("../entities/pending.bull.job.entity");
|
17
|
+
const pending_bull_job_job_1 = require("../jobs/pending.bull.job.job");
|
18
|
+
let PendingBullJobSubscriber = class PendingBullJobSubscriber extends nestjs_utility_services_1.CommonSubscriber {
|
19
|
+
constructor(dataSource, pendingBullJobJob) {
|
20
|
+
super();
|
21
|
+
this.dataSource = dataSource;
|
22
|
+
this.pendingBullJobJob = pendingBullJobJob;
|
23
|
+
dataSource.subscribers.push(this);
|
24
|
+
}
|
25
|
+
listenTo() {
|
26
|
+
return pending_bull_job_entity_1.PendingBullJobEntity;
|
27
|
+
}
|
28
|
+
async afterInsert(event) {
|
29
|
+
await this.pendingBullJobJob.delayedDispatch(this.getEventData(event));
|
30
|
+
}
|
31
|
+
async afterUpdate(event) {
|
32
|
+
await this.pendingBullJobJob.delayedDispatch(this.getEventData(event));
|
33
|
+
}
|
34
|
+
};
|
35
|
+
PendingBullJobSubscriber = __decorate([
|
36
|
+
(0, typeorm_1.EventSubscriber)(),
|
37
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource, typeof (_a = typeof pending_bull_job_job_1.PendingBullJobJob !== "undefined" && pending_bull_job_job_1.PendingBullJobJob) === "function" ? _a : Object])
|
38
|
+
], PendingBullJobSubscriber);
|
39
|
+
exports.PendingBullJobSubscriber = PendingBullJobSubscriber;
|
40
|
+
//# sourceMappingURL=pending.bull.job.subscriber.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pending.bull.job.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/pending.bull.job.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oFAA0E;AAC1E,qCAAgF;AAChF,iFAA2E;AAC3E,uEAAiE;AAE1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,0CAAsC;IAChF,YAA6B,UAAsB,EAAmB,iBAAoC;QACtG,KAAK,EAAE,CAAC;QADiB,eAAU,GAAV,UAAU,CAAY;QAAmB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEtG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ;QACJ,OAAO,8CAAoB,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,KAAwC;QACtD,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAwC;QACtD,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AAfY,wBAAwB;IADpC,IAAA,yBAAe,GAAE;qCAE2B,oBAAU,sBAAsC,wCAAiB,oBAAjB,wCAAiB;GADjG,wBAAwB,CAepC;AAfY,4DAAwB"}
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base.controller"), exports);
|
18
18
|
__exportStar(require("./data.controller"), exports);
|
19
19
|
__exportStar(require("./form.controller"), exports);
|
20
|
-
__exportStar(require("./job.controller"), exports);
|
21
20
|
__exportStar(require("./menu.controller"), exports);
|
22
21
|
__exportStar(require("./preference.controller"), exports);
|
23
22
|
__exportStar(require("./report.controller"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC;AAClC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC;AAClC,0DAAwC;AACxC,sDAAoC;AACpC,sDAAoC;AACpC,+DAA6C"}
|
@@ -14,6 +14,10 @@ const class_validator_1 = require("class-validator");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
15
15
|
const common_entity_1 = require("../../common/libraries/common.entity");
|
16
16
|
let PropertyEntity = class PropertyEntity extends common_entity_1.CommonEntity {
|
17
|
+
constructor() {
|
18
|
+
super(...arguments);
|
19
|
+
this.enableRecordWatcher = false;
|
20
|
+
}
|
17
21
|
};
|
18
22
|
__decorate([
|
19
23
|
(0, class_validator_1.IsNotEmpty)(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property.entity.js","sourceRoot":"","sources":["../../../src/system/entities/property.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6C;AAC7C,qCAAyC;AACzC,wEAAoE;AAS7D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;
|
1
|
+
{"version":3,"file":"property.entity.js","sourceRoot":"","sources":["../../../src/system/entities/property.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6C;AAC7C,qCAAyC;AACzC,wEAAoE;AAS7D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAAzC;;QACO,wBAAmB,GAAY,KAAK,CAAC;IASnD,CAAC;CAAA,CAAA;AAPG;IAAC,IAAA,4BAAU,GAAE;IAAE,IAAA,gBAAM,GAAE;;4CAAc;AACrC;IAAC,IAAA,4BAAU,GAAE;IAAE,IAAA,gBAAM,GAAE;;6CAAe;AACtC;IAAC,IAAA,gBAAM,GAAE;;0DAA6B;AACtC;IAAC,IAAA,gBAAM,GAAE;;oDAAuB;AAChC;IAAC,IAAA,4BAAU,GAAE;IAAE,IAAA,gBAAM,GAAE;;mDAAqB;AAPnC,cAAc;IAD1B,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,cAAc,CAU1B;AAVY,wCAAc"}
|
@@ -9,7 +9,6 @@ import { SyncAllCommand } from './commands/sync.all.command';
|
|
9
9
|
import { BaseController } from './controllers/base.controller';
|
10
10
|
import { DataController } from './controllers/data.controller';
|
11
11
|
import { FormController } from './controllers/form.controller';
|
12
|
-
import { JobController } from './controllers/job.controller';
|
13
12
|
import { MenuController } from './controllers/menu.controller';
|
14
13
|
import { PreferenceController } from './controllers/preference.controller';
|
15
14
|
import { ReportController } from './controllers/report.controller';
|
@@ -124,10 +123,10 @@ import { UserGroupPermissionSubscriber } from './subscribers/user.group.permissi
|
|
124
123
|
import { UserGroupRoleSubscriber } from './subscribers/user.group.role.subscriber';
|
125
124
|
declare const es6Classes: {
|
126
125
|
commands: (typeof DbScannerCommand | typeof DynamoScannerCommand | typeof EventQueueCommand | typeof JobsScannerCommand | typeof ModelScannerCommand | typeof ReportScannerCommand | typeof ServiceScannerCommand | typeof SyncAllCommand)[];
|
127
|
-
controllers: (typeof BaseController | typeof DataController | typeof FormController | typeof
|
128
|
-
dtos: (typeof DocumentAttributesDto | typeof
|
129
|
-
entities: (typeof LookupTypeEntity | typeof UserGroupRoleEntity | typeof UserGroupEntity | typeof UserGroupMemberEntity | typeof BusinessRuleRoleEntity | typeof BusinessRuleEntity | typeof ColumnDefinitionEntity | typeof ColumnEntity | typeof ModelEntity | typeof FormPreferenceEntity | typeof ModelColumnEntity | typeof RelationshipEntity | typeof ModelRelationshipEntity | typeof ModelRoleEntity | typeof FormColumnEntity | typeof SystemScriptEntity | typeof UiActionPermissionEntity | typeof UiActionEntity | typeof UiActionRoleEntity | typeof PrimaryAxisEntity | typeof ChartEntity | typeof ClientScriptEntity | typeof CommentEntity | typeof DocumentEntity | typeof DynamoTableEntity | typeof
|
130
|
-
jobs: (typeof ModelScannerJob | typeof ReportColumnSyncJob | typeof ScheduledEventJob | typeof CleanScheduledEventJob | typeof ColumnMapperJob | typeof
|
126
|
+
controllers: (typeof BaseController | typeof DataController | typeof FormController | typeof MenuController | typeof PreferenceController | typeof UploadController | typeof UserPreferenceController | typeof ReportController)[];
|
127
|
+
dtos: (typeof DocumentAttributesDto | typeof ModelFormPreferenceCreationDto | typeof S3UploadOptionsDto | typeof LocalFileS3UploadDto | typeof S3ObjectInfoDto | typeof FileUploadSpecDto | typeof UserPreferenceCreationDto | typeof JobRecordParamDto | typeof ModelAllowedColumnDto)[];
|
128
|
+
entities: (typeof LookupTypeEntity | typeof UserGroupRoleEntity | typeof UserGroupEntity | typeof UserGroupMemberEntity | typeof BusinessRuleRoleEntity | typeof BusinessRuleEntity | typeof ColumnDefinitionEntity | typeof ColumnEntity | typeof ModelEntity | typeof FormPreferenceEntity | typeof ModelColumnEntity | typeof RelationshipEntity | typeof ModelRelationshipEntity | typeof ModelRoleEntity | typeof FormColumnEntity | typeof SystemScriptEntity | typeof UiActionPermissionEntity | typeof UiActionEntity | typeof UiActionRoleEntity | typeof PrimaryAxisEntity | typeof ChartEntity | typeof ClientScriptEntity | typeof CommentEntity | typeof DocumentEntity | typeof DynamoTableEntity | typeof EventDetailEntity | typeof EventQueueEntity | typeof ReportColumnEntity | typeof ReportEntity | typeof ReportRelationshipEntity | typeof ReportRoleEntity | typeof ServiceEntity | typeof SecurityRuleEntity | typeof MailLogEntity | typeof MenuRoleEntity | typeof MenuEntity | typeof ModuleEntity | typeof ModuleMenuEntity | typeof PageDefinitionEntity | typeof ParentMenuEntity | typeof OpenPropertyEntity | typeof ReportFilterEntity | typeof ScheduledEventEntity | typeof SmsTemplateEntity | typeof SmsMessageEntity | typeof UserGroupPermissionEntity | typeof UserPreferenceEntity | typeof WhatsappTemplateEntity)[];
|
129
|
+
jobs: (typeof ModelScannerJob | typeof ReportColumnSyncJob | typeof ScheduledEventJob | typeof CleanScheduledEventJob | typeof ColumnMapperJob | typeof RefreshPropertyCacheJob | typeof PropertyJob | typeof RelationshipMapperJob | typeof ScheduledEventsJob | typeof UserGroupMemberJob | typeof UserGroupPermissionJob | typeof UserGroupRoleJob)[];
|
131
130
|
libraries: (typeof SyncDynamoTables | typeof ModelSync | typeof SecurityRuleEvaluator | typeof ColumnManager | typeof BusinessRuleFilterValidator | typeof BusinessRuleQueryEvaluator)[];
|
132
131
|
modifiers: (typeof MenuListModifier | typeof ModuleListModifier)[];
|
133
132
|
services: (typeof PropertyService | typeof EventQueueService | typeof EventDetailService | typeof SecurityRuleService | typeof UiActionService | typeof ModelService | typeof CommonService | typeof ClientScriptService | typeof PreferenceService | typeof BusinessRuleService | typeof ListService | typeof FormService | typeof MenuService | typeof UserPreferenceService | typeof ReportService | typeof AwsS3Service | typeof UploadService | typeof ScheduledEventService | typeof ColumnService | typeof CommentService | typeof DocumentService | typeof Es6JobsService | typeof Es6Service)[];
|
@@ -11,7 +11,6 @@ const sync_all_command_1 = require("./commands/sync.all.command");
|
|
11
11
|
const base_controller_1 = require("./controllers/base.controller");
|
12
12
|
const data_controller_1 = require("./controllers/data.controller");
|
13
13
|
const form_controller_1 = require("./controllers/form.controller");
|
14
|
-
const job_controller_1 = require("./controllers/job.controller");
|
15
14
|
const menu_controller_1 = require("./controllers/menu.controller");
|
16
15
|
const preference_controller_1 = require("./controllers/preference.controller");
|
17
16
|
const report_controller_1 = require("./controllers/report.controller");
|
@@ -147,7 +146,6 @@ const es6Classes = {
|
|
147
146
|
base_controller_1.BaseController,
|
148
147
|
data_controller_1.DataController,
|
149
148
|
form_controller_1.FormController,
|
150
|
-
job_controller_1.JobController,
|
151
149
|
menu_controller_1.MenuController,
|
152
150
|
preference_controller_1.PreferenceController,
|
153
151
|
report_controller_1.ReportController,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/system/es6.classes.ts"],"names":[],"mappings":";;AAAA,sEAAiE;AACjE,8EAAyE;AACzE,wEAAmE;AACnE,0EAAqE;AACrE,4EAAuE;AACvE,8EAAyE;AACzE,gFAA2E;AAC3E,kEAA6D;AAC7D,mEAA+D;AAC/D,mEAA+D;AAC/D,mEAA+D;AAC/D,
|
1
|
+
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/system/es6.classes.ts"],"names":[],"mappings":";;AAAA,sEAAiE;AACjE,8EAAyE;AACzE,wEAAmE;AACnE,0EAAqE;AACrE,4EAAuE;AACvE,8EAAyE;AACzE,gFAA2E;AAC3E,kEAA6D;AAC7D,mEAA+D;AAC/D,mEAA+D;AAC/D,mEAA+D;AAC/D,mEAA+D;AAC/D,+EAA2E;AAC3E,uEAAmE;AACnE,uEAAmE;AACnE,yFAAoF;AACpF,4EAAuE;AACvE,sEAAgE;AAChE,sEAAgE;AAChE,8EA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AAC;AAEF,kBAAe,UAAU,CAAC"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { CommonJob, DatabaseEventDto } from '../../common';
|
2
2
|
import { QueueService } from '../../platformUtility';
|
3
3
|
import { PropertyEntity } from '../entities';
|
4
|
-
import {
|
4
|
+
import { RefreshPropertyCacheJob } from './refresh.property.cache.job';
|
5
5
|
export declare class PropertyJob extends CommonJob {
|
6
6
|
protected readonly queueService: QueueService;
|
7
|
-
private readonly
|
8
|
-
constructor(queueService: QueueService,
|
9
|
-
handle(event: DatabaseEventDto<PropertyEntity>): Promise<
|
7
|
+
private readonly refreshPropertyCacheJob;
|
8
|
+
constructor(queueService: QueueService, refreshPropertyCacheJob: RefreshPropertyCacheJob);
|
9
|
+
handle(event: DatabaseEventDto<PropertyEntity>): Promise<void>;
|
10
10
|
}
|
@@ -13,28 +13,20 @@ exports.PropertyJob = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const common_2 = require("../../common");
|
15
15
|
const platformUtility_1 = require("../../platformUtility");
|
16
|
-
const
|
17
|
-
const date_util_1 = require("../../common/libraries/date.util");
|
18
|
-
const custom_crypt_1 = require("../../common/libraries/custom.crypt");
|
16
|
+
const refresh_property_cache_job_1 = require("./refresh.property.cache.job");
|
19
17
|
let PropertyJob = class PropertyJob extends common_2.CommonJob {
|
20
|
-
constructor(queueService,
|
18
|
+
constructor(queueService, refreshPropertyCacheJob) {
|
21
19
|
super();
|
22
20
|
this.queueService = queueService;
|
23
|
-
this.
|
21
|
+
this.refreshPropertyCacheJob = refreshPropertyCacheJob;
|
24
22
|
}
|
25
23
|
async handle(event) {
|
26
|
-
|
27
|
-
if (!entity.is_caching_enabled)
|
28
|
-
return;
|
29
|
-
let value = entity.value;
|
30
|
-
if (entity.is_encrypted)
|
31
|
-
value = custom_crypt_1.CustomCrypt.decrypt(value);
|
32
|
-
return this.cacheService.set(`property.${entity.name}`, value, date_util_1.DateUtil.getFutureDateTime(15));
|
24
|
+
await this.refreshPropertyCacheJob.delayedDispatch(event.entity);
|
33
25
|
}
|
34
26
|
};
|
35
27
|
PropertyJob = __decorate([
|
36
28
|
(0, common_1.Injectable)(),
|
37
|
-
__metadata("design:paramtypes", [platformUtility_1.QueueService,
|
29
|
+
__metadata("design:paramtypes", [platformUtility_1.QueueService, refresh_property_cache_job_1.RefreshPropertyCacheJob])
|
38
30
|
], PropertyJob);
|
39
31
|
exports.PropertyJob = PropertyJob;
|
40
32
|
//# sourceMappingURL=property.job.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property.job.js","sourceRoot":"","sources":["../../../src/system/jobs/property.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAA2D;AAC3D,2DAAqD;
|
1
|
+
{"version":3,"file":"property.job.js","sourceRoot":"","sources":["../../../src/system/jobs/property.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAA2D;AAC3D,2DAAqD;AAGrD,6EAAuE;AAShE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,kBAAS;IAOtC,YAA+B,YAA0B,EAAmB,uBAAgD;QACxH,KAAK,EAAE,CAAC;QADmB,iBAAY,GAAZ,YAAY,CAAc;QAAmB,4BAAuB,GAAvB,uBAAuB,CAAyB;IAE5H,CAAC;IAQD,KAAK,CAAC,MAAM,CAAC,KAAuC;QAChD,MAAM,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AApBY,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAQoC,8BAAY,EAA4C,oDAAuB;GAPnH,WAAW,CAoBvB;AApBY,kCAAW"}
|
@@ -4,5 +4,6 @@ export declare class PropertyService {
|
|
4
4
|
private readonly cacheService;
|
5
5
|
constructor(cacheService: CacheService);
|
6
6
|
get(key: string, defaultValue?: any): Promise<string>;
|
7
|
-
|
7
|
+
getFromDb(key: string, defaultValue?: any): Promise<string>;
|
8
|
+
set(property: Partial<PropertyEntity>): Promise<PropertyEntity>;
|
8
9
|
}
|
@@ -37,6 +37,16 @@ let PropertyService = class PropertyService {
|
|
37
37
|
}
|
38
38
|
return pValue;
|
39
39
|
}
|
40
|
+
async getFromDb(key, defaultValue) {
|
41
|
+
defaultValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : null;
|
42
|
+
const property = await property_entity_1.PropertyEntity.findOne({ where: { name: key } });
|
43
|
+
if (!property)
|
44
|
+
return defaultValue;
|
45
|
+
let pValue = property.value;
|
46
|
+
if (property.is_encrypted)
|
47
|
+
pValue = custom_crypt_1.CustomCrypt.decrypt(pValue);
|
48
|
+
return pValue;
|
49
|
+
}
|
40
50
|
async set(property) {
|
41
51
|
const record = await property_entity_1.PropertyEntity.firstOrNew({
|
42
52
|
name: property.name,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property.service.js","sourceRoot":"","sources":["../../../src/system/services/property.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,gFAA4E;AAC5E,gEAA4D;AAC5D,iEAA6D;AAC7D,sEAAkE;AAClE,yDAA0D;AAQnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAMxB,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAS3D,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,YAAkB;QACrC,YAAY,GAAG,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,IAAI,CAAC;QAEpC,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEvD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,gCAAc,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAA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E3B;AAxEY,0CAAe"}
|
@@ -16,7 +16,7 @@ let SystemModule = class SystemModule {
|
|
16
16
|
};
|
17
17
|
SystemModule = __decorate([
|
18
18
|
(0, common_1.Module)({
|
19
|
-
imports: [typeorm_1.TypeOrmModule.forFeature(es6_classes_1.default.entities), auth_module_1.AuthModule, platform_utility_module_1.PlatformUtilityModule],
|
19
|
+
imports: [typeorm_1.TypeOrmModule.forFeature(es6_classes_1.default.entities), (0, common_1.forwardRef)(() => auth_module_1.AuthModule), (0, common_1.forwardRef)(() => platform_utility_module_1.PlatformUtilityModule)],
|
20
20
|
controllers: es6_classes_1.default.controllers,
|
21
21
|
providers: [...es6_classes_1.default.services, ...es6_classes_1.default.commands, ...es6_classes_1.default.subscribers, ...es6_classes_1.default.jobs],
|
22
22
|
exports: [...es6_classes_1.default.services, ...es6_classes_1.default.jobs],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"system.module.js","sourceRoot":"","sources":["../../src/system/system.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"system.module.js","sourceRoot":"","sources":["../../src/system/system.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,qDAAiD;AACjD,wFAAmF;AACnF,+CAAuC;AAQhC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IANxB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,qBAAU,CAAC,QAAQ,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC,CAAC;QAC/H,WAAW,EAAE,qBAAU,CAAC,WAAW;QACnC,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,WAAW,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;QAC1G,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;KACxD,CAAC;GACW,YAAY,CAAG;AAAf,oCAAY"}
|