@kubb/plugin-faker 4.10.1 → 4.11.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.
@@ -133,135 +133,189 @@ function joinItems(items) {
133
133
  default: return fakerKeywordMapper.union(items);
134
134
  }
135
135
  }
136
- function parse({ schema, current, parent, name, siblings }, options) {
137
- const value = fakerKeywordMapper[current.keyword];
138
- if (!value) return;
139
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.union)) {
140
- if (Array.isArray(current.args) && !current.args.length) return "";
141
- return fakerKeywordMapper.union(current.args.map((it) => parse({
142
- schema,
143
- parent: current,
144
- name,
145
- current: it,
146
- siblings
147
- }, {
148
- ...options,
149
- canOverride: false
150
- })).filter(Boolean));
151
- }
152
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.and)) return fakerKeywordMapper.and(current.args.map((it) => parse({
153
- schema,
154
- parent: current,
155
- current: it,
156
- siblings
157
- }, {
158
- ...options,
159
- canOverride: false
160
- })).filter(Boolean));
161
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.array)) return fakerKeywordMapper.array(current.args.items.map((it) => parse({
162
- schema,
163
- parent: current,
164
- current: it,
165
- siblings
166
- }, {
167
- ...options,
168
- typeName: `NonNullable<${options.typeName}>[number]`,
169
- canOverride: false
170
- })).filter(Boolean), current.args.min, current.args.max);
171
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.enum)) {
172
- if (parent ? (0, __kubb_plugin_oas.isKeyword)(parent, __kubb_plugin_oas.schemaKeywords.tuple) : false) return fakerKeywordMapper.enum(current.args.items.map((schema$1) => {
173
- if (schema$1.format === "number") return schema$1.value;
174
- if (schema$1.format === "boolean") return schema$1.value;
175
- return __kubb_core_transformers.default.stringify(schema$1.value);
176
- }));
177
- return fakerKeywordMapper.enum(current.args.items.map((schema$1) => {
178
- if (schema$1.format === "number") return schema$1.value;
179
- if (schema$1.format === "boolean") return schema$1.value;
180
- return __kubb_core_transformers.default.stringify(schema$1.value);
181
- }), name ? options.typeName : void 0);
182
- }
183
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.ref)) {
184
- if (!current.args?.name) throw new Error(`Name not defined for keyword ${current.keyword}`);
185
- if (options.canOverride) return `${current.args.name}(data)`;
186
- return `${current.args.name}()`;
187
- }
188
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.object)) return `{${Object.entries(current.args?.properties || {}).filter((item) => {
189
- const schema$1 = item[1];
190
- return schema$1 && typeof schema$1.map === "function";
191
- }).map(([name$1, schemas]) => {
192
- const mappedName = schemas.find((schema$1) => schema$1.keyword === __kubb_plugin_oas.schemaKeywords.name)?.args || name$1;
193
- if (options.mapper?.[mappedName]) return `"${name$1}": ${options.mapper?.[mappedName]}`;
194
- return `"${name$1}": ${joinItems(schemas.sort(schemaKeywordSorter).map((it) => parse({
195
- schema,
196
- name: name$1,
197
- parent: current,
198
- current: it,
199
- siblings: schemas
200
- }, {
201
- ...options,
202
- typeName: `NonNullable<${options.typeName}>[${JSON.stringify(name$1)}]`,
203
- canOverride: false
204
- })).filter(Boolean))}`;
205
- }).join(",")}}`;
206
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.tuple)) {
207
- if (Array.isArray(current.args.items)) return fakerKeywordMapper.tuple(current.args.items.map((it) => parse({
208
- schema,
209
- parent: current,
210
- current: it,
211
- siblings
212
- }, {
213
- ...options,
214
- canOverride: false
215
- })).filter(Boolean));
216
- return parse({
217
- schema,
218
- parent: current,
219
- current: current.args.items,
220
- siblings
221
- }, {
222
- ...options,
223
- canOverride: false
224
- });
225
- }
226
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.const)) {
227
- if (current.args.format === "number" && current.args.name !== void 0) return fakerKeywordMapper.const(current.args.name?.toString());
228
- return fakerKeywordMapper.const(__kubb_core_transformers.default.stringify(current.args.value));
229
- }
230
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.matches) && current.args) return fakerKeywordMapper.matches(current.args, options.regexGenerator);
231
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.null) || (0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.undefined) || (0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.any)) return value() || "";
232
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.string)) {
233
- if (siblings) {
234
- const minSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.min);
235
- const maxSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.max);
236
- return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args);
237
- }
238
- return fakerKeywordMapper.string();
239
- }
240
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.number)) {
241
- if (siblings) {
242
- const minSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.min);
243
- const maxSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.max);
244
- return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args);
245
- }
246
- return fakerKeywordMapper.number();
247
- }
248
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.integer)) {
249
- if (siblings) {
250
- const minSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.min);
251
- const maxSchema = __kubb_plugin_oas.SchemaGenerator.find(siblings, __kubb_plugin_oas.schemaKeywords.max);
252
- return fakerKeywordMapper.integer(minSchema?.args, maxSchema?.args);
136
+ const parse = (0, __kubb_plugin_oas.createParser)({
137
+ mapper: fakerKeywordMapper,
138
+ handlers: {
139
+ union(tree, options) {
140
+ const { current, schema, name, siblings } = tree;
141
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.union)) return void 0;
142
+ if (Array.isArray(current.args) && !current.args.length) return "";
143
+ return fakerKeywordMapper.union(current.args.map((it) => this.parse({
144
+ schema,
145
+ parent: current,
146
+ name,
147
+ current: it,
148
+ siblings
149
+ }, {
150
+ ...options,
151
+ canOverride: false
152
+ })).filter(Boolean));
153
+ },
154
+ and(tree, options) {
155
+ const { current, schema, siblings } = tree;
156
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.and)) return void 0;
157
+ return fakerKeywordMapper.and(current.args.map((it) => this.parse({
158
+ schema,
159
+ parent: current,
160
+ current: it,
161
+ siblings
162
+ }, {
163
+ ...options,
164
+ canOverride: false
165
+ })).filter(Boolean));
166
+ },
167
+ array(tree, options) {
168
+ const { current, schema } = tree;
169
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.array)) return void 0;
170
+ return fakerKeywordMapper.array(current.args.items.map((it) => this.parse({
171
+ schema,
172
+ parent: current,
173
+ current: it,
174
+ siblings: current.args.items
175
+ }, {
176
+ ...options,
177
+ typeName: `NonNullable<${options.typeName}>[number]`,
178
+ canOverride: false
179
+ })).filter(Boolean), current.args.min, current.args.max);
180
+ },
181
+ enum(tree, options) {
182
+ const { current, parent, name } = tree;
183
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.enum)) return void 0;
184
+ if (parent ? (0, __kubb_plugin_oas.isKeyword)(parent, __kubb_plugin_oas.schemaKeywords.tuple) : false) return fakerKeywordMapper.enum(current.args.items.map((schema) => {
185
+ if (schema.format === "number") return schema.value;
186
+ if (schema.format === "boolean") return schema.value;
187
+ return __kubb_core_transformers.default.stringify(schema.value);
188
+ }));
189
+ return fakerKeywordMapper.enum(current.args.items.map((schema) => {
190
+ if (schema.format === "number") return schema.value;
191
+ if (schema.format === "boolean") return schema.value;
192
+ return __kubb_core_transformers.default.stringify(schema.value);
193
+ }), name ? options.typeName : void 0);
194
+ },
195
+ ref(tree, options) {
196
+ const { current } = tree;
197
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.ref)) return void 0;
198
+ if (!current.args?.name) throw new Error(`Name not defined for keyword ${current.keyword}`);
199
+ if (options.canOverride) return `${current.args.name}(data)`;
200
+ return `${current.args.name}()`;
201
+ },
202
+ object(tree, options) {
203
+ const { current, schema } = tree;
204
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.object)) return void 0;
205
+ return `{${Object.entries(current.args?.properties || {}).filter((item) => {
206
+ const schema$1 = item[1];
207
+ return schema$1 && typeof schema$1.map === "function";
208
+ }).map(([name, schemas]) => {
209
+ const mappedName = schemas.find((schema$1) => schema$1.keyword === __kubb_plugin_oas.schemaKeywords.name)?.args || name;
210
+ if (options.mapper?.[mappedName]) return `"${name}": ${options.mapper?.[mappedName]}`;
211
+ return `"${name}": ${joinItems(schemas.sort(schemaKeywordSorter).map((it) => this.parse({
212
+ schema,
213
+ name,
214
+ parent: current,
215
+ current: it,
216
+ siblings: schemas
217
+ }, {
218
+ ...options,
219
+ typeName: `NonNullable<${options.typeName}>[${JSON.stringify(name)}]`,
220
+ canOverride: false
221
+ })).filter(Boolean))}`;
222
+ }).join(",")}}`;
223
+ },
224
+ tuple(tree, options) {
225
+ const { current, schema, siblings } = tree;
226
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.tuple)) return void 0;
227
+ if (Array.isArray(current.args.items)) return fakerKeywordMapper.tuple(current.args.items.map((it) => this.parse({
228
+ schema,
229
+ parent: current,
230
+ current: it,
231
+ siblings
232
+ }, {
233
+ ...options,
234
+ canOverride: false
235
+ })).filter(Boolean));
236
+ return this.parse({
237
+ schema,
238
+ parent: current,
239
+ current: current.args.items,
240
+ siblings
241
+ }, {
242
+ ...options,
243
+ canOverride: false
244
+ });
245
+ },
246
+ const(tree, _options) {
247
+ const { current } = tree;
248
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.const)) return void 0;
249
+ if (current.args.format === "number" && current.args.name !== void 0) return fakerKeywordMapper.const(current.args.name?.toString());
250
+ return fakerKeywordMapper.const(__kubb_core_transformers.default.stringify(current.args.value));
251
+ },
252
+ matches(tree, options) {
253
+ const { current } = tree;
254
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.matches)) return void 0;
255
+ if (current.args) return fakerKeywordMapper.matches(current.args, options.regexGenerator);
256
+ },
257
+ null(tree) {
258
+ const { current } = tree;
259
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.null)) return void 0;
260
+ return fakerKeywordMapper.null();
261
+ },
262
+ undefined(tree) {
263
+ const { current } = tree;
264
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.undefined)) return void 0;
265
+ return fakerKeywordMapper.undefined();
266
+ },
267
+ any(tree) {
268
+ const { current } = tree;
269
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.any)) return void 0;
270
+ return fakerKeywordMapper.any();
271
+ },
272
+ string(tree, _options) {
273
+ const { current, siblings } = tree;
274
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.string)) return void 0;
275
+ if (siblings) {
276
+ const minSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "min");
277
+ const maxSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "max");
278
+ return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args);
279
+ }
280
+ return fakerKeywordMapper.string();
281
+ },
282
+ number(tree, _options) {
283
+ const { current, siblings } = tree;
284
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.number)) return void 0;
285
+ if (siblings) {
286
+ const minSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "min");
287
+ const maxSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "max");
288
+ return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args);
289
+ }
290
+ return fakerKeywordMapper.number();
291
+ },
292
+ integer(tree, _options) {
293
+ const { current, siblings } = tree;
294
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.integer)) return void 0;
295
+ if (siblings) {
296
+ const minSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "min");
297
+ const maxSchema = (0, __kubb_plugin_oas.findSchemaKeyword)(siblings, "max");
298
+ return fakerKeywordMapper.integer(minSchema?.args, maxSchema?.args);
299
+ }
300
+ return fakerKeywordMapper.integer();
301
+ },
302
+ datetime(tree) {
303
+ const { current } = tree;
304
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.datetime)) return void 0;
305
+ return fakerKeywordMapper.datetime();
306
+ },
307
+ date(tree, options) {
308
+ const { current } = tree;
309
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.date)) return void 0;
310
+ return fakerKeywordMapper.date(current.args.type, options.dateParser);
311
+ },
312
+ time(tree, options) {
313
+ const { current } = tree;
314
+ if (!(0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.time)) return void 0;
315
+ return fakerKeywordMapper.time(current.args.type, options.dateParser);
253
316
  }
254
- return fakerKeywordMapper.integer();
255
- }
256
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.datetime)) return fakerKeywordMapper.datetime();
257
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.date)) return fakerKeywordMapper.date(current.args.type, options.dateParser);
258
- if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.time)) return fakerKeywordMapper.time(current.args.type, options.dateParser);
259
- if (current.keyword in fakerKeywordMapper && "args" in current) {
260
- const value$1 = fakerKeywordMapper[current.keyword];
261
- return value$1(JSON.stringify(current.args));
262
317
  }
263
- if (current.keyword in fakerKeywordMapper) return value();
264
- }
318
+ });
265
319
 
266
320
  //#endregion
267
321
  //#region src/components/Faker.tsx
@@ -340,4 +394,4 @@ Object.defineProperty(exports, '__toESM', {
340
394
  return __toESM;
341
395
  }
342
396
  });
343
- //# sourceMappingURL=components-BP20Parg.cjs.map
397
+ //# sourceMappingURL=components-B3zDIwzO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-B3zDIwzO.cjs","names":["transformers","schemaKeywords","schema","parserFaker.joinItems","parserFaker.parse","FunctionParams","File","Function","transformers"],"sources":["../src/parser.ts","../src/components/Faker.tsx"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\nimport { createParser, findSchemaKeyword, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\nimport type { Options } from './types.ts'\n\nconst fakerKeywordMapper = {\n any: () => 'undefined',\n unknown: () => 'undefined',\n void: () => 'undefined',\n number: (min?: number, max?: number) => {\n if (max !== undefined && min !== undefined) {\n return `faker.number.float({ min: ${min}, max: ${max} })`\n }\n\n if (max !== undefined) {\n return `faker.number.float({ max: ${max} })`\n }\n\n if (min !== undefined) {\n return `faker.number.float({ min: ${min} })`\n }\n\n return 'faker.number.float()'\n },\n integer: (min?: number, max?: number) => {\n if (max !== undefined && min !== undefined) {\n return `faker.number.int({ min: ${min}, max: ${max} })`\n }\n\n if (max !== undefined) {\n return `faker.number.int({ max: ${max} })`\n }\n\n if (min !== undefined) {\n return `faker.number.int({ min: ${min} })`\n }\n\n return 'faker.number.int()'\n },\n string: (min?: number, max?: number) => {\n if (max !== undefined && min !== undefined) {\n return `faker.string.alpha({ length: { min: ${min}, max: ${max} } })`\n }\n\n if (max !== undefined) {\n return `faker.string.alpha({ length: ${max} })`\n }\n\n if (min !== undefined) {\n return `faker.string.alpha({ length: ${min} })`\n }\n\n return 'faker.string.alpha()'\n },\n boolean: () => 'faker.datatype.boolean()',\n undefined: () => 'undefined',\n null: () => 'null',\n array: (items: string[] = [], min?: number, max?: number) => {\n if (items.length > 1) {\n return `faker.helpers.arrayElements([${items.join(', ')}])`\n }\n const item = items.at(0)\n\n if (min !== undefined && max !== undefined) {\n return `faker.helpers.multiple(() => (${item}), { count: { min: ${min}, max: ${max} }})`\n }\n if (min !== undefined) {\n return `faker.helpers.multiple(() => (${item}), { count: ${min} })`\n }\n if (max !== undefined) {\n return `faker.helpers.multiple(() => (${item}), { count: { min: 0, max: ${max} }})`\n }\n\n return `faker.helpers.multiple(() => (${item}))`\n },\n tuple: (items: string[] = []) => `[${items.join(', ')}]`,\n enum: (items: Array<string | number | boolean | undefined> = [], type = 'any') => `faker.helpers.arrayElement<${type}>([${items.join(', ')}])`,\n union: (items: string[] = []) => `faker.helpers.arrayElement<any>([${items.join(', ')}])`,\n /**\n * ISO 8601\n */\n datetime: () => 'faker.date.anytime().toISOString()',\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', parser: Options['dateParser'] = 'faker') => {\n if (type === 'string') {\n if (parser !== 'faker') {\n return `${parser}(faker.date.anytime()).format(\"YYYY-MM-DD\")`\n }\n return 'faker.date.anytime().toISOString().substring(0, 10)'\n }\n\n if (parser !== 'faker') {\n throw new Error(`type '${type}' and parser '${parser}' can not work together`)\n }\n\n return 'faker.date.anytime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', parser: Options['dateParser'] = 'faker') => {\n if (type === 'string') {\n if (parser !== 'faker') {\n return `${parser}(faker.date.anytime()).format(\"HH:mm:ss\")`\n }\n return 'faker.date.anytime().toISOString().substring(11, 19)'\n }\n\n if (parser !== 'faker') {\n throw new Error(`type '${type}' and parser '${parser}' can not work together`)\n }\n\n return 'faker.date.anytime()'\n },\n uuid: () => 'faker.string.uuid()',\n url: () => 'faker.internet.url()',\n and: (items: string[] = []) => `Object.assign({}, ${items.join(', ')})`,\n object: () => 'object',\n ref: () => 'ref',\n matches: (value = '', regexGenerator: 'faker' | 'randexp' = 'faker') => {\n if (regexGenerator === 'randexp') {\n return `${transformers.toRegExpString(value, 'RandExp')}.gen()`\n }\n return `faker.helpers.fromRegExp(\"${value}\")`\n },\n email: () => 'faker.internet.email()',\n firstName: () => 'faker.person.firstName()',\n lastName: () => 'faker.person.lastName()',\n password: () => 'faker.internet.password()',\n phone: () => 'faker.phone.number()',\n blob: () => 'faker.image.url() as unknown as Blob',\n default: undefined,\n describe: undefined,\n const: (value?: string | number) => (value as string) ?? '',\n max: undefined,\n min: undefined,\n nullable: undefined,\n nullish: undefined,\n optional: undefined,\n readOnly: undefined,\n writeOnly: undefined,\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: undefined,\n name: undefined,\n interface: undefined,\n exclusiveMaximum: undefined,\n exclusiveMinimum: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nfunction schemaKeywordSorter(_a: Schema, b: Schema) {\n if (b.keyword === 'null') {\n return -1\n }\n\n return 0\n}\n\nexport function joinItems(items: string[]): string {\n switch (items.length) {\n case 0:\n return 'undefined'\n case 1:\n return items[0]!\n default:\n return fakerKeywordMapper.union(items)\n }\n}\n\ntype ParserOptions = {\n typeName?: string\n regexGenerator?: 'faker' | 'randexp'\n canOverride?: boolean\n dateParser?: Options['dateParser']\n mapper?: Record<string, string>\n}\n\nexport const parse = createParser<string, ParserOptions>({\n mapper: fakerKeywordMapper,\n handlers: {\n union(tree, options) {\n const { current, schema, name, siblings } = tree\n if (!isKeyword(current, schemaKeywords.union)) return undefined\n\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return fakerKeywordMapper.union(\n current.args.map((it) => this.parse({ schema, parent: current, name, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n },\n and(tree, options) {\n const { current, schema, siblings } = tree\n if (!isKeyword(current, schemaKeywords.and)) return undefined\n\n return fakerKeywordMapper.and(\n current.args.map((it) => this.parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n },\n array(tree, options) {\n const { current, schema } = tree\n if (!isKeyword(current, schemaKeywords.array)) return undefined\n\n return fakerKeywordMapper.array(\n current.args.items\n .map((it) =>\n this.parse(\n { schema, parent: current, current: it, siblings: current.args.items },\n {\n ...options,\n typeName: `NonNullable<${options.typeName}>[number]`,\n canOverride: false,\n },\n ),\n )\n .filter(Boolean),\n current.args.min,\n current.args.max,\n )\n },\n enum(tree, options) {\n const { current, parent, name } = tree\n if (!isKeyword(current, schemaKeywords.enum)) return undefined\n\n const isParentTuple = parent ? isKeyword(parent, schemaKeywords.tuple) : false\n\n if (isParentTuple) {\n return fakerKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return schema.value\n }\n\n if (schema.format === 'boolean') {\n return schema.value\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n return fakerKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'number') {\n return schema.value\n }\n if (schema.format === 'boolean') {\n return schema.value\n }\n return transformers.stringify(schema.value)\n }),\n // TODO replace this with getEnumNameFromSchema\n name ? options.typeName : undefined,\n )\n },\n ref(tree, options) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.ref)) return undefined\n\n if (!current.args?.name) {\n throw new Error(`Name not defined for keyword ${current.keyword}`)\n }\n\n if (options.canOverride) {\n return `${current.args.name}(data)`\n }\n\n return `${current.args.name}()`\n },\n object(tree, options) {\n const { current, schema } = tree\n if (!isKeyword(current, schemaKeywords.object)) return undefined\n\n const argsObject = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n return `\"${name}\": ${joinItems(\n schemas\n .sort(schemaKeywordSorter)\n .map((it) =>\n this.parse(\n { schema, name, parent: current, current: it, siblings: schemas },\n {\n ...options,\n typeName: `NonNullable<${options.typeName}>[${JSON.stringify(name)}]`,\n canOverride: false,\n },\n ),\n )\n .filter(Boolean),\n )}`\n })\n .join(',')\n\n return `{${argsObject}}`\n },\n tuple(tree, options) {\n const { current, schema, siblings } = tree\n if (!isKeyword(current, schemaKeywords.tuple)) return undefined\n\n if (Array.isArray(current.args.items)) {\n return fakerKeywordMapper.tuple(\n current.args.items.map((it) => this.parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n }\n\n return this.parse({ schema, parent: current, current: current.args.items, siblings }, { ...options, canOverride: false })\n },\n const(tree, _options) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.const)) return undefined\n\n if (current.args.format === 'number' && current.args.name !== undefined) {\n return fakerKeywordMapper.const(current.args.name?.toString())\n }\n return fakerKeywordMapper.const(transformers.stringify(current.args.value))\n },\n matches(tree, options) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.matches)) return undefined\n\n if (current.args) {\n return fakerKeywordMapper.matches(current.args, options.regexGenerator)\n }\n return undefined\n },\n null(tree) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.null)) return undefined\n\n return fakerKeywordMapper.null()\n },\n undefined(tree) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.undefined)) return undefined\n\n return fakerKeywordMapper.undefined()\n },\n any(tree) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.any)) return undefined\n\n return fakerKeywordMapper.any()\n },\n string(tree, _options) {\n const { current, siblings } = tree\n if (!isKeyword(current, schemaKeywords.string)) return undefined\n\n if (siblings) {\n const minSchema = findSchemaKeyword(siblings, 'min')\n const maxSchema = findSchemaKeyword(siblings, 'max')\n\n return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.string()\n },\n number(tree, _options) {\n const { current, siblings } = tree\n if (!isKeyword(current, schemaKeywords.number)) return undefined\n\n if (siblings) {\n const minSchema = findSchemaKeyword(siblings, 'min')\n const maxSchema = findSchemaKeyword(siblings, 'max')\n\n return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.number()\n },\n integer(tree, _options) {\n const { current, siblings } = tree\n if (!isKeyword(current, schemaKeywords.integer)) return undefined\n\n if (siblings) {\n const minSchema = findSchemaKeyword(siblings, 'min')\n const maxSchema = findSchemaKeyword(siblings, 'max')\n\n return fakerKeywordMapper.integer(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.integer()\n },\n datetime(tree) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.datetime)) return undefined\n\n return fakerKeywordMapper.datetime()\n },\n date(tree, options) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.date)) return undefined\n\n return fakerKeywordMapper.date(current.args.type, options.dateParser)\n },\n time(tree, options) {\n const { current } = tree\n if (!isKeyword(current, schemaKeywords.time)) return undefined\n\n return fakerKeywordMapper.time(current.args.type, options.dateParser)\n },\n },\n})\n","import transformers from '@kubb/core/transformers'\nimport type { Schema } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport * as parserFaker from '../parser.ts'\nimport type { PluginFaker } from '../types.ts'\n\ntype Props = {\n name: string\n typeName: string\n tree: Array<Schema>\n seed?: PluginFaker['options']['seed']\n description?: string\n regexGenerator?: PluginFaker['options']['regexGenerator']\n mapper?: PluginFaker['options']['mapper']\n dateParser?: PluginFaker['options']['dateParser']\n canOverride: boolean\n}\n\nexport function Faker({ tree, description, name, typeName, seed, regexGenerator, canOverride, mapper, dateParser }: Props): KubbNode {\n const fakerText = parserFaker.joinItems(\n tree\n .map((schema, _index, siblings) =>\n parserFaker.parse(\n { name, schema, parent: undefined, current: schema, siblings },\n {\n typeName,\n regexGenerator,\n mapper,\n canOverride,\n dateParser,\n },\n ),\n )\n .filter(Boolean),\n )\n\n const isArray = fakerText.startsWith('faker.helpers.arrayElements') || fakerText.startsWith('faker.helpers.multiple')\n const isObject = fakerText.startsWith('{')\n const isTuple = fakerText.startsWith('faker.helpers.arrayElement')\n\n const isSimpleString = name === 'string'\n const isSimpleInt = name === 'integer'\n const isSimpleFloat = name === 'float'\n\n let fakerTextWithOverride = fakerText\n\n if (canOverride && isObject) {\n fakerTextWithOverride = `{\n ...${fakerText},\n ...data || {}\n}`\n }\n\n if (canOverride && isTuple) {\n fakerTextWithOverride = `data || ${fakerText}`\n }\n\n if (canOverride && isArray) {\n fakerTextWithOverride = `[\n ...${fakerText},\n ...data || []\n ]`\n }\n\n if (canOverride && isSimpleString) {\n fakerTextWithOverride = 'data ?? faker.string.alpha()'\n }\n\n if (canOverride && isSimpleInt) {\n fakerTextWithOverride = 'data ?? faker.number.int()'\n }\n\n if (canOverride && isSimpleFloat) {\n fakerTextWithOverride = 'data ?? faker.number.float()'\n }\n\n let type = `Partial<${typeName}>`\n\n if (isArray) type = typeName\n else if (isSimpleString) type = name\n else if (isSimpleInt || isSimpleFloat) type = 'number'\n\n const params = FunctionParams.factory({\n data: {\n // making a partial out of an array does not make sense\n type,\n optional: true,\n },\n })\n\n let returnType = canOverride ? typeName : undefined\n\n if (isSimpleString || isSimpleInt || isSimpleFloat) returnType = type\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n export\n name={name}\n JSDoc={{ comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean) }}\n params={canOverride ? params.toConstructor() : undefined}\n returnType={returnType}\n >\n {seed ? `faker.seed(${JSON.stringify(seed)})` : undefined}\n <br />\n {`return ${fakerTextWithOverride}`}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,qBAAqB;CACzB,WAAW;CACX,eAAe;CACf,YAAY;CACZ,SAAS,KAAc,QAAiB;AACtC,MAAI,QAAQ,UAAa,QAAQ,OAC/B,QAAO,6BAA6B,IAAI,SAAS,IAAI;AAGvD,MAAI,QAAQ,OACV,QAAO,6BAA6B,IAAI;AAG1C,MAAI,QAAQ,OACV,QAAO,6BAA6B,IAAI;AAG1C,SAAO;;CAET,UAAU,KAAc,QAAiB;AACvC,MAAI,QAAQ,UAAa,QAAQ,OAC/B,QAAO,2BAA2B,IAAI,SAAS,IAAI;AAGrD,MAAI,QAAQ,OACV,QAAO,2BAA2B,IAAI;AAGxC,MAAI,QAAQ,OACV,QAAO,2BAA2B,IAAI;AAGxC,SAAO;;CAET,SAAS,KAAc,QAAiB;AACtC,MAAI,QAAQ,UAAa,QAAQ,OAC/B,QAAO,uCAAuC,IAAI,SAAS,IAAI;AAGjE,MAAI,QAAQ,OACV,QAAO,gCAAgC,IAAI;AAG7C,MAAI,QAAQ,OACV,QAAO,gCAAgC,IAAI;AAG7C,SAAO;;CAET,eAAe;CACf,iBAAiB;CACjB,YAAY;CACZ,QAAQ,QAAkB,EAAE,EAAE,KAAc,QAAiB;AAC3D,MAAI,MAAM,SAAS,EACjB,QAAO,gCAAgC,MAAM,KAAK,KAAK,CAAC;EAE1D,MAAM,OAAO,MAAM,GAAG,EAAE;AAExB,MAAI,QAAQ,UAAa,QAAQ,OAC/B,QA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