@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,8 +1,52 @@
|
|
|
1
|
-
const require_Faker = require("./Faker-
|
|
1
|
+
const require_Faker = require("./Faker-CkJccVKI.cjs");
|
|
2
2
|
let _kubb_core = require("@kubb/core");
|
|
3
3
|
let _kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
4
4
|
let _kubb_renderer_jsx = require("@kubb/renderer-jsx");
|
|
5
5
|
let _kubb_renderer_jsx_jsx_runtime = require("@kubb/renderer-jsx/jsx-runtime");
|
|
6
|
+
//#region ../../internals/utils/src/imports.ts
|
|
7
|
+
function escapeRegExp(value) {
|
|
8
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9
|
+
}
|
|
10
|
+
function getImportNames(entry) {
|
|
11
|
+
return (Array.isArray(entry.name) ? entry.name : [entry.name]).map((name) => {
|
|
12
|
+
if (typeof name === "string") return name;
|
|
13
|
+
return name.name ?? name.propertyName;
|
|
14
|
+
}).filter((name) => Boolean(name));
|
|
15
|
+
}
|
|
16
|
+
function filterUsedImports(imports, text, skipImportNames = []) {
|
|
17
|
+
return imports.filter((entry) => {
|
|
18
|
+
return getImportNames(entry).some((name) => {
|
|
19
|
+
if (skipImportNames.includes(name)) return false;
|
|
20
|
+
return new RegExp(`\\b${escapeRegExp(name)}\\b(?=\\s*\\()`).test(text);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function aliasConflictingImports(imports, reservedNames) {
|
|
25
|
+
const reservedNameSet = new Set(reservedNames);
|
|
26
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
27
|
+
return {
|
|
28
|
+
imports: imports.map((entry) => {
|
|
29
|
+
const aliasedNames = (Array.isArray(entry.name) ? entry.name : [entry.name]).map((item) => {
|
|
30
|
+
if (typeof item !== "string" || !reservedNameSet.has(item)) return item;
|
|
31
|
+
const alias = `${item}Schema`;
|
|
32
|
+
aliases.set(item, alias);
|
|
33
|
+
return {
|
|
34
|
+
propertyName: item,
|
|
35
|
+
name: alias
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return aliasedNames.some((item) => typeof item === "object" && item.name) ? {
|
|
39
|
+
...entry,
|
|
40
|
+
name: aliasedNames
|
|
41
|
+
} : entry;
|
|
42
|
+
}),
|
|
43
|
+
aliases
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function rewriteAliasedImports(text, aliases) {
|
|
47
|
+
return Array.from(aliases).reduce((acc, [name, alias]) => acc.replace(new RegExp(`\\b${escapeRegExp(name)}\\b`, "g"), alias), text);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
6
50
|
//#region ../../internals/utils/src/object.ts
|
|
7
51
|
/**
|
|
8
52
|
* Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.
|
|
@@ -113,6 +157,22 @@ function parseEnumValue(value) {
|
|
|
113
157
|
if (typeof value === "string") return stringify(value);
|
|
114
158
|
return value;
|
|
115
159
|
}
|
|
160
|
+
/** Reads the discriminator literal off a variant, or `undefined` when it can't be determined. */
|
|
161
|
+
function getDiscriminatorValue(member, discriminatorPropertyName) {
|
|
162
|
+
const prop = _kubb_core.ast.narrowSchema(member, "object")?.properties?.find((p) => p.name === discriminatorPropertyName);
|
|
163
|
+
const enumNode = prop ? _kubb_core.ast.narrowSchema(prop.schema, "enum") : null;
|
|
164
|
+
return enumNode ? getEnumValues(enumNode)[0] : void 0;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Type expression for an object property's value, indexed off the parent `typeName`.
|
|
168
|
+
*
|
|
169
|
+
* In a union (`oneOf`), a key that only some branches declare turns a plain `NonNullable<T>[K]`
|
|
170
|
+
* into a TS2339 error, so union members guard the access. The breakdown is below.
|
|
171
|
+
*/
|
|
172
|
+
function indexedTypeName(typeName, propertyName, nestedInUnion) {
|
|
173
|
+
const key = JSON.stringify(propertyName);
|
|
174
|
+
return nestedInUnion ? `(NonNullable<${typeName}> & Record<${key}, unknown>)[${key}]` : `NonNullable<${typeName}>[${key}]`;
|
|
175
|
+
}
|
|
116
176
|
/**
|
|
117
177
|
* Creates a Faker printer that generates mock data generation code from schema nodes.
|
|
118
178
|
* Handles circular references gracefully by emitting memoizing getters for cyclic properties.
|
|
@@ -168,7 +228,20 @@ const printerFaker = _kubb_core.ast.definePrinter((options) => {
|
|
|
168
228
|
return fakerKeywordMapper.enum(getEnumValues(node).map(parseEnumValue), this.options.typeName);
|
|
169
229
|
},
|
|
170
230
|
union(node) {
|
|
171
|
-
const
|
|
231
|
+
const { discriminatorPropertyName } = node;
|
|
232
|
+
const baseTypeName = this.options.typeName;
|
|
233
|
+
const items = (node.members ?? []).map((member) => {
|
|
234
|
+
const value = discriminatorPropertyName ? getDiscriminatorValue(member, discriminatorPropertyName) : void 0;
|
|
235
|
+
if (baseTypeName && value !== void 0) return printNested(member, {
|
|
236
|
+
typeName: `Extract<NonNullable<${baseTypeName}>, { ${JSON.stringify(discriminatorPropertyName)}: ${parseEnumValue(value)} }>`,
|
|
237
|
+
nestedInObject: true
|
|
238
|
+
});
|
|
239
|
+
return printNested(member, {
|
|
240
|
+
typeName: baseTypeName,
|
|
241
|
+
nestedInObject: true,
|
|
242
|
+
nestedInUnion: true
|
|
243
|
+
});
|
|
244
|
+
}).filter((item) => Boolean(item));
|
|
172
245
|
return fakerKeywordMapper.union(items);
|
|
173
246
|
},
|
|
174
247
|
intersection(node) {
|
|
@@ -194,7 +267,7 @@ const printerFaker = _kubb_core.ast.definePrinter((options) => {
|
|
|
194
267
|
return `{${(node.properties ?? []).map((property) => {
|
|
195
268
|
if (this.options.mapper && Object.hasOwn(this.options.mapper, property.name)) return `"${property.name}": ${this.options.mapper[property.name]}`;
|
|
196
269
|
const value = printNested(property.schema, {
|
|
197
|
-
typeName: this.options.typeName ?
|
|
270
|
+
typeName: this.options.typeName ? indexedTypeName(this.options.typeName, property.name, this.options.nestedInUnion) : void 0,
|
|
198
271
|
nestedInObject: true
|
|
199
272
|
}) ?? "undefined";
|
|
200
273
|
if (cyclicSchemas && _kubb_core.ast.containsCircularRef(property.schema, {
|
|
@@ -213,17 +286,22 @@ const printerFaker = _kubb_core.ast.definePrinter((options) => {
|
|
|
213
286
|
});
|
|
214
287
|
//#endregion
|
|
215
288
|
//#region src/generators/fakerGenerator.tsx
|
|
289
|
+
/**
|
|
290
|
+
* Built-in generator for `@kubb/plugin-faker`. Emits one `createX` factory
|
|
291
|
+
* per schema in the spec plus per-operation request/response factories. Each
|
|
292
|
+
* factory returns a value matching the corresponding TypeScript type from
|
|
293
|
+
* `@kubb/plugin-ts`.
|
|
294
|
+
*/
|
|
216
295
|
const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
217
296
|
name: "faker",
|
|
218
|
-
renderer: _kubb_renderer_jsx.
|
|
297
|
+
renderer: _kubb_renderer_jsx.jsxRendererSync,
|
|
219
298
|
schema(node, ctx) {
|
|
220
299
|
const { adapter, config, resolver, root } = ctx;
|
|
221
300
|
const { output, group, dateParser, regexGenerator, mapper, seed, locale, printer } = ctx.options;
|
|
222
301
|
const pluginTs = ctx.driver.getPlugin(_kubb_plugin_ts.pluginTsName);
|
|
223
|
-
if (!node.name || !pluginTs
|
|
302
|
+
if (!node.name || !pluginTs) return;
|
|
224
303
|
const tsResolver = ctx.driver.getResolver(_kubb_plugin_ts.pluginTsName);
|
|
225
|
-
const
|
|
226
|
-
const schemaName = schemaNode.name ?? node.name;
|
|
304
|
+
const schemaName = node.name;
|
|
227
305
|
const mode = ctx.getMode(output);
|
|
228
306
|
const meta = {
|
|
229
307
|
name: resolver.resolveName(schemaName),
|
|
@@ -233,7 +311,7 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
233
311
|
}, {
|
|
234
312
|
root,
|
|
235
313
|
output,
|
|
236
|
-
group
|
|
314
|
+
group: group ?? void 0
|
|
237
315
|
}),
|
|
238
316
|
typeName: tsResolver.resolveTypeName(schemaName),
|
|
239
317
|
typeFile: tsResolver.resolveFile({
|
|
@@ -242,11 +320,11 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
242
320
|
}, {
|
|
243
321
|
root,
|
|
244
322
|
output: pluginTs.options?.output ?? output,
|
|
245
|
-
group: pluginTs.options?.group
|
|
323
|
+
group: pluginTs.options?.group ?? void 0
|
|
246
324
|
})
|
|
247
325
|
};
|
|
248
|
-
const canOverride = require_Faker.canOverrideSchema(
|
|
249
|
-
const cyclicSchemas =
|
|
326
|
+
const canOverride = require_Faker.canOverrideSchema(node);
|
|
327
|
+
const cyclicSchemas = new Set(ctx.meta.circularNames);
|
|
250
328
|
const printerInstance = printerFaker({
|
|
251
329
|
resolver,
|
|
252
330
|
schemaName,
|
|
@@ -257,16 +335,16 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
257
335
|
nodes: printer?.nodes,
|
|
258
336
|
cyclicSchemas
|
|
259
337
|
});
|
|
260
|
-
const fakerText = printerInstance.print(
|
|
338
|
+
const fakerText = printerInstance.print(node) ?? "undefined";
|
|
261
339
|
const typeReference = require_Faker.resolveTypeReference({
|
|
262
|
-
node
|
|
340
|
+
node,
|
|
263
341
|
canOverride,
|
|
264
342
|
name: meta.name,
|
|
265
343
|
typeName: meta.typeName,
|
|
266
344
|
filePath: meta.file.path,
|
|
267
345
|
typeFilePath: meta.typeFile.path
|
|
268
346
|
});
|
|
269
|
-
const usedImports =
|
|
347
|
+
const usedImports = filterUsedImports(adapter.getImports(node, (schemaName) => ({
|
|
270
348
|
name: resolver.resolveName(schemaName),
|
|
271
349
|
path: resolver.resolveFile({
|
|
272
350
|
name: schemaName,
|
|
@@ -274,20 +352,28 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
274
352
|
}, {
|
|
275
353
|
root,
|
|
276
354
|
output,
|
|
277
|
-
group
|
|
355
|
+
group: group ?? void 0
|
|
278
356
|
}).path
|
|
279
357
|
})).filter((entry) => entry.path !== meta.file.path), fakerText);
|
|
280
358
|
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
|
|
281
359
|
baseName: meta.file.baseName,
|
|
282
360
|
path: meta.file.path,
|
|
283
361
|
meta: meta.file.meta,
|
|
284
|
-
banner: resolver.resolveBanner(
|
|
362
|
+
banner: resolver.resolveBanner(ctx.meta, {
|
|
285
363
|
output,
|
|
286
|
-
config
|
|
364
|
+
config,
|
|
365
|
+
file: {
|
|
366
|
+
path: meta.file.path,
|
|
367
|
+
baseName: meta.file.baseName
|
|
368
|
+
}
|
|
287
369
|
}),
|
|
288
|
-
footer: resolver.resolveFooter(
|
|
370
|
+
footer: resolver.resolveFooter(ctx.meta, {
|
|
289
371
|
output,
|
|
290
|
-
config
|
|
372
|
+
config,
|
|
373
|
+
file: {
|
|
374
|
+
path: meta.file.path,
|
|
375
|
+
baseName: meta.file.baseName
|
|
376
|
+
}
|
|
291
377
|
}),
|
|
292
378
|
children: [
|
|
293
379
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -323,8 +409,8 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
323
409
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_Faker.Faker, {
|
|
324
410
|
name: meta.name,
|
|
325
411
|
typeName: typeReference.typeName,
|
|
326
|
-
description:
|
|
327
|
-
node
|
|
412
|
+
description: node.description,
|
|
413
|
+
node,
|
|
328
414
|
printer: printerInstance,
|
|
329
415
|
seed,
|
|
330
416
|
canOverride
|
|
@@ -364,6 +450,7 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
364
450
|
...dataEntry ? [dataEntry.name] : [],
|
|
365
451
|
responseName
|
|
366
452
|
]);
|
|
453
|
+
const cyclicSchemas = new Set(ctx.meta.circularNames);
|
|
367
454
|
const meta = {
|
|
368
455
|
file: resolver.resolveFile({
|
|
369
456
|
name: node.operationId,
|
|
@@ -373,7 +460,7 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
373
460
|
}, {
|
|
374
461
|
root,
|
|
375
462
|
output,
|
|
376
|
-
group
|
|
463
|
+
group: group ?? void 0
|
|
377
464
|
}),
|
|
378
465
|
typeFile: tsResolver.resolveFile({
|
|
379
466
|
name: node.operationId,
|
|
@@ -383,7 +470,7 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
383
470
|
}, {
|
|
384
471
|
root,
|
|
385
472
|
output: pluginTs.options?.output ?? output,
|
|
386
|
-
group: pluginTs.options?.group
|
|
473
|
+
group: pluginTs.options?.group ?? void 0
|
|
387
474
|
})
|
|
388
475
|
};
|
|
389
476
|
function resolveMockImports(schema) {
|
|
@@ -395,14 +482,13 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
395
482
|
}, {
|
|
396
483
|
root,
|
|
397
484
|
output,
|
|
398
|
-
group
|
|
485
|
+
group: group ?? void 0
|
|
399
486
|
}).path
|
|
400
487
|
})).filter((entry) => entry.path !== meta.file.path);
|
|
401
488
|
}
|
|
402
489
|
function renderEntry({ schema, name, typeName, description, skipImportNames = [] }) {
|
|
403
490
|
if (!schema) return null;
|
|
404
491
|
const canOverride = require_Faker.canOverrideSchema(schema);
|
|
405
|
-
const cyclicSchemas = adapter.inputNode ? _kubb_core.ast.findCircularSchemas(adapter.inputNode.schemas) : void 0;
|
|
406
492
|
const printerInstance = printerFaker({
|
|
407
493
|
resolver,
|
|
408
494
|
schemaName: name,
|
|
@@ -414,8 +500,8 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
414
500
|
cyclicSchemas
|
|
415
501
|
});
|
|
416
502
|
const fakerText = printerInstance.print(schema) ?? "undefined";
|
|
417
|
-
const { imports, aliases } =
|
|
418
|
-
const rewrittenFakerText =
|
|
503
|
+
const { imports, aliases } = aliasConflictingImports(filterUsedImports(resolveMockImports(schema), fakerText, skipImportNames), localHelperNames);
|
|
504
|
+
const rewrittenFakerText = rewriteAliasedImports(fakerText, aliases);
|
|
419
505
|
const typeReference = require_Faker.resolveTypeReference({
|
|
420
506
|
node: schema,
|
|
421
507
|
canOverride,
|
|
@@ -458,13 +544,21 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
458
544
|
baseName: meta.file.baseName,
|
|
459
545
|
path: meta.file.path,
|
|
460
546
|
meta: meta.file.meta,
|
|
461
|
-
banner: resolver.resolveBanner(
|
|
547
|
+
banner: resolver.resolveBanner(ctx.meta, {
|
|
462
548
|
output,
|
|
463
|
-
config
|
|
549
|
+
config,
|
|
550
|
+
file: {
|
|
551
|
+
path: meta.file.path,
|
|
552
|
+
baseName: meta.file.baseName
|
|
553
|
+
}
|
|
464
554
|
}),
|
|
465
|
-
footer: resolver.resolveFooter(
|
|
555
|
+
footer: resolver.resolveFooter(ctx.meta, {
|
|
466
556
|
output,
|
|
467
|
-
config
|
|
557
|
+
config,
|
|
558
|
+
file: {
|
|
559
|
+
path: meta.file.path,
|
|
560
|
+
baseName: meta.file.baseName
|
|
561
|
+
}
|
|
468
562
|
}),
|
|
469
563
|
children: [
|
|
470
564
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -488,7 +582,7 @@ const fakerGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
488
582
|
typeName
|
|
489
583
|
})),
|
|
490
584
|
responseEntries.map(({ response, name, typeName }) => renderEntry({
|
|
491
|
-
schema: response.schema,
|
|
585
|
+
schema: response.content?.[0]?.schema ?? null,
|
|
492
586
|
name,
|
|
493
587
|
typeName,
|
|
494
588
|
description: response.description
|
|
@@ -523,4 +617,4 @@ Object.defineProperty(exports, "printerFaker", {
|
|
|
523
617
|
}
|
|
524
618
|
});
|
|
525
619
|
|
|
526
|
-
//# sourceMappingURL=fakerGenerator-
|
|
620
|
+
//# sourceMappingURL=fakerGenerator-DhNV9xBw.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fakerGenerator-DhNV9xBw.cjs","names":["trimQuotes","trimQuotes","ast","jsxRendererSync","pluginTsName","canOverrideSchema","resolveTypeReference","File","localeToFakerImport","Faker","ast","resolveParamNameByLocation","buildResponseUnionSchema"],"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,SAAS,KAAK,EAChC,OAAO;GAGT,OAAO,IAAI,OAAO,MAAM,aAAa,KAAK,CAAC,gBAAgB,CAAC,KAAK,KAAK;IACtE;GACF;;AAGJ,SAAgB,wBACd,SACA,eAC+D;CAC/D,MAAM,kBAAkB,IAAI,IAAI,cAAc;CAC9C,MAAM,0BAAU,IAAI,KAAqB;CAuBzC,OAAO;EACL,SAtBqB,QAAQ,KAAK,UAAU;GAE5C,MAAM,gBADQ,MAAM,QAAQ,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,MAAM,KAAK,EACxC,KAAK,SAAqB;IACnD,IAAI,OAAO,SAAS,YAA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KAAK;KAAM,UAAU,KAAK,KAAK;KAAU;IAAE,CAAC;aAL5H;IAOE,iBAAA,GAAA,+BAAA,KAACA,mBAAAA,KAAK,QAAN;KAAa,MAAM,SAAS,CAAC;MAAE,cAAcC,cAAAA,oBAAoB,OAAO;MAAE,MAAM;MAAS,CAAC,GAAG,CAAC,QAAQ;KAAE,MAAK;KAAoB,CAAA;IAChI,mBAAmB,aAAa,iBAAA,GAAA,+BAAA,KAACD,mBAAAA,KAAK,QAAN;KAAa,MAAM;KAAW,MAAM;KAAa,CAAA;IACjF,eAAe,WAAW,iBAAA,GAAA,+BAAA,KAACA,mBAAAA,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,QAAQK,cAAAA,yBAAyB,MAAM,SAAS;KAChD,MAAM;KACN,UAAU,WAAW,oBAAoB,KAAK;KAC9C,iBAAiB,gBAAgB,KAAK,EAAE,WAAW,KAAK;KACzD,CAAC;IACG;;;CAGZ,CAAC"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_fakerGenerator = require("./fakerGenerator-
|
|
2
|
+
const require_fakerGenerator = require("./fakerGenerator-DhNV9xBw.cjs");
|
|
3
3
|
exports.fakerGenerator = require_fakerGenerator.fakerGenerator;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as fakerGenerator } from "./fakerGenerator-
|
|
1
|
+
import { t as fakerGenerator } from "./fakerGenerator-DSvAJTq3.js";
|
|
2
2
|
export { fakerGenerator };
|
package/dist/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as fakerGenerator } from "./fakerGenerator-
|
|
1
|
+
import { t as fakerGenerator } from "./fakerGenerator-BvMBDgwp.js";
|
|
2
2
|
export { fakerGenerator };
|