@solid-nestjs/common 0.2.4 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enums/aggregate-function.enum.d.ts +42 -0
- package/dist/enums/aggregate-function.enum.d.ts.map +1 -0
- package/dist/enums/aggregate-function.enum.js +46 -0
- package/dist/enums/aggregate-function.enum.js.map +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +1 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/helpers/types.helper.d.ts +9 -0
- package/dist/helpers/types.helper.d.ts.map +1 -1
- package/dist/helpers/types.helper.js +19 -0
- package/dist/helpers/types.helper.js.map +1 -1
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/inputs/filters.interfaces.d.ts +36 -0
- package/dist/interfaces/inputs/filters.interfaces.d.ts.map +1 -0
- package/dist/interfaces/inputs/filters.interfaces.js +3 -0
- package/dist/interfaces/inputs/filters.interfaces.js.map +1 -0
- package/dist/interfaces/inputs/find-args.interface.d.ts +8 -0
- package/dist/interfaces/inputs/find-args.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/find-args.interface.js +3 -0
- package/dist/interfaces/inputs/find-args.interface.js.map +1 -0
- package/dist/interfaces/inputs/group-by-args.interface.d.ts +33 -0
- package/dist/interfaces/inputs/group-by-args.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/group-by-args.interface.js +3 -0
- package/dist/interfaces/inputs/group-by-args.interface.js.map +1 -0
- package/dist/interfaces/inputs/group-by-request.interface.d.ts +63 -0
- package/dist/interfaces/inputs/group-by-request.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/group-by-request.interface.js +3 -0
- package/dist/interfaces/inputs/group-by-request.interface.js.map +1 -0
- package/dist/interfaces/inputs/index.d.ts +6 -0
- package/dist/interfaces/inputs/index.d.ts.map +1 -0
- package/dist/interfaces/inputs/index.js +22 -0
- package/dist/interfaces/inputs/index.js.map +1 -0
- package/dist/interfaces/inputs/pagination-request.interface.d.ts +7 -0
- package/dist/interfaces/inputs/pagination-request.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/pagination-request.interface.js +3 -0
- package/dist/interfaces/inputs/pagination-request.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-args.interface.d.ts +33 -0
- package/dist/interfaces/misc/group-by-args.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-args.interface.js +3 -0
- package/dist/interfaces/misc/group-by-args.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-request.interface.d.ts +63 -0
- package/dist/interfaces/misc/group-by-request.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-request.interface.js +3 -0
- package/dist/interfaces/misc/group-by-request.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-response.interface.d.ts +59 -0
- package/dist/interfaces/misc/group-by-response.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-response.interface.js +3 -0
- package/dist/interfaces/misc/group-by-response.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by.interface.d.ts +145 -0
- package/dist/interfaces/misc/group-by.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by.interface.js +3 -0
- package/dist/interfaces/misc/group-by.interface.js.map +1 -0
- package/dist/interfaces/misc/index.d.ts +0 -4
- package/dist/interfaces/misc/index.d.ts.map +1 -1
- package/dist/interfaces/misc/index.js +0 -4
- package/dist/interfaces/misc/index.js.map +1 -1
- package/dist/interfaces/outputs/group-by-response.interface.d.ts +59 -0
- package/dist/interfaces/outputs/group-by-response.interface.d.ts.map +1 -0
- package/dist/interfaces/outputs/group-by-response.interface.js +3 -0
- package/dist/interfaces/outputs/group-by-response.interface.js.map +1 -0
- package/dist/interfaces/outputs/index.d.ts +3 -0
- package/dist/interfaces/outputs/index.d.ts.map +1 -0
- package/dist/interfaces/outputs/index.js +19 -0
- package/dist/interfaces/outputs/index.js.map +1 -0
- package/dist/interfaces/outputs/pagination-result.interface.d.ts +10 -0
- package/dist/interfaces/outputs/pagination-result.interface.d.ts.map +1 -0
- package/dist/interfaces/outputs/pagination-result.interface.js +3 -0
- package/dist/interfaces/outputs/pagination-result.interface.js.map +1 -0
- package/dist/interfaces/services/crud-service.interface.d.ts +2 -1
- package/dist/interfaces/services/crud-service.interface.d.ts.map +1 -1
- package/dist/interfaces/services/crud-service.interface.js.map +1 -1
- package/dist/interfaces/services/data-service.interface.d.ts +3 -1
- package/dist/interfaces/services/data-service.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/common-services.index.d.ts +1 -0
- package/dist/interfaces/structures/common-services.index.d.ts.map +1 -0
- package/dist/interfaces/structures/common-services.index.js +2 -0
- package/dist/interfaces/structures/common-services.index.js.map +1 -0
- package/dist/interfaces/structures/crud-service-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/crud-service-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/data-service-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/data-service-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.js.map +1 -1
- package/dist/interfaces/structures/service-plugins.interface.d.ts +3 -2
- package/dist/interfaces/structures/service-plugins.interface.d.ts.map +1 -1
- package/dist/types/find-args.type.d.ts +9 -7
- package/dist/types/find-args.type.d.ts.map +1 -1
- package/dist/types/group-by.type.d.ts +41 -0
- package/dist/types/group-by.type.d.ts.map +1 -0
- package/dist/types/group-by.type.js +3 -0
- package/dist/types/group-by.type.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/objects.utils.d.ts +8 -0
- package/dist/utils/objects.utils.d.ts.map +1 -0
- package/dist/utils/objects.utils.js +13 -0
- package/dist/utils/objects.utils.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PaginationResult } from './pagination-result.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single group result.
|
|
4
|
+
*
|
|
5
|
+
* @interface GroupResult
|
|
6
|
+
* @template T - The entity type being grouped
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const groupResult: GroupResult<Product> = {
|
|
11
|
+
* key: { category: 'Electronics', supplierName: 'TechCorp' },
|
|
12
|
+
* aggregates: { avgPrice: 1250.50, totalProducts: 15 }
|
|
13
|
+
* };
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export interface GroupResult<T = any> {
|
|
17
|
+
/**
|
|
18
|
+
* The grouped key values as an object
|
|
19
|
+
*/
|
|
20
|
+
key: Record<string, any>;
|
|
21
|
+
/**
|
|
22
|
+
* The computed aggregate values as an object
|
|
23
|
+
*/
|
|
24
|
+
aggregates: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents the result of a grouped query with pagination.
|
|
28
|
+
* Extends PaginationResult to reuse existing pagination properties.
|
|
29
|
+
*
|
|
30
|
+
* @interface GroupedPaginationResult
|
|
31
|
+
* @template T - The entity type being grouped
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const result: GroupedPaginationResult<Product> = {
|
|
36
|
+
* groups: [groupResult1, groupResult2, ...],
|
|
37
|
+
* pagination: {
|
|
38
|
+
* total: 25,
|
|
39
|
+
* count: 10,
|
|
40
|
+
* limit: 10,
|
|
41
|
+
* page: 1,
|
|
42
|
+
* pageCount: 3,
|
|
43
|
+
* hasNextPage: true,
|
|
44
|
+
* hasPreviousPage: false
|
|
45
|
+
* }
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export interface GroupedPaginationResult<T = any> {
|
|
50
|
+
/**
|
|
51
|
+
* Array of group results
|
|
52
|
+
*/
|
|
53
|
+
groups: GroupResult<T>[];
|
|
54
|
+
/**
|
|
55
|
+
* Pagination information for the groups
|
|
56
|
+
*/
|
|
57
|
+
pagination: PaginationResult;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=group-by-response.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-response.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-response.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-response.interface.js","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-response.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { AggregateFunctionTypes } from '../../enums';
|
|
2
|
+
import { GroupBy } from '../../types/find-args.type';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an aggregate field configuration for groupBy operations.
|
|
5
|
+
*
|
|
6
|
+
* @interface AggregateField
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const aggregateField: AggregateField = {
|
|
11
|
+
* field: 'price',
|
|
12
|
+
* function: AggregateFunctionTypes.AVG,
|
|
13
|
+
* alias: 'averagePrice'
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface AggregateField {
|
|
18
|
+
/**
|
|
19
|
+
* The field name to apply the aggregate function to
|
|
20
|
+
*/
|
|
21
|
+
field: string;
|
|
22
|
+
/**
|
|
23
|
+
* The aggregate function to apply
|
|
24
|
+
*/
|
|
25
|
+
function: AggregateFunctionTypes;
|
|
26
|
+
/**
|
|
27
|
+
* Optional alias for the aggregate result
|
|
28
|
+
* If not provided, defaults to `${function}_${field}`
|
|
29
|
+
*/
|
|
30
|
+
alias?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents the groupBy configuration for queries.
|
|
34
|
+
*
|
|
35
|
+
* @interface GroupByRequest
|
|
36
|
+
* @template T - The entity type being grouped
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const groupByRequest: GroupByRequest<Product> = {
|
|
41
|
+
* fields: {
|
|
42
|
+
* category: true,
|
|
43
|
+
* supplier: { name: true }
|
|
44
|
+
* },
|
|
45
|
+
* aggregates: [
|
|
46
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG, alias: 'avgPrice' },
|
|
47
|
+
* { field: 'id', function: AggregateFunctionTypes.COUNT, alias: 'totalProducts' }
|
|
48
|
+
* ],
|
|
49
|
+
* includeItems: false
|
|
50
|
+
* };
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export interface GroupByRequest<T = any> {
|
|
54
|
+
/**
|
|
55
|
+
* Fields to group by (similar to OrderBy structure)
|
|
56
|
+
*/
|
|
57
|
+
fields?: GroupBy<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Aggregate functions to apply
|
|
60
|
+
*/
|
|
61
|
+
aggregates?: AggregateField[];
|
|
62
|
+
/**
|
|
63
|
+
* Whether to include individual items in each group
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
includeItems?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Maximum number of items to include per group when includeItems is true
|
|
69
|
+
* @default 10
|
|
70
|
+
*/
|
|
71
|
+
maxItemsPerGroup?: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Represents a single group result.
|
|
75
|
+
*
|
|
76
|
+
* @interface GroupResult
|
|
77
|
+
* @template T - The entity type being grouped
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const groupResult: GroupResult<Product> = {
|
|
82
|
+
* key: { category: 'Electronics', supplierName: 'TechCorp' },
|
|
83
|
+
* aggregates: { avgPrice: 1250.50, totalProducts: 15 },
|
|
84
|
+
* items: [product1, product2, ...] // optional
|
|
85
|
+
* };
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export interface GroupResult<T = any> {
|
|
89
|
+
/**
|
|
90
|
+
* The grouped key values (can be object or JSON string for GraphQL compatibility)
|
|
91
|
+
*/
|
|
92
|
+
key: Record<string, any> | string;
|
|
93
|
+
/**
|
|
94
|
+
* The computed aggregate values (can be object or JSON string for GraphQL compatibility)
|
|
95
|
+
*/
|
|
96
|
+
aggregates: Record<string, any> | string;
|
|
97
|
+
/**
|
|
98
|
+
* Individual items in this group (optional)
|
|
99
|
+
*/
|
|
100
|
+
items?: T[];
|
|
101
|
+
/**
|
|
102
|
+
* Total count of items in this group
|
|
103
|
+
*/
|
|
104
|
+
count: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Represents the result of a grouped query with pagination.
|
|
108
|
+
*
|
|
109
|
+
* @interface GroupedPaginationResult
|
|
110
|
+
* @template T - The entity type being grouped
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const result: GroupedPaginationResult<Product> = {
|
|
115
|
+
* groups: [groupResult1, groupResult2, ...],
|
|
116
|
+
* totalGroups: 25,
|
|
117
|
+
* page: 1,
|
|
118
|
+
* limit: 10,
|
|
119
|
+
* totalItems: 150
|
|
120
|
+
* };
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export interface GroupedPaginationResult<T = any> {
|
|
124
|
+
/**
|
|
125
|
+
* Array of group results
|
|
126
|
+
*/
|
|
127
|
+
groups: GroupResult<T>[];
|
|
128
|
+
/**
|
|
129
|
+
* Total number of groups
|
|
130
|
+
*/
|
|
131
|
+
totalGroups: number;
|
|
132
|
+
/**
|
|
133
|
+
* Current page number
|
|
134
|
+
*/
|
|
135
|
+
page: number;
|
|
136
|
+
/**
|
|
137
|
+
* Number of groups per page
|
|
138
|
+
*/
|
|
139
|
+
limit: number;
|
|
140
|
+
/**
|
|
141
|
+
* Total number of individual items across all groups
|
|
142
|
+
*/
|
|
143
|
+
totalItems: number;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=group-by.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,sBAAsB,CAAC;IAEjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IAElC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by.interface.js","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export * from './context.interface';
|
|
2
2
|
export * from './entity.interface';
|
|
3
|
-
export * from './filters.interfaces';
|
|
4
|
-
export * from './find-args.interface';
|
|
5
|
-
export * from './pagination-request.interface';
|
|
6
|
-
export * from './pagination-result.interface';
|
|
7
3
|
export * from './audit-service.interface';
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC"}
|
|
@@ -16,9 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./context.interface"), exports);
|
|
18
18
|
__exportStar(require("./entity.interface"), exports);
|
|
19
|
-
__exportStar(require("./filters.interfaces"), exports);
|
|
20
|
-
__exportStar(require("./find-args.interface"), exports);
|
|
21
|
-
__exportStar(require("./pagination-request.interface"), exports);
|
|
22
|
-
__exportStar(require("./pagination-result.interface"), exports);
|
|
23
19
|
__exportStar(require("./audit-service.interface"), exports);
|
|
24
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/misc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/misc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,4DAA0C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PaginationResult } from './pagination-result.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single group result.
|
|
4
|
+
*
|
|
5
|
+
* @interface GroupResult
|
|
6
|
+
* @template T - The entity type being grouped
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const groupResult: GroupResult<Product> = {
|
|
11
|
+
* key: { category: 'Electronics', supplierName: 'TechCorp' },
|
|
12
|
+
* aggregates: { avgPrice: 1250.50, totalProducts: 15 }
|
|
13
|
+
* };
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export interface GroupResult<T = any> {
|
|
17
|
+
/**
|
|
18
|
+
* The grouped key values as an object
|
|
19
|
+
*/
|
|
20
|
+
key: Record<string, any>;
|
|
21
|
+
/**
|
|
22
|
+
* The computed aggregate values as an object
|
|
23
|
+
*/
|
|
24
|
+
aggregates: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents the result of a grouped query with pagination.
|
|
28
|
+
* Extends PaginationResult to reuse existing pagination properties.
|
|
29
|
+
*
|
|
30
|
+
* @interface GroupedPaginationResult
|
|
31
|
+
* @template T - The entity type being grouped
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const result: GroupedPaginationResult<Product> = {
|
|
36
|
+
* groups: [groupResult1, groupResult2, ...],
|
|
37
|
+
* pagination: {
|
|
38
|
+
* total: 25,
|
|
39
|
+
* count: 10,
|
|
40
|
+
* limit: 10,
|
|
41
|
+
* page: 1,
|
|
42
|
+
* pageCount: 3,
|
|
43
|
+
* hasNextPage: true,
|
|
44
|
+
* hasPreviousPage: false
|
|
45
|
+
* }
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export interface GroupedPaginationResult<T = any> {
|
|
50
|
+
/**
|
|
51
|
+
* Array of group results
|
|
52
|
+
*/
|
|
53
|
+
groups: GroupResult<T>[];
|
|
54
|
+
/**
|
|
55
|
+
* Pagination information for the groups
|
|
56
|
+
*/
|
|
57
|
+
pagination: PaginationResult;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=group-by-response.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-response.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/outputs/group-by-response.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-response.interface.js","sourceRoot":"","sources":["../../../src/interfaces/outputs/group-by-response.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/outputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./group-by-response.interface"), exports);
|
|
18
|
+
__exportStar(require("./pagination-result.interface"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/outputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,gEAA8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination-result.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/outputs/pagination-result.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination-result.interface.js","sourceRoot":"","sources":["../../../src/interfaces/outputs/pagination-result.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DeepPartial } from '../../types';
|
|
2
|
-
import { Context, IdTypeFrom, Entity
|
|
2
|
+
import { Context, IdTypeFrom, Entity } from '../misc';
|
|
3
|
+
import { FindArgs } from '../inputs';
|
|
3
4
|
import { DataService } from './data-service.interface';
|
|
4
5
|
/**
|
|
5
6
|
* Interface for Create, Update, and Delete operations without soft deletion support.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud-service.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/services/crud-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"crud-service.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/services/crud-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU,CACzB,MAAM,SAAS,UAAU,CAAC,UAAU,CAAC,EACrC,UAAU,SAAS,MAAM,CAAC,OAAO,CAAC,EAClC,eAAe,SAAS,WAAW,CAAC,UAAU,CAAC,EAC/C,eAAe,SAAS,WAAW,CAAC,UAAU,CAAC,EAC/C,YAAY,SAAS,QAAQ,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,EAChE,WAAW,SAAS,OAAO,GAAG,OAAO;IAErC;;;;;;OAMG;IACH,MAAM,CACJ,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,eAAe,GAC3B,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;OAOG;IACH,MAAM,CACJ,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,eAAe,GAC3B,OAAO,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.js","sourceRoot":"","sources":["../../../src/interfaces/services/crud-service.interface.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"crud-service.interface.js","sourceRoot":"","sources":["../../../src/interfaces/services/crud-service.interface.ts"],"names":[],"mappings":";;AA8KA,gEAyBC;AA1BD,kEAAkE;AAClE,SAAgB,0BAA0B,CAQxC,OAOC;IASD,OAAO,OAAO,IAAI,OAAQ,OAAe,CAAC,UAAU,KAAK,UAAU,CAAC;AACtE,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BooleanType, NotNullableIf, If } from '../../types';
|
|
2
|
-
import { Context, IdTypeFrom, Entity
|
|
2
|
+
import { Context, IdTypeFrom, Entity } from '../misc';
|
|
3
|
+
import { FindArgs } from '../inputs';
|
|
4
|
+
import { PaginationResult } from '../outputs';
|
|
3
5
|
import { Where } from '../../types/find-args.type';
|
|
4
6
|
/**
|
|
5
7
|
* Generic interface for a data service that provides CRUD-like operations and transactional support.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-service.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/services/data-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"data-service.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/services/data-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;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ACd,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=common-services.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-services.index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/common-services.index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-services.index.js","sourceRoot":"","sources":["../../../src/interfaces/structures/common-services.index.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constructable, DeepPartial } from '../../types';
|
|
2
|
-
import { Context, Entity,
|
|
2
|
+
import { Context, Entity, IdTypeFrom } from '../misc';
|
|
3
|
+
import { FindArgs } from '../inputs';
|
|
3
4
|
import { DataServiceFunctions, DataServiceStructure } from './data-service-structure.interface';
|
|
4
5
|
/**
|
|
5
6
|
* Configuration structure for individual CRUD service functions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud-service-structure.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/crud-service-structure.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"crud-service-structure.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/crud-service-structure.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,E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C,eAAe,CAAC,CAAC;IAChD,wDAAwD;IACxD,SAAS,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;CAC9C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constructable } from '../../types';
|
|
2
|
-
import { Context, Entity,
|
|
2
|
+
import { Context, Entity, IdTypeFrom } from '../misc';
|
|
3
|
+
import { FindArgs } from '../inputs';
|
|
3
4
|
import { EntityProviderStructure } from './entity-provider-structure.interface';
|
|
4
5
|
/**
|
|
5
6
|
* Configuration structure for individual data service functions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-service-structure.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/data-service-structure.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"data-service-structure.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/data-service-structure.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,WAAW,4BAA4B,CAAC,UAAU;IACtD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,UAAU;IAC9C,8CAA8C;IAC9C,OAAO,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACnD,8CAA8C;IAC9C,OAAO,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACnD,iDAAiD;IACjD,UAAU,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB,CACnC,MAAM,SAAS,UAAU,CAAC,UAAU,CAAC,EACrC,UAAU,SAAS,MAAM,CAAC,OAAO,CAAC,EAClC,YAAY,SAAS,QAAQ,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,EAChE,WAAW,SAAS,OAAO,GAAG,OAAO,CACrC,SAAQ,uBAAuB,CAAC,MAAM,EAAE,UAAU,CAAC;IACnD,uDAAuD;IACvD,YAAY,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,gDAAgD;IAChD,WAAW,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACzC,wDAAwD;IACxD,SAAS,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;CAC9C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PipeTransform, Type } from '@nestjs/common';
|
|
2
2
|
import { Constructable, DeepPartial } from '../../types';
|
|
3
|
-
import { Context, Entity,
|
|
3
|
+
import { Context, Entity, IdTypeFrom } from '../misc';
|
|
4
|
+
import { FindArgs } from '../inputs';
|
|
4
5
|
export interface IdStructure<IdType> {
|
|
5
6
|
type: Constructable<IdType>;
|
|
6
7
|
pipeTransforms?: Type<PipeTransform>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-provider-structure.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/entity-provider-structure.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"entity-provider-structure.interface.d.ts","sourceRoot":"","sources":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AY,EACZ,WAAW,CACZ,GACA,qBAAqB,CACtB,MAAM,EACN,UAAU,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,CACZ,CAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-provider-structure.interface.js","sourceRoot":"","sources":["../../../src/interfaces/structures/entity-provider-structure.interface.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"entity-provider-structure.interface.js","sourceRoot":"","sources":["../../../src/interfaces/structures/entity-provider-structure.interface.ts"],"names":[],"mappings":";;AAmBA,oCAaC;AAwBD,sDASC;AAED,sDAyBC;AA3FD,2CAAyE;AAkBzE,SAAgB,YAAY,CAG1B,cAA2D;IAC3D,IAAI,cAAc,CAAC,QAAQ;QAAE,OAAO;IAEpC,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,IAAA,iCAAuB,EAAC,MAAM,CAAC,CAAC;IAExD,cAAc,CAAC,QAAQ,GAAG;QACxB,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;KACzD,CAAC;AACJ,CAAC;AAwBD,SAAgB,qBAAqB,CAMnC,KAA2E;IAE3E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,qBAAqB,CAQnC,KAOC;IASD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Type } from '@nestjs/common';
|
|
2
2
|
import { Constructable, DeepPartial, UnionToIntersection } from '../../types';
|
|
3
|
-
import { Context, Entity,
|
|
3
|
+
import { Context, Entity, IdTypeFrom } from '../misc';
|
|
4
|
+
import { FindArgs } from '../inputs';
|
|
4
5
|
import { DataService, CrudService } from '../services';
|
|
5
6
|
import { CrudServiceStructure } from './crud-service-structure.interface';
|
|
6
7
|
import { DataServiceStructure } from './data-service-structure.interface';
|
|
@@ -124,7 +125,7 @@ export interface ServicePlugin<IdType extends IdTypeFrom<EntityType>, EntityType
|
|
|
124
125
|
* }
|
|
125
126
|
* ```
|
|
126
127
|
*/
|
|
127
|
-
applyCrudServiceClass?(serviceClass: Constructable<CrudService<IdType, EntityType, CreateInputType, UpdateInputType, FindArgsType, ContextType
|
|
128
|
+
applyCrudServiceClass?(serviceClass: Constructable<CrudService<IdType, EntityType, CreateInputType, UpdateInputType, FindArgsType, ContextType> & TDataAddOns>, structure: CrudServiceStructure<IdType, EntityType, CreateInputType, UpdateInputType, FindArgsType, ContextType> & TDataOptions & TCrudOptions): Type<CrudService<IdType, EntityType, CreateInputType, UpdateInputType, FindArgsType, ContextType> & TDataAddOns & TCrudAddOns>;
|
|
128
129
|
}
|
|
129
130
|
/**
|
|
130
131
|
* Utility type that extracts and merges all data add-ons from an array of service plugins.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-plugins.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/service-plugins.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"service-plugins.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/structures/service-plugins.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,W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,EAAE,IACD,mBAAmB,CACrB,sBAAsB,CAAC,MAAM,CAAC,SAAS,aAAa,CAClD,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,MAAM,QAAQ,EACd,GAAG,EACH,GAAG,CACJ,GACG,QAAQ,GACR,KAAK,CACV,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,oCAAoC,CAC9C,sBAAsB,SAAS,SAAS,aAAa,CACnD,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,CACJ,EAAE,IACD,wCAAwC,CAAC,sBAAsB,CAAC,GAClE,wCAAwC,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderByTypes } from '../enums';
|
|
2
|
-
import { StringFilter, NumberFilter, DateFilter } from './../interfaces/
|
|
2
|
+
import { StringFilter, NumberFilter, DateFilter } from './../interfaces/inputs/filters.interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a flexible filter type for a given field type `T` in query operations.
|
|
5
5
|
*
|
|
@@ -7,13 +7,14 @@ import { StringFilter, NumberFilter, DateFilter } from './../interfaces/misc/fil
|
|
|
7
7
|
* - For `number` fields, allows a number, an array of numbers, or a `NumberFilter` object.
|
|
8
8
|
* - For `Date` fields, allows a `Date`, an array of `Date`s, or a `DateFilter` object.
|
|
9
9
|
* - For `boolean` fields, allows a boolean value.
|
|
10
|
+
* - For array fields (e.g., `InvoiceDetail[]`), extracts the element type and applies `Where<ElementType>`.
|
|
10
11
|
* - For all other types, recursively applies the `Where<T>` type.
|
|
11
12
|
*
|
|
12
13
|
* This utility type is typically used to define the shape of "where" filter arguments in query builders or ORM-like APIs.
|
|
13
14
|
*
|
|
14
15
|
* @template T - The type of the field to generate a filter for.
|
|
15
16
|
*/
|
|
16
|
-
type WhereField<T> = T extends string ? string | string[] | StringFilter : T extends number ? number | number[] | NumberFilter : T extends Date ? Date | Date[] | DateFilter : T extends boolean ? boolean : Where<T>;
|
|
17
|
+
type WhereField<T> = T extends string ? string | string[] | StringFilter : T extends number ? number | number[] | NumberFilter : T extends Date ? Date | Date[] | DateFilter : T extends boolean ? boolean : T extends (infer U)[] ? Where<U> : Where<T>;
|
|
17
18
|
/**
|
|
18
19
|
* Represents a flexible filter type for querying objects of type `T`.
|
|
19
20
|
*
|
|
@@ -34,15 +35,16 @@ export type Where<T> = {
|
|
|
34
35
|
/**
|
|
35
36
|
* Infers the appropriate ordering type for a given field type `T`.
|
|
36
37
|
*
|
|
37
|
-
* - If `T` is a `string`, the type is `
|
|
38
|
-
* - If `T` is a `number`, the type is `
|
|
39
|
-
* - If `T` is a `Date`, the type is `
|
|
40
|
-
* - If `T` is a `boolean`, the type is `
|
|
38
|
+
* - If `T` is a `string`, the type is `OrderByTypes`.
|
|
39
|
+
* - If `T` is a `number`, the type is `OrderByTypes`.
|
|
40
|
+
* - If `T` is a `Date`, the type is `OrderByTypes`.
|
|
41
|
+
* - If `T` is a `boolean`, the type is `OrderByTypes`.
|
|
42
|
+
* - For array fields (e.g., `InvoiceDetail[]`), extracts the element type and applies `OrderBy<ElementType>`.
|
|
41
43
|
* - Otherwise, falls back to `OrderBy<T>`, allowing for nested ordering.
|
|
42
44
|
*
|
|
43
45
|
* @template T - The type of the field to determine the order-by type for.
|
|
44
46
|
*/
|
|
45
|
-
type OrderByField<T> = T extends string ? OrderByTypes : T extends number ? OrderByTypes : T extends Date ? OrderByTypes : T extends boolean ? OrderByTypes : OrderBy<T>;
|
|
47
|
+
type OrderByField<T> = T extends string ? OrderByTypes : T extends number ? OrderByTypes : T extends Date ? OrderByTypes : T extends boolean ? OrderByTypes : T extends (infer U)[] ? OrderBy<U> : OrderBy<T>;
|
|
46
48
|
/**
|
|
47
49
|
* Represents an object for specifying sorting order for each property of type `T`.
|
|
48
50
|
* Each key of `T` can be optionally assigned an `OrderByField` value to indicate the sort direction.
|