@ptc-org/nestjs-query-core 0.30.1 → 0.30.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.
Files changed (166) hide show
  1. package/package.json +2 -2
  2. package/src/assemblers/abstract.assembler.d.ts +33 -0
  3. package/src/assemblers/abstract.assembler.js +55 -0
  4. package/src/assemblers/abstract.assembler.js.map +1 -0
  5. package/src/assemblers/assembler.d.ts +86 -0
  6. package/src/assemblers/assembler.deserializer.d.ts +4 -0
  7. package/src/assemblers/assembler.deserializer.js +22 -0
  8. package/src/assemblers/assembler.deserializer.js.map +1 -0
  9. package/src/assemblers/assembler.factory.d.ts +8 -0
  10. package/src/assemblers/assembler.factory.js +29 -0
  11. package/src/assemblers/assembler.factory.js.map +1 -0
  12. package/src/assemblers/assembler.js +33 -0
  13. package/src/assemblers/assembler.js.map +1 -0
  14. package/src/assemblers/assembler.serializer.d.ts +4 -0
  15. package/src/assemblers/assembler.serializer.js +22 -0
  16. package/src/assemblers/assembler.serializer.js.map +1 -0
  17. package/src/assemblers/class-transformer.assembler.d.ts +17 -0
  18. package/src/assemblers/class-transformer.assembler.js +67 -0
  19. package/src/assemblers/class-transformer.assembler.js.map +1 -0
  20. package/src/assemblers/constants.d.ts +4 -0
  21. package/src/assemblers/constants.js +8 -0
  22. package/src/assemblers/constants.js.map +1 -0
  23. package/src/assemblers/default.assembler.d.ts +8 -0
  24. package/src/assemblers/default.assembler.js +14 -0
  25. package/src/assemblers/default.assembler.js.map +1 -0
  26. package/src/assemblers/index.d.ts +7 -0
  27. package/src/assemblers/index.js +19 -0
  28. package/src/assemblers/index.js.map +1 -0
  29. package/src/common/class.type.d.ts +8 -0
  30. package/src/common/class.type.js +3 -0
  31. package/src/common/class.type.js.map +1 -0
  32. package/src/common/class.utils.d.ts +2 -0
  33. package/src/common/class.utils.js +12 -0
  34. package/src/common/class.utils.js.map +1 -0
  35. package/src/common/deep-partial.type.d.ts +6 -0
  36. package/src/common/deep-partial.type.js +3 -0
  37. package/src/common/deep-partial.type.js.map +1 -0
  38. package/src/common/index.d.ts +5 -0
  39. package/src/common/index.js +9 -0
  40. package/src/common/index.js.map +1 -0
  41. package/src/common/misc.utils.d.ts +4 -0
  42. package/src/common/misc.utils.js +9 -0
  43. package/src/common/misc.utils.js.map +1 -0
  44. package/src/common/reflect.utils.d.ts +31 -0
  45. package/src/common/reflect.utils.js +98 -0
  46. package/src/common/reflect.utils.js.map +1 -0
  47. package/src/decorators/helpers.d.ts +6 -0
  48. package/src/decorators/helpers.js +12 -0
  49. package/src/decorators/helpers.js.map +1 -0
  50. package/src/decorators/index.d.ts +3 -0
  51. package/src/decorators/index.js +10 -0
  52. package/src/decorators/index.js.map +1 -0
  53. package/src/decorators/inject-assembler-query-service.decorator.d.ts +4 -0
  54. package/src/decorators/inject-assembler-query-service.decorator.js +8 -0
  55. package/src/decorators/inject-assembler-query-service.decorator.js.map +1 -0
  56. package/src/decorators/inject-query-service.decorator.d.ts +3 -0
  57. package/src/decorators/inject-query-service.decorator.js +8 -0
  58. package/src/decorators/inject-query-service.decorator.js.map +1 -0
  59. package/src/helpers/aggregate.helpers.d.ts +4 -0
  60. package/src/helpers/aggregate.helpers.js +56 -0
  61. package/src/helpers/aggregate.helpers.js.map +1 -0
  62. package/src/helpers/comparison.builder.d.ts +11 -0
  63. package/src/helpers/comparison.builder.js +92 -0
  64. package/src/helpers/comparison.builder.js.map +1 -0
  65. package/src/helpers/filter.builder.d.ts +10 -0
  66. package/src/helpers/filter.builder.js +49 -0
  67. package/src/helpers/filter.builder.js.map +1 -0
  68. package/src/helpers/filter.helpers.d.ts +24 -0
  69. package/src/helpers/filter.helpers.js +115 -0
  70. package/src/helpers/filter.helpers.js.map +1 -0
  71. package/src/helpers/index.d.ts +3 -0
  72. package/src/helpers/index.js +17 -0
  73. package/src/helpers/index.js.map +1 -0
  74. package/src/helpers/page.builder.d.ts +6 -0
  75. package/src/helpers/page.builder.js +13 -0
  76. package/src/helpers/page.builder.js.map +1 -0
  77. package/src/helpers/query.helpers.d.ts +11 -0
  78. package/src/helpers/query.helpers.js +60 -0
  79. package/src/helpers/query.helpers.js.map +1 -0
  80. package/src/helpers/sort.builder.d.ts +11 -0
  81. package/src/helpers/sort.builder.js +82 -0
  82. package/src/helpers/sort.builder.js.map +1 -0
  83. package/src/helpers/types.d.ts +3 -0
  84. package/src/helpers/types.js +3 -0
  85. package/src/helpers/types.js.map +1 -0
  86. package/src/index.d.ts +7 -0
  87. package/src/index.js.map +1 -0
  88. package/src/interfaces/aggregate-query.interface.d.ts +8 -0
  89. package/src/interfaces/aggregate-query.interface.js +3 -0
  90. package/src/interfaces/aggregate-query.interface.js.map +1 -0
  91. package/src/interfaces/aggregate-response.interface.d.ts +14 -0
  92. package/src/interfaces/aggregate-response.interface.js +3 -0
  93. package/src/interfaces/aggregate-response.interface.js.map +1 -0
  94. package/src/interfaces/delete-many-options.interface.d.ts +2 -0
  95. package/src/interfaces/delete-many-options.interface.js +3 -0
  96. package/src/interfaces/delete-many-options.interface.js.map +1 -0
  97. package/src/interfaces/delete-many-response.interface.d.ts +9 -0
  98. package/src/interfaces/delete-many-response.interface.js +3 -0
  99. package/src/interfaces/delete-many-response.interface.js.map +1 -0
  100. package/src/interfaces/delete-one-options.interface.d.ts +7 -0
  101. package/src/interfaces/delete-one-options.interface.js +3 -0
  102. package/src/interfaces/delete-one-options.interface.js.map +1 -0
  103. package/src/interfaces/filter-field-comparison.interface.d.ts +202 -0
  104. package/src/interfaces/filter-field-comparison.interface.js +3 -0
  105. package/src/interfaces/filter-field-comparison.interface.js.map +1 -0
  106. package/src/interfaces/filter.interface.d.ts +113 -0
  107. package/src/interfaces/filter.interface.js +3 -0
  108. package/src/interfaces/filter.interface.js.map +1 -0
  109. package/src/interfaces/filterable.interface.d.ts +13 -0
  110. package/src/interfaces/filterable.interface.js +3 -0
  111. package/src/interfaces/filterable.interface.js.map +1 -0
  112. package/src/interfaces/find-by-id-options.interface.d.ts +7 -0
  113. package/src/interfaces/find-by-id-options.interface.js +3 -0
  114. package/src/interfaces/find-by-id-options.interface.js.map +1 -0
  115. package/src/interfaces/find-relation-options.interface.d.ts +2 -0
  116. package/src/interfaces/find-relation-options.interface.js +3 -0
  117. package/src/interfaces/find-relation-options.interface.js.map +1 -0
  118. package/src/interfaces/get-by-id-options.interface.d.ts +2 -0
  119. package/src/interfaces/get-by-id-options.interface.js +3 -0
  120. package/src/interfaces/get-by-id-options.interface.js.map +1 -0
  121. package/src/interfaces/index.d.ts +17 -0
  122. package/src/interfaces/index.js +21 -0
  123. package/src/interfaces/index.js.map +1 -0
  124. package/src/interfaces/modify-relation-options.interface.d.ts +9 -0
  125. package/src/interfaces/modify-relation-options.interface.js +3 -0
  126. package/src/interfaces/modify-relation-options.interface.js.map +1 -0
  127. package/src/interfaces/paging.interface.d.ts +13 -0
  128. package/src/interfaces/paging.interface.js +3 -0
  129. package/src/interfaces/paging.interface.js.map +1 -0
  130. package/src/interfaces/query.inteface.d.ts +37 -0
  131. package/src/interfaces/query.inteface.js +3 -0
  132. package/src/interfaces/query.inteface.js.map +1 -0
  133. package/src/interfaces/sort-field.interface.d.ts +60 -0
  134. package/src/interfaces/sort-field.interface.js +26 -0
  135. package/src/interfaces/sort-field.interface.js.map +1 -0
  136. package/src/interfaces/update-many-response.interface.d.ts +9 -0
  137. package/src/interfaces/update-many-response.interface.js +3 -0
  138. package/src/interfaces/update-many-response.interface.js.map +1 -0
  139. package/src/interfaces/update-one-options.interface.d.ts +8 -0
  140. package/src/interfaces/update-one-options.interface.js +3 -0
  141. package/src/interfaces/update-one-options.interface.js.map +1 -0
  142. package/src/module.d.ts +10 -0
  143. package/src/module.js +18 -0
  144. package/src/module.js.map +1 -0
  145. package/src/providers.d.ts +4 -0
  146. package/src/providers.js +24 -0
  147. package/src/providers.js.map +1 -0
  148. package/src/services/assembler-query.service.d.ts +63 -0
  149. package/src/services/assembler-query.service.js +132 -0
  150. package/src/services/assembler-query.service.js.map +1 -0
  151. package/src/services/index.d.ts +5 -0
  152. package/src/services/index.js +14 -0
  153. package/src/services/index.js.map +1 -0
  154. package/src/services/noop-query.service.d.ts +32 -0
  155. package/src/services/noop-query.service.js +76 -0
  156. package/src/services/noop-query.service.js.map +1 -0
  157. package/src/services/proxy-query.service.d.ts +59 -0
  158. package/src/services/proxy-query.service.js +82 -0
  159. package/src/services/proxy-query.service.js.map +1 -0
  160. package/src/services/query.service.d.ts +175 -0
  161. package/src/services/query.service.js +14 -0
  162. package/src/services/query.service.js.map +1 -0
  163. package/src/services/relation-query.service.d.ts +50 -0
  164. package/src/services/relation-query.service.js +103 -0
  165. package/src/services/relation-query.service.js.map +1 -0
  166. package/CHANGELOG.md +0 -471
@@ -0,0 +1,50 @@
1
+ import { Class, DeepPartial } from '../common';
2
+ import { Filter, Query, AggregateQuery, AggregateResponse, FindRelationOptions } from '../interfaces';
3
+ import { ProxyQueryService } from './proxy-query.service';
4
+ import { QueryService } from './query.service';
5
+ export declare type QueryServiceRelation<DTO, Relation> = {
6
+ service: QueryService<Relation, unknown, unknown>;
7
+ query: (dto: DTO) => Query<Relation>;
8
+ };
9
+ export declare class RelationQueryService<DTO, C = DeepPartial<DTO>, U = DeepPartial<DTO>> extends ProxyQueryService<DTO, C, U> {
10
+ readonly relations: Record<string, QueryServiceRelation<DTO, unknown>>;
11
+ constructor(queryService: QueryService<DTO, C, U>, relations: Record<string, QueryServiceRelation<DTO, unknown>>);
12
+ constructor(relations: Record<string, QueryServiceRelation<DTO, unknown>>);
13
+ /**
14
+ * Query for relations for an array of DTOs. This method will return a map with the DTO as the key and the relations as the value.
15
+ * @param RelationClass - The class of the relation.
16
+ * @param relationName - The name of the relation to load.
17
+ * @param dtos - the dtos to find relations for.
18
+ * @param query - A query to use to filter, page, and sort relations.
19
+ */
20
+ queryRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dtos: DTO[], query: Query<Relation>): Promise<Map<DTO, Relation[]>>;
21
+ /**
22
+ * Query for an array of relations.
23
+ * @param RelationClass - The class to serialize the relations into.
24
+ * @param dto - The dto to query relations for.
25
+ * @param relationName - The name of relation to query for.
26
+ * @param query - A query to filter, page and sort relations.
27
+ */
28
+ queryRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dto: DTO, query: Query<Relation>): Promise<Relation[]>;
29
+ aggregateRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dto: DTO, filter: Filter<Relation>, aggregate: AggregateQuery<Relation>): Promise<AggregateResponse<Relation>[]>;
30
+ aggregateRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dtos: DTO[], filter: Filter<Relation>, aggregate: AggregateQuery<Relation>): Promise<Map<DTO, AggregateResponse<Relation>[]>>;
31
+ countRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dtos: DTO[], filter: Filter<Relation>): Promise<Map<DTO, number>>;
32
+ countRelations<Relation>(RelationClass: Class<Relation>, relationName: string, dto: DTO, filter: Filter<Relation>): Promise<number>;
33
+ /**
34
+ * Find a relation for an array of DTOs. This will return a Map where the key is the DTO and the value is to relation or undefined if not found.
35
+ * @param RelationClass - the class of the relation
36
+ * @param relationName - the name of the relation to load.
37
+ * @param dtos - the dtos to find the relation for.
38
+ * @param filter - Additional filter to apply when finding relations
39
+ */
40
+ findRelation<Relation>(RelationClass: Class<Relation>, relationName: string, dtos: DTO[], opts?: FindRelationOptions<Relation>): Promise<Map<DTO, Relation | undefined>>;
41
+ /**
42
+ * Finds a single relation.
43
+ * @param RelationClass - The class to serialize the relation into.
44
+ * @param dto - The dto to find the relation for.
45
+ * @param relationName - The name of the relation to query for.
46
+ * @param filter - Additional filter to apply when finding relations
47
+ */
48
+ findRelation<Relation>(RelationClass: Class<Relation>, relationName: string, dto: DTO, opts?: FindRelationOptions<Relation>): Promise<Relation | undefined>;
49
+ getRelation<Relation>(name: string): QueryServiceRelation<DTO, Relation> | undefined;
50
+ }
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationQueryService = void 0;
4
+ const helpers_1 = require("../helpers");
5
+ const noop_query_service_1 = require("./noop-query.service");
6
+ const proxy_query_service_1 = require("./proxy-query.service");
7
+ class RelationQueryService extends proxy_query_service_1.ProxyQueryService {
8
+ constructor(queryService, relations) {
9
+ if (typeof queryService.query === 'function') {
10
+ super(queryService);
11
+ this.relations = relations;
12
+ }
13
+ else {
14
+ super(noop_query_service_1.NoOpQueryService.getInstance());
15
+ this.relations = queryService;
16
+ }
17
+ }
18
+ async queryRelations(RelationClass, relationName, dto, query) {
19
+ const serviceRelation = this.getRelation(relationName);
20
+ if (!serviceRelation) {
21
+ if (Array.isArray(dto)) {
22
+ return super.queryRelations(RelationClass, relationName, dto, query);
23
+ }
24
+ return super.queryRelations(RelationClass, relationName, dto, query);
25
+ }
26
+ const { query: qf, service } = serviceRelation;
27
+ if (Array.isArray(dto)) {
28
+ const map = new Map();
29
+ await Promise.all(dto.map(async (d) => {
30
+ const relations = await service.query((0, helpers_1.mergeQuery)(query, qf(d)));
31
+ map.set(d, relations);
32
+ }));
33
+ return map;
34
+ }
35
+ return service.query((0, helpers_1.mergeQuery)(query, qf(dto)));
36
+ }
37
+ async aggregateRelations(RelationClass, relationName, dto, filter, aggregate) {
38
+ const serviceRelation = this.getRelation(relationName);
39
+ if (!serviceRelation) {
40
+ if (Array.isArray(dto)) {
41
+ return super.aggregateRelations(RelationClass, relationName, dto, filter, aggregate);
42
+ }
43
+ return super.aggregateRelations(RelationClass, relationName, dto, filter, aggregate);
44
+ }
45
+ const { query: qf, service } = serviceRelation;
46
+ if (Array.isArray(dto)) {
47
+ const map = new Map();
48
+ await Promise.all(dto.map(async (d) => {
49
+ const relations = await service.aggregate((0, helpers_1.mergeQuery)({ filter }, qf(d)).filter ?? {}, aggregate);
50
+ map.set(d, relations);
51
+ }));
52
+ return map;
53
+ }
54
+ return service.aggregate((0, helpers_1.mergeQuery)({ filter }, qf(dto)).filter ?? {}, aggregate);
55
+ }
56
+ async countRelations(RelationClass, relationName, dto, filter) {
57
+ const serviceRelation = this.getRelation(relationName);
58
+ if (!serviceRelation) {
59
+ if (Array.isArray(dto)) {
60
+ return super.countRelations(RelationClass, relationName, dto, filter);
61
+ }
62
+ return super.countRelations(RelationClass, relationName, dto, filter);
63
+ }
64
+ const { query: qf, service } = serviceRelation;
65
+ if (Array.isArray(dto)) {
66
+ const map = new Map();
67
+ await Promise.all(dto.map(async (d) => {
68
+ const count = await service.count((0, helpers_1.mergeQuery)({ filter }, qf(d)).filter || {});
69
+ map.set(d, count);
70
+ }));
71
+ return map;
72
+ }
73
+ return service.count((0, helpers_1.mergeQuery)({ filter }, qf(dto)).filter || {});
74
+ }
75
+ async findRelation(RelationClass, relationName, dto, opts) {
76
+ const serviceRelation = this.getRelation(relationName);
77
+ if (!serviceRelation) {
78
+ if (Array.isArray(dto)) {
79
+ return super.findRelation(RelationClass, relationName, dto, opts);
80
+ }
81
+ return super.findRelation(RelationClass, relationName, dto, opts);
82
+ }
83
+ const { query: qf, service } = serviceRelation;
84
+ if (Array.isArray(dto)) {
85
+ const map = new Map();
86
+ await Promise.all(dto.map(async (d) => {
87
+ const relation = await service.query((0, helpers_1.mergeQuery)(qf(d), { paging: { limit: 1 }, filter: opts?.filter }));
88
+ map.set(d, relation[0]);
89
+ }));
90
+ return map;
91
+ }
92
+ return (await service.query((0, helpers_1.mergeQuery)(qf(dto), { paging: { limit: 1 }, filter: opts?.filter })))[0];
93
+ }
94
+ getRelation(name) {
95
+ const relation = this.relations[name];
96
+ if (relation) {
97
+ return relation;
98
+ }
99
+ return undefined;
100
+ }
101
+ }
102
+ exports.RelationQueryService = RelationQueryService;
103
+ //# sourceMappingURL=relation-query.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-query.service.js","sourceRoot":"","sources":["../../../../../packages/core/src/services/relation-query.service.ts"],"names":[],"mappings":";;;AACA,wCAAwC;AAExC,6DAAwD;AACxD,+DAA0D;AAQ1D,MAAa,oBAAsE,SAAQ,uCAI1F;IAOC,Y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AC,CAAC,CAAC;IACvG,CAAC;IAED,WAAW,CAAW,IAAY;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,QAAQ,EAAE;YACZ,OAAO,QAA+C,CAAC;SACxD;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAlOD,oDAkOC"}
package/CHANGELOG.md DELETED
@@ -1,471 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [0.30.0](https://github.com/doug-martin/nestjs-query/compare/v0.29.0...v0.30.0) (2021-09-30)
7
-
8
- **Note:** Version bump only for package @nestjs-query/core
9
-
10
-
11
-
12
-
13
-
14
- # [0.29.0](https://github.com/doug-martin/nestjs-query/compare/v0.28.1...v0.29.0) (2021-09-09)
15
-
16
- **Note:** Version bump only for package @nestjs-query/core
17
-
18
-
19
-
20
-
21
-
22
- ## [0.28.1](https://github.com/doug-martin/nestjs-query/compare/v0.28.0...v0.28.1) (2021-07-27)
23
-
24
- **Note:** Version bump only for package @nestjs-query/core
25
-
26
-
27
-
28
-
29
-
30
- # [0.28.0](https://github.com/doug-martin/nestjs-query/compare/v0.27.0...v0.28.0) (2021-07-19)
31
-
32
- **Note:** Version bump only for package @nestjs-query/core
33
-
34
-
35
-
36
-
37
-
38
- # [0.27.0](https://github.com/doug-martin/nestjs-query/compare/v0.26.0...v0.27.0) (2021-05-12)
39
-
40
-
41
- ### Features
42
-
43
- * **graphql,#1058:** Allow declaration of custom ID scalar type ([fb2ed7a](https://github.com/doug-martin/nestjs-query/commit/fb2ed7aca59d66fa8827522cf81b6e31e77161d3)), closes [#1058](https://github.com/doug-martin/nestjs-query/issues/1058)
44
-
45
-
46
-
47
-
48
-
49
- # [0.26.0](https://github.com/doug-martin/nestjs-query/compare/v0.25.1...v0.26.0) (2021-04-13)
50
-
51
-
52
- ### Features
53
-
54
- * **core:** Add new `setRelations` to set oneToMany/manyToMany relations ([4c73591](https://github.com/doug-martin/nestjs-query/commit/4c7359168c0713723d18ae2dc302366fd820dc7b))
55
-
56
-
57
-
58
-
59
-
60
- ## [0.25.1](https://github.com/doug-martin/nestjs-query/compare/v0.25.0...v0.25.1) (2021-04-07)
61
-
62
-
63
- ### Bug Fixes
64
-
65
- * **mongoose,typegoose,#881:** Allow string objectId filters ([11098c4](https://github.com/doug-martin/nestjs-query/commit/11098c441de41462fe6c45742bc317f52ea09711)), closes [#881](https://github.com/doug-martin/nestjs-query/issues/881)
66
-
67
-
68
-
69
-
70
-
71
- # [0.25.0](https://github.com/doug-martin/nestjs-query/compare/v0.24.5...v0.25.0) (2021-03-31)
72
-
73
-
74
- ### Bug Fixes
75
-
76
- * Add consistent sorting for aggregate queries ([4ac7a14](https://github.com/doug-martin/nestjs-query/commit/4ac7a1485c7dcd83569951298606f487608806b1))
77
-
78
-
79
- ### Features
80
-
81
- * **core:** Add aggregate group by ([d5eb73b](https://github.com/doug-martin/nestjs-query/commit/d5eb73b9e7a193f664f46486435b7d8d76087b55))
82
-
83
-
84
-
85
-
86
-
87
- ## [0.24.4](https://github.com/doug-martin/nestjs-query/compare/v0.24.3...v0.24.4) (2021-03-18)
88
-
89
- **Note:** Version bump only for package @nestjs-query/core
90
-
91
-
92
-
93
-
94
-
95
- # [0.24.0](https://github.com/doug-martin/nestjs-query/compare/v0.23.1...v0.24.0) (2021-03-15)
96
-
97
-
98
- ### Features
99
-
100
- * **typegoose:** Add typegoose package ([#846](https://github.com/doug-martin/nestjs-query/issues/846)) ([73cf5cd](https://github.com/doug-martin/nestjs-query/commit/73cf5cdbf11496ad3a3ce3f6bb69975510de26e2))
101
-
102
-
103
-
104
-
105
-
106
- # [0.23.0](https://github.com/doug-martin/nestjs-query/compare/v0.22.0...v0.23.0) (2021-02-26)
107
-
108
- **Note:** Version bump only for package @nestjs-query/core
109
-
110
-
111
-
112
-
113
-
114
- # [0.22.0](https://github.com/doug-martin/nestjs-query/compare/v0.21.2...v0.22.0) (2021-02-08)
115
-
116
- **Note:** Version bump only for package @nestjs-query/core
117
-
118
-
119
-
120
-
121
-
122
- ## [0.21.2](https://github.com/doug-martin/nestjs-query/compare/v0.21.1...v0.21.2) (2020-10-23)
123
-
124
-
125
- ### Features
126
-
127
- * **core:** added two new filter helpers ([031012e](https://github.com/doug-martin/nestjs-query/commit/031012e96bf99e1eb08c155059fd5106b38e9faf))
128
-
129
-
130
-
131
-
132
-
133
- # [0.21.0](https://github.com/doug-martin/nestjs-query/compare/v0.20.2...v0.21.0) (2020-10-16)
134
-
135
-
136
- ### Bug Fixes
137
-
138
- * **core:** Look up the proper assembler with inheritance ([8bd22c5](https://github.com/doug-martin/nestjs-query/commit/8bd22c5a40974c9011d0b472dc1ebe1328ba83f6))
139
- * **eslint:** Fix eslint to recognize sub packages ([13fdd2b](https://github.com/doug-martin/nestjs-query/commit/13fdd2b31289dbc80316cbdb5aa32edbe596bad4))
140
-
141
-
142
- ### Features
143
-
144
- * **mongoose:** Hardening reference support ([107bba0](https://github.com/doug-martin/nestjs-query/commit/107bba040a2b1d423deb4f1e428a43cecab48e79))
145
- * **mongoose:** Switch to native mongoose support ([5cdfa39](https://github.com/doug-martin/nestjs-query/commit/5cdfa39b7d91cf0f8438ef3387a89aac850f4452))
146
-
147
-
148
-
149
-
150
-
151
- ## [0.20.2](https://github.com/doug-martin/nestjs-query/compare/v0.20.1...v0.20.2) (2020-10-01)
152
-
153
-
154
- ### Features
155
-
156
- * **core:** parallelize queries within relation query service ([b339a2a](https://github.com/doug-martin/nestjs-query/commit/b339a2a9a3d1ad315d92eec67ab31af18617f6ca))
157
-
158
-
159
-
160
-
161
-
162
- ## [0.20.1](https://github.com/doug-martin/nestjs-query/compare/v0.20.0...v0.20.1) (2020-09-28)
163
-
164
- **Note:** Version bump only for package @nestjs-query/core
165
-
166
-
167
-
168
-
169
-
170
- # [0.20.0](https://github.com/doug-martin/nestjs-query/compare/v0.19.4...v0.20.0) (2020-09-17)
171
-
172
-
173
- ### Features
174
-
175
- * **core:** Update assemblers to allow transforming create/update dtos ([5085d11](https://github.com/doug-martin/nestjs-query/commit/5085d1193a84396c9016821347c04f0e15eb04da))
176
- * **core:** Update query service decorator to have correct generics ([74dc618](https://github.com/doug-martin/nestjs-query/commit/74dc618b61d1ce5575843accf5ea01066020f073))
177
-
178
-
179
-
180
-
181
-
182
- ## [0.19.4](https://github.com/doug-martin/nestjs-query/compare/v0.19.3...v0.19.4) (2020-09-15)
183
-
184
-
185
- ### Features
186
-
187
- * **graphql:** Add keyset connections ([36bdbdd](https://github.com/doug-martin/nestjs-query/commit/36bdbdd9fda8b1db531ceb65c3a7c604c3da23fe))
188
-
189
-
190
-
191
-
192
-
193
- ## [0.19.3](https://github.com/doug-martin/nestjs-query/compare/v0.19.2...v0.19.3) (2020-09-09)
194
-
195
-
196
- ### Bug Fixes
197
-
198
- * **graphql,hooks:** Allow getting hooks from parent classes ([59a0aeb](https://github.com/doug-martin/nestjs-query/commit/59a0aebc3dabd7d23ffde576a94bc588e768efbe))
199
-
200
-
201
-
202
-
203
-
204
- ## [0.19.2](https://github.com/doug-martin/nestjs-query/compare/v0.19.1...v0.19.2) (2020-09-03)
205
-
206
- **Note:** Version bump only for package @nestjs-query/core
207
-
208
-
209
-
210
-
211
-
212
- # [0.19.0](https://github.com/doug-martin/nestjs-query/compare/v0.18.1...v0.19.0) (2020-09-01)
213
-
214
-
215
- ### Features
216
-
217
- * **core:** Update QueryService to allow additional filtering ([474369b](https://github.com/doug-martin/nestjs-query/commit/474369bd46ee82e3c8510f0564019627367d467c))
218
-
219
-
220
-
221
-
222
-
223
- ## [0.18.1](https://github.com/doug-martin/nestjs-query/compare/v0.18.0...v0.18.1) (2020-08-14)
224
-
225
-
226
- ### Bug Fixes
227
-
228
- * **core:** Fix potential stack overflow with filter comparison ([f498802](https://github.com/doug-martin/nestjs-query/commit/f49880274a32e681d9072253135a8669bec7b3b2))
229
-
230
-
231
- ### Features
232
-
233
- * **core:** refactor null compares and improve tests ([3582ed2](https://github.com/doug-martin/nestjs-query/commit/3582ed2f6b4aa5e3fa78bd9986621b9816566156))
234
- * refactored filter builder to support nested object filters ([1ee8dbf](https://github.com/doug-martin/nestjs-query/commit/1ee8dbf5a0ae1a1258b203da1e68901e2b8d20f8))
235
-
236
-
237
-
238
-
239
-
240
- # [0.18.0](https://github.com/doug-martin/nestjs-query/compare/v0.17.10...v0.18.0) (2020-08-11)
241
-
242
- **Note:** Version bump only for package @nestjs-query/core
243
-
244
-
245
-
246
-
247
-
248
- ## [0.17.10](https://github.com/doug-martin/nestjs-query/compare/v0.17.9...v0.17.10) (2020-08-01)
249
-
250
- **Note:** Version bump only for package @nestjs-query/core
251
-
252
-
253
-
254
-
255
-
256
- ## [0.17.8](https://github.com/doug-martin/nestjs-query/compare/v0.17.7...v0.17.8) (2020-07-28)
257
-
258
-
259
- ### Features
260
-
261
- * **graphql:** Allow specifying allowed comparisons on filterable fields ([ced2792](https://github.com/doug-martin/nestjs-query/commit/ced27920e5c2278c2a04c027a692e25b3306f6cb))
262
-
263
-
264
-
265
-
266
-
267
- ## [0.17.7](https://github.com/doug-martin/nestjs-query/compare/v0.17.6...v0.17.7) (2020-07-27)
268
-
269
-
270
- ### Features
271
-
272
- * **core:** Added applySort, applyPaging and applyQuery [#405](https://github.com/doug-martin/nestjs-query/issues/405) ([9f9ae0d](https://github.com/doug-martin/nestjs-query/commit/9f9ae0d0722c685483f1b2e1bd501a0f3df3ff85))
273
-
274
-
275
-
276
-
277
-
278
- ## [0.17.2](https://github.com/doug-martin/nestjs-query/compare/v0.17.1...v0.17.2) (2020-07-17)
279
-
280
- **Note:** Version bump only for package @nestjs-query/core
281
-
282
-
283
-
284
-
285
-
286
- # [0.17.0](https://github.com/doug-martin/nestjs-query/compare/v0.16.2...v0.17.0) (2020-07-16)
287
-
288
-
289
- ### Features
290
-
291
- * **aggregations:** Add aggregations interfaces ([d67e733](https://github.com/doug-martin/nestjs-query/commit/d67e73393d2cb8d2f0dc131a8455bb798a270e14))
292
- * **aggregations:** Add aggregations to graphql ([af075d2](https://github.com/doug-martin/nestjs-query/commit/af075d2e93b6abbbfbe32afcc917350f803fadaa))
293
- * **aggregations,relations,core:** Add relation aggregation to core ([a489588](https://github.com/doug-martin/nestjs-query/commit/a4895881a1e9ff76811b264cc58eeea116b3edfd))
294
-
295
-
296
-
297
-
298
-
299
- ## [0.16.2](https://github.com/doug-martin/nestjs-query/compare/v0.16.1...v0.16.2) (2020-07-09)
300
-
301
- **Note:** Version bump only for package @nestjs-query/core
302
-
303
-
304
-
305
-
306
-
307
- # [0.16.0](https://github.com/doug-martin/nestjs-query/compare/v0.15.1...v0.16.0) (2020-07-05)
308
-
309
-
310
- ### Features
311
-
312
- * **core:** Add type support for nest objects in filter ([cd9d0b5](https://github.com/doug-martin/nestjs-query/commit/cd9d0b524c1f4c384dc9e5ac6baeb5a49bc068e7))
313
-
314
-
315
-
316
-
317
-
318
- # [0.15.0](https://github.com/doug-martin/nestjs-query/compare/v0.14.3...v0.15.0) (2020-06-23)
319
-
320
-
321
- ### Features
322
-
323
- * **graphql,connection:** Add totalCount to connections ([ed1e84a](https://github.com/doug-martin/nestjs-query/commit/ed1e84a2feb6f89c3b270fcbc1d0eaf6aec5e575))
324
-
325
-
326
-
327
-
328
-
329
- # [0.14.0](https://github.com/doug-martin/nestjs-query/compare/v0.13.2...v0.14.0) (2020-06-18)
330
-
331
- **Note:** Version bump only for package @nestjs-query/core
332
-
333
-
334
-
335
-
336
-
337
- # [0.13.0](https://github.com/doug-martin/nestjs-query/compare/v0.12.0...v0.13.0) (2020-06-12)
338
-
339
- **Note:** Version bump only for package @nestjs-query/core
340
-
341
-
342
-
343
-
344
-
345
- # [0.12.0](https://github.com/doug-martin/nestjs-query/compare/v0.11.8...v0.12.0) (2020-06-07)
346
-
347
-
348
- ### Features
349
-
350
- * **graphql:** Add graphql subscriptions ([5dc987f](https://github.com/doug-martin/nestjs-query/commit/5dc987f435e0680192313e208359839f9c21d70b))
351
-
352
-
353
-
354
-
355
-
356
- ## [0.11.8](https://github.com/doug-martin/nestjs-query/compare/v0.11.7...v0.11.8) (2020-05-30)
357
-
358
- **Note:** Version bump only for package @nestjs-query/core
359
-
360
-
361
-
362
-
363
-
364
- ## [0.11.7](https://github.com/doug-martin/nestjs-query/compare/v0.11.6...v0.11.7) (2020-05-29)
365
-
366
- **Note:** Version bump only for package @nestjs-query/core
367
-
368
-
369
-
370
-
371
-
372
- ## [0.11.6](https://github.com/doug-martin/nestjs-query/compare/v0.11.5...v0.11.6) (2020-05-26)
373
-
374
- **Note:** Version bump only for package @nestjs-query/core
375
-
376
-
377
-
378
-
379
-
380
- ## [0.11.5](https://github.com/doug-martin/nestjs-query/compare/v0.11.4...v0.11.5) (2020-05-21)
381
-
382
- **Note:** Version bump only for package @nestjs-query/core
383
-
384
-
385
-
386
-
387
-
388
- ## [0.11.4](https://github.com/doug-martin/nestjs-query/compare/v0.11.3...v0.11.4) (2020-05-19)
389
-
390
- **Note:** Version bump only for package @nestjs-query/core
391
-
392
-
393
-
394
-
395
-
396
- ## [0.11.3](https://github.com/doug-martin/nestjs-query/compare/v0.11.2...v0.11.3) (2020-05-16)
397
-
398
- **Note:** Version bump only for package @nestjs-query/core
399
-
400
-
401
-
402
-
403
-
404
- ## [0.11.2](https://github.com/doug-martin/nestjs-query/compare/v0.11.1...v0.11.2) (2020-05-14)
405
-
406
-
407
- ### Bug Fixes
408
-
409
- * Fix lint issues ([c3407c0](https://github.com/doug-martin/nestjs-query/commit/c3407c0abfebe2ed6563cf754bab646af124a661))
410
-
411
-
412
- ### Features
413
-
414
- * **graphql,core:** Add support for custom services and assemblers ([85e8658](https://github.com/doug-martin/nestjs-query/commit/85e8658c6acd495233cabb576c3458afcb8fff12))
415
-
416
-
417
-
418
-
419
-
420
- ## [0.11.1](https://github.com/doug-martin/nestjs-query/compare/v0.11.0...v0.11.1) (2020-05-11)
421
-
422
-
423
- ### Features
424
-
425
- * **graphql:** Add support for auto-generated federations ([238f641](https://github.com/doug-martin/nestjs-query/commit/238f641967ea6668dfb7bd9034fec732da7fe38b))
426
-
427
-
428
-
429
-
430
-
431
- # [0.11.0](https://github.com/doug-martin/nestjs-query/compare/v0.10.2...v0.11.0) (2020-05-09)
432
-
433
-
434
- ### Features
435
-
436
- * **graphql:** Add graphql module ([282c421](https://github.com/doug-martin/nestjs-query/commit/282c421d0e6f67fe750fa6005f6cb7d960c8fbd0))
437
-
438
-
439
-
440
-
441
-
442
- # [0.10.0](https://github.com/doug-martin/nestjs-query/compare/v0.9.0...v0.10.0) (2020-04-29)
443
-
444
-
445
- ### Features
446
-
447
- * **sequelize:** Initial Sequelize support ([bfcf436](https://github.com/doug-martin/nestjs-query/commit/bfcf4368b96617113c0334cd78a8881e4952eb99))
448
-
449
-
450
-
451
-
452
-
453
- # [0.9.0](https://github.com/doug-martin/nestjs-query/compare/v0.8.9...v0.9.0) (2020-04-26)
454
-
455
- **Note:** Version bump only for package @nestjs-query/core
456
-
457
-
458
-
459
-
460
-
461
- ## [0.8.9](https://github.com/doug-martin/nestjs-query/compare/v0.8.8...v0.8.9) (2020-04-24)
462
-
463
- **Note:** Version bump only for package @nestjs-query/core
464
-
465
-
466
-
467
-
468
-
469
- ## [0.8.7](https://github.com/doug-martin/nestjs-query/compare/v0.8.6...v0.8.7) (2020-04-23)
470
-
471
- **Note:** Version bump only for package @nestjs-query/core