@kubb/plugin-faker 4.31.0 → 4.31.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.
@@ -1,4 +1,5 @@
1
- import { n as PluginFaker, r as __name } from "./types-DpNAdZTi.js";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
2
+ import { n as PluginFaker } from "./types-BIWyHbXy.js";
2
3
  import { Schema } from "@kubb/plugin-oas";
3
4
  import { FabricReactNode } from "@kubb/react-fabric/types";
4
5
 
@@ -1,10 +1,11 @@
1
- import { n as PluginFaker, r as __name } from "./types-DpNAdZTi.js";
2
- import { FabricReactNode } from "@kubb/react-fabric/types";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
2
+ import { n as PluginFaker } from "./types-BIWyHbXy.js";
3
3
  import { BaseGenerator, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
4
+ import { Fabric } from "@kubb/react-fabric";
5
+ import { FabricReactNode } from "@kubb/react-fabric/types";
4
6
  import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
5
7
  import { AsyncEventEmitter } from "@kubb/core/utils";
6
8
  import { KubbFile } from "@kubb/fabric-core/types";
7
- import { Fabric } from "@kubb/react-fabric";
8
9
 
9
10
  //#region ../plugin-oas/src/types.d.ts
10
11
  type GetOasOptions = {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { n as PluginFaker, r as __name, t as Options } from "./types-DpNAdZTi.js";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
2
+ import { n as PluginFaker, t as Options } from "./types-BIWyHbXy.js";
2
3
  import * as _kubb_core0 from "@kubb/core";
3
4
 
4
5
  //#region src/plugin.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-faker",
3
- "version": "4.31.0",
3
+ "version": "4.31.1",
4
4
  "description": "Faker.js data generator plugin for Kubb, creating realistic mock data from OpenAPI specifications for development and testing.",
5
5
  "keywords": [
6
6
  "faker",
@@ -71,11 +71,11 @@
71
71
  }
72
72
  ],
73
73
  "dependencies": {
74
- "@kubb/react-fabric": "0.13.2",
75
- "@kubb/core": "4.31.0",
76
- "@kubb/oas": "4.31.0",
77
- "@kubb/plugin-oas": "4.31.0",
78
- "@kubb/plugin-ts": "4.31.0"
74
+ "@kubb/react-fabric": "0.13.3",
75
+ "@kubb/core": "4.31.1",
76
+ "@kubb/oas": "4.31.1",
77
+ "@kubb/plugin-oas": "4.31.1",
78
+ "@kubb/plugin-ts": "4.31.1"
79
79
  },
80
80
  "engines": {
81
81
  "node": ">=20"
@@ -1,133 +0,0 @@
1
- import { Exclude, Include, Override, ResolvePathOptions, Schema } from "@kubb/plugin-oas";
2
- import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
3
- import { Oas, SchemaObject, contentType } from "@kubb/oas";
4
- import { Generator } from "@kubb/plugin-oas/generators";
5
-
6
- //#region \0rolldown/runtime.js
7
- //#endregion
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: 'handlers', 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
- /**
21
- * Group the Faker mocks based on the provided name.
22
- */
23
- group?: Group;
24
- /**
25
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
26
- */
27
- exclude?: Array<Exclude>;
28
- /**
29
- * Array containing include parameters to include tags/operations/methods/paths.
30
- */
31
- include?: Array<Include>;
32
- /**
33
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
34
- */
35
- override?: Array<Override<ResolvedOptions>>;
36
- /**
37
- * Choose to use date or datetime as JavaScript Date instead of string.
38
- * - 'string' represents dates as string values.
39
- * - 'date' represents dates as JavaScript Date objects.
40
- * @default 'string'
41
- */
42
- dateType?: 'string' | 'date';
43
- /**
44
- * Choose to use `number` or `bigint` for integer fields with `int64` format.
45
- * - 'number' uses the JavaScript `number` type (matches JSON.parse() runtime behavior).
46
- * - 'bigint' uses the JavaScript `bigint` type (accurate for values exceeding Number.MAX_SAFE_INTEGER).
47
- * @note in v5 of Kubb 'bigint' will become the default to better align with OpenAPI's int64 specification.
48
- * @default 'number'
49
- */
50
- integerType?: 'number' | 'bigint';
51
- /**
52
- * Which parser should be used when dateType is set to string.
53
- * - 'faker' uses faker's built-in date formatting methods.
54
- * - 'dayjs' uses dayjs for date formatting with custom patterns.
55
- * - 'moment' uses moment for date formatting with custom patterns.
56
- * @default 'faker'
57
- */
58
- dateParser?: 'faker' | 'dayjs' | 'moment' | (string & {});
59
- /**
60
- * Which type to use when the Swagger/OpenAPI file is not providing more information.
61
- * - 'any' allows any value.
62
- * - 'unknown' requires type narrowing before use.
63
- * - 'void' represents no value.
64
- * @default 'any'
65
- */
66
- unknownType?: 'any' | 'unknown' | 'void';
67
- /**
68
- * Which type to use for empty schema values.
69
- * - 'any' allows any value.
70
- * - 'unknown' requires type narrowing before use.
71
- * - 'void' represents no value.
72
- * @default `unknownType`
73
- */
74
- emptySchemaType?: 'any' | 'unknown' | 'void';
75
- /**
76
- * Choose which generator to use when using Regexp.
77
- * - 'faker' uses faker.helpers.fromRegExp for generating values from regex patterns.
78
- * - 'randexp' uses RandExp library for generating values from regex patterns.
79
- * @default 'faker'
80
- */
81
- regexGenerator?: 'faker' | 'randexp';
82
- mapper?: Record<string, string>;
83
- /**
84
- * The use of Seed is intended to allow for consistent values in a test.
85
- */
86
- seed?: number | number[];
87
- /**
88
- * Transform parameter names to a specific casing format.
89
- * When set to 'camelcase', parameter names in path, query, and header params will be transformed to camelCase.
90
- * This should match the paramsCasing setting used in @kubb/plugin-ts.
91
- * @default undefined
92
- */
93
- paramsCasing?: 'camelcase';
94
- transformers?: {
95
- /**
96
- * Customize the names based on the type that is provided by the plugin.
97
- */
98
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
99
- /**
100
- * Receive schema and baseName(propertyName) and return FakerMeta array
101
- * TODO TODO add docs
102
- * @beta
103
- */
104
- schema?: (props: {
105
- schema: SchemaObject | null;
106
- name: string | null;
107
- parentName: string | null;
108
- }, defaultSchemas: Schema[]) => Schema[] | undefined;
109
- };
110
- /**
111
- * Define some generators next to the faker generators
112
- */
113
- generators?: Array<Generator<PluginFaker>>;
114
- };
115
- type ResolvedOptions = {
116
- output: Output<Oas>;
117
- group: Options['group'];
118
- override: NonNullable<Options['override']>;
119
- dateType: NonNullable<Options['dateType']>;
120
- integerType: NonNullable<Options['integerType']>;
121
- dateParser: NonNullable<Options['dateParser']>;
122
- unknownType: NonNullable<Options['unknownType']>;
123
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
124
- transformers: NonNullable<Options['transformers']>;
125
- seed: NonNullable<Options['seed']> | undefined;
126
- mapper: NonNullable<Options['mapper']>;
127
- regexGenerator: NonNullable<Options['regexGenerator']>;
128
- paramsCasing: Options['paramsCasing'];
129
- };
130
- type PluginFaker = PluginFactoryOptions<'plugin-faker', Options, ResolvedOptions, never, ResolvePathOptions>;
131
- //#endregion
132
- export { PluginFaker as n, __name as r, Options as t };
133
- //# sourceMappingURL=types-DpNAdZTi.d.ts.map