@servicelabsco/slabs-access-manager 0.0.38 → 0.0.40

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 (46) hide show
  1. package/dist/access/dtos/common.list.filter.dto.d.ts +16 -0
  2. package/dist/access/dtos/common.list.filter.dto.js +88 -0
  3. package/dist/access/dtos/common.list.filter.dto.js.map +1 -0
  4. package/dist/access/dtos/date.filter.dto.d.ts +9 -0
  5. package/dist/access/dtos/date.filter.dto.js +56 -0
  6. package/dist/access/dtos/date.filter.dto.js.map +1 -0
  7. package/dist/access/dtos/date.range.filter.dto.d.ts +4 -0
  8. package/dist/access/dtos/date.range.filter.dto.js +28 -0
  9. package/dist/access/dtos/date.range.filter.dto.js.map +1 -0
  10. package/dist/access/dtos/index.d.ts +6 -0
  11. package/dist/access/dtos/index.js +6 -0
  12. package/dist/access/dtos/index.js.map +1 -1
  13. package/dist/access/dtos/list.response.dto.d.ts +14 -0
  14. package/dist/access/dtos/list.response.dto.js +7 -0
  15. package/dist/access/dtos/list.response.dto.js.map +1 -0
  16. package/dist/access/dtos/list.response.format.dto.d.ts +4 -0
  17. package/dist/access/dtos/list.response.format.dto.js +27 -0
  18. package/dist/access/dtos/list.response.format.dto.js.map +1 -0
  19. package/dist/access/dtos/number.range.filter.dto.d.ts +7 -0
  20. package/dist/access/dtos/number.range.filter.dto.js +45 -0
  21. package/dist/access/dtos/number.range.filter.dto.js.map +1 -0
  22. package/dist/access/entities/listing.column.entity.d.ts +2 -0
  23. package/dist/access/entities/listing.column.entity.js +8 -0
  24. package/dist/access/entities/listing.column.entity.js.map +1 -1
  25. package/dist/access/es6.classes.d.ts +12 -2
  26. package/dist/access/es6.classes.js +26 -1
  27. package/dist/access/es6.classes.js.map +1 -1
  28. package/dist/access/libraries/index.d.ts +4 -0
  29. package/dist/access/libraries/index.js +4 -0
  30. package/dist/access/libraries/index.js.map +1 -1
  31. package/dist/access/libraries/process.common.list.d.ts +31 -0
  32. package/dist/access/libraries/process.common.list.js +96 -0
  33. package/dist/access/libraries/process.common.list.js.map +1 -0
  34. package/dist/access/libraries/process.date.filter.d.ts +14 -0
  35. package/dist/access/libraries/process.date.filter.js +61 -0
  36. package/dist/access/libraries/process.date.filter.js.map +1 -0
  37. package/dist/access/libraries/process.listing.csv.file.d.ts +19 -0
  38. package/dist/access/libraries/process.listing.csv.file.js +59 -0
  39. package/dist/access/libraries/process.listing.csv.file.js.map +1 -0
  40. package/dist/access/libraries/process.report.data.d.ts +28 -0
  41. package/dist/access/libraries/process.report.data.js +113 -0
  42. package/dist/access/libraries/process.report.data.js.map +1 -0
  43. package/dist/migrations/1693641946423-AddVisibilityUtlListingColumnsTable.ts.d.ts +5 -0
  44. package/dist/migrations/1693641946423-AddVisibilityUtlListingColumnsTable.ts.js +16 -0
  45. package/dist/migrations/1693641946423-AddVisibilityUtlListingColumnsTable.ts.js.map +1 -0
  46. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import { DateFilterDto } from './date.filter.dto';
2
+ import { ListResponseFormatDto } from './list.response.format.dto';
3
+ import { NumberRangeFilterDto } from './number.range.filter.dto';
4
+ export declare class CommonListFilterDto {
5
+ search?: string;
6
+ limit?: number;
7
+ page?: number;
8
+ stats?: boolean;
9
+ no_metrics?: boolean;
10
+ format?: ListResponseFormatDto;
11
+ date?: DateFilterDto;
12
+ amount?: NumberRangeFilterDto;
13
+ aggregate?: Record<string, string>;
14
+ filter_query?: string;
15
+ listing_slug?: string;
16
+ }
@@ -0,0 +1,88 @@
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.CommonListFilterDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const date_filter_dto_1 = require("./date.filter.dto");
16
+ const list_response_format_dto_1 = require("./list.response.format.dto");
17
+ const number_range_filter_dto_1 = require("./number.range.filter.dto");
18
+ class CommonListFilterDto {
19
+ }
20
+ __decorate([
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, class_validator_1.IsString)(),
23
+ (0, class_validator_1.MinLength)(3),
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", String)
26
+ ], CommonListFilterDto.prototype, "search", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_validator_1.IsNumber)(),
30
+ (0, class_transformer_1.Expose)(),
31
+ __metadata("design:type", Number)
32
+ ], CommonListFilterDto.prototype, "limit", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsNumber)(),
36
+ (0, class_validator_1.Min)(1),
37
+ (0, class_transformer_1.Expose)(),
38
+ __metadata("design:type", Number)
39
+ ], CommonListFilterDto.prototype, "page", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsBoolean)(),
43
+ (0, class_transformer_1.Expose)(),
44
+ __metadata("design:type", Boolean)
45
+ ], CommonListFilterDto.prototype, "stats", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsBoolean)(),
49
+ (0, class_transformer_1.Expose)(),
50
+ __metadata("design:type", Boolean)
51
+ ], CommonListFilterDto.prototype, "no_metrics", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsOptional)(),
54
+ (0, class_validator_1.ValidateNested)(),
55
+ (0, class_transformer_1.Type)(() => list_response_format_dto_1.ListResponseFormatDto),
56
+ __metadata("design:type", list_response_format_dto_1.ListResponseFormatDto)
57
+ ], CommonListFilterDto.prototype, "format", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsOptional)(),
60
+ (0, class_validator_1.ValidateNested)(),
61
+ (0, class_transformer_1.Type)(() => date_filter_dto_1.DateFilterDto),
62
+ (0, class_transformer_1.Expose)(),
63
+ __metadata("design:type", date_filter_dto_1.DateFilterDto)
64
+ ], CommonListFilterDto.prototype, "date", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_1.ValidateNested)(),
68
+ (0, class_transformer_1.Type)(() => number_range_filter_dto_1.NumberRangeFilterDto),
69
+ (0, class_transformer_1.Expose)(),
70
+ __metadata("design:type", number_range_filter_dto_1.NumberRangeFilterDto)
71
+ ], CommonListFilterDto.prototype, "amount", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_transformer_1.Expose)(),
75
+ __metadata("design:type", Object)
76
+ ], CommonListFilterDto.prototype, "aggregate", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsOptional)(),
79
+ (0, class_transformer_1.Expose)(),
80
+ __metadata("design:type", String)
81
+ ], CommonListFilterDto.prototype, "filter_query", void 0);
82
+ __decorate([
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_transformer_1.Expose)(),
85
+ __metadata("design:type", String)
86
+ ], CommonListFilterDto.prototype, "listing_slug", void 0);
87
+ exports.CommonListFilterDto = CommonListFilterDto;
88
+ //# sourceMappingURL=common.list.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.list.filter.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/common.list.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,qDAA4G;AAC5G,uDAAkD;AAClD,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D1B,kDAwDC"}
@@ -0,0 +1,9 @@
1
+ import { DateRangeFilterDto } from './date.range.filter.dto';
2
+ export declare class DateFilterDto {
3
+ range?: DateRangeFilterDto;
4
+ today?: boolean;
5
+ week?: boolean;
6
+ month?: boolean;
7
+ year?: boolean;
8
+ financial_year?: boolean;
9
+ }
@@ -0,0 +1,56 @@
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
+ const date_range_filter_dto_1 = require("./date.range.filter.dto");
16
+ class DateFilterDto {
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_validator_1.ValidateNested)(),
21
+ (0, class_transformer_1.Type)(() => date_range_filter_dto_1.DateRangeFilterDto),
22
+ (0, class_transformer_1.Expose)(),
23
+ __metadata("design:type", date_range_filter_dto_1.DateRangeFilterDto)
24
+ ], DateFilterDto.prototype, "range", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.IsBoolean)(),
28
+ (0, class_transformer_1.Expose)(),
29
+ __metadata("design:type", Boolean)
30
+ ], DateFilterDto.prototype, "today", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsOptional)(),
33
+ (0, class_validator_1.IsBoolean)(),
34
+ (0, class_transformer_1.Expose)(),
35
+ __metadata("design:type", Boolean)
36
+ ], DateFilterDto.prototype, "week", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsBoolean)(),
40
+ (0, class_transformer_1.Expose)(),
41
+ __metadata("design:type", Boolean)
42
+ ], DateFilterDto.prototype, "month", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsOptional)(),
45
+ (0, class_validator_1.IsBoolean)(),
46
+ (0, class_transformer_1.Expose)(),
47
+ __metadata("design:type", Boolean)
48
+ ], DateFilterDto.prototype, "year", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsOptional)(),
51
+ (0, class_validator_1.IsBoolean)(),
52
+ (0, class_transformer_1.Expose)(),
53
+ __metadata("design:type", Boolean)
54
+ ], DateFilterDto.prototype, "financial_year", void 0);
55
+ exports.DateFilterDto = DateFilterDto;
56
+ //# sourceMappingURL=date.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.filter.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/date.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,qDAAwE;AACxE,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: Date;
3
+ max: Date;
4
+ }
@@ -0,0 +1,28 @@
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_transformer_1.Expose)(),
20
+ __metadata("design:type", Date)
21
+ ], DateRangeFilterDto.prototype, "min", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", Date)
26
+ ], DateRangeFilterDto.prototype, "max", void 0);
27
+ exports.DateRangeFilterDto = DateRangeFilterDto;
28
+ //# sourceMappingURL=date.range.filter.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.range.filter.dto.js","sourceRoot":"","sources":["../../../src/access/dtos/date.range.filter.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAA6C;AAE7C,MAAa,kBAAkB;CAQ9B;AAPG;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;8BACJ,IAAI;+CAAC;AAEV;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;8BACJ,IAAI;+CAAC;AAPd,gDAQC"}
@@ -2,11 +2,16 @@ export * from './access.business.param.dto';
2
2
  export * from './business.user.attributes.dto';
3
3
  export * from './business.user.role.attributes.dto';
4
4
  export * from './child.menu.attributes.dto';
5
+ export * from './common.list.filter.dto';
5
6
  export * from './custom.report.attributes.dto';
6
7
  export * from './dashboard.attributes.dto';
7
8
  export * from './dashboard.component.attributes.dto';
9
+ export * from './date.filter.dto';
10
+ export * from './date.range.filter.dto';
8
11
  export * from './group.role.attributes.dto';
9
12
  export * from './list.preference.attributes.dto';
13
+ export * from './list.response.dto';
14
+ export * from './list.response.format.dto';
10
15
  export * from './listing.column.attributes.dto';
11
16
  export * from './listing.page.attributes.dto';
12
17
  export * from './listing.preference.attributes.dto';
@@ -15,6 +20,7 @@ export * from './menu.attributes.dto';
15
20
  export * from './menu.role.attributes.dto';
16
21
  export * from './module.attributes.dto';
17
22
  export * from './module.menu.attributes.dto';
23
+ export * from './number.range.filter.dto';
18
24
  export * from './product.attributes.dto';
19
25
  export * from './role.group.attributes.dto';
20
26
  export * from './string.search.dto';
@@ -18,11 +18,16 @@ __exportStar(require("./access.business.param.dto"), exports);
18
18
  __exportStar(require("./business.user.attributes.dto"), exports);
19
19
  __exportStar(require("./business.user.role.attributes.dto"), exports);
20
20
  __exportStar(require("./child.menu.attributes.dto"), exports);
21
+ __exportStar(require("./common.list.filter.dto"), exports);
21
22
  __exportStar(require("./custom.report.attributes.dto"), exports);
22
23
  __exportStar(require("./dashboard.attributes.dto"), exports);
23
24
  __exportStar(require("./dashboard.component.attributes.dto"), exports);
25
+ __exportStar(require("./date.filter.dto"), exports);
26
+ __exportStar(require("./date.range.filter.dto"), exports);
24
27
  __exportStar(require("./group.role.attributes.dto"), exports);
25
28
  __exportStar(require("./list.preference.attributes.dto"), exports);
29
+ __exportStar(require("./list.response.dto"), exports);
30
+ __exportStar(require("./list.response.format.dto"), exports);
26
31
  __exportStar(require("./listing.column.attributes.dto"), exports);
27
32
  __exportStar(require("./listing.page.attributes.dto"), exports);
28
33
  __exportStar(require("./listing.preference.attributes.dto"), exports);
@@ -31,6 +36,7 @@ __exportStar(require("./menu.attributes.dto"), exports);
31
36
  __exportStar(require("./menu.role.attributes.dto"), exports);
32
37
  __exportStar(require("./module.attributes.dto"), exports);
33
38
  __exportStar(require("./module.menu.attributes.dto"), exports);
39
+ __exportStar(require("./number.range.filter.dto"), exports);
34
40
  __exportStar(require("./product.attributes.dto"), exports);
35
41
  __exportStar(require("./role.group.attributes.dto"), exports);
36
42
  __exportStar(require("./string.search.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,iEAA+C;AAC/C,sEAAoD;AACpD,8DAA4C;AAC5C,iEAA+C;AAC/C,6DAA2C;AAC3C,uEAAqD;AACrD,8DAA4C;AAC5C,mEAAiD;AACjD,kEAAgD;AAChD,gEAA8C;AAC9C,sEAAoD;AACpD,+DAA6C;AAC7C,wDAAsC;AACtC,6DAA2C;AAC3C,0DAAwC;AACxC,+DAA6C;AAC7C,2DAAyC;AACzC,8DAA4C;AAC5C,sDAAoC;AACpC,6DAA2C;AAC3C,kEAAgD;AAChD,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,iEAA+C;AAC/C,sEAAoD;AACpD,8DAA4C;AAC5C,2DAAyC;AACzC,iEAA+C;AAC/C,6DAA2C;AAC3C,uEAAqD;AACrD,oDAAkC;AAClC,0DAAwC;AACxC,8DAA4C;AAC5C,mEAAiD;AACjD,sDAAoC;AACpC,6DAA2C;AAC3C,kEAAgD;AAChD,gEAA8C;AAC9C,sEAAoD;AACpD,+DAA6C;AAC7C,wDAAsC;AACtC,6DAA2C;AAC3C,0DAAwC;AACxC,+DAA6C;AAC7C,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C;AAC5C,sDAAoC;AACpC,6DAA2C;AAC3C,kEAAgD;AAChD,6DAA2C"}
@@ -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/access/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/access/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/access/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"}
@@ -14,6 +14,8 @@ export declare class ListingColumnEntity extends CommonEntity {
14
14
  is_sortable: boolean;
15
15
  is_db_sortable: boolean;
16
16
  active: boolean;
17
+ is_visible: boolean;
18
+ is_report_enabled: boolean;
17
19
  attributes: ListingColumnAttributesDto;
18
20
  listing: ListingPageEntity;
19
21
  column_type: ColumnDefinitionEntity;
@@ -64,6 +64,14 @@ __decorate([
64
64
  (0, typeorm_1.Column)(),
65
65
  __metadata("design:type", Boolean)
66
66
  ], ListingColumnEntity.prototype, "active", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)(),
69
+ __metadata("design:type", Boolean)
70
+ ], ListingColumnEntity.prototype, "is_visible", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)(),
73
+ __metadata("design:type", Boolean)
74
+ ], ListingColumnEntity.prototype, "is_report_enabled", void 0);
67
75
  __decorate([
68
76
  (0, typeorm_1.Column)('json'),
69
77
  __metadata("design:type", listing_column_attributes_dto_1.ListingColumnAttributesDto)
@@ -1 +1 @@
1
- {"version":3,"file":"listing.column.entity.js","sourceRoot":"","sources":["../../../src/access/entities/listing.column.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oFAA8F;AAC9F,qCAAgE;AAChE,yFAAmF;AACnF,+DAA0D;AASnD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,sCAAY;CA4CpD,CAAA;AA3CG;IAAC,IAAA,gBAAM,GAAE;;uDACU;AAEnB;IAAC,IAAA,gBAAM,GAAE;;iDACI;AAEb;IAAC,IAAA,gBAAM,GAAE;;uDACU;AAEnB;IAAC,IAAA,gBAAM,GAAE;;wDACW;AAEpB;IAAC,IAAA,gBAAM,GAAE;;2DACc;AAEvB;IAAC,IAAA,gBAAM,GAAE;;kDACK;AAEd;IAAC,IAAA,gBAAM,GAAE;;0DACa;AAEtB;IAAC,IAAA,gBAAM,GAAE;;6DACgB;AAEzB;IAAC,IAAA,gBAAM,GAAE;;qDACQ;AAEjB;IAAC,IAAA,gBAAM,GAAE;;wDACY;AAErB;IAAC,IAAA,gBAAM,GAAE;;2DACe;AAExB;IAAC,IAAA,gBAAM,GAAE;;mDACO;AAEhB;IAAC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACH,0DAA0B;uDAAC;AAGvC;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAAU,uCAAiB;oDAAC;AAEnG;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAAsB,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;8BAAc,gDAAsB;wDAAC;AA3C5G,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;GACjB,mBAAmB,CA4C/B;AA5CY,kDAAmB"}
1
+ {"version":3,"file":"listing.column.entity.js","sourceRoot":"","sources":["../../../src/access/entities/listing.column.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oFAA8F;AAC9F,qCAAgE;AAChE,yFAAmF;AACnF,+DAA0D;AASnD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,sCAAY;CAkDpD,CAAA;AAjDG;IAAC,IAAA,gBAAM,GAAE;;uDACU;AAEnB;IAAC,IAAA,gBAAM,GAAE;;iDACI;AAEb;IAAC,IAAA,gBAAM,GAAE;;uDACU;AAEnB;IAAC,IAAA,gBAAM,GAAE;;wDACW;AAEpB;IAAC,IAAA,gBAAM,GAAE;;2DACc;AAEvB;IAAC,IAAA,gBAAM,GAAE;;kDACK;AAEd;IAAC,IAAA,gBAAM,GAAE;;0DACa;AAEtB;IAAC,IAAA,gBAAM,GAAE;;6DACgB;AAEzB;IAAC,IAAA,gBAAM,GAAE;;qDACQ;AAEjB;IAAC,IAAA,gBAAM,GAAE;;wDACY;AAErB;IAAC,IAAA,gBAAM,GAAE;;2DACe;AAExB;IAAC,IAAA,gBAAM,GAAE;;mDACO;AAEhB;IAAC,IAAA,gBAAM,GAAE;;uDACW;AAEpB;IAAC,IAAA,gBAAM,GAAE;;8DACkB;AAE3B;IAAC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACH,0DAA0B;uDAAC;AAGvC;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAAU,uCAAiB;oDAAC;AAEnG;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAAsB,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;8BAAc,gDAAsB;wDAAC;AAjD5G,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;GACjB,mBAAmB,CAkD/B;AAlDY,kDAAmB"}
@@ -2,6 +2,12 @@ import { AccessMenuController } from './controllers/access.menu.controller';
2
2
  import { DashboardController } from './controllers/dashboard.controller';
3
3
  import { AccessBusinessParamDto } from './dtos/access.business.param.dto';
4
4
  import { BusinessUserRoleAttributesDto } from './dtos/business.user.role.attributes.dto';
5
+ import { CommonListFilterDto } from './dtos/common.list.filter.dto';
6
+ import { DateFilterDto } from './dtos/date.filter.dto';
7
+ import { DateRangeFilterDto } from './dtos/date.range.filter.dto';
8
+ import { ListResponseDto } from './dtos/list.response.dto';
9
+ import { ListResponseFormatDto } from './dtos/list.response.format.dto';
10
+ import { NumberRangeFilterDto } from './dtos/number.range.filter.dto';
5
11
  import { StringSearchDto } from './dtos/string.search.dto';
6
12
  import { AccessBusinessEntity } from './entities/access.business.entity';
7
13
  import { BusinessUserEntity } from './entities/business.user.entity';
@@ -40,8 +46,12 @@ import { UiActionRoleJob } from './jobs/ui.action.role.job';
40
46
  import { UserRoleJob } from './jobs/user.role.job';
41
47
  import { ProcessApplicationMenu } from './libraries/process.application.menu';
42
48
  import { ProcessBusinessUserRoleUpdate } from './libraries/process.business.user.role.update';
49
+ import { ProcessCommonList } from './libraries/process.common.list';
43
50
  import { ProcessDashboardReport } from './libraries/process.dashboard.report';
51
+ import { ProcessDateFilter } from './libraries/process.date.filter';
52
+ import { ProcessListingCsvFile } from './libraries/process.listing.csv.file';
44
53
  import { ProcessMenuDetails } from './libraries/process.menu.details';
54
+ import { ProcessReportData } from './libraries/process.report.data';
45
55
  import { BusinessMiddleware } from './middlewares/business.middleware';
46
56
  import { BusinessUserRoleService } from './services/business.user.role.service';
47
57
  import { Es6JobsService } from './services/es6.jobs.service';
@@ -69,10 +79,10 @@ import { UiActionSubscriber } from './subscribers/ui.action.subscriber';
69
79
  import { UserRoleSubscriber } from './subscribers/user.role.subscriber';
70
80
  declare const es6Classes: {
71
81
  controllers: (typeof AccessMenuController | typeof DashboardController)[];
72
- dtos: (typeof AccessBusinessParamDto | typeof BusinessUserRoleAttributesDto | typeof StringSearchDto)[];
82
+ dtos: (typeof AccessBusinessParamDto | typeof BusinessUserRoleAttributesDto | typeof DateRangeFilterDto | typeof DateFilterDto | typeof ListResponseFormatDto | typeof NumberRangeFilterDto | typeof CommonListFilterDto | typeof ListResponseDto | typeof StringSearchDto)[];
73
83
  entities: (typeof AccessBusinessEntity | typeof BusinessUserEntity | typeof ProductEntity | typeof BusinessUserRoleEntity | typeof MenuEntity | typeof ChildMenuEntity | typeof DashboardComponentEntity | typeof GroupRoleEntity | typeof ListingPreferenceEntity | typeof MenuActionEntity | typeof MenuRoleEntity | typeof ModuleMenuEntity | typeof UiActionRoleEntity | typeof UserRoleEntity)[];
74
84
  jobs: (typeof BusinessUserJob | typeof BusinessUserRoleJob | typeof ChildMenuJob | typeof CustomReportJob | typeof DashboardComponentJob | typeof DashboardJob | typeof GroupRoleJob | typeof ListPreferenceJob | typeof ListingColumnJob | typeof ListingPageJob | typeof ListingPreferenceJob | typeof MenuActionJob | typeof MenuJob | typeof MenuRoleJob | typeof ModuleJob | typeof ModuleMenuJob | typeof ProductJob | typeof RoleGroupJob | typeof UiActionJob | typeof UiActionRoleJob | typeof UserRoleJob)[];
75
- libraries: (typeof ProcessApplicationMenu | typeof ProcessMenuDetails | typeof ProcessDashboardReport | typeof ProcessBusinessUserRoleUpdate)[];
85
+ libraries: (typeof ProcessApplicationMenu | typeof ProcessMenuDetails | typeof ProcessDashboardReport | typeof ProcessBusinessUserRoleUpdate | typeof ProcessListingCsvFile | typeof ProcessDateFilter | typeof ProcessCommonList | typeof ProcessReportData)[];
76
86
  middlewares: (typeof BusinessMiddleware)[];
77
87
  services: (typeof BusinessUserRoleService | typeof LoadEntityService | typeof Es6JobsService)[];
78
88
  subscribers: (typeof BusinessUserRoleSubscriber | typeof BusinessUserSubscriber | typeof ChildMenuSubscriber | typeof CustomReportSubscriber | typeof DashboardComponentSubscriber | typeof DashboardSubscriber | typeof GroupRoleSubscriber | typeof ListPreferenceSubscriber | typeof ListingColumnSubscriber | typeof ListingPageSubscriber | typeof ListingPreferenceSubscriber | typeof MenuActionSubscriber | typeof MenuRoleSubscriber | typeof MenuSubscriber | typeof ModuleMenuSubscriber | typeof ModuleSubscriber | typeof ProductSubscriber | typeof RoleGroupSubscriber | typeof UiActionRoleSubscriber | typeof UiActionSubscriber | typeof UserRoleSubscriber)[];
@@ -6,11 +6,16 @@ const access_business_param_dto_1 = require("./dtos/access.business.param.dto");
6
6
  const business_user_attributes_dto_1 = require("./dtos/business.user.attributes.dto");
7
7
  const business_user_role_attributes_dto_1 = require("./dtos/business.user.role.attributes.dto");
8
8
  const child_menu_attributes_dto_1 = require("./dtos/child.menu.attributes.dto");
9
+ const common_list_filter_dto_1 = require("./dtos/common.list.filter.dto");
9
10
  const custom_report_attributes_dto_1 = require("./dtos/custom.report.attributes.dto");
10
11
  const dashboard_attributes_dto_1 = require("./dtos/dashboard.attributes.dto");
11
12
  const dashboard_component_attributes_dto_1 = require("./dtos/dashboard.component.attributes.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 group_role_attributes_dto_1 = require("./dtos/group.role.attributes.dto");
13
16
  const list_preference_attributes_dto_1 = require("./dtos/list.preference.attributes.dto");
17
+ const list_response_dto_1 = require("./dtos/list.response.dto");
18
+ const list_response_format_dto_1 = require("./dtos/list.response.format.dto");
14
19
  const listing_column_attributes_dto_1 = require("./dtos/listing.column.attributes.dto");
15
20
  const listing_page_attributes_dto_1 = require("./dtos/listing.page.attributes.dto");
16
21
  const listing_preference_attributes_dto_1 = require("./dtos/listing.preference.attributes.dto");
@@ -19,6 +24,7 @@ const menu_attributes_dto_1 = require("./dtos/menu.attributes.dto");
19
24
  const menu_role_attributes_dto_1 = require("./dtos/menu.role.attributes.dto");
20
25
  const module_attributes_dto_1 = require("./dtos/module.attributes.dto");
21
26
  const module_menu_attributes_dto_1 = require("./dtos/module.menu.attributes.dto");
27
+ const number_range_filter_dto_1 = require("./dtos/number.range.filter.dto");
22
28
  const product_attributes_dto_1 = require("./dtos/product.attributes.dto");
23
29
  const role_group_attributes_dto_1 = require("./dtos/role.group.attributes.dto");
24
30
  const string_search_dto_1 = require("./dtos/string.search.dto");
@@ -70,8 +76,12 @@ const ui_action_role_job_1 = require("./jobs/ui.action.role.job");
70
76
  const user_role_job_1 = require("./jobs/user.role.job");
71
77
  const process_application_menu_1 = require("./libraries/process.application.menu");
72
78
  const process_business_user_role_update_1 = require("./libraries/process.business.user.role.update");
79
+ const process_common_list_1 = require("./libraries/process.common.list");
73
80
  const process_dashboard_report_1 = require("./libraries/process.dashboard.report");
81
+ const process_date_filter_1 = require("./libraries/process.date.filter");
82
+ const process_listing_csv_file_1 = require("./libraries/process.listing.csv.file");
74
83
  const process_menu_details_1 = require("./libraries/process.menu.details");
84
+ const process_report_data_1 = require("./libraries/process.report.data");
75
85
  const business_middleware_1 = require("./middlewares/business.middleware");
76
86
  const business_user_role_service_1 = require("./services/business.user.role.service");
77
87
  const es6_jobs_service_1 = require("./services/es6.jobs.service");
@@ -104,11 +114,16 @@ const es6Classes = {
104
114
  business_user_attributes_dto_1.BusinessUserAttributesDto,
105
115
  business_user_role_attributes_dto_1.BusinessUserRoleAttributesDto,
106
116
  child_menu_attributes_dto_1.ChildMenuAttributesDto,
117
+ common_list_filter_dto_1.CommonListFilterDto,
107
118
  custom_report_attributes_dto_1.CustomReportAttributesDto,
108
119
  dashboard_attributes_dto_1.DashboardAttributesDto,
109
120
  dashboard_component_attributes_dto_1.DashboardComponentAttributesDto,
121
+ date_filter_dto_1.DateFilterDto,
122
+ date_range_filter_dto_1.DateRangeFilterDto,
110
123
  group_role_attributes_dto_1.GroupRoleAttributesDto,
111
124
  list_preference_attributes_dto_1.ListPreferenceAttributesDto,
125
+ list_response_dto_1.ListResponseDto,
126
+ list_response_format_dto_1.ListResponseFormatDto,
112
127
  listing_column_attributes_dto_1.ListingColumnAttributesDto,
113
128
  listing_page_attributes_dto_1.ListingPageAttributesDto,
114
129
  listing_preference_attributes_dto_1.ListingPreferenceAttributesDto,
@@ -117,6 +132,7 @@ const es6Classes = {
117
132
  menu_role_attributes_dto_1.MenuRoleAttributesDto,
118
133
  module_attributes_dto_1.ModuleAttributesDto,
119
134
  module_menu_attributes_dto_1.ModuleMenuAttributesDto,
135
+ number_range_filter_dto_1.NumberRangeFilterDto,
120
136
  product_attributes_dto_1.ProductAttributesDto,
121
137
  role_group_attributes_dto_1.RoleGroupAttributesDto,
122
138
  string_search_dto_1.StringSearchDto,
@@ -171,7 +187,16 @@ const es6Classes = {
171
187
  ui_action_role_job_1.UiActionRoleJob,
172
188
  user_role_job_1.UserRoleJob,
173
189
  ],
174
- libraries: [process_application_menu_1.ProcessApplicationMenu, process_business_user_role_update_1.ProcessBusinessUserRoleUpdate, process_dashboard_report_1.ProcessDashboardReport, process_menu_details_1.ProcessMenuDetails],
190
+ libraries: [
191
+ process_application_menu_1.ProcessApplicationMenu,
192
+ process_business_user_role_update_1.ProcessBusinessUserRoleUpdate,
193
+ process_common_list_1.ProcessCommonList,
194
+ process_dashboard_report_1.ProcessDashboardReport,
195
+ process_date_filter_1.ProcessDateFilter,
196
+ process_listing_csv_file_1.ProcessListingCsvFile,
197
+ process_menu_details_1.ProcessMenuDetails,
198
+ process_report_data_1.ProcessReportData,
199
+ ],
175
200
  middlewares: [business_middleware_1.BusinessMiddleware],
176
201
  services: [business_user_role_service_1.BusinessUserRoleService, es6_jobs_service_1.Es6JobsService, load_entity_service_1.LoadEntityService],
177
202
  subscribers: [
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/access/es6.classes.ts"],"names":[],"mappings":";;AAAA,iFAA4E;AAC5E,6EAAyE;AACzE,gFAA0E;AAC1E,sFAAgF;AAChF,gGAAyF;AACzF,gFAA0E;AAC1E,sFAAgF;AAChF,8EAAyE;AACzE,kGAA4F;AAC5F,gFAA0E;AAC1E,0FAAoF;AACpF,wFAAkF;AAClF,oFAA8E;AAC9E,gGAA0F;AAC1F,kFAA4E;AAC5E,oEAA+D;AAC/D,8EAAwE;AACxE,wEAAmE;AACnE,kFAA4E;AAC5E,0EA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ACtB,6DAA4B;QAC5B,0CAAmB;QACnB,2CAAmB;QACnB,qDAAwB;QACxB,mDAAuB;QACvB,+CAAqB;QACrB,2DAA2B;QAC3B,6CAAoB;QACpB,yCAAkB;QAClB,gCAAc;QACd,6CAAoB;QACpB,oCAAgB;QAChB,sCAAiB;QACjB,2CAAmB;QACnB,kDAAsB;QACtB,yCAAkB;QAClB,yCAAkB;KACrB;CACJ,CAAC;AAEF,kBAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/access/es6.classes.ts"],"names":[],"mappings":";;AAAA,iFAA4E;AAC5E,6EAAyE;AACzE,gFAA0E;AAC1E,sFAAgF;AAChF,gGAAyF;AACzF,gFAA0E;AAC1E,0EAAoE;AACpE,sFAAgF;AAChF,8EAAyE;AACzE,kGAA4F;AAC5F,4DAAuD;AACvD,wEAAkE;AAClE,gFAA0E;AAC1E,0FAAoF;AACpF,gEAA2D;AAC3D,8EAAwE;AACxE,wFAAkF;AAClF,oFAA8E;AAC9E,gGAA0F;AAC1F,kFAA4E;AAC5E,oEAA+D;AAC/D,8EAAwE;AACxE,wEAAmE;AACnE,kFAA4E;AAC5E,4EAAsE;AACtE,0EAAqE;AACrE,gFAA0E;AAC1E,gEAA2D;AAC3D,8EAAwE;AACxE,wFAAiF;AACjF,8EAAwE;AACxE,8EAAyE;AACzE,0EAAqE;AACrE,oFAA8E;AAC9E,oEAA+D;AAC/D,0EAAqE;AACrE,sFAAiF;AACjF,kEAA8D;AAC9D,oEAA+D;AAC/D,8EAAyE;AACzE,4EAAuE;AACvE,wEAAmE;AACnE,oFAA+E;AAC/E,sEAAiE;AACjE,wDAAoD;AACpD,kEAA6D;AAC7D,4DAAwD;AACxD,sEAAiE;AACjE,8DAA0D;AAC1D,oEAA+D;AAC/D,kEAA6D;AAC7D,4EAAsE;AACtE,kEAA6D;AAC7D,gEAA2D;AAC3D,0EAAoE;AACpE,0DAAqD;AACrD,gEAA2D;AAC3D,4EAAuE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"}
@@ -1,4 +1,8 @@
1
1
  export * from './process.application.menu';
2
2
  export * from './process.business.user.role.update';
3
+ export * from './process.common.list';
3
4
  export * from './process.dashboard.report';
5
+ export * from './process.date.filter';
6
+ export * from './process.listing.csv.file';
4
7
  export * from './process.menu.details';
8
+ export * from './process.report.data';
@@ -16,6 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./process.application.menu"), exports);
18
18
  __exportStar(require("./process.business.user.role.update"), exports);
19
+ __exportStar(require("./process.common.list"), exports);
19
20
  __exportStar(require("./process.dashboard.report"), exports);
21
+ __exportStar(require("./process.date.filter"), exports);
22
+ __exportStar(require("./process.listing.csv.file"), exports);
20
23
  __exportStar(require("./process.menu.details"), exports);
24
+ __exportStar(require("./process.report.data"), exports);
21
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,sEAAoD;AACpD,6DAA2C;AAC3C,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,sEAAoD;AACpD,wDAAsC;AACtC,6DAA2C;AAC3C,wDAAsC;AACtC,6DAA2C;AAC3C,yDAAuC;AACvC,wDAAsC"}
@@ -0,0 +1,31 @@
1
+ import { SqlService, UploadService } from '@servicelabsco/nestjs-utility-services';
2
+ import { CommonListFilterDto } from '../dtos/common.list.filter.dto';
3
+ import { ListResponseDto } from '../dtos/list.response.dto';
4
+ import { DateFilterDto } from '../dtos/date.filter.dto';
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 uploadService: UploadService;
18
+ protected handle(): Promise<{
19
+ aggregate: any;
20
+ }> | Promise<{
21
+ url: string;
22
+ }> | Promise<ListResponseDto>;
23
+ private getListRecords;
24
+ private getTotalRecords;
25
+ private getQueryRestrictions;
26
+ private getQuery;
27
+ private getRecords;
28
+ private aggregate;
29
+ protected processDate(date: DateFilterDto, column: string): void;
30
+ private generateCsv;
31
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessCommonList = void 0;
4
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
5
+ const process_listing_csv_file_1 = require("./process.listing.csv.file");
6
+ const process_date_filter_1 = require("./process.date.filter");
7
+ class ProcessCommonList {
8
+ constructor() {
9
+ this.restrictions = [];
10
+ this.response = { stats: {}, metrics: {}, records: [] };
11
+ }
12
+ handle() {
13
+ this.query = this.getQuery();
14
+ if (this.filter.aggregate)
15
+ return this.aggregate();
16
+ if (this.filter.format?.csv)
17
+ return this.generateCsv();
18
+ return this.getListRecords();
19
+ }
20
+ async getListRecords() {
21
+ await this.getRecords();
22
+ await this.getTotalRecords();
23
+ return this.response;
24
+ }
25
+ async getTotalRecords() {
26
+ if (this.filter?.no_metrics || this.filter?.format?.csv)
27
+ return;
28
+ const metrics = this.config?.metrics || [];
29
+ metrics.push(`count(1) count`);
30
+ const sql = `select ${this.config.metrics.join(',')} from ${this.query}`;
31
+ const record = await this.sqlService.readFirst(sql);
32
+ this.response.stats.total = record.count;
33
+ this.response.metrics = {};
34
+ for (const [key, value] of Object.entries(record)) {
35
+ if (key === 'count')
36
+ continue;
37
+ this.response.metrics[key] = value;
38
+ }
39
+ }
40
+ getQueryRestrictions() {
41
+ if (!this.restrictions.length)
42
+ return;
43
+ const record = [];
44
+ this.restrictions.forEach((restriction) => {
45
+ record.push(` ( ${restriction} ) `);
46
+ });
47
+ return record.join('and');
48
+ }
49
+ getQuery() {
50
+ const restrictions = this.getQueryRestrictions();
51
+ const columns = this.config.columns.join(',');
52
+ let sql = `select ${columns} from ${this.config.sql}`;
53
+ if (restrictions)
54
+ sql = `${sql} and ${restrictions} `;
55
+ if (this.filter.filter_query)
56
+ return `(${sql}) sq where ${this.filter.filter_query}`;
57
+ return `(${sql}) sq`;
58
+ }
59
+ async getRecords() {
60
+ const filter = this.filter;
61
+ const limit = filter.limit ?? 20;
62
+ const page = filter.page || 1;
63
+ const offset = (page - 1) * limit;
64
+ const order = this.config.order || 'sq.created_at desc';
65
+ const sql = `select sq.* from ${this.query} order by ${order} limit ${limit} offset ${offset}`;
66
+ this.response.stats.limit = limit;
67
+ this.response.stats.page = page;
68
+ this.response.records = await this.sqlService.read(sql);
69
+ }
70
+ async aggregate() {
71
+ const aggregate = this.filter.aggregate;
72
+ const supportedOperations = ['avg', 'sum', 'max', 'min'];
73
+ const key = Object.keys(aggregate)[0];
74
+ if (supportedOperations.indexOf(key) === -1)
75
+ throw new nestjs_utility_services_1.OperationException(`Given aggregate function ${key} is not supported`);
76
+ const value = Object.values(aggregate)[0];
77
+ const sql = `select ${key}(sq.${value}) aggregate from ${this.query}`;
78
+ const response = await this.sqlService.readFirst(sql);
79
+ return { aggregate: response.aggregate };
80
+ }
81
+ processDate(date, column) {
82
+ const range = new process_date_filter_1.ProcessDateFilter().process(date);
83
+ if (!range)
84
+ return;
85
+ this.restrictions.push(`${column} between '${range.min}' and '${range.max}'`);
86
+ }
87
+ async generateCsv() {
88
+ if (!this.filter?.listing_slug)
89
+ throw new nestjs_utility_services_1.OperationException(`listing slug is mandatory for csv exports`);
90
+ const dataSql = `select sq.* from ${this.query} limit 1000`;
91
+ const records = await this.sqlService.read(dataSql);
92
+ return new process_listing_csv_file_1.ProcessListingCsvFile(this.uploadService, this.sqlService).process(this.filter.listing_slug, records);
93
+ }
94
+ }
95
+ exports.ProcessCommonList = ProcessCommonList;
96
+ //# sourceMappingURL=process.common.list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.common.list.js","sourceRoot":"","sources":["../../../src/access/libraries/process.common.list.ts"],"names":[],"mappings":";;;AAAA,oFAAuG;AAGvG,yEAAmE;AACnE,+DAA0D;AAS1D,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;IAgLlF,CAAC;IA9Ja,MAAM;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAE7B,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;QACnD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG;YAAE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAEvD,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;IAEO,KAAK,CAAC,cAAc;QAExB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAG7B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAOO,KAAK,CAAC,eAAe;QAEzB,IAAI,IAAI,CAAC,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG;YAAE,OAAO;QAChE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;QAE3C,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAE/B,MAAM,GAAG,GAAG,UAAU,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,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AAoB,IAAI,CAAC,KAAK,EAAE,CAAC;QAEtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAEtD,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAUS,WAAW,CAAC,IAAmB,EAAE,MAAc;QACrD,MAAM,KAAK,GAAG,IAAI,uCAAiB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,aAAa,KAAK,CAAC,GAAG,UAAU,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;IAClF,CAAC;IAQO,KAAK,CAAC,WAAW;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY;YAAE,MAAM,IAAI,4CAAkB,CAAC,2CAA2C,CAAC,CAAC;QAE1G,MAAM,OAAO,GAAG,oBAAoB,IAAI,CAAC,KAAK,aAAa,CAAC;QAC5D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEpD,OAAO,IAAI,gDAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrH,CAAC;CACJ;AAjND,8CAiNC"}
@@ -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
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessDateFilter = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ class ProcessDateFilter {
6
+ process(filter) {
7
+ if (!filter)
8
+ return;
9
+ this.filter = filter;
10
+ this.analyseFilter();
11
+ return this.range;
12
+ }
13
+ analyseFilter() {
14
+ this.today();
15
+ if (!this.range)
16
+ this.week();
17
+ if (!this.range)
18
+ this.month();
19
+ if (!this.range)
20
+ this.year();
21
+ if (!this.range)
22
+ this.financialYear();
23
+ if (!this.range)
24
+ this.checkRange();
25
+ }
26
+ today() {
27
+ if (!this.filter.today)
28
+ return;
29
+ const today = new Date();
30
+ this.range = { min: (0, date_fns_1.startOfDay)(today), max: (0, date_fns_1.endOfDay)(today) };
31
+ }
32
+ week() {
33
+ if (!this.filter.week)
34
+ return;
35
+ const now = new Date();
36
+ this.range = { min: (0, date_fns_1.startOfWeek)(now, { weekStartsOn: 1 }), max: (0, date_fns_1.endOfDay)(now) };
37
+ }
38
+ month() {
39
+ if (!this.filter.month)
40
+ return;
41
+ const now = new Date();
42
+ this.range = { min: (0, date_fns_1.startOfMonth)(now), max: (0, date_fns_1.endOfDay)(now) };
43
+ }
44
+ year() {
45
+ if (!this.filter.year)
46
+ return;
47
+ const now = new Date();
48
+ this.range = { min: (0, date_fns_1.startOfYear)(now), max: (0, date_fns_1.endOfDay)(now) };
49
+ }
50
+ financialYear() {
51
+ if (!this.filter.financial_year)
52
+ return;
53
+ }
54
+ checkRange() {
55
+ if (!this.filter.range)
56
+ return;
57
+ this.range = this.filter.range;
58
+ }
59
+ }
60
+ exports.ProcessDateFilter = ProcessDateFilter;
61
+ //# sourceMappingURL=process.date.filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.date.filter.js","sourceRoot":"","sources":["../../../src/access/libraries/process.date.filter.ts"],"names":[],"mappings":";;;AAAA,uCAAwF;AAQxF,MAAa,iBAAiB;IAsB1B,OAAO,CAAC,MAAqB;Q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AAE,OAAO;QAE/B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,IAAA,uBAAY,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;IAChE,CAAC;IAQO,IAAI;QACR,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAC9B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QAEvB,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,IAAA,sBAAW,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;IAC/D,CAAC;IAQO,aAAa;QACjB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc;YAAE,OAAO;IAG5C,CAAC;IAQO,UAAU;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,OAAO;QAE/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IACnC,CAAC;CACJ;AA1HD,8CA0HC"}
@@ -0,0 +1,19 @@
1
+ import { SqlService, UploadService } from '@servicelabsco/nestjs-utility-services';
2
+ import { ListingColumnEntity } from '../entities';
3
+ export declare class ProcessListingCsvFile {
4
+ private readonly uploadService;
5
+ private readonly sqlService;
6
+ protected columns: ListingColumnEntity[];
7
+ protected records: any[];
8
+ protected list: string[];
9
+ private today;
10
+ constructor(uploadService: UploadService, sqlService: SqlService);
11
+ process(identifier: string, data: any[]): Promise<{
12
+ url: string;
13
+ }>;
14
+ private setColumns;
15
+ private generateFile;
16
+ private setHeader;
17
+ private setData;
18
+ private getData;
19
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessListingCsvFile = void 0;
4
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
5
+ const date_fns_1 = require("date-fns");
6
+ class ProcessListingCsvFile {
7
+ constructor(uploadService, sqlService) {
8
+ this.uploadService = uploadService;
9
+ this.sqlService = sqlService;
10
+ }
11
+ async process(identifier, data) {
12
+ this.records = data;
13
+ this.columns = await this.setColumns(identifier);
14
+ if (this.columns.length)
15
+ throw new nestjs_utility_services_1.OperationException(`Columns are not set for report`);
16
+ this.today = (0, date_fns_1.format)(new Date(), 'yyyyMMdd');
17
+ return this.generateFile(identifier);
18
+ }
19
+ async setColumns(identifier) {
20
+ const sql = `select b.* from utl_listing_pages a, utl_listing_columns b where a.deleted_at is null and b.deleted_at is null and a.id = b.listing_id and b.active = true and b.is_report_enabled = true and a.identifier = '${identifier}' order by b.priority asc, b.created_at asc`;
21
+ return this.sqlService.read(sql);
22
+ }
23
+ async generateFile(identifier) {
24
+ this.setHeader();
25
+ this.setData();
26
+ const buffer = Buffer.from(this.list.join('\n'), 'utf-8');
27
+ const originalname = `export-${identifier}-${nestjs_utility_services_1.PlatformUtility.generateRandomAlpha(16).toLowerCase()}.csv`;
28
+ const url = await this.uploadService.upload({ buffer, originalname }, { folder: `csv-exports/${this.today}` });
29
+ return { url };
30
+ }
31
+ setHeader() {
32
+ const header = ['SN'];
33
+ this.columns.forEach((column) => {
34
+ header.push(column.name);
35
+ });
36
+ this.list.push(header.join(','));
37
+ }
38
+ setData() {
39
+ let iteration = 0;
40
+ for (const record of this.records) {
41
+ const row = [++iteration];
42
+ for (const column of this.columns) {
43
+ const data = this.getData(record, column.identifier);
44
+ row.push(data);
45
+ }
46
+ this.list.push(row.join(','));
47
+ }
48
+ }
49
+ getData(record, identifier) {
50
+ const columns = identifier.split('.');
51
+ let r = { ...record };
52
+ columns.forEach((column) => {
53
+ r = r[column];
54
+ });
55
+ return r;
56
+ }
57
+ }
58
+ exports.ProcessListingCsvFile = ProcessListingCsvFile;
59
+ //# sourceMappingURL=process.listing.csv.file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.listing.csv.file.js","sourceRoot":"","sources":["../../../src/access/libraries/process.listing.csv.file.ts"],"names":[],"mappings":";;;AAAA,oFAAwH;AACxH,uCAAkC;AAIlC,MAAa,qBAAqB;IAuC9B,YAA6B,aAA4B,EAAmB,UAAsB;QAArE,kBAAa,GAAb,aAAa,CAAe;QAAmB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAStG,KAAK,CAAC,OAAO,CAAC,UAAkB,EAAE,IAAW;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,MAAM,IAAI,4CAAkB,CAAC,gCAAgC,CAAC,CAAC;QAExF,IAAI,CAAC,KAAK,GAAG,IAAA,iBAAM,EAAC,IAAI,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IASO,KAAK,CAAC,UAAU,CAAC,UAAkB;QACvC,MAAM,GAAG,GAAG,iNAAiN,UAAU,6CAA6C,CAAC;QAErR,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IASO,KAAK,CAAC,YAAY,CAAC,UAAkB;QACzC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;QAEf,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,UAAU,UAAU,IAAI,yCAAe,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC;QAEzG,MAAM,GAAG,GAAG,MAAM,IAAI,CAA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,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACb,CAAC;CACJ;AAhJD,sDAgJC"}
@@ -0,0 +1,28 @@
1
+ import { ReportEntity, SqlService, UploadService } from '@servicelabsco/nestjs-utility-services';
2
+ import { CommonListFilterDto } from '../dtos/common.list.filter.dto';
3
+ import { ListResponseDto } from '../dtos/list.response.dto';
4
+ export declare class ProcessReportData {
5
+ private readonly sqlService;
6
+ private readonly report;
7
+ private readonly uploadService;
8
+ protected filter: CommonListFilterDto;
9
+ private query;
10
+ protected restrictions: string[];
11
+ protected response: ListResponseDto;
12
+ constructor(sqlService: SqlService, report: ReportEntity, uploadService: UploadService);
13
+ list(filter: any): Promise<ListResponseDto | {
14
+ url: string;
15
+ } | {
16
+ aggregate: any;
17
+ }>;
18
+ data(filter: any): Promise<any>;
19
+ private getListRecords;
20
+ private getQueryRestrictions;
21
+ private getRecords;
22
+ private getTotalRecords;
23
+ private setQuery;
24
+ private aggregate;
25
+ private sendResponse;
26
+ private getParamRestrictions;
27
+ private generateCsv;
28
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessReportData = void 0;
4
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
5
+ const process_listing_csv_file_1 = require("./process.listing.csv.file");
6
+ class ProcessReportData {
7
+ constructor(sqlService, report, uploadService) {
8
+ this.sqlService = sqlService;
9
+ this.report = report;
10
+ this.uploadService = uploadService;
11
+ this.restrictions = [];
12
+ this.response = { stats: {}, metrics: {}, records: [] };
13
+ }
14
+ async list(filter) {
15
+ this.filter = filter;
16
+ this.query = await this.setQuery();
17
+ if (this.filter.aggregate)
18
+ return this.aggregate();
19
+ if (this.filter.format?.csv)
20
+ return this.generateCsv();
21
+ return this.getListRecords();
22
+ }
23
+ async data(filter) {
24
+ this.filter = filter;
25
+ this.query = await this.setQuery();
26
+ const sql = `select * from ${this.query}`;
27
+ return this.sqlService.read(sql);
28
+ }
29
+ async getListRecords() {
30
+ await this.getRecords();
31
+ await this.getTotalRecords();
32
+ return this.sendResponse();
33
+ }
34
+ getQueryRestrictions() {
35
+ if (!this.restrictions.length)
36
+ return;
37
+ const record = [];
38
+ this.restrictions.forEach((restriction) => {
39
+ record.push(` ( ${restriction} ) `);
40
+ });
41
+ return record.join('and');
42
+ }
43
+ async getRecords() {
44
+ const filter = this.filter;
45
+ const limit = filter.limit ?? 20;
46
+ const page = filter.page || 1;
47
+ const offset = (page - 1) * limit;
48
+ const sql = `select sq.* from ${this.query} limit ${limit} offset ${offset}`;
49
+ this.response.stats.limit = limit;
50
+ this.response.stats.page = page;
51
+ this.response.records = await this.sqlService.read(sql);
52
+ }
53
+ async getTotalRecords() {
54
+ if (this.filter?.no_metrics || this.filter?.format?.csv)
55
+ return;
56
+ const sql = `select count(1) count from ${this.query}`;
57
+ const record = await this.sqlService.readFirst(sql);
58
+ this.response.stats.total = record.count;
59
+ }
60
+ async setQuery() {
61
+ let sql = this.report.query.script;
62
+ const restrictions = this.getQueryRestrictions();
63
+ if (restrictions)
64
+ sql = `${sql} and ${restrictions}`;
65
+ for (const [key, value] of Object.entries(this.filter)) {
66
+ sql = sql.replace(new RegExp(`:${key}`, 'ig'), value);
67
+ }
68
+ const paramRestrictions = await this.getParamRestrictions();
69
+ if (paramRestrictions)
70
+ sql = `${sql} and ${paramRestrictions}`;
71
+ if (this.filter.filter_query)
72
+ return `(${sql}) sq where ${this.filter.filter_query}`;
73
+ return `(${sql}) sq`;
74
+ }
75
+ async aggregate() {
76
+ const aggregate = this.filter.aggregate;
77
+ const supportedOperations = ['avg', 'sum', 'max', 'min'];
78
+ const key = Object.keys(aggregate)[0];
79
+ if (supportedOperations.indexOf(key) === -1)
80
+ throw new nestjs_utility_services_1.OperationException(`Given aggregate function ${key} is not supported`);
81
+ const value = Object.values(aggregate)[0];
82
+ const sql = `select ${key}(sq.${value}) aggregate from ${this.query}`;
83
+ const response = await this.sqlService.readFirst(sql);
84
+ return { aggregate: response.aggregate };
85
+ }
86
+ async sendResponse() {
87
+ if (!this.filter.format?.csv)
88
+ return this.response;
89
+ }
90
+ async getParamRestrictions() {
91
+ const filters = await nestjs_utility_services_1.ReportFilterEntity.find({ where: { report_id: this.report.id } });
92
+ if (!filters.length)
93
+ return;
94
+ const restrictions = [];
95
+ for (const filter of filters) {
96
+ if (!this.filter[filter.column])
97
+ continue;
98
+ restrictions.push(`${filter.identifier} = '${this.filter[filter.column]}'`);
99
+ }
100
+ if (restrictions.length)
101
+ return `${restrictions.join(' and ')}`;
102
+ return '';
103
+ }
104
+ async generateCsv() {
105
+ if (!this.filter?.listing_slug)
106
+ throw new nestjs_utility_services_1.OperationException(`listing slug is mandatory for csv exports`);
107
+ const dataSql = `select sq.* from ${this.query} limit 1000`;
108
+ const records = await this.sqlService.read(dataSql);
109
+ return new process_listing_csv_file_1.ProcessListingCsvFile(this.uploadService, this.sqlService).process(this.filter.listing_slug, records);
110
+ }
111
+ }
112
+ exports.ProcessReportData = ProcessReportData;
113
+ //# sourceMappingURL=process.report.data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.report.data.js","sourceRoot":"","sources":["../../../src/access/libraries/process.report.data.ts"],"names":[],"mappings":";;;AAAA,oFAAyI;AAGzI,yEAAmE;AAEnE,MAAa,iBAAiB;IAwC1B,YAA6B,UAAsB,EAAmB,MAAoB,EAAmB,aAA4B;QAA5G,eAAU,GAAV,UAAU,CAAY;QAAmB,WAAM,GAAN,MAAM,CAAc;QAAmB,kBAAa,GAAb,aAAa,CAAe;QAjB/H,iBAAY,GAAa,EAAE,CAAC;QAQ5B,aAAQ,GAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAS8D,CAAC;IAQ7I,KAAK,CAAC,IAAI,CAAC,MAAW;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,IAA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AM,OAAO,GAAG,MAAM,4CAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO;QAE5B,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;gBAAE,SAAS;YAE1C,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,UAAU,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC/E;QAED,IAAI,YAAY,CAAC,MAAM;YAAE,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAEhE,OAAO,EAAE,CAAC;IACd,CAAC;IAQO,KAAK,CAAC,WAAW;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY;YAAE,MAAM,IAAI,4CAAkB,CAAC,2CAA2C,CAAC,CAAC;QAE1G,MAAM,OAAO,GAAG,oBAAoB,IAAI,CAAC,KAAK,aAAa,CAAC;QAC5D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEpD,OAAO,IAAI,gDAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrH,CAAC;CACJ;AA/ND,8CA+NC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationUtility } from '@servicelabsco/nestjs-utility-services';
2
+ export declare class AddVisibilityUtlListingColumnsTable1693641946423 extends MigrationUtility {
3
+ constructor();
4
+ process(): void;
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddVisibilityUtlListingColumnsTable1693641946423 = void 0;
4
+ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
5
+ class AddVisibilityUtlListingColumnsTable1693641946423 extends nestjs_utility_services_1.MigrationUtility {
6
+ constructor() {
7
+ super('utl_listing_columns');
8
+ this.process();
9
+ }
10
+ process() {
11
+ this.boolean('is_visible', true);
12
+ this.boolean('is_report_enabled', true);
13
+ }
14
+ }
15
+ exports.AddVisibilityUtlListingColumnsTable1693641946423 = AddVisibilityUtlListingColumnsTable1693641946423;
16
+ //# sourceMappingURL=1693641946423-AddVisibilityUtlListingColumnsTable.ts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1693641946423-AddVisibilityUtlListingColumnsTable.ts.js","sourceRoot":"","sources":["../../src/migrations/1693641946423-AddVisibilityUtlListingColumnsTable.ts.ts"],"names":[],"mappings":";;;AAAA,oFAA0E;AAE1E,MAAa,gDAAiD,SAAQ,0CAAgB;IAClF;QACI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;CACJ;AAVD,4GAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicelabsco/slabs-access-manager",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "Support for application level menus and dashboards",
5
5
  "author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
6
6
  "license": "MIT",