@nestbridge/core 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"nestbridge.core.js","sources":["../src/analysis/decorator-inspection.ts","../src/models/http-method.ts","../src/analysis/node-location.ts","../src/analysis/extract-parameter-definition.ts","../src/analysis/graphql-scalar-type.ts","../src/analysis/read-response-kind.ts","../src/analysis/route-path.ts","../src/analysis/extract-method-definition.ts","../src/analysis/extract-controller-definition.ts","../src/analysis/find-controller-classes.ts","../src/analysis/analyze-controllers.ts","../src/models/graphql-operation-kind.ts","../src/analysis/read-type-thunk-expression.ts","../src/analysis/read-args-type-option.ts","../src/analysis/extract-resolver-argument-definition.ts","../src/analysis/resolve-type-declaration.ts","../src/analysis/extract-selection-fields.ts","../src/analysis/read-graphql-operation-name.ts","../src/analysis/read-graphql-return-type-option.ts","../src/analysis/extract-resolver-method-definition.ts","../src/analysis/extract-resolver-definition.ts","../src/analysis/find-resolver-classes.ts","../src/analysis/analyze-resolvers.ts","../src/declarations/generate-controller-declaration.ts","../src/diagnostics/format-diagnostic.ts","../src/diagnostics/nestbridge-diagnostic-error.ts","../src/version.ts"],"sourcesContent":["import ts from 'typescript';\n\nexport const findDecorator = (\n node:\n | ts.ClassDeclaration\n | ts.MethodDeclaration\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration,\n decoratorName: string,\n) => {\n const decorators = ts.getDecorators(node);\n\n if (decorators === undefined) {\n return undefined;\n }\n\n return decorators.find((decorator) => decoratorNameOf(decorator) === decoratorName);\n};\n\nexport const findAnyDecorator = (\n node:\n | ts.ClassDeclaration\n | ts.MethodDeclaration\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration,\n decoratorNames: readonly string[],\n) => {\n const decorators = ts.getDecorators(node);\n\n if (decorators === undefined) {\n return undefined;\n }\n\n return decorators.find((decorator) => decoratorNames.includes(decoratorNameOf(decorator) ?? ''));\n};\n\nexport const decoratorNameOf = (decorator: ts.Decorator) => {\n const expression = decorator.expression;\n\n if (ts.isCallExpression(expression) && ts.isIdentifier(expression.expression)) {\n return expression.expression.text;\n }\n\n if (ts.isIdentifier(expression)) {\n return expression.text;\n }\n\n return undefined;\n};\n\nexport const readStaticStringArgument = (decorator: ts.Decorator) => {\n const expression = decorator.expression;\n\n if (!ts.isCallExpression(expression)) {\n return { ok: true, value: undefined };\n }\n\n const [firstArgument] = expression.arguments;\n\n if (firstArgument === undefined) {\n return { ok: true, value: undefined };\n }\n\n if (ts.isStringLiteralLike(firstArgument)) {\n return { ok: true, value: firstArgument.text };\n }\n\n return { ok: false, argumentText: firstArgument.getText() };\n};\n","export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport const HTTP_METHOD_DECORATOR_NAMES: Record<string, HttpMethod> = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Patch: 'PATCH',\n Delete: 'DELETE',\n};\n","import type ts from 'typescript';\n\nexport const locationOf = (sourceFile: ts.SourceFile, node: ts.Node) => {\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n return { line: line + 1, column: character + 1 };\n};\n","import ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { ControllerParameterDefinition } from '../models/controller-parameter-definition';\nimport {\n decoratorNameOf,\n findAnyDecorator,\n readStaticStringArgument,\n} from './decorator-inspection';\nimport { locationOf } from './node-location';\n\nconst SUPPORTED_PARAMETER_DECORATORS = ['Param', 'Query', 'Body', 'Headers'] as const;\nconst KNOWN_UNSUPPORTED_PARAMETER_DECORATORS = ['Req', 'Res', 'Request', 'Response'] as const;\n\ninterface ExtractionContext {\n sourceFile: ts.SourceFile;\n filePath: string;\n controllerName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractParameterDefinition = (\n parameter: ts.ParameterDeclaration,\n index: number,\n context: ExtractionContext,\n): ControllerParameterDefinition | undefined => {\n const decorator = findAnyDecorator(parameter, [\n ...SUPPORTED_PARAMETER_DECORATORS,\n ...KNOWN_UNSUPPORTED_PARAMETER_DECORATORS,\n ]);\n const location = locationOf(context.sourceFile, parameter);\n\n if (decorator === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `Parameter \"${parameter.name.getText()}\" must be decorated with one of @Param, @Query, @Body, or @Headers to be transported through a NestBridge HTTP client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const decoratorName = decoratorNameOf(decorator);\n\n if (\n decoratorName !== undefined &&\n (KNOWN_UNSUPPORTED_PARAMETER_DECORATORS as readonly string[]).includes(decoratorName)\n ) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `@${decoratorName}() cannot be transported through a NestBridge HTTP client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (!ts.isIdentifier(parameter.name)) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: 'Destructured parameters cannot be transported through a NestBridge HTTP client.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const argument = readStaticStringArgument(decorator);\n\n if (!argument.ok) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `@${decoratorName}() arguments must be statically analyzable string literals.`,\n found: `@${decoratorName}(${argument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const base = {\n index,\n parameterName: parameter.name.text,\n };\n\n if (decoratorName === 'Param') {\n if (argument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail:\n \"A whole @Param() is not supported; provide a route parameter name such as @Param('id').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n return { ...base, kind: 'param', name: argument.value };\n }\n\n if (decoratorName === 'Headers') {\n if (argument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail:\n \"A whole @Headers() is not supported; provide a header name such as @Headers('x-example').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n return { ...base, kind: 'header', name: argument.value };\n }\n\n if (decoratorName === 'Query') {\n return { ...base, kind: 'query', name: argument.value };\n }\n\n return { ...base, kind: 'body', name: argument.value };\n};\n","import ts from 'typescript';\n\nconst PRIMITIVE_SCALAR_TYPES: Record<string, string> = {\n string: 'String',\n number: 'Float',\n boolean: 'Boolean',\n};\n\nexport interface UnwrappedTypeNode {\n identifierText: string;\n isArray: boolean;\n isNullable: boolean;\n}\n\nexport const unwrapPromise = (typeNode: ts.TypeNode): ts.TypeNode => {\n if (\n ts.isTypeReferenceNode(typeNode) &&\n ts.isIdentifier(typeNode.typeName) &&\n typeNode.typeName.text === 'Promise' &&\n typeNode.typeArguments?.[0] !== undefined\n ) {\n return unwrapPromise(typeNode.typeArguments[0]);\n }\n\n return typeNode;\n};\n\nconst unwrapNullable = (typeNode: ts.TypeNode) => {\n if (!ts.isUnionTypeNode(typeNode)) {\n return { inner: typeNode, isNullable: false };\n }\n\n const nonNullMembers = typeNode.types.filter(\n (member) =>\n member.kind !== ts.SyntaxKind.NullKeyword && member.kind !== ts.SyntaxKind.UndefinedKeyword,\n );\n const [onlyMember] = nonNullMembers;\n\n if (nonNullMembers.length !== 1 || onlyMember === undefined) {\n return { inner: typeNode, isNullable: nonNullMembers.length !== typeNode.types.length };\n }\n\n return { inner: onlyMember, isNullable: true };\n};\n\nconst unwrapArrayElement = (typeNode: ts.TypeNode): ts.TypeNode | undefined => {\n if (ts.isArrayTypeNode(typeNode)) {\n return typeNode.elementType;\n }\n\n if (\n ts.isTypeReferenceNode(typeNode) &&\n ts.isIdentifier(typeNode.typeName) &&\n typeNode.typeName.text === 'Array' &&\n typeNode.typeArguments?.[0] !== undefined\n ) {\n return typeNode.typeArguments[0];\n }\n\n return undefined;\n};\n\nconst identifierTextOf = (typeNode: ts.TypeNode): string | undefined => {\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n\n switch (typeNode.kind) {\n case ts.SyntaxKind.StringKeyword:\n return 'string';\n case ts.SyntaxKind.NumberKeyword:\n return 'number';\n case ts.SyntaxKind.BooleanKeyword:\n return 'boolean';\n default:\n return undefined;\n }\n};\n\nexport const unwrapTypeNode = (typeNode: ts.TypeNode): UnwrappedTypeNode | undefined => {\n const withoutPromise = unwrapPromise(typeNode);\n const { inner: withoutNullable, isNullable } = unwrapNullable(withoutPromise);\n const arrayElement = unwrapArrayElement(withoutNullable);\n const element = arrayElement === undefined ? withoutNullable : unwrapNullable(arrayElement).inner;\n const identifierText = identifierTextOf(element);\n\n if (identifierText === undefined) {\n return undefined;\n }\n\n return { identifierText, isArray: arrayElement !== undefined, isNullable };\n};\n\nexport const graphqlScalarNameFor = (identifierText: string) =>\n PRIMITIVE_SCALAR_TYPES[identifierText] ?? identifierText;\n\nexport const graphqlTypeStringFor = (unwrapped: UnwrappedTypeNode, explicitTypeName?: string) => {\n const baseName = explicitTypeName ?? graphqlScalarNameFor(unwrapped.identifierText);\n const wrapped = unwrapped.isArray ? `[${baseName}!]` : baseName;\n return unwrapped.isNullable ? wrapped : `${wrapped}!`;\n};\n","import ts from 'typescript';\nimport type { ResponseKind } from '../models/response-kind';\nimport { unwrapPromise } from './graphql-scalar-type';\n\nconst OBSERVABLE_TYPE_NAME = 'Observable';\nconst STREAMABLE_FILE_TYPE_NAME = 'StreamableFile';\n\nexport const readResponseKind = (returnType: ts.TypeNode | undefined): ResponseKind => {\n if (returnType === undefined) {\n return 'json';\n }\n\n const unwrapped = unwrapPromise(returnType);\n\n if (!ts.isTypeReferenceNode(unwrapped) || !ts.isIdentifier(unwrapped.typeName)) {\n return 'json';\n }\n\n if (unwrapped.typeName.text === OBSERVABLE_TYPE_NAME) {\n return 'observable';\n }\n\n if (unwrapped.typeName.text === STREAMABLE_FILE_TYPE_NAME) {\n return 'stream';\n }\n\n return 'json';\n};\n","const trimSlashes = (segment: string) => segment.replace(/^\\/+/, '').replace(/\\/+$/, '');\n\nexport const joinRoutePath = (controllerPath: string, methodPath: string | undefined) => {\n const segments = [trimSlashes(controllerPath), trimSlashes(methodPath ?? '')].filter(\n (segment) => segment.length > 0,\n );\n\n return `/${segments.join('/')}`;\n};\n","import type ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { HTTP_METHOD_DECORATOR_NAMES } from '../models/http-method';\nimport {\n decoratorNameOf,\n findAnyDecorator,\n readStaticStringArgument,\n} from './decorator-inspection';\nimport { extractParameterDefinition } from './extract-parameter-definition';\nimport { locationOf } from './node-location';\nimport { readResponseKind } from './read-response-kind';\nimport { joinRoutePath } from './route-path';\n\ninterface ExtractionContext {\n sourceFile: ts.SourceFile;\n filePath: string;\n controllerName: string;\n controllerPath: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractMethodDefinition = (\n method: ts.MethodDeclaration,\n context: ExtractionContext,\n) => {\n const decorator = findAnyDecorator(method, Object.keys(HTTP_METHOD_DECORATOR_NAMES));\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const methodName = method.name.getText();\n const decoratorName = decoratorNameOf(decorator);\n const location = locationOf(context.sourceFile, method);\n\n if (decoratorName === undefined) {\n return undefined;\n }\n\n const httpMethod = HTTP_METHOD_DECORATOR_NAMES[decoratorName];\n\n if (httpMethod === undefined) {\n return undefined;\n }\n\n const routeArgument = readStaticStringArgument(decorator);\n\n if (!routeArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported route.',\n controllerName: context.controllerName,\n memberName: methodName,\n detail: 'Route paths must be statically analyzable.',\n found: `@${decoratorName}(${routeArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const parameters = method.parameters.map((parameter, index) =>\n extractParameterDefinition(parameter, index, {\n sourceFile: context.sourceFile,\n filePath: context.filePath,\n controllerName: context.controllerName,\n methodName,\n diagnostics: context.diagnostics,\n }),\n );\n\n if (parameters.some((parameter) => parameter === undefined)) {\n return undefined;\n }\n\n return {\n name: methodName,\n httpMethod,\n path: joinRoutePath(context.controllerPath, routeArgument.value),\n parameters: parameters.filter((parameter) => parameter !== undefined),\n responseKind: readResponseKind(method.type),\n line: location.line,\n column: location.column,\n };\n};\n","import ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { findDecorator, readStaticStringArgument } from './decorator-inspection';\nimport { extractMethodDefinition } from './extract-method-definition';\nimport { locationOf } from './node-location';\n\nexport const extractControllerDefinition = (\n classDeclaration: ts.ClassDeclaration,\n sourceFile: ts.SourceFile,\n filePath: string,\n diagnostics: NestBridgeDiagnostic[],\n) => {\n const controllerName = classDeclaration.name?.text ?? '(anonymous controller)';\n const decorator = findDecorator(classDeclaration, 'Controller');\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const location = locationOf(sourceFile, classDeclaration);\n const argument = readStaticStringArgument(decorator);\n\n if (!argument.ok) {\n diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported route.',\n controllerName,\n memberName: '',\n detail: 'Controller paths must be statically analyzable.',\n found: `@Controller(${argument.argumentText})`,\n filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const methods = classDeclaration.members\n .filter((member): member is ts.MethodDeclaration => ts.isMethodDeclaration(member))\n .map((method) =>\n extractMethodDefinition(method, {\n sourceFile,\n filePath,\n controllerName,\n controllerPath: argument.value ?? '',\n diagnostics,\n }),\n )\n .filter((method) => method !== undefined);\n\n return {\n name: controllerName,\n path: argument.value ?? '',\n sourceFile: filePath,\n methods,\n };\n};\n","import ts from 'typescript';\nimport { findDecorator } from './decorator-inspection';\n\nexport const findControllerClasses = (sourceFile: ts.SourceFile) => {\n return sourceFile.statements.filter(\n (statement): statement is ts.ClassDeclaration =>\n ts.isClassDeclaration(statement) && findDecorator(statement, 'Controller') !== undefined,\n );\n};\n","import { readFileSync } from 'node:fs';\nimport ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics';\nimport type { ControllerDefinition } from '../models';\nimport { extractControllerDefinition } from './extract-controller-definition';\nimport { findControllerClasses } from './find-controller-classes';\n\nexport const analyzeControllers = (filePaths: readonly string[]) => {\n const diagnostics: NestBridgeDiagnostic[] = [];\n const controllers: ControllerDefinition[] = [];\n\n for (const filePath of filePaths) {\n const content = readFileSync(filePath, 'utf-8');\n const sourceFile = ts.createSourceFile(\n filePath,\n content,\n ts.ScriptTarget.ESNext,\n true,\n ts.ScriptKind.TS,\n );\n\n for (const classDeclaration of findControllerClasses(sourceFile)) {\n const controller = extractControllerDefinition(\n classDeclaration,\n sourceFile,\n filePath,\n diagnostics,\n );\n\n if (controller !== undefined) {\n controllers.push(controller);\n }\n }\n }\n\n return { controllers, diagnostics };\n};\n","export type GraphqlOperationKind = 'query' | 'mutation';\n\nexport const GRAPHQL_OPERATION_DECORATOR_NAMES: Record<string, GraphqlOperationKind> = {\n Query: 'query',\n Mutation: 'mutation',\n};\n","import ts from 'typescript';\n\nexport const readTypeThunkExpression = (\n thunk: ts.ArrowFunction | ts.FunctionExpression,\n): ts.Expression | undefined => {\n if (!ts.isBlock(thunk.body)) {\n return thunk.body;\n }\n\n const returnStatement = thunk.body.statements.find(ts.isReturnStatement);\n return returnStatement?.expression;\n};\n","import ts from 'typescript';\nimport { readTypeThunkExpression } from './read-type-thunk-expression';\n\nexport interface ArgsTypeOption {\n typeName: string;\n isArray: boolean;\n}\n\nexport const readArgsTypeOption = (decorator: ts.Decorator): ArgsTypeOption | undefined => {\n if (!ts.isCallExpression(decorator.expression)) {\n return undefined;\n }\n\n const optionsArgument = decorator.expression.arguments.find(ts.isObjectLiteralExpression);\n\n if (optionsArgument === undefined) {\n return undefined;\n }\n\n const typeProperty = optionsArgument.properties.find(\n (property): property is ts.PropertyAssignment =>\n ts.isPropertyAssignment(property) &&\n ts.isIdentifier(property.name) &&\n property.name.text === 'type',\n );\n\n if (typeProperty === undefined) {\n return undefined;\n }\n\n const thunk = typeProperty.initializer;\n\n if (!ts.isArrowFunction(thunk) && !ts.isFunctionExpression(thunk)) {\n return undefined;\n }\n\n const returnedExpression = readTypeThunkExpression(thunk);\n\n if (returnedExpression === undefined) {\n return undefined;\n }\n\n if (ts.isArrayLiteralExpression(returnedExpression)) {\n const element = returnedExpression.elements[0];\n return element !== undefined && ts.isIdentifier(element)\n ? { typeName: element.text, isArray: true }\n : undefined;\n }\n\n return ts.isIdentifier(returnedExpression)\n ? { typeName: returnedExpression.text, isArray: false }\n : undefined;\n};\n","import ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { ResolverArgumentDefinition } from '../models/resolver-argument-definition';\nimport { findAnyDecorator, readStaticStringArgument } from './decorator-inspection';\nimport { graphqlTypeStringFor, unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { readArgsTypeOption } from './read-args-type-option';\n\ninterface ExtractionContext {\n sourceFile: ts.SourceFile;\n filePath: string;\n resolverName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractResolverArgumentDefinition = (\n parameter: ts.ParameterDeclaration,\n index: number,\n context: ExtractionContext,\n): ResolverArgumentDefinition | undefined => {\n const decorator = findAnyDecorator(parameter, ['Args']);\n const location = locationOf(context.sourceFile, parameter);\n\n if (decorator === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Parameter \"${parameter.name.getText()}\" must be decorated with @Args to be transported through a NestBridge GraphQL client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (!ts.isIdentifier(parameter.name)) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: 'Destructured parameters cannot be transported through a NestBridge GraphQL client.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const nameArgument = readStaticStringArgument(decorator);\n\n if (!nameArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: '@Args() name must be a statically analyzable string literal.',\n found: `@Args(${nameArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (nameArgument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: \"A whole @Args() is not supported; provide an argument name such as @Args('id').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (parameter.type === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `@Args() parameter \"${parameter.name.text}\" needs an explicit type annotation.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const unwrapped = unwrapTypeNode(parameter.type);\n\n if (unwrapped === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `@Args() parameter \"${parameter.name.text}\" has a type NestBridge cannot statically resolve to a GraphQL type.`,\n found: parameter.type.getText(),\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const explicitType = readArgsTypeOption(decorator);\n\n return {\n index,\n parameterName: parameter.name.text,\n name: nameArgument.value,\n graphqlType: graphqlTypeStringFor(unwrapped, explicitType?.typeName),\n };\n};\n","import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, resolve as resolvePath } from 'node:path';\nimport ts from 'typescript';\n\nexport interface ResolvedTypeDeclaration {\n classDeclaration: ts.ClassDeclaration;\n sourceFile: ts.SourceFile;\n filePath: string;\n}\n\ninterface ImportSource {\n moduleSpecifierText: string;\n importedName: string;\n}\n\nconst parsedFilesByPath = new Map<string, ts.SourceFile>();\n\nconst parseFile = (filePath: string): ts.SourceFile => {\n const cached = parsedFilesByPath.get(filePath);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const content = readFileSync(filePath, 'utf-8');\n const sourceFile = ts.createSourceFile(\n filePath,\n content,\n ts.ScriptTarget.ESNext,\n true,\n ts.ScriptKind.TS,\n );\n parsedFilesByPath.set(filePath, sourceFile);\n return sourceFile;\n};\n\nconst resolveModuleFile = (\n fromFilePath: string,\n moduleSpecifierText: string,\n): string | undefined => {\n if (!moduleSpecifierText.startsWith('.')) {\n return undefined;\n }\n\n const base = resolvePath(dirname(fromFilePath), moduleSpecifierText);\n const candidates = [`${base}.ts`, `${base}.tsx`, resolvePath(base, 'index.ts')];\n\n return candidates.find((candidate) => existsSync(candidate));\n};\n\nconst findExportedDeclaration = (\n sourceFile: ts.SourceFile,\n name: string,\n): ts.ClassDeclaration | undefined =>\n sourceFile.statements.find(\n (statement): statement is ts.ClassDeclaration =>\n ts.isClassDeclaration(statement) && statement.name?.text === name,\n );\n\nconst findImportSource = (\n sourceFile: ts.SourceFile,\n localName: string,\n): ImportSource | undefined => {\n for (const statement of sourceFile.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteralLike(statement.moduleSpecifier)) {\n continue;\n }\n\n const namedBindings = statement.importClause?.namedBindings;\n\n if (namedBindings === undefined || !ts.isNamedImports(namedBindings)) {\n continue;\n }\n\n const element = namedBindings.elements.find((candidate) => candidate.name.text === localName);\n\n if (element !== undefined) {\n return {\n moduleSpecifierText: statement.moduleSpecifier.text,\n importedName: element.propertyName?.text ?? element.name.text,\n };\n }\n }\n\n return undefined;\n};\n\nconst findReExportSource = (sourceFile: ts.SourceFile, name: string): string | undefined => {\n for (const statement of sourceFile.statements) {\n if (\n !ts.isExportDeclaration(statement) ||\n statement.moduleSpecifier === undefined ||\n !ts.isStringLiteralLike(statement.moduleSpecifier)\n ) {\n continue;\n }\n\n if (statement.exportClause === undefined) {\n return statement.moduleSpecifier.text;\n }\n\n if (\n ts.isNamedExports(statement.exportClause) &&\n statement.exportClause.elements.some(\n (element) => (element.propertyName?.text ?? element.name.text) === name,\n )\n ) {\n return statement.moduleSpecifier.text;\n }\n }\n\n return undefined;\n};\n\nexport const resolveClassDeclaration = (\n name: string,\n fromSourceFile: ts.SourceFile,\n fromFilePath: string,\n visited: Set<string> = new Set(),\n): ResolvedTypeDeclaration | undefined => {\n if (visited.has(fromFilePath)) {\n return undefined;\n }\n\n visited.add(fromFilePath);\n\n const direct = findExportedDeclaration(fromSourceFile, name);\n\n if (direct !== undefined) {\n return { classDeclaration: direct, sourceFile: fromSourceFile, filePath: fromFilePath };\n }\n\n const importSource = findImportSource(fromSourceFile, name);\n\n if (importSource !== undefined) {\n const resolvedPath = resolveModuleFile(fromFilePath, importSource.moduleSpecifierText);\n\n if (resolvedPath !== undefined) {\n const nextSourceFile = parseFile(resolvedPath);\n const result = resolveClassDeclaration(\n importSource.importedName,\n nextSourceFile,\n resolvedPath,\n visited,\n );\n\n if (result !== undefined) {\n return result;\n }\n }\n }\n\n const reExportModuleSpecifierText = findReExportSource(fromSourceFile, name);\n\n if (reExportModuleSpecifierText !== undefined) {\n const resolvedPath = resolveModuleFile(fromFilePath, reExportModuleSpecifierText);\n\n if (resolvedPath !== undefined) {\n const nextSourceFile = parseFile(resolvedPath);\n return resolveClassDeclaration(name, nextSourceFile, resolvedPath, visited);\n }\n }\n\n return undefined;\n};\n","import ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { SelectionField } from '../models/selection-field';\nimport { findDecorator } from './decorator-inspection';\nimport { unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { resolveClassDeclaration } from './resolve-type-declaration';\n\nconst PRIMITIVE_SCALAR_NAMES = new Set(['string', 'number', 'boolean']);\n\ninterface SelectionContext {\n resolverName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n visitedTypeNames: Set<string>;\n}\n\nexport const extractSelectionFields = (\n classDeclaration: ts.ClassDeclaration,\n sourceFile: ts.SourceFile,\n filePath: string,\n context: SelectionContext,\n): SelectionField[] | undefined => {\n const typeName = classDeclaration.name?.text ?? '(anonymous type)';\n const location = locationOf(sourceFile, classDeclaration);\n\n if (context.visitedTypeNames.has(typeName)) {\n context.diagnostics.push({\n code: 'circular-type',\n title: 'Circular type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Type \"${typeName}\" references itself, directly or indirectly. NestBridge cannot build a finite GraphQL selection set for it.`,\n filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const nextVisited = new Set(context.visitedTypeNames).add(typeName);\n\n const properties = classDeclaration.members.filter(\n (member): member is ts.PropertyDeclaration =>\n ts.isPropertyDeclaration(member) && findDecorator(member, 'Field') !== undefined,\n );\n\n const fields: SelectionField[] = [];\n\n for (const property of properties) {\n if (!ts.isIdentifier(property.name)) {\n continue;\n }\n\n const fieldName = property.name.text;\n const fieldLocation = locationOf(sourceFile, property);\n\n if (property.type === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" needs an explicit type annotation.`,\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n const unwrapped = unwrapTypeNode(property.type);\n\n if (unwrapped === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" has a type NestBridge cannot statically resolve.`,\n found: property.type.getText(),\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n if (PRIMITIVE_SCALAR_NAMES.has(unwrapped.identifierText)) {\n fields.push({ name: fieldName });\n continue;\n }\n\n const resolved = resolveClassDeclaration(unwrapped.identifierText, sourceFile, filePath);\n\n if (resolved === undefined) {\n fields.push({ name: fieldName });\n continue;\n }\n\n if (findDecorator(resolved.classDeclaration, 'ObjectType') === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" resolves to class \"${unwrapped.identifierText}\", which is not decorated with @ObjectType(). NestBridge cannot build a GraphQL selection set for it.`,\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n const children = extractSelectionFields(\n resolved.classDeclaration,\n resolved.sourceFile,\n resolved.filePath,\n {\n ...context,\n visitedTypeNames: nextVisited,\n },\n );\n\n if (children === undefined) {\n return undefined;\n }\n\n fields.push({ name: fieldName, children });\n }\n\n return fields;\n};\n","import ts from 'typescript';\n\nexport interface ReadGraphqlOperationNameResult {\n ok: boolean;\n value?: string;\n argumentText?: string;\n}\n\nconst readNameFromOptions = (optionsArgument: ts.ObjectLiteralExpression) => {\n const nameProperty = optionsArgument.properties.find(\n (property): property is ts.PropertyAssignment =>\n ts.isPropertyAssignment(property) &&\n ts.isIdentifier(property.name) &&\n property.name.text === 'name',\n );\n\n if (nameProperty === undefined || !ts.isStringLiteralLike(nameProperty.initializer)) {\n return undefined;\n }\n\n return nameProperty.initializer.text;\n};\n\nexport const readGraphqlOperationName = (\n decorator: ts.Decorator,\n): ReadGraphqlOperationNameResult => {\n const expression = decorator.expression;\n\n if (!ts.isCallExpression(expression)) {\n return { ok: true, value: undefined };\n }\n\n let value: string | undefined;\n\n for (const argument of expression.arguments) {\n if (ts.isArrowFunction(argument) || ts.isFunctionExpression(argument)) {\n continue;\n }\n\n if (ts.isStringLiteralLike(argument)) {\n value = argument.text;\n continue;\n }\n\n if (ts.isObjectLiteralExpression(argument)) {\n value = readNameFromOptions(argument) ?? value;\n continue;\n }\n\n return { ok: false, argumentText: argument.getText() };\n }\n\n return { ok: true, value };\n};\n","import ts from 'typescript';\nimport { readTypeThunkExpression } from './read-type-thunk-expression';\n\nexport const readGraphqlReturnTypeOption = (decorator: ts.Decorator): string | undefined => {\n if (!ts.isCallExpression(decorator.expression)) {\n return undefined;\n }\n\n const thunk = decorator.expression.arguments.find(\n (argument): argument is ts.ArrowFunction | ts.FunctionExpression =>\n ts.isArrowFunction(argument) || ts.isFunctionExpression(argument),\n );\n\n if (thunk === undefined) {\n return undefined;\n }\n\n const returnedExpression = readTypeThunkExpression(thunk);\n\n if (returnedExpression === undefined) {\n return undefined;\n }\n\n if (ts.isArrayLiteralExpression(returnedExpression)) {\n const element = returnedExpression.elements[0];\n return element !== undefined && ts.isIdentifier(element) ? element.text : undefined;\n }\n\n return ts.isIdentifier(returnedExpression) ? returnedExpression.text : undefined;\n};\n","import type ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { GRAPHQL_OPERATION_DECORATOR_NAMES } from '../models/graphql-operation-kind';\nimport type { SelectionField } from '../models/selection-field';\nimport { decoratorNameOf, findAnyDecorator } from './decorator-inspection';\nimport { extractResolverArgumentDefinition } from './extract-resolver-argument-definition';\nimport { extractSelectionFields } from './extract-selection-fields';\nimport { unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { readGraphqlOperationName } from './read-graphql-operation-name';\nimport { readGraphqlReturnTypeOption } from './read-graphql-return-type-option';\nimport { resolveClassDeclaration } from './resolve-type-declaration';\n\nconst PRIMITIVE_SCALAR_NAMES = new Set(['string', 'number', 'boolean']);\n\ninterface ExtractionContext {\n sourceFile: ts.SourceFile;\n filePath: string;\n resolverName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractResolverMethodDefinition = (\n method: ts.MethodDeclaration,\n context: ExtractionContext,\n) => {\n const decorator = findAnyDecorator(method, Object.keys(GRAPHQL_OPERATION_DECORATOR_NAMES));\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const methodName = method.name.getText();\n const decoratorName = decoratorNameOf(decorator);\n const location = locationOf(context.sourceFile, method);\n\n if (decoratorName === undefined) {\n return undefined;\n }\n\n const operationKind = GRAPHQL_OPERATION_DECORATOR_NAMES[decoratorName];\n\n if (operationKind === undefined) {\n return undefined;\n }\n\n const nameArgument = readGraphqlOperationName(decorator);\n\n if (!nameArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported operation name.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail: 'GraphQL operation names must be statically analyzable string literals.',\n found: `@${decoratorName}(${nameArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const decoratorReturnType = readGraphqlReturnTypeOption(decorator);\n const identifierText =\n decoratorReturnType ??\n (method.type === undefined ? undefined : unwrapTypeNode(method.type)?.identifierText);\n\n if (identifierText === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported return type.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail:\n 'GraphQL resolver methods need a type thunk on @Query()/@Mutation() (e.g. \"() => UserType\") or an explicit return type annotation so NestBridge can build a selection set.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n let selection: SelectionField[] = [];\n\n if (!PRIMITIVE_SCALAR_NAMES.has(identifierText.toLowerCase())) {\n const resolved = resolveClassDeclaration(identifierText, context.sourceFile, context.filePath);\n\n if (resolved === undefined && decoratorReturnType === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported return type.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail: `NestBridge could not locate the declaration of type \"${identifierText}\".`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (resolved !== undefined) {\n const fields = extractSelectionFields(\n resolved.classDeclaration,\n resolved.sourceFile,\n resolved.filePath,\n {\n resolverName: context.resolverName,\n methodName,\n diagnostics: context.diagnostics,\n visitedTypeNames: new Set(),\n },\n );\n\n if (fields === undefined) {\n return undefined;\n }\n\n selection = fields;\n }\n }\n\n const args = method.parameters.map((parameter, index) =>\n extractResolverArgumentDefinition(parameter, index, {\n sourceFile: context.sourceFile,\n filePath: context.filePath,\n resolverName: context.resolverName,\n methodName,\n diagnostics: context.diagnostics,\n }),\n );\n\n if (args.some((argument) => argument === undefined)) {\n return undefined;\n }\n\n return {\n name: methodName,\n operationKind,\n operationName: nameArgument.value ?? methodName,\n arguments: args.filter((argument) => argument !== undefined),\n selection,\n line: location.line,\n column: location.column,\n };\n};\n","import ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { extractResolverMethodDefinition } from './extract-resolver-method-definition';\n\nexport const extractResolverDefinition = (\n classDeclaration: ts.ClassDeclaration,\n sourceFile: ts.SourceFile,\n filePath: string,\n diagnostics: NestBridgeDiagnostic[],\n) => {\n const resolverName = classDeclaration.name?.text ?? '(anonymous resolver)';\n\n const methods = classDeclaration.members\n .filter((member): member is ts.MethodDeclaration => ts.isMethodDeclaration(member))\n .map((method) =>\n extractResolverMethodDefinition(method, {\n sourceFile,\n filePath,\n resolverName,\n diagnostics,\n }),\n )\n .filter((method) => method !== undefined);\n\n return {\n name: resolverName,\n sourceFile: filePath,\n methods,\n };\n};\n","import ts from 'typescript';\nimport { findDecorator } from './decorator-inspection';\n\nexport const findResolverClasses = (sourceFile: ts.SourceFile) => {\n return sourceFile.statements.filter(\n (statement): statement is ts.ClassDeclaration =>\n ts.isClassDeclaration(statement) && findDecorator(statement, 'Resolver') !== undefined,\n );\n};\n","import { readFileSync } from 'node:fs';\nimport ts from 'typescript';\nimport type { NestBridgeDiagnostic } from '../diagnostics';\nimport type { ResolverDefinition } from '../models';\nimport { extractResolverDefinition } from './extract-resolver-definition';\nimport { findResolverClasses } from './find-resolver-classes';\n\nexport const analyzeResolvers = (filePaths: readonly string[]) => {\n const diagnostics: NestBridgeDiagnostic[] = [];\n const resolvers: ResolverDefinition[] = [];\n\n for (const filePath of filePaths) {\n const content = readFileSync(filePath, 'utf-8');\n const sourceFile = ts.createSourceFile(\n filePath,\n content,\n ts.ScriptTarget.ESNext,\n true,\n ts.ScriptKind.TS,\n );\n\n for (const classDeclaration of findResolverClasses(sourceFile)) {\n const resolver = extractResolverDefinition(\n classDeclaration,\n sourceFile,\n filePath,\n diagnostics,\n );\n\n if (resolver !== undefined) {\n resolvers.push(resolver);\n }\n }\n }\n\n return { resolvers, diagnostics };\n};\n","import { dirname, extname, relative } from 'node:path';\nimport type { ResponseKind } from '../models/response-kind';\n\ninterface ClientDeclarationSource {\n name: string;\n sourceFile: string;\n methods: readonly { name: string; responseKind?: ResponseKind }[];\n}\n\nconst REMOTE_RESULT_HELPERS: Record<ResponseKind, string> = {\n json: 'RemoteResult',\n observable: 'RemoteObservableResult',\n stream: 'RemoteStreamResult',\n};\n\nconst toPosixPath = (filePath: string) => filePath.replace(/\\\\/g, '/');\n\nconst importSpecifierFor = (sourceFile: string, outputFilePath: string) => {\n if (\n !sourceFile.startsWith('.') &&\n !/^[A-Za-z]:[\\\\/]/.test(sourceFile) &&\n !sourceFile.startsWith('/')\n ) {\n return sourceFile;\n }\n\n const relativePath = toPosixPath(relative(dirname(outputFilePath), sourceFile));\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n};\n\nconst stripExtension = (filePath: string) => {\n const extension = extname(filePath);\n return extension.length > 0 ? filePath.slice(0, -extension.length) : filePath;\n};\n\nexport const generateControllerDeclaration = (\n controller: ClientDeclarationSource,\n outputFilePath: string,\n) => {\n const sourceFileSpecifier = importSpecifierFor(controller.sourceFile, outputFilePath);\n const importSpecifier = stripExtension(sourceFileSpecifier);\n const serverAlias = `__Server${controller.name}`;\n const methodDeclarations = controller.methods.map((method) => {\n const helperName = REMOTE_RESULT_HELPERS[method.responseKind ?? 'json'];\n return ` ${method.name}(...args: Parameters<${serverAlias}['${method.name}']>): ${helperName}<${serverAlias}['${method.name}']>;`;\n });\n\n const classBody = [' constructor();', '', ...methodDeclarations].join('\\n');\n\n const usedHelperNames = new Set(\n controller.methods.map((method) => REMOTE_RESULT_HELPERS[method.responseKind ?? 'json']),\n );\n const helperImports = Array.from(\n usedHelperNames.size > 0 ? usedHelperNames : ['RemoteResult'],\n ).sort();\n\n return [\n `import type { ${controller.name} as ${serverAlias} } from '${importSpecifier}';`,\n `import type { ${helperImports.join(', ')} } from '@nestbridge/runtime';`,\n '',\n '/**',\n ' * Generated by NestBridge — client-facing methods only.',\n ` * @see {@link ${sourceFileSpecifier}} for the real controller implementation.`,\n ' */',\n `export declare class ${controller.name} {`,\n classBody,\n '}',\n '',\n ].join('\\n');\n};\n","import type { NestBridgeDiagnostic } from './nestbridge-diagnostic';\n\nexport const formatDiagnostic = (diagnostic: NestBridgeDiagnostic) => {\n const subject =\n diagnostic.memberName.length > 0\n ? `${diagnostic.controllerName}.${diagnostic.memberName}`\n : diagnostic.controllerName;\n\n const lines = [`[NestBridge] ${diagnostic.title}`, '', subject, '', diagnostic.detail];\n\n if (diagnostic.found !== undefined) {\n lines.push('', 'Found:', diagnostic.found);\n }\n\n if (diagnostic.expected !== undefined) {\n lines.push('', 'Expected:', diagnostic.expected);\n }\n\n lines.push('', `${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}`);\n\n return lines.join('\\n');\n};\n","import { formatDiagnostic } from './format-diagnostic';\nimport type { NestBridgeDiagnostic } from './nestbridge-diagnostic';\n\nexport class NestBridgeDiagnosticError extends Error {\n readonly diagnostic: NestBridgeDiagnostic;\n\n constructor(diagnostic: NestBridgeDiagnostic) {\n super(formatDiagnostic(diagnostic));\n this.name = 'NestBridgeDiagnosticError';\n this.diagnostic = diagnostic;\n }\n}\n","import { version } from '../package.json';\n\nexport const VERSION: string = version;\n"],"names":["resolvePath","PRIMITIVE_SCALAR_NAMES"],"mappings":";;;;AAEO,MAAM,aAAA,GAAgB,CAC3B,IAAA,EAKA,aAAA,KACG;AACH,EAAA,MAAM,UAAA,GAAa,EAAA,CAAG,aAAA,CAAc,IAAI,CAAA;AAExC,EAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,WAAW,IAAA,CAAK,CAAC,cAAc,eAAA,CAAgB,SAAS,MAAM,aAAa,CAAA;AACpF,CAAA;AAEO,MAAM,gBAAA,GAAmB,CAC9B,IAAA,EAKA,cAAA,KACG;AACH,EAAA,MAAM,UAAA,GAAa,EAAA,CAAG,aAAA,CAAc,IAAI,CAAA;AAExC,EAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,UAAA,CAAW,IAAA,CAAK,CAAC,SAAA,KAAc,cAAA,CAAe,SAAS,eAAA,CAAgB,SAAS,CAAA,IAAK,EAAE,CAAC,CAAA;AACjG,CAAA;AAEO,MAAM,eAAA,GAAkB,CAAC,SAAA,KAA4B;AAC1D,EAAA,MAAM,aAAa,SAAA,CAAU,UAAA;AAE7B,EAAA,IAAI,EAAA,CAAG,iBAAiB,UAAU,CAAA,IAAK,GAAG,YAAA,CAAa,UAAA,CAAW,UAAU,CAAA,EAAG;AAC7E,IAAA,OAAO,WAAW,UAAA,CAAW,IAAA;AAAA,EAC/B;AAEA,EAAA,IAAI,EAAA,CAAG,YAAA,CAAa,UAAU,CAAA,EAAG;AAC/B,IAAA,OAAO,UAAA,CAAW,IAAA;AAAA,EACpB;AAEA,E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AAK,IAAI,EAAA,EAAI,OAAA,EAAS,EAAA,EAAI,UAAA,CAAW,MAAM,CAAA;AAErF,EAAA,IAAI,UAAA,CAAW,UAAU,MAAA,EAAW;AAClC,IAAA,KAAA,CAAM,IAAA,CAAK,EAAA,EAAI,QAAA,EAAU,UAAA,CAAW,KAAK,CAAA;AAAA,EAC3C;AAEA,EAAA,IAAI,UAAA,CAAW,aAAa,MAAA,EAAW;AACrC,IAAA,KAAA,CAAM,IAAA,CAAK,EAAA,EAAI,WAAA,EAAa,UAAA,CAAW,QAAQ,CAAA;AAAA,EACjD;AAEA,EAAA,KAAA,CAAM,IAAA,CAAK,EAAA,EAAI,CAAA,EAAG,UAAA,CAAW,QAAQ,CAAA,CAAA,EAAI,UAAA,CAAW,IAAI,CAAA,CAAA,EAAI,UAAA,CAAW,MAAM,CAAA,CAAE,CAAA;AAE/E,EAAA,OAAO,KAAA,CAAM,KAAK,IAAI,CAAA;AACxB;;AClBO,MAAM,kCAAkC,KAAA,CAAM;AAAA,EAC1C,UAAA;AAAA,EAET,YAAY,UAAA,EAAkC;AAC5C,IAAA,KAAA,CAAM,gBAAA,CAAiB,UAAU,CAAC,CAAA;AAClC,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AACZ,IAAA,IAAA,CAAK,UAAA,GAAa,UAAA;AAAA,EACpB;AACF;;;;ACTO,MAAM,OAAA,GAAkB;;"}
1
+ {"version":3,"file":"nestbridge.core.js","names":[],"sources":["../src/analysis/decorator-inspection.ts","../src/models/http-method.ts","../src/analysis/node-location.ts","../src/analysis/extract-parameter-definition.ts","../src/analysis/graphql-scalar-type.ts","../src/analysis/read-response-kind.ts","../src/analysis/route-path.ts","../src/analysis/extract-method-definition.ts","../src/analysis/extract-controller-definition.ts","../src/analysis/find-controller-classes.ts","../src/analysis/parse-source-file.ts","../src/analysis/analyze-controllers.ts","../src/models/graphql-operation-kind.ts","../src/analysis/read-type-thunk-expression.ts","../src/analysis/read-args-type-option.ts","../src/analysis/extract-resolver-argument-definition.ts","../src/analysis/resolve-type-declaration.ts","../src/analysis/extract-selection-fields.ts","../src/analysis/read-graphql-operation-name.ts","../src/analysis/read-graphql-return-type-option.ts","../src/analysis/extract-resolver-method-definition.ts","../src/analysis/extract-resolver-definition.ts","../src/analysis/find-resolver-classes.ts","../src/analysis/analyze-resolvers.ts","../src/declarations/generate-controller-declaration.ts","../src/diagnostics/format-diagnostic.ts","../src/diagnostics/nestbridge-diagnostic-error.ts","../package.json","../src/version.ts"],"sourcesContent":["import type {\n ClassDeclaration,\n Decorator,\n MethodDeclaration,\n ParameterDeclaration,\n PropertyDeclaration,\n} from 'typescript/unstable/ast';\nimport {\n isCallExpression,\n isDecorator,\n isIdentifier,\n isStringLiteralLikeNode,\n} from 'typescript/unstable/ast';\n\nconst getDecorators = (\n node: ClassDeclaration | MethodDeclaration | ParameterDeclaration | PropertyDeclaration,\n) => {\n const decorators = node.modifiers?.filter(isDecorator);\n return decorators === undefined || decorators.length === 0 ? undefined : decorators;\n};\n\nexport const findDecorator = (\n node: ClassDeclaration | MethodDeclaration | ParameterDeclaration | PropertyDeclaration,\n decoratorName: string,\n) => {\n const decorators = getDecorators(node);\n\n if (decorators === undefined) {\n return undefined;\n }\n\n return decorators.find((decorator) => decoratorNameOf(decorator) === decoratorName);\n};\n\nexport const findAnyDecorator = (\n node: ClassDeclaration | MethodDeclaration | ParameterDeclaration | PropertyDeclaration,\n decoratorNames: readonly string[],\n) => {\n const decorators = getDecorators(node);\n\n if (decorators === undefined) {\n return undefined;\n }\n\n return decorators.find((decorator) => decoratorNames.includes(decoratorNameOf(decorator) ?? ''));\n};\n\nexport const decoratorNameOf = (decorator: Decorator) => {\n const expression = decorator.expression;\n\n if (isCallExpression(expression) && isIdentifier(expression.expression)) {\n return expression.expression.text;\n }\n\n if (isIdentifier(expression)) {\n return expression.text;\n }\n\n return undefined;\n};\n\nexport const readStaticStringArgument = (decorator: Decorator) => {\n const expression = decorator.expression;\n\n if (!isCallExpression(expression)) {\n return { ok: true, value: undefined };\n }\n\n const [firstArgument] = expression.arguments;\n\n if (firstArgument === undefined) {\n return { ok: true, value: undefined };\n }\n\n if (isStringLiteralLikeNode(firstArgument)) {\n return { ok: true, value: firstArgument.text };\n }\n\n return { ok: false, argumentText: firstArgument.getText() };\n};\n","export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport const HTTP_METHOD_DECORATOR_NAMES: Record<string, HttpMethod> = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Patch: 'PATCH',\n Delete: 'DELETE',\n};\n","import type { Node, SourceFile } from 'typescript/unstable/ast';\n\nexport const locationOf = (sourceFile: SourceFile, node: Node) => {\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n return { line: line + 1, column: character + 1 };\n};\n","import type { ParameterDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isIdentifier } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { ControllerParameterDefinition } from '../models/controller-parameter-definition';\nimport {\n decoratorNameOf,\n findAnyDecorator,\n readStaticStringArgument,\n} from './decorator-inspection';\nimport { locationOf } from './node-location';\n\nconst SUPPORTED_PARAMETER_DECORATORS = ['Param', 'Query', 'Body', 'Headers'] as const;\nconst KNOWN_UNSUPPORTED_PARAMETER_DECORATORS = ['Req', 'Res', 'Request', 'Response'] as const;\n\ninterface ExtractionContext {\n sourceFile: SourceFile;\n filePath: string;\n controllerName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractParameterDefinition = (\n parameter: ParameterDeclaration,\n index: number,\n context: ExtractionContext,\n): ControllerParameterDefinition | undefined => {\n const decorator = findAnyDecorator(parameter, [\n ...SUPPORTED_PARAMETER_DECORATORS,\n ...KNOWN_UNSUPPORTED_PARAMETER_DECORATORS,\n ]);\n const location = locationOf(context.sourceFile, parameter);\n\n if (decorator === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `Parameter \"${parameter.name.getText()}\" must be decorated with one of @Param, @Query, @Body, or @Headers to be transported through a NestBridge HTTP client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const decoratorName = decoratorNameOf(decorator);\n\n if (\n decoratorName !== undefined &&\n (KNOWN_UNSUPPORTED_PARAMETER_DECORATORS as readonly string[]).includes(decoratorName)\n ) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `@${decoratorName}() cannot be transported through a NestBridge HTTP client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (!isIdentifier(parameter.name)) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: 'Destructured parameters cannot be transported through a NestBridge HTTP client.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const argument = readStaticStringArgument(decorator);\n\n if (!argument.ok) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail: `@${decoratorName}() arguments must be statically analyzable string literals.`,\n found: `@${decoratorName}(${argument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const base = {\n index,\n parameterName: parameter.name.text,\n };\n\n if (decoratorName === 'Param') {\n if (argument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail:\n \"A whole @Param() is not supported; provide a route parameter name such as @Param('id').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n return { ...base, kind: 'param', name: argument.value };\n }\n\n if (decoratorName === 'Headers') {\n if (argument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-parameter',\n title: 'Unsupported parameter.',\n controllerName: context.controllerName,\n memberName: context.methodName,\n detail:\n \"A whole @Headers() is not supported; provide a header name such as @Headers('x-example').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n return { ...base, kind: 'header', name: argument.value };\n }\n\n if (decoratorName === 'Query') {\n return { ...base, kind: 'query', name: argument.value };\n }\n\n return { ...base, kind: 'body', name: argument.value };\n};\n","import type { TypeNode } from 'typescript/unstable/ast';\nimport {\n isArrayTypeNode,\n isIdentifier,\n isTypeReferenceNode,\n isUnionTypeNode,\n SyntaxKind,\n} from 'typescript/unstable/ast';\n\nconst PRIMITIVE_SCALAR_TYPES: Record<string, string> = {\n string: 'String',\n number: 'Float',\n boolean: 'Boolean',\n};\n\nexport interface UnwrappedTypeNode {\n identifierText: string;\n isArray: boolean;\n isNullable: boolean;\n}\n\nexport const unwrapPromise = (typeNode: TypeNode): TypeNode => {\n if (\n isTypeReferenceNode(typeNode) &&\n isIdentifier(typeNode.typeName) &&\n typeNode.typeName.text === 'Promise' &&\n typeNode.typeArguments?.[0] !== undefined\n ) {\n return unwrapPromise(typeNode.typeArguments[0]);\n }\n\n return typeNode;\n};\n\nconst unwrapNullable = (typeNode: TypeNode) => {\n if (!isUnionTypeNode(typeNode)) {\n return { inner: typeNode, isNullable: false };\n }\n\n const nonNullMembers = typeNode.types.filter(\n (member) =>\n member.kind !== SyntaxKind.NullKeyword && member.kind !== SyntaxKind.UndefinedKeyword,\n );\n const [onlyMember] = nonNullMembers;\n\n if (nonNullMembers.length !== 1 || onlyMember === undefined) {\n return { inner: typeNode, isNullable: nonNullMembers.length !== typeNode.types.length };\n }\n\n return { inner: onlyMember, isNullable: true };\n};\n\nconst unwrapArrayElement = (typeNode: TypeNode): TypeNode | undefined => {\n if (isArrayTypeNode(typeNode)) {\n return typeNode.elementType;\n }\n\n if (\n isTypeReferenceNode(typeNode) &&\n isIdentifier(typeNode.typeName) &&\n typeNode.typeName.text === 'Array' &&\n typeNode.typeArguments?.[0] !== undefined\n ) {\n return typeNode.typeArguments[0];\n }\n\n return undefined;\n};\n\nconst identifierTextOf = (typeNode: TypeNode): string | undefined => {\n if (isTypeReferenceNode(typeNode) && isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n\n switch (typeNode.kind) {\n case SyntaxKind.StringKeyword:\n return 'string';\n case SyntaxKind.NumberKeyword:\n return 'number';\n case SyntaxKind.BooleanKeyword:\n return 'boolean';\n default:\n return undefined;\n }\n};\n\nexport const unwrapTypeNode = (typeNode: TypeNode): UnwrappedTypeNode | undefined => {\n const withoutPromise = unwrapPromise(typeNode);\n const { inner: withoutNullable, isNullable } = unwrapNullable(withoutPromise);\n const arrayElement = unwrapArrayElement(withoutNullable);\n const element = arrayElement === undefined ? withoutNullable : unwrapNullable(arrayElement).inner;\n const identifierText = identifierTextOf(element);\n\n if (identifierText === undefined) {\n return undefined;\n }\n\n return { identifierText, isArray: arrayElement !== undefined, isNullable };\n};\n\nexport const graphqlScalarNameFor = (identifierText: string) =>\n PRIMITIVE_SCALAR_TYPES[identifierText] ?? identifierText;\n\nexport const graphqlTypeStringFor = (unwrapped: UnwrappedTypeNode, explicitTypeName?: string) => {\n const baseName = explicitTypeName ?? graphqlScalarNameFor(unwrapped.identifierText);\n const wrapped = unwrapped.isArray ? `[${baseName}!]` : baseName;\n return unwrapped.isNullable ? wrapped : `${wrapped}!`;\n};\n","import type { TypeNode } from 'typescript/unstable/ast';\nimport { isIdentifier, isTypeReferenceNode } from 'typescript/unstable/ast';\nimport type { ResponseKind } from '../models/response-kind';\nimport { unwrapPromise } from './graphql-scalar-type';\n\nconst OBSERVABLE_TYPE_NAME = 'Observable';\nconst STREAMABLE_FILE_TYPE_NAME = 'StreamableFile';\n\nexport const readResponseKind = (returnType: TypeNode | undefined): ResponseKind => {\n if (returnType === undefined) {\n return 'json';\n }\n\n const unwrapped = unwrapPromise(returnType);\n\n if (!isTypeReferenceNode(unwrapped) || !isIdentifier(unwrapped.typeName)) {\n return 'json';\n }\n\n if (unwrapped.typeName.text === OBSERVABLE_TYPE_NAME) {\n return 'observable';\n }\n\n if (unwrapped.typeName.text === STREAMABLE_FILE_TYPE_NAME) {\n return 'stream';\n }\n\n return 'json';\n};\n","const trimSlashes = (segment: string) => segment.replace(/^\\/+/, '').replace(/\\/+$/, '');\n\nexport const joinRoutePath = (controllerPath: string, methodPath: string | undefined) => {\n const segments = [trimSlashes(controllerPath), trimSlashes(methodPath ?? '')].filter(\n (segment) => segment.length > 0,\n );\n\n return `/${segments.join('/')}`;\n};\n","import type { MethodDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { HTTP_METHOD_DECORATOR_NAMES } from '../models/http-method';\nimport {\n decoratorNameOf,\n findAnyDecorator,\n readStaticStringArgument,\n} from './decorator-inspection';\nimport { extractParameterDefinition } from './extract-parameter-definition';\nimport { locationOf } from './node-location';\nimport { readResponseKind } from './read-response-kind';\nimport { joinRoutePath } from './route-path';\n\ninterface ExtractionContext {\n sourceFile: SourceFile;\n filePath: string;\n controllerName: string;\n controllerPath: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractMethodDefinition = (method: MethodDeclaration, context: ExtractionContext) => {\n const decorator = findAnyDecorator(method, Object.keys(HTTP_METHOD_DECORATOR_NAMES));\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const methodName = method.name.getText();\n const decoratorName = decoratorNameOf(decorator);\n const location = locationOf(context.sourceFile, method);\n\n if (decoratorName === undefined) {\n return undefined;\n }\n\n const httpMethod = HTTP_METHOD_DECORATOR_NAMES[decoratorName];\n\n if (httpMethod === undefined) {\n return undefined;\n }\n\n const routeArgument = readStaticStringArgument(decorator);\n\n if (!routeArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported route.',\n controllerName: context.controllerName,\n memberName: methodName,\n detail: 'Route paths must be statically analyzable.',\n found: `@${decoratorName}(${routeArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const parameters = method.parameters.map((parameter, index) =>\n extractParameterDefinition(parameter, index, {\n sourceFile: context.sourceFile,\n filePath: context.filePath,\n controllerName: context.controllerName,\n methodName,\n diagnostics: context.diagnostics,\n }),\n );\n\n if (parameters.some((parameter) => parameter === undefined)) {\n return undefined;\n }\n\n return {\n name: methodName,\n httpMethod,\n path: joinRoutePath(context.controllerPath, routeArgument.value),\n parameters: parameters.filter((parameter) => parameter !== undefined),\n responseKind: readResponseKind(method.type),\n line: location.line,\n column: location.column,\n };\n};\n","import type { ClassDeclaration, MethodDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isMethodDeclaration } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { findDecorator, readStaticStringArgument } from './decorator-inspection';\nimport { extractMethodDefinition } from './extract-method-definition';\nimport { locationOf } from './node-location';\n\nexport const extractControllerDefinition = (\n classDeclaration: ClassDeclaration,\n sourceFile: SourceFile,\n filePath: string,\n diagnostics: NestBridgeDiagnostic[],\n) => {\n const controllerName = classDeclaration.name?.text ?? '(anonymous controller)';\n const decorator = findDecorator(classDeclaration, 'Controller');\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const location = locationOf(sourceFile, classDeclaration);\n const argument = readStaticStringArgument(decorator);\n\n if (!argument.ok) {\n diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported route.',\n controllerName,\n memberName: '',\n detail: 'Controller paths must be statically analyzable.',\n found: `@Controller(${argument.argumentText})`,\n filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const methods = classDeclaration.members\n .filter((member): member is MethodDeclaration => isMethodDeclaration(member))\n .map((method) =>\n extractMethodDefinition(method, {\n sourceFile,\n filePath,\n controllerName,\n controllerPath: argument.value ?? '',\n diagnostics,\n }),\n )\n .filter((method) => method !== undefined);\n\n return {\n name: controllerName,\n path: argument.value ?? '',\n sourceFile: filePath,\n methods,\n };\n};\n","import type { ClassDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isClassDeclaration } from 'typescript/unstable/ast';\nimport { findDecorator } from './decorator-inspection';\n\nexport const findControllerClasses = (sourceFile: SourceFile) => {\n return sourceFile.statements.filter(\n (statement): statement is ClassDeclaration =>\n isClassDeclaration(statement) && findDecorator(statement, 'Controller') !== undefined,\n );\n};\n","import { API } from 'typescript/unstable/sync';\n\nlet sharedApi: API | undefined;\n\nexport const parseSourceFile = (filePath: string) => {\n sharedApi ??= new API();\n\n const snapshot = sharedApi.updateSnapshot({ openFiles: [filePath] });\n const project = snapshot.getDefaultProjectForFile(filePath);\n const sourceFile = project?.program.getSourceFile(filePath);\n\n if (sourceFile === undefined) {\n throw new Error(`Unable to parse source file: ${filePath}`);\n }\n\n return sourceFile;\n};\n","import type { NestBridgeDiagnostic } from '../diagnostics';\nimport type { ControllerDefinition } from '../models';\nimport { extractControllerDefinition } from './extract-controller-definition';\nimport { findControllerClasses } from './find-controller-classes';\nimport { parseSourceFile } from './parse-source-file';\n\nexport const analyzeControllers = (\n filePaths: readonly string[],\n): { controllers: ControllerDefinition[]; diagnostics: NestBridgeDiagnostic[] } => {\n const diagnostics: NestBridgeDiagnostic[] = [];\n const controllers: ControllerDefinition[] = [];\n\n for (const filePath of filePaths) {\n const sourceFile = parseSourceFile(filePath);\n\n for (const classDeclaration of findControllerClasses(sourceFile)) {\n const controller = extractControllerDefinition(\n classDeclaration,\n sourceFile,\n filePath,\n diagnostics,\n );\n\n if (controller !== undefined) {\n controllers.push(controller);\n }\n }\n }\n\n return { controllers, diagnostics };\n};\n","export type GraphqlOperationKind = 'query' | 'mutation';\n\nexport const GRAPHQL_OPERATION_DECORATOR_NAMES: Record<string, GraphqlOperationKind> = {\n Query: 'query',\n Mutation: 'mutation',\n};\n","import type { ArrowFunction, Expression, FunctionExpression } from 'typescript/unstable/ast';\nimport { isBlock, isReturnStatement } from 'typescript/unstable/ast';\n\nexport const readTypeThunkExpression = (\n thunk: ArrowFunction | FunctionExpression,\n): Expression | undefined => {\n if (!isBlock(thunk.body)) {\n return thunk.body;\n }\n\n const returnStatement = thunk.body.statements.find(isReturnStatement);\n return returnStatement?.expression;\n};\n","import type { Decorator, PropertyAssignment } from 'typescript/unstable/ast';\nimport {\n isArrayLiteralExpression,\n isArrowFunction,\n isCallExpression,\n isFunctionExpression,\n isIdentifier,\n isObjectLiteralExpression,\n isPropertyAssignment,\n} from 'typescript/unstable/ast';\nimport { readTypeThunkExpression } from './read-type-thunk-expression';\n\nexport interface ArgsTypeOption {\n typeName: string;\n isArray: boolean;\n}\n\nexport const readArgsTypeOption = (decorator: Decorator): ArgsTypeOption | undefined => {\n if (!isCallExpression(decorator.expression)) {\n return undefined;\n }\n\n const optionsArgument = decorator.expression.arguments.find(isObjectLiteralExpression);\n\n if (optionsArgument === undefined) {\n return undefined;\n }\n\n const typeProperty = optionsArgument.properties.find(\n (property): property is PropertyAssignment =>\n isPropertyAssignment(property) &&\n isIdentifier(property.name) &&\n property.name.text === 'type',\n );\n\n if (typeProperty === undefined) {\n return undefined;\n }\n\n const thunk = typeProperty.initializer;\n\n if (!isArrowFunction(thunk) && !isFunctionExpression(thunk)) {\n return undefined;\n }\n\n const returnedExpression = readTypeThunkExpression(thunk);\n\n if (returnedExpression === undefined) {\n return undefined;\n }\n\n if (isArrayLiteralExpression(returnedExpression)) {\n const element = returnedExpression.elements[0];\n return element !== undefined && isIdentifier(element)\n ? { typeName: element.text, isArray: true }\n : undefined;\n }\n\n return isIdentifier(returnedExpression)\n ? { typeName: returnedExpression.text, isArray: false }\n : undefined;\n};\n","import type { ParameterDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isIdentifier } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { ResolverArgumentDefinition } from '../models/resolver-argument-definition';\nimport { findAnyDecorator, readStaticStringArgument } from './decorator-inspection';\nimport { graphqlTypeStringFor, unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { readArgsTypeOption } from './read-args-type-option';\n\ninterface ExtractionContext {\n sourceFile: SourceFile;\n filePath: string;\n resolverName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractResolverArgumentDefinition = (\n parameter: ParameterDeclaration,\n index: number,\n context: ExtractionContext,\n): ResolverArgumentDefinition | undefined => {\n const decorator = findAnyDecorator(parameter, ['Args']);\n const location = locationOf(context.sourceFile, parameter);\n\n if (decorator === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Parameter \"${parameter.name.getText()}\" must be decorated with @Args to be transported through a NestBridge GraphQL client.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (!isIdentifier(parameter.name)) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: 'Destructured parameters cannot be transported through a NestBridge GraphQL client.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const nameArgument = readStaticStringArgument(decorator);\n\n if (!nameArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: '@Args() name must be a statically analyzable string literal.',\n found: `@Args(${nameArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (nameArgument.value === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: \"A whole @Args() is not supported; provide an argument name such as @Args('id').\",\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (parameter.type === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `@Args() parameter \"${parameter.name.text}\" needs an explicit type annotation.`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const unwrapped = unwrapTypeNode(parameter.type);\n\n if (unwrapped === undefined) {\n context.diagnostics.push({\n code: 'unsupported-argument',\n title: 'Unsupported argument.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `@Args() parameter \"${parameter.name.text}\" has a type NestBridge cannot statically resolve to a GraphQL type.`,\n found: parameter.type.getText(),\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const explicitType = readArgsTypeOption(decorator);\n\n return {\n index,\n parameterName: parameter.name.text,\n name: nameArgument.value,\n graphqlType: graphqlTypeStringFor(unwrapped, explicitType?.typeName),\n };\n};\n","import { existsSync } from 'node:fs';\nimport { dirname, resolve as resolvePath } from 'node:path';\nimport type { ClassDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport {\n isClassDeclaration,\n isExportDeclaration,\n isImportDeclaration,\n isNamedExports,\n isNamedImports,\n isStringLiteralLikeNode,\n} from 'typescript/unstable/ast';\nimport { parseSourceFile } from './parse-source-file';\n\nexport interface ResolvedTypeDeclaration {\n classDeclaration: ClassDeclaration;\n sourceFile: SourceFile;\n filePath: string;\n}\n\ninterface ImportSource {\n moduleSpecifierText: string;\n importedName: string;\n}\n\nconst parsedFilesByPath = new Map<string, SourceFile>();\n\nconst parseFile = (filePath: string): SourceFile => {\n const cached = parsedFilesByPath.get(filePath);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const sourceFile = parseSourceFile(filePath);\n parsedFilesByPath.set(filePath, sourceFile);\n return sourceFile;\n};\n\nconst resolveModuleFile = (\n fromFilePath: string,\n moduleSpecifierText: string,\n): string | undefined => {\n if (!moduleSpecifierText.startsWith('.')) {\n return undefined;\n }\n\n const base = resolvePath(dirname(fromFilePath), moduleSpecifierText);\n const candidates = [`${base}.ts`, `${base}.tsx`, resolvePath(base, 'index.ts')];\n\n return candidates.find((candidate) => existsSync(candidate));\n};\n\nconst findExportedDeclaration = (\n sourceFile: SourceFile,\n name: string,\n): ClassDeclaration | undefined =>\n sourceFile.statements.find(\n (statement): statement is ClassDeclaration =>\n isClassDeclaration(statement) && statement.name?.text === name,\n );\n\nconst findImportSource = (sourceFile: SourceFile, localName: string): ImportSource | undefined => {\n for (const statement of sourceFile.statements) {\n if (!isImportDeclaration(statement) || !isStringLiteralLikeNode(statement.moduleSpecifier)) {\n continue;\n }\n\n const namedBindings = statement.importClause?.namedBindings;\n\n if (namedBindings === undefined || !isNamedImports(namedBindings)) {\n continue;\n }\n\n const element = namedBindings.elements.find((candidate) => candidate.name.text === localName);\n\n if (element !== undefined) {\n return {\n moduleSpecifierText: statement.moduleSpecifier.text,\n importedName: element.propertyName?.text ?? element.name.text,\n };\n }\n }\n\n return undefined;\n};\n\nconst findReExportSource = (sourceFile: SourceFile, name: string): string | undefined => {\n for (const statement of sourceFile.statements) {\n if (\n !isExportDeclaration(statement) ||\n statement.moduleSpecifier === undefined ||\n !isStringLiteralLikeNode(statement.moduleSpecifier)\n ) {\n continue;\n }\n\n if (statement.exportClause === undefined) {\n return statement.moduleSpecifier.text;\n }\n\n if (\n isNamedExports(statement.exportClause) &&\n statement.exportClause.elements.some(\n (element) => (element.propertyName?.text ?? element.name.text) === name,\n )\n ) {\n return statement.moduleSpecifier.text;\n }\n }\n\n return undefined;\n};\n\nexport const resolveClassDeclaration = (\n name: string,\n fromSourceFile: SourceFile,\n fromFilePath: string,\n visited: Set<string> = new Set(),\n): ResolvedTypeDeclaration | undefined => {\n if (visited.has(fromFilePath)) {\n return undefined;\n }\n\n visited.add(fromFilePath);\n\n const direct = findExportedDeclaration(fromSourceFile, name);\n\n if (direct !== undefined) {\n return { classDeclaration: direct, sourceFile: fromSourceFile, filePath: fromFilePath };\n }\n\n const importSource = findImportSource(fromSourceFile, name);\n\n if (importSource !== undefined) {\n const resolvedPath = resolveModuleFile(fromFilePath, importSource.moduleSpecifierText);\n\n if (resolvedPath !== undefined) {\n const nextSourceFile = parseFile(resolvedPath);\n const result = resolveClassDeclaration(\n importSource.importedName,\n nextSourceFile,\n resolvedPath,\n visited,\n );\n\n if (result !== undefined) {\n return result;\n }\n }\n }\n\n const reExportModuleSpecifierText = findReExportSource(fromSourceFile, name);\n\n if (reExportModuleSpecifierText !== undefined) {\n const resolvedPath = resolveModuleFile(fromFilePath, reExportModuleSpecifierText);\n\n if (resolvedPath !== undefined) {\n const nextSourceFile = parseFile(resolvedPath);\n return resolveClassDeclaration(name, nextSourceFile, resolvedPath, visited);\n }\n }\n\n return undefined;\n};\n","import type { ClassDeclaration, PropertyDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isIdentifier, isPropertyDeclaration } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport type { SelectionField } from '../models/selection-field';\nimport { findDecorator } from './decorator-inspection';\nimport { unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { resolveClassDeclaration } from './resolve-type-declaration';\n\nconst PRIMITIVE_SCALAR_NAMES = new Set(['string', 'number', 'boolean']);\n\ninterface SelectionContext {\n resolverName: string;\n methodName: string;\n diagnostics: NestBridgeDiagnostic[];\n visitedTypeNames: Set<string>;\n}\n\nexport const extractSelectionFields = (\n classDeclaration: ClassDeclaration,\n sourceFile: SourceFile,\n filePath: string,\n context: SelectionContext,\n): SelectionField[] | undefined => {\n const typeName = classDeclaration.name?.text ?? '(anonymous type)';\n const location = locationOf(sourceFile, classDeclaration);\n\n if (context.visitedTypeNames.has(typeName)) {\n context.diagnostics.push({\n code: 'circular-type',\n title: 'Circular type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Type \"${typeName}\" references itself, directly or indirectly. NestBridge cannot build a finite GraphQL selection set for it.`,\n filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const nextVisited = new Set(context.visitedTypeNames).add(typeName);\n\n const properties = classDeclaration.members.filter(\n (member): member is PropertyDeclaration =>\n isPropertyDeclaration(member) && findDecorator(member, 'Field') !== undefined,\n );\n\n const fields: SelectionField[] = [];\n\n for (const property of properties) {\n if (!isIdentifier(property.name)) {\n continue;\n }\n\n const fieldName = property.name.text;\n const fieldLocation = locationOf(sourceFile, property);\n\n if (property.type === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" needs an explicit type annotation.`,\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n const unwrapped = unwrapTypeNode(property.type);\n\n if (unwrapped === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" has a type NestBridge cannot statically resolve.`,\n found: property.type.getText(),\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n if (PRIMITIVE_SCALAR_NAMES.has(unwrapped.identifierText)) {\n fields.push({ name: fieldName });\n continue;\n }\n\n const resolved = resolveClassDeclaration(unwrapped.identifierText, sourceFile, filePath);\n\n if (resolved === undefined) {\n fields.push({ name: fieldName });\n continue;\n }\n\n if (findDecorator(resolved.classDeclaration, 'ObjectType') === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported field type.',\n controllerName: context.resolverName,\n memberName: context.methodName,\n detail: `Field \"${fieldName}\" on \"${typeName}\" resolves to class \"${unwrapped.identifierText}\", which is not decorated with @ObjectType(). NestBridge cannot build a GraphQL selection set for it.`,\n filePath,\n line: fieldLocation.line,\n column: fieldLocation.column,\n });\n return undefined;\n }\n\n const children = extractSelectionFields(\n resolved.classDeclaration,\n resolved.sourceFile,\n resolved.filePath,\n {\n ...context,\n visitedTypeNames: nextVisited,\n },\n );\n\n if (children === undefined) {\n return undefined;\n }\n\n fields.push({ name: fieldName, children });\n }\n\n return fields;\n};\n","import type {\n Decorator,\n ObjectLiteralExpression,\n PropertyAssignment,\n} from 'typescript/unstable/ast';\nimport {\n isArrowFunction,\n isCallExpression,\n isFunctionExpression,\n isIdentifier,\n isObjectLiteralExpression,\n isPropertyAssignment,\n isStringLiteralLikeNode,\n} from 'typescript/unstable/ast';\n\nexport interface ReadGraphqlOperationNameResult {\n ok: boolean;\n value?: string;\n argumentText?: string;\n}\n\nconst readNameFromOptions = (optionsArgument: ObjectLiteralExpression) => {\n const nameProperty = optionsArgument.properties.find(\n (property): property is PropertyAssignment =>\n isPropertyAssignment(property) &&\n isIdentifier(property.name) &&\n property.name.text === 'name',\n );\n\n if (nameProperty === undefined || !isStringLiteralLikeNode(nameProperty.initializer)) {\n return undefined;\n }\n\n return nameProperty.initializer.text;\n};\n\nexport const readGraphqlOperationName = (decorator: Decorator): ReadGraphqlOperationNameResult => {\n const expression = decorator.expression;\n\n if (!isCallExpression(expression)) {\n return { ok: true, value: undefined };\n }\n\n let value: string | undefined;\n\n for (const argument of expression.arguments) {\n if (isArrowFunction(argument) || isFunctionExpression(argument)) {\n continue;\n }\n\n if (isStringLiteralLikeNode(argument)) {\n value = argument.text;\n continue;\n }\n\n if (isObjectLiteralExpression(argument)) {\n value = readNameFromOptions(argument) ?? value;\n continue;\n }\n\n return { ok: false, argumentText: argument.getText() };\n }\n\n return { ok: true, value };\n};\n","import type { ArrowFunction, Decorator, FunctionExpression } from 'typescript/unstable/ast';\nimport {\n isArrayLiteralExpression,\n isArrowFunction,\n isCallExpression,\n isFunctionExpression,\n isIdentifier,\n} from 'typescript/unstable/ast';\nimport { readTypeThunkExpression } from './read-type-thunk-expression';\n\nexport const readGraphqlReturnTypeOption = (decorator: Decorator): string | undefined => {\n if (!isCallExpression(decorator.expression)) {\n return undefined;\n }\n\n const thunk = decorator.expression.arguments.find(\n (argument): argument is ArrowFunction | FunctionExpression =>\n isArrowFunction(argument) || isFunctionExpression(argument),\n );\n\n if (thunk === undefined) {\n return undefined;\n }\n\n const returnedExpression = readTypeThunkExpression(thunk);\n\n if (returnedExpression === undefined) {\n return undefined;\n }\n\n if (isArrayLiteralExpression(returnedExpression)) {\n const element = returnedExpression.elements[0];\n return element !== undefined && isIdentifier(element) ? element.text : undefined;\n }\n\n return isIdentifier(returnedExpression) ? returnedExpression.text : undefined;\n};\n","import type { MethodDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { GRAPHQL_OPERATION_DECORATOR_NAMES } from '../models/graphql-operation-kind';\nimport type { SelectionField } from '../models/selection-field';\nimport { decoratorNameOf, findAnyDecorator } from './decorator-inspection';\nimport { extractResolverArgumentDefinition } from './extract-resolver-argument-definition';\nimport { extractSelectionFields } from './extract-selection-fields';\nimport { unwrapTypeNode } from './graphql-scalar-type';\nimport { locationOf } from './node-location';\nimport { readGraphqlOperationName } from './read-graphql-operation-name';\nimport { readGraphqlReturnTypeOption } from './read-graphql-return-type-option';\nimport { resolveClassDeclaration } from './resolve-type-declaration';\n\nconst PRIMITIVE_SCALAR_NAMES = new Set(['string', 'number', 'boolean']);\n\ninterface ExtractionContext {\n sourceFile: SourceFile;\n filePath: string;\n resolverName: string;\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport const extractResolverMethodDefinition = (\n method: MethodDeclaration,\n context: ExtractionContext,\n) => {\n const decorator = findAnyDecorator(method, Object.keys(GRAPHQL_OPERATION_DECORATOR_NAMES));\n\n if (decorator === undefined) {\n return undefined;\n }\n\n const methodName = method.name.getText();\n const decoratorName = decoratorNameOf(decorator);\n const location = locationOf(context.sourceFile, method);\n\n if (decoratorName === undefined) {\n return undefined;\n }\n\n const operationKind = GRAPHQL_OPERATION_DECORATOR_NAMES[decoratorName];\n\n if (operationKind === undefined) {\n return undefined;\n }\n\n const nameArgument = readGraphqlOperationName(decorator);\n\n if (!nameArgument.ok) {\n context.diagnostics.push({\n code: 'unsupported-route',\n title: 'Unsupported operation name.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail: 'GraphQL operation names must be statically analyzable string literals.',\n found: `@${decoratorName}(${nameArgument.argumentText})`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n const decoratorReturnType = readGraphqlReturnTypeOption(decorator);\n const identifierText =\n decoratorReturnType ??\n (method.type === undefined ? undefined : unwrapTypeNode(method.type)?.identifierText);\n\n if (identifierText === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported return type.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail:\n 'GraphQL resolver methods need a type thunk on @Query()/@Mutation() (e.g. \"() => UserType\") or an explicit return type annotation so NestBridge can build a selection set.',\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n let selection: SelectionField[] = [];\n\n if (!PRIMITIVE_SCALAR_NAMES.has(identifierText.toLowerCase())) {\n const resolved = resolveClassDeclaration(identifierText, context.sourceFile, context.filePath);\n\n if (resolved === undefined && decoratorReturnType === undefined) {\n context.diagnostics.push({\n code: 'unsupported-return-type',\n title: 'Unsupported return type.',\n controllerName: context.resolverName,\n memberName: methodName,\n detail: `NestBridge could not locate the declaration of type \"${identifierText}\".`,\n filePath: context.filePath,\n line: location.line,\n column: location.column,\n });\n return undefined;\n }\n\n if (resolved !== undefined) {\n const fields = extractSelectionFields(\n resolved.classDeclaration,\n resolved.sourceFile,\n resolved.filePath,\n {\n resolverName: context.resolverName,\n methodName,\n diagnostics: context.diagnostics,\n visitedTypeNames: new Set(),\n },\n );\n\n if (fields === undefined) {\n return undefined;\n }\n\n selection = fields;\n }\n }\n\n const args = method.parameters.map((parameter, index) =>\n extractResolverArgumentDefinition(parameter, index, {\n sourceFile: context.sourceFile,\n filePath: context.filePath,\n resolverName: context.resolverName,\n methodName,\n diagnostics: context.diagnostics,\n }),\n );\n\n if (args.some((argument) => argument === undefined)) {\n return undefined;\n }\n\n return {\n name: methodName,\n operationKind,\n operationName: nameArgument.value ?? methodName,\n arguments: args.filter((argument) => argument !== undefined),\n selection,\n line: location.line,\n column: location.column,\n };\n};\n","import type { ClassDeclaration, MethodDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isMethodDeclaration } from 'typescript/unstable/ast';\nimport type { NestBridgeDiagnostic } from '../diagnostics/nestbridge-diagnostic';\nimport { extractResolverMethodDefinition } from './extract-resolver-method-definition';\n\nexport const extractResolverDefinition = (\n classDeclaration: ClassDeclaration,\n sourceFile: SourceFile,\n filePath: string,\n diagnostics: NestBridgeDiagnostic[],\n) => {\n const resolverName = classDeclaration.name?.text ?? '(anonymous resolver)';\n\n const methods = classDeclaration.members\n .filter((member): member is MethodDeclaration => isMethodDeclaration(member))\n .map((method) =>\n extractResolverMethodDefinition(method, {\n sourceFile,\n filePath,\n resolverName,\n diagnostics,\n }),\n )\n .filter((method) => method !== undefined);\n\n return {\n name: resolverName,\n sourceFile: filePath,\n methods,\n };\n};\n","import type { ClassDeclaration, SourceFile } from 'typescript/unstable/ast';\nimport { isClassDeclaration } from 'typescript/unstable/ast';\nimport { findDecorator } from './decorator-inspection';\n\nexport const findResolverClasses = (sourceFile: SourceFile) => {\n return sourceFile.statements.filter(\n (statement): statement is ClassDeclaration =>\n isClassDeclaration(statement) && findDecorator(statement, 'Resolver') !== undefined,\n );\n};\n","import type { NestBridgeDiagnostic } from '../diagnostics';\nimport type { ResolverDefinition } from '../models';\nimport { extractResolverDefinition } from './extract-resolver-definition';\nimport { findResolverClasses } from './find-resolver-classes';\nimport { parseSourceFile } from './parse-source-file';\n\nexport const analyzeResolvers = (\n filePaths: readonly string[],\n): { resolvers: ResolverDefinition[]; diagnostics: NestBridgeDiagnostic[] } => {\n const diagnostics: NestBridgeDiagnostic[] = [];\n const resolvers: ResolverDefinition[] = [];\n\n for (const filePath of filePaths) {\n const sourceFile = parseSourceFile(filePath);\n\n for (const classDeclaration of findResolverClasses(sourceFile)) {\n const resolver = extractResolverDefinition(\n classDeclaration,\n sourceFile,\n filePath,\n diagnostics,\n );\n\n if (resolver !== undefined) {\n resolvers.push(resolver);\n }\n }\n }\n\n return { resolvers, diagnostics };\n};\n","import { dirname, extname, relative } from 'node:path';\nimport type { ResponseKind } from '../models/response-kind';\n\ninterface ClientDeclarationSource {\n name: string;\n sourceFile: string;\n methods: readonly { name: string; responseKind?: ResponseKind }[];\n}\n\nconst REMOTE_RESULT_HELPERS: Record<ResponseKind, string> = {\n json: 'RemoteResult',\n observable: 'RemoteObservableResult',\n stream: 'RemoteStreamResult',\n};\n\nconst toPosixPath = (filePath: string) => filePath.replace(/\\\\/g, '/');\n\nconst importSpecifierFor = (sourceFile: string, outputFilePath: string) => {\n if (\n !sourceFile.startsWith('.') &&\n !/^[A-Za-z]:[\\\\/]/.test(sourceFile) &&\n !sourceFile.startsWith('/')\n ) {\n return sourceFile;\n }\n\n const relativePath = toPosixPath(relative(dirname(outputFilePath), sourceFile));\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n};\n\nconst stripExtension = (filePath: string) => {\n const extension = extname(filePath);\n return extension.length > 0 ? filePath.slice(0, -extension.length) : filePath;\n};\n\nexport const generateControllerDeclaration = (\n controller: ClientDeclarationSource,\n outputFilePath: string,\n): string => {\n const sourceFileSpecifier = importSpecifierFor(controller.sourceFile, outputFilePath);\n const importSpecifier = stripExtension(sourceFileSpecifier);\n const serverAlias = `__Server${controller.name}`;\n const methodDeclarations = controller.methods.map((method) => {\n const helperName = REMOTE_RESULT_HELPERS[method.responseKind ?? 'json'];\n return ` ${method.name}(...args: Parameters<${serverAlias}['${method.name}']>): ${helperName}<${serverAlias}['${method.name}']>;`;\n });\n\n const classBody = [' constructor();', '', ...methodDeclarations].join('\\n');\n\n const usedHelperNames = new Set(\n controller.methods.map((method) => REMOTE_RESULT_HELPERS[method.responseKind ?? 'json']),\n );\n const helperImports = Array.from(\n usedHelperNames.size > 0 ? usedHelperNames : ['RemoteResult'],\n ).sort();\n\n return [\n `import type { ${controller.name} as ${serverAlias} } from '${importSpecifier}';`,\n `import type { ${helperImports.join(', ')} } from 'nestbridge';`,\n '',\n '/**',\n ' * Generated by NestBridge — client-facing methods only.',\n ` * @see {@link ${sourceFileSpecifier}} for the real controller implementation.`,\n ' */',\n `export declare class ${controller.name} {`,\n classBody,\n '}',\n '',\n ].join('\\n');\n};\n","import type { NestBridgeDiagnostic } from './nestbridge-diagnostic';\n\nexport const formatDiagnostic = (diagnostic: NestBridgeDiagnostic): string => {\n const subject =\n diagnostic.memberName.length > 0\n ? `${diagnostic.controllerName}.${diagnostic.memberName}`\n : diagnostic.controllerName;\n\n const lines = [`[NestBridge] ${diagnostic.title}`, '', subject, '', diagnostic.detail];\n\n if (diagnostic.found !== undefined) {\n lines.push('', 'Found:', diagnostic.found);\n }\n\n if (diagnostic.expected !== undefined) {\n lines.push('', 'Expected:', diagnostic.expected);\n }\n\n lines.push('', `${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}`);\n\n return lines.join('\\n');\n};\n","import { formatDiagnostic } from './format-diagnostic';\nimport type { NestBridgeDiagnostic } from './nestbridge-diagnostic';\n\nexport class NestBridgeDiagnosticError extends Error {\n readonly diagnostic: NestBridgeDiagnostic;\n\n constructor(diagnostic: NestBridgeDiagnostic) {\n super(formatDiagnostic(diagnostic));\n this.name = 'NestBridgeDiagnosticError';\n this.diagnostic = diagnostic;\n }\n}\n","{\n \"name\": \"@nestbridge/core\",\n \"version\": \"1.1.1\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/MDReal32/nestbridge.git\",\n \"directory\": \"packages/core\"\n },\n \"main\": \"./build/nestbridge.core.js\",\n \"types\": \"./build/nestbridge.core.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./build/nestbridge.core.d.ts\",\n \"import\": \"./build/nestbridge.core.js\"\n }\n },\n \"files\": [\n \"build\"\n ],\n \"scripts\": {\n \"build\": \"vite build\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc -p tsconfig.json --noEmit\",\n \"lint\": \"biome check .\"\n },\n \"dependencies\": {\n \"typescript\": \"^7.0.2\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^26.4.1\",\n \"rolldown-plugin-dts\": \"^0.28.5\",\n \"vite\": \"^8.2.2\",\n \"vitest\": \"^5.0.0\"\n }\n}\n","import { version } from '../package.json';\n\nexport const VERSION: string = version;\n"],"mappings":";;;;;AAcA,IAAM,iBACJ,SACG;CACH,MAAM,aAAa,KAAK,WAAW,OAAO,WAAW;CACrD,OAAO,eAAe,KAAA,KAAa,WAAW,WAAW,IAAI,KAAA,IAAY;AAC3E;AAEA,IAAa,iBACX,MACA,kBACG;CACH,MAAM,aAAa,cAAc,IAAI;CAErC,IAAI,eAAe,KAAA,GACjB;CAGF,OAAO,WAAW,MAAM,cAAc,gBAAgB,SAAS,MAAM,aAAa;AACpF;AAEA,IAAa,oBACX,MACA,mBACG;CACH,MAAM,aAAa,cAAc,IAAI;CAErC,IAAI,eAAe,KAAA,GACjB;CAGF,OAAO,WAAW,MAAM,cAAc,eAAe,SAAS,gBAAgB,SAAS,KAAK,EAAE,CAAC;AACjG;AAEA,IAAa,mBAAmB,cAAyB;CACvD,MAAM,aAAa,UAAU;CAE7B,IAAI,iBAAiB,UAAU,KAAK,aAAa,WAAW,UAAU,GACpE,OAAO,WAAW,WAAW;CAG/B,IAAI,aAAa,UAAU,GACzB,OAAO,WAAW;AAItB;AAEA,IAAa,4BAA4B,cAAyB;CAChE,MAAM,aAAa,UAAU;CAE7B,IAAI,CAAC,iBAAiB,UAAU,GAC9B,OAAO;EAAE,IAAI;EAAM,OAAO,KAAA;CAAU;CAGtC,MAAM,CAAC,iBAAiB,WAAW;CAEnC,IAAI,kBAAkB,KAAA,GACpB,OAAO;EA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AQ;CAGjD,MAAM,KAAK,IAAI,GAAG,WAAW,SAAS,GAAG,WAAW,KAAK,GAAG,WAAW,QAAQ;CAE/E,OAAO,MAAM,KAAK,IAAI;AACxB;;;AClBA,IAAa,4BAAb,cAA+C,MAAM;CACnD;CAEA,YAAY,YAAkC;EAC5C,MAAM,iBAAiB,UAAU,CAAC;EAClC,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;;;AETA,IAAa,UAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestbridge/core",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "lint": "biome check ."
27
27
  },
28
28
  "dependencies": {
29
- "typescript": "^5.7.2"
29
+ "typescript": "^7.0.2"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/node": "^22.10.2",
33
- "vite": "^6.0.7",
34
- "vite-plugin-dts": "^4.4.0",
32
+ "@types/node": "^26.4.1",
33
+ "rolldown-plugin-dts": "^0.28.5",
34
+ "vite": "^8.2.2",
35
35
  "vitest": "^5.0.0"
36
36
  }
37
37
  }