@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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of supported aggregate functions for database queries.
|
|
3
|
+
*
|
|
4
|
+
* @enum {string}
|
|
5
|
+
* @readonly
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Using aggregate functions in groupBy operations
|
|
10
|
+
* const aggregates = [
|
|
11
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG },
|
|
12
|
+
* { field: 'id', function: AggregateFunctionTypes.COUNT }
|
|
13
|
+
* ];
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare enum AggregateFunctionTypes {
|
|
17
|
+
/**
|
|
18
|
+
* Count of non-null values
|
|
19
|
+
*/
|
|
20
|
+
COUNT = "COUNT",
|
|
21
|
+
/**
|
|
22
|
+
* Sum of numeric values
|
|
23
|
+
*/
|
|
24
|
+
SUM = "SUM",
|
|
25
|
+
/**
|
|
26
|
+
* Average of numeric values
|
|
27
|
+
*/
|
|
28
|
+
AVG = "AVG",
|
|
29
|
+
/**
|
|
30
|
+
* Minimum value
|
|
31
|
+
*/
|
|
32
|
+
MIN = "MIN",
|
|
33
|
+
/**
|
|
34
|
+
* Maximum value
|
|
35
|
+
*/
|
|
36
|
+
MAX = "MAX",
|
|
37
|
+
/**
|
|
38
|
+
* Count of distinct values
|
|
39
|
+
*/
|
|
40
|
+
COUNT_DISTINCT = "COUNT_DISTINCT"
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=aggregate-function.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-function.enum.d.ts","sourceRoot":"","sources":["../../src/enums/aggregate-function.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,cAAc,mBAAmB;CAClC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateFunctionTypes = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enumeration of supported aggregate functions for database queries.
|
|
6
|
+
*
|
|
7
|
+
* @enum {string}
|
|
8
|
+
* @readonly
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Using aggregate functions in groupBy operations
|
|
13
|
+
* const aggregates = [
|
|
14
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG },
|
|
15
|
+
* { field: 'id', function: AggregateFunctionTypes.COUNT }
|
|
16
|
+
* ];
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
var AggregateFunctionTypes;
|
|
20
|
+
(function (AggregateFunctionTypes) {
|
|
21
|
+
/**
|
|
22
|
+
* Count of non-null values
|
|
23
|
+
*/
|
|
24
|
+
AggregateFunctionTypes["COUNT"] = "COUNT";
|
|
25
|
+
/**
|
|
26
|
+
* Sum of numeric values
|
|
27
|
+
*/
|
|
28
|
+
AggregateFunctionTypes["SUM"] = "SUM";
|
|
29
|
+
/**
|
|
30
|
+
* Average of numeric values
|
|
31
|
+
*/
|
|
32
|
+
AggregateFunctionTypes["AVG"] = "AVG";
|
|
33
|
+
/**
|
|
34
|
+
* Minimum value
|
|
35
|
+
*/
|
|
36
|
+
AggregateFunctionTypes["MIN"] = "MIN";
|
|
37
|
+
/**
|
|
38
|
+
* Maximum value
|
|
39
|
+
*/
|
|
40
|
+
AggregateFunctionTypes["MAX"] = "MAX";
|
|
41
|
+
/**
|
|
42
|
+
* Count of distinct values
|
|
43
|
+
*/
|
|
44
|
+
AggregateFunctionTypes["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
45
|
+
})(AggregateFunctionTypes || (exports.AggregateFunctionTypes = AggregateFunctionTypes = {}));
|
|
46
|
+
//# sourceMappingURL=aggregate-function.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-function.enum.js","sourceRoot":"","sources":["../../src/enums/aggregate-function.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,IAAY,sBA8BX;AA9BD,WAAY,sBAAsB;IAChC;;OAEG;IACH,yCAAe,CAAA;IAEf;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,2DAAiC,CAAA;AACnC,CAAC,EA9BW,sBAAsB,sCAAtB,sBAAsB,QA8BjC"}
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
package/dist/enums/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./standard-actions.enum"), exports);
|
|
18
18
|
__exportStar(require("./order-by-type.enum"), exports);
|
|
19
|
+
__exportStar(require("./aggregate-function.enum"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/enums/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,uDAAqC;AACrC,4DAA0C"}
|
|
@@ -7,6 +7,15 @@ import { Constructor } from '../types';
|
|
|
7
7
|
* @throws {Error} If the provided type is neither a string nor a constructor function.
|
|
8
8
|
*/
|
|
9
9
|
export declare function getTypeName(type: string | Function): string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the constructor function if the provided type is a function (class or constructor),
|
|
12
|
+
* or `undefined` if the type is a string. Throws an error if the input is neither a string nor a function.
|
|
13
|
+
*
|
|
14
|
+
* @param type - The type to evaluate, which can be a string or a constructor function.
|
|
15
|
+
* @returns The constructor function if `type` is a function, otherwise `undefined`.
|
|
16
|
+
* @throws {Error} If `type` is neither a string nor a constructor function.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getTypeClass(type: string | Function): Constructor | undefined;
|
|
10
19
|
/**
|
|
11
20
|
* Retrieves the design type metadata of a specified property from a class constructor.
|
|
12
21
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/types.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAW3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAEtE"}
|
|
1
|
+
{"version":3,"file":"types.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/types.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAW3D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAW7E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAEtE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTypeName = getTypeName;
|
|
4
|
+
exports.getTypeClass = getTypeClass;
|
|
4
5
|
exports.getPropertyType = getPropertyType;
|
|
5
6
|
/**
|
|
6
7
|
* Returns the name of a type, given either a string or a constructor function.
|
|
@@ -19,6 +20,24 @@ function getTypeName(type) {
|
|
|
19
20
|
}
|
|
20
21
|
throw new Error('Type must be a string or a constructor function');
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the constructor function if the provided type is a function (class or constructor),
|
|
25
|
+
* or `undefined` if the type is a string. Throws an error if the input is neither a string nor a function.
|
|
26
|
+
*
|
|
27
|
+
* @param type - The type to evaluate, which can be a string or a constructor function.
|
|
28
|
+
* @returns The constructor function if `type` is a function, otherwise `undefined`.
|
|
29
|
+
* @throws {Error} If `type` is neither a string nor a constructor function.
|
|
30
|
+
*/
|
|
31
|
+
function getTypeClass(type) {
|
|
32
|
+
if (typeof type === 'string') {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
// Handle constructor functions/classes
|
|
36
|
+
if (typeof type === 'function') {
|
|
37
|
+
return type;
|
|
38
|
+
}
|
|
39
|
+
throw new Error('Type must be a string or a constructor function');
|
|
40
|
+
}
|
|
22
41
|
/**
|
|
23
42
|
* Retrieves the design type metadata of a specified property from a class constructor.
|
|
24
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.helper.js","sourceRoot":"","sources":["../../src/helpers/types.helper.ts"],"names":[],"mappings":";;AASA,kCAWC;AAaD,0CAEC;
|
|
1
|
+
{"version":3,"file":"types.helper.js","sourceRoot":"","sources":["../../src/helpers/types.helper.ts"],"names":[],"mappings":";;AASA,kCAWC;AAUD,oCAWC;AAaD,0CAEC;AAtDD;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,IAAuB;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uCAAuC;IACvC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,IAAuB;IAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,uCAAuC;IACvC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,IAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,WAAwB,EAAE,KAAa;IACrE,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./services"), exports);
|
|
18
18
|
__exportStar(require("./structures"), exports);
|
|
19
19
|
__exportStar(require("./misc"), exports);
|
|
20
|
+
__exportStar(require("./inputs"), exports);
|
|
21
|
+
__exportStar(require("./outputs"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,4CAA0B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface StringFilter {
|
|
2
|
+
_eq?: string;
|
|
3
|
+
_neq?: string;
|
|
4
|
+
_in?: string[];
|
|
5
|
+
_startswith?: string;
|
|
6
|
+
_notstartswith?: string;
|
|
7
|
+
_endswith?: string;
|
|
8
|
+
_notendswith?: string;
|
|
9
|
+
_contains?: string;
|
|
10
|
+
_notcontains?: string;
|
|
11
|
+
_like?: string;
|
|
12
|
+
_notlike?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NumberFilter {
|
|
15
|
+
_eq?: number;
|
|
16
|
+
_neq?: number;
|
|
17
|
+
_gt?: number;
|
|
18
|
+
_gte?: number;
|
|
19
|
+
_lt?: number;
|
|
20
|
+
_lte?: number;
|
|
21
|
+
_in?: number[];
|
|
22
|
+
_between?: number[];
|
|
23
|
+
_notbetween?: number[];
|
|
24
|
+
}
|
|
25
|
+
export interface DateFilter {
|
|
26
|
+
_eq?: Date;
|
|
27
|
+
_neq?: Date;
|
|
28
|
+
_gt?: Date;
|
|
29
|
+
_gte?: Date;
|
|
30
|
+
_lt?: Date;
|
|
31
|
+
_lte?: Date;
|
|
32
|
+
_in?: Date[];
|
|
33
|
+
_between?: Date[];
|
|
34
|
+
_notbetween?: Date[];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=filters.interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.interfaces.d.ts","sourceRoot":"","sources":["../../../src/interfaces/inputs/filters.interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IACb,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/inputs/filters.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Where, OrderBy } from '../../types/find-args.type';
|
|
2
|
+
import { PaginationRequest } from './pagination-request.interface';
|
|
3
|
+
export interface FindArgs<T> {
|
|
4
|
+
pagination?: PaginationRequest;
|
|
5
|
+
where?: Where<T>;
|
|
6
|
+
orderBy?: OrderBy<T> | OrderBy<T>[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=find-args.interface.d.ts.map
|
|
@@ -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,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":""}
|