@nestbridge/core 0.1.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,19 @@ export declare const analyzeControllers: (filePaths: readonly string[]) => {
3
3
  diagnostics: NestBridgeDiagnostic[];
4
4
  };
5
5
 
6
+ export declare const analyzeResolvers: (filePaths: readonly string[]) => {
7
+ resolvers: ResolverDefinition[];
8
+ diagnostics: NestBridgeDiagnostic[];
9
+ };
10
+
11
+ declare interface ClientDeclarationSource {
12
+ name: string;
13
+ sourceFile: string;
14
+ methods: readonly {
15
+ name: string;
16
+ }[];
17
+ }
18
+
6
19
  export declare interface ControllerDefinition {
7
20
  name: string;
8
21
  path: string;
@@ -40,7 +53,9 @@ export declare type ControllerParameterDefinition = (ControllerParameterBase & {
40
53
 
41
54
  export declare const formatDiagnostic: (diagnostic: NestBridgeDiagnostic) => string;
42
55
 
43
- export declare const generateControllerDeclaration: (controller: ControllerDefinition, outputFilePath: string) => string;
56
+ export declare const generateControllerDeclaration: (controller: ClientDeclarationSource, outputFilePath: string) => string;
57
+
58
+ export declare type GraphqlOperationKind = 'query' | 'mutation';
44
59
 
45
60
  export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
46
61
 
@@ -57,7 +72,7 @@ export declare interface NestBridgeDiagnostic {
57
72
  column: number;
58
73
  }
59
74
 
60
- export declare type NestBridgeDiagnosticCode = 'unsupported-route' | 'unsupported-parameter';
75
+ export declare type NestBridgeDiagnosticCode = 'unsupported-route' | 'unsupported-parameter' | 'unsupported-argument' | 'unsupported-return-type' | 'circular-type';
61
76
 
62
77
  export declare class NestBridgeDiagnosticError extends Error {
63
78
  readonly diagnostic: NestBridgeDiagnostic;
@@ -66,6 +81,34 @@ export declare class NestBridgeDiagnosticError extends Error {
66
81
 
67
82
  export declare type ParameterSourceKind = 'param' | 'query' | 'body' | 'header';
68
83
 
84
+ export declare interface ResolverArgumentDefinition {
85
+ index: number;
86
+ parameterName: string;
87
+ name: string;
88
+ graphqlType: string;
89
+ }
90
+
91
+ export declare interface ResolverDefinition {
92
+ name: string;
93
+ sourceFile: string;
94
+ methods: ResolverMethodDefinition[];
95
+ }
96
+
97
+ export declare interface ResolverMethodDefinition {
98
+ name: string;
99
+ operationKind: GraphqlOperationKind;
100
+ operationName: string;
101
+ arguments: ResolverArgumentDefinition[];
102
+ selection: SelectionField[];
103
+ line: number;
104
+ column: number;
105
+ }
106
+
107
+ export declare interface SelectionField {
108
+ name: string;
109
+ children?: SelectionField[];
110
+ }
111
+
69
112
  export declare const VERSION: string;
70
113
 
71
114
  export { }
@@ -1,6 +1,6 @@
1
- import { readFileSync } from 'node:fs';
1
+ import { readFileSync, existsSync } from 'node:fs';
2
2
  import ts from 'typescript';
3
- import { relative, dirname, extname } from 'node:path';
3
+ import { resolve, dirname, relative, extname } from 'node:path';
4
4
 
5
5
  const findDecorator = (node, decoratorName) => {
6
6
  const decorators = ts.getDecorators(node);
@@ -291,6 +291,608 @@ const analyzeControllers = (filePaths) => {
291
291
  return { controllers, diagnostics };
292
292
  };
293
293
 
294
+ const GRAPHQL_OPERATION_DECORATOR_NAMES = {
295
+ Query: "query",
296
+ Mutation: "mutation"
297
+ };
298
+
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
+ const readTypeThunkExpression = (thunk) => {
366
+ if (!ts.isBlock(thunk.body)) {
367
+ return thunk.body;
368
+ }
369
+ const returnStatement = thunk.body.statements.find(ts.isReturnStatement);
370
+ return returnStatement?.expression;
371
+ };
372
+
373
+ const readArgsTypeOption = (decorator) => {
374
+ if (!ts.isCallExpression(decorator.expression)) {
375
+ return void 0;
376
+ }
377
+ const optionsArgument = decorator.expression.arguments.find(ts.isObjectLiteralExpression);
378
+ if (optionsArgument === void 0) {
379
+ return void 0;
380
+ }
381
+ const typeProperty = optionsArgument.properties.find(
382
+ (property) => ts.isPropertyAssignment(property) && ts.isIdentifier(property.name) && property.name.text === "type"
383
+ );
384
+ if (typeProperty === void 0) {
385
+ return void 0;
386
+ }
387
+ const thunk = typeProperty.initializer;
388
+ if (!ts.isArrowFunction(thunk) && !ts.isFunctionExpression(thunk)) {
389
+ return void 0;
390
+ }
391
+ const returnedExpression = readTypeThunkExpression(thunk);
392
+ if (returnedExpression === void 0) {
393
+ return void 0;
394
+ }
395
+ if (ts.isArrayLiteralExpression(returnedExpression)) {
396
+ const element = returnedExpression.elements[0];
397
+ return element !== void 0 && ts.isIdentifier(element) ? { typeName: element.text, isArray: true } : void 0;
398
+ }
399
+ return ts.isIdentifier(returnedExpression) ? { typeName: returnedExpression.text, isArray: false } : void 0;
400
+ };
401
+
402
+ const extractResolverArgumentDefinition = (parameter, index, context) => {
403
+ const decorator = findAnyDecorator(parameter, ["Args"]);
404
+ const location = locationOf(context.sourceFile, parameter);
405
+ if (decorator === void 0) {
406
+ context.diagnostics.push({
407
+ code: "unsupported-argument",
408
+ title: "Unsupported argument.",
409
+ controllerName: context.resolverName,
410
+ memberName: context.methodName,
411
+ detail: `Parameter "${parameter.name.getText()}" must be decorated with @Args to be transported through a NestBridge GraphQL client.`,
412
+ filePath: context.filePath,
413
+ line: location.line,
414
+ column: location.column
415
+ });
416
+ return void 0;
417
+ }
418
+ if (!ts.isIdentifier(parameter.name)) {
419
+ context.diagnostics.push({
420
+ code: "unsupported-argument",
421
+ title: "Unsupported argument.",
422
+ controllerName: context.resolverName,
423
+ memberName: context.methodName,
424
+ detail: "Destructured parameters cannot be transported through a NestBridge GraphQL client.",
425
+ filePath: context.filePath,
426
+ line: location.line,
427
+ column: location.column
428
+ });
429
+ return void 0;
430
+ }
431
+ const nameArgument = readStaticStringArgument(decorator);
432
+ if (!nameArgument.ok) {
433
+ context.diagnostics.push({
434
+ code: "unsupported-argument",
435
+ title: "Unsupported argument.",
436
+ controllerName: context.resolverName,
437
+ memberName: context.methodName,
438
+ detail: "@Args() name must be a statically analyzable string literal.",
439
+ found: `@Args(${nameArgument.argumentText})`,
440
+ filePath: context.filePath,
441
+ line: location.line,
442
+ column: location.column
443
+ });
444
+ return void 0;
445
+ }
446
+ if (nameArgument.value === void 0) {
447
+ context.diagnostics.push({
448
+ code: "unsupported-argument",
449
+ title: "Unsupported argument.",
450
+ controllerName: context.resolverName,
451
+ memberName: context.methodName,
452
+ detail: "A whole @Args() is not supported; provide an argument name such as @Args('id').",
453
+ filePath: context.filePath,
454
+ line: location.line,
455
+ column: location.column
456
+ });
457
+ return void 0;
458
+ }
459
+ if (parameter.type === void 0) {
460
+ context.diagnostics.push({
461
+ code: "unsupported-argument",
462
+ title: "Unsupported argument.",
463
+ controllerName: context.resolverName,
464
+ memberName: context.methodName,
465
+ detail: `@Args() parameter "${parameter.name.text}" needs an explicit type annotation.`,
466
+ filePath: context.filePath,
467
+ line: location.line,
468
+ column: location.column
469
+ });
470
+ return void 0;
471
+ }
472
+ const unwrapped = unwrapTypeNode(parameter.type);
473
+ if (unwrapped === void 0) {
474
+ context.diagnostics.push({
475
+ code: "unsupported-argument",
476
+ title: "Unsupported argument.",
477
+ controllerName: context.resolverName,
478
+ memberName: context.methodName,
479
+ detail: `@Args() parameter "${parameter.name.text}" has a type NestBridge cannot statically resolve to a GraphQL type.`,
480
+ found: parameter.type.getText(),
481
+ filePath: context.filePath,
482
+ line: location.line,
483
+ column: location.column
484
+ });
485
+ return void 0;
486
+ }
487
+ const explicitType = readArgsTypeOption(decorator);
488
+ return {
489
+ index,
490
+ parameterName: parameter.name.text,
491
+ name: nameArgument.value,
492
+ graphqlType: graphqlTypeStringFor(unwrapped, explicitType?.typeName)
493
+ };
494
+ };
495
+
496
+ const parsedFilesByPath = /* @__PURE__ */ new Map();
497
+ const parseFile = (filePath) => {
498
+ const cached = parsedFilesByPath.get(filePath);
499
+ if (cached !== void 0) {
500
+ return cached;
501
+ }
502
+ const content = readFileSync(filePath, "utf-8");
503
+ const sourceFile = ts.createSourceFile(
504
+ filePath,
505
+ content,
506
+ ts.ScriptTarget.ESNext,
507
+ true,
508
+ ts.ScriptKind.TS
509
+ );
510
+ parsedFilesByPath.set(filePath, sourceFile);
511
+ return sourceFile;
512
+ };
513
+ const resolveModuleFile = (fromFilePath, moduleSpecifierText) => {
514
+ if (!moduleSpecifierText.startsWith(".")) {
515
+ return void 0;
516
+ }
517
+ const base = resolve(dirname(fromFilePath), moduleSpecifierText);
518
+ const candidates = [`${base}.ts`, `${base}.tsx`, resolve(base, "index.ts")];
519
+ return candidates.find((candidate) => existsSync(candidate));
520
+ };
521
+ const findExportedDeclaration = (sourceFile, name) => sourceFile.statements.find(
522
+ (statement) => ts.isClassDeclaration(statement) && statement.name?.text === name
523
+ );
524
+ const findImportSource = (sourceFile, localName) => {
525
+ for (const statement of sourceFile.statements) {
526
+ if (!ts.isImportDeclaration(statement) || !ts.isStringLiteralLike(statement.moduleSpecifier)) {
527
+ continue;
528
+ }
529
+ const namedBindings = statement.importClause?.namedBindings;
530
+ if (namedBindings === void 0 || !ts.isNamedImports(namedBindings)) {
531
+ continue;
532
+ }
533
+ const element = namedBindings.elements.find((candidate) => candidate.name.text === localName);
534
+ if (element !== void 0) {
535
+ return {
536
+ moduleSpecifierText: statement.moduleSpecifier.text,
537
+ importedName: element.propertyName?.text ?? element.name.text
538
+ };
539
+ }
540
+ }
541
+ return void 0;
542
+ };
543
+ const findReExportSource = (sourceFile, name) => {
544
+ for (const statement of sourceFile.statements) {
545
+ if (!ts.isExportDeclaration(statement) || statement.moduleSpecifier === void 0 || !ts.isStringLiteralLike(statement.moduleSpecifier)) {
546
+ continue;
547
+ }
548
+ if (statement.exportClause === void 0) {
549
+ return statement.moduleSpecifier.text;
550
+ }
551
+ if (ts.isNamedExports(statement.exportClause) && statement.exportClause.elements.some(
552
+ (element) => (element.propertyName?.text ?? element.name.text) === name
553
+ )) {
554
+ return statement.moduleSpecifier.text;
555
+ }
556
+ }
557
+ return void 0;
558
+ };
559
+ const resolveClassDeclaration = (name, fromSourceFile, fromFilePath, visited = /* @__PURE__ */ new Set()) => {
560
+ if (visited.has(fromFilePath)) {
561
+ return void 0;
562
+ }
563
+ visited.add(fromFilePath);
564
+ const direct = findExportedDeclaration(fromSourceFile, name);
565
+ if (direct !== void 0) {
566
+ return { classDeclaration: direct, sourceFile: fromSourceFile, filePath: fromFilePath };
567
+ }
568
+ const importSource = findImportSource(fromSourceFile, name);
569
+ if (importSource !== void 0) {
570
+ const resolvedPath = resolveModuleFile(fromFilePath, importSource.moduleSpecifierText);
571
+ if (resolvedPath !== void 0) {
572
+ const nextSourceFile = parseFile(resolvedPath);
573
+ const result = resolveClassDeclaration(
574
+ importSource.importedName,
575
+ nextSourceFile,
576
+ resolvedPath,
577
+ visited
578
+ );
579
+ if (result !== void 0) {
580
+ return result;
581
+ }
582
+ }
583
+ }
584
+ const reExportModuleSpecifierText = findReExportSource(fromSourceFile, name);
585
+ if (reExportModuleSpecifierText !== void 0) {
586
+ const resolvedPath = resolveModuleFile(fromFilePath, reExportModuleSpecifierText);
587
+ if (resolvedPath !== void 0) {
588
+ const nextSourceFile = parseFile(resolvedPath);
589
+ return resolveClassDeclaration(name, nextSourceFile, resolvedPath, visited);
590
+ }
591
+ }
592
+ return void 0;
593
+ };
594
+
595
+ const PRIMITIVE_SCALAR_NAMES$1 = /* @__PURE__ */ new Set(["string", "number", "boolean"]);
596
+ const extractSelectionFields = (classDeclaration, sourceFile, filePath, context) => {
597
+ const typeName = classDeclaration.name?.text ?? "(anonymous type)";
598
+ const location = locationOf(sourceFile, classDeclaration);
599
+ if (context.visitedTypeNames.has(typeName)) {
600
+ context.diagnostics.push({
601
+ code: "circular-type",
602
+ title: "Circular type.",
603
+ controllerName: context.resolverName,
604
+ memberName: context.methodName,
605
+ detail: `Type "${typeName}" references itself, directly or indirectly. NestBridge cannot build a finite GraphQL selection set for it.`,
606
+ filePath,
607
+ line: location.line,
608
+ column: location.column
609
+ });
610
+ return void 0;
611
+ }
612
+ const nextVisited = new Set(context.visitedTypeNames).add(typeName);
613
+ const properties = classDeclaration.members.filter(
614
+ (member) => ts.isPropertyDeclaration(member) && findDecorator(member, "Field") !== void 0
615
+ );
616
+ const fields = [];
617
+ for (const property of properties) {
618
+ if (!ts.isIdentifier(property.name)) {
619
+ continue;
620
+ }
621
+ const fieldName = property.name.text;
622
+ const fieldLocation = locationOf(sourceFile, property);
623
+ if (property.type === void 0) {
624
+ context.diagnostics.push({
625
+ code: "unsupported-return-type",
626
+ title: "Unsupported field type.",
627
+ controllerName: context.resolverName,
628
+ memberName: context.methodName,
629
+ detail: `Field "${fieldName}" on "${typeName}" needs an explicit type annotation.`,
630
+ filePath,
631
+ line: fieldLocation.line,
632
+ column: fieldLocation.column
633
+ });
634
+ return void 0;
635
+ }
636
+ const unwrapped = unwrapTypeNode(property.type);
637
+ if (unwrapped === void 0) {
638
+ context.diagnostics.push({
639
+ code: "unsupported-return-type",
640
+ title: "Unsupported field type.",
641
+ controllerName: context.resolverName,
642
+ memberName: context.methodName,
643
+ detail: `Field "${fieldName}" on "${typeName}" has a type NestBridge cannot statically resolve.`,
644
+ found: property.type.getText(),
645
+ filePath,
646
+ line: fieldLocation.line,
647
+ column: fieldLocation.column
648
+ });
649
+ return void 0;
650
+ }
651
+ if (PRIMITIVE_SCALAR_NAMES$1.has(unwrapped.identifierText)) {
652
+ fields.push({ name: fieldName });
653
+ continue;
654
+ }
655
+ const resolved = resolveClassDeclaration(unwrapped.identifierText, sourceFile, filePath);
656
+ if (resolved === void 0) {
657
+ fields.push({ name: fieldName });
658
+ continue;
659
+ }
660
+ if (findDecorator(resolved.classDeclaration, "ObjectType") === void 0) {
661
+ context.diagnostics.push({
662
+ code: "unsupported-return-type",
663
+ title: "Unsupported field type.",
664
+ controllerName: context.resolverName,
665
+ memberName: context.methodName,
666
+ 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.`,
667
+ filePath,
668
+ line: fieldLocation.line,
669
+ column: fieldLocation.column
670
+ });
671
+ return void 0;
672
+ }
673
+ const children = extractSelectionFields(
674
+ resolved.classDeclaration,
675
+ resolved.sourceFile,
676
+ resolved.filePath,
677
+ {
678
+ ...context,
679
+ visitedTypeNames: nextVisited
680
+ }
681
+ );
682
+ if (children === void 0) {
683
+ return void 0;
684
+ }
685
+ fields.push({ name: fieldName, children });
686
+ }
687
+ return fields;
688
+ };
689
+
690
+ const readNameFromOptions = (optionsArgument) => {
691
+ const nameProperty = optionsArgument.properties.find(
692
+ (property) => ts.isPropertyAssignment(property) && ts.isIdentifier(property.name) && property.name.text === "name"
693
+ );
694
+ if (nameProperty === void 0 || !ts.isStringLiteralLike(nameProperty.initializer)) {
695
+ return void 0;
696
+ }
697
+ return nameProperty.initializer.text;
698
+ };
699
+ const readGraphqlOperationName = (decorator) => {
700
+ const expression = decorator.expression;
701
+ if (!ts.isCallExpression(expression)) {
702
+ return { ok: true, value: void 0 };
703
+ }
704
+ let value;
705
+ for (const argument of expression.arguments) {
706
+ if (ts.isArrowFunction(argument) || ts.isFunctionExpression(argument)) {
707
+ continue;
708
+ }
709
+ if (ts.isStringLiteralLike(argument)) {
710
+ value = argument.text;
711
+ continue;
712
+ }
713
+ if (ts.isObjectLiteralExpression(argument)) {
714
+ value = readNameFromOptions(argument) ?? value;
715
+ continue;
716
+ }
717
+ return { ok: false, argumentText: argument.getText() };
718
+ }
719
+ return { ok: true, value };
720
+ };
721
+
722
+ const readGraphqlReturnTypeOption = (decorator) => {
723
+ if (!ts.isCallExpression(decorator.expression)) {
724
+ return void 0;
725
+ }
726
+ const thunk = decorator.expression.arguments.find(
727
+ (argument) => ts.isArrowFunction(argument) || ts.isFunctionExpression(argument)
728
+ );
729
+ if (thunk === void 0) {
730
+ return void 0;
731
+ }
732
+ const returnedExpression = readTypeThunkExpression(thunk);
733
+ if (returnedExpression === void 0) {
734
+ return void 0;
735
+ }
736
+ if (ts.isArrayLiteralExpression(returnedExpression)) {
737
+ const element = returnedExpression.elements[0];
738
+ return element !== void 0 && ts.isIdentifier(element) ? element.text : void 0;
739
+ }
740
+ return ts.isIdentifier(returnedExpression) ? returnedExpression.text : void 0;
741
+ };
742
+
743
+ const PRIMITIVE_SCALAR_NAMES = /* @__PURE__ */ new Set(["string", "number", "boolean"]);
744
+ const extractResolverMethodDefinition = (method, context) => {
745
+ const decorator = findAnyDecorator(method, Object.keys(GRAPHQL_OPERATION_DECORATOR_NAMES));
746
+ if (decorator === void 0) {
747
+ return void 0;
748
+ }
749
+ const methodName = method.name.getText();
750
+ const decoratorName = decoratorNameOf(decorator);
751
+ const location = locationOf(context.sourceFile, method);
752
+ if (decoratorName === void 0) {
753
+ return void 0;
754
+ }
755
+ const operationKind = GRAPHQL_OPERATION_DECORATOR_NAMES[decoratorName];
756
+ if (operationKind === void 0) {
757
+ return void 0;
758
+ }
759
+ const nameArgument = readGraphqlOperationName(decorator);
760
+ if (!nameArgument.ok) {
761
+ context.diagnostics.push({
762
+ code: "unsupported-route",
763
+ title: "Unsupported operation name.",
764
+ controllerName: context.resolverName,
765
+ memberName: methodName,
766
+ detail: "GraphQL operation names must be statically analyzable string literals.",
767
+ found: `@${decoratorName}(${nameArgument.argumentText})`,
768
+ filePath: context.filePath,
769
+ line: location.line,
770
+ column: location.column
771
+ });
772
+ return void 0;
773
+ }
774
+ const decoratorReturnType = readGraphqlReturnTypeOption(decorator);
775
+ const identifierText = decoratorReturnType ?? (method.type === void 0 ? void 0 : unwrapTypeNode(method.type)?.identifierText);
776
+ if (identifierText === void 0) {
777
+ context.diagnostics.push({
778
+ code: "unsupported-return-type",
779
+ title: "Unsupported return type.",
780
+ controllerName: context.resolverName,
781
+ memberName: methodName,
782
+ detail: '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.',
783
+ filePath: context.filePath,
784
+ line: location.line,
785
+ column: location.column
786
+ });
787
+ return void 0;
788
+ }
789
+ let selection = [];
790
+ if (!PRIMITIVE_SCALAR_NAMES.has(identifierText.toLowerCase())) {
791
+ const resolved = resolveClassDeclaration(identifierText, context.sourceFile, context.filePath);
792
+ if (resolved === void 0 && decoratorReturnType === void 0) {
793
+ context.diagnostics.push({
794
+ code: "unsupported-return-type",
795
+ title: "Unsupported return type.",
796
+ controllerName: context.resolverName,
797
+ memberName: methodName,
798
+ detail: `NestBridge could not locate the declaration of type "${identifierText}".`,
799
+ filePath: context.filePath,
800
+ line: location.line,
801
+ column: location.column
802
+ });
803
+ return void 0;
804
+ }
805
+ if (resolved !== void 0) {
806
+ const fields = extractSelectionFields(
807
+ resolved.classDeclaration,
808
+ resolved.sourceFile,
809
+ resolved.filePath,
810
+ {
811
+ resolverName: context.resolverName,
812
+ methodName,
813
+ diagnostics: context.diagnostics,
814
+ visitedTypeNames: /* @__PURE__ */ new Set()
815
+ }
816
+ );
817
+ if (fields === void 0) {
818
+ return void 0;
819
+ }
820
+ selection = fields;
821
+ }
822
+ }
823
+ const args = method.parameters.map(
824
+ (parameter, index) => extractResolverArgumentDefinition(parameter, index, {
825
+ sourceFile: context.sourceFile,
826
+ filePath: context.filePath,
827
+ resolverName: context.resolverName,
828
+ methodName,
829
+ diagnostics: context.diagnostics
830
+ })
831
+ );
832
+ if (args.some((argument) => argument === void 0)) {
833
+ return void 0;
834
+ }
835
+ return {
836
+ name: methodName,
837
+ operationKind,
838
+ operationName: nameArgument.value ?? methodName,
839
+ arguments: args.filter((argument) => argument !== void 0),
840
+ selection,
841
+ line: location.line,
842
+ column: location.column
843
+ };
844
+ };
845
+
846
+ const extractResolverDefinition = (classDeclaration, sourceFile, filePath, diagnostics) => {
847
+ const resolverName = classDeclaration.name?.text ?? "(anonymous resolver)";
848
+ const methods = classDeclaration.members.filter((member) => ts.isMethodDeclaration(member)).map(
849
+ (method) => extractResolverMethodDefinition(method, {
850
+ sourceFile,
851
+ filePath,
852
+ resolverName,
853
+ diagnostics
854
+ })
855
+ ).filter((method) => method !== void 0);
856
+ return {
857
+ name: resolverName,
858
+ sourceFile: filePath,
859
+ methods
860
+ };
861
+ };
862
+
863
+ const findResolverClasses = (sourceFile) => {
864
+ return sourceFile.statements.filter(
865
+ (statement) => ts.isClassDeclaration(statement) && findDecorator(statement, "Resolver") !== void 0
866
+ );
867
+ };
868
+
869
+ const analyzeResolvers = (filePaths) => {
870
+ const diagnostics = [];
871
+ const resolvers = [];
872
+ for (const filePath of filePaths) {
873
+ const content = readFileSync(filePath, "utf-8");
874
+ const sourceFile = ts.createSourceFile(
875
+ filePath,
876
+ content,
877
+ ts.ScriptTarget.ESNext,
878
+ true,
879
+ ts.ScriptKind.TS
880
+ );
881
+ for (const classDeclaration of findResolverClasses(sourceFile)) {
882
+ const resolver = extractResolverDefinition(
883
+ classDeclaration,
884
+ sourceFile,
885
+ filePath,
886
+ diagnostics
887
+ );
888
+ if (resolver !== void 0) {
889
+ resolvers.push(resolver);
890
+ }
891
+ }
892
+ }
893
+ return { resolvers, diagnostics };
894
+ };
895
+
294
896
  const toPosixPath = (filePath) => filePath.replace(/\\/g, "/");
295
897
  const importSpecifierFor = (sourceFile, outputFilePath) => {
296
898
  if (!sourceFile.startsWith(".") && !/^[A-Za-z]:[\\/]/.test(sourceFile) && !sourceFile.startsWith("/")) {
@@ -348,9 +950,9 @@ class NestBridgeDiagnosticError extends Error {
348
950
  }
349
951
  }
350
952
 
351
- const version = "0.1.1";
953
+ const version = "1.0.0";
352
954
 
353
955
  const VERSION = version;
354
956
 
355
- export { NestBridgeDiagnosticError, VERSION, analyzeControllers, formatDiagnostic, generateControllerDeclaration };
957
+ export { NestBridgeDiagnosticError, VERSION, analyzeControllers, analyzeResolvers, formatDiagnostic, generateControllerDeclaration };
356
958
  //# sourceMappingURL=nestbridge.core.js.map
@@ -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/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: ts.ClassDeclaration | ts.MethodDeclaration | ts.ParameterDeclaration,\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: ts.ClassDeclaration | ts.MethodDeclaration | ts.ParameterDeclaration,\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","import { dirname, extname, relative } from 'node:path';\nimport type { ControllerDefinition } from '../models';\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: ControllerDefinition,\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":[],"mappings":";;;;AAEO,MAAM,aAAA,GAAgB,CAC3B,IAAA,EACA,aAA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AiB,UAAU,CAAC,CAAA;AAClC,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AACZ,IAAA,IAAA,CAAK,UAAA,GAAa,UAAA;AAAA,EACpB;AACF;;;;ACTO,MAAM,OAAA,GAAkB;;"}
1
+ {"version":3,"file":"nestbridge.core.js","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,CAAA,IAAK,EA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