@nestbridge/core 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,118 +1,132 @@
1
- export declare const analyzeControllers: (filePaths: readonly string[]) => {
2
- controllers: ControllerDefinition[];
3
- diagnostics: NestBridgeDiagnostic[];
4
- };
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
- responseKind?: ResponseKind;
17
- }[];
18
- }
19
-
20
- export declare interface ControllerDefinition {
21
- name: string;
22
- path: string;
23
- sourceFile: string;
24
- methods: ControllerMethodDefinition[];
25
- }
26
-
27
- export declare interface ControllerMethodDefinition {
28
- name: string;
29
- httpMethod: HttpMethod;
30
- path: string;
31
- parameters: ControllerParameterDefinition[];
32
- responseKind: ResponseKind;
33
- line: number;
34
- column: number;
35
- }
36
-
37
- declare interface ControllerParameterBase {
38
- index: number;
39
- parameterName: string;
40
- }
41
-
42
- export declare type ControllerParameterDefinition = (ControllerParameterBase & {
43
- kind: 'param';
44
- name: string;
45
- }) | (ControllerParameterBase & {
46
- kind: 'query';
47
- name?: string;
48
- }) | (ControllerParameterBase & {
49
- kind: 'body';
50
- name?: string;
51
- }) | (ControllerParameterBase & {
52
- kind: 'header';
53
- name: string;
54
- });
55
-
56
- export declare const formatDiagnostic: (diagnostic: NestBridgeDiagnostic) => string;
57
-
58
- export declare const generateControllerDeclaration: (controller: ClientDeclarationSource, outputFilePath: string) => string;
59
-
60
- export declare type GraphqlOperationKind = 'query' | 'mutation';
61
-
62
- export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
63
-
64
- export declare interface NestBridgeDiagnostic {
65
- code: NestBridgeDiagnosticCode;
66
- title: string;
67
- controllerName: string;
68
- memberName: string;
69
- detail: string;
70
- found?: string;
71
- expected?: string;
72
- filePath: string;
73
- line: number;
74
- column: number;
75
- }
76
-
77
- export declare type NestBridgeDiagnosticCode = 'unsupported-route' | 'unsupported-parameter' | 'unsupported-argument' | 'unsupported-return-type' | 'circular-type';
78
-
79
- export declare class NestBridgeDiagnosticError extends Error {
80
- readonly diagnostic: NestBridgeDiagnostic;
81
- constructor(diagnostic: NestBridgeDiagnostic);
82
- }
83
-
84
- export declare type ParameterSourceKind = 'param' | 'query' | 'body' | 'header';
85
-
86
- export declare interface ResolverArgumentDefinition {
87
- index: number;
88
- parameterName: string;
89
- name: string;
90
- graphqlType: string;
91
- }
92
-
93
- export declare interface ResolverDefinition {
94
- name: string;
95
- sourceFile: string;
96
- methods: ResolverMethodDefinition[];
97
- }
98
-
99
- export declare interface ResolverMethodDefinition {
100
- name: string;
101
- operationKind: GraphqlOperationKind;
102
- operationName: string;
103
- arguments: ResolverArgumentDefinition[];
104
- selection: SelectionField[];
105
- line: number;
106
- column: number;
107
- }
108
-
109
- export declare type ResponseKind = 'json' | 'observable' | 'stream';
110
-
111
- export declare interface SelectionField {
112
- name: string;
113
- children?: SelectionField[];
114
- }
115
-
116
- export declare const VERSION: string;
117
-
118
- export { }
1
+ //#region src/diagnostics/nestbridge-diagnostic.d.ts
2
+ type NestBridgeDiagnosticCode = "unsupported-route" | "unsupported-parameter" | "unsupported-argument" | "unsupported-return-type" | "circular-type";
3
+ interface NestBridgeDiagnostic {
4
+ code: NestBridgeDiagnosticCode;
5
+ title: string;
6
+ controllerName: string;
7
+ memberName: string;
8
+ detail: string;
9
+ found?: string;
10
+ expected?: string;
11
+ filePath: string;
12
+ line: number;
13
+ column: number;
14
+ }
15
+ //#endregion
16
+ //#region src/diagnostics/format-diagnostic.d.ts
17
+ export declare const formatDiagnostic: (diagnostic: NestBridgeDiagnostic) => string;
18
+ //#endregion
19
+ //#region src/diagnostics/nestbridge-diagnostic-error.d.ts
20
+ export declare class NestBridgeDiagnosticError extends Error {
21
+ readonly diagnostic: NestBridgeDiagnostic;
22
+ constructor(diagnostic: NestBridgeDiagnostic);
23
+ }
24
+ //#endregion
25
+ //#region src/models/controller-parameter-definition.d.ts
26
+ type ParameterSourceKind = "param" | "query" | "body" | "header";
27
+ interface ControllerParameterBase {
28
+ index: number;
29
+ parameterName: string;
30
+ }
31
+ type ControllerParameterDefinition = (ControllerParameterBase & {
32
+ kind: "param";
33
+ name: string;
34
+ }) | (ControllerParameterBase & {
35
+ kind: "query";
36
+ name?: string;
37
+ }) | (ControllerParameterBase & {
38
+ kind: "body";
39
+ name?: string;
40
+ }) | (ControllerParameterBase & {
41
+ kind: "header";
42
+ name: string;
43
+ });
44
+ //#endregion
45
+ //#region src/models/http-method.d.ts
46
+ type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
47
+ //#endregion
48
+ //#region src/models/response-kind.d.ts
49
+ type ResponseKind = "json" | "observable" | "stream";
50
+ //#endregion
51
+ //#region src/models/controller-method-definition.d.ts
52
+ interface ControllerMethodDefinition {
53
+ name: string;
54
+ httpMethod: HttpMethod;
55
+ path: string;
56
+ parameters: ControllerParameterDefinition[];
57
+ responseKind: ResponseKind;
58
+ line: number;
59
+ column: number;
60
+ }
61
+ //#endregion
62
+ //#region src/models/controller-definition.d.ts
63
+ interface ControllerDefinition {
64
+ name: string;
65
+ path: string;
66
+ sourceFile: string;
67
+ methods: ControllerMethodDefinition[];
68
+ }
69
+ //#endregion
70
+ //#region src/models/graphql-operation-kind.d.ts
71
+ type GraphqlOperationKind = "query" | "mutation";
72
+ //#endregion
73
+ //#region src/models/resolver-argument-definition.d.ts
74
+ interface ResolverArgumentDefinition {
75
+ index: number;
76
+ parameterName: string;
77
+ name: string;
78
+ graphqlType: string;
79
+ }
80
+ //#endregion
81
+ //#region src/models/selection-field.d.ts
82
+ interface SelectionField {
83
+ name: string;
84
+ children?: SelectionField[];
85
+ }
86
+ //#endregion
87
+ //#region src/models/resolver-method-definition.d.ts
88
+ interface ResolverMethodDefinition {
89
+ name: string;
90
+ operationKind: GraphqlOperationKind;
91
+ operationName: string;
92
+ arguments: ResolverArgumentDefinition[];
93
+ selection: SelectionField[];
94
+ line: number;
95
+ column: number;
96
+ }
97
+ //#endregion
98
+ //#region src/models/resolver-definition.d.ts
99
+ interface ResolverDefinition {
100
+ name: string;
101
+ sourceFile: string;
102
+ methods: ResolverMethodDefinition[];
103
+ }
104
+ //#endregion
105
+ //#region src/analysis/analyze-controllers.d.ts
106
+ export declare const analyzeControllers: (filePaths: readonly string[]) => {
107
+ controllers: ControllerDefinition[];
108
+ diagnostics: NestBridgeDiagnostic[];
109
+ };
110
+ //#endregion
111
+ //#region src/analysis/analyze-resolvers.d.ts
112
+ export declare const analyzeResolvers: (filePaths: readonly string[]) => {
113
+ resolvers: ResolverDefinition[];
114
+ diagnostics: NestBridgeDiagnostic[];
115
+ };
116
+ //#endregion
117
+ //#region src/declarations/generate-controller-declaration.d.ts
118
+ interface ClientDeclarationSource {
119
+ name: string;
120
+ sourceFile: string;
121
+ methods: readonly {
122
+ name: string;
123
+ responseKind?: ResponseKind;
124
+ }[];
125
+ }
126
+ export declare const generateControllerDeclaration: (controller: ClientDeclarationSource, outputFilePath: string) => string;
127
+ //#endregion
128
+ //#region src/version.d.ts
129
+ export declare const VERSION: string;
130
+ //#endregion
131
+ export type { ControllerDefinition, ControllerMethodDefinition, ControllerParameterDefinition, GraphqlOperationKind, HttpMethod, NestBridgeDiagnostic, NestBridgeDiagnosticCode, ParameterSourceKind, ResolverArgumentDefinition, ResolverDefinition, ResolverMethodDefinition, ResponseKind, SelectionField };
132
+ //# sourceMappingURL=nestbridge.core.d.ts.map