@solid-nestjs/common 0.2.6 → 0.2.9
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/adapters/index.d.ts +7 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +23 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/validation.adapter.d.ts +20 -0
- package/dist/adapters/validation.adapter.d.ts.map +1 -0
- package/dist/adapters/validation.adapter.js +309 -0
- package/dist/adapters/validation.adapter.js.map +1 -0
- package/dist/decorator-registry/decorator-registry.d.ts +54 -0
- package/dist/decorator-registry/decorator-registry.d.ts.map +1 -0
- package/dist/decorator-registry/decorator-registry.js +161 -0
- package/dist/decorator-registry/decorator-registry.js.map +1 -0
- package/dist/decorator-registry/index.d.ts +2 -0
- package/dist/decorator-registry/index.d.ts.map +1 -0
- package/dist/decorator-registry/index.js +18 -0
- package/dist/decorator-registry/index.js.map +1 -0
- package/dist/decorators/index.d.ts +6 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +6 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/solid-entity.decorator.d.ts +6 -0
- package/dist/decorators/solid-entity.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-entity.decorator.js +23 -0
- package/dist/decorators/solid-entity.decorator.js.map +1 -0
- package/dist/decorators/solid-field.decorator.d.ts +7 -0
- package/dist/decorators/solid-field.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-field.decorator.js +51 -0
- package/dist/decorators/solid-field.decorator.js.map +1 -0
- package/dist/decorators/solid-id.decorator.d.ts +9 -0
- package/dist/decorators/solid-id.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-id.decorator.js +27 -0
- package/dist/decorators/solid-id.decorator.js.map +1 -0
- package/dist/decorators/solid-input.decorator.d.ts +6 -0
- package/dist/decorators/solid-input.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-input.decorator.js +35 -0
- package/dist/decorators/solid-input.decorator.js.map +1 -0
- package/dist/decorators/solid-relation.decorator.d.ts +19 -0
- package/dist/decorators/solid-relation.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-relation.decorator.js +66 -0
- package/dist/decorators/solid-relation.decorator.js.map +1 -0
- package/dist/decorators/solid-timestamp.decorator.d.ts +13 -0
- package/dist/decorators/solid-timestamp.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-timestamp.decorator.js +49 -0
- package/dist/decorators/solid-timestamp.decorator.js.map +1 -0
- 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/args-helpers/class-generator.helper.d.ts +143 -0
- package/dist/helpers/args-helpers/class-generator.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/class-generator.helper.js +221 -0
- package/dist/helpers/args-helpers/class-generator.helper.js.map +1 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.d.ts +83 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.js +119 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.js.map +1 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.d.ts +160 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.js +161 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.js.map +1 -0
- package/dist/helpers/args-helpers/field-config.helper.d.ts +98 -0
- package/dist/helpers/args-helpers/field-config.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/field-config.helper.js +143 -0
- package/dist/helpers/args-helpers/field-config.helper.js.map +1 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.d.ts +87 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.js +185 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.js.map +1 -0
- package/dist/helpers/args-helpers/index.d.ts +15 -0
- package/dist/helpers/args-helpers/index.d.ts.map +1 -0
- package/dist/helpers/args-helpers/index.js +58 -0
- package/dist/helpers/args-helpers/index.js.map +1 -0
- package/dist/helpers/args-helpers/type-inference.helper.d.ts +191 -0
- package/dist/helpers/args-helpers/type-inference.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/type-inference.helper.js +330 -0
- package/dist/helpers/args-helpers/type-inference.helper.js.map +1 -0
- package/dist/helpers/class-generation/dynamic-class.helper.d.ts +101 -0
- package/dist/helpers/class-generation/dynamic-class.helper.d.ts.map +1 -0
- package/dist/helpers/class-generation/dynamic-class.helper.js +180 -0
- package/dist/helpers/class-generation/dynamic-class.helper.js.map +1 -0
- package/dist/helpers/class-generation/index.d.ts +9 -0
- package/dist/helpers/class-generation/index.d.ts.map +1 -0
- package/dist/helpers/class-generation/index.js +18 -0
- package/dist/helpers/class-generation/index.js.map +1 -0
- package/dist/helpers/decorators/decorator-utils.helper.d.ts +75 -0
- package/dist/helpers/decorators/decorator-utils.helper.d.ts.map +1 -0
- package/dist/helpers/decorators/decorator-utils.helper.js +92 -0
- package/dist/helpers/decorators/decorator-utils.helper.js.map +1 -0
- package/dist/helpers/decorators/index.d.ts +9 -0
- package/dist/helpers/decorators/index.d.ts.map +1 -0
- package/dist/helpers/decorators/index.js +16 -0
- package/dist/helpers/decorators/index.js.map +1 -0
- package/dist/helpers/dto-generator-base.helper.d.ts +19 -0
- package/dist/helpers/dto-generator-base.helper.d.ts.map +1 -0
- package/dist/helpers/dto-generator-base.helper.js +72 -0
- package/dist/helpers/dto-generator-base.helper.js.map +1 -0
- package/dist/helpers/index.d.ts +9 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +9 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/metadata-extractor.helper.d.ts +26 -0
- package/dist/helpers/metadata-extractor.helper.d.ts.map +1 -0
- package/dist/helpers/metadata-extractor.helper.js +67 -0
- package/dist/helpers/metadata-extractor.helper.js.map +1 -0
- package/dist/helpers/package-detector.helper.d.ts +33 -0
- package/dist/helpers/package-detector.helper.d.ts.map +1 -0
- package/dist/helpers/package-detector.helper.js +82 -0
- package/dist/helpers/package-detector.helper.js.map +1 -0
- package/dist/helpers/property-filter.helper.d.ts +15 -0
- package/dist/helpers/property-filter.helper.d.ts.map +1 -0
- package/dist/helpers/property-filter.helper.js +44 -0
- package/dist/helpers/property-filter.helper.js.map +1 -0
- package/dist/helpers/type-inference.helper.d.ts +76 -0
- package/dist/helpers/type-inference.helper.d.ts.map +1 -0
- package/dist/helpers/type-inference.helper.js +205 -0
- package/dist/helpers/type-inference.helper.js.map +1 -0
- package/dist/helpers/validation-inference.helper.d.ts +18 -0
- package/dist/helpers/validation-inference.helper.d.ts.map +1 -0
- package/dist/helpers/validation-inference.helper.js +100 -0
- package/dist/helpers/validation-inference.helper.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/adapters/decorator-adapter.interface.d.ts +8 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.d.ts.map +1 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.js +3 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.js.map +1 -0
- package/dist/interfaces/decorators/solid-field-options.interface.d.ts +55 -0
- package/dist/interfaces/decorators/solid-field-options.interface.d.ts.map +1 -0
- package/dist/interfaces/decorators/solid-field-options.interface.js +3 -0
- package/dist/interfaces/decorators/solid-field-options.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +5 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +5 -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/metadata/field-metadata.interface.d.ts +29 -0
- package/dist/interfaces/metadata/field-metadata.interface.d.ts.map +1 -0
- package/dist/interfaces/metadata/field-metadata.interface.js +3 -0
- package/dist/interfaces/metadata/field-metadata.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 +2 -1
- package/dist/interfaces/structures/service-plugins.interface.d.ts.map +1 -1
- package/dist/metadata/index.d.ts +2 -0
- package/dist/metadata/index.d.ts.map +1 -0
- package/dist/metadata/index.js +18 -0
- package/dist/metadata/index.js.map +1 -0
- package/dist/metadata/metadata-storage.d.ts +54 -0
- package/dist/metadata/metadata-storage.d.ts.map +1 -0
- package/dist/metadata/metadata-storage.js +106 -0
- package/dist/metadata/metadata-storage.js.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +18 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/relation-adapter-registry.d.ts +11 -0
- package/dist/registry/relation-adapter-registry.d.ts.map +1 -0
- package/dist/registry/relation-adapter-registry.js +30 -0
- package/dist/registry/relation-adapter-registry.js.map +1 -0
- package/dist/types/dto-generation.types.d.ts +46 -0
- package/dist/types/dto-generation.types.d.ts.map +1 -0
- package/dist/types/dto-generation.types.js +6 -0
- package/dist/types/dto-generation.types.js.map +1 -0
- 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 +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/utils/object.utils.d.ts +0 -8
- package/dist/utils/object.utils.d.ts.map +0 -1
- package/dist/utils/object.utils.js +0 -11
- package/dist/utils/object.utils.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-args.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/find-args.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-args.interface.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/find-args.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FindArgs } from './find-args.interface';
|
|
2
|
+
import { GroupByRequest } from './group-by-request.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Extended find arguments that include groupBy configuration.
|
|
5
|
+
* This interface extends FindArgs to add GROUP BY functionality
|
|
6
|
+
* without polluting the base FindArgs interface.
|
|
7
|
+
*
|
|
8
|
+
* @interface GroupByArgs
|
|
9
|
+
* @template T - The entity type being queried
|
|
10
|
+
* @extends {FindArgs<T>}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const args: GroupByArgs<Product> = {
|
|
15
|
+
* where: { category: 'Electronics' },
|
|
16
|
+
* groupBy: {
|
|
17
|
+
* fields: { supplier: { name: true } },
|
|
18
|
+
* aggregates: [
|
|
19
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG }
|
|
20
|
+
* ]
|
|
21
|
+
* },
|
|
22
|
+
* pagination: { page: 1, limit: 10 }
|
|
23
|
+
* };
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface GroupByArgs<T> extends FindArgs<T> {
|
|
27
|
+
/**
|
|
28
|
+
* GroupBy configuration for the query.
|
|
29
|
+
* This property is required for grouped queries.
|
|
30
|
+
*/
|
|
31
|
+
groupBy: GroupByRequest<T>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=group-by-args.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-args.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/group-by-args.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-args.interface.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/group-by-args.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AggregateFunctionTypes } from '../../enums';
|
|
2
|
+
import { GroupBy } from '../../types/group-by.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: 'type', 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
|
+
//# sourceMappingURL=group-by-request.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-request.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/group-by-request.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD;;;;;;;;;;;;;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;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-request.interface.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/group-by-request.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./filters.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./find-args.interface"), exports);
|
|
19
|
+
__exportStar(require("./group-by-args.interface"), exports);
|
|
20
|
+
__exportStar(require("./group-by-request.interface"), exports);
|
|
21
|
+
__exportStar(require("./pagination-request.interface"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,+DAA6C;AAC7C,iEAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination-request.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/pagination-request.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination-request.interface.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/pagination-request.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SolidFieldOptions } from '../decorators/solid-field-options.interface';
|
|
2
|
+
export interface FieldMetadata {
|
|
3
|
+
target: Function;
|
|
4
|
+
propertyKey: string | symbol;
|
|
5
|
+
type: any;
|
|
6
|
+
options: SolidFieldOptions;
|
|
7
|
+
isOptional: boolean;
|
|
8
|
+
adapterOptions?: any;
|
|
9
|
+
}
|
|
10
|
+
export interface EntityMetadata {
|
|
11
|
+
target: Function;
|
|
12
|
+
options: SolidEntityOptions;
|
|
13
|
+
type: 'entity' | 'input';
|
|
14
|
+
}
|
|
15
|
+
export interface SolidEntityOptions {
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
tableName?: string;
|
|
19
|
+
schema?: string;
|
|
20
|
+
skip?: string[];
|
|
21
|
+
adapters?: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
export interface SolidInputOptions {
|
|
24
|
+
name?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
skip?: string[];
|
|
27
|
+
defaultSkip?: string[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=field-metadata.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-metadata.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/metadata/field-metadata.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAEhF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-metadata.interface.js","sourceRoot":"","sources":["../../../src/interfaces/metadata/field-metadata.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FindArgs } from './find-args.interface';
|
|
2
|
+
import { GroupByRequest } from './group-by-request.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Extended find arguments that include groupBy configuration.
|
|
5
|
+
* This interface extends FindArgs to add GROUP BY functionality
|
|
6
|
+
* without polluting the base FindArgs interface.
|
|
7
|
+
*
|
|
8
|
+
* @interface GroupByArgs
|
|
9
|
+
* @template T - The entity type being queried
|
|
10
|
+
* @extends {FindArgs<T>}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const args: GroupByArgs<Product> = {
|
|
15
|
+
* where: { category: 'Electronics' },
|
|
16
|
+
* groupBy: {
|
|
17
|
+
* fields: { supplier: { name: true } },
|
|
18
|
+
* aggregates: [
|
|
19
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG }
|
|
20
|
+
* ]
|
|
21
|
+
* },
|
|
22
|
+
* pagination: { page: 1, limit: 10 }
|
|
23
|
+
* };
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface GroupByArgs<T> extends FindArgs<T> {
|
|
27
|
+
/**
|
|
28
|
+
* GroupBy configuration for the query.
|
|
29
|
+
* This property is required for grouped queries.
|
|
30
|
+
*/
|
|
31
|
+
groupBy: GroupByRequest<T>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=group-by-args.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-args.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-args.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-args.interface.js","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-args.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AggregateFunctionTypes } from '../../enums';
|
|
2
|
+
import { GroupBy } from '../../types/group-by.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: 'type', 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
|
+
//# sourceMappingURL=group-by-request.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-request.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-request.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD;;;;;;;;;;;;;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;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-by-request.interface.js","sourceRoot":"","sources":["../../../src/interfaces/misc/group-by-request.interface.ts"],"names":[],"mappings":""}
|
|
@@ -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"}
|