@ptc-org/nestjs-query-core 3.0.0-alpha.2 → 3.0.2
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/package.json +3 -3
- package/src/helpers/filter.helpers.d.ts +3 -3
- package/src/interfaces/aggregate-query.interface.js +1 -1
- package/src/interfaces/aggregate-query.interface.js.map +1 -1
- package/src/interfaces/sort-field.interface.js +2 -2
- package/src/interfaces/sort-field.interface.js.map +1 -1
- package/src/services/query.service.d.ts +2 -1
- package/src/services/query.service.js +2 -2
- package/src/services/query.service.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptc-org/nestjs-query-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Base query package",
|
|
5
5
|
"author": "doug-martin <doug@dougamartin.com>",
|
|
6
6
|
"homepage": "https://github.com/tripss/nestjs-query#readme",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"lodash.merge": "^4.6.2",
|
|
29
29
|
"reflect-metadata": "^0.1.13",
|
|
30
|
-
"tslib": "^2.
|
|
30
|
+
"tslib": "^2.5.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@nestjs/common": "^
|
|
33
|
+
"@nestjs/common": "^9.0.0 || ^10.0.0",
|
|
34
34
|
"class-transformer": "^0.2.3 || 0.3.1 || ^0.5"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -10,15 +10,15 @@ export declare const isInComparisonOperators: (op: unknown) => op is InCompariso
|
|
|
10
10
|
export declare const isBetweenComparisonOperators: (op: unknown) => op is BetweenComparisonOperators;
|
|
11
11
|
export declare const isRangeComparisonOperators: (op: unknown) => op is RangeComparisonOperators;
|
|
12
12
|
export declare const isBooleanComparisonOperators: (op: unknown) => op is BooleanComparisonOperators;
|
|
13
|
-
export declare const isComparison: <DTO, K extends keyof DTO>(maybeComparison?:
|
|
14
|
-
export declare const getFilterFieldComparison: <DTO, K extends keyof DTO>(obj: FilterComparisons<DTO>, field: K) =>
|
|
13
|
+
export declare const isComparison: <DTO, K extends keyof DTO>(maybeComparison?: FilterFieldComparison<DTO[K]> | Filter<DTO[K]>) => maybeComparison is FilterFieldComparison<DTO[K]>;
|
|
14
|
+
export declare const getFilterFieldComparison: <DTO, K extends keyof DTO>(obj: FilterComparisons<DTO>, field: K) => FilterFieldComparison<DTO[K]> & {
|
|
15
15
|
and?: Filter<DTO[K]>[];
|
|
16
16
|
or?: Filter<DTO[K]>[];
|
|
17
17
|
} & FilterComparisons<DTO[K]>;
|
|
18
18
|
export declare const transformFilter: <From, To>(filter: Filter<From>, fieldMap: QueryFieldMap<From, To, keyof To>) => Filter<To>;
|
|
19
19
|
export declare const mergeFilter: <T>(base: Filter<T>, source: Filter<T>) => Filter<T>;
|
|
20
20
|
export declare const getFilterFields: <DTO>(filter: Filter<DTO>) => string[];
|
|
21
|
-
export declare const getFilterComparisons: <DTO, K extends keyof DTO>(filter: Filter<DTO>, key: K) =>
|
|
21
|
+
export declare const getFilterComparisons: <DTO, K extends keyof DTO>(filter: Filter<DTO>, key: K) => FilterFieldComparison<DTO[K]>[];
|
|
22
22
|
export declare const getFilterOmitting: <DTO>(filter: Filter<DTO>, ...keys: (keyof DTO | keyof {
|
|
23
23
|
and?: Filter<DTO>[];
|
|
24
24
|
or?: Filter<DTO>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-query.interface.js","sourceRoot":"","sources":["../../../../../packages/core/src/interfaces/aggregate-query.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,wBAAa,CAAA;AACf,CAAC,EALW,OAAO,
|
|
1
|
+
{"version":3,"file":"aggregate-query.interface.js","sourceRoot":"","sources":["../../../../../packages/core/src/interfaces/aggregate-query.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,wBAAa,CAAA;AACf,CAAC,EALW,OAAO,uBAAP,OAAO,QAKlB"}
|
|
@@ -8,7 +8,7 @@ var SortDirection;
|
|
|
8
8
|
(function (SortDirection) {
|
|
9
9
|
SortDirection["ASC"] = "ASC";
|
|
10
10
|
SortDirection["DESC"] = "DESC";
|
|
11
|
-
})(SortDirection
|
|
11
|
+
})(SortDirection || (exports.SortDirection = SortDirection = {}));
|
|
12
12
|
/**
|
|
13
13
|
* Null sort option.
|
|
14
14
|
*/
|
|
@@ -22,5 +22,5 @@ var SortNulls;
|
|
|
22
22
|
* All nulls will be last.
|
|
23
23
|
*/
|
|
24
24
|
SortNulls["NULLS_LAST"] = "NULLS LAST";
|
|
25
|
-
})(SortNulls
|
|
25
|
+
})(SortNulls || (exports.SortNulls = SortNulls = {}));
|
|
26
26
|
//# sourceMappingURL=sort-field.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-field.interface.js","sourceRoot":"","sources":["../../../../../packages/core/src/interfaces/sort-field.interface.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAHW,aAAa,
|
|
1
|
+
{"version":3,"file":"sort-field.interface.js","sourceRoot":"","sources":["../../../../../packages/core/src/interfaces/sort-field.interface.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB;;OAEG;IACH,wCAA2B,CAAA;IAC3B;;OAEG;IACH,sCAAyB,CAAA;AAC3B,CAAC,EATW,SAAS,yBAAT,SAAS,QASpB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InjectableOptions } from '@nestjs/common/decorators/core/injectable.decorator';
|
|
1
2
|
import { Class, DeepPartial } from '../common';
|
|
2
3
|
import { AggregateOptions, AggregateQuery, AggregateResponse, CountOptions, DeleteManyOptions, DeleteManyResponse, DeleteOneOptions, Filter, FindByIdOptions, FindRelationOptions, GetByIdOptions, ModifyRelationOptions, Query, QueryOptions, UpdateManyResponse, UpdateOneOptions } from '../interfaces';
|
|
3
4
|
/**
|
|
@@ -174,4 +175,4 @@ export interface QueryService<DTO, C = DeepPartial<DTO>, U = DeepPartial<DTO>> {
|
|
|
174
175
|
* QueryService decorator to register with nestjs-query
|
|
175
176
|
* @param DTOClass - the DTO class that the QueryService is used for.
|
|
176
177
|
*/
|
|
177
|
-
export declare function QueryService<DTO, C = DeepPartial<DTO>, U = DeepPartial<DTO>>(DTOClass: Class<DTO
|
|
178
|
+
export declare function QueryService<DTO, C = DeepPartial<DTO>, U = DeepPartial<DTO>>(DTOClass: Class<DTO>, options?: InjectableOptions): <Cls extends Class<QueryService<DTO, C, U>>>(cls: Cls) => void | Cls;
|
|
@@ -7,9 +7,9 @@ const common_1 = require("@nestjs/common");
|
|
|
7
7
|
* @param DTOClass - the DTO class that the QueryService is used for.
|
|
8
8
|
*/
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-redeclare,@typescript-eslint/no-unused-vars -- intentional
|
|
10
|
-
function QueryService(DTOClass) {
|
|
10
|
+
function QueryService(DTOClass, options) {
|
|
11
11
|
return (cls) => {
|
|
12
|
-
return (0, common_1.Injectable)()(cls);
|
|
12
|
+
return (0, common_1.Injectable)(options)(cls);
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
exports.QueryService = QueryService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.service.js","sourceRoot":"","sources":["../../../../../packages/core/src/services/query.service.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;
|
|
1
|
+
{"version":3,"file":"query.service.js","sourceRoot":"","sources":["../../../../../packages/core/src/services/query.service.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AA4R3C;;;GAGG;AACH,4GAA4G;AAC5G,SAAgB,YAAY,CAAkD,QAAoB,EAAE,OAA2B;IAC7H,OAAO,CAA6C,GAAQ,EAAc,EAAE;QAC1E,OAAO,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC,CAAA;AACH,CAAC;AAJD,oCAIC"}
|