@conduit-client/generator-ts 2.0.1 → 3.0.0
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/dist/types/v1/generators/bindings-generator.d.ts +10 -0
- package/dist/v1/index.js +4529 -6503
- package/dist/v1/index.js.map +1 -1
- package/package.json +7 -7
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/v1/files/code.ts","../../src/v1/files/file.ts","../../src/v1/files/write-files.ts","../../src/v1/types/json-schema.ts","../../src/v1/types/type-definition.ts","../../src/v1/types/json-schema-declarations.ts","../../src/v1/types/resolve-all-of-type.ts","../../src/v1/types/normalized-type-definition.ts","../../src/v1/normalization/utils.ts","../../src/v1/generators/cache-control-generator.ts","../../src/v1/normalization/identifiable-type-generator.ts","../../src/v1/normalization/unidentifiable-type-generator.ts","../../src/v1/normalization/normalized-type-generator.ts","../../src/v1/normalization/normalize-code-gen/normalize-generator-service.ts","../../src/v1/normalization/type-registry-generator.ts","../../src/v1/normalization/graphql/base-type-generator.ts","../../src/v1/normalization/graphql/identifiable-type-generator.ts","../../src/v1/normalization/graphql/unidentifiable-type-generator.ts","../../src/v1/normalization/graphql/cursor-connection-type-generator.ts","../../src/v1/normalization/graphql/interface-type-generator.ts","../../src/v1/normalization/graphql/union-type-generator.ts","../../src/v1/normalization/graphql/document-root-type-generator.ts","../../src/v1/normalization/graphql-type-generator.ts","../../src/v1/normalization/graphql-type-registry-generator.ts","../../src/v1/generators/base-command-generator.ts","../../src/v1/generators/utils.ts","../../src/v1/generators/http-command-generator.ts","../../src/v1/generators/aura-command-generator.ts","../../src/v1/generators/aura-resource-cache-control-command-generator.ts","../../src/v1/generators/imperative-binding-generator.ts","../../src/v1/generators/imperative-legacy-binding-generator.ts","../../src/v1/generators/graphql-root-variable-names.ts","../../src/v1/generators/graphql-imperative-legacy-binding-generator.ts","../../src/v1/generators/wire-binding-generator.ts","../../src/v1/generators/graphql-imperative-binding-generator.ts","../../src/v1/generators/graphql-wire-binding-generator.ts","../../src/v1/generators/graphql-mutation-binding-generator.ts","../../src/v1/generators/bindings-generator.ts","../../src/v1/utils.ts","../../src/v1/generators/command-config-builder.ts","../../src/v1/generators/normalized-cache-control-generator-mixin.ts","../../src/v1/generators/graphql-normalized-cache-control-generator-mixin.ts","../../src/v1/generators/http-graphql-normalized-cache-control-command-generator.ts","../../src/v1/model/base-command-model.ts","../../src/v1/model/aura-command-model.ts","../../src/v1/model/http-command-model.ts","../../src/v1/model/aura-normalized-caching-command-model.ts","../../src/v1/model/aura-resource-caching-command-model.ts","../../src/v1/generators/aura-normalized-cache-control-command-generator.ts","../../src/v1/generators/http-normalized-cache-control-command-generator.ts","../../src/v1/model/http-normalized-caching-command-model.ts","../../../../../../node_modules/graphql/jsutils/devAssert.mjs","../../../../../../node_modules/graphql/jsutils/isObjectLike.mjs","../../../../../../node_modules/graphql/jsutils/invariant.mjs","../../../../../../node_modules/graphql/language/location.mjs","../../../../../../node_modules/graphql/language/printLocation.mjs","../../../../../../node_modules/graphql/error/GraphQLError.mjs","../../../../../../node_modules/graphql/error/syntaxError.mjs","../../../../../../node_modules/graphql/language/ast.mjs","../../../../../../node_modules/graphql/language/directiveLocation.mjs","../../../../../../node_modules/graphql/language/kinds.mjs","../../../../../../node_modules/graphql/language/characterClasses.mjs","../../../../../../node_modules/graphql/language/blockString.mjs","../../../../../../node_modules/graphql/language/tokenKind.mjs","../../../../../../node_modules/graphql/language/lexer.mjs","../../../../../../node_modules/graphql/jsutils/inspect.mjs","../../../../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../../../../node_modules/graphql/language/source.mjs","../../../../../../node_modules/graphql/language/parser.mjs","../../../../../../node_modules/graphql/jsutils/didYouMean.mjs","../../../../../../node_modules/graphql/jsutils/identityFunc.mjs","../../../../../../node_modules/graphql/jsutils/keyMap.mjs","../../../../../../node_modules/graphql/jsutils/keyValMap.mjs","../../../../../../node_modules/graphql/jsutils/mapValue.mjs","../../../../../../node_modules/graphql/jsutils/naturalCompare.mjs","../../../../../../node_modules/graphql/jsutils/suggestionList.mjs","../../../../../../node_modules/graphql/jsutils/toObjMap.mjs","../../../../../../node_modules/graphql/language/printString.mjs","../../../../../../node_modules/graphql/language/visitor.mjs","../../../../../../node_modules/graphql/language/printer.mjs","../../../../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs","../../../../../../node_modules/graphql/type/assertName.mjs","../../../../../../node_modules/graphql/type/definition.mjs","../../../../../../node_modules/graphql/utilities/typeComparators.mjs","../../../../../../node_modules/graphql/type/scalars.mjs","../../../../../../node_modules/graphql/type/directives.mjs","../../../../../../node_modules/graphql/jsutils/isIterableObject.mjs","../../../../../../node_modules/graphql/utilities/astFromValue.mjs","../../../../../../node_modules/graphql/type/introspection.mjs","../../../../../../node_modules/graphql/type/schema.mjs","../../../../../../node_modules/graphql/utilities/typeFromAST.mjs","../../../../../../node_modules/graphql/language/predicates.mjs","../../../../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs","../../../../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs","../../../../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs","../../../../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs","../../../../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs","../../../../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs","../../../../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs","../../../../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs","../../../../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs","../../../../../../node_modules/graphql/utilities/sortValueNode.mjs","../../../../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs","../../../../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs","../../../../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs","../../../../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs","../../../../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs","../../../../../../node_modules/graphql/utilities/valueFromAST.mjs","../../../../../../node_modules/graphql/execution/values.mjs","../../../../../../node_modules/graphql/execution/collectFields.mjs","../../../../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs","../../../../../../node_modules/graphql/jsutils/groupBy.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs","../../../../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs","../../../../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs","../../../../../../node_modules/graphql/validation/specifiedRules.mjs","../../../../../../node_modules/graphql/validation/ValidationContext.mjs","../../../../../../node_modules/graphql/validation/validate.mjs","../../../../../../node_modules/graphql/utilities/extendSchema.mjs","../../../../../../node_modules/graphql/utilities/buildASTSchema.mjs","../../src/v1/model/graphql-schema-model.ts","../../src/v1/model/aura-graphql-command-model.ts","../../src/v1/model/http-graphql-command-model.ts","../../src/v1/generators/aura-graphql-normalized-cache-control-command-generator.ts","../../src/v1/generators/api-family-module-generator.ts","../../src/v1/api-module-generator-service.ts"],"sourcesContent":["export type ImportableReference = (\n | {\n filename: string;\n }\n | {\n module: string;\n }\n) & {\n exportedSymbol?: string;\n isType: boolean;\n};\n\nexport type ImportableTypeReference = ImportableReference & { isType: true };\nexport type ImportableValueReference = ImportableReference & { isType: false };\n\n/**\n * Indicates if a value is an ImportableReference.\n *\n * @param x value to test\n * @returns true if x is an ImportableReference; false if not\n */\nexport function isImportableReference(x: any): x is ImportableReference {\n return (\n typeof x === 'object' &&\n x !== null &&\n (('filename' in x && typeof x.filename === 'string') ||\n ('module' in x && typeof x.module === 'string')) &&\n 'isType' in x &&\n typeof x.isType === 'boolean'\n );\n}\n\n// default importStringifier implementation\nfunction defaultImportStringifier(ir: ImportableReference): string {\n const source = 'filename' in ir ? `file:${ir.filename}` : `module:${ir.module}`;\n return `<<${source}:${ir.exportedSymbol}:${ir.isType})>>`;\n}\n\n/**\n * A Code instance holds a collection of TypeScript code.\n */\nexport class Code {\n // code can be strings or references that we need to import\n chunks: Array<string | ImportableReference> = [];\n\n /**\n * Constructor.\n *\n * @param chunks initial bits of code to include\n */\n constructor(...chunks: Array<string | ImportableReference>) {\n this.push(...chunks);\n }\n\n /**\n * Concatenates a set of Codes with an optional separator between them.\n *\n * @param codes Codes to be concatenated\n * @param separator separator to be inserted between the Codes\n * @returns concatenated Codes/separators\n */\n static join(codes: any[], separator: string = ''): Code {\n return codes.reduce(\n (joined: Code, code: any, i: number) => joined.push(i > 0 ? separator : '', code),\n new Code()\n );\n }\n\n /**\n * Appends new chunks of code to this list. Parameters are handled as follows:\n *\n * - undefined, null, '' - ignored\n * - string, ImportableReference - appended to this.chunks\n * - Code - chunks from the other Code are appended to this Code\n * - [] - desructured & individual elements processed\n * - al others - converted to a string & appended to this.chunks\n *\n * In the case of recursive values (Code & arrays), processing is done\n * depth-first.\n *\n * @param newChunks code to be appended\n * @returns this\n */\n push(...newChunks: any[]): this {\n for (const chunk of newChunks) {\n if (chunk === undefined || chunk === null || chunk === '') {\n continue;\n } else if (typeof chunk === 'string' || isImportableReference(chunk)) {\n this.chunks.push(chunk);\n } else if (chunk instanceof Code) {\n this.push(...chunk.chunks);\n } else if (Array.isArray(chunk)) {\n this.push(...chunk);\n } else {\n this.chunks.push('' + chunk);\n }\n }\n\n return this;\n }\n\n /**\n * Compares to another Code object to check\n * equivalence (i.e., chunks properties are identical)\n *\n * @param Code\n * @returns boolean\n */\n equals(comparison: Code): boolean {\n return this.toString() === comparison.toString();\n }\n\n /**\n * Returns the Code as a single string.\n *\n * @param options\n * importStringifier - function to convert ImportableReferences to strings.\n * Defaults to an internal function whose only guarantee is that equivalent\n * ImportableReferencesit will result in equivalent strings.\n * @returns string representation of the code\n */\n toString(\n options: {\n importStringifier?: (reference: ImportableReference) => string;\n } = {}\n ): string {\n const irToString = options.importStringifier || defaultImportStringifier;\n\n return this.chunks\n .map((chunk) => (isImportableReference(chunk) ? irToString(chunk) : chunk))\n .join('');\n }\n}\n\n/**\n * A tagged template literal wrapper for Code. Strings & parameters are\n * interleaved as chunks in the returned Code.\n *\n * @param strings strings from the tagged template literal\n * @param params expressions from the tagged template literal\n * @returns Code\n */\nexport function code(strings: TemplateStringsArray, ...params: any[]): Code {\n return strings.reduce(\n (result: Code, _: any, i: number) =>\n result.push(strings[i], i < params.length ? params[i] : undefined),\n new Code()\n );\n}\n","import * as path from 'path';\nimport * as prettier from 'prettier';\nimport {\n toTypeScriptSafeIdentifier,\n type NamedService,\n type ServiceDescriptor,\n} from '@conduit-client/utils';\nimport { Code } from './code';\nimport type { ImportableReference } from './code';\n\n/**\n * Service that builds TypeScript source files.\n */\nexport type FileService = {\n /**\n * Convenience method that creates a File if one with the\n * specified name does not already exist.\n *\n * @param filename filename\n * @returns File with the given filename\n */\n build(filename: string): File;\n\n /**\n * Files that have been created. Key is filename.\n */\n cache: ReadonlyMap<string, File>;\n};\n\nexport type NamedFileService<Name extends string = 'file'> = NamedService<Name, FileService>;\n\nexport type FileServiceDescriptor = ServiceDescriptor<FileService, '1.0'>;\n\n/**\n * A simple FileService implementation.\n */\nclass Files implements FileService {\n cache = new Map<string, File>();\n\n build(filename: string) {\n let file = this.cache.get(filename);\n\n if (!file) {\n this.cache.set(filename, (file = new File(filename)));\n }\n\n return file;\n }\n}\n\n/**\n * Constructs a new FileService.\n */\nexport function fileService(): FileService {\n return new Files();\n}\n\n/**\n * A class used to track and resolve the ImportableReferences used within a File.\n */\nclass Imports {\n // local symbols assigned to imports; used to ensure imports have unique names\n private localSymbols: Set<string> = new Set();\n\n // to keep track of the ImportableReferences we've already resolved\n private imports: {\n [relativeFilename: string]: {\n exportedSymbol?: string;\n localSymbol: string;\n isType: boolean;\n }[];\n } = {};\n\n /**\n * Constructor\n *\n * @param filename name of the importing file\n */\n constructor(private filename: string) {}\n\n /**\n * Computes a unique local symbol to use for an import.\n *\n * @param exportedSymbol symbol used on the export\n * @returns local symbol to be used\n */\n private uniqueSymbolFor(exportedSymbol: string): string {\n // use the exported name if it's not already taken; otherwise start\n // adding numeric suffixes until we find a unique local symbol\n let result = exportedSymbol,\n suffix = 1;\n\n while (this.localSymbols.has(result)) {\n result = `${exportedSymbol}$${suffix++}`;\n }\n\n // remember we've used this local symbol\n this.localSymbols.add(result);\n\n return result;\n }\n\n /**\n * Returns the local symbol to be used for an ImportableReference.\n *\n * @param filename file that defines the thing being imported\n * @param exportedSymbol symbol exported from file\n * @param isType true if the import is for a TypeScript type; false if it is for a value\n * @returns local symbol to use for the import\n */\n localSymbolFor(ref: ImportableReference): string {\n // if the import is from this file then just use exportedSymbol as the localSymbol\n if (ref.exportedSymbol && 'filename' in ref && ref.filename === this.filename) {\n return ref.exportedSymbol;\n }\n\n let from;\n if ('filename' in ref) {\n // compute relative path from this file to the file being imported from\n from = path\n .relative(path.dirname(this.filename), ref.filename)\n .replace(/\\.(js|ts)$/, '');\n\n // imports from files must always be relative\n if (!from.startsWith('.')) {\n from = './' + from;\n }\n } else {\n // use module name\n from = ref.module;\n }\n\n // see if we've already got a local symbol for this reference\n let imports = this.imports[from];\n if (!imports) {\n imports = this.imports[from] = [];\n }\n\n let result = imports.find(\n ({ exportedSymbol, isType }) =>\n exportedSymbol === ref.exportedSymbol && isType === ref.isType\n )?.localSymbol;\n if (result) {\n return result;\n }\n\n // no symbol yet, generate a new one\n result = this.uniqueSymbolFor(ref.exportedSymbol || toTypeScriptSafeIdentifier(from));\n imports.push({\n exportedSymbol: ref.exportedSymbol,\n localSymbol: result,\n isType: ref.isType,\n });\n\n return result;\n }\n\n /**\n * Generates the TypeScript import statements for the imported symbols.\n *\n * @param isType generate import statements for types (true) or values (false)\n * @returns TypeScript code for the import statements\n */\n toString(): string {\n let typeAbsoluteImportStatements: string[] = [];\n let nonTypeAbsoluteImportStatements: string[] = [];\n let typeRelativeImportStatements: string[] = [];\n let nonTypeRelativeImportStatements: string[] = [];\n\n Object.keys(this.imports).map((importFrom) => {\n const imports = this.imports[importFrom];\n\n // build imports\n [true, false].forEach((typeImports) => {\n const importClauses = imports\n .filter(({ isType }) => isType === typeImports)\n .map(\n ({ exportedSymbol, localSymbol }) =>\n `${exportedSymbol || 'default'}${\n localSymbol === exportedSymbol ? '' : ' as ' + localSymbol\n }`\n )\n .join(',');\n if (importClauses !== '') {\n let resultArray: string[];\n const isRelative = importFrom.startsWith('.');\n if (typeImports && isRelative) {\n resultArray = typeRelativeImportStatements;\n } else if (typeImports && !isRelative) {\n resultArray = typeAbsoluteImportStatements;\n } else if (!typeImports && isRelative) {\n resultArray = nonTypeRelativeImportStatements;\n } else {\n resultArray = nonTypeAbsoluteImportStatements;\n }\n\n resultArray.push(\n `import ${\n typeImports ? 'type ' : ''\n }{${importClauses}} from '${importFrom}';`\n );\n }\n });\n });\n\n // imports should be ordered with type imports last, absolute imports first, relative last\n return [\n ...nonTypeAbsoluteImportStatements.sort(),\n ...nonTypeRelativeImportStatements.sort(),\n ...typeAbsoluteImportStatements.sort(),\n ...typeRelativeImportStatements.sort(),\n ].join('');\n }\n}\n\n/**\n * A TypeScript source file.\n *\n * A File consists of arbirtrarily many appendable blocks of code, each\n * identified by a Symbol. A template determines how the blocks of code\n * are concatenated along with other code to create the final contents\n * of the file.\n */\nexport class File {\n /**\n * Symbol used to add code to the default block.\n */\n static DEFAULT_BLOCK = Symbol();\n\n /**\n * Code blocks for this file.\n */\n blocks = new Map<Symbol, Code>();\n\n /**\n * Template to use when assembling code blocks. Each entry in the array\n * specifies either literal code or the symbol associated with an entry\n * in blocks. The resulting Code objects are concatenated to create the\n * contents of the file.\n */\n template: Array<Code | Symbol> = [File.DEFAULT_BLOCK];\n\n constructor(readonly filename: string) {}\n\n /**\n * Appends new chunks of code to the default code block. Chunks are handled\n * as in Code.push().\n *\n * @param chunks code to be appended to the default code block\n * @returns this\n */\n push(...chunks: any[]): this {\n return this.pushTo(File.DEFAULT_BLOCK, ...chunks);\n }\n\n /**\n * Appends code to the specified code block within this file. Code chunks are\n * handled as in Code.push().\n *\n * @param block block to append code to\n * @param chunks code to be appended\n * @returns this\n */\n pushTo(block: Symbol, ...chunks: any[]): this {\n let code = this.blocks.get(block);\n\n if (!code) {\n this.blocks.set(block, (code = new Code()));\n }\n\n code.push(...chunks);\n\n return this;\n }\n\n /**\n * Returns the code for this File, with ImportableReferences resolved.\n *\n * @param options\n * prettififed - true to run the code through prettier\n * @returns TypeScript source code for this File\n */\n async toString(\n options: {\n prettified?: boolean;\n } = {}\n ): Promise<string> {\n const finalCode = new Code();\n for (const item of this.template) {\n finalCode.push(typeof item === 'symbol' ? this.blocks.get(item) : item);\n }\n\n const imports = new Imports(this.filename);\n const executableCode = finalCode.toString({\n importStringifier: (ir: ImportableReference) => imports.localSymbolFor(ir),\n });\n const code = imports.toString() + executableCode;\n\n if (options.prettified) {\n try {\n return prettier.format(code, { parser: 'typescript' });\n } catch (e) {\n return code;\n }\n }\n return code;\n }\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport type { NamedFileService } from './file';\n\n/**\n * Writes the files collected in a FileService to the filesystem.\n *\n * @param services files to be written\n * @param outputDir directory against which to resolve filenames\n * @param options\n * prettififed - true to run the code through prettier\n */\nexport async function writeFiles(\n services: NamedFileService,\n outputDir: string,\n options: {\n prettified?: boolean;\n } = {}\n): Promise<void> {\n const promises: Promise<any>[] = [];\n\n for (const file of services.file.cache.values()) {\n const filename = path.join(outputDir, file.filename);\n\n promises.push(\n fs.promises\n .mkdir(path.dirname(filename), { recursive: true })\n .then(async () => fs.promises.writeFile(filename, await file.toString(options)))\n );\n }\n\n await Promise.all(promises);\n}\n","import { type ObjectType, type Type } from '@conduit-client/model/v1';\nimport type {\n JSONSchema,\n ObjectType as ObjectJsonSchema,\n RefType,\n} from '@conduit-client/jsonschema-validate';\n\ntype JsonSchemaForOptions = {\n referenceFor?: (t: Type) => RefType | undefined;\n useReferences?: boolean;\n};\n\n/**\n * Returns the JSON schema for a specified type.\n *\n * @param type the type\n * @param options Options\n * @returns JSON schema for type\n */\nexport function jsonSchemaFor(type: Type, options: JsonSchemaForOptions = {}): JSONSchema {\n if (options.useReferences) {\n const existingRef = options.referenceFor?.(type);\n if (existingRef !== undefined) {\n return existingRef;\n }\n }\n\n if (type.type === 'any') {\n return true;\n }\n // arbitrary type with inheritance => allOf(the inherited types + the type w/o inheritance)\n else if (type.type === 'allOf') {\n return {\n allOf: schemasFor({ ...options, useReferences: true }, ...type.allOf),\n };\n } else if (type.type === 'oneOf') {\n return {\n oneOf: schemasFor({ ...options, useReferences: true }, ...type.oneOf),\n };\n } else if (type.type === 'object') {\n return buildObjectSchema(type, { ...options, useReferences: true });\n } else if (type.type === 'discriminatedObject') {\n // discriminated object => oneOf the discriminated types\n return {\n oneOf: schemasFor({ ...options, useReferences: true }, ...Object.values(type.mapping)),\n };\n } else if (type.type === 'array') {\n return {\n type: 'array',\n items: jsonSchemaFor(type.items!, {\n ...options,\n useReferences: true,\n }),\n };\n } else if (\n ['string', 'date', 'time', 'datetime', 'datetime-only'].some((t) => t === type.type)\n ) {\n return { type: 'string' };\n } else if (['double', 'number'].some((t) => t === type.type)) {\n return { type: 'number' };\n } else if (type.type === 'boolean') {\n return { type: 'boolean' };\n } else if (type.type === 'integer') {\n return { type: 'integer' };\n } else if (type.type === 'nil') {\n return { type: 'null' };\n } else if (type.type === 'not') {\n // short-circuit not-any => false\n if (type.not.type === 'any') {\n return false;\n }\n return {\n not: jsonSchemaFor(type.not, {\n ...options,\n useReferences: true,\n }),\n };\n } else if (type.type === 'enum') {\n // TODO: we need to update our jsonschema library to validate on enums\n return true;\n } else if (type.type === 'ref') {\n return jsonSchemaFor(type.$ref, {\n ...options,\n useReferences: true,\n });\n } else {\n throw new Error(`Found unsupported type generating JSONSchema: ${type.type}`);\n }\n}\n\n/**\n * Translates a set of Types to the corresponding JSON schemas, removing duplicates.\n *\n * @param options Options\n * @param types Types\n * @returns JSON schemas for the specified types, deduped\n */\nfunction schemasFor(options: JsonSchemaForOptions = {}, ...types: Type[]): JSONSchema[] {\n return types.reduce((schemas, type) => {\n const schema = jsonSchemaFor(type, { ...options, useReferences: true });\n if (!schemas.find((existing) => existing === schema)) {\n schemas.push(schema);\n }\n return schemas;\n }, [] as JSONSchema[]);\n}\n\n// constructs the JSON schema for a non-discriminated object type\nfunction buildObjectSchema(type: ObjectType, options: JsonSchemaForOptions = {}): ObjectJsonSchema {\n const required: string[] = [];\n const properties: Record<string, JSONSchema> = {};\n\n Object.entries(type.properties).forEach(([propName, propType]) => {\n if (propType.required) {\n required.push(propName);\n }\n properties[propName] = jsonSchemaFor(propType.type, {\n ...options,\n useReferences: true,\n });\n });\n\n return {\n type: 'object',\n properties,\n required,\n additionalProperties: jsonSchemaFor(type.additionalProperties, {\n ...options,\n useReferences: true,\n }),\n };\n}\n","import { type NamedService, toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { Code, code } from '../files';\nimport type { ImportableReference, NamedFileService } from '../files';\nimport type {\n DiscriminatedObjectType,\n ObjectType,\n Type,\n RefType,\n AllOfType,\n OneOf,\n} from '@conduit-client/model/v1';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\n\nexport type TypeDefinitionForOptions = {\n referenceFor?: (t: Type) => ImportableReference | undefined;\n useReferences?: boolean;\n};\n\nexport type ITypeDefinitionService = {\n build(type: Type | undefined): Code;\n};\n\nexport type NamedTypeDefinitionService = NamedService<'typeDefinition', ITypeDefinitionService>;\n\nexport class TypeDefinitionService implements ITypeDefinitionService {\n constructor(\n protected services: NamedAPIService & NamedFileService,\n private fileFor: (typename: string) => string = SINGLE_FILE\n ) {}\n\n cache = new Map<string, ImportableReference>();\n\n build(type: Type | undefined, useReferences = true) {\n return type\n ? this.buildTypeCode(type, {\n referenceFor: (t) => {\n const typename = this.services.api.api.types.nameOf(t);\n return typename ? this.buildTypeDeclaration(typename) : undefined;\n },\n useReferences,\n })\n : code`void`;\n }\n\n buildTypeCode(t: Type, options: TypeDefinitionForOptions): Code {\n // if we're allowed to use references, see if one exists for this type\n if (options.useReferences) {\n const reference = options.referenceFor?.(t);\n if (reference) {\n return code`${reference}`;\n }\n }\n\n // construct the definition for this type\n switch (t.type) {\n case 'allOf': {\n return this.buildAllOfCode(t, options);\n }\n case 'enum': {\n return Code.join(\n t.values.map((enumValue) => {\n if (typeof enumValue === 'string') {\n return `'${enumValue}'`;\n }\n\n return enumValue;\n }),\n '|'\n );\n }\n case 'boolean': {\n return code`boolean`;\n }\n\n case 'double':\n case 'integer': // treat as number for now, but need to check length & use bigint if needed\n case 'number': {\n return code`number`;\n }\n\n case 'nil': {\n return code`null`;\n }\n\n case 'object': {\n return this.buildObjectCode(t, options);\n }\n\n case 'discriminatedObject':\n return this.buildDiscriminatedObjectCode(t, options);\n\n case 'array': {\n return code`Array<${this.buildTypeCode(t.items, {\n ...options,\n useReferences: true,\n })}>`;\n }\n\n case 'oneOf': {\n return this.buildOneOfCode(t, options);\n }\n case 'time':\n case 'date':\n case 'datetime-only':\n case 'datetime':\n case 'string': {\n return code`string`;\n }\n\n case 'any': {\n return code`unknown`;\n }\n case 'not': {\n // no good way to express \"not something\" in typescript at the moment, defer until someone asks for it\n return code`any`;\n }\n case 'ref': {\n return this.buildReferenceCode(t, options);\n }\n }\n\n throw new Error(`unknown type: ${(t as any).type}`);\n }\n\n buildReferenceCode(refType: RefType, options: TypeDefinitionForOptions): Code {\n return this.buildTypeCode(refType.$ref, { ...options, useReferences: true });\n }\n\n buildObjectCode(t: ObjectType, options: TypeDefinitionForOptions): Code {\n const result: Code[] = [];\n result.push(...this.buildObjectProperties(t, options));\n result.push(...this.buildAdditionalProperties(t, options));\n\n return Code.join(result, '&');\n }\n\n buildDiscriminatedObjectCode(\n t: DiscriminatedObjectType,\n options: TypeDefinitionForOptions\n ): Code {\n const result: Code[] = [];\n\n if (Object.keys(t.mapping).length === 0) {\n // default to vanilla object type if no discriminated children are found\n return this.buildObjectCode(t.baseType, options);\n }\n\n Object.entries(t.mapping).forEach(([value, type]) => {\n result.push(\n code`(${this.buildTypeCode(type, {\n ...options,\n useReferences: true,\n })}&{${t.discriminator}:'${value}'})`\n );\n });\n\n return Code.join(result, '|');\n }\n\n buildObjectProperties(t: ObjectType, options: TypeDefinitionForOptions): Code[] {\n const result: Code[] = [];\n // recurse to get definitions for each property\n const propertyDefinitions = Object.entries(t.properties).map(\n ([name, { type, required }]) =>\n // ok to reference type names once we're inside a type\n code`${toTypeScriptSafeIdentifier(name) === name ? name : `'${name}'`}${required ? '' : '?'}:${this.buildTypeCode(\n type,\n {\n ...options,\n useReferences: true,\n }\n )}`\n );\n\n if (propertyDefinitions.length > 0) {\n result.push(code`{${Code.join(propertyDefinitions, ',')}}`);\n } else {\n result.push(code`object`);\n }\n\n return result;\n }\n\n buildAdditionalProperties(t: ObjectType, options: TypeDefinitionForOptions): Code[] {\n const result: Code[] = [];\n\n // No additional properties allowed, default to other parts of the type\n if (t.additionalProperties.type === 'not' && t.additionalProperties.not.type === 'any') {\n return result;\n }\n\n // Additional properties allowed, no schema specified, which means any value is allowed\n // but the type is not known\n if (t.additionalProperties.type === 'any') {\n result.push(code`Record<string,unknown>`);\n return result;\n }\n\n // Additional properties allowed and we have a schema\n result.push(\n code`Record<string,${this.buildTypeCode(t.additionalProperties, {\n ...options,\n useReferences: true,\n })}>`\n );\n\n return result;\n }\n\n buildAllOfCode(t: AllOfType, options: TypeDefinitionForOptions) {\n const allOfCode = t.allOf\n .filter((allOfType) => allOfType.type !== 'any')\n .map((allOfType) => {\n let canonicalType: Type = allOfType;\n while (canonicalType.type === 'ref') {\n canonicalType = canonicalType.$ref;\n }\n\n const type =\n canonicalType.type === 'discriminatedObject'\n ? canonicalType.baseType\n : canonicalType;\n return this.buildTypeCode(type, { ...options, useReferences: true });\n });\n\n if (allOfCode.length === 0) {\n return code`unknown`;\n }\n\n return Code.join(\n allOfCode.map((c) => code`(${c})`),\n '&'\n );\n }\n\n buildOneOfCode(t: OneOf, options: TypeDefinitionForOptions) {\n const oneofCodes = t.oneOf.map((oneOfType) =>\n this.buildTypeCode(oneOfType, { ...options, useReferences: true })\n );\n\n // Note: prettier will remove the parenthesis when not needed.\n return code`(${Code.join(oneofCodes, '|')})`;\n }\n\n getExportedSymbol(typename: string): string {\n return toTypeScriptSafeIdentifier(typename);\n }\n\n // as defined in TypeDeclarationService\n buildTypeDeclaration(typename: string): ImportableReference {\n // see if we've already built this type\n const cacheResult = this.cache.get(typename);\n if (cacheResult) {\n return cacheResult;\n }\n\n // find the type in the API's TypeRegistry\n const typeRegistry = this.services.api.api.types;\n const type = typeRegistry.get(typename);\n if (!type) {\n throw new Error(`type ${typename} is not defined in the model`);\n }\n\n const filename = this.fileFor(typename);\n\n // in cases of types with unsafe characters in the type name, convert\n // to underscores for the exported symbol\n const exportedSymbol = this.getExportedSymbol(typename);\n const result = {\n filename,\n exportedSymbol,\n isType: true,\n };\n // pre-register the declaration; this is done to prevent loops for\n // recursive types\n this.cache.set(typename, result);\n // build the type declaration\n const declaration = code`export type ${exportedSymbol}=${this.build(type, false)};`;\n this.services.file.build(filename).push(declaration);\n\n return result;\n }\n}\n\nexport function typeDefinitions(\n services: NamedAPIService & NamedFileService,\n options: {\n fileFor?: (typename: string) => string;\n } = {}\n) {\n return new TypeDefinitionService(services, options.fileFor || SINGLE_FILE);\n}\n\n// fileFor function that places each type in its own file under the types/ directory\nexport const FILE_PER_TYPE = (typename: string) => `types/${typename}.ts`;\n\n// fileFor function that places all types in a types/types.ts file\nexport const SINGLE_FILE = (_: string) => 'types/types.ts';\n","import { JSONStringify, type NamedService } from '@conduit-client/utils';\nimport { code } from '../files';\nimport { jsonSchemaFor } from './json-schema';\nimport type { Type } from '@conduit-client/model/v1';\nimport type { APIService, NamedAPIService } from '@conduit-client/model/v1';\nimport type { Code, File, FileService, ImportableReference, NamedFileService } from '../files';\nimport type { RefType } from '@conduit-client/jsonschema-validate';\n\n/**\n * A JsonSchemaDeclarationService constructs & tracks JSONSchema definitions for types.\n */\nexport type JsonSchemaDeclarationService = {\n /**\n * Returns a JSONSchema for a specified Type.\n *\n * @param type type to build JSON Schema for. The specified type can be a type in the TypeRegistry\n * associated with this service, contain references to a type in the TypeRegistry, or be a standalone\n * type with no connection to the TypeRegistry.\n * @returns Code containing a TypeScript expression of the JSON schema for the type, eg \"{type:'string'}\"\n * or \"{type:'object',properties:{foo:{$ref:'#/$defs/bar'}},...<ImportableReference>}\". The Code will contain\n * ImportableReferences if the input type references any Types in the service's TypeRegistry.\n */\n build(type: Type): Code;\n};\n\nexport type NamedJSONSchemaDeclarationService<Name extends string = 'jsonSchema'> = NamedService<\n Name,\n JsonSchemaDeclarationService\n>;\n\n// fileFor function that places all named type schemas in a json-schema/schema.ts file\nconst SCHEMA_FILE_PATH = 'json-schema/index.ts';\nconst COMBINED_SCHEMA: ImportableReference = {\n filename: SCHEMA_FILE_PATH,\n exportedSymbol: 'DECLARED_TYPE_DEFINITIONS',\n isType: false,\n};\n\n// identifier for block of $defs code in SCHEMA_FILE_PATH\nconst DEFS_BLOCK = Symbol();\n\n/**\n * An implementation of JsonSchemaDeclarationService that consumes Types from an APIService\n * and generates JSONSchema in Files from a FileService.\n */\nclass JSONSchemas implements JsonSchemaDeclarationService {\n private generated = new Set<Type>();\n private file?: File;\n\n constructor(private services: NamedAPIService & NamedFileService) {}\n\n build(type: Type): Code {\n let usedRef = false;\n const jsonSchemaDef = jsonSchemaFor(type, {\n referenceFor: (t: Type) => {\n const ref = this.getReferenceFor(t);\n if (ref) {\n usedRef = true;\n }\n return ref;\n },\n useReferences: true,\n });\n\n const defCodeString = JSON.stringify(jsonSchemaDef);\n if (usedRef) {\n return code`{...${COMBINED_SCHEMA},${defCodeString.replace('{', '')}`;\n } else {\n return code`${defCodeString}`;\n }\n }\n\n // Logic pulled out to util function to support deeply nested references to defined types.\n private getReferenceFor(type: Type): RefType | undefined {\n const typename = this.services.api.api.types.nameOf(type);\n if (typename === undefined) {\n return undefined;\n }\n\n if (!this.generated.has(type)) {\n // short-circuit recursive type definitions\n this.generated.add(type);\n\n // we'll need the shared schema file\n if (!this.file) {\n this.file = this.services.file.build(SCHEMA_FILE_PATH);\n this.file.template = [\n code`export const ${COMBINED_SCHEMA.exportedSymbol}={$defs:{`,\n DEFS_BLOCK,\n code`}}`,\n ];\n }\n\n // add schema to the combined schema file\n this.file.pushTo(\n DEFS_BLOCK,\n code`\"${typename}\":${JSONStringify(\n jsonSchemaFor(type, { referenceFor: this.getReferenceFor.bind(this) })\n )},`\n );\n }\n\n return { $ref: `#/$defs/${typename}` };\n }\n}\n\n/**\n * Creates a JsonSchemaDeclarationService.\n *\n **/\nexport function jsonSchemaDeclarationService(services: {\n api: APIService;\n file: FileService;\n}): JsonSchemaDeclarationService {\n return new JSONSchemas(services);\n}\n","import {\n AllOfType,\n EnumType,\n isAllOfType,\n isAnyType,\n isArrayType,\n isBooleanType,\n isCanonicalNumberType,\n isCanonicalStringType,\n isDiscriminatedObjectType,\n isEnumType,\n isNotType,\n isObjectType,\n isOneOfType,\n isRefType,\n isScalar,\n isNilType,\n ObjectType,\n OneOf,\n Property,\n ScalarType,\n Type,\n typesEqual,\n NilType,\n} from '@conduit-client/model/v1';\nimport { err, ok, Result } from '@conduit-client/utils';\n\n/**\n * This function is intended to collapse an allOf type into it's concrete type\n * This is allows code generation to operate on a single, canonical type definition\n * that has had any composition resolved. This process occurs by recursively applying\n * intersection between all the members of the allof. If at any point an intersection\n * results in an \"impossible\" type, e.g. string & number, an error is thrown.\n *\n * Please reference the OpenAPI spec to see the intention of composed allOfs:\n * https://spec.openapis.org/oas/v3.1.0.html#composition-and-inheritance-polymorphism\n * @param type The all of type to resolve\n * @returns a resolved type\n */\nexport function resolveAllOfType(type: AllOfType): Type {\n const result = type.allOf.reduce<Result<Type, Error>>(\n (prev, curr) => {\n if (prev.isErr()) {\n return prev;\n }\n // allOf inherently is a composition, so should ignore the top level\n // extensions since extensions aren't inherited\n return intersectTypes(prev.value, { ...curr, extensions: undefined });\n },\n ok({ type: 'any' })\n );\n\n if (result.isErr()) {\n throw result.error;\n }\n\n return result.value;\n}\n\nexport function intersectTypes(a: Type, b: Type): Result<Type, Error> {\n let result: Result<Type, Error> | undefined = undefined;\n\n if (isAnyType(a)) {\n result = ok(b);\n } else if (isAnyType(b)) {\n result = ok(a);\n } else if (isRefType(a)) {\n result = intersectTypes(a.$ref, b);\n } else if (isRefType(b)) {\n result = intersectTypes(a, b.$ref);\n } else if (isAllOfType(a)) {\n result = intersectTypes(resolveAllOfType(a), b);\n } else if (isAllOfType(b)) {\n result = intersectTypes(a, resolveAllOfType(b));\n } else if (isOneOfType(a)) {\n result = intersectOneOf(a, b);\n } else if (isOneOfType(b)) {\n result = intersectOneOf(b, a);\n } else if (isNotType(a)) {\n // We're not going to handle not types, so just defer to the other type\n result = ok(b);\n } else if (isNotType(b)) {\n result = ok(a);\n } else if (isObjectType(a) && isObjectType(b)) {\n result = intersectObjects(a, b);\n } else if (\n (isObjectType(a) && !isObjectType(b) && !isDiscriminatedObjectType(b)) ||\n (isObjectType(b) && !isObjectType(a) && !isDiscriminatedObjectType(a))\n ) {\n result = err(new Error('Object type and non object type cannot be combined'));\n } else if (isObjectType(a) && isDiscriminatedObjectType(b)) {\n result = intersectObjects(a, b.baseType);\n } else if (isDiscriminatedObjectType(a) && isObjectType(b)) {\n result = intersectObjects(a.baseType, b);\n } else if (isDiscriminatedObjectType(a) && isDiscriminatedObjectType(b)) {\n result = err(new Error('Cannot intersect two discriminated objects'));\n } else if (isArrayType(a) && isArrayType(b)) {\n const combinedItemsResult = intersectTypes(a.items, b.items);\n if (combinedItemsResult.isErr()) {\n result = combinedItemsResult;\n } else {\n result = ok({ type: 'array' as const, items: combinedItemsResult.value });\n }\n } else if ((isArrayType(a) && !isArrayType(b)) || (isArrayType(b) && !isArrayType(a))) {\n result = err(new Error('Array type and non array type cannot be combined'));\n } else if (isScalar(a) && isScalar(b)) {\n if (a.type !== b.type) {\n result = err(new Error(`Type mismatch during allOf resolution`));\n } else {\n // We assume here that all scalars types of the same type are the same. This may not\n // be true in the future if we handle date time formats independently\n result = ok(b);\n }\n } else if (isScalar(a) && isEnumType(b)) {\n result = combineScalarAndEnum(a, b);\n } else if (isEnumType(a) && isScalar(b)) {\n result = combineScalarAndEnum(b, a);\n } else if (\n (isScalar(a) && !isScalar(b) && !isEnumType(b)) ||\n (isScalar(b) && !isScalar(a) && !isEnumType(a))\n ) {\n result = err(new Error(`Cannot combine types ${a.type} and ${b.type}`));\n } else if (isNilType(a) && isNilType(b)) {\n result = ok(a);\n } else if (isNilType(a) && isEnumType(b)) {\n result = combineNilAndEnum(a, b);\n } else if (isEnumType(a) && isNilType(b)) {\n result = combineNilAndEnum(b, a);\n }\n\n if (result === undefined) {\n return err(new Error(`Unhandled intersection scenario for types ${a.type} and ${b.type}`));\n }\n\n if (result.isErr()) {\n return result;\n }\n\n return ok(resolveCanonicalIntersectedType(a, b, result.value));\n}\n\nfunction combineScalarAndEnum(a: ScalarType, b: EnumType) {\n // Enum is more specific than scalar, but the values of the\n // enum should be filtered to only those assignable to the scalar\n\n const values = b.values.filter((v) => {\n if (isCanonicalStringType(a) && typeof v === 'string') {\n return true;\n }\n\n if (isCanonicalNumberType(a) && typeof v === 'number') {\n return true;\n }\n\n if (isBooleanType(a) && typeof v === 'boolean') {\n return true;\n }\n\n return false;\n });\n\n if (values.length === 0) {\n return err(new Error('No enum values valid after intersection'));\n }\n\n return ok({\n type: 'enum' as const,\n values,\n });\n}\n\nfunction combineNilAndEnum(a: NilType, b: EnumType) {\n if (b.values.includes(null)) {\n return ok(a);\n }\n\n return err(new Error('Cannot combine nil type and enum type that does not include null'));\n}\n\nfunction intersectObjects(a: ObjectType, b: ObjectType) {\n let errs: Error[] = [];\n const intersectedProps = Object.entries(a.properties).reduce(\n (prev, [propName, prop]) => {\n if (propName in b.properties) {\n const bProp = b.properties[propName];\n const newPropTypeResult = intersectTypes(prop.type, bProp.type);\n if (newPropTypeResult.isOk()) {\n prev[propName] = {\n type: newPropTypeResult.value,\n required: prop.required || bProp.required,\n };\n return prev;\n }\n\n errs.push(newPropTypeResult.error);\n return prev;\n } else {\n const newPropTypeResult = intersectTypes(prop.type, b.additionalProperties);\n if (newPropTypeResult.isOk()) {\n prev[propName] = { ...prop, type: newPropTypeResult.value };\n return prev;\n }\n\n errs.push(newPropTypeResult.error);\n return prev;\n }\n },\n {} as Record<string, Property>\n );\n\n Object.entries(b.properties).reduce((prev, [propName, prop]) => {\n if (propName in intersectedProps) {\n // already resolved\n return prev;\n }\n\n const newPropTypeResult = intersectTypes(prop.type, a.additionalProperties);\n if (newPropTypeResult.isOk()) {\n prev[propName] = { ...prop, type: newPropTypeResult.value };\n return prev;\n }\n errs.push(newPropTypeResult.error);\n\n return prev;\n }, intersectedProps);\n\n if (errs.length > 0) {\n return err(\n new Error(\n `Errors encountered during object resolution:\\n${errs.map((e) => `- ${e.message}`).join('\\n')}`\n )\n );\n }\n\n const intersectedAdditionalPropsResult = intersectTypes(\n a.additionalProperties,\n b.additionalProperties\n );\n if (intersectedAdditionalPropsResult.isErr()) {\n return intersectedAdditionalPropsResult;\n }\n\n return ok({\n type: 'object' as const,\n properties: intersectedProps,\n additionalProperties: intersectedAdditionalPropsResult.value,\n });\n}\n\nfunction intersectOneOf(a: OneOf, b: Type) {\n const intersectedOneOf = a.oneOf.reduce((prev, curr) => {\n const intersectResult = intersectTypes(curr, b);\n if (intersectResult.isErr()) {\n // Exclude this member of the one of from the result\n return prev;\n }\n\n if (intersectResult.value.type === 'oneOf') {\n prev.push(...intersectResult.value.oneOf);\n } else {\n prev.push(intersectResult.value);\n }\n return prev;\n }, [] as Type[]);\n\n if (intersectedOneOf.length === 0) {\n return err(new Error('Intersected union resulted in no possible values'));\n }\n\n return ok({ type: 'oneOf' as const, oneOf: intersectedOneOf });\n}\n\nfunction resolveCanonicalIntersectedType(a: Type, b: Type, result: Type) {\n if (typesEqual(a, result)) {\n return a;\n }\n\n if (typesEqual(b, result)) {\n return b;\n }\n\n return result;\n}\n","import { isIdentifiableType, isRefType, Type } from '@conduit-client/model/v1';\nimport { Code, code } from '../files';\nimport {\n ITypeDefinitionService,\n TypeDefinitionForOptions,\n TypeDefinitionService,\n} from './type-definition';\nimport { ImportableReference } from '../files';\nimport { toTypeScriptSafeIdentifier, type NamedService } from '@conduit-client/utils';\nimport type {\n AllOfType,\n DiscriminatedObjectType,\n NamedAPIService,\n OneOf,\n RefType,\n} from '@conduit-client/model/v1';\nimport type { NamedFileService } from '../files';\nimport { resolveAllOfType } from './resolve-all-of-type';\n\nconst NORMALIZED_LINK: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizedLink',\n isType: true,\n};\n\nexport type INormalizedTypeDefinitionService = {\n buildReference(type: Type): Code;\n buildRepresentation(type: Type): Code;\n};\n\nexport const SINGLE_FILE_NORMALIZED = (_: string) => 'normalization/types.ts';\n\nexport class NormalizedTypeDefinitionService\n extends TypeDefinitionService\n implements INormalizedTypeDefinitionService\n{\n constructor(\n services: NamedAPIService & NamedFileService,\n fileFor: (typename: string) => string = SINGLE_FILE_NORMALIZED\n ) {\n super(services, fileFor);\n }\n\n buildReference(t: Type): Code {\n return this.build(t);\n }\n\n buildRepresentation(t: Type): Code {\n let typeToBuild: Type = { ...t, extensions: undefined };\n if (t.type === 'discriminatedObject') {\n // TODO: there's an issue with copying the mapping from the discriminator since it's a getter, manually copying for now\n typeToBuild = { ...t, mapping: t.mapping, extensions: undefined };\n }\n return this.build(typeToBuild);\n }\n\n build(type: Type | undefined, useReferences = true) {\n if (!useReferences && type) {\n if (isIdentifiableType(type)) {\n // The referencing type will just get a NormalizedLink\n return new Code(NORMALIZED_LINK);\n }\n }\n\n return super.build(type, useReferences);\n }\n\n buildAllOfCode(allOfType: AllOfType, options: TypeDefinitionForOptions): Code {\n const resolved = resolveAllOfType(allOfType);\n return this.buildTypeCode(resolved, options);\n }\n\n buildOneOfCode(t: OneOf, options: TypeDefinitionForOptions): Code {\n const oneofCodes = t.oneOf.map((oneOfType, index) => {\n const normalizedTypeCode = this.buildTypeCode(oneOfType, {\n ...options,\n useReferences: true,\n });\n return code`{discriminator: '${index}', data: ${normalizedTypeCode}}`;\n });\n\n // Note: prettier will remove the parenthesis when not needed.\n return code`(${Code.join(oneofCodes, '|')})`;\n }\n\n buildDiscriminatedObjectCode(\n t: DiscriminatedObjectType,\n options: TypeDefinitionForOptions\n ): Code {\n const result: Code[] = [];\n\n if (Object.keys(t.mapping).length === 0) {\n // default to vanilla object type if no discriminated children are found\n return this.buildObjectCode(t.baseType, options);\n }\n\n Object.entries(t.mapping).forEach(([value, type]) => {\n result.push(\n code`({discriminator: '${value}', data: ${this.buildTypeCode(type, {\n ...options,\n useReferences: true,\n })}})`\n );\n });\n\n return Code.join(result, '|');\n }\n\n getExportedSymbol(typename: string): string {\n const normalizedTypename = `${typename}NormalizedReference`;\n return toTypeScriptSafeIdentifier(normalizedTypename);\n }\n}\n\nexport type NamedNormalizedTypeDefinitionService = NamedService<\n 'normalizedTypeDefinition',\n INormalizedTypeDefinitionService\n>;\n\nexport function normalizedTypeDefinitions(\n services: NamedAPIService & NamedFileService,\n options: {\n fileFor?: (typename: string) => string;\n } = {}\n): NormalizedTypeDefinitionService {\n return new NormalizedTypeDefinitionService(services, options.fileFor);\n}\n","import { code, type ImportableReference } from '../files';\n\nexport const CACHE: ImportableReference = {\n module: '@conduit-client/service-cache/v1',\n exportedSymbol: 'Cache',\n isType: true,\n};\n\nexport const READONLY_CACHE: ImportableReference = {\n module: '@conduit-client/service-cache/v1',\n exportedSymbol: 'ReadonlyCache',\n isType: true,\n};\n\nexport const NORMALIZED_LINK: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizedLink',\n isType: true,\n};\n\nexport const READ_ERRORS: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadErrors',\n isType: true,\n};\n\nexport const WRITE_ERRORS: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteErrors',\n isType: true,\n};\n\nexport const READ_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadInput',\n isType: true,\n};\nexport const WRITE_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteInput',\n isType: true,\n};\n\nexport const NORMALIZE_DATA_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizeDataInput',\n isType: true,\n};\n\nexport const DENORMALIZE_DATA_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'DenormalizeDataInput',\n isType: true,\n};\n\nexport const EXTRACT_READ_WRITE_DATA: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'extractReadWriteData',\n isType: false,\n};\n\nexport const BUILD_READ_WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'buildReadWriteResult',\n isType: false,\n};\n\nexport const OK: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'ok',\n isType: false,\n};\n\nexport const RESULT: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'Result',\n isType: true,\n};\n\nexport const READ_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadResult',\n isType: true,\n};\n\nexport const WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteResult',\n isType: true,\n};\n\nexport const DEEP_EQUALS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'deepEquals',\n isType: false,\n};\n\nexport const NAMED_CACHE_CONTROLLER_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const NAMED_PUB_SUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport const TYPE_SERVICES = code`${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUB_SUB_SERVICE}`;\n\nexport const NORMALIZE_UNION_REPRESENTATION: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'normalizeUnionRepresentation',\n isType: false,\n};\n\nexport const DENORMALIZE_UNION_REPRESENTATION: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'denormalizeUnionRepresentation',\n isType: false,\n};\n\nexport const VALIDATE_JSON_SCHEMA: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'validateJsonSchema',\n isType: false,\n};\n","import { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport { code } from '../files';\n\nexport function generateCacheControl(cacheControl: TypeCacheControlExtension) {\n return code`get cacheControl() {return ${getCacheControlValue(cacheControl)} as const}`;\n}\n\nfunction getCacheControlValue(cacheControl: TypeCacheControlExtension) {\n if (cacheControl.type === 'no-cache') {\n return code`{type: 'no-cache'}`;\n }\n return code`{type: 'max-age',maxAge: ${cacheControl['max-age']}}`;\n}\n","import { code } from '../files';\nimport { Code } from '../files';\nimport {\n BUILD_READ_WRITE_RESULT,\n CACHE,\n DENORMALIZE_DATA_INPUT,\n NORMALIZE_DATA_INPUT,\n READ_ERRORS,\n READ_INPUT,\n READ_RESULT,\n READONLY_CACHE,\n TYPE_SERVICES,\n WRITE_ERRORS,\n WRITE_INPUT,\n WRITE_RESULT,\n} from './utils';\nimport type { ImportableReference } from '../files';\nimport type { IdentifiableType, Type } from '@conduit-client/model/v1';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { generateCacheControl } from '../generators/cache-control-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\n\nconst IDENTIFIABLE_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'IdentifiableTypeRepository',\n isType: false,\n};\n\nconst FLATTENED_KEY_SELF_IDENTIFIABLE_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'FlattenedKeySelfIdentifiableTypeRepository',\n isType: false,\n};\n\nconst RESULT: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'Result',\n isType: true,\n};\n\n/**\n * Generates the normalizer class for an identifiable type\n * @param services The services required for this function. TypeDefinitionService is used to generate utility types.\n * TypeRegistryGeneratorService is used to build references to child types\n * @param type The type to generate the normalizer for\n * @param options Options for generating the type, including the type name, namespace, and an optional key param override\n * @returns Class name and code for the build type class\n */\nexport function generateIdentifiableType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: IdentifiableType,\n options: {\n className: string;\n namespace: string;\n name: string;\n keyParamType?: Type;\n }\n) {\n const dataType = services.typeDefinition.build(type);\n const normalizedRepType = services.normalizedTypeDefinition.buildRepresentation(type);\n\n const isSelfIdentifying = options.keyParamType === undefined;\n const normalizationCode = services.normalizeGenerator.build(type, {\n namespace: options.namespace,\n typeRegistryRef: code`this.typeRegistry`,\n cacheRef: code`cache`,\n denormalizeDataRef: code`input.normalizedData`,\n normalizeDataRef: code`input.data`,\n errorsRef: code`errors`,\n existingNormalizedDataRef: code`input.existingNormalizedData`,\n });\n\n const typescriptSafeName = toTypeScriptSafeIdentifier(options.name);\n const readInput = code`${typescriptSafeName}ReadInput`;\n const writeInput = code`${typescriptSafeName}WriteInput`;\n const normalizeDataInput = code`${typescriptSafeName}NormalizeDataInput`;\n const denormalizeDataInput = code`${typescriptSafeName}DenormalizeDataInput`;\n return code`\n type NormalizedRepresentation = ${normalizedRepType};\n type Data = ${dataType};\n type KeyParams = ${buildMappedKey(type, dataType)};\n type ${readInput} = ${READ_INPUT}\n type ${writeInput} = ${WRITE_INPUT}<Data${isSelfIdentifying ? '' : ',{keyParams:KeyParams}'}>\n type ${normalizeDataInput} = ${NORMALIZE_DATA_INPUT}<Data, NormalizedRepresentation>\n type ${denormalizeDataInput} = ${DENORMALIZE_DATA_INPUT}<NormalizedRepresentation>\n export class ${options.className} extends ${isSelfIdentifying ? FLATTENED_KEY_SELF_IDENTIFIABLE_TYPE_REPOSITORY : IDENTIFIABLE_TYPE_REPOSITORY}<Data, NormalizedRepresentation, KeyParams, ${readInput}, ${writeInput}> {\n namespace = '${options.namespace}'\n typeName = '${options.name}'\n ${generateCacheControl(type.extensions['cache-control'])}\n keySchema = ${JSON.stringify(Object.keys(type.extensions.key.fields).sort())};\n \n constructor(protected typeRegistry: ${{ ...services.typeRegistryGenerator.build(), isType: true }}, services: ${TYPE_SERVICES}){super(services)}\n \n buildKeyParams(input: ${writeInput}){\n return ${isSelfIdentifying ? buildMappedKey(type, code`input.data`) : code`input.keyParams`}\n }\n denormalizeData(cache: ${READONLY_CACHE}, input: ${denormalizeDataInput}): ${RESULT}<${dataType},${READ_ERRORS}> {\n const errors: ${READ_ERRORS} = []\n const denormalized = ${normalizationCode.denormalize}\n return ${BUILD_READ_WRITE_RESULT}<Data, ${READ_ERRORS}>(denormalized, errors)\n }\n normalizeData(cache: ${CACHE}, input: ${normalizeDataInput}): ${RESULT}<${normalizedRepType}, ${WRITE_ERRORS}> {\n const errors: ${WRITE_ERRORS} = []\n const normalized = ${normalizationCode.normalize}\n return ${BUILD_READ_WRITE_RESULT}<NormalizedRepresentation, ${WRITE_ERRORS}>(normalized, errors)\n }\n }`;\n}\n\nfunction buildMappedKey(type: IdentifiableType, typeCode: Code): Code {\n return code`{${Code.join(\n Object.entries(type.extensions.key.fields).map(([keyParamName, typePath]) => {\n const typePathParts = typePath.split('.');\n const accessor = typePathParts.reduce((prev, curr) => {\n return code`${prev}['${curr}']`;\n }, new Code());\n return code`${keyParamName}:${typeCode}${accessor}`;\n }),\n ','\n )}}`;\n}\n","import { code } from '../files';\nimport {\n BUILD_READ_WRITE_RESULT,\n CACHE,\n DEEP_EQUALS,\n DENORMALIZE_DATA_INPUT,\n NORMALIZE_DATA_INPUT,\n READ_ERRORS,\n READONLY_CACHE,\n TYPE_SERVICES,\n WRITE_ERRORS,\n} from './utils';\nimport type { UnidentifiableType } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\n\nconst TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'TypeRepository',\n isType: true,\n};\n\nconst WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteResult',\n isType: true,\n};\n\n/**\n * Generates the normalizer class for an unidentifiable type\n * @param services The services required for this function. TypeDefinitionService is used to generate utility types.\n * TypeRegistryGeneratorService is used to build references to child types\n * @param type The type to generate the normalizer for\n * @param options Options for generating the type, including the type name and namespace\n * @returns Class name and code for the build type class\n */\nexport function generateUnidentifiableType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: UnidentifiableType,\n options: {\n namespace: string;\n name: string;\n className: string;\n }\n) {\n const dataType = services.typeDefinition.build(type);\n const normalizedRefType = services.normalizedTypeDefinition.buildReference(type);\n\n const normalizationCode = services.normalizeGenerator.build(type, {\n namespace: options.namespace,\n typeRegistryRef: code`this.typeRegistry`,\n cacheRef: code`cache`,\n denormalizeDataRef: code`input.normalizedData`,\n normalizeDataRef: code`input.data`,\n existingNormalizedDataRef: code`input.existingNormalizedData`,\n errorsRef: code`errors`,\n });\n const typescriptSafeName = toTypeScriptSafeIdentifier(options.name);\n\n const writeInput = code`${typescriptSafeName}WriteInput`;\n const readInput = code`${typescriptSafeName}ReadInput`;\n\n return code`\n type Data = ${dataType}\n type NormalizedReference = ${normalizedRefType};\n\n type ${writeInput} = ${NORMALIZE_DATA_INPUT}<Data, NormalizedReference>\n type ${readInput} = ${DENORMALIZE_DATA_INPUT}<NormalizedReference>\n export class ${options.className} implements ${TYPE_REPOSITORY}<Data, ${readInput}, NormalizedReference, ${writeInput}> {\n namespace = '${options.namespace}'\n typeName = '${options.name}'\n\n constructor(protected typeRegistry: ${{ ...services.typeRegistryGenerator.build(), isType: true }}, services: ${TYPE_SERVICES}){}\n\n write(cache: ${CACHE}, input: ${writeInput}): ${WRITE_RESULT}<NormalizedReference> {\n const errors: ${WRITE_ERRORS} = []\n const normalized = ${normalizationCode.normalize}\n return ${BUILD_READ_WRITE_RESULT}<NormalizedReference, ${WRITE_ERRORS}>(normalized, errors)\n }\n\n read(cache: ${READONLY_CACHE}, input: ${readInput}){\n const errors: ${READ_ERRORS} = []\n const denormalized = ${normalizationCode.denormalize}\n return ${BUILD_READ_WRITE_RESULT}<Data, ${READ_ERRORS}>(denormalized, errors)\n }\n\n equals(a: Data, b: Data){return ${DEEP_EQUALS}(a,b)}\n }`;\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { generateIdentifiableType } from './identifiable-type-generator';\nimport { generateUnidentifiableType } from './unidentifiable-type-generator';\nimport type { ImportableValueReference, NamedFileService } from '../files';\nimport { isIdentifiableType, UnidentifiableType, type Type } from '@conduit-client/model/v1';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\n\nexport type INormalizedTypeGenerator = {\n build(options: {\n namespace: string;\n name: string;\n type: Type;\n keyParamType?: Type;\n }): ImportableValueReference;\n\n buildRef(options: {\n namespace: string;\n name: string;\n type: Type;\n keyParamType?: Type;\n }): ImportableValueReference;\n};\n\ntype Options = { namespace: string; name: string; type: Type; keyParamsType?: Type };\n\nexport const FILE_PER_NORMALIZED_TYPE = (typename: string) =>\n `normalization/${toTypeScriptSafeIdentifier(typename)}.ts`;\n\n/**\n * A class for building normalized type class implementations\n */\nexport class NormalizedTypeGenerator implements INormalizedTypeGenerator {\n constructor(\n protected services: NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n private fileFor: (typename: string) => string = FILE_PER_NORMALIZED_TYPE,\n private generateType: typeof defaultGenerateType = defaultGenerateType\n ) {}\n\n cache = new Map<string, ImportableValueReference>();\n\n protected typeBuildersSymbol = Symbol.for('typeBuilders');\n\n /**\n *\n * @param options The options for building the type normalizer, inclduing the namespace, the name, the type, and key param overrides\n * @returns An importable reference for the type class\n */\n build(options: Options): ImportableValueReference {\n const cacheKey = `${options.namespace}:${options.name}`;\n const cachedRef = this.cache.get(cacheKey);\n if (cachedRef) {\n return cachedRef;\n }\n\n const ref = this.buildRef(options);\n const className = ref.exportedSymbol;\n\n const file = this.services.file.build(ref.filename);\n this.cache.set(cacheKey, ref);\n\n const code = this.generateType(this.services, options.type, { ...options, className });\n\n file.push(code);\n\n return ref;\n }\n\n buildRef(options: Options) {\n const filename = this.fileFor(options.name!);\n const className = toTypeScriptSafeIdentifier(`${options.name}Repository`);\n const ref = { filename, exportedSymbol: className, isType: false } as const;\n return ref;\n }\n}\n\nfunction defaultGenerateType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: Type,\n options: Options & { className: string }\n) {\n return isIdentifiableType(type)\n ? generateIdentifiableType(services, type, options)\n : generateUnidentifiableType(services, type as UnidentifiableType, options);\n}\n","import { type NamedService } from '@conduit-client/utils';\nimport { Code, code } from '../../files';\nimport { type ObjectType, type Type } from '@conduit-client/model/v1';\nimport type { DiscriminatedObjectType, NamedAPIService, OneOf } from '@conduit-client/model/v1';\nimport { NamedTypeRegistryGeneratorService } from '../type-registry-generator';\nimport {\n DENORMALIZE_UNION_REPRESENTATION,\n EXTRACT_READ_WRITE_DATA,\n NORMALIZE_UNION_REPRESENTATION,\n VALIDATE_JSON_SCHEMA,\n} from '../utils';\nimport {\n NamedJSONSchemaDeclarationService,\n NamedNormalizedTypeDefinitionService,\n NamedTypeDefinitionService,\n} from '../../types';\nimport { resolveAllOfType } from '../../types/resolve-all-of-type';\n\n/**\n * The input options for the normalize generator service. Includes all the\n * data and code references required to build an implementation of normalize & denormalize method bodies\n */\ntype Options = {\n namespace: string;\n typeRegistryRef: Code;\n cacheRef: Code;\n denormalizeDataRef: Code;\n normalizeDataRef: Code;\n existingNormalizedDataRef: Code;\n errorsRef: Code;\n useReferences?: boolean;\n};\n\n/**\n * The result type of the normalize generator service\n */\ntype NormalizationCode = {\n normalize: Code;\n denormalize: Code;\n};\n\n/**\n * An interface for a service that builds the normalization and denormalization code\n * for a given type, given a set of code references for required variables, e.g.\n * a type registry, the data to normalized/denormalize, etc.\n */\nexport type INormalizeGeneratorService = {\n build(type: Type, options: Options): NormalizationCode;\n};\n\n/**\n * The named service definition for the normalize generator\n */\nexport type NamedNormalizeGeneratorService = NamedService<\n 'normalizeGenerator',\n INormalizeGeneratorService\n>;\n\n/**\n * The implementation of the normalize generator service.\n */\nexport class NormalizeGeneratorService implements INormalizeGeneratorService {\n constructor(\n protected services: NamedAPIService &\n NamedTypeRegistryGeneratorService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService &\n NamedJSONSchemaDeclarationService\n ) {}\n\n /**\n * The public interface method for the normalize generator service, used\n * to build the body of denormalize/normalize methods.\n * @param type The type to generate normalization/denormalization code for\n * @param options The set of required input options to generate the code\n * @returns The normalize and denormalize code\n */\n build(type: Type, options: Options): NormalizationCode {\n const c = this.buildNormalizeCode(type, options);\n if (c === undefined) {\n return {\n normalize: code`${options.normalizeDataRef}`,\n denormalize: code`${options.denormalizeDataRef}`,\n };\n }\n\n return c;\n }\n\n buildNormalizeCode(type: Type, options: Options): NormalizationCode | undefined {\n const { namespace, typeRegistryRef, cacheRef, denormalizeDataRef, normalizeDataRef } =\n options;\n const typeName = this.services.api.api.types.nameOf(type);\n\n if (typeName !== undefined && options.useReferences) {\n const build = (dataRef: Code, method: 'write' | 'read') =>\n code`${EXTRACT_READ_WRITE_DATA}(${typeRegistryRef}.${this.services.typeRegistryGenerator.buildType(type, { name: typeName, namespace }).propertyName}.${method}(${cacheRef},${method === 'read' ? `{normalizedData:${dataRef}}` : `{data:${dataRef}, existingNormalizedData:${options.existingNormalizedDataRef}}`}), ${options.errorsRef})`;\n return {\n normalize: build(normalizeDataRef, 'write'),\n denormalize: build(denormalizeDataRef, 'read'),\n };\n }\n\n // otherwise, we need to traverse the type\n switch (type.type) {\n case 'allOf': {\n return this.buildNormalizeCode(resolveAllOfType(type), options);\n }\n case 'object': {\n return this.buildObjectCode(type, options);\n }\n\n case 'discriminatedObject':\n return this.buildDiscriminatedObjectCode(type, options);\n\n case 'array': {\n const itemsNormalizationCode = this.buildNormalizeCode(type.items, {\n ...options,\n normalizeDataRef: code`el`,\n denormalizeDataRef: code`el`,\n useReferences: true,\n existingNormalizedDataRef: code`${options.existingNormalizedDataRef}?.[idx]`,\n });\n if (itemsNormalizationCode === undefined) {\n return undefined;\n }\n const itemType = this.services.typeDefinition.build(type.items);\n const normalizedItemType = this.services.normalizedTypeDefinition.buildReference(\n type.items\n );\n\n const build = (dataRef: Code, itemTransform: Code, itemType: Code) =>\n code`${dataRef}.map((el: ${itemType}, idx: number) => {return ${itemTransform}})`;\n return {\n normalize: build(normalizeDataRef, itemsNormalizationCode.normalize, itemType),\n denormalize: build(\n denormalizeDataRef,\n itemsNormalizationCode.denormalize,\n normalizedItemType\n ),\n };\n }\n\n case 'oneOf': {\n return this.buildOneOfCode(type, options);\n }\n\n case 'ref': {\n return this.buildNormalizeCode(type.$ref, { ...options, useReferences: true });\n }\n case 'enum':\n case 'boolean':\n case 'double':\n case 'integer':\n case 'number':\n case 'nil':\n case 'time':\n case 'date':\n case 'datetime-only':\n case 'datetime':\n case 'string':\n case 'any':\n case 'not': {\n return undefined;\n }\n }\n\n throw new Error(`unknown type: ${(type as any).type}`);\n }\n\n buildObjectCode(t: ObjectType, options: Options): NormalizationCode | undefined {\n const propCodes = this.buildPropCodes(t, options);\n const additionalPropsCode = this.buildAdditionalPropsCode(t, propCodes.length > 0, options);\n\n if (propCodes.length === 0 && additionalPropsCode === undefined) {\n return undefined;\n }\n\n const build = (\n dataRef: Code,\n propsCodes: Code[],\n additionalPropsCode: Code | undefined\n ) => {\n return code`{...${dataRef},${propsCodes.length > 0 ? code`${Code.join(propsCodes, ',')},` : code``}${additionalPropsCode ? code`...${additionalPropsCode}` : code``}}`;\n };\n\n return {\n normalize: build(\n options.normalizeDataRef,\n propCodes.map((c) => c.normalize),\n additionalPropsCode?.normalize\n ),\n denormalize: build(\n options.denormalizeDataRef,\n propCodes.map((c) => c.denormalize),\n additionalPropsCode?.denormalize\n ),\n };\n }\n\n buildPropCodes(t: ObjectType, options: Options): NormalizationCode[] {\n return Object.entries(t.properties)\n .map(([propName, prop]) => {\n const propAccessor = code`['${propName}']`;\n const normalizedPropRef = code`${options.normalizeDataRef}${propAccessor}`;\n const denormalizePropRef = code`${options.denormalizeDataRef}${propAccessor}`;\n const propTypeCode = this.buildNormalizeCode(prop.type, {\n ...options,\n normalizeDataRef: normalizedPropRef,\n denormalizeDataRef: denormalizePropRef,\n useReferences: true,\n existingNormalizedDataRef: code`input.existingNormalizedData?.${propAccessor}`,\n });\n if (propTypeCode === undefined) {\n return undefined;\n }\n if (prop.required) {\n const build = (propCode: Code) => code`${propName}: ${propCode}`;\n return {\n normalize: build(propTypeCode.normalize),\n denormalize: build(propTypeCode.denormalize),\n };\n } else {\n const build = (dataRef: Code, propCode: Code) =>\n code`${propName}: ${dataRef} ? ${propCode} : undefined`;\n return {\n normalize: build(normalizedPropRef, propTypeCode.normalize),\n denormalize: build(denormalizePropRef, propTypeCode.denormalize),\n };\n }\n })\n .filter((c) => c !== undefined) as NormalizationCode[];\n }\n\n buildAdditionalPropsCode(\n t: ObjectType,\n hasExplicitPropertiesDefined: boolean,\n options: Options\n ): NormalizationCode | undefined {\n let additionalPropertiesCode: NormalizationCode | undefined = undefined;\n\n const hasAdditionalProperties =\n t.additionalProperties.type !== 'not' || t.additionalProperties.not.type !== 'any';\n if (hasAdditionalProperties) {\n const additionalPropertiesTypeCode = this.buildNormalizeCode(t.additionalProperties, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`${options.denormalizeDataRef}![curr]`,\n normalizeDataRef: code`${options.normalizeDataRef}![curr]`,\n existingNormalizedDataRef: code`${options.existingNormalizedDataRef}?.[curr]`,\n });\n if (additionalPropertiesTypeCode !== undefined) {\n const build = (dataRef: Code, additionalPropsCode: Code) => {\n const filterAdditionalPropsByDefinedProps = hasExplicitPropertiesDefined\n ? code`.filter(key => ![${Code.join(\n Object.keys(t.properties).map((propName) => code`'${propName}'`),\n ','\n )}].includes(key))`\n : code``;\n return code`Object.keys(${dataRef})${filterAdditionalPropsByDefinedProps}.reduce((prev, curr) => {prev[curr]=${additionalPropsCode};return prev;}, {} as Record<string, unknown>)`;\n };\n additionalPropertiesCode = {\n normalize: build(\n options.normalizeDataRef,\n additionalPropertiesTypeCode.normalize\n ),\n denormalize: build(\n options.denormalizeDataRef,\n additionalPropertiesTypeCode.denormalize\n ),\n };\n }\n }\n\n return additionalPropertiesCode;\n }\n\n buildOneOfCode(type: OneOf, options: Options): NormalizationCode | undefined {\n const results = type.oneOf.map((oneOfType, index) => {\n const discriminator = `'${index}'`;\n const normalizeCode = this.buildNormalizeCode(oneOfType, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`data`,\n normalizeDataRef: code`data`,\n existingNormalizedDataRef: code`(${options.existingNormalizedDataRef})?.discriminator === ${discriminator} ? (${options.existingNormalizedDataRef})?.data : undefined`,\n });\n const jsonSchema = this.services.jsonSchema.build(oneOfType);\n\n return {\n discriminator,\n normalizeCode,\n jsonSchema,\n discriminatedType: oneOfType,\n };\n });\n\n if (results.every((r) => r.normalizeCode === undefined)) {\n return undefined;\n }\n\n const unionMap = code`{\n ${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {data: ${this.services.typeDefinition.build(r.discriminatedType)}, normalized: ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}}`;\n }),\n ','\n )}\n }`;\n\n return {\n normalize: code`${NORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.normalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {test: (data) => ${VALIDATE_JSON_SCHEMA}(data, ${r.jsonSchema}).isOk(), normalize: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.normalize} as ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}`}}`;\n }),\n ','\n )}})`,\n denormalize: code`${DENORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.denormalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: (data: any) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.denormalize} as ${this.services.typeDefinition.build(r.discriminatedType)}`}`;\n }),\n ','\n )}})`,\n };\n }\n\n buildDiscriminatedObjectCode(t: DiscriminatedObjectType, options: Options) {\n const results = Object.entries(t.mapping).map(([discriminator, discriminatedType]) => {\n const normalizeCode = this.buildNormalizeCode(discriminatedType, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`data`,\n normalizeDataRef: code`data`,\n existingNormalizedDataRef: code`(${options.existingNormalizedDataRef})?.discriminator === '${discriminator}' ? (${options.existingNormalizedDataRef})?.data : undefined`,\n });\n\n return {\n discriminator,\n normalizeCode,\n discriminatedType,\n };\n });\n\n if (results.every((r) => r.normalizeCode === undefined)) {\n return undefined;\n }\n\n const unionMap = code`{\n ${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {data: ${this.services.typeDefinition.build(r.discriminatedType)}, normalized: ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}}`;\n }),\n ','\n )}\n }`;\n\n return {\n normalize: code`${NORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.normalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {test: (data) => data['${t.discriminator}'] === '${r.discriminator}', normalize: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.normalize} as ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}`}}`;\n }),\n ','\n )}})`,\n denormalize: code`${DENORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.denormalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.denormalize} as ${this.services.typeDefinition.build(r.discriminatedType)}`}`;\n }),\n ','\n )}})`,\n };\n }\n}\n\nexport function normalizeGenerator(\n services: NamedTypeDefinitionService &\n NamedAPIService &\n NamedTypeRegistryGeneratorService &\n NamedJSONSchemaDeclarationService &\n NamedNormalizedTypeDefinitionService\n) {\n return new NormalizeGeneratorService(services);\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { Code, code } from '../files';\nimport { NormalizedTypeGenerator } from './normalized-type-generator';\nimport type {\n NamedJSONSchemaDeclarationService,\n NamedNormalizedTypeDefinitionService,\n NamedTypeDefinitionService,\n} from '../types';\nimport type { INormalizedTypeGenerator } from './normalized-type-generator';\nimport type { NamedService } from '@conduit-client/utils';\nimport type { File, ImportableValueReference, NamedFileService } from '../files';\nimport { NamedAPIService, isIdentifiableType, type Type } from '@conduit-client/model/v1';\nimport { TYPE_SERVICES } from './utils';\nimport {\n INormalizeGeneratorService,\n NamedNormalizeGeneratorService,\n NormalizeGeneratorService,\n} from './normalize-code-gen/normalize-generator-service';\n\ntype TypeRepositoryReference = { propertyName: string; typeClassRef: ImportableValueReference };\ntype Options = { name: string; namespace: string; keyParamType?: Type; isInvalidatable?: boolean };\n\nexport type ITypeRegistryGeneratorService = {\n build(): ImportableValueReference;\n buildType(type: Type, options: Options): TypeRepositoryReference;\n\n invalidatableTypes: TypeRepositoryReference[];\n};\n\nexport type NamedTypeRegistryGeneratorService<Name extends string = 'typeRegistryGenerator'> =\n NamedService<Name, ITypeRegistryGeneratorService>;\n\nconst TYPE_REGISTRY_CLASS = 'TypeRegistry';\n\n/**\n * A class for building the type registry for a given module\n */\nexport class TypeRegistryGenerator implements ITypeRegistryGeneratorService {\n constructor(\n protected services: NamedFileService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService,\n protected typeGenerator: INormalizedTypeGenerator,\n protected filename: string = TYPE_REGISTRY_FILE\n ) {}\n\n _file: File | undefined = undefined;\n\n protected typeDeclarationsSymbol = Symbol.for('typeDeclarations');\n protected typeInstantiationsSymbol = Symbol.for('typeInstantiations');\n protected typeGettersSymbol = Symbol.for('typeGetters');\n cache = new Map<string, TypeRepositoryReference>();\n\n /**\n * Note: Use with caution, it is only guaranteed to have the types with normalization\n * after all operations precessing is complete.\n */\n invalidatableTypes: TypeRepositoryReference[] = [];\n\n private get file() {\n return this.buildFile();\n }\n\n private buildFile(): File {\n if (this._file) {\n return this._file;\n }\n\n const file = this.services.file.build(this.filename);\n file.template = this.template;\n this._file = file;\n return file;\n }\n\n get template() {\n return [\n code`export class ${TYPE_REGISTRY_CLASS} {`,\n this.typeDeclarationsSymbol,\n code`constructor(protected services: ${TYPE_SERVICES}) {`,\n this.typeInstantiationsSymbol,\n code`}`,\n this.typeGettersSymbol,\n code`}`,\n ];\n }\n\n /**\n * A method for building the base type registry code, without any classes populated\n * @returns\n */\n build() {\n this.buildFile();\n return {\n filename: this.filename,\n exportedSymbol: TYPE_REGISTRY_CLASS,\n isType: false,\n } as const;\n }\n\n /**\n * A method for building/adding a specific type to the registry\n * @param type The type to add to the registry\n * @param options Options including namespace, name, and key overrides\n * @returns The name of the method on the registry used to build the type, and an importable reference to the type class\n */\n buildType(type: Type, options: Options) {\n const cacheKey = `${options.namespace}:${options.name}`;\n let cachedResult = this.cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n\n const propertyName = `${toTypeScriptSafeIdentifier(options.name)}`;\n const ref = this.typeGenerator.buildRef({ type, ...options });\n const result = { propertyName, typeClassRef: ref };\n this.cache.set(cacheKey, result);\n\n this.typeGenerator.build({ type, ...options });\n\n const privateName = code`_${propertyName}`;\n\n this.file.pushTo(this.typeDeclarationsSymbol, code`${privateName}: ${ref};`);\n this.file.pushTo(\n this.typeInstantiationsSymbol,\n code`this.${privateName} = new ${ref}(this, this.services);`\n );\n this.file.pushTo(\n this.typeGettersSymbol,\n code`get ${propertyName}(){return this.${privateName}}`\n );\n\n const builderMethodCode = new Code();\n builderMethodCode.push(\n code`${propertyName}(){ return new `,\n ref,\n code`(this, this.services) }`\n );\n\n if (\n isIdentifiableType(type) &&\n (options.isInvalidatable === undefined || options.isInvalidatable)\n ) {\n this.invalidatableTypes.push(result);\n }\n\n return result;\n }\n}\n\nexport const TYPE_REGISTRY_FILE = 'normalization/type-registry.ts';\n\n/**\n * Creates a TypeRegistryGeneratorService.\n *\n **/\nexport function typeRegistryGeneratorService(\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService &\n NamedJSONSchemaDeclarationService &\n Partial<NamedNormalizeGeneratorService>,\n typeGenerator?: INormalizedTypeGenerator\n): ITypeRegistryGeneratorService {\n const typeGeneratorServices: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedJSONSchemaDeclarationService &\n NamedNormalizedTypeDefinitionService = {\n ...services,\n typeRegistryGenerator: undefined as any,\n normalizeGenerator: undefined as any,\n };\n typeGeneratorServices.normalizeGenerator =\n services.normalizeGenerator || new NormalizeGeneratorService(typeGeneratorServices);\n\n const tg = typeGenerator || new NormalizedTypeGenerator(typeGeneratorServices);\n const typeRegistryGenerator = new TypeRegistryGenerator(services, tg);\n typeGeneratorServices.typeRegistryGenerator = typeRegistryGenerator;\n return typeRegistryGenerator;\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLFieldType,\n GraphQLListFieldType,\n GraphQLSchemaModel,\n GraphQLSingleFieldType,\n GraphQLTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\n\nexport const BASE_SCALAR_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseScalarFieldDef',\n isType: false,\n};\n\nexport const BASE_OBJECT_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseObjectFieldDef',\n isType: false,\n};\n\nexport const BASE_ARRAY_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseArrayFieldDef',\n isType: false,\n};\n\nexport const FIELD_DEFS: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'FieldDefs',\n isType: true,\n};\n\nexport const GRAPHQL_INPUT_EXTENSION: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLInputExtension',\n isType: true,\n};\n\nexport const GRAPHQL_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLData',\n isType: true,\n};\n\nexport const GRAPHQL_TYPE_SERVICES: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const GRAPHQL_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport type GenerationOptions = {\n namespace: string;\n name: string;\n className: string;\n};\n\nexport abstract class BaseGraphQLTypeGenerator<\n T extends GraphQLTypeModel & {\n fields?: Record<string, GraphQLFieldType>;\n interfaces?: string[];\n },\n> {\n constructor(protected services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService) {}\n\n /**\n * Determine if a GraphQL type should be treated as an object-like type\n * that needs a repository in the type registry\n */\n private isObjectLikeType(type: GraphQLTypeModel): boolean {\n return type.kind === 'object' || type.kind === 'interface' || type.kind === 'union';\n }\n\n /**\n * Ensure a referenced type is built and return the appropriate registry reference\n */\n protected ensureTypeBuiltAndGetReference(\n referencedType: GraphQLTypeModel,\n schemaModel: GraphQLSchemaModel\n ): Code {\n if (this.isObjectLikeType(referencedType)) {\n // Object-like type: ensure it's built and reference through typeRegistry\n const ref = this.services.graphqlTypeRegistryGenerator.buildGraphQLType({\n type: referencedType as any,\n schemaModel,\n });\n return code`this.typeRegistry.${ref.propertyName}`;\n } else {\n // For scalar/enum types, we might need different handling\n // For now, assume they don't need registry references\n throw new Error(\n `Type ${referencedType.name} is not an object-like type and cannot be referenced in possibleTypes`\n );\n }\n }\n\n /**\n * Generate a field definition for a single field type (recursive helper)\n */\n private generateSingleFieldDef(\n fieldType: GraphQLSingleFieldType | GraphQLListFieldType,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel\n ): Code {\n if (fieldType.kind === 'single') {\n const { name: typeName, nullable } = fieldType;\n const referencedType = schemaModel.types.find((t) => t.name === typeName);\n\n if (referencedType && this.isObjectLikeType(referencedType)) {\n // Object field: User, Post, etc. - ensure it's built and reference through typeRegistry\n const ref = this.ensureTypeBuiltAndGetReference(referencedType, schemaModel);\n return code`new ${BASE_OBJECT_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(${ref}, ${nullable})`;\n } else {\n // Scalar field: String, Int, ID, enum types, custom scalars, etc.\n // This covers built-in scalars, custom scalars, enums, and any unknown types\n return code`new ${BASE_SCALAR_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(${nullable})`;\n }\n } else if (fieldType.kind === 'list') {\n const { nullable: arrayNullable, items } = fieldType;\n\n // Generate the item field definition recursively\n const itemFieldDef = this.generateSingleFieldDef(\n items,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel\n );\n\n // Wrap in array field definition\n return code`new ${BASE_ARRAY_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(\n ${itemFieldDef},\n ${arrayNullable}\n )`;\n } else {\n throw new Error(`Unexpected field type in field definition.`);\n }\n }\n\n /**\n * Generate field definitions for a GraphQL type\n */\n protected generateFieldDefinitions(\n type: T,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel,\n namespace: string\n ): Code[] {\n if (!type.fields) {\n return [];\n }\n\n return Object.entries(type.fields).map(([fieldName, fieldType]) => {\n const fieldDef = this.generateSingleFieldDef(\n fieldType.type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel\n );\n\n return code`${fieldName}: ${fieldDef}`;\n });\n }\n\n /**\n * Generate complete fields property as a getter method to avoid circular dependencies\n */\n protected generateFieldsProperty(\n type: T,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel,\n namespace: string\n ): Code {\n const fieldDefs = this.generateFieldDefinitions(\n type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel,\n namespace\n );\n\n const fieldsCode = Code.join(fieldDefs, ',\\n ');\n\n return code`get fields() {\n return {\n ${fieldsCode}\n } satisfies ${FIELD_DEFS}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>;\n }`;\n }\n\n /**\n * Get the ImportableReference for the GraphQLTypeRegistry\n */\n protected getGraphQLTypeRegistryReference(): {\n filename: string;\n exportedSymbol: string;\n isType: false;\n } {\n return {\n filename: 'normalization/graphql-type-registry.ts',\n exportedSymbol: 'GraphQLTypeRegistry',\n isType: false,\n };\n }\n\n /**\n * Generate constructor that accepts services and type registry\n */\n protected generateConstructor(): Code {\n const typeRegistryRef = this.getGraphQLTypeRegistryReference();\n return code`constructor(\n protected services: ${GRAPHQL_TYPE_SERVICES} & ${GRAPHQL_PUBSUB_SERVICE},\n protected typeRegistry: ${typeRegistryRef}<ExtraInputExtension>\n ) {\n super(services);\n }`;\n }\n\n /**\n * Generate common properties shared by all GraphQL type repositories\n */\n protected generateCommonProperties(type: T, options: GenerationOptions): Code {\n return code`namespace = '${options.namespace}';\n typeName = '${type.name}';\n implementedInterfaces = ${JSON.stringify(type.interfaces || [])};\n `;\n }\n\n /**\n * Generate a standard GraphQL type class with common structure\n */\n protected generateStandardClass(\n type: T,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions,\n baseClass: ImportableReference,\n genericTypes: {\n data: string | ImportableReference;\n normalized: string | ImportableReference;\n },\n additionalMethods: Code[] = []\n ): Code {\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n\n // Generate fields property if the type has fields (for types that need field definitions)\n const fieldsProperty = this.generateFieldsProperty(\n type,\n genericTypes?.data || GRAPHQL_DATA,\n genericTypes?.normalized || 'any',\n schemaModel,\n options.namespace\n );\n\n const additionalMethodsCode =\n additionalMethods.length > 0 ? Code.join(additionalMethods, '\\n\\n ') : code``;\n\n // Conditionally include generic type parameters\n const baseClassWithGenerics = code`${baseClass}<${genericTypes.data}, ${genericTypes.normalized}, ExtraInputExtension>`;\n\n return code`\nexport class ${options.className}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>> extends ${baseClassWithGenerics} {\n ${commonProperties}\n\n ${constructor}${\n fieldsProperty\n ? code`\n\n ${fieldsProperty}`\n : code``\n }${\n additionalMethods.length > 0\n ? code`\n\n ${additionalMethodsCode}`\n : code``\n }\n}`;\n }\n\n /**\n * Generate a standard GraphQL type class for identifiable types with key params\n */\n protected generateIdentifiableClass(\n type: T,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions,\n baseClass: ImportableReference,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n keyParamsType: string,\n additionalMethods: Code[] = []\n ): Code {\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n const fieldsProperty = this.generateFieldsProperty(\n type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel,\n options.namespace\n );\n\n const additionalMethodsCode =\n additionalMethods.length > 0 ? Code.join(additionalMethods, '\\n\\n ') : code``;\n\n return code`\nexport class ${options.className}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>> extends ${baseClass}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ${keyParamsType}, ExtraInputExtension> {\n ${commonProperties}\n\n ${constructor}\n\n ${fieldsProperty}${\n additionalMethods.length > 0\n ? code`\n\n ${additionalMethodsCode}`\n : code``\n }\n}`;\n }\n\n /**\n * Abstract method to be implemented by specific type generators\n */\n abstract generate(type: T, schemaModel: GraphQLSchemaModel, options: GenerationOptions): Code;\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport { generateCacheControl } from '../../generators/cache-control-generator';\nimport type { GraphQLObjectTypeModel, GraphQLSchemaModel } from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst IDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'IdentifiableGraphQLTypeRepository',\n isType: false,\n};\n\nexport type IdentifiableGraphQLObjectType = GraphQLObjectTypeModel & {\n category: 'identifiable';\n idField: string;\n};\n\nexport class IdentifiableGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<IdentifiableGraphQLObjectType> {\n generate(\n type: IdentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n const keyParamsType = `{ ${type.idField}: string }`;\n const idField = code`idField = '${type.idField}'`;\n const cacheControl = generateCacheControl(type.metadata['cache-control']);\n\n return this.generateIdentifiableClass(\n type,\n schemaModel,\n options,\n IDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY,\n GRAPHQL_DATA,\n 'any',\n keyParamsType,\n [cacheControl, idField]\n );\n }\n}\n\nexport function generateIdentifiableGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: IdentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new IdentifiableGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type { GraphQLSchemaModel, GraphQLTypeModel } from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst UNIDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'UnidentifiableGraphQLTypeRepository',\n isType: false,\n};\n\nexport type UnidentifiableGraphQLObjectType = GraphQLTypeModel & {\n kind: 'object';\n category: 'unidentifiable';\n};\n\nexport class UnidentifiableGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<UnidentifiableGraphQLObjectType> {\n generate(\n type: UnidentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n UNIDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY,\n { data: GRAPHQL_DATA, normalized: 'any' } // For unidentifiable types, data use GraphQLData\n );\n }\n}\n\nexport function generateUnidentifiableGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: UnidentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new UnidentifiableGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n GraphQLTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions } from './base-type-generator';\n\nconst CURSOR_CONNECTION_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'CursorConnectionGraphQLTypeRepository',\n isType: false,\n};\n\nconst PAGINATED_RESPONSE: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'PaginatedResponse',\n isType: true,\n};\n\nconst CONNECTION_NORMALIZED_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'ConnectionNormalizedData',\n isType: true,\n};\n\nconst GRAPHQL_INPUT_EXTENSION: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLInputExtension',\n isType: true,\n};\n\nexport type CursorConnectionGraphQLObjectType = GraphQLObjectTypeModel & {\n category: 'cursor-connection';\n defaultPageSize?: number;\n};\n\n/**\n * Cursor Connection Type MUST be an Object Type according to the Cursor Connection spec.\n * https://relay.dev/graphql/connections.htm#sec-Connection-Types\n */\nexport class CursorConnectionGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<CursorConnectionGraphQLObjectType> {\n generate(\n type: CursorConnectionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n const defaultPageSize = type.defaultPageSize || 10;\n\n const defaultPageSizeProperty = code`defaultPageSize = ${defaultPageSize};`;\n\n // Need special handling for cursor connection with 3 type parameters\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n const fieldsProperty = this.generateFieldsProperty(\n type,\n PAGINATED_RESPONSE,\n CONNECTION_NORMALIZED_DATA,\n schemaModel,\n options.namespace\n );\n\n return code`\nexport class ${options.className} extends ${CURSOR_CONNECTION_GRAPHQL_TYPE_REPOSITORY}<${PAGINATED_RESPONSE}, ${CONNECTION_NORMALIZED_DATA}, ${GRAPHQL_INPUT_EXTENSION}> {\n ${commonProperties}\n\n ${constructor}\n\n ${fieldsProperty}\n\n ${defaultPageSizeProperty}\n}`;\n }\n}\n\nexport function generateCursorConnectionGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: CursorConnectionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new CursorConnectionGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLSchemaModel,\n GraphQLInterfaceTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst BASE_INTERFACE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseInterfaceRepository',\n isType: false,\n};\n\nexport type InterfaceGraphQLObjectType = GraphQLInterfaceTypeModel;\n\nexport class InterfaceGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<InterfaceGraphQLObjectType> {\n generate(\n type: InterfaceGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n // Generate possibleTypes mapping using this.typeRegistry\n const possibleTypesEntries = type.possibleTypes.map((possibleType) => {\n const typeReference = this.ensureTypeBuiltAndGetReference(possibleType, schemaModel);\n return code`'${possibleType.name}': ${typeReference}`;\n });\n const possibleTypesCode = Code.join(possibleTypesEntries, ',\\n ');\n\n const possibleTypesProperty = code`get possibleTypes() {\n return {\n ${possibleTypesCode}\n };\n }`;\n\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n BASE_INTERFACE_REPOSITORY,\n {\n data: GRAPHQL_DATA,\n normalized: 'any',\n },\n [possibleTypesProperty]\n );\n }\n}\n\nexport function generateInterfaceGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: InterfaceGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new InterfaceGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type { GraphQLSchemaModel, GraphQLUnionTypeModel } from '../../model/graphql-schema-model';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\n\nconst BASE_UNION_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseUnionRepository',\n isType: false,\n};\n\nexport type UnionGraphQLObjectType = GraphQLUnionTypeModel;\n\nexport class UnionGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<UnionGraphQLObjectType> {\n generate(\n type: UnionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n // Generate possibleTypes mapping using this.typeRegistry\n const possibleTypesEntries = type.possibleTypes.map((possibleType) => {\n const typeReference = this.ensureTypeBuiltAndGetReference(possibleType, schemaModel);\n return code`'${possibleType.name}': ${typeReference}`;\n });\n const possibleTypesCode = Code.join(possibleTypesEntries, ',\\n ');\n\n const possibleTypesProperty = code`get possibleTypes() {\n return {\n ${possibleTypesCode}\n };\n }`;\n\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n BASE_UNION_REPOSITORY,\n {\n data: GRAPHQL_DATA,\n normalized: 'any',\n },\n [possibleTypesProperty]\n );\n }\n}\n\nexport function generateUnionGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: UnionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new UnionGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code, Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport { generateCacheControl } from '../../generators/cache-control-generator';\nimport type {\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n IdentifiableGraphQLTypeMetadata,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport type { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport { BaseGraphQLTypeGenerator, GenerationOptions } from './base-type-generator';\n\nconst GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLDocumentRootTypeRepository',\n isType: false,\n};\n\nconst GRAPHQL_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLData',\n isType: true,\n};\n\n/**\n * Query Type MUST be an Object Type according to the GraphQL spec.\n * https://spec.graphql.org/October2021/#sec-Query\n */\nexport class DocumentRootTypeGenerator extends BaseGraphQLTypeGenerator<GraphQLObjectTypeModel> {\n generate(\n type: GraphQLObjectTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY,\n { data: GRAPHQL_DATA, normalized: 'any' },\n [\n code`${generateCacheControl((type.metadata as IdentifiableGraphQLTypeMetadata)['cache-control'])}`,\n ] // We force the Root Query Type to have identifiable metadata\n );\n }\n}\n\nexport function generateDocumentRootGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: GraphQLObjectTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new DocumentRootTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import {\n generateIdentifiableGraphQLType,\n IdentifiableGraphQLObjectType,\n} from './graphql/identifiable-type-generator';\nimport {\n generateUnidentifiableGraphQLType,\n UnidentifiableGraphQLObjectType,\n} from './graphql/unidentifiable-type-generator';\nimport {\n generateCursorConnectionGraphQLType,\n CursorConnectionGraphQLObjectType,\n} from './graphql/cursor-connection-type-generator';\nimport {\n generateInterfaceGraphQLType,\n InterfaceGraphQLObjectType,\n} from './graphql/interface-type-generator';\nimport { generateUnionGraphQLType, UnionGraphQLObjectType } from './graphql/union-type-generator';\nimport { generateDocumentRootGraphQLType } from './graphql/document-root-type-generator';\nimport type { ImportableValueReference, NamedFileService, Code } from '../files';\nimport type {\n GraphQLEnumTypeModel,\n GraphQLInterfaceTypeModel,\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n GraphQLTypeModel,\n GraphQLUnionTypeModel,\n} from '../model/graphql-schema-model';\nimport type { GenerationOptions } from './graphql/base-type-generator';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { NamedGraphQLTypeRegistryGeneratorService } from './graphql-type-registry-generator';\n\nexport const FILE_PER_GRAPHQL_TYPE = (typename: string) =>\n `graphql/${typename.toLowerCase()}-repository.ts`;\n\nexport interface IGraphQLTypeGenerator {\n build(options: {\n namespace: string;\n name: string;\n schemaModel: GraphQLSchemaModel;\n }): ImportableValueReference;\n\n buildRef(options: { namespace: string; name: string }): ImportableValueReference;\n}\n\nfunction defaultGenerateType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: GraphQLTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n // Check if this is a document root type (Query, Mutation, Subscription)\n if (isObjectType(type)) {\n if (type.name === schemaModel.queryTypeName || type.name === schemaModel.mutationTypeName) {\n return generateDocumentRootGraphQLType(services, type, schemaModel, options);\n } else if (isIdentifiableType(type)) {\n return generateIdentifiableGraphQLType(services, type, schemaModel, options);\n } else if (isUnidentifiableType(type)) {\n return generateUnidentifiableGraphQLType(services, type, schemaModel, options);\n } else if (isCursorConnectionType(type)) {\n return generateCursorConnectionGraphQLType(services, type, schemaModel, options);\n }\n } else if (isInterfaceType(type)) {\n return generateInterfaceGraphQLType(services, type, schemaModel, options);\n } else if (isUnionType(type)) {\n return generateUnionGraphQLType(services, type, schemaModel, options);\n }\n throw new Error(\n `Unsupported GraphQL type category: ${(type as any).category || (type as any).kind}`\n );\n}\n\nexport type GraphQLObjectType =\n | IdentifiableGraphQLObjectType\n | UnidentifiableGraphQLObjectType\n | CursorConnectionGraphQLObjectType\n | InterfaceGraphQLObjectType\n | UnionGraphQLObjectType;\n\n/**\n * A class for building GraphQL type repository implementations\n */\nexport class GraphQLTypeGenerator implements IGraphQLTypeGenerator {\n private cache = new Map<string, ImportableValueReference>();\n\n constructor(\n protected services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n private fileFor: (typename: string) => string = FILE_PER_GRAPHQL_TYPE,\n private generateType: typeof defaultGenerateType = defaultGenerateType\n ) {}\n\n /**\n * Build a GraphQL type repository class, starting from the specified type name\n * and spidering out to referenced types as needed\n */\n build(options: {\n namespace: string;\n name: string;\n schemaModel: GraphQLSchemaModel;\n }): ImportableValueReference {\n const { namespace, name, schemaModel } = options;\n const cacheKey = `${namespace}:${name}`;\n\n const cachedRef = this.cache.get(cacheKey);\n if (cachedRef) {\n return cachedRef;\n }\n\n const ref = this.buildRef({ namespace, name });\n const className = ref.exportedSymbol!;\n\n // Find the type in the schema model\n const type = schemaModel.types.find((t) => t.name === name);\n if (!type) {\n throw new Error(`GraphQL type '${name}' not found in schema model`);\n }\n this.cache.set(cacheKey, ref); // Must avoid infinite looping\n\n // Generate the code for this type\n const code = this.generateType(this.services, type, schemaModel, {\n namespace,\n name,\n className,\n });\n\n const file = this.services.file.build('filename' in ref ? ref.filename : ref.module);\n file.push(code);\n\n return ref;\n }\n\n buildRef(options: { namespace: string; name: string }): ImportableValueReference {\n const filename = this.fileFor(options.name);\n const className = toTypeScriptSafeIdentifier(`${options.name}Repository`);\n const ref = { filename, exportedSymbol: className, isType: false } as const;\n return ref;\n }\n}\n\nfunction isObjectType(type: GraphQLTypeModel): type is GraphQLObjectTypeModel {\n return type.kind === 'object';\n}\n\nfunction isUnionType(type: GraphQLTypeModel): type is GraphQLUnionTypeModel {\n return type.kind === 'union';\n}\n\nfunction isEnumType(type: GraphQLTypeModel): type is GraphQLEnumTypeModel {\n return type.kind === 'enum';\n}\n\nfunction isInterfaceType(type: GraphQLTypeModel): type is GraphQLInterfaceTypeModel {\n return type.kind === 'interface';\n}\n\nfunction isIdentifiableType(\n type: GraphQLTypeModel\n): type is GraphQLObjectTypeModel & { category: 'identifiable' } {\n return type.kind === 'object' && type.category === 'identifiable';\n}\n\nfunction isUnidentifiableType(type: GraphQLTypeModel): type is (\n | GraphQLObjectTypeModel\n | GraphQLInterfaceTypeModel\n | GraphQLUnionTypeModel\n) & {\n category: 'unidentifiable';\n} {\n return type.category === 'unidentifiable';\n}\n\nfunction isCursorConnectionType(type: GraphQLTypeModel): type is GraphQLObjectTypeModel & {\n category: 'cursor-connection';\n} {\n return type.kind === 'object' && type.category === 'cursor-connection';\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { code } from '../files';\nimport { GraphQLTypeGenerator } from './graphql-type-generator';\nimport type {\n NamedFileService,\n File,\n ImportableValueReference,\n ImportableReference,\n} from '../files';\nimport type { NamedService } from '@conduit-client/utils';\nimport type { GraphQLSchemaModel } from '../model/graphql-schema-model';\nimport type { GraphQLObjectType } from './graphql-type-generator';\nimport { NamedAPIService } from '@conduit-client/model/v1';\n\ntype GraphQLTypeRepositoryReference = {\n propertyName: string;\n typeClassRef: ImportableValueReference;\n typeName: string;\n};\n\ntype Options = {\n type: GraphQLObjectType;\n schemaModel: GraphQLSchemaModel;\n};\n\nexport type IGraphQLTypeRegistryGeneratorService = {\n build(): ImportableValueReference;\n buildGraphQLType(options: Options): GraphQLTypeRepositoryReference;\n};\n\nexport type NamedGraphQLTypeRegistryGeneratorService<\n Name extends string = 'graphqlTypeRegistryGenerator',\n> = NamedService<Name, IGraphQLTypeRegistryGeneratorService>;\n\nconst GRAPHQL_TYPE_REGISTRY_CLASS = 'GraphQLTypeRegistry';\nconst GRAPHQL_TYPE_REGISTRY_FILE = 'normalization/graphql-type-registry.ts';\n\nexport const NAMED_CACHE_CONTROLLER_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const NAMED_PUB_SUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport const TYPE_SERVICES = code`${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUB_SUB_SERVICE}`;\n\n/**\n * A class for building the GraphQL type registry for a given module\n */\nexport class GraphQLTypeRegistryGenerator implements IGraphQLTypeRegistryGeneratorService {\n protected graphqlTypeGenerator!: GraphQLTypeGenerator;\n\n constructor(\n protected services: NamedFileService & NamedAPIService,\n protected filename: string = GRAPHQL_TYPE_REGISTRY_FILE\n ) {}\n\n setGraphQLTypeGenerator(generator: GraphQLTypeGenerator) {\n this.graphqlTypeGenerator = generator;\n }\n\n _file: File | undefined = undefined;\n\n protected typeDeclarationsSymbol = Symbol.for('graphqlTypeDeclarations');\n protected typeInstantiationsSymbol = Symbol.for('graphqlTypeInstantiations');\n protected typeGettersSymbol = Symbol.for('graphqlTypeGetters');\n cache = new Map<string, GraphQLTypeRepositoryReference>();\n\n private get file() {\n if (this._file) {\n return this._file;\n }\n return this.buildFile();\n }\n\n private buildFile(): File {\n const file = this.services.file.build(this.filename);\n file.template = this.template;\n this._file = file;\n return file;\n }\n\n get template() {\n return [\n code`export class ${GRAPHQL_TYPE_REGISTRY_CLASS}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>, ExtraServices extends object = object > {`,\n this.typeDeclarationsSymbol,\n code`constructor(protected services: ${TYPE_SERVICES} & ExtraServices) {`,\n this.typeInstantiationsSymbol,\n code`}`,\n this.typeGettersSymbol,\n code`}`,\n ];\n }\n\n /**\n * A method for building the base GraphQL type registry code, without any classes populated\n */\n build() {\n this.buildFile();\n return {\n filename: this.filename,\n exportedSymbol: GRAPHQL_TYPE_REGISTRY_CLASS,\n isType: false,\n } as const;\n }\n\n get namespace() {\n return this.services.api.api.namespace;\n }\n\n /**\n * A method for building/adding a specific GraphQL type to the registry\n */\n buildGraphQLType(options: Options): GraphQLTypeRepositoryReference {\n const { type, schemaModel } = options;\n const cacheKey = `${this.namespace}:${type.name}`;\n\n let cachedResult = this.cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n\n const propertyName = toTypeScriptSafeIdentifier(type.name);\n\n // Create a placeholder result and cache it immediately to prevent recursive calls\n // from modifying the template multiple times during field processing\n const result: GraphQLTypeRepositoryReference = {\n propertyName,\n typeClassRef: { filename: '', exportedSymbol: '', isType: false }, // placeholder\n typeName: type.name,\n };\n this.cache.set(cacheKey, result);\n\n // Build the GraphQL type repository class\n const typeClassRef = this.graphqlTypeGenerator.build({\n name: type.name,\n schemaModel,\n namespace: this.namespace,\n });\n\n // Update the cached result with the actual typeClassRef\n result.typeClassRef = typeClassRef;\n\n // Add to registry template (only for new types)\n const privateName = code`_${propertyName}`;\n\n this.file.pushTo(this.typeDeclarationsSymbol, code`${privateName}: ${typeClassRef};`);\n this.file.pushTo(\n this.typeInstantiationsSymbol,\n code`this.${privateName} = new ${typeClassRef}<ExtraInputExtension>(this.services, this);`\n );\n this.file.pushTo(\n this.typeGettersSymbol,\n code`get ${propertyName}() { return this.${privateName}; }`\n );\n\n return result;\n }\n}\n\n/**\n * Creates a GraphQLTypeRegistryGeneratorService.\n */\nexport function graphqlTypeRegistryGeneratorService(\n services: NamedFileService & NamedAPIService,\n graphqlTypeGenerator?: GraphQLTypeGenerator\n): IGraphQLTypeRegistryGeneratorService {\n const registry = new GraphQLTypeRegistryGenerator(services);\n const gtg =\n graphqlTypeGenerator ||\n new GraphQLTypeGenerator(\n { ...services, graphqlTypeRegistryGenerator: registry },\n undefined,\n undefined\n );\n registry.setGraphQLTypeGenerator(gtg);\n return registry;\n}\n","import { type Code, type ImportableTypeReference, type NamedFileService, code } from '../files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel, InvalidationConfig } from '../model/base-command-model';\n\nconst JSON_SCHEMA: ImportableTypeReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst ABORTABLE_COMMAND_OPTIONS: ImportableTypeReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'AbortableCommandOptions',\n isType: true,\n};\n\nexport type ICommandGenerator = {\n build(): void;\n};\n\n/**\n * Abstract base class for generating command files based on a command model and associated services.\n *\n * This class provides a framework for generating files associated with commands, including type definitions,\n * JSON schemas, and class templates. It leverages protected symbols to encapsulate template pieces,\n * facilitating the extension and customization in subclasses.\n *\n * The commandBaseClass abstract property must reference a type only, importable reference that references the base class that the generated command\n * will reference. For example, the HTTP concretion of this class would reference:\n * ```\n * {\n * module: '@conduit-client/command-fetch-network/v1',\n * exportedSymbol: 'FetchNetworkCommand',\n * isType: true,\n * }\n * ```\n * which corresponds to the import: `import {type FetchNetworkCommand} from '@conduit-client/command-fetch-network/v1'`.\n *\n * The class body abstract command provides a hook for concretions to implement whatever contract is required\n * by their base class. By convention, the concrete implementations of `classBody` should delegate to a method for\n * each property & class method that is implemented.\n *\n * None of the other properties are expected to be overridden in subclasses.\n *\n * @abstract\n * @property {ICommandModel} commandModel - The command model that provides metadata and configuration for generating command files.\n * @property {NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService} services - Services required for file generation, type definition, and JSON schema generation.\n */\nexport abstract class CommandGenerator {\n constructor(\n protected commandModel: ICommandModel,\n protected services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService\n ) {}\n\n protected commandTypeGenericsSymbol = Symbol.for('commandType');\n protected commandConfigSchemaSymbol = Symbol.for('commandConfigSchema');\n protected commandConfigTypeSymbol = Symbol.for('commandConfigType');\n protected commandClassBodySymbol = Symbol.for('commandClassBody');\n protected commandOptionsTypeSymbol = Symbol.for('commandOptionsType');\n\n abstract get commandBaseClass(): ImportableTypeReference;\n\n get classBody(): Code[] {\n return [];\n }\n\n get commandTypeConstructorArgs() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`config: Config, typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n return code`config: Config`;\n }\n\n get commandConstructorArgs() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`private config: Config, private typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n return code`private config: Config`;\n }\n\n get exposeSubscribeAndRefresh() {\n // Currently only checks this flag on network commands\n if (this.commandModel.exposeRefresh && this.commandModel.cacheStrategy.type === 'none') {\n return code`exposeSubscribeAndRefresh = true;`;\n }\n return code``;\n }\n\n /**\n * Generates the Command type definition.\n * Can be overridden by subclasses to customize the Command type signature.\n */\n protected generateCommandType(): Code {\n return code`export type Command=new (${this.commandTypeConstructorArgs},...args: CommandConstructorParams) => CommandType;`;\n }\n\n /**\n * Generates the constructor for the command class.\n * Can be overridden by subclasses to customize constructor behavior.\n */\n protected generateConstructor(): Code {\n return code`constructor(${this.commandConstructorArgs}, ...args: CommandConstructorParams){super(...args)}`;\n }\n\n /**\n * Generates the operationType getter for the concrete command class.\n * Subclasses (e.g., GraphQL mixins) can override to emit nothing.\n */\n protected generateOperationType(): Code {\n return code`get operationType() {\n return '${this.commandModel.operationType}' as const;\n }`;\n }\n\n /**\n * Template for generating the command file content.\n * This getter constructs the full template array incorporating various symbols for later replacement in the build process.\n * @returns {Code[]} An array of code blocks forming the complete command file template.\n */\n get template() {\n return [\n code`export type Config=`,\n this.commandConfigTypeSymbol,\n code`;`,\n code`export const CONFIG_SCHEMA:${JSON_SCHEMA}=`,\n this.commandConfigSchemaSymbol,\n code`;`,\n this.commandOptionsTypeSymbol,\n code`export type CommandType=${this.commandBaseClass}<`,\n this.commandTypeGenericsSymbol,\n code`>;`,\n code`export type CommandConstructorType=typeof ${this.commandBaseClass}<`,\n this.commandTypeGenericsSymbol,\n code`>;`,\n code`export type CommandConstructorParams=ConstructorParameters<CommandConstructorType>;`,\n this.generateCommandType(),\n code`export function buildCommandClass(baseClass: CommandConstructorType): Command{`,\n code`return class extends baseClass{`,\n this.generateConstructor(),\n ...this.classBody,\n this.exposeSubscribeAndRefresh,\n this.generateOperationType(),\n this.generateAfterRequestHooks(),\n code`}};`,\n ];\n }\n\n /**\n * Builds the command file by assembling various components into a file structure and saving it.\n * This method orchestrates the generation of necessary types, configurations, and class bodies.\n */\n build() {\n const file = this.services.file.build(this.commandModel.filePath);\n file.template = this.template;\n\n file.pushTo(this.commandConfigTypeSymbol, this.buildCommandConfigType());\n file.pushTo(this.commandConfigSchemaSymbol, this.buildCommandConfigSchema());\n\n file.pushTo(this.commandOptionsTypeSymbol, this.buildCommandOptionsType());\n\n file.pushTo(this.commandTypeGenericsSymbol, this.buildCommandTypeGenerics());\n file.pushTo(this.commandClassBodySymbol, ...this.classBody);\n }\n\n protected buildCommandConfigType() {\n return this.services.typeDefinition.build(this.commandModel.configType);\n }\n\n protected buildCommandConfigSchema() {\n return this.services.jsonSchema.build(this.commandModel.configType);\n }\n\n protected buildCommandOptionsType() {\n const commandName = this.commandModel.className;\n return code`export type ${commandName}Options = ${ABORTABLE_COMMAND_OPTIONS};`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n return code`${this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n )}${extraServicesCode ? code`, ${extraServicesCode}` : ''}`;\n }\n\n protected buildExtraServices(): Code | undefined {\n if (this.commandModel.serviceDependencies.extra.length === 0) {\n return undefined;\n }\n\n return this.commandModel.serviceDependencies.extra.reduce(\n (previous, current, idx) => {\n return code`${previous}${idx > 0 ? '&' : ''}${current.namedService}`;\n },\n code``\n );\n }\n\n protected generateAfterRequestHooks() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`async afterRequestHooks(options: { statusCode: number }){\n ${this.generateInvalidationSwitch()}\n }`;\n }\n return code``;\n }\n\n private getInvalidationStatements(responses: InvalidationConfig[]): (Code[] | undefined)[] {\n return responses.map((resp) => {\n return resp.invalidation?.map((invalidate) => {\n const split = invalidate.ref.split('/');\n const typeName = split[split.length - 1];\n return code`this.typeRegistry.${typeName}.invalidate([${this.buildMappedKeyConfig(invalidate.key)}])`;\n });\n });\n }\n\n private generateInvalidationSwitch(): Code {\n return code`switch(options.statusCode) {\n ${this.generateInvalidationCasesByStatusCode()}\n }`;\n }\n\n private generateInvalidationCasesByStatusCode(): Code[] {\n return this.commandModel.invalidationConfigs.map((resp) => {\n return code`case ${resp.statusCode}:\n ${this.getInvalidationStatements([resp])}\n break;\n `;\n });\n }\n\n protected buildMappedKeyConfig(operationKey: Record<string, string>) {\n return code`{${Object.entries(operationKey).map(([keyName, keyPath], index, array) => {\n const [paramType, ...pathElements] = keyPath.split('.');\n\n if (pathElements.length === 0) {\n throw Error('no path specified');\n }\n\n const delimiter = index < array.length ? ', ' : '';\n\n const path = pathElements.join('.');\n if (paramType === 'body' && this.commandModel.configSchemaType === 'default') {\n return `${keyName}: this.config['${this.commandModel.body?.parameterName}']${this.pathToAccessor(path)}${delimiter}`;\n } else {\n return `${keyName}: this.config${this.pathToAccessor(path)}${delimiter}`;\n }\n })}}`;\n }\n\n private pathToAccessor(path: string) {\n return path\n .split('.')\n .map((element) => `['${element}']`)\n .join('');\n }\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { type Code, code } from '../files';\nimport { ICommandModel } from '../model/base-command-model';\n\n/**\n * Generates a destructuring assignment code block for a given property name, ensuring that the variable names are valid TypeScript identifiers.\n * This function is particularly useful when dealing with property names that may not directly translate into valid TypeScript variable names,\n * such as names containing special characters.\n *\n * @param propertyName - The original property name to be destructured from an object.\n * @returns An object containing:\n * - `code`: a `Code` type representing the TypeScript code for destructuring the property.\n * - `variableName`: a string that represents the valid TypeScript identifier to which the property value is assigned.\n */\nexport function buildPropertyDestructureDeclaration(propertyName: string): {\n code: Code;\n variableName: string;\n} {\n const typescriptSafeName = toTypeScriptSafeIdentifier(propertyName);\n if (propertyName !== typescriptSafeName) {\n return {\n code: code`'${propertyName}':${typescriptSafeName}`,\n variableName: typescriptSafeName,\n };\n } else {\n return { code: code`${propertyName}`, variableName: propertyName };\n }\n}\n\nexport function buildServiceProjection(model: ICommandModel) {\n let name = 'services';\n let overrides = '';\n if (\n model.serviceDependencies?.overrides &&\n Object.keys(model.serviceDependencies.overrides).length !== 0\n ) {\n let commandName = toTypeScriptSafeIdentifier(model.commandName);\n name = `servicesProjection_for_${commandName}`;\n overrides = `const ${name} = {\n ...services,`;\n for (const [alias, entry] of Object.entries(model.serviceDependencies.overrides)) {\n overrides += `${alias}: services.${entry.type}_${commandName},`;\n }\n overrides += `};`;\n }\n return [name, overrides];\n}\n","import { code, Code } from '../files';\nimport { CommandGenerator } from './base-command-generator';\nimport { buildPropertyDestructureDeclaration } from './utils';\nimport type { ImportableReference, ImportableTypeReference } from '../files';\nimport {\n type Type,\n type ArrayType,\n type Parameter,\n isCanonicalStringType,\n isCanonicalNumberType,\n canonicalizeType,\n} from '@conduit-client/model/v1';\n\nconst HEADER_CONTENT_TYPE = 'Content-Type';\n\nconst FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchService',\n isType: true,\n};\n\nconst FETCH_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nconst FETCH_RESPONSE: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'FetchResponse',\n isType: true,\n};\n\nconst COERCE_RESPONSE_TO_FETCH_RESPONSE: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'coerceResponseToFetchResponse',\n isType: false,\n};\n\nconst ENCODE_QUERY_PARAM: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'encodeQueryParam',\n isType: false,\n};\n\nexport const MEDIATYPE_APP_JSON = 'application/json';\n\n/**\n * Extends CommandGenerator to provide functionality for generating command files specifically designed for HTTP operations.\n *\n * This class specializes in creating files that include detailed HTTP-specific configurations such as fetch parameters,\n * header construction, query parameters, and error handling, tailored to interact with web APIs using the fetch API.\n *\n * @extends CommandGenerator\n */\nexport class HttpCommandGenerator extends CommandGenerator {\n commandBaseClass: ImportableTypeReference = FETCH_COMMAND_BASE_CLASS;\n\n /**\n * Constructs and returns an array of code blocks that form the body of the HTTP command class.\n * Includes methods for generating fetch parameters and error coercion logic.\n * @returns {Code[]} An array of code snippets that define the command class body for HTTP operations.\n */\n get classBody(): Code[] {\n return [code`${this.generateFetchParams()}`, this.generateCoerceError()];\n }\n\n /**\n * Generates a code block for fetch parameters based on the command model's configuration.\n * Constructs a detailed setup for fetch operations including method, headers, body, and cache settings.\n * @returns {Code} A comprehensive code snippet that defines all necessary fetch parameters.\n */\n generateFetchParams(): Code {\n const headers = this.generateHeaders();\n const result = new Code().push(\n code`get fetchParams(): Parameters<${FETCH_SERVICE}>{`,\n code`${this.generateAllParams()}`,\n code`${this.generateUrl()}${this.generateQueryParameters()}${headers}`\n );\n\n const hasRequestBody = this.commandModel.body!!;\n const hasHeaders = headers !== undefined;\n result.push(\n code`const params:Parameters<${FETCH_SERVICE}>[1]={`,\n code`method:'${this.commandModel.method}',`,\n code`cache:'no-cache',`\n );\n if (hasHeaders) {\n result.push(`headers,`);\n }\n if (hasRequestBody) {\n result.push(`body:JSON.stringify(body)`);\n }\n result.push(`};`);\n\n result.push(code`return [url, params]}`);\n return result;\n }\n\n /**\n * Constructs the base URL for the fetch command.\n * @returns {Code} A code snippet that defines the URL to be used in fetch operations.\n */\n generateUrl(): Code {\n return code`let url:Parameters<${FETCH_SERVICE}>[0]=\\`${this.processUrl()}\\`;`;\n }\n\n /**\n * Generates headers necessary for the HTTP fetch based on the command model's requirements.\n * Handles conditional inclusion of headers based on their defined necessity and request body presence.\n * @returns {object} An object containing the header names and the corresponding code to create them.\n */\n generateHeaders() {\n let result = undefined;\n const hasRequestBody = this.commandModel.body!!;\n if (this.commandModel.headers.length > 0 || hasRequestBody) {\n result = code`const headers:Record<string,any>={`;\n if (hasRequestBody) {\n result.push(`'${HEADER_CONTENT_TYPE}':'${MEDIATYPE_APP_JSON}',`);\n }\n const headers = this.commandModel.headers.filter(\n (hdr) => hdr.name.toLowerCase() !== HEADER_CONTENT_TYPE.toLowerCase()\n );\n\n const headerVariables: Record<string, string> = {};\n const headerDefaults: Record<string, unknown> = {};\n headers.forEach((hdr) => {\n const destructure = buildPropertyDestructureDeclaration(hdr.name);\n result.push(code`${destructure.code},`);\n headerVariables[hdr.name] = destructure.variableName;\n if (hdr.defaultValue) {\n headerDefaults[hdr.name] = hdr.defaultValue;\n }\n });\n result.push(`};`);\n Object.entries(headerVariables).forEach(([hdrName, hdrVariableName]) => {\n result.push(\n `if(${hdrVariableName}!==undefined){headers['${hdrName}']=${hdrVariableName};}`\n );\n if (headerDefaults[hdrName]) {\n result.push(`else{headers['${hdrName}']='${headerDefaults[hdrName]}';}`);\n }\n });\n }\n return result;\n }\n\n /**\n * Constructs a setup for handling query parameters within the URL for the fetch operation.\n * @returns {object} An object containing the parameter names and the corresponding code to handle them.\n */\n generateQueryParameters() {\n // resolve query params\n let result = undefined;\n if (this.commandModel.queryParameters.length > 0) {\n result = code`let queryParams:string[]=[];`;\n this.commandModel.queryParameters.forEach((param) => {\n const variableName = buildPropertyDestructureDeclaration(param.name).variableName;\n result.push(\n param.required ? '' : `if(${variableName}!==undefined){`,\n code`queryParams.push(...${ENCODE_QUERY_PARAM}('${param.name}', ${variableName}, ${param.explode}));`,\n param.required ? '' : `}`\n );\n });\n result.push(`if(queryParams.length>0){url+='?'+queryParams.join('&');}`);\n }\n return result;\n }\n\n /**\n * Generates a consolidated list of all parameters involved in the fetch operation.\n * @returns {Code} A code block that consolidates all necessary parameters from headers, query, and URI.\n */\n generateAllParams(): Code {\n const result = new Code();\n const paramDestructuring = this.commandModel.getAllParams().map((param) => {\n const destructure = buildPropertyDestructureDeclaration(param.name);\n return destructure.code;\n });\n if (this.commandModel.body || paramDestructuring.length) {\n result.push(\n code`const {\n ${paramDestructuring.join(',')}\n ${paramDestructuring.length && this.commandModel.body ? ',' : ''}\n ${this.generateInputPayloadParameter()}\n } = this.config;`\n );\n }\n return result;\n }\n\n /**\n * Determines the code snippet for destructuring the input payload based on the configuration schema type.\n * @returns {Code | undefined} A code snippet for the input payload parameter, if applicable.\n */\n generateInputPayloadParameter(): Code | undefined {\n if (this.commandModel.body) {\n if (this.commandModel.configSchemaType === 'flattened') {\n // Use rest operator when flattening,\n // e.g. const { ...body } = this.config\n return code`...body`;\n } else {\n // Extract using input payload name otherwise,\n // e.g. const { inputPayload: body } = this.config\n return code`${this.commandModel.body.parameterName}: body`;\n }\n }\n }\n\n /**\n * Encodes a parameter based on its type.\n * @param {string} name The name of the parameter to encode.\n * @param {Type} type The type descriptor of the parameter.\n * @returns {string | undefined} The encoded parameter value as a string, or undefined if the type is unsupported.\n */\n encodeParam(name: string, type: Type, required: boolean): string | undefined {\n const isScalarArrayType = (t: Type): t is ArrayType => {\n const canonicalizedType = canonicalizeType(t);\n if (canonicalizedType.type !== 'array') {\n return false;\n }\n\n const canonicalizedItems = canonicalizeType(canonicalizedType.items);\n return (\n isCanonicalStringType(canonicalizedItems) ||\n isCanonicalNumberType(canonicalizedItems)\n );\n };\n\n const canonicalType = canonicalizeType(type);\n return isCanonicalNumberType(canonicalType)\n ? `${name}`\n : isCanonicalStringType(canonicalType)\n ? required\n ? `encodeURIComponent(${name})`\n : `encodeURIComponent(${name} ? ${name} : '')`\n : isScalarArrayType(canonicalType)\n ? isCanonicalStringType(canonicalType.items)\n ? `${name}.map(item=>encodeURIComponent(item)).join(',')`\n : `${name}.join(',')`\n : undefined;\n }\n\n /**\n * Processes the URL with replacements for URI parameters based on their values specified in the command model.\n * @returns {string} The fully constructed URL with all necessary URI parameter substitutions.\n */\n processUrl(): string {\n const uriParams: Record<string, Parameter> = this.commandModel.uriParameters.reduce(\n (result, param) => {\n result[param.name] = param;\n return result;\n },\n {} as Record<string, Parameter>\n );\n\n // resolve URL against server\n let url = [\n this.commandModel.serverUrlPath.replace(/\\/$/, ''),\n this.commandModel.endpointUrlPath.replace(/^\\//, ''),\n ].join('/');\n\n // resolve uri/path params\n url = url.replace(/\\{(.+?)\\}/g, (_, uriParameter) => {\n const uriParam = uriParams[uriParameter];\n if (!uriParam) {\n throw new Error(\n `unknown uri parameter ${uriParameter} in ${url} for ${this.commandModel.method} ${this.commandModel.endpointUrlPath} operation`\n );\n }\n const paramName = buildPropertyDestructureDeclaration(uriParameter).variableName;\n const value: string | undefined = this.encodeParam(\n paramName,\n uriParam.type,\n uriParam.required\n );\n return `\\${${value}}`;\n });\n\n return url;\n }\n\n generateCoerceError() {\n if (this.commandModel.errorStrategy.type === 'fetchResponse') {\n return code`async coerceError(errorResponse: Response):Promise<${FETCH_RESPONSE}<unknown>>{\n return ${COERCE_RESPONSE_TO_FETCH_RESPONSE}(errorResponse)\n }`;\n }\n return code``;\n }\n}\n","import { Code, type ImportableValueReference, type ImportableTypeReference, code } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { buildPropertyDestructureDeclaration } from './utils';\n\nconst FETCH_RESPONSE: ImportableTypeReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'FetchResponse',\n isType: true,\n};\n\nconst CONVERT_AURA_ERRORS_TO_FETCH_RESPONSE: ImportableValueReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'getFetchResponseFromAuraError',\n isType: false,\n};\n\nconst AURA_COMMAND_BASE_CLASS: ImportableTypeReference = {\n module: '@conduit-client/command-aura-network/v1',\n exportedSymbol: 'AuraNetworkCommand',\n isType: true,\n};\n/**\n * An extension of the CommandGenerator for generating command files specifically tailored for Salesforce Aura components.\n *\n * This class specializes in handling Aura-specific functionalities such as defining endpoints, generating Aura-compatible\n * parameters, and handling errors in a manner compatible with Aura's handling mechanisms. It leverages the structure and\n * behavior of the parent CommandGenerator class to create command files optimized for Aura component interactions.\n *\n * @extends CommandGenerator\n */\nexport class AuraCommandGenerator extends HttpCommandGenerator {\n commandBaseClass = AURA_COMMAND_BASE_CLASS;\n\n /**\n * Constructs and returns an array of code blocks that form the body of the Aura-specific command class.\n * @returns {Code[]} An array of code snippets that define the command class body, tailored for Aura components.\n */\n get classBody(): Code[] {\n return [\n ...super.classBody,\n this.generateNetworkPreference(),\n this.generateEndpoint(),\n this.generateAuraParams(),\n ];\n }\n\n generateNetworkPreference(): Code {\n return code`protected networkPreference='${this.commandModel.networkPreference}' as const;`;\n }\n\n /**\n * Generates a code snippet that sets the command endpoint based on the controller and method defined in the command model.\n * @returns {Code} A code snippet that statically sets the endpoint for the command.\n */\n generateEndpoint(): Code {\n return code`endpoint='${this.commandModel.aura!.controller}.${this.commandModel.aura!.method}';`;\n }\n\n /**\n * Generates a getter method that constructs and returns a record of parameters required by the Aura command.\n * @returns {Code} A code snippet defining a getter for the Aura parameters, structured as a record.\n */\n generateAuraParams(): Code {\n return code`get auraParams():Record<string,unknown>{${this.generateAuraParamsCode()}}`;\n }\n\n /**\n * Helper method that aggregates all parameters (query and URI) and formats them into a structured record,\n * possibly including the command body if specified.\n * @returns {Code} A code block that constructs the parameters object for the Aura command.\n */\n generateAuraParamsCode(): Code {\n const result = new Code();\n const paramDestructuring = this.commandModel\n .getAllParams()\n .map(({ name }) => {\n return buildPropertyDestructureDeclaration(name).code;\n })\n .join(',');\n\n const inputPayloadDelimiter =\n paramDestructuring.length && this.commandModel.body ? ',' : '';\n if (paramDestructuring.length || this.commandModel.body) {\n result.push(\n code`const {\n ${paramDestructuring}\n ${inputPayloadDelimiter}\n ${this.generateInputPayloadParameter()}\n } = this.config;`\n );\n }\n\n result.push(code`return { ${paramDestructuring}`);\n if (this.commandModel.body) {\n if (this.commandModel.aura === undefined) {\n throw new Error('Aura command model information missing');\n }\n const inputPayload = this.commandModel.aura.bodyParam;\n\n if (inputPayload === undefined) {\n throw new Error('Aura body param missing');\n }\n result.push(code`${inputPayloadDelimiter}${inputPayload}:body`);\n }\n result.push(`};`);\n return result;\n }\n\n /**\n * Determines how to destructure the input payload from the command configuration, adjusting based on schema type.\n * @returns {Code | undefined} A code snippet for destructuring the input payload, if a body type is specified.\n */\n generateInputPayloadParameter(): Code | undefined {\n if (this.commandModel.body) {\n if (this.commandModel.configSchemaType === 'flattened') {\n return code`...body`;\n } else {\n return code`${this.commandModel.body.parameterName}: body`;\n }\n }\n }\n\n /**\n * Generates a method for transforming Aura-specific errors into a standard format, based on the defined error strategy.\n * @returns {Code} A code snippet for a method that coverts Aura errors into a fetch-compatible response.\n */\n generateCoerceError(): Code {\n if (this.commandModel.errorStrategy.type === 'fetchResponse') {\n return code`protected override coerceAuraErrors(auraErrors: any[]):${FETCH_RESPONSE}<unknown>{return ${CONVERT_AURA_ERRORS_TO_FETCH_RESPONSE}(auraErrors[0])}`;\n }\n\n return code``;\n }\n}\n","import { code } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport type { Code, ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'AuraResourceCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n/**\n * Extends AuraCommandGenerator to add cache control strategies specific to resource caching in Aura components.\n *\n * This class further specializes the command generation process by including methods that handle cache control metadata and configuration,\n * ensuring that resources are cached according to the specified strategy in the command model.\n *\n * @extends AuraCommandGenerator\n */\nexport class AuraResourceCacheControlCommandGenerator extends AuraCommandGenerator {\n commandBaseClass = AURA_CACHE_CONTROL_COMMAND_BASE_CLASS;\n\n /**\n * Generates a method to build cache control metadata based on the response type and cache strategy defined in the command model.\n * Throws an error if the cache strategy is set to 'none'.\n *\n * @returns {Code} A code snippet that constructs cache control metadata for the command.\n * @throws {Error} Throws an error if the cache strategy is 'none'.\n */\n generateBuildCacheControlMetadata(): Code {\n if (this.commandModel.cacheStrategy.type !== 'resource') {\n throw new Error('incorrect cache strategy');\n }\n\n return code`buildCacheControlMetadata(_networkResult:${this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n )}){return{type:'max-age',maxAge:${\n this.commandModel.cacheStrategy.config['max-age']\n },generatedTime:Date.now()/1000}as const;}`;\n }\n\n /**\n * Generates a getter method that provides configuration for cache control strategies based on the command model settings.\n * Throws an error if the cache strategy is set to 'none'.\n *\n * @returns {Code} A code snippet that provides cache control strategy configuration.\n * @throws {Error} Throws an error if the cache strategy is 'none'.\n */\n generateCacheControlStrategyConfig(): Code {\n if (this.commandModel.cacheStrategy.type !== 'resource') {\n throw new Error('incorrect cache strategy');\n }\n return code`get cacheControlStrategyConfig(){return{type:'max-age',requestMaxAge:${this.commandModel.cacheStrategy.config['max-age']},now:Date.now()/1000}as const;}`;\n }\n\n /**\n * Overrides the base classBody method to include methods for cache control alongside the standard Aura command class body.\n *\n * @returns {Code[]} An array of code blocks that form the complete class body for the cache-controlled Aura command.\n */\n get classBody(): Code[] {\n return [\n code`\n ${super.classBody}\n ${this.generateCacheControlStrategyConfig()}\n ${this.generateBuildCacheControlMetadata()}\n `,\n ];\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst BUILD_ASYNC_IMPERATIVE_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncImperativeInvoker',\n isType: false,\n};\n\nconst DEFAULT_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'DefaultImperativeResult',\n isType: true,\n};\n\nconst QUERY_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'QueryImperativeResult',\n isType: true,\n};\n\nconst BUILD_ASYNC_IMPERATIVE_SUBSCRIBABLE_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncImperativeSubscribableInvoker',\n isType: false,\n};\n\nconst BUILD_ASYNC_QUERY_IMPERATIVE_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncQueryImperativeInvoker',\n isType: false,\n};\n\nconst SUBSCRIBABLE_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'SubscribableImperativeResult',\n isType: true,\n};\n\nconst SUBSCRIBABLE_REFRESHABLE_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'SubscribableRefreshableImperativeResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nexport class ImperativeAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.className}Options`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}<${this.responseTypeCode}>`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n if (this.isSubscribable()) {\n if (this.commandModel.exposeRefresh) {\n return code`${SUBSCRIBABLE_REFRESHABLE_IMPERATIVE_RESULT}`;\n }\n return code`${SUBSCRIBABLE_IMPERATIVE_RESULT}`;\n }\n\n if (this.commandModel.operationType === 'query') {\n return code`${QUERY_IMPERATIVE_RETURN_SHAPE}`;\n }\n return code`${DEFAULT_IMPERATIVE_RETURN_SHAPE}`;\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n get invoker() {\n if (this.isSubscribable()) {\n return code`${BUILD_ASYNC_IMPERATIVE_SUBSCRIBABLE_INVOKER}`;\n }\n\n if (this.commandModel.operationType === 'query') {\n return code`${BUILD_ASYNC_QUERY_IMPERATIVE_INVOKER}`;\n }\n return code`${BUILD_ASYNC_IMPERATIVE_INVOKER}`;\n }\n\n get exposeRefresh() {\n if (this.isSubscribable()) {\n return code`${this.commandModel.exposeRefresh}`;\n }\n return code``;\n }\n\n isSubscribable() {\n return (\n this.binding.type === 'imperative' &&\n this.commandModel.operationType === 'query' &&\n this.commandModel.cacheStrategy.type !== 'none'\n );\n }\n\n buildInvocation(servicesName = 'services') {\n const requiresTypeRegistry =\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0;\n\n const typeRegistry = requiresTypeRegistry ? 'typeRegistry,' : '';\n\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>,${this.responseTypeCode}>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${typeRegistry}${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n },${this.exposeRefresh}) as ${this.bindingTypeCode};`;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst BUILD_ASYNC_IMPERATIVE_LEGACY_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncImperativeLegacyInvoker',\n isType: false,\n};\n\nconst LEGACY_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'LegacyImperativeShape',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nexport class ImperativeAdapterLegacyBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${LEGACY_IMPERATIVE_RETURN_SHAPE}<${this.commandConfigTypeImport},${this.responseTypeCode}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services') {\n const requiresTypeRegistry =\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0;\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${BUILD_ASYNC_IMPERATIVE_LEGACY_INVOKER}<${this.commandConfigTypeImport},${this.responseTypeCode}>(\n ({config,assertIsValid})=>{\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n return new ${this.localCommandConstructorName}(config,${requiresTypeRegistry ? 'typeRegistry,' : ''}${servicesName});\n });`;\n }\n}\n","export const QUERY_TYPE_VARIABLE_NAME = 'queryType' as const;\nexport const MUTATION_TYPE_VARIABLE_NAME = 'mutationType' as const;\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst BUILD_ASYNC_GRAPHQL_IMPERATIVE_LEGACY_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncGraphQLImperativeLegacyInvoker',\n isType: false,\n};\n\nconst LEGACY_GRAPHQL_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'LegacyGraphQLImperativeShape',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nexport class GraphQLImperativeAdapterLegacyBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${LEGACY_GRAPHQL_IMPERATIVE_RETURN_SHAPE}<${this.commandConfigTypeImport}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${BUILD_ASYNC_GRAPHQL_IMPERATIVE_LEGACY_INVOKER}<${this.commandConfigTypeImport}>(\n ({config,assertIsValid})=>{\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n return new ${this.localCommandConstructorName}(config,${QUERY_TYPE_VARIABLE_NAME},${servicesName});\n });`;\n }\n}\n","import { code, type Code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'WireAdapterConstructor',\n isType: true,\n};\n\nconst COMMAND_WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'CommandWireAdapterConstructor',\n isType: false,\n};\n\nexport class WireAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration(): Code {\n return code`export let ${this.binding.identifier}:${WIRE_ADAPTER_CONSTRUCTOR}<${this.commandConfigTypeImport}, ${this.responseTypeCode}, {}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services'): Code {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=class extends ${COMMAND_WIRE_ADAPTER_CONSTRUCTOR}<${this.responseTypeCode}, ${this.commandConfigTypeImport}>{\n configSchema=${this.commandConfigSchemaImport};\n exposeRefresh=${this.commandModel.exposeRefresh};\n getCommand(){return new ${this.localCommandConstructorName}(this.config!,${this.getTypeRegistryArgument()}${servicesName});}};`;\n }\n\n getTypeRegistryArgument(): Code {\n if (\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0\n ) {\n return code`typeRegistry,`;\n }\n\n return code``;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst BUILD_ASYNC_GRAPHQL_IMPERATIVE_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncGraphQLImperativeInvoker',\n isType: false,\n};\n\nconst SUBSCRIBABLE_REFRESHABLE_GRAPHQL_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'SubscribableRefreshableGraphQLImperativeResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nexport class GraphQLImperativeAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.commandName}CommandOptions`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n return code`${SUBSCRIBABLE_REFRESHABLE_GRAPHQL_IMPERATIVE_RESULT}`;\n }\n\n get invoker() {\n return code`${BUILD_ASYNC_GRAPHQL_IMPERATIVE_INVOKER}`;\n }\n\n get exposeRefresh() {\n if (this.isSubscribable()) {\n return code`${this.commandModel.exposeRefresh}`;\n }\n return code``;\n }\n\n isSubscribable() {\n return true;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${QUERY_TYPE_VARIABLE_NAME},${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n },${this.exposeRefresh}) as ${this.bindingTypeCode};`;\n }\n}\n","import { code, type Code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'WireAdapterConstructor',\n isType: true,\n};\n\nconst GRAPHQL_COMMAND_WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'GraphQLCommandWireAdapterConstructor',\n isType: false,\n};\n\nexport class GraphQLWireAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration(): Code {\n return code`export let ${this.binding.identifier}:${WIRE_ADAPTER_CONSTRUCTOR}<${this.commandConfigTypeImport}, ${this.responseTypeCode}, {}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services'): Code {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=class extends ${GRAPHQL_COMMAND_WIRE_ADAPTER_CONSTRUCTOR}<${this.commandConfigTypeImport}>{\n configSchema=${this.commandConfigSchemaImport};\n exposeRefresh=${this.commandModel.exposeRefresh};\n getCommand(){return new ${this.localCommandConstructorName}(this.config as any,${QUERY_TYPE_VARIABLE_NAME},${servicesName});}};`;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { MUTATION_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst BUILD_ASYNC_GRAPHQL_MUTATION_INVOKER: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'buildAsyncGraphQLMutationInvoker',\n isType: false,\n};\n\nconst GRAPHQL_MUTATION_RESULT: ImportableReference = {\n module: '@conduit-client/lwc-bindings',\n exportedSymbol: 'GraphQLMutationResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nexport class GraphQLMutationAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.commandName}CommandOptions`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n return code`${GRAPHQL_MUTATION_RESULT}`;\n }\n\n get invoker() {\n return code`${BUILD_ASYNC_GRAPHQL_MUTATION_INVOKER}`;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${MUTATION_TYPE_VARIABLE_NAME},${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n }) as ${this.bindingTypeCode};`;\n }\n}\n","import {\n stableJSONStringify,\n stringIsVersion,\n toTypeScriptSafeIdentifier,\n Version,\n} from '@conduit-client/utils';\nimport { code, Code, type ImportableReference, type NamedFileService } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport { ImperativeAdapterBindingGenerator } from './imperative-binding-generator';\nimport { ImperativeAdapterLegacyBindingGenerator } from './imperative-legacy-binding-generator';\nimport { GraphQLImperativeAdapterLegacyBindingGenerator } from './graphql-imperative-legacy-binding-generator';\nimport { WireAdapterBindingGenerator } from './wire-binding-generator';\nimport type { ICommandModel, ServiceDependency } from '../model/base-command-model';\nimport type { IGraphQLCommandModel } from '../model/graphql-command-model-interface';\nimport type {\n NamedTypeRegistryGeneratorService,\n TypeRegistryGenerator,\n} from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport { Binding, NamedAPIService } from '@conduit-client/model/v1';\nimport { GraphQLObjectType } from '../normalization/graphql-type-generator';\nimport { GraphQLImperativeAdapterBindingGenerator } from './graphql-imperative-binding-generator';\nimport { GraphQLWireAdapterBindingGenerator } from './graphql-wire-binding-generator';\nimport { GraphQLMutationAdapterBindingGenerator } from './graphql-mutation-binding-generator';\nimport {\n QUERY_TYPE_VARIABLE_NAME,\n MUTATION_TYPE_VARIABLE_NAME,\n} from './graphql-root-variable-names';\nimport type {\n ResolvedOperationServices,\n ResolvedServiceDescriptor,\n} from '@conduit-client/model/v1';\nimport { buildServiceProjection } from './utils';\n\nconst SERVICE_REQUEST_TYPE: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n exportedSymbol: 'ServiceRequest',\n isType: true,\n};\n\nconst OPTIONAL_SERVICE_REQUEST_TYPE: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n exportedSymbol: 'OptionalServiceRequest',\n isType: true,\n};\n\nconst GET_SERVICES: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n isType: false,\n};\n\nconst INSTRUMENT_COMMAND_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-instrument-command/v1',\n exportedSymbol: 'InstrumentCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_INSTRUMENT_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/service-instrument-command/v1',\n exportedSymbol: 'NamedInstrumentCommandService',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\nconst FETCH_NETWORK_COMMAND_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_FETCH_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'NamedFetchNetworkCommandService',\n isType: true,\n};\n\nexport type IBindingsGenerator = {\n build(): void;\n};\n\nexport function defaultAdapterBindingsGeneratorFactory(\n services: NamedTypeDefinitionService,\n model: ICommandModel,\n binding: Binding\n):\n | ImperativeAdapterBindingGenerator\n | ImperativeAdapterLegacyBindingGenerator\n | WireAdapterBindingGenerator\n | GraphQLImperativeAdapterBindingGenerator\n | GraphQLImperativeAdapterLegacyBindingGenerator\n | GraphQLWireAdapterBindingGenerator\n | GraphQLMutationAdapterBindingGenerator {\n const restBindingGenerators = {\n imperative: ImperativeAdapterBindingGenerator,\n 'imperative-legacy': ImperativeAdapterLegacyBindingGenerator,\n wire: WireAdapterBindingGenerator,\n };\n\n const graphqlBindingGenerators = {\n imperative: GraphQLImperativeAdapterBindingGenerator,\n 'imperative-legacy': GraphQLImperativeAdapterLegacyBindingGenerator,\n wire: GraphQLWireAdapterBindingGenerator,\n mutation: GraphQLMutationAdapterBindingGenerator,\n };\n\n let GeneratorClass:\n | typeof ImperativeAdapterBindingGenerator\n | typeof ImperativeAdapterLegacyBindingGenerator\n | typeof WireAdapterBindingGenerator\n | typeof GraphQLImperativeAdapterBindingGenerator\n | typeof GraphQLImperativeAdapterLegacyBindingGenerator\n | typeof GraphQLWireAdapterBindingGenerator\n | typeof GraphQLMutationAdapterBindingGenerator\n | undefined;\n\n if (model.operationType === 'graphql') {\n const key = binding.type as keyof typeof graphqlBindingGenerators;\n GeneratorClass = graphqlBindingGenerators[key];\n } else {\n const key = binding.type as keyof typeof restBindingGenerators;\n GeneratorClass = restBindingGenerators[key];\n }\n\n if (!GeneratorClass) {\n throw new Error(`Unknown binding type: ${binding.type}`);\n }\n\n return new GeneratorClass(services, model, binding);\n}\n\n/**\n * Class responsible for generating binding files based on command models and service dependencies.\n *\n * The `BindingsGenerator` class orchestrates the creation of files that manage service dependencies,\n * adapters, and invocation logic for a given set of command models. It provides a template for the binding\n * structure and manages the generation and integration of individual adapter bindings.\n *\n * The expectation for new bindings is that new *BindingGenerator classes are used inside of the build method.\n *\n * @property {NamedFileService & NamedTypeDefinitionService} services - Services required for file handling and type definitions.\n * @property {ICommandModel[]} commandModels - Array of command models to generate bindings for.\n */\nexport class BindingsGenerator {\n constructor(\n protected services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService,\n protected commandModels: ICommandModel[],\n protected adapterBindingsGeneratorFactory = defaultAdapterBindingsGeneratorFactory\n ) {}\n\n protected adapterDeclarationSymbol = Symbol.for('adapterDeclarations');\n protected serviceRequirementsSymbol = Symbol.for('serviceRequirements');\n protected adapterInvocationSymbol = Symbol.for('adapterInvocation');\n protected typeRegistryInstantiationSymbol = Symbol.for('typeRegistryInstantiation');\n protected typeInvalidationDeclarationSymbol = Symbol.for('typeInvalidationDeclaration');\n protected typeInvalidationDefinitionSymbol = Symbol.for('typeInvalidationDefinition');\n protected rootTypesInstantiationSymbol = Symbol.for('rootTypesInstantiation');\n\n /**\n * Template for generating the binding structure in the output file.\n * Includes placeholders for adapter declarations, service requirements, and adapter invocations.\n *\n * Bindings files are structured as:\n * 1. Adapter declarations -> an export of the wire or imperative adapter that is initially undefined, but has proper typescript typing\n * 2. Service requirements -> a declaration of what services this module depends on from the service provisioner\n * 3. Adapter instantiation/invocation -> Creation and population of the declaration with a real adapter implementation, after\n * all the required services have been received.\n *\n * @returns {Code[]} An array of code blocks forming the template for the binding output file.\n */\n get template() {\n return [\n this.adapterDeclarationSymbol,\n this.typeInvalidationDeclarationSymbol,\n code`const serviceRequirements=`,\n this.serviceRequirementsSymbol,\n code`;`,\n code`${GET_SERVICES}(serviceRequirements).then(\n (services) => {`,\n this.typeRegistryInstantiationSymbol,\n this.rootTypesInstantiationSymbol,\n this.typeInvalidationDefinitionSymbol,\n this.adapterInvocationSymbol,\n code`},(_err) => {});`,\n ];\n }\n\n protected get serviceDependencies(): ServiceDependency[] {\n const deps = [\n {\n version: '1.0' as const,\n descriptor: INSTRUMENT_COMMAND_DESCRIPTOR,\n namedService: NAMED_INSTRUMENT_COMMAND_SERVICE,\n localName: 'instrumentCommand',\n serviceName: 'instrumentCommand',\n },\n ];\n\n if (this.hasRESTNormalization || this.hasGraphQL) {\n deps.push(\n {\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n },\n {\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n }\n );\n }\n\n if (this.hasImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: FETCH_NETWORK_COMMAND_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_NETWORK_COMMAND_SERVICE,\n localName: 'fetchNetworkCommandBaseClass',\n serviceName: 'fetchNetworkCommandBaseClass',\n });\n }\n\n return deps;\n }\n\n /**\n * Builds the binding file, generating declarations, requirements, and invocations for each command model.\n * This method coordinates with individual binding generators to compile the necessary elements into a single file.\n */\n build() {\n const filename = 'artifacts/lwc-bindings.ts';\n const file = this.services.file.build(filename);\n file.template = this.template;\n\n if (this.hasRESTNormalization) {\n const { typeRegistryGenerator } = this.services;\n file.pushTo(\n this.typeRegistryInstantiationSymbol,\n code`const typeRegistry = new ${typeRegistryGenerator.build()}(services);`\n );\n\n // needs to be called after all the (normalizer) types are built, which is guaranteed for bindings.\n const { declarations, definitions } = this.buildTypeInvalidation(\n typeRegistryGenerator.invalidatableTypes\n );\n\n file.pushTo(this.typeInvalidationDeclarationSymbol, declarations);\n file.pushTo(this.typeInvalidationDefinitionSymbol, definitions);\n }\n\n if (this.hasGraphQL) {\n const { graphqlTypeRegistryGenerator } = this.services;\n const graphqlTypeRegistry = graphqlTypeRegistryGenerator.build();\n const firstGraphQLCommand = this.commandModels.find(\n (model) => model.operationType === 'graphql'\n ) as IGraphQLCommandModel;\n const queryTypeModel: GraphQLObjectType = firstGraphQLCommand?.schema.types.find(\n (type: any) => type.name === firstGraphQLCommand.schema.queryTypeName\n )! as GraphQLObjectType;\n const queryType = graphqlTypeRegistryGenerator.buildGraphQLType({\n schemaModel: firstGraphQLCommand.schema,\n type: queryTypeModel,\n });\n const mutationTypeModel: GraphQLObjectType | undefined = firstGraphQLCommand?.schema\n .mutationTypeName\n ? (firstGraphQLCommand.schema.types.find(\n (type: any) => type.name === firstGraphQLCommand.schema.mutationTypeName\n ) as GraphQLObjectType | undefined)\n : undefined;\n const mutationType = mutationTypeModel\n ? graphqlTypeRegistryGenerator.buildGraphQLType({\n schemaModel: firstGraphQLCommand.schema,\n type: mutationTypeModel,\n })\n : undefined;\n\n file.pushTo(\n this.rootTypesInstantiationSymbol,\n code`const graphqlTypeRegistry = new ${graphqlTypeRegistry}(services);\n const ${QUERY_TYPE_VARIABLE_NAME} = graphqlTypeRegistry.${queryType.propertyName};`\n );\n if (mutationType) {\n file.pushTo(\n this.rootTypesInstantiationSymbol,\n code`const ${MUTATION_TYPE_VARIABLE_NAME} = graphqlTypeRegistry.${mutationType.propertyName};`\n );\n }\n }\n\n const bindingGenerators = this.commandModels.flatMap((model) =>\n model.bindings.map((binding) => {\n return this.adapterBindingsGeneratorFactory(this.services, model, binding);\n })\n );\n\n // adapter declaration\n bindingGenerators.forEach((generator) => {\n file.pushTo(this.adapterDeclarationSymbol, generator.buildDeclaration());\n });\n\n file.pushTo(this.serviceRequirementsSymbol, this.buildRequirements());\n\n file.pushTo(\n this.adapterInvocationSymbol,\n Code.join(\n bindingGenerators.flatMap((generator) => {\n const [servicesName, serviceOverrides] = buildServiceProjection(\n generator.localCommandModel\n );\n const invocation = generator.buildInvocation(servicesName);\n if (serviceOverrides) {\n return [serviceOverrides, invocation];\n }\n return invocation;\n }),\n ''\n )\n );\n }\n\n buildTypeInvalidation(typesWithNormalization: TypeRegistryGenerator['invalidatableTypes']) {\n return typesWithNormalization.reduce<{ definitions: Code[]; declarations: Code[] }>(\n (acc, { propertyName, typeClassRef }) => {\n const invalidateFunctionName = code`invalidate${toTypeScriptSafeIdentifier(propertyName)}`;\n acc.declarations.push(\n code`export let ${invalidateFunctionName}: ${typeClassRef}[\"invalidate\"];`\n );\n acc.definitions.push(\n code`${invalidateFunctionName} = (configs) => typeRegistry.${toTypeScriptSafeIdentifier(propertyName)}.invalidate(configs);`\n );\n return acc;\n },\n { declarations: [], definitions: [] }\n );\n }\n\n protected buildRequirements() {\n const serviceDependencies: ServiceDependency[] = [...this.serviceDependencies];\n\n const depsEqual = (a: ServiceDependency, b: ServiceDependency) => {\n return (\n a.localName === b.localName &&\n a.serviceName === b.serviceName &&\n a.version === b.version &&\n stableJSONStringify(a.tags) === stableJSONStringify(b.tags)\n );\n };\n const findMatchingDeps = (collection: ServiceDependency[], newDep: ServiceDependency) => {\n return collection.filter((existingDep) => depsEqual(existingDep, newDep));\n };\n const pushDep = (collection: ServiceDependency[], newDep: ServiceDependency) => {\n const matchingExistingDeps = findMatchingDeps(collection, newDep);\n const collectionContainsDep = matchingExistingDeps.length > 0;\n\n if (!collectionContainsDep) {\n const existingServicesWithMatchingName = collection.filter(\n (dep) => dep.localName === newDep.localName\n );\n if (existingServicesWithMatchingName.length > 0) {\n throw new Error(\n `Conflicting dependencies for service name ${newDep.localName}: ${JSON.stringify(newDep)}, ${JSON.stringify(existingServicesWithMatchingName)}`\n );\n }\n collection.push(newDep);\n } else {\n // Dep already exists, but may have different requiredness\n const dep = matchingExistingDeps[0];\n dep.optional &&= newDep.optional;\n }\n };\n\n const matchServiceWithOverride = (\n collection: ServiceDependency[],\n alias: string,\n entry: ResolvedServiceDescriptor\n ) => {\n return collection.find((service) => {\n if (service.localName === alias) {\n if (\n !(\n service.version === entry.version &&\n service.tags === entry.tags &&\n service.serviceName === entry.type\n )\n ) {\n return service;\n } else {\n throw new Error(\n `Tried to override service ${alias} but it already existed with the same parameters`\n );\n }\n }\n });\n };\n\n const overrideServices = (\n collection: ServiceDependency[],\n overrides: ResolvedOperationServices,\n model: ICommandModel\n ) => {\n for (const [alias, entry] of Object.entries(overrides)) {\n let existingService = matchServiceWithOverride(collection, alias, entry);\n if (existingService && stringIsVersion(entry.version)) {\n const serviceOverride: ServiceDependency = {\n version: entry.version,\n descriptor: existingService.descriptor,\n namedService: existingService.namedService,\n localName: [entry.type, toTypeScriptSafeIdentifier(model.commandName)].join(\n '_'\n ),\n serviceName: entry.type,\n tags: entry.tags,\n };\n collection.push(serviceOverride);\n } else {\n throw new Error(\n `Tried to override service ${alias} but it did not exist already`\n );\n }\n }\n };\n\n const overrideDefaultServices = (\n collection: ServiceDependency[],\n overrides: ResolvedOperationServices\n ) => {\n for (const [alias, entry] of Object.entries(overrides)) {\n let existingService = matchServiceWithOverride(collection, alias, entry);\n if (existingService && stringIsVersion(entry.version)) {\n // override existing service, but don't change local name, since this now replacing the base version of the service\n existingService.version = entry.version;\n existingService.serviceName = entry.type;\n existingService.tags = entry.tags;\n } else {\n throw new Error(\n `Tried to override service ${alias} but it did not exist already`\n );\n }\n }\n };\n\n this.commandModels.forEach((model) => {\n pushDep(serviceDependencies, model.serviceDependencies.baseClass);\n model.serviceDependencies.inherited.forEach((dep) => pushDep(serviceDependencies, dep));\n model.serviceDependencies.extra.forEach((dep) => pushDep(serviceDependencies, dep));\n overrideServices(serviceDependencies, model.serviceDependencies.overrides, model);\n });\n\n if (this.commandModels.length) {\n // all the models should have the same defaultOverrides so can just pick the first\n overrideDefaultServices(\n serviceDependencies,\n this.commandModels[0].serviceDependencies.defaultOverrides\n );\n }\n\n return code`{${Code.join(\n serviceDependencies.map((dep) => {\n return code`${dep.localName}:{type:'${dep.serviceName}',version:'${dep.version}'${dep.tags ? `,tags:${JSON.stringify(dep.tags)}` : ''}${dep.optional ? `,optional:true` : ''}} as ${dep.optional ? OPTIONAL_SERVICE_REQUEST_TYPE : SERVICE_REQUEST_TYPE}<${dep.descriptor}>`;\n }),\n ','\n )}}`;\n }\n\n protected get hasRESTNormalization() {\n return this.commandModels.some((model) => {\n return model.cacheStrategy.type === 'normalized' && model.operationType !== 'graphql';\n });\n }\n\n protected get hasGraphQL() {\n return this.commandModels.some((model) => model.operationType === 'graphql');\n }\n\n protected get hasImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'imperative' || binding.type == 'mutation'\n )\n );\n }\n}\n","import type { Parameter, Type, QueryParameter, TypeOfParameter } from '@conduit-client/model/v1';\n\n/**\n * Converts a set of parameter specification from Record<string, Parameter> to a list of named parameters info.\n * Performs dupe parameters detection.\n *\n * @param records the parameter specifications to convert\n * @returns a list of parameters info\n */\nexport function getParameterMembers<T extends Type = TypeOfParameter<Parameter>>(\n ...records: Record<string, Parameter<T>>[]\n): { name: string; type: T; required: boolean; explode?: boolean }[] {\n let dupes: string[] = [];\n const members = records.filter(Boolean).reduce(\n (result, record) => {\n const current = result.map((m) => m.name);\n const members = Object.entries(record).map(([name, param]) => {\n return { name, ...param };\n });\n dupes = dupes.concat(\n members.filter((m) => current.includes(m.name)).map((m) => m.name)\n );\n return result.concat(members);\n },\n [] as { name: string; type: T; required: boolean; explode?: boolean }[]\n );\n if (dupes.length > 0) {\n throw new Error(`duplicate parameters found: ${dupes.join(', ')}`);\n }\n return members;\n}\n\nexport const getQueryParameterMembers = getParameterMembers<TypeOfParameter<QueryParameter>>;\n","import { getParameterMembers, getQueryParameterMembers } from '../utils';\nimport {\n type Operation,\n type AllOfType,\n type ObjectType,\n type Type,\n canonicalizeType,\n} from '@conduit-client/model/v1';\nimport type { ContentModel } from '../model/base-command-model';\n\n/**\n * Class for building command configurations based on an operation and its associated parameters.\n * This builder handles the construction of an object type structure that encapsulates various parameters\n * from an operation, including query parameters, headers, URI parameters, and potentially a payload.\n *\n * @property {Operation} operation - The operation object that provides context for the command configuration.\n * @property {{ type: Type; name: string } | undefined} payload - Optional payload definition that specifies the type and name of the main data structure if needed.\n */\nexport class CommandConfigBuilder {\n constructor(\n protected operation: Operation,\n protected payload?: { content: ContentModel; parameterName: string }\n ) {}\n\n /**\n * Builds and returns an object type configuration based on the initial operation and the optional payload.\n * This method organizes various request parameters into a structured type definition, suitable for generating type-safe command configurations.\n *\n * @returns {ObjectType} The complete configuration type for the command, encapsulating all necessary parameters and payload definitions.\n */\n build(): Type {\n const request = this.operation.requests[0];\n\n const queryParams = [request?.queryParameters];\n const otherParams = [\n // request?.cookies,\n request?.headers,\n request?.uriParameters,\n this.operation.endpoint.uriParameters,\n this.operation.server.uriParameters,\n ];\n\n const configType = {\n type: 'allOf',\n allOf: [\n {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'not',\n\n not: { type: 'any' },\n },\n },\n ],\n includes: (_t: Type) => false,\n } as AllOfType;\n\n [\n ...getQueryParameterMembers(...queryParams),\n ...getParameterMembers(...otherParams),\n ].forEach((param) => {\n (configType.allOf[0] as ObjectType).properties[param.name] = {\n type: param.type,\n required: param.required,\n };\n });\n\n if (this.payload) {\n if (this.operation.configSchemaType === 'flattened') {\n // Input payload needs to be flattened for backwards compatibility with\n // older versions of Luvio.\n let payloadType = this.payload.content['application/json']!;\n let canonicalPayloadType = canonicalizeType(payloadType);\n\n // when flattening, we use `allOf`, which means all members of the `allOf` must allow `additionalProperties`\n if (canonicalPayloadType.type === 'object') {\n canonicalPayloadType = {\n ...canonicalPayloadType,\n additionalProperties: {\n type: 'any',\n },\n };\n }\n configType.allOf.push(canonicalPayloadType);\n (configType.allOf[0] as ObjectType).additionalProperties = {\n type: 'any',\n };\n } else {\n (configType.allOf[0] as ObjectType).properties[this.payload.parameterName] = {\n type: this.payload.content['application/json']!,\n required: true,\n };\n }\n }\n return configType;\n }\n}\n","import { canonicalizeType, Type } from '@conduit-client/model/v1';\nimport { Code, code, ImportableTypeReference, ImportableValueReference } from '../files';\nimport type { CommandGenerator } from './base-command-generator';\n\n// Interface to define the methods provided by the normalized cache control mixin\nexport interface NormalizedCacheControlGenerator {\n generateCacheControlStrategyConfig(): Code;\n}\n\ntype Constructor = new (...args: any[]) => CommandGenerator;\ntype NormalizedCacheControlConstructor = new (\n ...args: any[]\n) => CommandGenerator & NormalizedCacheControlGenerator;\n\nconst DATA_OF: ImportableTypeReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'DataOf',\n isType: true,\n};\n\n/**\n *\n * @param Base The base class to mix in the normalized code generation logic to\n * @param commandBaseClass An importable refernce to the command base class to use in the generated code\n * @returns A new class with the normalized generation behavior mixed in\n */\nexport function NormalizedCacheControlGeneratorMixin(\n Base: Constructor,\n commandBaseClass: ImportableTypeReference\n): NormalizedCacheControlConstructor {\n return class NormalizedCacheControl extends Base implements NormalizedCacheControlGenerator {\n commandBaseClass = commandBaseClass;\n get commandTypeConstructorArgs() {\n return code`config: Config, typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n get commandConstructorArgs() {\n return code`private config: Config, private typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n const builtType = this.buildResponseType();\n return code`${builtType.typeClassRef}${extraServicesCode ? code`, ${extraServicesCode}` : ''}`;\n }\n\n get classBody(): Code[] {\n return [\n ...super.classBody,\n // TODO: this is a stub for the real data\n this.generateCacheControlStrategyConfig(),\n this.generateBuildResultType(),\n this.generateBuildReadInput(),\n this.generateBuildWriteInput(),\n ];\n }\n\n generateCacheControlStrategyConfig(): Code {\n if (this.commandModel.cacheStrategy.type !== 'normalized') {\n throw new Error('incorrect cache strategy');\n }\n\n const cacheControl = this.commandModel.cacheStrategy['cache-control'];\n\n function getCacheControlValue() {\n if (cacheControl.type === 'no-cache') {\n return code`{type: 'no-cache', now:Date.now()/1000}`;\n }\n return code`{type: 'max-age',requestMaxAge: ${cacheControl['max-age']},now:Date.now()/1000}`;\n }\n\n return code`get cacheControlStrategyConfig(){return ${getCacheControlValue()} as const;}`;\n }\n\n protected generateBuildResultType() {\n const builtType = this.buildResponseType();\n return code`buildResultType(){return this.typeRegistry.${builtType.propertyName}}`;\n }\n\n protected generateBuildReadInput() {\n return code`buildQuery(){\n return {type: 'keyParams', keyParams: ${this.buildKeyConfig()} } as const;\n }`;\n }\n\n protected generateBuildWriteInput() {\n return code`buildWriteInput(data: ${DATA_OF}<${this.buildResponseType().typeClassRef}>){return ${this.needsResourceWrapperType ? '{data, keyParams: this.config}' : '{data}'};}`;\n }\n\n private get responseType() {\n const responseType = this.commandModel.responseType?.default['application/json'];\n if (!responseType) {\n throw new Error('Could not find a response for operation');\n }\n return canonicalizeType(responseType);\n }\n\n private get cacheStrategy() {\n const cacheStrategy = this.commandModel.cacheStrategy;\n if (cacheStrategy.type !== 'normalized') {\n throw new Error('Got an unnormalized operation');\n }\n return cacheStrategy;\n }\n\n private get needsResourceWrapperType() {\n const isOperationMappedToIdentifiableType =\n this.cacheStrategy.key && this.responseType.extensions?.type === 'identifiable';\n\n return !isOperationMappedToIdentifiableType;\n }\n\n private buildResponseType(): {\n propertyName: string;\n typeClassRef: ImportableValueReference;\n } {\n const responseType = this.responseType;\n\n if (this.needsResourceWrapperType) {\n const wrappedResponseType = {\n type: 'ref',\n $ref: responseType,\n extensions: {\n type: 'identifiable',\n key: { fields: {} },\n 'cache-control': this.cacheStrategy['cache-control'],\n },\n } as const satisfies Type;\n return this.services.typeRegistryGenerator.buildType(wrappedResponseType, {\n namespace: this.services.api.api.namespace,\n name: `${this.commandModel.commandName}Response`,\n keyParamType: { ...this.commandModel.configType },\n isInvalidatable: false,\n });\n }\n\n const typename = this.services.api.api.types.nameOf(responseType);\n\n if (typename === undefined) {\n throw new Error('cannot find name for response type');\n }\n\n return this.services.typeRegistryGenerator.buildType(responseType, {\n namespace: this.services.api.api.namespace,\n name: typename,\n });\n }\n\n private buildKeyConfig() {\n if (this.needsResourceWrapperType) {\n return this.buildResourceKeyConfig();\n }\n const operationKey = this.cacheStrategy.key!;\n\n return this.buildMappedKeyConfig(operationKey);\n }\n\n private buildResourceKeyConfig() {\n return code`this.config`;\n }\n };\n}\n","import { code, type ImportableTypeReference, type Code } from '../files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { ImportableReference, NamedFileService } from '../files';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport { GraphQLSchemaModel } from '../model/graphql-schema-model';\nimport type { CommandGenerator } from './base-command-generator';\nimport type { NormalizedCacheControlGenerator } from './normalized-cache-control-generator-mixin';\nimport { GRAPHQL_DATA } from '../normalization/graphql/base-type-generator';\n\nconst GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY: ImportableTypeReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLDocumentRootTypeRepository',\n isType: true,\n};\n\nconst DOCUMENT_NODE: ImportableTypeReference = {\n module: '@conduit-client/onestore-graphql-parser/v1',\n exportedSymbol: 'DocumentNode',\n isType: true,\n};\n\nconst GRAPHQL_QUERY_JSON_SCHEMA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLQueryJsonSchema',\n isType: false,\n};\n\nconst NAMED_CACHE_CONTROLLER_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst NAMED_AURA_NETWORK_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkService',\n isType: true,\n};\n\nconst NAMED_FETCH_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\ntype Constructor = new (...args: any[]) => CommandGenerator & NormalizedCacheControlGenerator;\n\ntype GraphQLCommandGeneratorServices = NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService;\n\n/**\n * Mixin that adds GraphQL-specific functionality to command generators.\n * This mixin modifies command generators to work with GraphQL operations by:\n * 1. Using DocumentNode for the query config type instead of string\n * 2. Adding documentRootType parameter to constructor\n * 3. Generating GraphQL-specific methods like buildRequestQuery\n */\nexport function GraphQLNormalizedCacheControlGeneratorMixin(\n Base: Constructor,\n commandBaseClass: ImportableTypeReference\n): Constructor {\n return class GraphQLNormalizedCacheControl extends Base {\n // Type assertion to ensure services has GraphQL type registry\n declare services: GraphQLCommandGeneratorServices;\n\n commandBaseClass = commandBaseClass;\n\n protected documentRootTypeSymbol = Symbol.for('documentRootType');\n\n get template() {\n return [\n code`export type DocumentRootType = ${GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY}<${GRAPHQL_DATA}, ${GRAPHQL_DATA}>;`,\n ...super.template,\n ];\n }\n\n protected buildNetworkServicesCode(): Code {\n return this.commandModel.aura\n ? code`Partial<${NAMED_AURA_NETWORK_SERVICE}> & Partial<${NAMED_FETCH_SERVICE}>`\n : code`${NAMED_FETCH_SERVICE}`;\n }\n\n protected generateCommandType(): Code {\n return code`export type Command = new (config: Config, documentRootType: DocumentRootType, services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object) => CommandType;`;\n }\n\n get commandTypeConstructorArgs() {\n return code`config: Config, documentRootType: DocumentRootType, services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object`;\n }\n\n get commandConstructorArgs() {\n return code`protected config: Config, protected documentRootType: DocumentRootType, protected services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object`;\n }\n\n get commandConstructorBody() {\n return code`super(config, documentRootType, services);`;\n }\n\n get classBody(): Code[] {\n // For GraphQL commands, we only need to override specific methods\n // The base class already provides most GraphQL functionality\n return [\n this.generateCacheControlStrategyConfig(),\n this.generateUrl(),\n this.generateEndpoint(),\n this.generateAuraBodyWrapperName(),\n ];\n }\n\n // Override to avoid generating an operationType getter on GraphQL commands\n protected generateOperationType(): Code {\n return code``;\n }\n\n /**\n * Generate the URL getter for the GraphQL endpoint\n */\n protected generateUrl(): Code {\n // Use the endpoint path from the command model\n const path = this.commandModel.endpointUrlPath;\n return code`\n get url() { \n return '${path}'; \n }\n `;\n }\n\n /**\n * Generate the endpoint property for GraphQL commands\n */\n protected generateEndpoint(): Code {\n const aura = this.commandModel.aura;\n if (aura) {\n return code`endpoint = '${aura.controller}.${aura.method}';`;\n }\n return code``;\n }\n\n /**\n * Generate the auraBodyWrapperName getter\n */\n protected generateAuraBodyWrapperName(): Code {\n // Use the aura body param if available\n const bodyParam = this.commandModel.aura?.bodyParam;\n if (bodyParam) {\n return code`\n protected get auraBodyWrapperName() { \n return '${bodyParam}'; \n }\n `;\n }\n return code``;\n }\n\n protected buildCommandConfigType() {\n // Override to use DocumentNode for query field instead of merging with base type\n return code`{\n query: ${DOCUMENT_NODE};\n variables?: Record<string, unknown>;\n operationName?: string;\n } & Record<string, unknown>`;\n }\n\n protected buildCommandConfigSchema() {\n return code`${GRAPHQL_QUERY_JSON_SCHEMA}`;\n }\n\n protected generateConstructor(): Code {\n return code`constructor(${this.commandConstructorArgs}){${this.commandConstructorBody}}`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n return code`${extraServicesCode ? code`, ${extraServicesCode}` : 'object'}`;\n }\n };\n}\n","import { type ImportableReference } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\nimport { GraphQLNormalizedCacheControlGeneratorMixin } from './graphql-normalized-cache-control-generator-mixin';\n\nconst HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'HttpGraphQLNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n// First apply the normalized cache control mixin to HttpCommandGenerator\nconst HttpNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n HttpCommandGenerator,\n HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n\n// Then apply the GraphQL mixin to the normalized cache control generator\nexport const HttpGraphQLNormalizedCacheControlCommandGenerator =\n GraphQLNormalizedCacheControlGeneratorMixin(\n HttpNormalizedCacheControlCommandGenerator,\n HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n );\n","import { type ServiceVersion, toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { CommandConfigBuilder } from '../generators/command-config-builder';\nimport { getParameterMembers, getQueryParameterMembers } from '../utils';\nimport type { ImportableReference } from '../files';\nimport type {\n Operation,\n Parameter,\n Payload,\n Type,\n QueryParameter,\n TypeOfParameter,\n HttpMethod,\n Binding,\n ResolvedOperationServices,\n} from '@conduit-client/model/v1';\nimport type { InvalidateConfig } from '@conduit-client/utils';\n\nexport type ServiceDependency = {\n version: ServiceVersion;\n descriptor: ImportableReference;\n namedService: ImportableReference;\n localName: string;\n serviceName: string;\n tags?: Record<string, string>;\n optional?: boolean;\n};\n\nexport type CommandServiceDependencies = {\n baseClass: ServiceDependency;\n inherited: ServiceDependency[];\n extra: ServiceDependency[];\n overrides: ResolvedOperationServices;\n defaultOverrides: ResolvedOperationServices;\n};\n\nexport type OperationType = 'query' | 'mutation' | 'graphql';\nexport type ContentModel = {\n 'application/json'?: Type;\n};\n\nexport type CacheStrategy =\n | {\n type: 'none';\n }\n | {\n type: 'resource';\n config: {\n 'max-age': number;\n };\n }\n | {\n type: 'normalized';\n 'cache-control':\n | { type: 'no-cache' }\n | {\n type: 'max-age';\n 'max-age': number;\n };\n key?: Record<string, string>;\n };\n\nexport type ErrorStrategy =\n | {\n type: 'stringified';\n }\n | {\n type: 'fetchResponse';\n };\nexport type ConfigSchemaType = 'default' | 'flattened';\n\nexport type InvalidationConfig = {\n statusCode: string;\n invalidation: InvalidateConfig[];\n};\n\nexport type NetworkPreference = 'aura' | 'http';\n\nexport type ICommandModel = {\n readonly transportType: 'aura' | 'http';\n readonly className: string;\n readonly commandName: string;\n readonly filePath: string;\n readonly bindings: Binding[];\n readonly configType: Type;\n readonly responseType:\n | ({\n default: ContentModel;\n } & {\n [statusCode: number]: ContentModel;\n })\n | undefined;\n readonly uriParameters: {\n name: string;\n type: TypeOfParameter<Parameter>;\n required: boolean;\n explode?: boolean;\n }[];\n readonly queryParameters: {\n name: string;\n type: TypeOfParameter<QueryParameter>;\n required: boolean;\n explode?: boolean;\n }[];\n readonly headers: {\n name: string;\n type: TypeOfParameter<Parameter>;\n required: boolean;\n explode?: boolean;\n defaultValue?: TypeOfParameter<Parameter>;\n }[];\n readonly body?: {\n content: ContentModel;\n parameterName: string;\n };\n getAllParams(): {\n name: string;\n type: TypeOfParameter<Parameter<Type>>;\n required: boolean;\n explode?: boolean;\n defaultValue?: TypeOfParameter<Parameter<Type>>;\n }[];\n\n readonly serviceDependencies: CommandServiceDependencies;\n readonly configSchemaType: ConfigSchemaType;\n readonly exposeRefresh: boolean;\n readonly operationType: OperationType;\n\n aura?: { controller: string; method: string; bodyParam?: string };\n networkPreference?: NetworkPreference;\n errorStrategy: ErrorStrategy;\n cacheStrategy: CacheStrategy;\n method: HttpMethod;\n serverUrlPath: string;\n endpointUrlPath: string;\n invalidationConfigs: InvalidationConfig[];\n};\n\n/**\n * Base abstract class for command models that encapsulates the common functionality required by all command models.\n * It provides a structure for mapping API operations to the necessary command-specific metadata to be used for code generation.\n */\nexport abstract class BaseCommandModel implements ICommandModel {\n constructor(protected operation: Operation) {}\n\n abstract get serviceDependencies(): CommandServiceDependencies;\n getAllParams(): {\n name: string;\n type: TypeOfParameter<Parameter<Type>>;\n required: boolean;\n explode?: boolean;\n }[] {\n return [...this.queryParameters, ...this.uriParameters, ...this.headers];\n }\n\n get transportType() {\n return this.operation.endpoint.type;\n }\n\n /**\n * Defaulted in {@link ../../../../model/src/v1/amf/endpoints/amf-operation.ts#L54}\n * */\n get bindings(): Binding[] {\n return this.operation.bindings;\n }\n\n get body() {\n return this.buildBody();\n }\n\n get configType() {\n return new CommandConfigBuilder(this.operation, this.buildBody()).build();\n }\n\n get responseType() {\n return this.buildResponseType();\n }\n\n get uriParameters() {\n return getParameterMembers(\n this.operation.server.uriParameters,\n this.operation.endpoint.uriParameters,\n this.request?.uriParameters || {}\n );\n }\n\n get queryParameters() {\n return getQueryParameterMembers(this.request?.queryParameters || {});\n }\n\n get headers() {\n return getParameterMembers(this.request?.headers || {});\n }\n\n get commandName() {\n return toTypeScriptSafeIdentifier(\n this.operation.operationId || this.operation.bindings[0].identifier\n );\n }\n\n get className() {\n return `${this.commandName}Command`;\n }\n\n get filePath() {\n return `commands/${this.className}.ts`;\n }\n\n get configSchemaType() {\n return this.operation.configSchemaType;\n }\n\n get exposeRefresh() {\n return this.operation.exposeRefresh;\n }\n\n get operationType() {\n return this.operation.operationType;\n }\n\n get errorStrategy() {\n return this.operation.errorStrategy;\n }\n\n get cacheStrategy() {\n return this.operation.cacheStrategy;\n }\n\n get method() {\n return this.operation.method;\n }\n\n get serverUrlPath() {\n return this.operation.server.url;\n }\n\n get endpointUrlPath() {\n return this.operation.endpoint.path;\n }\n\n get request() {\n return this.operation.requests[0];\n }\n\n get invalidationConfigs(): InvalidationConfig[] {\n return this.operation.responses\n .filter((res) => {\n return res.invalidation !== undefined;\n })\n .map((invalidationResponse) => {\n return {\n statusCode: invalidationResponse.statusCode.toString(),\n invalidation: invalidationResponse.invalidation!,\n };\n });\n }\n\n protected buildBody(): { content: ContentModel; parameterName: string } | undefined {\n let payload = undefined;\n // We currently only look at the first request defined to define the config, something to expand on in the future...\n if (\n this.request !== undefined &&\n (this.request.payloads?.length || 0) > 0 &&\n 'configBodyParam' in this.operation\n ) {\n // We currently only support application/json requests\n let inputPayloadType = getPayloadForMediaType(this.request.payloads);\n if (!inputPayloadType) {\n throw new Error(\n `unsupported input payload type in ${this.operation.method} ${this.operation.endpoint.path} operation. Only application/json is supported`\n );\n }\n\n payload = {\n parameterName: this.operation.configBodyParam,\n content: { 'application/json': inputPayloadType },\n };\n }\n return payload;\n }\n\n protected buildResponseType() {\n const jsonType = getPayloadForMediaType(\n this.operation.responses[0]?.payloads,\n 'application/json'\n );\n return jsonType\n ? {\n default: { 'application/json': jsonType },\n }\n : undefined;\n }\n}\n\n/**\n * Gets the payload with the specified media type.\n *\n * @param payloads\n * @param mediaType\n * @returns\n */\nfunction getPayloadForMediaType(\n payloads: Array<Payload>,\n mediaType: string = 'application/json'\n): Type | undefined {\n let inputPayloadType = undefined;\n if (payloads?.length > 0) {\n const requestPayload = payloads.find((payload) => payload.mediaType === mediaType);\n inputPayloadType = requestPayload ? requestPayload.data : undefined;\n }\n return inputPayloadType;\n}\n","import { BaseCommandModel, type CommandServiceDependencies } from './base-command-model';\nimport type { ImportableReference } from '../files';\nimport type {\n AuraEndPoint,\n AuraOperation,\n AuraOperationWithRequestBody,\n} from '@conduit-client/model/v1';\n\nconst NAMED_AURA_NETWORK_SERVICE: ImportableReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkService',\n isType: true,\n};\n\nconst AURA_NETWORK_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'AuraNetworkServiceDescriptor',\n isType: true,\n};\n\nconst AURA_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-network/v1',\n exportedSymbol: 'AuraNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command/aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkCommandService',\n isType: true,\n};\n\nconst NAMED_FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\nconst FETCH_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model for Aura-specific operations, extending the functionalities of the BaseCommandModel.\n * This class is used to model Aura specific code metadata from the API model.\n */\nexport class AuraCommandModel extends BaseCommandModel {\n getAllParams() {\n return [...this.queryParameters, ...this.uriParameters];\n }\n\n get networkPreference() {\n return (this.operation.endpoint as AuraEndPoint).networkPreference;\n }\n\n /**\n * Gets the Aura controller and method associated with the operation.\n * @returns {object} An object containing the `controller` and `method` names.\n */\n get aura() {\n const auraOperation = this.operation as AuraOperation;\n return {\n controller: (this.operation.endpoint as AuraEndPoint).auraController.name,\n method: auraOperation.aura.methodName,\n bodyParam: 'bodyParam' in auraOperation.aura ? auraOperation.aura.bodyParam : undefined,\n };\n }\n\n /**\n * Provides the service dependencies required by this AuraCommandModel.\n * Includes information about the base class and inherited services, as well as any extra dependencies.\n * @returns {object} An object detailing the service dependencies for the Aura command.\n */\n get serviceDependencies(): CommandServiceDependencies {\n return {\n baseClass: {\n version: '1.0' as const,\n descriptor: AURA_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_NETWORK_COMMAND_SERVICE,\n localName: 'auraNetworkCommandBaseClass',\n serviceName: 'auraNetworkCommandBaseClass',\n },\n inherited: [\n {\n version: '1.0' as const,\n descriptor: AURA_NETWORK_SERVICE_DESCRIPTOR,\n namedService: NAMED_AURA_NETWORK_SERVICE,\n localName: 'auraNetwork',\n serviceName: 'auraNetwork',\n optional: true,\n },\n {\n version: '1.0' as const,\n descriptor: FETCH_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_SERVICE,\n localName: 'fetch',\n serviceName: 'fetch',\n optional: true,\n },\n ],\n extra: [],\n overrides: this.operation.serviceOverrides || {},\n defaultOverrides: this.operation.defaults?.services || {},\n };\n }\n}\n","import { BaseCommandModel, type ServiceDependency } from './base-command-model';\nimport type { ImportableReference } from '../files';\n\nexport const INPUT_PAYLOAD_MEMBER_NAME = 'inputPayload';\n\nconst NAMED_FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\nconst FETCH_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchServiceDescriptor',\n isType: true,\n};\nconst FETCH_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_FETCH_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'NamedFetchNetworkCommandService',\n isType: true,\n};\n\n/**\n * Represents an HTTP command model that extends BaseCommandModel to handle HTTP-specific commands.\n * This model specifically manages the input payload and service dependencies for HTTP operations.\n */\nexport class HttpCommandModel extends BaseCommandModel {\n getInputPayloadParameterName(): string {\n return INPUT_PAYLOAD_MEMBER_NAME;\n }\n\n getAllParams() {\n return [...this.queryParameters, ...this.uriParameters, ...this.headers];\n }\n\n /**\n * Defines and retrieves the service dependencies for the HTTP command model,\n * including any adjustments based on the server URL indicating specific service requirements.\n * @returns {CommandServiceDependencies} An object detailing the service dependencies.\n */\n get serviceDependencies() {\n const baseClass: ServiceDependency = {\n version: '1.0' as const,\n descriptor: FETCH_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_FETCH_NETWORK_COMMAND_SERVICE,\n localName: 'fetchNetworkCommandBaseClass',\n serviceName: 'fetchNetworkCommandBaseClass',\n };\n const SFAP_BASE_URL = 'api.salesforce.com';\n const isSfapServer = [this.operation.server].some((server) => {\n try {\n const url = new URL(server.url);\n return url.host.includes(SFAP_BASE_URL);\n } catch (_e) {\n return server.url.startsWith(SFAP_BASE_URL);\n }\n });\n\n const fetchServiceDependency: ServiceDependency = {\n version: '1.0' as const,\n descriptor: FETCH_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_SERVICE,\n localName: 'fetch',\n serviceName: 'fetch',\n };\n\n if (isSfapServer) {\n fetchServiceDependency.tags = { authenticationScopes: 'sfap_api' };\n }\n\n return {\n baseClass,\n inherited: [fetchServiceDependency],\n extra: [],\n overrides: this.operation.serviceOverrides || {},\n defaultOverrides: this.operation.defaults?.services || {},\n };\n }\n}\n","import { AuraCommandModel } from './aura-command-model';\nimport type { ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'AuraNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'NamedAuraNormalizedCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling normalized caching in Aura applications.\n * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class AuraNormalizedCachingCommandModel extends AuraCommandModel {\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraNormalizedCacheControlCommand',\n serviceName: 'auraNormalizedCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","import { AuraCommandModel } from './aura-command-model';\nimport type { ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'AuraResourceCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'NamedAuraResourceCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling resource caching in Aura applications.\n * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class AuraResourceCachingCommandModel extends AuraCommandModel {\n /**\n * Overrides the serviceDependencies getter to customize dependencies for caching.\n * Adds specific dependencies related to cache control, while preserving the base dependencies from `AuraCommandModel`.\n * @returns {CommandServiceDependencies} An object detailing the service dependencies for caching.\n */\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraResourceCacheControlCommand',\n serviceName: 'auraResourceCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","import { type ImportableReference } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\n\nconst AURA_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'AuraNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nexport const AuraNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n AuraCommandGenerator,\n AURA_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n","import { type ImportableReference } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\n\nconst HTTP_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'HttpNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nexport const HttpNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n HttpCommandGenerator,\n HTTP_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n","import { HttpCommandModel } from './http-command-model';\nimport type { ImportableReference } from '../files';\n\nconst HTTP_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'HttpNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_HTTP_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'NamedHttpNormalizedCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling normalized caching for HTTP transport adapters.\n * This model extends `HttpCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class HttpNormalizedCachingCommandModel extends HttpCommandModel {\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: HTTP_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_HTTP_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'httpNormalizedCacheControlCommand',\n serviceName: 'httpNormalizedCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","export function devAssert(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport function isObjectLike(value) {\n return typeof value == 'object' && value !== null;\n}\n","export function invariant(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(\n message != null ? message : 'Unexpected invariant triggered.',\n );\n }\n}\n","import { invariant } from '../jsutils/invariant.mjs';\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}\n","import { getLocation } from './location.mjs';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\nexport function printLocation(location) {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines = [];\n\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines.slice(1, subLineIndex + 1).map((subLine) => ['|', subLine]),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(lines) {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n","import { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { getLocation } from '../language/location.mjs';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.mjs';\n\nfunction toNormalizedOptions(args) {\n const firstArg = args[0];\n\n if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {\n return {\n nodes: firstArg,\n source: args[1],\n positions: args[2],\n path: args[3],\n originalError: args[4],\n extensions: args[5],\n };\n }\n\n return firstArg;\n}\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n\n /**\n * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.\n */\n constructor(message, ...rawArgs) {\n var _this$nodes, _nodeLocations$, _ref;\n\n const { nodes, source, positions, path, originalError, extensions } =\n toNormalizedOptions(rawArgs);\n super(message);\n this.name = 'GraphQLError';\n this.path = path !== null && path !== void 0 ? path : undefined;\n this.originalError =\n originalError !== null && originalError !== void 0\n ? originalError\n : undefined; // Compute list of blame nodes.\n\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n const nodeLocations = undefinedIfEmpty(\n (_this$nodes = this.nodes) === null || _this$nodes === void 0\n ? void 0\n : _this$nodes.map((node) => node.loc).filter((loc) => loc != null),\n ); // Compute locations in the source for the given nodes/positions.\n\n this.source =\n source !== null && source !== void 0\n ? source\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : (_nodeLocations$ = nodeLocations[0]) === null ||\n _nodeLocations$ === void 0\n ? void 0\n : _nodeLocations$.source;\n this.positions =\n positions !== null && positions !== void 0\n ? positions\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => loc.start);\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => getLocation(loc.source, loc.start));\n const originalExtensions = isObjectLike(\n originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions,\n )\n ? originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions\n : undefined;\n this.extensions =\n (_ref =\n extensions !== null && extensions !== void 0\n ? extensions\n : originalExtensions) !== null && _ref !== void 0\n ? _ref\n : Object.create(null); // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: {\n enumerable: false,\n },\n nodes: {\n enumerable: false,\n },\n source: {\n enumerable: false,\n },\n positions: {\n enumerable: false,\n },\n originalError: {\n enumerable: false,\n },\n }); // Include (non-enumerable) stack trace.\n\n /* c8 ignore start */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n\n if (\n originalError !== null &&\n originalError !== void 0 &&\n originalError.stack\n ) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n /* c8 ignore stop */\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLError';\n }\n\n toString() {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n toJSON() {\n const formattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * See: https://spec.graphql.org/draft/#sec-Errors\n */\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n *\n * @deprecated Please use `error.toString` instead. Will be removed in v17\n */\nexport function printError(error) {\n return error.toString();\n}\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n *\n * @deprecated Please use `error.toJSON` instead. Will be removed in v17\n */\n\nexport function formatError(error) {\n return error.toJSON();\n}\n","import { GraphQLError } from './GraphQLError.mjs';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\n}\n","/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n constructor(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n get [Symbol.toStringTag]() {\n return 'Location';\n }\n\n toJSON() {\n return {\n start: this.start,\n end: this.end,\n };\n }\n}\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport class Token {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. <SOF> is always the first node and <EOF>\n * the last.\n */\n constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'Token';\n }\n\n toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n/**\n * The list of all possible AST node types.\n */\n\n/**\n * @internal\n */\nexport const QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: [\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'name', // Note: fragment variable definitions are deprecated and will removed in v17.0.0\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n};\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n const maybeKind =\n maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n/** Name */\n\nvar OperationTypeNode;\n\n(function (OperationTypeNode) {\n OperationTypeNode['QUERY'] = 'query';\n OperationTypeNode['MUTATION'] = 'mutation';\n OperationTypeNode['SUBSCRIPTION'] = 'subscription';\n})(OperationTypeNode || (OperationTypeNode = {}));\n\nexport { OperationTypeNode };\n","/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation;\n\n(function (DirectiveLocation) {\n DirectiveLocation['QUERY'] = 'QUERY';\n DirectiveLocation['MUTATION'] = 'MUTATION';\n DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION';\n DirectiveLocation['FIELD'] = 'FIELD';\n DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION';\n DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD';\n DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT';\n DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION';\n DirectiveLocation['SCHEMA'] = 'SCHEMA';\n DirectiveLocation['SCALAR'] = 'SCALAR';\n DirectiveLocation['OBJECT'] = 'OBJECT';\n DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION';\n DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION';\n DirectiveLocation['INTERFACE'] = 'INTERFACE';\n DirectiveLocation['UNION'] = 'UNION';\n DirectiveLocation['ENUM'] = 'ENUM';\n DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE';\n DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';\n DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';\n})(DirectiveLocation || (DirectiveLocation = {}));\n\nexport { DirectiveLocation };\n/**\n * The enum type representing the directive location values.\n *\n * @deprecated Please use `DirectiveLocation`. Will be remove in v17.\n */\n","/**\n * The set of allowed kind values for AST nodes.\n */\nvar Kind;\n\n(function (Kind) {\n Kind['NAME'] = 'Name';\n Kind['DOCUMENT'] = 'Document';\n Kind['OPERATION_DEFINITION'] = 'OperationDefinition';\n Kind['VARIABLE_DEFINITION'] = 'VariableDefinition';\n Kind['SELECTION_SET'] = 'SelectionSet';\n Kind['FIELD'] = 'Field';\n Kind['ARGUMENT'] = 'Argument';\n Kind['FRAGMENT_SPREAD'] = 'FragmentSpread';\n Kind['INLINE_FRAGMENT'] = 'InlineFragment';\n Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition';\n Kind['VARIABLE'] = 'Variable';\n Kind['INT'] = 'IntValue';\n Kind['FLOAT'] = 'FloatValue';\n Kind['STRING'] = 'StringValue';\n Kind['BOOLEAN'] = 'BooleanValue';\n Kind['NULL'] = 'NullValue';\n Kind['ENUM'] = 'EnumValue';\n Kind['LIST'] = 'ListValue';\n Kind['OBJECT'] = 'ObjectValue';\n Kind['OBJECT_FIELD'] = 'ObjectField';\n Kind['DIRECTIVE'] = 'Directive';\n Kind['NAMED_TYPE'] = 'NamedType';\n Kind['LIST_TYPE'] = 'ListType';\n Kind['NON_NULL_TYPE'] = 'NonNullType';\n Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition';\n Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition';\n Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition';\n Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition';\n Kind['FIELD_DEFINITION'] = 'FieldDefinition';\n Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition';\n Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition';\n Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition';\n Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition';\n Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition';\n Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition';\n Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition';\n Kind['SCHEMA_EXTENSION'] = 'SchemaExtension';\n Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension';\n Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension';\n Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension';\n Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension';\n Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';\n Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';\n})(Kind || (Kind = {}));\n\nexport { Kind };\n/**\n * The enum type representing the possible kind values of AST nodes.\n *\n * @deprecated Please use `Kind`. Will be remove in v17.\n */\n","/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code) {\n return code === 0x0009 || code === 0x0020;\n}\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\n\nexport function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\n\nexport function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameContinue(code) {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n","import { isWhiteSpace } from './characterClasses.mjs';\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\n\nexport function dedentBlockStringLines(lines) {\n var _firstNonEmptyLine2;\n\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n var _firstNonEmptyLine;\n\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine =\n (_firstNonEmptyLine = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine !== void 0\n ? _firstNonEmptyLine\n : i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return lines // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) // Remove leading and trailing blank lines.\n .slice(\n (_firstNonEmptyLine2 = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine2 !== void 0\n ? _firstNonEmptyLine2\n : 0,\n lastNonEmptyLine + 1,\n );\n}\n\nfunction leadingWhitespace(str) {\n let i = 0;\n\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n\n return i;\n}\n/**\n * @internal\n */\n\nexport function isPrintableAsBlockString(value) {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false;\n // Has non-printable characters\n\n case 0x000d:\n // \\r\n return false;\n // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10:\n // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n\n seenNonEmptyLine = true;\n isEmptyLine = true;\n hasIndent = false;\n break;\n\n case 9: // \\t\n\n case 32:\n // <space>\n hasIndent || (hasIndent = isEmptyLine);\n break;\n\n default:\n hasCommonIndent && (hasCommonIndent = hasIndent);\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value, options) {\n const escapedValue = value.replace(/\"\"\"/g, '\\\\\"\"\"'); // Expand a block string's raw value into independent lines.\n\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line\n\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line\n\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"'); // Trailing quote (single or double) or slash forces trailing new line\n\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n const printAsMultipleLines =\n !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n let result = ''; // Format a multi-line block quote to account for leading space.\n\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind;\n\n(function (TokenKind) {\n TokenKind['SOF'] = '<SOF>';\n TokenKind['EOF'] = '<EOF>';\n TokenKind['BANG'] = '!';\n TokenKind['DOLLAR'] = '$';\n TokenKind['AMP'] = '&';\n TokenKind['PAREN_L'] = '(';\n TokenKind['PAREN_R'] = ')';\n TokenKind['SPREAD'] = '...';\n TokenKind['COLON'] = ':';\n TokenKind['EQUALS'] = '=';\n TokenKind['AT'] = '@';\n TokenKind['BRACKET_L'] = '[';\n TokenKind['BRACKET_R'] = ']';\n TokenKind['BRACE_L'] = '{';\n TokenKind['PIPE'] = '|';\n TokenKind['BRACE_R'] = '}';\n TokenKind['NAME'] = 'Name';\n TokenKind['INT'] = 'Int';\n TokenKind['FLOAT'] = 'Float';\n TokenKind['STRING'] = 'String';\n TokenKind['BLOCK_STRING'] = 'BlockString';\n TokenKind['COMMENT'] = 'Comment';\n})(TokenKind || (TokenKind = {}));\n\nexport { TokenKind };\n/**\n * The enum type representing the token kinds values.\n *\n * @deprecated Please use `TokenKind`. Will be remove in v17.\n */\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { dedentBlockStringLines } from './blockString.mjs';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport class Lexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n get [Symbol.toStringTag]() {\n return 'Lexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n }\n}\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n */\n\nfunction isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n */\n\nfunction isSupplementaryCodePoint(body, location) {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code) {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code) {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n */\n\nfunction printCodePointAt(lexer, location) {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n } // Unicode code point\n\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n/**\n * Create a token with line and column location information.\n */\n\nfunction createToken(lexer, kind, start, end, value) {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // SourceCharacter\n\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // <BOM>\n\n case 0x0009: // \\t\n\n case 0x0020: // <space>\n\n case 0x002c:\n // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n\n case 0x000a:\n // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n\n case 0x000d:\n // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n\n case 0x0023:\n // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n\n case 0x0021:\n // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n\n case 0x0024:\n // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n\n case 0x0026:\n // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x002e:\n // .\n if (\n body.charCodeAt(position + 1) === 0x002e &&\n body.charCodeAt(position + 2) === 0x002e\n ) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n\n break;\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x003d:\n // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n\n case 0x005b:\n // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n\n case 0x005d:\n // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n\n case 0x007b:\n // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n\n case 0x007c:\n // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n\n case 0x007d:\n // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n\n case 0x0022:\n // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n\n return readString(lexer, position);\n } // IntValue | FloatValue (Digit | -)\n\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n */\n\nfunction readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n */\n\nfunction readNumber(lexer, start, firstCode) {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false; // NegativeSign (-)\n\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n } // Zero (0)\n\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Full stop (.)\n\n if (code === 0x002e) {\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // E e\n\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n code = body.charCodeAt(++position); // + -\n\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n/**\n * Returns the new position in the source after reading one or more digits.\n */\n\nfunction readDigits(lexer, start, firstCode) {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n */\n\nfunction readString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Quote (\")\n\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n } // Escape Sequence (\\)\n\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n } // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n} // The string value and lexed size of an escape sequence.\n\nfunction readEscapedUnicodeVariableWidth(lexer, position) {\n const body = lexer.source.body;\n let point = 0;\n let size = 3; // Cannot be larger than 12 chars (\\u{00000000}).\n\n while (size < 12) {\n const code = body.charCodeAt(position + size++); // Closing Brace (})\n\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n\n return {\n value: String.fromCodePoint(point),\n size,\n };\n } // Append this hex digit to the code point.\n\n point = (point << 4) | readHexDigit(code);\n\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(lexer, position) {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return {\n value: String.fromCodePoint(code),\n size: 6,\n };\n } // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return {\n value: String.fromCodePoint(code, trailingCode),\n size: 12,\n };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n */\n\nfunction read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n */\n\nfunction readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n */\n\nfunction readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n */\n\nfunction readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n */\n\nfunction readName(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\n}\n","const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n\n case 'object':\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON(); // check for infinite recursion\n\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value) {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(object, seenValues) {\n const entries = Object.entries(object);\n\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object) {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","import { inspect } from './inspect.mjs';\n/* c8 ignore next 3 */\n\nconst isProduction =\n globalThis.process && // eslint-disable-next-line no-undef\n process.env.NODE_ENV === 'production';\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\n\nexport const instanceOf =\n /* c8 ignore next 6 */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n isProduction\n ? function instanceOf(value, constructor) {\n return value instanceof constructor;\n }\n : function instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (typeof value === 'object' && value !== null) {\n var _value$constructor;\n\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n ? value[Symbol.toStringTag]\n : (_value$constructor = value.constructor) === null ||\n _value$constructor === void 0\n ? void 0\n : _value$constructor.name;\n\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(`Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`);\n }\n }\n\n return false;\n };\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n constructor(\n body,\n name = 'GraphQL request',\n locationOffset = {\n line: 1,\n column: 1,\n },\n ) {\n typeof body === 'string' ||\n devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 ||\n devAssert(\n false,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n this.locationOffset.column > 0 ||\n devAssert(\n false,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'Source';\n }\n}\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","import { syntaxError } from '../error/syntaxError.mjs';\nimport { Location, OperationTypeNode } from './ast.mjs';\nimport { DirectiveLocation } from './directiveLocation.mjs';\nimport { Kind } from './kinds.mjs';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.mjs';\nimport { isSource, Source } from './source.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n */\n\nexport function parseConstValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport class Parser {\n constructor(source, options = {}) {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n this._tokenCounter = 0;\n }\n\n get tokenCount() {\n return this._tokenCounter;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n\n parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\n parseDefinition() {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } // Many definitions begin with a description and require a lookahead.\n\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are supported only on type definitions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n const operation = this.parseOperationType();\n let name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * OperationType : one of query mutation subscription\n */\n\n parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n /**\n * Variable : $ Name\n */\n\n parseVariable() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n */\n\n parseSelectionSet() {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n parseArguments(isConst) {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n\n parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument() {\n return this.parseArgument(true);\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n });\n }\n\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n parseFragmentDefinition() {\n const start = this._lexer.token;\n this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (this._options.allowLegacyFragmentVariables === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentName : Name but not `on`\n */\n\n parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this.advanceLexer();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral() {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral() {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n */\n\n parseObject(isConst) {\n const item = () => this.parseObjectField(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n parseObjectField(isConst) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n\n parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n\n parseConstDirectives() {\n return this.parseDirectives(true);\n }\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n */\n\n parseDirective(isConst) {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n parseTypeReference() {\n const start = this._lexer.token;\n let type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n\n parseNamedType() {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n } // Implements the parsing rules in the Type Definition section.\n\n peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n\n parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n */\n\n parseSchemaDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n */\n\n parseFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n */\n\n parseEnumValuesDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n */\n\n parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseEnumValueName() {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n\n return this.parseName();\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n */\n\n parseInputFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n parseTypeSystemExtension() {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n */\n\n parseSchemaExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n\n parseInterfaceTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n * ```\n */\n\n parseDirectiveDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n repeatable,\n locations,\n });\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n parseDirectiveLocation() {\n const start = this._lexer.token;\n const name = this.parseName();\n\n if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n */\n\n node(startToken, node) {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n\n return node;\n }\n /**\n * Determines if the next token is of a given kind\n */\n\n peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n\n unexpected(atToken) {\n const token =\n atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n\n delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n }\n\n advanceLexer() {\n const { maxTokens } = this._options;\n\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more that ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\n}\n","const MAX_SUGGESTIONS = 5;\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\n\nexport function didYouMean(firstArg, secondArg) {\n const [subMessage, suggestionsArg] = secondArg\n ? [firstArg, secondArg]\n : [undefined, firstArg];\n let message = ' Did you mean ';\n\n if (subMessage) {\n message += subMessage + ' ';\n }\n\n const suggestions = suggestionsArg.map((x) => `\"${x}\"`);\n\n switch (suggestions.length) {\n case 0:\n return '';\n\n case 1:\n return message + suggestions[0] + '?';\n\n case 2:\n return message + suggestions[0] + ' or ' + suggestions[1] + '?';\n }\n\n const selected = suggestions.slice(0, MAX_SUGGESTIONS);\n const lastItem = selected.pop();\n return message + selected.join(', ') + ', or ' + lastItem + '?';\n}\n","/**\n * Returns the first argument it receives.\n */\nexport function identityFunc(x) {\n return x;\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // {\n * // Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' }\n * // }\n *\n * const jennyEntry = entriesByName['Jenny']\n *\n * // { name: 'Jenny', num: '857-6309' }\n * ```\n */\nexport function keyMap(list, keyFn) {\n const result = Object.create(null);\n\n for (const item of list) {\n result[keyFn(item)] = item;\n }\n\n return result;\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n * ```\n */\nexport function keyValMap(list, keyFn, valFn) {\n const result = Object.create(null);\n\n for (const item of list) {\n result[keyFn(item)] = valFn(item);\n }\n\n return result;\n}\n","/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n */\nexport function mapValue(map, fn) {\n const result = Object.create(null);\n\n for (const key of Object.keys(map)) {\n result[key] = fn(map[key], key);\n }\n\n return result;\n}\n","/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n */\nexport function naturalCompare(aStr, bStr) {\n let aIndex = 0;\n let bIndex = 0;\n\n while (aIndex < aStr.length && bIndex < bStr.length) {\n let aChar = aStr.charCodeAt(aIndex);\n let bChar = bStr.charCodeAt(bIndex);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n let aNum = 0;\n\n do {\n ++aIndex;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIndex);\n } while (isDigit(aChar) && aNum > 0);\n\n let bNum = 0;\n\n do {\n ++bIndex;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIndex);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIndex;\n ++bIndex;\n }\n }\n\n return aStr.length - bStr.length;\n}\nconst DIGIT_0 = 48;\nconst DIGIT_9 = 57;\n\nfunction isDigit(code) {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n","import { naturalCompare } from './naturalCompare.mjs';\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\n\nexport function suggestionList(input, options) {\n const optionsByDistance = Object.create(null);\n const lexicalDistance = new LexicalDistance(input);\n const threshold = Math.floor(input.length * 0.4) + 1;\n\n for (const option of options) {\n const distance = lexicalDistance.measure(option, threshold);\n\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort((a, b) => {\n const distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n */\n\nclass LexicalDistance {\n constructor(input) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n this._rows = [\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n ];\n }\n\n measure(option, threshold) {\n if (this._input === option) {\n return 0;\n }\n\n const optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit\n\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n let a = stringToArray(optionLowerCase);\n let b = this._inputArray;\n\n if (a.length < b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n\n const aLength = a.length;\n const bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n const rows = this._rows;\n\n for (let j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (let i = 1; i <= aLength; i++) {\n const upRow = rows[(i - 1) % 3];\n const currentRow = rows[i % 3];\n let smallestCell = (currentRow[0] = i);\n\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n let currentCell = Math.min(\n upRow[j] + 1, // delete\n currentRow[j - 1] + 1, // insert\n upRow[j - 1] + cost, // substitute\n );\n\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n // transposition\n const doubleDiagonalCell = rows[(i - 2) % 3][j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[j] = currentCell;\n } // Early exit, since distance can't go smaller than smallest element of the previous row.\n\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n const distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n }\n}\n\nfunction stringToArray(str) {\n const strLength = str.length;\n const array = new Array(strLength);\n\n for (let i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n\n return array;\n}\n","export function toObjMap(obj) {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n return map;\n}\n","/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n */\nexport function printString(str) {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n} // eslint-disable-next-line no-control-regex\n\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str) {\n return escapeSequences[str.charCodeAt(0)];\n} // prettier-ignore\n\nconst escapeSequences = [\n '\\\\u0000',\n '\\\\u0001',\n '\\\\u0002',\n '\\\\u0003',\n '\\\\u0004',\n '\\\\u0005',\n '\\\\u0006',\n '\\\\u0007',\n '\\\\b',\n '\\\\t',\n '\\\\n',\n '\\\\u000B',\n '\\\\f',\n '\\\\r',\n '\\\\u000E',\n '\\\\u000F',\n '\\\\u0010',\n '\\\\u0011',\n '\\\\u0012',\n '\\\\u0013',\n '\\\\u0014',\n '\\\\u0015',\n '\\\\u0016',\n '\\\\u0017',\n '\\\\u0018',\n '\\\\u0019',\n '\\\\u001A',\n '\\\\u001B',\n '\\\\u001C',\n '\\\\u001D',\n '\\\\u001E',\n '\\\\u001F',\n '',\n '',\n '\\\\\"',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 2F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 3F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 4F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\\\\\',\n '',\n '',\n '', // 5F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 6F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\u007F',\n '\\\\u0080',\n '\\\\u0081',\n '\\\\u0082',\n '\\\\u0083',\n '\\\\u0084',\n '\\\\u0085',\n '\\\\u0086',\n '\\\\u0087',\n '\\\\u0088',\n '\\\\u0089',\n '\\\\u008A',\n '\\\\u008B',\n '\\\\u008C',\n '\\\\u008D',\n '\\\\u008E',\n '\\\\u008F',\n '\\\\u0090',\n '\\\\u0091',\n '\\\\u0092',\n '\\\\u0093',\n '\\\\u0094',\n '\\\\u0095',\n '\\\\u0096',\n '\\\\u0097',\n '\\\\u0098',\n '\\\\u0099',\n '\\\\u009A',\n '\\\\u009B',\n '\\\\u009C',\n '\\\\u009D',\n '\\\\u009E',\n '\\\\u009F',\n];\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = { ...node };\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n","import { printBlockString } from './blockString.mjs';\nimport { printString } from './printString.mjs';\nimport { visit } from './visitor.mjs';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, printDocASTReducer);\n}\nconst MAX_LINE_LENGTH = 80;\nconst printDocASTReducer = {\n Name: {\n leave: (node) => node.value,\n },\n Variable: {\n leave: (node) => '$' + node.name,\n },\n // Document\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n OperationDefinition: {\n leave(node) {\n const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix = join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n ); // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives }) =>\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: {\n leave: ({ selections }) => block(selections),\n },\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = wrap('', alias, ': ') + name;\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n },\n Argument: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Fragments\n FragmentSpread: {\n leave: ({ name, directives }) =>\n '...' + name + wrap(' ', join(directives, ' ')),\n },\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n FragmentDefinition: {\n leave: (\n { name, typeCondition, variableDefinitions, directives, selectionSet }, // Note: fragment variable definitions are experimental and may be changed\n ) =>\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n // Value\n IntValue: {\n leave: ({ value }) => value,\n },\n FloatValue: {\n leave: ({ value }) => value,\n },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString ? printBlockString(value) : printString(value),\n },\n BooleanValue: {\n leave: ({ value }) => (value ? 'true' : 'false'),\n },\n NullValue: {\n leave: () => 'null',\n },\n EnumValue: {\n leave: ({ value }) => value,\n },\n ListValue: {\n leave: ({ values }) => '[' + join(values, ', ') + ']',\n },\n ObjectValue: {\n leave: ({ fields }) => '{' + join(fields, ', ') + '}',\n },\n ObjectField: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Directive\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n // Type\n NamedType: {\n leave: ({ name }) => name,\n },\n ListType: {\n leave: ({ type }) => '[' + type + ']',\n },\n NonNullType: {\n leave: ({ type }) => type + '!',\n },\n // Type System Definitions\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n DirectiveDefinition: {\n leave: ({ description, name, arguments: args, repeatable, locations }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n};\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\nfunction join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n */\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\nfunction wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray) {\n var _maybeArray$some;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n return (_maybeArray$some =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.some((str) => str.includes('\\n'))) !== null &&\n _maybeArray$some !== void 0\n ? _maybeArray$some\n : false;\n}\n","import { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { Kind } from '../language/kinds.mjs';\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\n\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map((node) =>\n valueFromASTUntyped(node, variables),\n );\n\n case Kind.OBJECT:\n return keyValMap(\n valueNode.fields,\n (field) => field.name.value,\n (field) => valueFromASTUntyped(field.value, variables),\n );\n\n case Kind.VARIABLE:\n return variables === null || variables === void 0\n ? void 0\n : variables[valueNode.name.value];\n }\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { isNameContinue, isNameStart } from '../language/characterClasses.mjs';\n/**\n * Upholds the spec rules about naming.\n */\n\nexport function assertName(name) {\n name != null || devAssert(false, 'Must provide name.');\n typeof name === 'string' || devAssert(false, 'Expected name to be a string.');\n\n if (name.length === 0) {\n throw new GraphQLError('Expected name to be a non-empty string.');\n }\n\n for (let i = 1; i < name.length; ++i) {\n if (!isNameContinue(name.charCodeAt(i))) {\n throw new GraphQLError(\n `Names must only contain [_a-zA-Z0-9] but \"${name}\" does not.`,\n );\n }\n }\n\n if (!isNameStart(name.charCodeAt(0))) {\n throw new GraphQLError(\n `Names must start with [_a-zA-Z] but \"${name}\" does not.`,\n );\n }\n\n return name;\n}\n/**\n * Upholds the spec rules about naming enum values.\n *\n * @internal\n */\n\nexport function assertEnumValueName(name) {\n if (name === 'true' || name === 'false' || name === 'null') {\n throw new GraphQLError(`Enum values cannot be named: ${name}`);\n }\n\n return assertName(name);\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { didYouMean } from '../jsutils/didYouMean.mjs';\nimport { identityFunc } from '../jsutils/identityFunc.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { mapValue } from '../jsutils/mapValue.mjs';\nimport { suggestionList } from '../jsutils/suggestionList.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { valueFromASTUntyped } from '../utilities/valueFromASTUntyped.mjs';\nimport { assertEnumValueName, assertName } from './assertName.mjs';\nexport function isType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n isListType(type) ||\n isNonNullType(type)\n );\n}\nexport function assertType(type) {\n if (!isType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`);\n }\n\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n if (!isScalarType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`);\n }\n\n return type;\n}\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n if (!isObjectType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`);\n }\n\n return type;\n}\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n if (!isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Interface type.`,\n );\n }\n\n return type;\n}\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n if (!isUnionType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`);\n }\n\n return type;\n}\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n if (!isEnumType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`);\n }\n\n return type;\n}\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n if (!isInputObjectType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Input Object type.`,\n );\n }\n\n return type;\n}\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n if (!isListType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`);\n }\n\n return type;\n}\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n if (!isNonNullType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);\n }\n\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return (\n isScalarType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n (isWrappingType(type) && isInputType(type.ofType))\n );\n}\nexport function assertInputType(type) {\n if (!isInputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`);\n }\n\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n (isWrappingType(type) && isOutputType(type.ofType))\n );\n}\nexport function assertOutputType(type) {\n if (!isOutputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`);\n }\n\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n if (!isLeafType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`);\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n if (!isCompositeType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL composite type.`,\n );\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n if (!isAbstractType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`);\n }\n\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * })\n * })\n * ```\n */\n\nexport class GraphQLList {\n constructor(ofType) {\n isType(ofType) ||\n devAssert(false, `Expected ${inspect(ofType)} to be a GraphQL type.`);\n this.ofType = ofType;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLList';\n }\n\n toString() {\n return '[' + String(this.ofType) + ']';\n }\n\n toJSON() {\n return this.toString();\n }\n}\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * ```ts\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * })\n * })\n * ```\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n\nexport class GraphQLNonNull {\n constructor(ofType) {\n isNullableType(ofType) ||\n devAssert(\n false,\n `Expected ${inspect(ofType)} to be a GraphQL nullable type.`,\n );\n this.ofType = ofType;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLNonNull';\n }\n\n toString() {\n return String(this.ofType) + '!';\n }\n\n toJSON() {\n return this.toString();\n }\n}\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n if (!isWrappingType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`);\n }\n\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n if (!isNullableType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`);\n }\n\n return type;\n}\nexport function getNullableType(type) {\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type)\n );\n}\nexport function assertNamedType(type) {\n if (!isNamedType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`);\n }\n\n return type;\n}\nexport function getNamedType(type) {\n if (type) {\n let unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nexport function resolveReadonlyArrayThunk(thunk) {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\nexport function resolveObjMapThunk(thunk) {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function returns `null` or does not return a value\n * (i.e. it returns `undefined`) then an error will be raised and a `null`\n * value will be returned in the response. It is always better to validate\n *\n * Example:\n *\n * ```ts\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (!Number.isFinite(value)) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is not a finite number.`,\n * );\n * }\n *\n * if (value % 2 === 0) {\n * throw new Error(`Scalar \"Odd\" cannot represent \"${value}\" since it is even.`);\n * }\n * return value;\n * }\n * });\n * ```\n */\nexport class GraphQLScalarType {\n constructor(config) {\n var _config$parseValue,\n _config$serialize,\n _config$parseLiteral,\n _config$extensionASTN;\n\n const parseValue =\n (_config$parseValue = config.parseValue) !== null &&\n _config$parseValue !== void 0\n ? _config$parseValue\n : identityFunc;\n this.name = assertName(config.name);\n this.description = config.description;\n this.specifiedByURL = config.specifiedByURL;\n this.serialize =\n (_config$serialize = config.serialize) !== null &&\n _config$serialize !== void 0\n ? _config$serialize\n : identityFunc;\n this.parseValue = parseValue;\n this.parseLiteral =\n (_config$parseLiteral = config.parseLiteral) !== null &&\n _config$parseLiteral !== void 0\n ? _config$parseLiteral\n : (node, variables) => parseValue(valueFromASTUntyped(node, variables));\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN = config.extensionASTNodes) !== null &&\n _config$extensionASTN !== void 0\n ? _config$extensionASTN\n : [];\n config.specifiedByURL == null ||\n typeof config.specifiedByURL === 'string' ||\n devAssert(\n false,\n `${this.name} must provide \"specifiedByURL\" as a string, ` +\n `but got: ${inspect(config.specifiedByURL)}.`,\n );\n config.serialize == null ||\n typeof config.serialize === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"serialize\" function. If this custom Scalar is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" functions are also provided.`,\n );\n\n if (config.parseLiteral) {\n (typeof config.parseValue === 'function' &&\n typeof config.parseLiteral === 'function') ||\n devAssert(\n false,\n `${this.name} must provide both \"parseValue\" and \"parseLiteral\" functions.`,\n );\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLScalarType';\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n specifiedByURL: this.specifiedByURL,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * ```ts\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n * ```\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n * ```\n */\nexport class GraphQLObjectType {\n constructor(config) {\n var _config$extensionASTN2;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN2 = config.extensionASTNodes) !== null &&\n _config$extensionASTN2 !== void 0\n ? _config$extensionASTN2\n : [];\n\n this._fields = () => defineFieldMap(config);\n\n this._interfaces = () => defineInterfaces(config);\n\n config.isTypeOf == null ||\n typeof config.isTypeOf === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"isTypeOf\" as a function, ` +\n `but got: ${inspect(config.isTypeOf)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLObjectType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineInterfaces(config) {\n var _config$interfaces;\n\n const interfaces = resolveReadonlyArrayThunk(\n (_config$interfaces = config.interfaces) !== null &&\n _config$interfaces !== void 0\n ? _config$interfaces\n : [],\n );\n Array.isArray(interfaces) ||\n devAssert(\n false,\n `${config.name} interfaces must be an Array or a function which returns an Array.`,\n );\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n const fieldMap = resolveObjMapThunk(config.fields);\n isPlainObj(fieldMap) ||\n devAssert(\n false,\n `${config.name} fields must be an object with field names as keys or a function which returns such an object.`,\n );\n return mapValue(fieldMap, (fieldConfig, fieldName) => {\n var _fieldConfig$args;\n\n isPlainObj(fieldConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} field config must be an object.`,\n );\n fieldConfig.resolve == null ||\n typeof fieldConfig.resolve === 'function' ||\n devAssert(\n false,\n `${config.name}.${fieldName} field resolver must be a function if ` +\n `provided, but got: ${inspect(fieldConfig.resolve)}.`,\n );\n const argsConfig =\n (_fieldConfig$args = fieldConfig.args) !== null &&\n _fieldConfig$args !== void 0\n ? _fieldConfig$args\n : {};\n isPlainObj(argsConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} args must be an object with argument names as keys.`,\n );\n return {\n name: assertName(fieldName),\n description: fieldConfig.description,\n type: fieldConfig.type,\n args: defineArguments(argsConfig),\n resolve: fieldConfig.resolve,\n subscribe: fieldConfig.subscribe,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode,\n };\n });\n}\n\nexport function defineArguments(config) {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: assertName(argName),\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: toObjMap(argConfig.extensions),\n astNode: argConfig.astNode,\n }));\n}\n\nfunction isPlainObj(obj) {\n return isObjectLike(obj) && !Array.isArray(obj);\n}\n\nfunction fieldsToFieldsConfig(fields) {\n return mapValue(fields, (field) => ({\n description: field.description,\n type: field.type,\n args: argsToArgsConfig(field.args),\n resolve: field.resolve,\n subscribe: field.subscribe,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode,\n }));\n}\n/**\n * @internal\n */\n\nexport function argsToArgsConfig(args) {\n return keyValMap(\n args,\n (arg) => arg.name,\n (arg) => ({\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode,\n }),\n );\n}\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * ```ts\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n * ```\n */\nexport class GraphQLInterfaceType {\n constructor(config) {\n var _config$extensionASTN3;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN3 = config.extensionASTNodes) !== null &&\n _config$extensionASTN3 !== void 0\n ? _config$extensionASTN3\n : [];\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n config.resolveType == null ||\n typeof config.resolveType === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"resolveType\" as a function, ` +\n `but got: ${inspect(config.resolveType)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLInterfaceType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * ```ts\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n * ```\n */\nexport class GraphQLUnionType {\n constructor(config) {\n var _config$extensionASTN4;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN4 = config.extensionASTNodes) !== null &&\n _config$extensionASTN4 !== void 0\n ? _config$extensionASTN4\n : [];\n this._types = defineTypes.bind(undefined, config);\n config.resolveType == null ||\n typeof config.resolveType === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"resolveType\" as a function, ` +\n `but got: ${inspect(config.resolveType)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLUnionType';\n }\n\n getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineTypes(config) {\n const types = resolveReadonlyArrayThunk(config.types);\n Array.isArray(types) ||\n devAssert(\n false,\n `Must provide Array of types or a function which returns such an array for Union ${config.name}.`,\n );\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * ```ts\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n * ```\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport class GraphQLEnumType {\n /* <T> */\n constructor(config) {\n var _config$extensionASTN5;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN5 = config.extensionASTNodes) !== null &&\n _config$extensionASTN5 !== void 0\n ? _config$extensionASTN5\n : [];\n this._values =\n typeof config.values === 'function'\n ? config.values\n : defineEnumValues(this.name, config.values);\n this._valueLookup = null;\n this._nameLookup = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLEnumType';\n }\n\n getValues() {\n if (typeof this._values === 'function') {\n this._values = defineEnumValues(this.name, this._values());\n }\n\n return this._values;\n }\n\n getValue(name) {\n if (this._nameLookup === null) {\n this._nameLookup = keyMap(this.getValues(), (value) => value.name);\n }\n\n return this._nameLookup[name];\n }\n\n serialize(outputValue) {\n if (this._valueLookup === null) {\n this._valueLookup = new Map(\n this.getValues().map((enumValue) => [enumValue.value, enumValue]),\n );\n }\n\n const enumValue = this._valueLookup.get(outputValue);\n\n if (enumValue === undefined) {\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent value: ${inspect(outputValue)}`,\n );\n }\n\n return enumValue.name;\n }\n\n parseValue(inputValue) /* T */\n {\n if (typeof inputValue !== 'string') {\n const valueStr = inspect(inputValue);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-string value: ${valueStr}.` +\n didYouMeanEnumValue(this, valueStr),\n );\n }\n\n const enumValue = this.getValue(inputValue);\n\n if (enumValue == null) {\n throw new GraphQLError(\n `Value \"${inputValue}\" does not exist in \"${this.name}\" enum.` +\n didYouMeanEnumValue(this, inputValue),\n );\n }\n\n return enumValue.value;\n }\n\n parseLiteral(valueNode, _variables) /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind !== Kind.ENUM) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-enum value: ${valueStr}.` +\n didYouMeanEnumValue(this, valueStr),\n {\n nodes: valueNode,\n },\n );\n }\n\n const enumValue = this.getValue(valueNode.value);\n\n if (enumValue == null) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Value \"${valueStr}\" does not exist in \"${this.name}\" enum.` +\n didYouMeanEnumValue(this, valueStr),\n {\n nodes: valueNode,\n },\n );\n }\n\n return enumValue.value;\n }\n\n toConfig() {\n const values = keyValMap(\n this.getValues(),\n (value) => value.name,\n (value) => ({\n description: value.description,\n value: value.value,\n deprecationReason: value.deprecationReason,\n extensions: value.extensions,\n astNode: value.astNode,\n }),\n );\n return {\n name: this.name,\n description: this.description,\n values,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction didYouMeanEnumValue(enumType, unknownValueStr) {\n const allNames = enumType.getValues().map((value) => value.name);\n const suggestedValues = suggestionList(unknownValueStr, allNames);\n return didYouMean('the enum value', suggestedValues);\n}\n\nfunction defineEnumValues(typeName, valueMap) {\n isPlainObj(valueMap) ||\n devAssert(\n false,\n `${typeName} values must be an object with value names as keys.`,\n );\n return Object.entries(valueMap).map(([valueName, valueConfig]) => {\n isPlainObj(valueConfig) ||\n devAssert(\n false,\n `${typeName}.${valueName} must refer to an object with a \"value\" key ` +\n `representing an internal value but got: ${inspect(valueConfig)}.`,\n );\n return {\n name: assertEnumValueName(valueName),\n description: valueConfig.description,\n value: valueConfig.value !== undefined ? valueConfig.value : valueName,\n deprecationReason: valueConfig.deprecationReason,\n extensions: toObjMap(valueConfig.extensions),\n astNode: valueConfig.astNode,\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * ```ts\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n * ```\n */\nexport class GraphQLInputObjectType {\n constructor(config) {\n var _config$extensionASTN6, _config$isOneOf;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN6 = config.extensionASTNodes) !== null &&\n _config$extensionASTN6 !== void 0\n ? _config$extensionASTN6\n : [];\n this.isOneOf =\n (_config$isOneOf = config.isOneOf) !== null && _config$isOneOf !== void 0\n ? _config$isOneOf\n : false;\n this._fields = defineInputFieldMap.bind(undefined, config);\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLInputObjectType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n toConfig() {\n const fields = mapValue(this.getFields(), (field) => ({\n description: field.description,\n type: field.type,\n defaultValue: field.defaultValue,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode,\n }));\n return {\n name: this.name,\n description: this.description,\n fields,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n isOneOf: this.isOneOf,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineInputFieldMap(config) {\n const fieldMap = resolveObjMapThunk(config.fields);\n isPlainObj(fieldMap) ||\n devAssert(\n false,\n `${config.name} fields must be an object with field names as keys or a function which returns such an object.`,\n );\n return mapValue(fieldMap, (fieldConfig, fieldName) => {\n !('resolve' in fieldConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`,\n );\n return {\n name: assertName(fieldName),\n description: fieldConfig.description,\n type: fieldConfig.type,\n defaultValue: fieldConfig.defaultValue,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode,\n };\n });\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}\n","import {\n isAbstractType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.mjs';\n\n/**\n * Provided two types, return true if the types are equal (invariant).\n */\nexport function isEqualType(typeA, typeB) {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n } // If either type is non-null, the other must also be non-null.\n\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // If either type is a list, the other must also be a list.\n\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // Otherwise the types are not equal.\n\n return false;\n}\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n */\n\nexport function isTypeSubTypeOf(schema, maybeSubType, superType) {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n } // If superType is non-null, maybeSubType must also be non-null.\n\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n } // If superType type is a list, maybeSubType type must also be a list.\n\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n } // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n\n return (\n isAbstractType(superType) &&\n (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) &&\n schema.isSubType(superType, maybeSubType)\n );\n}\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n */\n\nexport function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema\n .getPossibleTypes(typeA)\n .some((type) => schema.isSubType(typeB, type));\n } // Determine if the latter type is a possible concrete type of the former.\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n return false;\n}\n","import { inspect } from '../jsutils/inspect.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { GraphQLScalarType } from './definition.mjs';\n/**\n * Maximum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1\n * */\n\nexport const GRAPHQL_MAX_INT = 2147483647;\n/**\n * Minimum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)\n * */\n\nexport const GRAPHQL_MIN_INT = -2147483648;\nexport const GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description:\n 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n let num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (typeof num !== 'number' || !Number.isInteger(num)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(coercedValue)}`,\n );\n }\n\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n 'Int cannot represent non 32-bit signed integer value: ' +\n inspect(coercedValue),\n );\n }\n\n return num;\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(inputValue)}`,\n );\n }\n\n if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inputValue}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n const num = parseInt(valueNode.value, 10);\n\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return num;\n },\n});\nexport const GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description:\n 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n let num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (typeof num !== 'number' || !Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)}`,\n );\n }\n\n return num;\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${print(valueNode)}`,\n valueNode,\n );\n }\n\n return parseFloat(valueNode.value);\n },\n});\nexport const GraphQLString = new GraphQLScalarType({\n name: 'String',\n description:\n 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n\n if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) {\n return coercedValue.toString();\n }\n\n throw new GraphQLError(\n `String cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\n `String cannot represent a non string value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\n `String cannot represent a non string value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n\n if (Number.isFinite(coercedValue)) {\n return coercedValue !== 0;\n }\n\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description:\n 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (Number.isInteger(coercedValue)) {\n return String(coercedValue);\n }\n\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n\n if (typeof inputValue === 'number' && Number.isInteger(inputValue)) {\n return inputValue.toString();\n }\n\n throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`);\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n 'ID cannot represent a non-string and non-integer value: ' +\n print(valueNode),\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const specifiedScalarTypes = Object.freeze([\n GraphQLString,\n GraphQLInt,\n GraphQLFloat,\n GraphQLBoolean,\n GraphQLID,\n]);\nexport function isSpecifiedScalarType(type) {\n return specifiedScalarTypes.some(({ name }) => type.name === name);\n} // Support serializing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\n\nfunction serializeObject(outputValue) {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n const valueOfResult = outputValue.valueOf();\n\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n\n if (typeof outputValue.toJSON === 'function') {\n return outputValue.toJSON();\n }\n }\n\n return outputValue;\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { DirectiveLocation } from '../language/directiveLocation.mjs';\nimport { assertName } from './assertName.mjs';\nimport {\n argsToArgsConfig,\n defineArguments,\n GraphQLNonNull,\n} from './definition.mjs';\nimport { GraphQLBoolean, GraphQLString } from './scalars.mjs';\n/**\n * Test if the given value is a GraphQL directive.\n */\n\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\nexport function assertDirective(directive) {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n\n return directive;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\nexport class GraphQLDirective {\n constructor(config) {\n var _config$isRepeatable, _config$args;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable =\n (_config$isRepeatable = config.isRepeatable) !== null &&\n _config$isRepeatable !== void 0\n ? _config$isRepeatable\n : false;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n Array.isArray(config.locations) ||\n devAssert(false, `@${config.name} locations must be an Array.`);\n const args =\n (_config$args = config.args) !== null && _config$args !== void 0\n ? _config$args\n : {};\n (isObjectLike(args) && !Array.isArray(args)) ||\n devAssert(\n false,\n `@${config.name} args must be an object with argument names as keys.`,\n );\n this.args = defineArguments(args);\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLDirective';\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: argsToArgsConfig(this.args),\n isRepeatable: this.isRepeatable,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n toString() {\n return '@' + this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport const GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description:\n 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.',\n },\n },\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport const GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description:\n 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.',\n },\n },\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport const DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport const GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [\n DirectiveLocation.FIELD_DEFINITION,\n DirectiveLocation.ARGUMENT_DEFINITION,\n DirectiveLocation.INPUT_FIELD_DEFINITION,\n DirectiveLocation.ENUM_VALUE,\n ],\n args: {\n reason: {\n type: GraphQLString,\n description:\n 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n defaultValue: DEFAULT_DEPRECATION_REASON,\n },\n },\n});\n/**\n * Used to provide a URL for specifying the behavior of custom scalar definitions.\n */\n\nexport const GraphQLSpecifiedByDirective = new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behavior of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behavior of this scalar.',\n },\n },\n});\n/**\n * Used to indicate an Input Object is a OneOf Input Object.\n */\n\nexport const GraphQLOneOfDirective = new GraphQLDirective({\n name: 'oneOf',\n description:\n 'Indicates exactly one field must be supplied and this field must not be `null`.',\n locations: [DirectiveLocation.INPUT_OBJECT],\n args: {},\n});\n/**\n * The full list of specified directives.\n */\n\nexport const specifiedDirectives = Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n]);\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(({ name }) => name === directive.name);\n}\n","/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and implements the Iterator protocol.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if\n * an object should be iterated-over e.g. Array, Map, Set, Int8Array,\n * TypedArray, etc. but excludes string literals.\n *\n * @example\n * ```ts\n * isIterableObject([ 1, 2, 3 ]) // true\n * isIterableObject(new Map()) // true\n * isIterableObject('ABC') // false\n * isIterableObject({ key: 'value' }) // false\n * isIterableObject({ length: 1, 0: 'Alpha' }) // false\n * ```\n */\nexport function isIterableObject(maybeIterable) {\n return (\n typeof maybeIterable === 'object' &&\n typeof (maybeIterable === null || maybeIterable === void 0\n ? void 0\n : maybeIterable[Symbol.iterator]) === 'function'\n );\n}\n","import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { isIterableObject } from '../jsutils/isIterableObject.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.mjs';\nimport { GraphQLID } from '../type/scalars.mjs';\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType. For example:\n *\n * astFromValue(\"value\", GraphQLString)\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Unknown | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n const astValue = astFromValue(value, type.ofType);\n\n if (\n (astValue === null || astValue === void 0 ? void 0 : astValue.kind) ===\n Kind.NULL\n ) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n if (value === null) {\n return {\n kind: Kind.NULL,\n };\n } // undefined\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n if (isListType(type)) {\n const itemType = type.ofType;\n\n if (isIterableObject(value)) {\n const valuesNodes = [];\n\n for (const item of value) {\n const itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: Kind.LIST,\n values: valuesNodes,\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n\n const fieldNodes = [];\n\n for (const field of Object.values(type.getFields())) {\n const fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name,\n },\n value: fieldValue,\n });\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes,\n };\n }\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n const serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized,\n };\n } // JavaScript numbers can be Int or Float values.\n\n if (typeof serialized === 'number' && Number.isFinite(serialized)) {\n const stringNum = String(serialized);\n return integerStringRegExp.test(stringNum)\n ? {\n kind: Kind.INT,\n value: stringNum,\n }\n : {\n kind: Kind.FLOAT,\n value: stringNum,\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized,\n };\n } // ID types can use Int literals.\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized,\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized,\n };\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}.`);\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nconst integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n","import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { DirectiveLocation } from '../language/directiveLocation.mjs';\nimport { print } from '../language/printer.mjs';\nimport { astFromValue } from '../utilities/astFromValue.mjs';\nimport {\n GraphQLEnumType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n isAbstractType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from './definition.mjs';\nimport { GraphQLBoolean, GraphQLString } from './scalars.mjs';\nexport const __Schema = new GraphQLObjectType({\n name: '__Schema',\n description:\n 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: () => ({\n description: {\n type: GraphQLString,\n resolve: (schema) => schema.description,\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n\n resolve(schema) {\n return Object.values(schema.getTypeMap());\n },\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: (schema) => schema.getQueryType(),\n },\n mutationType: {\n description:\n 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getMutationType(),\n },\n subscriptionType: {\n description:\n 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getSubscriptionType(),\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__Directive)),\n ),\n resolve: (schema) => schema.getDirectives(),\n },\n }),\n});\nexport const __Directive = new GraphQLObjectType({\n name: '__Directive',\n description:\n \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (directive) => directive.name,\n },\n description: {\n type: GraphQLString,\n resolve: (directive) => directive.description,\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.isRepeatable,\n },\n locations: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__DirectiveLocation)),\n ),\n resolve: (directive) => directive.locations,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(field, { includeDeprecated }) {\n return includeDeprecated\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n }),\n});\nexport const __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description:\n 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.',\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.',\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.',\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.',\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.',\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.',\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.',\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.',\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.',\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.',\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.',\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.',\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.',\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.',\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.',\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.',\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.',\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.',\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.',\n },\n },\n});\nexport const __Type = new GraphQLObjectType({\n name: '__Type',\n description:\n 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: () => ({\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n\n resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n\n if (isListType(type)) {\n return TypeKind.LIST;\n }\n\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered)\n\n false || invariant(false, `Unexpected type: \"${inspect(type)}\".`);\n },\n },\n name: {\n type: GraphQLString,\n resolve: (type) => ('name' in type ? type.name : undefined),\n },\n description: {\n type: GraphQLString,\n resolve: (\n type, // FIXME: add test case\n ) =>\n /* c8 ignore next */\n 'description' in type ? type.description : undefined,\n },\n specifiedByURL: {\n type: GraphQLString,\n resolve: (obj) =>\n 'specifiedByURL' in obj ? obj.specifiedByURL : undefined,\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const fields = Object.values(type.getFields());\n return includeDeprecated\n ? fields\n : fields.filter((field) => field.deprecationReason == null);\n }\n },\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n\n resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n },\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n\n resolve(type, _args, _context, { schema }) {\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n },\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isEnumType(type)) {\n const values = type.getValues();\n return includeDeprecated\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isInputObjectType(type)) {\n const values = Object.values(type.getFields());\n return includeDeprecated\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n ofType: {\n type: __Type,\n resolve: (type) => ('ofType' in type ? type.ofType : undefined),\n },\n isOneOf: {\n type: GraphQLBoolean,\n resolve: (type) => {\n if (isInputObjectType(type)) {\n return type.isOneOf;\n }\n },\n },\n }),\n});\nexport const __Field = new GraphQLObjectType({\n name: '__Field',\n description:\n 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (field) => field.name,\n },\n description: {\n type: GraphQLString,\n resolve: (field) => field.description,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(field, { includeDeprecated }) {\n return includeDeprecated\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (field) => field.type,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (field) => field.deprecationReason,\n },\n }),\n});\nexport const __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description:\n 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (inputValue) => inputValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (inputValue) => inputValue.description,\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (inputValue) => inputValue.type,\n },\n defaultValue: {\n type: GraphQLString,\n description:\n 'A GraphQL-formatted string representing the default value for this input value.',\n\n resolve(inputValue) {\n const { type, defaultValue } = inputValue;\n const valueAST = astFromValue(defaultValue, type);\n return valueAST ? print(valueAST) : null;\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (obj) => obj.deprecationReason,\n },\n }),\n});\nexport const __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description:\n 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (enumValue) => enumValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.description,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (enumValue) => enumValue.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.deprecationReason,\n },\n }),\n});\nvar TypeKind;\n\n(function (TypeKind) {\n TypeKind['SCALAR'] = 'SCALAR';\n TypeKind['OBJECT'] = 'OBJECT';\n TypeKind['INTERFACE'] = 'INTERFACE';\n TypeKind['UNION'] = 'UNION';\n TypeKind['ENUM'] = 'ENUM';\n TypeKind['INPUT_OBJECT'] = 'INPUT_OBJECT';\n TypeKind['LIST'] = 'LIST';\n TypeKind['NON_NULL'] = 'NON_NULL';\n})(TypeKind || (TypeKind = {}));\n\nexport { TypeKind };\nexport const __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.',\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description:\n 'Indicates this type is an object. `fields` and `interfaces` are valid fields.',\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description:\n 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.',\n },\n UNION: {\n value: TypeKind.UNION,\n description:\n 'Indicates this type is a union. `possibleTypes` is a valid field.',\n },\n ENUM: {\n value: TypeKind.ENUM,\n description:\n 'Indicates this type is an enum. `enumValues` is a valid field.',\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description:\n 'Indicates this type is an input object. `inputFields` is a valid field.',\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.',\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description:\n 'Indicates this type is a non-null. `ofType` is a valid field.',\n },\n },\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport const SchemaMetaFieldDef = {\n name: '__schema',\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: (_source, _args, _context, { schema }) => schema,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [\n {\n name: 'name',\n description: undefined,\n type: new GraphQLNonNull(GraphQLString),\n defaultValue: undefined,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n },\n ],\n resolve: (_source, { name }, _context, { schema }) => schema.getType(name),\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const TypeNameMetaFieldDef = {\n name: '__typename',\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: (_source, _args, _context, { parentType }) => parentType.name,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const introspectionTypes = Object.freeze([\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n]);\nexport function isIntrospectionType(type) {\n return introspectionTypes.some(({ name }) => type.name === name);\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { OperationTypeNode } from '../language/ast.mjs';\nimport {\n getNamedType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isUnionType,\n} from './definition.mjs';\nimport { isDirective, specifiedDirectives } from './directives.mjs';\nimport { __Schema } from './introspection.mjs';\n/**\n * Test if the given value is a GraphQL schema.\n */\n\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\nexport function assertSchema(schema) {\n if (!isSchema(schema)) {\n throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`);\n }\n\n return schema;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n * ```\n *\n * Note: When the schema is constructed, by default only the types that are\n * reachable by traversing the root types are included, other types must be\n * explicitly referenced.\n *\n * Example:\n *\n * ```ts\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * ...\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface, ... },\n * }\n * }),\n * ...\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * })\n * ```\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. `@include` and\n * `@skip`) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n * ```\n */\nexport class GraphQLSchema {\n // Used as a cache for validateSchema().\n constructor(config) {\n var _config$extensionASTN, _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n isObjectLike(config) ||\n devAssert(false, 'Must provide configuration object.');\n !config.types ||\n Array.isArray(config.types) ||\n devAssert(\n false,\n `\"types\" must be Array if provided but got: ${inspect(config.types)}.`,\n );\n !config.directives ||\n Array.isArray(config.directives) ||\n devAssert(\n false,\n '\"directives\" must be Array if provided but got: ' +\n `${inspect(config.directives)}.`,\n );\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN = config.extensionASTNodes) !== null &&\n _config$extensionASTN !== void 0\n ? _config$extensionASTN\n : [];\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives =\n (_config$directives = config.directives) !== null &&\n _config$directives !== void 0\n ? _config$directives\n : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n const allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (const type of config.types) {\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (const directive of this._directives) {\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (const arg of directive.args) {\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (const namedType of allReferencedTypes) {\n if (namedType == null) {\n continue;\n }\n\n const typeName = namedType.name;\n typeName ||\n devAssert(\n false,\n 'One of the provided types for building the Schema is missing a name.',\n );\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\n `Schema must contain uniquely named types but contains multiple types named \"${typeName}\".`,\n );\n }\n\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n }\n\n implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLSchema';\n }\n\n getQueryType() {\n return this._queryType;\n }\n\n getMutationType() {\n return this._mutationType;\n }\n\n getSubscriptionType() {\n return this._subscriptionType;\n }\n\n getRootType(operation) {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return this.getQueryType();\n\n case OperationTypeNode.MUTATION:\n return this.getMutationType();\n\n case OperationTypeNode.SUBSCRIPTION:\n return this.getSubscriptionType();\n }\n }\n\n getTypeMap() {\n return this._typeMap;\n }\n\n getType(name) {\n return this.getTypeMap()[name];\n }\n\n getPossibleTypes(abstractType) {\n return isUnionType(abstractType)\n ? abstractType.getTypes()\n : this.getImplementations(abstractType).objects;\n }\n\n getImplementations(interfaceType) {\n const implementations = this._implementationsMap[interfaceType.name];\n return implementations !== null && implementations !== void 0\n ? implementations\n : {\n objects: [],\n interfaces: [],\n };\n }\n\n isSubType(abstractType, maybeSubType) {\n let map = this._subTypeMap[abstractType.name];\n\n if (map === undefined) {\n map = Object.create(null);\n\n if (isUnionType(abstractType)) {\n for (const type of abstractType.getTypes()) {\n map[type.name] = true;\n }\n } else {\n const implementations = this.getImplementations(abstractType);\n\n for (const type of implementations.objects) {\n map[type.name] = true;\n }\n\n for (const type of implementations.interfaces) {\n map[type.name] = true;\n }\n }\n\n this._subTypeMap[abstractType.name] = map;\n }\n\n return map[maybeSubType.name] !== undefined;\n }\n\n getDirectives() {\n return this._directives;\n }\n\n getDirective(name) {\n return this.getDirectives().find((directive) => directive.name === name);\n }\n\n toConfig() {\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: Object.values(this.getTypeMap()),\n directives: this.getDirectives(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n assumeValid: this.__validationErrors !== undefined,\n };\n }\n}\n\nfunction collectReferencedTypes(type, typeSet) {\n const namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n\n if (isUnionType(namedType)) {\n for (const memberType of namedType.getTypes()) {\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (const interfaceType of namedType.getInterfaces()) {\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n\n for (const arg of field.args) {\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n","import { Kind } from '../language/kinds.mjs';\nimport { GraphQLList, GraphQLNonNull } from '../type/definition.mjs';\nexport function typeFromAST(schema, typeNode) {\n switch (typeNode.kind) {\n case Kind.LIST_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n\n case Kind.NON_NULL_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLNonNull(innerType);\n }\n\n case Kind.NAMED_TYPE:\n return schema.getType(typeNode.name.value);\n }\n}\n","import { Kind } from './kinds.mjs';\nexport function isDefinitionNode(node) {\n return (\n isExecutableDefinitionNode(node) ||\n isTypeSystemDefinitionNode(node) ||\n isTypeSystemExtensionNode(node)\n );\n}\nexport function isExecutableDefinitionNode(node) {\n return (\n node.kind === Kind.OPERATION_DEFINITION ||\n node.kind === Kind.FRAGMENT_DEFINITION\n );\n}\nexport function isSelectionNode(node) {\n return (\n node.kind === Kind.FIELD ||\n node.kind === Kind.FRAGMENT_SPREAD ||\n node.kind === Kind.INLINE_FRAGMENT\n );\n}\nexport function isValueNode(node) {\n return (\n node.kind === Kind.VARIABLE ||\n node.kind === Kind.INT ||\n node.kind === Kind.FLOAT ||\n node.kind === Kind.STRING ||\n node.kind === Kind.BOOLEAN ||\n node.kind === Kind.NULL ||\n node.kind === Kind.ENUM ||\n node.kind === Kind.LIST ||\n node.kind === Kind.OBJECT\n );\n}\nexport function isConstValueNode(node) {\n return (\n isValueNode(node) &&\n (node.kind === Kind.LIST\n ? node.values.some(isConstValueNode)\n : node.kind === Kind.OBJECT\n ? node.fields.some((field) => isConstValueNode(field.value))\n : node.kind !== Kind.VARIABLE)\n );\n}\nexport function isTypeNode(node) {\n return (\n node.kind === Kind.NAMED_TYPE ||\n node.kind === Kind.LIST_TYPE ||\n node.kind === Kind.NON_NULL_TYPE\n );\n}\nexport function isTypeSystemDefinitionNode(node) {\n return (\n node.kind === Kind.SCHEMA_DEFINITION ||\n isTypeDefinitionNode(node) ||\n node.kind === Kind.DIRECTIVE_DEFINITION\n );\n}\nexport function isTypeDefinitionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_DEFINITION ||\n node.kind === Kind.OBJECT_TYPE_DEFINITION ||\n node.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n node.kind === Kind.UNION_TYPE_DEFINITION ||\n node.kind === Kind.ENUM_TYPE_DEFINITION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n );\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_EXTENSION ||\n node.kind === Kind.OBJECT_TYPE_EXTENSION ||\n node.kind === Kind.INTERFACE_TYPE_EXTENSION ||\n node.kind === Kind.UNION_TYPE_EXTENSION ||\n node.kind === Kind.ENUM_TYPE_EXTENSION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n );\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { isExecutableDefinitionNode } from '../../language/predicates.mjs';\n\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n *\n * See https://spec.graphql.org/draft/#sec-Executable-Definitions\n */\nexport function ExecutableDefinitionsRule(context) {\n return {\n Document(node) {\n for (const definition of node.definitions) {\n if (!isExecutableDefinitionNode(definition)) {\n const defName =\n definition.kind === Kind.SCHEMA_DEFINITION ||\n definition.kind === Kind.SCHEMA_EXTENSION\n ? 'schema'\n : '\"' + definition.name.value + '\"';\n context.reportError(\n new GraphQLError(`The ${defName} definition is not executable.`, {\n nodes: definition,\n }),\n );\n }\n }\n\n return false;\n },\n };\n}\n","import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { naturalCompare } from '../../jsutils/naturalCompare.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isAbstractType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.mjs';\n\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selections\n */\nexport function FieldsOnCorrectTypeRule(context) {\n return {\n Field(node) {\n const type = context.getParentType();\n\n if (type) {\n const fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n const schema = context.getSchema();\n const fieldName = node.name.value; // First determine if there are any suggested types to condition on.\n\n let suggestion = didYouMean(\n 'to use an inline fragment on',\n getSuggestedTypeNames(schema, type, fieldName),\n ); // If there are no suggested types, then perhaps this was a typo?\n\n if (suggestion === '') {\n suggestion = didYouMean(getSuggestedFieldNames(type, fieldName));\n } // Report an error, including helpful suggestions.\n\n context.reportError(\n new GraphQLError(\n `Cannot query field \"${fieldName}\" on type \"${type.name}\".` +\n suggestion,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n };\n}\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest them,\n * sorted by how often the type is referenced.\n */\n\nfunction getSuggestedTypeNames(schema, type, fieldName) {\n if (!isAbstractType(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n const suggestedTypes = new Set();\n const usageCount = Object.create(null);\n\n for (const possibleType of schema.getPossibleTypes(type)) {\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (const possibleInterface of possibleType.getInterfaces()) {\n var _usageCount$possibleI;\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] =\n ((_usageCount$possibleI = usageCount[possibleInterface.name]) !==\n null && _usageCount$possibleI !== void 0\n ? _usageCount$possibleI\n : 0) + 1;\n }\n }\n\n return [...suggestedTypes]\n .sort((typeA, typeB) => {\n // Suggest both interface and object types based on how common they are.\n const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n } // Suggest super types first followed by subtypes\n\n if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n\n if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return naturalCompare(typeA.name, typeB.name);\n })\n .map((x) => x.name);\n}\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n */\n\nfunction getSuggestedFieldNames(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n } // Otherwise, must be a Union type, which does not define fields.\n\n return [];\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isCompositeType } from '../../type/definition.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types\n */\nexport function FragmentsOnCompositeTypesRule(context) {\n return {\n InlineFragment(node) {\n const typeCondition = node.typeCondition;\n\n if (typeCondition) {\n const type = typeFromAST(context.getSchema(), typeCondition);\n\n if (type && !isCompositeType(type)) {\n const typeStr = print(typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment cannot condition on non composite type \"${typeStr}\".`,\n {\n nodes: typeCondition,\n },\n ),\n );\n }\n }\n },\n\n FragmentDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.typeCondition);\n\n if (type && !isCompositeType(type)) {\n const typeStr = print(node.typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment \"${node.name.value}\" cannot condition on non composite type \"${typeStr}\".`,\n {\n nodes: node.typeCondition,\n },\n ),\n );\n }\n },\n };\n}\n","import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations\n */\nexport function KnownArgumentNamesRule(context) {\n return {\n // eslint-disable-next-line new-cap\n ...KnownArgumentNamesOnDirectivesRule(context),\n\n Argument(argNode) {\n const argDef = context.getArgument();\n const fieldDef = context.getFieldDef();\n const parentType = context.getParentType();\n\n if (!argDef && fieldDef && parentType) {\n const argName = argNode.name.value;\n const knownArgsNames = fieldDef.args.map((arg) => arg.name);\n const suggestions = suggestionList(argName, knownArgsNames);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on field \"${parentType.name}.${fieldDef.name}\".` +\n didYouMean(suggestions),\n {\n nodes: argNode,\n },\n ),\n );\n }\n },\n };\n}\n/**\n * @internal\n */\n\nexport function KnownArgumentNamesOnDirectivesRule(context) {\n const directiveArgs = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n directiveArgs[directive.name] = directive.args.map((arg) => arg.name);\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argsNodes =\n (_def$arguments = def.arguments) !== null && _def$arguments !== void 0\n ? _def$arguments\n : [];\n directiveArgs[def.name.value] = argsNodes.map((arg) => arg.name.value);\n }\n }\n\n return {\n Directive(directiveNode) {\n const directiveName = directiveNode.name.value;\n const knownArgs = directiveArgs[directiveName];\n\n if (directiveNode.arguments && knownArgs) {\n for (const argNode of directiveNode.arguments) {\n const argName = argNode.name.value;\n\n if (!knownArgs.includes(argName)) {\n const suggestions = suggestionList(argName, knownArgs);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on directive \"@${directiveName}\".` +\n didYouMean(suggestions),\n {\n nodes: argNode,\n },\n ),\n );\n }\n }\n }\n\n return false;\n },\n };\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { invariant } from '../../jsutils/invariant.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { OperationTypeNode } from '../../language/ast.mjs';\nimport { DirectiveLocation } from '../../language/directiveLocation.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined\n */\nexport function KnownDirectivesRule(context) {\n const locationsMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n locationsMap[directive.name] = directive.locations;\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap[def.name.value] = def.locations.map((name) => name.value);\n }\n }\n\n return {\n Directive(node, _key, _parent, _path, ancestors) {\n const name = node.name.value;\n const locations = locationsMap[name];\n\n if (!locations) {\n context.reportError(\n new GraphQLError(`Unknown directive \"@${name}\".`, {\n nodes: node,\n }),\n );\n return;\n }\n\n const candidateLocation = getDirectiveLocationForASTPath(ancestors);\n\n if (candidateLocation && !locations.includes(candidateLocation)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${name}\" may not be used on ${candidateLocation}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n\nfunction getDirectiveLocationForASTPath(ancestors) {\n const appliedTo = ancestors[ancestors.length - 1];\n 'kind' in appliedTo || invariant(false);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n\n case Kind.VARIABLE_DEFINITION:\n return DirectiveLocation.VARIABLE_DEFINITION;\n\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n\n case Kind.INPUT_VALUE_DEFINITION: {\n const parentNode = ancestors[ancestors.length - 3];\n 'kind' in parentNode || invariant(false);\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n ? DirectiveLocation.INPUT_FIELD_DEFINITION\n : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n // Not reachable, all possible types have been considered.\n\n /* c8 ignore next */\n\n default:\n false || invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind));\n }\n}\n\nfunction getDirectiveLocationForOperation(operation) {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return DirectiveLocation.QUERY;\n\n case OperationTypeNode.MUTATION:\n return DirectiveLocation.MUTATION;\n\n case OperationTypeNode.SUBSCRIPTION:\n return DirectiveLocation.SUBSCRIPTION;\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined\n */\nexport function KnownFragmentNamesRule(context) {\n return {\n FragmentSpread(node) {\n const fragmentName = node.name.value;\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n context.reportError(\n new GraphQLError(`Unknown fragment \"${fragmentName}\".`, {\n nodes: node.name,\n }),\n );\n }\n },\n };\n}\n","import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeSystemDefinitionNode,\n isTypeSystemExtensionNode,\n} from '../../language/predicates.mjs';\nimport { introspectionTypes } from '../../type/introspection.mjs';\nimport { specifiedScalarTypes } from '../../type/scalars.mjs';\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence\n */\nexport function KnownTypeNamesRule(context) {\n const schema = context.getSchema();\n const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n const definedTypes = Object.create(null);\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n const typeNames = [\n ...Object.keys(existingTypesMap),\n ...Object.keys(definedTypes),\n ];\n return {\n NamedType(node, _1, parent, _2, ancestors) {\n const typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n const definitionNode =\n (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0\n ? _ancestors$\n : parent;\n const isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && standardTypeNames.includes(typeName)) {\n return;\n }\n\n const suggestedTypes = suggestionList(\n typeName,\n isSDL ? standardTypeNames.concat(typeNames) : typeNames,\n );\n context.reportError(\n new GraphQLError(\n `Unknown type \"${typeName}\".` + didYouMean(suggestedTypes),\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\nconst standardTypeNames = [...specifiedScalarTypes, ...introspectionTypes].map(\n (type) => type.name,\n);\n\nfunction isSDLNode(value) {\n return (\n 'kind' in value &&\n (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))\n );\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\n\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n *\n * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation\n */\nexport function LoneAnonymousOperationRule(context) {\n let operationCount = 0;\n return {\n Document(node) {\n operationCount = node.definitions.filter(\n (definition) => definition.kind === Kind.OPERATION_DEFINITION,\n ).length;\n },\n\n OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(\n new GraphQLError(\n 'This anonymous operation must be the only defined operation.',\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n */\nexport function LoneSchemaDefinitionRule(context) {\n var _ref, _ref2, _oldSchema$astNode;\n\n const oldSchema = context.getSchema();\n const alreadyDefined =\n (_ref =\n (_ref2 =\n (_oldSchema$astNode =\n oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0\n ? _oldSchema$astNode\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getQueryType()) !== null && _ref2 !== void 0\n ? _ref2\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getMutationType()) !== null && _ref !== void 0\n ? _ref\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getSubscriptionType();\n let schemaDefinitionsCount = 0;\n return {\n SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(\n new GraphQLError(\n 'Cannot define a new schema within a schema extension.',\n {\n nodes: node,\n },\n ),\n );\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(\n new GraphQLError('Must provide only one schema definition.', {\n nodes: node,\n }),\n );\n }\n\n ++schemaDefinitionsCount;\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nconst MAX_LISTS_DEPTH = 3;\nexport function MaxIntrospectionDepthRule(context) {\n /**\n * Counts the depth of list fields in \"__Type\" recursively and\n * returns `true` if the limit has been reached.\n */\n function checkDepth(node, visitedFragments = Object.create(null), depth = 0) {\n if (node.kind === Kind.FRAGMENT_SPREAD) {\n const fragmentName = node.name.value;\n\n if (visitedFragments[fragmentName] === true) {\n // Fragment cycles are handled by `NoFragmentCyclesRule`.\n return false;\n }\n\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n // Missing fragments checks are handled by `KnownFragmentNamesRule`.\n return false;\n } // Rather than following an immutable programming pattern which has\n // significant memory and garbage collection overhead, we've opted to\n // take a mutable approach for efficiency's sake. Importantly visiting a\n // fragment twice is fine, so long as you don't do one visit inside the\n // other.\n\n try {\n visitedFragments[fragmentName] = true;\n return checkDepth(fragment, visitedFragments, depth);\n } finally {\n visitedFragments[fragmentName] = undefined;\n }\n }\n\n if (\n node.kind === Kind.FIELD && // check all introspection lists\n (node.name.value === 'fields' ||\n node.name.value === 'interfaces' ||\n node.name.value === 'possibleTypes' ||\n node.name.value === 'inputFields')\n ) {\n // eslint-disable-next-line no-param-reassign\n depth++;\n\n if (depth >= MAX_LISTS_DEPTH) {\n return true;\n }\n } // handles fields and inline fragments\n\n if ('selectionSet' in node && node.selectionSet) {\n for (const child of node.selectionSet.selections) {\n if (checkDepth(child, visitedFragments, depth)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return {\n Field(node) {\n if (node.name.value === '__schema' || node.name.value === '__type') {\n if (checkDepth(node)) {\n context.reportError(\n new GraphQLError('Maximum introspection depth exceeded', {\n nodes: [node],\n }),\n );\n return false;\n }\n }\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No fragment cycles\n *\n * The graph of fragment spreads must not form any cycles including spreading itself.\n * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles\n */\nexport function NoFragmentCyclesRule(context) {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors\n\n const spreadPath = []; // Position in the spread path\n\n const spreadPathIndexByName = Object.create(null);\n return {\n OperationDefinition: () => false,\n\n FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n },\n }; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(fragment) {\n if (visitedFrags[fragment.name.value]) {\n return;\n }\n\n const fragmentName = fragment.name.value;\n visitedFrags[fragmentName] = true;\n const spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (const spreadNode of spreadNodes) {\n const spreadName = spreadNode.name.value;\n const cycleIndex = spreadPathIndexByName[spreadName];\n spreadPath.push(spreadNode);\n\n if (cycleIndex === undefined) {\n const spreadFragment = context.getFragment(spreadName);\n\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n const cyclePath = spreadPath.slice(cycleIndex);\n const viaPath = cyclePath\n .slice(0, -1)\n .map((s) => '\"' + s.name.value + '\"')\n .join(', ');\n context.reportError(\n new GraphQLError(\n `Cannot spread fragment \"${spreadName}\" within itself` +\n (viaPath !== '' ? ` via ${viaPath}.` : '.'),\n {\n nodes: cyclePath,\n },\n ),\n );\n }\n\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined\n */\nexport function NoUndefinedVariablesRule(context) {\n let variableNameDefined = Object.create(null);\n return {\n OperationDefinition: {\n enter() {\n variableNameDefined = Object.create(null);\n },\n\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node } of usages) {\n const varName = node.name.value;\n\n if (variableNameDefined[varName] !== true) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${varName}\" is not defined by operation \"${operation.name.value}\".`\n : `Variable \"$${varName}\" is not defined.`,\n {\n nodes: [node, operation],\n },\n ),\n );\n }\n }\n },\n },\n\n VariableDefinition(node) {\n variableNameDefined[node.variable.name.value] = true;\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used\n */\nexport function NoUnusedFragmentsRule(context) {\n const operationDefs = [];\n const fragmentDefs = [];\n return {\n OperationDefinition(node) {\n operationDefs.push(node);\n return false;\n },\n\n FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n\n Document: {\n leave() {\n const fragmentNameUsed = Object.create(null);\n\n for (const operation of operationDefs) {\n for (const fragment of context.getRecursivelyReferencedFragments(\n operation,\n )) {\n fragmentNameUsed[fragment.name.value] = true;\n }\n }\n\n for (const fragmentDef of fragmentDefs) {\n const fragName = fragmentDef.name.value;\n\n if (fragmentNameUsed[fragName] !== true) {\n context.reportError(\n new GraphQLError(`Fragment \"${fragName}\" is never used.`, {\n nodes: fragmentDef,\n }),\n );\n }\n }\n },\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variables-Used\n */\nexport function NoUnusedVariablesRule(context) {\n let variableDefs = [];\n return {\n OperationDefinition: {\n enter() {\n variableDefs = [];\n },\n\n leave(operation) {\n const variableNameUsed = Object.create(null);\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node } of usages) {\n variableNameUsed[node.name.value] = true;\n }\n\n for (const variableDef of variableDefs) {\n const variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${variableName}\" is never used in operation \"${operation.name.value}\".`\n : `Variable \"$${variableName}\" is never used.`,\n {\n nodes: variableDef,\n },\n ),\n );\n }\n }\n },\n },\n\n VariableDefinition(def) {\n variableDefs.push(def);\n },\n };\n}\n","import { naturalCompare } from '../jsutils/naturalCompare.mjs';\nimport { Kind } from '../language/kinds.mjs';\n/**\n * Sort ValueNode.\n *\n * This function returns a sorted copy of the given ValueNode.\n *\n * @internal\n */\n\nexport function sortValueNode(valueNode) {\n switch (valueNode.kind) {\n case Kind.OBJECT:\n return { ...valueNode, fields: sortFields(valueNode.fields) };\n\n case Kind.LIST:\n return { ...valueNode, values: valueNode.values.map(sortValueNode) };\n\n case Kind.INT:\n case Kind.FLOAT:\n case Kind.STRING:\n case Kind.BOOLEAN:\n case Kind.NULL:\n case Kind.ENUM:\n case Kind.VARIABLE:\n return valueNode;\n }\n}\n\nfunction sortFields(fields) {\n return fields\n .map((fieldNode) => ({\n ...fieldNode,\n value: sortValueNode(fieldNode.value),\n }))\n .sort((fieldA, fieldB) =>\n naturalCompare(fieldA.name.value, fieldB.name.value),\n );\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport {\n getNamedType,\n isInterfaceType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../../type/definition.mjs';\nimport { sortValueNode } from '../../utilities/sortValueNode.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\nfunction reasonMessage(reason) {\n if (Array.isArray(reason)) {\n return reason\n .map(\n ([responseName, subReason]) =>\n `subfields \"${responseName}\" conflict because ` +\n reasonMessage(subReason),\n )\n .join(' and ');\n }\n\n return reason;\n}\n/**\n * Overlapping fields can be merged\n *\n * A selection set is only valid if all fields (including spreading any\n * fragments) either correspond to distinct response names or can be merged\n * without ambiguity.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging\n */\n\nexport function OverlappingFieldsCanBeMergedRule(context) {\n // A memoization for when fields and a fragment or two fragments are compared\n // \"between\" each other for conflicts. Comparisons made be made many times,\n // so memoizing this can dramatically improve the performance of this validator.\n const comparedFieldsAndFragmentPairs = new OrderedPairSet();\n const comparedFragmentPairs = new PairSet(); // A cache for the \"field map\" and list of fragment names found in any given\n // selection set. Selection sets may be asked for this information multiple\n // times, so this improves the performance of this validator.\n\n const cachedFieldsAndFragmentNames = new Map();\n return {\n SelectionSet(selectionSet) {\n const conflicts = findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n context.getParentType(),\n selectionSet,\n );\n\n for (const [[responseName, reason], fields1, fields2] of conflicts) {\n const reasonMsg = reasonMessage(reason);\n context.reportError(\n new GraphQLError(\n `Fields \"${responseName}\" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,\n {\n nodes: fields1.concat(fields2),\n },\n ),\n );\n }\n },\n };\n}\n\n/**\n * Algorithm:\n *\n * Conflicts occur when two fields exist in a query which will produce the same\n * response name, but represent differing values, thus creating a conflict.\n * The algorithm below finds all conflicts via making a series of comparisons\n * between fields. In order to compare as few fields as possible, this makes\n * a series of comparisons \"within\" sets of fields and \"between\" sets of fields.\n *\n * Given any selection set, a collection produces both a set of fields by\n * also including all inline fragments, as well as a list of fragments\n * referenced by fragment spreads.\n *\n * A) Each selection set represented in the document first compares \"within\" its\n * collected set of fields, finding any conflicts between every pair of\n * overlapping fields.\n * Note: This is the *only time* that a the fields \"within\" a set are compared\n * to each other. After this only fields \"between\" sets are compared.\n *\n * B) Also, if any fragment is referenced in a selection set, then a\n * comparison is made \"between\" the original set of fields and the\n * referenced fragment.\n *\n * C) Also, if multiple fragments are referenced, then comparisons\n * are made \"between\" each referenced fragment.\n *\n * D) When comparing \"between\" a set of fields and a referenced fragment, first\n * a comparison is made between each field in the original set of fields and\n * each field in the the referenced set of fields.\n *\n * E) Also, if any fragment is referenced in the referenced selection set,\n * then a comparison is made \"between\" the original set of fields and the\n * referenced fragment (recursively referring to step D).\n *\n * F) When comparing \"between\" two fragments, first a comparison is made between\n * each field in the first referenced set of fields and each field in the the\n * second referenced set of fields.\n *\n * G) Also, any fragments referenced by the first must be compared to the\n * second, and any fragments referenced by the second must be compared to the\n * first (recursively referring to step F).\n *\n * H) When comparing two fields, if both have selection sets, then a comparison\n * is made \"between\" both selection sets, first comparing the set of fields in\n * the first selection set with the set of fields in the second.\n *\n * I) Also, if any fragment is referenced in either selection set, then a\n * comparison is made \"between\" the other set of fields and the\n * referenced fragment.\n *\n * J) Also, if two fragments are referenced in both selection sets, then a\n * comparison is made \"between\" the two fragments.\n *\n */\n// Find all conflicts found \"within\" a selection set, including those found\n// via spreading in fragments. Called when visiting each SelectionSet in the\n// GraphQL Document.\nfunction findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentType,\n selectionSet,\n) {\n const conflicts = [];\n const [fieldMap, fragmentNames] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType,\n selectionSet,\n ); // (A) Find find all conflicts \"within\" the fields of this selection set.\n // Note: this is the *only place* `collectConflictsWithin` is called.\n\n collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n );\n\n if (fragmentNames.length !== 0) {\n // (B) Then collect conflicts between these fields and those represented by\n // each spread fragment name found.\n for (let i = 0; i < fragmentNames.length; i++) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fieldMap,\n fragmentNames[i],\n ); // (C) Then compare this fragment with all other fragments found in this\n // selection set to collect conflicts between fragments spread together.\n // This compares each item in the list of fragment names to every other\n // item in that same list (except for itself).\n\n for (let j = i + 1; j < fragmentNames.length; j++) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fragmentNames[i],\n fragmentNames[j],\n );\n }\n }\n }\n\n return conflicts;\n} // Collect all conflicts found between a set of fields and a fragment reference\n// including via spreading in any nested fragments.\n\nfunction collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n fragmentName,\n) {\n // Memoize so the fields and fragments are not compared for conflicts more\n // than once.\n if (\n comparedFieldsAndFragmentPairs.has(\n fieldMap,\n fragmentName,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n\n comparedFieldsAndFragmentPairs.add(\n fieldMap,\n fragmentName,\n areMutuallyExclusive,\n );\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n return;\n }\n\n const [fieldMap2, referencedFragmentNames] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment,\n ); // Do not compare a fragment's fieldMap to itself.\n\n if (fieldMap === fieldMap2) {\n return;\n } // (D) First collect any conflicts between the provided collection of fields\n // and the collection of fields represented by the given fragment.\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n fieldMap2,\n ); // (E) Then collect any conflicts between the provided collection of fields\n // and any fragment names found in the given fragment.\n\n for (const referencedFragmentName of referencedFragmentNames) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n referencedFragmentName,\n );\n }\n} // Collect all conflicts found between two fragments, including via spreading in\n// any nested fragments.\n\nfunction collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n fragmentName2,\n) {\n // No need to compare a fragment to itself.\n if (fragmentName1 === fragmentName2) {\n return;\n } // Memoize so two fragments are not compared for conflicts more than once.\n\n if (\n comparedFragmentPairs.has(\n fragmentName1,\n fragmentName2,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n\n comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive);\n const fragment1 = context.getFragment(fragmentName1);\n const fragment2 = context.getFragment(fragmentName2);\n\n if (!fragment1 || !fragment2) {\n return;\n }\n\n const [fieldMap1, referencedFragmentNames1] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment1,\n );\n const [fieldMap2, referencedFragmentNames2] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment2,\n ); // (F) First, collect all conflicts between these two collections of fields\n // (not including any nested fragments).\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n ); // (G) Then collect conflicts between the first fragment and any nested\n // fragments spread in the second fragment.\n\n for (const referencedFragmentName2 of referencedFragmentNames2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n referencedFragmentName2,\n );\n } // (G) Then collect conflicts between the second fragment and any nested\n // fragments spread in the first fragment.\n\n for (const referencedFragmentName1 of referencedFragmentNames1) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n referencedFragmentName1,\n fragmentName2,\n );\n }\n} // Find all conflicts found between two selection sets, including those found\n// via spreading in fragments. Called when determining if conflicts exist\n// between the sub-fields of two overlapping fields.\n\nfunction findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n parentType1,\n selectionSet1,\n parentType2,\n selectionSet2,\n) {\n const conflicts = [];\n const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType1,\n selectionSet1,\n );\n const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType2,\n selectionSet2,\n ); // (H) First, collect all conflicts between these two collections of field.\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n ); // (I) Then collect conflicts between the first collection of fields and\n // those referenced by each fragment name associated with the second.\n\n for (const fragmentName2 of fragmentNames2) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentName2,\n );\n } // (I) Then collect conflicts between the second collection of fields and\n // those referenced by each fragment name associated with the first.\n\n for (const fragmentName1 of fragmentNames1) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap2,\n fragmentName1,\n );\n } // (J) Also collect conflicts between any fragment names by the first and\n // fragment names by the second. This compares each item in the first set of\n // names to each item in the second set of names.\n\n for (const fragmentName1 of fragmentNames1) {\n for (const fragmentName2 of fragmentNames2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n fragmentName2,\n );\n }\n }\n\n return conflicts;\n} // Collect all Conflicts \"within\" one collection of fields.\n\nfunction collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For every response name, if there are multiple fields, they\n // must be compared to find a potential conflict.\n for (const [responseName, fields] of Object.entries(fieldMap)) {\n // This compares every field in the list to every other field in this list\n // (except to itself). If the list only has one item, nothing needs to\n // be compared.\n if (fields.length > 1) {\n for (let i = 0; i < fields.length; i++) {\n for (let j = i + 1; j < fields.length; j++) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false, // within one collection is never mutually exclusive\n responseName,\n fields[i],\n fields[j],\n );\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Collect all Conflicts between two collections of fields. This is similar to,\n// but different from the `collectConflictsWithin` function above. This check\n// assumes that `collectConflictsWithin` has already been called on each\n// provided collection of fields. This is true because this validator traverses\n// each individual selection set.\n\nfunction collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For any response name which appears in both provided field\n // maps, each field from the first field map must be compared to every field\n // in the second field map to find potential conflicts.\n for (const [responseName, fields1] of Object.entries(fieldMap1)) {\n const fields2 = fieldMap2[responseName];\n\n if (fields2) {\n for (const field1 of fields1) {\n for (const field2 of fields2) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n field2,\n );\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Determines if there is a conflict between two particular fields, including\n// comparing their sub-fields.\n\nfunction findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n field2,\n) {\n const [parentType1, node1, def1] = field1;\n const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same\n // time, due to the parent types, then it is safe to permit them to diverge\n // in aliased field or arguments used as they will not present any ambiguity\n // by differing.\n // It is known that two parent types could never overlap if they are\n // different Object types. Interface or Union types might overlap - if not\n // in the current state of the schema, then perhaps in some future version,\n // thus may not safely diverge.\n\n const areMutuallyExclusive =\n parentFieldsAreMutuallyExclusive ||\n (parentType1 !== parentType2 &&\n isObjectType(parentType1) &&\n isObjectType(parentType2));\n\n if (!areMutuallyExclusive) {\n // Two aliases must refer to the same field.\n const name1 = node1.name.value;\n const name2 = node2.name.value;\n\n if (name1 !== name2) {\n return [\n [responseName, `\"${name1}\" and \"${name2}\" are different fields`],\n [node1],\n [node2],\n ];\n } // Two field calls must have the same arguments.\n\n if (!sameArguments(node1, node2)) {\n return [\n [responseName, 'they have differing arguments'],\n [node1],\n [node2],\n ];\n }\n } // The return type for each field.\n\n const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type;\n const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type;\n\n if (type1 && type2 && doTypesConflict(type1, type2)) {\n return [\n [\n responseName,\n `they return conflicting types \"${inspect(type1)}\" and \"${inspect(\n type2,\n )}\"`,\n ],\n [node1],\n [node2],\n ];\n } // Collect and compare sub-fields. Use the same \"visited fragment names\" list\n // for both collections so fields in a fragment reference are never\n // compared to themselves.\n\n const selectionSet1 = node1.selectionSet;\n const selectionSet2 = node2.selectionSet;\n\n if (selectionSet1 && selectionSet2) {\n const conflicts = findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n getNamedType(type1),\n selectionSet1,\n getNamedType(type2),\n selectionSet2,\n );\n return subfieldConflicts(conflicts, responseName, node1, node2);\n }\n}\n\nfunction sameArguments(node1, node2) {\n const args1 = node1.arguments;\n const args2 = node2.arguments;\n\n if (args1 === undefined || args1.length === 0) {\n return args2 === undefined || args2.length === 0;\n }\n\n if (args2 === undefined || args2.length === 0) {\n return false;\n }\n /* c8 ignore next */\n\n if (args1.length !== args2.length) {\n /* c8 ignore next */\n return false;\n /* c8 ignore next */\n }\n\n const values2 = new Map(args2.map(({ name, value }) => [name.value, value]));\n return args1.every((arg1) => {\n const value1 = arg1.value;\n const value2 = values2.get(arg1.name.value);\n\n if (value2 === undefined) {\n return false;\n }\n\n return stringifyValue(value1) === stringifyValue(value2);\n });\n}\n\nfunction stringifyValue(value) {\n return print(sortValueNode(value));\n} // Two types conflict if both types could not apply to a value simultaneously.\n// Composite types are ignored as their individual field types will be compared\n// later recursively. However List and Non-Null types must match.\n\nfunction doTypesConflict(type1, type2) {\n if (isListType(type1)) {\n return isListType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n\n if (isListType(type2)) {\n return true;\n }\n\n if (isNonNullType(type1)) {\n return isNonNullType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n\n if (isNonNullType(type2)) {\n return true;\n }\n\n if (isLeafType(type1) || isLeafType(type2)) {\n return type1 !== type2;\n }\n\n return false;\n} // Given a selection set, return the collection of fields (a mapping of response\n// name to field nodes and definitions) as well as a list of fragment names\n// referenced via fragment spreads.\n\nfunction getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType,\n selectionSet,\n) {\n const cached = cachedFieldsAndFragmentNames.get(selectionSet);\n\n if (cached) {\n return cached;\n }\n\n const nodeAndDefs = Object.create(null);\n const fragmentNames = Object.create(null);\n\n _collectFieldsAndFragmentNames(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentNames,\n );\n\n const result = [nodeAndDefs, Object.keys(fragmentNames)];\n cachedFieldsAndFragmentNames.set(selectionSet, result);\n return result;\n} // Given a reference to a fragment, return the represented collection of fields\n// as well as a list of nested fragment names referenced via fragment spreads.\n\nfunction getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment,\n) {\n // Short-circuit building a type from the node if possible.\n const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet);\n\n if (cached) {\n return cached;\n }\n\n const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);\n return getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragmentType,\n fragment.selectionSet,\n );\n}\n\nfunction _collectFieldsAndFragmentNames(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentNames,\n) {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n const fieldName = selection.name.value;\n let fieldDef;\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n fieldDef = parentType.getFields()[fieldName];\n }\n\n const responseName = selection.alias\n ? selection.alias.value\n : fieldName;\n\n if (!nodeAndDefs[responseName]) {\n nodeAndDefs[responseName] = [];\n }\n\n nodeAndDefs[responseName].push([parentType, selection, fieldDef]);\n break;\n }\n\n case Kind.FRAGMENT_SPREAD:\n fragmentNames[selection.name.value] = true;\n break;\n\n case Kind.INLINE_FRAGMENT: {\n const typeCondition = selection.typeCondition;\n const inlineFragmentType = typeCondition\n ? typeFromAST(context.getSchema(), typeCondition)\n : parentType;\n\n _collectFieldsAndFragmentNames(\n context,\n inlineFragmentType,\n selection.selectionSet,\n nodeAndDefs,\n fragmentNames,\n );\n\n break;\n }\n }\n }\n} // Given a series of Conflicts which occurred between two sub-fields, generate\n// a single Conflict.\n\nfunction subfieldConflicts(conflicts, responseName, node1, node2) {\n if (conflicts.length > 0) {\n return [\n [responseName, conflicts.map(([reason]) => reason)],\n [node1, ...conflicts.map(([, fields1]) => fields1).flat()],\n [node2, ...conflicts.map(([, , fields2]) => fields2).flat()],\n ];\n }\n}\n/**\n * A way to keep track of pairs of things where the ordering of the pair\n * matters.\n *\n * Provides a third argument for has/set to allow flagging the pair as\n * weakly or strongly present within the collection.\n */\n\nclass OrderedPairSet {\n constructor() {\n this._data = new Map();\n }\n\n has(a, b, weaklyPresent) {\n var _this$_data$get;\n\n const result =\n (_this$_data$get = this._data.get(a)) === null ||\n _this$_data$get === void 0\n ? void 0\n : _this$_data$get.get(b);\n\n if (result === undefined) {\n return false;\n }\n\n return weaklyPresent ? true : weaklyPresent === result;\n }\n\n add(a, b, weaklyPresent) {\n const map = this._data.get(a);\n\n if (map === undefined) {\n this._data.set(a, new Map([[b, weaklyPresent]]));\n } else {\n map.set(b, weaklyPresent);\n }\n }\n}\n/**\n * A way to keep track of pairs of similar things when the ordering of the pair\n * does not matter.\n */\n\nclass PairSet {\n constructor() {\n this._orderedPairSet = new OrderedPairSet();\n }\n\n has(a, b, weaklyPresent) {\n return a < b\n ? this._orderedPairSet.has(a, b, weaklyPresent)\n : this._orderedPairSet.has(b, a, weaklyPresent);\n }\n\n add(a, b, weaklyPresent) {\n if (a < b) {\n this._orderedPairSet.add(a, b, weaklyPresent);\n } else {\n this._orderedPairSet.add(b, a, weaklyPresent);\n }\n }\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { isCompositeType } from '../../type/definition.mjs';\nimport { doTypesOverlap } from '../../utilities/typeComparators.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n */\nexport function PossibleFragmentSpreadsRule(context) {\n return {\n InlineFragment(node) {\n const fragType = context.getType();\n const parentType = context.getParentType();\n\n if (\n isCompositeType(fragType) &&\n isCompositeType(parentType) &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n FragmentSpread(node) {\n const fragName = node.name.value;\n const fragType = getFragmentType(context, fragName);\n const parentType = context.getParentType();\n\n if (\n fragType &&\n parentType &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment \"${fragName}\" cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n\nfunction getFragmentType(context, name) {\n const frag = context.getFragment(name);\n\n if (frag) {\n const type = typeFromAST(context.getSchema(), frag.typeCondition);\n\n if (isCompositeType(type)) {\n return type;\n }\n }\n}\n","import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { inspect } from '../../jsutils/inspect.mjs';\nimport { invariant } from '../../jsutils/invariant.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { isTypeDefinitionNode } from '../../language/predicates.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../../type/definition.mjs';\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n */\nexport function PossibleTypeExtensionsRule(context) {\n const schema = context.getSchema();\n const definedTypes = Object.create(null);\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension,\n };\n\n function checkExtension(node) {\n const typeName = node.name.value;\n const defNode = definedTypes[typeName];\n const existingType =\n schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n let expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n const kindStr = extensionKindToTypeName(node.kind);\n context.reportError(\n new GraphQLError(`Cannot extend non-${kindStr} type \"${typeName}\".`, {\n nodes: defNode ? [defNode, node] : node,\n }),\n );\n }\n } else {\n const allTypeNames = Object.keys({\n ...definedTypes,\n ...(schema === null || schema === void 0\n ? void 0\n : schema.getTypeMap()),\n });\n const suggestedTypes = suggestionList(typeName, allTypeNames);\n context.reportError(\n new GraphQLError(\n `Cannot extend type \"${typeName}\" because it is not defined.` +\n didYouMean(suggestedTypes),\n {\n nodes: node.name,\n },\n ),\n );\n }\n }\n}\nconst defKindToExtKind = {\n [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION,\n [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION,\n [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION,\n [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION,\n [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION,\n [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n};\n\nfunction typeToExtKind(type) {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n }\n\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n }\n /* c8 ignore next 3 */\n // Not reachable. All possible types have been considered\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind) {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n // Not reachable. All possible types have been considered\n\n /* c8 ignore next */\n\n default:\n false || invariant(false, 'Unexpected kind: ' + inspect(kind));\n }\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { keyMap } from '../../jsutils/keyMap.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isRequiredArgument, isType } from '../../type/definition.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n */\nexport function ProvidedRequiredArgumentsRule(context) {\n return {\n // eslint-disable-next-line new-cap\n ...ProvidedRequiredArgumentsOnDirectivesRule(context),\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(fieldNode) {\n var _fieldNode$arguments;\n\n const fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n return false;\n }\n\n const providedArgs = new Set( // FIXME: https://github.com/graphql/graphql-js/issues/2203\n /* c8 ignore next */\n (_fieldNode$arguments = fieldNode.arguments) === null ||\n _fieldNode$arguments === void 0\n ? void 0\n : _fieldNode$arguments.map((arg) => arg.name.value),\n );\n\n for (const argDef of fieldDef.args) {\n if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) {\n const argTypeStr = inspect(argDef.type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldDef.name}\" argument \"${argDef.name}\" of type \"${argTypeStr}\" is required, but it was not provided.`,\n {\n nodes: fieldNode,\n },\n ),\n );\n }\n }\n },\n },\n };\n}\n/**\n * @internal\n */\n\nexport function ProvidedRequiredArgumentsOnDirectivesRule(context) {\n var _schema$getDirectives;\n\n const requiredArgsMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives =\n (_schema$getDirectives =\n schema === null || schema === void 0\n ? void 0\n : schema.getDirectives()) !== null && _schema$getDirectives !== void 0\n ? _schema$getDirectives\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n requiredArgsMap[directive.name] = keyMap(\n directive.args.filter(isRequiredArgument),\n (arg) => arg.name,\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argNodes =\n (_def$arguments = def.arguments) !== null && _def$arguments !== void 0\n ? _def$arguments\n : [];\n requiredArgsMap[def.name.value] = keyMap(\n argNodes.filter(isRequiredArgumentNode),\n (arg) => arg.name.value,\n );\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(directiveNode) {\n const directiveName = directiveNode.name.value;\n const requiredArgs = requiredArgsMap[directiveName];\n\n if (requiredArgs) {\n var _directiveNode$argume;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argNodes =\n (_directiveNode$argume = directiveNode.arguments) !== null &&\n _directiveNode$argume !== void 0\n ? _directiveNode$argume\n : [];\n const argNodeMap = new Set(argNodes.map((arg) => arg.name.value));\n\n for (const [argName, argDef] of Object.entries(requiredArgs)) {\n if (!argNodeMap.has(argName)) {\n const argType = isType(argDef.type)\n ? inspect(argDef.type)\n : print(argDef.type);\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" argument \"${argName}\" of type \"${argType}\" is required, but it was not provided.`,\n {\n nodes: directiveNode,\n },\n ),\n );\n }\n }\n }\n },\n },\n };\n}\n\nfunction isRequiredArgumentNode(arg) {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { getNamedType, isLeafType } from '../../type/definition.mjs';\n\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n */\nexport function ScalarLeafsRule(context) {\n return {\n Field(node) {\n const type = context.getType();\n const selectionSet = node.selectionSet;\n\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" must not have a selection since type \"${typeStr}\" has no subfields.`,\n {\n nodes: selectionSet,\n },\n ),\n );\n }\n } else if (!selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have a selection of subfields. Did you mean \"${fieldName} { ... }\"?`,\n {\n nodes: node,\n },\n ),\n );\n } else if (selectionSet.selections.length === 0) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have at least one field selected.`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n };\n}\n","import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.mjs';\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Unknown |\n * | NullValue | null |\n *\n */\n\nexport function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n const variableValue = variables[variableName];\n\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n\n if (valueNode.kind === Kind.LIST) {\n const coercedValues = [];\n\n for (const itemNode of valueNode.values) {\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n const itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n const coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedObj = Object.create(null);\n const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);\n\n for (const field of Object.values(type.getFields())) {\n const fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n const fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n if (type.isOneOf) {\n const keys = Object.keys(coercedObj);\n\n if (keys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n if (coercedObj[keys[0]] === null) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n\n return coercedObj;\n }\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n let result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible input types have been considered.\n\n false || invariant(false, 'Unexpected input type: ' + inspect(type));\n} // Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\n\nfunction isMissingVariable(valueNode, variables) {\n return (\n valueNode.kind === Kind.VARIABLE &&\n (variables == null || variables[valueNode.name.value] === undefined)\n );\n}\n","import { inspect } from '../jsutils/inspect.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { printPathArray } from '../jsutils/printPathArray.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { isInputType, isNonNullType } from '../type/definition.mjs';\nimport { coerceInputValue } from '../utilities/coerceInputValue.mjs';\nimport { typeFromAST } from '../utilities/typeFromAST.mjs';\nimport { valueFromAST } from '../utilities/valueFromAST.mjs';\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getVariableValues(schema, varDefNodes, inputs, options) {\n const errors = [];\n const maxErrors =\n options === null || options === void 0 ? void 0 : options.maxErrors;\n\n try {\n const coerced = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n\n errors.push(error);\n },\n );\n\n if (errors.length === 0) {\n return {\n coerced,\n };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return {\n errors,\n };\n}\n\nfunction coerceVariableValues(schema, varDefNodes, inputs, onError) {\n const coercedValues = {};\n\n for (const varDefNode of varDefNodes) {\n const varName = varDefNode.variable.name.value;\n const varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = print(varDefNode.type);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n {\n nodes: varDefNode.type,\n },\n ),\n );\n continue;\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);\n } else if (isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of required type \"${varTypeStr}\" was not provided.`,\n {\n nodes: varDefNode,\n },\n ),\n );\n }\n\n continue;\n }\n\n const value = inputs[varName];\n\n if (value === null && isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of non-null type \"${varTypeStr}\" must not be null.`,\n {\n nodes: varDefNode,\n },\n ),\n );\n continue;\n }\n\n coercedValues[varName] = coerceInputValue(\n value,\n varType,\n (path, invalidValue, error) => {\n let prefix =\n `Variable \"$${varName}\" got invalid value ` + inspect(invalidValue);\n\n if (path.length > 0) {\n prefix += ` at \"${varName}${printPathArray(path)}\"`;\n }\n\n onError(\n new GraphQLError(prefix + '; ' + error.message, {\n nodes: varDefNode,\n originalError: error,\n }),\n );\n },\n );\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getArgumentValues(def, node, variableValues) {\n var _node$arguments;\n\n const coercedValues = {}; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const argumentNodes =\n (_node$arguments = node.arguments) !== null && _node$arguments !== void 0\n ? _node$arguments\n : [];\n const argNodeMap = keyMap(argumentNodes, (arg) => arg.name.value);\n\n for (const argDef of def.args) {\n const name = argDef.name;\n const argType = argDef.type;\n const argumentNode = argNodeMap[name];\n\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n 'was not provided.',\n {\n nodes: node,\n },\n );\n }\n\n continue;\n }\n\n const valueNode = argumentNode.value;\n let isNull = valueNode.kind === Kind.NULL;\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n\n if (\n variableValues == null ||\n !hasOwnProperty(variableValues, variableName)\n ) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n `was provided the variable \"$${variableName}\" which was not provided a runtime value.`,\n {\n nodes: valueNode,\n },\n );\n }\n\n continue;\n }\n\n isNull = variableValues[variableName] == null;\n }\n\n if (isNull && isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of non-null type \"${inspect(argType)}\" ` +\n 'must not be null.',\n {\n nodes: valueNode,\n },\n );\n }\n\n const coercedValue = valueFromAST(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n `Argument \"${name}\" has invalid value ${print(valueNode)}.`,\n {\n nodes: valueNode,\n },\n );\n }\n\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getDirectiveValues(directiveDef, node, variableValues) {\n var _node$directives;\n\n const directiveNode =\n (_node$directives = node.directives) === null || _node$directives === void 0\n ? void 0\n : _node$directives.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(directiveDef, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","import { Kind } from '../language/kinds.mjs';\nimport { isAbstractType } from '../type/definition.mjs';\nimport {\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.mjs';\nimport { typeFromAST } from '../utilities/typeFromAST.mjs';\nimport { getDirectiveValues } from './values.mjs';\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n\nexport function collectFields(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n) {\n const fields = new Map();\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n fields,\n new Set(),\n );\n return fields;\n}\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n\nexport function collectSubfields(\n schema,\n fragments,\n variableValues,\n returnType,\n fieldNodes,\n) {\n const subFieldNodes = new Map();\n const visitedFragmentNames = new Set();\n\n for (const node of fieldNodes) {\n if (node.selectionSet) {\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n returnType,\n node.selectionSet,\n subFieldNodes,\n visitedFragmentNames,\n );\n }\n }\n\n return subFieldNodes;\n}\n\nfunction collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n fields,\n visitedFragmentNames,\n) {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(variableValues, selection)) {\n continue;\n }\n\n const name = getFieldEntryKey(selection);\n const fieldList = fields.get(name);\n\n if (fieldList !== undefined) {\n fieldList.push(selection);\n } else {\n fields.set(name, [selection]);\n }\n\n break;\n }\n\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(variableValues, selection) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selection.selectionSet,\n fields,\n visitedFragmentNames,\n );\n break;\n }\n\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n visitedFragmentNames.has(fragName) ||\n !shouldIncludeNode(variableValues, selection)\n ) {\n continue;\n }\n\n visitedFragmentNames.add(fragName);\n const fragment = fragments[fragName];\n\n if (\n !fragment ||\n !doesFragmentConditionMatch(schema, fragment, runtimeType)\n ) {\n continue;\n }\n\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n fragment.selectionSet,\n fields,\n visitedFragmentNames,\n );\n break;\n }\n }\n }\n}\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\n\nfunction shouldIncludeNode(variableValues, node) {\n const skip = getDirectiveValues(GraphQLSkipDirective, node, variableValues);\n\n if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) {\n return false;\n }\n\n const include = getDirectiveValues(\n GraphQLIncludeDirective,\n node,\n variableValues,\n );\n\n if (\n (include === null || include === void 0 ? void 0 : include.if) === false\n ) {\n return false;\n }\n\n return true;\n}\n/**\n * Determines if a fragment is applicable to the given type.\n */\n\nfunction doesFragmentConditionMatch(schema, fragment, type) {\n const typeConditionNode = fragment.typeCondition;\n\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalType = typeFromAST(schema, typeConditionNode);\n\n if (conditionalType === type) {\n return true;\n }\n\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n\n return false;\n}\n/**\n * Implements the logic to compute the key of a given field's entry\n */\n\nfunction getFieldEntryKey(node) {\n return node.alias ? node.alias.value : node.name.value;\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { collectFields } from '../../execution/collectFields.mjs';\n\n/**\n * Subscriptions must only include a non-introspection field.\n *\n * A GraphQL subscription is valid only if it contains a single root field and\n * that root field is not an introspection field.\n *\n * See https://spec.graphql.org/draft/#sec-Single-root-field\n */\nexport function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition(node) {\n if (node.operation === 'subscription') {\n const schema = context.getSchema();\n const subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType) {\n const operationName = node.name ? node.name.value : null;\n const variableValues = Object.create(null);\n const document = context.getDocument();\n const fragments = Object.create(null);\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[definition.name.value] = definition;\n }\n }\n\n const fields = collectFields(\n schema,\n fragments,\n variableValues,\n subscriptionType,\n node.selectionSet,\n );\n\n if (fields.size > 1) {\n const fieldSelectionLists = [...fields.values()];\n const extraFieldSelectionLists = fieldSelectionLists.slice(1);\n const extraFieldSelections = extraFieldSelectionLists.flat();\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must select only one top level field.`\n : 'Anonymous Subscription must select only one top level field.',\n {\n nodes: extraFieldSelections,\n },\n ),\n );\n }\n\n for (const fieldNodes of fields.values()) {\n const field = fieldNodes[0];\n const fieldName = field.name.value;\n\n if (fieldName.startsWith('__')) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not select an introspection top level field.`\n : 'Anonymous Subscription must not select an introspection top level field.',\n {\n nodes: fieldNodes,\n },\n ),\n );\n }\n }\n }\n }\n },\n };\n}\n","/**\n * Groups array items into a Map, given a function to produce grouping key.\n */\nexport function groupBy(list, keyFn) {\n const result = new Map();\n\n for (const item of list) {\n const key = keyFn(item);\n const group = result.get(key);\n\n if (group === undefined) {\n result.set(key, [item]);\n } else {\n group.push(item);\n }\n }\n\n return result;\n}\n","import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique argument definition names\n *\n * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments.\n * A GraphQL Directive is only valid if all its arguments are uniquely named.\n */\nexport function UniqueArgumentDefinitionNamesRule(context) {\n return {\n DirectiveDefinition(directiveNode) {\n var _directiveNode$argume;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argumentNodes =\n (_directiveNode$argume = directiveNode.arguments) !== null &&\n _directiveNode$argume !== void 0\n ? _directiveNode$argume\n : [];\n return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes);\n },\n\n InterfaceTypeDefinition: checkArgUniquenessPerField,\n InterfaceTypeExtension: checkArgUniquenessPerField,\n ObjectTypeDefinition: checkArgUniquenessPerField,\n ObjectTypeExtension: checkArgUniquenessPerField,\n };\n\n function checkArgUniquenessPerField(typeNode) {\n var _typeNode$fields;\n\n const typeName = typeNode.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const fieldNodes =\n (_typeNode$fields = typeNode.fields) !== null &&\n _typeNode$fields !== void 0\n ? _typeNode$fields\n : [];\n\n for (const fieldDef of fieldNodes) {\n var _fieldDef$arguments;\n\n const fieldName = fieldDef.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const argumentNodes =\n (_fieldDef$arguments = fieldDef.arguments) !== null &&\n _fieldDef$arguments !== void 0\n ? _fieldDef$arguments\n : [];\n checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes);\n }\n\n return false;\n }\n\n function checkArgUniqueness(parentName, argumentNodes) {\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `Argument \"${parentName}(${argName}:)\" can only be defined once.`,\n {\n nodes: argNodes.map((node) => node.name),\n },\n ),\n );\n }\n }\n\n return false;\n }\n}\n","import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n */\nexport function UniqueArgumentNamesRule(context) {\n return {\n Field: checkArgUniqueness,\n Directive: checkArgUniqueness,\n };\n\n function checkArgUniqueness(parentNode) {\n var _parentNode$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argumentNodes =\n (_parentNode$arguments = parentNode.arguments) !== null &&\n _parentNode$arguments !== void 0\n ? _parentNode$arguments\n : [];\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one argument named \"${argName}\".`,\n {\n nodes: argNodes.map((node) => node.name),\n },\n ),\n );\n }\n }\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n */\nexport function UniqueDirectiveNamesRule(context) {\n const knownDirectiveNames = Object.create(null);\n const schema = context.getSchema();\n return {\n DirectiveDefinition(node) {\n const directiveName = node.name.value;\n\n if (\n schema !== null &&\n schema !== void 0 &&\n schema.getDirective(directiveName)\n ) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" already exists in the schema. It cannot be redefined.`,\n {\n nodes: node.name,\n },\n ),\n );\n return;\n }\n\n if (knownDirectiveNames[directiveName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one directive named \"@${directiveName}\".`,\n {\n nodes: [knownDirectiveNames[directiveName], node.name],\n },\n ),\n );\n } else {\n knownDirectiveNames[directiveName] = node.name;\n }\n\n return false;\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../../language/predicates.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location\n */\nexport function UniqueDirectivesPerLocationRule(context) {\n const uniqueDirectiveMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n const schemaDirectives = Object.create(null);\n const typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter(node) {\n if (!('directives' in node) || !node.directives) {\n return;\n }\n\n let seenDirectives;\n\n if (\n node.kind === Kind.SCHEMA_DEFINITION ||\n node.kind === Kind.SCHEMA_EXTENSION\n ) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n const typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (const directive of node.directives) {\n const directiveName = directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(\n new GraphQLError(\n `The directive \"@${directiveName}\" can only be used once at this location.`,\n {\n nodes: [seenDirectives[directiveName], directive],\n },\n ),\n );\n } else {\n seenDirectives[directiveName] = directive;\n }\n }\n }\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { isEnumType } from '../../type/definition.mjs';\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n */\nexport function UniqueEnumValueNamesRule(context) {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownValueNames = Object.create(null);\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness,\n };\n\n function checkValueUniqueness(node) {\n var _node$values;\n\n const typeName = node.name.value;\n\n if (!knownValueNames[typeName]) {\n knownValueNames[typeName] = Object.create(null);\n } // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const valueNodes =\n (_node$values = node.values) !== null && _node$values !== void 0\n ? _node$values\n : [];\n const valueNames = knownValueNames[typeName];\n\n for (const valueDef of valueNodes) {\n const valueName = valueDef.name.value;\n const existingType = existingTypeMap[typeName];\n\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n {\n nodes: valueDef.name,\n },\n ),\n );\n } else if (valueNames[valueName]) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" can only be defined once.`,\n {\n nodes: [valueNames[valueName], valueDef.name],\n },\n ),\n );\n } else {\n valueNames[valueName] = valueDef.name;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.mjs';\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n */\nexport function UniqueFieldDefinitionNamesRule(context) {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownFieldNames = Object.create(null);\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness,\n };\n\n function checkFieldUniqueness(node) {\n var _node$fields;\n\n const typeName = node.name.value;\n\n if (!knownFieldNames[typeName]) {\n knownFieldNames[typeName] = Object.create(null);\n } // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const fieldNodes =\n (_node$fields = node.fields) !== null && _node$fields !== void 0\n ? _node$fields\n : [];\n const fieldNames = knownFieldNames[typeName];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n {\n nodes: fieldDef.name,\n },\n ),\n );\n } else if (fieldNames[fieldName]) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" can only be defined once.`,\n {\n nodes: [fieldNames[fieldName], fieldDef.name],\n },\n ),\n );\n } else {\n fieldNames[fieldName] = fieldDef.name;\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n\n return false;\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness\n */\nexport function UniqueFragmentNamesRule(context) {\n const knownFragmentNames = Object.create(null);\n return {\n OperationDefinition: () => false,\n\n FragmentDefinition(node) {\n const fragmentName = node.name.value;\n\n if (knownFragmentNames[fragmentName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one fragment named \"${fragmentName}\".`,\n {\n nodes: [knownFragmentNames[fragmentName], node.name],\n },\n ),\n );\n } else {\n knownFragmentNames[fragmentName] = node.name;\n }\n\n return false;\n },\n };\n}\n","import { invariant } from '../../jsutils/invariant.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness\n */\nexport function UniqueInputFieldNamesRule(context) {\n const knownNameStack = [];\n let knownNames = Object.create(null);\n return {\n ObjectValue: {\n enter() {\n knownNameStack.push(knownNames);\n knownNames = Object.create(null);\n },\n\n leave() {\n const prevKnownNames = knownNameStack.pop();\n prevKnownNames || invariant(false);\n knownNames = prevKnownNames;\n },\n },\n\n ObjectField(node) {\n const fieldName = node.name.value;\n\n if (knownNames[fieldName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one input field named \"${fieldName}\".`,\n {\n nodes: [knownNames[fieldName], node.name],\n },\n ),\n );\n } else {\n knownNames[fieldName] = node.name;\n }\n },\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness\n */\nexport function UniqueOperationNamesRule(context) {\n const knownOperationNames = Object.create(null);\n return {\n OperationDefinition(node) {\n const operationName = node.name;\n\n if (operationName) {\n if (knownOperationNames[operationName.value]) {\n context.reportError(\n new GraphQLError(\n `There can be only one operation named \"${operationName.value}\".`,\n {\n nodes: [\n knownOperationNames[operationName.value],\n operationName,\n ],\n },\n ),\n );\n } else {\n knownOperationNames[operationName.value] = operationName;\n }\n }\n\n return false;\n },\n\n FragmentDefinition: () => false,\n };\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n */\nexport function UniqueOperationTypesRule(context) {\n const schema = context.getSchema();\n const definedOperationTypes = Object.create(null);\n const existingOperationTypes = schema\n ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType(),\n }\n : {};\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes,\n };\n\n function checkOperationTypes(node) {\n var _node$operationTypes;\n\n // See: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const operationTypesNodes =\n (_node$operationTypes = node.operationTypes) !== null &&\n _node$operationTypes !== void 0\n ? _node$operationTypes\n : [];\n\n for (const operationType of operationTypesNodes) {\n const operation = operationType.operation;\n const alreadyDefinedOperationType = definedOperationTypes[operation];\n\n if (existingOperationTypes[operation]) {\n context.reportError(\n new GraphQLError(\n `Type for ${operation} already defined in the schema. It cannot be redefined.`,\n {\n nodes: operationType,\n },\n ),\n );\n } else if (alreadyDefinedOperationType) {\n context.reportError(\n new GraphQLError(\n `There can be only one ${operation} type in schema.`,\n {\n nodes: [alreadyDefinedOperationType, operationType],\n },\n ),\n );\n } else {\n definedOperationTypes[operation] = operationType;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n */\nexport function UniqueTypeNamesRule(context) {\n const knownTypeNames = Object.create(null);\n const schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName,\n };\n\n function checkTypeName(node) {\n const typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(\n new GraphQLError(\n `Type \"${typeName}\" already exists in the schema. It cannot also be defined in this type definition.`,\n {\n nodes: node.name,\n },\n ),\n );\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(\n new GraphQLError(`There can be only one type named \"${typeName}\".`, {\n nodes: [knownTypeNames[typeName], node.name],\n }),\n );\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}\n","import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n */\nexport function UniqueVariableNamesRule(context) {\n return {\n OperationDefinition(operationNode) {\n var _operationNode$variab;\n\n // See: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const variableDefinitions =\n (_operationNode$variab = operationNode.variableDefinitions) !== null &&\n _operationNode$variab !== void 0\n ? _operationNode$variab\n : [];\n const seenVariableDefinitions = groupBy(\n variableDefinitions,\n (node) => node.variable.name.value,\n );\n\n for (const [variableName, variableNodes] of seenVariableDefinitions) {\n if (variableNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one variable named \"$${variableName}\".`,\n {\n nodes: variableNodes.map((node) => node.variable.name),\n },\n ),\n );\n }\n }\n },\n };\n}\n","import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { inspect } from '../../jsutils/inspect.mjs';\nimport { keyMap } from '../../jsutils/keyMap.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport {\n getNamedType,\n getNullableType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../../type/definition.mjs';\n\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n *\n * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type\n */\nexport function ValuesOfCorrectTypeRule(context) {\n let variableDefinitions = {};\n return {\n OperationDefinition: {\n enter() {\n variableDefinitions = {};\n },\n },\n\n VariableDefinition(definition) {\n variableDefinitions[definition.variable.name.value] = definition;\n },\n\n ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n const type = getNullableType(context.getParentInputType());\n\n if (!isListType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n\n ObjectValue(node) {\n const type = getNamedType(context.getInputType());\n\n if (!isInputObjectType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n const fieldNodeMap = keyMap(node.fields, (field) => field.name.value);\n\n for (const fieldDef of Object.values(type.getFields())) {\n const fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && isRequiredInputField(fieldDef)) {\n const typeStr = inspect(fieldDef.type);\n context.reportError(\n new GraphQLError(\n `Field \"${type.name}.${fieldDef.name}\" of required type \"${typeStr}\" was not provided.`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n\n if (type.isOneOf) {\n validateOneOfInputObject(\n context,\n node,\n type,\n fieldNodeMap,\n variableDefinitions,\n );\n }\n },\n\n ObjectField(node) {\n const parentType = getNamedType(context.getParentInputType());\n const fieldType = context.getInputType();\n\n if (!fieldType && isInputObjectType(parentType)) {\n const suggestions = suggestionList(\n node.name.value,\n Object.keys(parentType.getFields()),\n );\n context.reportError(\n new GraphQLError(\n `Field \"${node.name.value}\" is not defined by type \"${parentType.name}\".` +\n didYouMean(suggestions),\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n NullValue(node) {\n const type = context.getInputType();\n\n if (isNonNullType(type)) {\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${inspect(type)}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n EnumValue: (node) => isValidValueNode(context, node),\n IntValue: (node) => isValidValueNode(context, node),\n FloatValue: (node) => isValidValueNode(context, node),\n StringValue: (node) => isValidValueNode(context, node),\n BooleanValue: (node) => isValidValueNode(context, node),\n };\n}\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n */\n\nfunction isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n const locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n const type = getNamedType(locationType);\n\n if (!isLeafType(type)) {\n const typeStr = inspect(locationType);\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n try {\n const parseResult = type.parseLiteral(\n node,\n undefined,\n /* variables */\n );\n\n if (parseResult === undefined) {\n const typeStr = inspect(locationType);\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n } catch (error) {\n const typeStr = inspect(locationType);\n\n if (error instanceof GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}; ` +\n error.message,\n {\n nodes: node,\n originalError: error,\n },\n ),\n );\n }\n }\n}\n\nfunction validateOneOfInputObject(\n context,\n node,\n type,\n fieldNodeMap,\n variableDefinitions,\n) {\n var _fieldNodeMap$keys$;\n\n const keys = Object.keys(fieldNodeMap);\n const isNotExactlyOneField = keys.length !== 1;\n\n if (isNotExactlyOneField) {\n context.reportError(\n new GraphQLError(\n `OneOf Input Object \"${type.name}\" must specify exactly one key.`,\n {\n nodes: [node],\n },\n ),\n );\n return;\n }\n\n const value =\n (_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null ||\n _fieldNodeMap$keys$ === void 0\n ? void 0\n : _fieldNodeMap$keys$.value;\n const isNullLiteral = !value || value.kind === Kind.NULL;\n const isVariable =\n (value === null || value === void 0 ? void 0 : value.kind) ===\n Kind.VARIABLE;\n\n if (isNullLiteral) {\n context.reportError(\n new GraphQLError(`Field \"${type.name}.${keys[0]}\" must be non-null.`, {\n nodes: [node],\n }),\n );\n return;\n }\n\n if (isVariable) {\n const variableName = value.name.value;\n const definition = variableDefinitions[variableName];\n const isNullableVariable = definition.type.kind !== Kind.NON_NULL_TYPE;\n\n if (isNullableVariable) {\n context.reportError(\n new GraphQLError(\n `Variable \"${variableName}\" must be non-nullable to be used for OneOf Input Object \"${type.name}\".`,\n {\n nodes: [node],\n },\n ),\n );\n }\n }\n}\n","import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isInputType } from '../../type/definition.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n *\n * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types\n */\nexport function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.type);\n\n if (type !== undefined && !isInputType(type)) {\n const variableName = node.variable.name.value;\n const typeName = print(node.type);\n context.reportError(\n new GraphQLError(\n `Variable \"$${variableName}\" cannot be non-input type \"${typeName}\".`,\n {\n nodes: node.type,\n },\n ),\n );\n }\n },\n };\n}\n","import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport {\n isInputObjectType,\n isNonNullType,\n isNullableType,\n} from '../../type/definition.mjs';\nimport { isTypeSubTypeOf } from '../../utilities/typeComparators.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Variables in allowed position\n *\n * Variable usages must be compatible with the arguments they are passed to.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed\n */\nexport function VariablesInAllowedPositionRule(context) {\n let varDefMap = Object.create(null);\n return {\n OperationDefinition: {\n enter() {\n varDefMap = Object.create(null);\n },\n\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node, type, defaultValue, parentType } of usages) {\n const varName = node.name.value;\n const varDef = varDefMap[varName];\n\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n const schema = context.getSchema();\n const varType = typeFromAST(schema, varDef.type);\n\n if (\n varType &&\n !allowedVariableUsage(\n schema,\n varType,\n varDef.defaultValue,\n type,\n defaultValue,\n )\n ) {\n const varTypeStr = inspect(varType);\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" of type \"${varTypeStr}\" used in position expecting type \"${typeStr}\".`,\n {\n nodes: [varDef, node],\n },\n ),\n );\n }\n\n if (\n isInputObjectType(parentType) &&\n parentType.isOneOf &&\n isNullableType(varType)\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" is of type \"${varType}\" but must be non-nullable to be used for OneOf Input Object \"${parentType}\".`,\n {\n nodes: [varDef, node],\n },\n ),\n );\n }\n }\n }\n },\n },\n\n VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n },\n };\n}\n/**\n * Returns true if the variable is allowed in the location it was found,\n * which includes considering if default values exist for either the variable\n * or the location at which it is located.\n */\n\nfunction allowedVariableUsage(\n schema,\n varType,\n varDefaultValue,\n locationType,\n locationDefaultValue,\n) {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n const hasNonNullVariableDefaultValue =\n varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;\n const hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n const nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n\n return isTypeSubTypeOf(schema, varType, locationType);\n}\n","// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.mjs'; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nimport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.mjs'; // Spec Section: \"Fragments on Composite Types\"\n\nimport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.mjs'; // Spec Section: \"Argument Names\"\n\nimport {\n KnownArgumentNamesOnDirectivesRule,\n KnownArgumentNamesRule,\n} from './rules/KnownArgumentNamesRule.mjs'; // Spec Section: \"Directives Are Defined\"\n\nimport { KnownDirectivesRule } from './rules/KnownDirectivesRule.mjs'; // Spec Section: \"Fragment spread target defined\"\n\nimport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.mjs'; // Spec Section: \"Fragment Spread Type Existence\"\n\nimport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.mjs'; // Spec Section: \"Lone Anonymous Operation\"\n\nimport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.mjs'; // SDL-specific validation rules\n\nimport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.mjs'; // TODO: Spec Section\n\nimport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.mjs'; // Spec Section: \"Fragments must not form cycles\"\n\nimport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.mjs'; // Spec Section: \"All Variable Used Defined\"\n\nimport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.mjs'; // Spec Section: \"Fragments must be used\"\n\nimport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.mjs'; // Spec Section: \"All Variables Used\"\n\nimport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.mjs'; // Spec Section: \"Field Selection Merging\"\n\nimport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.mjs'; // Spec Section: \"Fragment spread is possible\"\n\nimport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.mjs';\nimport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.mjs'; // Spec Section: \"Argument Optionality\"\n\nimport {\n ProvidedRequiredArgumentsOnDirectivesRule,\n ProvidedRequiredArgumentsRule,\n} from './rules/ProvidedRequiredArgumentsRule.mjs'; // Spec Section: \"Leaf Field Selections\"\n\nimport { ScalarLeafsRule } from './rules/ScalarLeafsRule.mjs'; // Spec Section: \"Subscriptions with Single Root Field\"\n\nimport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.mjs';\nimport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.mjs'; // Spec Section: \"Argument Uniqueness\"\n\nimport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.mjs';\nimport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.mjs'; // Spec Section: \"Directives Are Unique Per Location\"\n\nimport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.mjs';\nimport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.mjs';\nimport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.mjs'; // Spec Section: \"Fragment Name Uniqueness\"\n\nimport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.mjs'; // Spec Section: \"Input Object Field Uniqueness\"\n\nimport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.mjs'; // Spec Section: \"Operation Name Uniqueness\"\n\nimport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.mjs';\nimport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.mjs';\nimport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.mjs'; // Spec Section: \"Variable Uniqueness\"\n\nimport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.mjs'; // Spec Section: \"Value Type Correctness\"\n\nimport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.mjs'; // Spec Section: \"Variables are Input Types\"\n\nimport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.mjs'; // Spec Section: \"All Variable Usages Are Allowed\"\n\nimport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.mjs';\n\n/**\n * Technically these aren't part of the spec but they are strongly encouraged\n * validation rules.\n */\nexport const recommendedRules = Object.freeze([MaxIntrospectionDepthRule]);\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\n\nexport const specifiedRules = Object.freeze([\n ExecutableDefinitionsRule,\n UniqueOperationNamesRule,\n LoneAnonymousOperationRule,\n SingleFieldSubscriptionsRule,\n KnownTypeNamesRule,\n FragmentsOnCompositeTypesRule,\n VariablesAreInputTypesRule,\n ScalarLeafsRule,\n FieldsOnCorrectTypeRule,\n UniqueFragmentNamesRule,\n KnownFragmentNamesRule,\n NoUnusedFragmentsRule,\n PossibleFragmentSpreadsRule,\n NoFragmentCyclesRule,\n UniqueVariableNamesRule,\n NoUndefinedVariablesRule,\n NoUnusedVariablesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n KnownArgumentNamesRule,\n UniqueArgumentNamesRule,\n ValuesOfCorrectTypeRule,\n ProvidedRequiredArgumentsRule,\n VariablesInAllowedPositionRule,\n OverlappingFieldsCanBeMergedRule,\n UniqueInputFieldNamesRule,\n ...recommendedRules,\n]);\n/**\n * @internal\n */\n\nexport const specifiedSDLRules = Object.freeze([\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n KnownTypeNamesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n PossibleTypeExtensionsRule,\n KnownArgumentNamesOnDirectivesRule,\n UniqueArgumentNamesRule,\n UniqueInputFieldNamesRule,\n ProvidedRequiredArgumentsOnDirectivesRule,\n]);\n","import { Kind } from '../language/kinds.mjs';\nimport { visit } from '../language/visitor.mjs';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n */\nexport class ASTValidationContext {\n constructor(ast, onError) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n get [Symbol.toStringTag]() {\n return 'ASTValidationContext';\n }\n\n reportError(error) {\n this._onError(error);\n }\n\n getDocument() {\n return this._ast;\n }\n\n getFragment(name) {\n let fragments;\n\n if (this._fragments) {\n fragments = this._fragments;\n } else {\n fragments = Object.create(null);\n\n for (const defNode of this.getDocument().definitions) {\n if (defNode.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[defNode.name.value] = defNode;\n }\n }\n\n this._fragments = fragments;\n }\n\n return fragments[name];\n }\n\n getFragmentSpreads(node) {\n let spreads = this._fragmentSpreads.get(node);\n\n if (!spreads) {\n spreads = [];\n const setsToVisit = [node];\n let set;\n\n while ((set = setsToVisit.pop())) {\n for (const selection of set.selections) {\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n\n this._fragmentSpreads.set(node, spreads);\n }\n\n return spreads;\n }\n\n getRecursivelyReferencedFragments(operation) {\n let fragments = this._recursivelyReferencedFragments.get(operation);\n\n if (!fragments) {\n fragments = [];\n const collectedNames = Object.create(null);\n const nodesToVisit = [operation.selectionSet];\n let node;\n\n while ((node = nodesToVisit.pop())) {\n for (const spread of this.getFragmentSpreads(node)) {\n const fragName = spread.name.value;\n\n if (collectedNames[fragName] !== true) {\n collectedNames[fragName] = true;\n const fragment = this.getFragment(fragName);\n\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n\n return fragments;\n }\n}\nexport class SDLValidationContext extends ASTValidationContext {\n constructor(ast, schema, onError) {\n super(ast, onError);\n this._schema = schema;\n }\n\n get [Symbol.toStringTag]() {\n return 'SDLValidationContext';\n }\n\n getSchema() {\n return this._schema;\n }\n}\nexport class ValidationContext extends ASTValidationContext {\n constructor(schema, ast, typeInfo, onError) {\n super(ast, onError);\n this._schema = schema;\n this._typeInfo = typeInfo;\n this._variableUsages = new Map();\n this._recursiveVariableUsages = new Map();\n }\n\n get [Symbol.toStringTag]() {\n return 'ValidationContext';\n }\n\n getSchema() {\n return this._schema;\n }\n\n getVariableUsages(node) {\n let usages = this._variableUsages.get(node);\n\n if (!usages) {\n const newUsages = [];\n const typeInfo = new TypeInfo(this._schema);\n visit(\n node,\n visitWithTypeInfo(typeInfo, {\n VariableDefinition: () => false,\n\n Variable(variable) {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n defaultValue: typeInfo.getDefaultValue(),\n parentType: typeInfo.getParentInputType(),\n });\n },\n }),\n );\n usages = newUsages;\n\n this._variableUsages.set(node, usages);\n }\n\n return usages;\n }\n\n getRecursiveVariableUsages(operation) {\n let usages = this._recursiveVariableUsages.get(operation);\n\n if (!usages) {\n usages = this.getVariableUsages(operation);\n\n for (const frag of this.getRecursivelyReferencedFragments(operation)) {\n usages = usages.concat(this.getVariableUsages(frag));\n }\n\n this._recursiveVariableUsages.set(operation, usages);\n }\n\n return usages;\n }\n\n getType() {\n return this._typeInfo.getType();\n }\n\n getParentType() {\n return this._typeInfo.getParentType();\n }\n\n getInputType() {\n return this._typeInfo.getInputType();\n }\n\n getParentInputType() {\n return this._typeInfo.getParentInputType();\n }\n\n getFieldDef() {\n return this._typeInfo.getFieldDef();\n }\n\n getDirective() {\n return this._typeInfo.getDirective();\n }\n\n getArgument() {\n return this._typeInfo.getArgument();\n }\n\n getEnumValue() {\n return this._typeInfo.getEnumValue();\n }\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { visit, visitInParallel } from '../language/visitor.mjs';\nimport { assertValidSchema } from '../type/validate.mjs';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';\nimport { specifiedRules, specifiedSDLRules } from './specifiedRules.mjs';\nimport {\n SDLValidationContext,\n ValidationContext,\n} from './ValidationContext.mjs';\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rules is a function which returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Validate will stop validation after a `maxErrors` limit has been reached.\n * Attackers can send pathologically invalid queries to induce a DoS attack,\n * so by default `maxErrors` set to 100 errors.\n *\n * Optionally a custom TypeInfo instance may be provided. If not provided, one\n * will be created from the provided schema.\n */\n\nexport function validate(\n schema,\n documentAST,\n rules = specifiedRules,\n options,\n /** @deprecated will be removed in 17.0.0 */\n typeInfo = new TypeInfo(schema),\n) {\n var _options$maxErrors;\n\n const maxErrors =\n (_options$maxErrors =\n options === null || options === void 0 ? void 0 : options.maxErrors) !==\n null && _options$maxErrors !== void 0\n ? _options$maxErrors\n : 100;\n documentAST || devAssert(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.\n\n assertValidSchema(schema);\n const abortObj = Object.freeze({});\n const errors = [];\n const context = new ValidationContext(\n schema,\n documentAST,\n typeInfo,\n (error) => {\n if (errors.length >= maxErrors) {\n errors.push(\n new GraphQLError(\n 'Too many validation errors, error limit reached. Validation aborted.',\n ),\n ); // eslint-disable-next-line @typescript-eslint/no-throw-literal\n\n throw abortObj;\n }\n\n errors.push(error);\n },\n ); // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n\n const visitor = visitInParallel(rules.map((rule) => rule(context))); // Visit the whole document with each instance of all provided rules.\n\n try {\n visit(documentAST, visitWithTypeInfo(typeInfo, visitor));\n } catch (e) {\n if (e !== abortObj) {\n throw e;\n }\n }\n\n return errors;\n}\n/**\n * @internal\n */\n\nexport function validateSDL(\n documentAST,\n schemaToExtend,\n rules = specifiedSDLRules,\n) {\n const errors = [];\n const context = new SDLValidationContext(\n documentAST,\n schemaToExtend,\n (error) => {\n errors.push(error);\n },\n );\n const visitors = rules.map((rule) => rule(context));\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDL(documentAST) {\n const errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDLExtension(documentAST, schema) {\n const errors = validateSDL(documentAST, schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { mapValue } from '../jsutils/mapValue.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../language/predicates.mjs';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.mjs';\nimport {\n GraphQLDeprecatedDirective,\n GraphQLDirective,\n GraphQLOneOfDirective,\n GraphQLSpecifiedByDirective,\n} from '../type/directives.mjs';\nimport {\n introspectionTypes,\n isIntrospectionType,\n} from '../type/introspection.mjs';\nimport {\n isSpecifiedScalarType,\n specifiedScalarTypes,\n} from '../type/scalars.mjs';\nimport { assertSchema, GraphQLSchema } from '../type/schema.mjs';\nimport { assertValidSDLExtension } from '../validation/validate.mjs';\nimport { getDirectiveValues } from '../execution/values.mjs';\nimport { valueFromAST } from './valueFromAST.mjs';\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n */\nexport function extendSchema(schema, documentAST, options) {\n assertSchema(schema);\n (documentAST != null && documentAST.kind === Kind.DOCUMENT) ||\n devAssert(false, 'Must provide valid Document AST.');\n\n if (\n (options === null || options === void 0 ? void 0 : options.assumeValid) !==\n true &&\n (options === null || options === void 0\n ? void 0\n : options.assumeValidSDL) !== true\n ) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n const schemaConfig = schema.toConfig();\n const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig\n ? schema\n : new GraphQLSchema(extendedConfig);\n}\n/**\n * @internal\n */\n\nexport function extendSchemaImpl(schemaConfig, documentAST, options) {\n var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid;\n\n // Collect the type definitions and extensions found in the document.\n const typeDefs = [];\n const typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n const directiveDefs = [];\n let schemaDef; // Schema extensions are collected which may add additional operation types.\n\n const schemaExtensions = [];\n\n for (const def of documentAST.definitions) {\n if (def.kind === Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if (isTypeDefinitionNode(def)) {\n typeDefs.push(def);\n } else if (isTypeExtensionNode(def)) {\n const extendedTypeName = def.name.value;\n const existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions\n ? existingTypeExtensions.concat([def])\n : [def];\n } else if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n if (\n Object.keys(typeExtensionsMap).length === 0 &&\n typeDefs.length === 0 &&\n directiveDefs.length === 0 &&\n schemaExtensions.length === 0 &&\n schemaDef == null\n ) {\n return schemaConfig;\n }\n\n const typeMap = Object.create(null);\n\n for (const existingType of schemaConfig.types) {\n typeMap[existingType.name] = extendNamedType(existingType);\n }\n\n for (const typeNode of typeDefs) {\n var _stdTypeMap$name;\n\n const name = typeNode.name.value;\n typeMap[name] =\n (_stdTypeMap$name = stdTypeMap[name]) !== null &&\n _stdTypeMap$name !== void 0\n ? _stdTypeMap$name\n : buildType(typeNode);\n }\n\n const operationTypes = {\n // Get the extended root operation types.\n query: schemaConfig.query && replaceNamedType(schemaConfig.query),\n mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation),\n subscription:\n schemaConfig.subscription && replaceNamedType(schemaConfig.subscription),\n // Then, incorporate schema definition and all schema extensions.\n ...(schemaDef && getOperationTypes([schemaDef])),\n ...getOperationTypes(schemaExtensions),\n }; // Then produce and return a Schema config with these types.\n\n return {\n description:\n (_schemaDef = schemaDef) === null || _schemaDef === void 0\n ? void 0\n : (_schemaDef$descriptio = _schemaDef.description) === null ||\n _schemaDef$descriptio === void 0\n ? void 0\n : _schemaDef$descriptio.value,\n ...operationTypes,\n types: Object.values(typeMap),\n directives: [\n ...schemaConfig.directives.map(replaceDirective),\n ...directiveDefs.map(buildDirective),\n ],\n extensions: Object.create(null),\n astNode:\n (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0\n ? _schemaDef2\n : schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),\n assumeValid:\n (_options$assumeValid =\n options === null || options === void 0\n ? void 0\n : options.assumeValid) !== null && _options$assumeValid !== void 0\n ? _options$assumeValid\n : false,\n }; // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (isListType(type)) {\n // @ts-expect-error\n return new GraphQLList(replaceType(type.ofType));\n }\n\n if (isNonNullType(type)) {\n // @ts-expect-error\n return new GraphQLNonNull(replaceType(type.ofType));\n } // @ts-expect-error FIXME\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n return typeMap[type.name];\n }\n\n function replaceDirective(directive) {\n const config = directive.toConfig();\n return new GraphQLDirective({\n ...config,\n args: mapValue(config.args, extendArg),\n });\n }\n\n function extendNamedType(type) {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n if (isScalarType(type)) {\n return extendScalarType(type);\n }\n\n if (isObjectType(type)) {\n return extendObjectType(type);\n }\n\n if (isInterfaceType(type)) {\n return extendInterfaceType(type);\n }\n\n if (isUnionType(type)) {\n return extendUnionType(type);\n }\n\n if (isEnumType(type)) {\n return extendEnumType(type);\n }\n\n if (isInputObjectType(type)) {\n return extendInputObjectType(type);\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible type definition nodes have been considered.\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n }\n\n function extendInputObjectType(type) {\n var _typeExtensionsMap$co;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co !== void 0\n ? _typeExtensionsMap$co\n : [];\n return new GraphQLInputObjectType({\n ...config,\n fields: () => ({\n ...mapValue(config.fields, (field) => ({\n ...field,\n type: replaceType(field.type),\n })),\n ...buildInputFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendEnumType(type) {\n var _typeExtensionsMap$ty;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null &&\n _typeExtensionsMap$ty !== void 0\n ? _typeExtensionsMap$ty\n : [];\n return new GraphQLEnumType({\n ...config,\n values: { ...config.values, ...buildEnumValueMap(extensions) },\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendScalarType(type) {\n var _typeExtensionsMap$co2;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co2 !== void 0\n ? _typeExtensionsMap$co2\n : [];\n let specifiedByURL = config.specifiedByURL;\n\n for (const extensionNode of extensions) {\n var _getSpecifiedByURL;\n\n specifiedByURL =\n (_getSpecifiedByURL = getSpecifiedByURL(extensionNode)) !== null &&\n _getSpecifiedByURL !== void 0\n ? _getSpecifiedByURL\n : specifiedByURL;\n }\n\n return new GraphQLScalarType({\n ...config,\n specifiedByURL,\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendObjectType(type) {\n var _typeExtensionsMap$co3;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co3 !== void 0\n ? _typeExtensionsMap$co3\n : [];\n return new GraphQLObjectType({\n ...config,\n interfaces: () => [\n ...type.getInterfaces().map(replaceNamedType),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...mapValue(config.fields, extendField),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendInterfaceType(type) {\n var _typeExtensionsMap$co4;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co4 !== void 0\n ? _typeExtensionsMap$co4\n : [];\n return new GraphQLInterfaceType({\n ...config,\n interfaces: () => [\n ...type.getInterfaces().map(replaceNamedType),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...mapValue(config.fields, extendField),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendUnionType(type) {\n var _typeExtensionsMap$co5;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co5 !== void 0\n ? _typeExtensionsMap$co5\n : [];\n return new GraphQLUnionType({\n ...config,\n types: () => [\n ...type.getTypes().map(replaceNamedType),\n ...buildUnionTypes(extensions),\n ],\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendField(field) {\n return {\n ...field,\n type: replaceType(field.type),\n args: field.args && mapValue(field.args, extendArg),\n };\n }\n\n function extendArg(arg) {\n return { ...arg, type: replaceType(arg.type) };\n }\n\n function getOperationTypes(nodes) {\n const opTypes = {};\n\n for (const node of nodes) {\n var _node$operationTypes;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const operationTypesNodes =\n /* c8 ignore next */\n (_node$operationTypes = node.operationTypes) !== null &&\n _node$operationTypes !== void 0\n ? _node$operationTypes\n : [];\n\n for (const operationType of operationTypesNodes) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n opTypes[operationType.operation] = getNamedType(operationType.type);\n }\n }\n\n return opTypes;\n }\n\n function getNamedType(node) {\n var _stdTypeMap$name2;\n\n const name = node.name.value;\n const type =\n (_stdTypeMap$name2 = stdTypeMap[name]) !== null &&\n _stdTypeMap$name2 !== void 0\n ? _stdTypeMap$name2\n : typeMap[name];\n\n if (type === undefined) {\n throw new Error(`Unknown type: \"${name}\".`);\n }\n\n return type;\n }\n\n function getWrappedType(node) {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(getWrappedType(node.type));\n }\n\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(getWrappedType(node.type));\n }\n\n return getNamedType(node);\n }\n\n function buildDirective(node) {\n var _node$description;\n\n return new GraphQLDirective({\n name: node.name.value,\n description:\n (_node$description = node.description) === null ||\n _node$description === void 0\n ? void 0\n : _node$description.value,\n // @ts-expect-error\n locations: node.locations.map(({ value }) => value),\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n astNode: node,\n });\n }\n\n function buildFieldMap(nodes) {\n const fieldConfigMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$fields;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const nodeFields =\n /* c8 ignore next */\n (_node$fields = node.fields) !== null && _node$fields !== void 0\n ? _node$fields\n : [];\n\n for (const field of nodeFields) {\n var _field$description;\n\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: getWrappedType(field.type),\n description:\n (_field$description = field.description) === null ||\n _field$description === void 0\n ? void 0\n : _field$description.value,\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n\n return fieldConfigMap;\n }\n\n function buildArgumentMap(args) {\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const argsNodes =\n /* c8 ignore next */\n args !== null && args !== void 0 ? args : [];\n const argConfigMap = Object.create(null);\n\n for (const arg of argsNodes) {\n var _arg$description;\n\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type = getWrappedType(arg.type);\n argConfigMap[arg.name.value] = {\n type,\n description:\n (_arg$description = arg.description) === null ||\n _arg$description === void 0\n ? void 0\n : _arg$description.value,\n defaultValue: valueFromAST(arg.defaultValue, type),\n deprecationReason: getDeprecationReason(arg),\n astNode: arg,\n };\n }\n\n return argConfigMap;\n }\n\n function buildInputFieldMap(nodes) {\n const inputFieldMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$fields2;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const fieldsNodes =\n /* c8 ignore next */\n (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0\n ? _node$fields2\n : [];\n\n for (const field of fieldsNodes) {\n var _field$description2;\n\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type = getWrappedType(field.type);\n inputFieldMap[field.name.value] = {\n type,\n description:\n (_field$description2 = field.description) === null ||\n _field$description2 === void 0\n ? void 0\n : _field$description2.value,\n defaultValue: valueFromAST(field.defaultValue, type),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n\n return inputFieldMap;\n }\n\n function buildEnumValueMap(nodes) {\n const enumValueMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$values;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const valuesNodes =\n /* c8 ignore next */\n (_node$values = node.values) !== null && _node$values !== void 0\n ? _node$values\n : [];\n\n for (const value of valuesNodes) {\n var _value$description;\n\n enumValueMap[value.name.value] = {\n description:\n (_value$description = value.description) === null ||\n _value$description === void 0\n ? void 0\n : _value$description.value,\n deprecationReason: getDeprecationReason(value),\n astNode: value,\n };\n }\n }\n\n return enumValueMap;\n }\n\n function buildInterfaces(nodes) {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n (node) => {\n var _node$interfaces$map, _node$interfaces;\n\n return (\n /* c8 ignore next */\n (_node$interfaces$map =\n (_node$interfaces = node.interfaces) === null ||\n _node$interfaces === void 0\n ? void 0\n : _node$interfaces.map(getNamedType)) !== null &&\n _node$interfaces$map !== void 0\n ? _node$interfaces$map\n : []\n );\n },\n );\n }\n\n function buildUnionTypes(nodes) {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n (node) => {\n var _node$types$map, _node$types;\n\n return (\n /* c8 ignore next */\n (_node$types$map =\n (_node$types = node.types) === null || _node$types === void 0\n ? void 0\n : _node$types.map(getNamedType)) !== null &&\n _node$types$map !== void 0\n ? _node$types$map\n : []\n );\n },\n );\n }\n\n function buildType(astNode) {\n var _typeExtensionsMap$na;\n\n const name = astNode.name.value;\n const extensionASTNodes =\n (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null &&\n _typeExtensionsMap$na !== void 0\n ? _typeExtensionsMap$na\n : [];\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION: {\n var _astNode$description;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLObjectType({\n name,\n description:\n (_astNode$description = astNode.description) === null ||\n _astNode$description === void 0\n ? void 0\n : _astNode$description.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.INTERFACE_TYPE_DEFINITION: {\n var _astNode$description2;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLInterfaceType({\n name,\n description:\n (_astNode$description2 = astNode.description) === null ||\n _astNode$description2 === void 0\n ? void 0\n : _astNode$description2.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.ENUM_TYPE_DEFINITION: {\n var _astNode$description3;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLEnumType({\n name,\n description:\n (_astNode$description3 = astNode.description) === null ||\n _astNode$description3 === void 0\n ? void 0\n : _astNode$description3.value,\n values: buildEnumValueMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.UNION_TYPE_DEFINITION: {\n var _astNode$description4;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLUnionType({\n name,\n description:\n (_astNode$description4 = astNode.description) === null ||\n _astNode$description4 === void 0\n ? void 0\n : _astNode$description4.value,\n types: () => buildUnionTypes(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.SCALAR_TYPE_DEFINITION: {\n var _astNode$description5;\n\n return new GraphQLScalarType({\n name,\n description:\n (_astNode$description5 = astNode.description) === null ||\n _astNode$description5 === void 0\n ? void 0\n : _astNode$description5.value,\n specifiedByURL: getSpecifiedByURL(astNode),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n var _astNode$description6;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLInputObjectType({\n name,\n description:\n (_astNode$description6 = astNode.description) === null ||\n _astNode$description6 === void 0\n ? void 0\n : _astNode$description6.value,\n fields: () => buildInputFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n isOneOf: isOneOf(astNode),\n });\n }\n }\n }\n}\nconst stdTypeMap = keyMap(\n [...specifiedScalarTypes, ...introspectionTypes],\n (type) => type.name,\n);\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n */\n\nfunction getDeprecationReason(node) {\n const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); // @ts-expect-error validated by `getDirectiveValues`\n\n return deprecated === null || deprecated === void 0\n ? void 0\n : deprecated.reason;\n}\n/**\n * Given a scalar node, returns the string value for the specifiedByURL.\n */\n\nfunction getSpecifiedByURL(node) {\n const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); // @ts-expect-error validated by `getDirectiveValues`\n\n return specifiedBy === null || specifiedBy === void 0\n ? void 0\n : specifiedBy.url;\n}\n/**\n * Given an input object node, returns if the node should be OneOf.\n */\n\nfunction isOneOf(node) {\n return Boolean(getDirectiveValues(GraphQLOneOfDirective, node));\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { parse } from '../language/parser.mjs';\nimport { specifiedDirectives } from '../type/directives.mjs';\nimport { GraphQLSchema } from '../type/schema.mjs';\nimport { assertValidSDL } from '../validation/validate.mjs';\nimport { extendSchemaImpl } from './extendSchema.mjs';\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * src/language/parser.js.\n *\n * If no schema definition is provided, then it will look for types named Query,\n * Mutation and Subscription.\n *\n * Given that AST it constructs a GraphQLSchema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n */\nexport function buildASTSchema(documentAST, options) {\n (documentAST != null && documentAST.kind === Kind.DOCUMENT) ||\n devAssert(false, 'Must provide valid Document AST.');\n\n if (\n (options === null || options === void 0 ? void 0 : options.assumeValid) !==\n true &&\n (options === null || options === void 0\n ? void 0\n : options.assumeValidSDL) !== true\n ) {\n assertValidSDL(documentAST);\n }\n\n const emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: Object.create(null),\n extensionASTNodes: [],\n assumeValid: false,\n };\n const config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (const type of config.types) {\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n // @ts-expect-error validated in `validateSchema`\n config.query = type;\n break;\n\n case 'Mutation':\n // @ts-expect-error validated in `validateSchema`\n config.mutation = type;\n break;\n\n case 'Subscription':\n // @ts-expect-error validated in `validateSchema`\n config.subscription = type;\n break;\n }\n }\n }\n\n const directives = [\n ...config.directives, // If specified directives were not explicitly declared, add them.\n ...specifiedDirectives.filter((stdDirective) =>\n config.directives.every(\n (directive) => directive.name !== stdDirective.name,\n ),\n ),\n ];\n return new GraphQLSchema({ ...config, directives });\n}\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n */\n\nexport function buildSchema(source, options) {\n const document = parse(source, {\n noLocation:\n options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacyFragmentVariables:\n options === null || options === void 0\n ? void 0\n : options.allowLegacyFragmentVariables,\n });\n return buildASTSchema(document, {\n assumeValidSDL:\n options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid:\n options === null || options === void 0 ? void 0 : options.assumeValid,\n });\n}\n","import { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport {\n GraphQLSchema,\n isNonNullType,\n isListType,\n isScalarType,\n isObjectType,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isInputObjectType,\n GraphQLType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLInputObjectType,\n GraphQLField,\n GraphQLInputField,\n GraphQLUnionType,\n GraphQLEnumType,\n} from 'graphql';\n\n// Metadata types for different GraphQL type categories\nexport type BaseGraphQLTypeMetadata = {\n typename: string;\n};\n\nexport type IdentifiableGraphQLTypeMetadata = BaseGraphQLTypeMetadata & {\n 'cache-control': TypeCacheControlExtension;\n};\n\nexport type RootGraphQLTypeMetadata = BaseGraphQLTypeMetadata & {\n 'cache-control': TypeCacheControlExtension;\n};\n\nexport type UnidentifiableGraphQLTypeMetadata = BaseGraphQLTypeMetadata;\n\nexport type CursorConnectionGraphQLTypeMetadata = BaseGraphQLTypeMetadata;\n\n// Union type for all possible metadata configurations\nexport type GraphQLTypeMetadata =\n | IdentifiableGraphQLTypeMetadata\n | UnidentifiableGraphQLTypeMetadata\n | CursorConnectionGraphQLTypeMetadata\n | RootGraphQLTypeMetadata;\n\nexport type GraphQLTypeCategory = 'unidentifiable' | 'identifiable' | 'cursor-connection' | 'root';\n\nexport type GraphQLSingleFieldType = {\n kind: 'single';\n name: string;\n typename: string;\n nullable: boolean;\n};\n\nexport type GraphQLListFieldType = {\n kind: 'list';\n nullable: boolean;\n items: GraphQLSingleFieldType | GraphQLListFieldType;\n};\n\nexport type GraphQLFieldType = {\n type: GraphQLSingleFieldType | GraphQLListFieldType;\n args?: Record<string, GraphQLArgumentType>;\n description?: string | null;\n};\n\ntype GraphQLArgumentType = {\n type: GraphQLSingleFieldType | GraphQLListFieldType;\n defaultValue?: any;\n description?: string | null;\n};\nexport type GraphQLBaseTypeModel =\n | {\n name: string;\n category: 'unidentifiable';\n metadata?: UnidentifiableGraphQLTypeMetadata;\n }\n | {\n name: string;\n category: 'cursor-connection';\n metadata?: CursorConnectionGraphQLTypeMetadata;\n }\n | {\n name: string;\n category: 'identifiable';\n metadata: IdentifiableGraphQLTypeMetadata;\n idField: string;\n }\n | {\n name: string;\n category: 'root';\n metadata: RootGraphQLTypeMetadata;\n };\n\nexport type GraphQLObjectTypeModel = {\n kind: 'object';\n fields: Record<string, GraphQLFieldType>;\n interfaces?: string[];\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLUnionTypeModel = {\n kind: 'union';\n fields: Record<string, GraphQLFieldType>;\n possibleTypes: GraphQLTypeModel[];\n} & GraphQLBaseTypeModel;\n\ntype GraphQLEnumValueModel = {\n name: string;\n value: number;\n description?: string | null;\n};\nexport type GraphQLEnumTypeModel = {\n kind: 'enum';\n values: Record<string, GraphQLEnumValueModel>;\n} & GraphQLBaseTypeModel;\n\ntype GraphQLInputObjectTypeModel = {\n kind: 'input';\n fields: Record<string, GraphQLFieldType>;\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLInterfaceTypeModel = {\n kind: 'interface';\n fields: Record<string, GraphQLFieldType>;\n possibleTypes: GraphQLTypeModel[];\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLTypeModel =\n | GraphQLObjectTypeModel\n | GraphQLUnionTypeModel\n | GraphQLEnumTypeModel\n | GraphQLInputObjectTypeModel\n | GraphQLInterfaceTypeModel;\nexport interface GraphQLSchemaModel {\n types: GraphQLTypeModel[];\n queryTypeName: string;\n mutationTypeName?: string;\n}\n\nconst BASE_FIELDS: Record<string, GraphQLFieldType> = {\n __typename: {\n type: {\n kind: 'single',\n name: '__typename',\n typename: 'String',\n nullable: false,\n },\n },\n};\n\n/**\n * Validates that the provided type metadata is valid for the given GraphQL schema.\n * Ensures that:\n * - All identifiable types have cache-control metadata\n * - All referenced typenames exist in the schema\n * - Metadata matches the expected category for each type\n */\nexport function validateGraphQLSchemaModel(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>,\n rootTypeNames: string[],\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n validateTypeMetadata(typeMap, metadataByTypename, rootTypeNames, defaults);\n checkForUnknownTypes(typeMap, metadataByTypename);\n}\n\n/**\n * Helper function to check if a type requires cache-control metadata\n */\nfunction requiresCacheControl(type: GraphQLType, rootTypeNames: string[]): boolean {\n if (!isObjectType(type)) {\n return false;\n }\n\n const isIdentifiable = !!getOutputIdField(type);\n const isRootType = rootTypeNames.includes(type.name);\n\n return isIdentifiable || isRootType;\n}\n\n/**\n * Helper function to check if cache-control metadata is properly configured\n */\nfunction hasCacheControlMetadata(metadata: GraphQLTypeMetadata | undefined): boolean {\n return metadata !== undefined && 'cache-control' in metadata;\n}\n\n/**\n * Validates individual type definitions in the schema\n */\nfunction validateTypeMetadata(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>,\n rootTypeNames: string[],\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n for (const [typeName, type] of Object.entries(typeMap)) {\n const metadata = metadataByTypename.get(typeName);\n\n if (requiresCacheControl(type, rootTypeNames)) {\n validateCacheControl(typeName, metadata, defaults);\n continue;\n }\n\n validateNonCacheControlType(typeName, metadata);\n }\n}\n\n/**\n * Validates that types requiring cache-control have it configured\n */\nfunction validateCacheControl(\n typeName: string,\n metadata: GraphQLTypeMetadata | undefined,\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n if (hasCacheControlMetadata(metadata)) {\n return; // Valid: has explicit cache-control metadata\n }\n\n if (defaults) {\n return; // Valid: will use defaults\n }\n\n throw new Error(\n `GraphQL type '${typeName}' requires cache-control metadata but none was provided. ` +\n `Either provide cache-control metadata for this type or set a default cache-control configuration.`\n );\n}\n\n/**\n * Validates that types not requiring cache-control don't have it configured\n */\nfunction validateNonCacheControlType(\n typeName: string,\n metadata: GraphQLTypeMetadata | undefined\n): void {\n if (hasCacheControlMetadata(metadata)) {\n throw new Error(\n `GraphQL type '${typeName}' is not identifiable but metadata includes 'cache-control' property.`\n );\n }\n}\n\n/**\n * Validates that all metadata references exist in the schema\n */\nfunction checkForUnknownTypes(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>\n): void {\n for (const [typename, metadata] of metadataByTypename) {\n if (!typeMap[typename]) {\n throw new Error(`Metadata references unknown GraphQL type '${metadata.typename}'.`);\n }\n }\n}\n\nfunction buildFieldsFromType(\n type: GraphQLObjectType | GraphQLInterfaceType\n): Record<string, GraphQLFieldType> {\n return {\n ...BASE_FIELDS,\n ...Object.fromEntries(\n Object.entries(type.getFields()).map(([fieldName, field]) => [\n fieldName,\n getFieldInfo(field),\n ])\n ),\n };\n}\n\nexport function isRelayConnectionType(type: GraphQLObjectType): boolean {\n const fields = type.getFields();\n\n // Check for required fields\n if (!fields.edges || !fields.pageInfo) {\n return false;\n }\n\n // Check edges type structure\n const edgesType = fields.edges.type;\n if (!edgesType || !('ofType' in edgesType)) {\n return false;\n }\n\n const edgeType = edgesType.ofType;\n if (!edgeType || !('getFields' in edgeType)) {\n return false;\n }\n\n const edgeFields = edgeType.getFields();\n if (!edgeFields.node || !edgeFields.cursor) {\n return false;\n }\n\n // Check pageInfo type structure\n const pageInfoType = fields.pageInfo.type;\n if (!pageInfoType || !('getFields' in pageInfoType)) {\n return false;\n }\n\n const pageInfoFields = pageInfoType.getFields();\n return Boolean(\n pageInfoFields.hasNextPage &&\n pageInfoFields.hasPreviousPage &&\n pageInfoFields.startCursor &&\n pageInfoFields.endCursor\n );\n}\n\nexport function unwrapFieldType(type: GraphQLType): GraphQLSingleFieldType | GraphQLListFieldType {\n let currentType = type;\n let nullable = true;\n\n if (isNonNullType(currentType)) {\n nullable = false;\n currentType = currentType.ofType;\n }\n\n if (isListType(currentType)) {\n return {\n kind: 'list',\n nullable,\n items: unwrapFieldType(currentType.ofType),\n };\n }\n\n return {\n kind: 'single',\n name: currentType.name,\n typename: currentType.toString(),\n nullable,\n };\n}\n\nexport function getFieldInfo(field: GraphQLField<any, any>): GraphQLFieldType {\n const fieldType = unwrapFieldType(field.type);\n const args: Record<string, GraphQLArgumentType> = {};\n\n // Process field arguments\n if (field.args && field.args.length > 0) {\n for (const arg of field.args) {\n args[arg.name] = {\n type: unwrapFieldType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n };\n }\n }\n\n return {\n type: fieldType,\n args: Object.keys(args).length > 0 ? args : undefined,\n description: field.description,\n };\n}\n\nexport function getInputFieldInfo(field: GraphQLInputField): GraphQLFieldType {\n const fieldType = unwrapFieldType(field.type);\n\n return {\n type: fieldType,\n description: field.description,\n };\n}\n\nfunction getPossibleTypes(\n possibleTypes: readonly GraphQLObjectType[],\n types: GraphQLTypeModel[]\n): GraphQLTypeModel[] {\n const possibleTypeModels: GraphQLTypeModel[] = [];\n\n possibleTypes.forEach((t) => {\n const implementation = types.find((concreteType) => concreteType.name === t.name);\n if (implementation) {\n possibleTypeModels.push(implementation);\n } else {\n throw new Error(`Unknown type ${t.name}`);\n }\n });\n\n return possibleTypeModels;\n}\n\nexport function getOutputIdField(\n type: GraphQLObjectType | GraphQLInterfaceType\n): string | undefined {\n const idFields = Object.values(type.getFields())\n .filter((field) => {\n const typeString = field.type.toString();\n return (\n (typeString === 'ID' || typeString === 'ID!') && field.name.toLowerCase() === 'id'\n );\n })\n .map((field) => field.name);\n\n if (idFields.length > 1) {\n throw new Error(`Multiple ID fields found for type ${type.name}`);\n }\n\n return idFields.length > 0 ? idFields[0] : undefined;\n}\n\nexport function getInputIdField(type: GraphQLInputObjectType): string | undefined {\n const idFields = Object.values(type.getFields())\n .filter((field) => {\n const typeString = field.type.toString();\n return (\n (typeString === 'ID' || typeString === 'ID!') && field.name.toLowerCase() === 'id'\n );\n })\n .map((field) => field.name);\n\n if (idFields.length > 1) {\n throw new Error(`Multiple ID fields found for type ${type.name}`);\n }\n\n return idFields.length > 0 ? idFields[0] : undefined;\n}\n\nfunction setCacheControl(\n metadata: GraphQLTypeMetadata | undefined,\n defaults?: Partial<TypeCacheControlExtension>\n): TypeCacheControlExtension | void {\n // Check if metadata has cache-control (type narrowing)\n if (metadata && 'cache-control' in metadata) {\n const explicitCacheControl = metadata['cache-control'];\n\n if (explicitCacheControl.type === 'no-cache') {\n // For no-cache, only use explicit values (no merging with defaults)\n return explicitCacheControl;\n } else {\n // For other types, merge defaults with explicit values\n return {\n ...defaults,\n ...explicitCacheControl,\n } as TypeCacheControlExtension;\n }\n } else if (defaults) {\n // Use defaults if no explicit metadata\n return defaults as TypeCacheControlExtension;\n }\n}\n\nfunction buildGraphQLObjectModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLObjectType,\n isRootType: boolean,\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLObjectTypeModel {\n const fields = buildFieldsFromType(type);\n const interfaces = type.getInterfaces().map((i) => i.name);\n\n if (isRelayConnectionType(type)) {\n const connectionMetadata: CursorConnectionGraphQLTypeMetadata = metadata || {\n typename: name,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'cursor-connection',\n metadata: connectionMetadata,\n };\n }\n\n const idField = getOutputIdField(type);\n if (idField || isRootType) {\n // For identifiable types, ensure cache-control is defined\n let cacheControl: TypeCacheControlExtension | void = setCacheControl(metadata, defaults);\n if (idField) {\n if (cacheControl) {\n const identifiableMetadata: IdentifiableGraphQLTypeMetadata = {\n typename: name,\n 'cache-control': cacheControl,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'identifiable',\n idField,\n metadata: identifiableMetadata,\n };\n }\n // No cache-control defined and no default - throw error\n throw new Error(\n `Identifiable GraphQL type '${name}' must have cache-control metadata defined. ` +\n `Either provide cache-control metadata for this type or set a default cache-control configuration.`\n );\n } else if (cacheControl) {\n // Otherwise we don't throw, but fall through to the unidentifiable case\n const rootMetadata: RootGraphQLTypeMetadata = {\n typename: name,\n 'cache-control': cacheControl,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'root',\n metadata: rootMetadata,\n };\n }\n }\n\n const unidentifiableMetadata: UnidentifiableGraphQLTypeMetadata = metadata || {\n typename: name,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'unidentifiable',\n metadata: unidentifiableMetadata,\n };\n}\n\nfunction buildGraphQLInputObjectModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLInputObjectType,\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLInputObjectTypeModel {\n const fields: Record<string, GraphQLFieldType> = {};\n for (const [fieldName, field] of Object.entries(type.getFields())) {\n fields[fieldName] = getInputFieldInfo(field);\n }\n\n const baseInputObjectModel = {\n kind: 'input' as const,\n name,\n metadata,\n fields,\n };\n\n return {\n ...baseInputObjectModel,\n category: 'unidentifiable',\n };\n}\n\nfunction buildGraphQLInterfaceModel(\n name: string,\n metadata: BaseGraphQLTypeMetadata | undefined,\n type: GraphQLInterfaceType,\n types: GraphQLTypeModel[],\n schema: GraphQLSchema\n): GraphQLInterfaceTypeModel {\n const fields = buildFieldsFromType(type);\n const possibleTypes = getPossibleTypes(schema.getImplementations(type).objects, types);\n return {\n kind: 'interface' as const,\n category: 'unidentifiable',\n name,\n metadata,\n fields,\n possibleTypes,\n };\n}\n\nfunction buildGraphQLUnionModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLUnionType,\n types: GraphQLTypeModel[]\n): GraphQLUnionTypeModel {\n const possibleTypes = getPossibleTypes(type.getTypes(), types);\n // Union Types have __typename field, but no other fields\n const fields = {\n ...BASE_FIELDS,\n };\n\n return {\n kind: 'union' as const,\n fields,\n name,\n metadata,\n possibleTypes,\n category: 'unidentifiable',\n };\n}\n\nfunction buildGraphQLEnumModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLEnumType\n): GraphQLEnumTypeModel {\n const values: Record<string, GraphQLEnumValueModel> = {};\n for (const [name, value] of Object.entries(type.getValues())) {\n values[name] = {\n name: value.name,\n value: value.value,\n description: value.description,\n };\n }\n\n return {\n kind: 'enum' as const,\n name,\n metadata,\n values,\n category: 'unidentifiable',\n };\n}\n\nexport function buildGraphQLSchemaModel(\n schema: GraphQLSchema,\n typeMetadata: GraphQLTypeMetadata[] = [],\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLSchemaModel {\n const typeMap = schema.getTypeMap();\n const types: GraphQLTypeModel[] = [];\n const metadataByTypename = new Map(typeMetadata.map((m) => [m.typename, m]));\n const queryTypeName = schema.getQueryType()?.name;\n const mutationTypeName = schema.getMutationType()?.name;\n\n // First resolve all the concrete types (objects and enums)\n for (const [name, type] of Object.entries(typeMap)) {\n // Skip internal types and scalars and ignore interfaces and unions for now\n if (\n name.startsWith('__') ||\n isScalarType(type) ||\n isInterfaceType(type) ||\n isUnionType(type)\n ) {\n continue;\n }\n const metadata = metadataByTypename.get(name);\n\n if (isObjectType(type)) {\n types.push(\n buildGraphQLObjectModel(\n name,\n metadata,\n type,\n type.name === queryTypeName || type.name === mutationTypeName,\n defaults\n )\n );\n } else if (isInputObjectType(type)) {\n types.push(buildGraphQLInputObjectModel(name, metadata, type, defaults));\n } else if (isEnumType(type)) {\n types.push(buildGraphQLEnumModel(name, metadata, type));\n }\n }\n\n // Next resolve all the interfaces and unions\n for (const [name, type] of Object.entries(typeMap)) {\n // Skip internal types and scalars and ignore objects and input objects\n if (name.startsWith('__') || isObjectType(type) || isInputObjectType(type)) {\n continue;\n }\n const metadata = metadataByTypename.get(name);\n if (isInterfaceType(type)) {\n types.push(buildGraphQLInterfaceModel(name, metadata, type, types, schema));\n } else if (isUnionType(type)) {\n types.push(buildGraphQLUnionModel(name, metadata, type, types));\n }\n }\n\n if (!queryTypeName) {\n throw new Error('No query type found in schema');\n }\n // Validate metadata before returning the model\n const rootTypeNames = [queryTypeName];\n if (mutationTypeName) {\n rootTypeNames.push(mutationTypeName);\n }\n validateGraphQLSchemaModel(typeMap, metadataByTypename, rootTypeNames, defaults);\n\n return {\n types,\n queryTypeName,\n mutationTypeName,\n };\n}\n","import { buildSchema } from 'graphql';\nimport { GraphQLSchemaModel, buildGraphQLSchemaModel } from './graphql-schema-model';\nimport { resolve } from 'path';\nimport { readFileSync } from 'fs';\nimport { AuraNormalizedCachingCommandModel } from './aura-normalized-caching-command-model';\nimport { AuraGraphQLOperation } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { IGraphQLCommandModel } from './graphql-command-model-interface';\n\nconst AURA_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'AuraGraphQLNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'NamedAuraGraphQLNormalizedCacheControlCommand',\n isType: true,\n};\n\nexport class AuraGraphQLCommandModel\n extends AuraNormalizedCachingCommandModel\n implements IGraphQLCommandModel\n{\n private schemaModel?: GraphQLSchemaModel;\n\n constructor(operation: AuraGraphQLOperation) {\n super(operation);\n }\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n // Override the base class to use GraphQL-specific command service\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraGraphQLNormalizedCacheControlCommand',\n serviceName: 'auraGraphQLNormalizedCacheControlCommand',\n };\n\n return deps;\n }\n\n get schema(): GraphQLSchemaModel {\n const graphQLOperation = this.operation as AuraGraphQLOperation;\n if (!this.schemaModel) {\n const config = graphQLOperation.graphqlConfig;\n const schemaPath = resolve(graphQLOperation.basePath, config.schemaFilePath);\n const schemaContent = readFileSync(schemaPath, 'utf-8');\n const graphqlSchema = buildSchema(schemaContent);\n\n // Access defaults from the operation's endpoint API\n const apiDefaults = this.operation.defaults.typeCacheControl;\n this.schemaModel = buildGraphQLSchemaModel(\n graphqlSchema,\n config['type-metadata'],\n apiDefaults\n );\n }\n return this.schemaModel;\n }\n}\n","import { buildSchema } from 'graphql';\nimport { GraphQLSchemaModel, buildGraphQLSchemaModel } from './graphql-schema-model';\nimport { resolve } from 'path';\nimport { readFileSync } from 'fs';\nimport { HttpNormalizedCachingCommandModel } from './http-normalized-caching-command-model';\nimport { HttpGraphQLOperation } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { IGraphQLCommandModel } from './graphql-command-model-interface';\n\nconst HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'HttpGraphQLNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'NamedHttpGraphQLNormalizedCacheControlCommand',\n isType: true,\n};\n\nexport class HttpGraphQLCommandModel\n extends HttpNormalizedCachingCommandModel\n implements IGraphQLCommandModel\n{\n private schemaModel?: GraphQLSchemaModel;\n\n constructor(operation: HttpGraphQLOperation) {\n super(operation);\n }\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n // Override the base class to use GraphQL-specific command service\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'httpGraphQLNormalizedCacheControlCommand',\n serviceName: 'httpGraphQLNormalizedCacheControlCommand',\n };\n\n return deps;\n }\n\n get schema(): GraphQLSchemaModel {\n const graphQLOperation = this.operation as HttpGraphQLOperation;\n\n if (!this.schemaModel) {\n const config = graphQLOperation.graphqlConfig;\n const schemaPath = resolve(graphQLOperation.basePath, config.schemaFilePath);\n const schemaContent = readFileSync(schemaPath, 'utf-8');\n const graphqlSchema = buildSchema(schemaContent);\n\n // Access defaults from the operation's endpoint API\n const apiDefaults = this.operation.defaults.typeCacheControl;\n\n this.schemaModel = buildGraphQLSchemaModel(\n graphqlSchema,\n config['type-metadata'],\n apiDefaults\n );\n }\n return this.schemaModel;\n }\n}\n","import { type ImportableReference } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\nimport { GraphQLNormalizedCacheControlGeneratorMixin } from './graphql-normalized-cache-control-generator-mixin';\n\nconst AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'AuraGraphQLNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n// First apply the normalized cache control mixin to AuraCommandGenerator\nconst AuraNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n AuraCommandGenerator,\n AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n\n// Then apply the GraphQL mixin to the normalized cache control generator\nexport const AuraGraphQLNormalizedCacheControlCommandGenerator =\n GraphQLNormalizedCacheControlGeneratorMixin(\n AuraNormalizedCacheControlCommandGenerator,\n AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n );\n","import { AuraCommandModel } from '../model/aura-command-model';\nimport { HttpCommandModel } from '../model/http-command-model';\nimport { AuraNormalizedCachingCommandModel } from '../model/aura-normalized-caching-command-model';\nimport { AuraResourceCachingCommandModel } from '../model/aura-resource-caching-command-model';\nimport { AuraNormalizedCacheControlCommandGenerator } from './aura-normalized-cache-control-command-generator';\nimport { AuraResourceCacheControlCommandGenerator } from './aura-resource-cache-control-command-generator';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { BindingsGenerator, type IBindingsGenerator } from './bindings-generator';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport type { NamedFileService } from '../files';\nimport type { NamedAPIService, Operation } from '@conduit-client/model/v1';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport type { ICommandGenerator } from './base-command-generator';\nimport { HttpNormalizedCacheControlCommandGenerator } from './http-normalized-cache-control-command-generator';\nimport { HttpNormalizedCachingCommandModel } from '../model/http-normalized-caching-command-model';\nimport { AuraGraphQLCommandModel } from '../model/aura-graphql-command-model';\nimport { HttpGraphQLCommandModel } from '../model/http-graphql-command-model';\nimport { AuraGraphQLNormalizedCacheControlCommandGenerator } from './aura-graphql-normalized-cache-control-command-generator';\nimport { HttpGraphQLNormalizedCacheControlCommandGenerator } from './http-graphql-normalized-cache-control-command-generator';\n\nexport function defaultCommandModelFactory(operation: Operation): ICommandModel {\n let commandModel;\n if (operation.endpoint.type === 'aura') {\n if (operation.operationType === 'graphql') {\n commandModel = AuraGraphQLCommandModel;\n } else if (operation.cacheStrategy.type === 'none') {\n commandModel = AuraCommandModel;\n } else if (operation.cacheStrategy.type === 'normalized') {\n commandModel = AuraNormalizedCachingCommandModel;\n } else if (operation.cacheStrategy.type === 'resource') {\n commandModel = AuraResourceCachingCommandModel;\n } else {\n throw new Error(\n `Unknown Aura cache strategy type ${(operation.cacheStrategy as any).type}. Must be 'none', 'resource' or 'normalized'`\n );\n }\n } else {\n if (operation.operationType === 'graphql') {\n commandModel = HttpGraphQLCommandModel;\n } else if (operation.cacheStrategy.type === 'none') {\n commandModel = HttpCommandModel;\n } else if (operation.cacheStrategy.type === 'normalized') {\n commandModel = HttpNormalizedCachingCommandModel;\n } else {\n throw new Error(\n `Unknown HTTP cache strategy type ${operation.cacheStrategy.type}. Must be 'none' or 'normalized'`\n );\n }\n }\n\n return new commandModel(operation);\n}\n\nexport function defaultCommandGeneratorFactory(\n commandModel: ICommandModel,\n services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n) {\n if (commandModel.transportType === 'aura') {\n if (commandModel.cacheStrategy.type === 'none') {\n return new AuraCommandGenerator(commandModel, services);\n } else if (commandModel.cacheStrategy.type === 'normalized') {\n if (commandModel.operationType === 'graphql') {\n return new AuraGraphQLNormalizedCacheControlCommandGenerator(\n commandModel,\n services\n );\n } else {\n return new AuraNormalizedCacheControlCommandGenerator(commandModel, services);\n }\n } else {\n return new AuraResourceCacheControlCommandGenerator(commandModel, services);\n }\n }\n\n if (commandModel.cacheStrategy.type === 'none') {\n return new HttpCommandGenerator(commandModel, services);\n } else if (commandModel.cacheStrategy.type === 'normalized') {\n if (commandModel.operationType === 'graphql') {\n return new HttpGraphQLNormalizedCacheControlCommandGenerator(commandModel, services);\n } else {\n return new HttpNormalizedCacheControlCommandGenerator(commandModel, services);\n }\n }\n\n throw new Error('Unknown command configuration');\n}\n\nexport function defaultBindingsGeneratorFactory(\n commandModels: ICommandModel[],\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n): IBindingsGenerator {\n return new BindingsGenerator(services, commandModels);\n}\n\nexport interface IApiFamilyModuleGenerator {\n build(): void;\n buildModels(): ICommandModel[];\n generateCommands(commandModels: ICommandModel[]): void;\n generateBindings(commandModels: ICommandModel[]): void;\n}\n\n/**\n * Class responsible for generating modules based on provided services and factories for commands and bindings.\n *\n * The `ModuleGenerator` class aggregates service interfaces and factory functions for creating command models,\n * command generators, and bindings generators. It uses these components to build modules by processing API\n * operations, generating necessary commands, and binding them into a coherent module structure.\n *\n * The general pattern for generating module code should, by convention, be:\n * 1. Transform the API model service into more targeted models for code generation\n * 2. Use those code generation models in the generator classes to populate a file template\n *\n * API operations map one to one with OneStore commands, and bindings sit on top of all commands, exposing the\n * interface to be consumed by a user, e.g. a component.\n *\n * @property {NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedJSONSchemaDeclarationService} services - Composite object providing essential services like API, File, Type Definition, and JSON Schema Declaration services.\n * @property {(op: Operation) => ICommandModel} commandModelFactory - Factory function to create command models from operations. Defaults to `defaultCommandModelFactory` if not provided.\n * @property {(op: Operation, commandModel: ICommandModel, services: NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService) => ICommandGenerator} commandGeneratorFactory - Factory function to create command generators. Takes an operation, a command model, and services. Defaults to `defaultCommandGeneratorFactory` if not provided.\n * @property {(commandModels: ICommandModel[], services: NamedFileService & NamedTypeDefinitionService) => IBindingsGenerator} bindingsGeneratorFactory - Factory function to create bindings generators from command models and services. Defaults to `defaultBindingsGeneratorFactory` if not provided.\n */\nexport class ApiFamilyModuleGenerator implements IApiFamilyModuleGenerator {\n constructor(\n protected services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedJSONSchemaDeclarationService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService,\n protected commandModelFactory: (\n op: Operation\n ) => ICommandModel = defaultCommandModelFactory,\n protected commandGeneratorFactory: (\n commandModel: ICommandModel,\n services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n ) => ICommandGenerator = defaultCommandGeneratorFactory,\n protected bindingsGeneratorFactory: (\n commandModels: ICommandModel[],\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n ) => IBindingsGenerator = defaultBindingsGeneratorFactory\n ) {}\n\n /**\n * Builds the module by processing all operations defined in the API service.\n * This method iterates through each endpoint and operation, uses the command model factory to generate command models,\n * then generates commands with the command generator factory, and finally builds bindings using the bindings generator factory.\n */\n build() {\n const commandModels = this.buildModels();\n this.generateCommands(commandModels);\n this.generateBindings(commandModels);\n }\n\n buildModels() {\n const commandModels: ICommandModel[] = [];\n for (const endpoint of this.services.api.api.endpoints) {\n for (const operation of endpoint.operations) {\n const commandModel = this.commandModelFactory(operation);\n commandModels.push(commandModel);\n }\n }\n return commandModels;\n }\n\n generateCommands(commandModels: ICommandModel[]) {\n commandModels.forEach((commandModel) => {\n this.commandGeneratorFactory(commandModel, this.services).build();\n });\n }\n\n generateBindings(commandModels: ICommandModel[]) {\n this.bindingsGeneratorFactory(commandModels, this.services).build();\n }\n}\n","import { ApiFamilyModuleGenerator, IApiFamilyModuleGenerator } from './generators';\nimport type { NamedLoggerService } from '@conduit-client/utils';\nimport type { NamedFileService } from './files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from './types';\nimport type { NamedTypeRegistryGeneratorService } from './normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from './normalization/graphql-type-registry-generator';\n\n/**\n * Creates a new instance of ModuleGenerator using a composite service object.\n *\n * This function takes an object that aggregates several named services essential for module generation.\n * It constructs and returns a new `ModuleGenerator` instance initialized with these services.\n *\n * @param {NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedLoggerService & NamedJSONSchemaDeclarationService} services - An object that must implement the required services\n * @returns {ModuleGenerator} A new `ModuleGenerator` instance configured with the provided services.\n */\nexport function apiFamilyModuleGeneratorService(\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedLoggerService &\n NamedJSONSchemaDeclarationService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n) {\n return new ApiFamilyModuleGenerator(services);\n}\n\nexport type { IApiFamilyModuleGenerator };\n"],"names":["code","isType","block","isObjectType","isEnumType","isIdentifiableType","NAMED_CACHE_CONTROLLER_SERVICE","NAMED_PUB_SUB_SERVICE","TYPE_SERVICES","defaultGenerateType","itemType","additionalPropsCode","GRAPHQL_DATA","GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY","isInterfaceType","isUnionType","path","FETCH_RESPONSE","JSON_SCHEMA_TYPE","APPLY_DECORATORS","WIRE_ADAPTER_CONSTRUCTOR","NAMED_CACHE_CONTROL_SERVICE","CACHE_CONTROL_SERVICE_DESCRIPTOR","NAMED_PUBSUB_SERVICE","PUBSUB_SERVICE_DESCRIPTOR","NAMED_FETCH_NETWORK_COMMAND_SERVICE","members","getCacheControlValue","NAMED_AURA_NETWORK_SERVICE","NAMED_FETCH_SERVICE","HttpNormalizedCacheControlCommandGenerator","FETCH_SERVICE_DESCRIPTOR","AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR","NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE","AuraNormalizedCacheControlCommandGenerator","OperationTypeNode","DirectiveLocation","Kind","isDigit","indent","TokenKind","instanceOf","enumValue","TypeKind","getNamedType","name"],"mappings":";;;;;;;;;;;;AAqBO,SAAS,sBAAsB,GAAkC;AACpE,SACI,OAAO,MAAM,YACb,MAAM,SACJ,cAAc,KAAK,OAAO,EAAE,aAAa,YACtC,YAAY,KAAK,OAAO,EAAE,WAAW,aAC1C,YAAY,KACZ,OAAO,EAAE,WAAW;AAE5B;AAGA,SAAS,yBAAyB,IAAiC;AAC/D,QAAM,SAAS,cAAc,KAAK,QAAQ,GAAG,QAAQ,KAAK,UAAU,GAAG,MAAM;AAC7E,SAAO,KAAK,MAAM,IAAI,GAAG,cAAc,IAAI,GAAG,MAAM;AACxD;AAKO,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASd,eAAe,QAA6C;AAP5D,SAAA,SAA8C,CAAA;AAQ1C,SAAK,KAAK,GAAG,MAAM;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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ACzC,cAAM,eAAe,KAAK,oBAAoB,SAAS;AACvD,sBAAc,KAAK,YAAY;AAAA,MACnC;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AAAA,EAEA,iBAAiB,eAAgC;AAC7C,kBAAc,QAAQ,CAAC,iBAAiB;AACpC,WAAK,wBAAwB,cAAc,KAAK,QAAQ,EAAE,MAAA;AAAA,IAC9D,CAAC;AAAA,EACL;AAAA,EAEA,iBAAiB,eAAgC;AAC7C,SAAK,yBAAyB,eAAe,KAAK,QAAQ,EAAE,MAAA;AAAA,EAChE;AACJ;AChLO,SAAS,gCACZ,UAOF;AACE,SAAO,IAAI,yBAAyB,QAAQ;AAChD;","x_google_ignoreList":[51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/v1/files/code.ts","../../src/v1/files/file.ts","../../src/v1/files/write-files.ts","../../src/v1/types/json-schema.ts","../../src/v1/types/type-definition.ts","../../src/v1/types/json-schema-declarations.ts","../../src/v1/types/resolve-all-of-type.ts","../../src/v1/types/normalized-type-definition.ts","../../src/v1/normalization/utils.ts","../../src/v1/generators/cache-control-generator.ts","../../src/v1/normalization/identifiable-type-generator.ts","../../src/v1/normalization/unidentifiable-type-generator.ts","../../src/v1/normalization/normalized-type-generator.ts","../../src/v1/normalization/normalize-code-gen/normalize-generator-service.ts","../../src/v1/normalization/type-registry-generator.ts","../../src/v1/normalization/graphql/base-type-generator.ts","../../src/v1/normalization/graphql/identifiable-type-generator.ts","../../src/v1/normalization/graphql/unidentifiable-type-generator.ts","../../src/v1/normalization/graphql/cursor-connection-type-generator.ts","../../src/v1/normalization/graphql/interface-type-generator.ts","../../src/v1/normalization/graphql/union-type-generator.ts","../../src/v1/normalization/graphql/document-root-type-generator.ts","../../src/v1/normalization/graphql-type-generator.ts","../../src/v1/normalization/graphql-type-registry-generator.ts","../../src/v1/generators/base-command-generator.ts","../../src/v1/generators/utils.ts","../../src/v1/generators/http-command-generator.ts","../../src/v1/generators/aura-command-generator.ts","../../src/v1/generators/aura-resource-cache-control-command-generator.ts","../../src/v1/generators/imperative-binding-generator.ts","../../src/v1/generators/imperative-legacy-binding-generator.ts","../../src/v1/generators/graphql-root-variable-names.ts","../../src/v1/generators/graphql-imperative-legacy-binding-generator.ts","../../src/v1/generators/wire-binding-generator.ts","../../src/v1/generators/graphql-imperative-binding-generator.ts","../../src/v1/generators/graphql-wire-binding-generator.ts","../../src/v1/generators/graphql-mutation-binding-generator.ts","../../src/v1/generators/bindings-generator.ts","../../src/v1/utils.ts","../../src/v1/generators/command-config-builder.ts","../../src/v1/generators/normalized-cache-control-generator-mixin.ts","../../src/v1/generators/graphql-normalized-cache-control-generator-mixin.ts","../../src/v1/generators/http-graphql-normalized-cache-control-command-generator.ts","../../src/v1/model/base-command-model.ts","../../src/v1/model/aura-command-model.ts","../../src/v1/model/http-command-model.ts","../../src/v1/model/aura-normalized-caching-command-model.ts","../../src/v1/model/aura-resource-caching-command-model.ts","../../src/v1/generators/aura-normalized-cache-control-command-generator.ts","../../src/v1/generators/http-normalized-cache-control-command-generator.ts","../../src/v1/model/http-normalized-caching-command-model.ts","../../../../../../node_modules/graphql/jsutils/devAssert.mjs","../../../../../../node_modules/graphql/jsutils/isObjectLike.mjs","../../../../../../node_modules/graphql/polyfills/symbols.mjs","../../../../../../node_modules/graphql/language/location.mjs","../../../../../../node_modules/graphql/language/printLocation.mjs","../../../../../../node_modules/graphql/error/GraphQLError.mjs","../../../../../../node_modules/graphql/error/syntaxError.mjs","../../../../../../node_modules/graphql/language/kinds.mjs","../../../../../../node_modules/graphql/jsutils/invariant.mjs","../../../../../../node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs","../../../../../../node_modules/graphql/jsutils/defineInspect.mjs","../../../../../../node_modules/graphql/language/ast.mjs","../../../../../../node_modules/graphql/language/tokenKind.mjs","../../../../../../node_modules/graphql/jsutils/inspect.mjs","../../../../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../../../../node_modules/graphql/language/source.mjs","../../../../../../node_modules/graphql/language/directiveLocation.mjs","../../../../../../node_modules/graphql/language/blockString.mjs","../../../../../../node_modules/graphql/language/lexer.mjs","../../../../../../node_modules/graphql/language/parser.mjs","../../../../../../node_modules/graphql/language/visitor.mjs","../../../../../../node_modules/graphql/polyfills/find.mjs","../../../../../../node_modules/graphql/polyfills/objectValues.mjs","../../../../../../node_modules/graphql/polyfills/objectEntries.mjs","../../../../../../node_modules/graphql/jsutils/keyMap.mjs","../../../../../../node_modules/graphql/jsutils/mapValue.mjs","../../../../../../node_modules/graphql/jsutils/toObjMap.mjs","../../../../../../node_modules/graphql/jsutils/keyValMap.mjs","../../../../../../node_modules/graphql/jsutils/didYouMean.mjs","../../../../../../node_modules/graphql/jsutils/identityFunc.mjs","../../../../../../node_modules/graphql/jsutils/naturalCompare.mjs","../../../../../../node_modules/graphql/jsutils/suggestionList.mjs","../../../../../../node_modules/graphql/language/printer.mjs","../../../../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs","../../../../../../node_modules/graphql/type/definition.mjs","../../../../../../node_modules/graphql/polyfills/arrayFrom.mjs","../../../../../../node_modules/graphql/polyfills/isFinite.mjs","../../../../../../node_modules/graphql/jsutils/safeArrayFrom.mjs","../../../../../../node_modules/graphql/polyfills/isInteger.mjs","../../../../../../node_modules/graphql/type/scalars.mjs","../../../../../../node_modules/graphql/utilities/astFromValue.mjs","../../../../../../node_modules/graphql/type/introspection.mjs","../../../../../../node_modules/graphql/type/directives.mjs","../../../../../../node_modules/graphql/type/schema.mjs","../../../../../../node_modules/graphql/language/predicates.mjs","../../../../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs","../../../../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs","../../../../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs","../../../../../../node_modules/graphql/validation/specifiedRules.mjs","../../../../../../node_modules/graphql/validation/ValidationContext.mjs","../../../../../../node_modules/graphql/validation/validate.mjs","../../../../../../node_modules/graphql/utilities/valueFromAST.mjs","../../../../../../node_modules/graphql/execution/values.mjs","../../../../../../node_modules/graphql/utilities/extendSchema.mjs","../../../../../../node_modules/graphql/utilities/buildASTSchema.mjs","../../src/v1/model/graphql-schema-model.ts","../../src/v1/model/aura-graphql-command-model.ts","../../src/v1/model/http-graphql-command-model.ts","../../src/v1/generators/aura-graphql-normalized-cache-control-command-generator.ts","../../src/v1/generators/api-family-module-generator.ts","../../src/v1/api-module-generator-service.ts"],"sourcesContent":["export type ImportableReference = (\n | {\n filename: string;\n }\n | {\n module: string;\n }\n) & {\n exportedSymbol?: string;\n isType: boolean;\n};\n\nexport type ImportableTypeReference = ImportableReference & { isType: true };\nexport type ImportableValueReference = ImportableReference & { isType: false };\n\n/**\n * Indicates if a value is an ImportableReference.\n *\n * @param x value to test\n * @returns true if x is an ImportableReference; false if not\n */\nexport function isImportableReference(x: any): x is ImportableReference {\n return (\n typeof x === 'object' &&\n x !== null &&\n (('filename' in x && typeof x.filename === 'string') ||\n ('module' in x && typeof x.module === 'string')) &&\n 'isType' in x &&\n typeof x.isType === 'boolean'\n );\n}\n\n// default importStringifier implementation\nfunction defaultImportStringifier(ir: ImportableReference): string {\n const source = 'filename' in ir ? `file:${ir.filename}` : `module:${ir.module}`;\n return `<<${source}:${ir.exportedSymbol}:${ir.isType})>>`;\n}\n\n/**\n * A Code instance holds a collection of TypeScript code.\n */\nexport class Code {\n // code can be strings or references that we need to import\n chunks: Array<string | ImportableReference> = [];\n\n /**\n * Constructor.\n *\n * @param chunks initial bits of code to include\n */\n constructor(...chunks: Array<string | ImportableReference>) {\n this.push(...chunks);\n }\n\n /**\n * Concatenates a set of Codes with an optional separator between them.\n *\n * @param codes Codes to be concatenated\n * @param separator separator to be inserted between the Codes\n * @returns concatenated Codes/separators\n */\n static join(codes: any[], separator: string = ''): Code {\n return codes.reduce(\n (joined: Code, code: any, i: number) => joined.push(i > 0 ? separator : '', code),\n new Code()\n );\n }\n\n /**\n * Appends new chunks of code to this list. Parameters are handled as follows:\n *\n * - undefined, null, '' - ignored\n * - string, ImportableReference - appended to this.chunks\n * - Code - chunks from the other Code are appended to this Code\n * - [] - desructured & individual elements processed\n * - al others - converted to a string & appended to this.chunks\n *\n * In the case of recursive values (Code & arrays), processing is done\n * depth-first.\n *\n * @param newChunks code to be appended\n * @returns this\n */\n push(...newChunks: any[]): this {\n for (const chunk of newChunks) {\n if (chunk === undefined || chunk === null || chunk === '') {\n continue;\n } else if (typeof chunk === 'string' || isImportableReference(chunk)) {\n this.chunks.push(chunk);\n } else if (chunk instanceof Code) {\n this.push(...chunk.chunks);\n } else if (Array.isArray(chunk)) {\n this.push(...chunk);\n } else {\n this.chunks.push('' + chunk);\n }\n }\n\n return this;\n }\n\n /**\n * Compares to another Code object to check\n * equivalence (i.e., chunks properties are identical)\n *\n * @param Code\n * @returns boolean\n */\n equals(comparison: Code): boolean {\n return this.toString() === comparison.toString();\n }\n\n /**\n * Returns the Code as a single string.\n *\n * @param options\n * importStringifier - function to convert ImportableReferences to strings.\n * Defaults to an internal function whose only guarantee is that equivalent\n * ImportableReferencesit will result in equivalent strings.\n * @returns string representation of the code\n */\n toString(\n options: {\n importStringifier?: (reference: ImportableReference) => string;\n } = {}\n ): string {\n const irToString = options.importStringifier || defaultImportStringifier;\n\n return this.chunks\n .map((chunk) => (isImportableReference(chunk) ? irToString(chunk) : chunk))\n .join('');\n }\n}\n\n/**\n * A tagged template literal wrapper for Code. Strings & parameters are\n * interleaved as chunks in the returned Code.\n *\n * @param strings strings from the tagged template literal\n * @param params expressions from the tagged template literal\n * @returns Code\n */\nexport function code(strings: TemplateStringsArray, ...params: any[]): Code {\n return strings.reduce(\n (result: Code, _: any, i: number) =>\n result.push(strings[i], i < params.length ? params[i] : undefined),\n new Code()\n );\n}\n","import * as path from 'path';\nimport * as prettier from 'prettier';\nimport {\n toTypeScriptSafeIdentifier,\n type NamedService,\n type ServiceDescriptor,\n} from '@conduit-client/utils';\nimport { Code } from './code';\nimport type { ImportableReference } from './code';\n\n/**\n * Service that builds TypeScript source files.\n */\nexport type FileService = {\n /**\n * Convenience method that creates a File if one with the\n * specified name does not already exist.\n *\n * @param filename filename\n * @returns File with the given filename\n */\n build(filename: string): File;\n\n /**\n * Files that have been created. Key is filename.\n */\n cache: ReadonlyMap<string, File>;\n};\n\nexport type NamedFileService<Name extends string = 'file'> = NamedService<Name, FileService>;\n\nexport type FileServiceDescriptor = ServiceDescriptor<FileService, '1.0'>;\n\n/**\n * A simple FileService implementation.\n */\nclass Files implements FileService {\n cache = new Map<string, File>();\n\n build(filename: string) {\n let file = this.cache.get(filename);\n\n if (!file) {\n this.cache.set(filename, (file = new File(filename)));\n }\n\n return file;\n }\n}\n\n/**\n * Constructs a new FileService.\n */\nexport function fileService(): FileService {\n return new Files();\n}\n\n/**\n * A class used to track and resolve the ImportableReferences used within a File.\n */\nclass Imports {\n // local symbols assigned to imports; used to ensure imports have unique names\n private localSymbols: Set<string> = new Set();\n\n // to keep track of the ImportableReferences we've already resolved\n private imports: {\n [relativeFilename: string]: {\n exportedSymbol?: string;\n localSymbol: string;\n isType: boolean;\n }[];\n } = {};\n\n /**\n * Constructor\n *\n * @param filename name of the importing file\n */\n constructor(private filename: string) {}\n\n /**\n * Computes a unique local symbol to use for an import.\n *\n * @param exportedSymbol symbol used on the export\n * @returns local symbol to be used\n */\n private uniqueSymbolFor(exportedSymbol: string): string {\n // use the exported name if it's not already taken; otherwise start\n // adding numeric suffixes until we find a unique local symbol\n let result = exportedSymbol,\n suffix = 1;\n\n while (this.localSymbols.has(result)) {\n result = `${exportedSymbol}$${suffix++}`;\n }\n\n // remember we've used this local symbol\n this.localSymbols.add(result);\n\n return result;\n }\n\n /**\n * Returns the local symbol to be used for an ImportableReference.\n *\n * @param filename file that defines the thing being imported\n * @param exportedSymbol symbol exported from file\n * @param isType true if the import is for a TypeScript type; false if it is for a value\n * @returns local symbol to use for the import\n */\n localSymbolFor(ref: ImportableReference): string {\n // if the import is from this file then just use exportedSymbol as the localSymbol\n if (ref.exportedSymbol && 'filename' in ref && ref.filename === this.filename) {\n return ref.exportedSymbol;\n }\n\n let from;\n if ('filename' in ref) {\n // compute relative path from this file to the file being imported from\n from = path\n .relative(path.dirname(this.filename), ref.filename)\n .replace(/\\.(js|ts)$/, '');\n\n // imports from files must always be relative\n if (!from.startsWith('.')) {\n from = './' + from;\n }\n } else {\n // use module name\n from = ref.module;\n }\n\n // see if we've already got a local symbol for this reference\n let imports = this.imports[from];\n if (!imports) {\n imports = this.imports[from] = [];\n }\n\n let result = imports.find(\n ({ exportedSymbol, isType }) =>\n exportedSymbol === ref.exportedSymbol && isType === ref.isType\n )?.localSymbol;\n if (result) {\n return result;\n }\n\n // no symbol yet, generate a new one\n result = this.uniqueSymbolFor(ref.exportedSymbol || toTypeScriptSafeIdentifier(from));\n imports.push({\n exportedSymbol: ref.exportedSymbol,\n localSymbol: result,\n isType: ref.isType,\n });\n\n return result;\n }\n\n /**\n * Generates the TypeScript import statements for the imported symbols.\n *\n * @param isType generate import statements for types (true) or values (false)\n * @returns TypeScript code for the import statements\n */\n toString(): string {\n let typeAbsoluteImportStatements: string[] = [];\n let nonTypeAbsoluteImportStatements: string[] = [];\n let typeRelativeImportStatements: string[] = [];\n let nonTypeRelativeImportStatements: string[] = [];\n\n Object.keys(this.imports).map((importFrom) => {\n const imports = this.imports[importFrom];\n\n // build imports\n [true, false].forEach((typeImports) => {\n const importClauses = imports\n .filter(({ isType }) => isType === typeImports)\n .map(\n ({ exportedSymbol, localSymbol }) =>\n `${exportedSymbol || 'default'}${\n localSymbol === exportedSymbol ? '' : ' as ' + localSymbol\n }`\n )\n .join(',');\n if (importClauses !== '') {\n let resultArray: string[];\n const isRelative = importFrom.startsWith('.');\n if (typeImports && isRelative) {\n resultArray = typeRelativeImportStatements;\n } else if (typeImports && !isRelative) {\n resultArray = typeAbsoluteImportStatements;\n } else if (!typeImports && isRelative) {\n resultArray = nonTypeRelativeImportStatements;\n } else {\n resultArray = nonTypeAbsoluteImportStatements;\n }\n\n resultArray.push(\n `import ${\n typeImports ? 'type ' : ''\n }{${importClauses}} from '${importFrom}';`\n );\n }\n });\n });\n\n // imports should be ordered with type imports last, absolute imports first, relative last\n return [\n ...nonTypeAbsoluteImportStatements.sort(),\n ...nonTypeRelativeImportStatements.sort(),\n ...typeAbsoluteImportStatements.sort(),\n ...typeRelativeImportStatements.sort(),\n ].join('');\n }\n}\n\n/**\n * A TypeScript source file.\n *\n * A File consists of arbirtrarily many appendable blocks of code, each\n * identified by a Symbol. A template determines how the blocks of code\n * are concatenated along with other code to create the final contents\n * of the file.\n */\nexport class File {\n /**\n * Symbol used to add code to the default block.\n */\n static DEFAULT_BLOCK = Symbol();\n\n /**\n * Code blocks for this file.\n */\n blocks = new Map<Symbol, Code>();\n\n /**\n * Template to use when assembling code blocks. Each entry in the array\n * specifies either literal code or the symbol associated with an entry\n * in blocks. The resulting Code objects are concatenated to create the\n * contents of the file.\n */\n template: Array<Code | Symbol> = [File.DEFAULT_BLOCK];\n\n constructor(readonly filename: string) {}\n\n /**\n * Appends new chunks of code to the default code block. Chunks are handled\n * as in Code.push().\n *\n * @param chunks code to be appended to the default code block\n * @returns this\n */\n push(...chunks: any[]): this {\n return this.pushTo(File.DEFAULT_BLOCK, ...chunks);\n }\n\n /**\n * Appends code to the specified code block within this file. Code chunks are\n * handled as in Code.push().\n *\n * @param block block to append code to\n * @param chunks code to be appended\n * @returns this\n */\n pushTo(block: Symbol, ...chunks: any[]): this {\n let code = this.blocks.get(block);\n\n if (!code) {\n this.blocks.set(block, (code = new Code()));\n }\n\n code.push(...chunks);\n\n return this;\n }\n\n /**\n * Returns the code for this File, with ImportableReferences resolved.\n *\n * @param options\n * prettififed - true to run the code through prettier\n * @returns TypeScript source code for this File\n */\n async toString(\n options: {\n prettified?: boolean;\n } = {}\n ): Promise<string> {\n const finalCode = new Code();\n for (const item of this.template) {\n finalCode.push(typeof item === 'symbol' ? this.blocks.get(item) : item);\n }\n\n const imports = new Imports(this.filename);\n const executableCode = finalCode.toString({\n importStringifier: (ir: ImportableReference) => imports.localSymbolFor(ir),\n });\n const code = imports.toString() + executableCode;\n\n if (options.prettified) {\n try {\n return prettier.format(code, { parser: 'typescript' });\n } catch (e) {\n return code;\n }\n }\n return code;\n }\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport type { NamedFileService } from './file';\n\n/**\n * Writes the files collected in a FileService to the filesystem.\n *\n * @param services files to be written\n * @param outputDir directory against which to resolve filenames\n * @param options\n * prettififed - true to run the code through prettier\n */\nexport async function writeFiles(\n services: NamedFileService,\n outputDir: string,\n options: {\n prettified?: boolean;\n } = {}\n): Promise<void> {\n const promises: Promise<any>[] = [];\n\n for (const file of services.file.cache.values()) {\n const filename = path.join(outputDir, file.filename);\n\n promises.push(\n fs.promises\n .mkdir(path.dirname(filename), { recursive: true })\n .then(async () => fs.promises.writeFile(filename, await file.toString(options)))\n );\n }\n\n await Promise.all(promises);\n}\n","import { type ObjectType, type Type } from '@conduit-client/model/v1';\nimport type {\n JSONSchema,\n ObjectType as ObjectJsonSchema,\n RefType,\n} from '@conduit-client/jsonschema-validate';\n\ntype JsonSchemaForOptions = {\n referenceFor?: (t: Type) => RefType | undefined;\n useReferences?: boolean;\n};\n\n/**\n * Returns the JSON schema for a specified type.\n *\n * @param type the type\n * @param options Options\n * @returns JSON schema for type\n */\nexport function jsonSchemaFor(type: Type, options: JsonSchemaForOptions = {}): JSONSchema {\n if (options.useReferences) {\n const existingRef = options.referenceFor?.(type);\n if (existingRef !== undefined) {\n return existingRef;\n }\n }\n\n if (type.type === 'any') {\n return true;\n }\n // arbitrary type with inheritance => allOf(the inherited types + the type w/o inheritance)\n else if (type.type === 'allOf') {\n return {\n allOf: schemasFor({ ...options, useReferences: true }, ...type.allOf),\n };\n } else if (type.type === 'oneOf') {\n return {\n oneOf: schemasFor({ ...options, useReferences: true }, ...type.oneOf),\n };\n } else if (type.type === 'object') {\n return buildObjectSchema(type, { ...options, useReferences: true });\n } else if (type.type === 'discriminatedObject') {\n // discriminated object => oneOf the discriminated types\n return {\n oneOf: schemasFor({ ...options, useReferences: true }, ...Object.values(type.mapping)),\n };\n } else if (type.type === 'array') {\n return {\n type: 'array',\n items: jsonSchemaFor(type.items!, {\n ...options,\n useReferences: true,\n }),\n };\n } else if (\n ['string', 'date', 'time', 'datetime', 'datetime-only'].some((t) => t === type.type)\n ) {\n return { type: 'string' };\n } else if (['double', 'number'].some((t) => t === type.type)) {\n return { type: 'number' };\n } else if (type.type === 'boolean') {\n return { type: 'boolean' };\n } else if (type.type === 'integer') {\n return { type: 'integer' };\n } else if (type.type === 'nil') {\n return { type: 'null' };\n } else if (type.type === 'not') {\n // short-circuit not-any => false\n if (type.not.type === 'any') {\n return false;\n }\n return {\n not: jsonSchemaFor(type.not, {\n ...options,\n useReferences: true,\n }),\n };\n } else if (type.type === 'enum') {\n // TODO: we need to update our jsonschema library to validate on enums\n return true;\n } else if (type.type === 'ref') {\n return jsonSchemaFor(type.$ref, {\n ...options,\n useReferences: true,\n });\n } else {\n throw new Error(`Found unsupported type generating JSONSchema: ${type.type}`);\n }\n}\n\n/**\n * Translates a set of Types to the corresponding JSON schemas, removing duplicates.\n *\n * @param options Options\n * @param types Types\n * @returns JSON schemas for the specified types, deduped\n */\nfunction schemasFor(options: JsonSchemaForOptions = {}, ...types: Type[]): JSONSchema[] {\n return types.reduce((schemas, type) => {\n const schema = jsonSchemaFor(type, { ...options, useReferences: true });\n if (!schemas.find((existing) => existing === schema)) {\n schemas.push(schema);\n }\n return schemas;\n }, [] as JSONSchema[]);\n}\n\n// constructs the JSON schema for a non-discriminated object type\nfunction buildObjectSchema(type: ObjectType, options: JsonSchemaForOptions = {}): ObjectJsonSchema {\n const required: string[] = [];\n const properties: Record<string, JSONSchema> = {};\n\n Object.entries(type.properties).forEach(([propName, propType]) => {\n if (propType.required) {\n required.push(propName);\n }\n properties[propName] = jsonSchemaFor(propType.type, {\n ...options,\n useReferences: true,\n });\n });\n\n return {\n type: 'object',\n properties,\n required,\n additionalProperties: jsonSchemaFor(type.additionalProperties, {\n ...options,\n useReferences: true,\n }),\n };\n}\n","import { type NamedService, toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { Code, code } from '../files';\nimport type { ImportableReference, NamedFileService } from '../files';\nimport type {\n DiscriminatedObjectType,\n ObjectType,\n Type,\n RefType,\n AllOfType,\n OneOf,\n} from '@conduit-client/model/v1';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\n\nexport type TypeDefinitionForOptions = {\n referenceFor?: (t: Type) => ImportableReference | undefined;\n useReferences?: boolean;\n};\n\nexport type ITypeDefinitionService = {\n build(type: Type | undefined): Code;\n};\n\nexport type NamedTypeDefinitionService = NamedService<'typeDefinition', ITypeDefinitionService>;\n\nexport class TypeDefinitionService implements ITypeDefinitionService {\n constructor(\n protected services: NamedAPIService & NamedFileService,\n private fileFor: (typename: string) => string = SINGLE_FILE\n ) {}\n\n cache = new Map<string, ImportableReference>();\n\n build(type: Type | undefined, useReferences = true) {\n return type\n ? this.buildTypeCode(type, {\n referenceFor: (t) => {\n const typename = this.services.api.api.types.nameOf(t);\n return typename ? this.buildTypeDeclaration(typename) : undefined;\n },\n useReferences,\n })\n : code`void`;\n }\n\n buildTypeCode(t: Type, options: TypeDefinitionForOptions): Code {\n // if we're allowed to use references, see if one exists for this type\n if (options.useReferences) {\n const reference = options.referenceFor?.(t);\n if (reference) {\n return code`${reference}`;\n }\n }\n\n // construct the definition for this type\n switch (t.type) {\n case 'allOf': {\n return this.buildAllOfCode(t, options);\n }\n case 'enum': {\n return Code.join(\n t.values.map((enumValue) => {\n if (typeof enumValue === 'string') {\n return `'${enumValue}'`;\n }\n\n return enumValue;\n }),\n '|'\n );\n }\n case 'boolean': {\n return code`boolean`;\n }\n\n case 'double':\n case 'integer': // treat as number for now, but need to check length & use bigint if needed\n case 'number': {\n return code`number`;\n }\n\n case 'nil': {\n return code`null`;\n }\n\n case 'object': {\n return this.buildObjectCode(t, options);\n }\n\n case 'discriminatedObject':\n return this.buildDiscriminatedObjectCode(t, options);\n\n case 'array': {\n return code`Array<${this.buildTypeCode(t.items, {\n ...options,\n useReferences: true,\n })}>`;\n }\n\n case 'oneOf': {\n return this.buildOneOfCode(t, options);\n }\n case 'time':\n case 'date':\n case 'datetime-only':\n case 'datetime':\n case 'string': {\n return code`string`;\n }\n\n case 'any': {\n return code`unknown`;\n }\n case 'not': {\n // no good way to express \"not something\" in typescript at the moment, defer until someone asks for it\n return code`any`;\n }\n case 'ref': {\n return this.buildReferenceCode(t, options);\n }\n }\n\n throw new Error(`unknown type: ${(t as any).type}`);\n }\n\n buildReferenceCode(refType: RefType, options: TypeDefinitionForOptions): Code {\n return this.buildTypeCode(refType.$ref, { ...options, useReferences: true });\n }\n\n buildObjectCode(t: ObjectType, options: TypeDefinitionForOptions): Code {\n const result: Code[] = [];\n result.push(...this.buildObjectProperties(t, options));\n result.push(...this.buildAdditionalProperties(t, options));\n\n return Code.join(result, '&');\n }\n\n buildDiscriminatedObjectCode(\n t: DiscriminatedObjectType,\n options: TypeDefinitionForOptions\n ): Code {\n const result: Code[] = [];\n\n if (Object.keys(t.mapping).length === 0) {\n // default to vanilla object type if no discriminated children are found\n return this.buildObjectCode(t.baseType, options);\n }\n\n Object.entries(t.mapping).forEach(([value, type]) => {\n result.push(\n code`(${this.buildTypeCode(type, {\n ...options,\n useReferences: true,\n })}&{${t.discriminator}:'${value}'})`\n );\n });\n\n return Code.join(result, '|');\n }\n\n buildObjectProperties(t: ObjectType, options: TypeDefinitionForOptions): Code[] {\n const result: Code[] = [];\n // recurse to get definitions for each property\n const propertyDefinitions = Object.entries(t.properties).map(\n ([name, { type, required }]) =>\n // ok to reference type names once we're inside a type\n code`${toTypeScriptSafeIdentifier(name) === name ? name : `'${name}'`}${required ? '' : '?'}:${this.buildTypeCode(\n type,\n {\n ...options,\n useReferences: true,\n }\n )}`\n );\n\n if (propertyDefinitions.length > 0) {\n result.push(code`{${Code.join(propertyDefinitions, ',')}}`);\n } else {\n result.push(code`object`);\n }\n\n return result;\n }\n\n buildAdditionalProperties(t: ObjectType, options: TypeDefinitionForOptions): Code[] {\n const result: Code[] = [];\n\n // No additional properties allowed, default to other parts of the type\n if (t.additionalProperties.type === 'not' && t.additionalProperties.not.type === 'any') {\n return result;\n }\n\n // Additional properties allowed, no schema specified, which means any value is allowed\n // but the type is not known\n if (t.additionalProperties.type === 'any') {\n result.push(code`Record<string,unknown>`);\n return result;\n }\n\n // Additional properties allowed and we have a schema\n result.push(\n code`Record<string,${this.buildTypeCode(t.additionalProperties, {\n ...options,\n useReferences: true,\n })}>`\n );\n\n return result;\n }\n\n buildAllOfCode(t: AllOfType, options: TypeDefinitionForOptions) {\n const allOfCode = t.allOf\n .filter((allOfType) => allOfType.type !== 'any')\n .map((allOfType) => {\n let canonicalType: Type = allOfType;\n while (canonicalType.type === 'ref') {\n canonicalType = canonicalType.$ref;\n }\n\n const type =\n canonicalType.type === 'discriminatedObject'\n ? canonicalType.baseType\n : canonicalType;\n return this.buildTypeCode(type, { ...options, useReferences: true });\n });\n\n if (allOfCode.length === 0) {\n return code`unknown`;\n }\n\n return Code.join(\n allOfCode.map((c) => code`(${c})`),\n '&'\n );\n }\n\n buildOneOfCode(t: OneOf, options: TypeDefinitionForOptions) {\n const oneofCodes = t.oneOf.map((oneOfType) =>\n this.buildTypeCode(oneOfType, { ...options, useReferences: true })\n );\n\n // Note: prettier will remove the parenthesis when not needed.\n return code`(${Code.join(oneofCodes, '|')})`;\n }\n\n getExportedSymbol(typename: string): string {\n return toTypeScriptSafeIdentifier(typename);\n }\n\n // as defined in TypeDeclarationService\n buildTypeDeclaration(typename: string): ImportableReference {\n // see if we've already built this type\n const cacheResult = this.cache.get(typename);\n if (cacheResult) {\n return cacheResult;\n }\n\n // find the type in the API's TypeRegistry\n const typeRegistry = this.services.api.api.types;\n const type = typeRegistry.get(typename);\n if (!type) {\n throw new Error(`type ${typename} is not defined in the model`);\n }\n\n const filename = this.fileFor(typename);\n\n // in cases of types with unsafe characters in the type name, convert\n // to underscores for the exported symbol\n const exportedSymbol = this.getExportedSymbol(typename);\n const result = {\n filename,\n exportedSymbol,\n isType: true,\n };\n // pre-register the declaration; this is done to prevent loops for\n // recursive types\n this.cache.set(typename, result);\n // build the type declaration\n const declaration = code`export type ${exportedSymbol}=${this.build(type, false)};`;\n this.services.file.build(filename).push(declaration);\n\n return result;\n }\n}\n\nexport function typeDefinitions(\n services: NamedAPIService & NamedFileService,\n options: {\n fileFor?: (typename: string) => string;\n } = {}\n) {\n return new TypeDefinitionService(services, options.fileFor || SINGLE_FILE);\n}\n\n// fileFor function that places each type in its own file under the types/ directory\nexport const FILE_PER_TYPE = (typename: string) => `types/${typename}.ts`;\n\n// fileFor function that places all types in a types/types.ts file\nexport const SINGLE_FILE = (_: string) => 'types/types.ts';\n","import { JSONStringify, type NamedService } from '@conduit-client/utils';\nimport { code } from '../files';\nimport { jsonSchemaFor } from './json-schema';\nimport type { Type } from '@conduit-client/model/v1';\nimport type { APIService, NamedAPIService } from '@conduit-client/model/v1';\nimport type { Code, File, FileService, ImportableReference, NamedFileService } from '../files';\nimport type { RefType } from '@conduit-client/jsonschema-validate';\n\n/**\n * A JsonSchemaDeclarationService constructs & tracks JSONSchema definitions for types.\n */\nexport type JsonSchemaDeclarationService = {\n /**\n * Returns a JSONSchema for a specified Type.\n *\n * @param type type to build JSON Schema for. The specified type can be a type in the TypeRegistry\n * associated with this service, contain references to a type in the TypeRegistry, or be a standalone\n * type with no connection to the TypeRegistry.\n * @returns Code containing a TypeScript expression of the JSON schema for the type, eg \"{type:'string'}\"\n * or \"{type:'object',properties:{foo:{$ref:'#/$defs/bar'}},...<ImportableReference>}\". The Code will contain\n * ImportableReferences if the input type references any Types in the service's TypeRegistry.\n */\n build(type: Type): Code;\n};\n\nexport type NamedJSONSchemaDeclarationService<Name extends string = 'jsonSchema'> = NamedService<\n Name,\n JsonSchemaDeclarationService\n>;\n\n// fileFor function that places all named type schemas in a json-schema/schema.ts file\nconst SCHEMA_FILE_PATH = 'json-schema/index.ts';\nconst COMBINED_SCHEMA: ImportableReference = {\n filename: SCHEMA_FILE_PATH,\n exportedSymbol: 'DECLARED_TYPE_DEFINITIONS',\n isType: false,\n};\n\n// identifier for block of $defs code in SCHEMA_FILE_PATH\nconst DEFS_BLOCK = Symbol();\n\n/**\n * An implementation of JsonSchemaDeclarationService that consumes Types from an APIService\n * and generates JSONSchema in Files from a FileService.\n */\nclass JSONSchemas implements JsonSchemaDeclarationService {\n private generated = new Set<Type>();\n private file?: File;\n\n constructor(private services: NamedAPIService & NamedFileService) {}\n\n build(type: Type): Code {\n let usedRef = false;\n const jsonSchemaDef = jsonSchemaFor(type, {\n referenceFor: (t: Type) => {\n const ref = this.getReferenceFor(t);\n if (ref) {\n usedRef = true;\n }\n return ref;\n },\n useReferences: true,\n });\n\n const defCodeString = JSON.stringify(jsonSchemaDef);\n if (usedRef) {\n return code`{...${COMBINED_SCHEMA},${defCodeString.replace('{', '')}`;\n } else {\n return code`${defCodeString}`;\n }\n }\n\n // Logic pulled out to util function to support deeply nested references to defined types.\n private getReferenceFor(type: Type): RefType | undefined {\n const typename = this.services.api.api.types.nameOf(type);\n if (typename === undefined) {\n return undefined;\n }\n\n if (!this.generated.has(type)) {\n // short-circuit recursive type definitions\n this.generated.add(type);\n\n // we'll need the shared schema file\n if (!this.file) {\n this.file = this.services.file.build(SCHEMA_FILE_PATH);\n this.file.template = [\n code`export const ${COMBINED_SCHEMA.exportedSymbol}={$defs:{`,\n DEFS_BLOCK,\n code`}}`,\n ];\n }\n\n // add schema to the combined schema file\n this.file.pushTo(\n DEFS_BLOCK,\n code`\"${typename}\":${JSONStringify(\n jsonSchemaFor(type, { referenceFor: this.getReferenceFor.bind(this) })\n )},`\n );\n }\n\n return { $ref: `#/$defs/${typename}` };\n }\n}\n\n/**\n * Creates a JsonSchemaDeclarationService.\n *\n **/\nexport function jsonSchemaDeclarationService(services: {\n api: APIService;\n file: FileService;\n}): JsonSchemaDeclarationService {\n return new JSONSchemas(services);\n}\n","import {\n AllOfType,\n EnumType,\n isAllOfType,\n isAnyType,\n isArrayType,\n isBooleanType,\n isCanonicalNumberType,\n isCanonicalStringType,\n isDiscriminatedObjectType,\n isEnumType,\n isNotType,\n isObjectType,\n isOneOfType,\n isRefType,\n isScalar,\n isNilType,\n ObjectType,\n OneOf,\n Property,\n ScalarType,\n Type,\n typesEqual,\n NilType,\n} from '@conduit-client/model/v1';\nimport { err, ok, Result } from '@conduit-client/utils';\n\n/**\n * This function is intended to collapse an allOf type into it's concrete type\n * This is allows code generation to operate on a single, canonical type definition\n * that has had any composition resolved. This process occurs by recursively applying\n * intersection between all the members of the allof. If at any point an intersection\n * results in an \"impossible\" type, e.g. string & number, an error is thrown.\n *\n * Please reference the OpenAPI spec to see the intention of composed allOfs:\n * https://spec.openapis.org/oas/v3.1.0.html#composition-and-inheritance-polymorphism\n * @param type The all of type to resolve\n * @returns a resolved type\n */\nexport function resolveAllOfType(type: AllOfType): Type {\n const result = type.allOf.reduce<Result<Type, Error>>(\n (prev, curr) => {\n if (prev.isErr()) {\n return prev;\n }\n // allOf inherently is a composition, so should ignore the top level\n // extensions since extensions aren't inherited\n return intersectTypes(prev.value, { ...curr, extensions: undefined });\n },\n ok({ type: 'any' })\n );\n\n if (result.isErr()) {\n throw result.error;\n }\n\n return result.value;\n}\n\nexport function intersectTypes(a: Type, b: Type): Result<Type, Error> {\n let result: Result<Type, Error> | undefined = undefined;\n\n if (isAnyType(a)) {\n result = ok(b);\n } else if (isAnyType(b)) {\n result = ok(a);\n } else if (isRefType(a)) {\n result = intersectTypes(a.$ref, b);\n } else if (isRefType(b)) {\n result = intersectTypes(a, b.$ref);\n } else if (isAllOfType(a)) {\n result = intersectTypes(resolveAllOfType(a), b);\n } else if (isAllOfType(b)) {\n result = intersectTypes(a, resolveAllOfType(b));\n } else if (isOneOfType(a)) {\n result = intersectOneOf(a, b);\n } else if (isOneOfType(b)) {\n result = intersectOneOf(b, a);\n } else if (isNotType(a)) {\n // We're not going to handle not types, so just defer to the other type\n result = ok(b);\n } else if (isNotType(b)) {\n result = ok(a);\n } else if (isObjectType(a) && isObjectType(b)) {\n result = intersectObjects(a, b);\n } else if (\n (isObjectType(a) && !isObjectType(b) && !isDiscriminatedObjectType(b)) ||\n (isObjectType(b) && !isObjectType(a) && !isDiscriminatedObjectType(a))\n ) {\n result = err(new Error('Object type and non object type cannot be combined'));\n } else if (isObjectType(a) && isDiscriminatedObjectType(b)) {\n result = intersectObjects(a, b.baseType);\n } else if (isDiscriminatedObjectType(a) && isObjectType(b)) {\n result = intersectObjects(a.baseType, b);\n } else if (isDiscriminatedObjectType(a) && isDiscriminatedObjectType(b)) {\n result = err(new Error('Cannot intersect two discriminated objects'));\n } else if (isArrayType(a) && isArrayType(b)) {\n const combinedItemsResult = intersectTypes(a.items, b.items);\n if (combinedItemsResult.isErr()) {\n result = combinedItemsResult;\n } else {\n result = ok({ type: 'array' as const, items: combinedItemsResult.value });\n }\n } else if ((isArrayType(a) && !isArrayType(b)) || (isArrayType(b) && !isArrayType(a))) {\n result = err(new Error('Array type and non array type cannot be combined'));\n } else if (isScalar(a) && isScalar(b)) {\n if (a.type !== b.type) {\n result = err(new Error(`Type mismatch during allOf resolution`));\n } else {\n // We assume here that all scalars types of the same type are the same. This may not\n // be true in the future if we handle date time formats independently\n result = ok(b);\n }\n } else if (isScalar(a) && isEnumType(b)) {\n result = combineScalarAndEnum(a, b);\n } else if (isEnumType(a) && isScalar(b)) {\n result = combineScalarAndEnum(b, a);\n } else if (\n (isScalar(a) && !isScalar(b) && !isEnumType(b)) ||\n (isScalar(b) && !isScalar(a) && !isEnumType(a))\n ) {\n result = err(new Error(`Cannot combine types ${a.type} and ${b.type}`));\n } else if (isNilType(a) && isNilType(b)) {\n result = ok(a);\n } else if (isNilType(a) && isEnumType(b)) {\n result = combineNilAndEnum(a, b);\n } else if (isEnumType(a) && isNilType(b)) {\n result = combineNilAndEnum(b, a);\n }\n\n if (result === undefined) {\n return err(new Error(`Unhandled intersection scenario for types ${a.type} and ${b.type}`));\n }\n\n if (result.isErr()) {\n return result;\n }\n\n return ok(resolveCanonicalIntersectedType(a, b, result.value));\n}\n\nfunction combineScalarAndEnum(a: ScalarType, b: EnumType) {\n // Enum is more specific than scalar, but the values of the\n // enum should be filtered to only those assignable to the scalar\n\n const values = b.values.filter((v) => {\n if (isCanonicalStringType(a) && typeof v === 'string') {\n return true;\n }\n\n if (isCanonicalNumberType(a) && typeof v === 'number') {\n return true;\n }\n\n if (isBooleanType(a) && typeof v === 'boolean') {\n return true;\n }\n\n return false;\n });\n\n if (values.length === 0) {\n return err(new Error('No enum values valid after intersection'));\n }\n\n return ok({\n type: 'enum' as const,\n values,\n });\n}\n\nfunction combineNilAndEnum(a: NilType, b: EnumType) {\n if (b.values.includes(null)) {\n return ok(a);\n }\n\n return err(new Error('Cannot combine nil type and enum type that does not include null'));\n}\n\nfunction intersectObjects(a: ObjectType, b: ObjectType) {\n let errs: Error[] = [];\n const intersectedProps = Object.entries(a.properties).reduce(\n (prev, [propName, prop]) => {\n if (propName in b.properties) {\n const bProp = b.properties[propName];\n const newPropTypeResult = intersectTypes(prop.type, bProp.type);\n if (newPropTypeResult.isOk()) {\n prev[propName] = {\n type: newPropTypeResult.value,\n required: prop.required || bProp.required,\n };\n return prev;\n }\n\n errs.push(newPropTypeResult.error);\n return prev;\n } else {\n const newPropTypeResult = intersectTypes(prop.type, b.additionalProperties);\n if (newPropTypeResult.isOk()) {\n prev[propName] = { ...prop, type: newPropTypeResult.value };\n return prev;\n }\n\n errs.push(newPropTypeResult.error);\n return prev;\n }\n },\n {} as Record<string, Property>\n );\n\n Object.entries(b.properties).reduce((prev, [propName, prop]) => {\n if (propName in intersectedProps) {\n // already resolved\n return prev;\n }\n\n const newPropTypeResult = intersectTypes(prop.type, a.additionalProperties);\n if (newPropTypeResult.isOk()) {\n prev[propName] = { ...prop, type: newPropTypeResult.value };\n return prev;\n }\n errs.push(newPropTypeResult.error);\n\n return prev;\n }, intersectedProps);\n\n if (errs.length > 0) {\n return err(\n new Error(\n `Errors encountered during object resolution:\\n${errs.map((e) => `- ${e.message}`).join('\\n')}`\n )\n );\n }\n\n const intersectedAdditionalPropsResult = intersectTypes(\n a.additionalProperties,\n b.additionalProperties\n );\n if (intersectedAdditionalPropsResult.isErr()) {\n return intersectedAdditionalPropsResult;\n }\n\n return ok({\n type: 'object' as const,\n properties: intersectedProps,\n additionalProperties: intersectedAdditionalPropsResult.value,\n });\n}\n\nfunction intersectOneOf(a: OneOf, b: Type) {\n const intersectedOneOf = a.oneOf.reduce((prev, curr) => {\n const intersectResult = intersectTypes(curr, b);\n if (intersectResult.isErr()) {\n // Exclude this member of the one of from the result\n return prev;\n }\n\n if (intersectResult.value.type === 'oneOf') {\n prev.push(...intersectResult.value.oneOf);\n } else {\n prev.push(intersectResult.value);\n }\n return prev;\n }, [] as Type[]);\n\n if (intersectedOneOf.length === 0) {\n return err(new Error('Intersected union resulted in no possible values'));\n }\n\n return ok({ type: 'oneOf' as const, oneOf: intersectedOneOf });\n}\n\nfunction resolveCanonicalIntersectedType(a: Type, b: Type, result: Type) {\n if (typesEqual(a, result)) {\n return a;\n }\n\n if (typesEqual(b, result)) {\n return b;\n }\n\n return result;\n}\n","import { isIdentifiableType, isRefType, Type } from '@conduit-client/model/v1';\nimport { Code, code } from '../files';\nimport {\n ITypeDefinitionService,\n TypeDefinitionForOptions,\n TypeDefinitionService,\n} from './type-definition';\nimport { ImportableReference } from '../files';\nimport { toTypeScriptSafeIdentifier, type NamedService } from '@conduit-client/utils';\nimport type {\n AllOfType,\n DiscriminatedObjectType,\n NamedAPIService,\n OneOf,\n RefType,\n} from '@conduit-client/model/v1';\nimport type { NamedFileService } from '../files';\nimport { resolveAllOfType } from './resolve-all-of-type';\n\nconst NORMALIZED_LINK: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizedLink',\n isType: true,\n};\n\nexport type INormalizedTypeDefinitionService = {\n buildReference(type: Type): Code;\n buildRepresentation(type: Type): Code;\n};\n\nexport const SINGLE_FILE_NORMALIZED = (_: string) => 'normalization/types.ts';\n\nexport class NormalizedTypeDefinitionService\n extends TypeDefinitionService\n implements INormalizedTypeDefinitionService\n{\n constructor(\n services: NamedAPIService & NamedFileService,\n fileFor: (typename: string) => string = SINGLE_FILE_NORMALIZED\n ) {\n super(services, fileFor);\n }\n\n buildReference(t: Type): Code {\n return this.build(t);\n }\n\n buildRepresentation(t: Type): Code {\n let typeToBuild: Type = { ...t, extensions: undefined };\n if (t.type === 'discriminatedObject') {\n // TODO: there's an issue with copying the mapping from the discriminator since it's a getter, manually copying for now\n typeToBuild = { ...t, mapping: t.mapping, extensions: undefined };\n }\n return this.build(typeToBuild);\n }\n\n build(type: Type | undefined, useReferences = true) {\n if (!useReferences && type) {\n if (isIdentifiableType(type)) {\n // The referencing type will just get a NormalizedLink\n return new Code(NORMALIZED_LINK);\n }\n }\n\n return super.build(type, useReferences);\n }\n\n buildAllOfCode(allOfType: AllOfType, options: TypeDefinitionForOptions): Code {\n const resolved = resolveAllOfType(allOfType);\n return this.buildTypeCode(resolved, options);\n }\n\n buildOneOfCode(t: OneOf, options: TypeDefinitionForOptions): Code {\n const oneofCodes = t.oneOf.map((oneOfType, index) => {\n const normalizedTypeCode = this.buildTypeCode(oneOfType, {\n ...options,\n useReferences: true,\n });\n return code`{discriminator: '${index}', data: ${normalizedTypeCode}}`;\n });\n\n // Note: prettier will remove the parenthesis when not needed.\n return code`(${Code.join(oneofCodes, '|')})`;\n }\n\n buildDiscriminatedObjectCode(\n t: DiscriminatedObjectType,\n options: TypeDefinitionForOptions\n ): Code {\n const result: Code[] = [];\n\n if (Object.keys(t.mapping).length === 0) {\n // default to vanilla object type if no discriminated children are found\n return this.buildObjectCode(t.baseType, options);\n }\n\n Object.entries(t.mapping).forEach(([value, type]) => {\n result.push(\n code`({discriminator: '${value}', data: ${this.buildTypeCode(type, {\n ...options,\n useReferences: true,\n })}})`\n );\n });\n\n return Code.join(result, '|');\n }\n\n getExportedSymbol(typename: string): string {\n const normalizedTypename = `${typename}NormalizedReference`;\n return toTypeScriptSafeIdentifier(normalizedTypename);\n }\n}\n\nexport type NamedNormalizedTypeDefinitionService = NamedService<\n 'normalizedTypeDefinition',\n INormalizedTypeDefinitionService\n>;\n\nexport function normalizedTypeDefinitions(\n services: NamedAPIService & NamedFileService,\n options: {\n fileFor?: (typename: string) => string;\n } = {}\n): NormalizedTypeDefinitionService {\n return new NormalizedTypeDefinitionService(services, options.fileFor);\n}\n","import { code, type ImportableReference } from '../files';\n\nexport const CACHE: ImportableReference = {\n module: '@conduit-client/service-cache/v1',\n exportedSymbol: 'Cache',\n isType: true,\n};\n\nexport const READONLY_CACHE: ImportableReference = {\n module: '@conduit-client/service-cache/v1',\n exportedSymbol: 'ReadonlyCache',\n isType: true,\n};\n\nexport const NORMALIZED_LINK: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizedLink',\n isType: true,\n};\n\nexport const READ_ERRORS: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadErrors',\n isType: true,\n};\n\nexport const WRITE_ERRORS: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteErrors',\n isType: true,\n};\n\nexport const READ_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadInput',\n isType: true,\n};\nexport const WRITE_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteInput',\n isType: true,\n};\n\nexport const NORMALIZE_DATA_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'NormalizeDataInput',\n isType: true,\n};\n\nexport const DENORMALIZE_DATA_INPUT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'DenormalizeDataInput',\n isType: true,\n};\n\nexport const EXTRACT_READ_WRITE_DATA: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'extractReadWriteData',\n isType: false,\n};\n\nexport const BUILD_READ_WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'buildReadWriteResult',\n isType: false,\n};\n\nexport const OK: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'ok',\n isType: false,\n};\n\nexport const RESULT: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'Result',\n isType: true,\n};\n\nexport const READ_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'ReadResult',\n isType: true,\n};\n\nexport const WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteResult',\n isType: true,\n};\n\nexport const DEEP_EQUALS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'deepEquals',\n isType: false,\n};\n\nexport const NAMED_CACHE_CONTROLLER_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const NAMED_PUB_SUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport const TYPE_SERVICES = code`${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUB_SUB_SERVICE}`;\n\nexport const NORMALIZE_UNION_REPRESENTATION: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'normalizeUnionRepresentation',\n isType: false,\n};\n\nexport const DENORMALIZE_UNION_REPRESENTATION: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'denormalizeUnionRepresentation',\n isType: false,\n};\n\nexport const VALIDATE_JSON_SCHEMA: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'validateJsonSchema',\n isType: false,\n};\n","import { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport { code } from '../files';\n\nexport function generateCacheControl(cacheControl: TypeCacheControlExtension) {\n return code`get cacheControl() {return ${getCacheControlValue(cacheControl)} as const}`;\n}\n\nfunction getCacheControlValue(cacheControl: TypeCacheControlExtension) {\n if (cacheControl.type === 'no-cache') {\n return code`{type: 'no-cache'}`;\n }\n return code`{type: 'max-age',maxAge: ${cacheControl['max-age']}}`;\n}\n","import { code } from '../files';\nimport { Code } from '../files';\nimport {\n BUILD_READ_WRITE_RESULT,\n CACHE,\n DENORMALIZE_DATA_INPUT,\n NORMALIZE_DATA_INPUT,\n READ_ERRORS,\n READ_INPUT,\n READ_RESULT,\n READONLY_CACHE,\n TYPE_SERVICES,\n WRITE_ERRORS,\n WRITE_INPUT,\n WRITE_RESULT,\n} from './utils';\nimport type { ImportableReference } from '../files';\nimport type { IdentifiableType, Type } from '@conduit-client/model/v1';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { generateCacheControl } from '../generators/cache-control-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\n\nconst IDENTIFIABLE_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'IdentifiableTypeRepository',\n isType: false,\n};\n\nconst FLATTENED_KEY_SELF_IDENTIFIABLE_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'FlattenedKeySelfIdentifiableTypeRepository',\n isType: false,\n};\n\nconst RESULT: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'Result',\n isType: true,\n};\n\n/**\n * Generates the normalizer class for an identifiable type\n * @param services The services required for this function. TypeDefinitionService is used to generate utility types.\n * TypeRegistryGeneratorService is used to build references to child types\n * @param type The type to generate the normalizer for\n * @param options Options for generating the type, including the type name, namespace, and an optional key param override\n * @returns Class name and code for the build type class\n */\nexport function generateIdentifiableType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: IdentifiableType,\n options: {\n className: string;\n namespace: string;\n name: string;\n keyParamType?: Type;\n }\n) {\n const dataType = services.typeDefinition.build(type);\n const normalizedRepType = services.normalizedTypeDefinition.buildRepresentation(type);\n\n const isSelfIdentifying = options.keyParamType === undefined;\n const normalizationCode = services.normalizeGenerator.build(type, {\n namespace: options.namespace,\n typeRegistryRef: code`this.typeRegistry`,\n cacheRef: code`cache`,\n denormalizeDataRef: code`input.normalizedData`,\n normalizeDataRef: code`input.data`,\n errorsRef: code`errors`,\n existingNormalizedDataRef: code`input.existingNormalizedData`,\n });\n\n const typescriptSafeName = toTypeScriptSafeIdentifier(options.name);\n const readInput = code`${typescriptSafeName}ReadInput`;\n const writeInput = code`${typescriptSafeName}WriteInput`;\n const normalizeDataInput = code`${typescriptSafeName}NormalizeDataInput`;\n const denormalizeDataInput = code`${typescriptSafeName}DenormalizeDataInput`;\n return code`\n type NormalizedRepresentation = ${normalizedRepType};\n type Data = ${dataType};\n type KeyParams = ${buildMappedKey(type, dataType)};\n type ${readInput} = ${READ_INPUT}\n type ${writeInput} = ${WRITE_INPUT}<Data${isSelfIdentifying ? '' : ',{keyParams:KeyParams}'}>\n type ${normalizeDataInput} = ${NORMALIZE_DATA_INPUT}<Data, NormalizedRepresentation>\n type ${denormalizeDataInput} = ${DENORMALIZE_DATA_INPUT}<NormalizedRepresentation>\n export class ${options.className} extends ${isSelfIdentifying ? FLATTENED_KEY_SELF_IDENTIFIABLE_TYPE_REPOSITORY : IDENTIFIABLE_TYPE_REPOSITORY}<Data, NormalizedRepresentation, KeyParams, ${readInput}, ${writeInput}> {\n namespace = '${options.namespace}'\n typeName = '${options.name}'\n ${generateCacheControl(type.extensions['cache-control'])}\n keySchema = ${JSON.stringify(Object.keys(type.extensions.key.fields).sort())};\n \n constructor(protected typeRegistry: ${{ ...services.typeRegistryGenerator.build(), isType: true }}, services: ${TYPE_SERVICES}){super(services)}\n \n buildKeyParams(input: ${writeInput}){\n return ${isSelfIdentifying ? buildMappedKey(type, code`input.data`) : code`input.keyParams`}\n }\n denormalizeData(cache: ${READONLY_CACHE}, input: ${denormalizeDataInput}): ${RESULT}<${dataType},${READ_ERRORS}> {\n const errors: ${READ_ERRORS} = []\n const denormalized = ${normalizationCode.denormalize}\n return ${BUILD_READ_WRITE_RESULT}<Data, ${READ_ERRORS}>(denormalized, errors)\n }\n normalizeData(cache: ${CACHE}, input: ${normalizeDataInput}): ${RESULT}<${normalizedRepType}, ${WRITE_ERRORS}> {\n const errors: ${WRITE_ERRORS} = []\n const normalized = ${normalizationCode.normalize}\n return ${BUILD_READ_WRITE_RESULT}<NormalizedRepresentation, ${WRITE_ERRORS}>(normalized, errors)\n }\n }`;\n}\n\nfunction buildMappedKey(type: IdentifiableType, typeCode: Code): Code {\n return code`{${Code.join(\n Object.entries(type.extensions.key.fields).map(([keyParamName, typePath]) => {\n const typePathParts = typePath.split('.');\n const accessor = typePathParts.reduce((prev, curr) => {\n return code`${prev}['${curr}']`;\n }, new Code());\n return code`${keyParamName}:${typeCode}${accessor}`;\n }),\n ','\n )}}`;\n}\n","import { code } from '../files';\nimport {\n BUILD_READ_WRITE_RESULT,\n CACHE,\n DEEP_EQUALS,\n DENORMALIZE_DATA_INPUT,\n NORMALIZE_DATA_INPUT,\n READ_ERRORS,\n READONLY_CACHE,\n TYPE_SERVICES,\n WRITE_ERRORS,\n} from './utils';\nimport type { UnidentifiableType } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\n\nconst TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'TypeRepository',\n isType: true,\n};\n\nconst WRITE_RESULT: ImportableReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'WriteResult',\n isType: true,\n};\n\n/**\n * Generates the normalizer class for an unidentifiable type\n * @param services The services required for this function. TypeDefinitionService is used to generate utility types.\n * TypeRegistryGeneratorService is used to build references to child types\n * @param type The type to generate the normalizer for\n * @param options Options for generating the type, including the type name and namespace\n * @returns Class name and code for the build type class\n */\nexport function generateUnidentifiableType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: UnidentifiableType,\n options: {\n namespace: string;\n name: string;\n className: string;\n }\n) {\n const dataType = services.typeDefinition.build(type);\n const normalizedRefType = services.normalizedTypeDefinition.buildReference(type);\n\n const normalizationCode = services.normalizeGenerator.build(type, {\n namespace: options.namespace,\n typeRegistryRef: code`this.typeRegistry`,\n cacheRef: code`cache`,\n denormalizeDataRef: code`input.normalizedData`,\n normalizeDataRef: code`input.data`,\n existingNormalizedDataRef: code`input.existingNormalizedData`,\n errorsRef: code`errors`,\n });\n const typescriptSafeName = toTypeScriptSafeIdentifier(options.name);\n\n const writeInput = code`${typescriptSafeName}WriteInput`;\n const readInput = code`${typescriptSafeName}ReadInput`;\n\n return code`\n type Data = ${dataType}\n type NormalizedReference = ${normalizedRefType};\n\n type ${writeInput} = ${NORMALIZE_DATA_INPUT}<Data, NormalizedReference>\n type ${readInput} = ${DENORMALIZE_DATA_INPUT}<NormalizedReference>\n export class ${options.className} implements ${TYPE_REPOSITORY}<Data, ${readInput}, NormalizedReference, ${writeInput}> {\n namespace = '${options.namespace}'\n typeName = '${options.name}'\n\n constructor(protected typeRegistry: ${{ ...services.typeRegistryGenerator.build(), isType: true }}, services: ${TYPE_SERVICES}){}\n\n write(cache: ${CACHE}, input: ${writeInput}): ${WRITE_RESULT}<NormalizedReference> {\n const errors: ${WRITE_ERRORS} = []\n const normalized = ${normalizationCode.normalize}\n return ${BUILD_READ_WRITE_RESULT}<NormalizedReference, ${WRITE_ERRORS}>(normalized, errors)\n }\n\n read(cache: ${READONLY_CACHE}, input: ${readInput}){\n const errors: ${READ_ERRORS} = []\n const denormalized = ${normalizationCode.denormalize}\n return ${BUILD_READ_WRITE_RESULT}<Data, ${READ_ERRORS}>(denormalized, errors)\n }\n\n equals(a: Data, b: Data){return ${DEEP_EQUALS}(a,b)}\n }`;\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { generateIdentifiableType } from './identifiable-type-generator';\nimport { generateUnidentifiableType } from './unidentifiable-type-generator';\nimport type { ImportableValueReference, NamedFileService } from '../files';\nimport { isIdentifiableType, UnidentifiableType, type Type } from '@conduit-client/model/v1';\nimport type { NamedNormalizedTypeDefinitionService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from './type-registry-generator';\nimport { NamedNormalizeGeneratorService } from './normalize-code-gen/normalize-generator-service';\n\nexport type INormalizedTypeGenerator = {\n build(options: {\n namespace: string;\n name: string;\n type: Type;\n keyParamType?: Type;\n }): ImportableValueReference;\n\n buildRef(options: {\n namespace: string;\n name: string;\n type: Type;\n keyParamType?: Type;\n }): ImportableValueReference;\n};\n\ntype Options = { namespace: string; name: string; type: Type; keyParamsType?: Type };\n\nexport const FILE_PER_NORMALIZED_TYPE = (typename: string) =>\n `normalization/${toTypeScriptSafeIdentifier(typename)}.ts`;\n\n/**\n * A class for building normalized type class implementations\n */\nexport class NormalizedTypeGenerator implements INormalizedTypeGenerator {\n constructor(\n protected services: NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n private fileFor: (typename: string) => string = FILE_PER_NORMALIZED_TYPE,\n private generateType: typeof defaultGenerateType = defaultGenerateType\n ) {}\n\n cache = new Map<string, ImportableValueReference>();\n\n protected typeBuildersSymbol = Symbol.for('typeBuilders');\n\n /**\n *\n * @param options The options for building the type normalizer, inclduing the namespace, the name, the type, and key param overrides\n * @returns An importable reference for the type class\n */\n build(options: Options): ImportableValueReference {\n const cacheKey = `${options.namespace}:${options.name}`;\n const cachedRef = this.cache.get(cacheKey);\n if (cachedRef) {\n return cachedRef;\n }\n\n const ref = this.buildRef(options);\n const className = ref.exportedSymbol;\n\n const file = this.services.file.build(ref.filename);\n this.cache.set(cacheKey, ref);\n\n const code = this.generateType(this.services, options.type, { ...options, className });\n\n file.push(code);\n\n return ref;\n }\n\n buildRef(options: Options) {\n const filename = this.fileFor(options.name!);\n const className = toTypeScriptSafeIdentifier(`${options.name}Repository`);\n const ref = { filename, exportedSymbol: className, isType: false } as const;\n return ref;\n }\n}\n\nfunction defaultGenerateType(\n services: NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedNormalizedTypeDefinitionService,\n type: Type,\n options: Options & { className: string }\n) {\n return isIdentifiableType(type)\n ? generateIdentifiableType(services, type, options)\n : generateUnidentifiableType(services, type as UnidentifiableType, options);\n}\n","import { type NamedService } from '@conduit-client/utils';\nimport { Code, code } from '../../files';\nimport { type ObjectType, type Type } from '@conduit-client/model/v1';\nimport type { DiscriminatedObjectType, NamedAPIService, OneOf } from '@conduit-client/model/v1';\nimport { NamedTypeRegistryGeneratorService } from '../type-registry-generator';\nimport {\n DENORMALIZE_UNION_REPRESENTATION,\n EXTRACT_READ_WRITE_DATA,\n NORMALIZE_UNION_REPRESENTATION,\n VALIDATE_JSON_SCHEMA,\n} from '../utils';\nimport {\n NamedJSONSchemaDeclarationService,\n NamedNormalizedTypeDefinitionService,\n NamedTypeDefinitionService,\n} from '../../types';\nimport { resolveAllOfType } from '../../types/resolve-all-of-type';\n\n/**\n * The input options for the normalize generator service. Includes all the\n * data and code references required to build an implementation of normalize & denormalize method bodies\n */\ntype Options = {\n namespace: string;\n typeRegistryRef: Code;\n cacheRef: Code;\n denormalizeDataRef: Code;\n normalizeDataRef: Code;\n existingNormalizedDataRef: Code;\n errorsRef: Code;\n useReferences?: boolean;\n};\n\n/**\n * The result type of the normalize generator service\n */\ntype NormalizationCode = {\n normalize: Code;\n denormalize: Code;\n};\n\n/**\n * An interface for a service that builds the normalization and denormalization code\n * for a given type, given a set of code references for required variables, e.g.\n * a type registry, the data to normalized/denormalize, etc.\n */\nexport type INormalizeGeneratorService = {\n build(type: Type, options: Options): NormalizationCode;\n};\n\n/**\n * The named service definition for the normalize generator\n */\nexport type NamedNormalizeGeneratorService = NamedService<\n 'normalizeGenerator',\n INormalizeGeneratorService\n>;\n\n/**\n * The implementation of the normalize generator service.\n */\nexport class NormalizeGeneratorService implements INormalizeGeneratorService {\n constructor(\n protected services: NamedAPIService &\n NamedTypeRegistryGeneratorService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService &\n NamedJSONSchemaDeclarationService\n ) {}\n\n /**\n * The public interface method for the normalize generator service, used\n * to build the body of denormalize/normalize methods.\n * @param type The type to generate normalization/denormalization code for\n * @param options The set of required input options to generate the code\n * @returns The normalize and denormalize code\n */\n build(type: Type, options: Options): NormalizationCode {\n const c = this.buildNormalizeCode(type, options);\n if (c === undefined) {\n return {\n normalize: code`${options.normalizeDataRef}`,\n denormalize: code`${options.denormalizeDataRef}`,\n };\n }\n\n return c;\n }\n\n buildNormalizeCode(type: Type, options: Options): NormalizationCode | undefined {\n const { namespace, typeRegistryRef, cacheRef, denormalizeDataRef, normalizeDataRef } =\n options;\n const typeName = this.services.api.api.types.nameOf(type);\n\n if (typeName !== undefined && options.useReferences) {\n const build = (dataRef: Code, method: 'write' | 'read') =>\n code`${EXTRACT_READ_WRITE_DATA}(${typeRegistryRef}.${this.services.typeRegistryGenerator.buildType(type, { name: typeName, namespace }).propertyName}.${method}(${cacheRef},${method === 'read' ? `{normalizedData:${dataRef}}` : `{data:${dataRef}, existingNormalizedData:${options.existingNormalizedDataRef}}`}), ${options.errorsRef})`;\n return {\n normalize: build(normalizeDataRef, 'write'),\n denormalize: build(denormalizeDataRef, 'read'),\n };\n }\n\n // otherwise, we need to traverse the type\n switch (type.type) {\n case 'allOf': {\n return this.buildNormalizeCode(resolveAllOfType(type), options);\n }\n case 'object': {\n return this.buildObjectCode(type, options);\n }\n\n case 'discriminatedObject':\n return this.buildDiscriminatedObjectCode(type, options);\n\n case 'array': {\n const itemsNormalizationCode = this.buildNormalizeCode(type.items, {\n ...options,\n normalizeDataRef: code`el`,\n denormalizeDataRef: code`el`,\n useReferences: true,\n existingNormalizedDataRef: code`${options.existingNormalizedDataRef}?.[idx]`,\n });\n if (itemsNormalizationCode === undefined) {\n return undefined;\n }\n const itemType = this.services.typeDefinition.build(type.items);\n const normalizedItemType = this.services.normalizedTypeDefinition.buildReference(\n type.items\n );\n\n const build = (dataRef: Code, itemTransform: Code, itemType: Code) =>\n code`${dataRef}.map((el: ${itemType}, idx: number) => {return ${itemTransform}})`;\n return {\n normalize: build(normalizeDataRef, itemsNormalizationCode.normalize, itemType),\n denormalize: build(\n denormalizeDataRef,\n itemsNormalizationCode.denormalize,\n normalizedItemType\n ),\n };\n }\n\n case 'oneOf': {\n return this.buildOneOfCode(type, options);\n }\n\n case 'ref': {\n return this.buildNormalizeCode(type.$ref, { ...options, useReferences: true });\n }\n case 'enum':\n case 'boolean':\n case 'double':\n case 'integer':\n case 'number':\n case 'nil':\n case 'time':\n case 'date':\n case 'datetime-only':\n case 'datetime':\n case 'string':\n case 'any':\n case 'not': {\n return undefined;\n }\n }\n\n throw new Error(`unknown type: ${(type as any).type}`);\n }\n\n buildObjectCode(t: ObjectType, options: Options): NormalizationCode | undefined {\n const propCodes = this.buildPropCodes(t, options);\n const additionalPropsCode = this.buildAdditionalPropsCode(t, propCodes.length > 0, options);\n\n if (propCodes.length === 0 && additionalPropsCode === undefined) {\n return undefined;\n }\n\n const build = (\n dataRef: Code,\n propsCodes: Code[],\n additionalPropsCode: Code | undefined\n ) => {\n return code`{...${dataRef},${propsCodes.length > 0 ? code`${Code.join(propsCodes, ',')},` : code``}${additionalPropsCode ? code`...${additionalPropsCode}` : code``}}`;\n };\n\n return {\n normalize: build(\n options.normalizeDataRef,\n propCodes.map((c) => c.normalize),\n additionalPropsCode?.normalize\n ),\n denormalize: build(\n options.denormalizeDataRef,\n propCodes.map((c) => c.denormalize),\n additionalPropsCode?.denormalize\n ),\n };\n }\n\n buildPropCodes(t: ObjectType, options: Options): NormalizationCode[] {\n return Object.entries(t.properties)\n .map(([propName, prop]) => {\n const propAccessor = code`['${propName}']`;\n const normalizedPropRef = code`${options.normalizeDataRef}${propAccessor}`;\n const denormalizePropRef = code`${options.denormalizeDataRef}${propAccessor}`;\n const propTypeCode = this.buildNormalizeCode(prop.type, {\n ...options,\n normalizeDataRef: normalizedPropRef,\n denormalizeDataRef: denormalizePropRef,\n useReferences: true,\n existingNormalizedDataRef: code`input.existingNormalizedData?.${propAccessor}`,\n });\n if (propTypeCode === undefined) {\n return undefined;\n }\n if (prop.required) {\n const build = (propCode: Code) => code`${propName}: ${propCode}`;\n return {\n normalize: build(propTypeCode.normalize),\n denormalize: build(propTypeCode.denormalize),\n };\n } else {\n const build = (dataRef: Code, propCode: Code) =>\n code`${propName}: ${dataRef} ? ${propCode} : undefined`;\n return {\n normalize: build(normalizedPropRef, propTypeCode.normalize),\n denormalize: build(denormalizePropRef, propTypeCode.denormalize),\n };\n }\n })\n .filter((c) => c !== undefined) as NormalizationCode[];\n }\n\n buildAdditionalPropsCode(\n t: ObjectType,\n hasExplicitPropertiesDefined: boolean,\n options: Options\n ): NormalizationCode | undefined {\n let additionalPropertiesCode: NormalizationCode | undefined = undefined;\n\n const hasAdditionalProperties =\n t.additionalProperties.type !== 'not' || t.additionalProperties.not.type !== 'any';\n if (hasAdditionalProperties) {\n const additionalPropertiesTypeCode = this.buildNormalizeCode(t.additionalProperties, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`${options.denormalizeDataRef}![curr]`,\n normalizeDataRef: code`${options.normalizeDataRef}![curr]`,\n existingNormalizedDataRef: code`${options.existingNormalizedDataRef}?.[curr]`,\n });\n if (additionalPropertiesTypeCode !== undefined) {\n const build = (dataRef: Code, additionalPropsCode: Code) => {\n const filterAdditionalPropsByDefinedProps = hasExplicitPropertiesDefined\n ? code`.filter(key => ![${Code.join(\n Object.keys(t.properties).map((propName) => code`'${propName}'`),\n ','\n )}].includes(key))`\n : code``;\n return code`Object.keys(${dataRef})${filterAdditionalPropsByDefinedProps}.reduce((prev, curr) => {prev[curr]=${additionalPropsCode};return prev;}, {} as Record<string, unknown>)`;\n };\n additionalPropertiesCode = {\n normalize: build(\n options.normalizeDataRef,\n additionalPropertiesTypeCode.normalize\n ),\n denormalize: build(\n options.denormalizeDataRef,\n additionalPropertiesTypeCode.denormalize\n ),\n };\n }\n }\n\n return additionalPropertiesCode;\n }\n\n buildOneOfCode(type: OneOf, options: Options): NormalizationCode | undefined {\n const results = type.oneOf.map((oneOfType, index) => {\n const discriminator = `'${index}'`;\n const normalizeCode = this.buildNormalizeCode(oneOfType, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`data`,\n normalizeDataRef: code`data`,\n existingNormalizedDataRef: code`(${options.existingNormalizedDataRef})?.discriminator === ${discriminator} ? (${options.existingNormalizedDataRef})?.data : undefined`,\n });\n const jsonSchema = this.services.jsonSchema.build(oneOfType);\n\n return {\n discriminator,\n normalizeCode,\n jsonSchema,\n discriminatedType: oneOfType,\n };\n });\n\n if (results.every((r) => r.normalizeCode === undefined)) {\n return undefined;\n }\n\n const unionMap = code`{\n ${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {data: ${this.services.typeDefinition.build(r.discriminatedType)}, normalized: ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}}`;\n }),\n ','\n )}\n }`;\n\n return {\n normalize: code`${NORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.normalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {test: (data) => ${VALIDATE_JSON_SCHEMA}(data, ${r.jsonSchema}).isOk(), normalize: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.normalize} as ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}`}}`;\n }),\n ','\n )}})`,\n denormalize: code`${DENORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.denormalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: (data: any) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.denormalize} as ${this.services.typeDefinition.build(r.discriminatedType)}`}`;\n }),\n ','\n )}})`,\n };\n }\n\n buildDiscriminatedObjectCode(t: DiscriminatedObjectType, options: Options) {\n const results = Object.entries(t.mapping).map(([discriminator, discriminatedType]) => {\n const normalizeCode = this.buildNormalizeCode(discriminatedType, {\n ...options,\n useReferences: true,\n denormalizeDataRef: code`data`,\n normalizeDataRef: code`data`,\n existingNormalizedDataRef: code`(${options.existingNormalizedDataRef})?.discriminator === '${discriminator}' ? (${options.existingNormalizedDataRef})?.data : undefined`,\n });\n\n return {\n discriminator,\n normalizeCode,\n discriminatedType,\n };\n });\n\n if (results.every((r) => r.normalizeCode === undefined)) {\n return undefined;\n }\n\n const unionMap = code`{\n ${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {data: ${this.services.typeDefinition.build(r.discriminatedType)}, normalized: ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}}`;\n }),\n ','\n )}\n }`;\n\n return {\n normalize: code`${NORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.normalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: {test: (data) => data['${t.discriminator}'] === '${r.discriminator}', normalize: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.normalize} as ${this.services.normalizedTypeDefinition.buildReference(r.discriminatedType)}`}}`;\n }),\n ','\n )}})`,\n denormalize: code`${DENORMALIZE_UNION_REPRESENTATION}<${unionMap}>(${options.denormalizeDataRef}, {${Code.join(\n results.map((r) => {\n return code`${r.discriminator}: (data) => ${r.normalizeCode === undefined ? 'data' : code`${r.normalizeCode?.denormalize} as ${this.services.typeDefinition.build(r.discriminatedType)}`}`;\n }),\n ','\n )}})`,\n };\n }\n}\n\nexport function normalizeGenerator(\n services: NamedTypeDefinitionService &\n NamedAPIService &\n NamedTypeRegistryGeneratorService &\n NamedJSONSchemaDeclarationService &\n NamedNormalizedTypeDefinitionService\n) {\n return new NormalizeGeneratorService(services);\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { Code, code } from '../files';\nimport { NormalizedTypeGenerator } from './normalized-type-generator';\nimport type {\n NamedJSONSchemaDeclarationService,\n NamedNormalizedTypeDefinitionService,\n NamedTypeDefinitionService,\n} from '../types';\nimport type { INormalizedTypeGenerator } from './normalized-type-generator';\nimport type { NamedService } from '@conduit-client/utils';\nimport type { File, ImportableValueReference, NamedFileService } from '../files';\nimport { NamedAPIService, isIdentifiableType, type Type } from '@conduit-client/model/v1';\nimport { TYPE_SERVICES } from './utils';\nimport {\n INormalizeGeneratorService,\n NamedNormalizeGeneratorService,\n NormalizeGeneratorService,\n} from './normalize-code-gen/normalize-generator-service';\n\ntype TypeRepositoryReference = { propertyName: string; typeClassRef: ImportableValueReference };\ntype Options = { name: string; namespace: string; keyParamType?: Type; isInvalidatable?: boolean };\n\nexport type ITypeRegistryGeneratorService = {\n build(): ImportableValueReference;\n buildType(type: Type, options: Options): TypeRepositoryReference;\n\n invalidatableTypes: TypeRepositoryReference[];\n};\n\nexport type NamedTypeRegistryGeneratorService<Name extends string = 'typeRegistryGenerator'> =\n NamedService<Name, ITypeRegistryGeneratorService>;\n\nconst TYPE_REGISTRY_CLASS = 'TypeRegistry';\n\n/**\n * A class for building the type registry for a given module\n */\nexport class TypeRegistryGenerator implements ITypeRegistryGeneratorService {\n constructor(\n protected services: NamedFileService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService,\n protected typeGenerator: INormalizedTypeGenerator,\n protected filename: string = TYPE_REGISTRY_FILE\n ) {}\n\n _file: File | undefined = undefined;\n\n protected typeDeclarationsSymbol = Symbol.for('typeDeclarations');\n protected typeInstantiationsSymbol = Symbol.for('typeInstantiations');\n protected typeGettersSymbol = Symbol.for('typeGetters');\n cache = new Map<string, TypeRepositoryReference>();\n\n /**\n * Note: Use with caution, it is only guaranteed to have the types with normalization\n * after all operations precessing is complete.\n */\n invalidatableTypes: TypeRepositoryReference[] = [];\n\n private get file() {\n return this.buildFile();\n }\n\n private buildFile(): File {\n if (this._file) {\n return this._file;\n }\n\n const file = this.services.file.build(this.filename);\n file.template = this.template;\n this._file = file;\n return file;\n }\n\n get template() {\n return [\n code`export class ${TYPE_REGISTRY_CLASS} {`,\n this.typeDeclarationsSymbol,\n code`constructor(protected services: ${TYPE_SERVICES}) {`,\n this.typeInstantiationsSymbol,\n code`}`,\n this.typeGettersSymbol,\n code`}`,\n ];\n }\n\n /**\n * A method for building the base type registry code, without any classes populated\n * @returns\n */\n build() {\n this.buildFile();\n return {\n filename: this.filename,\n exportedSymbol: TYPE_REGISTRY_CLASS,\n isType: false,\n } as const;\n }\n\n /**\n * A method for building/adding a specific type to the registry\n * @param type The type to add to the registry\n * @param options Options including namespace, name, and key overrides\n * @returns The name of the method on the registry used to build the type, and an importable reference to the type class\n */\n buildType(type: Type, options: Options) {\n const cacheKey = `${options.namespace}:${options.name}`;\n let cachedResult = this.cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n\n const propertyName = `${toTypeScriptSafeIdentifier(options.name)}`;\n const ref = this.typeGenerator.buildRef({ type, ...options });\n const result = { propertyName, typeClassRef: ref };\n this.cache.set(cacheKey, result);\n\n this.typeGenerator.build({ type, ...options });\n\n const privateName = code`_${propertyName}`;\n\n this.file.pushTo(this.typeDeclarationsSymbol, code`${privateName}: ${ref};`);\n this.file.pushTo(\n this.typeInstantiationsSymbol,\n code`this.${privateName} = new ${ref}(this, this.services);`\n );\n this.file.pushTo(\n this.typeGettersSymbol,\n code`get ${propertyName}(){return this.${privateName}}`\n );\n\n const builderMethodCode = new Code();\n builderMethodCode.push(\n code`${propertyName}(){ return new `,\n ref,\n code`(this, this.services) }`\n );\n\n if (\n isIdentifiableType(type) &&\n (options.isInvalidatable === undefined || options.isInvalidatable)\n ) {\n this.invalidatableTypes.push(result);\n }\n\n return result;\n }\n}\n\nexport const TYPE_REGISTRY_FILE = 'normalization/type-registry.ts';\n\n/**\n * Creates a TypeRegistryGeneratorService.\n *\n **/\nexport function typeRegistryGeneratorService(\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedNormalizedTypeDefinitionService &\n NamedJSONSchemaDeclarationService &\n Partial<NamedNormalizeGeneratorService>,\n typeGenerator?: INormalizedTypeGenerator\n): ITypeRegistryGeneratorService {\n const typeGeneratorServices: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedNormalizeGeneratorService &\n NamedJSONSchemaDeclarationService &\n NamedNormalizedTypeDefinitionService = {\n ...services,\n typeRegistryGenerator: undefined as any,\n normalizeGenerator: undefined as any,\n };\n typeGeneratorServices.normalizeGenerator =\n services.normalizeGenerator || new NormalizeGeneratorService(typeGeneratorServices);\n\n const tg = typeGenerator || new NormalizedTypeGenerator(typeGeneratorServices);\n const typeRegistryGenerator = new TypeRegistryGenerator(services, tg);\n typeGeneratorServices.typeRegistryGenerator = typeRegistryGenerator;\n return typeRegistryGenerator;\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLFieldType,\n GraphQLListFieldType,\n GraphQLSchemaModel,\n GraphQLSingleFieldType,\n GraphQLTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\n\nexport const BASE_SCALAR_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseScalarFieldDef',\n isType: false,\n};\n\nexport const BASE_OBJECT_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseObjectFieldDef',\n isType: false,\n};\n\nexport const BASE_ARRAY_FIELD_DEF: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseArrayFieldDef',\n isType: false,\n};\n\nexport const FIELD_DEFS: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'FieldDefs',\n isType: true,\n};\n\nexport const GRAPHQL_INPUT_EXTENSION: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLInputExtension',\n isType: true,\n};\n\nexport const GRAPHQL_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLData',\n isType: true,\n};\n\nexport const GRAPHQL_TYPE_SERVICES: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const GRAPHQL_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport type GenerationOptions = {\n namespace: string;\n name: string;\n className: string;\n};\n\nexport abstract class BaseGraphQLTypeGenerator<\n T extends GraphQLTypeModel & {\n fields?: Record<string, GraphQLFieldType>;\n interfaces?: string[];\n },\n> {\n constructor(protected services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService) {}\n\n /**\n * Determine if a GraphQL type should be treated as an object-like type\n * that needs a repository in the type registry\n */\n private isObjectLikeType(type: GraphQLTypeModel): boolean {\n return type.kind === 'object' || type.kind === 'interface' || type.kind === 'union';\n }\n\n /**\n * Ensure a referenced type is built and return the appropriate registry reference\n */\n protected ensureTypeBuiltAndGetReference(\n referencedType: GraphQLTypeModel,\n schemaModel: GraphQLSchemaModel\n ): Code {\n if (this.isObjectLikeType(referencedType)) {\n // Object-like type: ensure it's built and reference through typeRegistry\n const ref = this.services.graphqlTypeRegistryGenerator.buildGraphQLType({\n type: referencedType as any,\n schemaModel,\n });\n return code`this.typeRegistry.${ref.propertyName}`;\n } else {\n // For scalar/enum types, we might need different handling\n // For now, assume they don't need registry references\n throw new Error(\n `Type ${referencedType.name} is not an object-like type and cannot be referenced in possibleTypes`\n );\n }\n }\n\n /**\n * Generate a field definition for a single field type (recursive helper)\n */\n private generateSingleFieldDef(\n fieldType: GraphQLSingleFieldType | GraphQLListFieldType,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel\n ): Code {\n if (fieldType.kind === 'single') {\n const { name: typeName, nullable } = fieldType;\n const referencedType = schemaModel.types.find((t) => t.name === typeName);\n\n if (referencedType && this.isObjectLikeType(referencedType)) {\n // Object field: User, Post, etc. - ensure it's built and reference through typeRegistry\n const ref = this.ensureTypeBuiltAndGetReference(referencedType, schemaModel);\n return code`new ${BASE_OBJECT_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(${ref}, ${nullable})`;\n } else {\n // Scalar field: String, Int, ID, enum types, custom scalars, etc.\n // This covers built-in scalars, custom scalars, enums, and any unknown types\n return code`new ${BASE_SCALAR_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(${nullable})`;\n }\n } else if (fieldType.kind === 'list') {\n const { nullable: arrayNullable, items } = fieldType;\n\n // Generate the item field definition recursively\n const itemFieldDef = this.generateSingleFieldDef(\n items,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel\n );\n\n // Wrap in array field definition\n return code`new ${BASE_ARRAY_FIELD_DEF}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>(\n ${itemFieldDef},\n ${arrayNullable}\n )`;\n } else {\n throw new Error(`Unexpected field type in field definition.`);\n }\n }\n\n /**\n * Generate field definitions for a GraphQL type\n */\n protected generateFieldDefinitions(\n type: T,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel,\n namespace: string\n ): Code[] {\n if (!type.fields) {\n return [];\n }\n\n return Object.entries(type.fields).map(([fieldName, fieldType]) => {\n const fieldDef = this.generateSingleFieldDef(\n fieldType.type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel\n );\n\n return code`${fieldName}: ${fieldDef}`;\n });\n }\n\n /**\n * Generate complete fields property as a getter method to avoid circular dependencies\n */\n protected generateFieldsProperty(\n type: T,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n schemaModel: GraphQLSchemaModel,\n namespace: string\n ): Code {\n const fieldDefs = this.generateFieldDefinitions(\n type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel,\n namespace\n );\n\n const fieldsCode = Code.join(fieldDefs, ',\\n ');\n\n return code`get fields() {\n return {\n ${fieldsCode}\n } satisfies ${FIELD_DEFS}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ExtraInputExtension>;\n }`;\n }\n\n /**\n * Get the ImportableReference for the GraphQLTypeRegistry\n */\n protected getGraphQLTypeRegistryReference(): {\n filename: string;\n exportedSymbol: string;\n isType: false;\n } {\n return {\n filename: 'normalization/graphql-type-registry.ts',\n exportedSymbol: 'GraphQLTypeRegistry',\n isType: false,\n };\n }\n\n /**\n * Generate constructor that accepts services and type registry\n */\n protected generateConstructor(): Code {\n const typeRegistryRef = this.getGraphQLTypeRegistryReference();\n return code`constructor(\n protected services: ${GRAPHQL_TYPE_SERVICES} & ${GRAPHQL_PUBSUB_SERVICE},\n protected typeRegistry: ${typeRegistryRef}<ExtraInputExtension>\n ) {\n super(services);\n }`;\n }\n\n /**\n * Generate common properties shared by all GraphQL type repositories\n */\n protected generateCommonProperties(type: T, options: GenerationOptions): Code {\n return code`namespace = '${options.namespace}';\n typeName = '${type.name}';\n implementedInterfaces = ${JSON.stringify(type.interfaces || [])};\n `;\n }\n\n /**\n * Generate a standard GraphQL type class with common structure\n */\n protected generateStandardClass(\n type: T,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions,\n baseClass: ImportableReference,\n genericTypes: {\n data: string | ImportableReference;\n normalized: string | ImportableReference;\n },\n additionalMethods: Code[] = []\n ): Code {\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n\n // Generate fields property if the type has fields (for types that need field definitions)\n const fieldsProperty = this.generateFieldsProperty(\n type,\n genericTypes?.data || GRAPHQL_DATA,\n genericTypes?.normalized || 'any',\n schemaModel,\n options.namespace\n );\n\n const additionalMethodsCode =\n additionalMethods.length > 0 ? Code.join(additionalMethods, '\\n\\n ') : code``;\n\n // Conditionally include generic type parameters\n const baseClassWithGenerics = code`${baseClass}<${genericTypes.data}, ${genericTypes.normalized}, ExtraInputExtension>`;\n\n return code`\nexport class ${options.className}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>> extends ${baseClassWithGenerics} {\n ${commonProperties}\n\n ${constructor}${\n fieldsProperty\n ? code`\n\n ${fieldsProperty}`\n : code``\n }${\n additionalMethods.length > 0\n ? code`\n\n ${additionalMethodsCode}`\n : code``\n }\n}`;\n }\n\n /**\n * Generate a standard GraphQL type class for identifiable types with key params\n */\n protected generateIdentifiableClass(\n type: T,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions,\n baseClass: ImportableReference,\n dataTypeAnnotation: string | ImportableReference,\n normalizedDataTypeAnnotation: string | ImportableReference,\n keyParamsType: string,\n additionalMethods: Code[] = []\n ): Code {\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n const fieldsProperty = this.generateFieldsProperty(\n type,\n dataTypeAnnotation,\n normalizedDataTypeAnnotation,\n schemaModel,\n options.namespace\n );\n\n const additionalMethodsCode =\n additionalMethods.length > 0 ? Code.join(additionalMethods, '\\n\\n ') : code``;\n\n return code`\nexport class ${options.className}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>> extends ${baseClass}<${dataTypeAnnotation}, ${normalizedDataTypeAnnotation}, ${keyParamsType}, ExtraInputExtension> {\n ${commonProperties}\n\n ${constructor}\n\n ${fieldsProperty}${\n additionalMethods.length > 0\n ? code`\n\n ${additionalMethodsCode}`\n : code``\n }\n}`;\n }\n\n /**\n * Abstract method to be implemented by specific type generators\n */\n abstract generate(type: T, schemaModel: GraphQLSchemaModel, options: GenerationOptions): Code;\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport { generateCacheControl } from '../../generators/cache-control-generator';\nimport type { GraphQLObjectTypeModel, GraphQLSchemaModel } from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst IDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'IdentifiableGraphQLTypeRepository',\n isType: false,\n};\n\nexport type IdentifiableGraphQLObjectType = GraphQLObjectTypeModel & {\n category: 'identifiable';\n idField: string;\n};\n\nexport class IdentifiableGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<IdentifiableGraphQLObjectType> {\n generate(\n type: IdentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n const keyParamsType = `{ ${type.idField}: string }`;\n const idField = code`idField = '${type.idField}'`;\n const cacheControl = generateCacheControl(type.metadata['cache-control']);\n\n return this.generateIdentifiableClass(\n type,\n schemaModel,\n options,\n IDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY,\n GRAPHQL_DATA,\n 'any',\n keyParamsType,\n [cacheControl, idField]\n );\n }\n}\n\nexport function generateIdentifiableGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: IdentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new IdentifiableGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type { GraphQLSchemaModel, GraphQLTypeModel } from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst UNIDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'UnidentifiableGraphQLTypeRepository',\n isType: false,\n};\n\nexport type UnidentifiableGraphQLObjectType = GraphQLTypeModel & {\n kind: 'object';\n category: 'unidentifiable';\n};\n\nexport class UnidentifiableGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<UnidentifiableGraphQLObjectType> {\n generate(\n type: UnidentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n UNIDENTIFIABLE_GRAPHQL_TYPE_REPOSITORY,\n { data: GRAPHQL_DATA, normalized: 'any' } // For unidentifiable types, data use GraphQLData\n );\n }\n}\n\nexport function generateUnidentifiableGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: UnidentifiableGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new UnidentifiableGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n GraphQLTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions } from './base-type-generator';\n\nconst CURSOR_CONNECTION_GRAPHQL_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'CursorConnectionGraphQLTypeRepository',\n isType: false,\n};\n\nconst PAGINATED_RESPONSE: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'PaginatedResponse',\n isType: true,\n};\n\nconst CONNECTION_NORMALIZED_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'ConnectionNormalizedData',\n isType: true,\n};\n\nconst GRAPHQL_INPUT_EXTENSION: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLInputExtension',\n isType: true,\n};\n\nexport type CursorConnectionGraphQLObjectType = GraphQLObjectTypeModel & {\n category: 'cursor-connection';\n defaultPageSize?: number;\n};\n\n/**\n * Cursor Connection Type MUST be an Object Type according to the Cursor Connection spec.\n * https://relay.dev/graphql/connections.htm#sec-Connection-Types\n */\nexport class CursorConnectionGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<CursorConnectionGraphQLObjectType> {\n generate(\n type: CursorConnectionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n const defaultPageSize = type.defaultPageSize || 10;\n\n const defaultPageSizeProperty = code`defaultPageSize = ${defaultPageSize};`;\n\n // Need special handling for cursor connection with 3 type parameters\n const constructor = this.generateConstructor();\n const commonProperties = this.generateCommonProperties(type, options);\n const fieldsProperty = this.generateFieldsProperty(\n type,\n PAGINATED_RESPONSE,\n CONNECTION_NORMALIZED_DATA,\n schemaModel,\n options.namespace\n );\n\n return code`\nexport class ${options.className} extends ${CURSOR_CONNECTION_GRAPHQL_TYPE_REPOSITORY}<${PAGINATED_RESPONSE}, ${CONNECTION_NORMALIZED_DATA}, ${GRAPHQL_INPUT_EXTENSION}> {\n ${commonProperties}\n\n ${constructor}\n\n ${fieldsProperty}\n\n ${defaultPageSizeProperty}\n}`;\n }\n}\n\nexport function generateCursorConnectionGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: CursorConnectionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new CursorConnectionGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type {\n GraphQLSchemaModel,\n GraphQLInterfaceTypeModel,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\n\nconst BASE_INTERFACE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseInterfaceRepository',\n isType: false,\n};\n\nexport type InterfaceGraphQLObjectType = GraphQLInterfaceTypeModel;\n\nexport class InterfaceGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<InterfaceGraphQLObjectType> {\n generate(\n type: InterfaceGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n // Generate possibleTypes mapping using this.typeRegistry\n const possibleTypesEntries = type.possibleTypes.map((possibleType) => {\n const typeReference = this.ensureTypeBuiltAndGetReference(possibleType, schemaModel);\n return code`'${possibleType.name}': ${typeReference}`;\n });\n const possibleTypesCode = Code.join(possibleTypesEntries, ',\\n ');\n\n const possibleTypesProperty = code`get possibleTypes() {\n return {\n ${possibleTypesCode}\n };\n }`;\n\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n BASE_INTERFACE_REPOSITORY,\n {\n data: GRAPHQL_DATA,\n normalized: 'any',\n },\n [possibleTypesProperty]\n );\n }\n}\n\nexport function generateInterfaceGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: InterfaceGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new InterfaceGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code } from '../../files';\nimport { Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport type { GraphQLSchemaModel, GraphQLUnionTypeModel } from '../../model/graphql-schema-model';\nimport { BaseGraphQLTypeGenerator, GenerationOptions, GRAPHQL_DATA } from './base-type-generator';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\n\nconst BASE_UNION_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'BaseUnionRepository',\n isType: false,\n};\n\nexport type UnionGraphQLObjectType = GraphQLUnionTypeModel;\n\nexport class UnionGraphQLTypeGenerator extends BaseGraphQLTypeGenerator<UnionGraphQLObjectType> {\n generate(\n type: UnionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n // Generate possibleTypes mapping using this.typeRegistry\n const possibleTypesEntries = type.possibleTypes.map((possibleType) => {\n const typeReference = this.ensureTypeBuiltAndGetReference(possibleType, schemaModel);\n return code`'${possibleType.name}': ${typeReference}`;\n });\n const possibleTypesCode = Code.join(possibleTypesEntries, ',\\n ');\n\n const possibleTypesProperty = code`get possibleTypes() {\n return {\n ${possibleTypesCode}\n };\n }`;\n\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n BASE_UNION_REPOSITORY,\n {\n data: GRAPHQL_DATA,\n normalized: 'any',\n },\n [possibleTypesProperty]\n );\n }\n}\n\nexport function generateUnionGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: UnionGraphQLObjectType,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new UnionGraphQLTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import { code, Code } from '../../files';\nimport type { ImportableReference, NamedFileService } from '../../files';\nimport { generateCacheControl } from '../../generators/cache-control-generator';\nimport type {\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n IdentifiableGraphQLTypeMetadata,\n} from '../../model/graphql-schema-model';\nimport { NamedGraphQLTypeRegistryGeneratorService } from '../graphql-type-registry-generator';\nimport type { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport { BaseGraphQLTypeGenerator, GenerationOptions } from './base-type-generator';\n\nconst GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLDocumentRootTypeRepository',\n isType: false,\n};\n\nconst GRAPHQL_DATA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLData',\n isType: true,\n};\n\n/**\n * Query Type MUST be an Object Type according to the GraphQL spec.\n * https://spec.graphql.org/October2021/#sec-Query\n */\nexport class DocumentRootTypeGenerator extends BaseGraphQLTypeGenerator<GraphQLObjectTypeModel> {\n generate(\n type: GraphQLObjectTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n ): Code {\n return this.generateStandardClass(\n type,\n schemaModel,\n options,\n GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY,\n { data: GRAPHQL_DATA, normalized: 'any' },\n [\n code`${generateCacheControl((type.metadata as IdentifiableGraphQLTypeMetadata)['cache-control'])}`,\n ] // We force the Root Query Type to have identifiable metadata\n );\n }\n}\n\nexport function generateDocumentRootGraphQLType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: GraphQLObjectTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n const generator = new DocumentRootTypeGenerator(services);\n return generator.generate(type, schemaModel, options);\n}\n","import {\n generateIdentifiableGraphQLType,\n IdentifiableGraphQLObjectType,\n} from './graphql/identifiable-type-generator';\nimport {\n generateUnidentifiableGraphQLType,\n UnidentifiableGraphQLObjectType,\n} from './graphql/unidentifiable-type-generator';\nimport {\n generateCursorConnectionGraphQLType,\n CursorConnectionGraphQLObjectType,\n} from './graphql/cursor-connection-type-generator';\nimport {\n generateInterfaceGraphQLType,\n InterfaceGraphQLObjectType,\n} from './graphql/interface-type-generator';\nimport { generateUnionGraphQLType, UnionGraphQLObjectType } from './graphql/union-type-generator';\nimport { generateDocumentRootGraphQLType } from './graphql/document-root-type-generator';\nimport type { ImportableValueReference, NamedFileService, Code } from '../files';\nimport type {\n GraphQLEnumTypeModel,\n GraphQLInterfaceTypeModel,\n GraphQLObjectTypeModel,\n GraphQLSchemaModel,\n GraphQLTypeModel,\n GraphQLUnionTypeModel,\n} from '../model/graphql-schema-model';\nimport type { GenerationOptions } from './graphql/base-type-generator';\nimport { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { NamedGraphQLTypeRegistryGeneratorService } from './graphql-type-registry-generator';\n\nexport const FILE_PER_GRAPHQL_TYPE = (typename: string) =>\n `graphql/${typename.toLowerCase()}-repository.ts`;\n\nexport interface IGraphQLTypeGenerator {\n build(options: {\n namespace: string;\n name: string;\n schemaModel: GraphQLSchemaModel;\n }): ImportableValueReference;\n\n buildRef(options: { namespace: string; name: string }): ImportableValueReference;\n}\n\nfunction defaultGenerateType(\n services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n type: GraphQLTypeModel,\n schemaModel: GraphQLSchemaModel,\n options: GenerationOptions\n): Code {\n // Check if this is a document root type (Query, Mutation, Subscription)\n if (isObjectType(type)) {\n if (type.name === schemaModel.queryTypeName || type.name === schemaModel.mutationTypeName) {\n return generateDocumentRootGraphQLType(services, type, schemaModel, options);\n } else if (isIdentifiableType(type)) {\n return generateIdentifiableGraphQLType(services, type, schemaModel, options);\n } else if (isUnidentifiableType(type)) {\n return generateUnidentifiableGraphQLType(services, type, schemaModel, options);\n } else if (isCursorConnectionType(type)) {\n return generateCursorConnectionGraphQLType(services, type, schemaModel, options);\n }\n } else if (isInterfaceType(type)) {\n return generateInterfaceGraphQLType(services, type, schemaModel, options);\n } else if (isUnionType(type)) {\n return generateUnionGraphQLType(services, type, schemaModel, options);\n }\n throw new Error(\n `Unsupported GraphQL type category: ${(type as any).category || (type as any).kind}`\n );\n}\n\nexport type GraphQLObjectType =\n | IdentifiableGraphQLObjectType\n | UnidentifiableGraphQLObjectType\n | CursorConnectionGraphQLObjectType\n | InterfaceGraphQLObjectType\n | UnionGraphQLObjectType;\n\n/**\n * A class for building GraphQL type repository implementations\n */\nexport class GraphQLTypeGenerator implements IGraphQLTypeGenerator {\n private cache = new Map<string, ImportableValueReference>();\n\n constructor(\n protected services: NamedFileService & NamedGraphQLTypeRegistryGeneratorService,\n private fileFor: (typename: string) => string = FILE_PER_GRAPHQL_TYPE,\n private generateType: typeof defaultGenerateType = defaultGenerateType\n ) {}\n\n /**\n * Build a GraphQL type repository class, starting from the specified type name\n * and spidering out to referenced types as needed\n */\n build(options: {\n namespace: string;\n name: string;\n schemaModel: GraphQLSchemaModel;\n }): ImportableValueReference {\n const { namespace, name, schemaModel } = options;\n const cacheKey = `${namespace}:${name}`;\n\n const cachedRef = this.cache.get(cacheKey);\n if (cachedRef) {\n return cachedRef;\n }\n\n const ref = this.buildRef({ namespace, name });\n const className = ref.exportedSymbol!;\n\n // Find the type in the schema model\n const type = schemaModel.types.find((t) => t.name === name);\n if (!type) {\n throw new Error(`GraphQL type '${name}' not found in schema model`);\n }\n this.cache.set(cacheKey, ref); // Must avoid infinite looping\n\n // Generate the code for this type\n const code = this.generateType(this.services, type, schemaModel, {\n namespace,\n name,\n className,\n });\n\n const file = this.services.file.build('filename' in ref ? ref.filename : ref.module);\n file.push(code);\n\n return ref;\n }\n\n buildRef(options: { namespace: string; name: string }): ImportableValueReference {\n const filename = this.fileFor(options.name);\n const className = toTypeScriptSafeIdentifier(`${options.name}Repository`);\n const ref = { filename, exportedSymbol: className, isType: false } as const;\n return ref;\n }\n}\n\nfunction isObjectType(type: GraphQLTypeModel): type is GraphQLObjectTypeModel {\n return type.kind === 'object';\n}\n\nfunction isUnionType(type: GraphQLTypeModel): type is GraphQLUnionTypeModel {\n return type.kind === 'union';\n}\n\nfunction isEnumType(type: GraphQLTypeModel): type is GraphQLEnumTypeModel {\n return type.kind === 'enum';\n}\n\nfunction isInterfaceType(type: GraphQLTypeModel): type is GraphQLInterfaceTypeModel {\n return type.kind === 'interface';\n}\n\nfunction isIdentifiableType(\n type: GraphQLTypeModel\n): type is GraphQLObjectTypeModel & { category: 'identifiable' } {\n return type.kind === 'object' && type.category === 'identifiable';\n}\n\nfunction isUnidentifiableType(type: GraphQLTypeModel): type is (\n | GraphQLObjectTypeModel\n | GraphQLInterfaceTypeModel\n | GraphQLUnionTypeModel\n) & {\n category: 'unidentifiable';\n} {\n return type.category === 'unidentifiable';\n}\n\nfunction isCursorConnectionType(type: GraphQLTypeModel): type is GraphQLObjectTypeModel & {\n category: 'cursor-connection';\n} {\n return type.kind === 'object' && type.category === 'cursor-connection';\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { code } from '../files';\nimport { GraphQLTypeGenerator } from './graphql-type-generator';\nimport type {\n NamedFileService,\n File,\n ImportableValueReference,\n ImportableReference,\n} from '../files';\nimport type { NamedService } from '@conduit-client/utils';\nimport type { GraphQLSchemaModel } from '../model/graphql-schema-model';\nimport type { GraphQLObjectType } from './graphql-type-generator';\nimport { NamedAPIService } from '@conduit-client/model/v1';\n\ntype GraphQLTypeRepositoryReference = {\n propertyName: string;\n typeClassRef: ImportableValueReference;\n typeName: string;\n};\n\ntype Options = {\n type: GraphQLObjectType;\n schemaModel: GraphQLSchemaModel;\n};\n\nexport type IGraphQLTypeRegistryGeneratorService = {\n build(): ImportableValueReference;\n buildGraphQLType(options: Options): GraphQLTypeRepositoryReference;\n};\n\nexport type NamedGraphQLTypeRegistryGeneratorService<\n Name extends string = 'graphqlTypeRegistryGenerator',\n> = NamedService<Name, IGraphQLTypeRegistryGeneratorService>;\n\nconst GRAPHQL_TYPE_REGISTRY_CLASS = 'GraphQLTypeRegistry';\nconst GRAPHQL_TYPE_REGISTRY_FILE = 'normalization/graphql-type-registry.ts';\n\nexport const NAMED_CACHE_CONTROLLER_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nexport const NAMED_PUB_SUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nexport const TYPE_SERVICES = code`${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUB_SUB_SERVICE}`;\n\n/**\n * A class for building the GraphQL type registry for a given module\n */\nexport class GraphQLTypeRegistryGenerator implements IGraphQLTypeRegistryGeneratorService {\n protected graphqlTypeGenerator!: GraphQLTypeGenerator;\n\n constructor(\n protected services: NamedFileService & NamedAPIService,\n protected filename: string = GRAPHQL_TYPE_REGISTRY_FILE\n ) {}\n\n setGraphQLTypeGenerator(generator: GraphQLTypeGenerator) {\n this.graphqlTypeGenerator = generator;\n }\n\n _file: File | undefined = undefined;\n\n protected typeDeclarationsSymbol = Symbol.for('graphqlTypeDeclarations');\n protected typeInstantiationsSymbol = Symbol.for('graphqlTypeInstantiations');\n protected typeGettersSymbol = Symbol.for('graphqlTypeGetters');\n cache = new Map<string, GraphQLTypeRepositoryReference>();\n\n private get file() {\n if (this._file) {\n return this._file;\n }\n return this.buildFile();\n }\n\n private buildFile(): File {\n const file = this.services.file.build(this.filename);\n file.template = this.template;\n this._file = file;\n return file;\n }\n\n get template() {\n return [\n code`export class ${GRAPHQL_TYPE_REGISTRY_CLASS}<ExtraInputExtension extends Record<string, any> = Record<string, unknown>, ExtraServices extends object = object > {`,\n this.typeDeclarationsSymbol,\n code`constructor(protected services: ${TYPE_SERVICES} & ExtraServices) {`,\n this.typeInstantiationsSymbol,\n code`}`,\n this.typeGettersSymbol,\n code`}`,\n ];\n }\n\n /**\n * A method for building the base GraphQL type registry code, without any classes populated\n */\n build() {\n this.buildFile();\n return {\n filename: this.filename,\n exportedSymbol: GRAPHQL_TYPE_REGISTRY_CLASS,\n isType: false,\n } as const;\n }\n\n get namespace() {\n return this.services.api.api.namespace;\n }\n\n /**\n * A method for building/adding a specific GraphQL type to the registry\n */\n buildGraphQLType(options: Options): GraphQLTypeRepositoryReference {\n const { type, schemaModel } = options;\n const cacheKey = `${this.namespace}:${type.name}`;\n\n let cachedResult = this.cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n\n const propertyName = toTypeScriptSafeIdentifier(type.name);\n\n // Create a placeholder result and cache it immediately to prevent recursive calls\n // from modifying the template multiple times during field processing\n const result: GraphQLTypeRepositoryReference = {\n propertyName,\n typeClassRef: { filename: '', exportedSymbol: '', isType: false }, // placeholder\n typeName: type.name,\n };\n this.cache.set(cacheKey, result);\n\n // Build the GraphQL type repository class\n const typeClassRef = this.graphqlTypeGenerator.build({\n name: type.name,\n schemaModel,\n namespace: this.namespace,\n });\n\n // Update the cached result with the actual typeClassRef\n result.typeClassRef = typeClassRef;\n\n // Add to registry template (only for new types)\n const privateName = code`_${propertyName}`;\n\n this.file.pushTo(this.typeDeclarationsSymbol, code`${privateName}: ${typeClassRef};`);\n this.file.pushTo(\n this.typeInstantiationsSymbol,\n code`this.${privateName} = new ${typeClassRef}<ExtraInputExtension>(this.services, this);`\n );\n this.file.pushTo(\n this.typeGettersSymbol,\n code`get ${propertyName}() { return this.${privateName}; }`\n );\n\n return result;\n }\n}\n\n/**\n * Creates a GraphQLTypeRegistryGeneratorService.\n */\nexport function graphqlTypeRegistryGeneratorService(\n services: NamedFileService & NamedAPIService,\n graphqlTypeGenerator?: GraphQLTypeGenerator\n): IGraphQLTypeRegistryGeneratorService {\n const registry = new GraphQLTypeRegistryGenerator(services);\n const gtg =\n graphqlTypeGenerator ||\n new GraphQLTypeGenerator(\n { ...services, graphqlTypeRegistryGenerator: registry },\n undefined,\n undefined\n );\n registry.setGraphQLTypeGenerator(gtg);\n return registry;\n}\n","import { type Code, type ImportableTypeReference, type NamedFileService, code } from '../files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel, InvalidationConfig } from '../model/base-command-model';\n\nconst JSON_SCHEMA: ImportableTypeReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst ABORTABLE_COMMAND_OPTIONS: ImportableTypeReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'AbortableCommandOptions',\n isType: true,\n};\n\nexport type ICommandGenerator = {\n build(): void;\n};\n\n/**\n * Abstract base class for generating command files based on a command model and associated services.\n *\n * This class provides a framework for generating files associated with commands, including type definitions,\n * JSON schemas, and class templates. It leverages protected symbols to encapsulate template pieces,\n * facilitating the extension and customization in subclasses.\n *\n * The commandBaseClass abstract property must reference a type only, importable reference that references the base class that the generated command\n * will reference. For example, the HTTP concretion of this class would reference:\n * ```\n * {\n * module: '@conduit-client/command-fetch-network/v1',\n * exportedSymbol: 'FetchNetworkCommand',\n * isType: true,\n * }\n * ```\n * which corresponds to the import: `import {type FetchNetworkCommand} from '@conduit-client/command-fetch-network/v1'`.\n *\n * The class body abstract command provides a hook for concretions to implement whatever contract is required\n * by their base class. By convention, the concrete implementations of `classBody` should delegate to a method for\n * each property & class method that is implemented.\n *\n * None of the other properties are expected to be overridden in subclasses.\n *\n * @abstract\n * @property {ICommandModel} commandModel - The command model that provides metadata and configuration for generating command files.\n * @property {NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService} services - Services required for file generation, type definition, and JSON schema generation.\n */\nexport abstract class CommandGenerator {\n constructor(\n protected commandModel: ICommandModel,\n protected services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService\n ) {}\n\n protected commandTypeGenericsSymbol = Symbol.for('commandType');\n protected commandConfigSchemaSymbol = Symbol.for('commandConfigSchema');\n protected commandConfigTypeSymbol = Symbol.for('commandConfigType');\n protected commandClassBodySymbol = Symbol.for('commandClassBody');\n protected commandOptionsTypeSymbol = Symbol.for('commandOptionsType');\n\n abstract get commandBaseClass(): ImportableTypeReference;\n\n get classBody(): Code[] {\n return [];\n }\n\n get commandTypeConstructorArgs() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`config: Config, typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n return code`config: Config`;\n }\n\n get commandConstructorArgs() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`private config: Config, private typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n return code`private config: Config`;\n }\n\n get exposeSubscribeAndRefresh() {\n // Currently only checks this flag on network commands\n if (this.commandModel.exposeRefresh && this.commandModel.cacheStrategy.type === 'none') {\n return code`exposeSubscribeAndRefresh = true;`;\n }\n return code``;\n }\n\n /**\n * Generates the Command type definition.\n * Can be overridden by subclasses to customize the Command type signature.\n */\n protected generateCommandType(): Code {\n return code`export type Command=new (${this.commandTypeConstructorArgs},...args: CommandConstructorParams) => CommandType;`;\n }\n\n /**\n * Generates the constructor for the command class.\n * Can be overridden by subclasses to customize constructor behavior.\n */\n protected generateConstructor(): Code {\n return code`constructor(${this.commandConstructorArgs}, ...args: CommandConstructorParams){super(...args)}`;\n }\n\n /**\n * Generates the operationType getter for the concrete command class.\n * Subclasses (e.g., GraphQL mixins) can override to emit nothing.\n */\n protected generateOperationType(): Code {\n return code`get operationType() {\n return '${this.commandModel.operationType}' as const;\n }`;\n }\n\n /**\n * Template for generating the command file content.\n * This getter constructs the full template array incorporating various symbols for later replacement in the build process.\n * @returns {Code[]} An array of code blocks forming the complete command file template.\n */\n get template() {\n return [\n code`export type Config=`,\n this.commandConfigTypeSymbol,\n code`;`,\n code`export const CONFIG_SCHEMA:${JSON_SCHEMA}=`,\n this.commandConfigSchemaSymbol,\n code`;`,\n this.commandOptionsTypeSymbol,\n code`export type CommandType=${this.commandBaseClass}<`,\n this.commandTypeGenericsSymbol,\n code`>;`,\n code`export type CommandConstructorType=typeof ${this.commandBaseClass}<`,\n this.commandTypeGenericsSymbol,\n code`>;`,\n code`export type CommandConstructorParams=ConstructorParameters<CommandConstructorType>;`,\n this.generateCommandType(),\n code`export function buildCommandClass(baseClass: CommandConstructorType): Command{`,\n code`return class extends baseClass{`,\n this.generateConstructor(),\n ...this.classBody,\n this.exposeSubscribeAndRefresh,\n this.generateOperationType(),\n this.generateAfterRequestHooks(),\n code`}};`,\n ];\n }\n\n /**\n * Builds the command file by assembling various components into a file structure and saving it.\n * This method orchestrates the generation of necessary types, configurations, and class bodies.\n */\n build() {\n const file = this.services.file.build(this.commandModel.filePath);\n file.template = this.template;\n\n file.pushTo(this.commandConfigTypeSymbol, this.buildCommandConfigType());\n file.pushTo(this.commandConfigSchemaSymbol, this.buildCommandConfigSchema());\n\n file.pushTo(this.commandOptionsTypeSymbol, this.buildCommandOptionsType());\n\n file.pushTo(this.commandTypeGenericsSymbol, this.buildCommandTypeGenerics());\n file.pushTo(this.commandClassBodySymbol, ...this.classBody);\n }\n\n protected buildCommandConfigType() {\n return this.services.typeDefinition.build(this.commandModel.configType);\n }\n\n protected buildCommandConfigSchema() {\n return this.services.jsonSchema.build(this.commandModel.configType);\n }\n\n protected buildCommandOptionsType() {\n const commandName = this.commandModel.className;\n return code`export type ${commandName}Options = ${ABORTABLE_COMMAND_OPTIONS};`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n return code`${this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n )}${extraServicesCode ? code`, ${extraServicesCode}` : ''}`;\n }\n\n protected buildExtraServices(): Code | undefined {\n if (this.commandModel.serviceDependencies.extra.length === 0) {\n return undefined;\n }\n\n return this.commandModel.serviceDependencies.extra.reduce(\n (previous, current, idx) => {\n return code`${previous}${idx > 0 ? '&' : ''}${current.namedService}`;\n },\n code``\n );\n }\n\n protected generateAfterRequestHooks() {\n if (this.commandModel.invalidationConfigs.length > 0) {\n return code`async afterRequestHooks(options: { statusCode: number }){\n ${this.generateInvalidationSwitch()}\n }`;\n }\n return code``;\n }\n\n private getInvalidationStatements(responses: InvalidationConfig[]): (Code[] | undefined)[] {\n return responses.map((resp) => {\n return resp.invalidation?.map((invalidate) => {\n const split = invalidate.ref.split('/');\n const typeName = split[split.length - 1];\n return code`this.typeRegistry.${typeName}.invalidate([${this.buildMappedKeyConfig(invalidate.key)}])`;\n });\n });\n }\n\n private generateInvalidationSwitch(): Code {\n return code`switch(options.statusCode) {\n ${this.generateInvalidationCasesByStatusCode()}\n }`;\n }\n\n private generateInvalidationCasesByStatusCode(): Code[] {\n return this.commandModel.invalidationConfigs.map((resp) => {\n return code`case ${resp.statusCode}:\n ${this.getInvalidationStatements([resp])}\n break;\n `;\n });\n }\n\n protected buildMappedKeyConfig(operationKey: Record<string, string>) {\n return code`{${Object.entries(operationKey).map(([keyName, keyPath], index, array) => {\n const [paramType, ...pathElements] = keyPath.split('.');\n\n if (pathElements.length === 0) {\n throw Error('no path specified');\n }\n\n const delimiter = index < array.length ? ', ' : '';\n\n const path = pathElements.join('.');\n if (paramType === 'body' && this.commandModel.configSchemaType === 'default') {\n return `${keyName}: this.config['${this.commandModel.body?.parameterName}']${this.pathToAccessor(path)}${delimiter}`;\n } else {\n return `${keyName}: this.config${this.pathToAccessor(path)}${delimiter}`;\n }\n })}}`;\n }\n\n private pathToAccessor(path: string) {\n return path\n .split('.')\n .map((element) => `['${element}']`)\n .join('');\n }\n}\n","import { toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { type Code, code } from '../files';\nimport { ICommandModel } from '../model/base-command-model';\n\n/**\n * Generates a destructuring assignment code block for a given property name, ensuring that the variable names are valid TypeScript identifiers.\n * This function is particularly useful when dealing with property names that may not directly translate into valid TypeScript variable names,\n * such as names containing special characters.\n *\n * @param propertyName - The original property name to be destructured from an object.\n * @returns An object containing:\n * - `code`: a `Code` type representing the TypeScript code for destructuring the property.\n * - `variableName`: a string that represents the valid TypeScript identifier to which the property value is assigned.\n */\nexport function buildPropertyDestructureDeclaration(propertyName: string): {\n code: Code;\n variableName: string;\n} {\n const typescriptSafeName = toTypeScriptSafeIdentifier(propertyName);\n if (propertyName !== typescriptSafeName) {\n return {\n code: code`'${propertyName}':${typescriptSafeName}`,\n variableName: typescriptSafeName,\n };\n } else {\n return { code: code`${propertyName}`, variableName: propertyName };\n }\n}\n\nconst createdServiceProjectionNames = new Set<string>();\n\nexport function buildServiceProjection(model: ICommandModel) {\n let name = 'services';\n let overrides = '';\n if (\n model.serviceDependencies?.overrides &&\n Object.keys(model.serviceDependencies.overrides).length !== 0\n ) {\n let commandName = toTypeScriptSafeIdentifier(model.commandName);\n name = `servicesProjection_for_${commandName}`;\n if (!createdServiceProjectionNames.has(name)) {\n overrides = `const ${name} = {\n ...services,`;\n for (const [alias, entry] of Object.entries(model.serviceDependencies.overrides)) {\n overrides += `${alias}: services.${entry.type}_${commandName},`;\n }\n overrides += `};`;\n createdServiceProjectionNames.add(name);\n }\n }\n return [name, overrides];\n}\n","import { code, Code } from '../files';\nimport { CommandGenerator } from './base-command-generator';\nimport { buildPropertyDestructureDeclaration } from './utils';\nimport type { ImportableReference, ImportableTypeReference } from '../files';\nimport {\n type Type,\n type ArrayType,\n type Parameter,\n isCanonicalStringType,\n isCanonicalNumberType,\n canonicalizeType,\n} from '@conduit-client/model/v1';\n\nconst HEADER_CONTENT_TYPE = 'Content-Type';\n\nconst FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchService',\n isType: true,\n};\n\nconst FETCH_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nconst FETCH_RESPONSE: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'FetchResponse',\n isType: true,\n};\n\nconst COERCE_RESPONSE_TO_FETCH_RESPONSE: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'coerceResponseToFetchResponse',\n isType: false,\n};\n\nconst ENCODE_QUERY_PARAM: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'encodeQueryParam',\n isType: false,\n};\n\nexport const MEDIATYPE_APP_JSON = 'application/json';\n\n/**\n * Extends CommandGenerator to provide functionality for generating command files specifically designed for HTTP operations.\n *\n * This class specializes in creating files that include detailed HTTP-specific configurations such as fetch parameters,\n * header construction, query parameters, and error handling, tailored to interact with web APIs using the fetch API.\n *\n * @extends CommandGenerator\n */\nexport class HttpCommandGenerator extends CommandGenerator {\n commandBaseClass: ImportableTypeReference = FETCH_COMMAND_BASE_CLASS;\n\n /**\n * Constructs and returns an array of code blocks that form the body of the HTTP command class.\n * Includes methods for generating fetch parameters and error coercion logic.\n * @returns {Code[]} An array of code snippets that define the command class body for HTTP operations.\n */\n get classBody(): Code[] {\n return [code`${this.generateFetchParams()}`, this.generateCoerceError()];\n }\n\n /**\n * Generates a code block for fetch parameters based on the command model's configuration.\n * Constructs a detailed setup for fetch operations including method, headers, body, and cache settings.\n * @returns {Code} A comprehensive code snippet that defines all necessary fetch parameters.\n */\n generateFetchParams(): Code {\n const headers = this.generateHeaders();\n const result = new Code().push(\n code`get fetchParams(): Parameters<${FETCH_SERVICE}>{`,\n code`${this.generateAllParams()}`,\n code`${this.generateUrl()}${this.generateQueryParameters()}${headers}`\n );\n\n const hasRequestBody = this.commandModel.body!!;\n const hasHeaders = headers !== undefined;\n result.push(\n code`const params:Parameters<${FETCH_SERVICE}>[1]={`,\n code`method:'${this.commandModel.method}',`,\n code`cache:'no-cache',`\n );\n if (hasHeaders) {\n result.push(`headers,`);\n }\n if (hasRequestBody) {\n result.push(`body:JSON.stringify(body)`);\n }\n result.push(`};`);\n\n result.push(code`return [url, params]}`);\n return result;\n }\n\n /**\n * Constructs the base URL for the fetch command.\n * @returns {Code} A code snippet that defines the URL to be used in fetch operations.\n */\n generateUrl(): Code {\n return code`let url:Parameters<${FETCH_SERVICE}>[0]=\\`${this.processUrl()}\\`;`;\n }\n\n /**\n * Generates headers necessary for the HTTP fetch based on the command model's requirements.\n * Handles conditional inclusion of headers based on their defined necessity and request body presence.\n * @returns {object} An object containing the header names and the corresponding code to create them.\n */\n generateHeaders() {\n let result = undefined;\n const hasRequestBody = this.commandModel.body!!;\n if (this.commandModel.headers.length > 0 || hasRequestBody) {\n result = code`const headers:Record<string,any>={`;\n if (hasRequestBody) {\n result.push(`'${HEADER_CONTENT_TYPE}':'${MEDIATYPE_APP_JSON}',`);\n }\n const headers = this.commandModel.headers.filter(\n (hdr) => hdr.name.toLowerCase() !== HEADER_CONTENT_TYPE.toLowerCase()\n );\n\n const headerVariables: Record<string, string> = {};\n const headerDefaults: Record<string, unknown> = {};\n headers.forEach((hdr) => {\n const destructure = buildPropertyDestructureDeclaration(hdr.name);\n result.push(code`${destructure.code},`);\n headerVariables[hdr.name] = destructure.variableName;\n if (hdr.defaultValue) {\n headerDefaults[hdr.name] = hdr.defaultValue;\n }\n });\n result.push(`};`);\n Object.entries(headerVariables).forEach(([hdrName, hdrVariableName]) => {\n result.push(\n `if(${hdrVariableName}!==undefined){headers['${hdrName}']=${hdrVariableName};}`\n );\n if (headerDefaults[hdrName]) {\n result.push(`else{headers['${hdrName}']='${headerDefaults[hdrName]}';}`);\n }\n });\n }\n return result;\n }\n\n /**\n * Constructs a setup for handling query parameters within the URL for the fetch operation.\n * @returns {object} An object containing the parameter names and the corresponding code to handle them.\n */\n generateQueryParameters() {\n // resolve query params\n let result = undefined;\n if (this.commandModel.queryParameters.length > 0) {\n result = code`let queryParams:string[]=[];`;\n this.commandModel.queryParameters.forEach((param) => {\n const variableName = buildPropertyDestructureDeclaration(param.name).variableName;\n result.push(\n param.required ? '' : `if(${variableName}!==undefined){`,\n code`queryParams.push(...${ENCODE_QUERY_PARAM}('${param.name}', ${variableName}, ${param.explode}));`,\n param.required ? '' : `}`\n );\n });\n result.push(`if(queryParams.length>0){url+='?'+queryParams.join('&');}`);\n }\n return result;\n }\n\n /**\n * Generates a consolidated list of all parameters involved in the fetch operation.\n * @returns {Code} A code block that consolidates all necessary parameters from headers, query, and URI.\n */\n generateAllParams(): Code {\n const result = new Code();\n const paramDestructuring = this.commandModel.getAllParams().map((param) => {\n const destructure = buildPropertyDestructureDeclaration(param.name);\n return destructure.code;\n });\n if (this.commandModel.body || paramDestructuring.length) {\n result.push(\n code`const {\n ${paramDestructuring.join(',')}\n ${paramDestructuring.length && this.commandModel.body ? ',' : ''}\n ${this.generateInputPayloadParameter()}\n } = this.config;`\n );\n }\n return result;\n }\n\n /**\n * Determines the code snippet for destructuring the input payload based on the configuration schema type.\n * @returns {Code | undefined} A code snippet for the input payload parameter, if applicable.\n */\n generateInputPayloadParameter(): Code | undefined {\n if (this.commandModel.body) {\n if (this.commandModel.configSchemaType === 'flattened') {\n // Use rest operator when flattening,\n // e.g. const { ...body } = this.config\n return code`...body`;\n } else {\n // Extract using input payload name otherwise,\n // e.g. const { inputPayload: body } = this.config\n return code`${this.commandModel.body.parameterName}: body`;\n }\n }\n }\n\n /**\n * Encodes a parameter based on its type.\n * @param {string} name The name of the parameter to encode.\n * @param {Type} type The type descriptor of the parameter.\n * @returns {string | undefined} The encoded parameter value as a string, or undefined if the type is unsupported.\n */\n encodeParam(name: string, type: Type, required: boolean): string | undefined {\n const isScalarArrayType = (t: Type): t is ArrayType => {\n const canonicalizedType = canonicalizeType(t);\n if (canonicalizedType.type !== 'array') {\n return false;\n }\n\n const canonicalizedItems = canonicalizeType(canonicalizedType.items);\n return (\n isCanonicalStringType(canonicalizedItems) ||\n isCanonicalNumberType(canonicalizedItems)\n );\n };\n\n const canonicalType = canonicalizeType(type);\n return isCanonicalNumberType(canonicalType)\n ? `${name}`\n : isCanonicalStringType(canonicalType)\n ? required\n ? `encodeURIComponent(${name})`\n : `encodeURIComponent(${name} ? ${name} : '')`\n : isScalarArrayType(canonicalType)\n ? isCanonicalStringType(canonicalType.items)\n ? `${name}.map(item=>encodeURIComponent(item)).join(',')`\n : `${name}.join(',')`\n : undefined;\n }\n\n /**\n * Processes the URL with replacements for URI parameters based on their values specified in the command model.\n * @returns {string} The fully constructed URL with all necessary URI parameter substitutions.\n */\n processUrl(): string {\n const uriParams: Record<string, Parameter> = this.commandModel.uriParameters.reduce(\n (result, param) => {\n result[param.name] = param;\n return result;\n },\n {} as Record<string, Parameter>\n );\n\n // resolve URL against server\n let url = [\n this.commandModel.serverUrlPath.replace(/\\/$/, ''),\n this.commandModel.endpointUrlPath.replace(/^\\//, ''),\n ].join('/');\n\n // resolve uri/path params\n url = url.replace(/\\{(.+?)\\}/g, (_, uriParameter) => {\n const uriParam = uriParams[uriParameter];\n if (!uriParam) {\n throw new Error(\n `unknown uri parameter ${uriParameter} in ${url} for ${this.commandModel.method} ${this.commandModel.endpointUrlPath} operation`\n );\n }\n const paramName = buildPropertyDestructureDeclaration(uriParameter).variableName;\n const value: string | undefined = this.encodeParam(\n paramName,\n uriParam.type,\n uriParam.required\n );\n return `\\${${value}}`;\n });\n\n return url;\n }\n\n generateCoerceError() {\n if (this.commandModel.errorStrategy.type === 'fetchResponse') {\n return code`async coerceError(errorResponse: Response):Promise<${FETCH_RESPONSE}<unknown>>{\n return ${COERCE_RESPONSE_TO_FETCH_RESPONSE}(errorResponse)\n }`;\n }\n return code``;\n }\n}\n","import { Code, type ImportableValueReference, type ImportableTypeReference, code } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { buildPropertyDestructureDeclaration } from './utils';\n\nconst FETCH_RESPONSE: ImportableTypeReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'FetchResponse',\n isType: true,\n};\n\nconst CONVERT_AURA_ERRORS_TO_FETCH_RESPONSE: ImportableValueReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'getFetchResponseFromAuraError',\n isType: false,\n};\n\nconst AURA_COMMAND_BASE_CLASS: ImportableTypeReference = {\n module: '@conduit-client/command-aura-network/v1',\n exportedSymbol: 'AuraNetworkCommand',\n isType: true,\n};\n/**\n * An extension of the CommandGenerator for generating command files specifically tailored for Salesforce Aura components.\n *\n * This class specializes in handling Aura-specific functionalities such as defining endpoints, generating Aura-compatible\n * parameters, and handling errors in a manner compatible with Aura's handling mechanisms. It leverages the structure and\n * behavior of the parent CommandGenerator class to create command files optimized for Aura component interactions.\n *\n * @extends CommandGenerator\n */\nexport class AuraCommandGenerator extends HttpCommandGenerator {\n commandBaseClass = AURA_COMMAND_BASE_CLASS;\n\n /**\n * Constructs and returns an array of code blocks that form the body of the Aura-specific command class.\n * @returns {Code[]} An array of code snippets that define the command class body, tailored for Aura components.\n */\n get classBody(): Code[] {\n return [\n ...super.classBody,\n this.generateNetworkPreference(),\n this.generateEndpoint(),\n this.generateAuraParams(),\n ];\n }\n\n generateNetworkPreference(): Code {\n return code`protected networkPreference='${this.commandModel.networkPreference}' as const;`;\n }\n\n /**\n * Generates a code snippet that sets the command endpoint based on the controller and method defined in the command model.\n * @returns {Code} A code snippet that statically sets the endpoint for the command.\n */\n generateEndpoint(): Code {\n return code`endpoint='${this.commandModel.aura!.controller}.${this.commandModel.aura!.method}';`;\n }\n\n /**\n * Generates a getter method that constructs and returns a record of parameters required by the Aura command.\n * @returns {Code} A code snippet defining a getter for the Aura parameters, structured as a record.\n */\n generateAuraParams(): Code {\n return code`get auraParams():Record<string,unknown>{${this.generateAuraParamsCode()}}`;\n }\n\n /**\n * Helper method that aggregates all parameters (query and URI) and formats them into a structured record,\n * possibly including the command body if specified.\n * @returns {Code} A code block that constructs the parameters object for the Aura command.\n */\n generateAuraParamsCode(): Code {\n const result = new Code();\n const paramDestructuring = this.commandModel\n .getAllParams()\n .map(({ name }) => {\n return buildPropertyDestructureDeclaration(name).code;\n })\n .join(',');\n\n const inputPayloadDelimiter =\n paramDestructuring.length && this.commandModel.body ? ',' : '';\n if (paramDestructuring.length || this.commandModel.body) {\n result.push(\n code`const {\n ${paramDestructuring}\n ${inputPayloadDelimiter}\n ${this.generateInputPayloadParameter()}\n } = this.config;`\n );\n }\n\n result.push(code`return { ${paramDestructuring}`);\n if (this.commandModel.body) {\n if (this.commandModel.aura === undefined) {\n throw new Error('Aura command model information missing');\n }\n const inputPayload = this.commandModel.aura.bodyParam;\n\n if (inputPayload === undefined) {\n throw new Error('Aura body param missing');\n }\n result.push(code`${inputPayloadDelimiter}${inputPayload}:body`);\n }\n result.push(`};`);\n return result;\n }\n\n /**\n * Determines how to destructure the input payload from the command configuration, adjusting based on schema type.\n * @returns {Code | undefined} A code snippet for destructuring the input payload, if a body type is specified.\n */\n generateInputPayloadParameter(): Code | undefined {\n if (this.commandModel.body) {\n if (this.commandModel.configSchemaType === 'flattened') {\n return code`...body`;\n } else {\n return code`${this.commandModel.body.parameterName}: body`;\n }\n }\n }\n\n /**\n * Generates a method for transforming Aura-specific errors into a standard format, based on the defined error strategy.\n * @returns {Code} A code snippet for a method that coverts Aura errors into a fetch-compatible response.\n */\n generateCoerceError(): Code {\n if (this.commandModel.errorStrategy.type === 'fetchResponse') {\n return code`protected override coerceAuraErrors(auraErrors: any[]):${FETCH_RESPONSE}<unknown>{return ${CONVERT_AURA_ERRORS_TO_FETCH_RESPONSE}(auraErrors[0])}`;\n }\n\n return code``;\n }\n}\n","import { code } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport type { Code, ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'AuraResourceCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n/**\n * Extends AuraCommandGenerator to add cache control strategies specific to resource caching in Aura components.\n *\n * This class further specializes the command generation process by including methods that handle cache control metadata and configuration,\n * ensuring that resources are cached according to the specified strategy in the command model.\n *\n * @extends AuraCommandGenerator\n */\nexport class AuraResourceCacheControlCommandGenerator extends AuraCommandGenerator {\n commandBaseClass = AURA_CACHE_CONTROL_COMMAND_BASE_CLASS;\n\n /**\n * Generates a method to build cache control metadata based on the response type and cache strategy defined in the command model.\n * Throws an error if the cache strategy is set to 'none'.\n *\n * @returns {Code} A code snippet that constructs cache control metadata for the command.\n * @throws {Error} Throws an error if the cache strategy is 'none'.\n */\n generateBuildCacheControlMetadata(): Code {\n if (this.commandModel.cacheStrategy.type !== 'resource') {\n throw new Error('incorrect cache strategy');\n }\n\n return code`buildCacheControlMetadata(_networkResult:${this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n )}){return{type:'max-age',maxAge:${\n this.commandModel.cacheStrategy.config['max-age']\n },generatedTime:Date.now()/1000}as const;}`;\n }\n\n /**\n * Generates a getter method that provides configuration for cache control strategies based on the command model settings.\n * Throws an error if the cache strategy is set to 'none'.\n *\n * @returns {Code} A code snippet that provides cache control strategy configuration.\n * @throws {Error} Throws an error if the cache strategy is 'none'.\n */\n generateCacheControlStrategyConfig(): Code {\n if (this.commandModel.cacheStrategy.type !== 'resource') {\n throw new Error('incorrect cache strategy');\n }\n return code`get cacheControlStrategyConfig(){return{type:'max-age',requestMaxAge:${this.commandModel.cacheStrategy.config['max-age']},now:Date.now()/1000}as const;}`;\n }\n\n /**\n * Overrides the base classBody method to include methods for cache control alongside the standard Aura command class body.\n *\n * @returns {Code[]} An array of code blocks that form the complete class body for the cache-controlled Aura command.\n */\n get classBody(): Code[] {\n return [\n code`\n ${super.classBody}\n ${this.generateCacheControlStrategyConfig()}\n ${this.generateBuildCacheControlMetadata()}\n `,\n ];\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst DEFAULT_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'DefaultImperativeResult',\n isType: true,\n};\n\nconst QUERY_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'QueryImperativeResult',\n isType: true,\n};\n\nconst SUBSCRIBABLE_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'SubscribableImperativeResult',\n isType: true,\n};\n\nconst SUBSCRIBABLE_REFRESHABLE_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'SubscribableRefreshableImperativeResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nconst DEFAULT_IMPERATIVE_BINDINGS = 'defaultImperativeBindings';\nconst SUBSCRIBABLE_IMPERATIVE_BINDINGS = 'subscribableImperativeBindings';\nconst QUERY_IMPERATIVE_BINDINGS = 'queryImperativeBindings';\nexport class ImperativeAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.className}Options`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}<${this.responseTypeCode}>`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n if (this.isSubscribable()) {\n if (this.commandModel.exposeRefresh) {\n return code`${SUBSCRIBABLE_REFRESHABLE_IMPERATIVE_RESULT}`;\n }\n return code`${SUBSCRIBABLE_IMPERATIVE_RESULT}`;\n }\n\n if (this.commandModel.operationType === 'query') {\n return code`${QUERY_IMPERATIVE_RETURN_SHAPE}`;\n }\n return code`${DEFAULT_IMPERATIVE_RETURN_SHAPE}`;\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n get invoker() {\n if (this.isSubscribable()) {\n return code`services.${SUBSCRIBABLE_IMPERATIVE_BINDINGS}.bind`;\n }\n\n if (this.commandModel.operationType === 'query') {\n return code`services.${QUERY_IMPERATIVE_BINDINGS}.bind`;\n }\n return code`services.${DEFAULT_IMPERATIVE_BINDINGS}.bind`;\n }\n\n get exposeRefresh() {\n if (this.isSubscribable()) {\n return code`${this.commandModel.exposeRefresh}`;\n }\n return code``;\n }\n\n isSubscribable() {\n return (\n this.binding.type === 'imperative' &&\n this.commandModel.operationType === 'query' &&\n this.commandModel.cacheStrategy.type !== 'none'\n );\n }\n\n buildInvocation(servicesName = 'services') {\n const requiresTypeRegistry =\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0;\n\n const typeRegistry = requiresTypeRegistry ? 'typeRegistry,' : '';\n\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>,${this.responseTypeCode}>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${typeRegistry}${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n },${this.exposeRefresh}) as ${this.bindingTypeCode};`;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst LEGACY_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'LegacyImperativeShape',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst LEGACY_IMPERATIVE_BINDINGS = 'legacyImperativeBindings';\n\nexport class ImperativeAdapterLegacyBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${LEGACY_IMPERATIVE_RETURN_SHAPE}<${this.commandConfigTypeImport},${this.responseTypeCode}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services') {\n const requiresTypeRegistry =\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0;\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=services.${LEGACY_IMPERATIVE_BINDINGS}.bind<${this.commandConfigTypeImport},${this.responseTypeCode}>(\n ({config,assertIsValid})=>{\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n return new ${this.localCommandConstructorName}(config,${requiresTypeRegistry ? 'typeRegistry,' : ''}${servicesName});\n });`;\n }\n}\n","export const QUERY_TYPE_VARIABLE_NAME = 'queryType' as const;\nexport const MUTATION_TYPE_VARIABLE_NAME = 'mutationType' as const;\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst LEGACY_GRAPHQL_IMPERATIVE_RETURN_SHAPE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'LegacyGraphQLImperativeShape',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst GRAPHQL_LEGACY_IMPERATIVE_BINDINGS = 'graphQLLegacyImperativeBindings';\n\nexport class GraphQLImperativeAdapterLegacyBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${LEGACY_GRAPHQL_IMPERATIVE_RETURN_SHAPE}<${this.commandConfigTypeImport}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=services.${GRAPHQL_LEGACY_IMPERATIVE_BINDINGS}.bind<${this.commandConfigTypeImport}>(\n ({config,assertIsValid})=>{\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n return new ${this.localCommandConstructorName}(config,${QUERY_TYPE_VARIABLE_NAME},${servicesName});\n });`;\n }\n}\n","import { code, type Code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\n\nconst WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'WireAdapterConstructor',\n isType: true,\n};\n\nconst LWC_WIRE_BINDINGS = 'lwcWireBindings';\n\nexport class WireAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration(): Code {\n return code`export let ${this.binding.identifier}:${WIRE_ADAPTER_CONSTRUCTOR}<${this.commandConfigTypeImport}, ${this.responseTypeCode}, {}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services'): Code {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=services.${LWC_WIRE_BINDINGS}.bind<${this.responseTypeCode}, ${this.commandConfigTypeImport}>(\n (config: ${this.commandConfigTypeImport}) => new ${this.localCommandConstructorName}(config!,${this.getTypeRegistryArgument()}${servicesName}),${this.commandConfigSchemaImport},${this.commandModel.exposeRefresh});`;\n }\n\n getTypeRegistryArgument(): Code {\n if (\n this.commandModel.cacheStrategy.type === 'normalized' ||\n this.commandModel.invalidationConfigs.length > 0\n ) {\n return code`typeRegistry,`;\n }\n\n return code``;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst SUBSCRIBABLE_REFRESHABLE_GRAPHQL_IMPERATIVE_RESULT: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'SubscribableRefreshableGraphQLImperativeResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nconst GRAPHQL_IMPERATIVE_BINDINGS = 'graphQLImperativeBindings';\nexport class GraphQLImperativeAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.commandName}CommandOptions`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n return code`${SUBSCRIBABLE_REFRESHABLE_GRAPHQL_IMPERATIVE_RESULT}`;\n }\n\n get invoker() {\n return code`services.${GRAPHQL_IMPERATIVE_BINDINGS}.bind`;\n }\n\n get exposeRefresh() {\n if (this.isSubscribable()) {\n return code`${this.commandModel.exposeRefresh}`;\n }\n return code``;\n }\n\n isSubscribable() {\n return true;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${QUERY_TYPE_VARIABLE_NAME},${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n },${this.exposeRefresh}) as ${this.bindingTypeCode};`;\n }\n}\n","import { code, type Code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { QUERY_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst WIRE_ADAPTER_CONSTRUCTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'WireAdapterConstructor',\n isType: true,\n};\n\nconst GRAPHQL_WIRE_BINDINGS = 'lwcGraphQLWireBindings';\n\nexport class GraphQLWireAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n }\n\n get responseTypeCode() {\n return this.services.typeDefinition.build(\n this.commandModel.responseType?.default['application/json']\n );\n }\n\n buildDeclaration(): Code {\n return code`export let ${this.binding.identifier}:${WIRE_ADAPTER_CONSTRUCTOR}<${this.commandConfigTypeImport}, ${this.responseTypeCode}, {}>;`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n buildInvocation(servicesName = 'services'): Code {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=services.${GRAPHQL_WIRE_BINDINGS}.bind<${this.commandConfigTypeImport}>((config: ${this.commandConfigTypeImport}) => new ${this.localCommandConstructorName}(config,${QUERY_TYPE_VARIABLE_NAME},${servicesName}), ${this.commandConfigSchemaImport}, ${this.commandModel.exposeRefresh});`;\n }\n}\n","import { code, type ImportableReference } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport { Binding } from '@conduit-client/model/v1';\nimport { MUTATION_TYPE_VARIABLE_NAME } from './graphql-root-variable-names';\n\nconst GRAPHQL_MUTATION_RESULT: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'GraphQLMutationResult',\n isType: true,\n};\n\nconst JSON_SCHEMA_TYPE: ImportableReference = {\n module: '@conduit-client/jsonschema-validate',\n exportedSymbol: 'JSONSchema',\n isType: true,\n};\n\nconst APPLY_DECORATORS: ImportableReference = {\n module: '@conduit-client/utils',\n exportedSymbol: 'applyDecorators',\n isType: false,\n};\n\nconst GRAPHQL_MUTATION_BINDINGS = 'graphQLMutationBindings';\n\nexport class GraphQLMutationAdapterBindingGenerator {\n protected commandConfigTypeImport: ImportableReference;\n protected commandConfigSchemaImport: ImportableReference;\n protected classBuilderImport: ImportableReference;\n protected commandOptionsTypeImport: ImportableReference;\n\n constructor(\n protected services: NamedTypeDefinitionService,\n protected commandModel: ICommandModel,\n protected binding: Binding\n ) {\n this.commandConfigTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'Config',\n isType: true,\n };\n this.commandConfigSchemaImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'CONFIG_SCHEMA',\n isType: false,\n };\n this.classBuilderImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: 'buildCommandClass',\n isType: false,\n };\n this.commandOptionsTypeImport = {\n filename: this.commandModel.filePath,\n exportedSymbol: `${this.commandModel.commandName}CommandOptions`,\n isType: true,\n };\n }\n\n buildDeclaration() {\n return code`export let ${this.binding.identifier}:${this.bindingTypeCode};`;\n }\n\n get bindingTypeCode() {\n return code`(config:${this.commandConfigTypeImport}, options?: ${this.commandOptionsTypeImport})=>${this.returnShape}`;\n }\n\n get localCommandConstructorName() {\n return `${this.binding.identifier}_ctor`;\n }\n\n get localCommandModel() {\n return this.commandModel;\n }\n\n get returnShape() {\n return code`${GRAPHQL_MUTATION_RESULT}`;\n }\n\n get invoker() {\n return code`services.${GRAPHQL_MUTATION_BINDINGS}.bind`;\n }\n\n buildInvocation(servicesName = 'services') {\n return code`const ${this.localCommandConstructorName} = services.instrumentCommand(${this.classBuilderImport}(${servicesName}.${this.commandModel.serviceDependencies.baseClass.localName}), '${this.commandModel.className}');\n ${this.binding.identifier}=${this.invoker}<Parameters<typeof ${this.binding.identifier}>>(\n ({params,assertIsValid})=>{\n const config=params[0];\n const options=params[1];\n const _:<T>(data:unknown,_:${JSON_SCHEMA_TYPE})=>asserts data is T=assertIsValid;\n _<${this.commandConfigTypeImport}>(config,${this.commandConfigSchemaImport});\n \n const baseCommand = new ${this.localCommandConstructorName}(config,${MUTATION_TYPE_VARIABLE_NAME},${servicesName});\n return ${APPLY_DECORATORS}(baseCommand, [${servicesName}.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);\n }) as ${this.bindingTypeCode};`;\n }\n}\n","import {\n stableJSONStringify,\n stringIsVersion,\n toTypeScriptSafeIdentifier,\n Version,\n} from '@conduit-client/utils';\nimport { code, Code, type ImportableReference, type NamedFileService } from '../files';\nimport { type NamedTypeDefinitionService } from '../types';\nimport { ImperativeAdapterBindingGenerator } from './imperative-binding-generator';\nimport { ImperativeAdapterLegacyBindingGenerator } from './imperative-legacy-binding-generator';\nimport { GraphQLImperativeAdapterLegacyBindingGenerator } from './graphql-imperative-legacy-binding-generator';\nimport { WireAdapterBindingGenerator } from './wire-binding-generator';\nimport type { ICommandModel, ServiceDependency } from '../model/base-command-model';\nimport type { IGraphQLCommandModel } from '../model/graphql-command-model-interface';\nimport type {\n NamedTypeRegistryGeneratorService,\n TypeRegistryGenerator,\n} from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport { Binding, NamedAPIService } from '@conduit-client/model/v1';\nimport { GraphQLObjectType } from '../normalization/graphql-type-generator';\nimport { GraphQLImperativeAdapterBindingGenerator } from './graphql-imperative-binding-generator';\nimport { GraphQLWireAdapterBindingGenerator } from './graphql-wire-binding-generator';\nimport { GraphQLMutationAdapterBindingGenerator } from './graphql-mutation-binding-generator';\nimport {\n QUERY_TYPE_VARIABLE_NAME,\n MUTATION_TYPE_VARIABLE_NAME,\n} from './graphql-root-variable-names';\nimport type {\n ResolvedOperationServices,\n ResolvedServiceDescriptor,\n} from '@conduit-client/model/v1';\nimport { buildServiceProjection } from './utils';\n\nconst SERVICE_REQUEST_TYPE: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n exportedSymbol: 'ServiceRequest',\n isType: true,\n};\n\nconst OPTIONAL_SERVICE_REQUEST_TYPE: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n exportedSymbol: 'OptionalServiceRequest',\n isType: true,\n};\n\nconst GET_SERVICES: ImportableReference = {\n module: '@conduit-client/service-provisioner/v1',\n isType: false,\n};\n\nconst INSTRUMENT_COMMAND_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-instrument-command/v1',\n exportedSymbol: 'InstrumentCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_INSTRUMENT_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/service-instrument-command/v1',\n exportedSymbol: 'NamedInstrumentCommandService',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\nconst FETCH_NETWORK_COMMAND_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_FETCH_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'NamedFetchNetworkCommandService',\n isType: true,\n};\n\nconst LWC_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'LWCWireBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_LWC_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'NamedLWCWireBindingsService',\n isType: true,\n};\n\nconst LWC_GRAPHQL_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'LWCGraphQLWireBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_LWC_GRAPHQL_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-lwc/v1',\n exportedSymbol: 'NamedLWCGraphQLWireBindingsService',\n isType: true,\n};\n\nconst DEFAULT_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'DefaultImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_DEFAULT_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedDefaultImperativeBindingsService',\n isType: true,\n};\n\nconst QUERY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'QueryImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_QUERY_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedQueryImperativeBindingsService',\n isType: true,\n};\n\nconst SUBSCRIBABLE_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'SubscribableImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_SUBSCRIBABLE_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedSubscribableImperativeBindingsService',\n isType: true,\n};\n\nconst LEGACY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'LegacyImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_LEGACY_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedLegacyImperativeBindingsService',\n isType: true,\n};\n\nconst GRAPHQL_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'GraphQLImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_GRAPHQL_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedGraphQLImperativeBindingsService',\n isType: true,\n};\n\nconst GRAPHQL_LEGACY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'GraphQLLegacyImperativeBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_GRAPHQL_LEGACY_IMPERATIVE_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedGraphQLLegacyImperativeBindingsService',\n isType: true,\n};\n\nconst GRAPHQL_MUTATION_BINDINGS_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'GraphQLMutationBindingsServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_GRAPHQL_MUTATION_BINDINGS_SERVICE: ImportableReference = {\n module: '@conduit-client/service-bindings-imperative/v1',\n exportedSymbol: 'NamedGraphQLMutationBindingsService',\n isType: true,\n};\n\nexport type IBindingsGenerator = {\n build(): void;\n};\n\nexport function defaultAdapterBindingsGeneratorFactory(\n services: NamedTypeDefinitionService,\n model: ICommandModel,\n binding: Binding\n):\n | ImperativeAdapterBindingGenerator\n | ImperativeAdapterLegacyBindingGenerator\n | WireAdapterBindingGenerator\n | GraphQLImperativeAdapterBindingGenerator\n | GraphQLImperativeAdapterLegacyBindingGenerator\n | GraphQLWireAdapterBindingGenerator\n | GraphQLMutationAdapterBindingGenerator {\n const restBindingGenerators = {\n imperative: ImperativeAdapterBindingGenerator,\n 'imperative-legacy': ImperativeAdapterLegacyBindingGenerator,\n wire: WireAdapterBindingGenerator,\n };\n\n const graphqlBindingGenerators = {\n imperative: GraphQLImperativeAdapterBindingGenerator,\n 'imperative-legacy': GraphQLImperativeAdapterLegacyBindingGenerator,\n wire: GraphQLWireAdapterBindingGenerator,\n mutation: GraphQLMutationAdapterBindingGenerator,\n };\n\n let GeneratorClass:\n | typeof ImperativeAdapterBindingGenerator\n | typeof ImperativeAdapterLegacyBindingGenerator\n | typeof WireAdapterBindingGenerator\n | typeof GraphQLImperativeAdapterBindingGenerator\n | typeof GraphQLImperativeAdapterLegacyBindingGenerator\n | typeof GraphQLWireAdapterBindingGenerator\n | typeof GraphQLMutationAdapterBindingGenerator\n | undefined;\n\n if (model.operationType === 'graphql') {\n const key = binding.type as keyof typeof graphqlBindingGenerators;\n GeneratorClass = graphqlBindingGenerators[key];\n } else {\n const key = binding.type as keyof typeof restBindingGenerators;\n GeneratorClass = restBindingGenerators[key];\n }\n\n if (!GeneratorClass) {\n throw new Error(`Unknown binding type: ${binding.type}`);\n }\n\n return new GeneratorClass(services, model, binding);\n}\n\n/**\n * Class responsible for generating binding files based on command models and service dependencies.\n *\n * The `BindingsGenerator` class orchestrates the creation of files that manage service dependencies,\n * adapters, and invocation logic for a given set of command models. It provides a template for the binding\n * structure and manages the generation and integration of individual adapter bindings.\n *\n * The expectation for new bindings is that new *BindingGenerator classes are used inside of the build method.\n *\n * @property {NamedFileService & NamedTypeDefinitionService} services - Services required for file handling and type definitions.\n * @property {ICommandModel[]} commandModels - Array of command models to generate bindings for.\n */\nexport class BindingsGenerator {\n constructor(\n protected services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService,\n protected commandModels: ICommandModel[],\n protected adapterBindingsGeneratorFactory = defaultAdapterBindingsGeneratorFactory\n ) {}\n\n protected adapterDeclarationSymbol = Symbol.for('adapterDeclarations');\n protected bindingsServicesDeclarationSymbol = Symbol.for('bindingsServicesDeclaration');\n protected serviceRequirementsSymbol = Symbol.for('serviceRequirements');\n protected adapterInvocationSymbol = Symbol.for('adapterInvocation');\n protected typeRegistryInstantiationSymbol = Symbol.for('typeRegistryInstantiation');\n protected typeInvalidationDeclarationSymbol = Symbol.for('typeInvalidationDeclaration');\n protected typeInvalidationDefinitionSymbol = Symbol.for('typeInvalidationDefinition');\n protected rootTypesInstantiationSymbol = Symbol.for('rootTypesInstantiation');\n\n /**\n * Template for generating the binding structure in the output file.\n * Includes placeholders for adapter declarations, service requirements, and adapter invocations.\n *\n * Bindings files are structured as:\n * 1. Adapter declarations -> an export of the wire or imperative adapter that is initially undefined, but has proper typescript typing\n * 2. Service requirements -> a declaration of what services this module depends on from the service provisioner\n * 3. Adapter instantiation/invocation -> Creation and population of the declaration with a real adapter implementation, after\n * all the required services have been received.\n *\n * @returns {Code[]} An array of code blocks forming the template for the binding output file.\n */\n get template() {\n return [\n this.bindingsServicesDeclarationSymbol,\n this.adapterDeclarationSymbol,\n this.typeInvalidationDeclarationSymbol,\n code`const serviceRequirements=`,\n this.serviceRequirementsSymbol,\n code`;`,\n code`${GET_SERVICES}(serviceRequirements).then(\n (services) => {`,\n this.typeRegistryInstantiationSymbol,\n this.rootTypesInstantiationSymbol,\n this.typeInvalidationDefinitionSymbol,\n this.adapterInvocationSymbol,\n code`},(_err) => {});`,\n ];\n }\n\n protected get serviceDependencies(): ServiceDependency[] {\n const deps = [\n {\n version: '1.0' as const,\n descriptor: INSTRUMENT_COMMAND_DESCRIPTOR,\n namedService: NAMED_INSTRUMENT_COMMAND_SERVICE,\n localName: 'instrumentCommand',\n serviceName: 'instrumentCommand',\n },\n ];\n\n if (this.hasRESTNormalization || this.hasGraphQL) {\n deps.push(\n {\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n },\n {\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n }\n );\n }\n\n if (this.hasImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: FETCH_NETWORK_COMMAND_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_NETWORK_COMMAND_SERVICE,\n localName: 'fetchNetworkCommandBaseClass',\n serviceName: 'fetchNetworkCommandBaseClass',\n });\n }\n\n if (this.hasDefaultImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: DEFAULT_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_DEFAULT_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'defaultImperativeBindings',\n serviceName: 'defaultImperativeBindings',\n });\n }\n if (this.hasQueryImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: QUERY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_QUERY_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'queryImperativeBindings',\n serviceName: 'queryImperativeBindings',\n });\n }\n if (this.hasSubscribableImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: SUBSCRIBABLE_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_SUBSCRIBABLE_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'subscribableImperativeBindings',\n serviceName: 'subscribableImperativeBindings',\n });\n }\n if (this.hasLegacyImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: LEGACY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_LEGACY_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'legacyImperativeBindings',\n serviceName: 'legacyImperativeBindings',\n });\n }\n if (this.hasGraphQLImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: GRAPHQL_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_GRAPHQL_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'graphQLImperativeBindings',\n serviceName: 'graphQLImperativeBindings',\n });\n }\n if (this.hasGraphQLLegacyImperativeBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: GRAPHQL_LEGACY_IMPERATIVE_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_GRAPHQL_LEGACY_IMPERATIVE_BINDINGS_SERVICE,\n localName: 'graphQLLegacyImperativeBindings',\n serviceName: 'graphQLLegacyImperativeBindings',\n });\n }\n if (this.hasGraphQLMutationBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: GRAPHQL_MUTATION_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_GRAPHQL_MUTATION_BINDINGS_SERVICE,\n localName: 'graphQLMutationBindings',\n serviceName: 'graphQLMutationBindings',\n });\n }\n if (this.hasWireBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: LWC_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_LWC_BINDINGS_SERVICE,\n localName: 'lwcWireBindings',\n serviceName: 'lwcWireBindings',\n });\n }\n if (this.hasGraphQLWireBindings) {\n deps.push({\n version: '1.0' as const,\n descriptor: LWC_GRAPHQL_BINDINGS_SERVICE_DESCRIPTOR,\n namedService: NAMED_LWC_GRAPHQL_BINDINGS_SERVICE,\n localName: 'lwcGraphQLWireBindings',\n serviceName: 'lwcGraphQLWireBindings',\n });\n }\n return deps;\n }\n\n /**\n * Builds the binding file, generating declarations, requirements, and invocations for each command model.\n * This method coordinates with individual binding generators to compile the necessary elements into a single file.\n */\n build() {\n const filename = 'artifacts/bindings.ts';\n const file = this.services.file.build(filename);\n file.template = this.template;\n\n if (this.hasRESTNormalization) {\n const { typeRegistryGenerator } = this.services;\n file.pushTo(\n this.typeRegistryInstantiationSymbol,\n code`const typeRegistry = new ${typeRegistryGenerator.build()}(services);`\n );\n\n // needs to be called after all the (normalizer) types are built, which is guaranteed for bindings.\n const { declarations, definitions } = this.buildTypeInvalidation(\n typeRegistryGenerator.invalidatableTypes\n );\n\n file.pushTo(this.typeInvalidationDeclarationSymbol, declarations);\n file.pushTo(this.typeInvalidationDefinitionSymbol, definitions);\n }\n\n if (this.hasGraphQL) {\n const { graphqlTypeRegistryGenerator } = this.services;\n const graphqlTypeRegistry = graphqlTypeRegistryGenerator.build();\n const firstGraphQLCommand = this.commandModels.find(\n (model) => model.operationType === 'graphql'\n ) as IGraphQLCommandModel;\n const queryTypeModel: GraphQLObjectType = firstGraphQLCommand?.schema.types.find(\n (type: any) => type.name === firstGraphQLCommand.schema.queryTypeName\n )! as GraphQLObjectType;\n const queryType = graphqlTypeRegistryGenerator.buildGraphQLType({\n schemaModel: firstGraphQLCommand.schema,\n type: queryTypeModel,\n });\n const mutationTypeModel: GraphQLObjectType | undefined = firstGraphQLCommand?.schema\n .mutationTypeName\n ? (firstGraphQLCommand.schema.types.find(\n (type: any) => type.name === firstGraphQLCommand.schema.mutationTypeName\n ) as GraphQLObjectType | undefined)\n : undefined;\n const mutationType = mutationTypeModel\n ? graphqlTypeRegistryGenerator.buildGraphQLType({\n schemaModel: firstGraphQLCommand.schema,\n type: mutationTypeModel,\n })\n : undefined;\n\n file.pushTo(\n this.rootTypesInstantiationSymbol,\n code`const graphqlTypeRegistry = new ${graphqlTypeRegistry}(services);\n const ${QUERY_TYPE_VARIABLE_NAME} = graphqlTypeRegistry.${queryType.propertyName};`\n );\n if (mutationType) {\n file.pushTo(\n this.rootTypesInstantiationSymbol,\n code`const ${MUTATION_TYPE_VARIABLE_NAME} = graphqlTypeRegistry.${mutationType.propertyName};`\n );\n }\n }\n\n const bindingGenerators = this.commandModels.flatMap((model) =>\n model.bindings.map((binding) => {\n return this.adapterBindingsGeneratorFactory(this.services, model, binding);\n })\n );\n\n // adapter declaration\n bindingGenerators.forEach((generator) => {\n file.pushTo(this.adapterDeclarationSymbol, generator.buildDeclaration());\n });\n\n file.pushTo(this.serviceRequirementsSymbol, this.buildRequirements());\n\n file.pushTo(\n this.adapterInvocationSymbol,\n Code.join(\n bindingGenerators.flatMap((generator) => {\n const [servicesName, serviceOverrides] = buildServiceProjection(\n generator.localCommandModel\n );\n const invocation = generator.buildInvocation(servicesName);\n if (serviceOverrides) {\n return [serviceOverrides, invocation];\n }\n return invocation;\n }),\n ''\n )\n );\n }\n\n buildTypeInvalidation(typesWithNormalization: TypeRegistryGenerator['invalidatableTypes']) {\n return typesWithNormalization.reduce<{ definitions: Code[]; declarations: Code[] }>(\n (acc, { propertyName, typeClassRef }) => {\n const invalidateFunctionName = code`invalidate${toTypeScriptSafeIdentifier(propertyName)}`;\n acc.declarations.push(\n code`export let ${invalidateFunctionName}: ${typeClassRef}[\"invalidate\"];`\n );\n acc.definitions.push(\n code`${invalidateFunctionName} = (configs) => typeRegistry.${toTypeScriptSafeIdentifier(propertyName)}.invalidate(configs);`\n );\n return acc;\n },\n { declarations: [], definitions: [] }\n );\n }\n\n protected buildRequirements() {\n const serviceDependencies: ServiceDependency[] = [...this.serviceDependencies];\n\n const depsEqual = (a: ServiceDependency, b: ServiceDependency) => {\n return (\n a.localName === b.localName &&\n a.serviceName === b.serviceName &&\n a.version === b.version &&\n stableJSONStringify(a.tags) === stableJSONStringify(b.tags)\n );\n };\n const findMatchingDeps = (collection: ServiceDependency[], newDep: ServiceDependency) => {\n return collection.filter((existingDep) => depsEqual(existingDep, newDep));\n };\n const pushDep = (collection: ServiceDependency[], newDep: ServiceDependency) => {\n const matchingExistingDeps = findMatchingDeps(collection, newDep);\n const collectionContainsDep = matchingExistingDeps.length > 0;\n\n if (!collectionContainsDep) {\n const existingServicesWithMatchingName = collection.filter(\n (dep) => dep.localName === newDep.localName\n );\n if (existingServicesWithMatchingName.length > 0) {\n throw new Error(\n `Conflicting dependencies for service name ${newDep.localName}: ${JSON.stringify(newDep)}, ${JSON.stringify(existingServicesWithMatchingName)}`\n );\n }\n collection.push(newDep);\n } else {\n // Dep already exists, but may have different requiredness\n const dep = matchingExistingDeps[0];\n dep.optional &&= newDep.optional;\n }\n };\n\n const matchServiceWithOverride = (\n collection: ServiceDependency[],\n alias: string,\n entry: ResolvedServiceDescriptor\n ) => {\n return collection.find((service) => {\n if (service.localName === alias) {\n if (\n !(\n service.version === entry.version &&\n service.tags === entry.tags &&\n service.serviceName === entry.type\n )\n ) {\n return service;\n } else {\n throw new Error(\n `Tried to override service ${alias} but it already existed with the same parameters`\n );\n }\n }\n });\n };\n\n const overrideServices = (\n collection: ServiceDependency[],\n overrides: ResolvedOperationServices,\n model: ICommandModel\n ) => {\n for (const [alias, entry] of Object.entries(overrides)) {\n let existingService = matchServiceWithOverride(collection, alias, entry);\n if (existingService && stringIsVersion(entry.version)) {\n const serviceOverride: ServiceDependency = {\n version: entry.version,\n descriptor: existingService.descriptor,\n namedService: existingService.namedService,\n localName: [entry.type, toTypeScriptSafeIdentifier(model.commandName)].join(\n '_'\n ),\n serviceName: entry.type,\n tags: entry.tags,\n };\n collection.push(serviceOverride);\n } else {\n throw new Error(\n `Tried to override service ${alias} but it did not exist already`\n );\n }\n }\n };\n\n const overrideDefaultServices = (\n collection: ServiceDependency[],\n overrides: ResolvedOperationServices\n ) => {\n for (const [alias, entry] of Object.entries(overrides)) {\n let existingService = matchServiceWithOverride(collection, alias, entry);\n if (existingService && stringIsVersion(entry.version)) {\n // override existing service, but don't change local name, since this now replacing the base version of the service\n existingService.version = entry.version;\n existingService.serviceName = entry.type;\n existingService.tags = entry.tags;\n } else {\n throw new Error(\n `Tried to override service ${alias} but it did not exist already`\n );\n }\n }\n };\n\n this.commandModels.forEach((model) => {\n pushDep(serviceDependencies, model.serviceDependencies.baseClass);\n model.serviceDependencies.inherited.forEach((dep) => pushDep(serviceDependencies, dep));\n model.serviceDependencies.extra.forEach((dep) => pushDep(serviceDependencies, dep));\n overrideServices(serviceDependencies, model.serviceDependencies.overrides, model);\n });\n\n if (this.commandModels.length) {\n // all the models should have the same defaultOverrides so can just pick the first\n overrideDefaultServices(\n serviceDependencies,\n this.commandModels[0].serviceDependencies.defaultOverrides\n );\n }\n\n return code`{${Code.join(\n serviceDependencies.map((dep) => {\n return code`${dep.localName}:{type:'${dep.serviceName}',version:'${dep.version}'${dep.tags ? `,tags:${JSON.stringify(dep.tags)}` : ''}${dep.optional ? `,optional:true` : ''}} as ${dep.optional ? OPTIONAL_SERVICE_REQUEST_TYPE : SERVICE_REQUEST_TYPE}<${dep.descriptor}>`;\n }),\n ','\n )}}`;\n }\n\n protected get hasRESTNormalization() {\n return this.commandModels.some((model) => {\n return model.cacheStrategy.type === 'normalized' && model.operationType !== 'graphql';\n });\n }\n\n protected get hasGraphQL() {\n return this.commandModels.some((model) => model.operationType === 'graphql');\n }\n\n protected get hasWireBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some((binding) => binding.type === 'wire')\n );\n }\n\n protected get hasImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'imperative' || binding.type === 'mutation'\n )\n );\n }\n\n protected get hasDefaultImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) =>\n binding.type === 'imperative' &&\n model.operationType !== 'query' &&\n model.operationType !== 'graphql'\n )\n );\n }\n\n protected get hasQueryImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'imperative' && model.operationType === 'query'\n )\n );\n }\n\n protected get hasSubscribableImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) =>\n binding.type === 'imperative' &&\n model.operationType === 'query' &&\n model.cacheStrategy.type !== 'none'\n )\n );\n }\n\n protected get hasLegacyImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some((binding) => binding.type === 'imperative-legacy')\n );\n }\n\n protected get hasGraphQLImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'imperative' && model.operationType === 'graphql'\n )\n );\n }\n\n protected get hasGraphQLLegacyImperativeBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) =>\n binding.type === 'imperative-legacy' && model.operationType === 'graphql'\n )\n );\n }\n\n protected get hasGraphQLMutationBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'mutation' && model.operationType === 'graphql'\n )\n );\n }\n\n protected get hasGraphQLWireBindings() {\n return this.commandModels.some((model) =>\n model.bindings.some(\n (binding) => binding.type === 'wire' && model.operationType === 'graphql'\n )\n );\n }\n}\n","import type { Parameter, Type, QueryParameter, TypeOfParameter } from '@conduit-client/model/v1';\n\n/**\n * Converts a set of parameter specification from Record<string, Parameter> to a list of named parameters info.\n * Performs dupe parameters detection.\n *\n * @param records the parameter specifications to convert\n * @returns a list of parameters info\n */\nexport function getParameterMembers<T extends Type = TypeOfParameter<Parameter>>(\n ...records: Record<string, Parameter<T>>[]\n): { name: string; type: T; required: boolean; explode?: boolean }[] {\n let dupes: string[] = [];\n const members = records.filter(Boolean).reduce(\n (result, record) => {\n const current = result.map((m) => m.name);\n const members = Object.entries(record).map(([name, param]) => {\n return { name, ...param };\n });\n dupes = dupes.concat(\n members.filter((m) => current.includes(m.name)).map((m) => m.name)\n );\n return result.concat(members);\n },\n [] as { name: string; type: T; required: boolean; explode?: boolean }[]\n );\n if (dupes.length > 0) {\n throw new Error(`duplicate parameters found: ${dupes.join(', ')}`);\n }\n return members;\n}\n\nexport const getQueryParameterMembers = getParameterMembers<TypeOfParameter<QueryParameter>>;\n","import { getParameterMembers, getQueryParameterMembers } from '../utils';\nimport {\n type Operation,\n type AllOfType,\n type ObjectType,\n type Type,\n canonicalizeType,\n} from '@conduit-client/model/v1';\nimport type { ContentModel } from '../model/base-command-model';\n\n/**\n * Class for building command configurations based on an operation and its associated parameters.\n * This builder handles the construction of an object type structure that encapsulates various parameters\n * from an operation, including query parameters, headers, URI parameters, and potentially a payload.\n *\n * @property {Operation} operation - The operation object that provides context for the command configuration.\n * @property {{ type: Type; name: string } | undefined} payload - Optional payload definition that specifies the type and name of the main data structure if needed.\n */\nexport class CommandConfigBuilder {\n constructor(\n protected operation: Operation,\n protected payload?: { content: ContentModel; parameterName: string }\n ) {}\n\n /**\n * Builds and returns an object type configuration based on the initial operation and the optional payload.\n * This method organizes various request parameters into a structured type definition, suitable for generating type-safe command configurations.\n *\n * @returns {ObjectType} The complete configuration type for the command, encapsulating all necessary parameters and payload definitions.\n */\n build(): Type {\n const request = this.operation.requests[0];\n\n const queryParams = [request?.queryParameters];\n const otherParams = [\n // request?.cookies,\n request?.headers,\n request?.uriParameters,\n this.operation.endpoint.uriParameters,\n this.operation.server.uriParameters,\n ];\n\n const configType = {\n type: 'allOf',\n allOf: [\n {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'not',\n\n not: { type: 'any' },\n },\n },\n ],\n includes: (_t: Type) => false,\n } as AllOfType;\n\n [\n ...getQueryParameterMembers(...queryParams),\n ...getParameterMembers(...otherParams),\n ].forEach((param) => {\n (configType.allOf[0] as ObjectType).properties[param.name] = {\n type: param.type,\n required: param.required,\n };\n });\n\n if (this.payload) {\n if (this.operation.configSchemaType === 'flattened') {\n // Input payload needs to be flattened for backwards compatibility with\n // older versions of Luvio.\n let payloadType = this.payload.content['application/json']!;\n let canonicalPayloadType = canonicalizeType(payloadType);\n\n // when flattening, we use `allOf`, which means all members of the `allOf` must allow `additionalProperties`\n if (canonicalPayloadType.type === 'object') {\n canonicalPayloadType = {\n ...canonicalPayloadType,\n additionalProperties: {\n type: 'any',\n },\n };\n }\n configType.allOf.push(canonicalPayloadType);\n (configType.allOf[0] as ObjectType).additionalProperties = {\n type: 'any',\n };\n } else {\n (configType.allOf[0] as ObjectType).properties[this.payload.parameterName] = {\n type: this.payload.content['application/json']!,\n required: true,\n };\n }\n }\n return configType;\n }\n}\n","import { canonicalizeType, Type } from '@conduit-client/model/v1';\nimport { Code, code, ImportableTypeReference, ImportableValueReference } from '../files';\nimport type { CommandGenerator } from './base-command-generator';\n\n// Interface to define the methods provided by the normalized cache control mixin\nexport interface NormalizedCacheControlGenerator {\n generateCacheControlStrategyConfig(): Code;\n}\n\ntype Constructor = new (...args: any[]) => CommandGenerator;\ntype NormalizedCacheControlConstructor = new (\n ...args: any[]\n) => CommandGenerator & NormalizedCacheControlGenerator;\n\nconst DATA_OF: ImportableTypeReference = {\n module: '@conduit-client/type-normalization/v1',\n exportedSymbol: 'DataOf',\n isType: true,\n};\n\n/**\n *\n * @param Base The base class to mix in the normalized code generation logic to\n * @param commandBaseClass An importable refernce to the command base class to use in the generated code\n * @returns A new class with the normalized generation behavior mixed in\n */\nexport function NormalizedCacheControlGeneratorMixin(\n Base: Constructor,\n commandBaseClass: ImportableTypeReference\n): NormalizedCacheControlConstructor {\n return class NormalizedCacheControl extends Base implements NormalizedCacheControlGenerator {\n commandBaseClass = commandBaseClass;\n get commandTypeConstructorArgs() {\n return code`config: Config, typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n get commandConstructorArgs() {\n return code`private config: Config, private typeRegistry: ${this.services.typeRegistryGenerator.build()}`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n const builtType = this.buildResponseType();\n return code`${builtType.typeClassRef}${extraServicesCode ? code`, ${extraServicesCode}` : ''}`;\n }\n\n get classBody(): Code[] {\n return [\n ...super.classBody,\n // TODO: this is a stub for the real data\n this.generateCacheControlStrategyConfig(),\n this.generateBuildResultType(),\n this.generateBuildReadInput(),\n this.generateBuildWriteInput(),\n ];\n }\n\n generateCacheControlStrategyConfig(): Code {\n if (this.commandModel.cacheStrategy.type !== 'normalized') {\n throw new Error('incorrect cache strategy');\n }\n\n const cacheControl = this.commandModel.cacheStrategy['cache-control'];\n\n function getCacheControlValue() {\n if (cacheControl.type === 'no-cache') {\n return code`{type: 'no-cache', now:Date.now()/1000}`;\n }\n return code`{type: 'max-age',requestMaxAge: ${cacheControl['max-age']},now:Date.now()/1000}`;\n }\n\n return code`get cacheControlStrategyConfig(){return ${getCacheControlValue()} as const;}`;\n }\n\n protected generateBuildResultType() {\n const builtType = this.buildResponseType();\n return code`buildResultType(){return this.typeRegistry.${builtType.propertyName}}`;\n }\n\n protected generateBuildReadInput() {\n return code`buildQuery(){\n return {type: 'keyParams', keyParams: ${this.buildKeyConfig()} } as const;\n }`;\n }\n\n protected generateBuildWriteInput() {\n return code`buildWriteInput(data: ${DATA_OF}<${this.buildResponseType().typeClassRef}>){return ${this.needsResourceWrapperType ? '{data, keyParams: this.config}' : '{data}'};}`;\n }\n\n private get responseType() {\n const responseType = this.commandModel.responseType?.default['application/json'];\n if (!responseType) {\n throw new Error('Could not find a response for operation');\n }\n return canonicalizeType(responseType);\n }\n\n private get cacheStrategy() {\n const cacheStrategy = this.commandModel.cacheStrategy;\n if (cacheStrategy.type !== 'normalized') {\n throw new Error('Got an unnormalized operation');\n }\n return cacheStrategy;\n }\n\n private get needsResourceWrapperType() {\n const isOperationMappedToIdentifiableType =\n this.cacheStrategy.key && this.responseType.extensions?.type === 'identifiable';\n\n return !isOperationMappedToIdentifiableType;\n }\n\n private buildResponseType(): {\n propertyName: string;\n typeClassRef: ImportableValueReference;\n } {\n const responseType = this.responseType;\n\n if (this.needsResourceWrapperType) {\n const wrappedResponseType = {\n type: 'ref',\n $ref: responseType,\n extensions: {\n type: 'identifiable',\n key: { fields: {} },\n 'cache-control': this.cacheStrategy['cache-control'],\n },\n } as const satisfies Type;\n return this.services.typeRegistryGenerator.buildType(wrappedResponseType, {\n namespace: this.services.api.api.namespace,\n name: `${this.commandModel.commandName}Response`,\n keyParamType: { ...this.commandModel.configType },\n isInvalidatable: false,\n });\n }\n\n const typename = this.services.api.api.types.nameOf(responseType);\n\n if (typename === undefined) {\n throw new Error('cannot find name for response type');\n }\n\n return this.services.typeRegistryGenerator.buildType(responseType, {\n namespace: this.services.api.api.namespace,\n name: typename,\n });\n }\n\n private buildKeyConfig() {\n if (this.needsResourceWrapperType) {\n return this.buildResourceKeyConfig();\n }\n const operationKey = this.cacheStrategy.key!;\n\n return this.buildMappedKeyConfig(operationKey);\n }\n\n private buildResourceKeyConfig() {\n return code`this.config`;\n }\n };\n}\n","import { code, type ImportableTypeReference, type Code } from '../files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { ImportableReference, NamedFileService } from '../files';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport { GraphQLSchemaModel } from '../model/graphql-schema-model';\nimport type { CommandGenerator } from './base-command-generator';\nimport type { NormalizedCacheControlGenerator } from './normalized-cache-control-generator-mixin';\nimport { GRAPHQL_DATA } from '../normalization/graphql/base-type-generator';\n\nconst GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY: ImportableTypeReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLDocumentRootTypeRepository',\n isType: true,\n};\n\nconst DOCUMENT_NODE: ImportableTypeReference = {\n module: '@conduit-client/onestore-graphql-parser/v1',\n exportedSymbol: 'DocumentNode',\n isType: true,\n};\n\nconst GRAPHQL_QUERY_JSON_SCHEMA: ImportableReference = {\n module: '@conduit-client/graphql-normalization/v1',\n exportedSymbol: 'GraphQLQueryJsonSchema',\n isType: false,\n};\n\nconst NAMED_CACHE_CONTROLLER_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst NAMED_AURA_NETWORK_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkService',\n isType: true,\n};\n\nconst NAMED_FETCH_SERVICE: ImportableTypeReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\ntype Constructor = new (...args: any[]) => CommandGenerator & NormalizedCacheControlGenerator;\n\ntype GraphQLCommandGeneratorServices = NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService;\n\n/**\n * Mixin that adds GraphQL-specific functionality to command generators.\n * This mixin modifies command generators to work with GraphQL operations by:\n * 1. Using DocumentNode for the query config type instead of string\n * 2. Adding documentRootType parameter to constructor\n * 3. Generating GraphQL-specific methods like buildRequestQuery\n */\nexport function GraphQLNormalizedCacheControlGeneratorMixin(\n Base: Constructor,\n commandBaseClass: ImportableTypeReference\n): Constructor {\n return class GraphQLNormalizedCacheControl extends Base {\n // Type assertion to ensure services has GraphQL type registry\n declare services: GraphQLCommandGeneratorServices;\n\n commandBaseClass = commandBaseClass;\n\n protected documentRootTypeSymbol = Symbol.for('documentRootType');\n\n get template() {\n return [\n code`export type DocumentRootType = ${GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY}<${GRAPHQL_DATA}, ${GRAPHQL_DATA}>;`,\n ...super.template,\n ];\n }\n\n protected buildNetworkServicesCode(): Code {\n return this.commandModel.aura\n ? code`Partial<${NAMED_AURA_NETWORK_SERVICE}> & Partial<${NAMED_FETCH_SERVICE}>`\n : code`${NAMED_FETCH_SERVICE}`;\n }\n\n protected generateCommandType(): Code {\n return code`export type Command = new (config: Config, documentRootType: DocumentRootType, services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object) => CommandType;`;\n }\n\n get commandTypeConstructorArgs() {\n return code`config: Config, documentRootType: DocumentRootType, services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object`;\n }\n\n get commandConstructorArgs() {\n return code`protected config: Config, protected documentRootType: DocumentRootType, protected services: ${NAMED_CACHE_CONTROLLER_SERVICE} & ${NAMED_PUBSUB_SERVICE} & ${this.buildNetworkServicesCode()} & object`;\n }\n\n get commandConstructorBody() {\n return code`super(config, documentRootType, services);`;\n }\n\n get classBody(): Code[] {\n // For GraphQL commands, we only need to override specific methods\n // The base class already provides most GraphQL functionality\n return [\n this.generateCacheControlStrategyConfig(),\n this.generateUrl(),\n this.generateEndpoint(),\n this.generateAuraBodyWrapperName(),\n ];\n }\n\n // Override to avoid generating an operationType getter on GraphQL commands\n protected generateOperationType(): Code {\n return code``;\n }\n\n /**\n * Generate the URL getter for the GraphQL endpoint\n */\n protected generateUrl(): Code {\n // Use the endpoint path from the command model\n const path = this.commandModel.endpointUrlPath;\n return code`\n get url() { \n return '${path}'; \n }\n `;\n }\n\n /**\n * Generate the endpoint property for GraphQL commands\n */\n protected generateEndpoint(): Code {\n const aura = this.commandModel.aura;\n if (aura) {\n return code`endpoint = '${aura.controller}.${aura.method}';`;\n }\n return code``;\n }\n\n /**\n * Generate the auraBodyWrapperName getter\n */\n protected generateAuraBodyWrapperName(): Code {\n // Use the aura body param if available\n const bodyParam = this.commandModel.aura?.bodyParam;\n if (bodyParam) {\n return code`\n protected get auraBodyWrapperName() { \n return '${bodyParam}'; \n }\n `;\n }\n return code``;\n }\n\n protected buildCommandConfigType() {\n // Override to use DocumentNode for query field instead of merging with base type\n return code`{\n query: ${DOCUMENT_NODE};\n variables?: Record<string, unknown>;\n operationName?: string;\n } & Record<string, unknown>`;\n }\n\n protected buildCommandConfigSchema() {\n return code`${GRAPHQL_QUERY_JSON_SCHEMA}`;\n }\n\n protected generateConstructor(): Code {\n return code`constructor(${this.commandConstructorArgs}){${this.commandConstructorBody}}`;\n }\n\n protected buildCommandTypeGenerics() {\n const extraServicesCode = this.buildExtraServices();\n return code`${extraServicesCode ? code`, ${extraServicesCode}` : 'object'}`;\n }\n };\n}\n","import { type ImportableReference } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\nimport { GraphQLNormalizedCacheControlGeneratorMixin } from './graphql-normalized-cache-control-generator-mixin';\n\nconst HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'HttpGraphQLNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n// First apply the normalized cache control mixin to HttpCommandGenerator\nconst HttpNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n HttpCommandGenerator,\n HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n\n// Then apply the GraphQL mixin to the normalized cache control generator\nexport const HttpGraphQLNormalizedCacheControlCommandGenerator =\n GraphQLNormalizedCacheControlGeneratorMixin(\n HttpNormalizedCacheControlCommandGenerator,\n HTTP_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n );\n","import { type ServiceVersion, toTypeScriptSafeIdentifier } from '@conduit-client/utils';\nimport { CommandConfigBuilder } from '../generators/command-config-builder';\nimport { getParameterMembers, getQueryParameterMembers } from '../utils';\nimport type { ImportableReference } from '../files';\nimport type {\n Operation,\n Parameter,\n Payload,\n Type,\n QueryParameter,\n TypeOfParameter,\n HttpMethod,\n Binding,\n ResolvedOperationServices,\n} from '@conduit-client/model/v1';\nimport type { InvalidateConfig } from '@conduit-client/utils';\n\nexport type ServiceDependency = {\n version: ServiceVersion;\n descriptor: ImportableReference;\n namedService: ImportableReference;\n localName: string;\n serviceName: string;\n tags?: Record<string, string>;\n optional?: boolean;\n};\n\nexport type CommandServiceDependencies = {\n baseClass: ServiceDependency;\n inherited: ServiceDependency[];\n extra: ServiceDependency[];\n overrides: ResolvedOperationServices;\n defaultOverrides: ResolvedOperationServices;\n};\n\nexport type OperationType = 'query' | 'mutation' | 'graphql';\nexport type ContentModel = {\n 'application/json'?: Type;\n};\n\nexport type CacheStrategy =\n | {\n type: 'none';\n }\n | {\n type: 'resource';\n config: {\n 'max-age': number;\n };\n }\n | {\n type: 'normalized';\n 'cache-control':\n | { type: 'no-cache' }\n | {\n type: 'max-age';\n 'max-age': number;\n };\n key?: Record<string, string>;\n };\n\nexport type ErrorStrategy =\n | {\n type: 'stringified';\n }\n | {\n type: 'fetchResponse';\n };\nexport type ConfigSchemaType = 'default' | 'flattened';\n\nexport type InvalidationConfig = {\n statusCode: string;\n invalidation: InvalidateConfig[];\n};\n\nexport type NetworkPreference = 'aura' | 'http';\n\nexport type ICommandModel = {\n readonly transportType: 'aura' | 'http';\n readonly className: string;\n readonly commandName: string;\n readonly filePath: string;\n readonly bindings: Binding[];\n readonly configType: Type;\n readonly responseType:\n | ({\n default: ContentModel;\n } & {\n [statusCode: number]: ContentModel;\n })\n | undefined;\n readonly uriParameters: {\n name: string;\n type: TypeOfParameter<Parameter>;\n required: boolean;\n explode?: boolean;\n }[];\n readonly queryParameters: {\n name: string;\n type: TypeOfParameter<QueryParameter>;\n required: boolean;\n explode?: boolean;\n }[];\n readonly headers: {\n name: string;\n type: TypeOfParameter<Parameter>;\n required: boolean;\n explode?: boolean;\n defaultValue?: TypeOfParameter<Parameter>;\n }[];\n readonly body?: {\n content: ContentModel;\n parameterName: string;\n };\n getAllParams(): {\n name: string;\n type: TypeOfParameter<Parameter<Type>>;\n required: boolean;\n explode?: boolean;\n defaultValue?: TypeOfParameter<Parameter<Type>>;\n }[];\n\n readonly serviceDependencies: CommandServiceDependencies;\n readonly configSchemaType: ConfigSchemaType;\n readonly exposeRefresh: boolean;\n readonly operationType: OperationType;\n\n aura?: { controller: string; method: string; bodyParam?: string };\n networkPreference?: NetworkPreference;\n errorStrategy: ErrorStrategy;\n cacheStrategy: CacheStrategy;\n method: HttpMethod;\n serverUrlPath: string;\n endpointUrlPath: string;\n invalidationConfigs: InvalidationConfig[];\n};\n\n/**\n * Base abstract class for command models that encapsulates the common functionality required by all command models.\n * It provides a structure for mapping API operations to the necessary command-specific metadata to be used for code generation.\n */\nexport abstract class BaseCommandModel implements ICommandModel {\n constructor(protected operation: Operation) {}\n\n abstract get serviceDependencies(): CommandServiceDependencies;\n getAllParams(): {\n name: string;\n type: TypeOfParameter<Parameter<Type>>;\n required: boolean;\n explode?: boolean;\n }[] {\n return [...this.queryParameters, ...this.uriParameters, ...this.headers];\n }\n\n get transportType() {\n return this.operation.endpoint.type;\n }\n\n /**\n * Defaulted in {@link ../../../../model/src/v1/amf/endpoints/amf-operation.ts#L54}\n * */\n get bindings(): Binding[] {\n return this.operation.bindings;\n }\n\n get body() {\n return this.buildBody();\n }\n\n get configType() {\n return new CommandConfigBuilder(this.operation, this.buildBody()).build();\n }\n\n get responseType() {\n return this.buildResponseType();\n }\n\n get uriParameters() {\n return getParameterMembers(\n this.operation.server.uriParameters,\n this.operation.endpoint.uriParameters,\n this.request?.uriParameters || {}\n );\n }\n\n get queryParameters() {\n return getQueryParameterMembers(this.request?.queryParameters || {});\n }\n\n get headers() {\n return getParameterMembers(this.request?.headers || {});\n }\n\n get commandName() {\n return toTypeScriptSafeIdentifier(\n this.operation.operationId || this.operation.bindings[0].identifier\n );\n }\n\n get className() {\n return `${this.commandName}Command`;\n }\n\n get filePath() {\n return `commands/${this.className}.ts`;\n }\n\n get configSchemaType() {\n return this.operation.configSchemaType;\n }\n\n get exposeRefresh() {\n return this.operation.exposeRefresh;\n }\n\n get operationType() {\n return this.operation.operationType;\n }\n\n get errorStrategy() {\n return this.operation.errorStrategy;\n }\n\n get cacheStrategy() {\n return this.operation.cacheStrategy;\n }\n\n get method() {\n return this.operation.method;\n }\n\n get serverUrlPath() {\n return this.operation.server.url;\n }\n\n get endpointUrlPath() {\n return this.operation.endpoint.path;\n }\n\n get request() {\n return this.operation.requests[0];\n }\n\n get invalidationConfigs(): InvalidationConfig[] {\n return this.operation.responses\n .filter((res) => {\n return res.invalidation !== undefined;\n })\n .map((invalidationResponse) => {\n return {\n statusCode: invalidationResponse.statusCode.toString(),\n invalidation: invalidationResponse.invalidation!,\n };\n });\n }\n\n protected buildBody(): { content: ContentModel; parameterName: string } | undefined {\n let payload = undefined;\n // We currently only look at the first request defined to define the config, something to expand on in the future...\n if (\n this.request !== undefined &&\n (this.request.payloads?.length || 0) > 0 &&\n 'configBodyParam' in this.operation\n ) {\n // We currently only support application/json requests\n let inputPayloadType = getPayloadForMediaType(this.request.payloads);\n if (!inputPayloadType) {\n throw new Error(\n `unsupported input payload type in ${this.operation.method} ${this.operation.endpoint.path} operation. Only application/json is supported`\n );\n }\n\n payload = {\n parameterName: this.operation.configBodyParam,\n content: { 'application/json': inputPayloadType },\n };\n }\n return payload;\n }\n\n protected buildResponseType() {\n const jsonType = getPayloadForMediaType(\n this.operation.responses[0]?.payloads,\n 'application/json'\n );\n return jsonType\n ? {\n default: { 'application/json': jsonType },\n }\n : undefined;\n }\n}\n\n/**\n * Gets the payload with the specified media type.\n *\n * @param payloads\n * @param mediaType\n * @returns\n */\nfunction getPayloadForMediaType(\n payloads: Array<Payload>,\n mediaType: string = 'application/json'\n): Type | undefined {\n let inputPayloadType = undefined;\n if (payloads?.length > 0) {\n const requestPayload = payloads.find((payload) => payload.mediaType === mediaType);\n inputPayloadType = requestPayload ? requestPayload.data : undefined;\n }\n return inputPayloadType;\n}\n","import { BaseCommandModel, type CommandServiceDependencies } from './base-command-model';\nimport type { ImportableReference } from '../files';\nimport type {\n AuraEndPoint,\n AuraOperation,\n AuraOperationWithRequestBody,\n} from '@conduit-client/model/v1';\n\nconst NAMED_AURA_NETWORK_SERVICE: ImportableReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkService',\n isType: true,\n};\n\nconst AURA_NETWORK_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-aura-network/v1',\n exportedSymbol: 'AuraNetworkServiceDescriptor',\n isType: true,\n};\n\nconst AURA_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-network/v1',\n exportedSymbol: 'AuraNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command/aura-network/v1',\n exportedSymbol: 'NamedAuraNetworkCommandService',\n isType: true,\n};\n\nconst NAMED_FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\nconst FETCH_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model for Aura-specific operations, extending the functionalities of the BaseCommandModel.\n * This class is used to model Aura specific code metadata from the API model.\n */\nexport class AuraCommandModel extends BaseCommandModel {\n getAllParams() {\n return [...this.queryParameters, ...this.uriParameters];\n }\n\n get networkPreference() {\n return (this.operation.endpoint as AuraEndPoint).networkPreference;\n }\n\n /**\n * Gets the Aura controller and method associated with the operation.\n * @returns {object} An object containing the `controller` and `method` names.\n */\n get aura() {\n const auraOperation = this.operation as AuraOperation;\n return {\n controller: (this.operation.endpoint as AuraEndPoint).auraController.name,\n method: auraOperation.aura.methodName,\n bodyParam: 'bodyParam' in auraOperation.aura ? auraOperation.aura.bodyParam : undefined,\n };\n }\n\n /**\n * Provides the service dependencies required by this AuraCommandModel.\n * Includes information about the base class and inherited services, as well as any extra dependencies.\n * @returns {object} An object detailing the service dependencies for the Aura command.\n */\n get serviceDependencies(): CommandServiceDependencies {\n return {\n baseClass: {\n version: '1.0' as const,\n descriptor: AURA_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_NETWORK_COMMAND_SERVICE,\n localName: 'auraNetworkCommandBaseClass',\n serviceName: 'auraNetworkCommandBaseClass',\n },\n inherited: [\n {\n version: '1.0' as const,\n descriptor: AURA_NETWORK_SERVICE_DESCRIPTOR,\n namedService: NAMED_AURA_NETWORK_SERVICE,\n localName: 'auraNetwork',\n serviceName: 'auraNetwork',\n optional: true,\n },\n {\n version: '1.0' as const,\n descriptor: FETCH_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_SERVICE,\n localName: 'fetch',\n serviceName: 'fetch',\n optional: true,\n },\n ],\n extra: [],\n overrides: this.operation.serviceOverrides || {},\n defaultOverrides: this.operation.defaults?.services || {},\n };\n }\n}\n","import { BaseCommandModel, type ServiceDependency } from './base-command-model';\nimport type { ImportableReference } from '../files';\n\nexport const INPUT_PAYLOAD_MEMBER_NAME = 'inputPayload';\n\nconst NAMED_FETCH_SERVICE: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'NamedFetchService',\n isType: true,\n};\n\nconst FETCH_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-fetch-network/v1',\n exportedSymbol: 'FetchServiceDescriptor',\n isType: true,\n};\nconst FETCH_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'FetchNetworkCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_FETCH_NETWORK_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-fetch-network/v1',\n exportedSymbol: 'NamedFetchNetworkCommandService',\n isType: true,\n};\n\n/**\n * Represents an HTTP command model that extends BaseCommandModel to handle HTTP-specific commands.\n * This model specifically manages the input payload and service dependencies for HTTP operations.\n */\nexport class HttpCommandModel extends BaseCommandModel {\n getInputPayloadParameterName(): string {\n return INPUT_PAYLOAD_MEMBER_NAME;\n }\n\n getAllParams() {\n return [...this.queryParameters, ...this.uriParameters, ...this.headers];\n }\n\n /**\n * Defines and retrieves the service dependencies for the HTTP command model,\n * including any adjustments based on the server URL indicating specific service requirements.\n * @returns {CommandServiceDependencies} An object detailing the service dependencies.\n */\n get serviceDependencies() {\n const baseClass: ServiceDependency = {\n version: '1.0' as const,\n descriptor: FETCH_NETWORK_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_FETCH_NETWORK_COMMAND_SERVICE,\n localName: 'fetchNetworkCommandBaseClass',\n serviceName: 'fetchNetworkCommandBaseClass',\n };\n const SFAP_BASE_URL = 'api.salesforce.com';\n const isSfapServer = [this.operation.server].some((server) => {\n try {\n const url = new URL(server.url);\n return url.host.includes(SFAP_BASE_URL);\n } catch (_e) {\n return server.url.startsWith(SFAP_BASE_URL);\n }\n });\n\n const fetchServiceDependency: ServiceDependency = {\n version: '1.0' as const,\n descriptor: FETCH_SERVICE_DESCRIPTOR,\n namedService: NAMED_FETCH_SERVICE,\n localName: 'fetch',\n serviceName: 'fetch',\n };\n\n if (isSfapServer) {\n fetchServiceDependency.tags = { authenticationScopes: 'sfap_api' };\n }\n\n return {\n baseClass,\n inherited: [fetchServiceDependency],\n extra: [],\n overrides: this.operation.serviceOverrides || {},\n defaultOverrides: this.operation.defaults?.services || {},\n };\n }\n}\n","import { AuraCommandModel } from './aura-command-model';\nimport type { ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'AuraNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'NamedAuraNormalizedCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling normalized caching in Aura applications.\n * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class AuraNormalizedCachingCommandModel extends AuraCommandModel {\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraNormalizedCacheControlCommand',\n serviceName: 'auraNormalizedCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","import { AuraCommandModel } from './aura-command-model';\nimport type { ImportableReference } from '../files';\n\nconst AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'AuraResourceCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-resource-cache-control/v1',\n exportedSymbol: 'NamedAuraResourceCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling resource caching in Aura applications.\n * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class AuraResourceCachingCommandModel extends AuraCommandModel {\n /**\n * Overrides the serviceDependencies getter to customize dependencies for caching.\n * Adds specific dependencies related to cache control, while preserving the base dependencies from `AuraCommandModel`.\n * @returns {CommandServiceDependencies} An object detailing the service dependencies for caching.\n */\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraResourceCacheControlCommand',\n serviceName: 'auraResourceCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","import { type ImportableReference } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\n\nconst AURA_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-normalized-cache-control/v1',\n exportedSymbol: 'AuraNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nexport const AuraNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n AuraCommandGenerator,\n AURA_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n","import { type ImportableReference } from '../files';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\n\nconst HTTP_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'HttpNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\nexport const HttpNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n HttpCommandGenerator,\n HTTP_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n","import { HttpCommandModel } from './http-command-model';\nimport type { ImportableReference } from '../files';\n\nconst HTTP_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'HttpNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_HTTP_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-http-normalized-cache-control/v1',\n exportedSymbol: 'NamedHttpNormalizedCacheControlCommand',\n isType: true,\n};\n\nconst NAMED_CACHE_CONTROL_SERVICE: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'NamedCacheControllerService',\n isType: true,\n};\n\nconst CACHE_CONTROL_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-cache-control/v1',\n exportedSymbol: 'CacheControllerServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_PUBSUB_SERVICE: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'NamedPubSubService',\n isType: true,\n};\n\nconst PUBSUB_SERVICE_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/service-pubsub/v1',\n exportedSymbol: 'PubSubServiceDescriptor',\n isType: true,\n};\n\n/**\n * Represents a command model specifically designed for handling normalized caching for HTTP transport adapters.\n * This model extends `HttpCommandModel` and overrides the service dependencies to include cache control services.\n */\nexport class HttpNormalizedCachingCommandModel extends HttpCommandModel {\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: HTTP_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_HTTP_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'httpNormalizedCacheControlCommand',\n serviceName: 'httpNormalizedCacheControlCommand',\n };\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: CACHE_CONTROL_SERVICE_DESCRIPTOR,\n namedService: NAMED_CACHE_CONTROL_SERVICE,\n localName: 'cacheController',\n serviceName: 'cacheController',\n });\n\n deps.inherited.push({\n version: '1.0' as const,\n descriptor: PUBSUB_SERVICE_DESCRIPTOR,\n namedService: NAMED_PUBSUB_SERVICE,\n localName: 'pubSub',\n serviceName: 'pubSub',\n optional: true,\n });\n\n return deps;\n }\n}\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\n","/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\n /**\n * An array of { line, column } locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _nodeLocations, _nodeLocations2, _nodeLocations3;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message);\n _this.name = 'GraphQLError';\n _this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.\n\n _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);\n var nodeLocations = [];\n\n for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {\n var _this$nodes;\n\n var _ref4 = _ref3[_i2];\n var loc = _ref4.loc;\n\n if (loc != null) {\n nodeLocations.push(loc);\n }\n }\n\n nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.\n\n _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;\n _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {\n return loc.start;\n });\n _this.locations = positions && source ? positions.map(function (pos) {\n return getLocation(source, pos);\n }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {\n return getLocation(loc.source, loc.start);\n });\n _this.path = path !== null && path !== void 0 ? path : undefined;\n var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;\n\n if (extensions == null && isObjectLike(originalExtensions)) {\n _this.extensions = _objectSpread({}, originalExtensions);\n } else {\n _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};\n } // By being enumerable, JSON.stringify will include bellow properties in the resulting output.\n // This ensures that the simplest possible GraphQL service adheres to the spec.\n\n\n Object.defineProperties(_assertThisInitialized(_this), {\n message: {\n enumerable: true\n },\n locations: {\n enumerable: _this.locations != null\n },\n path: {\n enumerable: _this.path != null\n },\n extensions: {\n enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0\n },\n name: {\n enumerable: false\n },\n nodes: {\n enumerable: false\n },\n source: {\n enumerable: false\n },\n positions: {\n enumerable: false\n },\n originalError: {\n enumerable: false\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return formatError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {\n var node = _error$nodes2[_i4];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {\n var location = _error$locations2[_i6];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\n\nexport function formatError(error) {\n var _error$message;\n\n error || devAssert(0, 'Received null or undefined error.');\n var message = (_error$message = error.message) !== null && _error$message !== void 0 ? _error$message : 'An unknown error occurred.';\n var locations = error.locations;\n var path = error.path;\n var extensions = error.extensions;\n return extensions && Object.keys(extensions).length > 0 ? {\n message: message,\n locations: locations,\n path: path,\n extensions: extensions\n } : {\n message: message,\n locations: locations,\n path: path\n };\n}\n/**\n * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors\n */\n","import { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport var Location = /*#__PURE__*/function () {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n function Location(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. <SOF> is always the first node and <EOF>\n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '<SOF>',\n EOF: '<EOF>',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\n });\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport inspect from \"./inspect.mjs\";\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (_typeof(value) === 'object' && value !== null) {\n var _value$constructor;\n\n var className = constructor.prototype[Symbol.toStringTag];\n var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;\n\n if (className === valueClassName) {\n var stringifiedValue = inspect(value);\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(stringifiedValue, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // <space>\n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport var Lexer = /*#__PURE__*/function () {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n ;\n\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.mjs\";\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n ;\n\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\n /**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n }\n\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n ;\n\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n ;\n\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n ;\n\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n ;\n\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n ;\n\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n ;\n\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { isNode } from \"./ast.mjs\";\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n clone[k] = node[k];\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error(\"Invalid AST Node: \".concat(inspect(node), \".\"));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _visitorKeys$node$kin;\n\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar find = Array.prototype.find ? function (list, predicate) {\n return Array.prototype.find.call(list, predicate);\n} : function (list, predicate) {\n for (var _i2 = 0; _i2 < list.length; _i2++) {\n var value = list[_i2];\n\n if (predicate(value)) {\n return value;\n }\n }\n};\nexport default find;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectValues = Object.values || function (obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n};\n\nexport default objectValues;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectEntries = Object.entries || function (obj) {\n return Object.keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n};\n\nexport default objectEntries;\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' } }\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // { name: 'Jenny', num: '857-6309' }\n * const jennyEntry = entriesByName['Jenny']\n *\n */\nexport default function keyMap(list, keyFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = item;\n return map;\n }, Object.create(null));\n}\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\n\n/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n */\nexport default function mapValue(map, fn) {\n var result = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(map); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var _key = _ref2[0];\n var _value = _ref2[1];\n result[_key] = fn(_value, _key);\n }\n\n return result;\n}\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\nexport default function toObjMap(obj) {\n /* eslint-enable no-redeclare */\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n var map = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(obj); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var key = _ref2[0];\n var value = _ref2[1];\n map[key] = value;\n }\n\n return map;\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n *\n */\nexport default function keyValMap(list, keyFn, valFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = valFn(item);\n return map;\n }, Object.create(null));\n}\n","var MAX_SUGGESTIONS = 5;\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\n\n// eslint-disable-next-line no-redeclare\nexport default function didYouMean(firstArg, secondArg) {\n var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg],\n subMessage = _ref[0],\n suggestionsArg = _ref[1];\n\n var message = ' Did you mean ';\n\n if (subMessage) {\n message += subMessage + ' ';\n }\n\n var suggestions = suggestionsArg.map(function (x) {\n return \"\\\"\".concat(x, \"\\\"\");\n });\n\n switch (suggestions.length) {\n case 0:\n return '';\n\n case 1:\n return message + suggestions[0] + '?';\n\n case 2:\n return message + suggestions[0] + ' or ' + suggestions[1] + '?';\n }\n\n var selected = suggestions.slice(0, MAX_SUGGESTIONS);\n var lastItem = selected.pop();\n return message + selected.join(', ') + ', or ' + lastItem + '?';\n}\n","/**\n * Returns the first argument it receives.\n */\nexport default function identityFunc(x) {\n return x;\n}\n","/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n */\nexport default function naturalCompare(aStr, bStr) {\n var aIdx = 0;\n var bIdx = 0;\n\n while (aIdx < aStr.length && bIdx < bStr.length) {\n var aChar = aStr.charCodeAt(aIdx);\n var bChar = bStr.charCodeAt(bIdx);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n var aNum = 0;\n\n do {\n ++aIdx;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIdx);\n } while (isDigit(aChar) && aNum > 0);\n\n var bNum = 0;\n\n do {\n ++bIdx;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIdx);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIdx;\n ++bIdx;\n }\n }\n\n return aStr.length - bStr.length;\n}\nvar DIGIT_0 = 48;\nvar DIGIT_9 = 57;\n\nfunction isDigit(code) {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n","import naturalCompare from \"./naturalCompare.mjs\";\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\n\nexport default function suggestionList(input, options) {\n var optionsByDistance = Object.create(null);\n var lexicalDistance = new LexicalDistance(input);\n var threshold = Math.floor(input.length * 0.4) + 1;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n var option = options[_i2];\n var distance = lexicalDistance.measure(option, threshold);\n\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort(function (a, b) {\n var distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n */\n\nvar LexicalDistance = /*#__PURE__*/function () {\n function LexicalDistance(input) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)];\n }\n\n var _proto = LexicalDistance.prototype;\n\n _proto.measure = function measure(option, threshold) {\n if (this._input === option) {\n return 0;\n }\n\n var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit\n\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n var a = stringToArray(optionLowerCase);\n var b = this._inputArray;\n\n if (a.length < b.length) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\n var aLength = a.length;\n var bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n var rows = this._rows;\n\n for (var j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (var i = 1; i <= aLength; i++) {\n var upRow = rows[(i - 1) % 3];\n var currentRow = rows[i % 3];\n var smallestCell = currentRow[0] = i;\n\n for (var _j = 1; _j <= bLength; _j++) {\n var cost = a[i - 1] === b[_j - 1] ? 0 : 1;\n var currentCell = Math.min(upRow[_j] + 1, // delete\n currentRow[_j - 1] + 1, // insert\n upRow[_j - 1] + cost // substitute\n );\n\n if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) {\n // transposition\n var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[_j] = currentCell;\n } // Early exit, since distance can't go smaller than smallest element of the previous row.\n\n\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n var distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n };\n\n return LexicalDistance;\n}();\n\nfunction stringToArray(str) {\n var strLength = str.length;\n var array = new Array(strLength);\n\n for (var i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n\n return array;\n}\n","import { visit } from \"./visitor.mjs\";\nimport { printBlockString } from \"./blockString.mjs\";\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n var prefix = wrap('', alias, ': ') + name;\n var argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: addDescription(function (_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n }),\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n interfaces = _ref26.interfaces,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n repeatable = _ref31.repeatable,\n locations = _ref31.locations;\n return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n interfaces = _ref35.interfaces,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\n\nfunction wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction isMultiline(str) {\n return str.indexOf('\\n') !== -1;\n}\n\nfunction hasMultilineItems(maybeArray) {\n return maybeArray != null && maybeArray.some(isMultiline);\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case Kind.OBJECT:\n return keyValMap(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || invariant(0, 'Unexpected value node: ' + inspect(valueNode));\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport mapValue from \"../jsutils/mapValue.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport didYouMean from \"../jsutils/didYouMean.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport identityFunc from \"../jsutils/identityFunc.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport suggestionList from \"../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { valueFromASTUntyped } from \"../utilities/valueFromASTUntyped.mjs\";\nexport function isType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type);\n}\nexport function assertType(type) {\n if (!isType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL type.\"));\n }\n\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n if (!isScalarType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Scalar type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n if (!isObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n if (!isInterfaceType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Interface type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n if (!isUnionType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Union type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n if (!isEnumType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Enum type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n if (!isInputObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Input Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n if (!isListType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL List type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n if (!isNonNullType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Non-Null type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType);\n}\nexport function assertInputType(type) {\n if (!isInputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL input type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}\nexport function assertOutputType(type) {\n if (!isOutputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL output type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n if (!isLeafType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL leaf type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n if (!isCompositeType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL composite type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n if (!isAbstractType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL abstract type.\"));\n }\n\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * })\n * })\n *\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLList<+T: GraphQLType> {\n +ofType: T;\n static <T>(ofType: T): GraphQLList<T>;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLList(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLList) {\n this.ofType = assertType(ofType);\n } else {\n return new GraphQLList(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLList.prototype.toString = function toString() {\n return '[' + String(this.ofType) + ']';\n};\n\nGraphQLList.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLList.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLList';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLList);\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * })\n * })\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLNonNull<+T: GraphQLNullableType> {\n +ofType: T;\n static <T>(ofType: T): GraphQLNonNull<T>;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLNonNull(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLNonNull) {\n this.ofType = assertNullableType(ofType);\n } else {\n return new GraphQLNonNull(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLNonNull.prototype.toString = function toString() {\n return String(this.ofType) + '!';\n};\n\nGraphQLNonNull.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLNonNull.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLNonNull';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLNonNull);\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n if (!isWrappingType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL wrapping type.\"));\n }\n\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n if (!isNullableType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL nullable type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNullableType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}\nexport function assertNamedType(type) {\n if (!isNamedType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL named type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNamedType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n var unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nfunction resolveThunk(thunk) {\n // $FlowFixMe[incompatible-use]\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\nfunction undefineIfEmpty(arr) {\n return arr && arr.length > 0 ? arr : undefined;\n}\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function does not return a value (i.e. it returns\n * `undefined`) then an error will be raised and a `null` value will be returned\n * in the response. If the serialize function returns `null`, then no error will\n * be included in the response.\n *\n * Example:\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (value % 2 === 1) {\n * return value;\n * }\n * }\n * });\n *\n */\n\n\nexport var GraphQLScalarType = /*#__PURE__*/function () {\n function GraphQLScalarType(config) {\n var _config$parseValue, _config$serialize, _config$parseLiteral;\n\n var parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc;\n this.name = config.name;\n this.description = config.description;\n this.specifiedByUrl = config.specifiedByUrl;\n this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc;\n this.parseValue = parseValue;\n this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function (node, variables) {\n return parseValue(valueFromASTUntyped(node, variables));\n };\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.specifiedByUrl == null || typeof config.specifiedByUrl === 'string' || devAssert(0, \"\".concat(this.name, \" must provide \\\"specifiedByUrl\\\" as a string, \") + \"but got: \".concat(inspect(config.specifiedByUrl), \".\"));\n config.serialize == null || typeof config.serialize === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"serialize\\\" function. If this custom Scalar is also used as an input type, ensure \\\"parseValue\\\" and \\\"parseLiteral\\\" functions are also provided.\"));\n\n if (config.parseLiteral) {\n typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || devAssert(0, \"\".concat(this.name, \" must provide both \\\"parseValue\\\" and \\\"parseLiteral\\\" functions.\"));\n }\n }\n\n var _proto = GraphQLScalarType.prototype;\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n name: this.name,\n description: this.description,\n specifiedByUrl: this.specifiedByUrl,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : []\n };\n };\n\n _proto.toString = function toString() {\n return this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLScalarType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLScalarType';\n }\n }]);\n\n return GraphQLScalarType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLScalarType);\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n *\n */\nexport var GraphQLObjectType = /*#__PURE__*/function () {\n function GraphQLObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.isTypeOf == null || typeof config.isTypeOf === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"isTypeOf\\\" as a function, \") + \"but got: \".concat(inspect(config.isTypeOf), \".\"));\n }\n\n var _proto2 = GraphQLObjectType.prototype;\n\n _proto2.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto2.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto2.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes || []\n };\n };\n\n _proto2.toString = function toString() {\n return this.name;\n };\n\n _proto2.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLObjectType';\n }\n }]);\n\n return GraphQLObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLObjectType);\n\nfunction defineInterfaces(config) {\n var _resolveThunk;\n\n var interfaces = (_resolveThunk = resolveThunk(config.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];\n Array.isArray(interfaces) || devAssert(0, \"\".concat(config.name, \" interfaces must be an Array or a function which returns an Array.\"));\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n var _fieldConfig$args;\n\n isPlainObj(fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field config must be an object.\"));\n !('isDeprecated' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field resolver must be a function if \") + \"provided, but got: \".concat(inspect(fieldConfig.resolve), \".\"));\n var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};\n isPlainObj(argsConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" args must be an object with argument names as keys.\"));\n var args = objectEntries(argsConfig).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n args: args,\n resolve: fieldConfig.resolve,\n subscribe: fieldConfig.subscribe,\n isDeprecated: fieldConfig.deprecationReason != null,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nfunction isPlainObj(obj) {\n return isObjectLike(obj) && !Array.isArray(obj);\n}\n\nfunction fieldsToFieldsConfig(fields) {\n return mapValue(fields, function (field) {\n return {\n description: field.description,\n type: field.type,\n args: argsToArgsConfig(field.args),\n resolve: field.resolve,\n subscribe: field.subscribe,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n}\n/**\n * @internal\n */\n\n\nexport function argsToArgsConfig(args) {\n return keyValMap(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode\n };\n });\n}\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n *\n */\nexport var GraphQLInterfaceType = /*#__PURE__*/function () {\n function GraphQLInterfaceType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto3 = GraphQLInterfaceType.prototype;\n\n _proto3.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto3.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto3.toConfig = function toConfig() {\n var _this$extensionASTNod2;\n\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod2 = this.extensionASTNodes) !== null && _this$extensionASTNod2 !== void 0 ? _this$extensionASTNod2 : []\n };\n };\n\n _proto3.toString = function toString() {\n return this.name;\n };\n\n _proto3.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInterfaceType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInterfaceType';\n }\n }]);\n\n return GraphQLInterfaceType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInterfaceType);\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n *\n */\nexport var GraphQLUnionType = /*#__PURE__*/function () {\n function GraphQLUnionType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._types = defineTypes.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto4 = GraphQLUnionType.prototype;\n\n _proto4.getTypes = function getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n };\n\n _proto4.toConfig = function toConfig() {\n var _this$extensionASTNod3;\n\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod3 = this.extensionASTNodes) !== null && _this$extensionASTNod3 !== void 0 ? _this$extensionASTNod3 : []\n };\n };\n\n _proto4.toString = function toString() {\n return this.name;\n };\n\n _proto4.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLUnionType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLUnionType';\n }\n }]);\n\n return GraphQLUnionType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLUnionType);\n\nfunction defineTypes(config) {\n var types = resolveThunk(config.types);\n Array.isArray(types) || devAssert(0, \"Must provide Array of types or a function which returns such an array for Union \".concat(config.name, \".\"));\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport var GraphQLEnumType\n/* <T> */\n= /*#__PURE__*/function () {\n function GraphQLEnumType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._values = defineEnumValues(this.name, config.values);\n this._valueLookup = new Map(this._values.map(function (enumValue) {\n return [enumValue.value, enumValue];\n }));\n this._nameLookup = keyMap(this._values, function (value) {\n return value.name;\n });\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto5 = GraphQLEnumType.prototype;\n\n _proto5.getValues = function getValues() {\n return this._values;\n };\n\n _proto5.getValue = function getValue(name) {\n return this._nameLookup[name];\n };\n\n _proto5.serialize = function serialize(outputValue) {\n var enumValue = this._valueLookup.get(outputValue);\n\n if (enumValue === undefined) {\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent value: \").concat(inspect(outputValue)));\n }\n\n return enumValue.name;\n };\n\n _proto5.parseValue = function parseValue(inputValue)\n /* T */\n {\n if (typeof inputValue !== 'string') {\n var valueStr = inspect(inputValue);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-string value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr));\n }\n\n var enumValue = this.getValue(inputValue);\n\n if (enumValue == null) {\n throw new GraphQLError(\"Value \\\"\".concat(inputValue, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, inputValue));\n }\n\n return enumValue.value;\n };\n\n _proto5.parseLiteral = function parseLiteral(valueNode, _variables)\n /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind !== Kind.ENUM) {\n var valueStr = print(valueNode);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-enum value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr), valueNode);\n }\n\n var enumValue = this.getValue(valueNode.value);\n\n if (enumValue == null) {\n var _valueStr = print(valueNode);\n\n throw new GraphQLError(\"Value \\\"\".concat(_valueStr, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, _valueStr), valueNode);\n }\n\n return enumValue.value;\n };\n\n _proto5.toConfig = function toConfig() {\n var _this$extensionASTNod4;\n\n var values = keyValMap(this.getValues(), function (value) {\n return value.name;\n }, function (value) {\n return {\n description: value.description,\n value: value.value,\n deprecationReason: value.deprecationReason,\n extensions: value.extensions,\n astNode: value.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n values: values,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod4 = this.extensionASTNodes) !== null && _this$extensionASTNod4 !== void 0 ? _this$extensionASTNod4 : []\n };\n };\n\n _proto5.toString = function toString() {\n return this.name;\n };\n\n _proto5.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLEnumType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLEnumType';\n }\n }]);\n\n return GraphQLEnumType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLEnumType);\n\nfunction didYouMeanEnumValue(enumType, unknownValueStr) {\n var allNames = enumType.getValues().map(function (value) {\n return value.name;\n });\n var suggestedValues = suggestionList(unknownValueStr, allNames);\n return didYouMean('the enum value', suggestedValues);\n}\n\nfunction defineEnumValues(typeName, valueMap) {\n isPlainObj(valueMap) || devAssert(0, \"\".concat(typeName, \" values must be an object with value names as keys.\"));\n return objectEntries(valueMap).map(function (_ref2) {\n var valueName = _ref2[0],\n valueConfig = _ref2[1];\n isPlainObj(valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" must refer to an object with a \\\"value\\\" key \") + \"representing an internal value but got: \".concat(inspect(valueConfig), \".\"));\n !('isDeprecated' in valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n return {\n name: valueName,\n description: valueConfig.description,\n value: valueConfig.value !== undefined ? valueConfig.value : valueName,\n isDeprecated: valueConfig.deprecationReason != null,\n deprecationReason: valueConfig.deprecationReason,\n extensions: valueConfig.extensions && toObjMap(valueConfig.extensions),\n astNode: valueConfig.astNode\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n *\n */\nexport var GraphQLInputObjectType = /*#__PURE__*/function () {\n function GraphQLInputObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineInputFieldMap.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto6 = GraphQLInputObjectType.prototype;\n\n _proto6.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto6.toConfig = function toConfig() {\n var _this$extensionASTNod5;\n\n var fields = mapValue(this.getFields(), function (field) {\n return {\n description: field.description,\n type: field.type,\n defaultValue: field.defaultValue,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n fields: fields,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod5 = this.extensionASTNodes) !== null && _this$extensionASTNod5 !== void 0 ? _this$extensionASTNod5 : []\n };\n };\n\n _proto6.toString = function toString() {\n return this.name;\n };\n\n _proto6.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInputObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInputObjectType';\n }\n }]);\n\n return GraphQLInputObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInputObjectType);\n\nfunction defineInputFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n !('resolve' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field has a resolve property, but Input Types cannot define resolvers.\"));\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n defaultValue: fieldConfig.defaultValue,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}\n","import { SYMBOL_ITERATOR } from \"./symbols.mjs\";\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar arrayFrom = Array.from || function (obj, mapFn, thisArg) {\n if (obj == null) {\n throw new TypeError('Array.from requires an array-like object - not null or undefined');\n } // Is Iterable?\n\n\n var iteratorMethod = obj[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n var iterator = iteratorMethod.call(obj);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever.\n // After a very large number of iterations, produce an error.\n // istanbul ignore if (Too big to actually test)\n\n if (i > 9999999) {\n throw new TypeError('Near-infinite iteration.');\n }\n }\n\n return result;\n } // Is Array like?\n\n\n var length = obj.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (Object.prototype.hasOwnProperty.call(obj, _i)) {\n _result.push(mapFn.call(thisArg, obj[_i], _i));\n }\n }\n\n return _result;\n }\n\n return [];\n};\n\nexport default arrayFrom;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isFinitePolyfill = Number.isFinite || function (value) {\n return typeof value === 'number' && isFinite(value);\n};\n\nexport default isFinitePolyfill;\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { SYMBOL_ITERATOR } from \"../polyfills/symbols.mjs\";\n/**\n * Safer version of `Array.from` that return `null` if value isn't convertible to array.\n * Also protects against Array-like objects without items.\n *\n * @example\n *\n * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3]\n * safeArrayFrom('ABC') // null\n * safeArrayFrom({ length: 1 }) // null\n * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha']\n * safeArrayFrom({ key: 'value' }) // null\n * safeArrayFrom(new Map()) // []\n *\n */\n\nexport default function safeArrayFrom(collection) {\n var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {\n return item;\n };\n\n if (collection == null || _typeof(collection) !== 'object') {\n return null;\n }\n\n if (Array.isArray(collection)) {\n return collection.map(mapFn);\n } // Is Iterable?\n\n\n var iteratorMethod = collection[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n // $FlowFixMe[incompatible-use]\n var iterator = iteratorMethod.call(collection);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn(step.value, i));\n }\n\n return result;\n } // Is Array like?\n\n\n var length = collection.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (!Object.prototype.hasOwnProperty.call(collection, _i)) {\n return null;\n }\n\n _result.push(mapFn(collection[String(_i)], _i));\n }\n\n return _result;\n }\n\n return null;\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isInteger = Number.isInteger || function (value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n};\n\nexport default isInteger;\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport isInteger from \"../polyfills/isInteger.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { GraphQLScalarType } from \"./definition.mjs\"; // As per the GraphQL Spec, Integers are only treated as valid when a valid\n// 32-bit signed integer, providing the broadest support across platforms.\n//\n// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because\n// they are internally represented as IEEE 754 doubles.\n\nvar MAX_INT = 2147483647;\nvar MIN_INT = -2147483648;\n\nfunction serializeInt(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isInteger(num)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(coercedValue)));\n }\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError('Int cannot represent non 32-bit signed integer value: ' + inspect(coercedValue));\n }\n\n return num;\n}\n\nfunction coerceInt(inputValue) {\n if (!isInteger(inputValue)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(inputValue)));\n }\n\n if (inputValue > MAX_INT || inputValue < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(inputValue));\n }\n\n return inputValue;\n}\n\nexport var GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n serialize: serializeInt,\n parseValue: coerceInt,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(print(valueNode)), valueNode);\n }\n\n var num = parseInt(valueNode.value, 10);\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(valueNode.value), valueNode);\n }\n\n return num;\n }\n});\n\nfunction serializeFloat(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isFinite(num)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(coercedValue)));\n }\n\n return num;\n}\n\nfunction coerceFloat(inputValue) {\n if (!isFinite(inputValue)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n serialize: serializeFloat,\n parseValue: coerceFloat,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(print(valueNode)), valueNode);\n }\n\n return parseFloat(valueNode.value);\n }\n}); // Support serializing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\n\nfunction serializeObject(outputValue) {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n var valueOfResult = outputValue.valueOf();\n\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n\n if (typeof outputValue.toJSON === 'function') {\n // $FlowFixMe[incompatible-use]\n return outputValue.toJSON();\n }\n }\n\n return outputValue;\n}\n\nfunction serializeString(outputValue) {\n var coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue.toString();\n }\n\n throw new GraphQLError(\"String cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceString(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLString = new GraphQLScalarType({\n name: 'String',\n description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n serialize: serializeString,\n parseValue: coerceString,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeBoolean(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue !== 0;\n }\n\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(coercedValue)));\n}\n\nfunction coerceBoolean(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n serialize: serializeBoolean,\n parseValue: coerceBoolean,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeID(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (isInteger(coercedValue)) {\n return String(coercedValue);\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceID(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n\n if (isInteger(inputValue)) {\n return inputValue.toString();\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(inputValue)));\n}\n\nexport var GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n serialize: serializeID,\n parseValue: coerceID,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError('ID cannot represent a non-string and non-integer value: ' + print(valueNode), valueNode);\n }\n\n return valueNode.value;\n }\n});\nexport var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]);\nexport function isSpecifiedScalarType(type) {\n return specifiedScalarTypes.some(function (_ref) {\n var name = _ref.name;\n return type.name === name;\n });\n}\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport safeArrayFrom from \"../jsutils/safeArrayFrom.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { GraphQLID } from \"../type/scalars.mjs\";\nimport { isLeafType, isEnumType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType. For example:\n *\n * astFromValue(\"value\", GraphQLString)\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (isListType(type)) {\n var itemType = type.ofType;\n var items = safeArrayFrom(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && isFinite(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: Kind.INT,\n value: stringNum\n } : {\n kind: Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(inspect(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nvar integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { astFromValue } from \"../utilities/astFromValue.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLEnumType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType } from \"./definition.mjs\";\nexport var __Schema = new GraphQLObjectType({\n name: '__Schema',\n description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: function fields() {\n return {\n description: {\n type: GraphQLString,\n resolve: function resolve(schema) {\n return schema.description;\n }\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n resolve: function resolve(schema) {\n return objectValues(schema.getTypeMap());\n }\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(schema) {\n return schema.getQueryType();\n }\n },\n mutationType: {\n description: 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getMutationType();\n }\n },\n subscriptionType: {\n description: 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getSubscriptionType();\n }\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),\n resolve: function resolve(schema) {\n return schema.getDirectives();\n }\n }\n };\n }\n});\nexport var __Directive = new GraphQLObjectType({\n name: '__Directive',\n description: \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(directive) {\n return directive.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(directive) {\n return directive.description;\n }\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(directive) {\n return directive.isRepeatable;\n }\n },\n locations: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),\n resolve: function resolve(directive) {\n return directive.locations;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(field, _ref) {\n var includeDeprecated = _ref.includeDeprecated;\n return includeDeprecated ? field.args : field.args.filter(function (arg) {\n return arg.deprecationReason == null;\n });\n }\n }\n };\n }\n});\nexport var __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.'\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.'\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.'\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.'\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.'\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.'\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.'\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.'\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.'\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.'\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.'\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.'\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.'\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.'\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.'\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.'\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.'\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.'\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.'\n }\n }\n});\nexport var __Type = new GraphQLObjectType({\n name: '__Type',\n description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: function fields() {\n return {\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n resolve: function resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n\n if (isListType(type)) {\n return TypeKind.LIST;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, \"Unexpected type: \\\"\".concat(inspect(type), \"\\\".\"));\n }\n },\n name: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.name !== undefined ? type.name : undefined;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.description !== undefined ? type.description : undefined;\n }\n },\n specifiedByUrl: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined;\n }\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref2) {\n var includeDeprecated = _ref2.includeDeprecated;\n\n if (isObjectType(type) || isInterfaceType(type)) {\n var fields = objectValues(type.getFields());\n return includeDeprecated ? fields : fields.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n }\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type, _args, _context, _ref3) {\n var schema = _ref3.schema;\n\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n }\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref4) {\n var includeDeprecated = _ref4.includeDeprecated;\n\n if (isEnumType(type)) {\n var values = type.getValues();\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref5) {\n var includeDeprecated = _ref5.includeDeprecated;\n\n if (isInputObjectType(type)) {\n var values = objectValues(type.getFields());\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n ofType: {\n type: __Type,\n resolve: function resolve(type) {\n return type.ofType !== undefined ? type.ofType : undefined;\n }\n }\n };\n }\n});\nexport var __Field = new GraphQLObjectType({\n name: '__Field',\n description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(field) {\n return field.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.description;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(field, _ref6) {\n var includeDeprecated = _ref6.includeDeprecated;\n return includeDeprecated ? field.args : field.args.filter(function (arg) {\n return arg.deprecationReason == null;\n });\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(field) {\n return field.type;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.deprecationReason;\n }\n }\n };\n }\n});\nexport var __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(inputValue) {\n return inputValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(inputValue) {\n return inputValue.description;\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(inputValue) {\n return inputValue.type;\n }\n },\n defaultValue: {\n type: GraphQLString,\n description: 'A GraphQL-formatted string representing the default value for this input value.',\n resolve: function resolve(inputValue) {\n var type = inputValue.type,\n defaultValue = inputValue.defaultValue;\n var valueAST = astFromValue(defaultValue, type);\n return valueAST ? print(valueAST) : null;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.deprecationReason;\n }\n }\n };\n }\n});\nexport var __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(enumValue) {\n return enumValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.description;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason;\n }\n }\n };\n }\n});\nexport var TypeKind = Object.freeze({\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n INPUT_OBJECT: 'INPUT_OBJECT',\n LIST: 'LIST',\n NON_NULL: 'NON_NULL'\n});\nexport var __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.'\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.'\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.'\n },\n UNION: {\n value: TypeKind.UNION,\n description: 'Indicates this type is a union. `possibleTypes` is a valid field.'\n },\n ENUM: {\n value: TypeKind.ENUM,\n description: 'Indicates this type is an enum. `enumValues` is a valid field.'\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description: 'Indicates this type is an input object. `inputFields` is a valid field.'\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.'\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description: 'Indicates this type is a non-null. `ofType` is a valid field.'\n }\n }\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport var SchemaMetaFieldDef = {\n name: '__schema',\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref7) {\n var schema = _ref7.schema;\n return schema;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [{\n name: 'name',\n description: undefined,\n type: new GraphQLNonNull(GraphQLString),\n defaultValue: undefined,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n }],\n resolve: function resolve(_source, _ref8, _context, _ref9) {\n var name = _ref8.name;\n var schema = _ref9.schema;\n return schema.getType(name);\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeNameMetaFieldDef = {\n name: '__typename',\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref10) {\n var parentType = _ref10.parentType;\n return parentType.name;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);\nexport function isIntrospectionType(type) {\n return introspectionTypes.some(function (_ref11) {\n var name = _ref11.name;\n return type.name === name;\n });\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { argsToArgsConfig, GraphQLNonNull } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL directive.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\nexport function assertDirective(directive) {\n if (!isDirective(directive)) {\n throw new Error(\"Expected \".concat(inspect(directive), \" to be a GraphQL directive.\"));\n }\n\n return directive;\n}\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\n\nexport var GraphQLDirective = /*#__PURE__*/function () {\n function GraphQLDirective(config) {\n var _config$isRepeatable, _config$args;\n\n this.name = config.name;\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n config.name || devAssert(0, 'Directive must be named.');\n Array.isArray(config.locations) || devAssert(0, \"@\".concat(config.name, \" locations must be an Array.\"));\n var args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {};\n isObjectLike(args) && !Array.isArray(args) || devAssert(0, \"@\".concat(config.name, \" args must be an object with argument names as keys.\"));\n this.args = objectEntries(args).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n }\n\n var _proto = GraphQLDirective.prototype;\n\n _proto.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: argsToArgsConfig(this.args),\n isRepeatable: this.isRepeatable,\n extensions: this.extensions,\n astNode: this.astNode\n };\n };\n\n _proto.toString = function toString() {\n return '@' + this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLDirective, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLDirective';\n }\n }]);\n\n return GraphQLDirective;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLDirective);\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport var GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description: 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.'\n }\n }\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport var GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description: 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.'\n }\n }\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport var DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport var GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ARGUMENT_DEFINITION, DirectiveLocation.INPUT_FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE],\n args: {\n reason: {\n type: GraphQLString,\n description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n defaultValue: DEFAULT_DEPRECATION_REASON\n }\n }\n});\n/**\n * Used to provide a URL for specifying the behaviour of custom scalar definitions.\n */\n\nexport var GraphQLSpecifiedByDirective = new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behaviour of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behaviour of this scalar.'\n }\n }\n});\n/**\n * The full list of specified directives.\n */\n\nexport var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective]);\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(function (_ref2) {\n var name = _ref2.name;\n return name === directive.name;\n });\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport find from \"../polyfills/find.mjs\";\nimport arrayFrom from \"../polyfills/arrayFrom.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { __Schema } from \"./introspection.mjs\";\nimport { GraphQLDirective, isDirective, specifiedDirectives } from \"./directives.mjs\";\nimport { isObjectType, isInterfaceType, isUnionType, isInputObjectType, getNamedType } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL schema.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\nexport function assertSchema(schema) {\n if (!isSchema(schema)) {\n throw new Error(\"Expected \".concat(inspect(schema), \" to be a GraphQL schema.\"));\n }\n\n return schema;\n}\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n *\n * Note: When the schema is constructed, by default only the types that are\n * reachable by traversing the root types are included, other types must be\n * explicitly referenced.\n *\n * Example:\n *\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * ...\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface, ... },\n * }\n * }),\n * ...\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * })\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. @include and\n * @skip) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n *\n */\n\nexport var GraphQLSchema = /*#__PURE__*/function () {\n // Used as a cache for validateSchema().\n function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n isObjectLike(config) || devAssert(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || devAssert(0, \"\\\"types\\\" must be Array if provided but got: \".concat(inspect(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || devAssert(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(inspect(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = arrayFrom(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || devAssert(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if (isInterfaceType(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if (isInterfaceType(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n var _proto = GraphQLSchema.prototype;\n\n _proto.getQueryType = function getQueryType() {\n return this._queryType;\n };\n\n _proto.getMutationType = function getMutationType() {\n return this._mutationType;\n };\n\n _proto.getSubscriptionType = function getSubscriptionType() {\n return this._subscriptionType;\n };\n\n _proto.getTypeMap = function getTypeMap() {\n return this._typeMap;\n };\n\n _proto.getType = function getType(name) {\n return this.getTypeMap()[name];\n };\n\n _proto.getPossibleTypes = function getPossibleTypes(abstractType) {\n return isUnionType(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;\n };\n\n _proto.getImplementations = function getImplementations(interfaceType) {\n var implementations = this._implementationsMap[interfaceType.name];\n return implementations !== null && implementations !== void 0 ? implementations : {\n objects: [],\n interfaces: []\n };\n } // @deprecated: use isSubType instead - will be removed in v16.\n ;\n\n _proto.isPossibleType = function isPossibleType(abstractType, possibleType) {\n return this.isSubType(abstractType, possibleType);\n };\n\n _proto.isSubType = function isSubType(abstractType, maybeSubType) {\n var map = this._subTypeMap[abstractType.name];\n\n if (map === undefined) {\n map = Object.create(null);\n\n if (isUnionType(abstractType)) {\n for (var _i14 = 0, _abstractType$getType2 = abstractType.getTypes(); _i14 < _abstractType$getType2.length; _i14++) {\n var type = _abstractType$getType2[_i14];\n map[type.name] = true;\n }\n } else {\n var implementations = this.getImplementations(abstractType);\n\n for (var _i16 = 0, _implementations$obje2 = implementations.objects; _i16 < _implementations$obje2.length; _i16++) {\n var _type = _implementations$obje2[_i16];\n map[_type.name] = true;\n }\n\n for (var _i18 = 0, _implementations$inte2 = implementations.interfaces; _i18 < _implementations$inte2.length; _i18++) {\n var _type2 = _implementations$inte2[_i18];\n map[_type2.name] = true;\n }\n }\n\n this._subTypeMap[abstractType.name] = map;\n }\n\n return map[maybeSubType.name] !== undefined;\n };\n\n _proto.getDirectives = function getDirectives() {\n return this._directives;\n };\n\n _proto.getDirective = function getDirective(name) {\n return find(this.getDirectives(), function (directive) {\n return directive.name === name;\n });\n };\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: objectValues(this.getTypeMap()),\n directives: this.getDirectives().slice(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [],\n assumeValid: this.__validationErrors !== undefined\n };\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLSchema, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLSchema';\n }\n }]);\n\n return GraphQLSchema;\n}();\n\nfunction collectReferencedTypes(type, typeSet) {\n var namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n\n if (isUnionType(namedType)) {\n for (var _i20 = 0, _namedType$getTypes2 = namedType.getTypes(); _i20 < _namedType$getTypes2.length; _i20++) {\n var memberType = _namedType$getTypes2[_i20];\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (var _i22 = 0, _namedType$getInterfa6 = namedType.getInterfaces(); _i22 < _namedType$getInterfa6.length; _i22++) {\n var interfaceType = _namedType$getInterfa6[_i22];\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (var _i24 = 0, _objectValues2 = objectValues(namedType.getFields()); _i24 < _objectValues2.length; _i24++) {\n var field = _objectValues2[_i24];\n collectReferencedTypes(field.type, typeSet);\n\n for (var _i26 = 0, _field$args2 = field.args; _i26 < _field$args2.length; _i26++) {\n var arg = _field$args2[_i26];\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (var _i28 = 0, _objectValues4 = objectValues(namedType.getFields()); _i28 < _objectValues4.length; _i28++) {\n var _field = _objectValues4[_i28];\n collectReferencedTypes(_field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n","import { Kind } from \"./kinds.mjs\";\nexport function isDefinitionNode(node) {\n return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node);\n}\nexport function isExecutableDefinitionNode(node) {\n return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION;\n}\nexport function isSelectionNode(node) {\n return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT;\n}\nexport function isValueNode(node) {\n return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT;\n}\nexport function isTypeNode(node) {\n return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE;\n}\nexport function isTypeSystemDefinitionNode(node) {\n return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION;\n}\nexport function isTypeDefinitionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION;\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION;\n}\n","import didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isTypeDefinitionNode, isTypeSystemDefinitionNode, isTypeSystemExtensionNode } from \"../../language/predicates.mjs\";\nimport { specifiedScalarTypes } from \"../../type/scalars.mjs\";\nimport { introspectionTypes } from \"../../type/introspection.mjs\";\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n */\nexport function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = suggestionList(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new GraphQLError(\"Unknown type \\\"\".concat(typeName, \"\\\".\") + didYouMean(suggestedTypes), node));\n }\n }\n };\n}\nvar standardTypeNames = [].concat(specifiedScalarTypes, introspectionTypes).map(function (type) {\n return type.name;\n});\n\nfunction isStandardTypeName(typeName) {\n return standardTypeNames.indexOf(typeName) !== -1;\n}\n\nfunction isSDLNode(value) {\n return !Array.isArray(value) && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value));\n}\n","import inspect from \"../../jsutils/inspect.mjs\";\nimport invariant from \"../../jsutils/invariant.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { DirectiveLocation } from \"../../language/directiveLocation.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n */\nexport function KnownDirectivesRule(context) {\n var locationsMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n locationsMap[directive.name] = directive.locations;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap[def.name.value] = def.locations.map(function (name) {\n return name.value;\n });\n }\n }\n\n return {\n Directive: function Directive(node, _key, _parent, _path, ancestors) {\n var name = node.name.value;\n var locations = locationsMap[name];\n\n if (!locations) {\n context.reportError(new GraphQLError(\"Unknown directive \\\"@\".concat(name, \"\\\".\"), node));\n return;\n }\n\n var candidateLocation = getDirectiveLocationForASTPath(ancestors);\n\n if (candidateLocation && locations.indexOf(candidateLocation) === -1) {\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(name, \"\\\" may not be used on \").concat(candidateLocation, \".\"), node));\n }\n }\n };\n}\n\nfunction getDirectiveLocationForASTPath(ancestors) {\n var appliedTo = ancestors[ancestors.length - 1];\n !Array.isArray(appliedTo) || invariant(0);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n\n case Kind.VARIABLE_DEFINITION:\n return DirectiveLocation.VARIABLE_DEFINITION;\n\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n\n case Kind.INPUT_VALUE_DEFINITION:\n {\n var parentNode = ancestors[ancestors.length - 3];\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n }\n}\n\nfunction getDirectiveLocationForOperation(operation) {\n switch (operation) {\n case 'query':\n return DirectiveLocation.QUERY;\n\n case 'mutation':\n return DirectiveLocation.MUTATION;\n\n case 'subscription':\n return DirectiveLocation.SUBSCRIPTION;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected operation: ' + inspect(operation));\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isTypeDefinitionNode, isTypeExtensionNode } from \"../../language/predicates.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n */\nexport function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === Kind.SCHEMA_DEFINITION || node.kind === Kind.SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new GraphQLError(\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n */\nexport function KnownArgumentNamesRule(context) {\n return _objectSpread(_objectSpread({}, KnownArgumentNamesOnDirectivesRule(context)), {}, {\n Argument: function Argument(argNode) {\n var argDef = context.getArgument();\n var fieldDef = context.getFieldDef();\n var parentType = context.getParentType();\n\n if (!argDef && fieldDef && parentType) {\n var argName = argNode.name.value;\n var knownArgsNames = fieldDef.args.map(function (arg) {\n return arg.name;\n });\n var suggestions = suggestionList(argName, knownArgsNames);\n context.reportError(new GraphQLError(\"Unknown argument \\\"\".concat(argName, \"\\\" on field \\\"\").concat(parentType.name, \".\").concat(fieldDef.name, \"\\\".\") + didYouMean(suggestions), argNode));\n }\n }\n });\n}\n/**\n * @internal\n */\n\nexport function KnownArgumentNamesOnDirectivesRule(context) {\n var directiveArgs = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n directiveArgs[directive.name] = directive.args.map(function (arg) {\n return arg.name;\n });\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : [];\n directiveArgs[def.name.value] = argsNodes.map(function (arg) {\n return arg.name.value;\n });\n }\n }\n\n return {\n Directive: function Directive(directiveNode) {\n var directiveName = directiveNode.name.value;\n var knownArgs = directiveArgs[directiveName];\n\n if (directiveNode.arguments && knownArgs) {\n for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) {\n var argNode = _directiveNode$argume2[_i6];\n var argName = argNode.name.value;\n\n if (knownArgs.indexOf(argName) === -1) {\n var suggestions = suggestionList(argName, knownArgs);\n context.reportError(new GraphQLError(\"Unknown argument \\\"\".concat(argName, \"\\\" on directive \\\"@\").concat(directiveName, \"\\\".\") + didYouMean(suggestions), argNode));\n }\n }\n }\n\n return false;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n */\nexport function UniqueArgumentNamesRule(context) {\n var knownArgNames = Object.create(null);\n return {\n Field: function Field() {\n knownArgNames = Object.create(null);\n },\n Directive: function Directive() {\n knownArgNames = Object.create(null);\n },\n Argument: function Argument(node) {\n var argName = node.name.value;\n\n if (knownArgNames[argName]) {\n context.reportError(new GraphQLError(\"There can be only one argument named \\\"\".concat(argName, \"\\\".\"), [knownArgNames[argName], node.name]));\n } else {\n knownArgNames[argName] = node.name;\n }\n\n return false;\n }\n };\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport keyMap from \"../../jsutils/keyMap.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { print } from \"../../language/printer.mjs\";\nimport { specifiedDirectives } from \"../../type/directives.mjs\";\nimport { isType, isRequiredArgument } from \"../../type/definition.mjs\";\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n */\nexport function ProvidedRequiredArgumentsRule(context) {\n return _objectSpread(_objectSpread({}, ProvidedRequiredArgumentsOnDirectivesRule(context)), {}, {\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave: function leave(fieldNode) {\n var _fieldNode$arguments;\n\n var fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n return false;\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var argNodes = (_fieldNode$arguments = fieldNode.arguments) !== null && _fieldNode$arguments !== void 0 ? _fieldNode$arguments : [];\n var argNodeMap = keyMap(argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i2 = 0, _fieldDef$args2 = fieldDef.args; _i2 < _fieldDef$args2.length; _i2++) {\n var argDef = _fieldDef$args2[_i2];\n var argNode = argNodeMap[argDef.name];\n\n if (!argNode && isRequiredArgument(argDef)) {\n var argTypeStr = inspect(argDef.type);\n context.reportError(new GraphQLError(\"Field \\\"\".concat(fieldDef.name, \"\\\" argument \\\"\").concat(argDef.name, \"\\\" of type \\\"\").concat(argTypeStr, \"\\\" is required, but it was not provided.\"), fieldNode));\n }\n }\n }\n }\n });\n}\n/**\n * @internal\n */\n\nexport function ProvidedRequiredArgumentsOnDirectivesRule(context) {\n var requiredArgsMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n\n for (var _i4 = 0; _i4 < definedDirectives.length; _i4++) {\n var directive = definedDirectives[_i4];\n requiredArgsMap[directive.name] = keyMap(directive.args.filter(isRequiredArgument), function (arg) {\n return arg.name;\n });\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i6 = 0; _i6 < astDefinitions.length; _i6++) {\n var def = astDefinitions[_i6];\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : [];\n requiredArgsMap[def.name.value] = keyMap(argNodes.filter(isRequiredArgumentNode), function (arg) {\n return arg.name.value;\n });\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave: function leave(directiveNode) {\n var directiveName = directiveNode.name.value;\n var requiredArgs = requiredArgsMap[directiveName];\n\n if (requiredArgs) {\n var _directiveNode$argume;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var _argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : [];\n\n var argNodeMap = keyMap(_argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i8 = 0, _Object$keys2 = Object.keys(requiredArgs); _i8 < _Object$keys2.length; _i8++) {\n var argName = _Object$keys2[_i8];\n\n if (!argNodeMap[argName]) {\n var argType = requiredArgs[argName].type;\n var argTypeStr = isType(argType) ? inspect(argType) : print(argType);\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(directiveName, \"\\\" argument \\\"\").concat(argName, \"\\\" of type \\\"\").concat(argTypeStr, \"\\\" is required, but it was not provided.\"), directiveNode));\n }\n }\n }\n }\n }\n };\n}\n\nfunction isRequiredArgumentNode(arg) {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n */\nexport function UniqueInputFieldNamesRule(context) {\n var knownNameStack = [];\n var knownNames = Object.create(null);\n return {\n ObjectValue: {\n enter: function enter() {\n knownNameStack.push(knownNames);\n knownNames = Object.create(null);\n },\n leave: function leave() {\n knownNames = knownNameStack.pop();\n }\n },\n ObjectField: function ObjectField(node) {\n var fieldName = node.name.value;\n\n if (knownNames[fieldName]) {\n context.reportError(new GraphQLError(\"There can be only one input field named \\\"\".concat(fieldName, \"\\\".\"), [knownNames[fieldName], node.name]));\n } else {\n knownNames[fieldName] = node.name;\n }\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n */\nexport function LoneSchemaDefinitionRule(context) {\n var _ref, _ref2, _oldSchema$astNode;\n\n var oldSchema = context.getSchema();\n var alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType();\n var schemaDefinitionsCount = 0;\n return {\n SchemaDefinition: function SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(new GraphQLError('Cannot define a new schema within a schema extension.', node));\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(new GraphQLError('Must provide only one schema definition.', node));\n }\n\n ++schemaDefinitionsCount;\n }\n };\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n */\nexport function UniqueOperationTypesRule(context) {\n var schema = context.getSchema();\n var definedOperationTypes = Object.create(null);\n var existingOperationTypes = schema ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType()\n } : {};\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes\n };\n\n function checkOperationTypes(node) {\n var _node$operationTypes;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : [];\n\n for (var _i2 = 0; _i2 < operationTypesNodes.length; _i2++) {\n var operationType = operationTypesNodes[_i2];\n var operation = operationType.operation;\n var alreadyDefinedOperationType = definedOperationTypes[operation];\n\n if (existingOperationTypes[operation]) {\n context.reportError(new GraphQLError(\"Type for \".concat(operation, \" already defined in the schema. It cannot be redefined.\"), operationType));\n } else if (alreadyDefinedOperationType) {\n context.reportError(new GraphQLError(\"There can be only one \".concat(operation, \" type in schema.\"), [alreadyDefinedOperationType, operationType]));\n } else {\n definedOperationTypes[operation] = operationType;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n */\nexport function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(new GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new GraphQLError(\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isEnumType } from \"../../type/definition.mjs\";\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n */\nexport function UniqueEnumValueNamesRule(context) {\n var schema = context.getSchema();\n var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n var knownValueNames = Object.create(null);\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness\n };\n\n function checkValueUniqueness(node) {\n var _node$values;\n\n var typeName = node.name.value;\n\n if (!knownValueNames[typeName]) {\n knownValueNames[typeName] = Object.create(null);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : [];\n var valueNames = knownValueNames[typeName];\n\n for (var _i2 = 0; _i2 < valueNodes.length; _i2++) {\n var valueDef = valueNodes[_i2];\n var valueName = valueDef.name.value;\n var existingType = existingTypeMap[typeName];\n\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(new GraphQLError(\"Enum value \\\"\".concat(typeName, \".\").concat(valueName, \"\\\" already exists in the schema. It cannot also be defined in this type extension.\"), valueDef.name));\n } else if (valueNames[valueName]) {\n context.reportError(new GraphQLError(\"Enum value \\\"\".concat(typeName, \".\").concat(valueName, \"\\\" can only be defined once.\"), [valueNames[valueName], valueDef.name]));\n } else {\n valueNames[valueName] = valueDef.name;\n }\n }\n\n return false;\n }\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { isObjectType, isInterfaceType, isInputObjectType } from \"../../type/definition.mjs\";\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n */\nexport function UniqueFieldDefinitionNamesRule(context) {\n var schema = context.getSchema();\n var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n var knownFieldNames = Object.create(null);\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness\n };\n\n function checkFieldUniqueness(node) {\n var _node$fields;\n\n var typeName = node.name.value;\n\n if (!knownFieldNames[typeName]) {\n knownFieldNames[typeName] = Object.create(null);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n\n var fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : [];\n var fieldNames = knownFieldNames[typeName];\n\n for (var _i2 = 0; _i2 < fieldNodes.length; _i2++) {\n var fieldDef = fieldNodes[_i2];\n var fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(new GraphQLError(\"Field \\\"\".concat(typeName, \".\").concat(fieldName, \"\\\" already exists in the schema. It cannot also be defined in this type extension.\"), fieldDef.name));\n } else if (fieldNames[fieldName]) {\n context.reportError(new GraphQLError(\"Field \\\"\".concat(typeName, \".\").concat(fieldName, \"\\\" can only be defined once.\"), [fieldNames[fieldName], fieldDef.name]));\n } else {\n fieldNames[fieldName] = fieldDef.name;\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n\n return false;\n}\n","import { GraphQLError } from \"../../error/GraphQLError.mjs\";\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n */\nexport function UniqueDirectiveNamesRule(context) {\n var knownDirectiveNames = Object.create(null);\n var schema = context.getSchema();\n return {\n DirectiveDefinition: function DirectiveDefinition(node) {\n var directiveName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) {\n context.reportError(new GraphQLError(\"Directive \\\"@\".concat(directiveName, \"\\\" already exists in the schema. It cannot be redefined.\"), node.name));\n return;\n }\n\n if (knownDirectiveNames[directiveName]) {\n context.reportError(new GraphQLError(\"There can be only one directive named \\\"@\".concat(directiveName, \"\\\".\"), [knownDirectiveNames[directiveName], node.name]));\n } else {\n knownDirectiveNames[directiveName] = node.name;\n }\n\n return false;\n }\n };\n}\n","var _defKindToExtKind;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport inspect from \"../../jsutils/inspect.mjs\";\nimport invariant from \"../../jsutils/invariant.mjs\";\nimport didYouMean from \"../../jsutils/didYouMean.mjs\";\nimport suggestionList from \"../../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../../error/GraphQLError.mjs\";\nimport { Kind } from \"../../language/kinds.mjs\";\nimport { isTypeDefinitionNode } from \"../../language/predicates.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from \"../../type/definition.mjs\";\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n */\nexport function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = suggestionList(typeName, allTypeNames);\n context.reportError(new GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + didYouMean(suggestedTypes), node.name));\n }\n }\n}\nvar defKindToExtKind = (_defKindToExtKind = {}, _defineProperty(_defKindToExtKind, Kind.SCALAR_TYPE_DEFINITION, Kind.SCALAR_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.OBJECT_TYPE_DEFINITION, Kind.OBJECT_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INTERFACE_TYPE_DEFINITION, Kind.INTERFACE_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.UNION_TYPE_DEFINITION, Kind.UNION_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.ENUM_TYPE_DEFINITION, Kind.ENUM_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INPUT_OBJECT_TYPE_DEFINITION, Kind.INPUT_OBJECT_TYPE_EXTENSION), _defKindToExtKind);\n\nfunction typeToExtKind(type) {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind) {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected kind: ' + inspect(kind));\n}\n","// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from \"./rules/ExecutableDefinitionsRule.mjs\"; // Spec Section: \"Operation Name Uniqueness\"\n\nimport { UniqueOperationNamesRule } from \"./rules/UniqueOperationNamesRule.mjs\"; // Spec Section: \"Lone Anonymous Operation\"\n\nimport { LoneAnonymousOperationRule } from \"./rules/LoneAnonymousOperationRule.mjs\"; // Spec Section: \"Subscriptions with Single Root Field\"\n\nimport { SingleFieldSubscriptionsRule } from \"./rules/SingleFieldSubscriptionsRule.mjs\"; // Spec Section: \"Fragment Spread Type Existence\"\n\nimport { KnownTypeNamesRule } from \"./rules/KnownTypeNamesRule.mjs\"; // Spec Section: \"Fragments on Composite Types\"\n\nimport { FragmentsOnCompositeTypesRule } from \"./rules/FragmentsOnCompositeTypesRule.mjs\"; // Spec Section: \"Variables are Input Types\"\n\nimport { VariablesAreInputTypesRule } from \"./rules/VariablesAreInputTypesRule.mjs\"; // Spec Section: \"Leaf Field Selections\"\n\nimport { ScalarLeafsRule } from \"./rules/ScalarLeafsRule.mjs\"; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nimport { FieldsOnCorrectTypeRule } from \"./rules/FieldsOnCorrectTypeRule.mjs\"; // Spec Section: \"Fragment Name Uniqueness\"\n\nimport { UniqueFragmentNamesRule } from \"./rules/UniqueFragmentNamesRule.mjs\"; // Spec Section: \"Fragment spread target defined\"\n\nimport { KnownFragmentNamesRule } from \"./rules/KnownFragmentNamesRule.mjs\"; // Spec Section: \"Fragments must be used\"\n\nimport { NoUnusedFragmentsRule } from \"./rules/NoUnusedFragmentsRule.mjs\"; // Spec Section: \"Fragment spread is possible\"\n\nimport { PossibleFragmentSpreadsRule } from \"./rules/PossibleFragmentSpreadsRule.mjs\"; // Spec Section: \"Fragments must not form cycles\"\n\nimport { NoFragmentCyclesRule } from \"./rules/NoFragmentCyclesRule.mjs\"; // Spec Section: \"Variable Uniqueness\"\n\nimport { UniqueVariableNamesRule } from \"./rules/UniqueVariableNamesRule.mjs\"; // Spec Section: \"All Variable Used Defined\"\n\nimport { NoUndefinedVariablesRule } from \"./rules/NoUndefinedVariablesRule.mjs\"; // Spec Section: \"All Variables Used\"\n\nimport { NoUnusedVariablesRule } from \"./rules/NoUnusedVariablesRule.mjs\"; // Spec Section: \"Directives Are Defined\"\n\nimport { KnownDirectivesRule } from \"./rules/KnownDirectivesRule.mjs\"; // Spec Section: \"Directives Are Unique Per Location\"\n\nimport { UniqueDirectivesPerLocationRule } from \"./rules/UniqueDirectivesPerLocationRule.mjs\"; // Spec Section: \"Argument Names\"\n\nimport { KnownArgumentNamesRule, KnownArgumentNamesOnDirectivesRule } from \"./rules/KnownArgumentNamesRule.mjs\"; // Spec Section: \"Argument Uniqueness\"\n\nimport { UniqueArgumentNamesRule } from \"./rules/UniqueArgumentNamesRule.mjs\"; // Spec Section: \"Value Type Correctness\"\n\nimport { ValuesOfCorrectTypeRule } from \"./rules/ValuesOfCorrectTypeRule.mjs\"; // Spec Section: \"Argument Optionality\"\n\nimport { ProvidedRequiredArgumentsRule, ProvidedRequiredArgumentsOnDirectivesRule } from \"./rules/ProvidedRequiredArgumentsRule.mjs\"; // Spec Section: \"All Variable Usages Are Allowed\"\n\nimport { VariablesInAllowedPositionRule } from \"./rules/VariablesInAllowedPositionRule.mjs\"; // Spec Section: \"Field Selection Merging\"\n\nimport { OverlappingFieldsCanBeMergedRule } from \"./rules/OverlappingFieldsCanBeMergedRule.mjs\"; // Spec Section: \"Input Object Field Uniqueness\"\n\nimport { UniqueInputFieldNamesRule } from \"./rules/UniqueInputFieldNamesRule.mjs\"; // TODO: Spec Section\n\nimport { MaxIntrospectionDepthRule } from \"./rules/MaxIntrospectionDepthRule.mjs\"; // SDL-specific validation rules\n\nimport { LoneSchemaDefinitionRule } from \"./rules/LoneSchemaDefinitionRule.mjs\";\nimport { UniqueOperationTypesRule } from \"./rules/UniqueOperationTypesRule.mjs\";\nimport { UniqueTypeNamesRule } from \"./rules/UniqueTypeNamesRule.mjs\";\nimport { UniqueEnumValueNamesRule } from \"./rules/UniqueEnumValueNamesRule.mjs\";\nimport { UniqueFieldDefinitionNamesRule } from \"./rules/UniqueFieldDefinitionNamesRule.mjs\";\nimport { UniqueDirectiveNamesRule } from \"./rules/UniqueDirectiveNamesRule.mjs\";\nimport { PossibleTypeExtensionsRule } from \"./rules/PossibleTypeExtensionsRule.mjs\";\n/**\n * Technically these aren't part of the spec but they are strongly encouraged\n * validation rules.\n */\n\nexport var recommendedRules = Object.freeze([MaxIntrospectionDepthRule]);\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\n\nexport var specifiedRules = Object.freeze([ExecutableDefinitionsRule, UniqueOperationNamesRule, LoneAnonymousOperationRule, SingleFieldSubscriptionsRule, KnownTypeNamesRule, FragmentsOnCompositeTypesRule, VariablesAreInputTypesRule, ScalarLeafsRule, FieldsOnCorrectTypeRule, UniqueFragmentNamesRule, KnownFragmentNamesRule, NoUnusedFragmentsRule, PossibleFragmentSpreadsRule, NoFragmentCyclesRule, UniqueVariableNamesRule, NoUndefinedVariablesRule, NoUnusedVariablesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, KnownArgumentNamesRule, UniqueArgumentNamesRule, ValuesOfCorrectTypeRule, ProvidedRequiredArgumentsRule, VariablesInAllowedPositionRule, OverlappingFieldsCanBeMergedRule, UniqueInputFieldNamesRule].concat(recommendedRules));\n/**\n * @internal\n */\n\nexport var specifiedSDLRules = Object.freeze([LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, KnownTypeNamesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, PossibleTypeExtensionsRule, KnownArgumentNamesOnDirectivesRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, ProvidedRequiredArgumentsOnDirectivesRule]);\n","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport { Kind } from \"../language/kinds.mjs\";\nimport { visit } from \"../language/visitor.mjs\";\nimport { TypeInfo, visitWithTypeInfo } from \"../utilities/TypeInfo.mjs\";\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n */\nexport var ASTValidationContext = /*#__PURE__*/function () {\n function ASTValidationContext(ast, onError) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n var _proto = ASTValidationContext.prototype;\n\n _proto.reportError = function reportError(error) {\n this._onError(error);\n };\n\n _proto.getDocument = function getDocument() {\n return this._ast;\n };\n\n _proto.getFragment = function getFragment(name) {\n var fragments = this._fragments;\n\n if (!fragments) {\n this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) {\n if (statement.kind === Kind.FRAGMENT_DEFINITION) {\n frags[statement.name.value] = statement;\n }\n\n return frags;\n }, Object.create(null));\n }\n\n return fragments[name];\n };\n\n _proto.getFragmentSpreads = function getFragmentSpreads(node) {\n var spreads = this._fragmentSpreads.get(node);\n\n if (!spreads) {\n spreads = [];\n var setsToVisit = [node];\n\n while (setsToVisit.length !== 0) {\n var set = setsToVisit.pop();\n\n for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) {\n var selection = _set$selections2[_i2];\n\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n\n this._fragmentSpreads.set(node, spreads);\n }\n\n return spreads;\n };\n\n _proto.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) {\n var fragments = this._recursivelyReferencedFragments.get(operation);\n\n if (!fragments) {\n fragments = [];\n var collectedNames = Object.create(null);\n var nodesToVisit = [operation.selectionSet];\n\n while (nodesToVisit.length !== 0) {\n var node = nodesToVisit.pop();\n\n for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) {\n var spread = _this$getFragmentSpre2[_i4];\n var fragName = spread.name.value;\n\n if (collectedNames[fragName] !== true) {\n collectedNames[fragName] = true;\n var fragment = this.getFragment(fragName);\n\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n\n return fragments;\n };\n\n return ASTValidationContext;\n}();\nexport var SDLValidationContext = /*#__PURE__*/function (_ASTValidationContext) {\n _inheritsLoose(SDLValidationContext, _ASTValidationContext);\n\n function SDLValidationContext(ast, schema, onError) {\n var _this;\n\n _this = _ASTValidationContext.call(this, ast, onError) || this;\n _this._schema = schema;\n return _this;\n }\n\n var _proto2 = SDLValidationContext.prototype;\n\n _proto2.getSchema = function getSchema() {\n return this._schema;\n };\n\n return SDLValidationContext;\n}(ASTValidationContext);\nexport var ValidationContext = /*#__PURE__*/function (_ASTValidationContext2) {\n _inheritsLoose(ValidationContext, _ASTValidationContext2);\n\n function ValidationContext(schema, ast, typeInfo, onError) {\n var _this2;\n\n _this2 = _ASTValidationContext2.call(this, ast, onError) || this;\n _this2._schema = schema;\n _this2._typeInfo = typeInfo;\n _this2._variableUsages = new Map();\n _this2._recursiveVariableUsages = new Map();\n return _this2;\n }\n\n var _proto3 = ValidationContext.prototype;\n\n _proto3.getSchema = function getSchema() {\n return this._schema;\n };\n\n _proto3.getVariableUsages = function getVariableUsages(node) {\n var usages = this._variableUsages.get(node);\n\n if (!usages) {\n var newUsages = [];\n var typeInfo = new TypeInfo(this._schema);\n visit(node, visitWithTypeInfo(typeInfo, {\n VariableDefinition: function VariableDefinition() {\n return false;\n },\n Variable: function Variable(variable) {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n defaultValue: typeInfo.getDefaultValue()\n });\n }\n }));\n usages = newUsages;\n\n this._variableUsages.set(node, usages);\n }\n\n return usages;\n };\n\n _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) {\n var usages = this._recursiveVariableUsages.get(operation);\n\n if (!usages) {\n usages = this.getVariableUsages(operation);\n\n for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) {\n var frag = _this$getRecursivelyR2[_i6];\n usages = usages.concat(this.getVariableUsages(frag));\n }\n\n this._recursiveVariableUsages.set(operation, usages);\n }\n\n return usages;\n };\n\n _proto3.getType = function getType() {\n return this._typeInfo.getType();\n };\n\n _proto3.getParentType = function getParentType() {\n return this._typeInfo.getParentType();\n };\n\n _proto3.getInputType = function getInputType() {\n return this._typeInfo.getInputType();\n };\n\n _proto3.getParentInputType = function getParentInputType() {\n return this._typeInfo.getParentInputType();\n };\n\n _proto3.getFieldDef = function getFieldDef() {\n return this._typeInfo.getFieldDef();\n };\n\n _proto3.getDirective = function getDirective() {\n return this._typeInfo.getDirective();\n };\n\n _proto3.getArgument = function getArgument() {\n return this._typeInfo.getArgument();\n };\n\n _proto3.getEnumValue = function getEnumValue() {\n return this._typeInfo.getEnumValue();\n };\n\n return ValidationContext;\n}(ASTValidationContext);\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { visit, visitInParallel } from \"../language/visitor.mjs\";\nimport { assertValidSchema } from \"../type/validate.mjs\";\nimport { TypeInfo, visitWithTypeInfo } from \"../utilities/TypeInfo.mjs\";\nimport { specifiedRules, specifiedSDLRules } from \"./specifiedRules.mjs\";\nimport { SDLValidationContext, ValidationContext } from \"./ValidationContext.mjs\";\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rules is a function which returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Optionally a custom TypeInfo instance may be provided. If not provided, one\n * will be created from the provided schema.\n */\n\nexport function validate(schema, documentAST) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedRules;\n var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new TypeInfo(schema);\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n maxErrors: undefined\n };\n documentAST || devAssert(0, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.\n\n assertValidSchema(schema);\n var abortObj = Object.freeze({});\n var errors = [];\n var context = new ValidationContext(schema, documentAST, typeInfo, function (error) {\n if (options.maxErrors != null && errors.length >= options.maxErrors) {\n errors.push(new GraphQLError('Too many validation errors, error limit reached. Validation aborted.'));\n throw abortObj;\n }\n\n errors.push(error);\n }); // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n\n var visitor = visitInParallel(rules.map(function (rule) {\n return rule(context);\n })); // Visit the whole document with each instance of all provided rules.\n\n try {\n visit(documentAST, visitWithTypeInfo(typeInfo, visitor));\n } catch (e) {\n if (e !== abortObj) {\n throw e;\n }\n }\n\n return errors;\n}\n/**\n * @internal\n */\n\nexport function validateSDL(documentAST, schemaToExtend) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedSDLRules;\n var errors = [];\n var context = new SDLValidationContext(documentAST, schemaToExtend, function (error) {\n errors.push(error);\n });\n var visitors = rules.map(function (rule) {\n return rule(context);\n });\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDLExtension(documentAST, schema) {\n var errors = validateSDL(documentAST, schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { isLeafType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Mixed |\n * | NullValue | null |\n *\n */\n\nexport function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = keyMap(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n} // Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\n\nfunction isMissingVariable(valueNode, variables) {\n return valueNode.kind === Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}\n","import find from \"../polyfills/find.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport printPathArray from \"../jsutils/printPathArray.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { isInputType, isNonNullType } from \"../type/definition.mjs\";\nimport { typeFromAST } from \"../utilities/typeFromAST.mjs\";\nimport { valueFromAST } from \"../utilities/valueFromAST.mjs\";\nimport { coerceInputValue } from \"../utilities/coerceInputValue.mjs\";\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getVariableValues(schema, varDefNodes, inputs, options) {\n var errors = [];\n var maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors;\n\n try {\n var coerced = coerceVariableValues(schema, varDefNodes, inputs, function (error) {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.');\n }\n\n errors.push(error);\n });\n\n if (errors.length === 0) {\n return {\n coerced: coerced\n };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return {\n errors: errors\n };\n}\n\nfunction coerceVariableValues(schema, varDefNodes, inputs, onError) {\n var coercedValues = {};\n\n var _loop = function _loop(_i2) {\n var varDefNode = varDefNodes[_i2];\n var varName = varDefNode.variable.name.value;\n var varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n var varTypeStr = print(varDefNode.type);\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" expected value of type \\\"\").concat(varTypeStr, \"\\\" which cannot be used as an input type.\"), varDefNode.type));\n return \"continue\";\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);\n } else if (isNonNullType(varType)) {\n var _varTypeStr = inspect(varType);\n\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" of required type \\\"\").concat(_varTypeStr, \"\\\" was not provided.\"), varDefNode));\n }\n\n return \"continue\";\n }\n\n var value = inputs[varName];\n\n if (value === null && isNonNullType(varType)) {\n var _varTypeStr2 = inspect(varType);\n\n onError(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" of non-null type \\\"\").concat(_varTypeStr2, \"\\\" must not be null.\"), varDefNode));\n return \"continue\";\n }\n\n coercedValues[varName] = coerceInputValue(value, varType, function (path, invalidValue, error) {\n var prefix = \"Variable \\\"$\".concat(varName, \"\\\" got invalid value \") + inspect(invalidValue);\n\n if (path.length > 0) {\n prefix += \" at \\\"\".concat(varName).concat(printPathArray(path), \"\\\"\");\n }\n\n onError(new GraphQLError(prefix + '; ' + error.message, varDefNode, undefined, undefined, undefined, error.originalError));\n });\n };\n\n for (var _i2 = 0; _i2 < varDefNodes.length; _i2++) {\n var _ret = _loop(_i2);\n\n if (_ret === \"continue\") continue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\n\n\nexport function getArgumentValues(def, node, variableValues) {\n var _node$arguments;\n\n var coercedValues = {}; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n var argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : [];\n var argNodeMap = keyMap(argumentNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {\n var argDef = _def$args2[_i4];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + 'was not provided.', node);\n }\n\n continue;\n }\n\n var valueNode = argumentNode.value;\n var isNull = valueNode.kind === Kind.NULL;\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(variableName, \"\\\" which was not provided a runtime value.\"), valueNode);\n }\n\n continue;\n }\n\n isNull = variableValues[variableName] == null;\n }\n\n if (isNull && isNonNullType(argType)) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(inspect(argType), \"\\\" \") + 'must not be null.', valueNode);\n }\n\n var coercedValue = valueFromAST(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(print(valueNode), \".\"), valueNode);\n }\n\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getDirectiveValues(directiveDef, node, variableValues) {\n var directiveNode = node.directives && find(node.directives, function (directive) {\n return directive.name.value === directiveDef.name;\n });\n\n if (directiveNode) {\n return getArgumentValues(directiveDef, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport mapValue from \"../jsutils/mapValue.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { TokenKind } from \"../language/tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"../language/blockString.mjs\";\nimport { isTypeDefinitionNode, isTypeExtensionNode } from \"../language/predicates.mjs\";\nimport { assertValidSDLExtension } from \"../validation/validate.mjs\";\nimport { getDirectiveValues } from \"../execution/values.mjs\";\nimport { assertSchema, GraphQLSchema } from \"../type/schema.mjs\";\nimport { specifiedScalarTypes, isSpecifiedScalarType } from \"../type/scalars.mjs\";\nimport { introspectionTypes, isIntrospectionType } from \"../type/introspection.mjs\";\nimport { GraphQLDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective } from \"../type/directives.mjs\";\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isListType, isNonNullType, isEnumType, isInputObjectType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType } from \"../type/definition.mjs\";\nimport { valueFromAST } from \"./valueFromAST.mjs\";\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n *\n * Accepts options as a third argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function extendSchema(schema, documentAST, options) {\n assertSchema(schema);\n documentAST != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.');\n\n if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n var schemaConfig = schema.toConfig();\n var extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig ? schema : new GraphQLSchema(extendedConfig);\n}\n/**\n * @internal\n */\n\nexport function extendSchemaImpl(schemaConfig, documentAST, options) {\n var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid;\n\n // Collect the type definitions and extensions found in the document.\n var typeDefs = [];\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefs = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n\n for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {\n var def = _documentAST$definiti2[_i2];\n\n if (def.kind === Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if (isTypeDefinitionNode(def)) {\n typeDefs.push(def);\n } else if (isTypeExtensionNode(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n\n if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) {\n return schemaConfig;\n }\n\n var typeMap = Object.create(null);\n\n for (var _i4 = 0, _schemaConfig$types2 = schemaConfig.types; _i4 < _schemaConfig$types2.length; _i4++) {\n var existingType = _schemaConfig$types2[_i4];\n typeMap[existingType.name] = extendNamedType(existingType);\n }\n\n for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {\n var _stdTypeMap$name;\n\n var typeNode = typeDefs[_i6];\n var name = typeNode.name.value;\n typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);\n }\n\n var operationTypes = _objectSpread(_objectSpread({\n // Get the extended root operation types.\n query: schemaConfig.query && replaceNamedType(schemaConfig.query),\n mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation),\n subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription)\n }, schemaDef && getOperationTypes([schemaDef])), getOperationTypes(schemaExtensions)); // Then produce and return a Schema config with these types.\n\n\n return _objectSpread(_objectSpread({\n description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value\n }, operationTypes), {}, {\n types: objectValues(typeMap),\n directives: [].concat(schemaConfig.directives.map(replaceDirective), directiveDefs.map(buildDirective)),\n extensions: undefined,\n astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),\n assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false\n }); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (isListType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLList(replaceType(type.ofType));\n }\n\n if (isNonNullType(type)) {\n // $FlowFixMe[incompatible-return]\n return new GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n return typeMap[type.name];\n }\n\n function replaceDirective(directive) {\n var config = directive.toConfig();\n return new GraphQLDirective(_objectSpread(_objectSpread({}, config), {}, {\n args: mapValue(config.args, extendArg)\n }));\n }\n\n function extendNamedType(type) {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n if (isScalarType(type)) {\n return extendScalarType(type);\n }\n\n if (isObjectType(type)) {\n return extendObjectType(type);\n }\n\n if (isInterfaceType(type)) {\n return extendInterfaceType(type);\n }\n\n if (isUnionType(type)) {\n return extendUnionType(type);\n }\n\n if (isEnumType(type)) {\n return extendEnumType(type);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isInputObjectType(type)) {\n return extendInputObjectType(type);\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, 'Unexpected type: ' + inspect(type));\n }\n\n function extendInputObjectType(type) {\n var _typeExtensionsMap$co;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];\n return new GraphQLInputObjectType(_objectSpread(_objectSpread({}, config), {}, {\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, function (field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type)\n });\n })), buildInputFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendEnumType(type) {\n var _typeExtensionsMap$ty;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];\n return new GraphQLEnumType(_objectSpread(_objectSpread({}, config), {}, {\n values: _objectSpread(_objectSpread({}, config.values), buildEnumValueMap(extensions)),\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendScalarType(type) {\n var _typeExtensionsMap$co2;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];\n var specifiedByUrl = config.specifiedByUrl;\n\n for (var _i8 = 0; _i8 < extensions.length; _i8++) {\n var _getSpecifiedByUrl;\n\n var extensionNode = extensions[_i8];\n specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;\n }\n\n return new GraphQLScalarType(_objectSpread(_objectSpread({}, config), {}, {\n specifiedByUrl: specifiedByUrl,\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendObjectType(type) {\n var _typeExtensionsMap$co3;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];\n return new GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));\n },\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendInterfaceType(type) {\n var _typeExtensionsMap$co4;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];\n return new GraphQLInterfaceType(_objectSpread(_objectSpread({}, config), {}, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));\n },\n fields: function fields() {\n return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendUnionType(type) {\n var _typeExtensionsMap$co5;\n\n var config = type.toConfig();\n var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];\n return new GraphQLUnionType(_objectSpread(_objectSpread({}, config), {}, {\n types: function types() {\n return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendField(field) {\n return _objectSpread(_objectSpread({}, field), {}, {\n type: replaceType(field.type),\n // $FlowFixMe[incompatible-call]\n args: mapValue(field.args, extendArg)\n });\n }\n\n function extendArg(arg) {\n return _objectSpread(_objectSpread({}, arg), {}, {\n type: replaceType(arg.type)\n });\n }\n\n function getOperationTypes(nodes) {\n var opTypes = {};\n\n for (var _i10 = 0; _i10 < nodes.length; _i10++) {\n var _node$operationTypes;\n\n var node = nodes[_i10];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : [];\n\n for (var _i12 = 0; _i12 < operationTypesNodes.length; _i12++) {\n var operationType = operationTypesNodes[_i12];\n opTypes[operationType.operation] = getNamedType(operationType.type);\n }\n } // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n return opTypes;\n }\n\n function getNamedType(node) {\n var _stdTypeMap$name2;\n\n var name = node.name.value;\n var type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name];\n\n if (type === undefined) {\n throw new Error(\"Unknown type: \\\"\".concat(name, \"\\\".\"));\n }\n\n return type;\n }\n\n function getWrappedType(node) {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(getWrappedType(node.type));\n }\n\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(getWrappedType(node.type));\n }\n\n return getNamedType(node);\n }\n\n function buildDirective(node) {\n var locations = node.locations.map(function (_ref) {\n var value = _ref.value;\n return value;\n });\n return new GraphQLDirective({\n name: node.name.value,\n description: getDescription(node, options),\n locations: locations,\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n astNode: node\n });\n }\n\n function buildFieldMap(nodes) {\n var fieldConfigMap = Object.create(null);\n\n for (var _i14 = 0; _i14 < nodes.length; _i14++) {\n var _node$fields;\n\n var node = nodes[_i14];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var nodeFields = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : [];\n\n for (var _i16 = 0; _i16 < nodeFields.length; _i16++) {\n var field = nodeFields[_i16];\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: getWrappedType(field.type),\n description: getDescription(field, options),\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field\n };\n }\n }\n\n return fieldConfigMap;\n }\n\n function buildArgumentMap(args) {\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var argsNodes = args !== null && args !== void 0 ? args : [];\n var argConfigMap = Object.create(null);\n\n for (var _i18 = 0; _i18 < argsNodes.length; _i18++) {\n var arg = argsNodes[_i18];\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n var type = getWrappedType(arg.type);\n argConfigMap[arg.name.value] = {\n type: type,\n description: getDescription(arg, options),\n defaultValue: valueFromAST(arg.defaultValue, type),\n deprecationReason: getDeprecationReason(arg),\n astNode: arg\n };\n }\n\n return argConfigMap;\n }\n\n function buildInputFieldMap(nodes) {\n var inputFieldMap = Object.create(null);\n\n for (var _i20 = 0; _i20 < nodes.length; _i20++) {\n var _node$fields2;\n\n var node = nodes[_i20];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var fieldsNodes = (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : [];\n\n for (var _i22 = 0; _i22 < fieldsNodes.length; _i22++) {\n var field = fieldsNodes[_i22];\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n var type = getWrappedType(field.type);\n inputFieldMap[field.name.value] = {\n type: type,\n description: getDescription(field, options),\n defaultValue: valueFromAST(field.defaultValue, type),\n deprecationReason: getDeprecationReason(field),\n astNode: field\n };\n }\n }\n\n return inputFieldMap;\n }\n\n function buildEnumValueMap(nodes) {\n var enumValueMap = Object.create(null);\n\n for (var _i24 = 0; _i24 < nodes.length; _i24++) {\n var _node$values;\n\n var node = nodes[_i24];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var valuesNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : [];\n\n for (var _i26 = 0; _i26 < valuesNodes.length; _i26++) {\n var value = valuesNodes[_i26];\n enumValueMap[value.name.value] = {\n description: getDescription(value, options),\n deprecationReason: getDeprecationReason(value),\n astNode: value\n };\n }\n }\n\n return enumValueMap;\n }\n\n function buildInterfaces(nodes) {\n var interfaces = [];\n\n for (var _i28 = 0; _i28 < nodes.length; _i28++) {\n var _node$interfaces;\n\n var node = nodes[_i28];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var interfacesNodes = (_node$interfaces = node.interfaces) !== null && _node$interfaces !== void 0 ? _node$interfaces : [];\n\n for (var _i30 = 0; _i30 < interfacesNodes.length; _i30++) {\n var type = interfacesNodes[_i30];\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable\n // results.\n interfaces.push(getNamedType(type));\n }\n }\n\n return interfaces;\n }\n\n function buildUnionTypes(nodes) {\n var types = [];\n\n for (var _i32 = 0; _i32 < nodes.length; _i32++) {\n var _node$types;\n\n var node = nodes[_i32];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];\n\n for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {\n var type = typeNodes[_i34];\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable\n // results.\n types.push(getNamedType(type));\n }\n }\n\n return types;\n }\n\n function buildType(astNode) {\n var _typeExtensionsMap$na;\n\n var name = astNode.name.value;\n var description = getDescription(astNode, options);\n var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION:\n {\n var extensionASTNodes = extensionNodes;\n var allNodes = [astNode].concat(extensionASTNodes);\n return new GraphQLObjectType({\n name: name,\n description: description,\n interfaces: function interfaces() {\n return buildInterfaces(allNodes);\n },\n fields: function fields() {\n return buildFieldMap(allNodes);\n },\n astNode: astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n {\n var _extensionASTNodes = extensionNodes;\n\n var _allNodes = [astNode].concat(_extensionASTNodes);\n\n return new GraphQLInterfaceType({\n name: name,\n description: description,\n interfaces: function interfaces() {\n return buildInterfaces(_allNodes);\n },\n fields: function fields() {\n return buildFieldMap(_allNodes);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes\n });\n }\n\n case Kind.ENUM_TYPE_DEFINITION:\n {\n var _extensionASTNodes2 = extensionNodes;\n\n var _allNodes2 = [astNode].concat(_extensionASTNodes2);\n\n return new GraphQLEnumType({\n name: name,\n description: description,\n values: buildEnumValueMap(_allNodes2),\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes2\n });\n }\n\n case Kind.UNION_TYPE_DEFINITION:\n {\n var _extensionASTNodes3 = extensionNodes;\n\n var _allNodes3 = [astNode].concat(_extensionASTNodes3);\n\n return new GraphQLUnionType({\n name: name,\n description: description,\n types: function types() {\n return buildUnionTypes(_allNodes3);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes3\n });\n }\n\n case Kind.SCALAR_TYPE_DEFINITION:\n {\n var _extensionASTNodes4 = extensionNodes;\n return new GraphQLScalarType({\n name: name,\n description: description,\n specifiedByUrl: getSpecifiedByUrl(astNode),\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes4\n });\n }\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n {\n var _extensionASTNodes5 = extensionNodes;\n\n var _allNodes4 = [astNode].concat(_extensionASTNodes5);\n\n return new GraphQLInputObjectType({\n name: name,\n description: description,\n fields: function fields() {\n return buildInputFieldMap(_allNodes4);\n },\n astNode: astNode,\n extensionASTNodes: _extensionASTNodes5\n });\n }\n } // istanbul ignore next (Not reachable. All possible type definition nodes have been considered)\n\n\n false || invariant(0, 'Unexpected type definition node: ' + inspect(astNode));\n }\n}\nvar stdTypeMap = keyMap(specifiedScalarTypes.concat(introspectionTypes), function (type) {\n return type.name;\n});\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n */\n\nfunction getDeprecationReason(node) {\n var deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);\n return deprecated === null || deprecated === void 0 ? void 0 : deprecated.reason;\n}\n/**\n * Given a scalar node, returns the string value for the specifiedByUrl.\n */\n\n\nfunction getSpecifiedByUrl(node) {\n var specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);\n return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url;\n}\n/**\n * Given an ast node, returns its string description.\n * @deprecated: provided to ease adoption and will be removed in v16.\n *\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\n\n\nexport function getDescription(node, options) {\n if (node.description) {\n return node.description.value;\n }\n\n if ((options === null || options === void 0 ? void 0 : options.commentDescriptions) === true) {\n var rawValue = getLeadingCommentBlock(node);\n\n if (rawValue !== undefined) {\n return dedentBlockStringValue('\\n' + rawValue);\n }\n }\n}\n\nfunction getLeadingCommentBlock(node) {\n var loc = node.loc;\n\n if (!loc) {\n return;\n }\n\n var comments = [];\n var token = loc.startToken.prev;\n\n while (token != null && token.kind === TokenKind.COMMENT && token.next && token.prev && token.line + 1 === token.next.line && token.line !== token.prev.line) {\n var value = String(token.value);\n comments.push(value);\n token = token.prev;\n }\n\n return comments.length > 0 ? comments.reverse().join('\\n') : undefined;\n}\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { parse } from \"../language/parser.mjs\";\nimport { assertValidSDL } from \"../validation/validate.mjs\";\nimport { GraphQLSchema } from \"../type/schema.mjs\";\nimport { specifiedDirectives } from \"../type/directives.mjs\";\nimport { extendSchemaImpl } from \"./extendSchema.mjs\";\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * src/language/parser.js.\n *\n * If no schema definition is provided, then it will look for types named Query\n * and Mutation.\n *\n * Given that AST it constructs a GraphQLSchema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n *\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function buildASTSchema(documentAST, options) {\n documentAST != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.');\n\n if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) {\n assertValidSDL(documentAST);\n }\n\n var emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: undefined,\n extensionASTNodes: [],\n assumeValid: false\n };\n var config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n config.query = type;\n break;\n\n case 'Mutation':\n config.mutation = type;\n break;\n\n case 'Subscription':\n config.subscription = type;\n break;\n }\n }\n }\n\n var directives = config.directives; // If specified directives were not explicitly declared, add them.\n\n var _loop = function _loop(_i4) {\n var stdDirective = specifiedDirectives[_i4];\n\n if (directives.every(function (directive) {\n return directive.name !== stdDirective.name;\n })) {\n directives.push(stdDirective);\n }\n };\n\n for (var _i4 = 0; _i4 < specifiedDirectives.length; _i4++) {\n _loop(_i4);\n }\n\n return new GraphQLSchema(config);\n}\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n */\n\nexport function buildSchema(source, options) {\n var document = parse(source, {\n noLocation: options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields,\n allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces,\n experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables\n });\n return buildASTSchema(document, {\n commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions,\n assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid\n });\n}\n","import { TypeCacheControlExtension } from '@conduit-client/model/v1';\nimport {\n GraphQLSchema,\n isNonNullType,\n isListType,\n isScalarType,\n isObjectType,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isInputObjectType,\n GraphQLType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLInputObjectType,\n GraphQLField,\n GraphQLInputField,\n GraphQLUnionType,\n GraphQLEnumType,\n} from 'graphql';\n\n// Metadata types for different GraphQL type categories\nexport type BaseGraphQLTypeMetadata = {\n typename: string;\n};\n\nexport type IdentifiableGraphQLTypeMetadata = BaseGraphQLTypeMetadata & {\n 'cache-control': TypeCacheControlExtension;\n};\n\nexport type RootGraphQLTypeMetadata = BaseGraphQLTypeMetadata & {\n 'cache-control': TypeCacheControlExtension;\n};\n\nexport type UnidentifiableGraphQLTypeMetadata = BaseGraphQLTypeMetadata;\n\nexport type CursorConnectionGraphQLTypeMetadata = BaseGraphQLTypeMetadata;\n\n// Union type for all possible metadata configurations\nexport type GraphQLTypeMetadata =\n | IdentifiableGraphQLTypeMetadata\n | UnidentifiableGraphQLTypeMetadata\n | CursorConnectionGraphQLTypeMetadata\n | RootGraphQLTypeMetadata;\n\nexport type GraphQLTypeCategory = 'unidentifiable' | 'identifiable' | 'cursor-connection' | 'root';\n\nexport type GraphQLSingleFieldType = {\n kind: 'single';\n name: string;\n typename: string;\n nullable: boolean;\n};\n\nexport type GraphQLListFieldType = {\n kind: 'list';\n nullable: boolean;\n items: GraphQLSingleFieldType | GraphQLListFieldType;\n};\n\nexport type GraphQLFieldType = {\n type: GraphQLSingleFieldType | GraphQLListFieldType;\n args?: Record<string, GraphQLArgumentType>;\n description?: string | null;\n};\n\ntype GraphQLArgumentType = {\n type: GraphQLSingleFieldType | GraphQLListFieldType;\n defaultValue?: any;\n description?: string | null;\n};\nexport type GraphQLBaseTypeModel =\n | {\n name: string;\n category: 'unidentifiable';\n metadata?: UnidentifiableGraphQLTypeMetadata;\n }\n | {\n name: string;\n category: 'cursor-connection';\n metadata?: CursorConnectionGraphQLTypeMetadata;\n }\n | {\n name: string;\n category: 'identifiable';\n metadata: IdentifiableGraphQLTypeMetadata;\n idField: string;\n }\n | {\n name: string;\n category: 'root';\n metadata: RootGraphQLTypeMetadata;\n };\n\nexport type GraphQLObjectTypeModel = {\n kind: 'object';\n fields: Record<string, GraphQLFieldType>;\n interfaces?: string[];\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLUnionTypeModel = {\n kind: 'union';\n fields: Record<string, GraphQLFieldType>;\n possibleTypes: GraphQLTypeModel[];\n} & GraphQLBaseTypeModel;\n\ntype GraphQLEnumValueModel = {\n name: string;\n value: number;\n description?: string | null;\n};\nexport type GraphQLEnumTypeModel = {\n kind: 'enum';\n values: Record<string, GraphQLEnumValueModel>;\n} & GraphQLBaseTypeModel;\n\ntype GraphQLInputObjectTypeModel = {\n kind: 'input';\n fields: Record<string, GraphQLFieldType>;\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLInterfaceTypeModel = {\n kind: 'interface';\n fields: Record<string, GraphQLFieldType>;\n possibleTypes: GraphQLTypeModel[];\n} & GraphQLBaseTypeModel;\n\nexport type GraphQLTypeModel =\n | GraphQLObjectTypeModel\n | GraphQLUnionTypeModel\n | GraphQLEnumTypeModel\n | GraphQLInputObjectTypeModel\n | GraphQLInterfaceTypeModel;\nexport interface GraphQLSchemaModel {\n types: GraphQLTypeModel[];\n queryTypeName: string;\n mutationTypeName?: string;\n}\n\nconst BASE_FIELDS: Record<string, GraphQLFieldType> = {\n __typename: {\n type: {\n kind: 'single',\n name: '__typename',\n typename: 'String',\n nullable: false,\n },\n },\n};\n\n/**\n * Validates that the provided type metadata is valid for the given GraphQL schema.\n * Ensures that:\n * - All identifiable types have cache-control metadata\n * - All referenced typenames exist in the schema\n * - Metadata matches the expected category for each type\n */\nexport function validateGraphQLSchemaModel(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>,\n rootTypeNames: string[],\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n validateTypeMetadata(typeMap, metadataByTypename, rootTypeNames, defaults);\n checkForUnknownTypes(typeMap, metadataByTypename);\n}\n\n/**\n * Helper function to check if a type requires cache-control metadata\n */\nfunction requiresCacheControl(type: GraphQLType, rootTypeNames: string[]): boolean {\n if (!isObjectType(type)) {\n return false;\n }\n\n const isIdentifiable = !!getOutputIdField(type);\n const isRootType = rootTypeNames.includes(type.name);\n\n return isIdentifiable || isRootType;\n}\n\n/**\n * Helper function to check if cache-control metadata is properly configured\n */\nfunction hasCacheControlMetadata(metadata: GraphQLTypeMetadata | undefined): boolean {\n return metadata !== undefined && 'cache-control' in metadata;\n}\n\n/**\n * Validates individual type definitions in the schema\n */\nfunction validateTypeMetadata(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>,\n rootTypeNames: string[],\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n for (const [typeName, type] of Object.entries(typeMap)) {\n const metadata = metadataByTypename.get(typeName);\n\n if (requiresCacheControl(type, rootTypeNames)) {\n validateCacheControl(typeName, metadata, defaults);\n continue;\n }\n\n validateNonCacheControlType(typeName, metadata);\n }\n}\n\n/**\n * Validates that types requiring cache-control have it configured\n */\nfunction validateCacheControl(\n typeName: string,\n metadata: GraphQLTypeMetadata | undefined,\n defaults?: Partial<TypeCacheControlExtension>\n): void {\n if (hasCacheControlMetadata(metadata)) {\n return; // Valid: has explicit cache-control metadata\n }\n\n if (defaults) {\n return; // Valid: will use defaults\n }\n\n throw new Error(\n `GraphQL type '${typeName}' requires cache-control metadata but none was provided. ` +\n `Either provide cache-control metadata for this type or set a default cache-control configuration.`\n );\n}\n\n/**\n * Validates that types not requiring cache-control don't have it configured\n */\nfunction validateNonCacheControlType(\n typeName: string,\n metadata: GraphQLTypeMetadata | undefined\n): void {\n if (hasCacheControlMetadata(metadata)) {\n throw new Error(\n `GraphQL type '${typeName}' is not identifiable but metadata includes 'cache-control' property.`\n );\n }\n}\n\n/**\n * Validates that all metadata references exist in the schema\n */\nfunction checkForUnknownTypes(\n typeMap: Record<string, GraphQLType>,\n metadataByTypename: Map<string, GraphQLTypeMetadata>\n): void {\n for (const [typename, metadata] of metadataByTypename) {\n if (!typeMap[typename]) {\n throw new Error(`Metadata references unknown GraphQL type '${metadata.typename}'.`);\n }\n }\n}\n\nfunction buildFieldsFromType(\n type: GraphQLObjectType | GraphQLInterfaceType\n): Record<string, GraphQLFieldType> {\n return {\n ...BASE_FIELDS,\n ...Object.fromEntries(\n Object.entries(type.getFields()).map(([fieldName, field]) => [\n fieldName,\n getFieldInfo(field),\n ])\n ),\n };\n}\n\nexport function isRelayConnectionType(type: GraphQLObjectType): boolean {\n const fields = type.getFields();\n\n // Check for required fields\n if (!fields.edges || !fields.pageInfo) {\n return false;\n }\n\n // Check edges type structure\n const edgesType = fields.edges.type;\n if (!edgesType || !('ofType' in edgesType)) {\n return false;\n }\n\n const edgeType = edgesType.ofType;\n if (!edgeType || !('getFields' in edgeType)) {\n return false;\n }\n\n const edgeFields = edgeType.getFields();\n if (!edgeFields.node || !edgeFields.cursor) {\n return false;\n }\n\n // Check pageInfo type structure\n const pageInfoType = fields.pageInfo.type;\n if (!pageInfoType || !('getFields' in pageInfoType)) {\n return false;\n }\n\n const pageInfoFields = pageInfoType.getFields();\n return Boolean(\n pageInfoFields.hasNextPage &&\n pageInfoFields.hasPreviousPage &&\n pageInfoFields.startCursor &&\n pageInfoFields.endCursor\n );\n}\n\nexport function unwrapFieldType(type: GraphQLType): GraphQLSingleFieldType | GraphQLListFieldType {\n let currentType = type;\n let nullable = true;\n\n if (isNonNullType(currentType)) {\n nullable = false;\n currentType = currentType.ofType;\n }\n\n if (isListType(currentType)) {\n return {\n kind: 'list',\n nullable,\n items: unwrapFieldType(currentType.ofType),\n };\n }\n\n return {\n kind: 'single',\n name: currentType.name,\n typename: currentType.toString(),\n nullable,\n };\n}\n\nexport function getFieldInfo(field: GraphQLField<any, any>): GraphQLFieldType {\n const fieldType = unwrapFieldType(field.type);\n const args: Record<string, GraphQLArgumentType> = {};\n\n // Process field arguments\n if (field.args && field.args.length > 0) {\n for (const arg of field.args) {\n args[arg.name] = {\n type: unwrapFieldType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n };\n }\n }\n\n return {\n type: fieldType,\n args: Object.keys(args).length > 0 ? args : undefined,\n description: field.description,\n };\n}\n\nexport function getInputFieldInfo(field: GraphQLInputField): GraphQLFieldType {\n const fieldType = unwrapFieldType(field.type);\n\n return {\n type: fieldType,\n description: field.description,\n };\n}\n\nfunction getPossibleTypes(\n possibleTypes: readonly GraphQLObjectType[],\n types: GraphQLTypeModel[]\n): GraphQLTypeModel[] {\n const possibleTypeModels: GraphQLTypeModel[] = [];\n\n possibleTypes.forEach((t) => {\n const implementation = types.find((concreteType) => concreteType.name === t.name);\n if (implementation) {\n possibleTypeModels.push(implementation);\n } else {\n throw new Error(`Unknown type ${t.name}`);\n }\n });\n\n return possibleTypeModels;\n}\n\nexport function getOutputIdField(\n type: GraphQLObjectType | GraphQLInterfaceType\n): string | undefined {\n const idFields = Object.values(type.getFields())\n .filter((field) => {\n const typeString = field.type.toString();\n return (\n (typeString === 'ID' || typeString === 'ID!') && field.name.toLowerCase() === 'id'\n );\n })\n .map((field) => field.name);\n\n if (idFields.length > 1) {\n throw new Error(`Multiple ID fields found for type ${type.name}`);\n }\n\n return idFields.length > 0 ? idFields[0] : undefined;\n}\n\nexport function getInputIdField(type: GraphQLInputObjectType): string | undefined {\n const idFields = Object.values(type.getFields())\n .filter((field) => {\n const typeString = field.type.toString();\n return (\n (typeString === 'ID' || typeString === 'ID!') && field.name.toLowerCase() === 'id'\n );\n })\n .map((field) => field.name);\n\n if (idFields.length > 1) {\n throw new Error(`Multiple ID fields found for type ${type.name}`);\n }\n\n return idFields.length > 0 ? idFields[0] : undefined;\n}\n\nfunction setCacheControl(\n metadata: GraphQLTypeMetadata | undefined,\n defaults?: Partial<TypeCacheControlExtension>\n): TypeCacheControlExtension | void {\n // Check if metadata has cache-control (type narrowing)\n if (metadata && 'cache-control' in metadata) {\n const explicitCacheControl = metadata['cache-control'];\n\n if (explicitCacheControl.type === 'no-cache') {\n // For no-cache, only use explicit values (no merging with defaults)\n return explicitCacheControl;\n } else {\n // For other types, merge defaults with explicit values\n return {\n ...defaults,\n ...explicitCacheControl,\n } as TypeCacheControlExtension;\n }\n } else if (defaults) {\n // Use defaults if no explicit metadata\n return defaults as TypeCacheControlExtension;\n }\n}\n\nfunction buildGraphQLObjectModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLObjectType,\n isRootType: boolean,\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLObjectTypeModel {\n const fields = buildFieldsFromType(type);\n const interfaces = type.getInterfaces().map((i) => i.name);\n\n if (isRelayConnectionType(type)) {\n const connectionMetadata: CursorConnectionGraphQLTypeMetadata = metadata || {\n typename: name,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'cursor-connection',\n metadata: connectionMetadata,\n };\n }\n\n const idField = getOutputIdField(type);\n if (idField || isRootType) {\n // For identifiable types, ensure cache-control is defined\n let cacheControl: TypeCacheControlExtension | void = setCacheControl(metadata, defaults);\n if (idField) {\n if (cacheControl) {\n const identifiableMetadata: IdentifiableGraphQLTypeMetadata = {\n typename: name,\n 'cache-control': cacheControl,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'identifiable',\n idField,\n metadata: identifiableMetadata,\n };\n }\n // No cache-control defined and no default - throw error\n throw new Error(\n `Identifiable GraphQL type '${name}' must have cache-control metadata defined. ` +\n `Either provide cache-control metadata for this type or set a default cache-control configuration.`\n );\n } else if (cacheControl) {\n // Otherwise we don't throw, but fall through to the unidentifiable case\n const rootMetadata: RootGraphQLTypeMetadata = {\n typename: name,\n 'cache-control': cacheControl,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'root',\n metadata: rootMetadata,\n };\n }\n }\n\n const unidentifiableMetadata: UnidentifiableGraphQLTypeMetadata = metadata || {\n typename: name,\n };\n\n return {\n kind: 'object' as const,\n name,\n fields,\n interfaces,\n category: 'unidentifiable',\n metadata: unidentifiableMetadata,\n };\n}\n\nfunction buildGraphQLInputObjectModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLInputObjectType,\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLInputObjectTypeModel {\n const fields: Record<string, GraphQLFieldType> = {};\n for (const [fieldName, field] of Object.entries(type.getFields())) {\n fields[fieldName] = getInputFieldInfo(field);\n }\n\n const baseInputObjectModel = {\n kind: 'input' as const,\n name,\n metadata,\n fields,\n };\n\n return {\n ...baseInputObjectModel,\n category: 'unidentifiable',\n };\n}\n\nfunction buildGraphQLInterfaceModel(\n name: string,\n metadata: BaseGraphQLTypeMetadata | undefined,\n type: GraphQLInterfaceType,\n types: GraphQLTypeModel[],\n schema: GraphQLSchema\n): GraphQLInterfaceTypeModel {\n const fields = buildFieldsFromType(type);\n const possibleTypes = getPossibleTypes(schema.getImplementations(type).objects, types);\n return {\n kind: 'interface' as const,\n category: 'unidentifiable',\n name,\n metadata,\n fields,\n possibleTypes,\n };\n}\n\nfunction buildGraphQLUnionModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLUnionType,\n types: GraphQLTypeModel[]\n): GraphQLUnionTypeModel {\n const possibleTypes = getPossibleTypes(type.getTypes(), types);\n // Union Types have __typename field, but no other fields\n const fields = {\n ...BASE_FIELDS,\n };\n\n return {\n kind: 'union' as const,\n fields,\n name,\n metadata,\n possibleTypes,\n category: 'unidentifiable',\n };\n}\n\nfunction buildGraphQLEnumModel(\n name: string,\n metadata: GraphQLTypeMetadata | undefined,\n type: GraphQLEnumType\n): GraphQLEnumTypeModel {\n const values: Record<string, GraphQLEnumValueModel> = {};\n for (const [name, value] of Object.entries(type.getValues())) {\n values[name] = {\n name: value.name,\n value: value.value,\n description: value.description,\n };\n }\n\n return {\n kind: 'enum' as const,\n name,\n metadata,\n values,\n category: 'unidentifiable',\n };\n}\n\nexport function buildGraphQLSchemaModel(\n schema: GraphQLSchema,\n typeMetadata: GraphQLTypeMetadata[] = [],\n defaults?: Partial<TypeCacheControlExtension>\n): GraphQLSchemaModel {\n const typeMap = schema.getTypeMap();\n const types: GraphQLTypeModel[] = [];\n const metadataByTypename = new Map(typeMetadata.map((m) => [m.typename, m]));\n const queryTypeName = schema.getQueryType()?.name;\n const mutationTypeName = schema.getMutationType()?.name;\n\n // First resolve all the concrete types (objects and enums)\n for (const [name, type] of Object.entries(typeMap)) {\n // Skip internal types and scalars and ignore interfaces and unions for now\n if (\n name.startsWith('__') ||\n isScalarType(type) ||\n isInterfaceType(type) ||\n isUnionType(type)\n ) {\n continue;\n }\n const metadata = metadataByTypename.get(name);\n\n if (isObjectType(type)) {\n types.push(\n buildGraphQLObjectModel(\n name,\n metadata,\n type,\n type.name === queryTypeName || type.name === mutationTypeName,\n defaults\n )\n );\n } else if (isInputObjectType(type)) {\n types.push(buildGraphQLInputObjectModel(name, metadata, type, defaults));\n } else if (isEnumType(type)) {\n types.push(buildGraphQLEnumModel(name, metadata, type));\n }\n }\n\n // Next resolve all the interfaces and unions\n for (const [name, type] of Object.entries(typeMap)) {\n // Skip internal types and scalars and ignore objects and input objects\n if (name.startsWith('__') || isObjectType(type) || isInputObjectType(type)) {\n continue;\n }\n const metadata = metadataByTypename.get(name);\n if (isInterfaceType(type)) {\n types.push(buildGraphQLInterfaceModel(name, metadata, type, types, schema));\n } else if (isUnionType(type)) {\n types.push(buildGraphQLUnionModel(name, metadata, type, types));\n }\n }\n\n if (!queryTypeName) {\n throw new Error('No query type found in schema');\n }\n // Validate metadata before returning the model\n const rootTypeNames = [queryTypeName];\n if (mutationTypeName) {\n rootTypeNames.push(mutationTypeName);\n }\n validateGraphQLSchemaModel(typeMap, metadataByTypename, rootTypeNames, defaults);\n\n return {\n types,\n queryTypeName,\n mutationTypeName,\n };\n}\n","import { buildSchema } from 'graphql';\nimport { GraphQLSchemaModel, buildGraphQLSchemaModel } from './graphql-schema-model';\nimport { resolve } from 'path';\nimport { readFileSync } from 'fs';\nimport { AuraNormalizedCachingCommandModel } from './aura-normalized-caching-command-model';\nimport { AuraGraphQLOperation } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { IGraphQLCommandModel } from './graphql-command-model-interface';\n\nconst AURA_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'AuraGraphQLNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_AURA_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'NamedAuraGraphQLNormalizedCacheControlCommand',\n isType: true,\n};\n\nexport class AuraGraphQLCommandModel\n extends AuraNormalizedCachingCommandModel\n implements IGraphQLCommandModel\n{\n private schemaModel?: GraphQLSchemaModel;\n\n constructor(operation: AuraGraphQLOperation) {\n super(operation);\n }\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n // Override the base class to use GraphQL-specific command service\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: AURA_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_AURA_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'auraGraphQLNormalizedCacheControlCommand',\n serviceName: 'auraGraphQLNormalizedCacheControlCommand',\n };\n\n return deps;\n }\n\n get schema(): GraphQLSchemaModel {\n const graphQLOperation = this.operation as AuraGraphQLOperation;\n if (!this.schemaModel) {\n const config = graphQLOperation.graphqlConfig;\n const schemaPath = resolve(graphQLOperation.basePath, config.schemaFilePath);\n const schemaContent = readFileSync(schemaPath, 'utf-8');\n const graphqlSchema = buildSchema(schemaContent);\n\n // Access defaults from the operation's endpoint API\n const apiDefaults = this.operation.defaults.typeCacheControl;\n this.schemaModel = buildGraphQLSchemaModel(\n graphqlSchema,\n config['type-metadata'],\n apiDefaults\n );\n }\n return this.schemaModel;\n }\n}\n","import { buildSchema } from 'graphql';\nimport { GraphQLSchemaModel, buildGraphQLSchemaModel } from './graphql-schema-model';\nimport { resolve } from 'path';\nimport { readFileSync } from 'fs';\nimport { HttpNormalizedCachingCommandModel } from './http-normalized-caching-command-model';\nimport { HttpGraphQLOperation } from '@conduit-client/model/v1';\nimport type { ImportableReference } from '../files';\nimport type { IGraphQLCommandModel } from './graphql-command-model-interface';\n\nconst HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR: ImportableReference = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'HttpGraphQLNormalizedCacheControlCommandServiceDescriptor',\n isType: true,\n};\n\nconst NAMED_HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE: ImportableReference = {\n module: '@conduit-client/command-http-graphql-normalized-cache-control/v1',\n exportedSymbol: 'NamedHttpGraphQLNormalizedCacheControlCommand',\n isType: true,\n};\n\nexport class HttpGraphQLCommandModel\n extends HttpNormalizedCachingCommandModel\n implements IGraphQLCommandModel\n{\n private schemaModel?: GraphQLSchemaModel;\n\n constructor(operation: HttpGraphQLOperation) {\n super(operation);\n }\n\n get serviceDependencies() {\n const deps = super.serviceDependencies;\n\n // Override the base class to use GraphQL-specific command service\n deps.baseClass = {\n version: '1.0' as const,\n descriptor: HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR,\n namedService: NAMED_HTTP_GRAPHQL_CACHE_CONTROL_COMMAND_SERVICE,\n localName: 'httpGraphQLNormalizedCacheControlCommand',\n serviceName: 'httpGraphQLNormalizedCacheControlCommand',\n };\n\n return deps;\n }\n\n get schema(): GraphQLSchemaModel {\n const graphQLOperation = this.operation as HttpGraphQLOperation;\n\n if (!this.schemaModel) {\n const config = graphQLOperation.graphqlConfig;\n const schemaPath = resolve(graphQLOperation.basePath, config.schemaFilePath);\n const schemaContent = readFileSync(schemaPath, 'utf-8');\n const graphqlSchema = buildSchema(schemaContent);\n\n // Access defaults from the operation's endpoint API\n const apiDefaults = this.operation.defaults.typeCacheControl;\n\n this.schemaModel = buildGraphQLSchemaModel(\n graphqlSchema,\n config['type-metadata'],\n apiDefaults\n );\n }\n return this.schemaModel;\n }\n}\n","import { type ImportableReference } from '../files';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport { NormalizedCacheControlGeneratorMixin } from './normalized-cache-control-generator-mixin';\nimport { GraphQLNormalizedCacheControlGeneratorMixin } from './graphql-normalized-cache-control-generator-mixin';\n\nconst AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS = {\n module: '@conduit-client/command-aura-graphql-normalized-cache-control/v1',\n exportedSymbol: 'AuraGraphQLNormalizedCacheControlCommand',\n isType: true,\n} as const satisfies ImportableReference;\n\n// First apply the normalized cache control mixin to AuraCommandGenerator\nconst AuraNormalizedCacheControlCommandGenerator = NormalizedCacheControlGeneratorMixin(\n AuraCommandGenerator,\n AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n);\n\n// Then apply the GraphQL mixin to the normalized cache control generator\nexport const AuraGraphQLNormalizedCacheControlCommandGenerator =\n GraphQLNormalizedCacheControlGeneratorMixin(\n AuraNormalizedCacheControlCommandGenerator,\n AURA_GRAPHQL_NORMALIZED_CACHE_CONTROL_COMMAND_BASE_CLASS\n );\n","import { AuraCommandModel } from '../model/aura-command-model';\nimport { HttpCommandModel } from '../model/http-command-model';\nimport { AuraNormalizedCachingCommandModel } from '../model/aura-normalized-caching-command-model';\nimport { AuraResourceCachingCommandModel } from '../model/aura-resource-caching-command-model';\nimport { AuraNormalizedCacheControlCommandGenerator } from './aura-normalized-cache-control-command-generator';\nimport { AuraResourceCacheControlCommandGenerator } from './aura-resource-cache-control-command-generator';\nimport { HttpCommandGenerator } from './http-command-generator';\nimport { BindingsGenerator, type IBindingsGenerator } from './bindings-generator';\nimport { AuraCommandGenerator } from './aura-command-generator';\nimport type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';\nimport type { NamedFileService } from '../files';\nimport type { NamedAPIService, Operation } from '@conduit-client/model/v1';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';\nimport type { ICommandModel } from '../model/base-command-model';\nimport type { ICommandGenerator } from './base-command-generator';\nimport { HttpNormalizedCacheControlCommandGenerator } from './http-normalized-cache-control-command-generator';\nimport { HttpNormalizedCachingCommandModel } from '../model/http-normalized-caching-command-model';\nimport { AuraGraphQLCommandModel } from '../model/aura-graphql-command-model';\nimport { HttpGraphQLCommandModel } from '../model/http-graphql-command-model';\nimport { AuraGraphQLNormalizedCacheControlCommandGenerator } from './aura-graphql-normalized-cache-control-command-generator';\nimport { HttpGraphQLNormalizedCacheControlCommandGenerator } from './http-graphql-normalized-cache-control-command-generator';\n\nexport function defaultCommandModelFactory(operation: Operation): ICommandModel {\n let commandModel;\n if (operation.endpoint.type === 'aura') {\n if (operation.operationType === 'graphql') {\n commandModel = AuraGraphQLCommandModel;\n } else if (operation.cacheStrategy.type === 'none') {\n commandModel = AuraCommandModel;\n } else if (operation.cacheStrategy.type === 'normalized') {\n commandModel = AuraNormalizedCachingCommandModel;\n } else if (operation.cacheStrategy.type === 'resource') {\n commandModel = AuraResourceCachingCommandModel;\n } else {\n throw new Error(\n `Unknown Aura cache strategy type ${(operation.cacheStrategy as any).type}. Must be 'none', 'resource' or 'normalized'`\n );\n }\n } else {\n if (operation.operationType === 'graphql') {\n commandModel = HttpGraphQLCommandModel;\n } else if (operation.cacheStrategy.type === 'none') {\n commandModel = HttpCommandModel;\n } else if (operation.cacheStrategy.type === 'normalized') {\n commandModel = HttpNormalizedCachingCommandModel;\n } else {\n throw new Error(\n `Unknown HTTP cache strategy type ${operation.cacheStrategy.type}. Must be 'none' or 'normalized'`\n );\n }\n }\n\n return new commandModel(operation);\n}\n\nexport function defaultCommandGeneratorFactory(\n commandModel: ICommandModel,\n services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n) {\n if (commandModel.transportType === 'aura') {\n if (commandModel.cacheStrategy.type === 'none') {\n return new AuraCommandGenerator(commandModel, services);\n } else if (commandModel.cacheStrategy.type === 'normalized') {\n if (commandModel.operationType === 'graphql') {\n return new AuraGraphQLNormalizedCacheControlCommandGenerator(\n commandModel,\n services\n );\n } else {\n return new AuraNormalizedCacheControlCommandGenerator(commandModel, services);\n }\n } else {\n return new AuraResourceCacheControlCommandGenerator(commandModel, services);\n }\n }\n\n if (commandModel.cacheStrategy.type === 'none') {\n return new HttpCommandGenerator(commandModel, services);\n } else if (commandModel.cacheStrategy.type === 'normalized') {\n if (commandModel.operationType === 'graphql') {\n return new HttpGraphQLNormalizedCacheControlCommandGenerator(commandModel, services);\n } else {\n return new HttpNormalizedCacheControlCommandGenerator(commandModel, services);\n }\n }\n\n throw new Error('Unknown command configuration');\n}\n\nexport function defaultBindingsGeneratorFactory(\n commandModels: ICommandModel[],\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n): IBindingsGenerator {\n return new BindingsGenerator(services, commandModels);\n}\n\nexport interface IApiFamilyModuleGenerator {\n build(): void;\n buildModels(): ICommandModel[];\n generateCommands(commandModels: ICommandModel[]): void;\n generateBindings(commandModels: ICommandModel[]): void;\n}\n\n/**\n * Class responsible for generating modules based on provided services and factories for commands and bindings.\n *\n * The `ModuleGenerator` class aggregates service interfaces and factory functions for creating command models,\n * command generators, and bindings generators. It uses these components to build modules by processing API\n * operations, generating necessary commands, and binding them into a coherent module structure.\n *\n * The general pattern for generating module code should, by convention, be:\n * 1. Transform the API model service into more targeted models for code generation\n * 2. Use those code generation models in the generator classes to populate a file template\n *\n * API operations map one to one with OneStore commands, and bindings sit on top of all commands, exposing the\n * interface to be consumed by a user, e.g. a component.\n *\n * @property {NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedJSONSchemaDeclarationService} services - Composite object providing essential services like API, File, Type Definition, and JSON Schema Declaration services.\n * @property {(op: Operation) => ICommandModel} commandModelFactory - Factory function to create command models from operations. Defaults to `defaultCommandModelFactory` if not provided.\n * @property {(op: Operation, commandModel: ICommandModel, services: NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService) => ICommandGenerator} commandGeneratorFactory - Factory function to create command generators. Takes an operation, a command model, and services. Defaults to `defaultCommandGeneratorFactory` if not provided.\n * @property {(commandModels: ICommandModel[], services: NamedFileService & NamedTypeDefinitionService) => IBindingsGenerator} bindingsGeneratorFactory - Factory function to create bindings generators from command models and services. Defaults to `defaultBindingsGeneratorFactory` if not provided.\n */\nexport class ApiFamilyModuleGenerator implements IApiFamilyModuleGenerator {\n constructor(\n protected services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedJSONSchemaDeclarationService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService,\n protected commandModelFactory: (\n op: Operation\n ) => ICommandModel = defaultCommandModelFactory,\n protected commandGeneratorFactory: (\n commandModel: ICommandModel,\n services: NamedAPIService &\n NamedFileService &\n NamedJSONSchemaDeclarationService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n ) => ICommandGenerator = defaultCommandGeneratorFactory,\n protected bindingsGeneratorFactory: (\n commandModels: ICommandModel[],\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n ) => IBindingsGenerator = defaultBindingsGeneratorFactory\n ) {}\n\n /**\n * Builds the module by processing all operations defined in the API service.\n * This method iterates through each endpoint and operation, uses the command model factory to generate command models,\n * then generates commands with the command generator factory, and finally builds bindings using the bindings generator factory.\n */\n build() {\n const commandModels = this.buildModels();\n this.generateCommands(commandModels);\n this.generateBindings(commandModels);\n }\n\n buildModels() {\n const commandModels: ICommandModel[] = [];\n for (const endpoint of this.services.api.api.endpoints) {\n for (const operation of endpoint.operations) {\n const commandModel = this.commandModelFactory(operation);\n commandModels.push(commandModel);\n }\n }\n return commandModels;\n }\n\n generateCommands(commandModels: ICommandModel[]) {\n commandModels.forEach((commandModel) => {\n this.commandGeneratorFactory(commandModel, this.services).build();\n });\n }\n\n generateBindings(commandModels: ICommandModel[]) {\n this.bindingsGeneratorFactory(commandModels, this.services).build();\n }\n}\n","import { ApiFamilyModuleGenerator, IApiFamilyModuleGenerator } from './generators';\nimport type { NamedLoggerService } from '@conduit-client/utils';\nimport type { NamedFileService } from './files';\nimport type { NamedAPIService } from '@conduit-client/model/v1';\nimport type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from './types';\nimport type { NamedTypeRegistryGeneratorService } from './normalization/type-registry-generator';\nimport type { NamedGraphQLTypeRegistryGeneratorService } from './normalization/graphql-type-registry-generator';\n\n/**\n * Creates a new instance of ModuleGenerator using a composite service object.\n *\n * This function takes an object that aggregates several named services essential for module generation.\n * It constructs and returns a new `ModuleGenerator` instance initialized with these services.\n *\n * @param {NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedLoggerService & NamedJSONSchemaDeclarationService} services - An object that must implement the required services\n * @returns {ModuleGenerator} A new `ModuleGenerator` instance configured with the provided services.\n */\nexport function apiFamilyModuleGeneratorService(\n services: NamedAPIService &\n NamedFileService &\n NamedTypeDefinitionService &\n NamedLoggerService &\n NamedJSONSchemaDeclarationService &\n NamedTypeRegistryGeneratorService &\n NamedGraphQLTypeRegistryGeneratorService\n) {\n return new ApiFamilyModuleGenerator(services);\n}\n\nexport type { IApiFamilyModuleGenerator };\n"],"names":["code","isType","block","isObjectType","isEnumType","isIdentifiableType","NAMED_CACHE_CONTROLLER_SERVICE","NAMED_PUB_SUB_SERVICE","TYPE_SERVICES","defaultGenerateType","itemType","additionalPropsCode","GRAPHQL_DATA","GRAPHQL_DOCUMENT_ROOT_TYPE_REPOSITORY","isInterfaceType","isUnionType","path","FETCH_RESPONSE","JSON_SCHEMA_TYPE","APPLY_DECORATORS","WIRE_ADAPTER_CONSTRUCTOR","NAMED_CACHE_CONTROL_SERVICE","CACHE_CONTROL_SERVICE_DESCRIPTOR","NAMED_PUBSUB_SERVICE","PUBSUB_SERVICE_DESCRIPTOR","NAMED_FETCH_NETWORK_COMMAND_SERVICE","members","getCacheControlValue","NAMED_AURA_NETWORK_SERVICE","NAMED_FETCH_SERVICE","HttpNormalizedCacheControlCommandGenerator","FETCH_SERVICE_DESCRIPTOR","AURA_CACHE_CONTROL_COMMAND_BASE_CLASS_DESCRIPTOR","NAMED_AURA_CACHE_CONTROL_COMMAND_SERVICE","AuraNormalizedCacheControlCommandGenerator","_typeof","obj","ownKeys","_objectSpread","_defineProperty","_defineProperties","_createClass","_wrapNativeSuper","Class","_construct","Parent","args","_setPrototypeOf","o","p","_getPrototypeOf","GraphQLError","loc","toString","toJSON","get","Location","Token","instanceOf","Source","indent","Lexer","Parser","item","fields","LexicalDistance","GraphQLScalarType","GraphQLObjectType","GraphQLInterfaceType","GraphQLUnionType","GraphQLEnumType","parseLiteral","GraphQLInputObjectType","isFinite","resolve","GraphQLDirective","GraphQLSchema","getPossibleTypes","NamedType","Directive","Field","Argument","ObjectField","ASTValid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AC,iBAAiB;AACpC,WAAK,wBAAwB,cAAc,KAAK,QAAQ,EAAE,MAAA;AAAA,IAC9D,CAAC;AAAA,EACL;AAAA,EAEA,iBAAiB,eAAgC;AAC7C,SAAK,yBAAyB,eAAe,KAAK,QAAQ,EAAE,MAAA;AAAA,EAChE;AACJ;AChLO,SAAS,gCACZ,UAOF;AACE,SAAO,IAAI,yBAAyB,QAAQ;AAChD;","x_google_ignoreList":[51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116]}
|