@kubb/plugin-mcp 5.0.0-alpha.9 → 5.0.0-beta.10
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 +17 -10
- package/README.md +24 -7
- package/dist/index.cjs +1007 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +215 -4
- package/dist/index.js +973 -90
- package/dist/index.js.map +1 -1
- package/extension.yaml +463 -0
- package/package.json +43 -66
- package/src/components/McpHandler.tsx +167 -0
- package/src/components/Server.tsx +89 -109
- package/src/generators/mcpGenerator.tsx +53 -84
- package/src/generators/serverGenerator.tsx +92 -58
- package/src/index.ts +11 -2
- package/src/plugin.ts +87 -135
- package/src/resolvers/resolverMcp.ts +31 -0
- package/src/types.ts +54 -28
- package/src/utils.ts +64 -0
- package/dist/Server-DV9zFrUP.cjs +0 -221
- package/dist/Server-DV9zFrUP.cjs.map +0 -1
- package/dist/Server-KWLMg0Lm.js +0 -173
- package/dist/Server-KWLMg0Lm.js.map +0 -1
- package/dist/components.cjs +0 -3
- package/dist/components.d.ts +0 -41
- package/dist/components.js +0 -2
- package/dist/generators-CWAFnA94.cjs +0 -285
- package/dist/generators-CWAFnA94.cjs.map +0 -1
- package/dist/generators-TtEOkDB1.js +0 -274
- package/dist/generators-TtEOkDB1.js.map +0 -1
- package/dist/generators.cjs +0 -4
- package/dist/generators.d.ts +0 -508
- package/dist/generators.js +0 -2
- package/dist/types-DXZDZ3vf.d.ts +0 -64
- package/src/components/index.ts +0 -1
- package/src/generators/index.ts +0 -2
package/dist/generators.d.ts
DELETED
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { n as PluginMcp } from "./types-DXZDZ3vf.js";
|
|
3
|
-
import { Config, FileMetaBase, Generator, Group, KubbEvents, Output, Plugin, PluginDriver, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
|
|
4
|
-
import { Fabric, KubbFile } from "@kubb/fabric-core/types";
|
|
5
|
-
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
6
|
-
import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
|
|
7
|
-
|
|
8
|
-
//#region ../../internals/utils/src/asyncEventEmitter.d.ts
|
|
9
|
-
/** A function that can be registered as an event listener, synchronous or async. */
|
|
10
|
-
type AsyncListener<TArgs extends unknown[]> = (...args: TArgs) => void | Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* A typed EventEmitter that awaits all async listeners before resolving.
|
|
13
|
-
* Wraps Node's `EventEmitter` with full TypeScript event-map inference.
|
|
14
|
-
*/
|
|
15
|
-
declare class AsyncEventEmitter<TEvents extends { [K in keyof TEvents]: unknown[] }> {
|
|
16
|
-
#private;
|
|
17
|
-
/**
|
|
18
|
-
* `maxListener` controls the maximum number of listeners per event before Node emits a memory-leak warning.
|
|
19
|
-
* @default 10
|
|
20
|
-
*/
|
|
21
|
-
constructor(maxListener?: number);
|
|
22
|
-
/**
|
|
23
|
-
* Emits an event and awaits all registered listeners in parallel.
|
|
24
|
-
* Throws if any listener rejects, wrapping the cause with the event name and serialized arguments.
|
|
25
|
-
*/
|
|
26
|
-
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void>;
|
|
27
|
-
/** Registers a persistent listener for the given event. */
|
|
28
|
-
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void;
|
|
29
|
-
/** Registers a one-shot listener that removes itself after the first invocation. */
|
|
30
|
-
onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void;
|
|
31
|
-
/** Removes a previously registered listener. */
|
|
32
|
-
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void;
|
|
33
|
-
/** Removes all listeners from every event channel. */
|
|
34
|
-
removeAll(): void;
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region ../plugin-oas/src/types.d.ts
|
|
38
|
-
type GetOasOptions = {
|
|
39
|
-
validate?: boolean;
|
|
40
|
-
};
|
|
41
|
-
type Context$2 = {
|
|
42
|
-
getOas(options?: GetOasOptions): Promise<Oas>;
|
|
43
|
-
getBaseURL(): Promise<string | undefined>;
|
|
44
|
-
};
|
|
45
|
-
declare global {
|
|
46
|
-
namespace Kubb {
|
|
47
|
-
interface PluginContext extends Context$2 {}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* `propertyName` is the ref name + resolved with the nameResolver
|
|
52
|
-
* @example import { Pet } from './Pet'
|
|
53
|
-
*
|
|
54
|
-
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
55
|
-
*
|
|
56
|
-
* `pluginName` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
57
|
-
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
58
|
-
*/
|
|
59
|
-
type Ref = {
|
|
60
|
-
propertyName: string;
|
|
61
|
-
originalName: string;
|
|
62
|
-
path: KubbFile.Path;
|
|
63
|
-
pluginName?: string;
|
|
64
|
-
};
|
|
65
|
-
type Refs = Record<string, Ref>;
|
|
66
|
-
type OperationSchema = {
|
|
67
|
-
/**
|
|
68
|
-
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
69
|
-
*/
|
|
70
|
-
name: string;
|
|
71
|
-
schema: SchemaObject;
|
|
72
|
-
operation?: Operation;
|
|
73
|
-
/**
|
|
74
|
-
* OperationName in PascalCase, only being used in OperationGenerator
|
|
75
|
-
*/
|
|
76
|
-
operationName: string;
|
|
77
|
-
description?: string;
|
|
78
|
-
statusCode?: number;
|
|
79
|
-
keys?: string[];
|
|
80
|
-
keysToOmit?: string[];
|
|
81
|
-
withData?: boolean;
|
|
82
|
-
};
|
|
83
|
-
type OperationSchemas = {
|
|
84
|
-
pathParams?: OperationSchema & {
|
|
85
|
-
keysToOmit?: never;
|
|
86
|
-
};
|
|
87
|
-
queryParams?: OperationSchema & {
|
|
88
|
-
keysToOmit?: never;
|
|
89
|
-
};
|
|
90
|
-
headerParams?: OperationSchema & {
|
|
91
|
-
keysToOmit?: never;
|
|
92
|
-
};
|
|
93
|
-
request?: OperationSchema;
|
|
94
|
-
response: OperationSchema;
|
|
95
|
-
responses: Array<OperationSchema>;
|
|
96
|
-
statusCodes?: Array<OperationSchema>;
|
|
97
|
-
errors?: Array<OperationSchema>;
|
|
98
|
-
};
|
|
99
|
-
type ByTag = {
|
|
100
|
-
type: 'tag';
|
|
101
|
-
pattern: string | RegExp;
|
|
102
|
-
};
|
|
103
|
-
type ByOperationId = {
|
|
104
|
-
type: 'operationId';
|
|
105
|
-
pattern: string | RegExp;
|
|
106
|
-
};
|
|
107
|
-
type ByPath = {
|
|
108
|
-
type: 'path';
|
|
109
|
-
pattern: string | RegExp;
|
|
110
|
-
};
|
|
111
|
-
type ByMethod = {
|
|
112
|
-
type: 'method';
|
|
113
|
-
pattern: HttpMethod | RegExp;
|
|
114
|
-
};
|
|
115
|
-
type BySchemaName = {
|
|
116
|
-
type: 'schemaName';
|
|
117
|
-
pattern: string | RegExp;
|
|
118
|
-
};
|
|
119
|
-
type ByContentType = {
|
|
120
|
-
type: 'contentType';
|
|
121
|
-
pattern: string | RegExp;
|
|
122
|
-
};
|
|
123
|
-
type Exclude = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName;
|
|
124
|
-
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName;
|
|
125
|
-
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
126
|
-
options: Partial<TOptions>;
|
|
127
|
-
};
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
130
|
-
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
131
|
-
fabric: Fabric;
|
|
132
|
-
oas: Oas;
|
|
133
|
-
exclude: Array<Exclude> | undefined;
|
|
134
|
-
include: Array<Include> | undefined;
|
|
135
|
-
override: Array<Override<TOptions>> | undefined;
|
|
136
|
-
contentType: contentType | undefined;
|
|
137
|
-
driver: PluginDriver;
|
|
138
|
-
events?: AsyncEventEmitter<KubbEvents>;
|
|
139
|
-
/**
|
|
140
|
-
* Current plugin
|
|
141
|
-
*/
|
|
142
|
-
plugin: Plugin<TPluginOptions>;
|
|
143
|
-
mode: KubbFile.Mode;
|
|
144
|
-
UNSTABLE_NAMING?: true;
|
|
145
|
-
};
|
|
146
|
-
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
|
|
147
|
-
#private;
|
|
148
|
-
constructor(options: TPluginOptions['resolvedOptions'], context: Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>);
|
|
149
|
-
get options(): TPluginOptions['resolvedOptions'];
|
|
150
|
-
set options(options: TPluginOptions['resolvedOptions']);
|
|
151
|
-
get context(): Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>;
|
|
152
|
-
getOptions(operation: Operation, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
|
|
153
|
-
getSchemas(operation: Operation, {
|
|
154
|
-
resolveName
|
|
155
|
-
}?: {
|
|
156
|
-
resolveName?: (name: string) => string;
|
|
157
|
-
}): OperationSchemas;
|
|
158
|
-
getOperations(): Promise<Array<{
|
|
159
|
-
path: string;
|
|
160
|
-
method: HttpMethod;
|
|
161
|
-
operation: Operation;
|
|
162
|
-
}>>;
|
|
163
|
-
build(...generators: Array<Generator$1<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
167
|
-
type SchemaKeywordMapper = {
|
|
168
|
-
object: {
|
|
169
|
-
keyword: 'object';
|
|
170
|
-
args: {
|
|
171
|
-
properties: {
|
|
172
|
-
[x: string]: Schema[];
|
|
173
|
-
};
|
|
174
|
-
additionalProperties: Schema[];
|
|
175
|
-
patternProperties?: Record<string, Schema[]>;
|
|
176
|
-
strict?: boolean;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
url: {
|
|
180
|
-
keyword: 'url';
|
|
181
|
-
};
|
|
182
|
-
readOnly: {
|
|
183
|
-
keyword: 'readOnly';
|
|
184
|
-
};
|
|
185
|
-
writeOnly: {
|
|
186
|
-
keyword: 'writeOnly';
|
|
187
|
-
};
|
|
188
|
-
uuid: {
|
|
189
|
-
keyword: 'uuid';
|
|
190
|
-
};
|
|
191
|
-
email: {
|
|
192
|
-
keyword: 'email';
|
|
193
|
-
};
|
|
194
|
-
firstName: {
|
|
195
|
-
keyword: 'firstName';
|
|
196
|
-
};
|
|
197
|
-
lastName: {
|
|
198
|
-
keyword: 'lastName';
|
|
199
|
-
};
|
|
200
|
-
phone: {
|
|
201
|
-
keyword: 'phone';
|
|
202
|
-
};
|
|
203
|
-
password: {
|
|
204
|
-
keyword: 'password';
|
|
205
|
-
};
|
|
206
|
-
date: {
|
|
207
|
-
keyword: 'date';
|
|
208
|
-
args: {
|
|
209
|
-
type?: 'date' | 'string';
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
time: {
|
|
213
|
-
keyword: 'time';
|
|
214
|
-
args: {
|
|
215
|
-
type?: 'date' | 'string';
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
datetime: {
|
|
219
|
-
keyword: 'datetime';
|
|
220
|
-
args: {
|
|
221
|
-
offset?: boolean;
|
|
222
|
-
local?: boolean;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
tuple: {
|
|
226
|
-
keyword: 'tuple';
|
|
227
|
-
args: {
|
|
228
|
-
items: Schema[];
|
|
229
|
-
min?: number;
|
|
230
|
-
max?: number;
|
|
231
|
-
rest?: Schema;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
array: {
|
|
235
|
-
keyword: 'array';
|
|
236
|
-
args: {
|
|
237
|
-
items: Schema[];
|
|
238
|
-
min?: number;
|
|
239
|
-
max?: number;
|
|
240
|
-
unique?: boolean;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
enum: {
|
|
244
|
-
keyword: 'enum';
|
|
245
|
-
args: {
|
|
246
|
-
name: string;
|
|
247
|
-
typeName: string;
|
|
248
|
-
asConst: boolean;
|
|
249
|
-
items: Array<{
|
|
250
|
-
name: string | number;
|
|
251
|
-
format: 'string' | 'number' | 'boolean';
|
|
252
|
-
value?: string | number | boolean;
|
|
253
|
-
}>;
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
and: {
|
|
257
|
-
keyword: 'and';
|
|
258
|
-
args: Schema[];
|
|
259
|
-
};
|
|
260
|
-
const: {
|
|
261
|
-
keyword: 'const';
|
|
262
|
-
args: {
|
|
263
|
-
name: string | number;
|
|
264
|
-
format: 'string' | 'number' | 'boolean';
|
|
265
|
-
value?: string | number | boolean;
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
union: {
|
|
269
|
-
keyword: 'union';
|
|
270
|
-
args: Schema[];
|
|
271
|
-
};
|
|
272
|
-
ref: {
|
|
273
|
-
keyword: 'ref';
|
|
274
|
-
args: {
|
|
275
|
-
name: string;
|
|
276
|
-
$ref: string;
|
|
277
|
-
/**
|
|
278
|
-
* Full qualified path.
|
|
279
|
-
*/
|
|
280
|
-
path: KubbFile.Path;
|
|
281
|
-
/**
|
|
282
|
-
* When true `File.Import` is used.
|
|
283
|
-
* When false a reference is used inside the current file.
|
|
284
|
-
*/
|
|
285
|
-
isImportable: boolean;
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
matches: {
|
|
289
|
-
keyword: 'matches';
|
|
290
|
-
args?: string;
|
|
291
|
-
};
|
|
292
|
-
boolean: {
|
|
293
|
-
keyword: 'boolean';
|
|
294
|
-
};
|
|
295
|
-
default: {
|
|
296
|
-
keyword: 'default';
|
|
297
|
-
args: string | number | boolean;
|
|
298
|
-
};
|
|
299
|
-
string: {
|
|
300
|
-
keyword: 'string';
|
|
301
|
-
};
|
|
302
|
-
integer: {
|
|
303
|
-
keyword: 'integer';
|
|
304
|
-
};
|
|
305
|
-
bigint: {
|
|
306
|
-
keyword: 'bigint';
|
|
307
|
-
};
|
|
308
|
-
number: {
|
|
309
|
-
keyword: 'number';
|
|
310
|
-
};
|
|
311
|
-
max: {
|
|
312
|
-
keyword: 'max';
|
|
313
|
-
args: number;
|
|
314
|
-
};
|
|
315
|
-
min: {
|
|
316
|
-
keyword: 'min';
|
|
317
|
-
args: number;
|
|
318
|
-
};
|
|
319
|
-
exclusiveMaximum: {
|
|
320
|
-
keyword: 'exclusiveMaximum';
|
|
321
|
-
args: number;
|
|
322
|
-
};
|
|
323
|
-
exclusiveMinimum: {
|
|
324
|
-
keyword: 'exclusiveMinimum';
|
|
325
|
-
args: number;
|
|
326
|
-
};
|
|
327
|
-
describe: {
|
|
328
|
-
keyword: 'describe';
|
|
329
|
-
args: string;
|
|
330
|
-
};
|
|
331
|
-
example: {
|
|
332
|
-
keyword: 'example';
|
|
333
|
-
args: string;
|
|
334
|
-
};
|
|
335
|
-
deprecated: {
|
|
336
|
-
keyword: 'deprecated';
|
|
337
|
-
};
|
|
338
|
-
optional: {
|
|
339
|
-
keyword: 'optional';
|
|
340
|
-
};
|
|
341
|
-
undefined: {
|
|
342
|
-
keyword: 'undefined';
|
|
343
|
-
};
|
|
344
|
-
nullish: {
|
|
345
|
-
keyword: 'nullish';
|
|
346
|
-
};
|
|
347
|
-
nullable: {
|
|
348
|
-
keyword: 'nullable';
|
|
349
|
-
};
|
|
350
|
-
null: {
|
|
351
|
-
keyword: 'null';
|
|
352
|
-
};
|
|
353
|
-
any: {
|
|
354
|
-
keyword: 'any';
|
|
355
|
-
};
|
|
356
|
-
unknown: {
|
|
357
|
-
keyword: 'unknown';
|
|
358
|
-
};
|
|
359
|
-
void: {
|
|
360
|
-
keyword: 'void';
|
|
361
|
-
};
|
|
362
|
-
blob: {
|
|
363
|
-
keyword: 'blob';
|
|
364
|
-
};
|
|
365
|
-
schema: {
|
|
366
|
-
keyword: 'schema';
|
|
367
|
-
args: {
|
|
368
|
-
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
369
|
-
format?: string;
|
|
370
|
-
};
|
|
371
|
-
};
|
|
372
|
-
name: {
|
|
373
|
-
keyword: 'name';
|
|
374
|
-
args: string;
|
|
375
|
-
};
|
|
376
|
-
catchall: {
|
|
377
|
-
keyword: 'catchall';
|
|
378
|
-
};
|
|
379
|
-
interface: {
|
|
380
|
-
keyword: 'interface';
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
type Schema = {
|
|
384
|
-
keyword: string;
|
|
385
|
-
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
386
|
-
//#endregion
|
|
387
|
-
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
388
|
-
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
389
|
-
fabric: Fabric;
|
|
390
|
-
oas: Oas;
|
|
391
|
-
driver: PluginDriver;
|
|
392
|
-
events?: AsyncEventEmitter<KubbEvents>;
|
|
393
|
-
/**
|
|
394
|
-
* Current plugin
|
|
395
|
-
*/
|
|
396
|
-
plugin: Plugin<TPluginOptions>;
|
|
397
|
-
mode: KubbFile.Mode;
|
|
398
|
-
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
399
|
-
override: Array<Override<TOptions>> | undefined;
|
|
400
|
-
contentType?: contentType;
|
|
401
|
-
output?: string;
|
|
402
|
-
};
|
|
403
|
-
type SchemaGeneratorOptions = {
|
|
404
|
-
dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
|
|
405
|
-
integerType?: 'number' | 'bigint';
|
|
406
|
-
unknownType: 'any' | 'unknown' | 'void';
|
|
407
|
-
emptySchemaType: 'any' | 'unknown' | 'void';
|
|
408
|
-
enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
|
|
409
|
-
enumSuffix?: string;
|
|
410
|
-
/**
|
|
411
|
-
* @deprecated Will be removed in v5. Use `collisionDetection: true` instead to prevent enum name collisions.
|
|
412
|
-
* When `collisionDetection` is enabled, the rootName-based approach eliminates the need for numeric suffixes.
|
|
413
|
-
* @internal
|
|
414
|
-
*/
|
|
415
|
-
usedEnumNames?: Record<string, number>;
|
|
416
|
-
mapper?: Record<string, string>;
|
|
417
|
-
typed?: boolean;
|
|
418
|
-
transformers: {
|
|
419
|
-
/**
|
|
420
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
421
|
-
*/
|
|
422
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
423
|
-
/**
|
|
424
|
-
* Receive schema and name(propertyName) and return Schema array.
|
|
425
|
-
* Return `undefined` to fall through to default schema generation.
|
|
426
|
-
* @beta
|
|
427
|
-
*/
|
|
428
|
-
schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
|
|
429
|
-
};
|
|
430
|
-
};
|
|
431
|
-
type SchemaProps$1 = {
|
|
432
|
-
schema: SchemaObject | null;
|
|
433
|
-
name: string | null;
|
|
434
|
-
parentName: string | null;
|
|
435
|
-
rootName?: string | null;
|
|
436
|
-
};
|
|
437
|
-
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
|
|
438
|
-
#private;
|
|
439
|
-
constructor(options: TOptions, context: Context<TOptions, TPluginOptions>);
|
|
440
|
-
get options(): TOptions;
|
|
441
|
-
set options(options: TOptions);
|
|
442
|
-
get context(): Context<TOptions, TPluginOptions>;
|
|
443
|
-
refs: Refs;
|
|
444
|
-
/**
|
|
445
|
-
* Creates a type node from a given schema.
|
|
446
|
-
* Delegates to getBaseTypeFromSchema internally and
|
|
447
|
-
* optionally adds a union with null.
|
|
448
|
-
*/
|
|
449
|
-
parse(props: SchemaProps$1): Schema[];
|
|
450
|
-
static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
|
|
451
|
-
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
452
|
-
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
453
|
-
build(...generators: Array<Generator$1<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
454
|
-
}
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
457
|
-
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
458
|
-
name: string;
|
|
459
|
-
type: 'core';
|
|
460
|
-
version: '1';
|
|
461
|
-
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
462
|
-
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
463
|
-
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
464
|
-
};
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region ../plugin-oas/src/generators/types.d.ts
|
|
467
|
-
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
468
|
-
config: Config;
|
|
469
|
-
generator: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
470
|
-
plugin: Plugin<TOptions>;
|
|
471
|
-
operations: Array<Operation>;
|
|
472
|
-
};
|
|
473
|
-
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
474
|
-
config: Config;
|
|
475
|
-
generator: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
476
|
-
plugin: Plugin<TOptions>;
|
|
477
|
-
operation: Operation;
|
|
478
|
-
};
|
|
479
|
-
type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
480
|
-
config: Config;
|
|
481
|
-
generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
482
|
-
plugin: Plugin<TOptions>;
|
|
483
|
-
schema: {
|
|
484
|
-
name: string;
|
|
485
|
-
tree: Array<Schema>;
|
|
486
|
-
value: SchemaObject;
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
type Generator$1<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions> | Generator<TOptions>;
|
|
490
|
-
//#endregion
|
|
491
|
-
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
492
|
-
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
493
|
-
name: string;
|
|
494
|
-
type: 'react';
|
|
495
|
-
version: '1';
|
|
496
|
-
Operations: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
497
|
-
Operation: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
498
|
-
Schema: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
499
|
-
};
|
|
500
|
-
//#endregion
|
|
501
|
-
//#region src/generators/mcpGenerator.d.ts
|
|
502
|
-
declare const mcpGenerator: ReactGenerator<PluginMcp>;
|
|
503
|
-
//#endregion
|
|
504
|
-
//#region src/generators/serverGenerator.d.ts
|
|
505
|
-
declare const serverGenerator: ReactGenerator<PluginMcp>;
|
|
506
|
-
//#endregion
|
|
507
|
-
export { mcpGenerator, serverGenerator };
|
|
508
|
-
//# sourceMappingURL=generators.d.ts.map
|
package/dist/generators.js
DELETED
package/dist/types-DXZDZ3vf.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
|
|
3
|
-
import { ClientImportPath, PluginClient } from "@kubb/plugin-client";
|
|
4
|
-
import { Exclude, Include, Override, ResolvePathOptions } from "@kubb/plugin-oas";
|
|
5
|
-
import { Generator as Generator$1 } from "@kubb/plugin-oas/generators";
|
|
6
|
-
import { Oas, contentType } from "@kubb/oas";
|
|
7
|
-
|
|
8
|
-
//#region src/types.d.ts
|
|
9
|
-
type Options = {
|
|
10
|
-
/**
|
|
11
|
-
* Specify the export location for the files and define the behavior of the output
|
|
12
|
-
* @default { path: 'mcp', barrelType: 'named' }
|
|
13
|
-
*/
|
|
14
|
-
output?: Output<Oas>;
|
|
15
|
-
/**
|
|
16
|
-
* Define which contentType should be used.
|
|
17
|
-
* By default, the first JSON valid mediaType is used
|
|
18
|
-
*/
|
|
19
|
-
contentType?: contentType;
|
|
20
|
-
client?: ClientImportPath & Pick<PluginClient['options'], 'clientType' | 'dataReturnType' | 'baseURL' | 'bundle' | 'paramsCasing'>;
|
|
21
|
-
/**
|
|
22
|
-
* Transform parameter names to a specific casing format.
|
|
23
|
-
* When set to 'camelcase', parameter names in path, query, and header params will be transformed to camelCase.
|
|
24
|
-
* This should match the paramsCasing setting used in @kubb/plugin-ts.
|
|
25
|
-
* @default undefined
|
|
26
|
-
*/
|
|
27
|
-
paramsCasing?: 'camelcase';
|
|
28
|
-
/**
|
|
29
|
-
* Group the mcp requests based on the provided name.
|
|
30
|
-
*/
|
|
31
|
-
group?: Group;
|
|
32
|
-
/**
|
|
33
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
34
|
-
*/
|
|
35
|
-
exclude?: Array<Exclude>;
|
|
36
|
-
/**
|
|
37
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
38
|
-
*/
|
|
39
|
-
include?: Array<Include>;
|
|
40
|
-
/**
|
|
41
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
42
|
-
*/
|
|
43
|
-
override?: Array<Override<ResolvedOptions>>;
|
|
44
|
-
transformers?: {
|
|
45
|
-
/**
|
|
46
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
47
|
-
*/
|
|
48
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Define some generators next to the Mcp generators.
|
|
52
|
-
*/
|
|
53
|
-
generators?: Array<Generator$1<PluginMcp>>;
|
|
54
|
-
};
|
|
55
|
-
type ResolvedOptions = {
|
|
56
|
-
output: Output<Oas>;
|
|
57
|
-
group: Options['group'];
|
|
58
|
-
client: Pick<PluginClient['options'], 'client' | 'clientType' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle' | 'paramsCasing'>;
|
|
59
|
-
paramsCasing: Options['paramsCasing'];
|
|
60
|
-
};
|
|
61
|
-
type PluginMcp = PluginFactoryOptions<'plugin-mcp', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { PluginMcp as n, Options as t };
|
|
64
|
-
//# sourceMappingURL=types-DXZDZ3vf.d.ts.map
|
package/src/components/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Server } from './Server.tsx'
|
package/src/generators/index.ts
DELETED