@orval/fetch 8.27.0 → 8.28.1

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.d.mts CHANGED
@@ -8,7 +8,7 @@ declare const getFetchDependencies: () => GeneratorDependency[];
8
8
  * paramsSerializer), request body encoding, response parsing, and optional
9
9
  * runtime Zod validation.
10
10
  */
11
- declare const generateRequestFunction: ({ queryParams, headers, operationName, typeName, response, mutator, body, props, verb, fetchReviver, formData, formUrlEncoded, override, doc, paramsSerializer }: GeneratorVerbOptions, { route: _route, context, pathRoute }: GeneratorOptions) => string;
11
+ declare const generateRequestFunction: ({ queryParams, headers, operationName, typeName, response, mutator, body, props, verb, fetchReviver, formData, formUrlEncoded, override, doc, paramsSerializer, params }: GeneratorVerbOptions, { route: _route, context, pathRoute }: GeneratorOptions) => string;
12
12
  /**
13
13
  * Derives the TypeScript response type name for a fetch operation.
14
14
  * Returns the operation-scoped name when `includeHttpResponseReturnType` is
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { GetterPropType, camel, generateBodyOptions, generateFormDataAndUrlEncodedFunction, generateVerbImports, isObject, makeRouteSafe, pascal, resolveRef, stringify, toObjectString } from "@orval/core";
1
+ import { GetterPropType, camel, emitResponseValidation, generateBodyOptions, generateFormDataAndUrlEncodedFunction, generateVerbImports, getSchemaOutputTypeRef, getSchemaValueRef, hasSchemaImport, isObject, isPrimitiveResponseType, makeRouteSafe, pascal, resolveRef, rewriteImportsForResponseValidation, stringify, toObjectString } from "@orval/core";
2
2
  //#region src/index.ts
3
3
  const WILDCARD_STATUS_CODE_REGEX = /^[1-5]XX$/i;
4
4
  const resolveSchemaRef = (schema, context) => resolveRef(schema, context);
@@ -27,9 +27,12 @@ const getRequestOptionsType = (mutator) => {
27
27
  * paramsSerializer), request body encoding, response parsing, and optional
28
28
  * runtime Zod validation.
29
29
  */
30
- const generateRequestFunction = ({ queryParams, headers, operationName, typeName, response, mutator, body, props, verb, fetchReviver, formData, formUrlEncoded, override, doc, paramsSerializer }, { route: _route, context, pathRoute }) => {
30
+ const generateRequestFunction = ({ queryParams, headers, operationName, typeName, response, mutator, body, props, verb, fetchReviver, formData, formUrlEncoded, override, doc, paramsSerializer, params }, { route: _route, context, pathRoute }) => {
31
31
  let route = _route;
32
- if (context.output.urlEncodeParameters) route = makeRouteSafe(route);
32
+ if (context.output.urlEncodeParameters) {
33
+ const skip = new Set(params.filter((p) => p.allowReserved).map((p) => p.name));
34
+ route = makeRouteSafe(route, skip);
35
+ }
33
36
  const isRequestOptions = override.requestOptions !== false;
34
37
  const isFormData = !override.formData.disabled;
35
38
  const isFormUrlEncoded = override.formUrlEncoded !== false;
@@ -149,15 +152,11 @@ ${deepObjectParameters.length > 0 ? " const deepObjectEntries = [];\n" : ""}
149
152
  const responseTypeName = fetchResponseTypeName(override.fetch.includeHttpResponseReturnType, isNdJson ? "Response" : response.definition.success, typeName);
150
153
  const responseType = response.definition.success;
151
154
  const isVoidResponse = responseType === "void";
152
- const isPrimitiveType = [
153
- "string",
154
- "number",
155
- "boolean",
156
- "void",
157
- "unknown"
158
- ].includes(responseType);
159
- const hasSchema = response.imports.some((imp) => imp.name === responseType);
160
- const isValidateResponse = override.fetch.runtimeValidation && !isPrimitiveType && hasSchema && !isNdJson;
155
+ const isPrimitiveType = isPrimitiveResponseType(responseType);
156
+ const hasSchema = hasSchemaImport(response.imports, responseType);
157
+ const isValidateResponse = override.fetch.runtimeValidation.enabled && !isPrimitiveType && hasSchema && !isNdJson;
158
+ const isZodSchemasOutput = isObject(context.output.schemas) && context.output.schemas.type === "zod";
159
+ const useValidatedOutputType = isValidateResponse && isZodSchemasOutput && !mutator;
161
160
  const allResponses = [...response.types.success, ...response.types.errors];
162
161
  if (allResponses.length === 0) allResponses.push({
163
162
  contentType: "",
@@ -178,10 +177,12 @@ ${deepObjectParameters.length > 0 ? " const deepObjectEntries = [];\n" : ""}
178
177
  suffix: pascal(r.contentType)
179
178
  } : r).map((r) => {
180
179
  const name = `${responseTypeName}${pascal(r.key)}${"suffix" in r ? r.suffix : ""}`;
181
- const dataType = r.value || "unknown";
180
+ const isSuccessEntry = response.types.success.some((s) => s.key === r.key);
181
+ const rawDataType = r.value || "unknown";
182
+ const dataType = useValidatedOutputType && isSuccessEntry && rawDataType === responseType && !isContentTypeNdJson(r.contentType) && (r.contentType === "" || isContentTypeJson(r.contentType)) ? getSchemaOutputTypeRef(responseType) : rawDataType;
182
183
  return {
183
184
  name,
184
- success: response.types.success.some((s) => s.key === r.key),
185
+ success: isSuccessEntry,
185
186
  value: `export type ${name} = {
186
187
  ${isContentTypeNdJson(r.contentType) ? `stream: TypedResponse<${dataType}>` : `data: ${dataType}`}
187
188
  status: ${r.key === "default" ? uniqueNonDefaultStatuses.length > 0 ? `Exclude<HTTPStatusCodes, ${uniqueNonDefaultStatuses.join(" | ")}>` : "number" : getStatusCodeType(r.key)}
@@ -209,7 +210,7 @@ ${override.fetch.forceSuccessResponse && hasSuccess ? "" : `export type ${respon
209
210
  const useRuntimeFetcher = override.fetch.useRuntimeFetcher;
210
211
  const fetchFnParam = useRuntimeFetcher && isRequestOptions && !mutator ? ", fetchFn?: typeof globalThis.fetch" : "";
211
212
  const args = `${toObjectString(props, "implementation")} ${isRequestOptions ? getRequestOptionsType(mutator) : ""}${fetchFnParam}`;
212
- const returnType = override.fetch.forceSuccessResponse && hasSuccess && override.fetch.includeHttpResponseReturnType ? `Promise<${successName}>` : `Promise<${responseTypeName}>`;
213
+ const returnType = override.fetch.forceSuccessResponse && hasSuccess && override.fetch.includeHttpResponseReturnType ? `Promise<${successName}>` : `Promise<${useValidatedOutputType && !override.fetch.includeHttpResponseReturnType ? getSchemaOutputTypeRef(responseType) : responseTypeName}>`;
213
214
  const fetchMethodOption = `method: '${verb.toUpperCase()}'`;
214
215
  const ignoreContentTypes = ["multipart/form-data"];
215
216
  const overrideHeaders = isObject(override.requestOptions) && override.requestOptions.headers ? Object.entries(override.requestOptions.headers).map(([key, value]) => `'${key}': \`${value}\``) : [];
@@ -229,7 +230,14 @@ ${override.fetch.forceSuccessResponse && hasSuccess ? "" : `export type ${respon
229
230
  const fetchHeadersOption = headersToAdd.length > 0 ? `headers: { ${headersToAdd.join(",")}, ...getHeaders(options?.headers) }` : "";
230
231
  const requestBodyParams = generateBodyOptions(body, isFormData, isFormUrlEncoded);
231
232
  const fetchBodyOption = requestBodyParams ? isFormData && body.formData || isFormUrlEncoded && body.formUrlEncoded || body.isBlob || isRawRequestBodyContentType(body.contentType) ? `body: ${requestBodyParams}` : `body: JSON.stringify(${requestBodyParams})` : "";
232
- const schemaValueRef = responseType === "Error" ? "ErrorSchema" : responseType;
233
+ const schemaValueRef = getSchemaValueRef(responseType);
234
+ const responseValidationExpression = emitResponseValidation({
235
+ schemaRef: schemaValueRef,
236
+ operationName,
237
+ strategy: override.fetch.runtimeValidation.strategy,
238
+ context: "fetch-assign",
239
+ inputExpression: "parsedBody"
240
+ });
233
241
  const includeZodSchema = isValidateResponse && context.output.override.includeZodSchemaInArguments && isObject(context.output.schemas) && context.output.schemas.type === "zod";
234
242
  const getFetchFnOptions = ({ withSchema = false } = {}) => {
235
243
  const fetchSchemaOption = withSchema && includeZodSchema ? `schema: ${schemaValueRef}` : "";
@@ -278,8 +286,8 @@ ${override.fetch.forceSuccessResponse && hasSuccess ? "" : `export type ${respon
278
286
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
279
287
  ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ""}
280
288
  ${isValidateResponse ? hasMixedSuccessContentTypes ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}
281
- const data = contentType.includes('json') ? ${schemaValueRef}.parse(parsedBody) : parsedBody` : successAlwaysJson ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}
282
- const data = contentType.includes('json') ? ${schemaValueRef}.parse(parsedBody) : parsedBody` : `const parsedBody = body !== null ? body : ''
289
+ const data = contentType.includes('json') ? ${responseValidationExpression} : parsedBody` : successAlwaysJson ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}
290
+ const data = contentType.includes('json') ? ${responseValidationExpression} : parsedBody` : `const parsedBody = body !== null ? body : ''
283
291
  const data = parsedBody` : hasMixedSuccessContentTypes ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ""} = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : ${isVoidResponse ? "undefined" : "{}"}` : successAlwaysJson ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ""} = body ? JSON.parse(body${reviver}) : ${isVoidResponse ? "undefined" : "{}"}` : `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ""} = body !== null ? body : ${isVoidResponse ? "undefined" : "''"}`}
284
292
  ${override.fetch.includeHttpResponseReturnType ? `return { data, status: res.status, headers: ${responseHeadersValue("res")} } as ${fetchResponseType}` : "return data"}
285
293
  `;
@@ -324,21 +332,12 @@ const fetchResponseTypeName = (includeHttpResponseReturnType, definitionSuccessR
324
332
  const generateClient = (verbOptions, options) => {
325
333
  const isZodOutput = typeof options.context.output.schemas === "object" && options.context.output.schemas.type === "zod";
326
334
  const responseType = verbOptions.response.definition.success;
327
- const isPrimitiveResponse = [
328
- "string",
329
- "number",
330
- "boolean",
331
- "void",
332
- "unknown"
333
- ].includes(responseType);
334
- const normalizedVerbOptions = verbOptions.override.fetch.runtimeValidation && isZodOutput && !isPrimitiveResponse && verbOptions.response.imports.some((imp) => imp.name === responseType) ? {
335
+ const isNdJsonResponse = verbOptions.response.contentTypes.some((contentType) => contentType === "application/nd-json" || contentType === "application/x-ndjson");
336
+ const normalizedVerbOptions = verbOptions.override.fetch.runtimeValidation.enabled && isZodOutput && !isNdJsonResponse && !isPrimitiveResponseType(responseType) && hasSchemaImport(verbOptions.response.imports, responseType) ? {
335
337
  ...verbOptions,
336
338
  response: {
337
339
  ...verbOptions.response,
338
- imports: verbOptions.response.imports.map((imp) => imp.name === responseType ? {
339
- ...imp,
340
- values: true
341
- } : imp)
340
+ imports: rewriteImportsForResponseValidation(verbOptions.response.imports, responseType, { includeOutputType: !verbOptions.mutator })
342
341
  }
343
342
  } : verbOptions;
344
343
  const imports = generateVerbImports(normalizedVerbOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n camel,\n type ClientBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n generateBodyOptions,\n generateFormDataAndUrlEncodedFunction,\n generateVerbImports,\n type GeneratorDependency,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n type GeneratorMutator,\n GetterPropType,\n isObject,\n makeRouteSafe,\n type OpenApiParameterObject,\n type OpenApiPathItemObject,\n type OpenApiReferenceObject,\n type OpenApiSchemaObject,\n pascal,\n resolveRef,\n type SharedTypeDeclaration,\n stringify,\n toObjectString,\n} from '@orval/core';\n\nconst WILDCARD_STATUS_CODE_REGEX = /^[1-5]XX$/i;\nconst resolveSchemaRef = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject,\n context: GeneratorOptions['context'],\n) =>\n resolveRef(schema, context) as {\n schema: OpenApiSchemaObject;\n };\n\nconst getStatusCodeType = (key: string): string => {\n if (WILDCARD_STATUS_CODE_REGEX.test(key)) {\n const prefix = key[0];\n return `HTTPStatusCode${prefix}xx`;\n }\n return key;\n};\n\nconst FETCH_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'z',\n alias: 'zod',\n values: true,\n },\n ],\n dependency: 'zod',\n },\n];\n\n/** Returns the list of generator dependencies required by the fetch client (e.g. zod). */\nexport const getFetchDependencies = () => FETCH_DEPENDENCIES;\n\nconst isRawRequestBodyContentType = (contentType: string) =>\n contentType === 'text/plain';\n\nconst getRequestOptionsType = (mutator?: GeneratorMutator) => {\n if (!mutator || !mutator.hasSecondArg) {\n return 'options?: RequestInit';\n }\n\n return mutator.isHook\n ? `options?: Parameters<ReturnType<typeof ${mutator.name}>>[1]`\n : `options?: Parameters<typeof ${mutator.name}>[1]`;\n};\n\n/**\n * Generates the URL helper function and the fetch request function for a single\n * OpenAPI operation. Handles query-param serialization (explode, arrayFormat,\n * paramsSerializer), request body encoding, response parsing, and optional\n * runtime Zod validation.\n */\nexport const generateRequestFunction = (\n {\n queryParams,\n headers,\n operationName,\n typeName,\n response,\n mutator,\n body,\n props,\n verb,\n fetchReviver,\n formData,\n formUrlEncoded,\n override,\n doc,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route: _route, context, pathRoute }: GeneratorOptions,\n) => {\n let route = _route;\n\n if (context.output.urlEncodeParameters) {\n route = makeRouteSafe(route);\n }\n\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n\n const GET_HEADERS_HELPER = ` const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Array.isArray(h)) return Object.fromEntries(h);\n return h;\n };\n`;\n\n const getUrlFnName = camel(`get-${operationName}-url`);\n const getUrlFnProps = toObjectString(\n props.filter(\n (prop) =>\n prop.type === GetterPropType.PARAM ||\n prop.type === GetterPropType.NAMED_PATH_PARAMS ||\n prop.type === GetterPropType.QUERY_PARAM,\n ),\n 'implementation',\n );\n\n const spec = context.spec.paths?.[pathRoute] as\n | OpenApiPathItemObject\n | undefined;\n // Path-item-level parameters apply to every operation under the path, and an\n // operation-level parameter with the same name and location overrides them.\n // Same dedup rule as `getParameters` in core.\n const parameters = [\n ...(spec?.parameters ?? []),\n ...(spec?.[verb]?.parameters ?? []),\n ];\n const parameterObjects = [\n ...new Map(\n parameters.map((parameter) => {\n const { schema } = resolveRef(parameter, context);\n const parameterObject = schema as OpenApiParameterObject;\n return [\n `${parameterObject.in}:${parameterObject.in === 'header' ? parameterObject.name?.toLowerCase() : parameterObject.name}`,\n parameterObject,\n ] as const;\n }),\n ).values(),\n ];\n\n const arrayFormat = override.fetch.arrayFormat;\n\n const isArrayLikeParam = (parameterObject: OpenApiParameterObject) => {\n if (!parameterObject.schema) return false;\n const { schema: schemaObject } = resolveSchemaRef(\n parameterObject.schema,\n context,\n );\n return (\n schemaObject.type === 'array' ||\n (\n (schemaObject.oneOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array') ||\n (\n (schemaObject.anyOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array') ||\n (\n (schemaObject.allOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array')\n );\n };\n\n const explodeParameters = parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' &&\n isArrayLikeParam(parameterObject) &&\n (parameterObject.style ?? 'form') === 'form' &&\n // Respect the OpenAPI default `explode: true` for form-style array query\n // params, but defer params without an explicit `explode` to arrayFormat\n // when an `arrayFormat` override is set.\n (parameterObject.explode ?? true) &&\n !(arrayFormat && parameterObject.explode === undefined),\n );\n\n // Array params where the spec does not explicitly set explode — arrayFormat applies here.\n const arrayFormatParameters = arrayFormat\n ? parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' &&\n isArrayLikeParam(parameterObject) &&\n parameterObject.explode === undefined,\n )\n : [];\n\n const explodeParametersNames = explodeParameters.map(\n (parameter) => parameter.name,\n );\n const arrayFormatParametersNames = arrayFormatParameters.map(\n (parameter) => parameter.name,\n );\n\n const hasExplodedDateParams =\n context.output.override.useDates &&\n explodeParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const hasArrayFormatDateParams =\n context.output.override.useDates &&\n arrayFormatParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const explodeArrayImplementation =\n explodeParameters.length > 0\n ? `const explodeParameters = ${JSON.stringify(explodeParametersNames)};\n\n if (Array.isArray(value) && explodeParameters.includes(key)) {\n value.forEach((v) => {\n normalizedParams.append(key, v === null ? 'null' : ${hasExplodedDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v));\n });\n return;\n }\n `\n : '';\n\n const arrayFormatImplementation =\n arrayFormatParameters.length > 0\n ? `const arrayFormatParameters = ${JSON.stringify(arrayFormatParametersNames)};\n\n if (Array.isArray(value) && arrayFormatParameters.includes(key)) {\n ${\n arrayFormat === 'repeat'\n ? `value.forEach((v) => { normalizedParams.append(key, v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)); });`\n : arrayFormat === 'brackets'\n ? `value.forEach((v) => { normalizedParams.append(key + '[]', v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)); });`\n : `normalizedParams.append(key, value.map((v) => v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)).join(','));`\n }\n return;\n }\n `\n : '';\n\n const deepObjectParameters = parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' && parameterObject.style === 'deepObject',\n );\n\n const deepObjectParameterNames = deepObjectParameters.map(\n (parameter) => parameter.name,\n );\n\n const hasDeepObjectDateParams =\n context.output.override.useDates &&\n deepObjectParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n\n if (!schema.properties) {\n return false;\n }\n\n return Object.values(\n schema.properties as Record<\n string,\n OpenApiSchemaObject | OpenApiReferenceObject\n >,\n ).some((prop) => {\n const { schema: propSchema } = resolveSchemaRef(prop, context);\n return propSchema.format === 'date-time';\n });\n });\n\n const deepObjectImplementation =\n deepObjectParameters.length > 0\n ? `const deepObjectParameters = ${JSON.stringify(deepObjectParameterNames)};\n\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && deepObjectParameters.includes(key)) {\n Object.entries(value).forEach(([subKey, subValue]) => {\n if (subValue !== undefined) {\n deepObjectEntries.push(encodeURIComponent(key) + '[' + encodeURIComponent(subKey) + ']=' + (subValue === null ? 'null' : encodeURIComponent(${hasDeepObjectDateParams ? 'subValue instanceof Date ? subValue.toISOString() : ' : ''}String(subValue))));\n }\n });\n return;\n }\n `\n : '';\n\n const isExplodeParametersOnly =\n explodeParameters.length +\n arrayFormatParameters.length +\n deepObjectParameters.length ===\n parameterObjects.filter((p) => p.in === 'query').length;\n\n const hasDateParams =\n context.output.override.useDates &&\n parameterObjects.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const normalParamsImplementation = `if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : ${hasDateParams ? 'value instanceof Date ? value.toISOString() : ' : ''}String(value))\n }`;\n\n const getUrlFnImplementation = paramsSerializer\n ? `export const ${getUrlFnName} = (${getUrlFnProps}) => {\n${\n queryParams\n ? ` const stringifiedParams = ${paramsSerializer.name}(params);`\n : ''\n}\n\n ${\n queryParams\n ? `return stringifiedParams.length > 0 ? \\`${route}?\\${stringifiedParams}\\` : \\`${route}\\``\n : `return \\`${route}\\``\n }\n}\\n`\n : `export const ${getUrlFnName} = (${getUrlFnProps}) => {\n${\n queryParams\n ? ` const normalizedParams = new URLSearchParams();\n${deepObjectParameters.length > 0 ? ' const deepObjectEntries = [];\\n' : ''}\n Object.entries(params || {}).forEach(([key, value]) => {\n ${explodeArrayImplementation}${arrayFormatImplementation}${deepObjectImplementation}\n ${isExplodeParametersOnly ? '' : normalParamsImplementation}\n });`\n : ''\n}\n\n ${queryParams ? (deepObjectParameters.length > 0 ? `const stringifiedParams = [normalizedParams.toString(), deepObjectEntries.join('&')].filter(Boolean).join('&');` : `const stringifiedParams = normalizedParams.toString();`) : ``}\n\n ${\n queryParams\n ? `return stringifiedParams.length > 0 ? \\`${route}?\\${stringifiedParams}\\` : \\`${route}\\``\n : `return \\`${route}\\``\n }\n}\\n`;\n\n const isContentTypeNdJson = (contentType: string) =>\n contentType === 'application/nd-json' ||\n contentType === 'application/x-ndjson';\n\n const isContentTypeJson = (contentType: string) =>\n contentType.toLowerCase().includes('json');\n\n const isNdJson = response.contentTypes.some((contentType) =>\n isContentTypeNdJson(contentType),\n );\n const isBlob = response.isBlob;\n\n const successContentTypes = response.types.success\n .map((t) => t.contentType)\n .filter(Boolean);\n const errorContentTypes = response.types.errors\n .map((t) => t.contentType)\n .filter(Boolean);\n\n // Resolve parsing strategy at generation time based on spec-declared content types.\n // Only emit a runtime Content-Type check when responses have mixed types.\n //\n // When `forceSuccessResponse` is false the same parse block handles both 2xx\n // and error status codes, so its strategy must cover error content types too\n // (otherwise e.g. 200 application/json + 429 text/plain still JSON.parses text).\n const parseTimeContentTypes = override.fetch.forceSuccessResponse\n ? successContentTypes\n : [...successContentTypes, ...errorContentTypes];\n const successHasJson = parseTimeContentTypes.some((ct) =>\n isContentTypeJson(ct),\n );\n const successHasNonJson = parseTimeContentTypes.some(\n (ct) => !isContentTypeJson(ct),\n );\n const hasMixedSuccessContentTypes = successHasJson && successHasNonJson;\n // No declared content types → fall back to JSON (preserve original behaviour)\n const successAlwaysJson =\n parseTimeContentTypes.length === 0 ||\n (successHasJson && !successHasNonJson);\n\n const errorHasJson = errorContentTypes.some((ct) => isContentTypeJson(ct));\n const errorHasNonJson = errorContentTypes.some(\n (ct) => !isContentTypeJson(ct),\n );\n const hasMixedErrorContentTypes = errorHasJson && errorHasNonJson;\n const errorAlwaysJson =\n errorContentTypes.length === 0 || (errorHasJson && !errorHasNonJson);\n const responseTypeName = fetchResponseTypeName(\n override.fetch.includeHttpResponseReturnType,\n isNdJson ? 'Response' : response.definition.success,\n typeName,\n );\n\n const responseType = response.definition.success;\n const isVoidResponse = responseType === 'void';\n\n const isPrimitiveType = [\n 'string',\n 'number',\n 'boolean',\n 'void',\n 'unknown',\n ].includes(responseType);\n const hasSchema = response.imports.some((imp) => imp.name === responseType);\n\n const isValidateResponse =\n override.fetch.runtimeValidation &&\n !isPrimitiveType &&\n hasSchema &&\n !isNdJson;\n\n const allResponses = [...response.types.success, ...response.types.errors];\n if (allResponses.length === 0) {\n allResponses.push({\n contentType: '',\n hasReadonlyProps: false,\n imports: [],\n isEnum: false,\n isRef: false,\n key: 'default',\n schemas: [],\n type: 'unknown',\n value: 'unknown',\n dependencies: [],\n });\n }\n const nonDefaultStatuses = allResponses\n .filter((r) => r.key !== 'default')\n .map((r) => getStatusCodeType(r.key));\n const uniqueNonDefaultStatuses = [...new Set(nonDefaultStatuses)];\n const responseDataTypes = allResponses\n .map((r) =>\n allResponses.filter((r2) => r2.key === r.key).length > 1\n ? { ...r, suffix: pascal(r.contentType) }\n : r,\n )\n .map((r) => {\n const name = `${responseTypeName}${pascal(r.key)}${'suffix' in r ? r.suffix : ''}`;\n const dataType = r.value || 'unknown';\n\n return {\n name,\n success: response.types.success.some((s) => s.key === r.key),\n value: `export type ${name} = {\n ${isContentTypeNdJson(r.contentType) ? `stream: TypedResponse<${dataType}>` : `data: ${dataType}`}\n status: ${\n r.key === 'default'\n ? uniqueNonDefaultStatuses.length > 0\n ? `Exclude<HTTPStatusCodes, ${uniqueNonDefaultStatuses.join(' | ')}>`\n : 'number'\n : getStatusCodeType(r.key)\n }\n}`,\n };\n });\n\n const successName = `${responseTypeName}Success`;\n const errorName = `${responseTypeName}Error`;\n const hasSuccess = responseDataTypes.some((r) => r.success);\n const hasError = responseDataTypes.some((r) => !r.success);\n\n const responseHeadersType = override.fetch.serializeResponseHeaders\n ? 'Record<string, string>'\n : 'Headers';\n const responseTypeImplementation = override.fetch\n .includeHttpResponseReturnType\n ? `${responseDataTypes.map((r) => r.value).join('\\n\\n')}\n\n${\n hasSuccess\n ? `export type ${successName} = (${responseDataTypes\n .filter((r) => r.success)\n .map((r) => r.name)\n .join(' | ')}) & {\n headers: ${responseHeadersType};\n}`\n : ''\n};\n${\n hasError\n ? `export type ${errorName} = (${responseDataTypes\n .filter((r) => !r.success)\n .map((r) => r.name)\n .join(' | ')}) & {\n headers: ${responseHeadersType};\n}`\n : ''\n};\n\n${override.fetch.forceSuccessResponse && hasSuccess ? '' : `export type ${responseTypeName} = (${hasError && hasSuccess ? `${successName} | ${errorName}` : hasSuccess ? successName : errorName})\\n\\n`}`\n : '';\n\n const getUrlFnProperties = props\n .filter(\n (prop) =>\n prop.type === GetterPropType.PARAM ||\n prop.type === GetterPropType.QUERY_PARAM ||\n prop.type === GetterPropType.NAMED_PATH_PARAMS,\n )\n .map((param) => {\n return param.type === GetterPropType.NAMED_PATH_PARAMS\n ? param.destructured\n : param.name;\n })\n .join(',');\n\n const useRuntimeFetcher = override.fetch.useRuntimeFetcher;\n const fetchFnParam =\n useRuntimeFetcher && isRequestOptions && !mutator\n ? ', fetchFn?: typeof globalThis.fetch'\n : '';\n const args = `${toObjectString(props, 'implementation')} ${isRequestOptions ? getRequestOptionsType(mutator) : ''}${fetchFnParam}`;\n const returnType =\n override.fetch.forceSuccessResponse &&\n hasSuccess &&\n override.fetch.includeHttpResponseReturnType\n ? `Promise<${successName}>`\n : `Promise<${responseTypeName}>`;\n\n const fetchMethodOption = `method: '${verb.toUpperCase()}'`;\n const ignoreContentTypes = ['multipart/form-data'];\n const overrideHeaders =\n isObject(override.requestOptions) && override.requestOptions.headers\n ? Object.entries(override.requestOptions.headers).map(\n ([key, value]) => `'${key}': \\`${value}\\``,\n )\n : [];\n\n const headersToAdd: string[] = [\n ...(body.contentType && !ignoreContentTypes.includes(body.contentType)\n ? [`'Content-Type': '${body.contentType}'`]\n : []),\n ...(isNdJson && response.contentTypes.length === 1\n ? [\n `Accept: ${\n response.contentTypes[0] === 'application/x-ndjson'\n ? \"'application/x-ndjson'\"\n : \"'application/nd-json'\"\n }`,\n ]\n : []),\n ...overrideHeaders,\n ...(headers ? ['...headers'] : []),\n ];\n\n let globalFetchOptions;\n if (isObject(override.requestOptions)) {\n // If both requestOptions and fetchHeadersOptions will be adding a header, we must merge them to avoid multiple properties with the same name\n const shouldMergeFetchOptionHeaders =\n headersToAdd.length > 0 && 'headers' in override.requestOptions;\n const globalFetchOptionsObject = { ...override.requestOptions };\n if (shouldMergeFetchOptionHeaders && override.requestOptions.headers) {\n // Remove the headers from the object going into globalFetchOptions\n delete globalFetchOptionsObject.headers;\n // Add it to the dedicated headers object\n }\n globalFetchOptions = stringify(globalFetchOptionsObject)\n ?.slice(1, -1)\n .trim();\n } else {\n globalFetchOptions = '';\n }\n const fetchHeadersOption =\n headersToAdd.length > 0\n ? `headers: { ${headersToAdd.join(',')}, ...getHeaders(options?.headers) }`\n : '';\n const requestBodyParams = generateBodyOptions(\n body,\n isFormData,\n isFormUrlEncoded,\n );\n const fetchBodyOption = requestBodyParams\n ? (isFormData && body.formData) ||\n (isFormUrlEncoded && body.formUrlEncoded) ||\n body.isBlob ||\n isRawRequestBodyContentType(body.contentType)\n ? `body: ${requestBodyParams}`\n : `body: JSON.stringify(${requestBodyParams})`\n : '';\n const schemaValueRef =\n responseType === 'Error' ? 'ErrorSchema' : responseType;\n // A custom mutator issues the request itself, so it cannot benefit from the\n // generated `Schema.parse()` call. Handing it the zod schema lets it validate\n // the response on its own, but only when the user opted in and the schemas\n // are actually zod ones — the schema is imported as a value in that case.\n const includeZodSchema =\n isValidateResponse &&\n context.output.override.includeZodSchemaInArguments &&\n isObject(context.output.schemas) &&\n context.output.schemas.type === 'zod';\n const getFetchFnOptions = ({ withSchema = false } = {}) => {\n const fetchSchemaOption =\n withSchema && includeZodSchema ? `schema: ${schemaValueRef}` : '';\n\n return `${getUrlFnName}(${getUrlFnProperties}),\n {${globalFetchOptions ? '\\n' : ''} ${globalFetchOptions}\n ${isRequestOptions ? '...options,' : ''}\n ${fetchMethodOption}${fetchHeadersOption ? ',' : ''}\n ${fetchHeadersOption}${fetchBodyOption ? ',' : ''}\n ${fetchBodyOption}${fetchSchemaOption ? `,\\n ${fetchSchemaOption}` : ''}\n }\n`;\n };\n const fetchFnOptions = getFetchFnOptions();\n const mutatorFetchFnOptions = getFetchFnOptions({ withSchema: true });\n const reviver = fetchReviver ? `, ${fetchReviver.name}` : '';\n const fetchResponseType =\n override.fetch.forceSuccessResponse &&\n hasSuccess &&\n override.fetch.includeHttpResponseReturnType\n ? successName\n : responseTypeName;\n\n // Error response fallback always uses {} — error data types vary (e.g. `Error`)\n // and {} satisfies them all without a type error, matching prior behaviour.\n // Use truthy `body` check before JSON.parse so empty string bodies fall back\n // instead of throwing (`JSON.parse('')` is invalid).\n const errorBodyExpression = hasMixedErrorContentTypes\n ? `errorBody ? (errorContentType.includes('json') ? JSON.parse(errorBody${reviver}) : errorBody) : {}`\n : errorAlwaysJson\n ? `errorBody ? JSON.parse(errorBody${reviver}) : {}`\n : `errorBody !== null ? errorBody : {}`;\n\n const throwOnErrorBodyExpression = hasMixedErrorContentTypes\n ? `body ? (errorContentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}`\n : errorAlwaysJson\n ? `body ? JSON.parse(body${reviver}) : {}`\n : `body !== null ? body : ''`;\n\n const throwOnErrorDataExpression = isNdJson\n ? `body ? JSON.parse(body${reviver}) : {}`\n : isBlob\n ? errorBodyExpression\n : throwOnErrorBodyExpression;\n\n // In the forceSuccessResponse path, throwOnErrorImplementation is emitted AFTER\n // `contentType` and `body` are already declared in the outer scope, so we must\n // NOT redeclare them here.\n const throwOnErrorInnerDeclarations = isNdJson\n ? 'const body = [204, 205, 304].includes(stream.status) ? null : await stream.text();'\n : isBlob\n ? `const errorBody = [204, 205, 304].includes(res.status) ? null : await res.text();\n ${hasMixedErrorContentTypes ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();` : ''}`\n : override.fetch.forceSuccessResponse\n ? hasMixedErrorContentTypes\n ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();`\n : ''\n : hasMixedErrorContentTypes\n ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();`\n : 'const body = [204, 205, 304].includes(res.status) ? null : await res.text();';\n\n const throwOnErrorImplementation = `if (!${isNdJson ? 'stream' : 'res'}.ok) {\n ${throwOnErrorInnerDeclarations}\n const err: globalThis.Error & {info?: ${hasError ? `${override.fetch.includeHttpResponseReturnType ? `${errorName}['data']` : responseTypeName}` : 'any'}, status?: number} = new globalThis.Error();\n const data ${hasError ? `: ${override.fetch.includeHttpResponseReturnType ? `${errorName}['data']` : responseTypeName}` : ''} = ${throwOnErrorDataExpression}\n err.info = data;\n err.status = ${isNdJson ? 'stream' : 'res'}.status;\n throw err;\n }`;\n const fetchFnCall =\n useRuntimeFetcher && isRequestOptions ? '(fetchFn ?? fetch)' : 'fetch';\n // Drop `set-cookie`: a dehydrated cache reaches the client. Names are lowercased.\n const responseHeadersValue = (responseVarName: string) =>\n override.fetch.serializeResponseHeaders\n ? `Object.fromEntries([...${responseVarName}.headers.entries()].filter(([name]) => name !== 'set-cookie'))`\n : `${responseVarName}.headers`;\n const blobFetchResponseImplementation = `const res = await ${fetchFnCall}(${fetchFnOptions})\n\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n const body = [204, 205, 304].includes(res.status) ? null : await res.blob();\n const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body as ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''}\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { data, status: res.status, headers: ${responseHeadersValue('res')} } as ${fetchResponseType}`\n : 'return data'\n }\n`;\n const fetchResponseImplementation = isNdJson\n ? ` const stream = await ${fetchFnCall}(${fetchFnOptions});\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { status: stream.status, stream, headers: ${responseHeadersValue('stream')} } as ${fetchResponseType}`\n : `return stream`\n }\n `\n : isBlob\n ? blobFetchResponseImplementation\n : `const res = await ${fetchFnCall}(${fetchFnOptions})\n\n ${hasMixedSuccessContentTypes || (isValidateResponse && successAlwaysJson) ? `const contentType = (res.headers.get('content-type') ?? '').toLowerCase();` : ''}\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n ${\n isValidateResponse\n ? hasMixedSuccessContentTypes\n ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}\n const data = contentType.includes('json') ? ${schemaValueRef}.parse(parsedBody) : parsedBody`\n : successAlwaysJson\n ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}\n const data = contentType.includes('json') ? ${schemaValueRef}.parse(parsedBody) : parsedBody`\n : `const parsedBody = body !== null ? body : ''\n const data = parsedBody`\n : hasMixedSuccessContentTypes\n ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : ${isVoidResponse ? 'undefined' : '{}'}`\n : successAlwaysJson\n ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body ? JSON.parse(body${reviver}) : ${isVoidResponse ? 'undefined' : '{}'}`\n : `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body !== null ? body : ${isVoidResponse ? 'undefined' : \"''\"}`\n }\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { data, status: res.status, headers: ${responseHeadersValue('res')} } as ${fetchResponseType}`\n : 'return data'\n }\n`;\n let customFetchResponseImplementation = `return ${mutator?.name}<${fetchResponseType}>(${mutatorFetchFnOptions});`;\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n if (mutator?.isHook) {\n const hasDefaultName = !mutator.path.includes('#');\n const fetchExportName = hasDefaultName\n ? 'customFetcher'\n : mutator.path.split('#')[1];\n const formattedDeconstructor = hasDefaultName\n ? `customFetcher`\n : `{${fetchExportName}}`;\n customFetchResponseImplementation = `\n const ${formattedDeconstructor} = ${mutator.name}();\n return (${args}) => {\n ${bodyForm}\n return ${fetchExportName}(${mutatorFetchFnOptions});\n }\n `;\n }\n\n const fetchImplementationBody = mutator\n ? customFetchResponseImplementation\n : fetchResponseImplementation;\n\n let fetchImplementation = `export const ${operationName} = async (${args}): ${returnType} => {\n ${bodyForm ? ` ${bodyForm}` : ''}\n ${fetchHeadersOption ? GET_HEADERS_HELPER : ''}${fetchImplementationBody}}\n `;\n if (mutator?.isHook) {\n fetchImplementation = `export const use${pascal(operationName)}Hook = (): (${args}) => ${returnType} => {\n ${fetchHeadersOption ? GET_HEADERS_HELPER : ''}${fetchImplementationBody}}\n `;\n }\n\n return (\n responseTypeImplementation +\n `${getUrlFnImplementation}\\n` +\n `${doc}${fetchImplementation}\\n`\n );\n};\n\n/**\n * Derives the TypeScript response type name for a fetch operation.\n * Returns the operation-scoped name when `includeHttpResponseReturnType` is\n * enabled, otherwise falls back to the success response definition name.\n */\nexport const fetchResponseTypeName = (\n includeHttpResponseReturnType: boolean | undefined,\n definitionSuccessResponse: string,\n typeName: string,\n) => {\n return includeHttpResponseReturnType\n ? `${typeName}Response`\n : definitionSuccessResponse;\n};\n\n/** Builds the full fetch client output (imports + implementation) for one verb. */\nexport const generateClient: ClientBuilder = (verbOptions, options) => {\n const isZodOutput =\n typeof options.context.output.schemas === 'object' &&\n options.context.output.schemas.type === 'zod';\n const responseType = verbOptions.response.definition.success;\n const isPrimitiveResponse = [\n 'string',\n 'number',\n 'boolean',\n 'void',\n 'unknown',\n ].includes(responseType);\n const shouldUseRuntimeValidation =\n verbOptions.override.fetch.runtimeValidation && isZodOutput;\n\n const normalizedVerbOptions =\n shouldUseRuntimeValidation &&\n !isPrimitiveResponse &&\n verbOptions.response.imports.some((imp) => imp.name === responseType)\n ? {\n ...verbOptions,\n response: {\n ...verbOptions.response,\n imports: verbOptions.response.imports.map((imp) =>\n imp.name === responseType ? { ...imp, values: true } : imp,\n ),\n },\n }\n : verbOptions;\n\n const imports = generateVerbImports(normalizedVerbOptions);\n const functionImplementation = generateRequestFunction(\n normalizedVerbOptions,\n options,\n );\n\n return {\n implementation: `${functionImplementation}\\n`,\n imports,\n docComment: '',\n };\n};\n\nconst HTTP_STATUS_CODE_SHARED_TYPES: SharedTypeDeclaration[] = [\n {\n name: 'HTTPStatusCode1xx',\n exported: true,\n code: 'type HTTPStatusCode1xx = 100 | 101 | 102 | 103;',\n },\n {\n name: 'HTTPStatusCode2xx',\n exported: true,\n code: 'type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;',\n },\n {\n name: 'HTTPStatusCode3xx',\n exported: true,\n code: 'type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;',\n },\n {\n name: 'HTTPStatusCode4xx',\n exported: true,\n code: 'type HTTPStatusCode4xx = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451;',\n },\n {\n name: 'HTTPStatusCode5xx',\n exported: true,\n code: 'type HTTPStatusCode5xx = 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;',\n },\n {\n name: 'HTTPStatusCodes',\n exported: true,\n code: 'type HTTPStatusCodes = HTTPStatusCode1xx | HTTPStatusCode2xx | HTTPStatusCode3xx | HTTPStatusCode4xx | HTTPStatusCode5xx;',\n },\n];\n\n/** Emits HTTP status-code union types at the top of the generated file when they are needed. */\nexport const generateFetchHeader: ClientHeaderBuilder = ({\n clientImplementation,\n}) => {\n const needsStatusCodeTypes = /HTTPStatusCode[1-5]xx|<HTTPStatusCodes,/.test(\n clientImplementation,\n );\n if (!needsStatusCodeTypes) return '';\n\n return {\n implementation: '',\n sharedTypes: HTTP_STATUS_CODE_SHARED_TYPES,\n };\n};\n\nconst fetchClientBuilder: ClientGeneratorsBuilder = {\n client: generateClient,\n header: generateFetchHeader,\n dependencies: getFetchDependencies,\n};\n\n/** Returns the fetch client builder factory used by orval's plugin system. */\nexport const builder = () => () => fetchClientBuilder;\n\nexport default builder;\n"],"mappings":";;AA0BA,MAAM,6BAA6B;AACnC,MAAM,oBACJ,QACA,YAEA,WAAW,QAAQ,OAAO;AAI5B,MAAM,qBAAqB,QAAwB;CACjD,IAAI,2BAA2B,KAAK,GAAG,GAErC,OAAO,iBADQ,IAAI,GACY;CAEjC,OAAO;AACT;AAEA,MAAM,qBAA4C,CAChD;CACE,SAAS,CACP;EACE,MAAM;EACN,OAAO;EACP,QAAQ;CACV,CACF;CACA,YAAY;AACd,CACF;;AAGA,MAAa,6BAA6B;AAE1C,MAAM,+BAA+B,gBACnC,gBAAgB;AAElB,MAAM,yBAAyB,YAA+B;CAC5D,IAAI,CAAC,WAAW,CAAC,QAAQ,cACvB,OAAO;CAGT,OAAO,QAAQ,SACX,0CAA0C,QAAQ,KAAK,SACvD,+BAA+B,QAAQ,KAAK;AAClD;;;;;;;AAQA,MAAa,2BACX,EACE,aACA,SACA,eACA,UACA,UACA,SACA,MACA,OACA,MACA,cACA,UACA,gBACA,UACA,KACA,oBAEF,EAAE,OAAO,QAAQ,SAAS,gBACvB;CACH,IAAI,QAAQ;CAEZ,IAAI,QAAQ,OAAO,qBACjB,QAAQ,cAAc,KAAK;CAG7B,MAAM,mBAAmB,SAAS,mBAAmB;CACrD,MAAM,aAAa,CAAC,SAAS,SAAS;CACtC,MAAM,mBAAmB,SAAS,mBAAmB;CAErD,MAAM,qBAAqB;;;;;;;CAQ3B,MAAM,eAAe,MAAM,OAAO,cAAc,KAAK;CACrD,MAAM,gBAAgB,eACpB,M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,MAAa,uBAA4C,EACvD,2BACI;CAIJ,IAAI,CAHyB,0CAA0C,KACrE,oBAEsB,GAAG,OAAO;CAElC,OAAO;EACL,gBAAgB;EAChB,aAAa;CACf;AACF;AAEA,MAAM,qBAA8C;CAClD,QAAQ;CACR,QAAQ;CACR,cAAc;AAChB;;AAGA,MAAa,sBAAsB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n camel,\n type ClientBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n emitResponseValidation,\n generateBodyOptions,\n generateFormDataAndUrlEncodedFunction,\n generateVerbImports,\n type GeneratorDependency,\n getSchemaOutputTypeRef,\n getSchemaValueRef,\n hasSchemaImport,\n isPrimitiveResponseType,\n rewriteImportsForResponseValidation,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n type GeneratorMutator,\n GetterPropType,\n isObject,\n makeRouteSafe,\n type OpenApiParameterObject,\n type OpenApiPathItemObject,\n type OpenApiReferenceObject,\n type OpenApiSchemaObject,\n pascal,\n resolveRef,\n type SharedTypeDeclaration,\n stringify,\n toObjectString,\n} from '@orval/core';\n\nconst WILDCARD_STATUS_CODE_REGEX = /^[1-5]XX$/i;\nconst resolveSchemaRef = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject,\n context: GeneratorOptions['context'],\n) =>\n resolveRef(schema, context) as {\n schema: OpenApiSchemaObject;\n };\n\nconst getStatusCodeType = (key: string): string => {\n if (WILDCARD_STATUS_CODE_REGEX.test(key)) {\n const prefix = key[0];\n return `HTTPStatusCode${prefix}xx`;\n }\n return key;\n};\n\nconst FETCH_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'z',\n alias: 'zod',\n values: true,\n },\n ],\n dependency: 'zod',\n },\n];\n\n/** Returns the list of generator dependencies required by the fetch client (e.g. zod). */\nexport const getFetchDependencies = () => FETCH_DEPENDENCIES;\n\nconst isRawRequestBodyContentType = (contentType: string) =>\n contentType === 'text/plain';\n\nconst getRequestOptionsType = (mutator?: GeneratorMutator) => {\n if (!mutator || !mutator.hasSecondArg) {\n return 'options?: RequestInit';\n }\n\n return mutator.isHook\n ? `options?: Parameters<ReturnType<typeof ${mutator.name}>>[1]`\n : `options?: Parameters<typeof ${mutator.name}>[1]`;\n};\n\n/**\n * Generates the URL helper function and the fetch request function for a single\n * OpenAPI operation. Handles query-param serialization (explode, arrayFormat,\n * paramsSerializer), request body encoding, response parsing, and optional\n * runtime Zod validation.\n */\nexport const generateRequestFunction = (\n {\n queryParams,\n headers,\n operationName,\n typeName,\n response,\n mutator,\n body,\n props,\n verb,\n fetchReviver,\n formData,\n formUrlEncoded,\n override,\n doc,\n paramsSerializer,\n params,\n }: GeneratorVerbOptions,\n { route: _route, context, pathRoute }: GeneratorOptions,\n) => {\n let route = _route;\n\n if (context.output.urlEncodeParameters) {\n const skip = new Set(\n params.filter((p) => p.allowReserved).map((p) => p.name),\n );\n route = makeRouteSafe(route, skip);\n }\n\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n\n const GET_HEADERS_HELPER = ` const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Array.isArray(h)) return Object.fromEntries(h);\n return h;\n };\n`;\n\n const getUrlFnName = camel(`get-${operationName}-url`);\n const getUrlFnProps = toObjectString(\n props.filter(\n (prop) =>\n prop.type === GetterPropType.PARAM ||\n prop.type === GetterPropType.NAMED_PATH_PARAMS ||\n prop.type === GetterPropType.QUERY_PARAM,\n ),\n 'implementation',\n );\n\n const spec = context.spec.paths?.[pathRoute] as\n | OpenApiPathItemObject\n | undefined;\n // Path-item-level parameters apply to every operation under the path, and an\n // operation-level parameter with the same name and location overrides them.\n // Same dedup rule as `getParameters` in core.\n const parameters = [\n ...(spec?.parameters ?? []),\n ...(spec?.[verb]?.parameters ?? []),\n ];\n const parameterObjects = [\n ...new Map(\n parameters.map((parameter) => {\n const { schema } = resolveRef(parameter, context);\n const parameterObject = schema as OpenApiParameterObject;\n return [\n `${parameterObject.in}:${parameterObject.in === 'header' ? parameterObject.name?.toLowerCase() : parameterObject.name}`,\n parameterObject,\n ] as const;\n }),\n ).values(),\n ];\n\n const arrayFormat = override.fetch.arrayFormat;\n\n const isArrayLikeParam = (parameterObject: OpenApiParameterObject) => {\n if (!parameterObject.schema) return false;\n const { schema: schemaObject } = resolveSchemaRef(\n parameterObject.schema,\n context,\n );\n return (\n schemaObject.type === 'array' ||\n (\n (schemaObject.oneOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array') ||\n (\n (schemaObject.anyOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array') ||\n (\n (schemaObject.allOf as\n | (OpenApiSchemaObject | OpenApiReferenceObject)[]\n | undefined) ?? []\n ).some((s) => resolveSchemaRef(s, context).schema.type === 'array')\n );\n };\n\n const explodeParameters = parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' &&\n isArrayLikeParam(parameterObject) &&\n (parameterObject.style ?? 'form') === 'form' &&\n // Respect the OpenAPI default `explode: true` for form-style array query\n // params, but defer params without an explicit `explode` to arrayFormat\n // when an `arrayFormat` override is set.\n (parameterObject.explode ?? true) &&\n !(arrayFormat && parameterObject.explode === undefined),\n );\n\n // Array params where the spec does not explicitly set explode — arrayFormat applies here.\n const arrayFormatParameters = arrayFormat\n ? parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' &&\n isArrayLikeParam(parameterObject) &&\n parameterObject.explode === undefined,\n )\n : [];\n\n const explodeParametersNames = explodeParameters.map(\n (parameter) => parameter.name,\n );\n const arrayFormatParametersNames = arrayFormatParameters.map(\n (parameter) => parameter.name,\n );\n\n const hasExplodedDateParams =\n context.output.override.useDates &&\n explodeParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const hasArrayFormatDateParams =\n context.output.override.useDates &&\n arrayFormatParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const explodeArrayImplementation =\n explodeParameters.length > 0\n ? `const explodeParameters = ${JSON.stringify(explodeParametersNames)};\n\n if (Array.isArray(value) && explodeParameters.includes(key)) {\n value.forEach((v) => {\n normalizedParams.append(key, v === null ? 'null' : ${hasExplodedDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v));\n });\n return;\n }\n `\n : '';\n\n const arrayFormatImplementation =\n arrayFormatParameters.length > 0\n ? `const arrayFormatParameters = ${JSON.stringify(arrayFormatParametersNames)};\n\n if (Array.isArray(value) && arrayFormatParameters.includes(key)) {\n ${\n arrayFormat === 'repeat'\n ? `value.forEach((v) => { normalizedParams.append(key, v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)); });`\n : arrayFormat === 'brackets'\n ? `value.forEach((v) => { normalizedParams.append(key + '[]', v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)); });`\n : `normalizedParams.append(key, value.map((v) => v === null ? 'null' : ${hasArrayFormatDateParams ? 'v instanceof Date ? v.toISOString() : ' : ''}String(v)).join(','));`\n }\n return;\n }\n `\n : '';\n\n const deepObjectParameters = parameterObjects.filter(\n (parameterObject) =>\n parameterObject.in === 'query' && parameterObject.style === 'deepObject',\n );\n\n const deepObjectParameterNames = deepObjectParameters.map(\n (parameter) => parameter.name,\n );\n\n const hasDeepObjectDateParams =\n context.output.override.useDates &&\n deepObjectParameters.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n\n if (!schema.properties) {\n return false;\n }\n\n return Object.values(\n schema.properties as Record<\n string,\n OpenApiSchemaObject | OpenApiReferenceObject\n >,\n ).some((prop) => {\n const { schema: propSchema } = resolveSchemaRef(prop, context);\n return propSchema.format === 'date-time';\n });\n });\n\n const deepObjectImplementation =\n deepObjectParameters.length > 0\n ? `const deepObjectParameters = ${JSON.stringify(deepObjectParameterNames)};\n\n if (typeof value === 'object' && value !== null && !Array.isArray(value) && deepObjectParameters.includes(key)) {\n Object.entries(value).forEach(([subKey, subValue]) => {\n if (subValue !== undefined) {\n deepObjectEntries.push(encodeURIComponent(key) + '[' + encodeURIComponent(subKey) + ']=' + (subValue === null ? 'null' : encodeURIComponent(${hasDeepObjectDateParams ? 'subValue instanceof Date ? subValue.toISOString() : ' : ''}String(subValue))));\n }\n });\n return;\n }\n `\n : '';\n\n const isExplodeParametersOnly =\n explodeParameters.length +\n arrayFormatParameters.length +\n deepObjectParameters.length ===\n parameterObjects.filter((p) => p.in === 'query').length;\n\n const hasDateParams =\n context.output.override.useDates &&\n parameterObjects.some((parameter) => {\n if (!parameter.schema) {\n return false;\n }\n\n const { schema } = resolveSchemaRef(parameter.schema, context);\n return schema.format === 'date-time';\n });\n\n const normalParamsImplementation = `if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : ${hasDateParams ? 'value instanceof Date ? value.toISOString() : ' : ''}String(value))\n }`;\n\n const getUrlFnImplementation = paramsSerializer\n ? `export const ${getUrlFnName} = (${getUrlFnProps}) => {\n${\n queryParams\n ? ` const stringifiedParams = ${paramsSerializer.name}(params);`\n : ''\n}\n\n ${\n queryParams\n ? `return stringifiedParams.length > 0 ? \\`${route}?\\${stringifiedParams}\\` : \\`${route}\\``\n : `return \\`${route}\\``\n }\n}\\n`\n : `export const ${getUrlFnName} = (${getUrlFnProps}) => {\n${\n queryParams\n ? ` const normalizedParams = new URLSearchParams();\n${deepObjectParameters.length > 0 ? ' const deepObjectEntries = [];\\n' : ''}\n Object.entries(params || {}).forEach(([key, value]) => {\n ${explodeArrayImplementation}${arrayFormatImplementation}${deepObjectImplementation}\n ${isExplodeParametersOnly ? '' : normalParamsImplementation}\n });`\n : ''\n}\n\n ${queryParams ? (deepObjectParameters.length > 0 ? `const stringifiedParams = [normalizedParams.toString(), deepObjectEntries.join('&')].filter(Boolean).join('&');` : `const stringifiedParams = normalizedParams.toString();`) : ``}\n\n ${\n queryParams\n ? `return stringifiedParams.length > 0 ? \\`${route}?\\${stringifiedParams}\\` : \\`${route}\\``\n : `return \\`${route}\\``\n }\n}\\n`;\n\n const isContentTypeNdJson = (contentType: string) =>\n contentType === 'application/nd-json' ||\n contentType === 'application/x-ndjson';\n\n const isContentTypeJson = (contentType: string) =>\n contentType.toLowerCase().includes('json');\n\n const isNdJson = response.contentTypes.some((contentType) =>\n isContentTypeNdJson(contentType),\n );\n const isBlob = response.isBlob;\n\n const successContentTypes = response.types.success\n .map((t) => t.contentType)\n .filter(Boolean);\n const errorContentTypes = response.types.errors\n .map((t) => t.contentType)\n .filter(Boolean);\n\n // Resolve parsing strategy at generation time based on spec-declared content types.\n // Only emit a runtime Content-Type check when responses have mixed types.\n //\n // When `forceSuccessResponse` is false the same parse block handles both 2xx\n // and error status codes, so its strategy must cover error content types too\n // (otherwise e.g. 200 application/json + 429 text/plain still JSON.parses text).\n const parseTimeContentTypes = override.fetch.forceSuccessResponse\n ? successContentTypes\n : [...successContentTypes, ...errorContentTypes];\n const successHasJson = parseTimeContentTypes.some((ct) =>\n isContentTypeJson(ct),\n );\n const successHasNonJson = parseTimeContentTypes.some(\n (ct) => !isContentTypeJson(ct),\n );\n const hasMixedSuccessContentTypes = successHasJson && successHasNonJson;\n // No declared content types → fall back to JSON (preserve original behaviour)\n const successAlwaysJson =\n parseTimeContentTypes.length === 0 ||\n (successHasJson && !successHasNonJson);\n\n const errorHasJson = errorContentTypes.some((ct) => isContentTypeJson(ct));\n const errorHasNonJson = errorContentTypes.some(\n (ct) => !isContentTypeJson(ct),\n );\n const hasMixedErrorContentTypes = errorHasJson && errorHasNonJson;\n const errorAlwaysJson =\n errorContentTypes.length === 0 || (errorHasJson && !errorHasNonJson);\n const responseTypeName = fetchResponseTypeName(\n override.fetch.includeHttpResponseReturnType,\n isNdJson ? 'Response' : response.definition.success,\n typeName,\n );\n\n const responseType = response.definition.success;\n const isVoidResponse = responseType === 'void';\n\n const isPrimitiveType = isPrimitiveResponseType(responseType);\n const hasSchema = hasSchemaImport(response.imports, responseType);\n\n const isValidateResponse =\n override.fetch.runtimeValidation.enabled &&\n !isPrimitiveType &&\n hasSchema &&\n !isNdJson;\n const isZodSchemasOutput =\n isObject(context.output.schemas) && context.output.schemas.type === 'zod';\n // The generated parse returns the schema's zod output type, so the declared\n // response type must reference the `XOutput` alias. A custom mutator issues\n // the request itself — the generated parse never runs there — so its\n // declared types keep the schema (input) name.\n const useValidatedOutputType =\n isValidateResponse && isZodSchemasOutput && !mutator;\n\n const allResponses = [...response.types.success, ...response.types.errors];\n if (allResponses.length === 0) {\n allResponses.push({\n contentType: '',\n hasReadonlyProps: false,\n imports: [],\n isEnum: false,\n isRef: false,\n key: 'default',\n schemas: [],\n type: 'unknown',\n value: 'unknown',\n dependencies: [],\n });\n }\n const nonDefaultStatuses = allResponses\n .filter((r) => r.key !== 'default')\n .map((r) => getStatusCodeType(r.key));\n const uniqueNonDefaultStatuses = [...new Set(nonDefaultStatuses)];\n const responseDataTypes = allResponses\n .map((r) =>\n allResponses.filter((r2) => r2.key === r.key).length > 1\n ? { ...r, suffix: pascal(r.contentType) }\n : r,\n )\n .map((r) => {\n const name = `${responseTypeName}${pascal(r.key)}${'suffix' in r ? r.suffix : ''}`;\n const isSuccessEntry = response.types.success.some(\n (s) => s.key === r.key,\n );\n const rawDataType = r.value || 'unknown';\n // An empty contentType falls back to JSON parsing at runtime, so it is\n // validated too (matching `successAlwaysJson`).\n const dataType =\n useValidatedOutputType &&\n isSuccessEntry &&\n rawDataType === responseType &&\n !isContentTypeNdJson(r.contentType) &&\n (r.contentType === '' || isContentTypeJson(r.contentType))\n ? getSchemaOutputTypeRef(responseType)\n : rawDataType;\n\n return {\n name,\n success: isSuccessEntry,\n value: `export type ${name} = {\n ${isContentTypeNdJson(r.contentType) ? `stream: TypedResponse<${dataType}>` : `data: ${dataType}`}\n status: ${\n r.key === 'default'\n ? uniqueNonDefaultStatuses.length > 0\n ? `Exclude<HTTPStatusCodes, ${uniqueNonDefaultStatuses.join(' | ')}>`\n : 'number'\n : getStatusCodeType(r.key)\n }\n}`,\n };\n });\n\n const successName = `${responseTypeName}Success`;\n const errorName = `${responseTypeName}Error`;\n const hasSuccess = responseDataTypes.some((r) => r.success);\n const hasError = responseDataTypes.some((r) => !r.success);\n\n const responseHeadersType = override.fetch.serializeResponseHeaders\n ? 'Record<string, string>'\n : 'Headers';\n const responseTypeImplementation = override.fetch\n .includeHttpResponseReturnType\n ? `${responseDataTypes.map((r) => r.value).join('\\n\\n')}\n\n${\n hasSuccess\n ? `export type ${successName} = (${responseDataTypes\n .filter((r) => r.success)\n .map((r) => r.name)\n .join(' | ')}) & {\n headers: ${responseHeadersType};\n}`\n : ''\n};\n${\n hasError\n ? `export type ${errorName} = (${responseDataTypes\n .filter((r) => !r.success)\n .map((r) => r.name)\n .join(' | ')}) & {\n headers: ${responseHeadersType};\n}`\n : ''\n};\n\n${override.fetch.forceSuccessResponse && hasSuccess ? '' : `export type ${responseTypeName} = (${hasError && hasSuccess ? `${successName} | ${errorName}` : hasSuccess ? successName : errorName})\\n\\n`}`\n : '';\n\n const getUrlFnProperties = props\n .filter(\n (prop) =>\n prop.type === GetterPropType.PARAM ||\n prop.type === GetterPropType.QUERY_PARAM ||\n prop.type === GetterPropType.NAMED_PATH_PARAMS,\n )\n .map((param) => {\n return param.type === GetterPropType.NAMED_PATH_PARAMS\n ? param.destructured\n : param.name;\n })\n .join(',');\n\n const useRuntimeFetcher = override.fetch.useRuntimeFetcher;\n const fetchFnParam =\n useRuntimeFetcher && isRequestOptions && !mutator\n ? ', fetchFn?: typeof globalThis.fetch'\n : '';\n const args = `${toObjectString(props, 'implementation')} ${isRequestOptions ? getRequestOptionsType(mutator) : ''}${fetchFnParam}`;\n const returnType =\n override.fetch.forceSuccessResponse &&\n hasSuccess &&\n override.fetch.includeHttpResponseReturnType\n ? `Promise<${successName}>`\n : `Promise<${\n useValidatedOutputType &&\n !override.fetch.includeHttpResponseReturnType\n ? getSchemaOutputTypeRef(responseType)\n : responseTypeName\n }>`;\n\n const fetchMethodOption = `method: '${verb.toUpperCase()}'`;\n const ignoreContentTypes = ['multipart/form-data'];\n const overrideHeaders =\n isObject(override.requestOptions) && override.requestOptions.headers\n ? Object.entries(override.requestOptions.headers).map(\n ([key, value]) => `'${key}': \\`${value}\\``,\n )\n : [];\n\n const headersToAdd: string[] = [\n ...(body.contentType && !ignoreContentTypes.includes(body.contentType)\n ? [`'Content-Type': '${body.contentType}'`]\n : []),\n ...(isNdJson && response.contentTypes.length === 1\n ? [\n `Accept: ${\n response.contentTypes[0] === 'application/x-ndjson'\n ? \"'application/x-ndjson'\"\n : \"'application/nd-json'\"\n }`,\n ]\n : []),\n ...overrideHeaders,\n ...(headers ? ['...headers'] : []),\n ];\n\n let globalFetchOptions;\n if (isObject(override.requestOptions)) {\n // If both requestOptions and fetchHeadersOptions will be adding a header, we must merge them to avoid multiple properties with the same name\n const shouldMergeFetchOptionHeaders =\n headersToAdd.length > 0 && 'headers' in override.requestOptions;\n const globalFetchOptionsObject = { ...override.requestOptions };\n if (shouldMergeFetchOptionHeaders && override.requestOptions.headers) {\n // Remove the headers from the object going into globalFetchOptions\n delete globalFetchOptionsObject.headers;\n // Add it to the dedicated headers object\n }\n globalFetchOptions = stringify(globalFetchOptionsObject)\n ?.slice(1, -1)\n .trim();\n } else {\n globalFetchOptions = '';\n }\n const fetchHeadersOption =\n headersToAdd.length > 0\n ? `headers: { ${headersToAdd.join(',')}, ...getHeaders(options?.headers) }`\n : '';\n const requestBodyParams = generateBodyOptions(\n body,\n isFormData,\n isFormUrlEncoded,\n );\n const fetchBodyOption = requestBodyParams\n ? (isFormData && body.formData) ||\n (isFormUrlEncoded && body.formUrlEncoded) ||\n body.isBlob ||\n isRawRequestBodyContentType(body.contentType)\n ? `body: ${requestBodyParams}`\n : `body: JSON.stringify(${requestBodyParams})`\n : '';\n const schemaValueRef = getSchemaValueRef(responseType);\n const responseValidationExpression = emitResponseValidation({\n schemaRef: schemaValueRef,\n operationName,\n strategy: override.fetch.runtimeValidation.strategy,\n context: 'fetch-assign',\n inputExpression: 'parsedBody',\n });\n // A custom mutator issues the request itself, so it cannot benefit from the\n // generated `Schema.parse()` call. Handing it the zod schema lets it validate\n // the response on its own, but only when the user opted in and the schemas\n // are actually zod ones — the schema is imported as a value in that case.\n const includeZodSchema =\n isValidateResponse &&\n context.output.override.includeZodSchemaInArguments &&\n isObject(context.output.schemas) &&\n context.output.schemas.type === 'zod';\n const getFetchFnOptions = ({ withSchema = false } = {}) => {\n const fetchSchemaOption =\n withSchema && includeZodSchema ? `schema: ${schemaValueRef}` : '';\n\n return `${getUrlFnName}(${getUrlFnProperties}),\n {${globalFetchOptions ? '\\n' : ''} ${globalFetchOptions}\n ${isRequestOptions ? '...options,' : ''}\n ${fetchMethodOption}${fetchHeadersOption ? ',' : ''}\n ${fetchHeadersOption}${fetchBodyOption ? ',' : ''}\n ${fetchBodyOption}${fetchSchemaOption ? `,\\n ${fetchSchemaOption}` : ''}\n }\n`;\n };\n const fetchFnOptions = getFetchFnOptions();\n const mutatorFetchFnOptions = getFetchFnOptions({ withSchema: true });\n const reviver = fetchReviver ? `, ${fetchReviver.name}` : '';\n const fetchResponseType =\n override.fetch.forceSuccessResponse &&\n hasSuccess &&\n override.fetch.includeHttpResponseReturnType\n ? successName\n : responseTypeName;\n\n // Error response fallback always uses {} — error data types vary (e.g. `Error`)\n // and {} satisfies them all without a type error, matching prior behaviour.\n // Use truthy `body` check before JSON.parse so empty string bodies fall back\n // instead of throwing (`JSON.parse('')` is invalid).\n const errorBodyExpression = hasMixedErrorContentTypes\n ? `errorBody ? (errorContentType.includes('json') ? JSON.parse(errorBody${reviver}) : errorBody) : {}`\n : errorAlwaysJson\n ? `errorBody ? JSON.parse(errorBody${reviver}) : {}`\n : `errorBody !== null ? errorBody : {}`;\n\n const throwOnErrorBodyExpression = hasMixedErrorContentTypes\n ? `body ? (errorContentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}`\n : errorAlwaysJson\n ? `body ? JSON.parse(body${reviver}) : {}`\n : `body !== null ? body : ''`;\n\n const throwOnErrorDataExpression = isNdJson\n ? `body ? JSON.parse(body${reviver}) : {}`\n : isBlob\n ? errorBodyExpression\n : throwOnErrorBodyExpression;\n\n // In the forceSuccessResponse path, throwOnErrorImplementation is emitted AFTER\n // `contentType` and `body` are already declared in the outer scope, so we must\n // NOT redeclare them here.\n const throwOnErrorInnerDeclarations = isNdJson\n ? 'const body = [204, 205, 304].includes(stream.status) ? null : await stream.text();'\n : isBlob\n ? `const errorBody = [204, 205, 304].includes(res.status) ? null : await res.text();\n ${hasMixedErrorContentTypes ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();` : ''}`\n : override.fetch.forceSuccessResponse\n ? hasMixedErrorContentTypes\n ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();`\n : ''\n : hasMixedErrorContentTypes\n ? `const errorContentType = (res.headers.get('content-type') ?? '').toLowerCase();\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();`\n : 'const body = [204, 205, 304].includes(res.status) ? null : await res.text();';\n\n const throwOnErrorImplementation = `if (!${isNdJson ? 'stream' : 'res'}.ok) {\n ${throwOnErrorInnerDeclarations}\n const err: globalThis.Error & {info?: ${hasError ? `${override.fetch.includeHttpResponseReturnType ? `${errorName}['data']` : responseTypeName}` : 'any'}, status?: number} = new globalThis.Error();\n const data ${hasError ? `: ${override.fetch.includeHttpResponseReturnType ? `${errorName}['data']` : responseTypeName}` : ''} = ${throwOnErrorDataExpression}\n err.info = data;\n err.status = ${isNdJson ? 'stream' : 'res'}.status;\n throw err;\n }`;\n const fetchFnCall =\n useRuntimeFetcher && isRequestOptions ? '(fetchFn ?? fetch)' : 'fetch';\n // Drop `set-cookie`: a dehydrated cache reaches the client. Names are lowercased.\n const responseHeadersValue = (responseVarName: string) =>\n override.fetch.serializeResponseHeaders\n ? `Object.fromEntries([...${responseVarName}.headers.entries()].filter(([name]) => name !== 'set-cookie'))`\n : `${responseVarName}.headers`;\n const blobFetchResponseImplementation = `const res = await ${fetchFnCall}(${fetchFnOptions})\n\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n const body = [204, 205, 304].includes(res.status) ? null : await res.blob();\n const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body as ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''}\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { data, status: res.status, headers: ${responseHeadersValue('res')} } as ${fetchResponseType}`\n : 'return data'\n }\n`;\n const fetchResponseImplementation = isNdJson\n ? ` const stream = await ${fetchFnCall}(${fetchFnOptions});\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { status: stream.status, stream, headers: ${responseHeadersValue('stream')} } as ${fetchResponseType}`\n : `return stream`\n }\n `\n : isBlob\n ? blobFetchResponseImplementation\n : `const res = await ${fetchFnCall}(${fetchFnOptions})\n\n ${hasMixedSuccessContentTypes || (isValidateResponse && successAlwaysJson) ? `const contentType = (res.headers.get('content-type') ?? '').toLowerCase();` : ''}\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n ${override.fetch.forceSuccessResponse ? throwOnErrorImplementation : ''}\n ${\n isValidateResponse\n ? hasMixedSuccessContentTypes\n ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}\n const data = contentType.includes('json') ? ${responseValidationExpression} : parsedBody`\n : successAlwaysJson\n ? `const parsedBody = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : {}\n const data = contentType.includes('json') ? ${responseValidationExpression} : parsedBody`\n : `const parsedBody = body !== null ? body : ''\n const data = parsedBody`\n : hasMixedSuccessContentTypes\n ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body ? (contentType.includes('json') ? JSON.parse(body${reviver}) : body) : ${isVoidResponse ? 'undefined' : '{}'}`\n : successAlwaysJson\n ? `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body ? JSON.parse(body${reviver}) : ${isVoidResponse ? 'undefined' : '{}'}`\n : `const data: ${fetchResponseType}${override.fetch.includeHttpResponseReturnType ? `['data']` : ''} = body !== null ? body : ${isVoidResponse ? 'undefined' : \"''\"}`\n }\n ${\n override.fetch.includeHttpResponseReturnType\n ? `return { data, status: res.status, headers: ${responseHeadersValue('res')} } as ${fetchResponseType}`\n : 'return data'\n }\n`;\n let customFetchResponseImplementation = `return ${mutator?.name}<${fetchResponseType}>(${mutatorFetchFnOptions});`;\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n if (mutator?.isHook) {\n const hasDefaultName = !mutator.path.includes('#');\n const fetchExportName = hasDefaultName\n ? 'customFetcher'\n : mutator.path.split('#')[1];\n const formattedDeconstructor = hasDefaultName\n ? `customFetcher`\n : `{${fetchExportName}}`;\n customFetchResponseImplementation = `\n const ${formattedDeconstructor} = ${mutator.name}();\n return (${args}) => {\n ${bodyForm}\n return ${fetchExportName}(${mutatorFetchFnOptions});\n }\n `;\n }\n\n const fetchImplementationBody = mutator\n ? customFetchResponseImplementation\n : fetchResponseImplementation;\n\n let fetchImplementation = `export const ${operationName} = async (${args}): ${returnType} => {\n ${bodyForm ? ` ${bodyForm}` : ''}\n ${fetchHeadersOption ? GET_HEADERS_HELPER : ''}${fetchImplementationBody}}\n `;\n if (mutator?.isHook) {\n fetchImplementation = `export const use${pascal(operationName)}Hook = (): (${args}) => ${returnType} => {\n ${fetchHeadersOption ? GET_HEADERS_HELPER : ''}${fetchImplementationBody}}\n `;\n }\n\n return (\n responseTypeImplementation +\n `${getUrlFnImplementation}\\n` +\n `${doc}${fetchImplementation}\\n`\n );\n};\n\n/**\n * Derives the TypeScript response type name for a fetch operation.\n * Returns the operation-scoped name when `includeHttpResponseReturnType` is\n * enabled, otherwise falls back to the success response definition name.\n */\nexport const fetchResponseTypeName = (\n includeHttpResponseReturnType: boolean | undefined,\n definitionSuccessResponse: string,\n typeName: string,\n) => {\n return includeHttpResponseReturnType\n ? `${typeName}Response`\n : definitionSuccessResponse;\n};\n\n/** Builds the full fetch client output (imports + implementation) for one verb. */\nexport const generateClient: ClientBuilder = (verbOptions, options) => {\n const isZodOutput =\n typeof options.context.output.schemas === 'object' &&\n options.context.output.schemas.type === 'zod';\n const responseType = verbOptions.response.definition.success;\n const isNdJsonResponse = verbOptions.response.contentTypes.some(\n (contentType) =>\n contentType === 'application/nd-json' ||\n contentType === 'application/x-ndjson',\n );\n // ndjson streams skip the generated parse entirely, so their schema import\n // stays type-only and no Output alias is needed.\n const shouldUseRuntimeValidation =\n verbOptions.override.fetch.runtimeValidation.enabled &&\n isZodOutput &&\n !isNdJsonResponse &&\n !isPrimitiveResponseType(responseType) &&\n hasSchemaImport(verbOptions.response.imports, responseType);\n\n const normalizedVerbOptions = shouldUseRuntimeValidation\n ? {\n ...verbOptions,\n response: {\n ...verbOptions.response,\n imports: rewriteImportsForResponseValidation(\n verbOptions.response.imports,\n responseType,\n // A mutator skips the generated parse (it issues the request\n // itself), so the declared types keep the schema (input) name and\n // no Output alias import is needed — but the schema value import\n // stays, for `includeZodSchemaInArguments`.\n { includeOutputType: !verbOptions.mutator },\n ),\n },\n }\n : verbOptions;\n\n const imports = generateVerbImports(normalizedVerbOptions);\n const functionImplementation = generateRequestFunction(\n normalizedVerbOptions,\n options,\n );\n\n return {\n implementation: `${functionImplementation}\\n`,\n imports,\n docComment: '',\n };\n};\n\nconst HTTP_STATUS_CODE_SHARED_TYPES: SharedTypeDeclaration[] = [\n {\n name: 'HTTPStatusCode1xx',\n exported: true,\n code: 'type HTTPStatusCode1xx = 100 | 101 | 102 | 103;',\n },\n {\n name: 'HTTPStatusCode2xx',\n exported: true,\n code: 'type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;',\n },\n {\n name: 'HTTPStatusCode3xx',\n exported: true,\n code: 'type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;',\n },\n {\n name: 'HTTPStatusCode4xx',\n exported: true,\n code: 'type HTTPStatusCode4xx = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451;',\n },\n {\n name: 'HTTPStatusCode5xx',\n exported: true,\n code: 'type HTTPStatusCode5xx = 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;',\n },\n {\n name: 'HTTPStatusCodes',\n exported: true,\n code: 'type HTTPStatusCodes = HTTPStatusCode1xx | HTTPStatusCode2xx | HTTPStatusCode3xx | HTTPStatusCode4xx | HTTPStatusCode5xx;',\n },\n];\n\n/** Emits HTTP status-code union types at the top of the generated file when they are needed. */\nexport const generateFetchHeader: ClientHeaderBuilder = ({\n clientImplementation,\n}) => {\n const needsStatusCodeTypes = /HTTPStatusCode[1-5]xx|<HTTPStatusCodes,/.test(\n clientImplementation,\n );\n if (!needsStatusCodeTypes) return '';\n\n return {\n implementation: '',\n sharedTypes: HTTP_STATUS_CODE_SHARED_TYPES,\n };\n};\n\nconst fetchClientBuilder: ClientGeneratorsBuilder = {\n client: generateClient,\n header: generateFetchHeader,\n dependencies: getFetchDependencies,\n};\n\n/** Returns the fetch client builder factory used by orval's plugin system. */\nexport const builder = () => () => fetchClientBuilder;\n\nexport default builder;\n"],"mappings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AM;EACN,UAAU;EACV,MAAM;CACR;CACA;EACE,MAAM;EACN,UAAU;EACV,MAAM;CACR;CACA;EACE,MAAM;EACN,UAAU;EACV,MAAM;CACR;CACA;EACE,MAAM;EACN,UAAU;EACV,MAAM;CACR;CACA;EACE,MAAM;EACN,UAAU;EACV,MAAM;CACR;AACF;;AAGA,MAAa,uBAA4C,EACvD,2BACI;CAIJ,IAAI,CAHyB,0CAA0C,KACrE,oBAEsB,GAAG,OAAO;CAElC,OAAO;EACL,gBAAgB;EAChB,aAAa;CACf;AACF;AAEA,MAAM,qBAA8C;CAClD,QAAQ;CACR,QAAQ;CACR,cAAc;AAChB;;AAGA,MAAa,sBAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orval/fetch",
3
- "version": "8.27.0",
3
+ "version": "8.28.1",
4
4
  "homepage": "https://orval.dev/docs/guides/fetch",
5
5
  "bugs": {
6
6
  "url": "https://github.com/orval-labs/orval/issues"
@@ -23,11 +23,11 @@
23
23
  "./package.json": "./package.json"
24
24
  },
25
25
  "dependencies": {
26
- "@orval/core": "8.27.0"
26
+ "@orval/core": "8.28.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "rimraf": "6.1.2",
30
30
  "typescript": "6.0.3",
31
- "vite-plus": "0.2.9"
31
+ "vite-plus": "0.3.0"
32
32
  }
33
33
  }