@kubb/plugin-faker 4.10.0 → 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.
- package/dist/{components-BP20Parg.cjs → components-B3zDIwzO.cjs} +182 -128
- package/dist/components-B3zDIwzO.cjs.map +1 -0
- package/dist/components-C4bJ99o9.js +358 -0
- package/dist/components-C4bJ99o9.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{fakerGenerator-APLVZFNv.cjs → fakerGenerator-D3S-ziEj.cjs} +2 -2
- package/dist/{fakerGenerator-APLVZFNv.cjs.map → fakerGenerator-D3S-ziEj.cjs.map} +1 -1
- package/dist/{fakerGenerator-CgXklxYJ.js → fakerGenerator-D4hR3u-d.js} +2 -2
- package/dist/{fakerGenerator-CgXklxYJ.js.map → fakerGenerator-D4hR3u-d.js.map} +1 -1
- package/dist/generators.cjs +1 -2
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +1 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-JsM2Z14N.d.ts → types-B1FgdqYL.d.cts} +21 -21
- package/dist/{types-uPoEoB49.d.cts → types-DgJG4t24.d.ts} +21 -21
- package/package.json +12 -12
- package/src/parser.ts +211 -180
- package/dist/components-BP20Parg.cjs.map +0 -1
- package/dist/components-DUQvu8JV.js +0 -304
- package/dist/components-DUQvu8JV.js.map +0 -1
package/src/parser.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import transformers from '@kubb/core/transformers'
|
|
2
|
-
import type { Schema,
|
|
3
|
-
import {
|
|
2
|
+
import type { Schema, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'
|
|
3
|
+
import { createParser, findSchemaKeyword, isKeyword, schemaKeywords } from '@kubb/plugin-oas'
|
|
4
4
|
import type { Options } from './types.ts'
|
|
5
5
|
|
|
6
6
|
const fakerKeywordMapper = {
|
|
@@ -186,210 +186,241 @@ type ParserOptions = {
|
|
|
186
186
|
mapper?: Record<string, string>
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
export
|
|
190
|
-
|
|
189
|
+
export const parse = createParser<string, ParserOptions>({
|
|
190
|
+
mapper: fakerKeywordMapper,
|
|
191
|
+
handlers: {
|
|
192
|
+
union(tree, options) {
|
|
193
|
+
const { current, schema, name, siblings } = tree
|
|
194
|
+
if (!isKeyword(current, schemaKeywords.union)) return undefined
|
|
191
195
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (isKeyword(current, schemaKeywords.union)) {
|
|
197
|
-
if (Array.isArray(current.args) && !current.args.length) {
|
|
198
|
-
return ''
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return fakerKeywordMapper.union(
|
|
202
|
-
current.args.map((it) => parse({ schema, parent: current, name, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),
|
|
203
|
-
)
|
|
204
|
-
}
|
|
196
|
+
if (Array.isArray(current.args) && !current.args.length) {
|
|
197
|
+
return ''
|
|
198
|
+
}
|
|
205
199
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
return fakerKeywordMapper.union(
|
|
201
|
+
current.args.map((it) => this.parse({ schema, parent: current, name, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),
|
|
202
|
+
)
|
|
203
|
+
},
|
|
204
|
+
and(tree, options) {
|
|
205
|
+
const { current, schema, siblings } = tree
|
|
206
|
+
if (!isKeyword(current, schemaKeywords.and)) return undefined
|
|
211
207
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
return fakerKeywordMapper.and(
|
|
209
|
+
current.args.map((it) => this.parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),
|
|
210
|
+
)
|
|
211
|
+
},
|
|
212
|
+
array(tree, options) {
|
|
213
|
+
const { current, schema } = tree
|
|
214
|
+
if (!isKeyword(current, schemaKeywords.array)) return undefined
|
|
215
|
+
|
|
216
|
+
return fakerKeywordMapper.array(
|
|
217
|
+
current.args.items
|
|
218
|
+
.map((it) =>
|
|
219
|
+
this.parse(
|
|
220
|
+
{ schema, parent: current, current: it, siblings: current.args.items },
|
|
221
|
+
{
|
|
222
|
+
...options,
|
|
223
|
+
typeName: `NonNullable<${options.typeName}>[number]`,
|
|
224
|
+
canOverride: false,
|
|
225
|
+
},
|
|
226
|
+
),
|
|
227
|
+
)
|
|
228
|
+
.filter(Boolean),
|
|
229
|
+
current.args.min,
|
|
230
|
+
current.args.max,
|
|
231
|
+
)
|
|
232
|
+
},
|
|
233
|
+
enum(tree, options) {
|
|
234
|
+
const { current, parent, name } = tree
|
|
235
|
+
if (!isKeyword(current, schemaKeywords.enum)) return undefined
|
|
236
|
+
|
|
237
|
+
const isParentTuple = parent ? isKeyword(parent, schemaKeywords.tuple) : false
|
|
238
|
+
|
|
239
|
+
if (isParentTuple) {
|
|
240
|
+
return fakerKeywordMapper.enum(
|
|
241
|
+
current.args.items.map((schema) => {
|
|
242
|
+
if (schema.format === 'number') {
|
|
243
|
+
return schema.value
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (schema.format === 'boolean') {
|
|
247
|
+
return schema.value
|
|
248
|
+
}
|
|
249
|
+
return transformers.stringify(schema.value)
|
|
250
|
+
}),
|
|
224
251
|
)
|
|
225
|
-
|
|
226
|
-
current.args.min,
|
|
227
|
-
current.args.max,
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (isKeyword(current, schemaKeywords.enum)) {
|
|
232
|
-
const isParentTuple = parent ? isKeyword(parent, schemaKeywords.tuple) : false
|
|
252
|
+
}
|
|
233
253
|
|
|
234
|
-
if (isParentTuple) {
|
|
235
254
|
return fakerKeywordMapper.enum(
|
|
236
255
|
current.args.items.map((schema) => {
|
|
237
256
|
if (schema.format === 'number') {
|
|
238
257
|
return schema.value
|
|
239
258
|
}
|
|
240
|
-
|
|
241
259
|
if (schema.format === 'boolean') {
|
|
242
260
|
return schema.value
|
|
243
261
|
}
|
|
244
262
|
return transformers.stringify(schema.value)
|
|
245
263
|
}),
|
|
264
|
+
// TODO replace this with getEnumNameFromSchema
|
|
265
|
+
name ? options.typeName : undefined,
|
|
246
266
|
)
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
current.
|
|
251
|
-
if (schema.format === 'number') {
|
|
252
|
-
return schema.value
|
|
253
|
-
}
|
|
254
|
-
if (schema.format === 'boolean') {
|
|
255
|
-
return schema.value
|
|
256
|
-
}
|
|
257
|
-
return transformers.stringify(schema.value)
|
|
258
|
-
}),
|
|
259
|
-
// TODO replace this with getEnumNameFromSchema
|
|
260
|
-
name ? options.typeName : undefined,
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
if (isKeyword(current, schemaKeywords.ref)) {
|
|
265
|
-
if (!current.args?.name) {
|
|
266
|
-
throw new Error(`Name not defined for keyword ${current.keyword}`)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
if (options.canOverride) {
|
|
270
|
-
return `${current.args.name}(data)`
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return `${current.args.name}()`
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (isKeyword(current, schemaKeywords.object)) {
|
|
277
|
-
const argsObject = Object.entries(current.args?.properties || {})
|
|
278
|
-
.filter((item) => {
|
|
279
|
-
const schema = item[1]
|
|
280
|
-
return schema && typeof schema.map === 'function'
|
|
281
|
-
})
|
|
282
|
-
.map(([name, schemas]) => {
|
|
283
|
-
const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']
|
|
284
|
-
const mappedName = nameSchema?.args || name
|
|
285
|
-
|
|
286
|
-
// custom mapper(pluginOptions)
|
|
287
|
-
if (options.mapper?.[mappedName]) {
|
|
288
|
-
return `"${name}": ${options.mapper?.[mappedName]}`
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return `"${name}": ${joinItems(
|
|
292
|
-
schemas
|
|
293
|
-
.sort(schemaKeywordSorter)
|
|
294
|
-
.map((it) =>
|
|
295
|
-
parse(
|
|
296
|
-
{ schema, name, parent: current, current: it, siblings: schemas },
|
|
297
|
-
{
|
|
298
|
-
...options,
|
|
299
|
-
typeName: `NonNullable<${options.typeName}>[${JSON.stringify(name)}]`,
|
|
300
|
-
canOverride: false,
|
|
301
|
-
},
|
|
302
|
-
),
|
|
303
|
-
)
|
|
304
|
-
.filter(Boolean),
|
|
305
|
-
)}`
|
|
306
|
-
})
|
|
307
|
-
.join(',')
|
|
308
|
-
|
|
309
|
-
return `{${argsObject}}`
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (isKeyword(current, schemaKeywords.tuple)) {
|
|
313
|
-
if (Array.isArray(current.args.items)) {
|
|
314
|
-
return fakerKeywordMapper.tuple(
|
|
315
|
-
current.args.items.map((it) => parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),
|
|
316
|
-
)
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
return parse({ schema, parent: current, current: current.args.items, siblings }, { ...options, canOverride: false })
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (isKeyword(current, schemaKeywords.const)) {
|
|
323
|
-
if (current.args.format === 'number' && current.args.name !== undefined) {
|
|
324
|
-
return fakerKeywordMapper.const(current.args.name?.toString())
|
|
325
|
-
}
|
|
326
|
-
return fakerKeywordMapper.const(transformers.stringify(current.args.value))
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
if (isKeyword(current, schemaKeywords.matches) && current.args) {
|
|
330
|
-
return fakerKeywordMapper.matches(current.args, options.regexGenerator)
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (isKeyword(current, schemaKeywords.null) || isKeyword(current, schemaKeywords.undefined) || isKeyword(current, schemaKeywords.any)) {
|
|
334
|
-
return value() || ''
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
if (isKeyword(current, schemaKeywords.string)) {
|
|
338
|
-
if (siblings) {
|
|
339
|
-
const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)
|
|
340
|
-
const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)
|
|
341
|
-
|
|
342
|
-
return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args)
|
|
343
|
-
}
|
|
267
|
+
},
|
|
268
|
+
ref(tree, options) {
|
|
269
|
+
const { current } = tree
|
|
270
|
+
if (!isKeyword(current, schemaKeywords.ref)) return undefined
|
|
344
271
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if (isKeyword(current, schemaKeywords.number)) {
|
|
349
|
-
if (siblings) {
|
|
350
|
-
const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)
|
|
351
|
-
const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)
|
|
352
|
-
|
|
353
|
-
return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args)
|
|
354
|
-
}
|
|
272
|
+
if (!current.args?.name) {
|
|
273
|
+
throw new Error(`Name not defined for keyword ${current.keyword}`)
|
|
274
|
+
}
|
|
355
275
|
|
|
356
|
-
|
|
357
|
-
|
|
276
|
+
if (options.canOverride) {
|
|
277
|
+
return `${current.args.name}(data)`
|
|
278
|
+
}
|
|
358
279
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const
|
|
280
|
+
return `${current.args.name}()`
|
|
281
|
+
},
|
|
282
|
+
object(tree, options) {
|
|
283
|
+
const { current, schema } = tree
|
|
284
|
+
if (!isKeyword(current, schemaKeywords.object)) return undefined
|
|
285
|
+
|
|
286
|
+
const argsObject = Object.entries(current.args?.properties || {})
|
|
287
|
+
.filter((item) => {
|
|
288
|
+
const schema = item[1]
|
|
289
|
+
return schema && typeof schema.map === 'function'
|
|
290
|
+
})
|
|
291
|
+
.map(([name, schemas]) => {
|
|
292
|
+
const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']
|
|
293
|
+
const mappedName = nameSchema?.args || name
|
|
294
|
+
|
|
295
|
+
// custom mapper(pluginOptions)
|
|
296
|
+
if (options.mapper?.[mappedName]) {
|
|
297
|
+
return `"${name}": ${options.mapper?.[mappedName]}`
|
|
298
|
+
}
|
|
363
299
|
|
|
364
|
-
|
|
365
|
-
|
|
300
|
+
return `"${name}": ${joinItems(
|
|
301
|
+
schemas
|
|
302
|
+
.sort(schemaKeywordSorter)
|
|
303
|
+
.map((it) =>
|
|
304
|
+
this.parse(
|
|
305
|
+
{ schema, name, parent: current, current: it, siblings: schemas },
|
|
306
|
+
{
|
|
307
|
+
...options,
|
|
308
|
+
typeName: `NonNullable<${options.typeName}>[${JSON.stringify(name)}]`,
|
|
309
|
+
canOverride: false,
|
|
310
|
+
},
|
|
311
|
+
),
|
|
312
|
+
)
|
|
313
|
+
.filter(Boolean),
|
|
314
|
+
)}`
|
|
315
|
+
})
|
|
316
|
+
.join(',')
|
|
317
|
+
|
|
318
|
+
return `{${argsObject}}`
|
|
319
|
+
},
|
|
320
|
+
tuple(tree, options) {
|
|
321
|
+
const { current, schema, siblings } = tree
|
|
322
|
+
if (!isKeyword(current, schemaKeywords.tuple)) return undefined
|
|
323
|
+
|
|
324
|
+
if (Array.isArray(current.args.items)) {
|
|
325
|
+
return fakerKeywordMapper.tuple(
|
|
326
|
+
current.args.items.map((it) => this.parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),
|
|
327
|
+
)
|
|
328
|
+
}
|
|
366
329
|
|
|
367
|
-
|
|
368
|
-
|
|
330
|
+
return this.parse({ schema, parent: current, current: current.args.items, siblings }, { ...options, canOverride: false })
|
|
331
|
+
},
|
|
332
|
+
const(tree, _options) {
|
|
333
|
+
const { current } = tree
|
|
334
|
+
if (!isKeyword(current, schemaKeywords.const)) return undefined
|
|
369
335
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
336
|
+
if (current.args.format === 'number' && current.args.name !== undefined) {
|
|
337
|
+
return fakerKeywordMapper.const(current.args.name?.toString())
|
|
338
|
+
}
|
|
339
|
+
return fakerKeywordMapper.const(transformers.stringify(current.args.value))
|
|
340
|
+
},
|
|
341
|
+
matches(tree, options) {
|
|
342
|
+
const { current } = tree
|
|
343
|
+
if (!isKeyword(current, schemaKeywords.matches)) return undefined
|
|
344
|
+
|
|
345
|
+
if (current.args) {
|
|
346
|
+
return fakerKeywordMapper.matches(current.args, options.regexGenerator)
|
|
347
|
+
}
|
|
348
|
+
return undefined
|
|
349
|
+
},
|
|
350
|
+
null(tree) {
|
|
351
|
+
const { current } = tree
|
|
352
|
+
if (!isKeyword(current, schemaKeywords.null)) return undefined
|
|
353
|
+
|
|
354
|
+
return fakerKeywordMapper.null()
|
|
355
|
+
},
|
|
356
|
+
undefined(tree) {
|
|
357
|
+
const { current } = tree
|
|
358
|
+
if (!isKeyword(current, schemaKeywords.undefined)) return undefined
|
|
359
|
+
|
|
360
|
+
return fakerKeywordMapper.undefined()
|
|
361
|
+
},
|
|
362
|
+
any(tree) {
|
|
363
|
+
const { current } = tree
|
|
364
|
+
if (!isKeyword(current, schemaKeywords.any)) return undefined
|
|
365
|
+
|
|
366
|
+
return fakerKeywordMapper.any()
|
|
367
|
+
},
|
|
368
|
+
string(tree, _options) {
|
|
369
|
+
const { current, siblings } = tree
|
|
370
|
+
if (!isKeyword(current, schemaKeywords.string)) return undefined
|
|
371
|
+
|
|
372
|
+
if (siblings) {
|
|
373
|
+
const minSchema = findSchemaKeyword(siblings, 'min')
|
|
374
|
+
const maxSchema = findSchemaKeyword(siblings, 'max')
|
|
375
|
+
|
|
376
|
+
return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args)
|
|
377
|
+
}
|
|
373
378
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
379
|
+
return fakerKeywordMapper.string()
|
|
380
|
+
},
|
|
381
|
+
number(tree, _options) {
|
|
382
|
+
const { current, siblings } = tree
|
|
383
|
+
if (!isKeyword(current, schemaKeywords.number)) return undefined
|
|
377
384
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
385
|
+
if (siblings) {
|
|
386
|
+
const minSchema = findSchemaKeyword(siblings, 'min')
|
|
387
|
+
const maxSchema = findSchemaKeyword(siblings, 'max')
|
|
381
388
|
|
|
382
|
-
|
|
383
|
-
|
|
389
|
+
return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args)
|
|
390
|
+
}
|
|
384
391
|
|
|
385
|
-
|
|
392
|
+
return fakerKeywordMapper.number()
|
|
393
|
+
},
|
|
394
|
+
integer(tree, _options) {
|
|
395
|
+
const { current, siblings } = tree
|
|
396
|
+
if (!isKeyword(current, schemaKeywords.integer)) return undefined
|
|
386
397
|
|
|
387
|
-
|
|
388
|
-
|
|
398
|
+
if (siblings) {
|
|
399
|
+
const minSchema = findSchemaKeyword(siblings, 'min')
|
|
400
|
+
const maxSchema = findSchemaKeyword(siblings, 'max')
|
|
389
401
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
402
|
+
return fakerKeywordMapper.integer(minSchema?.args, maxSchema?.args)
|
|
403
|
+
}
|
|
393
404
|
|
|
394
|
-
|
|
395
|
-
}
|
|
405
|
+
return fakerKeywordMapper.integer()
|
|
406
|
+
},
|
|
407
|
+
datetime(tree) {
|
|
408
|
+
const { current } = tree
|
|
409
|
+
if (!isKeyword(current, schemaKeywords.datetime)) return undefined
|
|
410
|
+
|
|
411
|
+
return fakerKeywordMapper.datetime()
|
|
412
|
+
},
|
|
413
|
+
date(tree, options) {
|
|
414
|
+
const { current } = tree
|
|
415
|
+
if (!isKeyword(current, schemaKeywords.date)) return undefined
|
|
416
|
+
|
|
417
|
+
return fakerKeywordMapper.date(current.args.type, options.dateParser)
|
|
418
|
+
},
|
|
419
|
+
time(tree, options) {
|
|
420
|
+
const { current } = tree
|
|
421
|
+
if (!isKeyword(current, schemaKeywords.time)) return undefined
|
|
422
|
+
|
|
423
|
+
return fakerKeywordMapper.time(current.args.type, options.dateParser)
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-BP20Parg.cjs","names":["transformers","schemaKeywords","schema","name","SchemaGenerator","value","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, SchemaKeywordBase, SchemaKeywordMapper, SchemaMapper } from '@kubb/plugin-oas'\nimport { isKeyword, SchemaGenerator, type SchemaTree, 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 function parse({ schema, current, parent, name, siblings }: SchemaTree, options: ParserOptions): string | null | undefined {\n const value = fakerKeywordMapper[current.keyword as keyof typeof fakerKeywordMapper]\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return fakerKeywordMapper.union(\n current.args.map((it) => parse({ schema, parent: current, name, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n return fakerKeywordMapper.and(\n current.args.map((it) => parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return fakerKeywordMapper.array(\n current.args.items\n .map((it) =>\n parse(\n { schema, parent: current, current: it, siblings },\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\n if (isKeyword(current, schemaKeywords.enum)) {\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\n if (isKeyword(current, schemaKeywords.ref)) {\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\n if (isKeyword(current, schemaKeywords.object)) {\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 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\n if (isKeyword(current, schemaKeywords.tuple)) {\n if (Array.isArray(current.args.items)) {\n return fakerKeywordMapper.tuple(\n current.args.items.map((it) => parse({ schema, parent: current, current: it, siblings }, { ...options, canOverride: false })).filter(Boolean),\n )\n }\n\n return parse({ schema, parent: current, current: current.args.items, siblings }, { ...options, canOverride: false })\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\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\n if (isKeyword(current, schemaKeywords.matches) && current.args) {\n return fakerKeywordMapper.matches(current.args, options.regexGenerator)\n }\n\n if (isKeyword(current, schemaKeywords.null) || isKeyword(current, schemaKeywords.undefined) || isKeyword(current, schemaKeywords.any)) {\n return value() || ''\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n if (siblings) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return fakerKeywordMapper.string(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.string()\n }\n\n if (isKeyword(current, schemaKeywords.number)) {\n if (siblings) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return fakerKeywordMapper.number(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.number()\n }\n\n if (isKeyword(current, schemaKeywords.integer)) {\n if (siblings) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return fakerKeywordMapper.integer(minSchema?.args, maxSchema?.args)\n }\n\n return fakerKeywordMapper.integer()\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return fakerKeywordMapper.datetime()\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return fakerKeywordMapper.date(current.args.type, options.dateParser)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return fakerKeywordMapper.time(current.args.type, options.dateParser)\n }\n\n if (current.keyword in fakerKeywordMapper && 'args' in current) {\n const value = fakerKeywordMapper[current.keyword as keyof typeof fakerKeywordMapper] as (typeof fakerKeywordMapper)['const']\n\n const options = JSON.stringify((current as SchemaKeywordBase<unknown>).args)\n\n return value(options)\n }\n\n if (current.keyword in fakerKeywordMapper) {\n return value()\n }\n\n return undefined\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,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