@servicelabsco/nestjs-utility-services 2.0.0 → 2.0.1
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 +1 -74
- package/dist/app.controller.js +1 -357
- package/dist/app.controller.js.map +1 -1
- package/dist/common/es6.classes.js +2 -0
- package/dist/common/es6.classes.js.map +1 -1
- package/dist/common/libraries/auth.js +1 -1
- package/dist/common/libraries/auth.js.map +1 -1
- package/dist/common/libraries/custom.logger.d.ts +7 -0
- package/dist/common/libraries/custom.logger.js +33 -0
- package/dist/common/libraries/custom.logger.js.map +1 -0
- package/dist/common/libraries/hash.d.ts +1 -1
- package/dist/common/libraries/index.d.ts +1 -0
- package/dist/common/libraries/index.js +1 -0
- package/dist/common/libraries/index.js.map +1 -1
- package/dist/health.check.controller.d.ts +4 -1
- package/dist/health.check.controller.js +72 -2
- package/dist/health.check.controller.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/migrations/1770625065996-AddIdentifierSysDocumentsTable.ts.d.ts +5 -0
- package/dist/migrations/1770625065996-AddIdentifierSysDocumentsTable.ts.js +15 -0
- package/dist/migrations/1770625065996-AddIdentifierSysDocumentsTable.ts.js.map +1 -0
- package/dist/platformUtility/dtos/index.d.ts +1 -0
- package/dist/platformUtility/dtos/index.js +1 -0
- package/dist/platformUtility/dtos/index.js.map +1 -1
- package/dist/platformUtility/dtos/lambda.zip.dto.d.ts +4 -0
- package/dist/platformUtility/dtos/lambda.zip.dto.js +27 -0
- package/dist/platformUtility/dtos/lambda.zip.dto.js.map +1 -0
- package/dist/platformUtility/es6.classes.d.ts +4 -2
- package/dist/platformUtility/es6.classes.js +4 -0
- package/dist/platformUtility/es6.classes.js.map +1 -1
- package/dist/platformUtility/services/es6.service.d.ts +3 -1
- package/dist/platformUtility/services/es6.service.js +6 -2
- package/dist/platformUtility/services/es6.service.js.map +1 -1
- package/dist/platformUtility/services/index.d.ts +1 -0
- package/dist/platformUtility/services/index.js +1 -0
- package/dist/platformUtility/services/index.js.map +1 -1
- package/dist/platformUtility/services/mail.service.js +5 -0
- package/dist/platformUtility/services/mail.service.js.map +1 -1
- package/dist/platformUtility/services/zip.service.d.ts +16 -0
- package/dist/platformUtility/services/zip.service.js +107 -0
- package/dist/platformUtility/services/zip.service.js.map +1 -0
- package/dist/system/entities/document.entity.d.ts +1 -0
- package/dist/system/entities/document.entity.js +4 -0
- package/dist/system/entities/document.entity.js.map +1 -1
- package/dist/system/services/document.service.d.ts +3 -2
- package/dist/system/services/document.service.js +6 -3
- package/dist/system/services/document.service.js.map +1 -1
- package/dist/system/services/scheduled.event.service.js +4 -3
- package/dist/system/services/scheduled.event.service.js.map +1 -1
- package/package.json +10 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CommonService } from '../../common/libraries/common.service';
|
|
1
2
|
import { SourceColumnDto } from '../../platformUtility/dtos/source.column.dto';
|
|
2
3
|
import { FileUploadDto } from '../dtos/file.upload.dto';
|
|
3
4
|
import { DocumentEntity } from '../entities/document.entity';
|
|
4
|
-
import { CommonService } from '../../common/libraries/common.service';
|
|
5
5
|
export declare class DocumentService extends CommonService {
|
|
6
6
|
protected publicExposed: boolean;
|
|
7
7
|
getDocuments(query: {
|
|
@@ -9,7 +9,8 @@ export declare class DocumentService extends CommonService {
|
|
|
9
9
|
source_id: number;
|
|
10
10
|
type_id?: number;
|
|
11
11
|
limit?: number;
|
|
12
|
+
identifier?: string;
|
|
12
13
|
}): Promise<any[]>;
|
|
13
|
-
setDocument(source: SourceColumnDto, file: FileUploadDto): Promise<DocumentEntity>;
|
|
14
|
+
setDocument(source: SourceColumnDto, file: FileUploadDto, identifier?: string): Promise<DocumentEntity>;
|
|
14
15
|
setDocuments(source: SourceColumnDto, files: FileUploadDto[]): Promise<DocumentEntity[]>;
|
|
15
16
|
}
|
|
@@ -10,22 +10,24 @@ exports.DocumentService = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const typeorm_1 = require("typeorm");
|
|
12
12
|
const access_exception_1 = require("../../common/exceptions/access.exception");
|
|
13
|
+
const common_service_1 = require("../../common/libraries/common.service");
|
|
13
14
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
|
14
15
|
const document_entity_1 = require("../entities/document.entity");
|
|
15
|
-
const common_service_1 = require("../../common/libraries/common.service");
|
|
16
16
|
let DocumentService = class DocumentService extends common_service_1.CommonService {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.publicExposed = true;
|
|
20
20
|
}
|
|
21
21
|
async getDocuments(query) {
|
|
22
|
+
const take = query.limit || 100;
|
|
23
|
+
delete query.limit;
|
|
22
24
|
return document_entity_1.DocumentEntity.find({
|
|
23
25
|
where: { ...query, document_url: (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) },
|
|
24
26
|
relations: ['creator'],
|
|
25
|
-
take
|
|
27
|
+
take,
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
|
-
async setDocument(source, file) {
|
|
30
|
+
async setDocument(source, file, identifier) {
|
|
29
31
|
if (!file.document_url)
|
|
30
32
|
return;
|
|
31
33
|
if (!platform_utility_1.PlatformUtility.isValidUrl(file.document_url))
|
|
@@ -40,6 +42,7 @@ let DocumentService = class DocumentService extends common_service_1.CommonServi
|
|
|
40
42
|
if (!document?.id && file.type_id)
|
|
41
43
|
document.type_id = file.type_id;
|
|
42
44
|
document.attributes = { ...document.attributes, ...file.attributes, comments: file.comments };
|
|
45
|
+
document.identifier = identifier || document.identifier;
|
|
43
46
|
return document.save();
|
|
44
47
|
}
|
|
45
48
|
async setDocuments(source, files) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.service.js","sourceRoot":"","sources":["../../../src/system/services/document.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAsC;AACtC,+EAA2E;AAC3E,8EAA0E;AAG1E,iEAA6D;
|
|
1
|
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wCAAwC,CAAC,CAAC;QAExE,IAAI,CAAC,QAAQ,EAAE,EAAE;YAAE,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7D,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,IAAI,CAAC,OAAO;YAAE,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAEnE,QAAQ,CAAC,UAAU,GAAG,EAAE,GAAG,QAAQ,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE9F,QAAQ,CAAC,UAAU,GAAG,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC;QAExD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAQD,KAAK,CAAC,YAAY,CAAC,MAAuB,EAAE,KAAsB;QAC9D,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC;YAAE,OAAO;QAEpD,MAAM,GAAG,GAAG,EAAE,CAAC;QAEf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC/C,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CACJ,CAAA;AAtEY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;GACA,eAAe,CAsE3B"}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ScheduledEventService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
-
const
|
|
14
|
+
const cron_parser_1 = require("cron-parser");
|
|
15
15
|
const date_fns_1 = require("date-fns");
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
17
|
const date_util_1 = require("../../common/libraries/date.util");
|
|
@@ -49,13 +49,14 @@ let ScheduledEventService = class ScheduledEventService {
|
|
|
49
49
|
lastRunTime = lastRunTime < startDate ? startDate : lastRunTime;
|
|
50
50
|
if (lastRunTime > endDate)
|
|
51
51
|
return;
|
|
52
|
-
const nextTime =
|
|
52
|
+
const nextTime = cron_parser_1.CronExpressionParser.parse(timing, {
|
|
53
53
|
currentDate: lastRunTime,
|
|
54
54
|
endDate,
|
|
55
|
+
tz: 'UTC',
|
|
55
56
|
});
|
|
56
57
|
while (dates.length <= +maxCount) {
|
|
57
58
|
if (!nextTime.hasNext())
|
|
58
|
-
|
|
59
|
+
break;
|
|
59
60
|
const next = nextTime.next().toDate();
|
|
60
61
|
const date = await this.withTimezoneOffset(next);
|
|
61
62
|
if (date < now)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled.event.service.js","sourceRoot":"","sources":["../../../src/system/services/scheduled.event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"scheduled.event.service.js","sourceRoot":"","sources":["../../../src/system/services/scheduled.event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,uCAAkD;AAClD,qCAAiE;AACjE,gEAA4D;AAE5D,4EAAwE;AACxE,uEAAkE;AAClE,+EAA0E;AAC1E,yDAAqD;AAS9C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAM9B,YACqB,eAAgC,EAC9B,UAAsB;QADxB,oBAAe,GAAf,eAAe,CAAiB;QAC9B,eAAU,GAAV,UAAU,CAAY;IAC1C,CAAC;IAOJ,KAAK,CAAC,sBAAsB,CAAC,MAAuB;QAChD,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE1C,MAAM,GAAG,G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AAE,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAQO,KAAK,CAAC,qBAAqB,CAAC,IAAU;QAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACJ,CAAA;AAlJY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAQ6B,kCAAe;QAClB,wBAAU;GARpC,qBAAqB,CAkJjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicelabsco/nestjs-utility-services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "NestJS generic packages to support development",
|
|
5
5
|
"author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"m:rev": "./node_modules/.bin/ts-node ./node_modules/.bin/typeorm migration:revert -d src/config/orm.config.ts",
|
|
33
33
|
"command": "npx nestjs-command",
|
|
34
34
|
"console": "node dist/console.js",
|
|
35
|
+
"runtime-check": "curl -s http://localhost:${SERVER_PORT:-4000}/health/runtime-check | jq . 2>/dev/null || curl -s http://localhost:${SERVER_PORT:-4000}/health/runtime-check",
|
|
35
36
|
"save": "bash ./commit.sh"
|
|
36
37
|
},
|
|
37
38
|
"keywords": [
|
|
@@ -71,23 +72,23 @@
|
|
|
71
72
|
"@sentry/node": "^10.34.0",
|
|
72
73
|
"@socket.io/redis-adapter": "^8.2.1",
|
|
73
74
|
"axios": "^1.7.9",
|
|
74
|
-
"bcryptjs": "^
|
|
75
|
+
"bcryptjs": "^3.0.3",
|
|
75
76
|
"bullmq": "^5.66.5",
|
|
76
77
|
"class-transformer": "^0.5.1",
|
|
77
|
-
"class-validator": "^0.
|
|
78
|
+
"class-validator": "^0.15.1",
|
|
78
79
|
"compression": "^1.7.4",
|
|
79
|
-
"cron-parser": "^
|
|
80
|
-
"date-fns": "^
|
|
80
|
+
"cron-parser": "^5.5.0",
|
|
81
|
+
"date-fns": "^4.1.0",
|
|
81
82
|
"dotenv": "^17.2.3",
|
|
82
83
|
"exceljs": "^4.4.0",
|
|
83
|
-
"express-http-
|
|
84
|
+
"express-http-context2": "^1.0.0",
|
|
84
85
|
"express-rate-limit": "^8.2.1",
|
|
85
86
|
"handlebars": "^4.7.8",
|
|
86
87
|
"helmet": "^8.1.0",
|
|
87
88
|
"html-to-text": "^9.0.5",
|
|
88
89
|
"ioredis": "^5.9.2",
|
|
89
|
-
"mongodb": "^
|
|
90
|
-
"nodemailer": "^
|
|
90
|
+
"mongodb": "^7.1.0",
|
|
91
|
+
"nodemailer": "^8.0.2",
|
|
91
92
|
"pg": "^8.17.1",
|
|
92
93
|
"redis": "^5.10.0",
|
|
93
94
|
"reflect-metadata": "^0.2.2",
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
"@types/jest": "^30.0.0",
|
|
108
109
|
"@types/multer": "^2.0.0",
|
|
109
110
|
"@types/node": "^22.10.5",
|
|
110
|
-
"@types/supertest": "^
|
|
111
|
+
"@types/supertest": "^7.2.0",
|
|
111
112
|
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
112
113
|
"@typescript-eslint/parser": "^8.53.0",
|
|
113
114
|
"eslint": "^9.39.2",
|