@trapi/metadata 2.0.0-beta.2 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +183 -1292
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +364 -1308
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,480 +1,7 @@
|
|
|
1
1
|
import { BaseError } from "@ebec/core";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Container } from "validup";
|
|
5
|
-
import { z } from "zod";
|
|
2
|
+
import { ClassDeclaration, CompilerOptions, EnumDeclaration, EnumMember, Expression, HasInitializer, InterfaceDeclaration, JSDoc, JSDocComment, JSDocTag, LiteralTypeNode, MethodDeclaration, Node, NodeArray, ParameterDeclaration, PropertyDeclaration, PropertySignature, SyntaxKind, Token, TypeAliasDeclaration, TypeChecker, TypeNode, TypeReferenceNode } from "typescript";
|
|
3
|
+
import { BaseType, Controller, DecoratorArgument, DecoratorHost, DecoratorSource, DecoratorTarget, DependencyResolver, Extension, HandlerContext, IControllerGenerator, IParameterGenerator, IResolverCache, JsDocHandlerContext, JsDocMatch, JsDocSource, Match, Metadata, Method, NeverType, Parameter, Preset, PrimitiveType, RefEnumType, RefObjectType, ReferenceType, Registry, ResolverProperty, Type, UnmatchedDecoratorReport, Validator, VoidType } from "@trapi/core";
|
|
6
4
|
|
|
7
|
-
//#region src/core/validator/types.d.ts
|
|
8
|
-
interface ValidatorMeta {}
|
|
9
|
-
type Validator = {
|
|
10
|
-
value?: unknown;
|
|
11
|
-
message?: string;
|
|
12
|
-
meta?: ValidatorMeta;
|
|
13
|
-
};
|
|
14
|
-
type Validators = Record<string, Validator>;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/core/resolver/constants.d.ts
|
|
17
|
-
declare enum TypeName {
|
|
18
|
-
STRING = "string",
|
|
19
|
-
BOOLEAN = "boolean",
|
|
20
|
-
BIGINT = "bigint",
|
|
21
|
-
DOUBLE = "double",
|
|
22
|
-
FLOAT = "float",
|
|
23
|
-
FILE = "file",
|
|
24
|
-
INTEGER = "integer",
|
|
25
|
-
LONG = "long",
|
|
26
|
-
ENUM = "enum",
|
|
27
|
-
ARRAY = "array",
|
|
28
|
-
DATETIME = "datetime",
|
|
29
|
-
DATE = "date",
|
|
30
|
-
BINARY = "binary",
|
|
31
|
-
BUFFER = "buffer",
|
|
32
|
-
BYTE = "byte",
|
|
33
|
-
VOID = "void",
|
|
34
|
-
OBJECT = "object",
|
|
35
|
-
ANY = "any",
|
|
36
|
-
UNDEFINED = "undefined",
|
|
37
|
-
NEVER = "never",
|
|
38
|
-
REF_ENUM = "refEnum",
|
|
39
|
-
REF_OBJECT = "refObject",
|
|
40
|
-
REF_ALIAS = "refAlias",
|
|
41
|
-
NESTED_OBJECT_LITERAL = "nestedObjectLiteral",
|
|
42
|
-
UNION = "union",
|
|
43
|
-
INTERSECTION = "intersection",
|
|
44
|
-
TUPLE = "tuple"
|
|
45
|
-
}
|
|
46
|
-
declare enum UtilityTypeName {
|
|
47
|
-
NON_NULLABLE = "NonNullable",
|
|
48
|
-
OMIT = "Omit",
|
|
49
|
-
PARTIAL = "Partial",
|
|
50
|
-
READONLY = "Readonly",
|
|
51
|
-
RECORD = "Record",
|
|
52
|
-
REQUIRED = "Required",
|
|
53
|
-
PICK = "Pick",
|
|
54
|
-
EXTRACT = "Extract",
|
|
55
|
-
EXCLUDE = "Exclude",
|
|
56
|
-
RETURN_TYPE = "ReturnType",
|
|
57
|
-
PARAMETERS = "Parameters",
|
|
58
|
-
AWAITED = "Awaited",
|
|
59
|
-
INSTANCE_TYPE = "InstanceType",
|
|
60
|
-
CONSTRUCTOR_PARAMETERS = "ConstructorParameters"
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/core/resolver/extension.d.ts
|
|
64
|
-
type Extension = {
|
|
65
|
-
key: string;
|
|
66
|
-
value: ExtensionType | ExtensionType[];
|
|
67
|
-
};
|
|
68
|
-
type ExtensionType = string | number | boolean | null | ExtensionType[] | {
|
|
69
|
-
[name: string]: ExtensionType | ExtensionType[];
|
|
70
|
-
};
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/core/resolver/types.d.ts
|
|
73
|
-
type Type = PrimitiveType | ObjectType | EnumType | ArrayType | FileType | DateTimeType | DateType | BinaryType | BufferType | ByteType | AnyType | UndefinedType | NeverType | RefEnumType | RefObjectType | RefAliasType | NestedObjectLiteralType | UnionType | IntersectionType | TupleType | VoidType;
|
|
74
|
-
type BaseType = {
|
|
75
|
-
typeName: `${TypeName}`;
|
|
76
|
-
};
|
|
77
|
-
type AnyType = BaseType & {
|
|
78
|
-
typeName: `${TypeName.ANY}`;
|
|
79
|
-
};
|
|
80
|
-
type UndefinedType = BaseType & {
|
|
81
|
-
typeName: `${TypeName.UNDEFINED}`;
|
|
82
|
-
};
|
|
83
|
-
type StringType = BaseType & {
|
|
84
|
-
typeName: `${TypeName.STRING}`;
|
|
85
|
-
};
|
|
86
|
-
type BooleanType = BaseType & {
|
|
87
|
-
typeName: `${TypeName.BOOLEAN}`;
|
|
88
|
-
};
|
|
89
|
-
type BigintType = BaseType & {
|
|
90
|
-
typeName: `${TypeName.BIGINT}`;
|
|
91
|
-
};
|
|
92
|
-
type DoubleType = BaseType & {
|
|
93
|
-
typeName: `${TypeName.DOUBLE}`;
|
|
94
|
-
};
|
|
95
|
-
type FloatType = BaseType & {
|
|
96
|
-
typeName: `${TypeName.FLOAT}`;
|
|
97
|
-
};
|
|
98
|
-
type IntegerType = BaseType & {
|
|
99
|
-
typeName: `${TypeName.INTEGER}`;
|
|
100
|
-
};
|
|
101
|
-
type LongType = BaseType & {
|
|
102
|
-
typeName: `${TypeName.LONG}`;
|
|
103
|
-
};
|
|
104
|
-
type VoidType = BaseType & {
|
|
105
|
-
typeName: `${TypeName.VOID}`;
|
|
106
|
-
};
|
|
107
|
-
type NeverType = BaseType & {
|
|
108
|
-
typeName: `${TypeName.NEVER}`;
|
|
109
|
-
};
|
|
110
|
-
type DateType = BaseType & {
|
|
111
|
-
typeName: `${TypeName.DATE}`;
|
|
112
|
-
};
|
|
113
|
-
type FileType = BaseType & {
|
|
114
|
-
typeName: `${TypeName.FILE}`;
|
|
115
|
-
};
|
|
116
|
-
type DateTimeType = BaseType & {
|
|
117
|
-
typeName: `${TypeName.DATETIME}`;
|
|
118
|
-
};
|
|
119
|
-
type BinaryType = BaseType & {
|
|
120
|
-
typeName: `${TypeName.BINARY}`;
|
|
121
|
-
};
|
|
122
|
-
type BufferType = BaseType & {
|
|
123
|
-
typeName: `${TypeName.BUFFER}`;
|
|
124
|
-
};
|
|
125
|
-
type ByteType = BaseType & {
|
|
126
|
-
typeName: `${TypeName.BYTE}`;
|
|
127
|
-
};
|
|
128
|
-
type ObjectType = BaseType & {
|
|
129
|
-
typeName: `${TypeName.OBJECT}`;
|
|
130
|
-
};
|
|
131
|
-
type EnumType = BaseType & {
|
|
132
|
-
members: Array<string | number | boolean | null>;
|
|
133
|
-
typeName: `${TypeName.ENUM}`;
|
|
134
|
-
};
|
|
135
|
-
type ArrayType = BaseType & {
|
|
136
|
-
elementType: Type;
|
|
137
|
-
typeName: `${TypeName.ARRAY}`;
|
|
138
|
-
};
|
|
139
|
-
type NestedObjectLiteralType = BaseType & {
|
|
140
|
-
typeName: `${TypeName.NESTED_OBJECT_LITERAL}`;
|
|
141
|
-
properties: ResolverProperty[];
|
|
142
|
-
additionalProperties?: Type;
|
|
143
|
-
};
|
|
144
|
-
type IntersectionType = BaseType & {
|
|
145
|
-
typeName: `${TypeName.INTERSECTION}`;
|
|
146
|
-
members: Type[];
|
|
147
|
-
};
|
|
148
|
-
type UnionType = BaseType & {
|
|
149
|
-
typeName: `${TypeName.UNION}`;
|
|
150
|
-
members: Type[];
|
|
151
|
-
};
|
|
152
|
-
type TupleElement = {
|
|
153
|
-
type: Type;
|
|
154
|
-
name?: string;
|
|
155
|
-
};
|
|
156
|
-
type TupleType = BaseType & {
|
|
157
|
-
typeName: `${TypeName.TUPLE}`;
|
|
158
|
-
elements: TupleElement[];
|
|
159
|
-
};
|
|
160
|
-
type ReferenceType = RefEnumType | RefObjectType | RefAliasType;
|
|
161
|
-
type ReferenceTypes = Record<string, ReferenceType>;
|
|
162
|
-
type DependencyResolver = (referenceTypes: ReferenceTypes) => void;
|
|
163
|
-
type ReferenceTypeBase = BaseType & {
|
|
164
|
-
description?: string;
|
|
165
|
-
typeName: `${TypeName.REF_ALIAS}` | `${TypeName.REF_ENUM}` | `${TypeName.REF_OBJECT}`;
|
|
166
|
-
refName: string;
|
|
167
|
-
example?: unknown;
|
|
168
|
-
deprecated: boolean;
|
|
169
|
-
};
|
|
170
|
-
type RefEnumType = ReferenceTypeBase & {
|
|
171
|
-
typeName: `${TypeName.REF_ENUM}`;
|
|
172
|
-
members: Array<string | number | boolean>;
|
|
173
|
-
memberNames?: string[];
|
|
174
|
-
};
|
|
175
|
-
type RefObjectType = ReferenceTypeBase & {
|
|
176
|
-
typeName: `${TypeName.REF_OBJECT}`;
|
|
177
|
-
properties: ResolverProperty[];
|
|
178
|
-
additionalProperties?: Type;
|
|
179
|
-
};
|
|
180
|
-
type RefAliasType = Omit<ResolverProperty, 'name' | 'required'> & ReferenceTypeBase & {
|
|
181
|
-
typeName: `${TypeName.REF_ALIAS}`;
|
|
182
|
-
};
|
|
183
|
-
type PrimitiveType = AnyType | BinaryType | BooleanType | BufferType | ByteType | DateType | DateTimeType | DoubleType | FloatType | FileType | BigintType | IntegerType | LongType | ObjectType | StringType | UndefinedType;
|
|
184
|
-
type ResolverProperty = {
|
|
185
|
-
default?: any;
|
|
186
|
-
format?: string;
|
|
187
|
-
example?: unknown;
|
|
188
|
-
validators?: Record<string, Validator>;
|
|
189
|
-
description?: string;
|
|
190
|
-
name: string;
|
|
191
|
-
type: Type;
|
|
192
|
-
required: boolean;
|
|
193
|
-
deprecated: boolean;
|
|
194
|
-
extensions?: Extension[];
|
|
195
|
-
};
|
|
196
|
-
/**
|
|
197
|
-
* Cache interface for the resolver's type cache.
|
|
198
|
-
*/
|
|
199
|
-
interface IResolverCache {
|
|
200
|
-
getCachedType(name: string): ReferenceType | undefined;
|
|
201
|
-
setCachedType(name: string, type: ReferenceType): void;
|
|
202
|
-
isInProgress(name: string): boolean;
|
|
203
|
-
markInProgress(name: string): void;
|
|
204
|
-
clearInProgress(name: string): void;
|
|
205
|
-
clear(): void;
|
|
206
|
-
}
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/core/resolver/type-guards.d.ts
|
|
209
|
-
declare function isAnyType(param: BaseType): param is AnyType;
|
|
210
|
-
declare function isUndefinedType(param: BaseType): param is UndefinedType;
|
|
211
|
-
declare function isStringType(param: BaseType): param is StringType;
|
|
212
|
-
declare function isBooleanType(param: BaseType): param is BooleanType;
|
|
213
|
-
declare function isBigintType(param: BaseType): param is BigintType;
|
|
214
|
-
declare function isDoubleType(param: BaseType): param is DoubleType;
|
|
215
|
-
declare function isFloatType(param: BaseType): param is FloatType;
|
|
216
|
-
declare function isIntegerType(param: BaseType): param is IntegerType;
|
|
217
|
-
declare function isLongType(param: BaseType): param is LongType;
|
|
218
|
-
declare function isVoidType(param: BaseType | undefined): param is VoidType;
|
|
219
|
-
declare function isNeverType(param: BaseType): param is NeverType;
|
|
220
|
-
declare function isDateType(param: BaseType): param is DateType;
|
|
221
|
-
declare function isFileType(param: BaseType): param is FileType;
|
|
222
|
-
declare function isDateTimeType(param: BaseType): param is DateTimeType;
|
|
223
|
-
declare function isBinaryType(param: BaseType): param is BinaryType;
|
|
224
|
-
declare function isBufferType(param: BaseType): param is BufferType;
|
|
225
|
-
declare function isByteType(param: BaseType): param is ByteType;
|
|
226
|
-
declare function isObjectType(param: BaseType): param is ObjectType;
|
|
227
|
-
declare function isEnumType(param: BaseType): param is EnumType;
|
|
228
|
-
declare function isArrayType(param: BaseType): param is ArrayType;
|
|
229
|
-
declare function isNestedObjectLiteralType(param: BaseType): param is NestedObjectLiteralType;
|
|
230
|
-
declare function isIntersectionType(param: BaseType): param is IntersectionType;
|
|
231
|
-
declare function isUnionType(param: BaseType): param is UnionType;
|
|
232
|
-
declare function isTupleType(param: BaseType): param is TupleType;
|
|
233
|
-
declare function isRefEnumType(param: BaseType): param is RefEnumType;
|
|
234
|
-
declare function isRefObjectType(param: BaseType): param is RefObjectType;
|
|
235
|
-
declare function isRefAliasType(param: BaseType): param is RefAliasType;
|
|
236
|
-
declare function isReferenceType(param: BaseType): param is ReferenceType;
|
|
237
|
-
declare function isPrimitiveType(type: BaseType): type is PrimitiveType;
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region src/core/error/base.d.ts
|
|
240
|
-
declare class MetadataError extends BaseError {}
|
|
241
|
-
//#endregion
|
|
242
|
-
//#region src/core/resolver/error.d.ts
|
|
243
|
-
declare class ResolverError extends MetadataError {
|
|
244
|
-
readonly file?: string;
|
|
245
|
-
readonly line?: number;
|
|
246
|
-
constructor(message: string, node?: Node | TypeNode, options?: boolean | {
|
|
247
|
-
onlyCurrent?: boolean;
|
|
248
|
-
cause?: unknown;
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
declare function isResolverError(input: unknown): input is ResolverError;
|
|
252
|
-
declare function prettyLocationOfNode(node: Node | TypeNode): {
|
|
253
|
-
text: string;
|
|
254
|
-
file: string;
|
|
255
|
-
line?: number;
|
|
256
|
-
} | undefined;
|
|
257
|
-
declare function prettyTroubleCause(node: Node | TypeNode, onlyCurrent?: boolean): string;
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/core/generator/types.d.ts
|
|
260
|
-
type Security = Record<string, string[]>;
|
|
261
|
-
type Example = {
|
|
262
|
-
value: unknown | unknown[];
|
|
263
|
-
summary?: string;
|
|
264
|
-
description?: string;
|
|
265
|
-
label?: string;
|
|
266
|
-
};
|
|
267
|
-
type Response = {
|
|
268
|
-
description: string;
|
|
269
|
-
examples?: Example[];
|
|
270
|
-
headers?: NestedObjectLiteralType | RefObjectType;
|
|
271
|
-
name: string;
|
|
272
|
-
produces?: string[];
|
|
273
|
-
status: string;
|
|
274
|
-
schema?: BaseType;
|
|
275
|
-
};
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/core/parameter/constants.d.ts
|
|
278
|
-
declare const ParameterSource: {
|
|
279
|
-
readonly BODY: "body";
|
|
280
|
-
readonly BODY_PROP: "bodyProp";
|
|
281
|
-
readonly CONTEXT: "context";
|
|
282
|
-
readonly COOKIE: "cookie";
|
|
283
|
-
readonly HEADER: "header";
|
|
284
|
-
readonly FORM_DATA: "formData";
|
|
285
|
-
readonly QUERY: "query";
|
|
286
|
-
readonly QUERY_PROP: "queryProp";
|
|
287
|
-
readonly PATH: "path";
|
|
288
|
-
};
|
|
289
|
-
type ParameterSource = typeof ParameterSource[keyof typeof ParameterSource];
|
|
290
|
-
declare const CollectionFormat: {
|
|
291
|
-
readonly CSV: "csv";
|
|
292
|
-
readonly SSV: "ssv";
|
|
293
|
-
readonly TSV: "tsv";
|
|
294
|
-
readonly PIPES: "pipes";
|
|
295
|
-
readonly MULTI: "multi";
|
|
296
|
-
};
|
|
297
|
-
type CollectionFormat = typeof CollectionFormat[keyof typeof CollectionFormat];
|
|
298
|
-
declare const ParameterErrorCode: {
|
|
299
|
-
readonly TYPE_UNSUPPORTED: "PARAMETER_TYPE_UNSUPPORTED";
|
|
300
|
-
readonly METHOD_UNSUPPORTED: "PARAMETER_METHOD_UNSUPPORTED";
|
|
301
|
-
readonly PATH_MISMATCH: "PARAMETER_PATH_MISMATCH";
|
|
302
|
-
readonly SCOPE_REQUIRED: "PARAMETER_SCOPE_REQUIRED";
|
|
303
|
-
readonly INVALID_EXAMPLE: "PARAMETER_INVALID_EXAMPLE";
|
|
304
|
-
};
|
|
305
|
-
//#endregion
|
|
306
|
-
//#region src/core/parameter/types.d.ts
|
|
307
|
-
type Parameter = {
|
|
308
|
-
parameterName: string;
|
|
309
|
-
description: string;
|
|
310
|
-
in: `${ParameterSource}`;
|
|
311
|
-
name: string;
|
|
312
|
-
required: boolean;
|
|
313
|
-
type: Type;
|
|
314
|
-
collectionFormat?: `${CollectionFormat}`;
|
|
315
|
-
allowEmptyValue?: boolean;
|
|
316
|
-
default?: any;
|
|
317
|
-
maxItems?: number;
|
|
318
|
-
minItems?: number;
|
|
319
|
-
deprecated?: boolean;
|
|
320
|
-
examples?: Example[];
|
|
321
|
-
exampleLabels?: string[];
|
|
322
|
-
extensions: Extension[];
|
|
323
|
-
validators?: Record<string, Validator>;
|
|
324
|
-
};
|
|
325
|
-
type ArrayParameter = Parameter & {
|
|
326
|
-
type: ArrayType;
|
|
327
|
-
};
|
|
328
|
-
interface IParameterGenerator {
|
|
329
|
-
generate(): Parameter[];
|
|
330
|
-
}
|
|
331
|
-
//#endregion
|
|
332
|
-
//#region src/core/method/types.d.ts
|
|
333
|
-
type Method = {
|
|
334
|
-
operationId?: string;
|
|
335
|
-
deprecated?: boolean;
|
|
336
|
-
description: string;
|
|
337
|
-
method: MethodType;
|
|
338
|
-
extensions: Extension[];
|
|
339
|
-
name: string;
|
|
340
|
-
parameters: Parameter[];
|
|
341
|
-
path: string;
|
|
342
|
-
type: BaseType;
|
|
343
|
-
tags: string[];
|
|
344
|
-
responses: Response[];
|
|
345
|
-
security?: Security[];
|
|
346
|
-
summary?: string;
|
|
347
|
-
consumes: string[];
|
|
348
|
-
produces: string[];
|
|
349
|
-
hidden: boolean;
|
|
350
|
-
};
|
|
351
|
-
type MethodType = 'get' | 'post' | 'put' | 'delete' | 'options' | 'head' | 'patch';
|
|
352
|
-
//#endregion
|
|
353
|
-
//#region src/core/controller/types.d.ts
|
|
354
|
-
type Controller = {
|
|
355
|
-
/**
|
|
356
|
-
* Allowed Content-Types to pass
|
|
357
|
-
* data according the definition.
|
|
358
|
-
*
|
|
359
|
-
* i.e. ['application/json']
|
|
360
|
-
*/
|
|
361
|
-
consumes: string[];
|
|
362
|
-
/**
|
|
363
|
-
* Whether every operation under this controller should be considered
|
|
364
|
-
* deprecated. OpenAPI has no controller-level `deprecated` field — emitters
|
|
365
|
-
* should cascade this flag to each emitted operation (combined with the
|
|
366
|
-
* method's own `deprecated`).
|
|
367
|
-
*/
|
|
368
|
-
deprecated?: boolean;
|
|
369
|
-
/**
|
|
370
|
-
* Vendor extensions (x-* keys) declared on the controller class.
|
|
371
|
-
*/
|
|
372
|
-
extensions: Extension[];
|
|
373
|
-
/**
|
|
374
|
-
* Is controller hidden, and should
|
|
375
|
-
* not be used/displayed in some scenarios.
|
|
376
|
-
*/
|
|
377
|
-
hidden: boolean;
|
|
378
|
-
/**
|
|
379
|
-
* File Location of the Controller.
|
|
380
|
-
*/
|
|
381
|
-
location: string;
|
|
382
|
-
/**
|
|
383
|
-
* Array of found method ( class functions )
|
|
384
|
-
* for a specific controller (class)
|
|
385
|
-
*/
|
|
386
|
-
methods: Method[];
|
|
387
|
-
name: string;
|
|
388
|
-
/**
|
|
389
|
-
* Relative URL paths the controller mounts at, e.g. ['/users'] or
|
|
390
|
-
* ['/roles', '/realms/:id/roles'] for multi-mounting.
|
|
391
|
-
*
|
|
392
|
-
* Always non-empty; a controller declared with no path argument has
|
|
393
|
-
* `paths: ['']`.
|
|
394
|
-
*/
|
|
395
|
-
paths: string[];
|
|
396
|
-
/**
|
|
397
|
-
* Possible Content-Types to receive
|
|
398
|
-
* data according the definition.
|
|
399
|
-
*
|
|
400
|
-
* i.e. ['application/json']
|
|
401
|
-
*/
|
|
402
|
-
produces: string[];
|
|
403
|
-
responses: Response[];
|
|
404
|
-
/**
|
|
405
|
-
* Tags can be used to group controllers
|
|
406
|
-
* by a name together.
|
|
407
|
-
*
|
|
408
|
-
* i.e. ['auth']
|
|
409
|
-
*/
|
|
410
|
-
tags: string[];
|
|
411
|
-
security?: Security[];
|
|
412
|
-
};
|
|
413
|
-
interface IControllerGenerator {
|
|
414
|
-
isValid(): boolean;
|
|
415
|
-
generate(): Controller | null;
|
|
416
|
-
}
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region src/core/method/constants.d.ts
|
|
419
|
-
declare const MethodName: {
|
|
420
|
-
readonly ALL: "ALL";
|
|
421
|
-
readonly GET: "GET";
|
|
422
|
-
readonly POST: "POST";
|
|
423
|
-
readonly PUT: "PUT";
|
|
424
|
-
readonly DELETE: "DELETE";
|
|
425
|
-
readonly PATCH: "PATCH";
|
|
426
|
-
readonly OPTIONS: "OPTIONS";
|
|
427
|
-
readonly HEAD: "HEAD";
|
|
428
|
-
};
|
|
429
|
-
type MethodName = typeof MethodName[keyof typeof MethodName];
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region src/core/parameter/error.d.ts
|
|
432
|
-
type UnsupportedTypeContext = {
|
|
433
|
-
decoratorName: string;
|
|
434
|
-
propertyName: string;
|
|
435
|
-
type: BaseType;
|
|
436
|
-
node?: Node;
|
|
437
|
-
};
|
|
438
|
-
type UnsupportedMethodContext = {
|
|
439
|
-
decoratorName: string;
|
|
440
|
-
propertyName: string;
|
|
441
|
-
method: string;
|
|
442
|
-
node?: Node;
|
|
443
|
-
};
|
|
444
|
-
type PathMatchInvalidContext = {
|
|
445
|
-
decoratorName: string;
|
|
446
|
-
propertyName: string;
|
|
447
|
-
path: string;
|
|
448
|
-
node?: Node;
|
|
449
|
-
};
|
|
450
|
-
type ScopeRequiredContext = {
|
|
451
|
-
decoratorName: string;
|
|
452
|
-
node?: Node;
|
|
453
|
-
};
|
|
454
|
-
declare class ParameterError extends MetadataError {
|
|
455
|
-
static typeUnsupported(context: UnsupportedTypeContext): ParameterError;
|
|
456
|
-
static methodUnsupported(context: UnsupportedMethodContext): ParameterError;
|
|
457
|
-
static invalidPathMatch(context: PathMatchInvalidContext): ParameterError;
|
|
458
|
-
static scopeRequired(context: ScopeRequiredContext): ParameterError;
|
|
459
|
-
static invalidExampleSchema(): ParameterError;
|
|
460
|
-
static getCurrentLocation(node: Node): string;
|
|
461
|
-
}
|
|
462
|
-
//#endregion
|
|
463
|
-
//#region src/core/generator/error.d.ts
|
|
464
|
-
declare class GeneratorError extends MetadataError {}
|
|
465
|
-
declare function isGeneratorError(input: unknown): input is GeneratorError & {
|
|
466
|
-
code: string;
|
|
467
|
-
};
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/core/generator/constants.d.ts
|
|
470
|
-
declare const GeneratorErrorCode: {
|
|
471
|
-
readonly CONTROLLER_NO_SOURCE_FILE: "GENERATOR_CONTROLLER_NO_SOURCE_FILE";
|
|
472
|
-
readonly CONTROLLER_NO_NAME: "GENERATOR_CONTROLLER_NO_NAME";
|
|
473
|
-
readonly PARAMETER_GENERATION_FAILED: "GENERATOR_PARAMETER_GENERATION_FAILED";
|
|
474
|
-
readonly BODY_PARAMETER_DUPLICATE: "GENERATOR_BODY_PARAMETER_DUPLICATE";
|
|
475
|
-
readonly BODY_FORM_CONFLICT: "GENERATOR_BODY_FORM_CONFLICT";
|
|
476
|
-
};
|
|
477
|
-
//#endregion
|
|
478
5
|
//#region src/adapters/cache/types.d.ts
|
|
479
6
|
interface CacheOptions {
|
|
480
7
|
/**
|
|
@@ -553,238 +80,6 @@ declare const CACHE_FILE_SUFFIX = ".json";
|
|
|
553
80
|
/** 7 days. */
|
|
554
81
|
declare const CACHE_DEFAULT_MAX_AGE_MS: number;
|
|
555
82
|
//#endregion
|
|
556
|
-
//#region src/adapters/decorator/constants.d.ts
|
|
557
|
-
declare const ParamKind: {
|
|
558
|
-
readonly Body: "body";
|
|
559
|
-
readonly BodyProp: "bodyProp";
|
|
560
|
-
readonly Context: "context";
|
|
561
|
-
readonly Cookie: "cookie";
|
|
562
|
-
readonly Header: "header";
|
|
563
|
-
readonly FormData: "formData";
|
|
564
|
-
readonly Query: "query";
|
|
565
|
-
readonly QueryProp: "queryProp";
|
|
566
|
-
readonly Path: "path";
|
|
567
|
-
};
|
|
568
|
-
type ParamKind = typeof ParamKind[keyof typeof ParamKind];
|
|
569
|
-
declare const CollectionKind: {
|
|
570
|
-
readonly Csv: "csv";
|
|
571
|
-
readonly Ssv: "ssv";
|
|
572
|
-
readonly Tsv: "tsv";
|
|
573
|
-
readonly Pipes: "pipes";
|
|
574
|
-
readonly Multi: "multi";
|
|
575
|
-
};
|
|
576
|
-
type CollectionKind = typeof CollectionKind[keyof typeof CollectionKind];
|
|
577
|
-
declare const DecoratorTargetKind: {
|
|
578
|
-
readonly Class: "class";
|
|
579
|
-
readonly Method: "method";
|
|
580
|
-
readonly Parameter: "parameter";
|
|
581
|
-
readonly Property: "property";
|
|
582
|
-
};
|
|
583
|
-
type DecoratorTargetKind = typeof DecoratorTargetKind[keyof typeof DecoratorTargetKind];
|
|
584
|
-
declare const DecoratorArgumentKindName: {
|
|
585
|
-
readonly Literal: "literal";
|
|
586
|
-
readonly Object: "object";
|
|
587
|
-
readonly Array: "array";
|
|
588
|
-
readonly Identifier: "identifier";
|
|
589
|
-
readonly Unresolvable: "unresolvable";
|
|
590
|
-
};
|
|
591
|
-
type DecoratorArgumentKindName = typeof DecoratorArgumentKindName[keyof typeof DecoratorArgumentKindName];
|
|
592
|
-
declare const MarkerName: {
|
|
593
|
-
readonly Hidden: "hidden";
|
|
594
|
-
readonly Deprecated: "deprecated";
|
|
595
|
-
readonly Extension: "extension";
|
|
596
|
-
};
|
|
597
|
-
type MarkerName = typeof MarkerName[keyof typeof MarkerName];
|
|
598
|
-
declare const NumericKind: {
|
|
599
|
-
readonly Int: "int";
|
|
600
|
-
readonly Long: "long";
|
|
601
|
-
readonly Float: "float";
|
|
602
|
-
readonly Double: "double";
|
|
603
|
-
};
|
|
604
|
-
type NumericKind = typeof NumericKind[keyof typeof NumericKind];
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region src/adapters/decorator/types.d.ts
|
|
607
|
-
type DecoratorTarget = `${DecoratorTargetKind}`;
|
|
608
|
-
type DecoratorArgumentKind = `${DecoratorArgumentKindName}`;
|
|
609
|
-
type DecoratorArgument = {
|
|
610
|
-
raw: unknown;
|
|
611
|
-
kind: DecoratorArgumentKind;
|
|
612
|
-
};
|
|
613
|
-
type DecoratorTypeArgument = {
|
|
614
|
-
resolve: () => Type;
|
|
615
|
-
};
|
|
616
|
-
type DecoratorHost = {
|
|
617
|
-
name: string;
|
|
618
|
-
parentName?: string;
|
|
619
|
-
};
|
|
620
|
-
type DecoratorSource = {
|
|
621
|
-
name: string;
|
|
622
|
-
arguments: DecoratorArgument[];
|
|
623
|
-
typeArguments: DecoratorTypeArgument[];
|
|
624
|
-
target: DecoratorTarget;
|
|
625
|
-
host: DecoratorHost;
|
|
626
|
-
/**
|
|
627
|
-
* Source-file location of the decorator AST node itself (1-based line).
|
|
628
|
-
* Optional because decorator sources can be synthesised in tests without
|
|
629
|
-
* a real source file. Populated by {@link buildDecoratorSources} when the
|
|
630
|
-
* decorator's containing source file is available.
|
|
631
|
-
*/
|
|
632
|
-
location?: {
|
|
633
|
-
file: string;
|
|
634
|
-
line: number;
|
|
635
|
-
};
|
|
636
|
-
};
|
|
637
|
-
type JsDocSource = {
|
|
638
|
-
tag: string;
|
|
639
|
-
text?: string;
|
|
640
|
-
typeExpression?: {
|
|
641
|
-
resolve: () => Type;
|
|
642
|
-
};
|
|
643
|
-
parameterName?: string;
|
|
644
|
-
target: DecoratorTarget;
|
|
645
|
-
host: DecoratorHost;
|
|
646
|
-
};
|
|
647
|
-
type ControllerDraft = {
|
|
648
|
-
name: string;
|
|
649
|
-
location: string;
|
|
650
|
-
paths?: string[];
|
|
651
|
-
hidden: boolean;
|
|
652
|
-
deprecated?: boolean;
|
|
653
|
-
consumes: string[];
|
|
654
|
-
produces: string[];
|
|
655
|
-
tags: string[];
|
|
656
|
-
responses: Response[];
|
|
657
|
-
security: Security[];
|
|
658
|
-
extensions: Extension[];
|
|
659
|
-
};
|
|
660
|
-
type MethodDraft = {
|
|
661
|
-
name: string;
|
|
662
|
-
verb?: MethodType;
|
|
663
|
-
path: string;
|
|
664
|
-
operationId?: string;
|
|
665
|
-
description: string;
|
|
666
|
-
summary?: string;
|
|
667
|
-
deprecated?: boolean;
|
|
668
|
-
hidden: boolean;
|
|
669
|
-
consumes: string[];
|
|
670
|
-
produces: string[];
|
|
671
|
-
tags: string[];
|
|
672
|
-
responses: Response[];
|
|
673
|
-
security: Security[];
|
|
674
|
-
extensions: Extension[];
|
|
675
|
-
parameters: ParameterDraft[];
|
|
676
|
-
type?: BaseType;
|
|
677
|
-
/**
|
|
678
|
-
* Examples that handlers (e.g. `@Example`) want attached to the implicitly
|
|
679
|
-
* generated default response. The orchestrator merges these into the
|
|
680
|
-
* default 200/204 response when finalising the method.
|
|
681
|
-
*/
|
|
682
|
-
defaultResponseExamples: Example[];
|
|
683
|
-
};
|
|
684
|
-
type ParameterDraft = {
|
|
685
|
-
parameterName: string;
|
|
686
|
-
name: string;
|
|
687
|
-
in?: `${ParamKind}`;
|
|
688
|
-
description: string;
|
|
689
|
-
required: boolean;
|
|
690
|
-
type?: Type;
|
|
691
|
-
collectionFormat?: `${CollectionKind}`;
|
|
692
|
-
allowEmptyValue?: boolean;
|
|
693
|
-
default?: unknown;
|
|
694
|
-
maxItems?: number;
|
|
695
|
-
minItems?: number;
|
|
696
|
-
deprecated?: boolean;
|
|
697
|
-
examples: Example[];
|
|
698
|
-
exampleLabels: string[];
|
|
699
|
-
extensions: Extension[];
|
|
700
|
-
validators: Record<string, Validator>;
|
|
701
|
-
};
|
|
702
|
-
type HandlerContext = {
|
|
703
|
-
host: DecoratorHost;
|
|
704
|
-
argument: (index: number) => DecoratorArgument | undefined;
|
|
705
|
-
arguments: () => DecoratorArgument[];
|
|
706
|
-
typeArgument: (index: number) => DecoratorTypeArgument | undefined;
|
|
707
|
-
typeArguments: () => DecoratorTypeArgument[];
|
|
708
|
-
parameterType: () => Type | undefined;
|
|
709
|
-
};
|
|
710
|
-
type JsDocHandlerContext = {
|
|
711
|
-
host: DecoratorHost;
|
|
712
|
-
source: JsDocSource;
|
|
713
|
-
parameterType: () => Type | undefined;
|
|
714
|
-
};
|
|
715
|
-
type Match = {
|
|
716
|
-
name: string;
|
|
717
|
-
on?: DecoratorTarget;
|
|
718
|
-
};
|
|
719
|
-
type JsDocMatch = {
|
|
720
|
-
tag: string;
|
|
721
|
-
on?: DecoratorTarget;
|
|
722
|
-
};
|
|
723
|
-
type ReplacesPolicy = true | string;
|
|
724
|
-
/**
|
|
725
|
-
* Tags a handler with a semantic concept that the type resolver consults.
|
|
726
|
-
*
|
|
727
|
-
* Allows preset authors to rename a decorator (via `match.name`) without
|
|
728
|
-
* breaking type-resolver behaviour: the resolver looks up handlers by marker
|
|
729
|
-
* and reads the canonical decorator name from each handler's `match.name`.
|
|
730
|
-
*/
|
|
731
|
-
type ResolverMarker = `${MarkerName}` | {
|
|
732
|
-
numeric: `${NumericKind}`;
|
|
733
|
-
};
|
|
734
|
-
type HandlerBase = {
|
|
735
|
-
match: Match;
|
|
736
|
-
replaces?: ReplacesPolicy;
|
|
737
|
-
marker?: ResolverMarker;
|
|
738
|
-
};
|
|
739
|
-
type ControllerHandler = HandlerBase & {
|
|
740
|
-
apply: (ctx: HandlerContext, draft: ControllerDraft) => void;
|
|
741
|
-
};
|
|
742
|
-
type MethodHandler = HandlerBase & {
|
|
743
|
-
apply: (ctx: HandlerContext, draft: MethodDraft) => void;
|
|
744
|
-
};
|
|
745
|
-
type ParameterHandler = HandlerBase & {
|
|
746
|
-
apply: (ctx: HandlerContext, draft: ParameterDraft) => void;
|
|
747
|
-
};
|
|
748
|
-
type JsDocHandlerBase = {
|
|
749
|
-
match: JsDocMatch;
|
|
750
|
-
replaces?: ReplacesPolicy;
|
|
751
|
-
marker?: ResolverMarker;
|
|
752
|
-
};
|
|
753
|
-
type ControllerJsDocHandler = JsDocHandlerBase & {
|
|
754
|
-
apply: (ctx: JsDocHandlerContext, draft: ControllerDraft) => void;
|
|
755
|
-
};
|
|
756
|
-
type MethodJsDocHandler = JsDocHandlerBase & {
|
|
757
|
-
apply: (ctx: JsDocHandlerContext, draft: MethodDraft) => void;
|
|
758
|
-
};
|
|
759
|
-
type ParameterJsDocHandler = JsDocHandlerBase & {
|
|
760
|
-
apply: (ctx: JsDocHandlerContext, draft: ParameterDraft) => void;
|
|
761
|
-
};
|
|
762
|
-
type AnyDecoratorHandler = ControllerHandler | MethodHandler | ParameterHandler;
|
|
763
|
-
type AnyJsDocHandler = ControllerJsDocHandler | MethodJsDocHandler | ParameterJsDocHandler;
|
|
764
|
-
type Preset = {
|
|
765
|
-
name: string;
|
|
766
|
-
extends?: string[];
|
|
767
|
-
controllers?: ControllerHandler[];
|
|
768
|
-
methods?: MethodHandler[];
|
|
769
|
-
parameters?: ParameterHandler[];
|
|
770
|
-
controllerJsDoc?: ControllerJsDocHandler[];
|
|
771
|
-
methodJsDoc?: MethodJsDocHandler[];
|
|
772
|
-
parameterJsDoc?: ParameterJsDocHandler[];
|
|
773
|
-
};
|
|
774
|
-
type Registry = {
|
|
775
|
-
controllers: ControllerHandler[];
|
|
776
|
-
methods: MethodHandler[];
|
|
777
|
-
parameters: ParameterHandler[];
|
|
778
|
-
controllerJsDoc: ControllerJsDocHandler[];
|
|
779
|
-
methodJsDoc: MethodJsDocHandler[];
|
|
780
|
-
parameterJsDoc: ParameterJsDocHandler[];
|
|
781
|
-
};
|
|
782
|
-
type PresetResolver = (name: string) => Promise<Preset> | Preset;
|
|
783
|
-
type LoadRegistryOptions = {
|
|
784
|
-
resolver: PresetResolver;
|
|
785
|
-
strict?: boolean;
|
|
786
|
-
};
|
|
787
|
-
//#endregion
|
|
788
83
|
//#region src/adapters/cache/utils.d.ts
|
|
789
84
|
declare function buildCacheOptions(input?: string | boolean | CacheOptionsInput): CacheOptions;
|
|
790
85
|
type CacheKeyParts = {
|
|
@@ -813,520 +108,6 @@ declare function hashCompilerOptions(options?: CompilerOptions): string;
|
|
|
813
108
|
*/
|
|
814
109
|
declare function hashRegistry(registry: Registry): string;
|
|
815
110
|
//#endregion
|
|
816
|
-
//#region src/adapters/decorator/helpers.d.ts
|
|
817
|
-
/**
|
|
818
|
-
* Read a positional argument as a string. Accepts both literal string args
|
|
819
|
-
* (`@Foo('value')`) and identifier references that resolve to a string
|
|
820
|
-
* (`@Foo(SOME_CONSTANT)`). Returns `undefined` for any other argument shape.
|
|
821
|
-
*/
|
|
822
|
-
declare function readString(arg: DecoratorArgument | undefined): string | undefined;
|
|
823
|
-
/**
|
|
824
|
-
* Read a positional argument as a number. Only matches numeric literals.
|
|
825
|
-
*/
|
|
826
|
-
declare function readNumber(arg: DecoratorArgument | undefined): number | undefined;
|
|
827
|
-
/**
|
|
828
|
-
* Read a positional argument as a boolean. Only matches boolean literals.
|
|
829
|
-
*/
|
|
830
|
-
declare function readBoolean(arg: DecoratorArgument | undefined): boolean | undefined;
|
|
831
|
-
/**
|
|
832
|
-
* Read a positional argument that may be either a single string or an array
|
|
833
|
-
* of strings. Returns `undefined` when the argument is missing, when any
|
|
834
|
-
* array element is non-string, or otherwise unresolvable. All-or-nothing:
|
|
835
|
-
* never returns a partial array with non-string items silently dropped.
|
|
836
|
-
*/
|
|
837
|
-
declare function readStringOrStringArray(arg: DecoratorArgument | undefined): string[] | undefined;
|
|
838
|
-
/**
|
|
839
|
-
* Convenience for the common controller path assignment. Reads the first
|
|
840
|
-
* argument as a string-or-string-array and writes it to `draft.paths`,
|
|
841
|
-
* defaulting to `['']` when the argument is missing or unresolvable. Use this
|
|
842
|
-
* inside a `controller({ match, apply })` handler to declare a class as a
|
|
843
|
-
* controller.
|
|
844
|
-
*/
|
|
845
|
-
declare function setControllerPaths(draft: ControllerDraft, arg: DecoratorArgument | undefined): void;
|
|
846
|
-
/**
|
|
847
|
-
* Convenience for the common method path assignment. Reads the first argument
|
|
848
|
-
* as a string and writes it to `draft.path` if present; leaves the field
|
|
849
|
-
* untouched otherwise (the orchestrator initialises it to `''`).
|
|
850
|
-
*/
|
|
851
|
-
declare function setMethodPath(draft: MethodDraft, arg: DecoratorArgument | undefined): void;
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region src/adapters/decorator/module.d.ts
|
|
854
|
-
declare function loadRegistry(preset: Preset, options: LoadRegistryOptions): Promise<Registry>;
|
|
855
|
-
/**
|
|
856
|
-
* Resolve a preset by string identifier (npm package, relative path, etc.) and
|
|
857
|
-
* return the v2 Preset object. Looks for a `preset` named export, then the
|
|
858
|
-
* default export, then the module itself.
|
|
859
|
-
*/
|
|
860
|
-
declare function resolvePresetByName(input: string): Promise<Preset>;
|
|
861
|
-
/**
|
|
862
|
-
* Resolve a preset by name and immediately materialize its registry, recursively
|
|
863
|
-
* loading `extends` parents through the same resolver.
|
|
864
|
-
*/
|
|
865
|
-
declare function loadRegistryByName(input: string): Promise<Registry>;
|
|
866
|
-
//#endregion
|
|
867
|
-
//#region src/adapters/decorator/test-helpers.d.ts
|
|
868
|
-
/**
|
|
869
|
-
* Build a literal-kind {@link DecoratorArgument} from a primitive value.
|
|
870
|
-
* Use this in unit tests to feed handlers a mock argument:
|
|
871
|
-
*
|
|
872
|
-
* ```ts
|
|
873
|
-
* const ctx = createHandlerContext({ args: [literalArg('users')] });
|
|
874
|
-
* controllerHandler.apply(ctx, draft);
|
|
875
|
-
* ```
|
|
876
|
-
*/
|
|
877
|
-
declare function literalArg(raw: string | number | boolean | null): DecoratorArgument;
|
|
878
|
-
/**
|
|
879
|
-
* Build an identifier-kind {@link DecoratorArgument} (e.g. `@Foo(SOME_CONSTANT)`).
|
|
880
|
-
* `raw` is the resolved value the identifier points to — typically a string.
|
|
881
|
-
*/
|
|
882
|
-
declare function identifierArg(raw: unknown): DecoratorArgument;
|
|
883
|
-
/**
|
|
884
|
-
* Build an array-kind {@link DecoratorArgument} (e.g. `@Foo(['a', 'b'])`).
|
|
885
|
-
*/
|
|
886
|
-
declare function arrayArg(raw: unknown[]): DecoratorArgument;
|
|
887
|
-
/**
|
|
888
|
-
* Build an object-kind {@link DecoratorArgument} (e.g. `@Foo({ key: 'value' })`).
|
|
889
|
-
*/
|
|
890
|
-
declare function objectArg(raw: Record<string, unknown>): DecoratorArgument;
|
|
891
|
-
/**
|
|
892
|
-
* Build an unresolvable-kind {@link DecoratorArgument} — represents arguments
|
|
893
|
-
* the source extractor couldn't statically evaluate (e.g. function calls,
|
|
894
|
-
* unknown identifiers).
|
|
895
|
-
*/
|
|
896
|
-
declare function unresolvableArg(): DecoratorArgument;
|
|
897
|
-
/**
|
|
898
|
-
* Build a {@link DecoratorTypeArgument} stub that returns the supplied type
|
|
899
|
-
* when `resolve()` is called.
|
|
900
|
-
*/
|
|
901
|
-
declare function typeArg(type: Type): DecoratorTypeArgument;
|
|
902
|
-
type CreateHandlerContextInput = {
|
|
903
|
-
args?: DecoratorArgument[];
|
|
904
|
-
typeArgs?: DecoratorTypeArgument[];
|
|
905
|
-
host?: DecoratorHost;
|
|
906
|
-
parameterType?: Type;
|
|
907
|
-
};
|
|
908
|
-
/**
|
|
909
|
-
* Construct a {@link HandlerContext} for unit-testing handlers in isolation
|
|
910
|
-
* without spinning up the full TypeScript compiler / `generateMetadata`
|
|
911
|
-
* pipeline. Combine with the `*Arg(...)` builders to feed a handler a
|
|
912
|
-
* controlled mock decorator source.
|
|
913
|
-
*
|
|
914
|
-
* ```ts
|
|
915
|
-
* const ctx = createHandlerContext({ args: [literalArg('users')] });
|
|
916
|
-
* const draft = newControllerDraft({ name: 'UserController', location: '/x.ts' });
|
|
917
|
-
* myHandler.apply(ctx, draft);
|
|
918
|
-
* expect(draft.paths).toEqual(['users']);
|
|
919
|
-
* ```
|
|
920
|
-
*/
|
|
921
|
-
declare function createHandlerContext(input?: CreateHandlerContextInput): HandlerContext;
|
|
922
|
-
//#endregion
|
|
923
|
-
//#region src/adapters/decorator/orchestrator/types.d.ts
|
|
924
|
-
/**
|
|
925
|
-
* Reported when a decorator on a node has no matching handler in the
|
|
926
|
-
* supplied registry. The orchestrator computes file/line from the host node
|
|
927
|
-
* (1-based line number).
|
|
928
|
-
*/
|
|
929
|
-
type UnmatchedDecoratorReport = {
|
|
930
|
-
name: string;
|
|
931
|
-
target: DecoratorTarget;
|
|
932
|
-
host: DecoratorHost;
|
|
933
|
-
file: string;
|
|
934
|
-
line: number;
|
|
935
|
-
};
|
|
936
|
-
type ApplyHandlersOptions = {
|
|
937
|
-
target: DecoratorTarget;
|
|
938
|
-
host: DecoratorHost;
|
|
939
|
-
resolveTypeNode: (node: TypeNode) => Type;
|
|
940
|
-
parameterType?: () => Type | undefined;
|
|
941
|
-
typeChecker?: TypeChecker;
|
|
942
|
-
/**
|
|
943
|
-
* Optional reporter for decorator sources that no handler matched.
|
|
944
|
-
* The orchestrator builds a {@link DecoratorSource} for every decorator
|
|
945
|
-
* on the node; if iteration finishes without any handler claiming a
|
|
946
|
-
* source, this callback fires once for that source.
|
|
947
|
-
*/
|
|
948
|
-
onUnmatchedDecorator?: (report: UnmatchedDecoratorReport, source: DecoratorSource) => void;
|
|
949
|
-
};
|
|
950
|
-
//#endregion
|
|
951
|
-
//#region src/adapters/decorator/orchestrator/module.d.ts
|
|
952
|
-
type DecoratorHandlerLike<D> = {
|
|
953
|
-
match: Match;
|
|
954
|
-
apply: (ctx: HandlerContext, draft: D) => void;
|
|
955
|
-
};
|
|
956
|
-
type JsDocHandlerLike<D> = {
|
|
957
|
-
match: JsDocMatch;
|
|
958
|
-
apply: (ctx: JsDocHandlerContext, draft: D) => void;
|
|
959
|
-
};
|
|
960
|
-
declare function buildHandlerContext(source: DecoratorSource, options: ApplyHandlersOptions): HandlerContext;
|
|
961
|
-
declare function buildJsDocHandlerContext(source: JsDocSource, options: ApplyHandlersOptions): JsDocHandlerContext;
|
|
962
|
-
declare function applyDecoratorHandlers<D>(node: Node, handlers: DecoratorHandlerLike<D>[], draft: D, options: ApplyHandlersOptions): void;
|
|
963
|
-
declare function applyJsDocHandlers<D>(node: Node, handlers: JsDocHandlerLike<D>[], draft: D, options: ApplyHandlersOptions): void;
|
|
964
|
-
//#endregion
|
|
965
|
-
//#region src/adapters/decorator/typescript/types.d.ts
|
|
966
|
-
type DecoratorSourceBuilderOptions = {
|
|
967
|
-
target: DecoratorTarget;
|
|
968
|
-
host: DecoratorHost;
|
|
969
|
-
resolveTypeNode: (node: TypeNode) => Type;
|
|
970
|
-
typeChecker?: TypeChecker;
|
|
971
|
-
};
|
|
972
|
-
type JsDocSourceBuilderOptions = {
|
|
973
|
-
target: DecoratorTarget;
|
|
974
|
-
host: DecoratorHost;
|
|
975
|
-
resolveTypeNode: (node: TypeNode) => Type;
|
|
976
|
-
};
|
|
977
|
-
//#endregion
|
|
978
|
-
//#region src/adapters/decorator/typescript/module.d.ts
|
|
979
|
-
declare function buildDecoratorSources(node: Node, options: DecoratorSourceBuilderOptions): DecoratorSource[];
|
|
980
|
-
declare function buildJsDocSources(node: Node, options: JsDocSourceBuilderOptions): JsDocSource[];
|
|
981
|
-
//#endregion
|
|
982
|
-
//#region src/adapters/decorator/typescript/utils.d.ts
|
|
983
|
-
type RawDecorator = {
|
|
984
|
-
name: string;
|
|
985
|
-
arguments: DecoratorArgument[];
|
|
986
|
-
};
|
|
987
|
-
/**
|
|
988
|
-
* Enumerate decorators on a TS node and classify their argument values without
|
|
989
|
-
* going through the registry. Used by read-side consumers (type resolver,
|
|
990
|
-
* extension extraction) that only need decorator names + argument values.
|
|
991
|
-
*/
|
|
992
|
-
declare function readNodeDecorators(node: Node, typeChecker?: TypeChecker): RawDecorator[];
|
|
993
|
-
declare function findDecoratorByName(node: Node, name: string, typeChecker?: TypeChecker): RawDecorator | undefined;
|
|
994
|
-
declare function findDecoratorsByName(node: Node, name: string, typeChecker?: TypeChecker): RawDecorator[];
|
|
995
|
-
declare function hasDecoratorNamed(node: Node, name: string, typeChecker?: TypeChecker): boolean;
|
|
996
|
-
declare function buildDecoratorArgument(expr: Expression, typeChecker?: TypeChecker): DecoratorArgument;
|
|
997
|
-
//#endregion
|
|
998
|
-
//#region src/adapters/decorator/utils.d.ts
|
|
999
|
-
declare function matches(match: Match, source: Pick<DecoratorSource, 'name' | 'target'>): boolean;
|
|
1000
|
-
declare function matchesJsDoc(match: JsDocMatch, source: Pick<JsDocSource, 'tag' | 'target'>): boolean;
|
|
1001
|
-
declare function newControllerDraft(input: Pick<ControllerDraft, 'name' | 'location'>): ControllerDraft;
|
|
1002
|
-
declare function newMethodDraft(input: Pick<MethodDraft, 'name'>): MethodDraft;
|
|
1003
|
-
declare function newParameterDraft(input: Pick<ParameterDraft, 'parameterName'>): ParameterDraft;
|
|
1004
|
-
/**
|
|
1005
|
-
* Build a {@link Registry}, optionally seeded with handler arrays from `input`.
|
|
1006
|
-
* Any kind omitted from `input` falls back to an empty array, so callers can
|
|
1007
|
-
* pass just the kinds they care about (e.g. `createRegistry({ methods: [...] })`).
|
|
1008
|
-
*
|
|
1009
|
-
* The provided arrays are copied — mutating the result does not affect `input`.
|
|
1010
|
-
*/
|
|
1011
|
-
declare function createRegistry(input?: Partial<Registry>): Registry;
|
|
1012
|
-
/**
|
|
1013
|
-
* Concatenate two registries kind-by-kind. Earlier handlers run first inside
|
|
1014
|
-
* the orchestrator, so callers who want override-by-running-later semantics
|
|
1015
|
-
* should pass the dominant registry as `b`.
|
|
1016
|
-
*/
|
|
1017
|
-
declare function mergeRegistries(a: Registry, b: Registry): Registry;
|
|
1018
|
-
declare function generatePresetLookupPaths(input: string): string[];
|
|
1019
|
-
/**
|
|
1020
|
-
* Collect the unique decorator names of every handler whose `marker` matches
|
|
1021
|
-
* the given predicate. Lets the type resolver discover preset-renamed
|
|
1022
|
-
* decorators without hard-coding canonical names.
|
|
1023
|
-
*/
|
|
1024
|
-
declare function namesForMarker(registry: Registry, predicate: (marker: ResolverMarker) => boolean): Set<string>;
|
|
1025
|
-
/**
|
|
1026
|
-
* Collect the unique JSDoc tag names of every JSDoc handler whose `marker`
|
|
1027
|
-
* matches the given predicate. JSDoc analogue of `namesForMarker`.
|
|
1028
|
-
*/
|
|
1029
|
-
declare function tagsForMarker(registry: Registry, predicate: (marker: ResolverMarker) => boolean): Set<string>;
|
|
1030
|
-
declare function isHiddenMarker(marker: ResolverMarker): boolean;
|
|
1031
|
-
declare function isDeprecatedMarker(marker: ResolverMarker): boolean;
|
|
1032
|
-
declare function isExtensionMarker(marker: ResolverMarker): boolean;
|
|
1033
|
-
declare function numericMarkerKind(marker: ResolverMarker): 'int' | 'long' | 'float' | 'double' | undefined;
|
|
1034
|
-
declare const controller: (handler: ControllerHandler) => ControllerHandler;
|
|
1035
|
-
declare const method: (handler: MethodHandler) => MethodHandler;
|
|
1036
|
-
declare const parameter: (handler: ParameterHandler) => ParameterHandler;
|
|
1037
|
-
declare const controllerJsDoc: (handler: ControllerJsDocHandler) => ControllerJsDocHandler;
|
|
1038
|
-
declare const methodJsDoc: (handler: MethodJsDocHandler) => MethodJsDocHandler;
|
|
1039
|
-
declare const parameterJsDoc: (handler: ParameterJsDocHandler) => ParameterJsDocHandler;
|
|
1040
|
-
type AnyDraft = ControllerDraft | MethodDraft | ParameterDraft;
|
|
1041
|
-
type DraftApply = (ctx: HandlerContext, draft: AnyDraft) => void;
|
|
1042
|
-
declare function into(key: string): {
|
|
1043
|
-
positional(index: number): DraftApply;
|
|
1044
|
-
typeArgument(index?: number): DraftApply;
|
|
1045
|
-
};
|
|
1046
|
-
declare function append(key: string): {
|
|
1047
|
-
positional(index: number): DraftApply;
|
|
1048
|
-
positionalAll(): DraftApply;
|
|
1049
|
-
};
|
|
1050
|
-
declare function flag(key: string, value?: unknown): DraftApply;
|
|
1051
|
-
//#endregion
|
|
1052
|
-
//#region src/adapters/decorator/validation/module.d.ts
|
|
1053
|
-
declare const matchSchema: z.ZodObject<{
|
|
1054
|
-
name: z.ZodString;
|
|
1055
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1056
|
-
class: "class";
|
|
1057
|
-
method: "method";
|
|
1058
|
-
parameter: "parameter";
|
|
1059
|
-
property: "property";
|
|
1060
|
-
}>>;
|
|
1061
|
-
}, z.core.$strip>;
|
|
1062
|
-
declare const jsDocMatchSchema: z.ZodObject<{
|
|
1063
|
-
tag: z.ZodString;
|
|
1064
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1065
|
-
class: "class";
|
|
1066
|
-
method: "method";
|
|
1067
|
-
parameter: "parameter";
|
|
1068
|
-
property: "property";
|
|
1069
|
-
}>>;
|
|
1070
|
-
}, z.core.$strip>;
|
|
1071
|
-
declare const controllerHandlerSchema: z.ZodObject<{
|
|
1072
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1073
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1074
|
-
numeric: z.ZodEnum<{
|
|
1075
|
-
double: "double";
|
|
1076
|
-
float: "float";
|
|
1077
|
-
long: "long";
|
|
1078
|
-
int: "int";
|
|
1079
|
-
}>;
|
|
1080
|
-
}, z.core.$strip>]>>;
|
|
1081
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1082
|
-
match: z.ZodObject<{
|
|
1083
|
-
name: z.ZodString;
|
|
1084
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1085
|
-
class: "class";
|
|
1086
|
-
method: "method";
|
|
1087
|
-
parameter: "parameter";
|
|
1088
|
-
property: "property";
|
|
1089
|
-
}>>;
|
|
1090
|
-
}, z.core.$strip>;
|
|
1091
|
-
}, z.core.$strip>;
|
|
1092
|
-
declare const methodHandlerSchema: z.ZodObject<{
|
|
1093
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1094
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1095
|
-
numeric: z.ZodEnum<{
|
|
1096
|
-
double: "double";
|
|
1097
|
-
float: "float";
|
|
1098
|
-
long: "long";
|
|
1099
|
-
int: "int";
|
|
1100
|
-
}>;
|
|
1101
|
-
}, z.core.$strip>]>>;
|
|
1102
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1103
|
-
match: z.ZodObject<{
|
|
1104
|
-
name: z.ZodString;
|
|
1105
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1106
|
-
class: "class";
|
|
1107
|
-
method: "method";
|
|
1108
|
-
parameter: "parameter";
|
|
1109
|
-
property: "property";
|
|
1110
|
-
}>>;
|
|
1111
|
-
}, z.core.$strip>;
|
|
1112
|
-
}, z.core.$strip>;
|
|
1113
|
-
declare const parameterHandlerSchema: z.ZodObject<{
|
|
1114
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1115
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1116
|
-
numeric: z.ZodEnum<{
|
|
1117
|
-
double: "double";
|
|
1118
|
-
float: "float";
|
|
1119
|
-
long: "long";
|
|
1120
|
-
int: "int";
|
|
1121
|
-
}>;
|
|
1122
|
-
}, z.core.$strip>]>>;
|
|
1123
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1124
|
-
match: z.ZodObject<{
|
|
1125
|
-
name: z.ZodString;
|
|
1126
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1127
|
-
class: "class";
|
|
1128
|
-
method: "method";
|
|
1129
|
-
parameter: "parameter";
|
|
1130
|
-
property: "property";
|
|
1131
|
-
}>>;
|
|
1132
|
-
}, z.core.$strip>;
|
|
1133
|
-
}, z.core.$strip>;
|
|
1134
|
-
declare const controllerJsDocHandlerSchema: z.ZodObject<{
|
|
1135
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1136
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1137
|
-
numeric: z.ZodEnum<{
|
|
1138
|
-
double: "double";
|
|
1139
|
-
float: "float";
|
|
1140
|
-
long: "long";
|
|
1141
|
-
int: "int";
|
|
1142
|
-
}>;
|
|
1143
|
-
}, z.core.$strip>]>>;
|
|
1144
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1145
|
-
match: z.ZodObject<{
|
|
1146
|
-
tag: z.ZodString;
|
|
1147
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1148
|
-
class: "class";
|
|
1149
|
-
method: "method";
|
|
1150
|
-
parameter: "parameter";
|
|
1151
|
-
property: "property";
|
|
1152
|
-
}>>;
|
|
1153
|
-
}, z.core.$strip>;
|
|
1154
|
-
}, z.core.$strip>;
|
|
1155
|
-
declare const methodJsDocHandlerSchema: z.ZodObject<{
|
|
1156
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1157
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1158
|
-
numeric: z.ZodEnum<{
|
|
1159
|
-
double: "double";
|
|
1160
|
-
float: "float";
|
|
1161
|
-
long: "long";
|
|
1162
|
-
int: "int";
|
|
1163
|
-
}>;
|
|
1164
|
-
}, z.core.$strip>]>>;
|
|
1165
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1166
|
-
match: z.ZodObject<{
|
|
1167
|
-
tag: z.ZodString;
|
|
1168
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1169
|
-
class: "class";
|
|
1170
|
-
method: "method";
|
|
1171
|
-
parameter: "parameter";
|
|
1172
|
-
property: "property";
|
|
1173
|
-
}>>;
|
|
1174
|
-
}, z.core.$strip>;
|
|
1175
|
-
}, z.core.$strip>;
|
|
1176
|
-
declare const parameterJsDocHandlerSchema: z.ZodObject<{
|
|
1177
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1178
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1179
|
-
numeric: z.ZodEnum<{
|
|
1180
|
-
double: "double";
|
|
1181
|
-
float: "float";
|
|
1182
|
-
long: "long";
|
|
1183
|
-
int: "int";
|
|
1184
|
-
}>;
|
|
1185
|
-
}, z.core.$strip>]>>;
|
|
1186
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1187
|
-
match: z.ZodObject<{
|
|
1188
|
-
tag: z.ZodString;
|
|
1189
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1190
|
-
class: "class";
|
|
1191
|
-
method: "method";
|
|
1192
|
-
parameter: "parameter";
|
|
1193
|
-
property: "property";
|
|
1194
|
-
}>>;
|
|
1195
|
-
}, z.core.$strip>;
|
|
1196
|
-
}, z.core.$strip>;
|
|
1197
|
-
declare const presetSchema: z.ZodObject<{
|
|
1198
|
-
name: z.ZodString;
|
|
1199
|
-
extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1200
|
-
controllers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1201
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1202
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1203
|
-
numeric: z.ZodEnum<{
|
|
1204
|
-
double: "double";
|
|
1205
|
-
float: "float";
|
|
1206
|
-
long: "long";
|
|
1207
|
-
int: "int";
|
|
1208
|
-
}>;
|
|
1209
|
-
}, z.core.$strip>]>>;
|
|
1210
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1211
|
-
match: z.ZodObject<{
|
|
1212
|
-
name: z.ZodString;
|
|
1213
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1214
|
-
class: "class";
|
|
1215
|
-
method: "method";
|
|
1216
|
-
parameter: "parameter";
|
|
1217
|
-
property: "property";
|
|
1218
|
-
}>>;
|
|
1219
|
-
}, z.core.$strip>;
|
|
1220
|
-
}, z.core.$strip>>>;
|
|
1221
|
-
methods: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1222
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1223
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1224
|
-
numeric: z.ZodEnum<{
|
|
1225
|
-
double: "double";
|
|
1226
|
-
float: "float";
|
|
1227
|
-
long: "long";
|
|
1228
|
-
int: "int";
|
|
1229
|
-
}>;
|
|
1230
|
-
}, z.core.$strip>]>>;
|
|
1231
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1232
|
-
match: z.ZodObject<{
|
|
1233
|
-
name: z.ZodString;
|
|
1234
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1235
|
-
class: "class";
|
|
1236
|
-
method: "method";
|
|
1237
|
-
parameter: "parameter";
|
|
1238
|
-
property: "property";
|
|
1239
|
-
}>>;
|
|
1240
|
-
}, z.core.$strip>;
|
|
1241
|
-
}, z.core.$strip>>>;
|
|
1242
|
-
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1243
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1244
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1245
|
-
numeric: z.ZodEnum<{
|
|
1246
|
-
double: "double";
|
|
1247
|
-
float: "float";
|
|
1248
|
-
long: "long";
|
|
1249
|
-
int: "int";
|
|
1250
|
-
}>;
|
|
1251
|
-
}, z.core.$strip>]>>;
|
|
1252
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1253
|
-
match: z.ZodObject<{
|
|
1254
|
-
name: z.ZodString;
|
|
1255
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1256
|
-
class: "class";
|
|
1257
|
-
method: "method";
|
|
1258
|
-
parameter: "parameter";
|
|
1259
|
-
property: "property";
|
|
1260
|
-
}>>;
|
|
1261
|
-
}, z.core.$strip>;
|
|
1262
|
-
}, z.core.$strip>>>;
|
|
1263
|
-
controllerJsDoc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1264
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1265
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1266
|
-
numeric: z.ZodEnum<{
|
|
1267
|
-
double: "double";
|
|
1268
|
-
float: "float";
|
|
1269
|
-
long: "long";
|
|
1270
|
-
int: "int";
|
|
1271
|
-
}>;
|
|
1272
|
-
}, z.core.$strip>]>>;
|
|
1273
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1274
|
-
match: z.ZodObject<{
|
|
1275
|
-
tag: z.ZodString;
|
|
1276
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1277
|
-
class: "class";
|
|
1278
|
-
method: "method";
|
|
1279
|
-
parameter: "parameter";
|
|
1280
|
-
property: "property";
|
|
1281
|
-
}>>;
|
|
1282
|
-
}, z.core.$strip>;
|
|
1283
|
-
}, z.core.$strip>>>;
|
|
1284
|
-
methodJsDoc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1285
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1286
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1287
|
-
numeric: z.ZodEnum<{
|
|
1288
|
-
double: "double";
|
|
1289
|
-
float: "float";
|
|
1290
|
-
long: "long";
|
|
1291
|
-
int: "int";
|
|
1292
|
-
}>;
|
|
1293
|
-
}, z.core.$strip>]>>;
|
|
1294
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1295
|
-
match: z.ZodObject<{
|
|
1296
|
-
tag: z.ZodString;
|
|
1297
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1298
|
-
class: "class";
|
|
1299
|
-
method: "method";
|
|
1300
|
-
parameter: "parameter";
|
|
1301
|
-
property: "property";
|
|
1302
|
-
}>>;
|
|
1303
|
-
}, z.core.$strip>;
|
|
1304
|
-
}, z.core.$strip>>>;
|
|
1305
|
-
parameterJsDoc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1306
|
-
replaces: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
1307
|
-
marker: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hidden">, z.ZodLiteral<"deprecated">, z.ZodLiteral<"extension">, z.ZodObject<{
|
|
1308
|
-
numeric: z.ZodEnum<{
|
|
1309
|
-
double: "double";
|
|
1310
|
-
float: "float";
|
|
1311
|
-
long: "long";
|
|
1312
|
-
int: "int";
|
|
1313
|
-
}>;
|
|
1314
|
-
}, z.core.$strip>]>>;
|
|
1315
|
-
apply: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
1316
|
-
match: z.ZodObject<{
|
|
1317
|
-
tag: z.ZodString;
|
|
1318
|
-
on: z.ZodOptional<z.ZodEnum<{
|
|
1319
|
-
class: "class";
|
|
1320
|
-
method: "method";
|
|
1321
|
-
parameter: "parameter";
|
|
1322
|
-
property: "property";
|
|
1323
|
-
}>>;
|
|
1324
|
-
}, z.core.$strip>;
|
|
1325
|
-
}, z.core.$strip>>>;
|
|
1326
|
-
}, z.core.$strip>;
|
|
1327
|
-
declare function createPresetContainer(): Container<Preset>;
|
|
1328
|
-
declare function validatePreset(input: unknown): Promise<Preset>;
|
|
1329
|
-
//#endregion
|
|
1330
111
|
//#region src/adapters/filesystem/tsconfig/types.d.ts
|
|
1331
112
|
type TsconfigLoadContext = {
|
|
1332
113
|
cwd?: string;
|
|
@@ -1438,21 +219,6 @@ type MetadataGeneratorContext = {
|
|
|
1438
219
|
interface IMetadataGenerator {
|
|
1439
220
|
generate(): Promise<Metadata>;
|
|
1440
221
|
}
|
|
1441
|
-
/**
|
|
1442
|
-
* The output specification for metadata generation.
|
|
1443
|
-
*/
|
|
1444
|
-
type Metadata = {
|
|
1445
|
-
/**
|
|
1446
|
-
* A Controller is a collection of grouped methods (GET, POST, ...)
|
|
1447
|
-
* for a common URL path (i.e /users) or an more explicit URL path (i.e. /users/:id).
|
|
1448
|
-
*/
|
|
1449
|
-
controllers: Controller[];
|
|
1450
|
-
/**
|
|
1451
|
-
* ReferenceTypes is an object of found types (interfaces, type, ...),
|
|
1452
|
-
* and classes which were detected during code analysis.
|
|
1453
|
-
*/
|
|
1454
|
-
referenceTypes: ReferenceTypes;
|
|
1455
|
-
};
|
|
1456
222
|
/**
|
|
1457
223
|
* Narrow context interface for the type resolver.
|
|
1458
224
|
* Contains only what TypeNodeResolver needs — no generator methods.
|
|
@@ -1490,30 +256,8 @@ interface IGeneratorContext extends IResolverContext, IReferenceTypeRegistry {
|
|
|
1490
256
|
reportUnmatchedDecorator?(report: UnmatchedDecoratorReport): void;
|
|
1491
257
|
}
|
|
1492
258
|
//#endregion
|
|
1493
|
-
//#region src/core/
|
|
1494
|
-
|
|
1495
|
-
//#endregion
|
|
1496
|
-
//#region src/core/validator/error.d.ts
|
|
1497
|
-
declare class ValidatorError extends MetadataError {}
|
|
1498
|
-
//#endregion
|
|
1499
|
-
//#region src/core/validator/constants.d.ts
|
|
1500
|
-
declare enum ValidatorName {
|
|
1501
|
-
UNIQUE_ITEMS = "uniqueItems",
|
|
1502
|
-
MINIMUM = "minimum",
|
|
1503
|
-
MAXIMUM = "maximum",
|
|
1504
|
-
MIN_ITEMS = "minItems",
|
|
1505
|
-
MAX_ITEMS = "maxItems",
|
|
1506
|
-
MIN_LENGTH = "minLength",
|
|
1507
|
-
MAX_LENGTH = "maxLength",
|
|
1508
|
-
MIN_DATE = "minDate",
|
|
1509
|
-
MAX_DATE = "maxDate",
|
|
1510
|
-
PATTERN = "pattern"
|
|
1511
|
-
}
|
|
1512
|
-
declare const ValidatorErrorCode: {
|
|
1513
|
-
readonly EXPECTED_NUMBER: "VALIDATOR_EXPECTED_NUMBER";
|
|
1514
|
-
readonly EXPECTED_DATE: "VALIDATOR_EXPECTED_DATE";
|
|
1515
|
-
readonly EXPECTED_STRING: "VALIDATOR_EXPECTED_STRING";
|
|
1516
|
-
};
|
|
259
|
+
//#region src/core/error/base.d.ts
|
|
260
|
+
declare class MetadataError extends BaseError {}
|
|
1517
261
|
//#endregion
|
|
1518
262
|
//#region src/core/error/config.d.ts
|
|
1519
263
|
declare class ConfigError extends MetadataError {}
|
|
@@ -1526,28 +270,115 @@ declare const ConfigErrorCode: {
|
|
|
1526
270
|
};
|
|
1527
271
|
type ConfigErrorCode = typeof ConfigErrorCode[keyof typeof ConfigErrorCode];
|
|
1528
272
|
//#endregion
|
|
273
|
+
//#region src/core/error/generator.d.ts
|
|
274
|
+
declare class GeneratorError extends MetadataError {}
|
|
275
|
+
declare function isGeneratorError(input: unknown): input is GeneratorError & {
|
|
276
|
+
code: string;
|
|
277
|
+
};
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/core/error/generator-codes.d.ts
|
|
280
|
+
declare const GeneratorErrorCode: {
|
|
281
|
+
readonly CONTROLLER_NO_SOURCE_FILE: "GENERATOR_CONTROLLER_NO_SOURCE_FILE";
|
|
282
|
+
readonly CONTROLLER_NO_NAME: "GENERATOR_CONTROLLER_NO_NAME";
|
|
283
|
+
readonly PARAMETER_GENERATION_FAILED: "GENERATOR_PARAMETER_GENERATION_FAILED";
|
|
284
|
+
readonly BODY_PARAMETER_DUPLICATE: "GENERATOR_BODY_PARAMETER_DUPLICATE";
|
|
285
|
+
readonly BODY_FORM_CONFLICT: "GENERATOR_BODY_FORM_CONFLICT";
|
|
286
|
+
readonly STRICT_UNMATCHED_DECORATORS: "GENERATOR_STRICT_UNMATCHED_DECORATORS";
|
|
287
|
+
};
|
|
288
|
+
type GeneratorErrorCode = typeof GeneratorErrorCode[keyof typeof GeneratorErrorCode];
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/core/error/parameter.d.ts
|
|
291
|
+
type UnsupportedTypeContext = {
|
|
292
|
+
decoratorName: string;
|
|
293
|
+
propertyName: string;
|
|
294
|
+
type: BaseType;
|
|
295
|
+
node?: Node;
|
|
296
|
+
};
|
|
297
|
+
type UnsupportedMethodContext = {
|
|
298
|
+
decoratorName: string;
|
|
299
|
+
propertyName: string;
|
|
300
|
+
method: string;
|
|
301
|
+
node?: Node;
|
|
302
|
+
};
|
|
303
|
+
type PathMatchInvalidContext = {
|
|
304
|
+
decoratorName: string;
|
|
305
|
+
propertyName: string;
|
|
306
|
+
path: string;
|
|
307
|
+
node?: Node;
|
|
308
|
+
};
|
|
309
|
+
type ScopeRequiredContext = {
|
|
310
|
+
decoratorName: string;
|
|
311
|
+
node?: Node;
|
|
312
|
+
};
|
|
313
|
+
declare class ParameterError extends MetadataError {
|
|
314
|
+
static typeUnsupported(context: UnsupportedTypeContext): ParameterError;
|
|
315
|
+
static methodUnsupported(context: UnsupportedMethodContext): ParameterError;
|
|
316
|
+
static invalidPathMatch(context: PathMatchInvalidContext): ParameterError;
|
|
317
|
+
static scopeRequired(context: ScopeRequiredContext): ParameterError;
|
|
318
|
+
static invalidExampleSchema(): ParameterError;
|
|
319
|
+
static getCurrentLocation(node: Node): string;
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/core/error/parameter-codes.d.ts
|
|
323
|
+
declare const ParameterErrorCode: {
|
|
324
|
+
readonly TYPE_UNSUPPORTED: "PARAMETER_TYPE_UNSUPPORTED";
|
|
325
|
+
readonly METHOD_UNSUPPORTED: "PARAMETER_METHOD_UNSUPPORTED";
|
|
326
|
+
readonly PATH_MISMATCH: "PARAMETER_PATH_MISMATCH";
|
|
327
|
+
readonly SCOPE_REQUIRED: "PARAMETER_SCOPE_REQUIRED";
|
|
328
|
+
readonly INVALID_EXAMPLE: "PARAMETER_INVALID_EXAMPLE";
|
|
329
|
+
};
|
|
330
|
+
type ParameterErrorCode = typeof ParameterErrorCode[keyof typeof ParameterErrorCode];
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/core/error/resolver.d.ts
|
|
333
|
+
declare class ResolverError extends MetadataError {
|
|
334
|
+
readonly file?: string;
|
|
335
|
+
readonly line?: number;
|
|
336
|
+
constructor(message: string, node?: Node | TypeNode, options?: boolean | {
|
|
337
|
+
onlyCurrent?: boolean;
|
|
338
|
+
cause?: unknown;
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
declare function isResolverError(input: unknown): input is ResolverError;
|
|
342
|
+
declare function prettyLocationOfNode(node: Node | TypeNode): {
|
|
343
|
+
text: string;
|
|
344
|
+
file: string;
|
|
345
|
+
line?: number;
|
|
346
|
+
} | undefined;
|
|
347
|
+
declare function prettyTroubleCause(node: Node | TypeNode, onlyCurrent?: boolean): string;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/core/error/validator.d.ts
|
|
350
|
+
declare class ValidatorError extends MetadataError {}
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/core/error/validator-codes.d.ts
|
|
353
|
+
declare const ValidatorErrorCode: {
|
|
354
|
+
readonly EXPECTED_NUMBER: "VALIDATOR_EXPECTED_NUMBER";
|
|
355
|
+
readonly EXPECTED_DATE: "VALIDATOR_EXPECTED_DATE";
|
|
356
|
+
readonly EXPECTED_STRING: "VALIDATOR_EXPECTED_STRING";
|
|
357
|
+
};
|
|
358
|
+
type ValidatorErrorCode = typeof ValidatorErrorCode[keyof typeof ValidatorErrorCode];
|
|
359
|
+
//#endregion
|
|
1529
360
|
//#region src/adapters/typescript/resolver/types.d.ts
|
|
1530
|
-
type OverrideToken =
|
|
1531
|
-
type UsableDeclaration =
|
|
361
|
+
type OverrideToken = Token<SyntaxKind.QuestionToken> | Token<SyntaxKind.PlusToken> | Token<SyntaxKind.MinusToken>;
|
|
362
|
+
type UsableDeclaration = InterfaceDeclaration | ClassDeclaration | PropertySignature | TypeAliasDeclaration | EnumMember;
|
|
1532
363
|
type TypeNodeResolverContext = {
|
|
1533
|
-
[name: string]:
|
|
364
|
+
[name: string]: TypeReferenceNode | TypeNode;
|
|
1534
365
|
};
|
|
1535
366
|
type SubResolverContext = {
|
|
1536
|
-
readonly typeChecker:
|
|
367
|
+
readonly typeChecker: TypeChecker;
|
|
1537
368
|
readonly current: IResolverContext & IReferenceTypeRegistry;
|
|
1538
|
-
readonly parentNode?:
|
|
369
|
+
readonly parentNode?: Node;
|
|
1539
370
|
readonly context: TypeNodeResolverContext;
|
|
1540
|
-
readonly referencer?:
|
|
1541
|
-
resolveType(typeNode:
|
|
1542
|
-
propertyFromSignature(sig:
|
|
1543
|
-
propertyFromDeclaration(decl:
|
|
1544
|
-
getNodeDescription(node: UsableDeclaration |
|
|
1545
|
-
getNodeExample(node: UsableDeclaration |
|
|
1546
|
-
getNodeExtensions(node: UsableDeclaration |
|
|
371
|
+
readonly referencer?: TypeNode;
|
|
372
|
+
resolveType(typeNode: TypeNode, parentNode?: Node, context?: TypeNodeResolverContext, referencer?: TypeNode): Type;
|
|
373
|
+
propertyFromSignature(sig: PropertySignature, overrideToken?: OverrideToken): ResolverProperty;
|
|
374
|
+
propertyFromDeclaration(decl: PropertyDeclaration | ParameterDeclaration, overrideToken?: OverrideToken): ResolverProperty;
|
|
375
|
+
getNodeDescription(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration): string;
|
|
376
|
+
getNodeExample(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration): unknown;
|
|
377
|
+
getNodeExtensions(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration): Extension[];
|
|
1547
378
|
};
|
|
1548
379
|
//#endregion
|
|
1549
380
|
//#region src/adapters/typescript/resolver/sub/array.d.ts
|
|
1550
|
-
declare function resolveArrayType(typeNode:
|
|
381
|
+
declare function resolveArrayType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1551
382
|
//#endregion
|
|
1552
383
|
//#region src/adapters/typescript/resolver/sub/base.d.ts
|
|
1553
384
|
declare class ResolverBase {
|
|
@@ -1557,27 +388,27 @@ declare class ResolverBase {
|
|
|
1557
388
|
}
|
|
1558
389
|
//#endregion
|
|
1559
390
|
//#region src/adapters/typescript/resolver/sub/indexed-access.d.ts
|
|
1560
|
-
declare function resolveIndexedAccessType(typeNode:
|
|
391
|
+
declare function resolveIndexedAccessType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1561
392
|
//#endregion
|
|
1562
393
|
//#region src/adapters/typescript/resolver/sub/intersection.d.ts
|
|
1563
|
-
declare function resolveIntersectionType(typeNode:
|
|
394
|
+
declare function resolveIntersectionType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1564
395
|
//#endregion
|
|
1565
396
|
//#region src/adapters/typescript/resolver/sub/literal.d.ts
|
|
1566
|
-
declare function resolveLiteralType(typeNode:
|
|
1567
|
-
declare function getLiteralValue(typeNode:
|
|
397
|
+
declare function resolveLiteralType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
398
|
+
declare function getLiteralValue(typeNode: LiteralTypeNode): string | number | boolean | null;
|
|
1568
399
|
//#endregion
|
|
1569
400
|
//#region src/adapters/typescript/resolver/sub/mapped.d.ts
|
|
1570
|
-
declare function resolveMappedType(typeNode:
|
|
401
|
+
declare function resolveMappedType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1571
402
|
//#endregion
|
|
1572
403
|
//#region src/adapters/typescript/resolver/sub/object-literal.d.ts
|
|
1573
|
-
declare function resolveObjectLiteralType(typeNode:
|
|
404
|
+
declare function resolveObjectLiteralType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1574
405
|
//#endregion
|
|
1575
406
|
//#region src/adapters/typescript/resolver/sub/primitive.d.ts
|
|
1576
407
|
declare class PrimitiveResolver {
|
|
1577
408
|
protected registry: Registry;
|
|
1578
409
|
constructor(registry: Registry);
|
|
1579
410
|
resolve(node: TypeNode, parentNode?: Node): PrimitiveType | NeverType | VoidType | undefined;
|
|
1580
|
-
resolveSyntaxKind(syntaxKind: SyntaxKind): "string" | "
|
|
411
|
+
resolveSyntaxKind(syntaxKind: SyntaxKind): "string" | "boolean" | "void" | "undefined" | "null" | "number" | "bigint" | "never";
|
|
1581
412
|
}
|
|
1582
413
|
//#endregion
|
|
1583
414
|
//#region src/adapters/typescript/resolver/sub/reference.d.ts
|
|
@@ -1594,13 +425,13 @@ declare class ReferenceResolver extends ResolverBase {
|
|
|
1594
425
|
}
|
|
1595
426
|
//#endregion
|
|
1596
427
|
//#region src/adapters/typescript/resolver/sub/tuple.d.ts
|
|
1597
|
-
declare function resolveTupleType(typeNode:
|
|
428
|
+
declare function resolveTupleType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1598
429
|
//#endregion
|
|
1599
430
|
//#region src/adapters/typescript/resolver/sub/type-operator.d.ts
|
|
1600
|
-
declare function resolveTypeOperatorType(typeNode:
|
|
431
|
+
declare function resolveTypeOperatorType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1601
432
|
//#endregion
|
|
1602
433
|
//#region src/adapters/typescript/resolver/sub/union.d.ts
|
|
1603
|
-
declare function resolveUnionType(typeNode:
|
|
434
|
+
declare function resolveUnionType(typeNode: TypeNode, ctx: SubResolverContext): Type | undefined;
|
|
1604
435
|
//#endregion
|
|
1605
436
|
//#region src/adapters/typescript/resolver/module.d.ts
|
|
1606
437
|
declare class TypeNodeResolver extends ResolverBase {
|
|
@@ -1613,7 +444,7 @@ declare class TypeNodeResolver extends ResolverBase {
|
|
|
1613
444
|
private readonly depth;
|
|
1614
445
|
private readonly primitiveResolver;
|
|
1615
446
|
private readonly referenceResolver;
|
|
1616
|
-
constructor(typeNode:
|
|
447
|
+
constructor(typeNode: TypeNode, current: IResolverContext & IReferenceTypeRegistry, parentNode?: Node, context?: TypeNodeResolverContext, referencer?: TypeNode, depth?: number);
|
|
1617
448
|
/**
|
|
1618
449
|
* @deprecated Use resolverCache.clear() on the context instead.
|
|
1619
450
|
* Kept for backward compatibility — no-ops since cache is now instance-scoped.
|
|
@@ -1665,7 +496,7 @@ declare class TypeNodeResolver extends ResolverBase {
|
|
|
1665
496
|
private getNodeDescription;
|
|
1666
497
|
private static getNodeFormat;
|
|
1667
498
|
private getNodeExample;
|
|
1668
|
-
protected getNodeExtensions(node: UsableDeclaration |
|
|
499
|
+
protected getNodeExtensions(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration): Extension[];
|
|
1669
500
|
}
|
|
1670
501
|
//#endregion
|
|
1671
502
|
//#region src/adapters/typescript/resolver/cache.d.ts
|
|
@@ -1704,8 +535,8 @@ interface NodeDecorator {
|
|
|
1704
535
|
declare function getNodeDecorators(node: Node, isMatching?: (data: NodeDecorator) => boolean): NodeDecorator[];
|
|
1705
536
|
//#endregion
|
|
1706
537
|
//#region src/adapters/typescript/initializer.d.ts
|
|
1707
|
-
declare function getInitializerValue(initializer?:
|
|
1708
|
-
declare const hasInitializer: (node:
|
|
538
|
+
declare function getInitializerValue(initializer?: Expression, typeChecker?: TypeChecker, type?: Type): unknown;
|
|
539
|
+
declare const hasInitializer: (node: Node) => node is HasInitializer;
|
|
1709
540
|
//#endregion
|
|
1710
541
|
//#region src/adapters/typescript/js-doc/constants.d.ts
|
|
1711
542
|
declare enum JSDocTagName {
|
|
@@ -1741,6 +572,69 @@ declare function transformJSDocComment(input?: string | NodeArray<JSDocComment>)
|
|
|
1741
572
|
//#region src/adapters/typescript/validator/module.d.ts
|
|
1742
573
|
declare function getDeclarationValidators(declaration: PropertyDeclaration | TypeAliasDeclaration | PropertySignature | ParameterDeclaration, name?: string): Record<string, Validator>;
|
|
1743
574
|
//#endregion
|
|
575
|
+
//#region src/adapters/decorator/orchestrator/types.d.ts
|
|
576
|
+
type ApplyHandlersOptions = {
|
|
577
|
+
target: DecoratorTarget;
|
|
578
|
+
host: DecoratorHost;
|
|
579
|
+
resolveTypeNode: (node: TypeNode) => Type;
|
|
580
|
+
parameterType?: () => Type | undefined;
|
|
581
|
+
typeChecker?: TypeChecker;
|
|
582
|
+
/**
|
|
583
|
+
* Optional reporter for decorator sources that no handler matched.
|
|
584
|
+
* The orchestrator builds a {@link DecoratorSource} for every decorator
|
|
585
|
+
* on the node; if iteration finishes without any handler claiming a
|
|
586
|
+
* source, this callback fires once for that source.
|
|
587
|
+
*/
|
|
588
|
+
onUnmatchedDecorator?: (report: UnmatchedDecoratorReport, source: DecoratorSource) => void;
|
|
589
|
+
};
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region src/adapters/decorator/orchestrator/module.d.ts
|
|
592
|
+
type DecoratorHandlerLike<D> = {
|
|
593
|
+
match: Match;
|
|
594
|
+
apply: (ctx: HandlerContext, draft: D) => void;
|
|
595
|
+
};
|
|
596
|
+
type JsDocHandlerLike<D> = {
|
|
597
|
+
match: JsDocMatch;
|
|
598
|
+
apply: (ctx: JsDocHandlerContext, draft: D) => void;
|
|
599
|
+
};
|
|
600
|
+
declare function buildHandlerContext(source: DecoratorSource, options: ApplyHandlersOptions): HandlerContext;
|
|
601
|
+
declare function buildJsDocHandlerContext(source: JsDocSource, options: ApplyHandlersOptions): JsDocHandlerContext;
|
|
602
|
+
declare function applyDecoratorHandlers<D>(node: Node, handlers: DecoratorHandlerLike<D>[], draft: D, options: ApplyHandlersOptions): void;
|
|
603
|
+
declare function applyJsDocHandlers<D>(node: Node, handlers: JsDocHandlerLike<D>[], draft: D, options: ApplyHandlersOptions): void;
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/adapters/decorator/typescript/types.d.ts
|
|
606
|
+
type DecoratorSourceBuilderOptions = {
|
|
607
|
+
target: DecoratorTarget;
|
|
608
|
+
host: DecoratorHost;
|
|
609
|
+
resolveTypeNode: (node: TypeNode) => Type;
|
|
610
|
+
typeChecker?: TypeChecker;
|
|
611
|
+
};
|
|
612
|
+
type JsDocSourceBuilderOptions = {
|
|
613
|
+
target: DecoratorTarget;
|
|
614
|
+
host: DecoratorHost;
|
|
615
|
+
resolveTypeNode: (node: TypeNode) => Type;
|
|
616
|
+
};
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region src/adapters/decorator/typescript/module.d.ts
|
|
619
|
+
declare function buildDecoratorSources(node: Node, options: DecoratorSourceBuilderOptions): DecoratorSource[];
|
|
620
|
+
declare function buildJsDocSources(node: Node, options: JsDocSourceBuilderOptions): JsDocSource[];
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/adapters/decorator/typescript/utils.d.ts
|
|
623
|
+
type RawDecorator = {
|
|
624
|
+
name: string;
|
|
625
|
+
arguments: DecoratorArgument[];
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* Enumerate decorators on a TS node and classify their argument values without
|
|
629
|
+
* going through the registry. Used by read-side consumers (type resolver,
|
|
630
|
+
* extension extraction) that only need decorator names + argument values.
|
|
631
|
+
*/
|
|
632
|
+
declare function readNodeDecorators(node: Node, typeChecker?: TypeChecker): RawDecorator[];
|
|
633
|
+
declare function findDecoratorByName(node: Node, name: string, typeChecker?: TypeChecker): RawDecorator | undefined;
|
|
634
|
+
declare function findDecoratorsByName(node: Node, name: string, typeChecker?: TypeChecker): RawDecorator[];
|
|
635
|
+
declare function hasDecoratorNamed(node: Node, name: string, typeChecker?: TypeChecker): boolean;
|
|
636
|
+
declare function buildDecoratorArgument(expr: Expression, typeChecker?: TypeChecker): DecoratorArgument;
|
|
637
|
+
//#endregion
|
|
1744
638
|
//#region src/adapters/filesystem/source-files.d.ts
|
|
1745
639
|
declare function scanSourceFiles(input: EntryPoint): Promise<string[]>;
|
|
1746
640
|
//#endregion
|
|
@@ -1788,9 +682,6 @@ declare class MetadataGenerator implements IGeneratorContext, IMetadataGenerator
|
|
|
1788
682
|
private buildControllers;
|
|
1789
683
|
}
|
|
1790
684
|
//#endregion
|
|
1791
|
-
//#region src/app/generator/metadata/utils.d.ts
|
|
1792
|
-
declare function isMetadata(input: unknown): input is Metadata;
|
|
1793
|
-
//#endregion
|
|
1794
685
|
//#region src/app/generator/controller/module.d.ts
|
|
1795
686
|
declare class ControllerGenerator implements IControllerGenerator {
|
|
1796
687
|
protected readonly node: ClassDeclaration;
|
|
@@ -1822,7 +713,7 @@ declare class ParameterGenerator implements IParameterGenerator {
|
|
|
1822
713
|
private readonly method;
|
|
1823
714
|
private readonly paths;
|
|
1824
715
|
private readonly current;
|
|
1825
|
-
constructor(parameter:
|
|
716
|
+
constructor(parameter: ParameterDeclaration, method: string, paths: string[], current: IGeneratorContext);
|
|
1826
717
|
generate(): Parameter[];
|
|
1827
718
|
private finalize;
|
|
1828
719
|
private draftToParameter;
|
|
@@ -1848,5 +739,5 @@ declare function hasOwnProperty<Y extends PropertyKey>(obj: unknown, prop: Y): o
|
|
|
1848
739
|
//#region src/core/utils/path-normalize.d.ts
|
|
1849
740
|
declare function normalizePath(str: string): string;
|
|
1850
741
|
//#endregion
|
|
1851
|
-
export {
|
|
742
|
+
export { ApplyHandlersOptions, CACHE_DEFAULT_MAX_AGE_MS, CACHE_FILE_PREFIX, CACHE_FILE_SUFFIX, CACHE_SCHEMA_VERSION, CacheClient, CacheData, CacheKeyParts, CacheOptions, CacheOptionsInput, ConfigError, ConfigErrorCode, ControllerGenerator, DecoratorSourceBuilderOptions, EntryPoint, EntryPointOptions, GeneratorError, GeneratorErrorCode, ICacheClient, IGeneratorContext, IMetadataGenerator, IReferenceTypeRegistry, IResolverContext, JSDocTagName, JsDocSourceBuilderOptions, MetadataError, MetadataGenerateOptions, MetadataGenerator, MetadataGeneratorContext, MetadataGeneratorOptions, MethodGenerator, NodeDecorator, OverrideToken, ParameterError, ParameterErrorCode, ParameterGenerator, PrimitiveResolver, RawDecorator, ReferenceResolver, ResolverBase, ResolverCache, ResolverError, SubResolverContext, TsCompilerOptions, TsConfig, TsconfigLoadContext, TypeNodeResolver, TypeNodeResolverContext, UsableDeclaration, ValidatorError, ValidatorErrorCode, applyDecoratorHandlers, applyJsDocHandlers, buildCacheOptions, buildDecoratorArgument, buildDecoratorSources, buildHandlerContext, buildJsDocHandlerContext, buildJsDocSources, composeCacheKey, findDecoratorByName, findDecoratorsByName, generateMetadata, getDeclarationValidators, getInitializerValue, getJSDoc, getJSDocDescription, getJSDocTagComment, getJSDocTagNames, getJSDocTags, getLiteralValue, getNodeDecorators, getNodeDescription, getNodeExtensions, hasDecoratorNamed, hasInitializer, hasJSDocTag, hasOwnProperty, hashCompilerOptions, hashRegistry, isGeneratorError, isResolverError, isStringArray, loadTSConfig, normalizePath, prettyLocationOfNode, prettyTroubleCause, readNodeDecorators, resolveArrayType, resolveIndexedAccessType, resolveIntersectionType, resolveLiteralType, resolveMappedType, resolveObjectLiteralType, resolveTupleType, resolveTypeOperatorType, resolveUnionType, scanSourceFiles, softLoadTsconfig, toTypeNodeOrFail, transformJSDocComment };
|
|
1852
743
|
//# sourceMappingURL=index.d.mts.map
|