@apinni/client-ts 0.0.0 → 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.
- package/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/cli.js +235 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +235 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +409 -0
- package/dist/index.d.ts +409 -0
- package/dist/index.js +234 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +234 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +85 -9
- package/index.js +0 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { Type, Node, Decorator } from 'ts-morph';
|
|
2
|
+
|
|
3
|
+
type JsonSchemaType = 'string' | 'number' | 'boolean' | 'null' | 'object' | 'array' | 'enum' | 'ref' | 'never' | 'complex' | 'any' | 'undefined';
|
|
4
|
+
interface SchemaDefinitionProperties {
|
|
5
|
+
global?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
example?: string;
|
|
8
|
+
default?: string;
|
|
9
|
+
deprecated?: string;
|
|
10
|
+
}
|
|
11
|
+
interface BaseJsonSchema extends SchemaDefinitionProperties {
|
|
12
|
+
type: JsonSchemaType;
|
|
13
|
+
}
|
|
14
|
+
interface StringSchema extends BaseJsonSchema {
|
|
15
|
+
type: 'string';
|
|
16
|
+
const?: string;
|
|
17
|
+
}
|
|
18
|
+
interface NumberSchema extends BaseJsonSchema {
|
|
19
|
+
type: 'number';
|
|
20
|
+
const?: number;
|
|
21
|
+
}
|
|
22
|
+
interface BooleanSchema extends BaseJsonSchema {
|
|
23
|
+
type: 'boolean';
|
|
24
|
+
const?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface NullSchema extends BaseJsonSchema {
|
|
27
|
+
type: 'null';
|
|
28
|
+
}
|
|
29
|
+
interface EnumSchema extends BaseJsonSchema {
|
|
30
|
+
type: 'enum';
|
|
31
|
+
values: (string | number | boolean)[];
|
|
32
|
+
}
|
|
33
|
+
interface ArrayItemMeta {
|
|
34
|
+
optional?: boolean;
|
|
35
|
+
rest?: boolean;
|
|
36
|
+
name?: string;
|
|
37
|
+
}
|
|
38
|
+
interface ArraySchema extends BaseJsonSchema {
|
|
39
|
+
type: 'array';
|
|
40
|
+
items: JsonSchema | (JsonSchema & ArrayItemMeta)[];
|
|
41
|
+
}
|
|
42
|
+
interface ObjectSchema extends BaseJsonSchema {
|
|
43
|
+
type: 'object';
|
|
44
|
+
properties: Record<string, JsonSchema>;
|
|
45
|
+
required?: string[];
|
|
46
|
+
indexedProperties?: JsonSchema;
|
|
47
|
+
}
|
|
48
|
+
interface RefSchema extends BaseJsonSchema {
|
|
49
|
+
type: 'ref';
|
|
50
|
+
name: string;
|
|
51
|
+
}
|
|
52
|
+
interface AnyOfSchema extends BaseJsonSchema {
|
|
53
|
+
type: 'complex';
|
|
54
|
+
anyOf: JsonSchema[];
|
|
55
|
+
}
|
|
56
|
+
interface AllOfSchema extends BaseJsonSchema {
|
|
57
|
+
type: 'complex';
|
|
58
|
+
allOf: JsonSchema[];
|
|
59
|
+
}
|
|
60
|
+
interface NeverSchema extends BaseJsonSchema {
|
|
61
|
+
type: 'never';
|
|
62
|
+
}
|
|
63
|
+
interface AnySchema extends BaseJsonSchema {
|
|
64
|
+
type: 'any';
|
|
65
|
+
}
|
|
66
|
+
interface UndefinedSchema extends BaseJsonSchema {
|
|
67
|
+
type: 'undefined';
|
|
68
|
+
}
|
|
69
|
+
type JsonSchema = StringSchema | NumberSchema | BooleanSchema | NullSchema | EnumSchema | ArraySchema | ObjectSchema | RefSchema | AnyOfSchema | AllOfSchema | NeverSchema | AnySchema | UndefinedSchema;
|
|
70
|
+
type SchemaBuilderEntry = {
|
|
71
|
+
name: string;
|
|
72
|
+
} | {
|
|
73
|
+
name: string;
|
|
74
|
+
model: string;
|
|
75
|
+
} | {
|
|
76
|
+
name: string;
|
|
77
|
+
inline: string;
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
type: Type;
|
|
81
|
+
node?: Node;
|
|
82
|
+
};
|
|
83
|
+
type TypesSchema = {
|
|
84
|
+
schema: Record<string, JsonSchema>;
|
|
85
|
+
refs: Record<string, JsonSchema>;
|
|
86
|
+
mappedReferences: Record<string, string>;
|
|
87
|
+
};
|
|
88
|
+
type DomainTypesSchema = Omit<TypesSchema, 'mappedReferences'>;
|
|
89
|
+
type NamedTsTypeEntry = Extract<SchemaBuilderEntry, {
|
|
90
|
+
type: Type;
|
|
91
|
+
}>;
|
|
92
|
+
type NamedInlineTypeEntry = Extract<SchemaBuilderEntry, {
|
|
93
|
+
inline: string;
|
|
94
|
+
}>;
|
|
95
|
+
type NamedModelTypeEntry = Extract<SchemaBuilderEntry, {
|
|
96
|
+
model: string;
|
|
97
|
+
}>;
|
|
98
|
+
type EndpointData = {
|
|
99
|
+
path: string;
|
|
100
|
+
method: string;
|
|
101
|
+
domains: string[];
|
|
102
|
+
disabledDomains: string[];
|
|
103
|
+
query?: string;
|
|
104
|
+
request?: string;
|
|
105
|
+
responses?: Record<number, string>;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
interface PipelineOptions {
|
|
109
|
+
useExistingBuild?: boolean;
|
|
110
|
+
watch?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type CountDuplicates<K extends string, Seen extends string[], Count extends number[] = []> = Seen extends [infer First extends string, ...infer Rest extends string[]] ? First extends K ? CountDuplicates<K, Rest, [...Count, any]> : CountDuplicates<K, Rest, Count> : Count;
|
|
114
|
+
type NormalizeParam<Param extends string, Seen extends string[]> = CountDuplicates<Param, Seen>['length'] extends 0 ? Param : `${NormalizeParam<`${Param}_${CountDuplicates<Param, Seen>['length']}`, Seen>}`;
|
|
115
|
+
type NormalizePath<T extends string, Seen extends string[] = [], Output extends string = ''> = T extends `${infer Before}:${infer Param}/${infer Rest}` ? NormalizePath<`/${Rest}`, [
|
|
116
|
+
...Seen,
|
|
117
|
+
Param
|
|
118
|
+
], `${Output}${Before}:${NormalizeParam<Param, Seen>}`> : T extends `${infer Before}:${infer Param}` ? `${Output}${Before}:${NormalizeParam<Param, Seen>}` : `${Output}${T}`;
|
|
119
|
+
|
|
120
|
+
interface ControllerOptions<T extends string = string> {
|
|
121
|
+
path: NormalizePath<T>;
|
|
122
|
+
}
|
|
123
|
+
declare const ApinniController: <Path extends string = string>(_options: ControllerOptions<Path>) => <T extends {
|
|
124
|
+
new (...args: any[]): object;
|
|
125
|
+
}>(constructor: T) => T;
|
|
126
|
+
|
|
127
|
+
type DisabledOptions = {
|
|
128
|
+
disabled: boolean;
|
|
129
|
+
reason?: string;
|
|
130
|
+
} | {
|
|
131
|
+
domains: Partial<{
|
|
132
|
+
'*': boolean;
|
|
133
|
+
[domain: string]: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
reason?: string;
|
|
136
|
+
};
|
|
137
|
+
declare const ApinniDisabled: (_options?: DisabledOptions) => (target: any, propertyKey?: string, descriptor?: PropertyDescriptor) => any;
|
|
138
|
+
|
|
139
|
+
interface DomainOptions {
|
|
140
|
+
domains: Array<string>;
|
|
141
|
+
}
|
|
142
|
+
declare const ApinniDomain: (_options: DomainOptions) => <T extends {
|
|
143
|
+
new (...args: any[]): object;
|
|
144
|
+
}>(constructor: T) => T;
|
|
145
|
+
|
|
146
|
+
type OptionDefinition = {
|
|
147
|
+
model: string;
|
|
148
|
+
name?: string;
|
|
149
|
+
};
|
|
150
|
+
interface EndpointOptions<T extends string = string> {
|
|
151
|
+
path: NormalizePath<T>;
|
|
152
|
+
method: string;
|
|
153
|
+
query?: OptionDefinition | Array<string>;
|
|
154
|
+
request?: OptionDefinition;
|
|
155
|
+
responses?: OptionDefinition | {
|
|
156
|
+
[status: number]: OptionDefinition;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
type TypeDefinition$1 = {
|
|
160
|
+
type: unknown;
|
|
161
|
+
name?: string;
|
|
162
|
+
};
|
|
163
|
+
type ResponseType = TypeDefinition$1 | {
|
|
164
|
+
[status: number]: TypeDefinition$1;
|
|
165
|
+
};
|
|
166
|
+
interface TypeShape {
|
|
167
|
+
query?: TypeDefinition$1;
|
|
168
|
+
request?: TypeDefinition$1;
|
|
169
|
+
responses?: ResponseType;
|
|
170
|
+
}
|
|
171
|
+
type EndpointShape<T extends TypeShape = TypeShape> = T;
|
|
172
|
+
type ApinniEndpointDecorator = <Shape extends TypeShape = TypeShape, Path extends string = string>(options: EndpointOptions<Path>) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
173
|
+
declare const ApinniEndpoint: ApinniEndpointDecorator;
|
|
174
|
+
|
|
175
|
+
type DecoratorVariant = 'class' | 'method';
|
|
176
|
+
type DecoratorType = 'compile-time' | 'run-time';
|
|
177
|
+
type HandlerEvent = 'register' | 'unregister';
|
|
178
|
+
interface DecoratorDefinition<T extends DecoratorVariant = DecoratorVariant> {
|
|
179
|
+
name: string;
|
|
180
|
+
variant: T;
|
|
181
|
+
type: DecoratorType;
|
|
182
|
+
handler: (event: HandlerEvent, params: {
|
|
183
|
+
target: any;
|
|
184
|
+
decorator: Decorator;
|
|
185
|
+
} & (T extends 'method' ? {
|
|
186
|
+
propertyKey: string | symbol;
|
|
187
|
+
} : Record<never, never>)) => void;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface ShareableRegistry {
|
|
191
|
+
register: <T extends DecoratorVariant>(definition: DecoratorDefinition<T>) => void;
|
|
192
|
+
}
|
|
193
|
+
interface ShareableContext<ClassMeta extends Record<string, any> = Record<string, any>, MethodMeta extends Record<string, any> = Record<string, any>> {
|
|
194
|
+
registerClassMetadata(target: any, metadata: Partial<Omit<ClassMetadata, 'target'> & ClassMeta>): void;
|
|
195
|
+
registerMethodMetadata(target: any, propertyKey: string | symbol, metadata: Partial<MethodMetadata & MethodMeta>): void;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface ClassMetadata {
|
|
199
|
+
target: any;
|
|
200
|
+
disabledDomains?: Partial<{
|
|
201
|
+
'*': boolean;
|
|
202
|
+
[domain: string]: boolean;
|
|
203
|
+
}>;
|
|
204
|
+
disabledReason?: string;
|
|
205
|
+
path?: string;
|
|
206
|
+
domains?: Array<string>;
|
|
207
|
+
[key: string]: any;
|
|
208
|
+
}
|
|
209
|
+
interface InternalClassMetadata extends ClassMetadata {
|
|
210
|
+
decorator: Decorator;
|
|
211
|
+
}
|
|
212
|
+
type TypeDefinition = {
|
|
213
|
+
name?: string;
|
|
214
|
+
model: string;
|
|
215
|
+
} | {
|
|
216
|
+
name?: string;
|
|
217
|
+
type: Type;
|
|
218
|
+
node: Node;
|
|
219
|
+
};
|
|
220
|
+
type QueryDefinition = {
|
|
221
|
+
name?: string;
|
|
222
|
+
inline: string;
|
|
223
|
+
};
|
|
224
|
+
interface MethodMetadata {
|
|
225
|
+
path: string;
|
|
226
|
+
method: string;
|
|
227
|
+
query?: TypeDefinition | QueryDefinition;
|
|
228
|
+
request?: TypeDefinition;
|
|
229
|
+
responses?: Record<number, TypeDefinition>;
|
|
230
|
+
target: any;
|
|
231
|
+
propertyKey: string | symbol;
|
|
232
|
+
descriptor: PropertyDescriptor;
|
|
233
|
+
disabledDomains?: Partial<{
|
|
234
|
+
'*': boolean;
|
|
235
|
+
[domain: string]: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
disabledReason?: string;
|
|
238
|
+
domains?: Array<string>;
|
|
239
|
+
[key: string]: any;
|
|
240
|
+
}
|
|
241
|
+
interface InternalMethodMetadata extends MethodMetadata {
|
|
242
|
+
decorator: Decorator;
|
|
243
|
+
}
|
|
244
|
+
interface IGenerationContext extends ShareableContext {
|
|
245
|
+
getClassMetadata(): ClassMetadata[];
|
|
246
|
+
getMethodMetadata(): MethodMetadata[];
|
|
247
|
+
getPreparedData(): MethodMetadata[];
|
|
248
|
+
filterEnabled(): void;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
type ApiSchema = {
|
|
252
|
+
endpoints: EndpointData[];
|
|
253
|
+
schema: TypesSchema;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
interface SharedContext<T = any> {
|
|
257
|
+
/** Plugin-specific shared context data */
|
|
258
|
+
data: T;
|
|
259
|
+
}
|
|
260
|
+
interface DependencyOptions {
|
|
261
|
+
allowContextManipulation?: boolean;
|
|
262
|
+
}
|
|
263
|
+
interface Dependency {
|
|
264
|
+
plugin: ShareablePlugin;
|
|
265
|
+
options?: DependencyOptions;
|
|
266
|
+
}
|
|
267
|
+
interface OverridedContext<T extends Record<string, any> = Record<string, any>, U extends Record<string, any> = Record<string, any>> {
|
|
268
|
+
classMetadata: T;
|
|
269
|
+
methodMetadata: U;
|
|
270
|
+
}
|
|
271
|
+
type ExtractDependenciesOverridedContext<Dependencies extends Dependency[] = []> = Dependencies extends [Dependency, ...Dependency[]] ? {
|
|
272
|
+
[K in keyof Dependencies]: Dependencies[K]['options'] extends DependencyOptions ? Dependencies[K]['options']['allowContextManipulation'] extends true ? ExtractOverridedContext<Dependencies[K]['plugin']> : OverridedContext : OverridedContext;
|
|
273
|
+
}[number] : OverridedContext;
|
|
274
|
+
/**
|
|
275
|
+
* Base configuration and hooks for a Apinni plugin
|
|
276
|
+
*/
|
|
277
|
+
interface BaseApinniPluginProps<OverridedGlobalContext extends OverridedContext = OverridedContext, Dependencies extends Dependency[] = [], IsShareable extends boolean = false, SharedContextData extends [IsShareable] extends [true] ? any : never = [
|
|
278
|
+
IsShareable
|
|
279
|
+
] extends [true] ? any : never> {
|
|
280
|
+
/** Unique identifier for the plugin */
|
|
281
|
+
name: string;
|
|
282
|
+
/** Plugin configuration options */
|
|
283
|
+
config?: {
|
|
284
|
+
/**
|
|
285
|
+
* Set to `true` if this plugin should be available as a dependency
|
|
286
|
+
* for other plugins. Only shareable plugins can be used as dependencies.
|
|
287
|
+
*
|
|
288
|
+
* **Note:**
|
|
289
|
+
*
|
|
290
|
+
* If plugin is used as dependency - the manipulation with global context
|
|
291
|
+
* could be restricted. By default the follow methods will be skipped:
|
|
292
|
+
* 1. `onRegisterMetadata()`
|
|
293
|
+
* 2. `onGenerateTypes()`
|
|
294
|
+
*
|
|
295
|
+
* Only if consumer pass the option **allowContextManipulation** as `true`
|
|
296
|
+
* all the hooks will be executed.
|
|
297
|
+
*/
|
|
298
|
+
shareable?: IsShareable;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Plugin lifecycle hooks executed in the following order:
|
|
302
|
+
* 1. `onInitialize()` - Initialize decorators in registry
|
|
303
|
+
* 2. `onAfterDecoratorsProcessed()` - Process after all decorators are loaded
|
|
304
|
+
* 3. `onProvideSharedContext()` - Share context with dependent plugins (shareable only)
|
|
305
|
+
* 4. `onConsumeDependencyContexts()` - Consume contexts from dependencies (with dependencies only)
|
|
306
|
+
* 5. `onRegisterMetadata()` - Register metadata in generation context
|
|
307
|
+
* 6. `onGenerateTypes()` - Generate final types
|
|
308
|
+
*/
|
|
309
|
+
hooks: {
|
|
310
|
+
/**
|
|
311
|
+
* Initialize custom decorators in the registry.
|
|
312
|
+
* This allows the library to import and process your decorators.
|
|
313
|
+
*
|
|
314
|
+
* @param registry - The decorator registry to register custom decorators
|
|
315
|
+
*/
|
|
316
|
+
onInitialize: (registry: ShareableRegistry, mode: ApinniRunMode) => Promise<void> | void;
|
|
317
|
+
/**
|
|
318
|
+
* Called after all decorators have been processed.
|
|
319
|
+
* Use this hook to prepare and validate your plugin data.
|
|
320
|
+
*/
|
|
321
|
+
onAfterDecoratorsProcessed?: () => void;
|
|
322
|
+
/**
|
|
323
|
+
* Register metadata in the generation context.
|
|
324
|
+
* This is where you can add plugin-specific metadata for code generation.
|
|
325
|
+
*
|
|
326
|
+
* @param context - The generation context to register metadata
|
|
327
|
+
*/
|
|
328
|
+
onRegisterMetadata?: (context: ShareableContext<OverridedGlobalContext['classMetadata'] & ExtractDependenciesOverridedContext<Dependencies>['classMetadata'], OverridedGlobalContext['methodMetadata'] & ExtractDependenciesOverridedContext<Dependencies>['methodMetadata']>) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Generate types and perform final code generation tasks.
|
|
331
|
+
* This is the final hook in the plugin lifecycle.
|
|
332
|
+
*
|
|
333
|
+
* @param context - The generation context for type generation
|
|
334
|
+
*/
|
|
335
|
+
onGenerateTypes?: (schema: ApiSchema, metadata?: {
|
|
336
|
+
classMetadata: Array<ClassMetadata & Partial<OverridedGlobalContext['classMetadata'] & ExtractDependenciesOverridedContext<Dependencies>['classMetadata']>>;
|
|
337
|
+
methodMetadata: Array<MethodMetadata & Partial<OverridedGlobalContext['methodMetadata'] & ExtractDependenciesOverridedContext<Dependencies>['methodMetadata']>>;
|
|
338
|
+
}) => Promise<void>;
|
|
339
|
+
} & ([IsShareable] extends [true] ? {
|
|
340
|
+
/**
|
|
341
|
+
* Provide shared context data to dependent plugins.
|
|
342
|
+
* Only called for plugins with `shareable: true`.
|
|
343
|
+
*
|
|
344
|
+
* @returns Shared context that will be passed to dependent plugins
|
|
345
|
+
*/
|
|
346
|
+
onProvideSharedContext: () => SharedContext<SharedContextData>;
|
|
347
|
+
} : Record<never, never>);
|
|
348
|
+
/** Array of shareable plugins that this plugin depends on */
|
|
349
|
+
dependencies?: Dependencies;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Utility type to extract the shared context type from a shareable plugin
|
|
353
|
+
*/
|
|
354
|
+
type ExtractSharedContext<T extends ShareablePlugin> = T extends ShareablePlugin<infer _, infer __, infer C> ? SharedContext<C> : never;
|
|
355
|
+
/**
|
|
356
|
+
* Utility type to extract the overrided global context type from a shareable plugin
|
|
357
|
+
*/
|
|
358
|
+
type ExtractOverridedContext<T extends ShareablePlugin> = T extends ShareablePlugin<infer R, infer _, infer __> ? R : never;
|
|
359
|
+
/**
|
|
360
|
+
* Apinni Plugin definition with conditional dependency context handling
|
|
361
|
+
*/
|
|
362
|
+
type InternalApinniPlugin<OverridedGlobalContext extends OverridedContext = OverridedContext, Dependencies extends Dependency[] = [], IsShareable extends boolean = false, SharedContext extends [IsShareable] extends [true] ? any : never = [
|
|
363
|
+
IsShareable
|
|
364
|
+
] extends [true] ? any : never> = Dependencies extends [Dependency, ...Dependency[]] ? BaseApinniPluginProps<OverridedGlobalContext, Dependencies, IsShareable, SharedContext> & {
|
|
365
|
+
/** Required dependencies that must be shareable plugins */
|
|
366
|
+
dependencies: {
|
|
367
|
+
[K in keyof Dependencies]: Dependencies[K] & Dependency;
|
|
368
|
+
};
|
|
369
|
+
hooks: {
|
|
370
|
+
/**
|
|
371
|
+
* Process shared contexts from dependency plugins.
|
|
372
|
+
* Called after all dependencies have provided their shared contexts.
|
|
373
|
+
*
|
|
374
|
+
* @param contexts - Array of shared contexts from dependency plugins
|
|
375
|
+
*/
|
|
376
|
+
onConsumeDependencyContexts: (contexts: {
|
|
377
|
+
[K in keyof Dependencies]: ExtractSharedContext<Dependencies[K]['plugin']>;
|
|
378
|
+
}) => void;
|
|
379
|
+
};
|
|
380
|
+
} : BaseApinniPluginProps<OverridedGlobalContext, Dependencies, IsShareable, SharedContext>;
|
|
381
|
+
type ApinniPlugin<OverridedGlobalContext extends OverridedContext = OverridedContext, Dependencies extends Dependency[] = [], IsShareable extends boolean = false, SharedContext extends [IsShareable] extends [true] ? any : never = [
|
|
382
|
+
IsShareable
|
|
383
|
+
] extends [true] ? any : never> = InternalApinniPlugin<OverridedGlobalContext, Dependencies, IsShareable, SharedContext> & {
|
|
384
|
+
readonly __brand?: 'ApinniPlugin';
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Represents a plugin that can be shared as a dependency
|
|
388
|
+
*/
|
|
389
|
+
type ShareablePlugin<OverridedGlobalContext extends OverridedContext = OverridedContext, Dependencies extends Dependency[] = [], Context = any> = ApinniPlugin<OverridedGlobalContext, Dependencies, true, Context> & {
|
|
390
|
+
readonly __brand?: 'ApinniPlugin';
|
|
391
|
+
};
|
|
392
|
+
type PluginTypes = ApinniPlugin<any, any, false, never> | ShareablePlugin<any, any, any>;
|
|
393
|
+
|
|
394
|
+
interface ApinniConfig {
|
|
395
|
+
includePatterns?: string[];
|
|
396
|
+
excludePattenrs?: string[];
|
|
397
|
+
plugins: PluginTypes[];
|
|
398
|
+
outputPath?: string;
|
|
399
|
+
generateSchemaFiles?: boolean;
|
|
400
|
+
}
|
|
401
|
+
type ApinniRunMode = 'watch' | 'default';
|
|
402
|
+
|
|
403
|
+
declare function runApinni(config: ApinniConfig, options: PipelineOptions): Promise<void>;
|
|
404
|
+
|
|
405
|
+
declare const buildPluginWithContext: <OverridedGlobalContext extends OverridedContext = OverridedContext>() => <Dependencies extends Dependency[] = [], IsShareable extends boolean = false, SharedContext extends [IsShareable] extends [true] ? any : never = [IsShareable] extends [true] ? any : never>(plugin: ApinniPlugin<OverridedGlobalContext, Dependencies, IsShareable, SharedContext>) => ApinniPlugin<OverridedGlobalContext, Dependencies, IsShareable, SharedContext>;
|
|
406
|
+
declare const buildPlugin: <Dependencies extends Dependency[] = [], IsShareable extends boolean = false, SharedContext extends [IsShareable] extends [true] ? any : never = [IsShareable] extends [true] ? any : never>(plugin: ApinniPlugin<OverridedContext, Dependencies, IsShareable, SharedContext>) => ApinniPlugin<OverridedContext, Dependencies, IsShareable, SharedContext>;
|
|
407
|
+
declare function extractDecoratorArgValue<T>(decorator: Decorator): T | null;
|
|
408
|
+
|
|
409
|
+
export { type AllOfSchema, type AnyOfSchema, type AnySchema, type ApiSchema, type ApinniConfig, ApinniController, ApinniDisabled, ApinniDomain, ApinniEndpoint, type ApinniPlugin, type ApinniRunMode, type ArrayItemMeta, type ArraySchema, type BaseApinniPluginProps, type BooleanSchema, type ClassMetadata, type ControllerOptions, type DecoratorDefinition, type DecoratorType, type DecoratorVariant, type Dependency, type DependencyOptions, type DisabledOptions, type DomainOptions, type DomainTypesSchema, type EndpointData, type EndpointOptions, type EndpointShape, type EnumSchema, type HandlerEvent, type IGenerationContext, type InternalClassMetadata, type InternalMethodMetadata, type JsonSchema, type JsonSchemaType, type MethodMetadata, type NamedInlineTypeEntry, type NamedModelTypeEntry, type NamedTsTypeEntry, type NeverSchema, type NullSchema, type NumberSchema, type ObjectSchema, type OverridedContext, type PipelineOptions, type PluginTypes, type RefSchema, type SchemaBuilderEntry, type SchemaDefinitionProperties, type ShareableContext, type ShareablePlugin, type ShareableRegistry, type SharedContext, type StringSchema, type TypesSchema, type UndefinedSchema, buildPlugin, buildPluginWithContext, extractDecoratorArgValue, runApinni };
|