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