@ptc-org/nestjs-query-graphql 2.4.0 → 3.0.0-alpha.1
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 +5 -5
- package/src/decorators/filterable-field.decorator.d.ts +2 -2
- package/src/decorators/filterable-field.decorator.js.map +1 -1
- package/src/decorators/hook-args.decorator.js +11 -5
- package/src/decorators/hook-args.decorator.js.map +1 -1
- package/src/decorators/hook.decorator.d.ts +10 -10
- package/src/decorators/hook.decorator.js +11 -9
- package/src/decorators/hook.decorator.js.map +1 -1
- package/src/decorators/id-field.decorator.d.ts +2 -2
- package/src/decorators/id-field.decorator.js.map +1 -1
- package/src/decorators/resolver-method.decorator.d.ts +15 -0
- package/src/decorators/resolver-method.decorator.js +10 -1
- package/src/decorators/resolver-method.decorator.js.map +1 -1
- package/src/decorators/resolver-relation-mutation.decorator.d.ts +10 -0
- package/src/decorators/resolver-relation-mutation.decorator.js +21 -0
- package/src/decorators/resolver-relation-mutation.decorator.js.map +1 -0
- package/src/interceptors/hook.interceptor.d.ts +1 -1
- package/src/interceptors/hook.interceptor.js +7 -7
- package/src/interceptors/hook.interceptor.js.map +1 -1
- package/src/providers/hook.provider.js +21 -14
- package/src/providers/hook.provider.js.map +1 -1
- package/src/resolvers/relations/helpers.js +1 -1
- package/src/resolvers/relations/helpers.js.map +1 -1
- package/src/resolvers/relations/relations.interface.d.ts +8 -19
- package/src/resolvers/relations/remove-relations.resolver.js +13 -12
- package/src/resolvers/relations/remove-relations.resolver.js.map +1 -1
- package/src/resolvers/relations/update-relations.resolver.js +16 -13
- package/src/resolvers/relations/update-relations.resolver.js.map +1 -1
- package/src/types/connection/cursor/page-info.type.js +1 -0
- package/src/types/connection/cursor/page-info.type.js.map +1 -1
- package/src/types/connection/offset/offset-connection.type.js +1 -0
- package/src/types/connection/offset/offset-connection.type.js.map +1 -1
- package/src/types/connection/offset/offset-page-info.type.js +1 -0
- package/src/types/connection/offset/offset-page-info.type.js.map +1 -1
- package/src/types/delete-many-reponse.type.js +1 -0
- package/src/types/delete-many-reponse.type.js.map +1 -1
- package/src/types/query/field-comparison/field-comparison.factory.d.ts +2 -2
- package/src/types/update-many-response.type.js +1 -0
- package/src/types/update-many-response.type.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptc-org/nestjs-query-graphql",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"description": "Nestjs graphql query adapter",
|
|
5
5
|
"author": "doug-martin <doug@dougamartin.com>",
|
|
6
6
|
"homepage": "https://github.com/tripss/nestjs-query#readme",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"pluralize": "^8.0.0",
|
|
40
40
|
"tslib": "^2.4.0",
|
|
41
41
|
"upper-case-first": "^2.0.2",
|
|
42
|
-
"@ptc-org/nestjs-query-core": "
|
|
42
|
+
"@ptc-org/nestjs-query-core": "3.0.0-alpha.1",
|
|
43
43
|
"lodash.merge": "4.6.2",
|
|
44
44
|
"reflect-metadata": "0.1.13"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@apollo/gateway": "^0.44.1 || ^0.46.0 || ^0.48.0 || ^0.49.0 || ^0.50.0 || ^2.0.0",
|
|
48
|
-
"@nestjs/common": "^
|
|
49
|
-
"@nestjs/core": "^
|
|
50
|
-
"@nestjs/graphql": "^
|
|
48
|
+
"@nestjs/common": "^9.0.0",
|
|
49
|
+
"@nestjs/core": "^9.0.0",
|
|
50
|
+
"@nestjs/graphql": "^11.0.0",
|
|
51
51
|
"class-transformer": "^0.2.3 || 0.3.1 || ^0.5",
|
|
52
52
|
"class-validator": "^0.14.0",
|
|
53
53
|
"graphql": "^16.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldOptions, ReturnTypeFunc } from '@nestjs/graphql';
|
|
1
|
+
import { FieldOptions, ReturnTypeFunc, ReturnTypeFuncValue } from '@nestjs/graphql';
|
|
2
2
|
import { Class, FilterComparisonOperators } from '@ptc-org/nestjs-query-core';
|
|
3
3
|
export type FilterableFieldOptions = {
|
|
4
4
|
allowedComparisons?: FilterComparisonOperators<unknown>[];
|
|
@@ -8,7 +8,7 @@ export type FilterableFieldOptions = {
|
|
|
8
8
|
export interface FilterableFieldDescriptor {
|
|
9
9
|
propertyName: string;
|
|
10
10
|
target: Class<unknown>;
|
|
11
|
-
returnTypeFunc?: ReturnTypeFunc
|
|
11
|
+
returnTypeFunc?: ReturnTypeFunc<ReturnTypeFuncValue>;
|
|
12
12
|
advancedOptions?: FilterableFieldOptions;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterable-field.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/filterable-field.decorator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"filterable-field.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/filterable-field.decorator.ts"],"names":[],"mappings":";;;AAAA,6CAA0F;AAC1F,kEAAgH;AAEhH,2CAAkD;AAElD,MAAM,SAAS,GAAG,IAAI,kCAAc,CAAC,gCAAoB,CAAC,CAAA;AAkD1D,SAAgB,eAAe,CAC7B,uBAAiE,EACjE,YAAqC;IAErC,IAAI,cAA0C,CAAA;IAC9C,IAAI,eAAmD,CAAA;IACvD,IAAI,OAAO,uBAAuB,KAAK,UAAU,EAAE;QACjD,cAAc,GAAG,uBAAuB,CAAA;QACxC,eAAe,GAAG,YAAY,CAAA;KAC/B;SAAM,IAAI,OAAO,uBAAuB,KAAK,QAAQ,EAAE;QACtD,eAAe,GAAG,uBAAuB,CAAA;KAC1C;SAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,YAAY,CAAA;KAC/B;IACD,OAAO;IACL,wDAAwD;IACxD,MAAc,EACd,YA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E,GAAG,MAAM,CAAC,CAAA;IAClC,CAAC,EAAE,EAAiC,CAAC,CAAA;AACvC,CAAC;AAPD,kDAOC"}
|
|
@@ -25,17 +25,23 @@ function createArgsDecorator(fn) {
|
|
|
25
25
|
return (0, decorator_utils_1.composeDecorators)((0, graphql_1.Args)(), dec);
|
|
26
26
|
}
|
|
27
27
|
const HookArgs = () => createArgsDecorator(async (data, context) => {
|
|
28
|
-
if (context.
|
|
29
|
-
|
|
28
|
+
if (context.hooks && context.hooks.length > 0) {
|
|
29
|
+
let hookedArgs = data;
|
|
30
|
+
for (const hook of context.hooks) {
|
|
31
|
+
hookedArgs = (await hook.run(hookedArgs, context));
|
|
32
|
+
}
|
|
30
33
|
return hookedArgs;
|
|
31
34
|
}
|
|
32
35
|
return data;
|
|
33
36
|
});
|
|
34
37
|
exports.HookArgs = HookArgs;
|
|
35
38
|
const MutationHookArgs = () => createArgsDecorator(async (data, context) => {
|
|
36
|
-
if (context.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
if (context.hooks && context.hooks.length > 0) {
|
|
40
|
+
let hookedArgs = data.input;
|
|
41
|
+
for (const hook of context.hooks) {
|
|
42
|
+
hookedArgs = (await hook.run(hookedArgs, context));
|
|
43
|
+
}
|
|
44
|
+
return { input: hookedArgs };
|
|
39
45
|
}
|
|
40
46
|
return data;
|
|
41
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-args.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/hook-args.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AACvE,6CAA2D;AAE3D,yDAAgD;AAKhD,uDAAqD;AAErD,SAAS,cAAc,CAAI,KAAQ,EAAE,IAAe;IAClD,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC,EAAE;QACpC,OAAO,IAAA,gCAAY,EAAa,IAAI,EAAE,KAAK,CAAC,CAAA;KAC7C;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,mBAAmB,CAAiB,EAA0C;IACrF,MAAM,GAAG,GAAG,CAAC,MAAsB,EAAE,UAAkB,EAAE,UAAkB,EAAQ,EAAE;QACnF,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAe,CAAA;QACzF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;QAClC,OAAO,IAAA,6BAAoB,EAAC,KAAK,EAAE,IAAa,EAAE,gBAAkC,EAAE,EAAE;YACtF,MAAM,mBAAmB,GAAG,6BAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;YACxE,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,EAAK,CAAA;YACtD,MAAM,IAAI,GAAG,mBAAmB,CAAC,OAAO,EAAK,CAAA;YAC7C,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,CAAA;QACtD,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;IACtC,CAAC,CAAA;IACD,OAAO,IAAA,mCAAiB,EAAC,IAAA,cAAI,GAAE,EAAE,GAAyB,CAAC,CAAA;AAC7D,CAAC;AAEM,MAAM,QAAQ,GAAG,GAA0B,EAAE,CAClD,mBAAmB,CAAC,KAAK,EAAE,IAAO,EAAE,OAAmC,EAAE,EAAE;IACzE,IAAI,OAAO,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"hook-args.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/hook-args.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AACvE,6CAA2D;AAE3D,yDAAgD;AAKhD,uDAAqD;AAErD,SAAS,cAAc,CAAI,KAAQ,EAAE,IAAe;IAClD,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC,EAAE;QACpC,OAAO,IAAA,g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AA;SACxD;QACD,OAAO,UAAU,CAAA;KAClB;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAC,CAAA;AAVS,QAAA,QAAQ,YAUjB;AAEG,MAAM,gBAAgB,GAAG,GAA4D,EAAE,CAC5F,mBAAmB,CAAC,KAAK,EAAE,IAAO,EAAE,OAAmC,EAAE,EAAE;IACzE,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7C,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAA;QAC3B,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE;YAChC,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAM,CAAA;SACxD;QACD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;KAC7B;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAC,CAAA;AAVS,QAAA,gBAAgB,oBAUzB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Class, MetaValue } from '@ptc-org/nestjs-query-core';
|
|
2
2
|
import { BeforeCreateManyHook, BeforeCreateOneHook, BeforeDeleteManyHook, BeforeDeleteOneHook, BeforeFindOneHook, BeforeQueryManyHook, BeforeUpdateManyHook, BeforeUpdateOneHook, Hook, HookTypes } from '../hooks';
|
|
3
|
-
export type HookMetaValue<H extends Hook<unknown>> = MetaValue<Class<H
|
|
3
|
+
export type HookMetaValue<H extends Hook<unknown>> = MetaValue<Class<H>[]>;
|
|
4
4
|
export type HookDecoratorArg<H extends Hook<unknown>> = Class<H> | H['run'];
|
|
5
|
-
export declare const BeforeCreateOne: (data: HookDecoratorArg<BeforeCreateOneHook<any, any>>) => (target: Function) => void;
|
|
6
|
-
export declare const BeforeCreateMany: (data: HookDecoratorArg<BeforeCreateManyHook<any, any>>) => (target: Function) => void;
|
|
7
|
-
export declare const BeforeUpdateOne: (data: HookDecoratorArg<BeforeUpdateOneHook<any, any>>) => (target: Function) => void;
|
|
8
|
-
export declare const BeforeUpdateMany: (data: HookDecoratorArg<BeforeUpdateManyHook<any, any, any>>) => (target: Function) => void;
|
|
9
|
-
export declare const BeforeDeleteOne: (data: HookDecoratorArg<BeforeDeleteOneHook<any>>) => (target: Function) => void;
|
|
10
|
-
export declare const BeforeDeleteMany: (data: HookDecoratorArg<BeforeDeleteManyHook<any, any>>) => (target: Function) => void;
|
|
11
|
-
export declare const BeforeQueryMany: (data: HookDecoratorArg<BeforeQueryManyHook<any, any>>) => (target: Function) => void;
|
|
12
|
-
export declare const BeforeFindOne: (data: HookDecoratorArg<BeforeFindOneHook<any>>) => (target: Function) => void;
|
|
13
|
-
export declare const
|
|
5
|
+
export declare const BeforeCreateOne: (...data: HookDecoratorArg<BeforeCreateOneHook<any, any>>[]) => (target: Function) => void;
|
|
6
|
+
export declare const BeforeCreateMany: (...data: HookDecoratorArg<BeforeCreateManyHook<any, any>>[]) => (target: Function) => void;
|
|
7
|
+
export declare const BeforeUpdateOne: (...data: HookDecoratorArg<BeforeUpdateOneHook<any, any>>[]) => (target: Function) => void;
|
|
8
|
+
export declare const BeforeUpdateMany: (...data: HookDecoratorArg<BeforeUpdateManyHook<any, any, any>>[]) => (target: Function) => void;
|
|
9
|
+
export declare const BeforeDeleteOne: (...data: HookDecoratorArg<BeforeDeleteOneHook<any>>[]) => (target: Function) => void;
|
|
10
|
+
export declare const BeforeDeleteMany: (...data: HookDecoratorArg<BeforeDeleteManyHook<any, any>>[]) => (target: Function) => void;
|
|
11
|
+
export declare const BeforeQueryMany: (...data: HookDecoratorArg<BeforeQueryManyHook<any, any>>[]) => (target: Function) => void;
|
|
12
|
+
export declare const BeforeFindOne: (...data: HookDecoratorArg<BeforeFindOneHook<any>>[]) => (target: Function) => void;
|
|
13
|
+
export declare const getHooksForType: <H extends Hook<unknown, any>>(hookType: HookTypes, DTOClass: Class<unknown>) => Class<H>[];
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getHooksForType = exports.BeforeFindOne = exports.BeforeQueryMany = exports.BeforeDeleteMany = exports.BeforeDeleteOne = exports.BeforeUpdateMany = exports.BeforeUpdateOne = exports.BeforeCreateMany = exports.BeforeCreateOne = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const nestjs_query_core_1 = require("@ptc-org/nestjs-query-core");
|
|
6
6
|
const hooks_1 = require("../hooks");
|
|
7
7
|
const hookMetaDataKey = (hookType) => `nestjs-query:${hookType}`;
|
|
8
8
|
const hookDecorator = (hookType) => {
|
|
9
9
|
const key = hookMetaDataKey(hookType);
|
|
10
|
+
const getHook = (hook) => {
|
|
11
|
+
if ((0, hooks_1.isHookClass)(hook)) {
|
|
12
|
+
return hook;
|
|
13
|
+
}
|
|
14
|
+
return (0, hooks_1.createDefaultHook)(hook);
|
|
15
|
+
};
|
|
10
16
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
|
-
return (data) =>
|
|
17
|
+
return (...data) =>
|
|
12
18
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
13
19
|
(target) => {
|
|
14
|
-
|
|
15
|
-
return Reflect.defineMetadata(key, data, target);
|
|
16
|
-
}
|
|
17
|
-
const hook = (0, hooks_1.createDefaultHook)(data);
|
|
18
|
-
return Reflect.defineMetadata(key, hook, target);
|
|
20
|
+
return Reflect.defineMetadata(key, data.map((d) => getHook(d)), target);
|
|
19
21
|
};
|
|
20
22
|
};
|
|
21
23
|
exports.BeforeCreateOne = hookDecorator(hooks_1.HookTypes.BEFORE_CREATE_ONE);
|
|
@@ -26,6 +28,6 @@ exports.BeforeDeleteOne = hookDecorator(hooks_1.HookTypes.BEFORE_DELETE_ONE);
|
|
|
26
28
|
exports.BeforeDeleteMany = hookDecorator(hooks_1.HookTypes.BEFORE_DELETE_MANY);
|
|
27
29
|
exports.BeforeQueryMany = hookDecorator(hooks_1.HookTypes.BEFORE_QUERY_MANY);
|
|
28
30
|
exports.BeforeFindOne = hookDecorator(hooks_1.HookTypes.BEFORE_FIND_ONE);
|
|
29
|
-
const
|
|
30
|
-
exports.
|
|
31
|
+
const getHooksForType = (hookType, DTOClass) => (0, nestjs_query_core_1.getClassMetadata)(DTOClass, hookMetaDataKey(hookType), true);
|
|
32
|
+
exports.getHooksForType = getHooksForType;
|
|
31
33
|
//# sourceMappingURL=hook.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/hook.decorator.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,kEAA+E;AAE/E,oCAaiB;AAMjB,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAU,EAAE,CAAC,gBAAgB,QAAQ,EAAE,CAAA;AAEnF,MAAM,aAAa,GAAG,CAA0B,QAAmB,EAAE,EAAE;IACrE,MAAM,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"hook.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/hook.decorator.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,kEAA+E;AAE/E,oCAaiB;AAMjB,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAU,EAAE,CAAC,gBAAgB,QAAQ,EAAE,CAAA;AAEnF,MAAM,aAAa,GAAG,CAA0B,QAAmB,EAAE,EAAE;IACrE,MAAM,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAErC,MAAM,OAAO,GAAG,CAAC,IAAyB,EAAE,EAAE;QAC5C,IAAI,IAAA,mBAAW,EAAC,IAAI,CAAC,EAAE;YACrB,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,wDAAwD;IACxD,OAAO,CAAC,GAAG,IAA2B,EAAE,EAAE;IACxC,wDAAwD;IACxD,CAAC,MAAgB,EAAQ,EAAE;QACzB,OAAO,OAAO,CAAC,cAAc,CAC3B,GAAG,EACH,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3B,MAAM,CACP,CAAA;IACH,CAAC,CAAA;AACL,CAAC,CAAA;AAEY,QAAA,eAAe,GAAG,aAAa,CAA2B,iBAAS,CAAC,iBAAiB,CAAC,CAAA;AACtF,QAAA,gBAAgB,GAAG,aAAa,CAA4B,iBAAS,CAAC,kBAAkB,CAAC,CAAA;AACzF,QAAA,eAAe,GAAG,aAAa,CAA2B,iBAAS,CAAC,iBAAiB,CAAC,CAAA;AACtF,QAAA,gBAAgB,GAAG,aAAa,CAAiC,iBAAS,CAAC,kBAAkB,CAAC,CAAA;AAC9F,QAAA,eAAe,GAAG,aAAa,CAAsB,iBAAS,CAAC,iBAAiB,CAAC,CAAA;AACjF,QAAA,gBAAgB,GAAG,aAAa,CAA4B,iBAAS,CAAC,kBAAkB,CAAC,CAAA;AACzF,QAAA,eAAe,GAAG,aAAa,CAA2B,iBAAS,CAAC,iBAAiB,CAAC,CAAA;AACtF,QAAA,aAAa,GAAG,aAAa,CAAoB,iBAAS,CAAC,eAAe,CAAC,CAAA;AAEjF,MAAM,eAAe,GAAG,CAA0B,QAAmB,EAAE,QAAwB,EAAoB,EAAE,CAC1H,IAAA,oCAAgB,EAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAA;AADhD,QAAA,eAAe,mBACiC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldOptions, ReturnTypeFunc } from '@nestjs/graphql';
|
|
1
|
+
import { FieldOptions, ReturnTypeFunc, ReturnTypeFuncValue } from '@nestjs/graphql';
|
|
2
2
|
import { Class, MetaValue } from '@ptc-org/nestjs-query-core';
|
|
3
3
|
import { FilterableFieldOptions } from './filterable-field.decorator';
|
|
4
4
|
type NoFilterIDFieldOptions = {
|
|
@@ -7,7 +7,7 @@ type NoFilterIDFieldOptions = {
|
|
|
7
7
|
export type IDFieldOptions = FilterableFieldOptions | NoFilterIDFieldOptions;
|
|
8
8
|
export interface IDFieldDescriptor {
|
|
9
9
|
propertyName: string;
|
|
10
|
-
returnTypeFunc: ReturnTypeFunc
|
|
10
|
+
returnTypeFunc: ReturnTypeFunc<ReturnTypeFuncValue>;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Decorator for Fields that should be filterable through a [[FilterType]]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-field.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/id-field.decorator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"id-field.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/id-field.decorator.ts"],"names":[],"mappings":";;;AAAA,6CAA0F;AAC1F,kEAA6E;AAE7E,2CAA0C;AAC1C,6EAAsF;AAEtF,MAAM,SAAS,GAAG,IAAI,kCAAc,CAAC,wBAAY,CAAC,CAAA;AAWlD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO,CAAC,cAA8B,EAAE,OAAwB;IAC9E,OAAO;IACL,wDAAwD;IACxD,MAAc,EACd,YAA6B,EAC7B,UAAuC,EACJ,EAAE;QACrC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,WAA6B,EAAE;YAClD,YAAY,EAAE,YAAY,CAAC,QAAQ,EAAE;YACrC,cAAc;SACf,CAAC,CAAA;QACF,MAAM,aAAa,GAAG,OAAO,IAAI,eAAe,IAAI,OAAO,CAAA;QAC3D,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,eAAK,CAAC,CAAC,CAAC,4CAAe,CAAA;QAC9D,IAAI,UAAU,EAAE;YACd,OAAO,cAAc,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;SACjF;QACD,OAAO,cAAc,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACtE,CAAC,CAAA;AACH,CAAC;AAlBD,0BAkBC;AAED,SAAgB,UAAU,CAAM,QAAoB;IAClD,OAAO,SAAS,CAAC,GAAG,CAAyB,QAAQ,EAAE,IAAI,CAAC,CAAA;AAC9D,CAAC;AAFD,gCAEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CanActivate, ExceptionFilter, NestInterceptor, PipeTransform } from '@nestjs/common';
|
|
2
|
+
import { Complexity } from '@nestjs/graphql';
|
|
2
3
|
import { Class } from '@ptc-org/nestjs-query-core';
|
|
3
4
|
export interface BaseResolverOptions {
|
|
4
5
|
/** An array of `nestjs` guards to apply to a graphql endpoint */
|
|
@@ -19,12 +20,26 @@ export interface ResolverMethodOpts extends BaseResolverOptions {
|
|
|
19
20
|
/** Set to true to disable the endpoint */
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for relation resolver methods.
|
|
25
|
+
*/
|
|
26
|
+
export interface ResolverRelationMethodOpts extends BaseResolverOptions {
|
|
27
|
+
/** Set to true to enable the endpoint */
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
complexity?: Complexity;
|
|
30
|
+
}
|
|
22
31
|
/**
|
|
23
32
|
* @internal
|
|
24
33
|
* Returns true if any of the [[ResolverMethodOpts]] are disabled.
|
|
25
34
|
* @param opts - The array of [[ResolverMethodOpts]] to check.
|
|
26
35
|
*/
|
|
27
36
|
export declare function isDisabled(opts: ResolverMethodOpts[]): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* Returns true if any of the [[ResolverRelationMethodOpts]] are disabled.
|
|
40
|
+
* @param opts - The array of [[ResolverRelationMethodOpts]] to check.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isEnabled(opts: ResolverRelationMethodOpts[]): boolean;
|
|
28
43
|
/**
|
|
29
44
|
* @internal
|
|
30
45
|
* Decorator for all ResolverMethods
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResolverMethod = exports.isDisabled = void 0;
|
|
3
|
+
exports.ResolverMethod = exports.isEnabled = exports.isDisabled = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
/**
|
|
@@ -22,6 +22,15 @@ function isDisabled(opts) {
|
|
|
22
22
|
return !!opts.find((o) => o.disabled);
|
|
23
23
|
}
|
|
24
24
|
exports.isDisabled = isDisabled;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* Returns true if any of the [[ResolverRelationMethodOpts]] are disabled.
|
|
28
|
+
* @param opts - The array of [[ResolverRelationMethodOpts]] to check.
|
|
29
|
+
*/
|
|
30
|
+
function isEnabled(opts) {
|
|
31
|
+
return opts.some((o) => o.enabled);
|
|
32
|
+
}
|
|
33
|
+
exports.isEnabled = isEnabled;
|
|
25
34
|
/**
|
|
26
35
|
* @internal
|
|
27
36
|
* Decorator for all ResolverMethods
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver-method.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/resolver-method.decorator.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,2CAUuB;
|
|
1
|
+
{"version":3,"file":"resolver-method.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/resolver-method.decorator.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,2CAUuB;AAkCvB;;;;GAIG;AACH,6DAA6D;AAC7D,SAAS,cAAc,CAAI,GAAG,IAAW;IACvC,MAAM,G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O,IAAI,EAAE,CAAC,CAAC,CAAC,EAC1F,GAAG,cAAc,CAAsC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAC/F,CAAA;AACH,CAAC;AARD,wCAQC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MutationOptions, ReturnTypeFunc } from '@nestjs/graphql';
|
|
2
|
+
import { ResolverRelationMethodOpts } from './resolver-method.decorator';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Decorator for a graphql `mutation` endpoint.
|
|
6
|
+
* @param typeFunc - A function that returns the return type for the mutation.
|
|
7
|
+
* @param options - `@nestjs/graphql` options to apply to the mutation.
|
|
8
|
+
* @param opts - [[ResolverRelationMethodOpts]] to apply to the mutation
|
|
9
|
+
*/
|
|
10
|
+
export declare function ResolverRelationMutation(typeFunc: ReturnTypeFunc, options?: MutationOptions, ...opts: ResolverRelationMethodOpts[]): MethodDecorator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResolverRelationMutation = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
const resolver_method_decorator_1 = require("./resolver-method.decorator");
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* Decorator for a graphql `mutation` endpoint.
|
|
10
|
+
* @param typeFunc - A function that returns the return type for the mutation.
|
|
11
|
+
* @param options - `@nestjs/graphql` options to apply to the mutation.
|
|
12
|
+
* @param opts - [[ResolverRelationMethodOpts]] to apply to the mutation
|
|
13
|
+
*/
|
|
14
|
+
function ResolverRelationMutation(typeFunc, options, ...opts) {
|
|
15
|
+
if (!(0, resolver_method_decorator_1.isEnabled)(opts)) {
|
|
16
|
+
return () => { };
|
|
17
|
+
}
|
|
18
|
+
return (0, common_1.applyDecorators)((0, graphql_1.Mutation)(typeFunc, options), (0, resolver_method_decorator_1.ResolverMethod)(...opts));
|
|
19
|
+
}
|
|
20
|
+
exports.ResolverRelationMutation = ResolverRelationMutation;
|
|
21
|
+
//# sourceMappingURL=resolver-relation-mutation.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver-relation-mutation.decorator.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/decorators/resolver-relation-mutation.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAChD,6CAA2E;AAE3E,2EAAmG;AAEnG;;;;;;GAMG;AACH,SAAgB,wBAAwB,CACtC,QAAwB,EACxB,OAAyB,EACzB,GAAG,IAAkC;IAErC,IAAI,CAAC,IAAA,qCAAS,EAAC,IAAI,CAAC,EAAE;QACpB,OAAO,GAAS,EAAE,GAAE,CAAC,CAAA;KACtB;IACD,OAAO,IAAA,wBAAe,EAAC,IAAA,kBAAQ,EAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAA,0CAAc,EAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AAC9E,CAAC;AATD,4DASC"}
|
|
@@ -2,6 +2,6 @@ import { NestInterceptor } from '@nestjs/common';
|
|
|
2
2
|
import { Class } from '@ptc-org/nestjs-query-core';
|
|
3
3
|
import { Hook, HookTypes } from '../hooks';
|
|
4
4
|
export type HookContext<H extends Hook<unknown>> = {
|
|
5
|
-
|
|
5
|
+
hooks?: H[];
|
|
6
6
|
};
|
|
7
7
|
export declare function HookInterceptor(type: HookTypes, ...DTOClasses: Class<unknown>[]): Class<NestInterceptor>;
|
|
@@ -12,26 +12,26 @@ class DefaultHookInterceptor {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
function HookInterceptor(type, ...DTOClasses) {
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
15
|
+
const HookedClasses = DTOClasses.find((Cls) => (0, decorators_1.getHooksForType)(type, Cls));
|
|
16
|
+
if (!HookedClasses) {
|
|
17
17
|
return DefaultHookInterceptor;
|
|
18
18
|
}
|
|
19
|
-
const hookToken = (0, hooks_1.getHookToken)(type,
|
|
19
|
+
const hookToken = (0, hooks_1.getHookToken)(type, HookedClasses);
|
|
20
20
|
let Interceptor = class Interceptor {
|
|
21
|
-
constructor(
|
|
22
|
-
this.
|
|
21
|
+
constructor(hooks) {
|
|
22
|
+
this.hooks = hooks;
|
|
23
23
|
}
|
|
24
24
|
intercept(context, next) {
|
|
25
25
|
const gqlContext = graphql_1.GqlExecutionContext.create(context);
|
|
26
26
|
const ctx = gqlContext.getContext();
|
|
27
|
-
ctx.
|
|
27
|
+
ctx.hooks = this.hooks;
|
|
28
28
|
return next.handle();
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
Interceptor = tslib_1.__decorate([
|
|
32
32
|
(0, common_1.Injectable)(),
|
|
33
33
|
tslib_1.__param(0, (0, common_1.Inject)(hookToken)),
|
|
34
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
34
|
+
tslib_1.__metadata("design:paramtypes", [Array])
|
|
35
35
|
], Interceptor);
|
|
36
36
|
Object.defineProperty(Interceptor, 'name', {
|
|
37
37
|
writable: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.interceptor.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/interceptors/hook.interceptor.ts"],"names":[],"mappings":";;;;AAAA,2CAAmG;AACnG,6CAAqD;AAGrD,
|
|
1
|
+
{"version":3,"file":"hook.interceptor.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/interceptors/hook.interceptor.ts"],"names":[],"mappings":";;;;AAAA,2CAAmG;AACnG,6CAAqD;AAGrD,8CAA+C;AAC/C,oCAAwD;AAIxD,MAAM,sBAAsB;IAC1B,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACpD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;IACtB,CAAC;CACF;AAED,SAAgB,eAAe,CAAC,IAAe,EAAE,GAAG,UAA4B;IAC9E,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,4BAAe,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;IAC1E,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,sBAAsB,CAAA;KAC9B;IACD,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,aAAa,CAAC,CAAA;IAEnD,IACM,WAAW,GADjB,MACM,WAAW;QACf,YAAwC,KAAmC;YAAnC,UAAK,GAAL,KAAK,CAA8B;QAAG,CAAC;QAE/E,SAAS,CAAC,OAAyB,EAAE,IAAiB;YACpD,MAAM,UAAU,GAAG,6BAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YACtD,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,EAA8B,CAAA;YAC/D,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;YACtB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;QACtB,CAAC;KACF,CAAA;IATK,WAAW;QADhB,IAAA,mBAAU,GAAE;QAEE,mBAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;;OAD1B,WAAW,CAShB;IAED,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE;QACzC,QAAQ,EAAE,KAAK;QACf,+EAA+E;QAC/E,KAAK,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,iBAAiB;KACrD,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC;AA1BD,0CA0BC"}
|
|
@@ -5,27 +5,34 @@ const decorators_1 = require("../decorators");
|
|
|
5
5
|
const hooks_1 = require("../hooks");
|
|
6
6
|
function createHookProvider(hookType, ...DTOClass) {
|
|
7
7
|
return DTOClass.reduce((p, cls) => {
|
|
8
|
-
if (p) {
|
|
8
|
+
if (p && p.length > 0) {
|
|
9
9
|
return p;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
11
|
+
const maybeHooks = (0, decorators_1.getHooksForType)(hookType, cls);
|
|
12
|
+
if (maybeHooks) {
|
|
13
|
+
return [
|
|
14
|
+
...maybeHooks,
|
|
15
|
+
{
|
|
16
|
+
provide: (0, hooks_1.getHookToken)(hookType, cls),
|
|
17
|
+
useFactory: (...providers) => providers,
|
|
18
|
+
inject: maybeHooks
|
|
19
|
+
}
|
|
20
|
+
];
|
|
14
21
|
}
|
|
15
|
-
return
|
|
16
|
-
},
|
|
22
|
+
return [];
|
|
23
|
+
}, []);
|
|
17
24
|
}
|
|
18
25
|
function getHookProviders(opts) {
|
|
19
26
|
const { DTOClass, CreateDTOClass = DTOClass, UpdateDTOClass = DTOClass } = opts;
|
|
20
27
|
return [
|
|
21
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_CREATE_ONE, CreateDTOClass, DTOClass),
|
|
22
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_CREATE_MANY, CreateDTOClass, DTOClass),
|
|
23
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_UPDATE_ONE, UpdateDTOClass, DTOClass),
|
|
24
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_UPDATE_MANY, UpdateDTOClass, DTOClass),
|
|
25
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_DELETE_ONE, DTOClass),
|
|
26
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_DELETE_MANY, DTOClass),
|
|
27
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_QUERY_MANY, DTOClass),
|
|
28
|
-
createHookProvider(hooks_1.HookTypes.BEFORE_FIND_ONE, DTOClass)
|
|
28
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_CREATE_ONE, CreateDTOClass, DTOClass),
|
|
29
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_CREATE_MANY, CreateDTOClass, DTOClass),
|
|
30
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_UPDATE_ONE, UpdateDTOClass, DTOClass),
|
|
31
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_UPDATE_MANY, UpdateDTOClass, DTOClass),
|
|
32
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_DELETE_ONE, DTOClass),
|
|
33
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_DELETE_MANY, DTOClass),
|
|
34
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_QUERY_MANY, DTOClass),
|
|
35
|
+
...createHookProvider(hooks_1.HookTypes.BEFORE_FIND_ONE, DTOClass)
|
|
29
36
|
].filter((p) => !!p);
|
|
30
37
|
}
|
|
31
38
|
const createHookProviders = (opts) => opts.reduce((ps, opt) => [...ps, ...getHookProviders(opt)], []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.provider.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/providers/hook.provider.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"hook.provider.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/providers/hook.provider.ts"],"names":[],"mappings":";;;AAGA,8CAA+C;AAC/C,oCAAkD;AASlD,SAAS,kBAAkB,CAAC,QAAmB,EAAE,GAAG,QAA0B;IAC5E,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAyB,EAAE,GAAG,EAAE,EAAE;QACxD,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,OAAO,CAAC,CAAA;SACT;QACD,MAAM,UAAU,GAAG,IAAA,4BAAe,EAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;QACjD,IAAI,UAAU,EAAE;YACd,OAAO;gBACL,GAAG,UAAU;gBACb;oBACE,OAAO,EAAE,IAAA,oBAAY,EAAC,QAAQ,EAAE,GAAG,CAAC;oBACpC,UAAU,EAAE,CAAC,GAAG,SAAqB,EAAE,EAAE,CAAC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1 = require("tslib");
|
|
|
5
5
|
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
6
6
|
const flattenRelations = (relationOptions) => Object.keys(relationOptions).map((name) => ({ dtoName: name, ...relationOptions[name] }));
|
|
7
7
|
exports.flattenRelations = flattenRelations;
|
|
8
|
-
const removeRelationOpts = (opts) => (0, lodash_omit_1.default)(opts, 'DTO', 'keys', 'nullable', 'dtoName', 'relationName', 'disableRead', '
|
|
8
|
+
const removeRelationOpts = (opts) => (0, lodash_omit_1.default)(opts, 'DTO', 'keys', 'nullable', 'dtoName', 'relationName', 'disableRead', 'update', 'remove', 'description');
|
|
9
9
|
exports.removeRelationOpts = removeRelationOpts;
|
|
10
10
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/helpers.ts"],"names":[],"mappings":";;;;AAAA,sEAA8B;AAKvB,MAAM,gBAAgB,GAAG,CAC9B,eAAoC,EAC9B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAFvF,QAAA,gBAAgB,oBAEuE;AAE7F,MAAM,kBAAkB,GAAG,CAChC,IAA+E,EAC3D,EAAE,CACtB,IAAA,qBAAI,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/helpers.ts"],"names":[],"mappings":";;;;AAAA,sEAA8B;AAKvB,MAAM,gBAAgB,GAAG,CAC9B,eAAoC,EAC9B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAFvF,QAAA,gBAAgB,oBAEuE;AAE7F,MAAM,kBAAkB,GAAG,CAChC,IAA+E,EAC3D,EAAE,CACtB,IAAA,qBAAI,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;AAHvG,QAAA,kBAAkB,sBAGqF"}
|
|
@@ -3,6 +3,7 @@ import { Class } from '@ptc-org/nestjs-query-core';
|
|
|
3
3
|
import { AuthorizerOptions } from '../../auth';
|
|
4
4
|
import { DTONamesOpts } from '../../common';
|
|
5
5
|
import { ResolverMethodOpts } from '../../decorators';
|
|
6
|
+
import { ResolverRelationMethodOpts } from '../../decorators/resolver-method.decorator';
|
|
6
7
|
import { ConnectionOptions, QueryArgsTypeOpts } from '../../types';
|
|
7
8
|
export type ReferencesKeys<DTO, Reference> = {
|
|
8
9
|
[F in keyof Reference]?: keyof DTO;
|
|
@@ -39,25 +40,6 @@ export type ResolverRelation<Relation> = {
|
|
|
39
40
|
* Disable read relation graphql endpoints
|
|
40
41
|
*/
|
|
41
42
|
disableRead?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Disable update relation graphql endpoints
|
|
44
|
-
* @deprecated use .update.disabled instead
|
|
45
|
-
*/
|
|
46
|
-
disableUpdate?: boolean;
|
|
47
|
-
update?: Pick<ResolverRelation<Relation>, 'description'> & ResolverMethodOpts;
|
|
48
|
-
/**
|
|
49
|
-
* Disable remove relation graphql endpoints
|
|
50
|
-
* @deprecated use .remove.disabled instead
|
|
51
|
-
*/
|
|
52
|
-
disableRemove?: boolean;
|
|
53
|
-
remove?: Pick<ResolverRelation<Relation>, 'description'> & ResolverMethodOpts;
|
|
54
|
-
/**
|
|
55
|
-
* Enable aggregation queries.
|
|
56
|
-
*/
|
|
57
|
-
enableAggregate?: boolean;
|
|
58
|
-
aggregate?: Pick<ResolverRelation<Relation>, 'description'> & Omit<ResolverMethodOpts, 'disabled'> & {
|
|
59
|
-
enabled?: boolean;
|
|
60
|
-
};
|
|
61
43
|
/**
|
|
62
44
|
* Enable look ahead mode, will join and select the relation when queried.
|
|
63
45
|
*/
|
|
@@ -77,6 +59,13 @@ export type ResolverRelation<Relation> = {
|
|
|
77
59
|
*/
|
|
78
60
|
description?: string;
|
|
79
61
|
complexity?: Complexity;
|
|
62
|
+
update?: Pick<ResolverRelation<Relation>, 'description'> & ResolverRelationMethodOpts;
|
|
63
|
+
remove?: Pick<ResolverRelation<Relation>, 'description'> & ResolverRelationMethodOpts;
|
|
64
|
+
/**
|
|
65
|
+
* Enable aggregation queries.
|
|
66
|
+
*/
|
|
67
|
+
enableAggregate?: boolean;
|
|
68
|
+
aggregate?: Pick<ResolverRelation<Relation>, 'description'> & ResolverRelationMethodOpts;
|
|
80
69
|
auth?: AuthorizerOptions<Relation>;
|
|
81
70
|
} & DTONamesOpts & ResolverMethodOpts & QueryArgsTypeOpts<Relation> & Pick<ConnectionOptions, 'enableTotalCount'>;
|
|
82
71
|
export type RelationTypeMap<RT> = Record<string, RT>;
|
|
@@ -7,6 +7,7 @@ const graphql_1 = require("@nestjs/graphql");
|
|
|
7
7
|
const auth_1 = require("../../auth");
|
|
8
8
|
const common_1 = require("../../common");
|
|
9
9
|
const decorators_1 = require("../../decorators");
|
|
10
|
+
const resolver_relation_mutation_decorator_1 = require("../../decorators/resolver-relation-mutation.decorator");
|
|
10
11
|
const interceptors_1 = require("../../interceptors");
|
|
11
12
|
const types_1 = require("../../types");
|
|
12
13
|
const helpers_1 = require("../helpers");
|
|
@@ -14,11 +15,10 @@ const resolver_interface_1 = require("../resolver.interface");
|
|
|
14
15
|
const helpers_2 = require("./helpers");
|
|
15
16
|
const RemoveOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
16
17
|
var _a;
|
|
17
|
-
|
|
18
|
-
if (relation.disableRemove || relation.remove?.disabled) {
|
|
18
|
+
if (!relation.remove?.enabled) {
|
|
19
19
|
return Base;
|
|
20
20
|
}
|
|
21
|
-
const commonResolverOpts =
|
|
21
|
+
const commonResolverOpts = (0, helpers_2.removeRelationOpts)(relation);
|
|
22
22
|
const relationDTO = relation.DTO;
|
|
23
23
|
const dtoNames = (0, common_1.getDTONames)(DTOClass);
|
|
24
24
|
const { baseNameLower, baseName } = (0, common_1.getDTONames)(relationDTO, { dtoName: relation.dtoName });
|
|
@@ -40,9 +40,10 @@ const RemoveOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
tslib_1.__decorate([
|
|
43
|
-
(0,
|
|
44
|
-
description: relation.remove?.description
|
|
45
|
-
|
|
43
|
+
(0, resolver_relation_mutation_decorator_1.ResolverRelationMutation)(() => DTOClass, {
|
|
44
|
+
description: relation.remove?.description,
|
|
45
|
+
complexity: relation.remove?.complexity
|
|
46
|
+
}, (0, common_1.mergeBaseResolverOpts)(relation.remove, commonResolverOpts), {
|
|
46
47
|
interceptors: [(0, interceptors_1.AuthorizerInterceptor)(DTOClass)]
|
|
47
48
|
}),
|
|
48
49
|
tslib_1.__param(0, (0, graphql_1.Args)()),
|
|
@@ -61,11 +62,10 @@ const RemoveOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
61
62
|
};
|
|
62
63
|
const RemoveManyRelationsMixin = (DTOClass, relation) => (Base) => {
|
|
63
64
|
var _a;
|
|
64
|
-
|
|
65
|
-
if (relation.disableRemove || relation.remove?.disabled) {
|
|
65
|
+
if (!relation.remove?.enabled) {
|
|
66
66
|
return Base;
|
|
67
67
|
}
|
|
68
|
-
const commonResolverOpts =
|
|
68
|
+
const commonResolverOpts = (0, helpers_2.removeRelationOpts)(relation);
|
|
69
69
|
const relationDTO = relation.DTO;
|
|
70
70
|
const dtoNames = (0, common_1.getDTONames)(DTOClass);
|
|
71
71
|
const { pluralBaseNameLower, pluralBaseName } = (0, common_1.getDTONames)(relationDTO, { dtoName: relation.dtoName });
|
|
@@ -87,9 +87,10 @@ const RemoveManyRelationsMixin = (DTOClass, relation) => (Base) => {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
tslib_1.__decorate([
|
|
90
|
-
(0,
|
|
91
|
-
description: relation.remove?.description
|
|
92
|
-
|
|
90
|
+
(0, resolver_relation_mutation_decorator_1.ResolverRelationMutation)(() => DTOClass, {
|
|
91
|
+
description: relation.remove?.description,
|
|
92
|
+
complexity: relation.remove?.complexity
|
|
93
|
+
}, (0, common_1.mergeBaseResolverOpts)(relation.remove, commonResolverOpts), {
|
|
93
94
|
interceptors: [(0, interceptors_1.AuthorizerInterceptor)(DTOClass)]
|
|
94
95
|
}),
|
|
95
96
|
tslib_1.__param(0, (0, graphql_1.Args)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-relations.resolver.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/remove-relations.resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAChD,6CAAqE;AAGrE,qCAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"remove-relations.resolver.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/remove-relations.resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAChD,6CAAqE;AAGrE,qCAA2C;AAC3C,yCAAiE;AACjE,iDAAiE;AACjE,gHAAgG;AAChG,qDAA0D;AAC1D,uCAAqF;AACrF,wCAAiD;AACjD,8DAA4E;AAC5E,uCAAgE;AAGhE,MAAM,sBAAsB,GAC1B,CAAgB,QAAoB,EAAE,QAAoC,EAAE,EAAE,CAC9E,CAA6E,IAAO,EAAK,EAAE;;IACzF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,E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AAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;OACzC,KAAK,CAuBV;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAEI,MAAM,oBAAoB,GAC/B,CAAM,QAAoB,EAAE,SAAwB,EAAE,EAAE,CACxD,CAA6E,IAAO,EAAK,EAAE;IACzF,MAAM,aAAa,GAAG,IAAA,0BAAgB,EAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IAC5D,MAAM,YAAY,GAAG,IAAA,0BAAgB,EAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;IAE1D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;IACjG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA;AARU,QAAA,oBAAoB,wBAQ9B;AAEI,MAAM,uBAAuB,GAAG,CAIrC,QAAoB,EACpB,SAAwB,EACS,EAAE,CAAC,IAAA,4BAAoB,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,wCAAmB,CAAC,CAAA;AANvF,QAAA,uBAAuB,2BAMgE"}
|
|
@@ -7,6 +7,7 @@ const graphql_1 = require("@nestjs/graphql");
|
|
|
7
7
|
const auth_1 = require("../../auth");
|
|
8
8
|
const common_1 = require("../../common");
|
|
9
9
|
const decorators_1 = require("../../decorators");
|
|
10
|
+
const resolver_relation_mutation_decorator_1 = require("../../decorators/resolver-relation-mutation.decorator");
|
|
10
11
|
const interceptors_1 = require("../../interceptors");
|
|
11
12
|
const types_1 = require("../../types");
|
|
12
13
|
const helpers_1 = require("../helpers");
|
|
@@ -14,11 +15,10 @@ const resolver_interface_1 = require("../resolver.interface");
|
|
|
14
15
|
const helpers_2 = require("./helpers");
|
|
15
16
|
const UpdateOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
16
17
|
var _a;
|
|
17
|
-
|
|
18
|
-
if (relation.disableUpdate || relation.update?.disabled) {
|
|
18
|
+
if (!relation.update?.enabled) {
|
|
19
19
|
return Base;
|
|
20
20
|
}
|
|
21
|
-
const commonResolverOpts =
|
|
21
|
+
const commonResolverOpts = (0, helpers_2.removeRelationOpts)(relation);
|
|
22
22
|
const relationDTO = relation.DTO;
|
|
23
23
|
const dtoNames = (0, common_1.getDTONames)(DTOClass);
|
|
24
24
|
const { baseNameLower, baseName } = (0, common_1.getDTONames)(relationDTO, { dtoName: relation.dtoName });
|
|
@@ -40,9 +40,10 @@ const UpdateOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
tslib_1.__decorate([
|
|
43
|
-
(0,
|
|
44
|
-
description: relation.update?.description
|
|
45
|
-
|
|
43
|
+
(0, resolver_relation_mutation_decorator_1.ResolverRelationMutation)(() => DTOClass, {
|
|
44
|
+
description: relation.update?.description,
|
|
45
|
+
complexity: relation.update?.complexity
|
|
46
|
+
}, (0, common_1.mergeBaseResolverOpts)(relation.update, commonResolverOpts), {
|
|
46
47
|
interceptors: [(0, interceptors_1.AuthorizerInterceptor)(DTOClass)]
|
|
47
48
|
}),
|
|
48
49
|
tslib_1.__param(0, (0, graphql_1.Args)()),
|
|
@@ -61,11 +62,10 @@ const UpdateOneRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
61
62
|
};
|
|
62
63
|
const UpdateManyRelationMixin = (DTOClass, relation) => (Base) => {
|
|
63
64
|
var _a, _b;
|
|
64
|
-
|
|
65
|
-
if (relation.disableUpdate || relation.update?.disabled) {
|
|
65
|
+
if (!relation.update?.enabled) {
|
|
66
66
|
return Base;
|
|
67
67
|
}
|
|
68
|
-
const commonResolverOpts =
|
|
68
|
+
const commonResolverOpts = (0, helpers_2.removeRelationOpts)(relation);
|
|
69
69
|
const relationDTO = relation.DTO;
|
|
70
70
|
const dtoNames = (0, common_1.getDTONames)(DTOClass);
|
|
71
71
|
const { pluralBaseNameLower, pluralBaseName } = (0, common_1.getDTONames)(relationDTO, { dtoName: relation.dtoName });
|
|
@@ -101,9 +101,10 @@ const UpdateManyRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
tslib_1.__decorate([
|
|
104
|
-
(0,
|
|
105
|
-
description: relation.update?.description
|
|
106
|
-
|
|
104
|
+
(0, resolver_relation_mutation_decorator_1.ResolverRelationMutation)(() => DTOClass, {
|
|
105
|
+
description: relation.update?.description,
|
|
106
|
+
complexity: relation.update?.complexity
|
|
107
|
+
}, (0, common_1.mergeBaseResolverOpts)(relation.update, commonResolverOpts), {
|
|
107
108
|
interceptors: [(0, interceptors_1.AuthorizerInterceptor)(DTOClass)]
|
|
108
109
|
}),
|
|
109
110
|
tslib_1.__param(0, (0, graphql_1.Args)()),
|
|
@@ -116,7 +117,9 @@ const UpdateManyRelationMixin = (DTOClass, relation) => (Base) => {
|
|
|
116
117
|
tslib_1.__metadata("design:returntype", Promise)
|
|
117
118
|
], UpdateManyMixin.prototype, _a, null);
|
|
118
119
|
tslib_1.__decorate([
|
|
119
|
-
(0,
|
|
120
|
+
(0, resolver_relation_mutation_decorator_1.ResolverRelationMutation)(() => DTOClass, {
|
|
121
|
+
complexity: relation.update?.complexity
|
|
122
|
+
}, (0, common_1.mergeBaseResolverOpts)(relation.update, commonResolverOpts), {
|
|
120
123
|
interceptors: [(0, interceptors_1.AuthorizerInterceptor)(DTOClass)]
|
|
121
124
|
}),
|
|
122
125
|
tslib_1.__param(0, (0, graphql_1.Args)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-relations.resolver.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/update-relations.resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAChD,6CAAqE;AAGrE,qCAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"update-relations.resolver.js","sourceRoot":"","sources":["../../../../../../packages/query-graphql/src/resolvers/relations/update-relations.resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAChD,6CAAqE;AAGrE,qCAA2C;AAC3C,yCAAiE;AACjE,iDAAiE;AACjE,gHAAgG;AAChG,qDAA0D;AAC1D,uCAAqF;AACrF,wCAAiD;AACjD,8DAA4E;AAC5E,uCAAgE;AAGhE,MAAM,sBAAsB,GAC1B,CAAgB,QAAoB,EAAE,QAAoC,EAAE,EAAE,CAC9E,CAA6E,IAAO,EAAK,EAAE;;IACzF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE;QAC7B,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,kBAAkB,GAAG,IAAA,4BAAkB,EAAC,QAAQ,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAA;IAChC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAA,oBAAW,EAAC,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3F,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,IAAI,aAAa,CAAA;IAG3D,IAAM,GAAG,GAAT,MAAM,GAAI,SAAQ,IAAA,yBAAiB,EAAC,QAAQ,EAAE,WAAW,CAAC;KAAG,CAAA;IAAvD,GAAG;QADR,IAAA,mBAAS,EAAC,MAAM,QAAQ,KAAK,QAAQ,CAAC,QAAQ,OAAO,CAAC;OACjD,GAAG,CAAoD;IAG7D,IAAM,OAAO,GAAb,MAAM,OAAQ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AAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC1F,CAAC,CAAA;AARU,QAAA,oBAAoB,wBAQ9B;AAEI,MAAM,uBAAuB,GAAG,CAIrC,QAAoB,EACpB,SAAwB,EACS,EAAE,CAAC,IAAA,4BAAoB,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,wCAAmB,CAAC,CAAA;AANvF,QAAA,uBAAuB,2BAMgE"}
|
|
@@ -39,6 +39,7 @@ const getOrCreatePageInfoType = () => {
|
|
|
39
39
|
tslib_1.__metadata("design:type", String)
|
|
40
40
|
], PageInfoTypeImpl.prototype, "endCursor", void 0);
|
|
41
41
|
PageInfoTypeImpl = tslib_1.__decorate([
|
|
42
|
+
(0, graphql_1.Directive)('@shareable'),
|
|
42
43
|
(0, graphql_1.ObjectType)('PageInfo'),
|
|
43
44
|
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean, String, String])
|
|
44
45
|
], PageInfoTypeImpl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-info.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/cursor/page-info.type.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"page-info.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/cursor/page-info.type.ts"],"names":[],"mappings":";;;;AAAA,6CAA8D;AAG9D,uDAAkF;AAYlF,gBAAgB;AAChB,IAAI,YAAY,GAA+B,IAAI,CAAA;AACnD,0EAA0E;AACnE,MAAM,uBAAuB,GAAG,GAA4B,EAAE;IACnE,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAA;KACpB;IAED,IAEM,gBAAgB,GAFtB,MAEM,gBAAgB;QACpB,YACE,WAAoB,EACpB,eAAwB,EACxB,WAA6C,EAC7C,SAA2C;YAE3C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;YAC9B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;YACtC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;YAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC5B,CAAC;KAgBF,CAAA;IAdC;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;yDACxF;IAEpB;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;;6DACtF;IAExB;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,sCAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;yDACnE;IAE9C;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,sCAAsB,EAAE;YACnC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,yCAAyC;SACvD,CAAC;;uDAC0C;IA1BxC,gBAAgB;QAFrB,IAAA,mBAAS,EAAC,YAAY,CAAC;QACvB,IAAA,oBAAU,EAAC,UAAU,CAAC;;OACjB,gBAAgB,CA2BrB;IAED,YAAY,GAAG,gBAAgB,CAAA;IAC/B,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAtCY,QAAA,uBAAuB,2BAsCnC"}
|
|
@@ -58,6 +58,7 @@ function getOrCreateOffsetConnectionType(TItemClass, opts) {
|
|
|
58
58
|
tslib_1.__metadata("design:paramtypes", [])
|
|
59
59
|
], AbstractConnection.prototype, "totalCount", null);
|
|
60
60
|
AbstractConnection = AbstractConnection_1 = tslib_1.__decorate([
|
|
61
|
+
(0, graphql_1.Directive)('@shareable'),
|
|
61
62
|
(0, graphql_1.ObjectType)(connectionName),
|
|
62
63
|
tslib_1.__metadata("design:paramtypes", [Object, Array, Function])
|
|
63
64
|
], AbstractConnection);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset-connection.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/offset/offset-connection.type.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"offset-connection.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/offset/offset-connection.type.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,6CAAmE;AACnE,kEAAuE;AAEvE,4CAAsD;AACtD,oDAA4C;AAW5C,mEAAuE;AACvE,mCAAqC;AAErC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,gCAAuB,CAAC,4BAA4B,CAAC,CAAC,CAAA;AAErG,MAAM,SAAS,GAAG,IAAI,gCAAY,CAAC,qCAAqC,CAAC,CAAA;AAEzE,SAAS,yBAAyB,CAAM,QAAoB,EAAE,IAA6B;IACzF,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IAC/B,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAA;KACtB;IACD,MAAM,OAAO,GAAG,IAAA,6BAAoB,EAAC,QAAQ,EAAE,sCAAsC,CAAC,CAAA;IACtF,OAAO,GAAG,OAAO,kBAAkB,CAAA;AACrC,CAAC;AAED,SAAgB,+BAA+B,CAC7C,UAAsB,EACtB,IAA6B;IAE7B,MAAM,cAAc,GAAG,yBAAyB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAClE,OAAO,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,EAAE;;QACxD,MAAM,KAAK,GAAG,IAAA,mBAAW,GAAO,CAAA;QAChC,MAAM,GAAG,GAAG,IAAA,qDAA6B,GAAE,CAAA;QAE3C,IAEM,kBAAkB,0BAFxB,MAEM,kBAAkB;YACtB,MAAM,KAAK,WAAW;gBACpB,OAAO,IAAI,CAAA;YACb,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,iBAAiB,C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AqCvB;QAED,OAAO,kBAAkB,CAAA;IAC3B,CAAC,CAAC,CAAA;AACJ,CAAC;AApDD,0EAoDC"}
|
|
@@ -25,6 +25,7 @@ const getOrCreateOffsetPageInfoType = () => {
|
|
|
25
25
|
tslib_1.__metadata("design:type", Boolean)
|
|
26
26
|
], PageInfoTypeImpl.prototype, "hasPreviousPage", void 0);
|
|
27
27
|
PageInfoTypeImpl = tslib_1.__decorate([
|
|
28
|
+
(0, graphql_1.Directive)('@shareable'),
|
|
28
29
|
(0, graphql_1.ObjectType)('OffsetPageInfo'),
|
|
29
30
|
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean])
|
|
30
31
|
], PageInfoTypeImpl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset-page-info.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/offset/offset-page-info.type.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"offset-page-info.type.js","sourceRoot":"","sources":["../../../../../../../packages/query-graphql/src/types/connection/offset/offset-page-info.type.ts"],"names":[],"mappings":";;;;AAAA,6CAA8D;AAS9D,gBAAgB;AAChB,IAAI,YAAY,GAAqC,IAAI,CAAA;AACzD,0EAA0E;AACnE,MAAM,6BAA6B,GAAG,GAAkC,EAAE;IAC/E,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAA;KACpB;IAED,IAEM,gBAAgB,GAFtB,MAEM,gBAAgB;QACpB,YAAY,WAAoB,EAAE,eAAwB;YACxD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;YAC9B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACxC,CAAC;KAOF,CAAA;IALC;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;yDACxF;IAEpB;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;;6DACtF;IAVpB,gBAAgB;QAFrB,IAAA,mBAAS,EAAC,YAAY,CAAC;QACvB,IAAA,oBAAU,EAAC,gBAAgB,CAAC;;OACvB,gBAAgB,CAWrB;IAED,YAAY,GAAG,gBAAgB,CAAA;IAC/B,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAtBY,QAAA,6BAA6B,iCAsBzC"}
|
|
@@ -16,6 +16,7 @@ const DeleteManyResponseType = () => {
|
|
|
16
16
|
tslib_1.__metadata("design:type", Number)
|
|
17
17
|
], DeleteManyResponseTypeImpl.prototype, "deletedCount", void 0);
|
|
18
18
|
DeleteManyResponseTypeImpl = tslib_1.__decorate([
|
|
19
|
+
(0, graphql_1.Directive)('@shareable'),
|
|
19
20
|
(0, graphql_1.ObjectType)('DeleteManyResponse')
|
|
20
21
|
], DeleteManyResponseTypeImpl);
|
|
21
22
|
deleteManyResponseType = DeleteManyResponseTypeImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-many-reponse.type.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/types/delete-many-reponse.type.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"delete-many-reponse.type.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/types/delete-many-reponse.type.ts"],"names":[],"mappings":";;;;AAAA,6CAAmE;AAGnE,gBAAgB;AAChB,IAAI,sBAAsB,GAAqC,IAAI,CAAA;AAE5D,MAAM,sBAAsB,GAAG,GAA8B,EAAE;IACpE,IAAI,sBAAsB,EAAE;QAC1B,OAAO,sBAAsB,CAAA;KAC9B;IAGD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;KAG/B,CAAA;IAFC;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,aAAG,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;oEAC/C;IAFjB,0BAA0B;QAF/B,IAAA,mBAAS,EAAC,YAAY,CAAC;QACvB,IAAA,oBAAU,EAAC,oBAAoB,CAAC;OAC3B,0BAA0B,CAG/B;IAED,sBAAsB,GAAG,0BAA0B,CAAA;IACnD,OAAO,sBAAsB,CAAA;AAC/B,CAAC,CAAA;AAbY,QAAA,sBAAsB,0BAalC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReturnTypeFunc } from '@nestjs/graphql';
|
|
1
|
+
import { ReturnTypeFunc, ReturnTypeFuncValue } from '@nestjs/graphql';
|
|
2
2
|
import { Class, FilterComparisonOperators, FilterFieldComparison } from '@ptc-org/nestjs-query-core';
|
|
3
3
|
type FilterComparisonOptions<T> = {
|
|
4
4
|
FieldType: Class<T>;
|
|
5
5
|
fieldName: string;
|
|
6
6
|
allowedComparisons?: FilterComparisonOperators<T>[];
|
|
7
|
-
returnTypeFunc?: ReturnTypeFunc
|
|
7
|
+
returnTypeFunc?: ReturnTypeFunc<ReturnTypeFuncValue>;
|
|
8
8
|
};
|
|
9
9
|
/** @internal */
|
|
10
10
|
export declare function createFilterComparisonType<T>(options: FilterComparisonOptions<T>): Class<FilterFieldComparison<T>>;
|
|
@@ -16,6 +16,7 @@ const UpdateManyResponseType = () => {
|
|
|
16
16
|
tslib_1.__metadata("design:type", Number)
|
|
17
17
|
], UpdateManyResponseTypeImpl.prototype, "updatedCount", void 0);
|
|
18
18
|
UpdateManyResponseTypeImpl = tslib_1.__decorate([
|
|
19
|
+
(0, graphql_1.Directive)('@shareable'),
|
|
19
20
|
(0, graphql_1.ObjectType)('UpdateManyResponse')
|
|
20
21
|
], UpdateManyResponseTypeImpl);
|
|
21
22
|
updateManyResponseType = UpdateManyResponseTypeImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-many-response.type.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/types/update-many-response.type.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"update-many-response.type.js","sourceRoot":"","sources":["../../../../../packages/query-graphql/src/types/update-many-response.type.ts"],"names":[],"mappings":";;;;AAAA,6CAAmE;AAGnE,gBAAgB;AAChB,IAAI,sBAAsB,GAAqC,IAAI,CAAA;AAE5D,MAAM,sBAAsB,GAAG,GAA8B,EAAE;IACpE,IAAI,sBAAsB,EAAE;QAC1B,OAAO,sBAAsB,CAAA;KAC9B;IAGD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;KAG/B,CAAA;IAFC;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,aAAG,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;oEAC/C;IAFjB,0BAA0B;QAF/B,IAAA,mBAAS,EAAC,YAAY,CAAC;QACvB,IAAA,oBAAU,EAAC,oBAAoB,CAAC;OAC3B,0BAA0B,CAG/B;IAED,sBAAsB,GAAG,0BAA0B,CAAA;IACnD,OAAO,sBAAsB,CAAA;AAC/B,CAAC,CAAA;AAbY,QAAA,sBAAsB,0BAalC"}
|