@webiny/api-graphql 0.0.0-unstable.0d717d18dd
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/LICENSE +21 -0
- package/README.md +11 -0
- package/ResolverDecoration.d.ts +6 -0
- package/ResolverDecoration.js +23 -0
- package/ResolverDecoration.js.map +1 -0
- package/builtInTypes/AnyScalar.d.ts +2 -0
- package/builtInTypes/AnyScalar.js +11 -0
- package/builtInTypes/AnyScalar.js.map +1 -0
- package/builtInTypes/DateScalar.d.ts +2 -0
- package/builtInTypes/DateScalar.js +23 -0
- package/builtInTypes/DateScalar.js.map +1 -0
- package/builtInTypes/DateTimeScalar.d.ts +2 -0
- package/builtInTypes/DateTimeScalar.js +18 -0
- package/builtInTypes/DateTimeScalar.js.map +1 -0
- package/builtInTypes/DateTimeZScalar.d.ts +6 -0
- package/builtInTypes/DateTimeZScalar.js +32 -0
- package/builtInTypes/DateTimeZScalar.js.map +1 -0
- package/builtInTypes/IconScalar.d.ts +10 -0
- package/builtInTypes/IconScalar.js +65 -0
- package/builtInTypes/IconScalar.js.map +1 -0
- package/builtInTypes/JsonScalar.d.ts +1 -0
- package/builtInTypes/JsonScalar.js +5 -0
- package/builtInTypes/JsonScalar.js.map +1 -0
- package/builtInTypes/LongScalar.d.ts +2 -0
- package/builtInTypes/LongScalar.js +40 -0
- package/builtInTypes/LongScalar.js.map +1 -0
- package/builtInTypes/NumberScalar.d.ts +2 -0
- package/builtInTypes/NumberScalar.js +41 -0
- package/builtInTypes/NumberScalar.js.map +1 -0
- package/builtInTypes/RefInputScalar.d.ts +2 -0
- package/builtInTypes/RefInputScalar.js +53 -0
- package/builtInTypes/RefInputScalar.js.map +1 -0
- package/builtInTypes/TimeScalar.d.ts +2 -0
- package/builtInTypes/TimeScalar.js +40 -0
- package/builtInTypes/TimeScalar.js.map +1 -0
- package/builtInTypes/index.d.ts +10 -0
- package/builtInTypes/index.js +10 -0
- package/createRequestBody.d.ts +2 -0
- package/createRequestBody.js +28 -0
- package/createRequestBody.js.map +1 -0
- package/createResolverDecorator.d.ts +2 -0
- package/createResolverDecorator.js +4 -0
- package/createResolverDecorator.js.map +1 -0
- package/engine/GraphQLContextEnhancer.d.ts +12 -0
- package/engine/GraphQLContextEnhancer.js +5 -0
- package/engine/GraphQLContextEnhancer.js.map +1 -0
- package/engine/GraphQLContextualSchema.d.ts +14 -0
- package/engine/GraphQLContextualSchema.js +5 -0
- package/engine/GraphQLContextualSchema.js.map +1 -0
- package/engine/GraphQLEngine.d.ts +21 -0
- package/engine/GraphQLEngine.js +95 -0
- package/engine/GraphQLEngine.js.map +1 -0
- package/engine/GraphQLEngineFeature.d.ts +4 -0
- package/engine/GraphQLEngineFeature.js +15 -0
- package/engine/GraphQLEngineFeature.js.map +1 -0
- package/engine/GraphQLRoute.d.ts +14 -0
- package/engine/GraphQLRoute.js +28 -0
- package/engine/GraphQLRoute.js.map +1 -0
- package/engine/abstractions.d.ts +7 -0
- package/engine/abstractions.js +5 -0
- package/engine/abstractions.js.map +1 -0
- package/engine/index.d.ts +5 -0
- package/engine/index.js +5 -0
- package/errors.d.ts +4 -0
- package/errors.js +9 -0
- package/errors.js.map +1 -0
- package/exports/api/graphql.d.ts +2 -0
- package/exports/api/graphql.js +2 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.d.ts +17 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.js +71 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaBuilder.js.map +1 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.d.ts +12 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.js +26 -0
- package/features/GraphQLSchemaBuilder/GraphQLSchemaComposer.js.map +1 -0
- package/features/GraphQLSchemaBuilder/abstractions.d.ts +39 -0
- package/features/GraphQLSchemaBuilder/abstractions.js +6 -0
- package/features/GraphQLSchemaBuilder/abstractions.js.map +1 -0
- package/features/GraphQLSchemaBuilder/feature.d.ts +4 -0
- package/features/GraphQLSchemaBuilder/feature.js +11 -0
- package/features/GraphQLSchemaBuilder/feature.js.map +1 -0
- package/graphql/abstractions.core.d.ts +15 -0
- package/graphql/abstractions.core.js +5 -0
- package/graphql/abstractions.core.js.map +1 -0
- package/graphql/abstractions.d.ts +2 -0
- package/graphql/abstractions.js +2 -0
- package/graphql/abstractions.public.d.ts +18 -0
- package/graphql/abstractions.public.js +5 -0
- package/graphql/abstractions.public.js.map +1 -0
- package/index.d.ts +12 -0
- package/index.js +14 -0
- package/index.js.map +1 -0
- package/package.json +50 -0
- package/plugins/GraphQLSchemaPlugin.d.ts +21 -0
- package/plugins/GraphQLSchemaPlugin.js +25 -0
- package/plugins/GraphQLSchemaPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +1 -0
- package/processRequestBody.d.ts +4 -0
- package/processRequestBody.js +26 -0
- package/processRequestBody.js.map +1 -0
- package/registerLegacyPluginsViaGqlContextEnhancer.d.ts +12 -0
- package/registerLegacyPluginsViaGqlContextEnhancer.js +21 -0
- package/registerLegacyPluginsViaGqlContextEnhancer.js.map +1 -0
- package/responses.d.ts +51 -0
- package/responses.js +59 -0
- package/responses.js.map +1 -0
- package/types.d.ts +50 -0
- package/types.js +0 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/resolve.d.ts +21 -0
- package/utils/resolve.js +20 -0
- package/utils/resolve.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/abstractions.public.js","sources":["../../src/graphql/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/** Define custom GraphQL schema extensions. */\nexport interface IGraphQLSchemaFactory {\n execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;\n}\n\n/** Define custom GraphQL schema extensions. */\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"],"names":["GraphQLSchemaFactory","createAbstraction"],"mappings":";AAuBO,MAAMA,uBACTC,kBAAyC"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./errors.js";
|
|
2
|
+
export { registerLegacyPluginsViaGqlContextEnhancer } from "./registerLegacyPluginsViaGqlContextEnhancer.js";
|
|
3
|
+
export * from "./responses.js";
|
|
4
|
+
export * from "./utils/index.js";
|
|
5
|
+
export * from "./plugins/index.js";
|
|
6
|
+
export * from "./createRequestBody.js";
|
|
7
|
+
export * from "./processRequestBody.js";
|
|
8
|
+
export * from "./createResolverDecorator.js";
|
|
9
|
+
export * from "./ResolverDecoration.js";
|
|
10
|
+
export * from "./engine/index.js";
|
|
11
|
+
export default _default;
|
|
12
|
+
declare function _default(): never[];
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./errors.js";
|
|
2
|
+
export * from "./responses.js";
|
|
3
|
+
export * from "./utils/index.js";
|
|
4
|
+
export * from "./plugins/index.js";
|
|
5
|
+
export * from "./createRequestBody.js";
|
|
6
|
+
export * from "./processRequestBody.js";
|
|
7
|
+
export * from "./createResolverDecorator.js";
|
|
8
|
+
export * from "./ResolverDecoration.js";
|
|
9
|
+
export * from "./engine/index.js";
|
|
10
|
+
const src = ()=>[];
|
|
11
|
+
export { registerLegacyPluginsViaGqlContextEnhancer } from "./registerLegacyPluginsViaGqlContextEnhancer.js";
|
|
12
|
+
export default src;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from \"./errors.js\";\nexport { registerLegacyPluginsViaGqlContextEnhancer } from \"./registerLegacyPluginsViaGqlContextEnhancer.js\";\nexport * from \"./responses.js\";\nexport * from \"./utils/index.js\";\nexport * from \"./plugins/index.js\";\nexport * from \"./createRequestBody.js\";\nexport * from \"./processRequestBody.js\";\nexport * from \"./createResolverDecorator.js\";\nexport * from \"./ResolverDecoration.js\";\nexport * from \"./engine/index.js\";\n\n// Backward-compat stub — the Fastify GraphQL route was replaced by GraphQLRoute\n// registered via GraphQLEngineFeature. This default export is a no-op.\nexport default () => [];\n"],"names":[],"mappings":";;;;;;;;;AAaA,YAAgB,IAAK,EAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webiny/api-graphql",
|
|
3
|
+
"version": "0.0.0-unstable.0d717d18dd",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/webiny/webiny-js.git"
|
|
13
|
+
},
|
|
14
|
+
"description": "The Server as a function.",
|
|
15
|
+
"contributors": [
|
|
16
|
+
"Pavel Denisjuk <pavel@webiny.com>",
|
|
17
|
+
"Sven Al Hamad <sven@webiny.com>",
|
|
18
|
+
"Adrian Smijulj <adrian@webiny.com>"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@graphql-tools/merge": "9.2.2",
|
|
22
|
+
"@graphql-tools/resolvers-composition": "7.0.35",
|
|
23
|
+
"@graphql-tools/schema": "10.0.38",
|
|
24
|
+
"@graphql-tools/utils": "11.2.2",
|
|
25
|
+
"@webiny/api": "0.0.0-unstable.0d717d18dd",
|
|
26
|
+
"@webiny/di": "1.0.2",
|
|
27
|
+
"@webiny/error": "0.0.0-unstable.0d717d18dd",
|
|
28
|
+
"@webiny/event-handler-core": "0.0.0-unstable.0d717d18dd",
|
|
29
|
+
"@webiny/feature": "0.0.0-unstable.0d717d18dd",
|
|
30
|
+
"@webiny/handler": "0.0.0-unstable.0d717d18dd",
|
|
31
|
+
"@webiny/plugins": "0.0.0-unstable.0d717d18dd",
|
|
32
|
+
"@webiny/utils": "0.0.0-unstable.0d717d18dd",
|
|
33
|
+
"graphql": "16.14.2",
|
|
34
|
+
"graphql-scalars": "1.25.0",
|
|
35
|
+
"zod": "4.4.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@webiny/build-tools": "0.0.0-unstable.0d717d18dd",
|
|
39
|
+
"rimraf": "6.1.3",
|
|
40
|
+
"typescript": "7.0.2",
|
|
41
|
+
"vitest": "4.1.10"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
|
|
47
|
+
"webiny": {
|
|
48
|
+
"publishFrom": "dist"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from "@webiny/api/types.js";
|
|
2
|
+
import { Plugin } from "@webiny/plugins";
|
|
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
|
+
}
|
|
8
|
+
export interface GraphQLSchemaPluginConfig<TContext> {
|
|
9
|
+
typeDefs?: TypeDefs;
|
|
10
|
+
resolvers?: Resolvers<TContext>;
|
|
11
|
+
resolverDecorators?: ResolverDecorators;
|
|
12
|
+
isApplicable?: (context: TContext) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class GraphQLSchemaPlugin<TContext = Context> extends Plugin implements IGraphQLSchemaPlugin<TContext> {
|
|
15
|
+
static readonly type: string;
|
|
16
|
+
protected config: GraphQLSchemaPluginConfig<TContext>;
|
|
17
|
+
constructor(config: GraphQLSchemaPluginConfig<TContext>);
|
|
18
|
+
get schema(): GraphQLSchemaDefinition<TContext>;
|
|
19
|
+
isApplicable(context: TContext): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const createGraphQLSchemaPlugin: <T = Context>(config: GraphQLSchemaPluginConfig<T>) => GraphQLSchemaPlugin<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
class GraphQLSchemaPlugin extends Plugin {
|
|
3
|
+
static{
|
|
4
|
+
this.type = "graphql-schema";
|
|
5
|
+
}
|
|
6
|
+
constructor(config){
|
|
7
|
+
super();
|
|
8
|
+
this.config = config;
|
|
9
|
+
}
|
|
10
|
+
get schema() {
|
|
11
|
+
return {
|
|
12
|
+
typeDefs: this.config.typeDefs || "",
|
|
13
|
+
resolvers: this.config.resolvers,
|
|
14
|
+
resolverDecorators: this.config.resolverDecorators
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
isApplicable(context) {
|
|
18
|
+
if (this.config.isApplicable) return this.config.isApplicable(context);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const createGraphQLSchemaPlugin = (config)=>new GraphQLSchemaPlugin(config);
|
|
23
|
+
export { GraphQLSchemaPlugin, createGraphQLSchemaPlugin };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=GraphQLSchemaPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins/GraphQLSchemaPlugin.js","sources":["../../src/plugins/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"],"names":["GraphQLSchemaPlugin","Plugin","config","context","createGraphQLSchemaPlugin"],"mappings":";AAgBO,MAAMA,4BACDC;;aAGwB,IAAI,GAAW;;IAG/C,YAAYC,MAA2C,CAAE;QACrD,KAAK;QACL,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,IAAI,SAA4C;QAC5C,OAAO;YACH,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI;YAClC,WAAW,IAAI,CAAC,MAAM,CAAC,SAAS;YAChC,oBAAoB,IAAI,CAAC,MAAM,CAAC,kBAAkB;QACtD;IACJ;IAEA,aAAaC,OAAiB,EAAW;QACrC,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EACxB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAACA;QAEpC,OAAO;IACX;AACJ;AAEO,MAAMC,4BAA4B,CAAcF,SAC5C,IAAIF,oBAAuBE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GraphQLSchemaPlugin.js";
|
package/plugins/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GraphQLSchemaPlugin.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
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>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { graphql } from "graphql";
|
|
2
|
+
const executeGraphQl = async (body, schema, context)=>{
|
|
3
|
+
const { query, variables, operationName } = body;
|
|
4
|
+
return graphql({
|
|
5
|
+
schema,
|
|
6
|
+
source: query,
|
|
7
|
+
rootValue: {},
|
|
8
|
+
contextValue: context,
|
|
9
|
+
variableValues: variables,
|
|
10
|
+
operationName
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const processRequestBody = async (requestBody, schema, context)=>{
|
|
14
|
+
if (Array.isArray(requestBody)) {
|
|
15
|
+
const results = [];
|
|
16
|
+
for (const body of requestBody){
|
|
17
|
+
const result = await executeGraphQl(body, schema, context);
|
|
18
|
+
results.push(result);
|
|
19
|
+
}
|
|
20
|
+
return results;
|
|
21
|
+
}
|
|
22
|
+
return await executeGraphQl(requestBody, schema, context);
|
|
23
|
+
};
|
|
24
|
+
export { processRequestBody };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=processRequestBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processRequestBody.js","sources":["../src/processRequestBody.ts"],"sourcesContent":["import type { ExecutionResult, GraphQLSchema } from \"graphql\";\nimport { graphql } from \"graphql\";\nimport type { GraphQLRequestBody } 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 return graphql({\n schema,\n source: query,\n rootValue: {},\n contextValue: context,\n variableValues: variables,\n operationName\n }) as Promise<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"],"names":["executeGraphQl","body","schema","context","query","variables","operationName","graphql","processRequestBody","requestBody","Array","results","result"],"mappings":";AAKA,MAAMA,iBAAiB,OACnBC,MACAC,QACAC;IAEA,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,aAAa,EAAE,GAAGL;IAC5C,OAAOM,QAAQ;QACXL;QACA,QAAQE;QACR,WAAW,CAAC;QACZ,cAAcD;QACd,gBAAgBE;QAChBC;IACJ;AACJ;AAEO,MAAME,qBAAqB,OAI9BC,aACAP,QACAC;IAEA,IAAIO,MAAM,OAAO,CAACD,cAAc;QAC5B,MAAME,UAAiD,EAAE;QACzD,KAAK,MAAMV,QAAQQ,YAAa;YAC5B,MAAMG,SAAS,MAAMZ,eAAmCC,MAAMC,QAAQC;YACtEQ,QAAQ,IAAI,CAACC;QACjB;QACA,OAAOD;IACX;IACA,OAAO,MAAMX,eAAmCS,aAAaP,QAAQC;AACzE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
/**
|
|
3
|
+
* Escape hatch for legacy plugin-based code that hasn't been migrated to createFeature() yet.
|
|
4
|
+
*
|
|
5
|
+
* Accepts any plugin array (same shape as the old createHandler({ plugins: [...] })) and
|
|
6
|
+
* applies them via a GraphQLContextEnhancer so they still receive the context object.
|
|
7
|
+
*
|
|
8
|
+
* Usage in createLambdaHandler request callback:
|
|
9
|
+
* registerLegacyPluginsViaGqlContextEnhancer(container, extensions());
|
|
10
|
+
* registerLegacyPluginsViaGqlContextEnhancer(container, [myPlugin(), anotherPlugin()]);
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerLegacyPluginsViaGqlContextEnhancer(container: Container, plugins: any | any[]): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
2
|
+
import { GraphQLContextEnhancer } from "./engine/index.js";
|
|
3
|
+
function registerLegacyPluginsViaGqlContextEnhancer(container, plugins) {
|
|
4
|
+
const flat = [
|
|
5
|
+
plugins
|
|
6
|
+
].flat(1 / 0).filter(Boolean);
|
|
7
|
+
let initialized = false;
|
|
8
|
+
const enhancer = {
|
|
9
|
+
async enhance (ctx) {
|
|
10
|
+
if (initialized) return;
|
|
11
|
+
initialized = true;
|
|
12
|
+
if (!ctx.plugins) ctx.plugins = new PluginsContainer([]);
|
|
13
|
+
for (const plugin of flat)if ("function" == typeof plugin.apply) await plugin.apply(ctx);
|
|
14
|
+
else if (ctx.plugins) ctx.plugins.register(plugin);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
container.registerInstance(GraphQLContextEnhancer, enhancer);
|
|
18
|
+
}
|
|
19
|
+
export { registerLegacyPluginsViaGqlContextEnhancer };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=registerLegacyPluginsViaGqlContextEnhancer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerLegacyPluginsViaGqlContextEnhancer.js","sources":["../src/registerLegacyPluginsViaGqlContextEnhancer.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { GraphQLContextEnhancer } from \"./engine/index.js\";\nimport type { IGraphQLContextEnhancer } from \"./engine/index.js\";\n\n/**\n * Escape hatch for legacy plugin-based code that hasn't been migrated to createFeature() yet.\n *\n * Accepts any plugin array (same shape as the old createHandler({ plugins: [...] })) and\n * applies them via a GraphQLContextEnhancer so they still receive the context object.\n *\n * Usage in createLambdaHandler request callback:\n * registerLegacyPluginsViaGqlContextEnhancer(container, extensions());\n * registerLegacyPluginsViaGqlContextEnhancer(container, [myPlugin(), anotherPlugin()]);\n */\nexport function registerLegacyPluginsViaGqlContextEnhancer(\n container: Container,\n plugins: any | any[]\n): void {\n const flat = [plugins].flat(Infinity as 1).filter(Boolean);\n let initialized = false;\n\n const enhancer: IGraphQLContextEnhancer = {\n async enhance(ctx: Record<string, any>): Promise<void> {\n if (initialized) {\n return;\n }\n initialized = true;\n\n // Legacy plugins assume ctx.plugins exists (they call ctx.plugins.register() directly).\n // Mirror the contract of the old createHandler which always initialised PluginsContainer.\n if (!ctx.plugins) {\n ctx.plugins = new PluginsContainer([]);\n }\n\n for (const plugin of flat) {\n if (typeof plugin.apply === \"function\") {\n await plugin.apply(ctx);\n } else if (ctx.plugins) {\n ctx.plugins.register(plugin);\n }\n }\n }\n };\n\n container.registerInstance(GraphQLContextEnhancer, enhancer);\n}\n"],"names":["registerLegacyPluginsViaGqlContextEnhancer","container","plugins","flat","Infinity","Boolean","initialized","enhancer","ctx","PluginsContainer","plugin","GraphQLContextEnhancer"],"mappings":";;AAeO,SAASA,2CACZC,SAAoB,EACpBC,OAAoB;IAEpB,MAAMC,OAAO;QAACD;KAAQ,CAAC,IAAI,CAACE,OAAe,MAAM,CAACC;IAClD,IAAIC,cAAc;IAElB,MAAMC,WAAoC;QACtC,MAAM,SAAQC,GAAwB;YAClC,IAAIF,aACA;YAEJA,cAAc;YAId,IAAI,CAACE,IAAI,OAAO,EACZA,IAAI,OAAO,GAAG,IAAIC,iBAAiB,EAAE;YAGzC,KAAK,MAAMC,UAAUP,KACjB,IAAI,AAAwB,cAAxB,OAAOO,OAAO,KAAK,EACnB,MAAMA,OAAO,KAAK,CAACF;iBAChB,IAAIA,IAAI,OAAO,EAClBA,IAAI,OAAO,CAAC,QAAQ,CAACE;QAGjC;IACJ;IAEAT,UAAU,gBAAgB,CAACU,wBAAwBJ;AACvD"}
|
package/responses.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface IMeta {
|
|
2
|
+
hasMoreItems: boolean;
|
|
3
|
+
totalCount: number;
|
|
4
|
+
cursor?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ErrorResponseParams {
|
|
7
|
+
message: string;
|
|
8
|
+
code?: string;
|
|
9
|
+
data?: any;
|
|
10
|
+
stack?: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** GraphQL error response helper. */
|
|
13
|
+
export declare class ErrorResponse {
|
|
14
|
+
readonly data: null;
|
|
15
|
+
readonly error: {
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
data: any;
|
|
19
|
+
stack: string | null;
|
|
20
|
+
};
|
|
21
|
+
constructor(params: ErrorResponseParams);
|
|
22
|
+
}
|
|
23
|
+
/** GraphQL not-found response helper. */
|
|
24
|
+
export declare class NotFoundResponse extends ErrorResponse {
|
|
25
|
+
constructor(message: string);
|
|
26
|
+
}
|
|
27
|
+
/** GraphQL list error response helper. */
|
|
28
|
+
export declare class ListErrorResponse {
|
|
29
|
+
readonly data: null;
|
|
30
|
+
readonly meta: null;
|
|
31
|
+
readonly error: {
|
|
32
|
+
code: string;
|
|
33
|
+
message: string;
|
|
34
|
+
data: any;
|
|
35
|
+
stack: string | null;
|
|
36
|
+
};
|
|
37
|
+
constructor(params: ErrorResponseParams);
|
|
38
|
+
}
|
|
39
|
+
/** GraphQL response helper. */
|
|
40
|
+
export declare class Response<T = any> {
|
|
41
|
+
readonly data: T;
|
|
42
|
+
readonly error: null;
|
|
43
|
+
constructor(data: T);
|
|
44
|
+
}
|
|
45
|
+
/** GraphQL list response helper. */
|
|
46
|
+
export declare class ListResponse<T, M = IMeta> {
|
|
47
|
+
readonly data: Array<T>;
|
|
48
|
+
readonly meta: M;
|
|
49
|
+
readonly error: null;
|
|
50
|
+
constructor(data: Array<T>, meta?: M);
|
|
51
|
+
}
|
package/responses.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const defaultParams = {
|
|
2
|
+
code: "",
|
|
3
|
+
message: "",
|
|
4
|
+
data: null,
|
|
5
|
+
stack: null
|
|
6
|
+
};
|
|
7
|
+
class ErrorResponse {
|
|
8
|
+
constructor(params){
|
|
9
|
+
this.data = null;
|
|
10
|
+
const debug = "true" === process.env.DEBUG;
|
|
11
|
+
let stack = defaultParams.stack;
|
|
12
|
+
if (debug && params.stack) stack = params.stack;
|
|
13
|
+
this.error = {
|
|
14
|
+
code: params.code || defaultParams.code,
|
|
15
|
+
message: params.message || defaultParams.message,
|
|
16
|
+
data: params.data || defaultParams.data,
|
|
17
|
+
stack: stack
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class NotFoundResponse extends ErrorResponse {
|
|
22
|
+
constructor(message){
|
|
23
|
+
super({
|
|
24
|
+
code: "NOT_FOUND",
|
|
25
|
+
message
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class ListErrorResponse {
|
|
30
|
+
constructor(params){
|
|
31
|
+
this.meta = null;
|
|
32
|
+
this.data = null;
|
|
33
|
+
const debug = "true" === process.env.DEBUG;
|
|
34
|
+
let stack = defaultParams.stack;
|
|
35
|
+
if (debug && params.stack) stack = params.stack;
|
|
36
|
+
this.error = {
|
|
37
|
+
code: params.code || defaultParams.code,
|
|
38
|
+
message: params.message || defaultParams.message,
|
|
39
|
+
data: params.data || defaultParams.data,
|
|
40
|
+
stack: stack
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class Response {
|
|
45
|
+
constructor(data){
|
|
46
|
+
this.data = data;
|
|
47
|
+
this.error = null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class ListResponse {
|
|
51
|
+
constructor(data, meta){
|
|
52
|
+
this.data = Array.isArray(data) ? data : [];
|
|
53
|
+
this.meta = meta || {};
|
|
54
|
+
this.error = null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export { ErrorResponse, ListErrorResponse, ListResponse, NotFoundResponse, Response };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=responses.js.map
|
package/responses.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sources":["../src/responses.ts"],"sourcesContent":["export interface IMeta {\n hasMoreItems: boolean;\n totalCount: number;\n cursor?: string | null;\n}\n\nexport interface ErrorResponseParams {\n message: string;\n code?: string;\n data?: any;\n stack?: string | null;\n}\n\nconst defaultParams: Required<ErrorResponseParams> = {\n code: \"\",\n message: \"\",\n data: null,\n stack: null\n};\n\n/** GraphQL error response helper. */\nexport class ErrorResponse {\n public readonly data: null;\n public readonly error: {\n code: string;\n message: string;\n data: any;\n stack: string | null;\n };\n\n constructor(params: ErrorResponseParams) {\n this.data = null;\n\n const debug = process.env.DEBUG === \"true\";\n\n // Ensure `stack` is either `string` or `null`.\n let stack = defaultParams.stack;\n if (debug && params.stack) {\n stack = params.stack;\n }\n\n this.error = {\n code: params.code || defaultParams.code,\n message: params.message || defaultParams.message,\n data: params.data || defaultParams.data,\n stack: stack\n };\n }\n}\n\n/** GraphQL not-found response helper. */\nexport class NotFoundResponse extends ErrorResponse {\n constructor(message: string) {\n super({\n code: \"NOT_FOUND\",\n message\n });\n }\n}\n\n/** GraphQL list error response helper. */\nexport class ListErrorResponse {\n public readonly data: null;\n public readonly meta: null;\n public readonly error: {\n code: string;\n message: string;\n data: any;\n stack: string | null;\n };\n\n constructor(params: ErrorResponseParams) {\n this.meta = null;\n this.data = null;\n\n const debug = process.env.DEBUG === \"true\";\n\n // Ensure `stack` is either `string` or `null`.\n let stack = defaultParams.stack;\n if (debug && params.stack) {\n stack = params.stack;\n }\n\n this.error = {\n code: params.code || defaultParams.code,\n message: params.message || defaultParams.message,\n data: params.data || defaultParams.data,\n stack: stack\n };\n }\n}\n\n/** GraphQL response helper. */\nexport class Response<T = any> {\n public readonly data: T;\n public readonly error: null;\n\n constructor(data: T) {\n this.data = data;\n this.error = null;\n }\n}\n\n/** GraphQL list response helper. */\nexport class ListResponse<T, M = IMeta> {\n public readonly data: Array<T>;\n public readonly meta: M;\n public readonly error: null;\n\n constructor(data: Array<T>, meta?: M) {\n this.data = Array.isArray(data) ? data : [];\n this.meta = meta || ({} as M);\n this.error = null;\n }\n}\n"],"names":["defaultParams","ErrorResponse","params","debug","process","stack","NotFoundResponse","message","ListErrorResponse","Response","data","ListResponse","meta","Array"],"mappings":"AAaA,MAAMA,gBAA+C;IACjD,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;AACX;AAGO,MAAMC;IAST,YAAYC,MAA2B,CAAE;QACrC,IAAI,CAAC,IAAI,GAAG;QAEZ,MAAMC,QAAQC,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK;QAG/B,IAAIC,QAAQL,cAAc,KAAK;QAC/B,IAAIG,SAASD,OAAO,KAAK,EACrBG,QAAQH,OAAO,KAAK;QAGxB,IAAI,CAAC,KAAK,GAAG;YACT,MAAMA,OAAO,IAAI,IAAIF,cAAc,IAAI;YACvC,SAASE,OAAO,OAAO,IAAIF,cAAc,OAAO;YAChD,MAAME,OAAO,IAAI,IAAIF,cAAc,IAAI;YACvC,OAAOK;QACX;IACJ;AACJ;AAGO,MAAMC,yBAAyBL;IAClC,YAAYM,OAAe,CAAE;QACzB,KAAK,CAAC;YACF,MAAM;YACNA;QACJ;IACJ;AACJ;AAGO,MAAMC;IAUT,YAAYN,MAA2B,CAAE;QACrC,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,IAAI,GAAG;QAEZ,MAAMC,QAAQC,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK;QAG/B,IAAIC,QAAQL,cAAc,KAAK;QAC/B,IAAIG,SAASD,OAAO,KAAK,EACrBG,QAAQH,OAAO,KAAK;QAGxB,IAAI,CAAC,KAAK,GAAG;YACT,MAAMA,OAAO,IAAI,IAAIF,cAAc,IAAI;YACvC,SAASE,OAAO,OAAO,IAAIF,cAAc,OAAO;YAChD,MAAME,OAAO,IAAI,IAAIF,cAAc,IAAI;YACvC,OAAOK;QACX;IACJ;AACJ;AAGO,MAAMI;IAIT,YAAYC,IAAO,CAAE;QACjB,IAAI,CAAC,IAAI,GAAGA;QACZ,IAAI,CAAC,KAAK,GAAG;IACjB;AACJ;AAGO,MAAMC;IAKT,YAAYD,IAAc,EAAEE,IAAQ,CAAE;QAClC,IAAI,CAAC,IAAI,GAAGC,MAAM,OAAO,CAACH,QAAQA,OAAO,EAAE;QAC3C,IAAI,CAAC,IAAI,GAAGE,QAAS,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG;IACjB;AACJ"}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GraphQLScalarType, GraphQLFieldResolver as BaseGraphQLFieldResolver, GraphQLSchema } from "graphql";
|
|
2
|
+
import type { Plugin } from "@webiny/plugins/types.js";
|
|
3
|
+
import type { Context, GenericRecord } from "@webiny/api/types.js";
|
|
4
|
+
import type { ResolversComposition } from "@graphql-tools/resolvers-composition";
|
|
5
|
+
import type { IResolvers, TypeSource } from "@graphql-tools/utils";
|
|
6
|
+
export interface GraphQLScalarPlugin extends Plugin {
|
|
7
|
+
type: "graphql-scalar";
|
|
8
|
+
scalar: GraphQLScalarType;
|
|
9
|
+
}
|
|
10
|
+
export type GraphQLFieldResolver<TSource = any, TArgs = any, TContext = Context> = BaseGraphQLFieldResolver<TSource, TContext, TArgs>;
|
|
11
|
+
export type TypeDefs = TypeSource;
|
|
12
|
+
export interface GraphQLSchemaPluginTypeArgs {
|
|
13
|
+
context?: any;
|
|
14
|
+
args?: any;
|
|
15
|
+
source?: any;
|
|
16
|
+
}
|
|
17
|
+
export type Resolvers<TContext> = IResolvers<any, TContext>;
|
|
18
|
+
export type ResolverDecorator<TSource = any, TContext = any, TArgs = any> = ResolversComposition<GraphQLFieldResolver<TSource, TContext, TArgs>>;
|
|
19
|
+
export type ResolverDecorators = GenericRecord<string, ResolverDecorator[]>;
|
|
20
|
+
export interface GraphQLSchemaDefinition<TContext = any> {
|
|
21
|
+
typeDefs: TypeDefs;
|
|
22
|
+
resolvers?: Resolvers<TContext>;
|
|
23
|
+
resolverDecorators?: ResolverDecorators;
|
|
24
|
+
}
|
|
25
|
+
export interface GraphQLSchemaPlugin<TContext extends Context = Context> extends Plugin {
|
|
26
|
+
type: "graphql-schema";
|
|
27
|
+
schema: GraphQLSchemaDefinition<TContext>;
|
|
28
|
+
}
|
|
29
|
+
export interface GraphQLRequestBody {
|
|
30
|
+
query: string;
|
|
31
|
+
variables?: Record<string, any> | null;
|
|
32
|
+
operationName?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GraphQLBeforeQueryPlugin<TContext extends Context = Context> extends Plugin {
|
|
35
|
+
type: "graphql-before-query";
|
|
36
|
+
apply(params: {
|
|
37
|
+
body: GraphQLRequestBody;
|
|
38
|
+
schema: GraphQLSchema;
|
|
39
|
+
context: TContext;
|
|
40
|
+
}): void;
|
|
41
|
+
}
|
|
42
|
+
export interface GraphQLAfterQueryPlugin<TContext extends Context = Context> extends Plugin {
|
|
43
|
+
type: "graphql-after-query";
|
|
44
|
+
apply(params: {
|
|
45
|
+
result: any;
|
|
46
|
+
body: GraphQLRequestBody;
|
|
47
|
+
schema: GraphQLSchema;
|
|
48
|
+
context: TContext;
|
|
49
|
+
}): void;
|
|
50
|
+
}
|
package/types.js
ADDED
|
File without changes
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./resolve.js";
|
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./resolve.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "../responses.js";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
export interface Meta {
|
|
4
|
+
totalCount: number;
|
|
5
|
+
hasMoreItems: boolean;
|
|
6
|
+
cursor: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const emptyResolver: () => {};
|
|
9
|
+
interface ResolveCallable<T = GenericRecord> {
|
|
10
|
+
(): Promise<T>;
|
|
11
|
+
}
|
|
12
|
+
export declare const resolve: <T = GenericRecord>(fn: ResolveCallable<T>) => Promise<ErrorResponse | Response<Awaited<T>>>;
|
|
13
|
+
interface ResolveListCallable<T> {
|
|
14
|
+
(): Promise<IListResult<T>>;
|
|
15
|
+
}
|
|
16
|
+
interface IListResult<T = GenericRecord> {
|
|
17
|
+
items: T[];
|
|
18
|
+
meta: Meta;
|
|
19
|
+
}
|
|
20
|
+
export declare const resolveList: <T = GenericRecord>(fn: ResolveListCallable<T>) => Promise<ListErrorResponse | ListResponse<T, Meta>>;
|
|
21
|
+
export {};
|
package/utils/resolve.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "../responses.js";
|
|
2
|
+
const emptyResolver = ()=>({});
|
|
3
|
+
const resolve = async (fn)=>{
|
|
4
|
+
try {
|
|
5
|
+
return new Response(await fn());
|
|
6
|
+
} catch (ex) {
|
|
7
|
+
return new ErrorResponse(ex);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const resolveList = async (fn)=>{
|
|
11
|
+
try {
|
|
12
|
+
const result = await fn();
|
|
13
|
+
return new ListResponse(result.items, result.meta);
|
|
14
|
+
} catch (ex) {
|
|
15
|
+
return new ListErrorResponse(ex);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export { emptyResolver, resolve, resolveList };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils/resolve.js","sources":["../../src/utils/resolve.ts"],"sourcesContent":["import { ErrorResponse, ListErrorResponse, ListResponse, Response } from \"~/responses.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface Meta {\n totalCount: number;\n hasMoreItems: boolean;\n cursor: string | null;\n}\n\nexport const emptyResolver = () => ({});\n\ninterface ResolveCallable<T = GenericRecord> {\n (): Promise<T>;\n}\n\nexport const resolve = async <T = GenericRecord>(fn: ResolveCallable<T>) => {\n try {\n return new Response(await fn());\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n};\n\ninterface ResolveListCallable<T> {\n (): Promise<IListResult<T>>;\n}\n\ninterface IListResult<T = GenericRecord> {\n items: T[];\n meta: Meta;\n}\n\nexport const resolveList = async <T = GenericRecord>(fn: ResolveListCallable<T>) => {\n try {\n const result = (await fn()) as IListResult<T>;\n return new ListResponse(result.items, result.meta);\n } catch (ex) {\n return new ListErrorResponse(ex);\n }\n};\n"],"names":["emptyResolver","resolve","fn","Response","ex","ErrorResponse","resolveList","result","ListResponse","ListErrorResponse"],"mappings":";AASO,MAAMA,gBAAgB,IAAO,EAAC;AAM9B,MAAMC,UAAU,OAA0BC;IAC7C,IAAI;QACA,OAAO,IAAIC,SAAS,MAAMD;IAC9B,EAAE,OAAOE,IAAI;QACT,OAAO,IAAIC,cAAcD;IAC7B;AACJ;AAWO,MAAME,cAAc,OAA0BJ;IACjD,IAAI;QACA,MAAMK,SAAU,MAAML;QACtB,OAAO,IAAIM,aAAaD,OAAO,KAAK,EAAEA,OAAO,IAAI;IACrD,EAAE,OAAOH,IAAI;QACT,OAAO,IAAIK,kBAAkBL;IACjC;AACJ"}
|