@kubb/plugin-faker 0.0.0-canary-20250724082832 → 0.0.0-canary-20250816141041

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 (39) hide show
  1. package/dist/components-BPhQ4XSw.cjs +323 -0
  2. package/dist/components-BPhQ4XSw.cjs.map +1 -0
  3. package/dist/components-iqgTT-Ux.js +289 -0
  4. package/dist/components-iqgTT-Ux.js.map +1 -0
  5. package/dist/components.cjs +2 -11
  6. package/dist/components.d.cts +24 -15
  7. package/dist/components.d.ts +24 -15
  8. package/dist/components.js +3 -3
  9. package/dist/fakerGenerator-CF5BYfUw.cjs +204 -0
  10. package/dist/fakerGenerator-CF5BYfUw.cjs.map +1 -0
  11. package/dist/fakerGenerator-Cz3dcC9B.js +199 -0
  12. package/dist/fakerGenerator-Cz3dcC9B.js.map +1 -0
  13. package/dist/generators.cjs +3 -12
  14. package/dist/generators.d.cts +5 -6
  15. package/dist/generators.d.ts +5 -6
  16. package/dist/generators.js +4 -4
  17. package/dist/index.cjs +96 -124
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6 -7
  20. package/dist/index.d.ts +6 -7
  21. package/dist/index.js +96 -118
  22. package/dist/index.js.map +1 -1
  23. package/dist/types-Bh_6SttY.d.cts +1214 -0
  24. package/dist/types-DYUKPbgH.d.ts +1214 -0
  25. package/package.json +24 -29
  26. package/dist/chunk-BQQKSGJ4.js +0 -370
  27. package/dist/chunk-BQQKSGJ4.js.map +0 -1
  28. package/dist/chunk-DP3UK3GA.js +0 -137
  29. package/dist/chunk-DP3UK3GA.js.map +0 -1
  30. package/dist/chunk-DUV3ZLQX.cjs +0 -139
  31. package/dist/chunk-DUV3ZLQX.cjs.map +0 -1
  32. package/dist/chunk-ZA3QHI3O.cjs +0 -376
  33. package/dist/chunk-ZA3QHI3O.cjs.map +0 -1
  34. package/dist/components.cjs.map +0 -1
  35. package/dist/components.js.map +0 -1
  36. package/dist/generators.cjs.map +0 -1
  37. package/dist/generators.js.map +0 -1
  38. package/dist/types-kyHdJ8oH.d.cts +0 -107
  39. package/dist/types-kyHdJ8oH.d.ts +0 -107
@@ -1,107 +0,0 @@
1
- import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
2
- import { Oas, contentType, SchemaObject } from '@kubb/oas';
3
- import { Exclude, Include, Override, Schema, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
4
-
5
- type Options = {
6
- /**
7
- * Specify the export location for the files and define the behavior of the output
8
- * @default { path: 'handlers', barrelType: 'named' }
9
- */
10
- output?: Output<Oas>;
11
- /**
12
- * Define which contentType should be used.
13
- * By default, the first JSON valid mediaType will be used
14
- */
15
- contentType?: contentType;
16
- /**
17
- * Group the Faker mocks based on the provided name.
18
- */
19
- group?: Group;
20
- /**
21
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
22
- */
23
- exclude?: Array<Exclude>;
24
- /**
25
- * Array containing include parameters to include tags/operations/methods/paths.
26
- */
27
- include?: Array<Include>;
28
- /**
29
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
30
- */
31
- override?: Array<Override<ResolvedOptions>>;
32
- /**
33
- * Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`.
34
- * @default 'string'
35
- */
36
- dateType?: 'string' | 'date';
37
- /**
38
- * Which parser should be used when dateType is set to 'string'.
39
- * - Schema with format 'date' will use ISO date format (YYYY-MM-DD)
40
- * - `'dayjs'` will use `dayjs(faker.date.anytime()).format("YYYY-MM-DD")`.
41
- * - `undefined` will use `faker.date.anytime().toString()`
42
- * - Schema with format 'time' will use ISO time format (HH:mm:ss[.SSSSSS])
43
- * - `'dayjs'` will use `dayjs(faker.date.anytime()).format("HH:mm:ss")`.
44
- * - `undefined` will use `faker.date.anytime().toString()`
45
- * * @default 'faker'
46
- */
47
- dateParser?: 'faker' | 'dayjs' | 'moment' | (string & {});
48
- /**
49
- * Which type to use when the Swagger/OpenAPI file is not providing more information
50
- * @default 'any'
51
- */
52
- unknownType?: 'any' | 'unknown' | 'void';
53
- /**
54
- * Which type to use for empty schema values
55
- * @default `unknownType`
56
- */
57
- emptySchemaType?: 'any' | 'unknown' | 'void';
58
- /**
59
- * Choose which generator to use when using Regexp.
60
- *
61
- * `'faker'` will use `faker.helpers.fromRegExp(new RegExp(/test/))`
62
- * `'randexp'` will use `new RandExp(/test/).gen()`
63
- * @default 'faker'
64
- */
65
- regexGenerator?: 'faker' | 'randexp';
66
- mapper?: Record<string, string>;
67
- /**
68
- * The use of Seed is intended to allow for consistent values in a test.
69
- */
70
- seed?: number | number[];
71
- transformers?: {
72
- /**
73
- * Customize the names based on the type that is provided by the plugin.
74
- */
75
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
76
- /**
77
- * Receive schema and baseName(propertName) and return FakerMeta array
78
- * TODO TODO add docs
79
- * @beta
80
- */
81
- schema?: (props: {
82
- schema?: SchemaObject;
83
- name?: string;
84
- parentName?: string;
85
- }, defaultSchemas: Schema[]) => Schema[] | undefined;
86
- };
87
- /**
88
- * Define some generators next to the faker generators
89
- */
90
- generators?: Array<Generator<PluginFaker>>;
91
- };
92
- type ResolvedOptions = {
93
- output: Output<Oas>;
94
- group: Options['group'];
95
- override: NonNullable<Options['override']>;
96
- dateType: NonNullable<Options['dateType']>;
97
- dateParser: NonNullable<Options['dateParser']>;
98
- unknownType: NonNullable<Options['unknownType']>;
99
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
100
- transformers: NonNullable<Options['transformers']>;
101
- seed: NonNullable<Options['seed']> | undefined;
102
- mapper: NonNullable<Options['mapper']>;
103
- regexGenerator: NonNullable<Options['regexGenerator']>;
104
- };
105
- type PluginFaker = PluginFactoryOptions<'plugin-faker', Options, ResolvedOptions, never, ResolvePathOptions>;
106
-
107
- export type { Options as O, PluginFaker as P };
@@ -1,107 +0,0 @@
1
- import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
2
- import { Oas, contentType, SchemaObject } from '@kubb/oas';
3
- import { Exclude, Include, Override, Schema, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
4
-
5
- type Options = {
6
- /**
7
- * Specify the export location for the files and define the behavior of the output
8
- * @default { path: 'handlers', barrelType: 'named' }
9
- */
10
- output?: Output<Oas>;
11
- /**
12
- * Define which contentType should be used.
13
- * By default, the first JSON valid mediaType will be used
14
- */
15
- contentType?: contentType;
16
- /**
17
- * Group the Faker mocks based on the provided name.
18
- */
19
- group?: Group;
20
- /**
21
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
22
- */
23
- exclude?: Array<Exclude>;
24
- /**
25
- * Array containing include parameters to include tags/operations/methods/paths.
26
- */
27
- include?: Array<Include>;
28
- /**
29
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
30
- */
31
- override?: Array<Override<ResolvedOptions>>;
32
- /**
33
- * Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`.
34
- * @default 'string'
35
- */
36
- dateType?: 'string' | 'date';
37
- /**
38
- * Which parser should be used when dateType is set to 'string'.
39
- * - Schema with format 'date' will use ISO date format (YYYY-MM-DD)
40
- * - `'dayjs'` will use `dayjs(faker.date.anytime()).format("YYYY-MM-DD")`.
41
- * - `undefined` will use `faker.date.anytime().toString()`
42
- * - Schema with format 'time' will use ISO time format (HH:mm:ss[.SSSSSS])
43
- * - `'dayjs'` will use `dayjs(faker.date.anytime()).format("HH:mm:ss")`.
44
- * - `undefined` will use `faker.date.anytime().toString()`
45
- * * @default 'faker'
46
- */
47
- dateParser?: 'faker' | 'dayjs' | 'moment' | (string & {});
48
- /**
49
- * Which type to use when the Swagger/OpenAPI file is not providing more information
50
- * @default 'any'
51
- */
52
- unknownType?: 'any' | 'unknown' | 'void';
53
- /**
54
- * Which type to use for empty schema values
55
- * @default `unknownType`
56
- */
57
- emptySchemaType?: 'any' | 'unknown' | 'void';
58
- /**
59
- * Choose which generator to use when using Regexp.
60
- *
61
- * `'faker'` will use `faker.helpers.fromRegExp(new RegExp(/test/))`
62
- * `'randexp'` will use `new RandExp(/test/).gen()`
63
- * @default 'faker'
64
- */
65
- regexGenerator?: 'faker' | 'randexp';
66
- mapper?: Record<string, string>;
67
- /**
68
- * The use of Seed is intended to allow for consistent values in a test.
69
- */
70
- seed?: number | number[];
71
- transformers?: {
72
- /**
73
- * Customize the names based on the type that is provided by the plugin.
74
- */
75
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
76
- /**
77
- * Receive schema and baseName(propertName) and return FakerMeta array
78
- * TODO TODO add docs
79
- * @beta
80
- */
81
- schema?: (props: {
82
- schema?: SchemaObject;
83
- name?: string;
84
- parentName?: string;
85
- }, defaultSchemas: Schema[]) => Schema[] | undefined;
86
- };
87
- /**
88
- * Define some generators next to the faker generators
89
- */
90
- generators?: Array<Generator<PluginFaker>>;
91
- };
92
- type ResolvedOptions = {
93
- output: Output<Oas>;
94
- group: Options['group'];
95
- override: NonNullable<Options['override']>;
96
- dateType: NonNullable<Options['dateType']>;
97
- dateParser: NonNullable<Options['dateParser']>;
98
- unknownType: NonNullable<Options['unknownType']>;
99
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
100
- transformers: NonNullable<Options['transformers']>;
101
- seed: NonNullable<Options['seed']> | undefined;
102
- mapper: NonNullable<Options['mapper']>;
103
- regexGenerator: NonNullable<Options['regexGenerator']>;
104
- };
105
- type PluginFaker = PluginFactoryOptions<'plugin-faker', Options, ResolvedOptions, never, ResolvePathOptions>;
106
-
107
- export type { Options as O, PluginFaker as P };