@kubb/plugin-faker 4.21.2 → 4.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{components-CDKWc3Yj.js → components-CiUIlcV3.js} +4 -3
  2. package/dist/components-CiUIlcV3.js.map +1 -0
  3. package/dist/{components-CQqf9rBj.cjs → components-D44-YPpj.cjs} +4 -3
  4. package/dist/components-D44-YPpj.cjs.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.d.cts +2 -1
  7. package/dist/components.d.ts +2 -1
  8. package/dist/components.js +1 -1
  9. package/dist/{fakerGenerator-VqIrrE7d.js → fakerGenerator-BWH5M054.js} +4 -4
  10. package/dist/fakerGenerator-BWH5M054.js.map +1 -0
  11. package/dist/{fakerGenerator-BC_ilj8m.cjs → fakerGenerator-DipEvGPU.cjs} +4 -4
  12. package/dist/fakerGenerator-DipEvGPU.cjs.map +1 -0
  13. package/dist/generators.cjs +1 -1
  14. package/dist/generators.d.cts +457 -1
  15. package/dist/generators.d.ts +457 -1
  16. package/dist/generators.js +1 -1
  17. package/dist/index.cjs +2 -2
  18. package/dist/index.d.cts +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/types-DPGJaaLM.d.cts +124 -0
  22. package/dist/types-wnjXCmBP.d.ts +123 -0
  23. package/package.json +5 -5
  24. package/src/generators/__snapshots__/createPet.ts +2 -2
  25. package/src/generators/__snapshots__/createPetSeed.ts +2 -2
  26. package/src/generators/__snapshots__/createPetUnknownTypeAny.ts +2 -2
  27. package/src/generators/__snapshots__/getPets.ts +2 -2
  28. package/src/generators/__snapshots__/showPetById.ts +4 -4
  29. package/src/generators/__snapshots__/updatePet.ts +34 -0
  30. package/src/generators/fakerGenerator.tsx +3 -1
  31. package/src/parser.ts +6 -2
  32. package/dist/components-CDKWc3Yj.js.map +0 -1
  33. package/dist/components-CQqf9rBj.cjs.map +0 -1
  34. package/dist/fakerGenerator-BC_ilj8m.cjs.map +0 -1
  35. package/dist/fakerGenerator-VqIrrE7d.js.map +0 -1
  36. package/dist/types-CB26F0zP.d.cts +0 -664
  37. package/dist/types-D8QPkAha.d.ts +0 -663
@@ -1,664 +0,0 @@
1
- import { BaseGenerator, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
2
- import { KubbFile } from "@kubb/fabric-core/types";
3
- import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
4
- import BaseOas from "oas";
5
- import { Operation } from "oas/operation";
6
- import { DiscriminatorObject, HttpMethods, OASDocument, SchemaObject } from "oas/types";
7
- import { Fabric } from "@kubb/react-fabric";
8
- import { FabricReactNode } from "@kubb/react-fabric/types";
9
-
10
- //#region rolldown:runtime
11
- //#endregion
12
- //#region ../oas/src/types.d.ts
13
- type contentType = 'application/json' | (string & {});
14
- type SchemaObject$1 = SchemaObject & {
15
- 'x-nullable'?: boolean;
16
- $ref?: string;
17
- };
18
- type HttpMethod = HttpMethods;
19
- type Document = OASDocument;
20
- type Operation$1 = Operation;
21
- type DiscriminatorObject$1 = DiscriminatorObject;
22
- //#endregion
23
- //#region ../oas/src/Oas.d.ts
24
- type OasOptions = {
25
- contentType?: contentType;
26
- discriminator?: 'strict' | 'inherit';
27
- /**
28
- * Resolve name collisions when schemas from different components share the same name (case-insensitive).
29
- * @default false
30
- */
31
- collisionDetection?: boolean;
32
- };
33
- declare class Oas extends BaseOas {
34
- #private;
35
- document: Document;
36
- constructor(document: Document);
37
- setOptions(options: OasOptions): void;
38
- get options(): OasOptions;
39
- get<T = unknown>($ref: string): T | null;
40
- getKey($ref: string): string | undefined;
41
- set($ref: string, value: unknown): false | undefined;
42
- getDiscriminator(schema: SchemaObject$1 | null): DiscriminatorObject$1 | null;
43
- dereferenceWithRef<T = unknown>(schema?: T): T;
44
- getResponseSchema(operation: Operation$1, statusCode: string | number): SchemaObject$1;
45
- getRequestSchema(operation: Operation$1): SchemaObject$1 | undefined;
46
- getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
47
- validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
48
- flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
49
- /**
50
- * Get schemas from OpenAPI components (schemas, responses, requestBodies).
51
- * Returns schemas in dependency order along with name mapping for collision resolution.
52
- */
53
- getSchemas(options?: {
54
- contentType?: contentType;
55
- includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
56
- collisionDetection?: boolean;
57
- }): {
58
- schemas: Record<string, SchemaObject$1>;
59
- nameMapping: Map<string, string>;
60
- };
61
- }
62
- //#endregion
63
- //#region ../core/src/utils/AsyncEventEmitter.d.ts
64
- declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
65
- #private;
66
- constructor(maxListener?: number);
67
- emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void>;
68
- on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
69
- onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArgs: TEvents[TEventName]) => void): void;
70
- off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
71
- removeAll(): void;
72
- }
73
- //#endregion
74
- //#region ../core/src/types.d.ts
75
- declare global {
76
- namespace Kubb {
77
- interface PluginContext {}
78
- }
79
- }
80
- /**
81
- * Config used in `kubb.config.ts`
82
- *
83
- * @example
84
- * import { defineConfig } from '@kubb/core'
85
- * export default defineConfig({
86
- * ...
87
- * })
88
- */
89
- //#endregion
90
- //#region ../plugin-oas/src/types.d.ts
91
- type GetOasOptions = {
92
- validate?: boolean;
93
- };
94
- type Context$2 = {
95
- getOas(options?: GetOasOptions): Promise<Oas>;
96
- getBaseURL(): Promise<string | undefined>;
97
- };
98
- declare global {
99
- namespace Kubb {
100
- interface PluginContext extends Context$2 {}
101
- }
102
- }
103
- type ResolvePathOptions = {
104
- pluginKey?: Plugin['key'];
105
- group?: {
106
- tag?: string;
107
- path?: string;
108
- };
109
- type?: ResolveNameParams['type'];
110
- };
111
- /**
112
- * `propertyName` is the ref name + resolved with the nameResolver
113
- * @example import { Pet } from './Pet'
114
- *
115
- * `originalName` is the original name used(in PascalCase), only used to remove duplicates
116
- *
117
- * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
118
- * @example import a type(plugin-ts) for a mock file(swagger-faker)
119
- */
120
- type Ref = {
121
- propertyName: string;
122
- originalName: string;
123
- path: KubbFile.Path;
124
- pluginKey?: Plugin['key'];
125
- };
126
- type Refs = Record<string, Ref>;
127
- type OperationSchema = {
128
- /**
129
- * Converted name, contains already `PathParams`, `QueryParams`, ...
130
- */
131
- name: string;
132
- schema: SchemaObject$1;
133
- operation?: Operation$1;
134
- /**
135
- * OperationName in PascalCase, only being used in OperationGenerator
136
- */
137
- operationName: string;
138
- description?: string;
139
- statusCode?: number;
140
- keys?: string[];
141
- keysToOmit?: string[];
142
- withData?: boolean;
143
- };
144
- type OperationSchemas = {
145
- pathParams?: OperationSchema & {
146
- keysToOmit?: never;
147
- };
148
- queryParams?: OperationSchema & {
149
- keysToOmit?: never;
150
- };
151
- headerParams?: OperationSchema & {
152
- keysToOmit?: never;
153
- };
154
- request?: OperationSchema;
155
- response: OperationSchema;
156
- responses: Array<OperationSchema>;
157
- statusCodes?: Array<OperationSchema>;
158
- errors?: Array<OperationSchema>;
159
- };
160
- type ByTag = {
161
- type: 'tag';
162
- pattern: string | RegExp;
163
- };
164
- type ByOperationId = {
165
- type: 'operationId';
166
- pattern: string | RegExp;
167
- };
168
- type ByPath = {
169
- type: 'path';
170
- pattern: string | RegExp;
171
- };
172
- type ByMethod = {
173
- type: 'method';
174
- pattern: HttpMethod | RegExp;
175
- };
176
- type BySchemaName = {
177
- type: 'schemaName';
178
- pattern: string | RegExp;
179
- };
180
- type ByContentType = {
181
- type: 'contentType';
182
- pattern: string | RegExp;
183
- };
184
- type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
185
- type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
186
- type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
187
- options: Partial<TOptions>;
188
- };
189
- //#endregion
190
- //#region ../plugin-oas/src/OperationGenerator.d.ts
191
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
192
- fabric: Fabric;
193
- oas: Oas;
194
- exclude: Array<Exclude$1> | undefined;
195
- include: Array<Include> | undefined;
196
- override: Array<Override<TOptions>> | undefined;
197
- contentType: contentType | undefined;
198
- pluginManager: PluginManager;
199
- events?: AsyncEventEmitter<KubbEvents>;
200
- /**
201
- * Current plugin
202
- */
203
- plugin: Plugin<TPluginOptions>;
204
- mode: KubbFile.Mode;
205
- UNSTABLE_NAMING?: true;
206
- };
207
- declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
208
- #private;
209
- getOptions(operation: Operation$1, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
210
- getSchemas(operation: Operation$1, {
211
- resolveName
212
- }?: {
213
- resolveName?: (name: string) => string;
214
- }): OperationSchemas;
215
- getOperations(): Promise<Array<{
216
- path: string;
217
- method: HttpMethod;
218
- operation: Operation$1;
219
- }>>;
220
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
221
- }
222
- //#endregion
223
- //#region ../plugin-oas/src/SchemaMapper.d.ts
224
- type SchemaKeywordMapper = {
225
- object: {
226
- keyword: 'object';
227
- args: {
228
- properties: {
229
- [x: string]: Schema[];
230
- };
231
- additionalProperties: Schema[];
232
- patternProperties?: Record<string, Schema[]>;
233
- strict?: boolean;
234
- };
235
- };
236
- url: {
237
- keyword: 'url';
238
- };
239
- readOnly: {
240
- keyword: 'readOnly';
241
- };
242
- writeOnly: {
243
- keyword: 'writeOnly';
244
- };
245
- uuid: {
246
- keyword: 'uuid';
247
- };
248
- email: {
249
- keyword: 'email';
250
- };
251
- firstName: {
252
- keyword: 'firstName';
253
- };
254
- lastName: {
255
- keyword: 'lastName';
256
- };
257
- phone: {
258
- keyword: 'phone';
259
- };
260
- password: {
261
- keyword: 'password';
262
- };
263
- date: {
264
- keyword: 'date';
265
- args: {
266
- type?: 'date' | 'string';
267
- };
268
- };
269
- time: {
270
- keyword: 'time';
271
- args: {
272
- type?: 'date' | 'string';
273
- };
274
- };
275
- datetime: {
276
- keyword: 'datetime';
277
- args: {
278
- offset?: boolean;
279
- local?: boolean;
280
- };
281
- };
282
- tuple: {
283
- keyword: 'tuple';
284
- args: {
285
- items: Schema[];
286
- min?: number;
287
- max?: number;
288
- rest?: Schema;
289
- };
290
- };
291
- array: {
292
- keyword: 'array';
293
- args: {
294
- items: Schema[];
295
- min?: number;
296
- max?: number;
297
- unique?: boolean;
298
- };
299
- };
300
- enum: {
301
- keyword: 'enum';
302
- args: {
303
- name: string;
304
- typeName: string;
305
- asConst: boolean;
306
- items: Array<{
307
- name: string | number;
308
- format: 'string' | 'number' | 'boolean';
309
- value?: string | number | boolean;
310
- }>;
311
- };
312
- };
313
- and: {
314
- keyword: 'and';
315
- args: Schema[];
316
- };
317
- const: {
318
- keyword: 'const';
319
- args: {
320
- name: string | number;
321
- format: 'string' | 'number' | 'boolean';
322
- value?: string | number | boolean;
323
- };
324
- };
325
- union: {
326
- keyword: 'union';
327
- args: Schema[];
328
- };
329
- ref: {
330
- keyword: 'ref';
331
- args: {
332
- name: string;
333
- $ref: string;
334
- /**
335
- * Full qualified path.
336
- */
337
- path: KubbFile.Path;
338
- /**
339
- * When true `File.Import` is used.
340
- * When false a reference is used inside the current file.
341
- */
342
- isImportable: boolean;
343
- };
344
- };
345
- matches: {
346
- keyword: 'matches';
347
- args?: string;
348
- };
349
- boolean: {
350
- keyword: 'boolean';
351
- };
352
- default: {
353
- keyword: 'default';
354
- args: string | number | boolean;
355
- };
356
- string: {
357
- keyword: 'string';
358
- };
359
- integer: {
360
- keyword: 'integer';
361
- };
362
- number: {
363
- keyword: 'number';
364
- };
365
- max: {
366
- keyword: 'max';
367
- args: number;
368
- };
369
- min: {
370
- keyword: 'min';
371
- args: number;
372
- };
373
- exclusiveMaximum: {
374
- keyword: 'exclusiveMaximum';
375
- args: number;
376
- };
377
- exclusiveMinimum: {
378
- keyword: 'exclusiveMinimum';
379
- args: number;
380
- };
381
- describe: {
382
- keyword: 'describe';
383
- args: string;
384
- };
385
- example: {
386
- keyword: 'example';
387
- args: string;
388
- };
389
- deprecated: {
390
- keyword: 'deprecated';
391
- };
392
- optional: {
393
- keyword: 'optional';
394
- };
395
- undefined: {
396
- keyword: 'undefined';
397
- };
398
- nullish: {
399
- keyword: 'nullish';
400
- };
401
- nullable: {
402
- keyword: 'nullable';
403
- };
404
- null: {
405
- keyword: 'null';
406
- };
407
- any: {
408
- keyword: 'any';
409
- };
410
- unknown: {
411
- keyword: 'unknown';
412
- };
413
- void: {
414
- keyword: 'void';
415
- };
416
- blob: {
417
- keyword: 'blob';
418
- };
419
- schema: {
420
- keyword: 'schema';
421
- args: {
422
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
423
- format?: string;
424
- };
425
- };
426
- name: {
427
- keyword: 'name';
428
- args: string;
429
- };
430
- catchall: {
431
- keyword: 'catchall';
432
- };
433
- interface: {
434
- keyword: 'interface';
435
- };
436
- };
437
- type Schema = {
438
- keyword: string;
439
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
440
- //#endregion
441
- //#region ../plugin-oas/src/SchemaGenerator.d.ts
442
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
443
- fabric: Fabric;
444
- oas: Oas;
445
- pluginManager: PluginManager;
446
- events?: AsyncEventEmitter<KubbEvents>;
447
- /**
448
- * Current plugin
449
- */
450
- plugin: Plugin<TPluginOptions>;
451
- mode: KubbFile.Mode;
452
- include?: Array<'schemas' | 'responses' | 'requestBodies'>;
453
- override: Array<Override<TOptions>> | undefined;
454
- contentType?: contentType;
455
- output?: string;
456
- };
457
- type SchemaGeneratorOptions = {
458
- dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
459
- unknownType: 'any' | 'unknown' | 'void';
460
- emptySchemaType: 'any' | 'unknown' | 'void';
461
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
462
- enumSuffix?: string;
463
- /**
464
- * @deprecated Will be removed in v5. Use `collisionDetection: true` instead to prevent enum name collisions.
465
- * When `collisionDetection` is enabled, the rootName-based approach eliminates the need for numeric suffixes.
466
- * @internal
467
- */
468
- usedEnumNames?: Record<string, number>;
469
- mapper?: Record<string, string>;
470
- typed?: boolean;
471
- transformers: {
472
- /**
473
- * Customize the names based on the type that is provided by the plugin.
474
- */
475
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
476
- /**
477
- * Receive schema and name(propertyName) and return FakerMeta array
478
- * TODO TODO add docs
479
- * @beta
480
- */
481
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
482
- };
483
- };
484
- type SchemaProps$1 = {
485
- schema: SchemaObject$1 | null;
486
- name: string | null;
487
- parentName: string | null;
488
- rootName?: string | null;
489
- };
490
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
491
- #private;
492
- refs: Refs;
493
- /**
494
- * Creates a type node from a given schema.
495
- * Delegates to getBaseTypeFromSchema internally and
496
- * optionally adds a union with null.
497
- */
498
- parse(props: SchemaProps$1): Schema[];
499
- static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
500
- static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
501
- static combineObjects(tree: Schema[] | undefined): Schema[];
502
- build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
503
- }
504
- //#endregion
505
- //#region ../plugin-oas/src/generators/createReactGenerator.d.ts
506
- type ReactGenerator<TOptions extends PluginFactoryOptions> = {
507
- name: string;
508
- type: 'react';
509
- Operations: (props: OperationsProps<TOptions>) => FabricReactNode;
510
- Operation: (props: OperationProps<TOptions>) => FabricReactNode;
511
- Schema: (props: SchemaProps<TOptions>) => FabricReactNode;
512
- };
513
- //#endregion
514
- //#region ../plugin-oas/src/generators/types.d.ts
515
- type OperationsProps<TOptions extends PluginFactoryOptions> = {
516
- config: Config;
517
- generator: Omit<OperationGenerator<TOptions>, 'build'>;
518
- plugin: Plugin<TOptions>;
519
- operations: Array<Operation$1>;
520
- };
521
- type OperationProps<TOptions extends PluginFactoryOptions> = {
522
- config: Config;
523
- generator: Omit<OperationGenerator<TOptions>, 'build'>;
524
- plugin: Plugin<TOptions>;
525
- operation: Operation$1;
526
- };
527
- type SchemaProps<TOptions extends PluginFactoryOptions> = {
528
- config: Config;
529
- generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
530
- plugin: Plugin<TOptions>;
531
- schema: {
532
- name: string;
533
- tree: Array<Schema>;
534
- value: SchemaObject$1;
535
- };
536
- };
537
- type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
538
- //#endregion
539
- //#region ../plugin-oas/src/generators/createGenerator.d.ts
540
- type CoreGenerator<TOptions extends PluginFactoryOptions> = {
541
- name: string;
542
- type: 'core';
543
- operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
544
- operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
545
- schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
546
- };
547
- //#endregion
548
- //#region src/types.d.ts
549
- type Options = {
550
- /**
551
- * Specify the export location for the files and define the behavior of the output
552
- * @default { path: 'handlers', barrelType: 'named' }
553
- */
554
- output?: Output<Oas>;
555
- /**
556
- * Define which contentType should be used.
557
- * By default, the first JSON valid mediaType is used
558
- */
559
- contentType?: contentType;
560
- /**
561
- * Group the Faker mocks based on the provided name.
562
- */
563
- group?: Group;
564
- /**
565
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
566
- */
567
- exclude?: Array<Exclude$1>;
568
- /**
569
- * Array containing include parameters to include tags/operations/methods/paths.
570
- */
571
- include?: Array<Include>;
572
- /**
573
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
574
- */
575
- override?: Array<Override<ResolvedOptions>>;
576
- /**
577
- * Choose to use date or datetime as JavaScript Date instead of string.
578
- * - 'string' represents dates as string values.
579
- * - 'date' represents dates as JavaScript Date objects.
580
- * @default 'string'
581
- */
582
- dateType?: 'string' | 'date';
583
- /**
584
- * Which parser should be used when dateType is set to string.
585
- * - 'faker' uses faker's built-in date formatting methods.
586
- * - 'dayjs' uses dayjs for date formatting with custom patterns.
587
- * - 'moment' uses moment for date formatting with custom patterns.
588
- * @default 'faker'
589
- */
590
- dateParser?: 'faker' | 'dayjs' | 'moment' | (string & {});
591
- /**
592
- * Which type to use when the Swagger/OpenAPI file is not providing more information.
593
- * - 'any' allows any value.
594
- * - 'unknown' requires type narrowing before use.
595
- * - 'void' represents no value.
596
- * @default 'any'
597
- */
598
- unknownType?: 'any' | 'unknown' | 'void';
599
- /**
600
- * Which type to use for empty schema values.
601
- * - 'any' allows any value.
602
- * - 'unknown' requires type narrowing before use.
603
- * - 'void' represents no value.
604
- * @default `unknownType`
605
- */
606
- emptySchemaType?: 'any' | 'unknown' | 'void';
607
- /**
608
- * Choose which generator to use when using Regexp.
609
- * - 'faker' uses faker.helpers.fromRegExp for generating values from regex patterns.
610
- * - 'randexp' uses RandExp library for generating values from regex patterns.
611
- * @default 'faker'
612
- */
613
- regexGenerator?: 'faker' | 'randexp';
614
- mapper?: Record<string, string>;
615
- /**
616
- * The use of Seed is intended to allow for consistent values in a test.
617
- */
618
- seed?: number | number[];
619
- /**
620
- * Transform parameter names to a specific casing format.
621
- * When set to 'camelcase', parameter names in path, query, and header params will be transformed to camelCase.
622
- * This should match the paramsCasing setting used in @kubb/plugin-ts.
623
- * @default undefined
624
- */
625
- paramsCasing?: 'camelcase';
626
- transformers?: {
627
- /**
628
- * Customize the names based on the type that is provided by the plugin.
629
- */
630
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
631
- /**
632
- * Receive schema and baseName(propertyName) and return FakerMeta array
633
- * TODO TODO add docs
634
- * @beta
635
- */
636
- schema?: (props: {
637
- schema: SchemaObject$1 | null;
638
- name: string | null;
639
- parentName: string | null;
640
- }, defaultSchemas: Schema[]) => Schema[] | undefined;
641
- };
642
- /**
643
- * Define some generators next to the faker generators
644
- */
645
- generators?: Array<Generator<PluginFaker>>;
646
- };
647
- type ResolvedOptions = {
648
- output: Output<Oas>;
649
- group: Options['group'];
650
- override: NonNullable<Options['override']>;
651
- dateType: NonNullable<Options['dateType']>;
652
- dateParser: NonNullable<Options['dateParser']>;
653
- unknownType: NonNullable<Options['unknownType']>;
654
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
655
- transformers: NonNullable<Options['transformers']>;
656
- seed: NonNullable<Options['seed']> | undefined;
657
- mapper: NonNullable<Options['mapper']>;
658
- regexGenerator: NonNullable<Options['regexGenerator']>;
659
- paramsCasing: Options['paramsCasing'];
660
- };
661
- type PluginFaker = PluginFactoryOptions<'plugin-faker', Options, ResolvedOptions, never, ResolvePathOptions>;
662
- //#endregion
663
- export { __name as a, Schema as i, PluginFaker as n, ReactGenerator as r, Options as t };
664
- //# sourceMappingURL=types-CB26F0zP.d.cts.map