@webiny/handler-graphql 0.0.0-unstable.aad28a72ae → 0.0.0-unstable.ac6ebf63c6
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/README.md +9 -5
- package/ResolverDecoration.d.ts +6 -0
- package/ResolverDecoration.js +19 -0
- package/ResolverDecoration.js.map +1 -0
- package/builtInTypes/AnyScalar.d.ts +1 -1
- package/builtInTypes/AnyScalar.js +4 -12
- package/builtInTypes/AnyScalar.js.map +1 -1
- package/builtInTypes/DateScalar.d.ts +1 -1
- package/builtInTypes/DateScalar.js +10 -20
- package/builtInTypes/DateScalar.js.map +1 -1
- package/builtInTypes/DateTimeScalar.d.ts +1 -1
- package/builtInTypes/DateTimeScalar.js +10 -20
- package/builtInTypes/DateTimeScalar.js.map +1 -1
- package/builtInTypes/DateTimeZScalar.d.ts +1 -1
- package/builtInTypes/DateTimeZScalar.js +10 -29
- package/builtInTypes/DateTimeZScalar.js.map +1 -1
- package/builtInTypes/IconScalar.d.ts +10 -0
- package/builtInTypes/IconScalar.js +93 -0
- package/builtInTypes/IconScalar.js.map +1 -0
- package/builtInTypes/JsonScalar.d.ts +1 -1
- package/builtInTypes/JsonScalar.js +3 -10
- package/builtInTypes/JsonScalar.js.map +1 -1
- package/builtInTypes/LongScalar.d.ts +2 -1
- package/builtInTypes/LongScalar.js +47 -9
- package/builtInTypes/LongScalar.js.map +1 -1
- package/builtInTypes/NumberScalar.d.ts +1 -1
- package/builtInTypes/NumberScalar.js +14 -30
- package/builtInTypes/NumberScalar.js.map +1 -1
- package/builtInTypes/RefInputScalar.d.ts +1 -1
- package/builtInTypes/RefInputScalar.js +40 -29
- package/builtInTypes/RefInputScalar.js.map +1 -1
- package/builtInTypes/TimeScalar.d.ts +1 -1
- package/builtInTypes/TimeScalar.js +11 -29
- package/builtInTypes/TimeScalar.js.map +1 -1
- package/builtInTypes/index.d.ts +10 -9
- package/builtInTypes/index.js +12 -122
- package/builtInTypes/index.js.map +1 -1
- package/createGraphQLHandler.d.ts +3 -3
- package/createGraphQLHandler.js +59 -48
- package/createGraphQLHandler.js.map +1 -1
- package/createGraphQLSchema.d.ts +4 -2
- package/createGraphQLSchema.js +76 -46
- package/createGraphQLSchema.js.map +1 -1
- package/createRequestBody.d.ts +2 -0
- package/createRequestBody.js +26 -0
- package/createRequestBody.js.map +1 -0
- package/createResolverDecorator.d.ts +2 -0
- package/createResolverDecorator.js +5 -0
- package/createResolverDecorator.js.map +1 -0
- package/debugPlugins.d.ts +2 -2
- package/debugPlugins.js +5 -19
- package/debugPlugins.js.map +1 -1
- package/errors.js +3 -14
- package/errors.js.map +1 -1
- package/exports/api/graphql.d.ts +2 -0
- package/exports/api/graphql.js +4 -0
- package/exports/api/graphql.js.map +1 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.d.ts +16 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.js +64 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.js.map +1 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.d.ts +13 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.js +29 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.js.map +1 -0
- package/features/GraphQLSchemaBuilder/abstractions.d.ts +34 -0
- package/features/GraphQLSchemaBuilder/abstractions.js +5 -0
- package/features/GraphQLSchemaBuilder/abstractions.js.map +1 -0
- package/features/GraphQLSchemaBuilder/feature.d.ts +1 -0
- package/features/GraphQLSchemaBuilder/feature.js +10 -0
- package/features/GraphQLSchemaBuilder/feature.js.map +1 -0
- package/graphql/abstractions.core.d.ts +11 -0
- package/graphql/abstractions.core.js +10 -0
- package/graphql/abstractions.core.js.map +1 -0
- package/graphql/abstractions.d.ts +2 -0
- package/graphql/abstractions.js +4 -0
- package/graphql/abstractions.js.map +1 -0
- package/graphql/abstractions.public.d.ts +19 -0
- package/graphql/abstractions.public.js +12 -0
- package/graphql/abstractions.public.js.map +1 -0
- package/index.d.ts +10 -5
- package/index.js +13 -57
- package/index.js.map +1 -1
- package/interceptConsole.js +9 -20
- package/interceptConsole.js.map +1 -1
- package/package.json +23 -25
- package/plugins/GraphQLSchemaPlugin.d.ts +13 -5
- package/plugins/GraphQLSchemaPlugin.js +15 -20
- package/plugins/GraphQLSchemaPlugin.js.map +1 -1
- package/plugins/index.d.ts +1 -1
- package/plugins/index.js +2 -17
- package/plugins/index.js.map +1 -1
- package/processRequestBody.d.ts +4 -5
- package/processRequestBody.js +19 -23
- package/processRequestBody.js.map +1 -1
- package/responses.js +10 -51
- package/responses.js.map +1 -1
- package/types.d.ts +20 -13
- package/types.js +2 -4
- package/types.js.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +3 -0
- package/utils/index.js.map +1 -0
- package/utils/resolve.d.ts +21 -0
- package/utils/resolve.js +19 -0
- package/utils/resolve.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["abstractions.ts"],"sourcesContent":["export * from \"./abstractions.core.js\";\nexport * from \"./abstractions.public.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Resolvers as IResolvers, TypeDefs as ITypeDefs, ResolverDecorators as IResolverDecorators } from "../types.js";
|
|
2
|
+
import type { GraphQLSchemaBuilder } from "../features/GraphQLSchemaBuilder/abstractions.js";
|
|
3
|
+
export interface IGraphQLSchema {
|
|
4
|
+
typeDefs?: ITypeDefs;
|
|
5
|
+
resolvers?: IResolvers<any>;
|
|
6
|
+
resolverDecorators?: IResolverDecorators;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* GraphQLSchemaFactory
|
|
10
|
+
*/
|
|
11
|
+
export interface IGraphQLSchemaFactory {
|
|
12
|
+
execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;
|
|
13
|
+
}
|
|
14
|
+
export declare const GraphQLSchemaFactory: import("@webiny/di").Abstraction<IGraphQLSchemaFactory>;
|
|
15
|
+
export declare namespace GraphQLSchemaFactory {
|
|
16
|
+
type Interface = IGraphQLSchemaFactory;
|
|
17
|
+
type SchemaBuilder = GraphQLSchemaBuilder.Interface;
|
|
18
|
+
type Return = Promise<GraphQLSchemaBuilder.Interface>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains abstraction for use by third party developers.
|
|
3
|
+
*/
|
|
4
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* GraphQLSchemaFactory
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const GraphQLSchemaFactory = createAbstraction("GraphQLSchemaFactory");
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=abstractions.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","GraphQLSchemaFactory"],"sources":["abstractions.public.ts"],"sourcesContent":["/**\n * This file contains abstraction for use by third party developers.\n */\nimport { createAbstraction } from \"@webiny/feature/api\";\nimport type {\n Resolvers as IResolvers,\n TypeDefs as ITypeDefs,\n ResolverDecorators as IResolverDecorators\n} from \"~/types.js\";\nimport type { GraphQLSchemaBuilder } from \"~/features/GraphQLSchemaBuilder/abstractions.js\";\n\nexport interface IGraphQLSchema {\n typeDefs?: ITypeDefs;\n resolvers?: IResolvers<any>;\n resolverDecorators?: IResolverDecorators;\n}\n\n/**\n * GraphQLSchemaFactory\n */\nexport interface IGraphQLSchemaFactory {\n execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;\n}\n\nexport const GraphQLSchemaFactory =\n createAbstraction<IGraphQLSchemaFactory>(\"GraphQLSchemaFactory\");\n\nexport namespace GraphQLSchemaFactory {\n export type Interface = IGraphQLSchemaFactory;\n export type SchemaBuilder = GraphQLSchemaBuilder.Interface;\n export type Return = Promise<GraphQLSchemaBuilder.Interface>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAcvD;AACA;AACA;;AAKA,OAAO,MAAMC,oBAAoB,GAC7BD,iBAAiB,CAAwB,sBAAsB,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
|
|
1
|
+
import type { Plugin } from "@webiny/plugins/types.js";
|
|
2
|
+
import type { HandlerGraphQLOptions } from "./types.js";
|
|
3
|
+
export * from "./errors.js";
|
|
4
|
+
export * from "./responses.js";
|
|
5
|
+
export * from "./utils/index.js";
|
|
6
|
+
export * from "./plugins/index.js";
|
|
7
|
+
export * from "./processRequestBody.js";
|
|
8
|
+
export * from "./createResolverDecorator.js";
|
|
9
|
+
export * from "./ResolverDecoration.js";
|
|
10
|
+
declare const _default: (options?: HandlerGraphQLOptions) => Plugin[];
|
|
6
11
|
export default _default;
|
package/index.js
CHANGED
|
@@ -1,57 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Object.keys(_errors).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _errors[key]) return;
|
|
19
|
-
Object.defineProperty(exports, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _errors[key];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _responses = require("./responses");
|
|
28
|
-
|
|
29
|
-
Object.keys(_responses).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
-
if (key in exports && exports[key] === _responses[key]) return;
|
|
33
|
-
Object.defineProperty(exports, key, {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () {
|
|
36
|
-
return _responses[key];
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
var _plugins = require("./plugins");
|
|
42
|
-
|
|
43
|
-
Object.keys(_plugins).forEach(function (key) {
|
|
44
|
-
if (key === "default" || key === "__esModule") return;
|
|
45
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
46
|
-
if (key in exports && exports[key] === _plugins[key]) return;
|
|
47
|
-
Object.defineProperty(exports, key, {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () {
|
|
50
|
-
return _plugins[key];
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
var _default = (options = {}) => [(0, _createGraphQLHandler.default)(options)];
|
|
56
|
-
|
|
57
|
-
exports.default = _default;
|
|
1
|
+
import createGraphQLHandler from "./createGraphQLHandler.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./responses.js";
|
|
4
|
+
export * from "./utils/index.js";
|
|
5
|
+
export * from "./plugins/index.js";
|
|
6
|
+
export * from "./processRequestBody.js";
|
|
7
|
+
export * from "./createResolverDecorator.js";
|
|
8
|
+
export * from "./ResolverDecoration.js";
|
|
9
|
+
export default (options = {}) => {
|
|
10
|
+
return createGraphQLHandler(options);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createGraphQLHandler","options"],"sources":["index.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types.js\";\nimport type { HandlerGraphQLOptions } from \"./types.js\";\nimport createGraphQLHandler from \"./createGraphQLHandler.js\";\n\nexport * from \"./errors.js\";\nexport * from \"./responses.js\";\nexport * from \"./utils/index.js\";\nexport * from \"./plugins/index.js\";\nexport * from \"./processRequestBody.js\";\nexport * from \"./createResolverDecorator.js\";\nexport * from \"./ResolverDecoration.js\";\n\nexport default (options: HandlerGraphQLOptions = {}): Plugin[] => {\n return createGraphQLHandler(options);\n};\n"],"mappings":"AAEA,OAAOA,oBAAoB;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,eAAe,CAACC,OAA8B,GAAG,CAAC,CAAC,KAAe;EAC9D,OAAOD,oBAAoB,CAACC,OAAO,CAAC;AACxC,CAAC","ignoreList":[]}
|
package/interceptConsole.js
CHANGED
|
@@ -1,43 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.interceptConsole = void 0;
|
|
7
1
|
const consoleMethods = ["assert", "debug", "dir", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "table", "warn"];
|
|
8
2
|
const originalMethods = {};
|
|
9
3
|
const skipOriginal = ["table"];
|
|
10
|
-
|
|
11
4
|
const restoreOriginalMethods = () => {
|
|
12
5
|
for (const method of consoleMethods) {
|
|
13
|
-
// @ts-
|
|
6
|
+
// @ts-expect-error
|
|
14
7
|
console[method] = originalMethods[method];
|
|
15
8
|
}
|
|
16
9
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
10
|
+
export const interceptConsole = callback => {
|
|
11
|
+
// @ts-expect-error
|
|
20
12
|
if (console["__WEBINY__"] === true) {
|
|
21
13
|
restoreOriginalMethods();
|
|
22
|
-
}
|
|
23
|
-
|
|
14
|
+
}
|
|
24
15
|
|
|
16
|
+
// @ts-expect-error
|
|
25
17
|
console["__WEBINY__"] = true;
|
|
26
|
-
|
|
27
18
|
for (const method of consoleMethods) {
|
|
28
|
-
// @ts-
|
|
29
|
-
originalMethods[method] = console[method];
|
|
30
|
-
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
originalMethods[method] = console[method];
|
|
21
|
+
// @ts-expect-error
|
|
31
22
|
console[method] = (...args) => {
|
|
32
23
|
callback(method, args);
|
|
33
|
-
|
|
34
24
|
if (skipOriginal.includes(method)) {
|
|
35
25
|
return;
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
originalMethods[method](...args);
|
|
39
28
|
};
|
|
40
29
|
}
|
|
41
30
|
};
|
|
42
31
|
|
|
43
|
-
|
|
32
|
+
//# sourceMappingURL=interceptConsole.js.map
|
package/interceptConsole.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["consoleMethods","originalMethods","skipOriginal","restoreOriginalMethods","method","console","interceptConsole","callback","args","includes"],"sources":["interceptConsole.ts"],"sourcesContent":["const consoleMethods = [\n \"assert\",\n \"debug\",\n \"dir\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n \"info\",\n \"log\",\n \"table\",\n \"warn\"\n];\n\nconst originalMethods: Record<string, any> = {};\nconst skipOriginal: string[] = [\"table\"];\n\nconst restoreOriginalMethods = () => {\n for (const method of consoleMethods) {\n // @ts-
|
|
1
|
+
{"version":3,"names":["consoleMethods","originalMethods","skipOriginal","restoreOriginalMethods","method","console","interceptConsole","callback","args","includes"],"sources":["interceptConsole.ts"],"sourcesContent":["const consoleMethods = [\n \"assert\",\n \"debug\",\n \"dir\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n \"info\",\n \"log\",\n \"table\",\n \"warn\"\n];\n\nconst originalMethods: Record<string, any> = {};\nconst skipOriginal: string[] = [\"table\"];\n\nconst restoreOriginalMethods = () => {\n for (const method of consoleMethods) {\n // @ts-expect-error\n console[method] = originalMethods[method];\n }\n};\n\ninterface InterceptConsoleCallable {\n (method: string, args: any[]): void;\n}\n\nexport const interceptConsole = (callback: InterceptConsoleCallable) => {\n // @ts-expect-error\n if (console[\"__WEBINY__\"] === true) {\n restoreOriginalMethods();\n }\n\n // @ts-expect-error\n console[\"__WEBINY__\"] = true;\n\n for (const method of consoleMethods) {\n // @ts-expect-error\n originalMethods[method] = console[method];\n // @ts-expect-error\n console[method] = (...args) => {\n callback(method, args);\n if (skipOriginal.includes(method)) {\n return;\n }\n originalMethods[method](...args);\n };\n }\n};\n"],"mappings":"AAAA,MAAMA,cAAc,GAAG,CACnB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,KAAK,EACL,OAAO,EACP,MAAM,CACT;AAED,MAAMC,eAAoC,GAAG,CAAC,CAAC;AAC/C,MAAMC,YAAsB,GAAG,CAAC,OAAO,CAAC;AAExC,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EACjC,KAAK,MAAMC,MAAM,IAAIJ,cAAc,EAAE;IACjC;IACAK,OAAO,CAACD,MAAM,CAAC,GAAGH,eAAe,CAACG,MAAM,CAAC;EAC7C;AACJ,CAAC;AAMD,OAAO,MAAME,gBAAgB,GAAIC,QAAkC,IAAK;EACpE;EACA,IAAIF,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE;IAChCF,sBAAsB,CAAC,CAAC;EAC5B;;EAEA;EACAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;EAE5B,KAAK,MAAMD,MAAM,IAAIJ,cAAc,EAAE;IACjC;IACAC,eAAe,CAACG,MAAM,CAAC,GAAGC,OAAO,CAACD,MAAM,CAAC;IACzC;IACAC,OAAO,CAACD,MAAM,CAAC,GAAG,CAAC,GAAGI,IAAI,KAAK;MAC3BD,QAAQ,CAACH,MAAM,EAAEI,IAAI,CAAC;MACtB,IAAIN,YAAY,CAACO,QAAQ,CAACL,MAAM,CAAC,EAAE;QAC/B;MACJ;MACAH,eAAe,CAACG,MAAM,CAAC,CAAC,GAAGI,IAAI,CAAC;IACpC,CAAC;EACL;AACJ,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-graphql",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.ac6ebf63c6",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"repository": {
|
|
@@ -14,36 +15,33 @@
|
|
|
14
15
|
"Adrian Smijulj <adrian@webiny.com>"
|
|
15
16
|
],
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@graphql-tools/
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/
|
|
18
|
+
"@graphql-tools/merge": "9.1.7",
|
|
19
|
+
"@graphql-tools/resolvers-composition": "7.0.26",
|
|
20
|
+
"@graphql-tools/schema": "10.0.31",
|
|
21
|
+
"@graphql-tools/utils": "11.0.0",
|
|
22
|
+
"@webiny/api": "0.0.0-unstable.ac6ebf63c6",
|
|
23
|
+
"@webiny/di": "0.2.3",
|
|
24
|
+
"@webiny/error": "0.0.0-unstable.ac6ebf63c6",
|
|
25
|
+
"@webiny/feature": "0.0.0-unstable.ac6ebf63c6",
|
|
26
|
+
"@webiny/handler": "0.0.0-unstable.ac6ebf63c6",
|
|
27
|
+
"@webiny/plugins": "0.0.0-unstable.ac6ebf63c6",
|
|
28
|
+
"@webiny/utils": "0.0.0-unstable.ac6ebf63c6",
|
|
23
29
|
"boolean": "3.2.0",
|
|
24
|
-
"graphql": "
|
|
25
|
-
"graphql-scalars": "1.
|
|
26
|
-
"graphql-tag": "2.12.6"
|
|
30
|
+
"graphql": "16.12.0",
|
|
31
|
+
"graphql-scalars": "1.25.0",
|
|
32
|
+
"graphql-tag": "2.12.6",
|
|
33
|
+
"zod": "3.25.76"
|
|
27
34
|
},
|
|
28
35
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"@webiny/project-utils": "^0.0.0-unstable.aad28a72ae",
|
|
35
|
-
"jest": "^28.1.0",
|
|
36
|
-
"jest-mock-console": "^1.0.0",
|
|
37
|
-
"rimraf": "^3.0.2",
|
|
38
|
-
"typescript": "4.7.4"
|
|
36
|
+
"@webiny/build-tools": "0.0.0-unstable.ac6ebf63c6",
|
|
37
|
+
"@webiny/handler-aws": "0.0.0-unstable.ac6ebf63c6",
|
|
38
|
+
"rimraf": "6.1.3",
|
|
39
|
+
"typescript": "5.9.3",
|
|
40
|
+
"vitest": "3.2.4"
|
|
39
41
|
},
|
|
40
42
|
"publishConfig": {
|
|
41
43
|
"access": "public",
|
|
42
44
|
"directory": "dist"
|
|
43
45
|
},
|
|
44
|
-
"
|
|
45
|
-
"build": "yarn webiny run build",
|
|
46
|
-
"watch": "yarn webiny run watch"
|
|
47
|
-
},
|
|
48
|
-
"gitHead": "aad28a72ae72f19b80a3196d2b4439399acc67ad"
|
|
46
|
+
"gitHead": "ac6ebf63c6de308703d41f2c1b375e03cd96b813"
|
|
49
47
|
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import type { Context } from "@webiny/api/types.js";
|
|
1
2
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { GraphQLSchemaDefinition, Resolvers,
|
|
3
|
-
|
|
3
|
+
import type { GraphQLSchemaDefinition, ResolverDecorators, Resolvers, TypeDefs } from "../types.js";
|
|
4
|
+
export interface IGraphQLSchemaPlugin<TContext = Context> extends Plugin {
|
|
5
|
+
schema: GraphQLSchemaDefinition<TContext>;
|
|
6
|
+
isApplicable: (context: TContext) => boolean;
|
|
7
|
+
}
|
|
4
8
|
export interface GraphQLSchemaPluginConfig<TContext> {
|
|
5
|
-
typeDefs?:
|
|
9
|
+
typeDefs?: TypeDefs;
|
|
6
10
|
resolvers?: Resolvers<TContext>;
|
|
11
|
+
resolverDecorators?: ResolverDecorators;
|
|
12
|
+
isApplicable?: (context: TContext) => boolean;
|
|
7
13
|
}
|
|
8
|
-
export declare class GraphQLSchemaPlugin<TContext = Context> extends Plugin {
|
|
14
|
+
export declare class GraphQLSchemaPlugin<TContext = Context> extends Plugin implements IGraphQLSchemaPlugin<TContext> {
|
|
9
15
|
static readonly type: string;
|
|
10
|
-
|
|
16
|
+
protected config: GraphQLSchemaPluginConfig<TContext>;
|
|
11
17
|
constructor(config: GraphQLSchemaPluginConfig<TContext>);
|
|
12
18
|
get schema(): GraphQLSchemaDefinition<TContext>;
|
|
19
|
+
isApplicable(context: TContext): boolean;
|
|
13
20
|
}
|
|
21
|
+
export declare const createGraphQLSchemaPlugin: <T = Context>(config: GraphQLSchemaPluginConfig<T>) => GraphQLSchemaPlugin<T>;
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.GraphQLSchemaPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _plugins = require("@webiny/plugins");
|
|
13
|
-
|
|
14
|
-
class GraphQLSchemaPlugin extends _plugins.Plugin {
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
export class GraphQLSchemaPlugin extends Plugin {
|
|
3
|
+
static type = "graphql-schema";
|
|
15
4
|
constructor(config) {
|
|
16
5
|
super();
|
|
17
|
-
(0, _defineProperty2.default)(this, "config", void 0);
|
|
18
6
|
this.config = config;
|
|
19
7
|
}
|
|
20
|
-
|
|
21
8
|
get schema() {
|
|
22
9
|
return {
|
|
23
10
|
typeDefs: this.config.typeDefs || "",
|
|
24
|
-
resolvers: this.config.resolvers
|
|
11
|
+
resolvers: this.config.resolvers,
|
|
12
|
+
resolverDecorators: this.config.resolverDecorators
|
|
25
13
|
};
|
|
26
14
|
}
|
|
27
|
-
|
|
15
|
+
isApplicable(context) {
|
|
16
|
+
if (this.config.isApplicable) {
|
|
17
|
+
return this.config.isApplicable(context);
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
28
21
|
}
|
|
22
|
+
export const createGraphQLSchemaPlugin = config => {
|
|
23
|
+
return new GraphQLSchemaPlugin(config);
|
|
24
|
+
};
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
(0, _defineProperty2.default)(GraphQLSchemaPlugin, "type", "graphql-schema");
|
|
26
|
+
//# sourceMappingURL=GraphQLSchemaPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GraphQLSchemaPlugin","
|
|
1
|
+
{"version":3,"names":["Plugin","GraphQLSchemaPlugin","type","constructor","config","schema","typeDefs","resolvers","resolverDecorators","isApplicable","context","createGraphQLSchemaPlugin"],"sources":["GraphQLSchemaPlugin.ts"],"sourcesContent":["import type { Context } from \"@webiny/api/types.js\";\nimport { Plugin } from \"@webiny/plugins\";\nimport type { GraphQLSchemaDefinition, ResolverDecorators, Resolvers, TypeDefs } from \"~/types.js\";\n\nexport interface IGraphQLSchemaPlugin<TContext = Context> extends Plugin {\n schema: GraphQLSchemaDefinition<TContext>;\n isApplicable: (context: TContext) => boolean;\n}\n\nexport interface GraphQLSchemaPluginConfig<TContext> {\n typeDefs?: TypeDefs;\n resolvers?: Resolvers<TContext>;\n resolverDecorators?: ResolverDecorators;\n isApplicable?: (context: TContext) => boolean;\n}\n\nexport class GraphQLSchemaPlugin<TContext = Context>\n extends Plugin\n implements IGraphQLSchemaPlugin<TContext>\n{\n public static override readonly type: string = \"graphql-schema\";\n protected config: GraphQLSchemaPluginConfig<TContext>;\n\n constructor(config: GraphQLSchemaPluginConfig<TContext>) {\n super();\n this.config = config;\n }\n\n get schema(): GraphQLSchemaDefinition<TContext> {\n return {\n typeDefs: this.config.typeDefs || \"\",\n resolvers: this.config.resolvers,\n resolverDecorators: this.config.resolverDecorators\n };\n }\n\n isApplicable(context: TContext): boolean {\n if (this.config.isApplicable) {\n return this.config.isApplicable(context);\n }\n return true;\n }\n}\n\nexport const createGraphQLSchemaPlugin = <T = Context>(config: GraphQLSchemaPluginConfig<T>) => {\n return new GraphQLSchemaPlugin<T>(config);\n};\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,iBAAiB;AAexC,OAAO,MAAMC,mBAAmB,SACpBD,MAAM,CAElB;EACI,OAAgCE,IAAI,GAAW,gBAAgB;EAG/DC,WAAWA,CAACC,MAA2C,EAAE;IACrD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,IAAIC,MAAMA,CAAA,EAAsC;IAC5C,OAAO;MACHC,QAAQ,EAAE,IAAI,CAACF,MAAM,CAACE,QAAQ,IAAI,EAAE;MACpCC,SAAS,EAAE,IAAI,CAACH,MAAM,CAACG,SAAS;MAChCC,kBAAkB,EAAE,IAAI,CAACJ,MAAM,CAACI;IACpC,CAAC;EACL;EAEAC,YAAYA,CAACC,OAAiB,EAAW;IACrC,IAAI,IAAI,CAACN,MAAM,CAACK,YAAY,EAAE;MAC1B,OAAO,IAAI,CAACL,MAAM,CAACK,YAAY,CAACC,OAAO,CAAC;IAC5C;IACA,OAAO,IAAI;EACf;AACJ;AAEA,OAAO,MAAMC,yBAAyB,GAAiBP,MAAoC,IAAK;EAC5F,OAAO,IAAIH,mBAAmB,CAAIG,MAAM,CAAC;AAC7C,CAAC","ignoreList":[]}
|
package/plugins/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./GraphQLSchemaPlugin";
|
|
1
|
+
export * from "./GraphQLSchemaPlugin.js";
|
package/plugins/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./GraphQLSchemaPlugin.js";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _GraphQLSchemaPlugin = require("./GraphQLSchemaPlugin");
|
|
8
|
-
|
|
9
|
-
Object.keys(_GraphQLSchemaPlugin).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _GraphQLSchemaPlugin[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _GraphQLSchemaPlugin[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GraphQLSchemaPlugin\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GraphQLSchemaPlugin.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/processRequestBody.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ExecutionResult, GraphQLSchema } from "graphql";
|
|
2
|
-
import { GraphQLRequestBody } from "./types";
|
|
3
|
-
import { Context } from "@webiny/api/types";
|
|
4
|
-
declare const
|
|
5
|
-
export default _default;
|
|
1
|
+
import type { ExecutionResult, GraphQLSchema } from "graphql";
|
|
2
|
+
import type { GraphQLRequestBody } from "./types.js";
|
|
3
|
+
import type { Context } from "@webiny/api/types.js";
|
|
4
|
+
export declare const processRequestBody: <TData = Record<string, any>, TExtensions = Record<string, any>>(requestBody: GraphQLRequestBody | GraphQLRequestBody[], schema: GraphQLSchema, context: Context) => Promise<ExecutionResult<TData, TExtensions>[] | ExecutionResult<TData, TExtensions>>;
|
package/processRequestBody.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _graphql = require("graphql");
|
|
9
|
-
|
|
10
|
-
const processRequestBody = async (body, schema, context) => {
|
|
1
|
+
import { graphql } from "graphql";
|
|
2
|
+
const executeGraphQl = async (body, schema, context) => {
|
|
11
3
|
const {
|
|
12
4
|
query,
|
|
13
5
|
variables,
|
|
@@ -18,7 +10,14 @@ const processRequestBody = async (body, schema, context) => {
|
|
|
18
10
|
schema,
|
|
19
11
|
context
|
|
20
12
|
}));
|
|
21
|
-
const result = await
|
|
13
|
+
const result = await graphql({
|
|
14
|
+
schema,
|
|
15
|
+
source: query,
|
|
16
|
+
rootValue: {},
|
|
17
|
+
contextValue: context,
|
|
18
|
+
variableValues: variables,
|
|
19
|
+
operationName
|
|
20
|
+
});
|
|
22
21
|
context.plugins.byType("graphql-after-query").forEach(pl => {
|
|
23
22
|
pl.apply({
|
|
24
23
|
result,
|
|
@@ -29,19 +28,16 @@ const processRequestBody = async (body, schema, context) => {
|
|
|
29
28
|
});
|
|
30
29
|
return result;
|
|
31
30
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
result.push(await processRequestBody(requestBody[i], schema, context));
|
|
31
|
+
export const processRequestBody = async (requestBody, schema, context) => {
|
|
32
|
+
if (Array.isArray(requestBody)) {
|
|
33
|
+
const results = [];
|
|
34
|
+
for (const body of requestBody) {
|
|
35
|
+
const result = await executeGraphQl(body, schema, context);
|
|
36
|
+
results.push(result);
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
return result;
|
|
38
|
+
return results;
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
return await processRequestBody(requestBody, schema, context);
|
|
40
|
+
return await executeGraphQl(requestBody, schema, context);
|
|
45
41
|
};
|
|
46
42
|
|
|
47
|
-
|
|
43
|
+
//# sourceMappingURL=processRequestBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["graphql","executeGraphQl","body","schema","context","query","variables","operationName","plugins","byType","forEach","pl","apply","result","source","rootValue","contextValue","variableValues","processRequestBody","requestBody","Array","isArray","results","push"],"sources":["processRequestBody.ts"],"sourcesContent":["import type { ExecutionResult, GraphQLSchema } from \"graphql\";\nimport { graphql } from \"graphql\";\nimport type {\n GraphQLAfterQueryPlugin,\n GraphQLBeforeQueryPlugin,\n GraphQLRequestBody\n} from \"~/types.js\";\nimport type { Context } from \"@webiny/api/types.js\";\n\nconst executeGraphQl = async <TData = Record<string, any>, TExtensions = Record<string, any>>(\n body: GraphQLRequestBody,\n schema: GraphQLSchema,\n context: Context\n): Promise<ExecutionResult<TData, TExtensions>> => {\n const { query, variables, operationName } = body;\n\n context.plugins\n .byType<GraphQLBeforeQueryPlugin>(\"graphql-before-query\")\n .forEach(pl => pl.apply({ body, schema, context }));\n\n const result = await graphql({\n schema,\n source: query,\n rootValue: {},\n contextValue: context,\n variableValues: variables,\n operationName\n });\n\n context.plugins.byType<GraphQLAfterQueryPlugin>(\"graphql-after-query\").forEach(pl => {\n pl.apply({ result, body, schema, context });\n });\n\n return result as ExecutionResult<TData, TExtensions>;\n};\n\nexport const processRequestBody = async <\n TData = Record<string, any>,\n TExtensions = Record<string, any>\n>(\n requestBody: GraphQLRequestBody | GraphQLRequestBody[],\n schema: GraphQLSchema,\n context: Context\n): Promise<ExecutionResult<TData, TExtensions>[] | ExecutionResult<TData, TExtensions>> => {\n if (Array.isArray(requestBody)) {\n const results: ExecutionResult<TData, TExtensions>[] = [];\n for (const body of requestBody) {\n const result = await executeGraphQl<TData, TExtensions>(body, schema, context);\n results.push(result);\n }\n return results;\n }\n return await executeGraphQl<TData, TExtensions>(requestBody, schema, context);\n};\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,SAAS;AAQjC,MAAMC,cAAc,GAAG,MAAAA,CACnBC,IAAwB,EACxBC,MAAqB,EACrBC,OAAgB,KAC+B;EAC/C,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGL,IAAI;EAEhDE,OAAO,CAACI,OAAO,CACVC,MAAM,CAA2B,sBAAsB,CAAC,CACxDC,OAAO,CAACC,EAAE,IAAIA,EAAE,CAACC,KAAK,CAAC;IAAEV,IAAI;IAAEC,MAAM;IAAEC;EAAQ,CAAC,CAAC,CAAC;EAEvD,MAAMS,MAAM,GAAG,MAAMb,OAAO,CAAC;IACzBG,MAAM;IACNW,MAAM,EAAET,KAAK;IACbU,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAEZ,OAAO;IACrBa,cAAc,EAAEX,SAAS;IACzBC;EACJ,CAAC,CAAC;EAEFH,OAAO,CAACI,OAAO,CAACC,MAAM,CAA0B,qBAAqB,CAAC,CAACC,OAAO,CAACC,EAAE,IAAI;IACjFA,EAAE,CAACC,KAAK,CAAC;MAAEC,MAAM;MAAEX,IAAI;MAAEC,MAAM;MAAEC;IAAQ,CAAC,CAAC;EAC/C,CAAC,CAAC;EAEF,OAAOS,MAAM;AACjB,CAAC;AAED,OAAO,MAAMK,kBAAkB,GAAG,MAAAA,CAI9BC,WAAsD,EACtDhB,MAAqB,EACrBC,OAAgB,KACuE;EACvF,IAAIgB,KAAK,CAACC,OAAO,CAACF,WAAW,CAAC,EAAE;IAC5B,MAAMG,OAA8C,GAAG,EAAE;IACzD,KAAK,MAAMpB,IAAI,IAAIiB,WAAW,EAAE;MAC5B,MAAMN,MAAM,GAAG,MAAMZ,cAAc,CAAqBC,IAAI,EAAEC,MAAM,EAAEC,OAAO,CAAC;MAC9EkB,OAAO,CAACC,IAAI,CAACV,MAAM,CAAC;IACxB;IACA,OAAOS,OAAO;EAClB;EACA,OAAO,MAAMrB,cAAc,CAAqBkB,WAAW,EAAEhB,MAAM,EAAEC,OAAO,CAAC;AACjF,CAAC","ignoreList":[]}
|
package/responses.js
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Response = exports.NotFoundResponse = exports.ListResponse = exports.ListErrorResponse = exports.ErrorResponse = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
1
|
const defaultParams = {
|
|
13
2
|
code: "",
|
|
14
3
|
message: "",
|
|
15
4
|
data: null,
|
|
16
5
|
stack: null
|
|
17
6
|
};
|
|
18
|
-
|
|
19
|
-
class ErrorResponse {
|
|
7
|
+
export class ErrorResponse {
|
|
20
8
|
constructor(params) {
|
|
21
|
-
(0, _defineProperty2.default)(this, "data", void 0);
|
|
22
|
-
(0, _defineProperty2.default)(this, "error", void 0);
|
|
23
9
|
this.data = null;
|
|
24
|
-
const debug = process.env.DEBUG === "true";
|
|
10
|
+
const debug = process.env.DEBUG === "true";
|
|
25
11
|
|
|
12
|
+
// Ensure `stack` is either `string` or `null`.
|
|
26
13
|
let stack = defaultParams.stack;
|
|
27
|
-
|
|
28
14
|
if (debug && params.stack) {
|
|
29
15
|
stack = params.stack;
|
|
30
16
|
}
|
|
31
|
-
|
|
32
17
|
this.error = {
|
|
33
18
|
code: params.code || defaultParams.code,
|
|
34
19
|
message: params.message || defaultParams.message,
|
|
@@ -36,38 +21,26 @@ class ErrorResponse {
|
|
|
36
21
|
stack: stack
|
|
37
22
|
};
|
|
38
23
|
}
|
|
39
|
-
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
exports.ErrorResponse = ErrorResponse;
|
|
43
|
-
|
|
44
|
-
class NotFoundResponse extends ErrorResponse {
|
|
25
|
+
export class NotFoundResponse extends ErrorResponse {
|
|
45
26
|
constructor(message) {
|
|
46
27
|
super({
|
|
47
28
|
code: "NOT_FOUND",
|
|
48
29
|
message
|
|
49
30
|
});
|
|
50
31
|
}
|
|
51
|
-
|
|
52
32
|
}
|
|
53
|
-
|
|
54
|
-
exports.NotFoundResponse = NotFoundResponse;
|
|
55
|
-
|
|
56
|
-
class ListErrorResponse {
|
|
33
|
+
export class ListErrorResponse {
|
|
57
34
|
constructor(params) {
|
|
58
|
-
(0, _defineProperty2.default)(this, "data", void 0);
|
|
59
|
-
(0, _defineProperty2.default)(this, "meta", void 0);
|
|
60
|
-
(0, _defineProperty2.default)(this, "error", void 0);
|
|
61
35
|
this.meta = null;
|
|
62
36
|
this.data = null;
|
|
63
|
-
const debug = process.env.DEBUG === "true";
|
|
37
|
+
const debug = process.env.DEBUG === "true";
|
|
64
38
|
|
|
39
|
+
// Ensure `stack` is either `string` or `null`.
|
|
65
40
|
let stack = defaultParams.stack;
|
|
66
|
-
|
|
67
41
|
if (debug && params.stack) {
|
|
68
42
|
stack = params.stack;
|
|
69
43
|
}
|
|
70
|
-
|
|
71
44
|
this.error = {
|
|
72
45
|
code: params.code || defaultParams.code,
|
|
73
46
|
message: params.message || defaultParams.message,
|
|
@@ -75,33 +48,19 @@ class ListErrorResponse {
|
|
|
75
48
|
stack: stack
|
|
76
49
|
};
|
|
77
50
|
}
|
|
78
|
-
|
|
79
51
|
}
|
|
80
|
-
|
|
81
|
-
exports.ListErrorResponse = ListErrorResponse;
|
|
82
|
-
|
|
83
|
-
class Response {
|
|
52
|
+
export class Response {
|
|
84
53
|
constructor(data) {
|
|
85
|
-
(0, _defineProperty2.default)(this, "data", void 0);
|
|
86
|
-
(0, _defineProperty2.default)(this, "error", void 0);
|
|
87
54
|
this.data = data;
|
|
88
55
|
this.error = null;
|
|
89
56
|
}
|
|
90
|
-
|
|
91
57
|
}
|
|
92
|
-
|
|
93
|
-
exports.Response = Response;
|
|
94
|
-
|
|
95
|
-
class ListResponse {
|
|
58
|
+
export class ListResponse {
|
|
96
59
|
constructor(data, meta) {
|
|
97
|
-
(0, _defineProperty2.default)(this, "data", void 0);
|
|
98
|
-
(0, _defineProperty2.default)(this, "meta", void 0);
|
|
99
|
-
(0, _defineProperty2.default)(this, "error", void 0);
|
|
100
60
|
this.data = Array.isArray(data) ? data : [];
|
|
101
61
|
this.meta = meta || {};
|
|
102
62
|
this.error = null;
|
|
103
63
|
}
|
|
104
|
-
|
|
105
64
|
}
|
|
106
65
|
|
|
107
|
-
|
|
66
|
+
//# sourceMappingURL=responses.js.map
|