@orval/mock 8.3.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -26,7 +26,7 @@ function t(e$1, ...t$1) {
26
26
  //#endregion
27
27
  //#region src/faker/compatible-v9.ts
28
28
  const getFakerPackageVersion = (packageJson) => {
29
- return packageJson.dependencies?.["@faker-js/faker"] ?? packageJson.devDependencies?.["@faker-js/faker"] ?? packageJson.peerDependencies?.["@faker-js/faker"];
29
+ return packageJson.resolvedVersions?.["@faker-js/faker"] ?? packageJson.dependencies?.["@faker-js/faker"] ?? packageJson.devDependencies?.["@faker-js/faker"] ?? packageJson.peerDependencies?.["@faker-js/faker"];
30
30
  };
31
31
  const isFakerVersionV9 = (packageJson) => {
32
32
  const version = getFakerPackageVersion(packageJson);
@@ -39,7 +39,7 @@ const isFakerVersionV9 = (packageJson) => {
39
39
  //#region src/faker/constants.ts
40
40
  const DEFAULT_FORMAT_MOCK = {
41
41
  bic: "faker.finance.bic()",
42
- binary: "new Blob(faker.helpers.arrayElements(faker.word.words(10).split(' ')))",
42
+ binary: "new ArrayBuffer(faker.number.int({ min: 1, max: 64 }))",
43
43
  city: "faker.location.city()",
44
44
  country: "faker.location.country()",
45
45
  date: "faker.date.past().toISOString().slice(0, 10)",
@@ -200,24 +200,30 @@ function getMockObject({ item, mockOptions, operationId, tags, combine, context,
200
200
  //#endregion
201
201
  //#region src/faker/getters/scalar.ts
202
202
  function getMockScalar({ item, imports, mockOptions, operationId, tags, combine, context, existingReferencedProperties, splitMockImplementations, allowOverride = false }) {
203
+ const safeMockOptions = mockOptions ?? {};
203
204
  if (item.isRef) existingReferencedProperties = [...existingReferencedProperties, item.name];
204
- const operationProperty = resolveMockOverride(mockOptions?.operations?.[operationId]?.properties, item);
205
+ const operationProperty = resolveMockOverride(safeMockOptions.operations?.[operationId]?.properties, item);
205
206
  if (operationProperty) return operationProperty;
206
- const tagProperty = resolveMockOverride(Object.entries(mockOptions?.tags ?? {}).toSorted((a, b) => {
207
- return a[0].localeCompare(b[0]);
208
- }).reduce((acc, [tag, options]) => tags.includes(tag) ? mergeDeep(acc, options) : acc, {}).properties, item);
207
+ let overrideTag = { properties: {} };
208
+ const sortedTags = Object.entries(safeMockOptions.tags ?? {}).toSorted((a, b) => a[0].localeCompare(b[0]));
209
+ for (const [tag, options] of sortedTags) {
210
+ if (!tags.includes(tag)) continue;
211
+ overrideTag = mergeDeep(overrideTag, options);
212
+ }
213
+ const tagProperty = resolveMockOverride(overrideTag.properties, item);
209
214
  if (tagProperty) return tagProperty;
210
- const property = resolveMockOverride(mockOptions?.properties, item);
215
+ const property = resolveMockOverride(safeMockOptions.properties, item);
211
216
  if (property) return property;
212
- if ((context.output.override.mock?.useExamples || mockOptions?.useExamples) && item.example !== void 0) return {
217
+ if ((context.output.override.mock?.useExamples || safeMockOptions.useExamples) && item.example !== void 0) return {
213
218
  value: JSON.stringify(item.example),
214
219
  imports: [],
215
220
  name: item.name,
216
221
  overrided: true
217
222
  };
223
+ const formatOverrides = safeMockOptions.format ?? {};
218
224
  const ALL_FORMAT = {
219
225
  ...DEFAULT_FORMAT_MOCK,
220
- ...mockOptions?.format
226
+ ...Object.fromEntries(Object.entries(formatOverrides).filter((entry) => typeof entry[1] === "string"))
221
227
  };
222
228
  const isNullable = Array.isArray(item.type) && item.type.includes("null");
223
229
  if (item.format && ALL_FORMAT[item.format]) {
@@ -235,8 +241,22 @@ function getMockScalar({ item, imports, mockOptions, operationId, tags, combine,
235
241
  switch (type) {
236
242
  case "number":
237
243
  case "integer": {
238
- let value = getNullable(`faker.number.${context.output.override.useBigInt && (item.format === "int64" || item.format === "uint64") ? "bigInt" : "int"}({min: ${item.exclusiveMinimum ?? item.minimum ?? mockOptions?.numberMin}, max: ${item.exclusiveMaximum ?? item.maximum ?? mockOptions?.numberMax}${isFakerV9 && item.multipleOf !== void 0 ? `, multipleOf: ${item.multipleOf}` : ""}})`, isNullable);
239
- if (type === "number") value = getNullable(`faker.number.float({min: ${item.exclusiveMinimum ?? item.minimum ?? mockOptions?.numberMin}, max: ${item.exclusiveMaximum ?? item.maximum ?? mockOptions?.numberMax}${isFakerV9 && item.multipleOf !== void 0 ? `, multipleOf: ${item.multipleOf}` : `, fractionDigits: ${mockOptions?.fractionDigits}`}})`, isNullable);
244
+ const intFunction = context.output.override.useBigInt && (item.format === "int64" || item.format === "uint64") ? "bigInt" : "int";
245
+ const numMin = item.exclusiveMinimum ?? item.minimum ?? safeMockOptions.numberMin;
246
+ const numMax = item.exclusiveMaximum ?? item.maximum ?? safeMockOptions.numberMax;
247
+ const intParts = [];
248
+ if (numMin !== void 0) intParts.push(`min: ${numMin}`);
249
+ if (numMax !== void 0) intParts.push(`max: ${numMax}`);
250
+ if (isFakerV9 && item.multipleOf !== void 0) intParts.push(`multipleOf: ${item.multipleOf}`);
251
+ let value = getNullable(`faker.number.${intFunction}(${intParts.length > 0 ? `{${intParts.join(", ")}}` : ""})`, isNullable);
252
+ if (type === "number") {
253
+ const floatParts = [];
254
+ if (numMin !== void 0) floatParts.push(`min: ${numMin}`);
255
+ if (numMax !== void 0) floatParts.push(`max: ${numMax}`);
256
+ if (isFakerV9 && item.multipleOf !== void 0) floatParts.push(`multipleOf: ${item.multipleOf}`);
257
+ else if (safeMockOptions.fractionDigits !== void 0) floatParts.push(`fractionDigits: ${safeMockOptions.fractionDigits}`);
258
+ value = getNullable(`faker.number.float(${floatParts.length > 0 ? `{${floatParts.join(", ")}}` : ""})`, isNullable);
259
+ }
240
260
  const numberImports = [];
241
261
  if (item.enum) value = getEnum(item, numberImports, context, existingReferencedProperties, "number");
242
262
  else if ("const" in item) value = JSON.stringify(item.const);
@@ -289,14 +309,24 @@ function getMockScalar({ item, imports, mockOptions, operationId, tags, combine,
289
309
  };
290
310
  let mapValue = value;
291
311
  if (combine && !value.startsWith("faker") && !value.startsWith("{") && !value.startsWith("Array.from")) mapValue = `{${value}}`;
312
+ const arrMin = item.minItems ?? safeMockOptions.arrayMin;
313
+ const arrMax = item.maxItems ?? safeMockOptions.arrayMax;
314
+ const arrParts = [];
315
+ if (arrMin !== void 0) arrParts.push(`min: ${arrMin}`);
316
+ if (arrMax !== void 0) arrParts.push(`max: ${arrMax}`);
292
317
  return {
293
- value: `Array.from({ length: faker.number.int({ min: ${item.minItems ?? mockOptions?.arrayMin}, max: ${item.maxItems ?? mockOptions?.arrayMax} }) }, (_, i) => i + 1).map(() => (${mapValue}))`,
318
+ value: `Array.from({ length: faker.number.int(${arrParts.length > 0 ? `{${arrParts.join(", ")}}` : ""}) }, (_, i) => i + 1).map(() => (${mapValue}))`,
294
319
  imports: resolvedImports,
295
320
  name: item.name
296
321
  };
297
322
  }
298
323
  case "string": {
299
- let value = `faker.string.alpha(${`{length: {min: ${item.minLength ?? mockOptions?.stringMin}, max: ${item.maxLength ?? mockOptions?.stringMax}}}`})`;
324
+ const strMin = item.minLength ?? safeMockOptions.stringMin;
325
+ const strMax = item.maxLength ?? safeMockOptions.stringMax;
326
+ const strLenParts = [];
327
+ if (strMin !== void 0) strLenParts.push(`min: ${strMin}`);
328
+ if (strMax !== void 0) strLenParts.push(`max: ${strMax}`);
329
+ let value = `faker.string.alpha(${strLenParts.length > 0 ? `{length: {${strLenParts.join(", ")}}}` : ""})`;
300
330
  const stringImports = [];
301
331
  if (item.enum) value = getEnum(item, stringImports, context, existingReferencedProperties, "string");
302
332
  else if (item.pattern) value = `faker.helpers.fromRegExp('${item.pattern}')`;
@@ -611,8 +641,20 @@ function getMockWithoutFunc(spec, override) {
611
641
  function getMockScalarJsTypes(definition, mockOptionsWithoutFunc) {
612
642
  const isArray = definition.endsWith("[]");
613
643
  switch (isArray ? definition.slice(0, -2) : definition) {
614
- case "number": return isArray ? `Array.from({length: faker.number.int({min: ${mockOptionsWithoutFunc.arrayMin}, max: ${mockOptionsWithoutFunc.arrayMax}})}, () => faker.number.int())` : "faker.number.int()";
615
- case "string": return isArray ? `Array.from({length: faker.number.int({min: ${mockOptionsWithoutFunc?.arrayMin},max: ${mockOptionsWithoutFunc?.arrayMax}})}, () => faker.word.sample())` : "faker.word.sample()";
644
+ case "number": {
645
+ const numArrParts = [];
646
+ if (mockOptionsWithoutFunc.arrayMin !== void 0) numArrParts.push(`min: ${mockOptionsWithoutFunc.arrayMin}`);
647
+ if (mockOptionsWithoutFunc.arrayMax !== void 0) numArrParts.push(`max: ${mockOptionsWithoutFunc.arrayMax}`);
648
+ const numArrArg = numArrParts.length > 0 ? `{${numArrParts.join(", ")}}` : "";
649
+ return isArray ? `Array.from({length: faker.number.int(${numArrArg})}, () => faker.number.int())` : "faker.number.int()";
650
+ }
651
+ case "string": {
652
+ const strArrParts = [];
653
+ if (mockOptionsWithoutFunc?.arrayMin !== void 0) strArrParts.push(`min: ${mockOptionsWithoutFunc.arrayMin}`);
654
+ if (mockOptionsWithoutFunc?.arrayMax !== void 0) strArrParts.push(`max: ${mockOptionsWithoutFunc.arrayMax}`);
655
+ const strArrArg = strArrParts.length > 0 ? `{${strArrParts.join(", ")}}` : "";
656
+ return isArray ? `Array.from({length: faker.number.int(${strArrArg})}, () => faker.word.sample())` : "faker.word.sample()";
657
+ }
616
658
  default: return "undefined";
617
659
  }
618
660
  }
@@ -738,27 +780,71 @@ function generateDefinition(name, route, getResponseMockFunctionNameBase, handle
738
780
  else if (definitions.length > 1) value = `faker.helpers.arrayElement(${definition})`;
739
781
  else if (definitions[0]) value = definitions[0];
740
782
  const isResponseOverridable = value.includes(overrideVarName);
741
- const isTextPlain = contentTypes.includes("text/plain");
783
+ const isTextLikeContentType = (ct) => ct.startsWith("text/") || ct === "application/xml" || ct.endsWith("+xml");
784
+ const isTypeExactlyString = (typeExpr) => typeExpr.trim().replaceAll(/^\(+|\)+$/g, "") === "string";
785
+ const isUnionContainingString = (typeExpr) => typeExpr.split("|").map((part) => part.trim().replaceAll(/^\(+|\)+$/g, "")).includes("string");
786
+ const isBinaryLikeContentType = (ct) => ct === "application/octet-stream" || ct === "application/pdf" || ct.startsWith("image/") || ct.startsWith("audio/") || ct.startsWith("video/") || ct.startsWith("font/");
787
+ const preferredContentType = isFunction(mock) ? void 0 : mock?.preferredContentType?.toLowerCase();
788
+ const preferredContentTypeMatch = preferredContentType ? contentTypes.find((ct) => ct.toLowerCase() === preferredContentType) : void 0;
789
+ const contentTypesByPreference = preferredContentTypeMatch ? [preferredContentTypeMatch] : contentTypes;
790
+ const hasTextLikeContentType = contentTypes.some((ct) => isTextLikeContentType(ct));
791
+ const isExactlyStringReturnType = isTypeExactlyString(returnType);
792
+ const isTextResponse = isExactlyStringReturnType && hasTextLikeContentType || contentTypesByPreference.some((ct) => isTextLikeContentType(ct));
793
+ const isBinaryResponse = returnType === "Blob" || contentTypesByPreference.some((ct) => isBinaryLikeContentType(ct));
742
794
  const isReturnHttpResponse = value && value !== "undefined";
743
795
  const getResponseMockFunctionName = `${getResponseMockFunctionNameBase}${pascal(name)}`;
744
796
  const handlerName = `${handlerNameBase}${pascal(name)}`;
745
797
  const addedSplitMockImplementations = splitMockImplementations.slice(oldSplitMockImplementations.length);
746
798
  splitMockImplementations.push(...addedSplitMockImplementations);
747
799
  const mockImplementations = addedSplitMockImplementations.length > 0 ? `${addedSplitMockImplementations.join("\n\n")}\n\n` : "";
748
- const mockImplementation = isReturnHttpResponse ? `${mockImplementations}export const ${getResponseMockFunctionName} = (${isResponseOverridable ? `overrideResponse: Partial< ${returnType} > = {}` : ""})${mockData ? "" : `: ${returnType}`} => (${value})\n\n` : mockImplementations;
800
+ const mockReturnType = isBinaryResponse ? returnType.replaceAll(/\bBlob\b/g, "ArrayBuffer") : returnType;
801
+ const hasJsonContentType = contentTypesByPreference.some((ct) => ct.includes("json") || ct.includes("+json"));
802
+ const hasStringReturnType = isTypeExactlyString(mockReturnType) || isUnionContainingString(mockReturnType);
803
+ const overrideResponseType = `Partial<Extract<${mockReturnType}, object>>`;
804
+ const shouldPreferJsonResponse = hasJsonContentType && !hasStringReturnType;
805
+ const needsRuntimeContentTypeSwitch = isTextResponse && hasJsonContentType && hasStringReturnType && mockReturnType !== "string";
806
+ const mockImplementation = isReturnHttpResponse ? `${mockImplementations}export const ${getResponseMockFunctionName} = (${isResponseOverridable ? `overrideResponse: ${overrideResponseType} = {}` : ""})${mockData ? "" : `: ${mockReturnType}`} => (${value})\n\n` : mockImplementations;
749
807
  const delay = getDelay(override, isFunction(mock) ? void 0 : mock);
750
808
  const infoParam = "info";
751
- const overrideResponse = `overrideResponse !== undefined
809
+ const resolvedResponseExpr = `overrideResponse !== undefined
752
810
  ? (typeof overrideResponse === "function" ? await overrideResponse(${infoParam}) : overrideResponse)
753
811
  : ${getResponseMockFunctionName}()`;
812
+ const statusCode = status === "default" ? 200 : status.replace(/XX$/, "00");
813
+ const binaryContentType = (preferredContentTypeMatch && isBinaryLikeContentType(preferredContentTypeMatch) ? preferredContentTypeMatch : contentTypes.find((ct) => isBinaryLikeContentType(ct))) ?? "application/octet-stream";
814
+ const firstTextCt = isExactlyStringReturnType && !!preferredContentTypeMatch && !isTextLikeContentType(preferredContentTypeMatch) && hasTextLikeContentType ? contentTypes.find((ct) => isTextLikeContentType(ct)) : contentTypesByPreference.find((ct) => isTextLikeContentType(ct));
815
+ const textHelper = firstTextCt === "application/xml" || firstTextCt?.endsWith("+xml") ? "xml" : firstTextCt === "text/html" ? "html" : "text";
816
+ let responseBody;
817
+ let responsePrelude = "";
818
+ if (isBinaryResponse) responsePrelude = `const binaryBody = ${resolvedResponseExpr};`;
819
+ else if (needsRuntimeContentTypeSwitch) responsePrelude = `const resolvedBody = ${resolvedResponseExpr};`;
820
+ else if (isTextResponse && !shouldPreferJsonResponse) responsePrelude = `const resolvedBody = ${resolvedResponseExpr};
821
+ const textBody = typeof resolvedBody === 'string' ? resolvedBody : JSON.stringify(resolvedBody ?? null);`;
822
+ if (!isReturnHttpResponse) responseBody = `new HttpResponse(null,
823
+ { status: ${statusCode}
824
+ })`;
825
+ else if (isBinaryResponse) responseBody = `HttpResponse.arrayBuffer(
826
+ binaryBody instanceof ArrayBuffer
827
+ ? binaryBody
828
+ : new ArrayBuffer(0),
829
+ { status: ${statusCode},
830
+ headers: { 'Content-Type': '${binaryContentType}' }
831
+ })`;
832
+ else if (needsRuntimeContentTypeSwitch) responseBody = `typeof resolvedBody === 'string'
833
+ ? HttpResponse.${textHelper}(resolvedBody, { status: ${statusCode} })
834
+ : HttpResponse.json(resolvedBody, { status: ${statusCode} })`;
835
+ else if (isTextResponse && !shouldPreferJsonResponse) responseBody = `HttpResponse.${textHelper}(textBody,
836
+ { status: ${statusCode}
837
+ })`;
838
+ else responseBody = `HttpResponse.json(${resolvedResponseExpr},
839
+ { status: ${statusCode}
840
+ })`;
841
+ const infoType = `Parameters<Parameters<typeof http.${verb}>[1]>[0]`;
754
842
  const handlerImplementation = `
755
- export const ${handlerName} = (overrideResponse?: ${returnType} | ((${infoParam}: Parameters<Parameters<typeof http.${verb}>[1]>[0]) => Promise<${returnType}> | ${returnType}), options?: RequestHandlerOptions) => {
756
- return http.${verb}('${route}', async (${infoParam}) => {${delay === false ? "" : `await delay(${isFunction(delay) ? `(${delay})()` : delay});`}
843
+ export const ${handlerName} = (overrideResponse?: ${mockReturnType} | ((${infoParam}: ${infoType}) => Promise<${mockReturnType}> | ${mockReturnType}), options?: RequestHandlerOptions) => {
844
+ return http.${verb}('${route}', async (${infoParam}: ${infoType}) => {${delay === false ? "" : `await delay(${isFunction(delay) ? `(${String(delay)})()` : String(delay)});`}
757
845
  ${isReturnHttpResponse ? "" : `if (typeof overrideResponse === 'function') {await overrideResponse(info); }`}
758
- return new HttpResponse(${isReturnHttpResponse ? isTextPlain ? overrideResponse : `JSON.stringify(${overrideResponse})` : null},
759
- { status: ${status === "default" ? 200 : status.replace(/XX$/, "00")},
760
- ${isReturnHttpResponse ? `headers: { 'Content-Type': ${isTextPlain ? "'text/plain'" : "'application/json'"} }` : ""}
761
- })
846
+ ${responsePrelude}
847
+ return ${responseBody}
762
848
  }, options)
763
849
  }\n`;
764
850
  const includeResponseImports = [...imports, ...response.imports.filter((r) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["e","t","DEFAULT_FORMAT_MOCK: Record<\n Required<OpenApiSchemaObject>['format'],\n string\n>","imports: GeneratorImport[]","includedProperties: string[]","numberImports: GeneratorImport[]","stringImports: GeneratorImport[]","enumImports: GeneratorImport[]","e","prop","combineImports: GeneratorImport[]","includedProperties: string[]","allRequiredFields: string[]","e","generateMSWImports: GenerateMockImports","splitMockImplementations: string[]","DEFAULT_MOCK_OPTIONS: GlobalMockOptions","generateMockImports: GenerateMockImports"],"sources":["../src/delay.ts","../../../node_modules/remeda/dist/prop-Cv_AVBuA.js","../src/faker/compatible-v9.ts","../src/faker/constants.ts","../src/faker/getters/object.ts","../src/faker/getters/scalar.ts","../src/faker/resolvers/value.ts","../src/faker/getters/combine.ts","../src/faker/getters/route.ts","../src/msw/mocks.ts","../src/msw/index.ts","../src/index.ts"],"sourcesContent":["import {\n isBoolean,\n isFunction,\n isNumber,\n type GlobalMockOptions,\n type NormalizedOverrideOutput,\n} from '@orval/core';\n\nexport const getDelay = (\n override?: NormalizedOverrideOutput,\n options?: GlobalMockOptions,\n): GlobalMockOptions['delay'] => {\n const overrideDelay = override?.mock?.delay ?? options?.delay;\n const delayFunctionLazyExecute =\n override?.mock?.delayFunctionLazyExecute ??\n options?.delayFunctionLazyExecute;\n if (isFunction(overrideDelay)) {\n return delayFunctionLazyExecute ? overrideDelay : overrideDelay();\n }\n if (isNumber(overrideDelay) || isBoolean(overrideDelay)) {\n return overrideDelay;\n }\n return false;\n};\n","function e(e,...n){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?r=>t(r,e,...n):t(e,...n)}function t(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}export{e as prop};\n//# sourceMappingURL=prop-Cv_AVBuA.js.map","import { compareVersions, type PackageJson } from '@orval/core';\n\nconst getFakerPackageVersion = (packageJson: PackageJson) => {\n return (\n packageJson.dependencies?.['@faker-js/faker'] ??\n packageJson.devDependencies?.['@faker-js/faker'] ??\n packageJson.peerDependencies?.['@faker-js/faker']\n );\n};\n\nexport const isFakerVersionV9 = (packageJson: PackageJson) => {\n const version = getFakerPackageVersion(packageJson);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '9.0.0');\n};\n","import type { OpenApiSchemaObject } from '@orval/core';\n\nexport const DEFAULT_FORMAT_MOCK: Record<\n Required<OpenApiSchemaObject>['format'],\n string\n> = {\n bic: 'faker.finance.bic()',\n binary:\n \"new Blob(faker.helpers.arrayElements(faker.word.words(10).split(' ')))\",\n city: 'faker.location.city()',\n country: 'faker.location.country()',\n date: 'faker.date.past().toISOString().slice(0, 10)',\n 'date-time': \"faker.date.past().toISOString().slice(0, 19) + 'Z'\",\n email: 'faker.internet.email()',\n firstName: 'faker.person.firstName()',\n gender: 'faker.person.gender()',\n iban: 'faker.finance.iban()',\n ipv4: 'faker.internet.ipv4()',\n ipv6: 'faker.internet.ipv6()',\n jobTitle: 'faker.person.jobTitle()',\n lastName: 'faker.person.lastName()',\n password: 'faker.internet.password()',\n phoneNumber: 'faker.phone.number()',\n streetName: 'faker.location.street()',\n uri: 'faker.internet.url()',\n url: 'faker.internet.url()',\n userName: 'faker.internet.userName()',\n uuid: 'faker.string.uuid()',\n zipCode: 'faker.location.zipCode()',\n};\n\n// #980 replace CUID so tests are consistent\nexport const DEFAULT_OBJECT_KEY_MOCK = 'faker.string.alphanumeric(5)';\n","import {\n type ContextSpec,\n type GeneratorImport,\n getKey,\n isBoolean,\n isReference,\n type MockOptions,\n type OpenApiReferenceObject,\n type OpenApiSchemaObject,\n pascal,\n PropertySortOrder,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { DEFAULT_OBJECT_KEY_MOCK } from '../constants';\nimport { resolveMockValue } from '../resolvers/value';\nimport { combineSchemasMock } from './combine';\n\nexport const overrideVarName = 'overrideResponse';\n\ninterface GetMockObjectOptions {\n item: MockSchemaObject;\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n // This is used to add the overrideResponse to the object\n allowOverride?: boolean;\n}\n\nexport function getMockObject({\n item,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride = false,\n}: GetMockObjectOptions): MockDefinition {\n if (isReference(item)) {\n return resolveMockValue({\n schema: {\n ...item,\n name: item.name,\n path: item.path ? `${item.path}.${item.name}` : item.name,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (item.allOf || item.oneOf || item.anyOf) {\n const separator = item.allOf ? 'allOf' : item.oneOf ? 'oneOf' : 'anyOf';\n return combineSchemasMock({\n item,\n separator,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (Array.isArray(item.type)) {\n return combineSchemasMock({\n item: {\n anyOf: item.type.map((type) => ({ type })),\n name: item.name,\n },\n separator: 'anyOf',\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (item.properties) {\n let value =\n !combine || combine.separator === 'oneOf' || combine.separator === 'anyOf'\n ? '{'\n : '';\n const imports: GeneratorImport[] = [];\n const includedProperties: string[] = [];\n\n const entries = Object.entries(item.properties);\n if (context.output.propertySortOrder === PropertySortOrder.ALPHABETICAL) {\n entries.sort((a, b) => {\n return a[0].localeCompare(b[0]);\n });\n }\n const propertyScalars = entries\n .map(\n ([key, prop]: [\n string,\n OpenApiReferenceObject | OpenApiSchemaObject,\n ]) => {\n if (combine?.includedProperties.includes(key)) {\n return;\n }\n\n const isRequired =\n mockOptions?.required ??\n (Array.isArray(item.required) ? item.required : []).includes(key);\n\n const hasNullable = 'nullable' in prop && prop.nullable === true;\n\n // Check to see if the property is a reference to an existing property\n // Fixes issue #910\n if (\n '$ref' in prop &&\n existingReferencedProperties.includes(\n pascal(prop.$ref.split('/').pop() ?? ''),\n )\n ) {\n if (isRequired) {\n const keyDefinition = getKey(key);\n return `${keyDefinition}: null`;\n }\n return;\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...prop,\n name: key,\n path: item.path ? `${item.path}.${key}` : `#.${key}`,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n imports.push(...resolvedValue.imports);\n includedProperties.push(key);\n\n const keyDefinition = getKey(key);\n\n if (!isRequired && !resolvedValue.overrided) {\n const nullValue = hasNullable ? 'null' : 'undefined';\n return `${keyDefinition}: faker.helpers.arrayElement([${resolvedValue.value}, ${nullValue}])`;\n }\n\n const isNullable =\n Array.isArray(prop.type) && prop.type.includes('null');\n if (isNullable && !resolvedValue.overrided) {\n return `${keyDefinition}: faker.helpers.arrayElement([${resolvedValue.value}, null])`;\n }\n\n return `${keyDefinition}: ${resolvedValue.value}`;\n },\n )\n .filter(Boolean);\n\n if (allowOverride) {\n propertyScalars.push(`...${overrideVarName}`);\n }\n\n value += propertyScalars.join(', ');\n value +=\n !combine || combine.separator === 'oneOf' || combine.separator === 'anyOf'\n ? '}'\n : '';\n\n return {\n value,\n imports,\n name: item.name,\n includedProperties,\n };\n }\n\n if (item.additionalProperties) {\n if (isBoolean(item.additionalProperties)) {\n return { value: `{}`, imports: [], name: item.name };\n }\n if (\n isReference(item.additionalProperties) &&\n existingReferencedProperties.includes(\n item.additionalProperties.$ref.split('/').pop() ?? '',\n )\n ) {\n return { value: `{}`, imports: [], name: item.name };\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...item.additionalProperties,\n name: item.name,\n path: item.path ? `${item.path}.#` : '#',\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n return {\n ...resolvedValue,\n value: `{\n [${DEFAULT_OBJECT_KEY_MOCK}]: ${resolvedValue.value}\n }`,\n };\n }\n\n return { value: '{}', imports: [], name: item.name };\n}\n","import {\n type ContextSpec,\n EnumGeneration,\n escape,\n type GeneratorImport,\n isString,\n mergeDeep,\n type MockOptions,\n type OpenApiSchemaObject,\n pascal,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { isFakerVersionV9 } from '../compatible-v9';\nimport { DEFAULT_FORMAT_MOCK } from '../constants';\nimport {\n getNullable,\n resolveMockOverride,\n resolveMockValue,\n} from '../resolvers';\nimport { getMockObject } from './object';\n\ninterface GetMockScalarOptions {\n item: MockSchemaObject;\n imports: GeneratorImport[];\n mockOptions?: MockOptions;\n operationId: string;\n isRef?: boolean;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n // This is used to add the overrideResponse to the object\n allowOverride?: boolean;\n}\n\nexport function getMockScalar({\n item,\n imports,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride = false,\n}: GetMockScalarOptions): MockDefinition {\n // Add the property to the existing properties to validate on object recursion\n if (item.isRef) {\n existingReferencedProperties = [...existingReferencedProperties, item.name];\n }\n\n const operationProperty = resolveMockOverride(\n mockOptions?.operations?.[operationId]?.properties,\n item,\n );\n\n if (operationProperty) {\n return operationProperty;\n }\n\n const overrideTag = Object.entries(mockOptions?.tags ?? {})\n .toSorted((a, b) => {\n return a[0].localeCompare(b[0]);\n })\n .reduce(\n (acc, [tag, options]) =>\n tags.includes(tag) ? mergeDeep(acc, options) : acc,\n {} as { properties: Record<string, unknown> },\n );\n\n const tagProperty = resolveMockOverride(overrideTag.properties, item);\n\n if (tagProperty) {\n return tagProperty;\n }\n\n const property = resolveMockOverride(mockOptions?.properties, item);\n\n if (property) {\n return property;\n }\n\n if (\n (context.output.override.mock?.useExamples || mockOptions?.useExamples) &&\n item.example !== undefined\n ) {\n return {\n value: JSON.stringify(item.example),\n imports: [],\n name: item.name,\n overrided: true,\n };\n }\n\n const ALL_FORMAT = {\n ...DEFAULT_FORMAT_MOCK,\n ...mockOptions?.format,\n };\n\n const isNullable = Array.isArray(item.type) && item.type.includes('null');\n if (item.format && ALL_FORMAT[item.format]) {\n let value = ALL_FORMAT[item.format] as string;\n\n const dateFormats = ['date', 'date-time'];\n if (dateFormats.includes(item.format) && context.output.override.useDates) {\n value = `new Date(${value})`;\n }\n\n return {\n value: getNullable(value, isNullable),\n imports: [],\n name: item.name,\n overrided: false,\n };\n }\n\n const type = getItemType(item);\n const isFakerV9 =\n !!context.output.packageJson &&\n isFakerVersionV9(context.output.packageJson);\n\n switch (type) {\n case 'number':\n case 'integer': {\n const intFunction =\n context.output.override.useBigInt &&\n (item.format === 'int64' || item.format === 'uint64')\n ? 'bigInt'\n : 'int';\n let value = getNullable(\n `faker.number.${intFunction}({min: ${item.exclusiveMinimum ?? item.minimum ?? mockOptions?.numberMin}, max: ${item.exclusiveMaximum ?? item.maximum ?? mockOptions?.numberMax}${isFakerV9 && item.multipleOf !== undefined ? `, multipleOf: ${item.multipleOf}` : ''}})`,\n isNullable,\n );\n if (type === 'number') {\n value = getNullable(\n `faker.number.float({min: ${item.exclusiveMinimum ?? item.minimum ?? mockOptions?.numberMin}, max: ${item.exclusiveMaximum ?? item.maximum ?? mockOptions?.numberMax}${isFakerV9 && item.multipleOf !== undefined ? `, multipleOf: ${item.multipleOf}` : `, fractionDigits: ${mockOptions?.fractionDigits}`}})`,\n isNullable,\n );\n }\n const numberImports: GeneratorImport[] = [];\n\n if (item.enum) {\n value = getEnum(\n item,\n numberImports,\n context,\n existingReferencedProperties,\n 'number',\n );\n } else if ('const' in item) {\n value = JSON.stringify(item.const);\n }\n\n return {\n value,\n enums: item.enum,\n imports: numberImports,\n name: item.name,\n };\n }\n\n case 'boolean': {\n let value = 'faker.datatype.boolean()';\n if ('const' in item) {\n value = JSON.stringify(item.const);\n }\n return {\n value,\n imports: [],\n name: item.name,\n };\n }\n\n case 'array': {\n if (!item.items) {\n return { value: '[]', imports: [], name: item.name };\n }\n\n if (\n '$ref' in item.items &&\n existingReferencedProperties.includes(\n pascal(item.items.$ref.split('/').pop() ?? ''),\n )\n ) {\n return { value: '[]', imports: [], name: item.name };\n }\n\n const {\n value,\n enums,\n imports: resolvedImports,\n } = resolveMockValue({\n schema: {\n ...item.items,\n name: item.name,\n path: item.path ? `${item.path}.[]` : '#.[]',\n },\n combine,\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n if (enums) {\n return {\n value,\n imports: resolvedImports,\n name: item.name,\n };\n }\n\n let mapValue = value;\n\n if (\n combine &&\n !value.startsWith('faker') &&\n !value.startsWith('{') &&\n !value.startsWith('Array.from')\n ) {\n mapValue = `{${value}}`;\n }\n\n return {\n value:\n `Array.from({ length: faker.number.int({ ` +\n `min: ${item.minItems ?? mockOptions?.arrayMin}, ` +\n `max: ${item.maxItems ?? mockOptions?.arrayMax} }) ` +\n `}, (_, i) => i + 1).map(() => (${mapValue}))`,\n imports: resolvedImports,\n name: item.name,\n };\n }\n\n case 'string': {\n const length = `{length: {min: ${item.minLength ?? mockOptions?.stringMin}, max: ${item.maxLength ?? mockOptions?.stringMax}}}`;\n let value = `faker.string.alpha(${length})`;\n const stringImports: GeneratorImport[] = [];\n\n if (item.enum) {\n value = getEnum(\n item,\n stringImports,\n context,\n existingReferencedProperties,\n 'string',\n );\n } else if (item.pattern) {\n value = `faker.helpers.fromRegExp('${item.pattern}')`;\n } else if ('const' in item) {\n value = JSON.stringify((item as OpenApiSchemaObject).const);\n }\n\n return {\n value: getNullable(value, isNullable),\n enums: item.enum,\n name: item.name,\n imports: stringImports,\n };\n }\n\n case 'null': {\n return {\n value: 'null',\n imports: [],\n name: item.name,\n };\n }\n\n default: {\n if (item.enum) {\n const enumImports: GeneratorImport[] = [];\n const value = getEnum(\n item,\n enumImports,\n context,\n existingReferencedProperties,\n );\n\n return {\n value,\n enums: item.enum,\n imports: enumImports,\n name: item.name,\n };\n }\n\n return getMockObject({\n item,\n mockOptions,\n operationId,\n tags,\n combine: combine\n ? {\n separator: combine.separator,\n includedProperties: [],\n }\n : undefined,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n }\n }\n}\n\nfunction getItemType(item: MockSchemaObject) {\n if (Array.isArray(item.type) && item.type.includes('null')) {\n const typesWithoutNull = item.type.filter((x) => x !== 'null');\n const itemType =\n typesWithoutNull.length === 1 ? typesWithoutNull[0] : typesWithoutNull;\n\n return itemType;\n }\n\n if (item.type) return item.type;\n if (!item.enum) return;\n\n const uniqTypes = new Set(item.enum.map((value) => typeof value));\n if (uniqTypes.size > 1) return;\n\n const type = [...uniqTypes.values()].at(0);\n if (!type) return;\n return ['string', 'number'].includes(type) ? type : undefined;\n}\n\nfunction getEnum(\n item: MockSchemaObject,\n imports: GeneratorImport[],\n context: ContextSpec,\n existingReferencedProperties: string[],\n type?: 'string' | 'number',\n) {\n if (!item.enum) return '';\n const joinedEnumValues = item.enum\n .filter((e) => e !== null) // TODO fix type, e can absolutely be null\n .map((e) =>\n type === 'string' || (type === undefined && isString(e))\n ? `'${escape(e)}'`\n : e,\n )\n .join(',');\n\n let enumValue = `[${joinedEnumValues}]`;\n if (context.output.override.enumGenerationType === EnumGeneration.ENUM) {\n if (item.isRef || existingReferencedProperties.length === 0) {\n enumValue += ` as ${item.name}${item.name.endsWith('[]') ? '' : '[]'}`;\n imports.push({ name: item.name });\n } else {\n enumValue += ` as ${existingReferencedProperties[existingReferencedProperties.length - 1]}['${item.name}']`;\n if (!item.path?.endsWith('[]')) enumValue += '[]';\n imports.push({\n name: existingReferencedProperties[\n existingReferencedProperties.length - 1\n ],\n });\n }\n } else {\n enumValue += ' as const';\n }\n\n // But if the value is a reference, we can use the object directly via the imports and using Object.values.\n if (item.isRef && type === 'string') {\n enumValue = `Object.values(${item.name})`;\n imports.push({\n name: item.name,\n values: true,\n });\n }\n\n return item.path?.endsWith('[]')\n ? `faker.helpers.arrayElements(${enumValue})`\n : `faker.helpers.arrayElement(${enumValue})`;\n}\n","import {\n type ContextSpec,\n type GeneratorImport,\n getRefInfo,\n isReference,\n type MockOptions,\n type OpenApiSchemaObject,\n pascal,\n} from '@orval/core';\nimport { prop } from 'remeda';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { overrideVarName } from '../getters';\nimport { getMockScalar } from '../getters/scalar';\n\nfunction isRegex(key: string) {\n return key.startsWith('/') && key.endsWith('/');\n}\n\nexport function resolveMockOverride(\n properties: Record<string, unknown> | undefined = {},\n item: OpenApiSchemaObject & { name: string; path?: string },\n) {\n const path = item.path ?? `#.${item.name}`;\n const property = Object.entries(properties).find(([key]) => {\n if (isRegex(key)) {\n const regex = new RegExp(key.slice(1, -1));\n if (regex.test(item.name) || regex.test(path)) {\n return true;\n }\n }\n\n if (`#.${key}` === path) {\n return true;\n }\n\n return false;\n });\n\n if (!property) {\n return;\n }\n\n const isNullable = Array.isArray(item.type) && item.type.includes('null');\n\n return {\n value: getNullable(property[1] as string, isNullable),\n imports: [],\n name: item.name,\n overrided: true,\n };\n}\n\nexport function getNullable(value: string, nullable?: boolean) {\n return nullable ? `faker.helpers.arrayElement([${value}, null])` : value;\n}\n\ninterface ResolveMockValueOptions {\n schema: MockSchemaObject;\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n allowOverride?: boolean;\n}\n\nexport function resolveMockValue({\n schema,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n}: ResolveMockValueOptions): MockDefinition & { type?: string } {\n if (isReference(schema)) {\n const { originalName, refPaths } = getRefInfo(schema.$ref, context);\n\n const schemaRef = Array.isArray(refPaths)\n ? (prop(\n context.spec,\n // @ts-expect-error: [ts2556] refPaths are not guaranteed to be valid keys of the spec\n ...refPaths,\n ) as Partial<OpenApiSchemaObject>)\n : undefined;\n\n const newSchema = {\n ...schemaRef,\n name: pascal(originalName),\n path: schema.path,\n isRef: true,\n required: [...(schemaRef?.required ?? []), ...(schema.required ?? [])],\n ...(schema.nullable !== undefined ? { nullable: schema.nullable } : {}),\n };\n\n const newSeparator = newSchema.allOf\n ? 'allOf'\n : newSchema.oneOf\n ? 'oneOf'\n : 'anyOf';\n\n const scalar = getMockScalar({\n item: newSchema,\n mockOptions,\n operationId,\n tags,\n combine: combine\n ? {\n separator:\n combine.separator === 'anyOf' ? newSeparator : combine.separator,\n includedProperties:\n newSeparator === 'allOf' ? [] : combine.includedProperties,\n }\n : undefined,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n if (\n scalar.value &&\n (newSchema.type === 'object' || newSchema.allOf) &&\n combine?.separator === 'oneOf'\n ) {\n const funcName = `get${pascal(operationId)}Response${pascal(newSchema.name)}Mock`;\n if (\n !splitMockImplementations.some((f) =>\n f.includes(`export const ${funcName}`),\n )\n ) {\n const discriminatedProperty = newSchema.discriminator?.propertyName;\n\n let type = `Partial<${newSchema.name}>`;\n if (discriminatedProperty) {\n type = `Omit<${type}, '${discriminatedProperty}'>`;\n }\n\n const args = `${overrideVarName}: ${type} = {}`;\n const func = `export const ${funcName} = (${args}): ${newSchema.name} => ({${scalar.value.startsWith('...') ? '' : '...'}${scalar.value}, ...${overrideVarName}});`;\n splitMockImplementations.push(func);\n }\n\n scalar.value = newSchema.nullable\n ? `${funcName}()`\n : `{...${funcName}()}`;\n\n scalar.imports.push({ name: newSchema.name });\n }\n\n return {\n ...scalar,\n type: getType(newSchema),\n };\n }\n\n const scalar = getMockScalar({\n item: schema,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n return {\n ...scalar,\n type: getType(schema),\n };\n}\n\nfunction getType(schema: MockSchemaObject) {\n return (\n (schema.type as string | undefined) ??\n (schema.properties ? 'object' : schema.items ? 'array' : undefined)\n );\n}\n","import {\n type ContextSpec,\n type GeneratorImport,\n isReference,\n isSchema,\n type MockOptions,\n pascal,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { resolveMockValue } from '../resolvers';\n\ninterface CombineSchemasMockOptions {\n item: MockSchemaObject;\n separator: 'allOf' | 'oneOf' | 'anyOf';\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n}\n\nexport function combineSchemasMock({\n item,\n separator,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n}: CombineSchemasMockOptions): MockDefinition {\n const combineImports: GeneratorImport[] = [];\n const includedProperties: string[] = [...(combine?.includedProperties ?? [])];\n\n const isRefAndNotExisting =\n isReference(item) && !existingReferencedProperties.includes(item.name);\n\n const itemResolvedValue =\n isRefAndNotExisting || item.properties\n ? resolveMockValue({\n schema: Object.fromEntries(\n Object.entries(item).filter(([key]) => key !== separator),\n ) as MockSchemaObject,\n combine: {\n separator: 'allOf',\n includedProperties: [],\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n })\n : undefined;\n\n includedProperties.push(...(itemResolvedValue?.includedProperties ?? []));\n combineImports.push(...(itemResolvedValue?.imports ?? []));\n let containsOnlyPrimitiveValues = true;\n\n const allRequiredFields: string[] = [];\n if (separator === 'allOf') {\n if (item.required) {\n allRequiredFields.push(...item.required);\n }\n for (const val of item[separator] ?? []) {\n if (isSchema(val) && val.required) {\n allRequiredFields.push(...val.required);\n }\n }\n }\n\n const value = (item[separator] ?? []).reduce(\n (acc, val, _, arr) => {\n const refName =\n '$ref' in val ? pascal(val.$ref.split('/').pop() ?? '') : '';\n // For allOf: skip if refName is in existingRefs AND this is an inline schema (not a top-level ref)\n // This allows top-level schemas (item.isRef=true) to get base properties from allOf\n // while preventing circular allOf chains in inline property schemas\n const shouldSkipRef =\n separator === 'allOf'\n ? refName &&\n (refName === item.name ||\n (existingReferencedProperties.includes(refName) && !item.isRef))\n : false;\n\n if (shouldSkipRef) {\n if (arr.length === 1) {\n return 'undefined';\n }\n\n return acc;\n }\n\n // the required fields in this schema need to be considered\n // in the sub schema under the allOf key\n if (separator === 'allOf' && allRequiredFields.length > 0) {\n const combinedRequired =\n isSchema(val) && val.required\n ? [...allRequiredFields, ...val.required]\n : allRequiredFields;\n val = { ...val, required: [...new Set(combinedRequired)] };\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...val,\n name: item.name,\n path: item.path ?? '#',\n },\n combine: {\n separator,\n includedProperties:\n separator === 'oneOf'\n ? (itemResolvedValue?.includedProperties ?? [])\n : includedProperties,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n combineImports.push(...resolvedValue.imports);\n includedProperties.push(...(resolvedValue.includedProperties ?? []));\n\n if (resolvedValue.value === '{}') {\n containsOnlyPrimitiveValues = false;\n return acc;\n }\n if (separator === 'allOf') {\n if (resolvedValue.value.startsWith('{') || !resolvedValue.type) {\n containsOnlyPrimitiveValues = false;\n return `${acc}...${resolvedValue.value},`;\n } else if (resolvedValue.type === 'object') {\n containsOnlyPrimitiveValues = false;\n return resolvedValue.value.startsWith('faker')\n ? `${acc}...${resolvedValue.value},`\n : `${acc}...{${resolvedValue.value}},`;\n }\n }\n return `${acc}${resolvedValue.value},`;\n },\n separator === 'allOf' ? '' : 'faker.helpers.arrayElement([',\n );\n let finalValue =\n value === 'undefined'\n ? value\n : // containsOnlyPrimitiveValues isn't just true, it's being set to false inside the above reduce and the type system doesn't detect it\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n `${separator === 'allOf' && !containsOnlyPrimitiveValues ? '{' : ''}${value}${separator === 'allOf' ? (containsOnlyPrimitiveValues ? '' : '}') : '])'}`;\n if (itemResolvedValue) {\n finalValue = finalValue.startsWith('...')\n ? `...{${finalValue}, ${itemResolvedValue.value}}`\n : `{...${finalValue}, ${itemResolvedValue.value}}`;\n }\n if (finalValue.endsWith(',')) {\n finalValue = finalValue.slice(0, Math.max(0, finalValue.length - 1));\n }\n\n return {\n value: finalValue,\n imports: combineImports,\n name: item.name,\n includedProperties,\n };\n}\n","import { camel, sanitize } from '@orval/core';\n\nconst hasParam = (path: string): boolean => /[^{]*{[\\w*_-]*}.*/.test(path);\n\nconst getRoutePath = (path: string): string => {\n const matches = /([^{]*){?([\\w*_-]*)}?(.*)/.exec(path);\n if (!matches?.length) return path; // impossible due to regexp grouping here, but for TS\n\n const prev = matches[1];\n const param = sanitize(camel(matches[2]), {\n es5keyword: true,\n underscore: true,\n dash: true,\n dot: true,\n });\n const next = hasParam(matches[3]) ? getRoutePath(matches[3]) : matches[3];\n\n return hasParam(path) ? `${prev}:${param}${next}` : `${prev}${param}${next}`;\n};\n\nexport const getRouteMSW = (route: string, baseUrl = '*') => {\n route = route.replaceAll(':', String.raw`\\:`);\n const splittedRoute = route.split('/');\n\n return splittedRoute.reduce((acc, path, i) => {\n if (!path && !i) {\n return acc;\n }\n\n if (!path.includes('{')) {\n return `${acc}/${path}`;\n }\n\n return `${acc}/${getRoutePath(path)}`;\n }, baseUrl);\n};\n","import {\n type ContextSpec,\n generalJSTypesWithArray,\n type GeneratorImport,\n type GlobalMockOptions,\n isFunction,\n type MockOptions,\n type NormalizedOverrideOutput,\n type OpenApiDocument,\n type OpenApiSchemaObject,\n resolveRef,\n type ResReqTypesValue,\n stringify,\n} from '@orval/core';\n\nimport { getMockScalar } from '../faker/getters';\n\nfunction getMockPropertiesWithoutFunc(properties: any, spec: OpenApiDocument) {\n return Object.entries(\n isFunction(properties) ? properties(spec) : properties,\n ).reduce<Record<string, string>>((acc, [key, value]) => {\n const implementation = isFunction(value)\n ? `(${value})()`\n : stringify(value as string)!;\n\n acc[key] = implementation.replaceAll(\n /import_faker\\.defaults|import_faker\\.faker|_faker\\.faker/g,\n 'faker',\n );\n return acc;\n }, {});\n}\n\nfunction getMockWithoutFunc(\n spec: OpenApiDocument,\n override?: NormalizedOverrideOutput,\n): MockOptions {\n return {\n arrayMin: override?.mock?.arrayMin,\n arrayMax: override?.mock?.arrayMax,\n stringMin: override?.mock?.stringMin,\n stringMax: override?.mock?.stringMax,\n numberMin: override?.mock?.numberMin,\n numberMax: override?.mock?.numberMax,\n required: override?.mock?.required,\n fractionDigits: override?.mock?.fractionDigits,\n ...(override?.mock?.properties\n ? {\n properties: getMockPropertiesWithoutFunc(\n override.mock.properties,\n spec,\n ),\n }\n : {}),\n ...(override?.mock?.format\n ? {\n format: getMockPropertiesWithoutFunc(override.mock.format, spec),\n }\n : {}),\n ...(override?.operations\n ? {\n operations: Object.entries(override.operations).reduce<\n Exclude<MockOptions['operations'], undefined>\n >((acc, [key, value]) => {\n if (value?.mock?.properties) {\n acc[key] = {\n properties: getMockPropertiesWithoutFunc(\n value.mock.properties,\n spec,\n ),\n };\n }\n\n return acc;\n }, {}),\n }\n : {}),\n ...(override?.tags\n ? {\n tags: Object.entries(override.tags).reduce<\n Exclude<MockOptions['tags'], undefined>\n >((acc, [key, value]) => {\n if (value?.mock?.properties) {\n acc[key] = {\n properties: getMockPropertiesWithoutFunc(\n value.mock.properties,\n spec,\n ),\n };\n }\n\n return acc;\n }, {}),\n }\n : {}),\n };\n}\n\nfunction getMockScalarJsTypes(\n definition: string,\n mockOptionsWithoutFunc: Record<string, unknown>,\n) {\n const isArray = definition.endsWith('[]');\n const type = isArray ? definition.slice(0, -2) : definition;\n\n switch (type) {\n case 'number': {\n return isArray\n ? `Array.from({length: faker.number.int({` +\n `min: ${mockOptionsWithoutFunc.arrayMin}, ` +\n `max: ${mockOptionsWithoutFunc.arrayMax}}` +\n `)}, () => faker.number.int())`\n : 'faker.number.int()';\n }\n case 'string': {\n return isArray\n ? `Array.from({length: faker.number.int({` +\n `min: ${mockOptionsWithoutFunc?.arrayMin},` +\n `max: ${mockOptionsWithoutFunc?.arrayMax}}` +\n `)}, () => faker.word.sample())`\n : 'faker.word.sample()';\n }\n default: {\n return 'undefined';\n }\n }\n}\n\ninterface GetResponsesMockDefinitionOptions {\n operationId: string;\n tags: string[];\n returnType: string;\n responses: ResReqTypesValue[];\n imports: GeneratorImport[];\n mockOptionsWithoutFunc: Record<string, unknown>;\n transformer?: (value: unknown, definition: string) => string;\n context: ContextSpec;\n mockOptions?: GlobalMockOptions;\n splitMockImplementations: string[];\n}\n\nexport function getResponsesMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n mockOptionsWithoutFunc,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n}: GetResponsesMockDefinitionOptions) {\n return responses.reduce(\n (\n acc,\n { value: definition, originalSchema, example, examples, imports, isRef },\n ) => {\n if (\n context.output.override.mock?.useExamples ||\n mockOptions?.useExamples\n ) {\n let exampleValue =\n example ??\n originalSchema?.example ??\n Object.values(examples ?? {})[0] ??\n originalSchema?.examples?.[0];\n exampleValue = exampleValue?.value ?? exampleValue;\n if (exampleValue) {\n acc.definitions.push(\n transformer\n ? transformer(exampleValue, returnType)\n : JSON.stringify(exampleValue),\n );\n return acc;\n }\n }\n if (!definition || generalJSTypesWithArray.includes(definition)) {\n const value = getMockScalarJsTypes(definition, mockOptionsWithoutFunc);\n\n acc.definitions.push(\n transformer ? transformer(value, returnType) : value,\n );\n\n return acc;\n }\n\n if (!originalSchema && definition === 'Blob') {\n originalSchema = { type: 'string', format: 'binary' };\n } else if (!originalSchema) {\n return acc;\n }\n\n const resolvedRef = resolveRef<OpenApiSchemaObject>(\n originalSchema,\n context,\n );\n\n const scalar = getMockScalar({\n item: {\n name: definition,\n ...resolvedRef.schema,\n },\n imports,\n mockOptions: mockOptionsWithoutFunc,\n operationId,\n tags,\n context,\n existingReferencedProperties: [],\n splitMockImplementations,\n allowOverride: true,\n });\n\n acc.imports.push(...scalar.imports);\n acc.definitions.push(\n transformer ? transformer(scalar.value, returnType) : scalar.value,\n );\n\n return acc;\n },\n {\n definitions: [] as string[],\n imports: [] as GeneratorImport[],\n },\n );\n}\n\ninterface GetMockDefinitionOptions {\n operationId: string;\n tags: string[];\n returnType: string;\n responses: ResReqTypesValue[];\n imports: GeneratorImport[];\n override: NormalizedOverrideOutput;\n transformer?: (value: unknown, definition: string) => string;\n context: ContextSpec;\n mockOptions?: GlobalMockOptions;\n splitMockImplementations: string[];\n}\n\nexport function getMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n override,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n}: GetMockDefinitionOptions) {\n const mockOptionsWithoutFunc = getMockWithoutFunc(context.spec, override);\n\n const { definitions, imports } = getResponsesMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n mockOptionsWithoutFunc,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n });\n\n return {\n definition: '[' + definitions.join(', ') + ']',\n definitions,\n imports,\n };\n}\n\nexport function getMockOptionsDataOverride(\n operationTags: string[],\n operationId: string,\n override: NormalizedOverrideOutput,\n) {\n const responseOverride =\n override.operations[operationId]?.mock?.data ??\n operationTags\n .map((operationTag) => override.tags[operationTag]?.mock?.data)\n .find((e) => e !== undefined);\n const implementation = isFunction(responseOverride)\n ? `(${responseOverride})()`\n : stringify(responseOverride);\n\n return implementation?.replaceAll(\n /import_faker\\.defaults|import_faker\\.faker|_faker\\.faker/g,\n 'faker',\n );\n}\n","import {\n type ClientMockGeneratorBuilder,\n generateDependencyImports,\n type GenerateMockImports,\n type GeneratorDependency,\n type GeneratorImport,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n type GlobalMockOptions,\n isFunction,\n isObject,\n pascal,\n type ResReqTypesValue,\n} from '@orval/core';\n\nimport { getDelay } from '../delay';\nimport { getRouteMSW, overrideVarName } from '../faker/getters';\nimport { getMockDefinition, getMockOptionsDataOverride } from './mocks';\n\nfunction getMSWDependencies(\n options?: GlobalMockOptions,\n): GeneratorDependency[] {\n const hasDelay = options?.delay !== false;\n const locale = options?.locale;\n\n const exports = [\n { name: 'http', values: true },\n { name: 'HttpResponse', values: true },\n { name: 'RequestHandlerOptions', values: false },\n ];\n\n if (hasDelay) {\n exports.push({ name: 'delay', values: true });\n }\n\n return [\n { exports, dependency: 'msw' },\n {\n exports: [{ name: 'faker', values: true }],\n dependency: locale\n ? `@faker-js/faker/locale/${locale}`\n : '@faker-js/faker',\n },\n ];\n}\n\nexport const generateMSWImports: GenerateMockImports = ({\n implementation,\n imports,\n projectName,\n hasSchemaDir,\n isAllowSyntheticDefaultImports,\n options,\n}) => {\n return generateDependencyImports(\n implementation,\n [...getMSWDependencies(options), ...imports],\n projectName,\n hasSchemaDir,\n isAllowSyntheticDefaultImports,\n );\n};\n\nfunction generateDefinition(\n name: string,\n route: string,\n getResponseMockFunctionNameBase: string,\n handlerNameBase: string,\n { operationId, response, verb, tags }: GeneratorVerbOptions,\n { override, context, mock }: GeneratorOptions,\n returnType: string,\n status: string,\n responseImports: GeneratorImport[],\n responses: ResReqTypesValue[],\n contentTypes: string[],\n splitMockImplementations: string[],\n) {\n const oldSplitMockImplementations = [...splitMockImplementations];\n const { definitions, definition, imports } = getMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n override,\n context,\n mockOptions: isFunction(mock) ? undefined : mock,\n splitMockImplementations,\n });\n\n const mockData = getMockOptionsDataOverride(tags, operationId, override);\n\n let value = '';\n\n if (mockData) {\n value = mockData;\n } else if (definitions.length > 1) {\n value = `faker.helpers.arrayElement(${definition})`;\n } else if (definitions[0]) {\n value = definitions[0];\n }\n\n const isResponseOverridable = value.includes(overrideVarName);\n const isTextPlain = contentTypes.includes('text/plain');\n const isReturnHttpResponse = value && value !== 'undefined';\n\n const getResponseMockFunctionName = `${getResponseMockFunctionNameBase}${pascal(\n name,\n )}`;\n const handlerName = `${handlerNameBase}${pascal(name)}`;\n\n const addedSplitMockImplementations = splitMockImplementations.slice(\n oldSplitMockImplementations.length,\n );\n splitMockImplementations.push(...addedSplitMockImplementations);\n const mockImplementations =\n addedSplitMockImplementations.length > 0\n ? `${addedSplitMockImplementations.join('\\n\\n')}\\n\\n`\n : '';\n\n const mockImplementation = isReturnHttpResponse\n ? `${mockImplementations}export const ${getResponseMockFunctionName} = (${\n isResponseOverridable\n ? `overrideResponse: Partial< ${returnType} > = {}`\n : ''\n })${mockData ? '' : `: ${returnType}`} => (${value})\\n\\n`\n : mockImplementations;\n\n const delay = getDelay(override, isFunction(mock) ? undefined : mock);\n const infoParam = 'info';\n const overrideResponse = `overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(${infoParam}) : overrideResponse)\n : ${getResponseMockFunctionName}()`;\n const handlerImplementation = `\nexport const ${handlerName} = (overrideResponse?: ${returnType} | ((${infoParam}: Parameters<Parameters<typeof http.${verb}>[1]>[0]) => Promise<${returnType}> | ${returnType}), options?: RequestHandlerOptions) => {\n return http.${verb}('${route}', async (${infoParam}) => {${\n delay === false\n ? ''\n : `await delay(${isFunction(delay) ? `(${delay})()` : delay});`\n }\n ${isReturnHttpResponse ? '' : `if (typeof overrideResponse === 'function') {await overrideResponse(info); }`}\n return new HttpResponse(${\n isReturnHttpResponse\n ? isTextPlain\n ? overrideResponse\n : `JSON.stringify(${overrideResponse})`\n : null\n },\n { status: ${status === 'default' ? 200 : status.replace(/XX$/, '00')},\n ${\n isReturnHttpResponse\n ? `headers: { 'Content-Type': ${isTextPlain ? \"'text/plain'\" : \"'application/json'\"} }`\n : ''\n }\n })\n }, options)\n}\\n`;\n\n const includeResponseImports = [\n ...imports,\n ...response.imports.filter((r) => {\n // Only include imports which are actually used in mock.\n const reg = new RegExp(String.raw`\\b${r.name}\\b`);\n return reg.test(handlerImplementation) || reg.test(mockImplementation);\n }),\n ];\n\n return {\n implementation: {\n function: mockImplementation,\n handlerName: handlerName,\n handler: handlerImplementation,\n },\n imports: includeResponseImports,\n };\n}\n\nexport function generateMSW(\n generatorVerbOptions: GeneratorVerbOptions,\n generatorOptions: GeneratorOptions,\n): ClientMockGeneratorBuilder {\n const { pathRoute, override, mock } = generatorOptions;\n const { operationId, response } = generatorVerbOptions;\n\n const route = getRouteMSW(\n pathRoute,\n override.mock?.baseUrl ?? (isFunction(mock) ? undefined : mock?.baseUrl),\n );\n\n const handlerName = `get${pascal(operationId)}MockHandler`;\n const getResponseMockFunctionName = `get${pascal(operationId)}ResponseMock`;\n\n const splitMockImplementations: string[] = [];\n\n const baseDefinition = generateDefinition(\n '',\n route,\n getResponseMockFunctionName,\n handlerName,\n generatorVerbOptions,\n generatorOptions,\n response.definition.success,\n response.types.success[0]?.key ?? '200',\n response.imports,\n response.types.success,\n response.contentTypes,\n splitMockImplementations,\n );\n\n const mockImplementations = [baseDefinition.implementation.function];\n const handlerImplementations = [baseDefinition.implementation.handler];\n const imports = [...baseDefinition.imports];\n\n if (\n generatorOptions.mock &&\n isObject(generatorOptions.mock) &&\n generatorOptions.mock.generateEachHttpStatus\n ) {\n for (const statusResponse of [\n ...response.types.success,\n ...response.types.errors,\n ]) {\n const definition = generateDefinition(\n statusResponse.key,\n route,\n getResponseMockFunctionName,\n handlerName,\n generatorVerbOptions,\n generatorOptions,\n statusResponse.value,\n statusResponse.key,\n response.imports,\n [statusResponse],\n [statusResponse.contentType],\n splitMockImplementations,\n );\n mockImplementations.push(definition.implementation.function);\n handlerImplementations.push(definition.implementation.handler);\n imports.push(...definition.imports);\n }\n }\n\n return {\n implementation: {\n function: mockImplementations.join('\\n'),\n handlerName: handlerName,\n handler: handlerImplementations.join('\\n'),\n },\n imports: imports,\n };\n}\n","import type {\n GenerateMockImports,\n GeneratorOptions,\n GeneratorVerbOptions,\n GlobalMockOptions,\n} from '@orval/core';\n\nimport { generateMSW, generateMSWImports } from './msw';\n\nexport const DEFAULT_MOCK_OPTIONS: GlobalMockOptions = {\n type: 'msw',\n useExamples: false,\n};\n\nexport const generateMockImports: GenerateMockImports = (importOptions) => {\n switch (importOptions.options?.type) {\n default: {\n // case 'msw':\n return generateMSWImports(importOptions);\n }\n }\n};\n\nexport function generateMock(\n generatorVerbOptions: GeneratorVerbOptions,\n generatorOptions: Omit<GeneratorOptions, 'mock'> & {\n mock: GlobalMockOptions;\n },\n) {\n switch (generatorOptions.mock.type) {\n default: {\n // case 'msw':\n return generateMSW(generatorVerbOptions, generatorOptions);\n }\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;AAQA,MAAa,YACX,UACA,YAC+B;CAC/B,MAAM,gBAAgB,UAAU,MAAM,SAAS,SAAS;CACxD,MAAM,2BACJ,UAAU,MAAM,4BAChB,SAAS;AACX,KAAI,WAAW,cAAc,CAC3B,QAAO,2BAA2B,gBAAgB,eAAe;AAEnE,KAAI,SAAS,cAAc,IAAI,UAAU,cAAc,CACrD,QAAO;AAET,QAAO;;;;;ACtBT,SAAS,EAAE,KAAE,GAAG,GAAE;AAAC,QAAO,OAAOA,OAAG,YAAU,OAAOA,OAAG,YAAU,OAAOA,OAAG,YAAS,MAAG,EAAE,GAAEA,KAAE,GAAG,EAAE,GAAC,EAAEA,KAAE,GAAG,EAAE;;AAAC,SAAS,EAAE,KAAE,GAAGC,KAAE;CAAC,IAAI,IAAED;AAA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AS,MAA/B;EACE,QAEE,QAAO,mBAAmB,cAAc;;;AAK9C,SAAgB,aACd,sBACA,kBAGA;AACA,SAAQ,iBAAiB,KAAK,MAA9B;EACE,QAEE,QAAO,YAAY,sBAAsB,iBAAiB"}
1
+ {"version":3,"file":"index.mjs","names":["e","t","DEFAULT_FORMAT_MOCK: Record<\n Required<OpenApiSchemaObject>['format'],\n string\n>","imports: GeneratorImport[]","includedProperties: string[]","safeMockOptions: MockOptions","overrideTag: { properties: Record<string, unknown> }","ALL_FORMAT: Record<string, string>","intParts: string[]","floatParts: string[]","numberImports: GeneratorImport[]","arrParts: string[]","strLenParts: string[]","stringImports: GeneratorImport[]","enumImports: GeneratorImport[]","e","prop","combineImports: GeneratorImport[]","includedProperties: string[]","allRequiredFields: string[]","numArrParts: string[]","strArrParts: string[]","e","generateMSWImports: GenerateMockImports","responseBody: string","splitMockImplementations: string[]","DEFAULT_MOCK_OPTIONS: GlobalMockOptions","generateMockImports: GenerateMockImports"],"sources":["../src/delay.ts","../../../node_modules/remeda/dist/prop-Cv_AVBuA.js","../src/faker/compatible-v9.ts","../src/faker/constants.ts","../src/faker/getters/object.ts","../src/faker/getters/scalar.ts","../src/faker/resolvers/value.ts","../src/faker/getters/combine.ts","../src/faker/getters/route.ts","../src/msw/mocks.ts","../src/msw/index.ts","../src/index.ts"],"sourcesContent":["import {\n isBoolean,\n isFunction,\n isNumber,\n type GlobalMockOptions,\n type NormalizedOverrideOutput,\n} from '@orval/core';\n\nexport const getDelay = (\n override?: NormalizedOverrideOutput,\n options?: GlobalMockOptions,\n): GlobalMockOptions['delay'] => {\n const overrideDelay = override?.mock?.delay ?? options?.delay;\n const delayFunctionLazyExecute =\n override?.mock?.delayFunctionLazyExecute ??\n options?.delayFunctionLazyExecute;\n if (isFunction(overrideDelay)) {\n return delayFunctionLazyExecute ? overrideDelay : overrideDelay();\n }\n if (isNumber(overrideDelay) || isBoolean(overrideDelay)) {\n return overrideDelay;\n }\n return false;\n};\n","function e(e,...n){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?r=>t(r,e,...n):t(e,...n)}function t(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}export{e as prop};\n//# sourceMappingURL=prop-Cv_AVBuA.js.map","import { compareVersions, type PackageJson } from '@orval/core';\n\nconst getFakerPackageVersion = (packageJson: PackageJson) => {\n return (\n packageJson.resolvedVersions?.['@faker-js/faker'] ??\n packageJson.dependencies?.['@faker-js/faker'] ??\n packageJson.devDependencies?.['@faker-js/faker'] ??\n packageJson.peerDependencies?.['@faker-js/faker']\n );\n};\n\nexport const isFakerVersionV9 = (packageJson: PackageJson) => {\n const version = getFakerPackageVersion(packageJson);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '9.0.0');\n};\n","import type { OpenApiSchemaObject } from '@orval/core';\n\nexport const DEFAULT_FORMAT_MOCK: Record<\n Required<OpenApiSchemaObject>['format'],\n string\n> = {\n bic: 'faker.finance.bic()',\n binary: 'new ArrayBuffer(faker.number.int({ min: 1, max: 64 }))',\n city: 'faker.location.city()',\n country: 'faker.location.country()',\n date: 'faker.date.past().toISOString().slice(0, 10)',\n 'date-time': \"faker.date.past().toISOString().slice(0, 19) + 'Z'\",\n email: 'faker.internet.email()',\n firstName: 'faker.person.firstName()',\n gender: 'faker.person.gender()',\n iban: 'faker.finance.iban()',\n ipv4: 'faker.internet.ipv4()',\n ipv6: 'faker.internet.ipv6()',\n jobTitle: 'faker.person.jobTitle()',\n lastName: 'faker.person.lastName()',\n password: 'faker.internet.password()',\n phoneNumber: 'faker.phone.number()',\n streetName: 'faker.location.street()',\n uri: 'faker.internet.url()',\n url: 'faker.internet.url()',\n userName: 'faker.internet.userName()',\n uuid: 'faker.string.uuid()',\n zipCode: 'faker.location.zipCode()',\n};\n\n// #980 replace CUID so tests are consistent\nexport const DEFAULT_OBJECT_KEY_MOCK = 'faker.string.alphanumeric(5)';\n","import {\n type ContextSpec,\n type GeneratorImport,\n getKey,\n isBoolean,\n isReference,\n type MockOptions,\n type OpenApiReferenceObject,\n type OpenApiSchemaObject,\n pascal,\n PropertySortOrder,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { DEFAULT_OBJECT_KEY_MOCK } from '../constants';\nimport { resolveMockValue } from '../resolvers/value';\nimport { combineSchemasMock } from './combine';\n\nexport const overrideVarName = 'overrideResponse';\n\ninterface GetMockObjectOptions {\n item: MockSchemaObject;\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n // This is used to add the overrideResponse to the object\n allowOverride?: boolean;\n}\n\nexport function getMockObject({\n item,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride = false,\n}: GetMockObjectOptions): MockDefinition {\n if (isReference(item)) {\n return resolveMockValue({\n schema: {\n ...item,\n name: item.name,\n path: item.path ? `${item.path}.${item.name}` : item.name,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (item.allOf || item.oneOf || item.anyOf) {\n const separator = item.allOf ? 'allOf' : item.oneOf ? 'oneOf' : 'anyOf';\n return combineSchemasMock({\n item,\n separator,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (Array.isArray(item.type)) {\n return combineSchemasMock({\n item: {\n anyOf: item.type.map((type) => ({ type })),\n name: item.name,\n },\n separator: 'anyOf',\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n }\n\n if (item.properties) {\n let value =\n !combine || combine.separator === 'oneOf' || combine.separator === 'anyOf'\n ? '{'\n : '';\n const imports: GeneratorImport[] = [];\n const includedProperties: string[] = [];\n\n const entries = Object.entries(item.properties);\n if (context.output.propertySortOrder === PropertySortOrder.ALPHABETICAL) {\n entries.sort((a, b) => {\n return a[0].localeCompare(b[0]);\n });\n }\n const propertyScalars = entries\n .map(\n ([key, prop]: [\n string,\n OpenApiReferenceObject | OpenApiSchemaObject,\n ]) => {\n if (combine?.includedProperties.includes(key)) {\n return;\n }\n\n const isRequired =\n mockOptions?.required ??\n (Array.isArray(item.required) ? item.required : []).includes(key);\n\n const hasNullable = 'nullable' in prop && prop.nullable === true;\n\n // Check to see if the property is a reference to an existing property\n // Fixes issue #910\n if (\n '$ref' in prop &&\n existingReferencedProperties.includes(\n pascal(prop.$ref.split('/').pop() ?? ''),\n )\n ) {\n if (isRequired) {\n const keyDefinition = getKey(key);\n return `${keyDefinition}: null`;\n }\n return;\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...prop,\n name: key,\n path: item.path ? `${item.path}.${key}` : `#.${key}`,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n imports.push(...resolvedValue.imports);\n includedProperties.push(key);\n\n const keyDefinition = getKey(key);\n\n if (!isRequired && !resolvedValue.overrided) {\n const nullValue = hasNullable ? 'null' : 'undefined';\n return `${keyDefinition}: faker.helpers.arrayElement([${resolvedValue.value}, ${nullValue}])`;\n }\n\n const isNullable =\n Array.isArray(prop.type) && prop.type.includes('null');\n if (isNullable && !resolvedValue.overrided) {\n return `${keyDefinition}: faker.helpers.arrayElement([${resolvedValue.value}, null])`;\n }\n\n return `${keyDefinition}: ${resolvedValue.value}`;\n },\n )\n .filter(Boolean);\n\n if (allowOverride) {\n propertyScalars.push(`...${overrideVarName}`);\n }\n\n value += propertyScalars.join(', ');\n value +=\n !combine || combine.separator === 'oneOf' || combine.separator === 'anyOf'\n ? '}'\n : '';\n\n return {\n value,\n imports,\n name: item.name,\n includedProperties,\n };\n }\n\n if (item.additionalProperties) {\n if (isBoolean(item.additionalProperties)) {\n return { value: `{}`, imports: [], name: item.name };\n }\n if (\n isReference(item.additionalProperties) &&\n existingReferencedProperties.includes(\n item.additionalProperties.$ref.split('/').pop() ?? '',\n )\n ) {\n return { value: `{}`, imports: [], name: item.name };\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...item.additionalProperties,\n name: item.name,\n path: item.path ? `${item.path}.#` : '#',\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n return {\n ...resolvedValue,\n value: `{\n [${DEFAULT_OBJECT_KEY_MOCK}]: ${resolvedValue.value}\n }`,\n };\n }\n\n return { value: '{}', imports: [], name: item.name };\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport {\n type ContextSpec,\n EnumGeneration,\n escape,\n type GeneratorImport,\n isString,\n mergeDeep,\n type MockOptions,\n type OpenApiSchemaObject,\n pascal,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { isFakerVersionV9 } from '../compatible-v9';\nimport { DEFAULT_FORMAT_MOCK } from '../constants';\nimport {\n getNullable,\n resolveMockOverride,\n resolveMockValue,\n} from '../resolvers';\nimport { getMockObject } from './object';\n\ninterface GetMockScalarOptions {\n item: MockSchemaObject;\n imports: GeneratorImport[];\n mockOptions?: MockOptions;\n operationId: string;\n isRef?: boolean;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n // This is used to add the overrideResponse to the object\n allowOverride?: boolean;\n}\n\nexport function getMockScalar({\n item,\n imports,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride = false,\n}: GetMockScalarOptions): MockDefinition {\n const safeMockOptions: MockOptions = mockOptions ?? {};\n // Add the property to the existing properties to validate on object recursion\n if (item.isRef) {\n existingReferencedProperties = [...existingReferencedProperties, item.name];\n }\n\n const operationProperty = resolveMockOverride(\n safeMockOptions.operations?.[operationId]?.properties,\n item,\n );\n\n if (operationProperty) {\n return operationProperty;\n }\n\n let overrideTag: { properties: Record<string, unknown> } = {\n properties: {},\n };\n const sortedTags = Object.entries(safeMockOptions.tags ?? {}).toSorted(\n (a, b) => a[0].localeCompare(b[0]),\n );\n for (const [tag, options] of sortedTags) {\n if (!tags.includes(tag)) {\n continue;\n }\n overrideTag = mergeDeep(overrideTag, options);\n }\n\n const tagProperty = resolveMockOverride(overrideTag.properties, item);\n\n if (tagProperty) {\n return tagProperty;\n }\n\n const property = resolveMockOverride(safeMockOptions.properties, item);\n\n if (property) {\n return property;\n }\n\n if (\n (context.output.override.mock?.useExamples ||\n safeMockOptions.useExamples) &&\n item.example !== undefined\n ) {\n return {\n value: JSON.stringify(item.example),\n imports: [],\n name: item.name,\n overrided: true,\n };\n }\n\n const formatOverrides = safeMockOptions.format ?? {};\n const ALL_FORMAT: Record<string, string> = {\n ...DEFAULT_FORMAT_MOCK,\n ...Object.fromEntries(\n Object.entries(formatOverrides).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string',\n ),\n ),\n };\n\n const isNullable = Array.isArray(item.type) && item.type.includes('null');\n if (item.format && ALL_FORMAT[item.format]) {\n let value = ALL_FORMAT[item.format] as string;\n\n const dateFormats = ['date', 'date-time'];\n if (dateFormats.includes(item.format) && context.output.override.useDates) {\n value = `new Date(${value})`;\n }\n\n return {\n value: getNullable(value, isNullable),\n imports: [],\n name: item.name,\n overrided: false,\n };\n }\n\n const type = getItemType(item);\n const isFakerV9 =\n !!context.output.packageJson &&\n isFakerVersionV9(context.output.packageJson);\n\n switch (type) {\n case 'number':\n case 'integer': {\n const intFunction =\n context.output.override.useBigInt &&\n (item.format === 'int64' || item.format === 'uint64')\n ? 'bigInt'\n : 'int';\n const numMin = (item.exclusiveMinimum ??\n item.minimum ??\n safeMockOptions.numberMin) as number | undefined;\n const numMax = (item.exclusiveMaximum ??\n item.maximum ??\n safeMockOptions.numberMax) as number | undefined;\n const intParts: string[] = [];\n if (numMin !== undefined) intParts.push(`min: ${numMin}`);\n if (numMax !== undefined) intParts.push(`max: ${numMax}`);\n if (isFakerV9 && item.multipleOf !== undefined)\n intParts.push(`multipleOf: ${item.multipleOf}`);\n let value = getNullable(\n `faker.number.${intFunction}(${intParts.length > 0 ? `{${intParts.join(', ')}}` : ''})`,\n isNullable,\n );\n if (type === 'number') {\n const floatParts: string[] = [];\n if (numMin !== undefined) floatParts.push(`min: ${numMin}`);\n if (numMax !== undefined) floatParts.push(`max: ${numMax}`);\n if (isFakerV9 && item.multipleOf !== undefined) {\n floatParts.push(`multipleOf: ${item.multipleOf}`);\n } else if (safeMockOptions.fractionDigits !== undefined) {\n floatParts.push(`fractionDigits: ${safeMockOptions.fractionDigits}`);\n }\n value = getNullable(\n `faker.number.float(${floatParts.length > 0 ? `{${floatParts.join(', ')}}` : ''})`,\n isNullable,\n );\n }\n const numberImports: GeneratorImport[] = [];\n\n if (item.enum) {\n value = getEnum(\n item,\n numberImports,\n context,\n existingReferencedProperties,\n 'number',\n );\n } else if ('const' in item) {\n value = JSON.stringify(item.const);\n }\n\n return {\n value,\n enums: item.enum,\n imports: numberImports,\n name: item.name,\n };\n }\n\n case 'boolean': {\n let value = 'faker.datatype.boolean()';\n if ('const' in item) {\n value = JSON.stringify(item.const);\n }\n return {\n value,\n imports: [],\n name: item.name,\n };\n }\n\n case 'array': {\n if (!item.items) {\n return { value: '[]', imports: [], name: item.name };\n }\n\n if (\n '$ref' in item.items &&\n existingReferencedProperties.includes(\n pascal(item.items.$ref.split('/').pop() ?? ''),\n )\n ) {\n return { value: '[]', imports: [], name: item.name };\n }\n\n const {\n value,\n enums,\n imports: resolvedImports,\n } = resolveMockValue({\n schema: {\n ...item.items,\n name: item.name,\n path: item.path ? `${item.path}.[]` : '#.[]',\n },\n combine,\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n if (enums) {\n return {\n value,\n imports: resolvedImports,\n name: item.name,\n };\n }\n\n let mapValue = value;\n\n if (\n combine &&\n !value.startsWith('faker') &&\n !value.startsWith('{') &&\n !value.startsWith('Array.from')\n ) {\n mapValue = `{${value}}`;\n }\n\n const arrMin = (item.minItems ?? safeMockOptions.arrayMin) as\n | number\n | undefined;\n const arrMax = (item.maxItems ?? safeMockOptions.arrayMax) as\n | number\n | undefined;\n const arrParts: string[] = [];\n if (arrMin !== undefined) arrParts.push(`min: ${arrMin}`);\n if (arrMax !== undefined) arrParts.push(`max: ${arrMax}`);\n const arrLengthArg =\n arrParts.length > 0 ? `{${arrParts.join(', ')}}` : '';\n\n return {\n value:\n `Array.from({ length: faker.number.int(` +\n `${arrLengthArg}) ` +\n `}, (_, i) => i + 1).map(() => (${mapValue}))`,\n imports: resolvedImports,\n name: item.name,\n };\n }\n\n case 'string': {\n const strMin = (item.minLength ?? safeMockOptions.stringMin) as\n | number\n | undefined;\n const strMax = (item.maxLength ?? safeMockOptions.stringMax) as\n | number\n | undefined;\n const strLenParts: string[] = [];\n if (strMin !== undefined) strLenParts.push(`min: ${strMin}`);\n if (strMax !== undefined) strLenParts.push(`max: ${strMax}`);\n const length =\n strLenParts.length > 0 ? `{length: {${strLenParts.join(', ')}}}` : '';\n let value = `faker.string.alpha(${length})`;\n const stringImports: GeneratorImport[] = [];\n\n if (item.enum) {\n value = getEnum(\n item,\n stringImports,\n context,\n existingReferencedProperties,\n 'string',\n );\n } else if (item.pattern) {\n value = `faker.helpers.fromRegExp('${item.pattern}')`;\n } else if ('const' in item) {\n value = JSON.stringify((item as OpenApiSchemaObject).const);\n }\n\n return {\n value: getNullable(value, isNullable),\n enums: item.enum,\n name: item.name,\n imports: stringImports,\n };\n }\n\n case 'null': {\n return {\n value: 'null',\n imports: [],\n name: item.name,\n };\n }\n\n default: {\n if (item.enum) {\n const enumImports: GeneratorImport[] = [];\n const value = getEnum(\n item,\n enumImports,\n context,\n existingReferencedProperties,\n );\n\n return {\n value,\n enums: item.enum,\n imports: enumImports,\n name: item.name,\n };\n }\n\n return getMockObject({\n item,\n mockOptions,\n operationId,\n tags,\n combine: combine\n ? {\n separator: combine.separator,\n includedProperties: [],\n }\n : undefined,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n }\n }\n}\n\nfunction getItemType(item: MockSchemaObject) {\n if (Array.isArray(item.type) && item.type.includes('null')) {\n const typesWithoutNull = item.type.filter((x) => x !== 'null');\n const itemType =\n typesWithoutNull.length === 1 ? typesWithoutNull[0] : typesWithoutNull;\n\n return itemType;\n }\n\n if (item.type) return item.type;\n if (!item.enum) return;\n\n const uniqTypes = new Set(item.enum.map((value) => typeof value));\n if (uniqTypes.size > 1) return;\n\n const type = [...uniqTypes.values()].at(0);\n if (!type) return;\n return ['string', 'number'].includes(type) ? type : undefined;\n}\n\nfunction getEnum(\n item: MockSchemaObject,\n imports: GeneratorImport[],\n context: ContextSpec,\n existingReferencedProperties: string[],\n type?: 'string' | 'number',\n) {\n if (!item.enum) return '';\n const joinedEnumValues = item.enum\n .filter((e) => e !== null) // TODO fix type, e can absolutely be null\n .map((e) =>\n type === 'string' || (type === undefined && isString(e))\n ? `'${escape(e)}'`\n : e,\n )\n .join(',');\n\n let enumValue = `[${joinedEnumValues}]`;\n if (context.output.override.enumGenerationType === EnumGeneration.ENUM) {\n if (item.isRef || existingReferencedProperties.length === 0) {\n enumValue += ` as ${item.name}${item.name.endsWith('[]') ? '' : '[]'}`;\n imports.push({ name: item.name });\n } else {\n enumValue += ` as ${existingReferencedProperties[existingReferencedProperties.length - 1]}['${item.name}']`;\n if (!item.path?.endsWith('[]')) enumValue += '[]';\n imports.push({\n name: existingReferencedProperties[\n existingReferencedProperties.length - 1\n ],\n });\n }\n } else {\n enumValue += ' as const';\n }\n\n // But if the value is a reference, we can use the object directly via the imports and using Object.values.\n if (item.isRef && type === 'string') {\n enumValue = `Object.values(${item.name})`;\n imports.push({\n name: item.name,\n values: true,\n });\n }\n\n return item.path?.endsWith('[]')\n ? `faker.helpers.arrayElements(${enumValue})`\n : `faker.helpers.arrayElement(${enumValue})`;\n}\n","import {\n type ContextSpec,\n type GeneratorImport,\n getRefInfo,\n isReference,\n type MockOptions,\n type OpenApiSchemaObject,\n pascal,\n} from '@orval/core';\nimport { prop } from 'remeda';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { overrideVarName } from '../getters';\nimport { getMockScalar } from '../getters/scalar';\n\nfunction isRegex(key: string) {\n return key.startsWith('/') && key.endsWith('/');\n}\n\nexport function resolveMockOverride(\n properties: Record<string, unknown> | undefined = {},\n item: OpenApiSchemaObject & { name: string; path?: string },\n) {\n const path = item.path ?? `#.${item.name}`;\n const property = Object.entries(properties).find(([key]) => {\n if (isRegex(key)) {\n const regex = new RegExp(key.slice(1, -1));\n if (regex.test(item.name) || regex.test(path)) {\n return true;\n }\n }\n\n if (`#.${key}` === path) {\n return true;\n }\n\n return false;\n });\n\n if (!property) {\n return;\n }\n\n const isNullable = Array.isArray(item.type) && item.type.includes('null');\n\n return {\n value: getNullable(property[1] as string, isNullable),\n imports: [],\n name: item.name,\n overrided: true,\n };\n}\n\nexport function getNullable(value: string, nullable?: boolean) {\n return nullable ? `faker.helpers.arrayElement([${value}, null])` : value;\n}\n\ninterface ResolveMockValueOptions {\n schema: MockSchemaObject;\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n allowOverride?: boolean;\n}\n\nexport function resolveMockValue({\n schema,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n}: ResolveMockValueOptions): MockDefinition & { type?: string } {\n if (isReference(schema)) {\n const { originalName, refPaths } = getRefInfo(schema.$ref, context);\n\n const schemaRef = Array.isArray(refPaths)\n ? (prop(\n context.spec,\n // @ts-expect-error: [ts2556] refPaths are not guaranteed to be valid keys of the spec\n ...refPaths,\n ) as Partial<OpenApiSchemaObject>)\n : undefined;\n\n const newSchema = {\n ...schemaRef,\n name: pascal(originalName),\n path: schema.path,\n isRef: true,\n required: [...(schemaRef?.required ?? []), ...(schema.required ?? [])],\n ...(schema.nullable !== undefined ? { nullable: schema.nullable } : {}),\n };\n\n const newSeparator = newSchema.allOf\n ? 'allOf'\n : newSchema.oneOf\n ? 'oneOf'\n : 'anyOf';\n\n const scalar = getMockScalar({\n item: newSchema,\n mockOptions,\n operationId,\n tags,\n combine: combine\n ? {\n separator:\n combine.separator === 'anyOf' ? newSeparator : combine.separator,\n includedProperties:\n newSeparator === 'allOf' ? [] : combine.includedProperties,\n }\n : undefined,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n if (\n scalar.value &&\n (newSchema.type === 'object' || newSchema.allOf) &&\n combine?.separator === 'oneOf'\n ) {\n const funcName = `get${pascal(operationId)}Response${pascal(newSchema.name)}Mock`;\n if (\n !splitMockImplementations.some((f) =>\n f.includes(`export const ${funcName}`),\n )\n ) {\n const discriminatedProperty = newSchema.discriminator?.propertyName;\n\n let type = `Partial<${newSchema.name}>`;\n if (discriminatedProperty) {\n type = `Omit<${type}, '${discriminatedProperty}'>`;\n }\n\n const args = `${overrideVarName}: ${type} = {}`;\n const func = `export const ${funcName} = (${args}): ${newSchema.name} => ({${scalar.value.startsWith('...') ? '' : '...'}${scalar.value}, ...${overrideVarName}});`;\n splitMockImplementations.push(func);\n }\n\n scalar.value = newSchema.nullable\n ? `${funcName}()`\n : `{...${funcName}()}`;\n\n scalar.imports.push({ name: newSchema.name });\n }\n\n return {\n ...scalar,\n type: getType(newSchema),\n };\n }\n\n const scalar = getMockScalar({\n item: schema,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n allowOverride,\n });\n return {\n ...scalar,\n type: getType(schema),\n };\n}\n\nfunction getType(schema: MockSchemaObject) {\n return (\n (schema.type as string | undefined) ??\n (schema.properties ? 'object' : schema.items ? 'array' : undefined)\n );\n}\n","import {\n type ContextSpec,\n type GeneratorImport,\n isReference,\n isSchema,\n type MockOptions,\n pascal,\n} from '@orval/core';\n\nimport type { MockDefinition, MockSchemaObject } from '../../types';\nimport { resolveMockValue } from '../resolvers';\n\ninterface CombineSchemasMockOptions {\n item: MockSchemaObject;\n separator: 'allOf' | 'oneOf' | 'anyOf';\n operationId: string;\n mockOptions?: MockOptions;\n tags: string[];\n combine?: {\n separator: 'allOf' | 'oneOf' | 'anyOf';\n includedProperties: string[];\n };\n context: ContextSpec;\n imports: GeneratorImport[];\n // This is used to prevent recursion when combining schemas\n // When an element is added to the array, it means on this iteration, we've already seen this property\n existingReferencedProperties: string[];\n splitMockImplementations: string[];\n}\n\nexport function combineSchemasMock({\n item,\n separator,\n mockOptions,\n operationId,\n tags,\n combine,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n}: CombineSchemasMockOptions): MockDefinition {\n const combineImports: GeneratorImport[] = [];\n const includedProperties: string[] = [...(combine?.includedProperties ?? [])];\n\n const isRefAndNotExisting =\n isReference(item) && !existingReferencedProperties.includes(item.name);\n\n const itemResolvedValue =\n isRefAndNotExisting || item.properties\n ? resolveMockValue({\n schema: Object.fromEntries(\n Object.entries(item).filter(([key]) => key !== separator),\n ) as MockSchemaObject,\n combine: {\n separator: 'allOf',\n includedProperties: [],\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n })\n : undefined;\n\n includedProperties.push(...(itemResolvedValue?.includedProperties ?? []));\n combineImports.push(...(itemResolvedValue?.imports ?? []));\n let containsOnlyPrimitiveValues = true;\n\n const allRequiredFields: string[] = [];\n if (separator === 'allOf') {\n if (item.required) {\n allRequiredFields.push(...item.required);\n }\n for (const val of item[separator] ?? []) {\n if (isSchema(val) && val.required) {\n allRequiredFields.push(...val.required);\n }\n }\n }\n\n const value = (item[separator] ?? []).reduce(\n (acc, val, _, arr) => {\n const refName =\n '$ref' in val ? pascal(val.$ref.split('/').pop() ?? '') : '';\n // For allOf: skip if refName is in existingRefs AND this is an inline schema (not a top-level ref)\n // This allows top-level schemas (item.isRef=true) to get base properties from allOf\n // while preventing circular allOf chains in inline property schemas\n const shouldSkipRef =\n separator === 'allOf'\n ? refName &&\n (refName === item.name ||\n (existingReferencedProperties.includes(refName) && !item.isRef))\n : false;\n\n if (shouldSkipRef) {\n if (arr.length === 1) {\n return 'undefined';\n }\n\n return acc;\n }\n\n // the required fields in this schema need to be considered\n // in the sub schema under the allOf key\n if (separator === 'allOf' && allRequiredFields.length > 0) {\n const combinedRequired =\n isSchema(val) && val.required\n ? [...allRequiredFields, ...val.required]\n : allRequiredFields;\n val = { ...val, required: [...new Set(combinedRequired)] };\n }\n\n const resolvedValue = resolveMockValue({\n schema: {\n ...val,\n name: item.name,\n path: item.path ?? '#',\n },\n combine: {\n separator,\n includedProperties:\n separator === 'oneOf'\n ? (itemResolvedValue?.includedProperties ?? [])\n : includedProperties,\n },\n mockOptions,\n operationId,\n tags,\n context,\n imports,\n existingReferencedProperties,\n splitMockImplementations,\n });\n\n combineImports.push(...resolvedValue.imports);\n includedProperties.push(...(resolvedValue.includedProperties ?? []));\n\n if (resolvedValue.value === '{}') {\n containsOnlyPrimitiveValues = false;\n return acc;\n }\n if (separator === 'allOf') {\n if (resolvedValue.value.startsWith('{') || !resolvedValue.type) {\n containsOnlyPrimitiveValues = false;\n return `${acc}...${resolvedValue.value},`;\n } else if (resolvedValue.type === 'object') {\n containsOnlyPrimitiveValues = false;\n return resolvedValue.value.startsWith('faker')\n ? `${acc}...${resolvedValue.value},`\n : `${acc}...{${resolvedValue.value}},`;\n }\n }\n return `${acc}${resolvedValue.value},`;\n },\n separator === 'allOf' ? '' : 'faker.helpers.arrayElement([',\n );\n let finalValue =\n value === 'undefined'\n ? value\n : // containsOnlyPrimitiveValues isn't just true, it's being set to false inside the above reduce and the type system doesn't detect it\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n `${separator === 'allOf' && !containsOnlyPrimitiveValues ? '{' : ''}${value}${separator === 'allOf' ? (containsOnlyPrimitiveValues ? '' : '}') : '])'}`;\n if (itemResolvedValue) {\n finalValue = finalValue.startsWith('...')\n ? `...{${finalValue}, ${itemResolvedValue.value}}`\n : `{...${finalValue}, ${itemResolvedValue.value}}`;\n }\n if (finalValue.endsWith(',')) {\n finalValue = finalValue.slice(0, Math.max(0, finalValue.length - 1));\n }\n\n return {\n value: finalValue,\n imports: combineImports,\n name: item.name,\n includedProperties,\n };\n}\n","import { camel, sanitize } from '@orval/core';\n\nconst hasParam = (path: string): boolean => /[^{]*{[\\w*_-]*}.*/.test(path);\n\nconst getRoutePath = (path: string): string => {\n const matches = /([^{]*){?([\\w*_-]*)}?(.*)/.exec(path);\n if (!matches?.length) return path; // impossible due to regexp grouping here, but for TS\n\n const prev = matches[1];\n const param = sanitize(camel(matches[2]), {\n es5keyword: true,\n underscore: true,\n dash: true,\n dot: true,\n });\n const next = hasParam(matches[3]) ? getRoutePath(matches[3]) : matches[3];\n\n return hasParam(path) ? `${prev}:${param}${next}` : `${prev}${param}${next}`;\n};\n\nexport const getRouteMSW = (route: string, baseUrl = '*') => {\n route = route.replaceAll(':', String.raw`\\:`);\n const splittedRoute = route.split('/');\n\n return splittedRoute.reduce((acc, path, i) => {\n if (!path && !i) {\n return acc;\n }\n\n if (!path.includes('{')) {\n return `${acc}/${path}`;\n }\n\n return `${acc}/${getRoutePath(path)}`;\n }, baseUrl);\n};\n","import {\n type ContextSpec,\n generalJSTypesWithArray,\n type GeneratorImport,\n type GlobalMockOptions,\n isFunction,\n type MockOptions,\n type NormalizedOverrideOutput,\n type OpenApiDocument,\n type OpenApiSchemaObject,\n resolveRef,\n type ResReqTypesValue,\n stringify,\n} from '@orval/core';\n\nimport { getMockScalar } from '../faker/getters';\n\nfunction getMockPropertiesWithoutFunc(properties: any, spec: OpenApiDocument) {\n return Object.entries(\n isFunction(properties) ? properties(spec) : properties,\n ).reduce<Record<string, string>>((acc, [key, value]) => {\n const implementation = isFunction(value)\n ? `(${value})()`\n : stringify(value as string)!;\n\n acc[key] = implementation.replaceAll(\n /import_faker\\.defaults|import_faker\\.faker|_faker\\.faker/g,\n 'faker',\n );\n return acc;\n }, {});\n}\n\nfunction getMockWithoutFunc(\n spec: OpenApiDocument,\n override?: NormalizedOverrideOutput,\n): MockOptions {\n return {\n arrayMin: override?.mock?.arrayMin,\n arrayMax: override?.mock?.arrayMax,\n stringMin: override?.mock?.stringMin,\n stringMax: override?.mock?.stringMax,\n numberMin: override?.mock?.numberMin,\n numberMax: override?.mock?.numberMax,\n required: override?.mock?.required,\n fractionDigits: override?.mock?.fractionDigits,\n ...(override?.mock?.properties\n ? {\n properties: getMockPropertiesWithoutFunc(\n override.mock.properties,\n spec,\n ),\n }\n : {}),\n ...(override?.mock?.format\n ? {\n format: getMockPropertiesWithoutFunc(override.mock.format, spec),\n }\n : {}),\n ...(override?.operations\n ? {\n operations: Object.entries(override.operations).reduce<\n Exclude<MockOptions['operations'], undefined>\n >((acc, [key, value]) => {\n if (value?.mock?.properties) {\n acc[key] = {\n properties: getMockPropertiesWithoutFunc(\n value.mock.properties,\n spec,\n ),\n };\n }\n\n return acc;\n }, {}),\n }\n : {}),\n ...(override?.tags\n ? {\n tags: Object.entries(override.tags).reduce<\n Exclude<MockOptions['tags'], undefined>\n >((acc, [key, value]) => {\n if (value?.mock?.properties) {\n acc[key] = {\n properties: getMockPropertiesWithoutFunc(\n value.mock.properties,\n spec,\n ),\n };\n }\n\n return acc;\n }, {}),\n }\n : {}),\n };\n}\n\nfunction getMockScalarJsTypes(\n definition: string,\n mockOptionsWithoutFunc: Record<string, unknown>,\n) {\n const isArray = definition.endsWith('[]');\n const type = isArray ? definition.slice(0, -2) : definition;\n\n switch (type) {\n case 'number': {\n const numArrParts: string[] = [];\n if (mockOptionsWithoutFunc.arrayMin !== undefined)\n numArrParts.push(`min: ${mockOptionsWithoutFunc.arrayMin}`);\n if (mockOptionsWithoutFunc.arrayMax !== undefined)\n numArrParts.push(`max: ${mockOptionsWithoutFunc.arrayMax}`);\n const numArrArg =\n numArrParts.length > 0 ? `{${numArrParts.join(', ')}}` : '';\n return isArray\n ? `Array.from({length: faker.number.int(${numArrArg})}, () => faker.number.int())`\n : 'faker.number.int()';\n }\n case 'string': {\n const strArrParts: string[] = [];\n if (mockOptionsWithoutFunc?.arrayMin !== undefined)\n strArrParts.push(`min: ${mockOptionsWithoutFunc.arrayMin}`);\n if (mockOptionsWithoutFunc?.arrayMax !== undefined)\n strArrParts.push(`max: ${mockOptionsWithoutFunc.arrayMax}`);\n const strArrArg =\n strArrParts.length > 0 ? `{${strArrParts.join(', ')}}` : '';\n return isArray\n ? `Array.from({length: faker.number.int(${strArrArg})}, () => faker.word.sample())`\n : 'faker.word.sample()';\n }\n default: {\n return 'undefined';\n }\n }\n}\n\ninterface GetResponsesMockDefinitionOptions {\n operationId: string;\n tags: string[];\n returnType: string;\n responses: ResReqTypesValue[];\n imports: GeneratorImport[];\n mockOptionsWithoutFunc: Record<string, unknown>;\n transformer?: (value: unknown, definition: string) => string;\n context: ContextSpec;\n mockOptions?: GlobalMockOptions;\n splitMockImplementations: string[];\n}\n\nexport function getResponsesMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n mockOptionsWithoutFunc,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n}: GetResponsesMockDefinitionOptions) {\n return responses.reduce(\n (\n acc,\n { value: definition, originalSchema, example, examples, imports, isRef },\n ) => {\n if (\n context.output.override.mock?.useExamples ||\n mockOptions?.useExamples\n ) {\n let exampleValue =\n example ??\n originalSchema?.example ??\n Object.values(examples ?? {})[0] ??\n originalSchema?.examples?.[0];\n exampleValue = exampleValue?.value ?? exampleValue;\n if (exampleValue) {\n acc.definitions.push(\n transformer\n ? transformer(exampleValue, returnType)\n : JSON.stringify(exampleValue),\n );\n return acc;\n }\n }\n if (!definition || generalJSTypesWithArray.includes(definition)) {\n const value = getMockScalarJsTypes(definition, mockOptionsWithoutFunc);\n\n acc.definitions.push(\n transformer ? transformer(value, returnType) : value,\n );\n\n return acc;\n }\n\n if (!originalSchema && definition === 'Blob') {\n originalSchema = { type: 'string', format: 'binary' };\n } else if (!originalSchema) {\n return acc;\n }\n\n const resolvedRef = resolveRef<OpenApiSchemaObject>(\n originalSchema,\n context,\n );\n\n const scalar = getMockScalar({\n item: {\n name: definition,\n ...resolvedRef.schema,\n },\n imports,\n mockOptions: mockOptionsWithoutFunc,\n operationId,\n tags,\n context,\n existingReferencedProperties: [],\n splitMockImplementations,\n allowOverride: true,\n });\n\n acc.imports.push(...scalar.imports);\n acc.definitions.push(\n transformer ? transformer(scalar.value, returnType) : scalar.value,\n );\n\n return acc;\n },\n {\n definitions: [] as string[],\n imports: [] as GeneratorImport[],\n },\n );\n}\n\ninterface GetMockDefinitionOptions {\n operationId: string;\n tags: string[];\n returnType: string;\n responses: ResReqTypesValue[];\n imports: GeneratorImport[];\n override: NormalizedOverrideOutput;\n transformer?: (value: unknown, definition: string) => string;\n context: ContextSpec;\n mockOptions?: GlobalMockOptions;\n splitMockImplementations: string[];\n}\n\nexport function getMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n override,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n}: GetMockDefinitionOptions) {\n const mockOptionsWithoutFunc = getMockWithoutFunc(context.spec, override);\n\n const { definitions, imports } = getResponsesMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n mockOptionsWithoutFunc,\n transformer,\n context,\n mockOptions,\n splitMockImplementations,\n });\n\n return {\n definition: '[' + definitions.join(', ') + ']',\n definitions,\n imports,\n };\n}\n\nexport function getMockOptionsDataOverride(\n operationTags: string[],\n operationId: string,\n override: NormalizedOverrideOutput,\n) {\n const responseOverride =\n override.operations[operationId]?.mock?.data ??\n operationTags\n .map((operationTag) => override.tags[operationTag]?.mock?.data)\n .find((e) => e !== undefined);\n const implementation = isFunction(responseOverride)\n ? `(${responseOverride})()`\n : stringify(responseOverride);\n\n return implementation?.replaceAll(\n /import_faker\\.defaults|import_faker\\.faker|_faker\\.faker/g,\n 'faker',\n );\n}\n","import {\n type ClientMockGeneratorBuilder,\n generateDependencyImports,\n type GenerateMockImports,\n type GeneratorDependency,\n type GeneratorImport,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n type GlobalMockOptions,\n isFunction,\n isObject,\n pascal,\n type ResReqTypesValue,\n} from '@orval/core';\n\nimport { getDelay } from '../delay';\nimport { getRouteMSW, overrideVarName } from '../faker/getters';\nimport { getMockDefinition, getMockOptionsDataOverride } from './mocks';\n\nfunction getMSWDependencies(\n options?: GlobalMockOptions,\n): GeneratorDependency[] {\n const hasDelay = options?.delay !== false;\n const locale = options?.locale;\n\n const exports = [\n { name: 'http', values: true },\n { name: 'HttpResponse', values: true },\n { name: 'RequestHandlerOptions', values: false },\n ];\n\n if (hasDelay) {\n exports.push({ name: 'delay', values: true });\n }\n\n return [\n { exports, dependency: 'msw' },\n {\n exports: [{ name: 'faker', values: true }],\n dependency: locale\n ? `@faker-js/faker/locale/${locale}`\n : '@faker-js/faker',\n },\n ];\n}\n\nexport const generateMSWImports: GenerateMockImports = ({\n implementation,\n imports,\n projectName,\n hasSchemaDir,\n isAllowSyntheticDefaultImports,\n options,\n}) => {\n return generateDependencyImports(\n implementation,\n [...getMSWDependencies(options), ...imports],\n projectName,\n hasSchemaDir,\n isAllowSyntheticDefaultImports,\n );\n};\n\nfunction generateDefinition(\n name: string,\n route: string,\n getResponseMockFunctionNameBase: string,\n handlerNameBase: string,\n { operationId, response, verb, tags }: GeneratorVerbOptions,\n { override, context, mock }: GeneratorOptions,\n returnType: string,\n status: string,\n responseImports: GeneratorImport[],\n responses: ResReqTypesValue[],\n contentTypes: string[],\n splitMockImplementations: string[],\n) {\n const oldSplitMockImplementations = [...splitMockImplementations];\n const { definitions, definition, imports } = getMockDefinition({\n operationId,\n tags,\n returnType,\n responses,\n imports: responseImports,\n override,\n context,\n mockOptions: isFunction(mock) ? undefined : mock,\n splitMockImplementations,\n });\n\n const mockData = getMockOptionsDataOverride(tags, operationId, override);\n\n let value = '';\n\n if (mockData) {\n value = mockData;\n } else if (definitions.length > 1) {\n value = `faker.helpers.arrayElement(${definition})`;\n } else if (definitions[0]) {\n value = definitions[0];\n }\n\n const isResponseOverridable = value.includes(overrideVarName);\n const isTextLikeContentType = (ct: string) =>\n ct.startsWith('text/') || ct === 'application/xml' || ct.endsWith('+xml');\n const isTypeExactlyString = (typeExpr: string) =>\n typeExpr.trim().replaceAll(/^\\(+|\\)+$/g, '') === 'string';\n const isUnionContainingString = (typeExpr: string) =>\n typeExpr\n .split('|')\n .map((part) => part.trim().replaceAll(/^\\(+|\\)+$/g, ''))\n .includes('string');\n const isBinaryLikeContentType = (ct: string) =>\n ct === 'application/octet-stream' ||\n ct === 'application/pdf' ||\n ct.startsWith('image/') ||\n ct.startsWith('audio/') ||\n ct.startsWith('video/') ||\n ct.startsWith('font/');\n\n const preferredContentType = isFunction(mock)\n ? undefined\n : (\n mock as { preferredContentType?: string } | undefined\n )?.preferredContentType?.toLowerCase();\n const preferredContentTypeMatch = preferredContentType\n ? contentTypes.find((ct) => ct.toLowerCase() === preferredContentType)\n : undefined;\n const contentTypesByPreference = preferredContentTypeMatch\n ? [preferredContentTypeMatch]\n : contentTypes;\n\n const hasTextLikeContentType = contentTypes.some((ct) =>\n isTextLikeContentType(ct),\n );\n const isExactlyStringReturnType = isTypeExactlyString(returnType);\n\n // Keep text helpers for exact string success return types whenever a text-like\n // media type is available in the declared content types. This prevents a\n // preferredContentType that matches an error media type from forcing\n // HttpResponse.json() for text/plain success responses.\n const isTextResponse =\n (isExactlyStringReturnType && hasTextLikeContentType) ||\n contentTypesByPreference.some((ct) => isTextLikeContentType(ct));\n const isBinaryResponse =\n returnType === 'Blob' ||\n contentTypesByPreference.some((ct) => isBinaryLikeContentType(ct));\n const isReturnHttpResponse = value && value !== 'undefined';\n\n const getResponseMockFunctionName = `${getResponseMockFunctionNameBase}${pascal(\n name,\n )}`;\n const handlerName = `${handlerNameBase}${pascal(name)}`;\n\n const addedSplitMockImplementations = splitMockImplementations.slice(\n oldSplitMockImplementations.length,\n );\n splitMockImplementations.push(...addedSplitMockImplementations);\n const mockImplementations =\n addedSplitMockImplementations.length > 0\n ? `${addedSplitMockImplementations.join('\\n\\n')}\\n\\n`\n : '';\n\n const mockReturnType = isBinaryResponse\n ? returnType.replaceAll(/\\bBlob\\b/g, 'ArrayBuffer')\n : returnType;\n\n const hasJsonContentType = contentTypesByPreference.some(\n (ct) => ct.includes('json') || ct.includes('+json'),\n );\n const hasStringReturnType =\n isTypeExactlyString(mockReturnType) ||\n isUnionContainingString(mockReturnType);\n const overrideResponseType = `Partial<Extract<${mockReturnType}, object>>`;\n const shouldPreferJsonResponse = hasJsonContentType && !hasStringReturnType;\n\n // When the return type is a union containing both string and structured types\n // (e.g. `string | Pet`) AND both text-like and JSON content types are available,\n // we need runtime branching to pick the correct HttpResponse helper based on\n // the actual resolved value type. Without this, objects could be JSON.stringify'd\n // and served under a text-like Content-Type (e.g. xml/html/plain), which is\n // semantically incorrect for structured JSON data.\n const needsRuntimeContentTypeSwitch =\n isTextResponse &&\n hasJsonContentType &&\n hasStringReturnType &&\n mockReturnType !== 'string';\n\n const mockImplementation = isReturnHttpResponse\n ? `${mockImplementations}export const ${getResponseMockFunctionName} = (${\n isResponseOverridable\n ? `overrideResponse: ${overrideResponseType} = {}`\n : ''\n })${mockData ? '' : `: ${mockReturnType}`} => (${value})\\n\\n`\n : mockImplementations;\n\n const delay = getDelay(override, isFunction(mock) ? undefined : mock);\n const infoParam = 'info';\n const resolvedResponseExpr = `overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(${infoParam}) : overrideResponse)\n : ${getResponseMockFunctionName}()`;\n\n const statusCode = status === 'default' ? 200 : status.replace(/XX$/, '00');\n\n // Determine the preferred non-JSON content type for binary responses\n const binaryContentType =\n (preferredContentTypeMatch &&\n isBinaryLikeContentType(preferredContentTypeMatch)\n ? preferredContentTypeMatch\n : contentTypes.find((ct) => isBinaryLikeContentType(ct))) ??\n 'application/octet-stream';\n\n // Pick the most specific MSW response helper based on the first\n // text-like content type so the correct Content-Type header is set.\n // MSW provides HttpResponse.xml() for application/xml and +xml,\n // HttpResponse.html() for text/html, and HttpResponse.text() for\n // all other text/* types.\n const shouldIgnorePreferredForTextHelper =\n isExactlyStringReturnType &&\n !!preferredContentTypeMatch &&\n !isTextLikeContentType(preferredContentTypeMatch) &&\n hasTextLikeContentType;\n const firstTextCt = shouldIgnorePreferredForTextHelper\n ? contentTypes.find((ct) => isTextLikeContentType(ct))\n : contentTypesByPreference.find((ct) => isTextLikeContentType(ct));\n const textHelper =\n firstTextCt === 'application/xml' || firstTextCt?.endsWith('+xml')\n ? 'xml'\n : firstTextCt === 'text/html'\n ? 'html'\n : 'text';\n\n let responseBody: string;\n // Use a prelude to evaluate the override expression once into a temp variable\n // (the expression contains `await` so must not be duplicated)\n let responsePrelude = '';\n if (isBinaryResponse) {\n responsePrelude = `const binaryBody = ${resolvedResponseExpr};`;\n } else if (needsRuntimeContentTypeSwitch) {\n responsePrelude = `const resolvedBody = ${resolvedResponseExpr};`;\n } else if (isTextResponse && !shouldPreferJsonResponse) {\n responsePrelude = `const resolvedBody = ${resolvedResponseExpr};\n const textBody = typeof resolvedBody === 'string' ? resolvedBody : JSON.stringify(resolvedBody ?? null);`;\n }\n if (!isReturnHttpResponse) {\n responseBody = `new HttpResponse(null,\n { status: ${statusCode}\n })`;\n } else if (isBinaryResponse) {\n responseBody = `HttpResponse.arrayBuffer(\n binaryBody instanceof ArrayBuffer\n ? binaryBody\n : new ArrayBuffer(0),\n { status: ${statusCode},\n headers: { 'Content-Type': '${binaryContentType}' }\n })`;\n } else if (needsRuntimeContentTypeSwitch) {\n // Runtime branching: when the resolved value is a string, use the\n // appropriate text helper; otherwise fall back to HttpResponse.json()\n // so objects are never JSON.stringify'd under a text/xml Content-Type.\n responseBody = `typeof resolvedBody === 'string'\n ? HttpResponse.${textHelper}(resolvedBody, { status: ${statusCode} })\n : HttpResponse.json(resolvedBody, { status: ${statusCode} })`;\n } else if (isTextResponse && !shouldPreferJsonResponse) {\n responseBody = `HttpResponse.${textHelper}(textBody,\n { status: ${statusCode}\n })`;\n } else {\n responseBody = `HttpResponse.json(${resolvedResponseExpr},\n { status: ${statusCode}\n })`;\n }\n\n const infoType = `Parameters<Parameters<typeof http.${verb}>[1]>[0]`;\n\n const handlerImplementation = `\nexport const ${handlerName} = (overrideResponse?: ${mockReturnType} | ((${infoParam}: ${infoType}) => Promise<${mockReturnType}> | ${mockReturnType}), options?: RequestHandlerOptions) => {\n return http.${verb}('${route}', async (${infoParam}: ${infoType}) => {${\n delay === false\n ? ''\n : `await delay(${isFunction(delay) ? `(${String(delay)})()` : String(delay)});`\n }\n ${isReturnHttpResponse ? '' : `if (typeof overrideResponse === 'function') {await overrideResponse(info); }`}\n ${responsePrelude}\n return ${responseBody}\n }, options)\n}\\n`;\n\n const includeResponseImports = [\n ...imports,\n ...response.imports.filter((r) => {\n // Only include imports which are actually used in mock.\n const reg = new RegExp(String.raw`\\b${r.name}\\b`);\n return reg.test(handlerImplementation) || reg.test(mockImplementation);\n }),\n ];\n\n return {\n implementation: {\n function: mockImplementation,\n handlerName: handlerName,\n handler: handlerImplementation,\n },\n imports: includeResponseImports,\n };\n}\n\nexport function generateMSW(\n generatorVerbOptions: GeneratorVerbOptions,\n generatorOptions: GeneratorOptions,\n): ClientMockGeneratorBuilder {\n const { pathRoute, override, mock } = generatorOptions;\n const { operationId, response } = generatorVerbOptions;\n\n const route = getRouteMSW(\n pathRoute,\n override.mock?.baseUrl ?? (isFunction(mock) ? undefined : mock?.baseUrl),\n );\n\n const handlerName = `get${pascal(operationId)}MockHandler`;\n const getResponseMockFunctionName = `get${pascal(operationId)}ResponseMock`;\n\n const splitMockImplementations: string[] = [];\n\n const baseDefinition = generateDefinition(\n '',\n route,\n getResponseMockFunctionName,\n handlerName,\n generatorVerbOptions,\n generatorOptions,\n response.definition.success,\n response.types.success[0]?.key ?? '200',\n response.imports,\n response.types.success,\n response.contentTypes,\n splitMockImplementations,\n );\n\n const mockImplementations = [baseDefinition.implementation.function];\n const handlerImplementations = [baseDefinition.implementation.handler];\n const imports = [...baseDefinition.imports];\n\n if (\n generatorOptions.mock &&\n isObject(generatorOptions.mock) &&\n generatorOptions.mock.generateEachHttpStatus\n ) {\n for (const statusResponse of [\n ...response.types.success,\n ...response.types.errors,\n ]) {\n const definition = generateDefinition(\n statusResponse.key,\n route,\n getResponseMockFunctionName,\n handlerName,\n generatorVerbOptions,\n generatorOptions,\n statusResponse.value,\n statusResponse.key,\n response.imports,\n [statusResponse],\n [statusResponse.contentType],\n splitMockImplementations,\n );\n mockImplementations.push(definition.implementation.function);\n handlerImplementations.push(definition.implementation.handler);\n imports.push(...definition.imports);\n }\n }\n\n return {\n implementation: {\n function: mockImplementations.join('\\n'),\n handlerName: handlerName,\n handler: handlerImplementations.join('\\n'),\n },\n imports: imports,\n };\n}\n","import type {\n GenerateMockImports,\n GeneratorOptions,\n GeneratorVerbOptions,\n GlobalMockOptions,\n} from '@orval/core';\n\nimport { generateMSW, generateMSWImports } from './msw';\n\nexport const DEFAULT_MOCK_OPTIONS: GlobalMockOptions = {\n type: 'msw',\n useExamples: false,\n};\n\nexport const generateMockImports: GenerateMockImports = (importOptions) => {\n switch (importOptions.options?.type) {\n default: {\n // case 'msw':\n return generateMSWImports(importOptions);\n }\n }\n};\n\nexport function generateMock(\n generatorVerbOptions: GeneratorVerbOptions,\n generatorOptions: Omit<GeneratorOptions, 'mock'> & {\n mock: GlobalMockOptions;\n },\n) {\n switch (generatorOptions.mock.type) {\n default: {\n // case 'msw':\n return generateMSW(generatorVerbOptions, generatorOptions);\n }\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;AAQA,MAAa,YACX,UACA,YAC+B;CAC/B,MAAM,gBAAgB,UAAU,MAAM,SAAS,SAAS;CACxD,MAAM,2BACJ,UAAU,MAAM,4BAChB,SAAS;AACX,KAAI,WAAW,cAAc,CAC3B,QAAO,2BAA2B,gBAAgB,eAAe;AAEnE,KAAI,SAAS,cAAc,IAAI,UAAU,cAAc,CACrD,QAAO;AAET,QAAO;;;;;ACtBT,SAAS,EAAE,KAAE,GAAG,GAAE;AAAC,QAAO,OAAOA,OAAG,YAAU,OAAOA,OAAG,YAAU,OAAOA,OAAG,YAAS,MAAG,EAAE,GAAEA,KAAE,GAAG,EAAE,GAAC,EAAEA,KAAE,GAAG,EAAE;;AAAC,SAAS,EAAE,KAAE,GAAGC,KAAE;CAAC,IAAI,IAAED;AAAE,MAAI,IAAIA,OAAKC,KAAE;AAAC,MAAG,KAAG,KAAK;AAAO,MAAE,EAAED;;AAAG,QAAO;;;;;ACEzL,MAAM,0BAA0B,gBAA6B;AAC3D,QACE,YAAY,mBAAmB,sBAC/B,YAAY,eAAe,sBAC3B,YAAY,kBAAkB,sBAC9B,YAAY,mBAAmB;;AAInC,MAAa,oBAAoB,gBAA6B;CAC5D,MAAM,UAAU,uBAAuB,YAAY;AAEnD,KAAI,CAAC,QACH,QAAO;CAGT,MAAM,YAAY,QAAQ,MAAM,IAAI,CAAC;AAErC,QAAO,gBAAgB,WAAW,QAAQ;;;;;AClB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/B,iBAAiB,KAAK,uBAEtB,MAAK,MAAM,kBAAkB,CAC3B,GAAG,SAAS,MAAM,SAClB,GAAG,SAAS,MAAM,OACnB,EAAE;EACD,MAAM,aAAa,mBACjB,eAAe,KACf,OACA,6BACA,aACA,sBACA,kBACA,eAAe,OACf,eAAe,KACf,SAAS,SACT,CAAC,eAAe,EAChB,CAAC,eAAe,YAAY,EAC5B,yBACD;AACD,sBAAoB,KAAK,WAAW,eAAe,SAAS;AAC5D,yBAAuB,KAAK,WAAW,eAAe,QAAQ;AAC9D,UAAQ,KAAK,GAAG,WAAW,QAAQ;;AAIvC,QAAO;EACL,gBAAgB;GACd,UAAU,oBAAoB,KAAK,KAAK;GAC3B;GACb,SAAS,uBAAuB,KAAK,KAAK;GAC3C;EACQ;EACV;;;;;AClXH,MAAaC,uBAA0C;CACrD,MAAM;CACN,aAAa;CACd;AAED,MAAaC,uBAA4C,kBAAkB;AACzE,SAAQ,cAAc,SAAS,MAA/B;EACE,QAEE,QAAO,mBAAmB,cAAc;;;AAK9C,SAAgB,aACd,sBACA,kBAGA;AACA,SAAQ,iBAAiB,KAAK,MAA9B;EACE,QAEE,QAAO,YAAY,sBAAsB,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orval/mock",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "nuke": "rimraf .turbo dist node_modules"
22
22
  },
23
23
  "dependencies": {
24
- "@orval/core": "8.3.0"
24
+ "@orval/core": "8.4.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "9.39.2",