@orval/angular 8.5.3 → 8.6.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/README.md +92 -13
- package/dist/index.d.mts +375 -5
- package/dist/index.mjs +1096 -108
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -4
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n camel,\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientFooterBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ClientTitleBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorDependency,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n isBoolean,\n pascal,\n sanitize,\n toObjectString,\n} from '@orval/core';\n\nconst ANGULAR_DEPENDENCIES = [\n {\n exports: [\n { name: 'HttpClient', values: true },\n { name: 'HttpHeaders', values: true },\n { name: 'HttpParams' },\n { name: 'HttpContext' },\n { name: 'HttpResponse', alias: 'AngularHttpResponse' }, // alias to prevent naming conflict with msw\n { name: 'HttpEvent' },\n ],\n dependency: '@angular/common/http',\n },\n {\n exports: [\n { name: 'Injectable', values: true },\n { name: 'inject', values: true },\n ],\n dependency: '@angular/core',\n },\n {\n exports: [{ name: 'Observable', values: true }],\n dependency: 'rxjs',\n },\n] as const satisfies readonly GeneratorDependency[];\n\nconst PRIMITIVE_RESPONSE_TYPES = [\n 'string',\n 'number',\n 'boolean',\n 'void',\n 'unknown',\n] as const;\n\nconst isPrimitiveResponseType = (typeName: string | undefined): boolean =>\n typeName != undefined &&\n (PRIMITIVE_RESPONSE_TYPES as readonly string[]).includes(typeName);\n\nconst hasSchemaImport = (\n imports: readonly { name: string }[],\n typeName: string | undefined,\n): boolean =>\n typeName != undefined && imports.some((imp) => imp.name === typeName);\n\nconst getSchemaValueRef = (typeName: string): string =>\n typeName === 'Error' ? 'ErrorSchema' : typeName;\n\ntype ReturnTypesToWrite = Map<string, string>;\n\nexport const getAngularDependencies: ClientDependenciesBuilder = () => [\n ...ANGULAR_DEPENDENCIES,\n];\n\nexport const generateAngularTitle: ClientTitleBuilder = (title) => {\n const sanTitle = sanitize(title);\n return `${pascal(sanTitle)}Service`;\n};\n\nconst createAngularHeader =\n (): ClientHeaderBuilder =>\n ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n verbOptions,\n tag,\n }) => {\n const stringTag = tag as string | undefined;\n const relevantVerbs = stringTag\n ? Object.values(verbOptions).filter((v) =>\n v.tags.some((t) => camel(t) === camel(stringTag)),\n )\n : Object.values(verbOptions);\n const hasQueryParams = relevantVerbs.some((v) => v.queryParams);\n return `\n${\n isRequestOptions && !isGlobalMutator\n ? `interface HttpClientOptions {\n readonly headers?: HttpHeaders | Record<string, string | string[]>;\n readonly context?: HttpContext;\n readonly params?:\n | HttpParams\n | Record<string, string | number | boolean | Array<string | number | boolean>>;\n readonly reportProgress?: boolean;\n readonly withCredentials?: boolean;\n readonly credentials?: RequestCredentials;\n readonly keepalive?: boolean;\n readonly priority?: RequestPriority;\n readonly cache?: RequestCache;\n readonly mode?: RequestMode;\n readonly redirect?: RequestRedirect;\n readonly referrer?: string;\n readonly integrity?: string;\n readonly referrerPolicy?: ReferrerPolicy;\n readonly transferCache?: {includeHeaders?: string[]} | boolean;\n}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody() : ''}`\n : ''\n}\n\n${\n isRequestOptions && isMutator\n ? `// eslint-disable-next-line\n type ThirdParameter<T extends (...args: any) => any> = T extends (\n config: any,\n httpClient: any,\n args: infer P,\n) => any\n ? P\n : never;`\n : ''\n}\n\n@Injectable(${provideIn ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }` : ''})\nexport class ${title} {\n private readonly http = inject(HttpClient);\n`;\n };\n\nexport const generateAngularHeader: ClientHeaderBuilder = (params) =>\n createAngularHeader()(params);\n\nconst standaloneFooterReturnTypesToWrite = new Map<string, string>();\n\nconst createAngularFooter =\n (returnTypesToWrite: ReturnTypesToWrite): ClientFooterBuilder =>\n ({ operationNames }) => {\n let footer = '}\\n\\n';\n\n for (const operationName of operationNames) {\n if (returnTypesToWrite.has(operationName)) {\n // Map.has ensures Map.get will not return undefined, but TS still complains\n // bug https://github.com/microsoft/TypeScript/issues/13086\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n footer += returnTypesToWrite.get(operationName) + '\\n';\n }\n }\n\n return footer;\n };\n\nexport const generateAngularFooter: ClientFooterBuilder = (params) =>\n createAngularFooter(standaloneFooterReturnTypesToWrite)(params);\n\nconst generateImplementation = (\n returnTypesToWrite: ReturnTypesToWrite,\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props,\n verb,\n override,\n formData,\n formUrlEncoded,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route, context }: GeneratorOptions,\n) => {\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n const dataType = response.definition.success || 'unknown';\n\n // Detect if Zod runtime validation should be applied\n const isPrimitiveType = isPrimitiveResponseType(dataType);\n const hasSchema = hasSchemaImport(response.imports, dataType);\n const isZodOutput =\n typeof context.output.schemas === 'object' &&\n context.output.schemas.type === 'zod';\n const shouldValidateResponse =\n override.angular.runtimeValidation &&\n isZodOutput &&\n !isPrimitiveType &&\n hasSchema;\n const schemaValueRef = shouldValidateResponse\n ? getSchemaValueRef(dataType)\n : dataType;\n // The observe-mode branches use <TData> generics, so cast the parse\n // result to keep TypeScript happy. The multi-content-type branch uses\n // concrete types and does not need the cast (see jsonValidationPipe).\n const validationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data) as TData))`\n : '';\n\n returnTypesToWrite.set(\n operationName,\n `export type ${pascal(\n operationName,\n )}ClientResult = NonNullable<${dataType}>`,\n );\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal: false,\n isExactOptionalPropertyTypes,\n isAngular: true,\n });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasThirdArg,\n )\n : '';\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(String.raw`(\\w*):\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return ` ${operationName}<TData = ${dataType}>(\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasThirdArg\n ? `options?: ThirdParameter<typeof ${mutator.name}>`\n : ''\n }) {${bodyForm}\n return ${mutator.name}<TData>(\n ${mutatorConfig},\n this.http,\n ${requestOptions});\n }\n `;\n }\n\n const optionsBase = {\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override.paramsSerializerOptions,\n isAngular: true,\n isExactOptionalPropertyTypes,\n hasSignal: false,\n } as const;\n\n const propsDefinition = toObjectString(props, 'definition');\n\n // Check for multiple content types in success responses\n const successTypes = response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n const hasMultipleContentTypes = uniqueContentTypes.length > 1;\n\n // When observe branching is active AND there are query params, extract\n // the params computation to a local const to avoid duplicating it in\n // every observe branch.\n const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;\n const angularParamsRef =\n needsObserveBranching && queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n const callExpr = getAngularFilteredParamsCallExpression(\n '{...params, ...options?.params}',\n queryParams.requiredNullableKeys ?? [],\n );\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${callExpr});\\n\\n `\n : `const ${angularParamsRef} = ${callExpr};\\n\\n `;\n }\n\n const optionsInput = {\n ...optionsBase,\n ...(angularParamsRef ? { angularParamsRef } : {}),\n } as const;\n\n const options = generateOptions(optionsInput);\n\n // For multiple content types, determine the default\n const defaultContentType = hasMultipleContentTypes\n ? uniqueContentTypes.includes('text/plain')\n ? 'text/plain'\n : getDefaultContentType(uniqueContentTypes)\n : (uniqueContentTypes[0] ?? 'application/json');\n const getContentTypeReturnType = (\n contentType: string | undefined,\n value: string,\n ): string => {\n if (!contentType) {\n return value;\n }\n\n if (contentType.includes('json') || contentType.includes('+json')) {\n return value;\n }\n\n if (contentType.startsWith('text/') || contentType.includes('xml')) {\n return 'string';\n }\n\n return 'Blob';\n };\n\n const jsonSuccessValues = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n\n const jsonReturnType =\n jsonSuccessValues.length > 0 ? jsonSuccessValues.join(' | ') : 'unknown';\n\n // For multi-content-type operations the overall dataType may be primitive\n // (e.g., 'string' when text/plain is the first content type) but the JSON\n // branch still needs validation against its own schema. Multi-content-type\n // branches use concrete return types (not <TData>), so no generic cast.\n let jsonValidationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data)))`\n : '';\n if (\n hasMultipleContentTypes &&\n !shouldValidateResponse &&\n override.angular.runtimeValidation &&\n isZodOutput &&\n jsonSuccessValues.length === 1\n ) {\n const jsonType = jsonSuccessValues[0];\n const jsonIsPrimitive = isPrimitiveResponseType(jsonType);\n const jsonHasSchema = hasSchemaImport(response.imports, jsonType);\n if (!jsonIsPrimitive && jsonHasSchema) {\n const jsonSchemaRef = getSchemaValueRef(jsonType);\n jsonValidationPipe = `.pipe(map(data => ${jsonSchemaRef}.parse(data)))`;\n }\n }\n\n const multiImplementationReturnType = `Observable<${jsonReturnType} | string | Blob>`;\n\n const observeOptions = needsObserveBranching\n ? {\n body: generateOptions({ ...optionsInput, angularObserve: 'body' }),\n events: generateOptions({ ...optionsInput, angularObserve: 'events' }),\n response: generateOptions({\n ...optionsInput,\n angularObserve: 'response',\n }),\n }\n : undefined;\n\n const isModelType = dataType !== 'Blob' && dataType !== 'string';\n let functionName = operationName;\n if (isModelType && !hasMultipleContentTypes) {\n functionName += `<TData = ${dataType}>`;\n }\n\n let contentTypeOverloads = '';\n if (hasMultipleContentTypes && isRequestOptions) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n contentTypeOverloads = successTypes\n .filter((t) => t.contentType)\n .map(({ contentType, value }) => {\n const returnType = getContentTypeReturnType(contentType, value);\n const requiredPart = requiredProps\n .map((p) => p.definition)\n .join(',\\n ');\n const acceptPart = `accept: '${contentType}'`;\n const optionalPart = optionalProps\n .map((p) => p.definition)\n .join(',\\n ');\n\n const allParams = [requiredPart, acceptPart, optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n return `${operationName}(${allParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n })\n .join('\\n ');\n\n const requiredPart = requiredProps.map((p) => p.definition).join(',\\n ');\n const optionalPart = optionalProps.map((p) => p.definition).join(',\\n ');\n const allParams = [requiredPart, 'accept?: string', optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n contentTypeOverloads += `\\n ${operationName}(${allParams}, options?: HttpClientOptions): ${multiImplementationReturnType};`;\n }\n\n const observeOverloads =\n isRequestOptions && !hasMultipleContentTypes\n ? `${functionName}(${propsDefinition} options?: HttpClientOptions & { observe?: 'body' }): Observable<${isModelType ? 'TData' : dataType}>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'events' }): Observable<HttpEvent<${isModelType ? 'TData' : dataType}>>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'response' }): Observable<AngularHttpResponse<${isModelType ? 'TData' : dataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = isModelType ? 'TData' : dataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n const requiredPart = requiredProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const optionalPart = optionalProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const allParams = [\n requiredPart,\n `accept: string = '${defaultContentType}'`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return ` ${overloads}\n ${operationName}(\n ${allParams},\n ${isRequestOptions ? 'options?: HttpClientOptions' : ''}\n ): ${multiImplementationReturnType} {${bodyForm}\n const headers = options?.headers instanceof HttpHeaders\n ? options.headers.set('Accept', accept)\n : { ...(options?.headers ?? {}), Accept: accept };\n\n if (accept.includes('json') || accept.includes('+json')) {\n return this.http.${verb}<${jsonReturnType}>(\\`${route}\\`, {\n ...options,\n responseType: 'json',\n headers,\n })${jsonValidationPipe};\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'text',\n headers,\n }) as Observable<string>;\n } else {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'blob',\n headers,\n }) as Observable<Blob>;\n }\n }\n`;\n }\n\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.events ?? options\n });\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.response ?? options\n });\n }\n\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.body ?? options\n })${validationPipe};`\n : `return this.http.${verb}${isModelType ? '<TData>' : ''}(${options})${validationPipe};`;\n\n return ` ${overloads}\n ${functionName}(\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions\n ? `options?: HttpClientOptions & { observe?: 'body' | 'events' | 'response' }`\n : ''\n }): ${singleImplementationReturnType} {${bodyForm}\n ${observeImplementation}\n }\n`;\n};\n\nconst createAngularClient =\n (returnTypesToWrite: ReturnTypesToWrite): ClientBuilder =>\n (verbOptions, options, _outputClient, _output) => {\n // Keep signature aligned with ClientBuilder without tripping TS noUnusedParameters\n void _outputClient;\n void _output;\n\n // Detect if Zod runtime validation should be applied\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 = isPrimitiveResponseType(responseType);\n const shouldUseRuntimeValidation =\n verbOptions.override.angular.runtimeValidation && isZodOutput;\n\n // Promote schema import from type-only to value import when runtime\n // validation is active, so the generated code can call Schema.parse()\n const normalizedVerbOptions = (() => {\n if (!shouldUseRuntimeValidation) return verbOptions;\n\n let result = verbOptions;\n\n // Promote the primary response schema\n if (\n !isPrimitiveResponse &&\n hasSchemaImport(result.response.imports, responseType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: result.response.imports.map((imp) =>\n imp.name === responseType ? { ...imp, values: true } : imp,\n ),\n },\n };\n }\n\n // For multi-content-type operations, also promote the JSON-specific\n // schema even when the primary content type is non-JSON (e.g.,\n // showPetById where text/plain is the default but application/json\n // returns Pet which needs .parse()).\n const successTypes = result.response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n if (uniqueContentTypes.length > 1) {\n const jsonSchemaNames = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') ||\n contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n if (jsonSchemaNames.length === 1) {\n const jsonType = jsonSchemaNames[0];\n const jsonIsPrimitive = isPrimitiveResponseType(jsonType);\n if (\n !jsonIsPrimitive &&\n hasSchemaImport(result.response.imports, jsonType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: result.response.imports.map((imp) =>\n imp.name === jsonType ? { ...imp, values: true } : imp,\n ),\n },\n };\n }\n }\n }\n\n return result;\n })();\n\n const implementation = generateImplementation(\n returnTypesToWrite,\n normalizedVerbOptions,\n options,\n );\n\n const imports = [\n ...generateVerbImports(normalizedVerbOptions),\n ...(implementation.includes('.pipe(map(')\n ? [{ name: 'map', values: true, importPath: 'rxjs' }]\n : []),\n ];\n\n return { implementation, imports };\n };\n\nconst standaloneReturnTypesToWrite = new Map<string, string>();\n\nexport const generateAngular: ClientBuilder = (\n verbOptions,\n options,\n outputClient,\n output,\n) =>\n createAngularClient(standaloneReturnTypesToWrite)(\n verbOptions,\n options,\n outputClient,\n output,\n );\n\nconst createAngularClientBuilder = (): ClientGeneratorsBuilder => {\n const returnTypesToWrite = new Map<string, string>();\n\n return {\n client: createAngularClient(returnTypesToWrite),\n header: createAngularHeader(),\n dependencies: getAngularDependencies,\n footer: createAngularFooter(returnTypesToWrite),\n title: generateAngularTitle,\n };\n};\n\nexport const builder: () => () => ClientGeneratorsBuilder = () => {\n return () => createAngularClientBuilder();\n};\n\nexport default builder;\n"],"mappings":";;;AAyBA,MAAM,uBAAuB;CAC3B;EACE,SAAS;GACP;IAAE,MAAM;IAAc,QAAQ;IAAM;GACpC;IAAE,MAAM;IAAe,QAAQ;IAAM;GACrC,EAAE,MAAM,cAAc;GACtB,EAAE,MAAM,eAAe;GACvB;IAAE,MAAM;IAAgB,OAAO;IA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emaOutputTypeRef","getContentTypeReturnType"],"sources":["../src/constants.ts","../src/types.ts","../src/utils.ts","../src/http-client.ts","../src/http-resource.ts","../src/index.ts"],"sourcesContent":["import type { GeneratorDependency } from '@orval/core';\n\nexport const ANGULAR_HTTP_CLIENT_DEPENDENCIES = [\n {\n exports: [\n { name: 'HttpClient', values: true },\n { name: 'HttpHeaders', values: true },\n { name: 'HttpParams' },\n { name: 'HttpContext' },\n { name: 'HttpResponse', alias: 'AngularHttpResponse', values: true }, // alias to prevent naming conflict with msw\n { name: 'HttpEvent' },\n ],\n dependency: '@angular/common/http',\n },\n {\n exports: [\n { name: 'Injectable', values: true },\n { name: 'inject', values: true },\n ],\n dependency: '@angular/core',\n },\n {\n exports: [{ name: 'Observable', values: true }],\n dependency: 'rxjs',\n },\n] as const satisfies readonly GeneratorDependency[];\n\nexport const ANGULAR_HTTP_RESOURCE_DEPENDENCIES = [\n {\n exports: [\n { name: 'httpResource', values: true },\n { name: 'HttpResourceOptions' },\n { name: 'HttpResourceRef' },\n { name: 'HttpResourceRequest' },\n { name: 'HttpHeaders', values: true },\n { name: 'HttpParams' },\n { name: 'HttpContext' },\n ],\n dependency: '@angular/common/http',\n },\n {\n exports: [{ name: 'Signal' }, { name: 'ResourceStatus' }],\n dependency: '@angular/core',\n },\n] as const satisfies readonly GeneratorDependency[];\n","/**\n * Code template for the `HttpClientOptions` interface emitted into generated files.\n *\n * This is NOT an import of Angular's type — Angular's HttpClient methods accept\n * inline option objects, not a single unified interface. Orval generates this\n * convenience wrapper so users have a single referenceable type.\n *\n * Properties sourced from Angular HttpClient public API (angular/angular\n * packages/common/http/src/client.ts).\n */\nexport const HTTP_CLIENT_OPTIONS_TEMPLATE = `interface HttpClientOptions {\n readonly headers?: HttpHeaders | Record<string, string | string[]>;\n readonly context?: HttpContext;\n readonly params?:\n | HttpParams\n | Record<string, string | number | boolean | Array<string | number | boolean>>;\n readonly reportProgress?: boolean;\n readonly withCredentials?: boolean;\n readonly credentials?: RequestCredentials;\n readonly keepalive?: boolean;\n readonly priority?: RequestPriority;\n readonly cache?: RequestCache;\n readonly mode?: RequestMode;\n readonly redirect?: RequestRedirect;\n readonly referrer?: string;\n readonly integrity?: string;\n readonly referrerPolicy?: ReferrerPolicy;\n readonly transferCache?: {includeHeaders?: string[]} | boolean;\n readonly timeout?: number;\n}`;\n\n/**\n * Code templates for reusable observe option helpers emitted into generated files.\n */\nexport const HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE = `type HttpClientBodyOptions = HttpClientOptions & {\n readonly observe?: 'body';\n};\n\ntype HttpClientEventOptions = HttpClientOptions & {\n readonly observe: 'events';\n};\n\ntype HttpClientResponseOptions = HttpClientOptions & {\n readonly observe: 'response';\n};\n\ntype HttpClientObserveOptions = HttpClientOptions & {\n readonly observe?: 'body' | 'events' | 'response';\n};`;\n\n/**\n * Code template for the `ThirdParameter` utility type used with custom mutators.\n */\nexport const THIRD_PARAMETER_TEMPLATE = `// eslint-disable-next-line\n type ThirdParameter<T extends (...args: never[]) => unknown> = T extends (\n config: unknown,\n httpClient: unknown,\n args: infer P,\n) => unknown\n ? P\n : never;`;\n","import {\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n isBoolean,\n isObject,\n type NormalizedOutputOptions,\n pascal,\n type ResReqTypesValue,\n sanitize,\n type Verbs,\n} from '@orval/core';\n\nimport {\n HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE,\n HTTP_CLIENT_OPTIONS_TEMPLATE,\n THIRD_PARAMETER_TEMPLATE,\n} from './types';\n\nexport type ClientOverride = 'httpClient' | 'httpResource' | 'both';\n\nconst PRIMITIVE_TYPE_VALUES = [\n 'string',\n 'number',\n 'boolean',\n 'void',\n 'unknown',\n] as const;\n\nexport type PrimitiveType = (typeof PRIMITIVE_TYPE_VALUES)[number];\n\nexport const PRIMITIVE_TYPES = new Set(PRIMITIVE_TYPE_VALUES);\n\nconst PRIMITIVE_TYPE_LOOKUP = {\n string: true,\n number: true,\n boolean: true,\n void: true,\n unknown: true,\n} as const satisfies Record<PrimitiveType, true>;\n\nexport const isPrimitiveType = (t: string | undefined): t is PrimitiveType =>\n t != undefined &&\n Object.prototype.hasOwnProperty.call(PRIMITIVE_TYPE_LOOKUP, t);\n\nexport const isZodSchemaOutput = (output: NormalizedOutputOptions): boolean =>\n isObject(output.schemas) && output.schemas.type === 'zod';\n\nexport const isDefined = <T>(v: T | null | undefined): v is T => v != undefined;\n\nexport const generateAngularTitle = (title: string) => {\n const sanTitle = sanitize(title);\n return `${pascal(sanTitle)}Service`;\n};\n\n/**\n * Builds the opening of an @Injectable Angular service class.\n * Shared between httpClient-only mode and the mutation section of httpResource mode.\n */\nexport const buildServiceClassOpen = ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n hasQueryParams,\n}: {\n title: string;\n isRequestOptions: boolean;\n isMutator: boolean;\n isGlobalMutator: boolean;\n provideIn: string | boolean | undefined;\n hasQueryParams: boolean;\n}): string => {\n const provideInValue = provideIn\n ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }`\n : '';\n\n return `\n${\n isRequestOptions && !isGlobalMutator\n ? `${HTTP_CLIENT_OPTIONS_TEMPLATE}\n\n${HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody() : ''}`\n : ''\n}\n\n${isRequestOptions && isMutator ? THIRD_PARAMETER_TEMPLATE : ''}\n\n@Injectable(${provideInValue})\nexport class ${title} {\n private readonly http = inject(HttpClient);\n`;\n};\n\n/**\n * Registry that maps operationName → full route (with baseUrl).\n *\n * Populated during client builder calls (which receive the full route via\n * GeneratorOptions.route) and read during header/footer builder calls\n * (which only receive verbOptions without routes).\n *\n * This avoids monkey-patching verbOptions with a non-standard `fullRoute` property.\n */\nexport const createRouteRegistry = () => {\n const routes = new Map<string, string>();\n\n return {\n reset() {\n routes.clear();\n },\n set(operationName: string, route: string) {\n routes.set(operationName, route);\n },\n get(operationName: string, fallback: string): string {\n return routes.get(operationName) ?? fallback;\n },\n };\n};\n\nexport const createReturnTypesRegistry = () => {\n const returnTypesToWrite = new Map<string, string>();\n\n return {\n reset() {\n returnTypesToWrite.clear();\n },\n set(operationName: string, typeDefinition: string) {\n returnTypesToWrite.set(operationName, typeDefinition);\n },\n getFooter(operationNames: string[]) {\n const collected: string[] = [];\n for (const operationName of operationNames) {\n const value = returnTypesToWrite.get(operationName);\n if (value) {\n collected.push(value);\n }\n }\n return collected.join('\\n');\n },\n };\n};\n\n/**\n * Determines whether an operation should be generated as an `httpResource()`\n * (retrieval) or as an `HttpClient` method in a service class (mutation).\n *\n * Resolution order:\n * 1. **Per-operation override** — `override.operations.<operationId>.angular.client`\n * in the orval config. `httpResource` forces retrieval, `httpClient` forces mutation.\n * 2. **HTTP verb** — absent a per-operation override, `GET` is treated as a retrieval.\n * 3. **Name heuristic** — For `POST`, if the operationName starts with a\n * retrieval-like prefix (search, list, find, query, get, fetch, lookup)\n * it is treated as a retrieval. This handles common patterns like\n * `POST /search` or `POST /graphql` with query-style operation names.\n *\n * If the heuristic misclassifies an operation, users can override it\n * per-operation in their orval config:\n *\n * ```ts\n * override: {\n * operations: {\n * myPostSearch: { angular: { retrievalClient: 'httpResource' } },\n * getOrCreateUser: { angular: { retrievalClient: 'httpClient' } },\n * }\n * }\n * ```\n */\nexport function isRetrievalVerb(\n verb: Verbs,\n operationName?: string,\n clientOverride?: ClientOverride,\n): boolean {\n // Per-operation override takes precedence\n if (clientOverride === 'httpResource') return true;\n if (clientOverride === 'httpClient') return false;\n\n // Absent a per-operation override, GET is treated as a retrieval\n if (verb === 'get') return true;\n\n // POST with a retrieval-like operation name\n if (verb === 'post' && operationName) {\n const lower = operationName.toLowerCase();\n return /^(search|list|find|query|get|fetch|lookup|filter)/.test(lower);\n }\n return false;\n}\n\nexport function isMutationVerb(\n verb: Verbs,\n operationName?: string,\n clientOverride?: ClientOverride,\n): boolean {\n return !isRetrievalVerb(verb, operationName, clientOverride);\n}\n\nexport function getDefaultSuccessType(\n successTypes: ResReqTypesValue[],\n fallback: string,\n) {\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n const jsonContentType = uniqueContentTypes.find((contentType) =>\n contentType.includes('json'),\n );\n const defaultContentType =\n jsonContentType ??\n (uniqueContentTypes.length > 1\n ? getDefaultContentType(uniqueContentTypes)\n : (uniqueContentTypes[0] ?? 'application/json'));\n const defaultType = successTypes.find(\n (t) => t.contentType === defaultContentType,\n );\n\n return {\n contentType: defaultContentType,\n value: defaultType?.value ?? fallback,\n };\n}\n","import {\n camel,\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientFooterBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n getEnumImplementation,\n isBoolean,\n pascal,\n toObjectString,\n} from '@orval/core';\n\nimport { ANGULAR_HTTP_CLIENT_DEPENDENCIES } from './constants';\nimport {\n HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE,\n HTTP_CLIENT_OPTIONS_TEMPLATE,\n THIRD_PARAMETER_TEMPLATE,\n} from './types';\nimport {\n createReturnTypesRegistry,\n isPrimitiveType,\n isZodSchemaOutput,\n} from './utils';\n\n/**\n * Narrowed context for `generateHttpClientImplementation`.\n *\n * The implementation only reads `context.output`, so callers don't need\n * to supply a full `ContextSpec` (which also requires `target`, `workspace`,\n * `spec`, etc.).\n *\n * @remarks\n * This keeps the call sites lightweight when `http-resource.ts` delegates\n * mutation generation back to the shared `HttpClient` implementation builder.\n */\nexport interface HttpClientGeneratorContext {\n route: string;\n context: Pick<ContextSpec, 'output'>;\n}\n\n// NOTE: Module-level singleton — reset() is called at the start of each\n// header builder invocation (generateAngularHeader). Must stay in sync with\n// the generation lifecycle.\nconst returnTypesRegistry = createReturnTypesRegistry();\n\nconst hasSchemaImport = (\n imports: readonly { name: string }[],\n typeName: string | undefined,\n): boolean =>\n typeName != undefined && imports.some((imp) => imp.name === typeName);\n\nconst getSchemaValueRef = (typeName: string): string =>\n typeName === 'Error' ? 'ErrorSchema' : typeName;\n\nconst getSchemaOutputTypeRef = (typeName: string): string =>\n typeName === 'Error' ? 'ErrorOutput' : `${typeName}Output`;\n\nconst getContentTypeReturnType = (\n contentType: string | undefined,\n value: string,\n): string => {\n if (!contentType) return value;\n if (contentType.includes('json') || contentType.includes('+json')) {\n return value;\n }\n if (contentType.startsWith('text/') || contentType.includes('xml')) {\n return 'string';\n }\n return 'Blob';\n};\n\n/**\n * Returns the dependency list required by the Angular `HttpClient` generator.\n *\n * These imports are consumed by Orval's generic dependency-import emitter when\n * composing the generated Angular client file.\n *\n * @returns The Angular `HttpClient` dependency descriptors used during import generation.\n */\nexport const getAngularDependencies: ClientDependenciesBuilder = () => [\n ...ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n];\n\n/**\n * Builds the generated TypeScript helper name used for multi-content-type\n * `Accept` header unions.\n *\n * Example: `listPets` -> `ListPetsAccept`.\n *\n * @returns A PascalCase helper type/const name for the operation's `Accept` values.\n */\nexport const getAcceptHelperName = (operationName: string) =>\n `${pascal(operationName)}Accept`;\n\n/**\n * Collects the distinct successful response content types for a single\n * operation.\n *\n * The Angular generators use this to decide whether they need `Accept`\n * overloads or content-type-specific branching logic.\n *\n * @returns A de-duplicated list of response content types, excluding empty entries.\n */\nexport const getUniqueContentTypes = (\n successTypes: GeneratorVerbOptions['response']['types']['success'],\n) => [...new Set(successTypes.map((t) => t.contentType).filter(Boolean))];\n\nconst toAcceptHelperKey = (contentType: string): string =>\n contentType\n .replaceAll(/[^A-Za-z0-9]+/g, '_')\n .replaceAll(/^_+|_+$/g, '')\n .toLowerCase();\n\nconst buildAcceptHelper = (\n operationName: string,\n contentTypes: string[],\n output: ContextSpec['output'],\n): string => {\n const acceptHelperName = getAcceptHelperName(operationName);\n const unionValue = contentTypes\n .map((contentType) => `'${contentType}'`)\n .join(' | ');\n const names = contentTypes.map((contentType) =>\n toAcceptHelperKey(contentType),\n );\n const implementation = getEnumImplementation(\n unionValue,\n names,\n undefined,\n output.override.namingConvention.enum,\n );\n\n return `export type ${acceptHelperName} = typeof ${acceptHelperName}[keyof typeof ${acceptHelperName}];\n\nexport const ${acceptHelperName} = {\n${implementation}} as const;`;\n};\n\n/**\n * Builds the shared `Accept` helper declarations for all operations in the\n * current Angular generation scope.\n *\n * @remarks\n * Helpers are emitted only for operations with more than one successful\n * response content type.\n *\n * @returns Concatenated type/const declarations or an empty string when no helpers are needed.\n */\nexport const buildAcceptHelpers = (\n verbOptions: readonly GeneratorVerbOptions[],\n output: ContextSpec['output'],\n): string =>\n verbOptions\n .flatMap((verbOption) => {\n const contentTypes = getUniqueContentTypes(\n verbOption.response.types.success,\n );\n if (contentTypes.length <= 1) return [];\n\n return [\n buildAcceptHelper(verbOption.operationName, contentTypes, output),\n ];\n })\n .join('\\n\\n');\n\n/**\n * Generates the static header section for Angular `HttpClient` output.\n *\n * Depending on the current generation options this may include:\n * - reusable request option helper types\n * - filtered query-param helper utilities\n * - mutator support types\n * - `Accept` helper unions/constants for multi-content-type operations\n * - the `@Injectable()` service class shell\n *\n * @returns A string containing the prelude and service class opening for the generated file.\n */\nexport const generateAngularHeader: ClientHeaderBuilder = ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n verbOptions,\n tag,\n output,\n}) => {\n returnTypesRegistry.reset();\n\n const relevantVerbs = tag\n ? Object.values(verbOptions).filter((v) =>\n v.tags.some((t) => camel(t) === camel(tag)),\n )\n : Object.values(verbOptions);\n const hasQueryParams = relevantVerbs.some((v) => v.queryParams);\n const acceptHelpers = buildAcceptHelpers(relevantVerbs, output);\n\n return `\n${\n isRequestOptions && !isGlobalMutator\n ? `${HTTP_CLIENT_OPTIONS_TEMPLATE}\n\n${HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody() : ''}`\n : ''\n}\n\n${isRequestOptions && isMutator ? THIRD_PARAMETER_TEMPLATE : ''}\n\n${acceptHelpers}\n\n@Injectable(${provideIn ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }` : ''})\nexport class ${title} {\n private readonly http = inject(HttpClient);\n`;\n};\n\n/**\n * Generates the closing section for Angular `HttpClient` output.\n *\n * @remarks\n * Besides closing the generated service class, this appends any collected\n * `ClientResult` aliases registered while individual operations were emitted.\n *\n * @returns The footer text for the generated Angular client file.\n */\nexport const generateAngularFooter: ClientFooterBuilder = ({\n operationNames,\n}) => {\n let footer = '};\\n\\n';\n\n const returnTypes = returnTypesRegistry.getFooter(operationNames);\n if (returnTypes) {\n footer += `${returnTypes}\\n`;\n }\n\n return footer;\n};\n\n/**\n * Generates the Angular `HttpClient` method implementation for a single\n * OpenAPI operation.\n *\n * This function is responsible for:\n * - method signatures and overloads\n * - observe-mode branching\n * - multi-content-type `Accept` handling\n * - mutator integration\n * - runtime Zod validation hooks for Angular output\n * - registering the operation's `ClientResult` alias for footer emission\n *\n * @remarks\n * This is the central implementation builder shared by the dedicated\n * `httpClient` mode and the mutation side of Angular `both` / `httpResource`\n * generation.\n *\n * @returns The complete TypeScript method declaration and implementation for the operation.\n */\nexport const generateHttpClientImplementation = (\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props,\n verb,\n override,\n formData,\n formUrlEncoded,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route, context }: HttpClientGeneratorContext,\n) => {\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n const dataType = response.definition.success || 'unknown';\n const isPrimitive = isPrimitiveType(dataType);\n const hasSchema = hasSchemaImport(response.imports, dataType);\n const isZodOutput = isZodSchemaOutput(context.output);\n const shouldValidateResponse =\n override.angular.runtimeValidation &&\n isZodOutput &&\n !isPrimitive &&\n hasSchema;\n const parsedDataType = shouldValidateResponse\n ? getSchemaOutputTypeRef(dataType)\n : dataType;\n const getGeneratedResponseType = (\n value: string,\n contentType: string | undefined,\n ): string => {\n if (\n override.angular.runtimeValidation &&\n isZodOutput &&\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')) &&\n !isPrimitiveType(value) &&\n hasSchemaImport(response.imports, value)\n ) {\n return getSchemaOutputTypeRef(value);\n }\n\n return getContentTypeReturnType(contentType, value);\n };\n const resultAliasType = mutator\n ? dataType\n : response.types.success.length <= 1\n ? parsedDataType\n : [\n ...new Set(\n response.types.success.map(({ value, contentType }) =>\n getGeneratedResponseType(value, contentType),\n ),\n ),\n ].join(' | ') || parsedDataType;\n const schemaValueRef = shouldValidateResponse\n ? getSchemaValueRef(dataType)\n : dataType;\n const validationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data) as TData))`\n : '';\n const responseValidationPipe = shouldValidateResponse\n ? `.pipe(map(response => response.clone({ body: ${schemaValueRef}.parse(response.body) as TData })))`\n : '';\n const eventValidationPipe = shouldValidateResponse\n ? `.pipe(map(event => event instanceof AngularHttpResponse ? event.clone({ body: ${schemaValueRef}.parse(event.body) as TData }) : event))`\n : '';\n\n returnTypesRegistry.set(\n operationName,\n `export type ${pascal(\n operationName,\n )}ClientResult = NonNullable<${resultAliasType}>`,\n );\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal: false,\n isExactOptionalPropertyTypes,\n isAngular: true,\n });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasThirdArg,\n )\n : '';\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(String.raw`(\\\\w*):\\\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return ` ${operationName}<TData = ${dataType}>(\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasThirdArg\n ? `options?: ThirdParameter<typeof ${mutator.name}>`\n : ''\n }) {${bodyForm}\n return ${mutator.name}<TData>(\n ${mutatorConfig},\n this.http,\n ${requestOptions});\n }\n `;\n }\n\n const optionsBase = {\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override.paramsSerializerOptions,\n isAngular: true,\n isExactOptionalPropertyTypes,\n hasSignal: false,\n } as const;\n\n const propsDefinition = toObjectString(props, 'definition');\n\n const successTypes = response.types.success;\n const uniqueContentTypes = getUniqueContentTypes(successTypes);\n const hasMultipleContentTypes = uniqueContentTypes.length > 1;\n const acceptTypeName = hasMultipleContentTypes\n ? getAcceptHelperName(operationName)\n : undefined;\n\n const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;\n const angularParamsRef =\n isRequestOptions && queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n const callExpr = getAngularFilteredParamsCallExpression(\n '{...params, ...options?.params}',\n queryParams.requiredNullableKeys ?? [],\n );\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${callExpr});\\n\\n `\n : `const ${angularParamsRef} = ${callExpr};\\n\\n `;\n }\n\n const optionsInput = {\n ...optionsBase,\n ...(angularParamsRef ? { angularParamsRef } : {}),\n } as const;\n\n const options = generateOptions(optionsInput);\n\n const defaultContentType = hasMultipleContentTypes\n ? (successTypes.find(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )?.contentType ?? getDefaultContentType(uniqueContentTypes))\n : (uniqueContentTypes[0] ?? 'application/json');\n\n const jsonSuccessValues = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n\n const jsonReturnType =\n jsonSuccessValues.length > 0 ? jsonSuccessValues.join(' | ') : 'unknown';\n const parsedJsonReturnType =\n jsonSuccessValues.length === 1 &&\n override.angular.runtimeValidation &&\n isZodOutput &&\n !isPrimitiveType(jsonSuccessValues[0]) &&\n hasSchemaImport(response.imports, jsonSuccessValues[0])\n ? getSchemaOutputTypeRef(jsonSuccessValues[0])\n : jsonReturnType;\n\n let jsonValidationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data)))`\n : '';\n if (\n hasMultipleContentTypes &&\n !shouldValidateResponse &&\n override.angular.runtimeValidation &&\n isZodOutput &&\n jsonSuccessValues.length === 1\n ) {\n const jsonType = jsonSuccessValues[0];\n const jsonIsPrimitive = isPrimitiveType(jsonType);\n const jsonHasSchema = hasSchemaImport(response.imports, jsonType);\n if (!jsonIsPrimitive && jsonHasSchema) {\n const jsonSchemaRef = getSchemaValueRef(jsonType);\n jsonValidationPipe = `.pipe(map(data => ${jsonSchemaRef}.parse(data)))`;\n }\n }\n\n const textSuccessTypes = successTypes.filter(\n ({ contentType, value }) =>\n !!contentType &&\n (contentType.startsWith('text/') ||\n contentType.includes('xml') ||\n value === 'string'),\n );\n const blobSuccessTypes = successTypes.filter(\n ({ contentType }) =>\n !!contentType &&\n !contentType.includes('json') &&\n !contentType.includes('+json') &&\n !contentType.startsWith('text/') &&\n !contentType.includes('xml'),\n );\n const multiReturnMembers = [\n parsedJsonReturnType,\n ...(textSuccessTypes.length > 0 ? ['string'] : []),\n ...(blobSuccessTypes.length > 0 ? ['Blob'] : []),\n ];\n const uniqueMultiReturnMembers = [...new Set(multiReturnMembers)];\n const refinedMultiImplementationReturnType = `Observable<${uniqueMultiReturnMembers.join(' | ')}>`;\n\n const observeOptions = needsObserveBranching\n ? {\n body: generateOptions({ ...optionsInput, angularObserve: 'body' }),\n events: generateOptions({ ...optionsInput, angularObserve: 'events' }),\n response: generateOptions({\n ...optionsInput,\n angularObserve: 'response',\n }),\n }\n : undefined;\n\n const isModelType =\n dataType !== 'Blob' && dataType !== 'string' && dataType !== 'ArrayBuffer';\n let functionName = operationName;\n if (isModelType && !hasMultipleContentTypes) {\n functionName += `<TData = ${parsedDataType}>`;\n }\n\n let contentTypeOverloads = '';\n if (hasMultipleContentTypes && isRequestOptions) {\n const requiredPart = props\n .filter((p) => p.required && !p.default)\n .map((p) => p.definition)\n .join(',\\n ');\n const optionalPart = props\n .filter((p) => !p.required || p.default)\n .map((p) => p.definition)\n .join(',\\n ');\n const branchOverloads = successTypes\n .filter(({ contentType }) => !!contentType)\n .map(({ contentType, value }) => {\n const returnType = getGeneratedResponseType(value, contentType);\n const overloadParams = [\n requiredPart,\n `accept: '${contentType}'`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return `${operationName}(${overloadParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n })\n .join('\\n ');\n const allParams = [\n requiredPart,\n `accept?: ${acceptTypeName ?? 'string'}`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n contentTypeOverloads = `${branchOverloads}\\n ${operationName}(${allParams}, options?: HttpClientOptions): ${refinedMultiImplementationReturnType};`;\n }\n\n const observeOverloads =\n isRequestOptions && !hasMultipleContentTypes\n ? `${functionName}(${propsDefinition} options?: HttpClientBodyOptions): Observable<${isModelType ? 'TData' : parsedDataType}>;\\n ${functionName}(${propsDefinition} options?: HttpClientEventOptions): Observable<HttpEvent<${isModelType ? 'TData' : parsedDataType}>>;\\n ${functionName}(${propsDefinition} options?: HttpClientResponseOptions): Observable<AngularHttpResponse<${isModelType ? 'TData' : parsedDataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = isModelType ? 'TData' : parsedDataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const requiredPart = props\n .filter((p) => p.required && !p.default)\n .map((p) => p.implementation)\n .join(',\\n ');\n const optionalPart = props\n .filter((p) => !p.required || p.default)\n .map((p) => p.implementation)\n .join(',\\n ');\n const allParams = [\n requiredPart,\n `accept: ${acceptTypeName ?? 'string'} = '${defaultContentType}'`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return ` ${overloads}\n ${operationName}(\n ${allParams},\n ${isRequestOptions ? 'options?: HttpClientOptions' : ''}\n ): ${refinedMultiImplementationReturnType} {${bodyForm}\n ${paramsDeclaration}const headers = options?.headers instanceof HttpHeaders\n ? options.headers.set('Accept', accept)\n : { ...(options?.headers ?? {}), Accept: accept };\n\n if (accept.includes('json') || accept.includes('+json')) {\n return this.http.${verb}<${parsedJsonReturnType}>(\\`${route}\\`, {\n ...options,\n responseType: 'json',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n })${jsonValidationPipe};\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'text',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n }) as Observable<string>;\n }${\n blobSuccessTypes.length > 0\n ? ` else {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'blob',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n }) as Observable<Blob>;\n }`\n : `\n\n return this.http.${verb}<${parsedJsonReturnType}>(\\`${route}\\`, {\n ...options,\n responseType: 'json',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n })${jsonValidationPipe};`\n }\n }\n`;\n }\n\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${observeOptions?.events ?? options})${eventValidationPipe};\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${observeOptions?.response ?? options})${responseValidationPipe};\n }\n\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${observeOptions?.body ?? options})${validationPipe};`\n : `return this.http.${verb}${isModelType ? '<TData>' : ''}(${options})${validationPipe};`;\n\n return ` ${overloads}\n ${functionName}(\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions ? `options?: HttpClientObserveOptions` : ''\n }): ${singleImplementationReturnType} {${bodyForm}\n ${observeImplementation}\n }\n`;\n};\n\n/**\n * Orval client builder entry point for Angular `HttpClient` output.\n *\n * It normalizes imports needed for runtime validation, delegates the actual\n * method implementation to `generateHttpClientImplementation`, and returns the\n * generated code plus imports for the current operation.\n *\n * @returns The generated implementation fragment and imports for one operation.\n */\nexport const generateAngular: ClientBuilder = (verbOptions, options) => {\n const isZodOutput = isZodSchemaOutput(options.context.output);\n const responseType = verbOptions.response.definition.success;\n const isPrimitiveResponse = isPrimitiveType(responseType);\n const shouldUseRuntimeValidation =\n verbOptions.override.angular.runtimeValidation && isZodOutput;\n\n const normalizedVerbOptions = (() => {\n if (!shouldUseRuntimeValidation) return verbOptions;\n\n let result: GeneratorVerbOptions = {\n ...verbOptions,\n response: {\n ...verbOptions.response,\n imports: verbOptions.response.imports.map((imp) => ({\n ...imp,\n values: true,\n })),\n },\n };\n\n if (\n !isPrimitiveResponse &&\n hasSchemaImport(result.response.imports, responseType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: [\n ...result.response.imports.map((imp) =>\n imp.name === responseType ? { ...imp, values: true } : imp,\n ),\n { name: getSchemaOutputTypeRef(responseType) },\n ],\n },\n };\n }\n\n const successTypes = result.response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n if (uniqueContentTypes.length > 1) {\n const jsonSchemaNames = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n if (jsonSchemaNames.length === 1) {\n const jsonType = jsonSchemaNames[0];\n const jsonIsPrimitive = isPrimitiveType(jsonType);\n if (\n !jsonIsPrimitive &&\n hasSchemaImport(result.response.imports, jsonType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: [\n ...result.response.imports.map((imp) =>\n imp.name === jsonType ? { ...imp, values: true } : imp,\n ),\n { name: getSchemaOutputTypeRef(jsonType) },\n ],\n },\n };\n }\n }\n }\n\n return result;\n })();\n\n const implementation = generateHttpClientImplementation(\n normalizedVerbOptions,\n options,\n );\n\n const imports = [\n ...generateVerbImports(normalizedVerbOptions),\n ...(implementation.includes('.pipe(map(')\n ? [{ name: 'map', values: true, importPath: 'rxjs' }]\n : []),\n ];\n\n return { implementation, imports };\n};\n\n/**\n * Returns the footer aliases collected for the provided operation names.\n *\n * The Angular generators use these aliases to expose stable `ClientResult`\n * helper types such as `ListPetsClientResult`.\n *\n * @returns Concatenated `ClientResult` aliases for the requested operation names.\n */\nexport const getHttpClientReturnTypes = (operationNames: string[]) =>\n returnTypesRegistry.getFooter(operationNames);\n\n/**\n * Clears the module-level return type registry used during Angular client\n * generation.\n *\n * This must be called at the start of each generation pass to avoid leaking\n * aliases across files or tags.\n *\n * @returns Nothing.\n */\nexport const resetHttpClientReturnTypes = () => {\n returnTypesRegistry.reset();\n};\n\nexport { generateAngularTitle } from './utils';\n","import {\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientExtraFilesBuilder,\n type ClientFooterBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n conventionName,\n escapeRegExp,\n generateDependencyImports,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorImports,\n type GeneratorDependency,\n type GeneratorImport,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsHelperBody,\n getFileInfo,\n getFullRoute,\n GetterPropType,\n isObject,\n isSyntheticDefaultImportsAllow,\n jsDoc,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n pascal,\n type ResReqTypesValue,\n toObjectString,\n upath,\n} from '@orval/core';\n\nimport {\n ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n ANGULAR_HTTP_RESOURCE_DEPENDENCIES,\n} from './constants';\nimport {\n buildAcceptHelpers,\n generateHttpClientImplementation,\n getAcceptHelperName,\n getHttpClientReturnTypes,\n getUniqueContentTypes,\n type HttpClientGeneratorContext,\n resetHttpClientReturnTypes,\n} from './http-client';\nimport {\n buildServiceClassOpen,\n type ClientOverride,\n createReturnTypesRegistry,\n createRouteRegistry,\n getDefaultSuccessType,\n isMutationVerb,\n isPrimitiveType,\n isRetrievalVerb,\n isZodSchemaOutput,\n} from './utils';\n\n/**\n * Reads the per-operation angular client override from the orval config.\n *\n * Mirrors the pattern used by `@orval/query` for `operationQueryOptions`:\n * ```ts\n * override: {\n * operations: {\n * myPostSearch: { angular: { retrievalClient: 'httpResource' } },\n * }\n * }\n * ```\n */\ninterface AngularOperationOverride {\n readonly client?: ClientOverride;\n readonly httpResource?: AngularHttpResourceOptionsConfig;\n}\n\ninterface AngularHttpResourceOptionsConfig {\n defaultValue?: unknown;\n debugName?: string;\n injector?: string;\n equal?: string;\n}\n\nconst isAngularHttpResourceOptions = (\n value: unknown,\n): value is AngularHttpResourceOptionsConfig =>\n value === undefined ||\n (isObject(value) &&\n (value.defaultValue === undefined ||\n typeof value.defaultValue === 'string' ||\n typeof value.defaultValue === 'number' ||\n typeof value.defaultValue === 'boolean' ||\n value.defaultValue === null ||\n Array.isArray(value.defaultValue) ||\n isObject(value.defaultValue)) &&\n (value.debugName === undefined || typeof value.debugName === 'string') &&\n (value.injector === undefined || typeof value.injector === 'string') &&\n (value.equal === undefined || typeof value.equal === 'string'));\n\nconst isAngularOperationOverride = (\n value: unknown,\n): value is AngularOperationOverride =>\n value !== undefined &&\n typeof value === 'object' &&\n value !== null &&\n (!('client' in value) ||\n value.client === 'httpClient' ||\n value.client === 'httpResource' ||\n value.client === 'both') &&\n (!('httpResource' in value) ||\n isAngularHttpResourceOptions(value.httpResource));\n\nconst getClientOverride = (\n verbOption: GeneratorVerbOptions,\n): ClientOverride | undefined => {\n const angular =\n verbOption.override.operations[verbOption.operationId]?.angular;\n\n return isAngularOperationOverride(angular) ? angular.client : undefined;\n};\n\n/**\n * Resolves the effective `httpResource` option override for an operation.\n *\n * Operation-level configuration takes precedence over the global\n * `override.angular.httpResource` block while still inheriting unspecified\n * values from the global configuration.\n *\n * @returns The merged resource options for the operation, or `undefined` when no override exists.\n */\nconst getHttpResourceOverride = (\n verbOption: GeneratorVerbOptions,\n output: NormalizedOutputOptions,\n): AngularHttpResourceOptionsConfig | undefined => {\n const operationAngular =\n verbOption.override.operations[verbOption.operationId]?.angular;\n const operationOverride = isAngularOperationOverride(operationAngular)\n ? operationAngular.httpResource\n : undefined;\n const angularOverride = output.override.angular as unknown;\n const globalOverride =\n isObject(angularOverride) &&\n 'httpResource' in angularOverride &&\n isAngularHttpResourceOptions(angularOverride.httpResource)\n ? angularOverride.httpResource\n : undefined;\n\n if (globalOverride === undefined) return operationOverride;\n if (operationOverride === undefined) return globalOverride;\n\n return {\n ...globalOverride,\n ...operationOverride,\n };\n};\n\n// NOTE: Module-level singletons — reset() is called by the header builder\n// (generateAngularHttpResourceHeader) at the start of each generation pass.\nconst resourceReturnTypesRegistry = createReturnTypesRegistry();\n\n/** @internal Exported for testing only */\nexport const routeRegistry = createRouteRegistry();\n\nconst getHeader = (\n option: false | ((info: OpenApiInfoObject) => string | string[]),\n info: OpenApiInfoObject | undefined,\n): string => {\n if (!option || !info) {\n return '';\n }\n\n const header = option(info);\n\n return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nconst mergeDependencies = (\n deps: GeneratorDependency[],\n): GeneratorDependency[] => {\n const merged = new Map<\n string,\n { exports: GeneratorImport[]; dependency: string }\n >();\n\n for (const dep of deps) {\n const existing = merged.get(dep.dependency);\n if (!existing) {\n merged.set(dep.dependency, {\n exports: [...dep.exports],\n dependency: dep.dependency,\n });\n continue;\n }\n\n for (const exp of dep.exports) {\n if (\n !existing.exports.some(\n (current) => current.name === exp.name && current.alias === exp.alias,\n )\n ) {\n existing.exports.push(exp);\n }\n }\n }\n\n return [...merged.values()];\n};\n\nconst cloneDependencies = (\n deps: readonly GeneratorDependency[],\n): GeneratorDependency[] =>\n deps.map((dep) => ({\n ...dep,\n exports: [...dep.exports],\n }));\n\n/**\n * Returns the merged dependency list required when Angular `httpResource`\n * output coexists with Angular `HttpClient` service generation.\n *\n * This is used for pure `httpResource` mode as well as mixed generation paths\n * that still need Angular common HTTP symbols and service helpers.\n *\n * @returns The de-duplicated dependency descriptors for Angular resource generation.\n */\nexport const getAngularHttpResourceDependencies: ClientDependenciesBuilder =\n () =>\n mergeDependencies([\n ...ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n ...ANGULAR_HTTP_RESOURCE_DEPENDENCIES,\n ]);\n\n/**\n * Returns only the dependencies required by standalone generated resource\n * files, such as the sibling `*.resource.ts` output used in `both` mode.\n *\n * @returns The dependency descriptors required by resource-only files.\n */\nexport const getAngularHttpResourceOnlyDependencies: ClientDependenciesBuilder =\n () => cloneDependencies(ANGULAR_HTTP_RESOURCE_DEPENDENCIES);\n\nconst isResponseText = (\n contentType: string | undefined,\n dataType: string,\n): boolean => {\n if (dataType === 'string') return true;\n if (!contentType) return false;\n return contentType.startsWith('text/') || contentType.includes('xml');\n};\n\nconst isResponseArrayBuffer = (contentType: string | undefined): boolean => {\n if (!contentType) return false;\n return (\n contentType.includes('application/octet-stream') ||\n contentType.includes('application/pdf')\n );\n};\n\nconst isResponseBlob = (\n contentType: string | undefined,\n isBlob: boolean,\n): boolean => {\n if (isBlob) return true;\n if (!contentType) return false;\n return contentType.startsWith('image/') || contentType.includes('blob');\n};\n\ntype HttpResourceFactoryName =\n | 'httpResource'\n | 'httpResource.text'\n | 'httpResource.arrayBuffer'\n | 'httpResource.blob';\n\nconst HTTP_RESOURCE_OPTIONS_TYPE_NAME = 'OrvalHttpResourceOptions';\n\nconst getHttpResourceFactory = (\n response: { readonly isBlob: boolean },\n contentType: string | undefined,\n dataType: string,\n): HttpResourceFactoryName => {\n if (isResponseText(contentType, dataType)) return 'httpResource.text';\n if (isResponseBlob(contentType, response.isBlob)) return 'httpResource.blob';\n if (isResponseArrayBuffer(contentType)) return 'httpResource.arrayBuffer';\n return 'httpResource';\n};\n\nconst getHttpResourceRawType = (factory: HttpResourceFactoryName): string => {\n switch (factory) {\n case 'httpResource.text': {\n return 'string';\n }\n case 'httpResource.arrayBuffer': {\n return 'ArrayBuffer';\n }\n case 'httpResource.blob': {\n return 'Blob';\n }\n default: {\n return 'unknown';\n }\n }\n};\n\nconst getTypeWithoutDefault = (definition: string): string => {\n const match = /^([^:]+):\\s*(.+)$/.exec(definition);\n if (!match) return definition;\n return match[2].replace(/\\s*=\\s*.*$/, '').trim();\n};\n\nconst getDefaultValueFromImplementation = (\n implementation: string,\n): string | undefined => {\n const match = /=\\s*(.+)$/.exec(implementation);\n return match ? match[1].trim() : undefined;\n};\n\ninterface SignalProp {\n readonly definition: string;\n readonly implementation: string;\n}\n\nconst withSignal = (\n prop: GeneratorVerbOptions['props'][number],\n options: { readonly hasDefault?: boolean } = {},\n): SignalProp => {\n const type = getTypeWithoutDefault(prop.definition);\n const derivedDefault =\n getDefaultValueFromImplementation(prop.implementation) !== undefined ||\n prop.default !== undefined;\n const hasDefault = options.hasDefault ?? derivedDefault;\n const nameMatch = /^([^:]+):/.exec(prop.definition);\n const namePart = nameMatch ? nameMatch[1] : prop.name;\n const hasOptionalMark = namePart.includes('?');\n const optional = prop.required && !hasDefault && !hasOptionalMark ? '' : '?';\n const definition = `${prop.name}${optional}: Signal<${type}>`;\n\n return {\n definition,\n implementation: definition,\n };\n};\n\nconst buildSignalProps = (\n props: GeneratorVerbOptions['props'],\n params: GeneratorVerbOptions['params'],\n): GeneratorVerbOptions['props'] => {\n const paramDefaults = new Map<string, boolean>();\n for (const param of params) {\n const hasDefault =\n getDefaultValueFromImplementation(param.implementation) !== undefined ||\n param.default !== undefined;\n paramDefaults.set(param.name, hasDefault);\n }\n\n return props.map((prop) => {\n switch (prop.type) {\n case GetterPropType.NAMED_PATH_PARAMS: {\n return {\n ...prop,\n name: 'pathParams',\n definition: `pathParams: Signal<${prop.schema.name}>`,\n implementation: `pathParams: Signal<${prop.schema.name}>`,\n };\n }\n case GetterPropType.PARAM:\n case GetterPropType.QUERY_PARAM:\n case GetterPropType.BODY:\n case GetterPropType.HEADER: {\n const hasDefault =\n prop.type === GetterPropType.PARAM\n ? (paramDefaults.get(prop.name) ?? false)\n : undefined;\n const signalProp = withSignal(prop, { hasDefault });\n return {\n ...prop,\n definition: signalProp.definition,\n implementation: signalProp.implementation,\n };\n }\n default: {\n return prop;\n }\n }\n });\n};\n\nconst applySignalRoute = (\n route: string,\n params: GeneratorVerbOptions['params'],\n useNamedParams: boolean,\n): string => {\n let updatedRoute = route;\n for (const param of params) {\n const template = '${' + param.name + '}';\n const defaultValue = getDefaultValueFromImplementation(\n param.implementation,\n );\n let replacement: string;\n if (useNamedParams) {\n replacement =\n defaultValue === undefined\n ? '${pathParams().' + param.name + '}'\n : '${pathParams()?.' + param.name + ' ?? ' + defaultValue + '}';\n } else {\n replacement =\n defaultValue === undefined\n ? '${' + param.name + '()}'\n : '${' + param.name + '?.() ?? ' + defaultValue + '}';\n }\n updatedRoute = updatedRoute.replaceAll(template, replacement);\n }\n return updatedRoute;\n};\n\ninterface ResourceRequest {\n readonly bodyForm: string;\n readonly request: string;\n readonly isUrlOnly: boolean;\n}\n\nconst buildResourceRequest = (\n {\n verb,\n body,\n headers,\n queryParams,\n paramsSerializer,\n override,\n formData,\n formUrlEncoded,\n }: GeneratorVerbOptions,\n route: string,\n): ResourceRequest => {\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n const hasFormData = isFormData && body.formData;\n const hasFormUrlEncoded = isFormUrlEncoded && body.formUrlEncoded;\n\n const bodyAccess = body.definition\n ? body.isOptional\n ? `${body.implementation}?.()`\n : `${body.implementation}()`\n : undefined;\n const bodyValue = hasFormData\n ? 'formData'\n : hasFormUrlEncoded\n ? 'formUrlEncoded'\n : bodyAccess;\n\n const paramsAccess = queryParams ? 'params?.()' : undefined;\n const headersAccess = headers ? 'headers?.()' : undefined;\n const filteredParamsValue = paramsAccess\n ? getAngularFilteredParamsCallExpression(\n `${paramsAccess} ?? {}`,\n queryParams?.requiredNullableKeys ?? [],\n !!paramsSerializer,\n )\n : undefined;\n const paramsValue = paramsAccess\n ? paramsSerializer\n ? `params?.() ? ${paramsSerializer.name}(${filteredParamsValue}) : undefined`\n : filteredParamsValue\n : undefined;\n\n const isGet = verb === 'get';\n const hasExtras = !isGet || !!bodyValue || !!paramsValue || !!headersAccess;\n const isUrlOnly = !hasExtras && !bodyForm;\n\n const requestLines = [\n `url: \\`${route}\\``,\n isGet ? undefined : `method: '${verb.toUpperCase()}'`,\n bodyValue ? `body: ${bodyValue}` : undefined,\n paramsValue ? `params: ${paramsValue}` : undefined,\n headersAccess ? `headers: ${headersAccess}` : undefined,\n ].filter(Boolean);\n\n const request = isUrlOnly\n ? `\\`${route}\\``\n : `({\\n ${requestLines.join(',\\n ')}\\n })`;\n\n return {\n bodyForm,\n request,\n isUrlOnly,\n };\n};\n\nconst getSchemaOutputTypeRef = (typeName: string): string =>\n typeName === 'Error' ? 'ErrorOutput' : `${typeName}Output`;\n\nconst getHttpResourceResponseImports = (\n response: GeneratorVerbOptions['response'],\n): GeneratorImport[] => {\n const successDefinition = response.definition.success;\n if (!successDefinition) return [];\n\n return response.imports.filter((imp) => {\n const name = imp.alias ?? imp.name;\n const pattern = new RegExp(String.raw`\\b${escapeRegExp(name)}\\b`, 'g');\n return pattern.test(successDefinition);\n });\n};\n\nconst getHttpResourceVerbImports = (\n verbOptions: GeneratorVerbOptions,\n output: NormalizedOutputOptions,\n): GeneratorImport[] => {\n const { response, body, queryParams, props, headers, params } = verbOptions;\n const responseImports = isZodSchemaOutput(output)\n ? [\n ...getHttpResourceResponseImports(response).map((imp) => ({\n ...imp,\n values: true,\n })),\n ...getHttpResourceResponseImports(response)\n .filter((imp) => !isPrimitiveType(imp.name))\n .map((imp) => ({ name: getSchemaOutputTypeRef(imp.name) })),\n ]\n : getHttpResourceResponseImports(response);\n\n return [\n ...responseImports,\n ...body.imports,\n ...props.flatMap((prop) =>\n prop.type === GetterPropType.NAMED_PATH_PARAMS\n ? [{ name: prop.schema.name }]\n : [],\n ),\n ...(queryParams ? [{ name: queryParams.schema.name }] : []),\n ...(headers ? [{ name: headers.schema.name }] : []),\n ...params.flatMap<GeneratorImport>(({ imports }) => imports),\n { name: 'map', values: true, importPath: 'rxjs' },\n ];\n};\n\nconst getParseExpression = (\n response: {\n readonly imports: readonly { name: string; isZodSchema?: boolean }[];\n readonly definition: { readonly success?: string };\n },\n factory: HttpResourceFactoryName,\n output: NormalizedOutputOptions,\n responseTypeOverride?: string,\n): string | undefined => {\n if (factory !== 'httpResource') return undefined;\n\n // Explicit isZodSchema flag on imports (forward-compatible)\n const zodSchema = response.imports.find((imp) => imp.isZodSchema);\n if (zodSchema) return `${zodSchema.name}.parse`;\n\n // Check if runtime validation is disabled\n if (!output.override.angular.runtimeValidation) return undefined;\n\n // Auto-detect: when schemas.type === 'zod', use the response type as the schema name\n if (!isZodSchemaOutput(output)) return undefined;\n\n const responseType = responseTypeOverride ?? response.definition.success;\n if (!responseType) return undefined;\n if (isPrimitiveType(responseType)) return undefined;\n\n // Verify a matching import exists (the response type name resolves to a zod schema)\n const hasMatchingImport = response.imports.some(\n (imp) => imp.name === responseType,\n );\n if (!hasMatchingImport) return undefined;\n\n return `${responseType}.parse`;\n};\n\n/**\n * Builds the literal option entries that Orval injects into generated\n * `httpResource()` calls.\n *\n * This merges user-supplied generator configuration such as `defaultValue` or\n * `debugName` with automatically derived runtime-validation hooks like\n * `parse: Schema.parse`.\n *\n * @returns The option entries plus metadata about whether a configured default value exists.\n */\nconst buildHttpResourceOptionsLiteral = (\n verbOption: GeneratorVerbOptions,\n factory: HttpResourceFactoryName,\n output: NormalizedOutputOptions,\n responseTypeOverride?: string,\n): { entries: string[]; hasDefaultValue: boolean } => {\n const override = getHttpResourceOverride(verbOption, output);\n const parseExpression = getParseExpression(\n verbOption.response,\n factory,\n output,\n responseTypeOverride,\n );\n\n const defaultValueLiteral =\n override?.defaultValue === undefined\n ? undefined\n : JSON.stringify(override.defaultValue);\n\n const optionEntries = [\n parseExpression ? `parse: ${parseExpression}` : undefined,\n defaultValueLiteral ? `defaultValue: ${defaultValueLiteral}` : undefined,\n override?.debugName === undefined\n ? undefined\n : `debugName: ${JSON.stringify(override.debugName)}`,\n override?.injector ? `injector: ${override.injector}` : undefined,\n override?.equal ? `equal: ${override.equal}` : undefined,\n ].filter((value): value is string => value !== undefined);\n\n return {\n entries: optionEntries,\n hasDefaultValue: defaultValueLiteral !== undefined,\n };\n};\n\nconst appendArgument = (args: string, argument: string): string => {\n const normalizedArgs = args.trim().replace(/,\\s*$/, '');\n\n return normalizedArgs.length > 0\n ? `${normalizedArgs},\n ${argument}`\n : argument;\n};\n\nconst normalizeOptionalParametersForRequiredTrailingArg = (\n args: string,\n): string =>\n args.replaceAll(/(\\w+)\\?:\\s*([^,\\n]+)(,?)/g, '$1: $2 | undefined$3');\n\nconst buildHttpResourceOptionsArgument = (\n valueType: string,\n rawType: string,\n options: { readonly requiresDefaultValue: boolean },\n omitParse = false,\n): string => {\n const baseType = `${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<${valueType}, ${rawType}${omitParse ? ', true' : ''}>`;\n return options.requiresDefaultValue\n ? `options: ${baseType} & { defaultValue: NoInfer<${valueType}> }`\n : `options?: ${baseType}`;\n};\n\nconst buildHttpResourceOptionsExpression = (\n configuredEntries: readonly string[],\n): string | undefined => {\n if (configuredEntries.length === 0) {\n return 'options';\n }\n\n return `{\n ...(options ?? {}),\n ${configuredEntries.join(',\\n ')}\n }`;\n};\n\nconst buildHttpResourceFunctionSignatures = (\n resourceName: string,\n args: string,\n valueType: string,\n rawType: string,\n hasConfiguredDefaultValue: boolean,\n omitParse = false,\n): string => {\n if (hasConfiguredDefaultValue) {\n return `export function ${resourceName}(${appendArgument(\n args,\n buildHttpResourceOptionsArgument(\n valueType,\n rawType,\n {\n requiresDefaultValue: false,\n },\n omitParse,\n ),\n )}): HttpResourceRef<${valueType}>`;\n }\n\n const overloadArgs = appendArgument(\n normalizeOptionalParametersForRequiredTrailingArg(args),\n buildHttpResourceOptionsArgument(\n valueType,\n rawType,\n {\n requiresDefaultValue: true,\n },\n omitParse,\n ),\n );\n const implementationArgs = appendArgument(\n args,\n buildHttpResourceOptionsArgument(\n valueType,\n rawType,\n {\n requiresDefaultValue: false,\n },\n omitParse,\n ),\n );\n\n return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${valueType}>;\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${valueType} | undefined>`;\n};\n\n/**\n * Generates a single Angular `httpResource` helper function for an operation.\n *\n * The generated output handles signal-wrapped parameters, route interpolation,\n * request-body construction, content-type branching, runtime validation, and\n * optional mutator integration when the mutator is compatible with standalone\n * resource functions.\n *\n * @remarks\n * This function emits overloads when content negotiation or caller-supplied\n * `defaultValue` support requires multiple signatures.\n *\n * @returns A string containing the complete generated resource helper.\n */\nconst buildHttpResourceFunction = (\n verbOption: GeneratorVerbOptions,\n route: string,\n output: NormalizedOutputOptions,\n): string => {\n const { operationName, response, props, params, mutator } = verbOption;\n\n const dataType = response.definition.success || 'unknown';\n const omitParse = isZodSchemaOutput(output);\n const responseSchemaImports = getHttpResourceResponseImports(response);\n const hasResponseSchemaImport = responseSchemaImports.some(\n (imp) => imp.name === dataType,\n );\n const resourceName = `${operationName}Resource`;\n const parsedDataType =\n omitParse &&\n output.override.angular.runtimeValidation &&\n !isPrimitiveType(dataType) &&\n hasResponseSchemaImport\n ? getSchemaOutputTypeRef(dataType)\n : dataType;\n const successTypes = response.types.success;\n const overallReturnType =\n successTypes.length <= 1\n ? parsedDataType\n : [\n ...new Set(\n successTypes.map((type) =>\n getHttpResourceGeneratedResponseType(\n type.value,\n type.contentType,\n responseSchemaImports,\n output,\n ),\n ),\n ),\n ].join(' | ') || parsedDataType;\n resourceReturnTypesRegistry.set(\n operationName,\n `export type ${pascal(\n operationName,\n )}ResourceResult = NonNullable<${overallReturnType}>`,\n );\n const uniqueContentTypes = getUniqueContentTypes(successTypes);\n const defaultSuccess = getDefaultSuccessType(successTypes, dataType);\n const jsonContentType = successTypes.find((type) =>\n type.contentType.includes('json'),\n )?.contentType;\n const preferredContentType = jsonContentType ?? defaultSuccess.contentType;\n const resourceFactory = getHttpResourceFactory(\n response,\n preferredContentType,\n dataType,\n );\n\n const hasNamedParams = props.some(\n (prop) => prop.type === GetterPropType.NAMED_PATH_PARAMS,\n );\n const signalRoute = applySignalRoute(route, params, hasNamedParams);\n\n const signalProps = buildSignalProps(props, params);\n const args = toObjectString(signalProps, 'implementation');\n\n const { bodyForm, request, isUrlOnly } = buildResourceRequest(\n verbOption,\n signalRoute,\n );\n\n if (uniqueContentTypes.length > 1) {\n const defaultContentType = jsonContentType ?? defaultSuccess.contentType;\n const acceptTypeName = getAcceptHelperName(operationName);\n const requiredProps = signalProps.filter(\n (_, index) => props[index]?.required && !props[index]?.default,\n );\n const optionalProps = signalProps.filter(\n (_, index) => !props[index]?.required || props[index]?.default,\n );\n const requiredPart = requiredProps\n .map((prop) => prop.implementation)\n .join(',\\n ');\n const optionalPart = optionalProps\n .map((prop) => prop.implementation)\n .join(',\\n ');\n const getBranchReturnType = (type: ResReqTypesValue) =>\n getHttpResourceGeneratedResponseType(\n type.value,\n type.contentType,\n responseSchemaImports,\n output,\n );\n const unionReturnType = [\n ...new Set(\n successTypes\n .filter((type) => type.contentType)\n .map((type) => getBranchReturnType(type)),\n ),\n ].join(' | ');\n const branchOverloads = successTypes\n .filter((type) => type.contentType)\n .map((type) => {\n const returnType = getBranchReturnType(type);\n const overloadArgs = [\n requiredPart,\n `accept: '${type.contentType}'`,\n optionalPart,\n `options?: ${buildBranchOptionsType(unionReturnType, 'unknown', omitParse)}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${returnType} | undefined>;`;\n })\n .join('\\n');\n const implementationArgs = [\n requiredPart,\n `accept?: ${acceptTypeName}`,\n optionalPart,\n `options?: ${buildBranchOptionsType(unionReturnType, 'unknown', omitParse)}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n const implementationArgsWithDefault = [\n requiredPart,\n `accept: ${acceptTypeName} = '${defaultContentType}'`,\n optionalPart,\n `options?: ${buildBranchOptionsType(unionReturnType, 'unknown', omitParse)}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n const getBranchOptions = (type: ResReqTypesValue | undefined) => {\n if (!type) {\n return `options as ${buildBranchOptionsType(unionReturnType, 'unknown', omitParse)}`;\n }\n\n const factory = getHttpResourceFactory(\n response,\n type.contentType,\n type.value,\n );\n const branchOptions = buildHttpResourceOptionsLiteral(\n verbOption,\n factory,\n output,\n type.value,\n );\n const branchOptionsExpression = buildHttpResourceOptionsExpression(\n branchOptions.entries,\n );\n\n return `${branchOptionsExpression ?? 'options'} as unknown as ${buildBranchOptionsType(\n getBranchReturnType(type),\n getHttpResourceRawType(factory),\n omitParse,\n )}`;\n };\n\n const jsonType = successTypes.find(\n (type) =>\n type.contentType.includes('json') || type.contentType.includes('+json'),\n );\n const textType = successTypes.find((type) =>\n isResponseText(type.contentType, type.value),\n );\n const arrayBufferType = successTypes.find((type) =>\n isResponseArrayBuffer(type.contentType),\n );\n const blobType = successTypes.find((type) =>\n isResponseBlob(type.contentType, response.isBlob),\n );\n\n const fallbackReturn = blobType\n ? `return httpResource.blob<Blob>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(blobType)});`\n : textType\n ? `return httpResource.text<string>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(textType)});`\n : `return httpResource<${jsonType ? getBranchReturnType(jsonType) : parsedDataType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(jsonType)});`;\n\n const normalizeRequest = isUrlOnly\n ? `const normalizedRequest: HttpResourceRequest = { url: request };`\n : `const normalizedRequest: HttpResourceRequest = request;`;\n\n return `/**\n * @experimental httpResource is experimental (Angular v19.2+)\n */\n${branchOverloads}\nexport function ${resourceName}(\n ${implementationArgs}\n ): HttpResourceRef<${unionReturnType} | undefined>;\nexport function ${resourceName}(\n ${implementationArgsWithDefault}\n): HttpResourceRef<${unionReturnType} | undefined> {\n ${bodyForm ? `${bodyForm};` : ''}\n const request = ${request};\n ${normalizeRequest}\n const headers = normalizedRequest.headers instanceof HttpHeaders\n ? normalizedRequest.headers.set('Accept', accept)\n : { ...(normalizedRequest.headers ?? {}), Accept: accept };\n\n if (accept.includes('json') || accept.includes('+json')) {\n return httpResource<${jsonType ? getBranchReturnType(jsonType) : parsedDataType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(jsonType)});\n }\n\n if (accept.startsWith('text/') || accept.includes('xml')) {\n return httpResource.text<string>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(textType)});\n }\n\n ${\n arrayBufferType\n ? `if (accept.includes('octet-stream') || accept.includes('pdf')) {\n return httpResource.arrayBuffer<ArrayBuffer>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(arrayBufferType)});\n }\n\n `\n : ''\n }${fallbackReturn}\n}\n`;\n }\n\n const resourceOptions = buildHttpResourceOptionsLiteral(\n verbOption,\n resourceFactory,\n output,\n );\n const rawType = getHttpResourceRawType(resourceFactory);\n const resourceValueType = resourceOptions.hasDefaultValue\n ? parsedDataType\n : `${parsedDataType} | undefined`;\n const functionSignatures = buildHttpResourceFunctionSignatures(\n resourceName,\n args,\n parsedDataType,\n rawType,\n resourceOptions.hasDefaultValue,\n omitParse,\n );\n const implementationArgs = appendArgument(\n args,\n buildHttpResourceOptionsArgument(\n parsedDataType,\n rawType,\n {\n requiresDefaultValue: false,\n },\n omitParse,\n ),\n );\n const optionsExpression = buildHttpResourceOptionsExpression(\n resourceOptions.entries,\n );\n const resourceCallOptions = optionsExpression ? `, ${optionsExpression}` : '';\n\n // HttpClient-style mutators expect (config, httpClient) — incompatible with\n // standalone httpResource functions which have no HttpClient instance.\n // Only apply mutators that accept a single argument (request config only).\n const isResourceCompatibleMutator =\n mutator !== undefined && !mutator.hasSecondArg;\n const returnExpression = isResourceCompatibleMutator\n ? `${mutator.name}(request)`\n : 'request';\n\n if (isUrlOnly && !isResourceCompatibleMutator) {\n return `/**\n * @experimental httpResource is experimental (Angular v19.2+)\n */\n${functionSignatures};\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${resourceValueType}> {\n return ${resourceFactory}<${parsedDataType}>(() => ${request}${resourceCallOptions});\n}\n`;\n }\n\n return `/**\n * @experimental httpResource is experimental (Angular v19.2+)\n */\n${functionSignatures};\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${resourceValueType}> {\n return ${resourceFactory}<${parsedDataType}>(() => {\n ${bodyForm ? `${bodyForm};` : ''}\n const request = ${request};\n return ${returnExpression};\n }${resourceCallOptions});\n}\n`;\n};\n\nconst buildHttpResourceOptionsUtilities = (omitParse: boolean): string => `\nexport type ${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<TValue, TRaw = unknown, TOmitParse extends boolean = ${omitParse}> = TOmitParse extends true\n ? Omit<HttpResourceOptions<TValue, TRaw>, 'parse'>\n : HttpResourceOptions<TValue, TRaw>;\n`;\n\nconst getContentTypeReturnType = (\n contentType: string | undefined,\n value: string,\n): string => {\n if (!contentType) return value;\n if (contentType.includes('json') || contentType.includes('+json')) {\n return value;\n }\n if (contentType.startsWith('text/') || contentType.includes('xml')) {\n return 'string';\n }\n if (isResponseArrayBuffer(contentType)) {\n return 'ArrayBuffer';\n }\n return 'Blob';\n};\n\nconst getHttpResourceGeneratedResponseType = (\n value: string,\n contentType: string | undefined,\n responseImports: readonly { name: string }[],\n output: NormalizedOutputOptions,\n): string => {\n if (\n isZodSchemaOutput(output) &&\n output.override.angular.runtimeValidation &&\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')) &&\n !isPrimitiveType(value) &&\n responseImports.some((imp) => imp.name === value)\n ) {\n return getSchemaOutputTypeRef(value);\n }\n\n return getContentTypeReturnType(contentType, value);\n};\n\nconst buildBranchOptionsType = (\n valueType: string,\n rawType: string,\n omitParse: boolean,\n) =>\n `${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<${valueType}, ${rawType}${omitParse ? ', true' : ''}>`;\n\nconst buildResourceStateUtilities = (): string => `\n/**\n * Utility type for httpResource results with status tracking.\n * Inspired by @angular-architects/ngrx-toolkit withResource pattern.\n *\n * Uses \\`globalThis.Error\\` to avoid collision with API model types named \\`Error\\`.\n */\nexport interface ResourceState<T> {\n readonly value: Signal<T | undefined>;\n readonly status: Signal<ResourceStatus>;\n readonly error: Signal<globalThis.Error | undefined>;\n readonly isLoading: Signal<boolean>;\n readonly hasValue: () => boolean;\n readonly reload: () => boolean;\n}\n\n/**\n * Wraps an HttpResourceRef to expose a consistent ResourceState interface.\n * Useful when integrating with NgRx SignalStore via withResource().\n */\nexport function toResourceState<T>(ref: HttpResourceRef<T>): ResourceState<T> {\n return {\n value: ref.value,\n status: ref.status,\n error: ref.error,\n isLoading: ref.isLoading,\n hasValue: () => ref.hasValue(),\n reload: () => ref.reload(),\n };\n}\n`;\n\n/**\n * Generates the header section for Angular `httpResource` output.\n *\n * @remarks\n * Resource functions are emitted in the header phase because their final shape\n * depends on the full set of operations in scope, including generated `Accept`\n * helpers and any shared mutation service methods.\n *\n * @returns The generated header, resource helpers, optional mutation service class, and resource result aliases.\n */\nexport const generateHttpResourceHeader: ClientHeaderBuilder = ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n output,\n verbOptions,\n}) => {\n resetHttpClientReturnTypes();\n resourceReturnTypesRegistry.reset();\n\n const retrievals = Object.values(verbOptions).filter((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\n const hasResourceQueryParams = retrievals.some(\n (verbOption) => !!verbOption.queryParams,\n );\n const filterParamsHelper = hasResourceQueryParams\n ? `\\n${getAngularFilteredParamsHelperBody()}\\n`\n : '';\n const acceptHelpers = buildAcceptHelpers(retrievals, output);\n\n const resources = retrievals\n .map((verbOption) => {\n const fullRoute = routeRegistry.get(\n verbOption.operationName,\n verbOption.route,\n );\n return buildHttpResourceFunction(verbOption, fullRoute, output);\n })\n .join('\\n');\n const resourceTypes = resourceReturnTypesRegistry.getFooter(\n retrievals.map((verbOption) => verbOption.operationName),\n );\n\n const mutations = Object.values(verbOptions).filter((verbOption) =>\n isMutationVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\n const hasMutationQueryParams = mutations.some(\n (verbOption) => !!verbOption.queryParams,\n );\n\n const mutationImplementation = mutations\n .map((verbOption) => {\n const fullRoute = routeRegistry.get(\n verbOption.operationName,\n verbOption.route,\n );\n const generatorOptions: HttpClientGeneratorContext = {\n route: fullRoute,\n context: { output },\n };\n\n return generateHttpClientImplementation(verbOption, generatorOptions);\n })\n .join('\\n');\n\n const classImplementation = mutationImplementation\n ? `\n${buildServiceClassOpen({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n hasQueryParams: hasMutationQueryParams && !hasResourceQueryParams,\n})}\n${mutationImplementation}\n};\n`\n : '';\n\n return `${buildHttpResourceOptionsUtilities(isZodSchemaOutput(output))}${filterParamsHelper}${acceptHelpers ? `${acceptHelpers}\\n\\n` : ''}${resources}${classImplementation}${resourceTypes ? `\\n${resourceTypes}\\n` : ''}`;\n};\n\n/**\n * Generates the footer for Angular `httpResource` output.\n *\n * The footer appends any registered `ClientResult` aliases coming from shared\n * `HttpClient` mutation methods and the resource-state helper utilities emitted\n * for generated Angular resources.\n *\n * @returns The footer text for the generated Angular resource file.\n */\nexport const generateHttpResourceFooter: ClientFooterBuilder = ({\n operationNames,\n}) => {\n const clientTypes = getHttpClientReturnTypes(operationNames);\n const utilities = buildResourceStateUtilities();\n\n return `${clientTypes ? `${clientTypes}\\n` : ''}${utilities}`;\n};\n\n/**\n * Per-operation builder used during Angular `httpResource` generation.\n *\n * Unlike the `HttpClient` builder, the actual implementation body is emitted in\n * the header phase after all operations are known. This function mainly records\n * the resolved route and returns the imports required by the current operation.\n *\n * @returns An empty implementation plus the imports required by the operation.\n */\nexport const generateHttpResourceClient: ClientBuilder = (\n verbOptions,\n options,\n) => {\n routeRegistry.set(verbOptions.operationName, options.route);\n const imports = getHttpResourceVerbImports(\n verbOptions,\n options.context.output,\n );\n\n return { implementation: '\\n', imports };\n};\n\nconst buildHttpResourceFile = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n resourceReturnTypesRegistry.reset();\n\n const retrievals = Object.values(verbOptions).filter((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\n\n const hasResourceQueryParams = retrievals.some(\n (verbOption) => !!verbOption.queryParams,\n );\n const filterParamsHelper = hasResourceQueryParams\n ? `\\n${getAngularFilteredParamsHelperBody()}\\n`\n : '';\n\n const resources = retrievals\n .map((verbOption) => {\n const fullRoute = getFullRoute(\n verbOption.route,\n context.spec.servers,\n output.baseUrl,\n );\n return buildHttpResourceFunction(verbOption, fullRoute, output);\n })\n .join('\\n');\n\n const resourceTypes = resourceReturnTypesRegistry.getFooter(\n Object.values(verbOptions).map((verbOption) => verbOption.operationName),\n );\n const utilities = buildResourceStateUtilities();\n const acceptHelpers = buildAcceptHelpers(retrievals, output);\n\n return `${buildHttpResourceOptionsUtilities(isZodSchemaOutput(output))}${filterParamsHelper}${acceptHelpers ? `${acceptHelpers}\\n\\n` : ''}${resources}\\n${resourceTypes ? `${resourceTypes}\\n` : ''}${utilities}`;\n};\n\nconst buildSchemaImportDependencies = (\n output: NormalizedOutputOptions,\n imports: GeneratorImport[],\n relativeSchemasPath: string,\n) => {\n const isZod = isZodSchemaOutput(output);\n const uniqueImports = [\n ...new Map(imports.map((imp) => [imp.name, imp])).values(),\n ];\n\n if (!output.indexFiles) {\n return [...uniqueImports].map((imp) => {\n const baseName = imp.schemaName ?? imp.name;\n const name = conventionName(baseName, output.namingConvention);\n const suffix = isZod ? '.zod' : '';\n const importExtension = output.fileExtension.replace(/\\.ts$/, '');\n return {\n exports: isZod ? [{ ...imp, values: true }] : [imp],\n dependency: upath.joinSafe(\n relativeSchemasPath,\n `${name}${suffix}${importExtension}`,\n ),\n };\n });\n }\n\n if (isZod) {\n return [\n {\n exports: uniqueImports.map((imp) => ({ ...imp, values: true })),\n dependency: upath.joinSafe(relativeSchemasPath, 'index.zod'),\n },\n ];\n }\n\n return [\n {\n exports: uniqueImports,\n dependency: relativeSchemasPath,\n },\n ];\n};\n\n/**\n * Generates the extra sibling resource file used by Angular `both` mode.\n *\n * @remarks\n * The main generated file keeps the `HttpClient` service class while retrieval\n * resources are emitted into `*.resource.ts` so consumers can opt into both\n * access patterns without mixing the generated surfaces.\n *\n * @returns A single extra file descriptor representing the generated resource file.\n */\nexport const generateHttpResourceExtraFiles: ClientExtraFilesBuilder = (\n verbOptions,\n output,\n context,\n) => {\n const { extension, dirname, filename } = getFileInfo(output.target);\n const outputPath = upath.join(dirname, `${filename}.resource${extension}`);\n const header = getHeader(output.override.header, context.spec.info);\n\n const implementation = buildHttpResourceFile(verbOptions, output, context);\n\n const schemasPath =\n typeof output.schemas === 'string' ? output.schemas : output.schemas?.path;\n const basePath = schemasPath ? getFileInfo(schemasPath).dirname : undefined;\n const relativeSchemasPath = basePath\n ? output.indexFiles\n ? upath.relativeSafe(dirname, basePath)\n : upath.relativeSafe(dirname, basePath)\n : `./${filename}.schemas`;\n\n const schemaImports = buildSchemaImportDependencies(\n output,\n Object.values(verbOptions)\n .filter((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n )\n .flatMap((verbOption) => getHttpResourceVerbImports(verbOption, output)),\n relativeSchemasPath,\n );\n\n const dependencies = getAngularHttpResourceOnlyDependencies(false, false);\n const importImplementation = generateDependencyImports(\n implementation,\n [...schemaImports, ...dependencies],\n context.projectName,\n !!output.schemas,\n isSyntheticDefaultImportsAllow(output.tsconfig),\n );\n\n const mutators = Object.values(verbOptions)\n .filter((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n )\n .flatMap((verbOption) => {\n // Only include mutators that are compatible with httpResource (single-arg).\n // HttpClient mutators that require (config, httpClient) are skipped.\n const resourceMutator =\n verbOption.mutator && !verbOption.mutator.hasSecondArg\n ? verbOption.mutator\n : undefined;\n\n return [\n resourceMutator,\n verbOption.formData,\n verbOption.formUrlEncoded,\n verbOption.paramsSerializer,\n ].filter(\n (value): value is NonNullable<typeof value> => value !== undefined,\n );\n });\n\n const mutatorImports =\n mutators.length > 0\n ? generateMutatorImports({\n mutators,\n })\n : '';\n\n const content = `${header}${importImplementation}${mutatorImports}${implementation}`;\n\n return Promise.resolve([\n {\n content,\n path: outputPath,\n },\n ]);\n};\n\nexport { generateAngularTitle } from './utils';\n","import type { AngularOptions, ClientGeneratorsBuilder } from '@orval/core';\n\nimport {\n generateAngular,\n generateAngularFooter,\n generateAngularHeader,\n generateAngularTitle,\n getAngularDependencies,\n} from './http-client';\nimport {\n generateHttpResourceClient,\n generateHttpResourceExtraFiles,\n generateHttpResourceFooter,\n generateHttpResourceHeader,\n getAngularHttpResourceDependencies,\n} from './http-resource';\n\nexport * from './constants';\nexport * from './http-client';\nexport * from './http-resource';\nexport * from './types';\nexport * from './utils';\n\nconst httpClientBuilder: ClientGeneratorsBuilder = {\n client: generateAngular,\n header: generateAngularHeader,\n dependencies: getAngularDependencies,\n footer: generateAngularFooter,\n title: generateAngularTitle,\n};\n\nconst httpResourceBuilder: ClientGeneratorsBuilder = {\n client: generateHttpResourceClient,\n header: generateHttpResourceHeader,\n dependencies: getAngularHttpResourceDependencies,\n footer: generateHttpResourceFooter,\n title: generateAngularTitle,\n};\n\nconst bothClientBuilder: ClientGeneratorsBuilder = {\n ...httpClientBuilder,\n extraFiles: generateHttpResourceExtraFiles,\n};\n\nexport const builder = () => (options?: AngularOptions) => {\n switch (options?.client) {\n case 'httpResource': {\n return httpResourceBuilder;\n }\n case 'both': {\n return bothClientBuilder;\n }\n default: {\n return httpClientBuilder;\n }\n }\n};\n\nexport default builder;\n"],"mappings":";;;AAEA,MAAa,mCAAmC;CAC9C;EACE,SAAS;GACP;IAAE,MAAM;IAAc,QAAQ;IAAM;GACpC;IAAE,MAAM;IAAe,QAAQ;IAAM;GACrC,EAAE,MAAM,cAAc;GACtB,EAAE,MAAM,eAAe;GACvB;IAAE,MAAM;IAAgB,OAAO;IAAuB,QAAQ;IAAM;GACpE,EAAE,MAAM,aAAa;GACtB;EACD,YAAY;EACb;CACD;EACE,SAAS,CACP;GAAE,MAAM;GAAc,QAAQ;GAAM,EACpC;GAAE,MAAM;GAAU,QAAQ;GAAM,CACjC;EACD,YAAY;EACb;CACD;EACE,SAAS,CAAC;GAAE,MAAM;GAAc,QAAQ;GAAM,CAAC;EAC/C,YAAY;EACb;CACF;AAED,MAAa,qCAAqC,CAChD;CACE,SAAS;EACP;GAAE,MAAM;GAAgB,QAAQ;GAAM;EACtC,EAAE,MAAM,uBAAuB;EAC/B,EAAE,MAAM,mBAAmB;EAC3B,EAAE,MAAM,uBAAuB;EAC/B;GAAE,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ED,MAAM,sBAA+C;CACnD,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,OAAO;CACR;AAED,MAAM,oBAA6C;CACjD,GAAG;CACH,YAAY;CACb;AAED,MAAa,iBAAiB,YAA6B;AACzD,SAAQ,SAAS,QAAjB;EACE,KAAK,eACH,QAAO;EAET,KAAK,OACH,QAAO;EAET,QACE,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/angular",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
7
7
|
"exports": {
|
|
8
|
-
".":
|
|
8
|
+
".": {
|
|
9
|
+
"development": "./src/index.ts",
|
|
10
|
+
"default": "./dist/index.mjs"
|
|
11
|
+
},
|
|
9
12
|
"./package.json": "./package.json"
|
|
10
13
|
},
|
|
11
14
|
"files": [
|
|
@@ -18,6 +21,7 @@
|
|
|
18
21
|
"dev": "tsdown --config-loader unrun --watch src",
|
|
19
22
|
"lint": "eslint .",
|
|
20
23
|
"test": "vitest",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
21
25
|
"clean": "rimraf .turbo dist",
|
|
22
26
|
"nuke": "rimraf .turbo dist node_modules"
|
|
23
27
|
},
|
|
@@ -25,10 +29,16 @@
|
|
|
25
29
|
"@orval/core": "8.5.3"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|
|
28
|
-
"eslint": "
|
|
32
|
+
"eslint": "9.39.2",
|
|
29
33
|
"rimraf": "6.1.2",
|
|
30
34
|
"tsdown": "0.20.3",
|
|
31
35
|
"typescript": "5.9.3",
|
|
32
36
|
"vitest": "4.0.18"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"exports": {
|
|
40
|
+
".": "./dist/index.mjs",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
|
-
}
|
|
44
|
+
}
|