@kubb/plugin-faker 5.0.0-beta.3 → 5.0.0-beta.30
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/README.md +26 -5
- package/dist/{Faker-CdyPfOPg.d.ts → Faker-BaLJxPyl.d.ts} +2 -2
- package/dist/{Faker-fcQEB9i5.js → Faker-CXZVQQ7e.js} +36 -99
- package/dist/Faker-CXZVQQ7e.js.map +1 -0
- package/dist/{Faker-BgleOzVN.cjs → Faker-CkJccVKI.cjs} +35 -122
- package/dist/Faker-CkJccVKI.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{fakerGenerator-D7daHCh6.js → fakerGenerator-BvMBDgwp.js} +126 -32
- package/dist/fakerGenerator-BvMBDgwp.js.map +1 -0
- package/dist/fakerGenerator-DSvAJTq3.d.ts +15 -0
- package/dist/{fakerGenerator-VJEVzLjc.cjs → fakerGenerator-DhNV9xBw.cjs} +127 -33
- package/dist/fakerGenerator-DhNV9xBw.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +177 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +33 -12
- package/dist/index.js +178 -37
- package/dist/index.js.map +1 -1
- package/dist/{printerFaker-CJiwzoto.d.ts → printerFaker-Bhwq62d1.d.ts} +63 -26
- package/extension.yaml +817 -0
- package/package.json +8 -13
- package/src/components/Faker.tsx +44 -63
- package/src/generators/fakerGenerator.tsx +35 -35
- package/src/plugin.ts +23 -6
- package/src/printers/printerFaker.ts +80 -16
- package/src/resolvers/resolverFaker.ts +29 -37
- package/src/types.ts +36 -23
- package/src/utils.ts +6 -105
- package/dist/Faker-BgleOzVN.cjs.map +0 -1
- package/dist/Faker-fcQEB9i5.js.map +0 -1
- package/dist/fakerGenerator-C3Ho3BaI.d.ts +0 -9
- package/dist/fakerGenerator-D7daHCh6.js.map +0 -1
- package/dist/fakerGenerator-VJEVzLjc.cjs.map +0 -1
|
@@ -1,9 +1,53 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as resolveParamNameByLocation, i as localeToFakerImport, n as buildResponseUnionSchema, o as resolveTypeReference, r as canOverrideSchema, s as trimQuotes, t as Faker } from "./Faker-CXZVQQ7e.js";
|
|
3
3
|
import { ast, defineGenerator } from "@kubb/core";
|
|
4
4
|
import { pluginTsName } from "@kubb/plugin-ts";
|
|
5
|
-
import { File,
|
|
5
|
+
import { File, jsxRendererSync } from "@kubb/renderer-jsx";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "@kubb/renderer-jsx/jsx-runtime";
|
|
7
|
+
//#region ../../internals/utils/src/imports.ts
|
|
8
|
+
function escapeRegExp(value) {
|
|
9
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
10
|
+
}
|
|
11
|
+
function getImportNames(entry) {
|
|
12
|
+
return (Array.isArray(entry.name) ? entry.name : [entry.name]).map((name) => {
|
|
13
|
+
if (typeof name === "string") return name;
|
|
14
|
+
return name.name ?? name.propertyName;
|
|
15
|
+
}).filter((name) => Boolean(name));
|
|
16
|
+
}
|
|
17
|
+
function filterUsedImports(imports, text, skipImportNames = []) {
|
|
18
|
+
return imports.filter((entry) => {
|
|
19
|
+
return getImportNames(entry).some((name) => {
|
|
20
|
+
if (skipImportNames.includes(name)) return false;
|
|
21
|
+
return new RegExp(`\\b${escapeRegExp(name)}\\b(?=\\s*\\()`).test(text);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function aliasConflictingImports(imports, reservedNames) {
|
|
26
|
+
const reservedNameSet = new Set(reservedNames);
|
|
27
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
28
|
+
return {
|
|
29
|
+
imports: imports.map((entry) => {
|
|
30
|
+
const aliasedNames = (Array.isArray(entry.name) ? entry.name : [entry.name]).map((item) => {
|
|
31
|
+
if (typeof item !== "string" || !reservedNameSet.has(item)) return item;
|
|
32
|
+
const alias = `${item}Schema`;
|
|
33
|
+
aliases.set(item, alias);
|
|
34
|
+
return {
|
|
35
|
+
propertyName: item,
|
|
36
|
+
name: alias
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return aliasedNames.some((item) => typeof item === "object" && item.name) ? {
|
|
40
|
+
...entry,
|
|
41
|
+
name: aliasedNames
|
|
42
|
+
} : entry;
|
|
43
|
+
}),
|
|
44
|
+
aliases
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function rewriteAliasedImports(text, aliases) {
|
|
48
|
+
return Array.from(aliases).reduce((acc, [name, alias]) => acc.replace(new RegExp(`\\b${escapeRegExp(name)}\\b`, "g"), alias), text);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
7
51
|
//#region ../../internals/utils/src/object.ts
|
|
8
52
|
/**
|
|
9
53
|
* Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.
|
|
@@ -114,6 +158,22 @@ function parseEnumValue(value) {
|
|
|
114
158
|
if (typeof value === "string") return stringify(value);
|
|
115
159
|
return value;
|
|
116
160
|
}
|
|
161
|
+
/** Reads the discriminator literal off a variant, or `undefined` when it can't be determined. */
|
|
162
|
+
function getDiscriminatorValue(member, discriminatorPropertyName) {
|
|
163
|
+
const prop = ast.narrowSchema(member, "object")?.properties?.find((p) => p.name === discriminatorPropertyName);
|
|
164
|
+
const enumNode = prop ? ast.narrowSchema(prop.schema, "enum") : null;
|
|
165
|
+
return enumNode ? getEnumValues(enumNode)[0] : void 0;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Type expression for an object property's value, indexed off the parent `typeName`.
|
|
169
|
+
*
|
|
170
|
+
* In a union (`oneOf`), a key that only some branches declare turns a plain `NonNullable<T>[K]`
|
|
171
|
+
* into a TS2339 error, so union members guard the access. The breakdown is below.
|
|
172
|
+
*/
|
|
173
|
+
function indexedTypeName(typeName, propertyName, nestedInUnion) {
|
|
174
|
+
const key = JSON.stringify(propertyName);
|
|
175
|
+
return nestedInUnion ? `(NonNullable<${typeName}> & Record<${key}, unknown>)[${key}]` : `NonNullable<${typeName}>[${key}]`;
|
|
176
|
+
}
|
|
117
177
|
/**
|
|
118
178
|
* Creates a Faker printer that generates mock data generation code from schema nodes.
|
|
119
179
|
* Handles circular references gracefully by emitting memoizing getters for cyclic properties.
|
|
@@ -169,7 +229,20 @@ const printerFaker = ast.definePrinter((options) => {
|
|
|
169
229
|
return fakerKeywordMapper.enum(getEnumValues(node).map(parseEnumValue), this.options.typeName);
|
|
170
230
|
},
|
|
171
231
|
union(node) {
|
|
172
|
-
const
|
|
232
|
+
const { discriminatorPropertyName } = node;
|
|
233
|
+
const baseTypeName = this.options.typeName;
|
|
234
|
+
const items = (node.members ?? []).map((member) => {
|
|
235
|
+
const value = discriminatorPropertyName ? getDiscriminatorValue(member, discriminatorPropertyName) : void 0;
|
|
236
|
+
if (baseTypeName && value !== void 0) return printNested(member, {
|
|
237
|
+
typeName: `Extract<NonNullable<${baseTypeName}>, { ${JSON.stringify(discriminatorPropertyName)}: ${parseEnumValue(value)} }>`,
|
|
238
|
+
nestedInObject: true
|
|
239
|
+
});
|
|
240
|
+
return printNested(member, {
|
|
241
|
+
typeName: baseTypeName,
|
|
242
|
+
nestedInObject: true,
|
|
243
|
+
nestedInUnion: true
|
|
244
|
+
});
|
|
245
|
+
}).filter((item) => Boolean(item));
|
|
173
246
|
return fakerKeywordMapper.union(items);
|
|
174
247
|
},
|
|
175
248
|
intersection(node) {
|
|
@@ -195,7 +268,7 @@ const printerFaker = ast.definePrinter((options) => {
|
|
|
195
268
|
return `{${(node.properties ?? []).map((property) => {
|
|
196
269
|
if (this.options.mapper && Object.hasOwn(this.options.mapper, property.name)) return `"${property.name}": ${this.options.mapper[property.name]}`;
|
|
197
270
|
const value = printNested(property.schema, {
|
|
198
|
-
typeName: this.options.typeName ?
|
|
271
|
+
typeName: this.options.typeName ? indexedTypeName(this.options.typeName, property.name, this.options.nestedInUnion) : void 0,
|
|
199
272
|
nestedInObject: true
|
|
200
273
|
}) ?? "undefined";
|
|
201
274
|
if (cyclicSchemas && ast.containsCircularRef(property.schema, {
|
|
@@ -214,17 +287,22 @@ const printerFaker = ast.definePrinter((options) => {
|
|
|
214
287
|
});
|
|
215
288
|
//#endregion
|
|
216
289
|
//#region src/generators/fakerGenerator.tsx
|
|
290
|
+
/**
|
|
291
|
+
* Built-in generator for `@kubb/plugin-faker`. Emits one `createX` factory
|
|
292
|
+
* per schema in the spec plus per-operation request/response factories. Each
|
|
293
|
+
* factory returns a value matching the corresponding TypeScript type from
|
|
294
|
+
* `@kubb/plugin-ts`.
|
|
295
|
+
*/
|
|
217
296
|
const fakerGenerator = defineGenerator({
|
|
218
297
|
name: "faker",
|
|
219
|
-
renderer:
|
|
298
|
+
renderer: jsxRendererSync,
|
|
220
299
|
schema(node, ctx) {
|
|
221
300
|
const { adapter, config, resolver, root } = ctx;
|
|
222
301
|
const { output, group, dateParser, regexGenerator, mapper, seed, locale, printer } = ctx.options;
|
|
223
302
|
const pluginTs = ctx.driver.getPlugin(pluginTsName);
|
|
224
|
-
if (!node.name || !pluginTs
|
|
303
|
+
if (!node.name || !pluginTs) return;
|
|
225
304
|
const tsResolver = ctx.driver.getResolver(pluginTsName);
|
|
226
|
-
const
|
|
227
|
-
const schemaName = schemaNode.name ?? node.name;
|
|
305
|
+
const schemaName = node.name;
|
|
228
306
|
const mode = ctx.getMode(output);
|
|
229
307
|
const meta = {
|
|
230
308
|
name: resolver.resolveName(schemaName),
|
|
@@ -234,7 +312,7 @@ const fakerGenerator = defineGenerator({
|
|
|
234
312
|
}, {
|
|
235
313
|
root,
|
|
236
314
|
output,
|
|
237
|
-
group
|
|
315
|
+
group: group ?? void 0
|
|
238
316
|
}),
|
|
239
317
|
typeName: tsResolver.resolveTypeName(schemaName),
|
|
240
318
|
typeFile: tsResolver.resolveFile({
|
|
@@ -243,11 +321,11 @@ const fakerGenerator = defineGenerator({
|
|
|
243
321
|
}, {
|
|
244
322
|
root,
|
|
245
323
|
output: pluginTs.options?.output ?? output,
|
|
246
|
-
group: pluginTs.options?.group
|
|
324
|
+
group: pluginTs.options?.group ?? void 0
|
|
247
325
|
})
|
|
248
326
|
};
|
|
249
|
-
const canOverride = canOverrideSchema(
|
|
250
|
-
const cyclicSchemas =
|
|
327
|
+
const canOverride = canOverrideSchema(node);
|
|
328
|
+
const cyclicSchemas = new Set(ctx.meta.circularNames);
|
|
251
329
|
const printerInstance = printerFaker({
|
|
252
330
|
resolver,
|
|
253
331
|
schemaName,
|
|
@@ -258,16 +336,16 @@ const fakerGenerator = defineGenerator({
|
|
|
258
336
|
nodes: printer?.nodes,
|
|
259
337
|
cyclicSchemas
|
|
260
338
|
});
|
|
261
|
-
const fakerText = printerInstance.print(
|
|
339
|
+
const fakerText = printerInstance.print(node) ?? "undefined";
|
|
262
340
|
const typeReference = resolveTypeReference({
|
|
263
|
-
node
|
|
341
|
+
node,
|
|
264
342
|
canOverride,
|
|
265
343
|
name: meta.name,
|
|
266
344
|
typeName: meta.typeName,
|
|
267
345
|
filePath: meta.file.path,
|
|
268
346
|
typeFilePath: meta.typeFile.path
|
|
269
347
|
});
|
|
270
|
-
const usedImports = filterUsedImports(adapter.getImports(
|
|
348
|
+
const usedImports = filterUsedImports(adapter.getImports(node, (schemaName) => ({
|
|
271
349
|
name: resolver.resolveName(schemaName),
|
|
272
350
|
path: resolver.resolveFile({
|
|
273
351
|
name: schemaName,
|
|
@@ -275,20 +353,28 @@ const fakerGenerator = defineGenerator({
|
|
|
275
353
|
}, {
|
|
276
354
|
root,
|
|
277
355
|
output,
|
|
278
|
-
group
|
|
356
|
+
group: group ?? void 0
|
|
279
357
|
}).path
|
|
280
358
|
})).filter((entry) => entry.path !== meta.file.path), fakerText);
|
|
281
359
|
return /* @__PURE__ */ jsxs(File, {
|
|
282
360
|
baseName: meta.file.baseName,
|
|
283
361
|
path: meta.file.path,
|
|
284
362
|
meta: meta.file.meta,
|
|
285
|
-
banner: resolver.resolveBanner(
|
|
363
|
+
banner: resolver.resolveBanner(ctx.meta, {
|
|
286
364
|
output,
|
|
287
|
-
config
|
|
365
|
+
config,
|
|
366
|
+
file: {
|
|
367
|
+
path: meta.file.path,
|
|
368
|
+
baseName: meta.file.baseName
|
|
369
|
+
}
|
|
288
370
|
}),
|
|
289
|
-
footer: resolver.resolveFooter(
|
|
371
|
+
footer: resolver.resolveFooter(ctx.meta, {
|
|
290
372
|
output,
|
|
291
|
-
config
|
|
373
|
+
config,
|
|
374
|
+
file: {
|
|
375
|
+
path: meta.file.path,
|
|
376
|
+
baseName: meta.file.baseName
|
|
377
|
+
}
|
|
292
378
|
}),
|
|
293
379
|
children: [
|
|
294
380
|
/* @__PURE__ */ jsx(File.Import, {
|
|
@@ -324,8 +410,8 @@ const fakerGenerator = defineGenerator({
|
|
|
324
410
|
/* @__PURE__ */ jsx(Faker, {
|
|
325
411
|
name: meta.name,
|
|
326
412
|
typeName: typeReference.typeName,
|
|
327
|
-
description:
|
|
328
|
-
node
|
|
413
|
+
description: node.description,
|
|
414
|
+
node,
|
|
329
415
|
printer: printerInstance,
|
|
330
416
|
seed,
|
|
331
417
|
canOverride
|
|
@@ -365,6 +451,7 @@ const fakerGenerator = defineGenerator({
|
|
|
365
451
|
...dataEntry ? [dataEntry.name] : [],
|
|
366
452
|
responseName
|
|
367
453
|
]);
|
|
454
|
+
const cyclicSchemas = new Set(ctx.meta.circularNames);
|
|
368
455
|
const meta = {
|
|
369
456
|
file: resolver.resolveFile({
|
|
370
457
|
name: node.operationId,
|
|
@@ -374,7 +461,7 @@ const fakerGenerator = defineGenerator({
|
|
|
374
461
|
}, {
|
|
375
462
|
root,
|
|
376
463
|
output,
|
|
377
|
-
group
|
|
464
|
+
group: group ?? void 0
|
|
378
465
|
}),
|
|
379
466
|
typeFile: tsResolver.resolveFile({
|
|
380
467
|
name: node.operationId,
|
|
@@ -384,7 +471,7 @@ const fakerGenerator = defineGenerator({
|
|
|
384
471
|
}, {
|
|
385
472
|
root,
|
|
386
473
|
output: pluginTs.options?.output ?? output,
|
|
387
|
-
group: pluginTs.options?.group
|
|
474
|
+
group: pluginTs.options?.group ?? void 0
|
|
388
475
|
})
|
|
389
476
|
};
|
|
390
477
|
function resolveMockImports(schema) {
|
|
@@ -396,14 +483,13 @@ const fakerGenerator = defineGenerator({
|
|
|
396
483
|
}, {
|
|
397
484
|
root,
|
|
398
485
|
output,
|
|
399
|
-
group
|
|
486
|
+
group: group ?? void 0
|
|
400
487
|
}).path
|
|
401
488
|
})).filter((entry) => entry.path !== meta.file.path);
|
|
402
489
|
}
|
|
403
490
|
function renderEntry({ schema, name, typeName, description, skipImportNames = [] }) {
|
|
404
491
|
if (!schema) return null;
|
|
405
492
|
const canOverride = canOverrideSchema(schema);
|
|
406
|
-
const cyclicSchemas = adapter.inputNode ? ast.findCircularSchemas(adapter.inputNode.schemas) : void 0;
|
|
407
493
|
const printerInstance = printerFaker({
|
|
408
494
|
resolver,
|
|
409
495
|
schemaName: name,
|
|
@@ -459,13 +545,21 @@ const fakerGenerator = defineGenerator({
|
|
|
459
545
|
baseName: meta.file.baseName,
|
|
460
546
|
path: meta.file.path,
|
|
461
547
|
meta: meta.file.meta,
|
|
462
|
-
banner: resolver.resolveBanner(
|
|
548
|
+
banner: resolver.resolveBanner(ctx.meta, {
|
|
463
549
|
output,
|
|
464
|
-
config
|
|
550
|
+
config,
|
|
551
|
+
file: {
|
|
552
|
+
path: meta.file.path,
|
|
553
|
+
baseName: meta.file.baseName
|
|
554
|
+
}
|
|
465
555
|
}),
|
|
466
|
-
footer: resolver.resolveFooter(
|
|
556
|
+
footer: resolver.resolveFooter(ctx.meta, {
|
|
467
557
|
output,
|
|
468
|
-
config
|
|
558
|
+
config,
|
|
559
|
+
file: {
|
|
560
|
+
path: meta.file.path,
|
|
561
|
+
baseName: meta.file.baseName
|
|
562
|
+
}
|
|
469
563
|
}),
|
|
470
564
|
children: [
|
|
471
565
|
/* @__PURE__ */ jsx(File.Import, {
|
|
@@ -489,7 +583,7 @@ const fakerGenerator = defineGenerator({
|
|
|
489
583
|
typeName
|
|
490
584
|
})),
|
|
491
585
|
responseEntries.map(({ response, name, typeName }) => renderEntry({
|
|
492
|
-
schema: response.schema,
|
|
586
|
+
schema: response.content?.[0]?.schema ?? null,
|
|
493
587
|
name,
|
|
494
588
|
typeName,
|
|
495
589
|
description: response.description
|
|
@@ -513,4 +607,4 @@ const fakerGenerator = defineGenerator({
|
|
|
513
607
|
//#endregion
|
|
514
608
|
export { printerFaker as n, fakerGenerator as t };
|
|
515
609
|
|
|
516
|
-
//# sourceMappingURL=fakerGenerator-
|
|
610
|
+
//# sourceMappingURL=fakerGenerator-BvMBDgwp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fakerGenerator-BvMBDgwp.js","names":[],"sources":["../../../internals/utils/src/imports.ts","../../../internals/utils/src/object.ts","../../../internals/utils/src/regexp.ts","../src/printers/printerFaker.ts","../src/generators/fakerGenerator.tsx"],"sourcesContent":["export type ImportName = string | { propertyName: string; name?: string }\n\nexport type ImportEntry = {\n name: string | Array<ImportName>\n path: string\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\nfunction getImportNames(entry: ImportEntry): Array<string> {\n return (Array.isArray(entry.name) ? entry.name : [entry.name])\n .map((name) => {\n if (typeof name === 'string') {\n return name\n }\n\n return name.name ?? name.propertyName\n })\n .filter((name): name is string => Boolean(name))\n}\n\nexport function filterUsedImports(imports: Array<ImportEntry>, text: string, skipImportNames: Array<string> = []): Array<ImportEntry> {\n return imports.filter((entry) => {\n const names = getImportNames(entry)\n\n return names.some((name) => {\n if (skipImportNames.includes(name)) {\n return false\n }\n\n return new RegExp(`\\\\b${escapeRegExp(name)}\\\\b(?=\\\\s*\\\\()`).test(text)\n })\n })\n}\n\nexport function aliasConflictingImports(\n imports: Array<ImportEntry>,\n reservedNames: Iterable<string>,\n): { imports: Array<ImportEntry>; aliases: Map<string, string> } {\n const reservedNameSet = new Set(reservedNames)\n const aliases = new Map<string, string>()\n\n const aliasedImports = imports.map((entry) => {\n const names = Array.isArray(entry.name) ? entry.name : [entry.name]\n const aliasedNames = names.map((item): ImportName => {\n if (typeof item !== 'string' || !reservedNameSet.has(item)) {\n return item\n }\n\n const alias = `${item}Schema`\n aliases.set(item, alias)\n\n return { propertyName: item, name: alias }\n })\n\n return aliasedNames.some((item) => typeof item === 'object' && item.name)\n ? {\n ...entry,\n name: aliasedNames,\n }\n : entry\n })\n\n return {\n imports: aliasedImports,\n aliases,\n }\n}\n\nexport function rewriteAliasedImports(text: string, aliases: ReadonlyMap<string, string>): string {\n return Array.from(aliases).reduce((acc, [name, alias]) => acc.replace(new RegExp(`\\\\b${escapeRegExp(name)}\\\\b`, 'g'), alias), text)\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | null {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Converts a pattern string into a `new RegExp(...)` constructor call or a regex literal string.\n * Inline flags expressed as `^(?im)` prefixes are extracted and applied to the resulting expression.\n * Pass `null` as the second argument to emit a `/pattern/flags` literal instead.\n *\n * @example\n * toRegExpString('^(?im)foo') // → 'new RegExp(\"foo\", \"im\")'\n * toRegExpString('^(?im)foo', null) // → '/foo/im'\n */\nexport function toRegExpString(text: string, func: string | null = 'RegExp'): string {\n const raw = trimQuotes(text)\n\n const match = raw.match(/^\\^(\\(\\?([igmsuy]+)\\))/i)\n const replacementTarget = match?.[1] ?? ''\n const matchedFlags = match?.[2]\n const cleaned = raw\n .replace(/^\\\\?\\//, '')\n .replace(/\\\\?\\/$/, '')\n .replace(replacementTarget, '')\n\n const { source, flags } = new RegExp(cleaned, matchedFlags)\n\n if (func === null) return `/${source}/${flags}`\n\n return `new ${func}(${JSON.stringify(source)}${flags ? `, ${JSON.stringify(flags)}` : ''})`\n}\n","import { stringify, toRegExpString } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport type { PluginFaker, ResolverFaker } from '../types.ts'\n\n/**\n * Partial map of node-type overrides for the Faker printer. Each key is a\n * `SchemaType` (`'string'`, `'date'`, ...) and each handler returns the\n * Faker expression for that schema as a string. Use `this.transform` to\n * recurse into nested schema nodes and `this.options` to read printer options.\n *\n * @example Override the integer handler\n * ```ts\n * pluginFaker({\n * printer: {\n * nodes: {\n * integer() {\n * return 'faker.number.float()'\n * },\n * },\n * },\n * })\n * ```\n */\nexport type PrinterFakerNodes = ast.PrinterPartial<string, PrinterFakerOptions>\n\n/**\n * Options passed to the Faker printer at instantiation: the parser library\n * for date strings, the regex generator, the user-supplied schema-name\n * mapper, and the resolver used to compute identifiers.\n */\nexport type PrinterFakerOptions = {\n dateParser?: PluginFaker['resolvedOptions']['dateParser']\n regexGenerator?: PluginFaker['resolvedOptions']['regexGenerator']\n mapper?: PluginFaker['resolvedOptions']['mapper']\n resolver: ResolverFaker\n typeName?: string\n schemaName?: string\n nestedInObject?: boolean\n /**\n * Set while printing the members of a union (`oneOf`). Object properties then index their\n * type as `(NonNullable<T> & Record<K, unknown>)[K]` instead of `NonNullable<T>[K]`, so a key\n * carried by only some branches stays valid (a plain index would be a TS2339).\n */\n nestedInUnion?: boolean\n nodes?: PrinterFakerNodes\n /**\n * Names of schemas that participate in a circular dependency chain.\n * Properties whose schema transitively references one of these are emitted\n * as lazy getters so that user overrides via the `data` parameter prevent\n * the recursive faker call from ever executing (avoiding stack overflow).\n */\n cyclicSchemas?: ReadonlySet<string>\n}\n\n/**\n * Factory options for the Faker printer, defining input/output types and configuration.\n */\nexport type PrinterFakerFactory = ast.PrinterFactoryOptions<'faker', PrinterFakerOptions, string, string>\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 bigint: () => 'faker.number.bigInt()',\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 null: () => 'null',\n array: (items: Array<string> = [], min?: number, max?: number) => {\n if (items.length > 1) {\n return `faker.helpers.arrayElements([${items.join(', ')}])`\n }\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\n if (min !== undefined) {\n return `faker.helpers.multiple(() => (${item}), { count: ${min} })`\n }\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: Array<string> = []) => `[${items.join(', ')}]`,\n enum: (items: Array<string | number | boolean | undefined> = [], type = 'any') => `faker.helpers.arrayElement<${type}>([${items.join(', ')}])`,\n union: (items: Array<string> = []) => `faker.helpers.arrayElement<any>([${items.join(', ')}])`,\n datetime: () => 'faker.date.anytime().toISOString()',\n date: (representation: 'date' | 'string' = 'string', parser: PluginFaker['resolvedOptions']['dateParser'] = 'faker') => {\n if (representation === 'string') {\n if (parser !== 'faker') {\n return `${parser}(faker.date.anytime()).format(\"YYYY-MM-DD\")`\n }\n\n return 'faker.date.anytime().toISOString().substring(0, 10)'\n }\n\n if (parser !== 'faker') {\n throw new Error(`type '${representation}' and parser '${parser}' can not work together`)\n }\n\n return 'faker.date.anytime()'\n },\n time: (representation: 'date' | 'string' = 'string', parser: PluginFaker['resolvedOptions']['dateParser'] = 'faker') => {\n if (representation === 'string') {\n if (parser !== 'faker') {\n return `${parser}(faker.date.anytime()).format(\"HH:mm:ss\")`\n }\n\n return 'faker.date.anytime().toISOString().substring(11, 19)'\n }\n\n if (parser !== 'faker') {\n throw new Error(`type '${representation}' 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: Array<string> = []) => {\n if (items.length === 0) {\n return '{}'\n }\n\n if (items.length === 1) {\n return items[0] ?? '{}'\n }\n\n return `{...${items.join(', ...')}}`\n },\n matches: (value = '', regexGenerator: 'faker' | 'randexp' = 'faker') => {\n if (regexGenerator === 'randexp') {\n return `${toRegExpString(value, 'RandExp')}.gen()`\n }\n\n return `faker.helpers.fromRegExp(\"${value}\")`\n },\n email: () => 'faker.internet.email()',\n blob: () => 'faker.image.url() as unknown as Blob',\n} as const\n\nfunction getEnumValues(node: ast.EnumSchemaNode): Array<string | number | boolean | undefined> {\n if (node.namedEnumValues?.length) {\n return node.namedEnumValues.map((item) => item.value as string | number | boolean | undefined)\n }\n\n return (node.enumValues ?? []) as Array<string | number | boolean | undefined>\n}\n\nfunction parseEnumValue(value: string | number | boolean | undefined) {\n if (typeof value === 'string') {\n return stringify(value)\n }\n\n return value\n}\n\n/** Reads the discriminator literal off a variant, or `undefined` when it can't be determined. */\nfunction getDiscriminatorValue(member: ast.SchemaNode, discriminatorPropertyName: string) {\n const prop = ast.narrowSchema(member, 'object')?.properties?.find((p) => p.name === discriminatorPropertyName)\n const enumNode = prop ? ast.narrowSchema(prop.schema, 'enum') : null\n\n return enumNode ? getEnumValues(enumNode)[0] : undefined\n}\n\n/**\n * Type expression for an object property's value, indexed off the parent `typeName`.\n *\n * In a union (`oneOf`), a key that only some branches declare turns a plain `NonNullable<T>[K]`\n * into a TS2339 error, so union members guard the access. The breakdown is below.\n */\nfunction indexedTypeName(typeName: string, propertyName: string, nestedInUnion?: boolean): string {\n const key = JSON.stringify(propertyName)\n\n // `(NonNullable<T> & Record<K, unknown>)[K]`, read inside-out:\n // NonNullable<T> strips null and undefined from the parent type T.\n // & Record<K, unknown> forces every branch to have key K. A branch that already declares K\n // keeps it (`T[K] & unknown` is `T[K]`); a branch missing K gains it as `unknown`.\n // [K] reads the key, which is now always present, so it never hits TS2339.\n // For a single object T the intersection does nothing, leaving `T[K]`.\n return nestedInUnion ? `(NonNullable<${typeName}> & Record<${key}, unknown>)[${key}]` : `NonNullable<${typeName}>[${key}]`\n}\n\n/**\n * Creates a Faker printer that generates mock data generation code from schema nodes.\n * Handles circular references gracefully by emitting memoizing getters for cyclic properties.\n */\nexport const printerFaker: (options: PrinterFakerOptions) => ast.Printer<PrinterFakerFactory> = ast.definePrinter<PrinterFakerFactory>((options) => {\n const printNested = (node: ast.SchemaNode, overrideOptions: Partial<PrinterFakerOptions> = {}): string => {\n return (\n printerFaker({\n ...options,\n ...overrideOptions,\n nodes: options.nodes,\n }).print(node) ?? 'undefined'\n )\n }\n\n return {\n name: 'faker',\n options,\n nodes: {\n any: () => fakerKeywordMapper.any(),\n unknown: () => fakerKeywordMapper.unknown(),\n void: () => fakerKeywordMapper.void(),\n boolean: () => fakerKeywordMapper.boolean(),\n null: () => fakerKeywordMapper.null(),\n string(node) {\n if (node.pattern) {\n return fakerKeywordMapper.matches(node.pattern, this.options.regexGenerator)\n }\n\n return fakerKeywordMapper.string(node.min, node.max)\n },\n email: () => fakerKeywordMapper.email(),\n url: () => fakerKeywordMapper.url(),\n uuid: () => fakerKeywordMapper.uuid(),\n number(node) {\n return fakerKeywordMapper.number(node.min, node.max)\n },\n integer(node) {\n return fakerKeywordMapper.integer(node.min, node.max)\n },\n bigint: () => fakerKeywordMapper.bigint(),\n blob: () => fakerKeywordMapper.blob(),\n datetime: () => fakerKeywordMapper.datetime(),\n date(node) {\n return fakerKeywordMapper.date(node.representation ?? 'string', this.options.dateParser)\n },\n time(node) {\n return fakerKeywordMapper.time(node.representation ?? 'string', this.options.dateParser)\n },\n ref(node) {\n // Parser-generated refs (with $ref) carry raw schema names that need resolving.\n // Use the canonical name from the $ref path — node.name may have been overridden\n // (e.g. by single-member allOf flatten using the property-derived child name).\n // Inline refs (without $ref) from faker utils already carry resolved helper names.\n const refName = node.ref ? (ast.extractRefName(node.ref) ?? node.name ?? node.schema?.name) : (node.name ?? node.schema?.name)\n\n if (!refName) {\n throw new Error('Name not defined for ref node')\n }\n\n if (this.options.schemaName && refName === this.options.schemaName) {\n return 'undefined as any'\n }\n\n // Internal helper refs (for generated response/data helpers) are already\n // emitted with resolver output and should not be transformed twice.\n const resolvedName = node.ref ? this.options.resolver.resolveName(refName) : refName\n\n if (!this.options.nestedInObject) {\n return `${resolvedName}(data)`\n }\n\n return `${resolvedName}()`\n },\n enum(node) {\n return fakerKeywordMapper.enum(getEnumValues(node).map(parseEnumValue), this.options.typeName)\n },\n union(node): string {\n const { discriminatorPropertyName } = node\n const baseTypeName = this.options.typeName\n\n const items: Array<string> = (node.members ?? [])\n .map((member) => {\n // For a discriminated union, narrow each variant to its own branch so nested\n // `NonNullable<T>[K]` indexes resolve against that branch instead of the whole union.\n const value = discriminatorPropertyName ? getDiscriminatorValue(member, discriminatorPropertyName) : undefined\n\n if (baseTypeName && value !== undefined) {\n const typeName = `Extract<NonNullable<${baseTypeName}>, { ${JSON.stringify(discriminatorPropertyName)}: ${parseEnumValue(value)} }>`\n\n return printNested(member, { typeName, nestedInObject: true })\n }\n\n // Without a discriminator, keep the union type but guard each indexed access (see\n // `indexedTypeName`) so a key carried by only some branches resolves to `unknown`\n // rather than erroring with TS2339.\n return printNested(member, { typeName: baseTypeName, nestedInObject: true, nestedInUnion: true })\n })\n .filter((item): item is string => Boolean(item))\n\n return fakerKeywordMapper.union(items)\n },\n intersection(node): string {\n const items: Array<string> = (node.members ?? [])\n .map((member) =>\n printNested(member, {\n nestedInObject: true,\n }),\n )\n .filter((item): item is string => Boolean(item))\n\n return fakerKeywordMapper.and(items)\n },\n array(node): string {\n const items: Array<string> = (node.items ?? [])\n .map((member) =>\n printNested(member, {\n typeName: this.options.typeName ? `NonNullable<${this.options.typeName}>[number]` : undefined,\n nestedInObject: true,\n }),\n )\n .filter((item): item is string => Boolean(item))\n\n return fakerKeywordMapper.array(items, node.min, node.max)\n },\n tuple(node): string {\n const items: Array<string> = (node.items ?? [])\n .map((member, index) =>\n printNested(member, {\n typeName: this.options.typeName ? `NonNullable<${this.options.typeName}>[${index}]` : undefined,\n nestedInObject: true,\n }),\n )\n .filter((item): item is string => Boolean(item))\n\n return fakerKeywordMapper.tuple(items)\n },\n object(node): string {\n const cyclicSchemas = this.options.cyclicSchemas\n const properties = (node.properties ?? [])\n .map((property): string => {\n if (this.options.mapper && Object.hasOwn(this.options.mapper, property.name)) {\n return `\"${property.name}\": ${this.options.mapper[property.name]}`\n }\n\n const value: string =\n printNested(property.schema, {\n typeName: this.options.typeName ? indexedTypeName(this.options.typeName, property.name, this.options.nestedInUnion) : undefined,\n nestedInObject: true,\n }) ?? 'undefined'\n\n // When the property's schema transitively references a schema that is\n // part of a circular dependency (other than the current schema itself),\n // emit a memoizing lazy getter. On first access it computes the value,\n // replaces itself with a plain data property via Object.defineProperty,\n // and returns the cached value – so every subsequent read is stable.\n if (cyclicSchemas && ast.containsCircularRef(property.schema, { circularSchemas: cyclicSchemas, excludeName: this.options.schemaName })) {\n return `get ${property.name}() { const _value = ${value}; Object.defineProperty(this, ${JSON.stringify(property.name)}, { value: _value, configurable: true, writable: true, enumerable: true }); return _value }`\n }\n\n return `\"${property.name}\": ${value}`\n })\n .join(',')\n\n return `{${properties}}`\n },\n ...options.nodes,\n },\n print(node) {\n return this.transform(node) ?? null\n },\n }\n})\n","import { aliasConflictingImports, filterUsedImports, rewriteAliasedImports } from '@internals/utils'\nimport { ast, defineGenerator } from '@kubb/core'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, jsxRendererSync } from '@kubb/renderer-jsx'\nimport { Faker } from '../components/Faker.tsx'\nimport { printerFaker } from '../printers/printerFaker.ts'\nimport type { PluginFaker } from '../types.ts'\nimport { buildResponseUnionSchema, canOverrideSchema, localeToFakerImport, resolveParamNameByLocation, resolveTypeReference } from '../utils.ts'\n\n/**\n * Built-in generator for `@kubb/plugin-faker`. Emits one `createX` factory\n * per schema in the spec plus per-operation request/response factories. Each\n * factory returns a value matching the corresponding TypeScript type from\n * `@kubb/plugin-ts`.\n */\nexport const fakerGenerator = defineGenerator<PluginFaker>({\n name: 'faker',\n renderer: jsxRendererSync,\n schema(node, ctx) {\n const { adapter, config, resolver, root } = ctx\n const { output, group, dateParser, regexGenerator, mapper, seed, locale, printer } = ctx.options\n const pluginTs = ctx.driver.getPlugin(pluginTsName)\n\n if (!node.name || !pluginTs) {\n return\n }\n\n const tsResolver = ctx.driver.getResolver(pluginTsName)\n\n const schemaName = node.name\n const mode = ctx.getMode(output)\n const meta = {\n name: resolver.resolveName(schemaName),\n file: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group: group ?? undefined }),\n typeName: tsResolver.resolveTypeName(schemaName),\n typeFile: tsResolver.resolveFile(\n { name: schemaName, extname: '.ts' },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group ?? undefined },\n ),\n } as const\n const canOverride = canOverrideSchema(node)\n const cyclicSchemas = new Set<string>(ctx.meta.circularNames)\n const printerInstance = printerFaker({\n resolver,\n schemaName,\n typeName: meta.typeName,\n dateParser,\n regexGenerator,\n mapper,\n nodes: printer?.nodes,\n cyclicSchemas,\n })\n const fakerText = printerInstance.print(node) ?? 'undefined'\n const typeReference = resolveTypeReference({\n node,\n canOverride,\n name: meta.name,\n typeName: meta.typeName,\n filePath: meta.file.path,\n typeFilePath: meta.typeFile.path,\n })\n\n const imports = adapter\n .getImports(node, (schemaName) => ({\n name: resolver.resolveName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group: group ?? undefined }).path,\n }))\n .filter((entry) => entry.path !== meta.file.path)\n const usedImports = filterUsedImports(imports, fakerText)\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n <File.Import name={locale ? [{ propertyName: localeToFakerImport(locale), name: 'faker' }] : ['faker']} path=\"@faker-js/faker\" />\n {regexGenerator === 'randexp' && <File.Import name={'RandExp'} path={'randexp'} />}\n {dateParser !== 'faker' && <File.Import path={dateParser} name={dateParser} />}\n {typeReference.importPath && <File.Import isTypeOnly root={meta.file.path} path={typeReference.importPath} name={[meta.typeName]} />}\n {mode === 'split' &&\n usedImports.map((imp) => <File.Import key={[schemaName, imp.path, imp.name].join('-')} root={meta.file.path} path={imp.path} name={imp.name} />)}\n <Faker\n name={meta.name}\n typeName={typeReference.typeName}\n description={node.description}\n node={node}\n printer={printerInstance}\n seed={seed}\n canOverride={canOverride}\n />\n </File>\n )\n },\n operation(node, ctx) {\n const { adapter, config, resolver, root } = ctx\n const { output, group, paramsCasing, dateParser, regexGenerator, mapper, seed, locale, printer } = ctx.options\n const pluginTs = ctx.driver.getPlugin(pluginTsName)\n\n if (!pluginTs) {\n return\n }\n\n const tsResolver = ctx.driver.getResolver(pluginTsName)\n\n const params = ast.caseParams(node.parameters, paramsCasing)\n const paramEntries = params.map((param) => ({\n param,\n name: resolveParamNameByLocation(resolver, node, param),\n typeName: resolveParamNameByLocation(tsResolver, node, param),\n }))\n const responseEntries = node.responses.map((response) => ({\n response,\n name: resolver.resolveResponseStatusName(node, response.statusCode),\n typeName: tsResolver.resolveResponseStatusName(node, response.statusCode),\n }))\n const dataEntry = node.requestBody?.content?.[0]?.schema\n ? {\n schema: {\n ...node.requestBody.content![0]!.schema!,\n description: node.requestBody.description ?? node.requestBody.content![0]!.schema!.description,\n },\n name: resolver.resolveDataName(node),\n typeName: tsResolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.content![0]!.schema!.description,\n }\n : null\n const responseName = resolver.resolveResponseName(node)\n const localHelperNames = new Set([\n ...paramEntries.map((entry) => entry.name),\n ...responseEntries.map((entry) => entry.name),\n ...(dataEntry ? [dataEntry.name] : []),\n responseName,\n ])\n const cyclicSchemas = new Set<string>(ctx.meta.circularNames)\n\n const meta = {\n file: resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group: group ?? undefined },\n ),\n typeFile: tsResolver.resolveFile(\n {\n name: node.operationId,\n extname: '.ts',\n tag: node.tags[0] ?? 'default',\n path: node.path,\n },\n {\n root,\n output: pluginTs.options?.output ?? output,\n group: pluginTs.options?.group ?? undefined,\n },\n ),\n } as const\n\n function resolveMockImports(schema: ast.SchemaNode) {\n return adapter\n .getImports(schema, (schemaName) => ({\n name: resolver.resolveName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group: group ?? undefined }).path,\n }))\n .filter((entry) => entry.path !== meta.file.path)\n }\n\n function renderEntry({\n schema,\n name,\n typeName,\n description,\n skipImportNames = [],\n }: {\n schema: ast.SchemaNode | null\n name: string\n typeName: string\n description?: string\n skipImportNames?: Array<string>\n }) {\n if (!schema) {\n return null\n }\n\n const canOverride = canOverrideSchema(schema)\n const printerInstance = printerFaker({\n resolver,\n schemaName: name,\n typeName,\n dateParser,\n regexGenerator,\n mapper,\n nodes: printer?.nodes,\n cyclicSchemas,\n })\n const fakerText = printerInstance.print(schema) ?? 'undefined'\n const usedImports = filterUsedImports(resolveMockImports(schema), fakerText, skipImportNames)\n const { imports, aliases } = aliasConflictingImports(usedImports, localHelperNames)\n const rewrittenFakerText = rewriteAliasedImports(fakerText, aliases)\n const typeReference = resolveTypeReference({\n node: schema,\n canOverride,\n name,\n typeName,\n filePath: meta.file.path,\n typeFilePath: meta.typeFile.path,\n })\n\n return (\n <>\n {typeReference.importPath && <File.Import isTypeOnly root={meta.file.path} path={typeReference.importPath} name={[typeName]} />}\n {imports.map((imp) => (\n <File.Import key={[name, imp.path, imp.name].join('-')} root={meta.file.path} path={imp.path} name={imp.name} />\n ))}\n <Faker\n name={name}\n typeName={typeReference.typeName}\n description={description}\n node={schema}\n printer={{ ...printerInstance, print: () => rewrittenFakerText }}\n seed={seed}\n canOverride={canOverride}\n />\n </>\n )\n }\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n <File.Import name={locale ? [{ propertyName: localeToFakerImport(locale), name: 'faker' }] : ['faker']} path=\"@faker-js/faker\" />\n {regexGenerator === 'randexp' && <File.Import name={'RandExp'} path={'randexp'} />}\n {dateParser !== 'faker' && <File.Import path={dateParser} name={dateParser} />}\n {paramEntries.map(({ param, name, typeName }) =>\n renderEntry({\n schema: param.schema,\n name,\n typeName,\n }),\n )}\n {responseEntries.map(({ response, name, typeName }) =>\n renderEntry({\n schema: response.content?.[0]?.schema ?? null,\n name,\n typeName,\n description: response.description,\n }),\n )}\n {dataEntry\n ? renderEntry({\n schema: dataEntry.schema,\n name: dataEntry.name,\n typeName: dataEntry.typeName,\n description: dataEntry.description,\n })\n : null}\n {renderEntry({\n schema: buildResponseUnionSchema(node, resolver),\n name: responseName,\n typeName: tsResolver.resolveResponseName(node),\n skipImportNames: responseEntries.map(({ name }) => name),\n })}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;AAOA,SAAS,aAAa,OAAuB;CAC3C,OAAO,MAAM,QAAQ,uBAAuB,OAAO;;AAGrD,SAAS,eAAe,OAAmC;CACzD,QAAQ,MAAM,QAAQ,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,MAAM,KAAK,EAC1D,KAAK,SAAS;EACb,IAAI,OAAO,SAAS,UAClB,OAAO;EAGT,OAAO,KAAK,QAAQ,KAAK;GACzB,CACD,QAAQ,SAAyB,QAAQ,KAAK,CAAC;;AAGpD,SAAgB,kBAAkB,SAA6B,MAAc,kBAAiC,EAAE,EAAsB;CACpI,OAAO,QAAQ,QAAQ,UAAU;EAG/B,OAFc,eAAe,MAEjB,CAAC,MAAM,SAAS;GAC1B,IAAI,gBAAgB,S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B,OAAO;MAAE,MAAM;MAAS,CAAC,GAAG,CAAC,QAAQ;KAAE,MAAK;KAAoB,CAAA;IAChI,mBAAmB,aAAa,oBAAC,KAAK,QAAN;KAAa,MAAM;KAAW,MAAM;KAAa,CAAA;IACjF,eAAe,WAAW,oBAAC,KAAK,QAAN;KAAa,MAAM;KAAY,MAAM;KAAc,CAAA;IAC7E,aAAa,KAAK,EAAE,OAAO,MAAM,eAChC,YAAY;KACV,QAAQ,MAAM;KACd;KACA;KACD,CAAC,CACH;IACA,gBAAgB,KAAK,EAAE,UAAU,MAAM,eACtC,YAAY;KACV,QAAQ,SAAS,UAAU,IAAI,UAAU;KACzC;KACA;KACA,aAAa,SAAS;KACvB,CAAC,CACH;IACA,YACG,YAAY;KACV,QAAQ,UAAU;KAClB,MAAM,UAAU;KAChB,UAAU,UAAU;KACpB,aAAa,UAAU;KACxB,CAAC,GACF;IACH,YAAY;KACX,QAAQ,yBAAyB,MAAM,SAAS;KAChD,MAAM;KACN,UAAU,WAAW,oBAAoB,KAAK;KAC9C,iBAAiB,gBAAgB,KAAK,EAAE,WAAW,KAAK;KACzD,CAAC;IACG;;;CAGZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
+
import { o as PluginFaker } from "./printerFaker-Bhwq62d1.js";
|
|
3
|
+
import * as _$_kubb_core0 from "@kubb/core";
|
|
4
|
+
|
|
5
|
+
//#region src/generators/fakerGenerator.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Built-in generator for `@kubb/plugin-faker`. Emits one `createX` factory
|
|
8
|
+
* per schema in the spec plus per-operation request/response factories. Each
|
|
9
|
+
* factory returns a value matching the corresponding TypeScript type from
|
|
10
|
+
* `@kubb/plugin-ts`.
|
|
11
|
+
*/
|
|
12
|
+
declare const fakerGenerator: _$_kubb_core0.Generator<PluginFaker, unknown>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { fakerGenerator as t };
|
|
15
|
+
//# sourceMappingURL=fakerGenerator-DSvAJTq3.d.ts.map
|