@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptc-org/nestjs-query-core",
3
- "version": "3.0.0-alpha.2",
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.4.0"
30
+ "tslib": "^2.5.3"
31
31
  },
32
32
  "peerDependencies": {
33
- "@nestjs/common": "^8.0.0 || ^9.0.0",
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?: (DTO[K] extends infer T ? T extends DTO[K] ? T extends string | String ? import("../interfaces").StringFieldComparisons : T extends boolean | Boolean ? import("../interfaces").BooleanFieldComparisons : T extends number | bigint | symbol | RegExp | Date | (string | number | bigint | boolean | symbol | RegExp | Date)[] ? import("../interfaces").CommonFieldComparisonType<T> : T extends (infer U)[] ? import("../interfaces").CommonFieldComparisonType<U> | Filter<U> : import("../interfaces").CommonFieldComparisonType<T> | Filter<T> : never : never) | Filter<DTO[K]>) => maybeComparison is DTO[K] extends infer T ? T extends DTO[K] ? T extends string | String ? import("../interfaces").StringFieldComparisons : T extends boolean | Boolean ? import("../interfaces").BooleanFieldComparisons : T extends number | bigint | symbol | RegExp | Date | (string | number | bigint | boolean | symbol | RegExp | Date)[] ? import("../interfaces").CommonFieldComparisonType<T> : T extends (infer U)[] ? import("../interfaces").CommonFieldComparisonType<U> | Filter<U> : import("../interfaces").CommonFieldComparisonType<T> | Filter<T> : never : never;
14
- export declare const getFilterFieldComparison: <DTO, K extends keyof DTO>(obj: FilterComparisons<DTO>, field: K) => (DTO[K] extends infer T ? T extends DTO[K] ? T extends string | String ? import("../interfaces").StringFieldComparisons : T extends boolean | Boolean ? import("../interfaces").BooleanFieldComparisons : T extends number | bigint | symbol | RegExp | Date | (string | number | bigint | boolean | symbol | RegExp | Date)[] ? import("../interfaces").CommonFieldComparisonType<T> : T extends (infer U)[] ? import("../interfaces").CommonFieldComparisonType<U> | Filter<U> : import("../interfaces").CommonFieldComparisonType<T> | Filter<T> : never : never) & {
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) => (DTO[K] extends infer T ? T extends DTO[K] ? T extends string | String ? import("../interfaces").StringFieldComparisons : T extends boolean | Boolean ? import("../interfaces").BooleanFieldComparisons : T extends number | bigint | symbol | RegExp | Date | (string | number | bigint | boolean | symbol | RegExp | Date)[] ? import("../interfaces").CommonFieldComparisonType<T> : T extends (infer U)[] ? import("../interfaces").CommonFieldComparisonType<U> | Filter<U> : import("../interfaces").CommonFieldComparisonType<T> | Filter<T> : never : never)[];
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>[];
@@ -7,5 +7,5 @@ var GroupBy;
7
7
  GroupBy["WEEK"] = "WEEK";
8
8
  GroupBy["MONTH"] = "MONTH";
9
9
  GroupBy["YEAR"] = "YEAR";
10
- })(GroupBy = exports.GroupBy || (exports.GroupBy = {}));
10
+ })(GroupBy || (exports.GroupBy = GroupBy = {}));
11
11
  //# sourceMappingURL=aggregate-query.interface.js.map
@@ -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,GAAP,eAAO,KAAP,eAAO,QAKlB"}
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 = exports.SortDirection || (exports.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 = exports.SortNulls || (exports.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,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB;;OAEG;IACH,wCAA2B,CAAA;IAC3B;;OAEG;IACH,sCAAyB,CAAA;AAC3B,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB"}
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>): <Cls extends Class<QueryService<DTO, C, U>>>(cls: Cls) => void | Cls;
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;AA2R3C;;;GAGG;AACH,4GAA4G;AAC5G,SAAgB,YAAY,CAAkD,QAAoB;IAChG,OAAO,CAA6C,GAAQ,EAAc,EAAE;QAC1E,OAAO,IAAA,mBAAU,GAAE,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC,CAAA;AACH,CAAC;AAJD,oCAIC"}
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"}