@nestbridge/core 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -8
- package/build/nestbridge.core.d.ts +4 -0
- package/build/nestbridge.core.js +103 -71
- package/build/nestbridge.core.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
[](https://github.com/MDReal32/nestbridge/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@nestbridge/core)
|
|
5
5
|
|
|
6
|
-
Static analysis of NestJS controllers
|
|
7
|
-
`.d.ts` declarations that make them safely importable
|
|
6
|
+
Static analysis of NestJS controllers and GraphQL resolvers, and generation
|
|
7
|
+
of the client-facing `.d.ts` declarations that make them safely importable
|
|
8
|
+
from the browser.
|
|
8
9
|
|
|
9
10
|
This package has no runtime dependency on NestJS, Vite, or the DOM — it reads
|
|
10
11
|
TypeScript source text via the TypeScript Compiler API and never executes
|
|
@@ -37,13 +38,35 @@ const { controllers, diagnostics } = analyzeControllers([
|
|
|
37
38
|
]);
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
### `
|
|
41
|
+
### `analyzeResolvers(filePaths)`
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
Parses each file, finds classes decorated with `@Resolver(...)`, and
|
|
44
|
+
extracts a plain `ResolverDefinition` per resolver — its name, and each
|
|
45
|
+
`@Query`/`@Mutation` method's operation kind (`'query'` | `'mutation'`),
|
|
46
|
+
operation name, `@Args()` parameter mapping (name, GraphQL type), and a
|
|
47
|
+
`selection` of `SelectionField`s built by walking the return type's
|
|
48
|
+
`@ObjectType()` fields. The return type itself is read from the
|
|
49
|
+
`@Query()`/`@Mutation()` type-thunk argument (`() => UserType`) first,
|
|
50
|
+
falling back to a TypeScript return-type annotation only when no thunk is
|
|
51
|
+
present — a resolver method never needs both.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { analyzeResolvers } from '@nestbridge/core';
|
|
55
|
+
|
|
56
|
+
const { resolvers, diagnostics } = analyzeResolvers([
|
|
57
|
+
'src/users/users.resolver.ts',
|
|
58
|
+
]);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### `generateControllerDeclaration(definition, outputFilePath)`
|
|
62
|
+
|
|
63
|
+
Turns a `ControllerDefinition` or a `ResolverDefinition` into the text of a
|
|
64
|
+
`.d.ts` file — both share the same `{ name, sourceFile, methods }` shape, so
|
|
65
|
+
the same generator is used for both. The generated class re-declares each
|
|
66
|
+
method using a type-only reference back to the real controller or resolver
|
|
67
|
+
(`Parameters<__ServerX['method']>` / `RemoteResult<...>`), so argument and
|
|
68
|
+
return types are projected from the real class's own type — never re-derived
|
|
69
|
+
from the AST.
|
|
47
70
|
|
|
48
71
|
```ts
|
|
49
72
|
import { generateControllerDeclaration } from '@nestbridge/core';
|
|
@@ -65,6 +88,8 @@ more diagnostics as a thrown `Error`.
|
|
|
65
88
|
|
|
66
89
|
`ControllerDefinition`, `ControllerMethodDefinition`,
|
|
67
90
|
`ControllerParameterDefinition`, `HttpMethod`, `ParameterSourceKind`,
|
|
91
|
+
`ResolverDefinition`, `ResolverMethodDefinition`,
|
|
92
|
+
`ResolverArgumentDefinition`, `SelectionField`, `GraphqlOperationKind`,
|
|
68
93
|
`NestBridgeDiagnostic`, `NestBridgeDiagnosticCode`.
|
|
69
94
|
|
|
70
95
|
## License
|
|
@@ -13,6 +13,7 @@ declare interface ClientDeclarationSource {
|
|
|
13
13
|
sourceFile: string;
|
|
14
14
|
methods: readonly {
|
|
15
15
|
name: string;
|
|
16
|
+
responseKind?: ResponseKind;
|
|
16
17
|
}[];
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -28,6 +29,7 @@ export declare interface ControllerMethodDefinition {
|
|
|
28
29
|
httpMethod: HttpMethod;
|
|
29
30
|
path: string;
|
|
30
31
|
parameters: ControllerParameterDefinition[];
|
|
32
|
+
responseKind: ResponseKind;
|
|
31
33
|
line: number;
|
|
32
34
|
column: number;
|
|
33
35
|
}
|
|
@@ -104,6 +106,8 @@ export declare interface ResolverMethodDefinition {
|
|
|
104
106
|
column: number;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
export declare type ResponseKind = 'json' | 'observable' | 'stream';
|
|
110
|
+
|
|
107
111
|
export declare interface SelectionField {
|
|
108
112
|
name: string;
|
|
109
113
|
children?: SelectionField[];
|
package/build/nestbridge.core.js
CHANGED
|
@@ -159,6 +159,91 @@ const extractParameterDefinition = (parameter, index, context) => {
|
|
|
159
159
|
return { ...base, kind: "body", name: argument.value };
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
const PRIMITIVE_SCALAR_TYPES = {
|
|
163
|
+
string: "String",
|
|
164
|
+
number: "Float",
|
|
165
|
+
boolean: "Boolean"
|
|
166
|
+
};
|
|
167
|
+
const unwrapPromise = (typeNode) => {
|
|
168
|
+
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName) && typeNode.typeName.text === "Promise" && typeNode.typeArguments?.[0] !== void 0) {
|
|
169
|
+
return unwrapPromise(typeNode.typeArguments[0]);
|
|
170
|
+
}
|
|
171
|
+
return typeNode;
|
|
172
|
+
};
|
|
173
|
+
const unwrapNullable = (typeNode) => {
|
|
174
|
+
if (!ts.isUnionTypeNode(typeNode)) {
|
|
175
|
+
return { inner: typeNode, isNullable: false };
|
|
176
|
+
}
|
|
177
|
+
const nonNullMembers = typeNode.types.filter(
|
|
178
|
+
(member) => member.kind !== ts.SyntaxKind.NullKeyword && member.kind !== ts.SyntaxKind.UndefinedKeyword
|
|
179
|
+
);
|
|
180
|
+
const [onlyMember] = nonNullMembers;
|
|
181
|
+
if (nonNullMembers.length !== 1 || onlyMember === void 0) {
|
|
182
|
+
return { inner: typeNode, isNullable: nonNullMembers.length !== typeNode.types.length };
|
|
183
|
+
}
|
|
184
|
+
return { inner: onlyMember, isNullable: true };
|
|
185
|
+
};
|
|
186
|
+
const unwrapArrayElement = (typeNode) => {
|
|
187
|
+
if (ts.isArrayTypeNode(typeNode)) {
|
|
188
|
+
return typeNode.elementType;
|
|
189
|
+
}
|
|
190
|
+
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName) && typeNode.typeName.text === "Array" && typeNode.typeArguments?.[0] !== void 0) {
|
|
191
|
+
return typeNode.typeArguments[0];
|
|
192
|
+
}
|
|
193
|
+
return void 0;
|
|
194
|
+
};
|
|
195
|
+
const identifierTextOf = (typeNode) => {
|
|
196
|
+
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {
|
|
197
|
+
return typeNode.typeName.text;
|
|
198
|
+
}
|
|
199
|
+
switch (typeNode.kind) {
|
|
200
|
+
case ts.SyntaxKind.StringKeyword:
|
|
201
|
+
return "string";
|
|
202
|
+
case ts.SyntaxKind.NumberKeyword:
|
|
203
|
+
return "number";
|
|
204
|
+
case ts.SyntaxKind.BooleanKeyword:
|
|
205
|
+
return "boolean";
|
|
206
|
+
default:
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const unwrapTypeNode = (typeNode) => {
|
|
211
|
+
const withoutPromise = unwrapPromise(typeNode);
|
|
212
|
+
const { inner: withoutNullable, isNullable } = unwrapNullable(withoutPromise);
|
|
213
|
+
const arrayElement = unwrapArrayElement(withoutNullable);
|
|
214
|
+
const element = arrayElement === void 0 ? withoutNullable : unwrapNullable(arrayElement).inner;
|
|
215
|
+
const identifierText = identifierTextOf(element);
|
|
216
|
+
if (identifierText === void 0) {
|
|
217
|
+
return void 0;
|
|
218
|
+
}
|
|
219
|
+
return { identifierText, isArray: arrayElement !== void 0, isNullable };
|
|
220
|
+
};
|
|
221
|
+
const graphqlScalarNameFor = (identifierText) => PRIMITIVE_SCALAR_TYPES[identifierText] ?? identifierText;
|
|
222
|
+
const graphqlTypeStringFor = (unwrapped, explicitTypeName) => {
|
|
223
|
+
const baseName = explicitTypeName ?? graphqlScalarNameFor(unwrapped.identifierText);
|
|
224
|
+
const wrapped = unwrapped.isArray ? `[${baseName}!]` : baseName;
|
|
225
|
+
return unwrapped.isNullable ? wrapped : `${wrapped}!`;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const OBSERVABLE_TYPE_NAME = "Observable";
|
|
229
|
+
const STREAMABLE_FILE_TYPE_NAME = "StreamableFile";
|
|
230
|
+
const readResponseKind = (returnType) => {
|
|
231
|
+
if (returnType === void 0) {
|
|
232
|
+
return "json";
|
|
233
|
+
}
|
|
234
|
+
const unwrapped = unwrapPromise(returnType);
|
|
235
|
+
if (!ts.isTypeReferenceNode(unwrapped) || !ts.isIdentifier(unwrapped.typeName)) {
|
|
236
|
+
return "json";
|
|
237
|
+
}
|
|
238
|
+
if (unwrapped.typeName.text === OBSERVABLE_TYPE_NAME) {
|
|
239
|
+
return "observable";
|
|
240
|
+
}
|
|
241
|
+
if (unwrapped.typeName.text === STREAMABLE_FILE_TYPE_NAME) {
|
|
242
|
+
return "stream";
|
|
243
|
+
}
|
|
244
|
+
return "json";
|
|
245
|
+
};
|
|
246
|
+
|
|
162
247
|
const trimSlashes = (segment) => segment.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
163
248
|
const joinRoutePath = (controllerPath, methodPath) => {
|
|
164
249
|
const segments = [trimSlashes(controllerPath), trimSlashes(methodPath ?? "")].filter(
|
|
@@ -214,6 +299,7 @@ const extractMethodDefinition = (method, context) => {
|
|
|
214
299
|
httpMethod,
|
|
215
300
|
path: joinRoutePath(context.controllerPath, routeArgument.value),
|
|
216
301
|
parameters: parameters.filter((parameter) => parameter !== void 0),
|
|
302
|
+
responseKind: readResponseKind(method.type),
|
|
217
303
|
line: location.line,
|
|
218
304
|
column: location.column
|
|
219
305
|
};
|
|
@@ -296,72 +382,6 @@ const GRAPHQL_OPERATION_DECORATOR_NAMES = {
|
|
|
296
382
|
Mutation: "mutation"
|
|
297
383
|
};
|
|
298
384
|
|
|
299
|
-
const PRIMITIVE_SCALAR_TYPES = {
|
|
300
|
-
string: "String",
|
|
301
|
-
number: "Float",
|
|
302
|
-
boolean: "Boolean"
|
|
303
|
-
};
|
|
304
|
-
const unwrapPromise = (typeNode) => {
|
|
305
|
-
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName) && typeNode.typeName.text === "Promise" && typeNode.typeArguments?.[0] !== void 0) {
|
|
306
|
-
return unwrapPromise(typeNode.typeArguments[0]);
|
|
307
|
-
}
|
|
308
|
-
return typeNode;
|
|
309
|
-
};
|
|
310
|
-
const unwrapNullable = (typeNode) => {
|
|
311
|
-
if (!ts.isUnionTypeNode(typeNode)) {
|
|
312
|
-
return { inner: typeNode, isNullable: false };
|
|
313
|
-
}
|
|
314
|
-
const nonNullMembers = typeNode.types.filter(
|
|
315
|
-
(member) => member.kind !== ts.SyntaxKind.NullKeyword && member.kind !== ts.SyntaxKind.UndefinedKeyword
|
|
316
|
-
);
|
|
317
|
-
const [onlyMember] = nonNullMembers;
|
|
318
|
-
if (nonNullMembers.length !== 1 || onlyMember === void 0) {
|
|
319
|
-
return { inner: typeNode, isNullable: nonNullMembers.length !== typeNode.types.length };
|
|
320
|
-
}
|
|
321
|
-
return { inner: onlyMember, isNullable: true };
|
|
322
|
-
};
|
|
323
|
-
const unwrapArrayElement = (typeNode) => {
|
|
324
|
-
if (ts.isArrayTypeNode(typeNode)) {
|
|
325
|
-
return typeNode.elementType;
|
|
326
|
-
}
|
|
327
|
-
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName) && typeNode.typeName.text === "Array" && typeNode.typeArguments?.[0] !== void 0) {
|
|
328
|
-
return typeNode.typeArguments[0];
|
|
329
|
-
}
|
|
330
|
-
return void 0;
|
|
331
|
-
};
|
|
332
|
-
const identifierTextOf = (typeNode) => {
|
|
333
|
-
if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {
|
|
334
|
-
return typeNode.typeName.text;
|
|
335
|
-
}
|
|
336
|
-
switch (typeNode.kind) {
|
|
337
|
-
case ts.SyntaxKind.StringKeyword:
|
|
338
|
-
return "string";
|
|
339
|
-
case ts.SyntaxKind.NumberKeyword:
|
|
340
|
-
return "number";
|
|
341
|
-
case ts.SyntaxKind.BooleanKeyword:
|
|
342
|
-
return "boolean";
|
|
343
|
-
default:
|
|
344
|
-
return void 0;
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
const unwrapTypeNode = (typeNode) => {
|
|
348
|
-
const withoutPromise = unwrapPromise(typeNode);
|
|
349
|
-
const { inner: withoutNullable, isNullable } = unwrapNullable(withoutPromise);
|
|
350
|
-
const arrayElement = unwrapArrayElement(withoutNullable);
|
|
351
|
-
const element = arrayElement === void 0 ? withoutNullable : unwrapNullable(arrayElement).inner;
|
|
352
|
-
const identifierText = identifierTextOf(element);
|
|
353
|
-
if (identifierText === void 0) {
|
|
354
|
-
return void 0;
|
|
355
|
-
}
|
|
356
|
-
return { identifierText, isArray: arrayElement !== void 0, isNullable };
|
|
357
|
-
};
|
|
358
|
-
const graphqlScalarNameFor = (identifierText) => PRIMITIVE_SCALAR_TYPES[identifierText] ?? identifierText;
|
|
359
|
-
const graphqlTypeStringFor = (unwrapped, explicitTypeName) => {
|
|
360
|
-
const baseName = explicitTypeName ?? graphqlScalarNameFor(unwrapped.identifierText);
|
|
361
|
-
const wrapped = unwrapped.isArray ? `[${baseName}!]` : baseName;
|
|
362
|
-
return unwrapped.isNullable ? wrapped : `${wrapped}!`;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
385
|
const readTypeThunkExpression = (thunk) => {
|
|
366
386
|
if (!ts.isBlock(thunk.body)) {
|
|
367
387
|
return thunk.body;
|
|
@@ -893,6 +913,11 @@ const analyzeResolvers = (filePaths) => {
|
|
|
893
913
|
return { resolvers, diagnostics };
|
|
894
914
|
};
|
|
895
915
|
|
|
916
|
+
const REMOTE_RESULT_HELPERS = {
|
|
917
|
+
json: "RemoteResult",
|
|
918
|
+
observable: "RemoteObservableResult",
|
|
919
|
+
stream: "RemoteStreamResult"
|
|
920
|
+
};
|
|
896
921
|
const toPosixPath = (filePath) => filePath.replace(/\\/g, "/");
|
|
897
922
|
const importSpecifierFor = (sourceFile, outputFilePath) => {
|
|
898
923
|
if (!sourceFile.startsWith(".") && !/^[A-Za-z]:[\\/]/.test(sourceFile) && !sourceFile.startsWith("/")) {
|
|
@@ -909,13 +934,20 @@ const generateControllerDeclaration = (controller, outputFilePath) => {
|
|
|
909
934
|
const sourceFileSpecifier = importSpecifierFor(controller.sourceFile, outputFilePath);
|
|
910
935
|
const importSpecifier = stripExtension(sourceFileSpecifier);
|
|
911
936
|
const serverAlias = `__Server${controller.name}`;
|
|
912
|
-
const methodDeclarations = controller.methods.map(
|
|
913
|
-
|
|
914
|
-
)
|
|
937
|
+
const methodDeclarations = controller.methods.map((method) => {
|
|
938
|
+
const helperName = REMOTE_RESULT_HELPERS[method.responseKind ?? "json"];
|
|
939
|
+
return ` ${method.name}(...args: Parameters<${serverAlias}['${method.name}']>): ${helperName}<${serverAlias}['${method.name}']>;`;
|
|
940
|
+
});
|
|
915
941
|
const classBody = [" constructor();", "", ...methodDeclarations].join("\n");
|
|
942
|
+
const usedHelperNames = new Set(
|
|
943
|
+
controller.methods.map((method) => REMOTE_RESULT_HELPERS[method.responseKind ?? "json"])
|
|
944
|
+
);
|
|
945
|
+
const helperImports = Array.from(
|
|
946
|
+
usedHelperNames.size > 0 ? usedHelperNames : ["RemoteResult"]
|
|
947
|
+
).sort();
|
|
916
948
|
return [
|
|
917
949
|
`import type { ${controller.name} as ${serverAlias} } from '${importSpecifier}';`,
|
|
918
|
-
`import type {
|
|
950
|
+
`import type { ${helperImports.join(", ")} } from '@nestbridge/runtime';`,
|
|
919
951
|
"",
|
|
920
952
|
"/**",
|
|
921
953
|
" * Generated by NestBridge — client-facing methods only.",
|
|
@@ -950,7 +982,7 @@ class NestBridgeDiagnosticError extends Error {
|
|
|
950
982
|
}
|
|
951
983
|
}
|
|
952
984
|
|
|
953
|
-
const version = "1.
|
|
985
|
+
const version = "1.1.0";
|
|
954
986
|
|
|
955
987
|
const VERSION = version;
|
|
956
988
|
|
|
@@ -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/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/graphql-scalar-type.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","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 { 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 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\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\nconst 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';\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';\n\ninterface ClientDeclarationSource {\n name: string;\n sourceFile: string;\n methods: readonly { name: string }[];\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(\n (method) =>\n ` ${method.name}(...args: Parameters<${serverAlias}['${method.name}']>): RemoteResult<${serverAlias}['${method.name}']>;`,\n );\n\n const classBody = [' constructor();', '', ...methodDeclarations].join('\\n');\n\n return [\n `import type { ${controller.name} as ${serverAlias} } from '${importSpecifier}';`,\n `import type { RemoteResult } 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,C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../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 V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