@orval/angular 8.10.0 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +31 -2
- package/dist/index.mjs +118 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -69,13 +69,26 @@ type ClientOverride = 'httpClient' | 'httpResource' | 'both';
|
|
|
69
69
|
declare const PRIMITIVE_TYPE_VALUES: readonly ["string", "number", "boolean", "void", "unknown"];
|
|
70
70
|
type PrimitiveType = (typeof PRIMITIVE_TYPE_VALUES)[number];
|
|
71
71
|
declare const PRIMITIVE_TYPES: Set<"string" | "number" | "boolean" | "void" | "unknown">;
|
|
72
|
+
/**
|
|
73
|
+
* Narrows a schema type string to the primitive set supported by the Angular
|
|
74
|
+
* generators' query/header helpers.
|
|
75
|
+
*/
|
|
72
76
|
declare const isPrimitiveType: (t: string | undefined) => t is PrimitiveType;
|
|
77
|
+
/**
|
|
78
|
+
* Indicates whether the configured schema output target is Zod-based.
|
|
79
|
+
*/
|
|
73
80
|
declare const isZodSchemaOutput: (output: NormalizedOutputOptions) => boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Removes `null` and `undefined` from a value in a type-safe way.
|
|
83
|
+
*/
|
|
74
84
|
declare const isDefined: <T>(v: T | null | undefined) => v is T;
|
|
75
85
|
/**
|
|
76
86
|
* Maps a schema type name to its Zod output-type reference (`${typeName}Output`).
|
|
77
87
|
*/
|
|
78
88
|
declare const getSchemaOutputTypeRef: (typeName: string) => string;
|
|
89
|
+
/**
|
|
90
|
+
* Converts an operation/tag title into the generated Angular service class name.
|
|
91
|
+
*/
|
|
79
92
|
declare const generateAngularTitle: (title: string) => string;
|
|
80
93
|
/**
|
|
81
94
|
* Builds the opening of an @Injectable Angular service class.
|
|
@@ -110,6 +123,16 @@ declare const createRouteRegistry: () => {
|
|
|
110
123
|
set(operationName: string, route: string): void;
|
|
111
124
|
get(operationName: string, fallback: string): string;
|
|
112
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Returns only the operations that belong to the current tag output.
|
|
128
|
+
*
|
|
129
|
+
* In `tags` / `tags-split` mode the writer may route untagged operations into
|
|
130
|
+
* the implicit `default` bucket. When a generated tag file targets that bucket
|
|
131
|
+
* we also include operations whose original tag list was empty; a literal
|
|
132
|
+
* user-defined `default` tag is treated like any other tag unless untagged
|
|
133
|
+
* operations are present in the same output.
|
|
134
|
+
*/
|
|
135
|
+
declare const getRelevantVerbOptionsForTag: (verbOptions: Record<string, GeneratorVerbOptions>, tag?: string) => GeneratorVerbOptions[];
|
|
113
136
|
declare const createReturnTypesRegistry: () => {
|
|
114
137
|
reset(): void;
|
|
115
138
|
set(operationName: string, typeDefinition: string): void;
|
|
@@ -142,6 +165,11 @@ declare const createReturnTypesRegistry: () => {
|
|
|
142
165
|
*/
|
|
143
166
|
declare function isRetrievalVerb(verb: Verbs, operationName?: string, clientOverride?: ClientOverride): boolean;
|
|
144
167
|
declare function isMutationVerb(verb: Verbs, operationName?: string, clientOverride?: ClientOverride): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Selects the preferred success payload type for Angular `httpResource`
|
|
170
|
+
* generation, favouring JSON responses and otherwise falling back to the
|
|
171
|
+
* generator's default content-type rules.
|
|
172
|
+
*/
|
|
145
173
|
declare function getDefaultSuccessType(successTypes: ResReqTypesValue[], fallback: string): {
|
|
146
174
|
contentType: string;
|
|
147
175
|
value: string;
|
|
@@ -256,7 +284,8 @@ declare const generateHttpClientImplementation: ({
|
|
|
256
284
|
override,
|
|
257
285
|
formData,
|
|
258
286
|
formUrlEncoded,
|
|
259
|
-
paramsSerializer
|
|
287
|
+
paramsSerializer,
|
|
288
|
+
paramsFilter
|
|
260
289
|
}: GeneratorVerbOptions, {
|
|
261
290
|
route,
|
|
262
291
|
context
|
|
@@ -383,5 +412,5 @@ declare const THIRD_PARAMETER_TEMPLATE = "// eslint-disable-next-line\n type
|
|
|
383
412
|
//#region src/index.d.ts
|
|
384
413
|
declare const builder: () => (options?: AngularOptions) => ClientGeneratorsBuilder;
|
|
385
414
|
//#endregion
|
|
386
|
-
export { ANGULAR_HTTP_CLIENT_DEPENDENCIES, ANGULAR_HTTP_RESOURCE_DEPENDENCIES, ClientOverride, HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE, HTTP_CLIENT_OPTIONS_TEMPLATE, HttpClientGeneratorContext, PRIMITIVE_TYPES, PrimitiveType, THIRD_PARAMETER_TEMPLATE, buildAcceptHelpers, buildServiceClassOpen, builder, builder as default, createReturnTypesRegistry, createRouteRegistry, generateAngular, generateAngularFooter, generateAngularHeader, generateAngularTitle, generateHttpClientImplementation, generateHttpResourceClient, generateHttpResourceExtraFiles, generateHttpResourceFooter, generateHttpResourceHeader, getAcceptHelperName, getAngularDependencies, getAngularHttpResourceDependencies, getAngularHttpResourceOnlyDependencies, getDefaultSuccessType, getHttpClientReturnTypes, getSchemaOutputTypeRef, getUniqueContentTypes, isDefined, isMutationVerb, isPrimitiveType, isRetrievalVerb, isZodSchemaOutput, resetHttpClientReturnTypes, routeRegistry };
|
|
415
|
+
export { ANGULAR_HTTP_CLIENT_DEPENDENCIES, ANGULAR_HTTP_RESOURCE_DEPENDENCIES, ClientOverride, HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE, HTTP_CLIENT_OPTIONS_TEMPLATE, HttpClientGeneratorContext, PRIMITIVE_TYPES, PrimitiveType, THIRD_PARAMETER_TEMPLATE, buildAcceptHelpers, buildServiceClassOpen, builder, builder as default, createReturnTypesRegistry, createRouteRegistry, generateAngular, generateAngularFooter, generateAngularHeader, generateAngularTitle, generateHttpClientImplementation, generateHttpResourceClient, generateHttpResourceExtraFiles, generateHttpResourceFooter, generateHttpResourceHeader, getAcceptHelperName, getAngularDependencies, getAngularHttpResourceDependencies, getAngularHttpResourceOnlyDependencies, getDefaultSuccessType, getHttpClientReturnTypes, getRelevantVerbOptionsForTag, getSchemaOutputTypeRef, getUniqueContentTypes, isDefined, isMutationVerb, isPrimitiveType, isRetrievalVerb, isZodSchemaOutput, resetHttpClientReturnTypes, routeRegistry };
|
|
387
416
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetterPropType, OutputMode, camel, conventionName, escapeRegExp, generateBodyOptions, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateVerbImports,
|
|
1
|
+
import { DefaultTag, GetterPropType, OutputMode, buildAngularParamsFilterExpression, camel, conventionName, escapeRegExp, generateBodyOptions, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateVerbImports, getAngularFilteredParamsHelperBody, getDefaultContentType, getEnumImplementation, getFileInfo, getFullRoute, getIsBodyVerb, isBoolean, isObject, isSyntheticDefaultImportsAllow, jsDoc, kebab, pascal, sanitize, toObjectString, upath } from "@orval/core";
|
|
2
2
|
//#region src/constants.ts
|
|
3
3
|
const ANGULAR_HTTP_CLIENT_DEPENDENCIES = [
|
|
4
4
|
{
|
|
@@ -136,13 +136,26 @@ const PRIMITIVE_TYPE_LOOKUP = {
|
|
|
136
136
|
void: true,
|
|
137
137
|
unknown: true
|
|
138
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Narrows a schema type string to the primitive set supported by the Angular
|
|
141
|
+
* generators' query/header helpers.
|
|
142
|
+
*/
|
|
139
143
|
const isPrimitiveType = (t) => t != void 0 && Object.prototype.hasOwnProperty.call(PRIMITIVE_TYPE_LOOKUP, t);
|
|
144
|
+
/**
|
|
145
|
+
* Indicates whether the configured schema output target is Zod-based.
|
|
146
|
+
*/
|
|
140
147
|
const isZodSchemaOutput = (output) => isObject(output.schemas) && output.schemas.type === "zod";
|
|
148
|
+
/**
|
|
149
|
+
* Removes `null` and `undefined` from a value in a type-safe way.
|
|
150
|
+
*/
|
|
141
151
|
const isDefined = (v) => v != void 0;
|
|
142
152
|
/**
|
|
143
153
|
* Maps a schema type name to its Zod output-type reference (`${typeName}Output`).
|
|
144
154
|
*/
|
|
145
155
|
const getSchemaOutputTypeRef = (typeName) => `${typeName}Output`;
|
|
156
|
+
/**
|
|
157
|
+
* Converts an operation/tag title into the generated Angular service class name.
|
|
158
|
+
*/
|
|
146
159
|
const generateAngularTitle = (title) => {
|
|
147
160
|
return `${pascal(sanitize(title))}Service`;
|
|
148
161
|
};
|
|
@@ -189,6 +202,22 @@ const createRouteRegistry = () => {
|
|
|
189
202
|
}
|
|
190
203
|
};
|
|
191
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* Returns only the operations that belong to the current tag output.
|
|
207
|
+
*
|
|
208
|
+
* In `tags` / `tags-split` mode the writer may route untagged operations into
|
|
209
|
+
* the implicit `default` bucket. When a generated tag file targets that bucket
|
|
210
|
+
* we also include operations whose original tag list was empty; a literal
|
|
211
|
+
* user-defined `default` tag is treated like any other tag unless untagged
|
|
212
|
+
* operations are present in the same output.
|
|
213
|
+
*/
|
|
214
|
+
const getRelevantVerbOptionsForTag = (verbOptions, tag) => {
|
|
215
|
+
const allVerbOptions = Object.values(verbOptions);
|
|
216
|
+
if (!tag) return allVerbOptions;
|
|
217
|
+
const camelTag = camel(tag);
|
|
218
|
+
const includeUntaggedOperations = tag === DefaultTag && allVerbOptions.some((verbOption) => verbOption.tags.length === 0);
|
|
219
|
+
return allVerbOptions.filter((verbOption) => verbOption.tags.some((currentTag) => camel(currentTag) === camelTag) || includeUntaggedOperations && verbOption.tags.length === 0);
|
|
220
|
+
};
|
|
192
221
|
const createReturnTypesRegistry = () => {
|
|
193
222
|
const returnTypesToWrite = /* @__PURE__ */ new Map();
|
|
194
223
|
return {
|
|
@@ -246,6 +275,11 @@ function isRetrievalVerb(verb, operationName, clientOverride) {
|
|
|
246
275
|
function isMutationVerb(verb, operationName, clientOverride) {
|
|
247
276
|
return !isRetrievalVerb(verb, operationName, clientOverride);
|
|
248
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Selects the preferred success payload type for Angular `httpResource`
|
|
280
|
+
* generation, favouring JSON responses and otherwise falling back to the
|
|
281
|
+
* generator's default content-type rules.
|
|
282
|
+
*/
|
|
249
283
|
function getDefaultSuccessType(successTypes, fallback) {
|
|
250
284
|
const uniqueContentTypes = [...new Set(successTypes.map((t) => t.contentType).filter(Boolean))];
|
|
251
285
|
const defaultContentType = uniqueContentTypes.find((contentType) => contentType.includes("json")) ?? (uniqueContentTypes.length > 1 ? getDefaultContentType(uniqueContentTypes) : uniqueContentTypes[0] ?? "application/json");
|
|
@@ -259,6 +293,27 @@ function getDefaultSuccessType(successTypes, fallback) {
|
|
|
259
293
|
const returnTypesRegistry = createReturnTypesRegistry();
|
|
260
294
|
const hasSchemaImport = (imports, typeName) => typeName != void 0 && imports.some((imp) => imp.name === typeName);
|
|
261
295
|
const getSchemaValueRef = (typeName) => typeName === "Error" ? "ErrorSchema" : typeName;
|
|
296
|
+
/**
|
|
297
|
+
* Partition props into the three buckets used by per-content-type overload
|
|
298
|
+
* rendering: required non-body params, body params, and optional non-body
|
|
299
|
+
* params. The body always sits between the required and optional non-body
|
|
300
|
+
* params so that the per-content-type overloads can insert a required
|
|
301
|
+
* `accept` literal immediately after the body without violating TS1016
|
|
302
|
+
* (required parameter cannot follow an optional one).
|
|
303
|
+
*/
|
|
304
|
+
const partitionPropsForMultiContent = (props) => {
|
|
305
|
+
const requiredNonBody = [];
|
|
306
|
+
const body = [];
|
|
307
|
+
const optionalNonBody = [];
|
|
308
|
+
for (const p of props) if (p.type === GetterPropType.BODY) body.push(p);
|
|
309
|
+
else if (p.required && !p.default) requiredNonBody.push(p);
|
|
310
|
+
else optionalNonBody.push(p);
|
|
311
|
+
return {
|
|
312
|
+
requiredNonBody,
|
|
313
|
+
body,
|
|
314
|
+
optionalNonBody
|
|
315
|
+
};
|
|
316
|
+
};
|
|
262
317
|
const getContentTypeReturnType$1 = (contentType, value) => {
|
|
263
318
|
if (!contentType) return value;
|
|
264
319
|
if (contentType.includes("json") || contentType.includes("+json")) return value;
|
|
@@ -330,15 +385,15 @@ const buildAcceptHelpers = (verbOptions, output) => verbOptions.flatMap((verbOpt
|
|
|
330
385
|
*/
|
|
331
386
|
const generateAngularHeader = ({ title, isRequestOptions, isMutator, isGlobalMutator, provideIn, verbOptions, tag, output }) => {
|
|
332
387
|
returnTypesRegistry.reset();
|
|
333
|
-
const relevantVerbs =
|
|
334
|
-
const
|
|
388
|
+
const relevantVerbs = getRelevantVerbOptionsForTag(verbOptions, tag);
|
|
389
|
+
const hasBuiltInFilteredQueryParams = relevantVerbs.some((v) => v.queryParams && !v.paramsFilter);
|
|
335
390
|
const acceptHelpers = buildAcceptHelpers(relevantVerbs, output);
|
|
336
391
|
return `
|
|
337
392
|
${isRequestOptions && !isGlobalMutator ? `${HTTP_CLIENT_OPTIONS_TEMPLATE}
|
|
338
393
|
|
|
339
394
|
${HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE}
|
|
340
395
|
|
|
341
|
-
${
|
|
396
|
+
${hasBuiltInFilteredQueryParams ? getAngularFilteredParamsHelperBody() : ""}` : ""}
|
|
342
397
|
|
|
343
398
|
${isRequestOptions && isMutator ? THIRD_PARAMETER_TEMPLATE : ""}
|
|
344
399
|
|
|
@@ -383,7 +438,7 @@ const generateAngularFooter = ({ operationNames }) => {
|
|
|
383
438
|
*
|
|
384
439
|
* @returns The complete TypeScript method declaration and implementation for the operation.
|
|
385
440
|
*/
|
|
386
|
-
const generateHttpClientImplementation = ({ headers, queryParams, operationName, response, mutator, body, props, verb, override, formData, formUrlEncoded, paramsSerializer }, { route, context }) => {
|
|
441
|
+
const generateHttpClientImplementation = ({ headers, queryParams, operationName, response, mutator, body, props, verb, override, formData, formUrlEncoded, paramsSerializer, paramsFilter }, { route, context }) => {
|
|
387
442
|
const isRequestOptions = override.requestOptions !== false;
|
|
388
443
|
const isFormData = !override.formData.disabled;
|
|
389
444
|
const isFormUrlEncoded = override.formUrlEncoded !== false;
|
|
@@ -423,7 +478,8 @@ const generateHttpClientImplementation = ({ headers, queryParams, operationName,
|
|
|
423
478
|
isFormUrlEncoded,
|
|
424
479
|
hasSignal: false,
|
|
425
480
|
isExactOptionalPropertyTypes,
|
|
426
|
-
isAngular: true
|
|
481
|
+
isAngular: true,
|
|
482
|
+
paramsFilter
|
|
427
483
|
});
|
|
428
484
|
const requestOptions = isRequestOptions ? generateMutatorRequestOptions(override.requestOptions, mutator.hasThirdArg) : "";
|
|
429
485
|
return ` ${operationName}<TData = ${dataType}>(\n ${mutator.bodyTypeName && body.definition ? toObjectString(props, "implementation").replace(new RegExp(String.raw`(\\w*):\\s?${body.definition}`), `$1: ${mutator.bodyTypeName}<${body.definition}>`) : toObjectString(props, "implementation")}\n ${isRequestOptions && mutator.hasThirdArg ? `options?: ThirdParameter<typeof ${mutator.name}>` : ""}) {${bodyForm}
|
|
@@ -446,6 +502,7 @@ const generateHttpClientImplementation = ({ headers, queryParams, operationName,
|
|
|
446
502
|
isFormUrlEncoded,
|
|
447
503
|
paramsSerializer,
|
|
448
504
|
paramsSerializerOptions: override.paramsSerializerOptions,
|
|
505
|
+
paramsFilter,
|
|
449
506
|
isAngular: true,
|
|
450
507
|
isExactOptionalPropertyTypes,
|
|
451
508
|
hasSignal: false
|
|
@@ -458,12 +515,16 @@ const generateHttpClientImplementation = ({ headers, queryParams, operationName,
|
|
|
458
515
|
const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;
|
|
459
516
|
const angularParamsRef = queryParams ? "filteredParams" : void 0;
|
|
460
517
|
let paramsDeclaration = "";
|
|
461
|
-
if (angularParamsRef && queryParams)
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
518
|
+
if (angularParamsRef && queryParams) {
|
|
519
|
+
const filterExpr = buildAngularParamsFilterExpression({
|
|
520
|
+
paramsExpression: isRequestOptions ? "{...params, ...options?.params}" : "params ?? {}",
|
|
521
|
+
requiredNullableParamKeys: queryParams.requiredNullableKeys ?? [],
|
|
522
|
+
preserveRequiredNullables: !!paramsSerializer,
|
|
523
|
+
nonPrimitiveKeys: paramsSerializer ? queryParams.nonPrimitiveKeys ?? [] : [],
|
|
524
|
+
paramsFilter,
|
|
525
|
+
useSharedHelper: isRequestOptions
|
|
526
|
+
});
|
|
527
|
+
paramsDeclaration = paramsSerializer ? `const ${angularParamsRef} = ${paramsSerializer.name}(${filterExpr});\n\n ` : `const ${angularParamsRef} = ${filterExpr};\n\n `;
|
|
467
528
|
}
|
|
468
529
|
const optionsInput = {
|
|
469
530
|
...optionsBase,
|
|
@@ -509,19 +570,31 @@ const generateHttpClientImplementation = ({ headers, queryParams, operationName,
|
|
|
509
570
|
if (hasTDataGeneric) functionName += `<TData = ${parsedDataType}>`;
|
|
510
571
|
let contentTypeOverloads = "";
|
|
511
572
|
if (hasMultipleContentTypes && isRequestOptions) {
|
|
512
|
-
const
|
|
513
|
-
const
|
|
573
|
+
const { requiredNonBody: requiredNonBodyProps, body: bodyProps, optionalNonBody: optionalNonBodyProps } = partitionPropsForMultiContent(props);
|
|
574
|
+
const requiredNonBodyPart = requiredNonBodyProps.map((p) => p.definition).join(",\n ");
|
|
575
|
+
const bodyPart = bodyProps.map((p) => p.definition).join(",\n ");
|
|
576
|
+
const bodyOverloadPart = bodyProps.map((p) => {
|
|
577
|
+
const optionalMarker = `${p.name}?:`;
|
|
578
|
+
if (!p.required && p.definition.startsWith(optionalMarker)) {
|
|
579
|
+
const required = `${p.name}:${p.definition.slice(optionalMarker.length)}`;
|
|
580
|
+
return /\bundefined\b/.test(required) ? required : `${required} | undefined`;
|
|
581
|
+
}
|
|
582
|
+
return p.definition;
|
|
583
|
+
}).join(",\n ");
|
|
584
|
+
const optionalNonBodyPart = optionalNonBodyProps.map((p) => p.definition).join(",\n ");
|
|
514
585
|
contentTypeOverloads = `${successTypes.filter(({ contentType }) => !!contentType).map(({ contentType, value }) => {
|
|
515
586
|
const returnType = getGeneratedResponseType(value, contentType);
|
|
516
587
|
return `${operationName}(${[
|
|
517
|
-
|
|
588
|
+
requiredNonBodyPart,
|
|
589
|
+
bodyOverloadPart,
|
|
518
590
|
`accept: '${contentType}'`,
|
|
519
|
-
|
|
591
|
+
optionalNonBodyPart
|
|
520
592
|
].filter(Boolean).join(",\n ")}, options?: HttpClientOptions): Observable<${returnType}>;`;
|
|
521
593
|
}).join("\n ")}\n ${operationName}(${[
|
|
522
|
-
|
|
594
|
+
requiredNonBodyPart,
|
|
595
|
+
bodyPart,
|
|
523
596
|
`accept?: ${acceptTypeName ?? "string"}`,
|
|
524
|
-
|
|
597
|
+
optionalNonBodyPart
|
|
525
598
|
].filter(Boolean).join(",\n ")}, options?: HttpClientOptions): ${refinedMultiImplementationReturnType};`;
|
|
526
599
|
}
|
|
527
600
|
const observeOverloads = isRequestOptions && !hasMultipleContentTypes ? `${functionName}(${propsDefinition} options?: HttpClientBodyOptions): Observable<${hasTDataGeneric ? "TData" : parsedDataType}>;\n ${functionName}(${propsDefinition} options?: HttpClientEventOptions): Observable<HttpEvent<${hasTDataGeneric ? "TData" : parsedDataType}>>;\n ${functionName}(${propsDefinition} options?: HttpClientResponseOptions): Observable<AngularHttpResponse<${hasTDataGeneric ? "TData" : parsedDataType}>>;` : "";
|
|
@@ -539,14 +612,17 @@ const generateHttpClientImplementation = ({ headers, queryParams, operationName,
|
|
|
539
612
|
${deleteBodyOption ? `${deleteBodyOption},` : ""}
|
|
540
613
|
}`;
|
|
541
614
|
const buildHttpClientCall = (typeArg, optionsObject) => getIsBodyVerb(verb) && verb !== "delete" ? `this.http.${verb}${typeArg}(\`${route}\`, ${bodyIdentifier ?? "undefined"}, ${optionsObject})` : `this.http.${verb}${typeArg}(\`${route}\`, ${optionsObject})`;
|
|
542
|
-
const
|
|
543
|
-
const
|
|
615
|
+
const { requiredNonBody: requiredNonBodyImplProps, body: bodyImplProps, optionalNonBody: optionalNonBodyImplProps } = partitionPropsForMultiContent(props);
|
|
616
|
+
const requiredNonBodyImplPart = requiredNonBodyImplProps.map((p) => p.implementation).join(",\n ");
|
|
617
|
+
const bodyImplPart = bodyImplProps.map((p) => p.implementation).join(",\n ");
|
|
618
|
+
const optionalNonBodyImplPart = optionalNonBodyImplProps.map((p) => p.implementation).join(",\n ");
|
|
544
619
|
return ` ${overloads}
|
|
545
620
|
${operationName}(
|
|
546
621
|
${[
|
|
547
|
-
|
|
622
|
+
requiredNonBodyImplPart,
|
|
623
|
+
bodyImplPart,
|
|
548
624
|
`accept: ${acceptTypeName ?? "string"} = '${defaultContentType}'`,
|
|
549
|
-
|
|
625
|
+
optionalNonBodyImplPart
|
|
550
626
|
].filter(Boolean).join(",\n ")},
|
|
551
627
|
${isRequestOptions ? "options?: HttpClientOptions" : ""}
|
|
552
628
|
): ${refinedMultiImplementationReturnType} {${bodyForm}
|
|
@@ -701,7 +777,6 @@ const getHttpResourceOverride = (verbOption, output) => {
|
|
|
701
777
|
const resourceReturnTypesRegistry = createReturnTypesRegistry();
|
|
702
778
|
/** @internal Exported for testing only */
|
|
703
779
|
const routeRegistry = createRouteRegistry();
|
|
704
|
-
const getRelevantVerbOptions = (verbOptions, tag) => tag ? Object.values(verbOptions).filter((verbOption) => verbOption.tags.some((currentTag) => camel(currentTag) === camel(tag))) : Object.values(verbOptions);
|
|
705
780
|
const getVerbOptionsRecord = (verbOptions) => Object.fromEntries(verbOptions.map((verbOption) => [verbOption.operationId, verbOption]));
|
|
706
781
|
const getPrimaryTag = (verbOption) => kebab(verbOption.tags[0] ?? "default");
|
|
707
782
|
const hasRetrievalOperations = (verbOptions) => Object.values(verbOptions).some((verbOption) => isRetrievalVerb(verbOption.verb, verbOption.operationName, getClientOverride(verbOption)));
|
|
@@ -838,7 +913,7 @@ const applySignalRoute = (route, params, useNamedParams) => {
|
|
|
838
913
|
}
|
|
839
914
|
return updatedRoute;
|
|
840
915
|
};
|
|
841
|
-
const buildResourceRequest = ({ verb, body, headers, queryParams, paramsSerializer, override, formData, formUrlEncoded }, route) => {
|
|
916
|
+
const buildResourceRequest = ({ verb, body, headers, queryParams, paramsSerializer, paramsFilter, override, formData, formUrlEncoded }, route) => {
|
|
842
917
|
const isFormData = !override.formData.disabled;
|
|
843
918
|
const isFormUrlEncoded = override.formUrlEncoded !== false;
|
|
844
919
|
const bodyForm = generateFormDataAndUrlEncodedFunction({
|
|
@@ -854,7 +929,14 @@ const buildResourceRequest = ({ verb, body, headers, queryParams, paramsSerializ
|
|
|
854
929
|
const bodyValue = hasFormData ? "formData" : hasFormUrlEncoded ? "formUrlEncoded" : bodyAccess;
|
|
855
930
|
const paramsAccess = queryParams ? "params?.()" : void 0;
|
|
856
931
|
const headersAccess = headers ? "headers?.()" : void 0;
|
|
857
|
-
const filteredParamsValue = paramsAccess ?
|
|
932
|
+
const filteredParamsValue = paramsAccess ? buildAngularParamsFilterExpression({
|
|
933
|
+
paramsExpression: `${paramsAccess} ?? {}`,
|
|
934
|
+
requiredNullableParamKeys: queryParams?.requiredNullableKeys ?? [],
|
|
935
|
+
preserveRequiredNullables: !!paramsSerializer,
|
|
936
|
+
nonPrimitiveKeys: paramsSerializer ? queryParams?.nonPrimitiveKeys ?? [] : [],
|
|
937
|
+
paramsFilter,
|
|
938
|
+
useSharedHelper: true
|
|
939
|
+
}) : void 0;
|
|
858
940
|
const paramsValue = paramsAccess ? paramsSerializer ? `params?.() ? ${paramsSerializer.name}(${filteredParamsValue}) : undefined` : filteredParamsValue : void 0;
|
|
859
941
|
const isGet = verb === "get";
|
|
860
942
|
const isUrlOnly = !(!isGet || !!bodyValue || !!paramsValue || !!headersAccess) && !bodyForm;
|
|
@@ -1178,17 +1260,17 @@ export function toResourceState<T>(ref: HttpResourceRef<T>): ResourceState<T> {
|
|
|
1178
1260
|
const generateHttpResourceHeader = ({ title, isRequestOptions, isMutator, isGlobalMutator, provideIn, output, verbOptions, tag }) => {
|
|
1179
1261
|
resetHttpClientReturnTypes();
|
|
1180
1262
|
resourceReturnTypesRegistry.reset();
|
|
1181
|
-
const relevantVerbOptions =
|
|
1263
|
+
const relevantVerbOptions = getRelevantVerbOptionsForTag(verbOptions, tag);
|
|
1182
1264
|
const retrievals = relevantVerbOptions.filter((verbOption) => isRetrievalVerb(verbOption.verb, verbOption.operationName, getClientOverride(verbOption)));
|
|
1183
|
-
const
|
|
1184
|
-
const filterParamsHelper =
|
|
1185
|
-
const acceptHelpers = buildAcceptHelpers(retrievals, output);
|
|
1265
|
+
const hasBuiltInFilteredQueryParams = retrievals.some((verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter);
|
|
1266
|
+
const filterParamsHelper = hasBuiltInFilteredQueryParams ? `\n${getAngularFilteredParamsHelperBody()}\n` : "";
|
|
1186
1267
|
const resources = retrievals.map((verbOption) => {
|
|
1187
1268
|
return buildHttpResourceFunction(verbOption, routeRegistry.get(verbOption.operationName, verbOption.route), output);
|
|
1188
1269
|
}).join("\n");
|
|
1189
1270
|
const resourceTypes = resourceReturnTypesRegistry.getFooter(retrievals.map((verbOption) => verbOption.operationName));
|
|
1190
1271
|
const mutations = relevantVerbOptions.filter((verbOption) => isMutationVerb(verbOption.verb, verbOption.operationName, getClientOverride(verbOption)));
|
|
1191
|
-
const
|
|
1272
|
+
const acceptHelpers = buildAcceptHelpers([...retrievals, ...mutations], output);
|
|
1273
|
+
const hasMutationBuiltInFilteredQueryParams = mutations.some((verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter);
|
|
1192
1274
|
const mutationImplementation = mutations.map((verbOption) => {
|
|
1193
1275
|
return generateHttpClientImplementation(verbOption, {
|
|
1194
1276
|
route: routeRegistry.get(verbOption.operationName, verbOption.route),
|
|
@@ -1202,7 +1284,7 @@ ${buildServiceClassOpen({
|
|
|
1202
1284
|
isMutator,
|
|
1203
1285
|
isGlobalMutator,
|
|
1204
1286
|
provideIn,
|
|
1205
|
-
hasQueryParams:
|
|
1287
|
+
hasQueryParams: hasMutationBuiltInFilteredQueryParams && !hasBuiltInFilteredQueryParams
|
|
1206
1288
|
})}
|
|
1207
1289
|
${mutationImplementation}
|
|
1208
1290
|
};
|
|
@@ -1242,7 +1324,7 @@ const generateHttpResourceClient = (verbOptions, options) => {
|
|
|
1242
1324
|
const buildHttpResourceFile = (verbOptions, output, context) => {
|
|
1243
1325
|
resourceReturnTypesRegistry.reset();
|
|
1244
1326
|
const retrievals = Object.values(verbOptions).filter((verbOption) => isRetrievalVerb(verbOption.verb, verbOption.operationName, getClientOverride(verbOption)));
|
|
1245
|
-
const filterParamsHelper = retrievals.some((verbOption) => !!verbOption.queryParams) ? `\n${getAngularFilteredParamsHelperBody()}\n` : "";
|
|
1327
|
+
const filterParamsHelper = retrievals.some((verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter) ? `\n${getAngularFilteredParamsHelperBody()}\n` : "";
|
|
1246
1328
|
const resources = retrievals.map((verbOption) => {
|
|
1247
1329
|
return buildHttpResourceFunction(verbOption, getFullRoute(verbOption.route, context.spec.servers, output.baseUrl), output);
|
|
1248
1330
|
}).join("\n");
|
|
@@ -1315,7 +1397,8 @@ const buildHttpResourceExtraFile = (verbOptions, outputPath, output, context, he
|
|
|
1315
1397
|
verbOption.mutator && !verbOption.mutator.hasSecondArg ? verbOption.mutator : void 0,
|
|
1316
1398
|
verbOption.formData,
|
|
1317
1399
|
verbOption.formUrlEncoded,
|
|
1318
|
-
verbOption.paramsSerializer
|
|
1400
|
+
verbOption.paramsSerializer,
|
|
1401
|
+
verbOption.paramsFilter
|
|
1319
1402
|
].filter((value) => value !== void 0);
|
|
1320
1403
|
});
|
|
1321
1404
|
return {
|
|
@@ -1350,7 +1433,7 @@ const generateHttpResourceExtraFiles = (verbOptions, output, context) => {
|
|
|
1350
1433
|
}
|
|
1351
1434
|
return Promise.resolve([...groupedVerbOptions.entries()].filter(([, tagVerbOptions]) => hasRetrievalOperations(tagVerbOptions)).map(([tag, tagVerbOptions]) => buildHttpResourceExtraFile(tagVerbOptions, getHttpResourceExtraFilePath(output, tag), output, context, header)));
|
|
1352
1435
|
}
|
|
1353
|
-
return Promise.resolve([buildHttpResourceExtraFile(getVerbOptionsRecord(
|
|
1436
|
+
return Promise.resolve([buildHttpResourceExtraFile(getVerbOptionsRecord(getRelevantVerbOptionsForTag(verbOptions)), getHttpResourceExtraFilePath(output), output, context, header)]);
|
|
1354
1437
|
};
|
|
1355
1438
|
//#endregion
|
|
1356
1439
|
//#region src/index.ts
|
|
@@ -1380,6 +1463,6 @@ const builder = () => (options) => {
|
|
|
1380
1463
|
}
|
|
1381
1464
|
};
|
|
1382
1465
|
//#endregion
|
|
1383
|
-
export { ANGULAR_HTTP_CLIENT_DEPENDENCIES, ANGULAR_HTTP_RESOURCE_DEPENDENCIES, HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE, HTTP_CLIENT_OPTIONS_TEMPLATE, PRIMITIVE_TYPES, THIRD_PARAMETER_TEMPLATE, buildAcceptHelpers, buildServiceClassOpen, builder, builder as default, createReturnTypesRegistry, createRouteRegistry, generateAngular, generateAngularFooter, generateAngularHeader, generateAngularTitle, generateHttpClientImplementation, generateHttpResourceClient, generateHttpResourceExtraFiles, generateHttpResourceFooter, generateHttpResourceHeader, getAcceptHelperName, getAngularDependencies, getAngularHttpResourceDependencies, getAngularHttpResourceOnlyDependencies, getDefaultSuccessType, getHttpClientReturnTypes, getSchemaOutputTypeRef, getUniqueContentTypes, isDefined, isMutationVerb, isPrimitiveType, isRetrievalVerb, isZodSchemaOutput, resetHttpClientReturnTypes, routeRegistry };
|
|
1466
|
+
export { ANGULAR_HTTP_CLIENT_DEPENDENCIES, ANGULAR_HTTP_RESOURCE_DEPENDENCIES, HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE, HTTP_CLIENT_OPTIONS_TEMPLATE, PRIMITIVE_TYPES, THIRD_PARAMETER_TEMPLATE, buildAcceptHelpers, buildServiceClassOpen, builder, builder as default, createReturnTypesRegistry, createRouteRegistry, generateAngular, generateAngularFooter, generateAngularHeader, generateAngularTitle, generateHttpClientImplementation, generateHttpResourceClient, generateHttpResourceExtraFiles, generateHttpResourceFooter, generateHttpResourceHeader, getAcceptHelperName, getAngularDependencies, getAngularHttpResourceDependencies, getAngularHttpResourceOnlyDependencies, getDefaultSuccessType, getHttpClientReturnTypes, getRelevantVerbOptionsForTag, getSchemaOutputTypeRef, getUniqueContentTypes, isDefined, isMutationVerb, isPrimitiveType, isRetrievalVerb, isZodSchemaOutput, resetHttpClientReturnTypes, routeRegistry };
|
|
1384
1467
|
|
|
1385
1468
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["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\n/**\n * Maps a schema type name to its Zod output-type reference (`${typeName}Output`).\n */\nexport const getSchemaOutputTypeRef = (typeName: string): string =>\n `${typeName}Output`;\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 generateBodyOptions,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsExpression,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n getEnumImplementation,\n getIsBodyVerb,\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 getSchemaOutputTypeRef,\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 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 // When Zod runtime validation is enabled the emitted method signature exposes\n // `parsedDataType` (e.g. `PetsOutput`) directly instead of a caller-overridable\n // `TData` generic. Casting `Schema.parse(data)` to `TData` is unsound because\n // `TData` can be widened/narrowed by callers while the runtime value is always\n // `PetsOutput`. We therefore drop the cast on the validation path and let the\n // inferred return type flow naturally.\n const validationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data)))`\n : '';\n const responseValidationPipe = shouldValidateResponse\n ? `.pipe(map(response => response.clone({ body: ${schemaValueRef}.parse(response.body) })))`\n : '';\n const eventValidationPipe = shouldValidateResponse\n ? `.pipe(map(event => event instanceof AngularHttpResponse ? event.clone({ body: ${schemaValueRef}.parse(event.body) }) : 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 = queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n if (isRequestOptions) {\n // Uses the shared filterParams helper emitted in the file header\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 } else {\n // No shared helper available; use inline IIFE filtering\n const iifeExpr = getAngularFilteredParamsExpression(\n 'params ?? {}',\n queryParams.requiredNullableKeys ?? [],\n !!paramsSerializer,\n );\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${iifeExpr});\\n\\n `\n : `const ${angularParamsRef} = ${iifeExpr};\\n\\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 // When the response goes through a Zod runtime validation pipe the runtime\n // value is fixed to `parsedDataType` (e.g. `PetsOutput`), so we avoid\n // exposing a caller-overridable `<TData>` generic on that path.\n const hasTDataGeneric =\n isModelType && !hasMultipleContentTypes && !shouldValidateResponse;\n let functionName = operationName;\n if (hasTDataGeneric) {\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<${hasTDataGeneric ? 'TData' : parsedDataType}>;\\n ${functionName}(${propsDefinition} options?: HttpClientEventOptions): Observable<HttpEvent<${hasTDataGeneric ? 'TData' : parsedDataType}>>;\\n ${functionName}(${propsDefinition} options?: HttpClientResponseOptions): Observable<AngularHttpResponse<${hasTDataGeneric ? 'TData' : parsedDataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = hasTDataGeneric ? 'TData' : parsedDataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const bodyIdentifier = generateBodyOptions(\n body,\n isFormData,\n isFormUrlEncoded,\n );\n const deleteBodyOption =\n verb === 'delete' && bodyIdentifier ? `body: ${bodyIdentifier}` : '';\n const buildOptionsObject = (responseType: string) => `{\n ...options,\n responseType: '${responseType}',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n ${deleteBodyOption ? `${deleteBodyOption},` : ''}\n }`;\n const buildHttpClientCall = (typeArg: string, optionsObject: string) =>\n getIsBodyVerb(verb) && verb !== 'delete'\n ? `this.http.${verb}${typeArg}(\\`${route}\\`, ${bodyIdentifier ?? 'undefined'}, ${optionsObject})`\n : `this.http.${verb}${typeArg}(\\`${route}\\`, ${optionsObject})`;\n\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 ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return ${buildHttpClientCall('', buildOptionsObject('text'))} as Observable<string>;\n }${\n blobSuccessTypes.length > 0\n ? ` else {\n return ${buildHttpClientCall('', buildOptionsObject('blob'))} as Observable<Blob>;\n }`\n : `\n\n return ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};`\n }\n }\n`;\n }\n\n // When the validation pipe is active the runtime payload is always the\n // parsed output type, so we emit `HttpClient.<verb><PetsOutput>(...)`\n // rather than threading a caller-overridable `TData` through the call.\n const httpTypeArg = hasTDataGeneric\n ? '<TData>'\n : shouldValidateResponse && isModelType\n ? `<${parsedDataType}>`\n : '';\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${httpTypeArg}(${observeOptions?.events ?? options})${eventValidationPipe};\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${httpTypeArg}(${observeOptions?.response ?? options})${responseValidationPipe};\n }\n\n return this.http.${verb}${httpTypeArg}(${observeOptions?.body ?? options})${validationPipe};`\n : `return this.http.${verb}${httpTypeArg}(${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 camel,\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 kebab,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n OutputMode,\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 getSchemaOutputTypeRef,\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 getRelevantVerbOptions = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n tag?: string,\n): GeneratorVerbOptions[] =>\n tag\n ? Object.values(verbOptions).filter((verbOption) =>\n verbOption.tags.some((currentTag) => camel(currentTag) === camel(tag)),\n )\n : Object.values(verbOptions);\n\nconst getVerbOptionsRecord = (\n verbOptions: readonly GeneratorVerbOptions[],\n): Record<string, GeneratorVerbOptions> =>\n Object.fromEntries(\n verbOptions.map((verbOption) => [verbOption.operationId, verbOption]),\n );\n\nconst getPrimaryTag = (verbOption: GeneratorVerbOptions): string =>\n kebab(verbOption.tags[0] ?? 'default');\n\nconst hasRetrievalOperations = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n): boolean =>\n Object.values(verbOptions).some((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\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 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 getBranchRawType = (type: ResReqTypesValue): string =>\n getHttpResourceRawType(\n getHttpResourceFactory(response, type.contentType, type.value),\n );\n // Per-branch options types (one per distinct content-type branch).\n // Deduped so text-like content types (text/plain, application/xml) that\n // share the same factory don't produce duplicate union members.\n const branchOptionsTypes = [\n ...new Set(\n successTypes\n .filter((type) => type.contentType)\n .map((type) =>\n buildBranchOptionsType(\n getBranchReturnType(type),\n getBranchRawType(type),\n omitParse,\n ),\n ),\n ),\n ];\n // The implementation signature accepts the union of branch option types.\n // This keeps each overload's narrow `options` assignable to the\n // implementation signature (required for TS overload compatibility) while\n // preventing mismatched `defaultValue`/`parse` across content types.\n const implementationOptionsType = branchOptionsTypes.join(' | ');\n // Per-accept overloads pin `options` to the branch-specific value/raw\n // types so `defaultValue` / `parse` type-check against the actual content\n // type — e.g. passing a `string` default to the `application/json`\n // overload is now a type error.\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(returnType, getBranchRawType(type), omitParse)}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${returnType} | undefined>;`;\n })\n .join('\\n');\n const implementationArgsWithDefault = [\n requiredPart,\n `accept: ${acceptTypeName} = '${defaultContentType}'`,\n optionalPart,\n `options?: ${implementationOptionsType}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n const getBranchOptions = (type?: ResReqTypesValue) => {\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 // Fallback path for unknown accept values must match the branch the\n // default `accept` argument targets — pick the success type whose content\n // type is `defaultContentType`, then fall back to the remaining branches\n // in the same priority order as the runtime dispatch above.\n const fallbackType =\n successTypes.find((type) => type.contentType === defaultContentType) ??\n jsonType ??\n textType ??\n arrayBufferType ??\n blobType;\n\n const buildFallbackReturn = (type: ResReqTypesValue): string => {\n const factory = getHttpResourceFactory(\n response,\n type.contentType,\n type.value,\n );\n const returnType =\n factory === 'httpResource'\n ? getBranchReturnType(type)\n : getHttpResourceRawType(factory);\n return `return ${factory}<${returnType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(type)});`;\n };\n\n const fallbackReturn = fallbackType\n ? buildFallbackReturn(fallbackType)\n : `return httpResource<${parsedDataType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions()});`;\n\n // Default-accept overload (when `accept` is omitted): narrow `options` to\n // the branch the runtime falls back to, so callers that skip `accept`\n // still get branch-specific typing instead of the broad options union.\n const defaultOverloadOptionsType = fallbackType\n ? buildBranchOptionsType(\n getBranchReturnType(fallbackType),\n getBranchRawType(fallbackType),\n omitParse,\n )\n : implementationOptionsType;\n const defaultOverloadReturnType = fallbackType\n ? getBranchReturnType(fallbackType)\n : unionReturnType;\n const defaultOverloadArgs = [\n requiredPart,\n optionalPart,\n `options?: ${defaultOverloadOptionsType}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\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 ${defaultOverloadArgs}\n ): HttpResourceRef<${defaultOverloadReturnType} | 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 tag,\n}) => {\n resetHttpClientReturnTypes();\n resourceReturnTypesRegistry.reset();\n\n // When the output is emitted per-tag (modes: `tags`, `tags-split`) each file\n // must only reference operations that belong to the current tag — otherwise\n // the shared header duplicates helpers across every tag file and pulls in\n // type names the file-local `imports` filter never sees, producing missing\n // schema imports in the generated output.\n const relevantVerbOptions = getRelevantVerbOptions(verbOptions, tag);\n\n const retrievals = relevantVerbOptions.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 = relevantVerbOptions.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.schemas) {\n return [\n {\n exports: isZod\n ? uniqueImports.map((imp) => ({ ...imp, values: true }))\n : uniqueImports,\n dependency: relativeSchemasPath,\n },\n ];\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: relativeSchemasPath,\n },\n ];\n }\n\n return [\n {\n exports: uniqueImports,\n dependency: relativeSchemasPath,\n },\n ];\n};\n\nconst getHttpResourceExtraFilePath = (\n output: NormalizedOutputOptions,\n tag?: string,\n): string => {\n const { extension, dirname, filename } = getFileInfo(output.target, {\n extension: output.fileExtension,\n });\n\n switch (output.mode) {\n case OutputMode.TAGS: {\n const normalizedTag = kebab(tag ?? 'default');\n return upath.joinSafe(dirname, `${normalizedTag}.resource${extension}`);\n }\n case OutputMode.TAGS_SPLIT: {\n const normalizedTag = kebab(tag ?? 'default');\n return upath.joinSafe(\n dirname,\n normalizedTag,\n `${normalizedTag}.resource${extension}`,\n );\n }\n default: {\n return upath.joinSafe(dirname, `${filename}.resource${extension}`);\n }\n }\n};\n\nconst getHttpResourceRelativeSchemasPath = (\n output: NormalizedOutputOptions,\n outputPath: string,\n): string => {\n const schemasPath =\n typeof output.schemas === 'string' ? output.schemas : output.schemas?.path;\n\n if (schemasPath) {\n return upath.getRelativeImportPath(\n outputPath,\n getFileInfo(schemasPath).dirname,\n );\n }\n\n const { dirname, filename, extension } = getFileInfo(output.target, {\n extension: output.fileExtension,\n });\n return upath.getRelativeImportPath(\n outputPath,\n upath.joinSafe(dirname, `${filename}.schemas${extension}`),\n output.fileExtension !== '.ts',\n );\n};\n\nconst buildHttpResourceExtraFile = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n outputPath: string,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n header: string,\n) => {\n const implementation = buildHttpResourceFile(verbOptions, output, context);\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 getHttpResourceRelativeSchemasPath(output, outputPath),\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 oneMore: output.mode === OutputMode.TAGS_SPLIT,\n })\n : '';\n\n return {\n content: `${header}${importImplementation}${mutatorImports}${implementation}`,\n path: outputPath,\n };\n};\n\n/**\n * Generates the extra sibling resource files 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. In tag-based output\n * modes this emits one sibling resource file per generated tag file.\n *\n * @returns One or more extra file descriptors representing generated resource files.\n */\nexport const generateHttpResourceExtraFiles: ClientExtraFilesBuilder = (\n verbOptions,\n output,\n context,\n) => {\n const header = getHeader(output.override.header, context.spec.info);\n\n if (!hasRetrievalOperations(verbOptions)) {\n return Promise.resolve([]);\n }\n\n if (\n output.mode === OutputMode.TAGS ||\n output.mode === OutputMode.TAGS_SPLIT\n ) {\n const groupedVerbOptions = new Map<\n string,\n Record<string, GeneratorVerbOptions>\n >();\n\n for (const verbOption of Object.values(verbOptions)) {\n const tag = getPrimaryTag(verbOption);\n const currentGroup = groupedVerbOptions.get(tag) ?? {};\n currentGroup[verbOption.operationId] = verbOption;\n groupedVerbOptions.set(tag, currentGroup);\n }\n\n return Promise.resolve(\n [...groupedVerbOptions.entries()]\n .filter(([, tagVerbOptions]) => hasRetrievalOperations(tagVerbOptions))\n .map(([tag, tagVerbOptions]) =>\n buildHttpResourceExtraFile(\n tagVerbOptions,\n getHttpResourceExtraFilePath(output, tag),\n output,\n context,\n header,\n ),\n ),\n );\n }\n\n return Promise.resolve([\n buildHttpResourceExtraFile(\n getVerbOptionsRecord(getRelevantVerbOptions(verbOptions)),\n getHttpResourceExtraFilePath(output),\n output,\n context,\n header,\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,MAAM;GAAe,QAAQ;GAAM;EACrC,EAAE,MAAM,cAAc;EACtB,EAAE,MAAM,eAAe;EACxB;CACD,YAAY;CACb,EACD;CACE,SAAS,CAAC,EAAE,MAAM,UAAU,EAAE,EAAE,MAAM,kBAAkB,CAAC;CACzD,YAAY;CACb,CACF;;;;;;;;;;;;;AClCD,MAAa,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;AAwB5C,MAAa,uCAAuC;;;;;;;;;;;;;;;;;;AAmBpD,MAAa,2BAA2B;;;;;;;;ACvBxC,MAAa,kBAAkB,IAAI,IAVL;CAC5B;CACA;CACA;CACA;CACA;CACD,CAI4D;AAE7D,MAAM,wBAAw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pC,QACA,SACA,OACD,CACF,CAAC;;;;AC/jDJ,MAAM,oBAA6C;CACjD,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,OAAO;CACR;AAED,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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["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 camel,\n DefaultTag,\n type GeneratorVerbOptions,\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\n/**\n * Narrows a schema type string to the primitive set supported by the Angular\n * generators' query/header helpers.\n */\nexport const isPrimitiveType = (t: string | undefined): t is PrimitiveType =>\n t != undefined &&\n Object.prototype.hasOwnProperty.call(PRIMITIVE_TYPE_LOOKUP, t);\n\n/**\n * Indicates whether the configured schema output target is Zod-based.\n */\nexport const isZodSchemaOutput = (output: NormalizedOutputOptions): boolean =>\n isObject(output.schemas) && output.schemas.type === 'zod';\n\n/**\n * Removes `null` and `undefined` from a value in a type-safe way.\n */\nexport const isDefined = <T>(v: T | null | undefined): v is T => v != undefined;\n\n/**\n * Maps a schema type name to its Zod output-type reference (`${typeName}Output`).\n */\nexport const getSchemaOutputTypeRef = (typeName: string): string =>\n `${typeName}Output`;\n\n/**\n * Converts an operation/tag title into the generated Angular service class name.\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/**\n * Returns only the operations that belong to the current tag output.\n *\n * In `tags` / `tags-split` mode the writer may route untagged operations into\n * the implicit `default` bucket. When a generated tag file targets that bucket\n * we also include operations whose original tag list was empty; a literal\n * user-defined `default` tag is treated like any other tag unless untagged\n * operations are present in the same output.\n */\nexport const getRelevantVerbOptionsForTag = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n tag?: string,\n): GeneratorVerbOptions[] => {\n const allVerbOptions = Object.values(verbOptions);\n if (!tag) return allVerbOptions;\n\n const camelTag = camel(tag);\n const includeUntaggedOperations =\n tag === DefaultTag &&\n allVerbOptions.some((verbOption) => verbOption.tags.length === 0);\n\n return allVerbOptions.filter(\n (verbOption) =>\n verbOption.tags.some((currentTag) => camel(currentTag) === camelTag) ||\n (includeUntaggedOperations && verbOption.tags.length === 0),\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\n/**\n * Selects the preferred success payload type for Angular `httpResource`\n * generation, favouring JSON responses and otherwise falling back to the\n * generator's default content-type rules.\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 buildAngularParamsFilterExpression,\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientFooterBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateBodyOptions,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorVerbOptions,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n getEnumImplementation,\n getIsBodyVerb,\n type GetterProp,\n GetterPropType,\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 getRelevantVerbOptionsForTag,\n getSchemaOutputTypeRef,\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\n/**\n * Partition props into the three buckets used by per-content-type overload\n * rendering: required non-body params, body params, and optional non-body\n * params. The body always sits between the required and optional non-body\n * params so that the per-content-type overloads can insert a required\n * `accept` literal immediately after the body without violating TS1016\n * (required parameter cannot follow an optional one).\n */\nconst partitionPropsForMultiContent = (\n props: readonly GetterProp[],\n): {\n requiredNonBody: GetterProp[];\n body: GetterProp[];\n optionalNonBody: GetterProp[];\n} => {\n const requiredNonBody: GetterProp[] = [];\n const body: GetterProp[] = [];\n const optionalNonBody: GetterProp[] = [];\n for (const p of props) {\n if (p.type === GetterPropType.BODY) {\n body.push(p);\n } else if (p.required && !p.default) {\n requiredNonBody.push(p);\n } else {\n optionalNonBody.push(p);\n }\n }\n return { requiredNonBody, body, optionalNonBody };\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 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 = getRelevantVerbOptionsForTag(verbOptions, tag);\n // Only emit the shared `filterParams` helper when at least one operation in\n // this file will actually call it. If every operation with queryParams has\n // its own `paramsFilter` mutator, the helper would be dead code.\n const hasBuiltInFilteredQueryParams = relevantVerbs.some(\n (v) => v.queryParams && !v.paramsFilter,\n );\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${hasBuiltInFilteredQueryParams ? 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 paramsFilter,\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 // When Zod runtime validation is enabled the emitted method signature exposes\n // `parsedDataType` (e.g. `PetsOutput`) directly instead of a caller-overridable\n // `TData` generic. Casting `Schema.parse(data)` to `TData` is unsound because\n // `TData` can be widened/narrowed by callers while the runtime value is always\n // `PetsOutput`. We therefore drop the cast on the validation path and let the\n // inferred return type flow naturally.\n const validationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data)))`\n : '';\n const responseValidationPipe = shouldValidateResponse\n ? `.pipe(map(response => response.clone({ body: ${schemaValueRef}.parse(response.body) })))`\n : '';\n const eventValidationPipe = shouldValidateResponse\n ? `.pipe(map(event => event instanceof AngularHttpResponse ? event.clone({ body: ${schemaValueRef}.parse(event.body) }) : 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 paramsFilter,\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 paramsFilter,\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 = queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n const filterExpr = buildAngularParamsFilterExpression({\n paramsExpression: isRequestOptions\n ? '{...params, ...options?.params}'\n : 'params ?? {}',\n requiredNullableParamKeys: queryParams.requiredNullableKeys ?? [],\n preserveRequiredNullables: !!paramsSerializer,\n // Only pass non-primitive params through the built-in `filterParams`\n // when a `paramsSerializer` can legally consume the raw object/array.\n // Without one, Angular's `HttpParams` would stringify it to\n // `[object Object]` and the helper's `unknown` return type is not\n // assignable to `HttpClient`'s params — so keep them filtered out.\n // The `paramsFilter` branch bypasses the built-in helper entirely.\n nonPrimitiveKeys: paramsSerializer\n ? (queryParams.nonPrimitiveKeys ?? [])\n : [],\n paramsFilter,\n // Request-options path uses the shared `filterParams` helper emitted in\n // the file header; the non-request-options path inlines an IIFE.\n useSharedHelper: isRequestOptions,\n });\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${filterExpr});\\n\\n `\n : `const ${angularParamsRef} = ${filterExpr};\\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 // When the response goes through a Zod runtime validation pipe the runtime\n // value is fixed to `parsedDataType` (e.g. `PetsOutput`), so we avoid\n // exposing a caller-overridable `<TData>` generic on that path.\n const hasTDataGeneric =\n isModelType && !hasMultipleContentTypes && !shouldValidateResponse;\n let functionName = operationName;\n if (hasTDataGeneric) {\n functionName += `<TData = ${parsedDataType}>`;\n }\n\n let contentTypeOverloads = '';\n if (hasMultipleContentTypes && isRequestOptions) {\n const {\n requiredNonBody: requiredNonBodyProps,\n body: bodyProps,\n optionalNonBody: optionalNonBodyProps,\n } = partitionPropsForMultiContent(props);\n const requiredNonBodyPart = requiredNonBodyProps\n .map((p) => p.definition)\n .join(',\\n ');\n const bodyPart = bodyProps.map((p) => p.definition).join(',\\n ');\n // Per-content-type overloads have a required `accept` literal after the body.\n // TS1016 forbids required params after optional ones, so optional body params\n // are rendered as positionally required (`name: Type | undefined`) here.\n // The `?` is removed via an identifier-anchored replacement so we only\n // affect the parameter's own optional marker, never a `?:` that may appear\n // elsewhere in the type (e.g. mapped or conditional types).\n const bodyOverloadPart = bodyProps\n .map((p) => {\n const optionalMarker = `${p.name}?:`;\n if (!p.required && p.definition.startsWith(optionalMarker)) {\n const required = `${p.name}:${p.definition.slice(optionalMarker.length)}`;\n return /\\bundefined\\b/.test(required)\n ? required\n : `${required} | undefined`;\n }\n return p.definition;\n })\n .join(',\\n ');\n const optionalNonBodyPart = optionalNonBodyProps\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 requiredNonBodyPart,\n bodyOverloadPart,\n `accept: '${contentType}'`,\n optionalNonBodyPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return `${operationName}(${overloadParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n })\n .join('\\n ');\n const allParams = [\n requiredNonBodyPart,\n bodyPart,\n `accept?: ${acceptTypeName ?? 'string'}`,\n optionalNonBodyPart,\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<${hasTDataGeneric ? 'TData' : parsedDataType}>;\\n ${functionName}(${propsDefinition} options?: HttpClientEventOptions): Observable<HttpEvent<${hasTDataGeneric ? 'TData' : parsedDataType}>>;\\n ${functionName}(${propsDefinition} options?: HttpClientResponseOptions): Observable<AngularHttpResponse<${hasTDataGeneric ? 'TData' : parsedDataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = hasTDataGeneric ? 'TData' : parsedDataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const bodyIdentifier = generateBodyOptions(\n body,\n isFormData,\n isFormUrlEncoded,\n );\n const deleteBodyOption =\n verb === 'delete' && bodyIdentifier ? `body: ${bodyIdentifier}` : '';\n const buildOptionsObject = (responseType: string) => `{\n ...options,\n responseType: '${responseType}',\n headers,\n ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n ${deleteBodyOption ? `${deleteBodyOption},` : ''}\n }`;\n const buildHttpClientCall = (typeArg: string, optionsObject: string) =>\n getIsBodyVerb(verb) && verb !== 'delete'\n ? `this.http.${verb}${typeArg}(\\`${route}\\`, ${bodyIdentifier ?? 'undefined'}, ${optionsObject})`\n : `this.http.${verb}${typeArg}(\\`${route}\\`, ${optionsObject})`;\n\n const {\n requiredNonBody: requiredNonBodyImplProps,\n body: bodyImplProps,\n optionalNonBody: optionalNonBodyImplProps,\n } = partitionPropsForMultiContent(props);\n const requiredNonBodyImplPart = requiredNonBodyImplProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const bodyImplPart = bodyImplProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const optionalNonBodyImplPart = optionalNonBodyImplProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const allParams = [\n requiredNonBodyImplPart,\n bodyImplPart,\n `accept: ${acceptTypeName ?? 'string'} = '${defaultContentType}'`,\n optionalNonBodyImplPart,\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 ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return ${buildHttpClientCall('', buildOptionsObject('text'))} as Observable<string>;\n }${\n blobSuccessTypes.length > 0\n ? ` else {\n return ${buildHttpClientCall('', buildOptionsObject('blob'))} as Observable<Blob>;\n }`\n : `\n\n return ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};`\n }\n }\n`;\n }\n\n // When the validation pipe is active the runtime payload is always the\n // parsed output type, so we emit `HttpClient.<verb><PetsOutput>(...)`\n // rather than threading a caller-overridable `TData` through the call.\n const httpTypeArg = hasTDataGeneric\n ? '<TData>'\n : shouldValidateResponse && isModelType\n ? `<${parsedDataType}>`\n : '';\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${httpTypeArg}(${observeOptions?.events ?? options})${eventValidationPipe};\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${httpTypeArg}(${observeOptions?.response ?? options})${responseValidationPipe};\n }\n\n return this.http.${verb}${httpTypeArg}(${observeOptions?.body ?? options})${validationPipe};`\n : `return this.http.${verb}${httpTypeArg}(${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 buildAngularParamsFilterExpression,\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 getAngularFilteredParamsHelperBody,\n getFileInfo,\n getFullRoute,\n GetterPropType,\n isObject,\n isSyntheticDefaultImportsAllow,\n jsDoc,\n kebab,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n OutputMode,\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 getRelevantVerbOptionsForTag,\n getSchemaOutputTypeRef,\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 getVerbOptionsRecord = (\n verbOptions: readonly GeneratorVerbOptions[],\n): Record<string, GeneratorVerbOptions> =>\n Object.fromEntries(\n verbOptions.map((verbOption) => [verbOption.operationId, verbOption]),\n );\n\nconst getPrimaryTag = (verbOption: GeneratorVerbOptions): string =>\n kebab(verbOption.tags[0] ?? 'default');\n\nconst hasRetrievalOperations = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n): boolean =>\n Object.values(verbOptions).some((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\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 paramsFilter,\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 ? buildAngularParamsFilterExpression({\n paramsExpression: `${paramsAccess} ?? {}`,\n requiredNullableParamKeys: queryParams?.requiredNullableKeys ?? [],\n preserveRequiredNullables: !!paramsSerializer,\n // Only pass non-primitive params through the built-in `filterParams`\n // when a `paramsSerializer` can legally consume the raw object/array.\n // Without one, the helper's `unknown` return type is not assignable\n // to `HttpClient`'s params, so keep them filtered out. The\n // `paramsFilter` branch bypasses the built-in helper entirely.\n nonPrimitiveKeys: paramsSerializer\n ? (queryParams?.nonPrimitiveKeys ?? [])\n : [],\n paramsFilter,\n useSharedHelper: true,\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 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 getBranchRawType = (type: ResReqTypesValue): string =>\n getHttpResourceRawType(\n getHttpResourceFactory(response, type.contentType, type.value),\n );\n // Per-branch options types (one per distinct content-type branch).\n // Deduped so text-like content types (text/plain, application/xml) that\n // share the same factory don't produce duplicate union members.\n const branchOptionsTypes = [\n ...new Set(\n successTypes\n .filter((type) => type.contentType)\n .map((type) =>\n buildBranchOptionsType(\n getBranchReturnType(type),\n getBranchRawType(type),\n omitParse,\n ),\n ),\n ),\n ];\n // The implementation signature accepts the union of branch option types.\n // This keeps each overload's narrow `options` assignable to the\n // implementation signature (required for TS overload compatibility) while\n // preventing mismatched `defaultValue`/`parse` across content types.\n const implementationOptionsType = branchOptionsTypes.join(' | ');\n // Per-accept overloads pin `options` to the branch-specific value/raw\n // types so `defaultValue` / `parse` type-check against the actual content\n // type — e.g. passing a `string` default to the `application/json`\n // overload is now a type error.\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(returnType, getBranchRawType(type), omitParse)}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${returnType} | undefined>;`;\n })\n .join('\\n');\n const implementationArgsWithDefault = [\n requiredPart,\n `accept: ${acceptTypeName} = '${defaultContentType}'`,\n optionalPart,\n `options?: ${implementationOptionsType}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n const getBranchOptions = (type?: ResReqTypesValue) => {\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 // Fallback path for unknown accept values must match the branch the\n // default `accept` argument targets — pick the success type whose content\n // type is `defaultContentType`, then fall back to the remaining branches\n // in the same priority order as the runtime dispatch above.\n const fallbackType =\n successTypes.find((type) => type.contentType === defaultContentType) ??\n jsonType ??\n textType ??\n arrayBufferType ??\n blobType;\n\n const buildFallbackReturn = (type: ResReqTypesValue): string => {\n const factory = getHttpResourceFactory(\n response,\n type.contentType,\n type.value,\n );\n const returnType =\n factory === 'httpResource'\n ? getBranchReturnType(type)\n : getHttpResourceRawType(factory);\n return `return ${factory}<${returnType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions(type)});`;\n };\n\n const fallbackReturn = fallbackType\n ? buildFallbackReturn(fallbackType)\n : `return httpResource<${parsedDataType}>(() => ({\n ...normalizedRequest,\n headers,\n }), ${getBranchOptions()});`;\n\n // Default-accept overload (when `accept` is omitted): narrow `options` to\n // the branch the runtime falls back to, so callers that skip `accept`\n // still get branch-specific typing instead of the broad options union.\n const defaultOverloadOptionsType = fallbackType\n ? buildBranchOptionsType(\n getBranchReturnType(fallbackType),\n getBranchRawType(fallbackType),\n omitParse,\n )\n : implementationOptionsType;\n const defaultOverloadReturnType = fallbackType\n ? getBranchReturnType(fallbackType)\n : unionReturnType;\n const defaultOverloadArgs = [\n requiredPart,\n optionalPart,\n `options?: ${defaultOverloadOptionsType}`,\n ]\n .filter(Boolean)\n .join(',\\n ');\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 ${defaultOverloadArgs}\n ): HttpResourceRef<${defaultOverloadReturnType} | 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 tag,\n}) => {\n resetHttpClientReturnTypes();\n resourceReturnTypesRegistry.reset();\n\n // When the output is emitted per-tag (modes: `tags`, `tags-split`) each file\n // must only reference operations that belong to the current tag — otherwise\n // the shared header duplicates helpers across every tag file and pulls in\n // type names the file-local `imports` filter never sees, producing missing\n // schema imports in the generated output.\n const relevantVerbOptions = getRelevantVerbOptionsForTag(verbOptions, tag);\n\n const retrievals = relevantVerbOptions.filter((verbOption) =>\n isRetrievalVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\n // Emit the shared `filterParams` helper only when at least one retrieval\n // with query params lacks its own `paramsFilter` mutator — otherwise the\n // helper would be dead code.\n const hasBuiltInFilteredQueryParams = retrievals.some(\n (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\n );\n const filterParamsHelper = hasBuiltInFilteredQueryParams\n ? `\\n${getAngularFilteredParamsHelperBody()}\\n`\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 = relevantVerbOptions.filter((verbOption) =>\n isMutationVerb(\n verbOption.verb,\n verbOption.operationName,\n getClientOverride(verbOption),\n ),\n );\n const acceptHelpers = buildAcceptHelpers(\n [...retrievals, ...mutations],\n output,\n );\n // Mutations need the built-in helper only when at least one mutation lacks\n // its own `paramsFilter`. If the resource section already emits the helper\n // for retrievals, we suppress the mutation-side emission to avoid duplication.\n const hasMutationBuiltInFilteredQueryParams = mutations.some(\n (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\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:\n hasMutationBuiltInFilteredQueryParams && !hasBuiltInFilteredQueryParams,\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 // Emit the shared `filterParams` helper only when at least one retrieval\n // with query params lacks its own `paramsFilter` mutator — otherwise the\n // helper would be dead code.\n const hasBuiltInFilteredQueryParams = retrievals.some(\n (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\n );\n const filterParamsHelper = hasBuiltInFilteredQueryParams\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.schemas) {\n return [\n {\n exports: isZod\n ? uniqueImports.map((imp) => ({ ...imp, values: true }))\n : uniqueImports,\n dependency: relativeSchemasPath,\n },\n ];\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: relativeSchemasPath,\n },\n ];\n }\n\n return [\n {\n exports: uniqueImports,\n dependency: relativeSchemasPath,\n },\n ];\n};\n\nconst getHttpResourceExtraFilePath = (\n output: NormalizedOutputOptions,\n tag?: string,\n): string => {\n const { extension, dirname, filename } = getFileInfo(output.target, {\n extension: output.fileExtension,\n });\n\n switch (output.mode) {\n case OutputMode.TAGS: {\n const normalizedTag = kebab(tag ?? 'default');\n return upath.joinSafe(dirname, `${normalizedTag}.resource${extension}`);\n }\n case OutputMode.TAGS_SPLIT: {\n const normalizedTag = kebab(tag ?? 'default');\n return upath.joinSafe(\n dirname,\n normalizedTag,\n `${normalizedTag}.resource${extension}`,\n );\n }\n default: {\n return upath.joinSafe(dirname, `${filename}.resource${extension}`);\n }\n }\n};\n\nconst getHttpResourceRelativeSchemasPath = (\n output: NormalizedOutputOptions,\n outputPath: string,\n): string => {\n const schemasPath =\n typeof output.schemas === 'string' ? output.schemas : output.schemas?.path;\n\n if (schemasPath) {\n return upath.getRelativeImportPath(\n outputPath,\n getFileInfo(schemasPath).dirname,\n );\n }\n\n const { dirname, filename, extension } = getFileInfo(output.target, {\n extension: output.fileExtension,\n });\n return upath.getRelativeImportPath(\n outputPath,\n upath.joinSafe(dirname, `${filename}.schemas${extension}`),\n output.fileExtension !== '.ts',\n );\n};\n\nconst buildHttpResourceExtraFile = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n outputPath: string,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n header: string,\n) => {\n const implementation = buildHttpResourceFile(verbOptions, output, context);\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 getHttpResourceRelativeSchemasPath(output, outputPath),\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 verbOption.paramsFilter,\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 oneMore: output.mode === OutputMode.TAGS_SPLIT,\n })\n : '';\n\n return {\n content: `${header}${importImplementation}${mutatorImports}${implementation}`,\n path: outputPath,\n };\n};\n\n/**\n * Generates the extra sibling resource files 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. In tag-based output\n * modes this emits one sibling resource file per generated tag file.\n *\n * @returns One or more extra file descriptors representing generated resource files.\n */\nexport const generateHttpResourceExtraFiles: ClientExtraFilesBuilder = (\n verbOptions,\n output,\n context,\n) => {\n const header = getHeader(output.override.header, context.spec.info);\n\n if (!hasRetrievalOperations(verbOptions)) {\n return Promise.resolve([]);\n }\n\n if (\n output.mode === OutputMode.TAGS ||\n output.mode === OutputMode.TAGS_SPLIT\n ) {\n const groupedVerbOptions = new Map<\n string,\n Record<string, GeneratorVerbOptions>\n >();\n\n for (const verbOption of Object.values(verbOptions)) {\n const tag = getPrimaryTag(verbOption);\n const currentGroup = groupedVerbOptions.get(tag) ?? {};\n currentGroup[verbOption.operationId] = verbOption;\n groupedVerbOptions.set(tag, currentGroup);\n }\n\n return Promise.resolve(\n [...groupedVerbOptions.entries()]\n .filter(([, tagVerbOptions]) => hasRetrievalOperations(tagVerbOptions))\n .map(([tag, tagVerbOptions]) =>\n buildHttpResourceExtraFile(\n tagVerbOptions,\n getHttpResourceExtraFilePath(output, tag),\n output,\n context,\n header,\n ),\n ),\n );\n }\n\n return Promise.resolve([\n buildHttpResourceExtraFile(\n getVerbOptionsRecord(getRelevantVerbOptionsForTag(verbOptions)),\n getHttpResourceExtraFilePath(output),\n output,\n context,\n header,\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,MAAM;GAAe,QAAQ;GAAM;EACrC,EAAE,MAAM,cAAc;EACtB,EAAE,MAAM,eAAe;EACxB;CACD,YAAY;CACb,EACD;CACE,SAAS,C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AQ,QAAQ,CACrB,2BACE,qBAAqB,6BAA6B,YAAY,CAAC,EAC/D,6BAA6B,OAAO,EACpC,QACA,SACA,OACD,CACF,CAAC;;;;AC7kDJ,MAAM,oBAA6C;CACjD,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,OAAO;CACR;AAED,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/angular",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"nuke": "rimraf .turbo dist node_modules"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@orval/core": "8.
|
|
38
|
+
"@orval/core": "8.11.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"eslint": "10.1.0",
|