@servicelabsco/nestjs-utility-services 1.2.116 → 1.2.117
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 +3 -1
- package/dist/app.controller.js +6 -2
- package/dist/app.controller.js.map +1 -1
- package/dist/platformUtility/es6.classes.d.ts +2 -2
- package/dist/platformUtility/services/audit.service.d.ts +2 -0
- package/dist/platformUtility/services/audit.service.js +7 -0
- package/dist/platformUtility/services/audit.service.js.map +1 -1
- package/dist/platformUtility/subscribers/base.subscriber.d.ts +2 -0
- package/dist/platformUtility/subscribers/base.subscriber.js +14 -7
- package/dist/platformUtility/subscribers/base.subscriber.js.map +1 -1
- package/package.json +1 -1
package/dist/app.controller.d.ts
CHANGED
@@ -7,6 +7,7 @@ import { ExecuteCodeFixJob } from './system/jobs/execute.code.fix.job';
|
|
7
7
|
import { SetScheduledEventJob } from './system/jobs/set.scheduled.event.job';
|
8
8
|
import { PropertyService } from './system/services/property.service';
|
9
9
|
import { SyncAllCodeJob } from './system/jobs/sync.all.code.job';
|
10
|
+
import { AuditService } from './platformUtility/services/audit.service';
|
10
11
|
export declare class AppController {
|
11
12
|
private readonly queueService;
|
12
13
|
protected readonly testJob: TestJob;
|
@@ -16,7 +17,8 @@ export declare class AppController {
|
|
16
17
|
protected readonly sqlService: SqlService;
|
17
18
|
protected readonly executeCodeFixJob: ExecuteCodeFixJob;
|
18
19
|
protected readonly syncAllCodeJob: SyncAllCodeJob;
|
19
|
-
|
20
|
+
protected readonly auditService: AuditService;
|
21
|
+
constructor(queueService: QueueService, testJob: TestJob, setScheduledEventJob: SetScheduledEventJob, mailService: MailService, propertyService: PropertyService, sqlService: SqlService, executeCodeFixJob: ExecuteCodeFixJob, syncAllCodeJob: SyncAllCodeJob, auditService: AuditService);
|
20
22
|
get(): Promise<{
|
21
23
|
message: string;
|
22
24
|
}>;
|
package/dist/app.controller.js
CHANGED
@@ -23,8 +23,9 @@ const execute_code_fix_job_1 = require("./system/jobs/execute.code.fix.job");
|
|
23
23
|
const set_scheduled_event_job_1 = require("./system/jobs/set.scheduled.event.job");
|
24
24
|
const property_service_1 = require("./system/services/property.service");
|
25
25
|
const sync_all_code_job_1 = require("./system/jobs/sync.all.code.job");
|
26
|
+
const audit_service_1 = require("./platformUtility/services/audit.service");
|
26
27
|
let AppController = class AppController {
|
27
|
-
constructor(queueService, testJob, setScheduledEventJob, mailService, propertyService, sqlService, executeCodeFixJob, syncAllCodeJob) {
|
28
|
+
constructor(queueService, testJob, setScheduledEventJob, mailService, propertyService, sqlService, executeCodeFixJob, syncAllCodeJob, auditService) {
|
28
29
|
this.queueService = queueService;
|
29
30
|
this.testJob = testJob;
|
30
31
|
this.setScheduledEventJob = setScheduledEventJob;
|
@@ -33,6 +34,7 @@ let AppController = class AppController {
|
|
33
34
|
this.sqlService = sqlService;
|
34
35
|
this.executeCodeFixJob = executeCodeFixJob;
|
35
36
|
this.syncAllCodeJob = syncAllCodeJob;
|
37
|
+
this.auditService = auditService;
|
36
38
|
}
|
37
39
|
async get() {
|
38
40
|
return { message: 'Hello World!' };
|
@@ -54,6 +56,7 @@ let AppController = class AppController {
|
|
54
56
|
return this.setScheduledEventJob.dispatch();
|
55
57
|
}
|
56
58
|
async test() {
|
59
|
+
return this.auditService.isLocallyAuditEnabled();
|
57
60
|
return this.syncAllCodeJob.dispatch();
|
58
61
|
}
|
59
62
|
async pause(query) {
|
@@ -138,6 +141,7 @@ exports.AppController = AppController = __decorate([
|
|
138
141
|
property_service_1.PropertyService,
|
139
142
|
sql_service_1.SqlService,
|
140
143
|
execute_code_fix_job_1.ExecuteCodeFixJob,
|
141
|
-
sync_all_code_job_1.SyncAllCodeJob
|
144
|
+
sync_all_code_job_1.SyncAllCodeJob,
|
145
|
+
audit_service_1.AuditService])
|
142
146
|
], AppController);
|
143
147
|
//# sourceMappingURL=app.controller.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAE1E,kDAA+C;AAC/C,8DAA0D;AAC1D,0EAAsE;AACtE,4EAAwE;AACxE,wEAAoE;AACpE,6EAAuE;AACvE,mFAA6E;AAC7E,yEAAqE;AACrE,uEAAiE;
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAE1E,kDAA+C;AAC/C,8DAA0D;AAC1D,0EAAsE;AACtE,4EAAwE;AACxE,wEAAoE;AACpE,6EAAuE;AACvE,mFAA6E;AAC7E,yEAAqE;AACrE,uEAAiE;AACjE,4EAAwE;AAIjE,IAAM,aAAa,GAAnB,MAAM,aAAa;IACtB,YACqB,YAA0B,EACxB,OAAgB,EAChB,oBAA0C,EAC1C,WAAwB,EACxB,eAAgC,EAChC,UAAsB,EACtB,iBAAoC,EACpC,cAA8B,EAC9B,YAA0B;QAR5B,iBAAY,GAAZ,YAAY,CAAc;QACxB,YAAO,GAAP,OAAO,CAAS;QAChB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,gBAAW,GAAX,WAAW,CAAa;QACxB,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAY;QACtB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;IAC9C,CAAC;IAGE,AAAN,KAAK,CAAC,GAAG;QACL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACvC,CAAC;IAQK,AAAN,KAAK,CAAC,iBAAiB;QACnB,OAAO,WAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO;QACT,OAAO,WAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAU,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,IAAA,YAAG,EAAC,KAAK,CAAC;;;;yCAIV;AAGK;IADL,IAAA,YAAG,EAAC,OAAO,CAAC;IACA,WAAA,IAAA,cAAK,GAAE,CAAA;;;;0CAEnB;AAGK;IADL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACA,WAAA,IAAA,cAAK,GAAE,CAAA;;;;2CAEpB;wBAjEQ,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAG0B,4BAAY;QACf,kBAAO;QACM,8CAAoB;QAC7B,0BAAW;QACP,kCAAe;QACpB,wBAAU;QACH,wCAAiB;QACpB,kCAAc;QAChB,4BAAY;GAVxC,aAAa,CAkEzB"}
|
@@ -70,9 +70,9 @@ declare const es6Classes: {
|
|
70
70
|
dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof SourceColumnDto | typeof CommonAttributesDto | typeof AwsConfigDto | typeof MailOptionsDto | typeof SmtpConfigDto | typeof RemoteRawResponseDto | typeof FcmResponseDto | typeof KaleyraCallbackPayloadDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof SetSmsPayloadDto | typeof SmsPayloadDto | typeof StringSearchDto)[];
|
71
71
|
entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
|
72
72
|
jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof ProcessSesDeliveryWebhookJob | typeof ProcessTrackingWebhookJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob)[];
|
73
|
-
libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof ProcessSesRawMail | typeof ProcessSmtpMail | typeof
|
73
|
+
libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof ProcessSesRawMail | typeof ProcessSmtpMail | typeof ProcessAuditLogData | typeof CommonSqsPolling | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof SetSmsMessage)[];
|
74
74
|
middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
|
75
|
-
services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof MailService | typeof SqlService | typeof DynamoService | typeof
|
75
|
+
services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof MailService | typeof SqlService | typeof DynamoService | typeof AuditService | typeof MaintenanceService | typeof RemoteRequestService | typeof SesMailNotificationService | typeof AwsSecretService | typeof Es6JobsService | typeof FcmNotificationService | typeof ShutdownService | typeof SmsService | typeof StartupService)[];
|
76
76
|
subscribers: (typeof BaseSubscriber)[];
|
77
77
|
};
|
78
78
|
export default es6Classes;
|
@@ -5,6 +5,7 @@ import { DynamoService } from './dynamo.service';
|
|
5
5
|
export declare class AuditService {
|
6
6
|
private readonly dynamoService;
|
7
7
|
private readonly propertyService;
|
8
|
+
private locallyEnabled;
|
8
9
|
private toIgnore;
|
9
10
|
private refreshTime;
|
10
11
|
private auditTable;
|
@@ -14,4 +15,5 @@ export declare class AuditService {
|
|
14
15
|
getSourceAuditLogs(sourcehash: string, id: number): Promise<any[]>;
|
15
16
|
private getDataFromDynamo;
|
16
17
|
getAuditTable(): Promise<string>;
|
18
|
+
isLocallyAuditEnabled(): Promise<any>;
|
17
19
|
}
|
@@ -23,6 +23,7 @@ let AuditService = class AuditService {
|
|
23
23
|
constructor(dynamoService, propertyService) {
|
24
24
|
this.dynamoService = dynamoService;
|
25
25
|
this.propertyService = propertyService;
|
26
|
+
this.locallyEnabled = null;
|
26
27
|
this.toIgnore = ['created_at', 'updated_at', 'created_by', 'updated_by', 'attributes'];
|
27
28
|
this.auditTable = null;
|
28
29
|
}
|
@@ -86,6 +87,12 @@ let AuditService = class AuditService {
|
|
86
87
|
this.auditTable = await this.propertyService.get('audit.table.name', false);
|
87
88
|
return this.auditTable;
|
88
89
|
}
|
90
|
+
async isLocallyAuditEnabled() {
|
91
|
+
if (this.locallyEnabled !== null)
|
92
|
+
return this.locallyEnabled;
|
93
|
+
this.locallyEnabled = process.env.AUDIT_DISABLED !== 'true';
|
94
|
+
return this.locallyEnabled;
|
95
|
+
}
|
89
96
|
};
|
90
97
|
exports.AuditService = AuditService;
|
91
98
|
exports.AuditService = AuditService = __decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"audit.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/audit.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAsC;AAEtC,sDAAmD;AACnD,8EAA0E;AAC1E,6EAAyE;AACzE,gFAA0E;AAC1E,uFAAmF;AACnF,uEAAmE;AACnE,qDAAiD;AAQ1C,IAAM,YAAY,GAAlB,MAAM,YAAY;
|
1
|
+
{"version":3,"file":"audit.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/audit.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAsC;AAEtC,sDAAmD;AACnD,8EAA0E;AAC1E,6EAAyE;AACzE,gFAA0E;AAC1E,uFAAmF;AACnF,uEAAmE;AACnE,qDAAiD;AAQ1C,IAAM,YAAY,GAAlB,MAAM,YAAY;IA8BrB,YACqB,aAA4B,EAC5B,eAAgC;QADhC,kBAAa,GAAb,aAAa,CAAe;QAC5B,oBAAe,GAAf,eAAe,CAAiB;QA/B7C,mBAAc,GAAG,IAAI,CAAC;QAMtB,aAAQ,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QAelF,eAAU,GAAG,IAAI,CAAC;IAWvB,CAAC;IAQJ,KAAK,CAAC,cAAc,CAAC,KAA4B;QAE7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG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eAAe,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAE5E,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAOD,KAAK,CAAC,qBAAqB;QACvB,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,cAAc,CAAC;QAE7D,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,CAAC;QAC5D,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;CACJ,CAAA;AAhKY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAgC2B,8BAAa;QACX,kCAAe;GAhC5C,YAAY,CAgKxB"}
|
@@ -2,6 +2,7 @@ import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
|
|
2
2
|
import { CommonSubscriber } from '../../common/libraries/common.subscriber';
|
3
3
|
import { RecordWatcherJob } from '../jobs/record.watcher.job';
|
4
4
|
import { AuditService } from '../services/audit.service';
|
5
|
+
import 'dotenv/config';
|
5
6
|
export declare class BaseSubscriber extends CommonSubscriber<any> {
|
6
7
|
private readonly recordWatcherJob;
|
7
8
|
private readonly auditService;
|
@@ -10,4 +11,5 @@ export declare class BaseSubscriber extends CommonSubscriber<any> {
|
|
10
11
|
afterInsert(event: InsertEvent<any>): Promise<void>;
|
11
12
|
beforeUpdate(event: UpdateEvent<any>): void;
|
12
13
|
afterUpdate(event: UpdateEvent<any>): Promise<void>;
|
14
|
+
private isAuditEnabled;
|
13
15
|
}
|
@@ -16,6 +16,7 @@ const common_subscriber_1 = require("../../common/libraries/common.subscriber");
|
|
16
16
|
const date_util_1 = require("../../common/libraries/date.util");
|
17
17
|
const record_watcher_job_1 = require("../jobs/record.watcher.job");
|
18
18
|
const audit_service_1 = require("../services/audit.service");
|
19
|
+
require("dotenv/config");
|
19
20
|
let BaseSubscriber = class BaseSubscriber extends common_subscriber_1.CommonSubscriber {
|
20
21
|
constructor(dataSource, recordWatcherJob, auditService) {
|
21
22
|
super();
|
@@ -35,10 +36,7 @@ let BaseSubscriber = class BaseSubscriber extends common_subscriber_1.CommonSubs
|
|
35
36
|
}
|
36
37
|
}
|
37
38
|
async afterInsert(event) {
|
38
|
-
const
|
39
|
-
if (shouldWatchRecord === false)
|
40
|
-
return;
|
41
|
-
const isAuditEnabled = await this.auditService.getAuditTable();
|
39
|
+
const isAuditEnabled = await this.isAuditEnabled(event);
|
42
40
|
if (!isAuditEnabled)
|
43
41
|
return;
|
44
42
|
const data = this.getEventData(event);
|
@@ -53,14 +51,23 @@ let BaseSubscriber = class BaseSubscriber extends common_subscriber_1.CommonSubs
|
|
53
51
|
}
|
54
52
|
}
|
55
53
|
async afterUpdate(event) {
|
56
|
-
const
|
54
|
+
const isAuditEnabled = await this.isAuditEnabled(event);
|
55
|
+
if (!isAuditEnabled)
|
56
|
+
return;
|
57
|
+
const data = this.getEventData(event);
|
58
|
+
return this.recordWatcherJob.delayedDispatch(data);
|
59
|
+
}
|
60
|
+
async isAuditEnabled(evt) {
|
61
|
+
const shouldWatchRecord = evt?.entity?.enableRecordWatcher;
|
57
62
|
if (shouldWatchRecord === false)
|
58
63
|
return;
|
64
|
+
const isLocallyEnabled = await this.auditService.isLocallyAuditEnabled();
|
65
|
+
if (!isLocallyEnabled)
|
66
|
+
return;
|
59
67
|
const isAuditEnabled = await this.auditService.getAuditTable();
|
60
68
|
if (!isAuditEnabled)
|
61
69
|
return;
|
62
|
-
|
63
|
-
return this.recordWatcherJob.delayedDispatch(data);
|
70
|
+
return true;
|
64
71
|
}
|
65
72
|
};
|
66
73
|
exports.BaseSubscriber = BaseSubscriber;
|
@@ -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,mEA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