@servicelabsco/nestjs-utility-services 1.1.66 → 1.1.67

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.
Files changed (70) hide show
  1. package/dist/app.controller.d.ts +2 -4
  2. package/dist/app.controller.js +3 -8
  3. package/dist/app.controller.js.map +1 -1
  4. package/dist/auth/es6.classes.d.ts +1 -1
  5. package/dist/auth/middlewares/index.d.ts +1 -1
  6. package/dist/auth/middlewares/index.js +1 -1
  7. package/dist/auth/middlewares/index.js.map +1 -1
  8. package/dist/common/es6.classes.d.ts +2 -1
  9. package/dist/common/es6.classes.js +4 -0
  10. package/dist/common/es6.classes.js.map +1 -1
  11. package/dist/common/index.d.ts +1 -1
  12. package/dist/common/index.js +1 -1
  13. package/dist/common/index.js.map +1 -1
  14. package/dist/common/libraries/common.entity.d.ts +3 -2
  15. package/dist/common/libraries/common.entity.js +2 -1
  16. package/dist/common/libraries/common.entity.js.map +1 -1
  17. package/dist/common/libraries/database.event.evaluator.d.ts +11 -0
  18. package/dist/common/libraries/database.event.evaluator.js +40 -0
  19. package/dist/common/libraries/database.event.evaluator.js.map +1 -0
  20. package/dist/common/libraries/entity.evaluator.d.ts +28 -0
  21. package/dist/common/libraries/entity.evaluator.js +127 -0
  22. package/dist/common/libraries/entity.evaluator.js.map +1 -0
  23. package/dist/common/libraries/index.d.ts +3 -1
  24. package/dist/common/libraries/index.js +3 -1
  25. package/dist/common/libraries/index.js.map +1 -1
  26. package/dist/platformUtility/commands/index.d.ts +1 -1
  27. package/dist/platformUtility/commands/index.js +1 -1
  28. package/dist/platformUtility/dtos/common.list.filter.dto.d.ts +15 -0
  29. package/dist/platformUtility/dtos/common.list.filter.dto.js +83 -0
  30. package/dist/platformUtility/dtos/common.list.filter.dto.js.map +1 -0
  31. package/dist/platformUtility/dtos/date.filter.dto.d.ts +10 -0
  32. package/dist/platformUtility/dtos/date.filter.dto.js +57 -0
  33. package/dist/platformUtility/dtos/date.filter.dto.js.map +1 -0
  34. package/dist/platformUtility/dtos/date.range.filter.dto.d.ts +4 -0
  35. package/dist/platformUtility/dtos/date.range.filter.dto.js +30 -0
  36. package/dist/platformUtility/dtos/date.range.filter.dto.js.map +1 -0
  37. package/dist/platformUtility/dtos/index.d.ts +6 -0
  38. package/dist/platformUtility/dtos/index.js +6 -0
  39. package/dist/platformUtility/dtos/index.js.map +1 -1
  40. package/dist/platformUtility/dtos/list.response.dto.d.ts +14 -0
  41. package/dist/platformUtility/dtos/list.response.dto.js +7 -0
  42. package/dist/platformUtility/dtos/list.response.dto.js.map +1 -0
  43. package/dist/platformUtility/dtos/list.response.format.dto.d.ts +4 -0
  44. package/dist/platformUtility/dtos/list.response.format.dto.js +27 -0
  45. package/dist/platformUtility/dtos/list.response.format.dto.js.map +1 -0
  46. package/dist/platformUtility/dtos/number.range.filter.dto.d.ts +7 -0
  47. package/dist/platformUtility/dtos/number.range.filter.dto.js +45 -0
  48. package/dist/platformUtility/dtos/number.range.filter.dto.js.map +1 -0
  49. package/dist/platformUtility/es6.classes.d.ts +12 -4
  50. package/dist/platformUtility/es6.classes.js +16 -0
  51. package/dist/platformUtility/es6.classes.js.map +1 -1
  52. package/dist/platformUtility/index.d.ts +1 -1
  53. package/dist/platformUtility/index.js +1 -1
  54. package/dist/platformUtility/index.js.map +1 -1
  55. package/dist/platformUtility/libraries/index.d.ts +2 -0
  56. package/dist/platformUtility/libraries/index.js +2 -0
  57. package/dist/platformUtility/libraries/index.js.map +1 -1
  58. package/dist/platformUtility/libraries/process.common.list.d.ts +28 -0
  59. package/dist/platformUtility/libraries/process.common.list.js +93 -0
  60. package/dist/platformUtility/libraries/process.common.list.js.map +1 -0
  61. package/dist/platformUtility/libraries/process.date.filter.d.ts +14 -0
  62. package/dist/platformUtility/libraries/process.date.filter.js +68 -0
  63. package/dist/platformUtility/libraries/process.date.filter.js.map +1 -0
  64. package/dist/platformUtility/services/index.d.ts +1 -1
  65. package/dist/platformUtility/services/index.js +1 -1
  66. package/dist/platformUtility/services/index.js.map +1 -1
  67. package/dist/system/entities/index.d.ts +0 -1
  68. package/dist/system/entities/index.js +0 -1
  69. package/dist/system/entities/index.js.map +1 -1
  70. package/package.json +2 -1
@@ -0,0 +1,57 @@
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.DateFilterDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ require("reflect-metadata");
16
+ const date_range_filter_dto_1 = require("./date.range.filter.dto");
17
+ class DateFilterDto {
18
+ }
19
+ __decorate([
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_validator_1.ValidateNested)(),
22
+ (0, class_transformer_1.Type)(() => date_range_filter_dto_1.DateRangeFilterDto),
23
+ (0, class_transformer_1.Expose)(),
24
+ __metadata("design:type", date_range_filter_dto_1.DateRangeFilterDto)
25
+ ], DateFilterDto.prototype, "range", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, class_validator_1.IsBoolean)(),
29
+ (0, class_transformer_1.Expose)(),
30
+ __metadata("design:type", Boolean)
31
+ ], DateFilterDto.prototype, "today", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsBoolean)(),
35
+ (0, class_transformer_1.Expose)(),
36
+ __metadata("design:type", Boolean)
37
+ ], DateFilterDto.prototype, "week", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsBoolean)(),
41
+ (0, class_transformer_1.Expose)(),
42
+ __metadata("design:type", Boolean)
43
+ ], DateFilterDto.prototype, "month", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, class_validator_1.IsBoolean)(),
47
+ (0, class_transformer_1.Expose)(),
48
+ __metadata("design:type", Boolean)
49
+ ], DateFilterDto.prototype, "year", void 0);
50
+ __decorate([
51
+ (0, class_validator_1.IsOptional)(),
52
+ (0, class_validator_1.IsBoolean)(),
53
+ (0, class_transformer_1.Expose)(),
54
+ __metadata("design:type", Boolean)
55
+ ], DateFilterDto.prototype, "financial_year", void 0);
56
+ exports.DateFilterDto = DateFilterDto;
57
+ //# sourceMappingURL=date.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.filter.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/date.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,qDAAwE;AACxE,4BAA0B;AAC1B,mEAA6D;AAE7D,MAAa,aAAa;CA+BzB;AA9BG;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,0CAAkB,CAAC;IAC9B,IAAA,0BAAM,GAAE;8BACD,0CAAkB;4CAAC;AAE3B;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;4CACO;AAEhB;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;2CACM;AAEf;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;4CACO;AAEhB;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;2CACM;AAEf;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;qDACgB;AA9B7B,sCA+BC"}
@@ -0,0 +1,4 @@
1
+ export declare class DateRangeFilterDto {
2
+ min: string;
3
+ max: string;
4
+ }
@@ -0,0 +1,30 @@
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.DateRangeFilterDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class DateRangeFilterDto {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsISO8601)(),
20
+ (0, class_transformer_1.Expose)(),
21
+ __metadata("design:type", String)
22
+ ], DateRangeFilterDto.prototype, "min", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_1.IsISO8601)(),
26
+ (0, class_transformer_1.Expose)(),
27
+ __metadata("design:type", String)
28
+ ], DateRangeFilterDto.prototype, "max", void 0);
29
+ exports.DateRangeFilterDto = DateRangeFilterDto;
30
+ //# sourceMappingURL=date.range.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.range.filter.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/date.range.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAwD;AAExD,MAAa,kBAAkB;CAU9B;AATG;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;+CACG;AAEZ;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;+CACG;AAThB,gDAUC"}
@@ -1,8 +1,14 @@
1
1
  export * from './common.attributes.dto';
2
+ export * from './common.list.filter.dto';
3
+ export * from './date.filter.dto';
4
+ export * from './date.range.filter.dto';
2
5
  export * from './failed.bull.job.attributes.dto';
3
6
  export * from './fcm.response.dto';
4
7
  export * from './job.payload.dto';
8
+ export * from './list.response.dto';
9
+ export * from './list.response.format.dto';
5
10
  export * from './mail.options.dto';
11
+ export * from './number.range.filter.dto';
6
12
  export * from './pending.bull.job.attributes.dto';
7
13
  export * from './push.notification.response.dto';
8
14
  export * from './push.notification.template.dto';
@@ -15,10 +15,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./common.attributes.dto"), exports);
18
+ __exportStar(require("./common.list.filter.dto"), exports);
19
+ __exportStar(require("./date.filter.dto"), exports);
20
+ __exportStar(require("./date.range.filter.dto"), exports);
18
21
  __exportStar(require("./failed.bull.job.attributes.dto"), exports);
19
22
  __exportStar(require("./fcm.response.dto"), exports);
20
23
  __exportStar(require("./job.payload.dto"), exports);
24
+ __exportStar(require("./list.response.dto"), exports);
25
+ __exportStar(require("./list.response.format.dto"), exports);
21
26
  __exportStar(require("./mail.options.dto"), exports);
27
+ __exportStar(require("./number.range.filter.dto"), exports);
22
28
  __exportStar(require("./pending.bull.job.attributes.dto"), exports);
23
29
  __exportStar(require("./push.notification.response.dto"), exports);
24
30
  __exportStar(require("./push.notification.template.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,mEAAiD;AACjD,qDAAmC;AACnC,oDAAkC;AAClC,qDAAmC;AACnC,oEAAkD;AAClD,mEAAiD;AACjD,mEAAiD;AACjD,sDAAoC;AACpC,4DAA0C;AAC1C,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,2DAAyC;AACzC,oDAAkC;AAClC,0DAAwC;AACxC,mEAAiD;AACjD,qDAAmC;AACnC,oDAAkC;AAClC,sDAAoC;AACpC,6DAA2C;AAC3C,qDAAmC;AACnC,4DAA0C;AAC1C,oEAAkD;AAClD,mEAAiD;AACjD,mEAAiD;AACjD,sDAAoC;AACpC,4DAA0C;AAC1C,sDAAoC"}
@@ -0,0 +1,14 @@
1
+ export declare class ListResponseDto {
2
+ stats?: {
3
+ total?: number;
4
+ page?: number;
5
+ limit?: number;
6
+ };
7
+ metrics?: {
8
+ [key: string]: number | {};
9
+ };
10
+ records?: any[];
11
+ file?: string;
12
+ headers?: any;
13
+ aggregate?: number;
14
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListResponseDto = void 0;
4
+ class ListResponseDto {
5
+ }
6
+ exports.ListResponseDto = ListResponseDto;
7
+ //# sourceMappingURL=list.response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.response.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/list.response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAe;CAO3B;AAPD,0CAOC"}
@@ -0,0 +1,4 @@
1
+ export declare class ListResponseFormatDto {
2
+ json?: boolean;
3
+ csv?: boolean;
4
+ }
@@ -0,0 +1,27 @@
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.ListResponseFormatDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class ListResponseFormatDto {
15
+ }
16
+ __decorate([
17
+ (0, class_validator_1.IsOptional)(),
18
+ (0, class_validator_1.IsBoolean)(),
19
+ __metadata("design:type", Boolean)
20
+ ], ListResponseFormatDto.prototype, "json", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsOptional)(),
23
+ (0, class_validator_1.IsBoolean)(),
24
+ __metadata("design:type", Boolean)
25
+ ], ListResponseFormatDto.prototype, "csv", void 0);
26
+ exports.ListResponseFormatDto = ListResponseFormatDto;
27
+ //# sourceMappingURL=list.response.format.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.response.format.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/list.response.format.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwD;AACxD,MAAa,qBAAqB;CAQjC;AAPG;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACG;AAEf;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;kDACE;AAPlB,sDAQC"}
@@ -0,0 +1,7 @@
1
+ export declare class NumberRangeFilterDto {
2
+ min?: number;
3
+ max?: number;
4
+ positive?: boolean;
5
+ negative?: boolean;
6
+ zero?: boolean;
7
+ }
@@ -0,0 +1,45 @@
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.NumberRangeFilterDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class NumberRangeFilterDto {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsNumber)(),
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_transformer_1.Expose)(),
21
+ __metadata("design:type", Number)
22
+ ], NumberRangeFilterDto.prototype, "min", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsNumber)(),
26
+ (0, class_transformer_1.Expose)(),
27
+ __metadata("design:type", Number)
28
+ ], NumberRangeFilterDto.prototype, "max", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsBoolean)(),
31
+ (0, class_validator_1.IsOptional)(),
32
+ __metadata("design:type", Boolean)
33
+ ], NumberRangeFilterDto.prototype, "positive", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsBoolean)(),
36
+ (0, class_validator_1.IsOptional)(),
37
+ __metadata("design:type", Boolean)
38
+ ], NumberRangeFilterDto.prototype, "negative", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsBoolean)(),
41
+ (0, class_validator_1.IsOptional)(),
42
+ __metadata("design:type", Boolean)
43
+ ], NumberRangeFilterDto.prototype, "zero", void 0);
44
+ exports.NumberRangeFilterDto = NumberRangeFilterDto;
45
+ //# sourceMappingURL=number.range.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.range.filter.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/number.range.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAkE;AAElE,MAAa,oBAAoB;CAsBhC;AArBG;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;iDACI;AAEb;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,0BAAM,GAAE;;iDACI;AAEb;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;sDACM;AAEnB;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;sDACM;AAEnB;IAAC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;kDACE;AArBnB,oDAsBC"}
@@ -7,9 +7,15 @@ import { JobConsumer } from './consumers/job.consumer';
7
7
  import { BullJobController } from './controllers/bull.job.controller';
8
8
  import { QueueController } from './controllers/queue.controller';
9
9
  import { CommonAttributesDto } from './dtos/common.attributes.dto';
10
+ import { CommonListFilterDto } from './dtos/common.list.filter.dto';
11
+ import { DateFilterDto } from './dtos/date.filter.dto';
12
+ import { DateRangeFilterDto } from './dtos/date.range.filter.dto';
10
13
  import { FcmResponseDto } from './dtos/fcm.response.dto';
11
14
  import { JobPayloadDto } from './dtos/job.payload.dto';
15
+ import { ListResponseDto } from './dtos/list.response.dto';
16
+ import { ListResponseFormatDto } from './dtos/list.response.format.dto';
12
17
  import { MailOptionsDto } from './dtos/mail.options.dto';
18
+ import { NumberRangeFilterDto } from './dtos/number.range.filter.dto';
13
19
  import { PushNotificationResponseDto } from './dtos/push.notification.response.dto';
14
20
  import { PushNotificationTemplateDto } from './dtos/push.notification.template.dto';
15
21
  import { QueueOptionsDto } from './dtos/queue.options.dto';
@@ -28,7 +34,9 @@ import { CreateEs6JobsFile } from './libraries/create.es6.jobs.file';
28
34
  import { CreateEs6ServiceFile } from './libraries/create.es6.service.file';
29
35
  import { CreateIndexFile } from './libraries/create.index.file';
30
36
  import { FileSystemUtility } from './libraries/file.system.utility';
37
+ import { ProcessCommonList } from './libraries/process.common.list';
31
38
  import { ProcessCommonMail } from './libraries/process.common.mail';
39
+ import { ProcessDateFilter } from './libraries/process.date.filter';
32
40
  import { ProcessPostmarkMail } from './libraries/process.postmark.mail';
33
41
  import { ProcessSmtpMail } from './libraries/process.smtp.mail';
34
42
  import { MaintenanceMiddleware } from './middlewares/maintenance.middleware';
@@ -50,15 +58,15 @@ import { SqsService } from './services/sqs.service';
50
58
  import { StartupService } from './services/startup.service';
51
59
  import { BaseSubscriber } from './subscribers/base.subscriber';
52
60
  declare const es6Classes: {
53
- commands: (typeof EntityGeneratorCommand | typeof MaintenanceCommand | typeof SyncClassCommand | typeof SqsWorkerCommand)[];
61
+ commands: (typeof EntityGeneratorCommand | typeof MaintenanceCommand | typeof SqsWorkerCommand | typeof SyncClassCommand)[];
54
62
  consumers: (typeof EventConsumer | typeof JobConsumer)[];
55
63
  controllers: (typeof BullJobController | typeof QueueController)[];
56
- dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof CommonAttributesDto | typeof RemoteRawResponseDto | typeof MailOptionsDto | typeof FcmResponseDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof SourceColumnDto)[];
64
+ dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof CommonAttributesDto | typeof RemoteRawResponseDto | typeof DateRangeFilterDto | typeof DateFilterDto | typeof ListResponseFormatDto | typeof NumberRangeFilterDto | typeof CommonListFilterDto | typeof ListResponseDto | typeof FcmResponseDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof MailOptionsDto | typeof SourceColumnDto)[];
57
65
  entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
58
66
  jobs: (typeof LoadFailedBullJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob | typeof TestJob)[];
59
- libraries: (typeof FileSystemUtility | typeof CommonSqsPolling | typeof CreateEntityConstantsFile | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessCommonMail | typeof ProcessPostmarkMail | typeof ProcessSmtpMail)[];
67
+ libraries: (typeof FileSystemUtility | typeof CommonSqsPolling | typeof CreateEntityConstantsFile | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessCommonMail | typeof ProcessSmtpMail | typeof ProcessPostmarkMail | typeof ProcessDateFilter | typeof ProcessCommonList)[];
60
68
  middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
61
- services: (typeof CacheService | typeof RemoteRequestService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof ShutdownService | typeof AuditService | typeof FcmNotificationService | typeof MailService | typeof StartupService | typeof SqsService | typeof Es6JobsService | typeof Es6Service | typeof LocalPropertyService | typeof QueueService)[];
69
+ services: (typeof CacheService | typeof RemoteRequestService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof ShutdownService | typeof AuditService | typeof FcmNotificationService | typeof MailService | typeof SqsService | typeof StartupService | typeof Es6JobsService | typeof Es6Service | typeof LocalPropertyService | typeof QueueService)[];
62
70
  subscribers: (typeof BaseSubscriber)[];
63
71
  };
64
72
  export default es6Classes;
@@ -9,10 +9,16 @@ const job_consumer_1 = require("./consumers/job.consumer");
9
9
  const bull_job_controller_1 = require("./controllers/bull.job.controller");
10
10
  const queue_controller_1 = require("./controllers/queue.controller");
11
11
  const common_attributes_dto_1 = require("./dtos/common.attributes.dto");
12
+ const common_list_filter_dto_1 = require("./dtos/common.list.filter.dto");
13
+ const date_filter_dto_1 = require("./dtos/date.filter.dto");
14
+ const date_range_filter_dto_1 = require("./dtos/date.range.filter.dto");
12
15
  const failed_bull_job_attributes_dto_1 = require("./dtos/failed.bull.job.attributes.dto");
13
16
  const fcm_response_dto_1 = require("./dtos/fcm.response.dto");
14
17
  const job_payload_dto_1 = require("./dtos/job.payload.dto");
18
+ const list_response_dto_1 = require("./dtos/list.response.dto");
19
+ const list_response_format_dto_1 = require("./dtos/list.response.format.dto");
15
20
  const mail_options_dto_1 = require("./dtos/mail.options.dto");
21
+ const number_range_filter_dto_1 = require("./dtos/number.range.filter.dto");
16
22
  const pending_bull_job_attributes_dto_1 = require("./dtos/pending.bull.job.attributes.dto");
17
23
  const push_notification_response_dto_1 = require("./dtos/push.notification.response.dto");
18
24
  const push_notification_template_dto_1 = require("./dtos/push.notification.template.dto");
@@ -32,7 +38,9 @@ const create_es6_jobs_file_1 = require("./libraries/create.es6.jobs.file");
32
38
  const create_es6_service_file_1 = require("./libraries/create.es6.service.file");
33
39
  const create_index_file_1 = require("./libraries/create.index.file");
34
40
  const file_system_utility_1 = require("./libraries/file.system.utility");
41
+ const process_common_list_1 = require("./libraries/process.common.list");
35
42
  const process_common_mail_1 = require("./libraries/process.common.mail");
43
+ const process_date_filter_1 = require("./libraries/process.date.filter");
36
44
  const process_postmark_mail_1 = require("./libraries/process.postmark.mail");
37
45
  const process_smtp_mail_1 = require("./libraries/process.smtp.mail");
38
46
  const maintenance_middleware_1 = require("./middlewares/maintenance.middleware");
@@ -59,10 +67,16 @@ const es6Classes = {
59
67
  controllers: [bull_job_controller_1.BullJobController, queue_controller_1.QueueController],
60
68
  dtos: [
61
69
  common_attributes_dto_1.CommonAttributesDto,
70
+ common_list_filter_dto_1.CommonListFilterDto,
71
+ date_filter_dto_1.DateFilterDto,
72
+ date_range_filter_dto_1.DateRangeFilterDto,
62
73
  failed_bull_job_attributes_dto_1.FailedBullJobAttributesDto,
63
74
  fcm_response_dto_1.FcmResponseDto,
64
75
  job_payload_dto_1.JobPayloadDto,
76
+ list_response_dto_1.ListResponseDto,
77
+ list_response_format_dto_1.ListResponseFormatDto,
65
78
  mail_options_dto_1.MailOptionsDto,
79
+ number_range_filter_dto_1.NumberRangeFilterDto,
66
80
  pending_bull_job_attributes_dto_1.PendingBullJobAttributesDto,
67
81
  push_notification_response_dto_1.PushNotificationResponseDto,
68
82
  push_notification_template_dto_1.PushNotificationTemplateDto,
@@ -80,7 +94,9 @@ const es6Classes = {
80
94
  create_es6_service_file_1.CreateEs6ServiceFile,
81
95
  create_index_file_1.CreateIndexFile,
82
96
  file_system_utility_1.FileSystemUtility,
97
+ process_common_list_1.ProcessCommonList,
83
98
  process_common_mail_1.ProcessCommonMail,
99
+ process_date_filter_1.ProcessDateFilter,
84
100
  process_postmark_mail_1.ProcessPostmarkMail,
85
101
  process_smtp_mail_1.ProcessSmtpMail,
86
102
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,kFAA6E;AAC7E,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,wEAAmE;AACnE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,8DAAyD;AACzD,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,q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;QACpB,kCAAe;QACf,wBAAU;QACV,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,kFAA6E;AAC7E,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,wEAAmE;AACnE,0EAAoE;AACpE,4DAAuD;AACvD,wEAAkE;AAClE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,gEAA2D;AAC3D,8EAAwE;AACxE,8DAAyD;AACzD,4EAAsE;AACtE,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,yEAAoE;AACpE,yEAAoE;AACpE,yEAAoE;AACpE,6EAAwE;AACxE,qEAAgE;AAChE,iFAA6E;AAC7E,uDAAmD;AACnD,4DAAwD;AACxD,4DAAwD;AACxD,8DAA0D;AAC1D,kEAA6D;AAC7D,wDAAoD;AACpD,kFAA6E;AAC7E,8EAAyE;AACzE,0DAAsD;AACtD,wEAAoE;AACpE,4DAAwD;AACxD,8EAAyE;AACzE,kEAA8D;AAC9D,wDAAoD;AACpD,wDAAoD;AACpD,gEAA4D;AAC5D,mEAA+D;AAE/D,MAAM,UAAU,GAAG;IACf,QAAQ,EAAE,CAAC,iDAAsB,EAAE,wCAAkB,EAAE,qCAAgB,EAAE,qCAAgB,CAAC;IAC1F,SAAS,EAAE,CAAC,8BAAa,EAAE,0BAAW,CAAC;IACvC,WAAW,EAAE,CAAC,uCAAiB,EAAE,kCAAe,CAAC;IACjD,IAAI,EAAE;QACF,2CAAmB;QACnB,4CAAmB;QACnB,+BAAa;QACb,0CAAkB;QAClB,2DAA0B;QAC1B,iCAAc;QACd,+BAAa;QACb,mCAAe;QACf,gDAAqB;QACrB,iCAAc;QACd,8CAAoB;QACpB,6DAA2B;QAC3B,4DAA2B;QAC3B,4DAA2B;QAC3B,mCAAe;QACf,8CAAoB;QACpB,mCAAe;KAClB;IACD,QAAQ,EAAE,CAAC,4CAAmB,EAAE,8CAAoB,CAAC;IACrD,IAAI,EAAE,CAAC,wCAAiB,EAAE,qCAAgB,EAAE,8CAAoB,EAAE,kBAAO,CAAC;IAC1E,SAAS,EAAE;QACP,qCAAgB;QAChB,wDAAyB;QACzB,8CAAoB;QACpB,wCAAiB;QACjB,8CAAoB;QACpB,mCAAe;QACf,uCAAiB;QACjB,uCAAiB;QACjB,uCAAiB;QACjB,uCAAiB;QACjB,2CAAmB;QACnB,mCAAe;KAClB;IACD,WAAW,EAAE,CAAC,8CAAqB,EAAE,oBAAQ,CAAC;IAC9C,QAAQ,EAAE;QACN,4BAAY;QACZ,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,wBAAU;QACV,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,kCAAe;QACf,wBAAU;QACV,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -6,6 +6,6 @@ export * from './entities';
6
6
  export * from './jobs';
7
7
  export * from './libraries';
8
8
  export * from './middlewares';
9
- export * from './platform.utility.module';
10
9
  export * from './services';
11
10
  export * from './subscribers';
11
+ export * from './platform.utility.module';
@@ -22,7 +22,7 @@ __exportStar(require("./entities"), exports);
22
22
  __exportStar(require("./jobs"), exports);
23
23
  __exportStar(require("./libraries"), exports);
24
24
  __exportStar(require("./middlewares"), exports);
25
- __exportStar(require("./platform.utility.module"), exports);
26
25
  __exportStar(require("./services"), exports);
27
26
  __exportStar(require("./subscribers"), exports);
27
+ __exportStar(require("./platform.utility.module"), exports);
28
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platformUtility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,gDAA8B;AAC9B,yCAAuB;AACvB,6CAA2B;AAC3B,yCAAuB;AACvB,8CAA4B;AAC5B,gDAA8B;AAC9B,4DAA0C;AAC1C,6CAA2B;AAC3B,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platformUtility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,gDAA8B;AAC9B,yCAAuB;AACvB,6CAA2B;AAC3B,yCAAuB;AACvB,8CAA4B;AAC5B,gDAA8B;AAC9B,6CAA2B;AAC3B,gDAA8B;AAC9B,4DAA0C"}
@@ -5,6 +5,8 @@ export * from './create.es6.jobs.file';
5
5
  export * from './create.es6.service.file';
6
6
  export * from './create.index.file';
7
7
  export * from './file.system.utility';
8
+ export * from './process.common.list';
8
9
  export * from './process.common.mail';
10
+ export * from './process.date.filter';
9
11
  export * from './process.postmark.mail';
10
12
  export * from './process.smtp.mail';
@@ -21,7 +21,9 @@ __exportStar(require("./create.es6.jobs.file"), exports);
21
21
  __exportStar(require("./create.es6.service.file"), exports);
22
22
  __exportStar(require("./create.index.file"), exports);
23
23
  __exportStar(require("./file.system.utility"), exports);
24
+ __exportStar(require("./process.common.list"), exports);
24
25
  __exportStar(require("./process.common.mail"), exports);
26
+ __exportStar(require("./process.date.filter"), exports);
25
27
  __exportStar(require("./process.postmark.mail"), exports);
26
28
  __exportStar(require("./process.smtp.mail"), exports);
27
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,4DAA0C;AAC1C,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,wDAAsC;AACtC,wDAAsC;AACtC,0DAAwC;AACxC,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,4DAA0C;AAC1C,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,wDAAsC;AACtC,wDAAsC;AACtC,wDAAsC;AACtC,wDAAsC;AACtC,0DAAwC;AACxC,sDAAoC"}
@@ -0,0 +1,28 @@
1
+ import { CommonListFilterDto } from '../dtos/common.list.filter.dto';
2
+ import { DateFilterDto } from '../dtos/date.filter.dto';
3
+ import { ListResponseDto } from '../dtos/list.response.dto';
4
+ import { SqlService } from '../services';
5
+ export declare class ProcessCommonList {
6
+ protected config: {
7
+ sql: string;
8
+ order: string;
9
+ columns: string[];
10
+ metrics?: string[];
11
+ };
12
+ protected filter: CommonListFilterDto;
13
+ protected restrictions: string[];
14
+ protected query: string;
15
+ protected response: ListResponseDto;
16
+ protected sqlService: SqlService;
17
+ protected handle(): Promise<{
18
+ aggregate: any;
19
+ }> | Promise<ListResponseDto>;
20
+ private getListRecords;
21
+ private getTotalRecords;
22
+ private getQueryRestrictions;
23
+ private getQuery;
24
+ private getRecords;
25
+ private aggregate;
26
+ protected processDate(date: DateFilterDto, column: string): void;
27
+ private sendResponse;
28
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessCommonList = void 0;
4
+ const common_1 = require("../../common");
5
+ const process_date_filter_1 = require("./process.date.filter");
6
+ class ProcessCommonList {
7
+ constructor() {
8
+ this.restrictions = [];
9
+ this.response = { stats: {}, metrics: {}, records: [] };
10
+ }
11
+ handle() {
12
+ this.query = this.getQuery();
13
+ if (this.filter.aggregate)
14
+ return this.aggregate();
15
+ return this.getListRecords();
16
+ }
17
+ async getListRecords() {
18
+ await this.getRecords();
19
+ await this.getTotalRecords();
20
+ return this.sendResponse();
21
+ }
22
+ async getTotalRecords() {
23
+ var _a, _b, _c, _d;
24
+ if (((_a = this.filter) === null || _a === void 0 ? void 0 : _a.no_metrics) || ((_c = (_b = this.filter) === null || _b === void 0 ? void 0 : _b.format) === null || _c === void 0 ? void 0 : _c.csv))
25
+ return;
26
+ const metrics = ((_d = this.config) === null || _d === void 0 ? void 0 : _d.metrics) || [];
27
+ metrics.push(`count(1) count`);
28
+ const sql = `select ${this.config.metrics.join(',')} from ${this.query}`;
29
+ const record = await this.sqlService.first(sql);
30
+ this.response.stats.total = record.count;
31
+ this.response.metrics = {};
32
+ for (const [key, value] of Object.entries(record)) {
33
+ if (key === 'count')
34
+ continue;
35
+ this.response.metrics[key] = value;
36
+ }
37
+ }
38
+ getQueryRestrictions() {
39
+ if (!this.restrictions.length)
40
+ return;
41
+ const record = [];
42
+ this.restrictions.forEach((restriction) => {
43
+ record.push(` ( ${restriction} ) `);
44
+ });
45
+ return record.join('and');
46
+ }
47
+ getQuery() {
48
+ const restrictions = this.getQueryRestrictions();
49
+ const columns = this.config.columns.join(',');
50
+ let sql = `select ${columns} from ${this.config.sql}`;
51
+ if (restrictions)
52
+ sql = `${sql} and ${restrictions} `;
53
+ if (this.filter.filter_query)
54
+ return `(${sql}) sq where ${this.filter.filter_query}`;
55
+ return `(${sql}) sq`;
56
+ }
57
+ async getRecords() {
58
+ var _a;
59
+ const filter = this.filter;
60
+ const limit = (_a = filter.limit) !== null && _a !== void 0 ? _a : 20;
61
+ const page = filter.page || 1;
62
+ const offset = (page - 1) * limit;
63
+ const order = this.config.order || 'sq.created_at desc';
64
+ const sql = `select sq.* from ${this.query} order by ${order} limit ${limit} offset ${offset}`;
65
+ this.response.stats.limit = limit;
66
+ this.response.stats.page = page;
67
+ this.response.records = await this.sqlService.sql(sql);
68
+ }
69
+ async aggregate() {
70
+ const aggregate = this.filter.aggregate;
71
+ const supportedOperations = ['avg', 'sum', 'max', 'min'];
72
+ const key = Object.keys(aggregate)[0];
73
+ if (supportedOperations.indexOf(key) === -1)
74
+ throw new common_1.OperationException(`Given aggregate function ${key} is not supported`);
75
+ const value = Object.values(aggregate)[0];
76
+ const sql = `select ${key}(sq.${value}) aggregate from ${this.query}`;
77
+ const response = await this.sqlService.first(sql);
78
+ return { aggregate: response.aggregate };
79
+ }
80
+ processDate(date, column) {
81
+ const range = new process_date_filter_1.ProcessDateFilter().process(date);
82
+ if (!range)
83
+ return;
84
+ this.restrictions.push(`${column} between '${range.min}' and '${range.max}'`);
85
+ }
86
+ async sendResponse() {
87
+ var _a;
88
+ if (!((_a = this.filter.format) === null || _a === void 0 ? void 0 : _a.csv))
89
+ return this.response;
90
+ }
91
+ }
92
+ exports.ProcessCommonList = ProcessCommonList;
93
+ //# sourceMappingURL=process.common.list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.common.list.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.common.list.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAKlD,+DAA0D;AAO1D,MAAa,iBAAiB;IAA9B;QAiBc,iBAAY,GAAa,EAAE,CAAC;QAgB5B,aAAQ,GAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IA2JlF,CAAC;IAjJa,MAAM;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;QAEnD,OA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M,CAAC,MAAM,0CAAE,GAAG,CAAA;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvD,CAAC;CACJ;AA5LD,8CA4LC"}
@@ -0,0 +1,14 @@
1
+ import { DateFilterDto } from '../dtos/date.filter.dto';
2
+ import { DateRangeFilterDto } from '../dtos/date.range.filter.dto';
3
+ export declare class ProcessDateFilter {
4
+ private filter;
5
+ private range;
6
+ process(filter: DateFilterDto): DateRangeFilterDto;
7
+ private analyseFilter;
8
+ private today;
9
+ private week;
10
+ private month;
11
+ private year;
12
+ private financialYear;
13
+ private checkRange;
14
+ }