@orval/angular 8.4.0 → 8.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +99 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -40,6 +40,16 @@ const ANGULAR_DEPENDENCIES = [
|
|
|
40
40
|
dependency: "rxjs"
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
|
+
const PRIMITIVE_RESPONSE_TYPES = [
|
|
44
|
+
"string",
|
|
45
|
+
"number",
|
|
46
|
+
"boolean",
|
|
47
|
+
"void",
|
|
48
|
+
"unknown"
|
|
49
|
+
];
|
|
50
|
+
const isPrimitiveResponseType = (typeName) => typeName != void 0 && PRIMITIVE_RESPONSE_TYPES.includes(typeName);
|
|
51
|
+
const hasSchemaImport = (imports, typeName) => typeName != void 0 && imports.some((imp) => imp.name === typeName);
|
|
52
|
+
const getSchemaValueRef = (typeName) => typeName === "Error" ? "ErrorSchema" : typeName;
|
|
43
53
|
const getAngularDependencies = () => [...ANGULAR_DEPENDENCIES];
|
|
44
54
|
const generateAngularTitle = (title) => {
|
|
45
55
|
return `${pascal(sanitize(title))}Service`;
|
|
@@ -48,23 +58,23 @@ const createAngularHeader = () => ({ title, isRequestOptions, isMutator, isGloba
|
|
|
48
58
|
const hasQueryParams = (tag ? Object.values(verbOptions).filter((v) => v.tags.includes(tag)) : Object.values(verbOptions)).some((v) => v.queryParams);
|
|
49
59
|
return `
|
|
50
60
|
${isRequestOptions && !isGlobalMutator ? `interface HttpClientOptions {
|
|
51
|
-
headers?: HttpHeaders | Record<string, string | string[]>;
|
|
52
|
-
context?: HttpContext;
|
|
53
|
-
params?:
|
|
61
|
+
readonly headers?: HttpHeaders | Record<string, string | string[]>;
|
|
62
|
+
readonly context?: HttpContext;
|
|
63
|
+
readonly params?:
|
|
54
64
|
| HttpParams
|
|
55
65
|
| Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
56
|
-
reportProgress?: boolean;
|
|
57
|
-
withCredentials?: boolean;
|
|
58
|
-
credentials?: RequestCredentials;
|
|
59
|
-
keepalive?: boolean;
|
|
60
|
-
priority?: RequestPriority;
|
|
61
|
-
cache?: RequestCache;
|
|
62
|
-
mode?: RequestMode;
|
|
63
|
-
redirect?: RequestRedirect;
|
|
64
|
-
referrer?: string;
|
|
65
|
-
integrity?: string;
|
|
66
|
-
referrerPolicy?: ReferrerPolicy;
|
|
67
|
-
transferCache?: {includeHeaders?: string[]} | boolean;
|
|
66
|
+
readonly reportProgress?: boolean;
|
|
67
|
+
readonly withCredentials?: boolean;
|
|
68
|
+
readonly credentials?: RequestCredentials;
|
|
69
|
+
readonly keepalive?: boolean;
|
|
70
|
+
readonly priority?: RequestPriority;
|
|
71
|
+
readonly cache?: RequestCache;
|
|
72
|
+
readonly mode?: RequestMode;
|
|
73
|
+
readonly redirect?: RequestRedirect;
|
|
74
|
+
readonly referrer?: string;
|
|
75
|
+
readonly integrity?: string;
|
|
76
|
+
readonly referrerPolicy?: ReferrerPolicy;
|
|
77
|
+
readonly transferCache?: {includeHeaders?: string[]} | boolean;
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
${hasQueryParams ? getAngularFilteredParamsHelperBody() : ""}` : ""}
|
|
@@ -86,7 +96,7 @@ export class ${title} {
|
|
|
86
96
|
const generateAngularHeader = (params) => createAngularHeader()(params);
|
|
87
97
|
const standaloneFooterReturnTypesToWrite = /* @__PURE__ */ new Map();
|
|
88
98
|
const createAngularFooter = (returnTypesToWrite) => ({ operationNames }) => {
|
|
89
|
-
let footer = "}
|
|
99
|
+
let footer = "}\n\n";
|
|
90
100
|
for (const operationName of operationNames) if (returnTypesToWrite.has(operationName)) footer += returnTypesToWrite.get(operationName) + "\n";
|
|
91
101
|
return footer;
|
|
92
102
|
};
|
|
@@ -104,6 +114,12 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
104
114
|
isFormUrlEncoded
|
|
105
115
|
});
|
|
106
116
|
const dataType = response.definition.success || "unknown";
|
|
117
|
+
const isPrimitiveType = isPrimitiveResponseType(dataType);
|
|
118
|
+
const hasSchema = hasSchemaImport(response.imports, dataType);
|
|
119
|
+
const isZodOutput = typeof context.output.schemas === "object" && context.output.schemas.type === "zod";
|
|
120
|
+
const shouldValidateResponse = override.angular.runtimeValidation && isZodOutput && !isPrimitiveType && hasSchema;
|
|
121
|
+
const schemaValueRef = shouldValidateResponse ? getSchemaValueRef(dataType) : dataType;
|
|
122
|
+
const validationPipe = shouldValidateResponse ? `.pipe(map(data => ${schemaValueRef}.parse(data) as TData))` : "";
|
|
107
123
|
returnTypesToWrite.set(operationName, `export type ${pascal(operationName)}ClientResult = NonNullable<${dataType}>`);
|
|
108
124
|
if (mutator) {
|
|
109
125
|
const mutatorConfig = generateMutatorConfig({
|
|
@@ -155,10 +171,11 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
155
171
|
const callExpr = getAngularFilteredParamsCallExpression("{...params, ...options?.params}", queryParams.requiredNullableKeys ?? []);
|
|
156
172
|
paramsDeclaration = paramsSerializer ? `const ${angularParamsRef} = ${paramsSerializer.name}(${callExpr});\n\n ` : `const ${angularParamsRef} = ${callExpr};\n\n `;
|
|
157
173
|
}
|
|
158
|
-
const
|
|
174
|
+
const optionsInput = {
|
|
159
175
|
...optionsBase,
|
|
160
176
|
...angularParamsRef ? { angularParamsRef } : {}
|
|
161
|
-
}
|
|
177
|
+
};
|
|
178
|
+
const options = generateOptions(optionsInput);
|
|
162
179
|
const defaultContentType = hasMultipleContentTypes ? uniqueContentTypes.includes("text/plain") ? "text/plain" : getDefaultContentType(uniqueContentTypes) : uniqueContentTypes[0] ?? "application/json";
|
|
163
180
|
const getContentTypeReturnType = (contentType, value) => {
|
|
164
181
|
if (!contentType) return value;
|
|
@@ -168,16 +185,27 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
168
185
|
};
|
|
169
186
|
const jsonSuccessValues = [...new Set(successTypes.filter(({ contentType }) => !!contentType && (contentType.includes("json") || contentType.includes("+json"))).map(({ value }) => value))];
|
|
170
187
|
const jsonReturnType = jsonSuccessValues.length > 0 ? jsonSuccessValues.join(" | ") : "unknown";
|
|
188
|
+
let jsonValidationPipe = shouldValidateResponse ? `.pipe(map(data => ${schemaValueRef}.parse(data)))` : "";
|
|
189
|
+
if (hasMultipleContentTypes && !shouldValidateResponse && override.angular.runtimeValidation && isZodOutput && jsonSuccessValues.length === 1) {
|
|
190
|
+
const jsonType = jsonSuccessValues[0];
|
|
191
|
+
const jsonIsPrimitive = isPrimitiveResponseType(jsonType);
|
|
192
|
+
const jsonHasSchema = hasSchemaImport(response.imports, jsonType);
|
|
193
|
+
if (!jsonIsPrimitive && jsonHasSchema) jsonValidationPipe = `.pipe(map(data => ${getSchemaValueRef(jsonType)}.parse(data)))`;
|
|
194
|
+
}
|
|
171
195
|
const multiImplementationReturnType = `Observable<${jsonReturnType} | string | Blob>`;
|
|
172
|
-
const withObserveMode = (generatedOptions, observeMode) => {
|
|
173
|
-
const spreadPattern = "...(options as Omit<NonNullable<typeof options>, 'observe'>),";
|
|
174
|
-
if (generatedOptions.includes(spreadPattern)) return generatedOptions.replace(spreadPattern, `${spreadPattern}\n observe: '${observeMode}',`);
|
|
175
|
-
return generatedOptions.replace("(options as Omit<NonNullable<typeof options>, 'observe'>)", `{ ...(options as Omit<NonNullable<typeof options>, 'observe'>), observe: '${observeMode}' }`);
|
|
176
|
-
};
|
|
177
196
|
const observeOptions = needsObserveBranching ? {
|
|
178
|
-
body:
|
|
179
|
-
|
|
180
|
-
|
|
197
|
+
body: generateOptions({
|
|
198
|
+
...optionsInput,
|
|
199
|
+
angularObserve: "body"
|
|
200
|
+
}),
|
|
201
|
+
events: generateOptions({
|
|
202
|
+
...optionsInput,
|
|
203
|
+
angularObserve: "events"
|
|
204
|
+
}),
|
|
205
|
+
response: generateOptions({
|
|
206
|
+
...optionsInput,
|
|
207
|
+
angularObserve: "response"
|
|
208
|
+
})
|
|
181
209
|
} : void 0;
|
|
182
210
|
const isModelType = dataType !== "Blob" && dataType !== "string";
|
|
183
211
|
let functionName = operationName;
|
|
@@ -230,7 +258,7 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
230
258
|
...options,
|
|
231
259
|
responseType: 'json',
|
|
232
260
|
headers,
|
|
233
|
-
});
|
|
261
|
+
})${jsonValidationPipe};
|
|
234
262
|
} else if (accept.startsWith('text/') || accept.includes('xml')) {
|
|
235
263
|
return this.http.${verb}(\`${route}\`, {
|
|
236
264
|
...options,
|
|
@@ -255,7 +283,7 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
255
283
|
return this.http.${verb}${isModelType ? "<TData>" : ""}(${observeOptions?.response ?? options});
|
|
256
284
|
}
|
|
257
285
|
|
|
258
|
-
return this.http.${verb}${isModelType ? "<TData>" : ""}(${observeOptions?.body ?? options});` : `return this.http.${verb}${isModelType ? "<TData>" : ""}(${options});`;
|
|
286
|
+
return this.http.${verb}${isModelType ? "<TData>" : ""}(${observeOptions?.body ?? options})${validationPipe};` : `return this.http.${verb}${isModelType ? "<TData>" : ""}(${options})${validationPipe};`;
|
|
259
287
|
return ` ${overloads}
|
|
260
288
|
${functionName}(
|
|
261
289
|
${toObjectString(props, "implementation")} ${isRequestOptions ? `options?: HttpClientOptions & { observe?: 'body' | 'events' | 'response' }` : ""}): ${singleImplementationReturnType} {${bodyForm}
|
|
@@ -264,10 +292,50 @@ const generateImplementation = (returnTypesToWrite, { headers, queryParams, oper
|
|
|
264
292
|
`;
|
|
265
293
|
};
|
|
266
294
|
const createAngularClient = (returnTypesToWrite) => (verbOptions, options, _outputClient, _output) => {
|
|
267
|
-
const
|
|
295
|
+
const isZodOutput = typeof options.context.output.schemas === "object" && options.context.output.schemas.type === "zod";
|
|
296
|
+
const responseType = verbOptions.response.definition.success;
|
|
297
|
+
const isPrimitiveResponse = isPrimitiveResponseType(responseType);
|
|
298
|
+
const shouldUseRuntimeValidation = verbOptions.override.angular.runtimeValidation && isZodOutput;
|
|
299
|
+
const normalizedVerbOptions = (() => {
|
|
300
|
+
if (!shouldUseRuntimeValidation) return verbOptions;
|
|
301
|
+
let result = verbOptions;
|
|
302
|
+
if (!isPrimitiveResponse && hasSchemaImport(result.response.imports, responseType)) result = {
|
|
303
|
+
...result,
|
|
304
|
+
response: {
|
|
305
|
+
...result.response,
|
|
306
|
+
imports: result.response.imports.map((imp) => imp.name === responseType ? {
|
|
307
|
+
...imp,
|
|
308
|
+
values: true
|
|
309
|
+
} : imp)
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const successTypes = result.response.types.success;
|
|
313
|
+
if ([...new Set(successTypes.map((t) => t.contentType).filter(Boolean))].length > 1) {
|
|
314
|
+
const jsonSchemaNames = [...new Set(successTypes.filter(({ contentType }) => !!contentType && (contentType.includes("json") || contentType.includes("+json"))).map(({ value }) => value))];
|
|
315
|
+
if (jsonSchemaNames.length === 1) {
|
|
316
|
+
const jsonType = jsonSchemaNames[0];
|
|
317
|
+
if (!isPrimitiveResponseType(jsonType) && hasSchemaImport(result.response.imports, jsonType)) result = {
|
|
318
|
+
...result,
|
|
319
|
+
response: {
|
|
320
|
+
...result.response,
|
|
321
|
+
imports: result.response.imports.map((imp) => imp.name === jsonType ? {
|
|
322
|
+
...imp,
|
|
323
|
+
values: true
|
|
324
|
+
} : imp)
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return result;
|
|
330
|
+
})();
|
|
331
|
+
const implementation = generateImplementation(returnTypesToWrite, normalizedVerbOptions, options);
|
|
268
332
|
return {
|
|
269
|
-
implementation
|
|
270
|
-
imports
|
|
333
|
+
implementation,
|
|
334
|
+
imports: [...generateVerbImports(normalizedVerbOptions), ...implementation.includes(".pipe(map(") ? [{
|
|
335
|
+
name: "map",
|
|
336
|
+
values: true,
|
|
337
|
+
importPath: "rxjs"
|
|
338
|
+
}] : []]
|
|
271
339
|
};
|
|
272
340
|
};
|
|
273
341
|
const standaloneReturnTypesToWrite = /* @__PURE__ */ new Map();
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["getAngularDependencies: ClientDependenciesBuilder","generateAngularTitle: ClientTitleBuilder","generateAngularHeader: ClientHeaderBuilder","generateAngularFooter: ClientFooterBuilder","generateAngular: ClientBuilder","builder: () => () => ClientGeneratorsBuilder"],"sources":["../src/index.ts"],"sourcesContent":["import {\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientFooterBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ClientTitleBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorDependency,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n isBoolean,\n pascal,\n sanitize,\n toObjectString,\n} from '@orval/core';\n\nconst ANGULAR_DEPENDENCIES = [\n {\n exports: [\n { name: 'HttpClient', values: true },\n { name: 'HttpHeaders', values: true },\n { name: 'HttpParams' },\n { name: 'HttpContext' },\n { name: 'HttpResponse', alias: 'AngularHttpResponse' }, // alias to prevent naming conflict with msw\n { name: 'HttpEvent' },\n ],\n dependency: '@angular/common/http',\n },\n {\n exports: [\n { name: 'Injectable', values: true },\n { name: 'inject', values: true },\n ],\n dependency: '@angular/core',\n },\n {\n exports: [{ name: 'Observable', values: true }],\n dependency: 'rxjs',\n },\n] as const satisfies readonly GeneratorDependency[];\n\ntype ReturnTypesToWrite = Map<string, string>;\n\nexport const getAngularDependencies: ClientDependenciesBuilder = () => [\n ...ANGULAR_DEPENDENCIES,\n];\n\nexport const generateAngularTitle: ClientTitleBuilder = (title) => {\n const sanTitle = sanitize(title);\n return `${pascal(sanTitle)}Service`;\n};\n\nconst createAngularHeader =\n (): ClientHeaderBuilder =>\n ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n verbOptions,\n tag,\n }) => {\n const relevantVerbs = tag\n ? Object.values(verbOptions).filter((v) => v.tags.includes(tag as string))\n : Object.values(verbOptions);\n const hasQueryParams = relevantVerbs.some((v) => v.queryParams);\n return `\n${\n isRequestOptions && !isGlobalMutator\n ? `interface HttpClientOptions {\n headers?: HttpHeaders | Record<string, string | string[]>;\n context?: HttpContext;\n params?:\n | HttpParams\n | Record<string, string | number | boolean | Array<string | number | boolean>>;\n reportProgress?: boolean;\n withCredentials?: boolean;\n credentials?: RequestCredentials;\n keepalive?: boolean;\n priority?: RequestPriority;\n cache?: RequestCache;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n integrity?: string;\n referrerPolicy?: ReferrerPolicy;\n transferCache?: {includeHeaders?: string[]} | boolean;\n}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody() : ''}`\n : ''\n}\n\n${\n isRequestOptions && isMutator\n ? `// eslint-disable-next-line\n type ThirdParameter<T extends (...args: any) => any> = T extends (\n config: any,\n httpClient: any,\n args: infer P,\n) => any\n ? P\n : never;`\n : ''\n}\n\n@Injectable(${provideIn ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }` : ''})\nexport class ${title} {\n private readonly http = inject(HttpClient);\n`;\n };\n\nexport const generateAngularHeader: ClientHeaderBuilder = (params) =>\n createAngularHeader()(params);\n\nconst standaloneFooterReturnTypesToWrite = new Map<string, string>();\n\nconst createAngularFooter =\n (returnTypesToWrite: ReturnTypesToWrite): ClientFooterBuilder =>\n ({ operationNames }) => {\n let footer = '};\\n\\n';\n\n for (const operationName of operationNames) {\n if (returnTypesToWrite.has(operationName)) {\n // Map.has ensures Map.get will not return undefined, but TS still complains\n // bug https://github.com/microsoft/TypeScript/issues/13086\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n footer += returnTypesToWrite.get(operationName) + '\\n';\n }\n }\n\n return footer;\n };\n\nexport const generateAngularFooter: ClientFooterBuilder = (params) =>\n createAngularFooter(standaloneFooterReturnTypesToWrite)(params);\n\nconst generateImplementation = (\n returnTypesToWrite: ReturnTypesToWrite,\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props,\n verb,\n override,\n formData,\n formUrlEncoded,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route, context }: GeneratorOptions,\n) => {\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n const dataType = response.definition.success || 'unknown';\n\n returnTypesToWrite.set(\n operationName,\n `export type ${pascal(\n operationName,\n )}ClientResult = NonNullable<${dataType}>`,\n );\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal: false,\n isExactOptionalPropertyTypes,\n isAngular: true,\n });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasThirdArg,\n )\n : '';\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(String.raw`(\\w*):\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return ` ${operationName}<TData = ${dataType}>(\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasThirdArg\n ? `options?: ThirdParameter<typeof ${mutator.name}>`\n : ''\n }) {${bodyForm}\n return ${mutator.name}<TData>(\n ${mutatorConfig},\n this.http,\n ${requestOptions});\n }\n `;\n }\n\n const optionsBase = {\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override.paramsSerializerOptions,\n isAngular: true,\n isExactOptionalPropertyTypes,\n hasSignal: false,\n } as const;\n\n const propsDefinition = toObjectString(props, 'definition');\n\n // Check for multiple content types in success responses\n const successTypes = response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n const hasMultipleContentTypes = uniqueContentTypes.length > 1;\n\n // When observe branching is active AND there are query params, extract\n // the params computation to a local const to avoid duplicating it in\n // every observe branch.\n const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;\n const angularParamsRef =\n needsObserveBranching && queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n const callExpr = getAngularFilteredParamsCallExpression(\n '{...params, ...options?.params}',\n queryParams.requiredNullableKeys ?? [],\n );\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${callExpr});\\n\\n `\n : `const ${angularParamsRef} = ${callExpr};\\n\\n `;\n }\n\n const options = generateOptions({\n ...optionsBase,\n ...(angularParamsRef ? { angularParamsRef } : {}),\n });\n\n // For multiple content types, determine the default\n const defaultContentType = hasMultipleContentTypes\n ? uniqueContentTypes.includes('text/plain')\n ? 'text/plain'\n : getDefaultContentType(uniqueContentTypes)\n : (uniqueContentTypes[0] ?? 'application/json');\n const getContentTypeReturnType = (\n contentType: string | undefined,\n value: string,\n ): string => {\n if (!contentType) {\n return value;\n }\n\n if (contentType.includes('json') || contentType.includes('+json')) {\n return value;\n }\n\n if (contentType.startsWith('text/') || contentType.includes('xml')) {\n return 'string';\n }\n\n return 'Blob';\n };\n\n const jsonSuccessValues = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n\n const jsonReturnType =\n jsonSuccessValues.length > 0 ? jsonSuccessValues.join(' | ') : 'unknown';\n const multiImplementationReturnType = `Observable<${jsonReturnType} | string | Blob>`;\n\n const withObserveMode = (\n generatedOptions: string,\n observeMode: 'body' | 'events' | 'response',\n ): string => {\n const spreadPattern =\n \"...(options as Omit<NonNullable<typeof options>, 'observe'>),\";\n\n if (generatedOptions.includes(spreadPattern)) {\n return generatedOptions.replace(\n spreadPattern,\n `${spreadPattern}\\n observe: '${observeMode}',`,\n );\n }\n\n return generatedOptions.replace(\n \"(options as Omit<NonNullable<typeof options>, 'observe'>)\",\n `{ ...(options as Omit<NonNullable<typeof options>, 'observe'>), observe: '${observeMode}' }`,\n );\n };\n\n const observeOptions = needsObserveBranching\n ? {\n body: withObserveMode(options, 'body'),\n events: withObserveMode(options, 'events'),\n response: withObserveMode(options, 'response'),\n }\n : undefined;\n\n const isModelType = dataType !== 'Blob' && dataType !== 'string';\n let functionName = operationName;\n if (isModelType && !hasMultipleContentTypes) {\n functionName += `<TData = ${dataType}>`;\n }\n\n let contentTypeOverloads = '';\n if (hasMultipleContentTypes && isRequestOptions) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n contentTypeOverloads = successTypes\n .filter((t) => t.contentType)\n .map(({ contentType, value }) => {\n const returnType = getContentTypeReturnType(contentType, value);\n const requiredPart = requiredProps\n .map((p) => p.definition)\n .join(',\\n ');\n const acceptPart = `accept: '${contentType}'`;\n const optionalPart = optionalProps\n .map((p) => p.definition)\n .join(',\\n ');\n\n const allParams = [requiredPart, acceptPart, optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n return `${operationName}(${allParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n })\n .join('\\n ');\n\n const requiredPart = requiredProps.map((p) => p.definition).join(',\\n ');\n const optionalPart = optionalProps.map((p) => p.definition).join(',\\n ');\n const allParams = [requiredPart, 'accept?: string', optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n contentTypeOverloads += `\\n ${operationName}(${allParams}, options?: HttpClientOptions): ${multiImplementationReturnType};`;\n }\n\n const observeOverloads =\n isRequestOptions && !hasMultipleContentTypes\n ? `${functionName}(${propsDefinition} options?: HttpClientOptions & { observe?: 'body' }): Observable<${isModelType ? 'TData' : dataType}>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'events' }): Observable<HttpEvent<${isModelType ? 'TData' : dataType}>>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'response' }): Observable<AngularHttpResponse<${isModelType ? 'TData' : dataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = isModelType ? 'TData' : dataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n const requiredPart = requiredProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const optionalPart = optionalProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const allParams = [\n requiredPart,\n `accept: string = '${defaultContentType}'`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return ` ${overloads}\n ${operationName}(\n ${allParams},\n ${isRequestOptions ? 'options?: HttpClientOptions' : ''}\n ): ${multiImplementationReturnType} {${bodyForm}\n const headers = options?.headers instanceof HttpHeaders\n ? options.headers.set('Accept', accept)\n : { ...(options?.headers ?? {}), Accept: accept };\n\n if (accept.includes('json') || accept.includes('+json')) {\n return this.http.${verb}<${jsonReturnType}>(\\`${route}\\`, {\n ...options,\n responseType: 'json',\n headers,\n });\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'text',\n headers,\n }) as Observable<string>;\n } else {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'blob',\n headers,\n }) as Observable<Blob>;\n }\n }\n`;\n }\n\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.events ?? options\n });\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.response ?? options\n });\n }\n\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.body ?? options\n });`\n : `return this.http.${verb}${isModelType ? '<TData>' : ''}(${options});`;\n\n return ` ${overloads}\n ${functionName}(\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions\n ? `options?: HttpClientOptions & { observe?: 'body' | 'events' | 'response' }`\n : ''\n }): ${singleImplementationReturnType} {${bodyForm}\n ${observeImplementation}\n }\n`;\n};\n\nconst createAngularClient =\n (returnTypesToWrite: ReturnTypesToWrite): ClientBuilder =>\n (verbOptions, options, _outputClient, _output) => {\n // Keep signature aligned with ClientBuilder without tripping TS noUnusedParameters\n void _outputClient;\n void _output;\n const imports = generateVerbImports(verbOptions);\n const implementation = generateImplementation(\n returnTypesToWrite,\n verbOptions,\n options,\n );\n\n return { implementation, imports };\n };\n\nconst standaloneReturnTypesToWrite = new Map<string, string>();\n\nexport const generateAngular: ClientBuilder = (\n verbOptions,\n options,\n outputClient,\n output,\n) =>\n createAngularClient(standaloneReturnTypesToWrite)(\n verbOptions,\n options,\n outputClient,\n output,\n );\n\nconst createAngularClientBuilder = (): ClientGeneratorsBuilder => {\n const returnTypesToWrite = new Map<string, string>();\n\n return {\n client: createAngularClient(returnTypesToWrite),\n header: createAngularHeader(),\n dependencies: getAngularDependencies,\n footer: createAngularFooter(returnTypesToWrite),\n title: generateAngularTitle,\n };\n};\n\nexport const builder: () => () => ClientGeneratorsBuilder = () => {\n return () => createAngularClientBuilder();\n};\n\nexport default builder;\n"],"mappings":";;;AAwBA,MAAM,uBAAuB;CAC3B;EACE,SAAS;GACP;IAAE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A,aAAa,SAAS,eAAe,YAAY;CAIhD,MAAM,UAAU,oBAAoB,YAAY;AAOhD,QAAO;EAAE,gBANc,uBACrB,oBACA,aACA,QACD;EAEwB;EAAS;;AAGtC,MAAM,+CAA+B,IAAI,KAAqB;AAE9D,MAAaC,mBACX,aACA,SACA,cACA,WAEA,oBAAoB,6BAA6B,CAC/C,aACA,SACA,cACA,OACD;AAEH,MAAM,mCAA4D;CAChE,MAAM,qCAAqB,IAAI,KAAqB;AAEpD,QAAO;EACL,QAAQ,oBAAoB,mBAAmB;EAC/C,QAAQ,qBAAqB;EAC7B,cAAc;EACd,QAAQ,oBAAoB,mBAAmB;EAC/C,OAAO;EACR;;AAGH,MAAaC,gBAAqD;AAChE,cAAa,4BAA4B;;AAG3C,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["getAngularDependencies: ClientDependenciesBuilder","generateAngularTitle: ClientTitleBuilder","generateAngularHeader: ClientHeaderBuilder","generateAngularFooter: ClientFooterBuilder","generateAngular: ClientBuilder","builder: () => () => ClientGeneratorsBuilder"],"sources":["../src/index.ts"],"sourcesContent":["import {\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientFooterBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ClientTitleBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n type GeneratorDependency,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getAngularFilteredParamsCallExpression,\n getAngularFilteredParamsHelperBody,\n getDefaultContentType,\n isBoolean,\n pascal,\n sanitize,\n toObjectString,\n} from '@orval/core';\n\nconst ANGULAR_DEPENDENCIES = [\n {\n exports: [\n { name: 'HttpClient', values: true },\n { name: 'HttpHeaders', values: true },\n { name: 'HttpParams' },\n { name: 'HttpContext' },\n { name: 'HttpResponse', alias: 'AngularHttpResponse' }, // alias to prevent naming conflict with msw\n { name: 'HttpEvent' },\n ],\n dependency: '@angular/common/http',\n },\n {\n exports: [\n { name: 'Injectable', values: true },\n { name: 'inject', values: true },\n ],\n dependency: '@angular/core',\n },\n {\n exports: [{ name: 'Observable', values: true }],\n dependency: 'rxjs',\n },\n] as const satisfies readonly GeneratorDependency[];\n\nconst PRIMITIVE_RESPONSE_TYPES = [\n 'string',\n 'number',\n 'boolean',\n 'void',\n 'unknown',\n] as const;\n\nconst isPrimitiveResponseType = (typeName: string | undefined): boolean =>\n typeName != undefined &&\n (PRIMITIVE_RESPONSE_TYPES as readonly string[]).includes(typeName);\n\nconst hasSchemaImport = (\n imports: readonly { name: string }[],\n typeName: string | undefined,\n): boolean =>\n typeName != undefined && imports.some((imp) => imp.name === typeName);\n\nconst getSchemaValueRef = (typeName: string): string =>\n typeName === 'Error' ? 'ErrorSchema' : typeName;\n\ntype ReturnTypesToWrite = Map<string, string>;\n\nexport const getAngularDependencies: ClientDependenciesBuilder = () => [\n ...ANGULAR_DEPENDENCIES,\n];\n\nexport const generateAngularTitle: ClientTitleBuilder = (title) => {\n const sanTitle = sanitize(title);\n return `${pascal(sanTitle)}Service`;\n};\n\nconst createAngularHeader =\n (): ClientHeaderBuilder =>\n ({\n title,\n isRequestOptions,\n isMutator,\n isGlobalMutator,\n provideIn,\n verbOptions,\n tag,\n }) => {\n const relevantVerbs = tag\n ? Object.values(verbOptions).filter((v) => v.tags.includes(tag as string))\n : Object.values(verbOptions);\n const hasQueryParams = relevantVerbs.some((v) => v.queryParams);\n return `\n${\n isRequestOptions && !isGlobalMutator\n ? `interface HttpClientOptions {\n readonly headers?: HttpHeaders | Record<string, string | string[]>;\n readonly context?: HttpContext;\n readonly params?:\n | HttpParams\n | Record<string, string | number | boolean | Array<string | number | boolean>>;\n readonly reportProgress?: boolean;\n readonly withCredentials?: boolean;\n readonly credentials?: RequestCredentials;\n readonly keepalive?: boolean;\n readonly priority?: RequestPriority;\n readonly cache?: RequestCache;\n readonly mode?: RequestMode;\n readonly redirect?: RequestRedirect;\n readonly referrer?: string;\n readonly integrity?: string;\n readonly referrerPolicy?: ReferrerPolicy;\n readonly transferCache?: {includeHeaders?: string[]} | boolean;\n}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody() : ''}`\n : ''\n}\n\n${\n isRequestOptions && isMutator\n ? `// eslint-disable-next-line\n type ThirdParameter<T extends (...args: any) => any> = T extends (\n config: any,\n httpClient: any,\n args: infer P,\n) => any\n ? P\n : never;`\n : ''\n}\n\n@Injectable(${provideIn ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }` : ''})\nexport class ${title} {\n private readonly http = inject(HttpClient);\n`;\n };\n\nexport const generateAngularHeader: ClientHeaderBuilder = (params) =>\n createAngularHeader()(params);\n\nconst standaloneFooterReturnTypesToWrite = new Map<string, string>();\n\nconst createAngularFooter =\n (returnTypesToWrite: ReturnTypesToWrite): ClientFooterBuilder =>\n ({ operationNames }) => {\n let footer = '}\\n\\n';\n\n for (const operationName of operationNames) {\n if (returnTypesToWrite.has(operationName)) {\n // Map.has ensures Map.get will not return undefined, but TS still complains\n // bug https://github.com/microsoft/TypeScript/issues/13086\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n footer += returnTypesToWrite.get(operationName) + '\\n';\n }\n }\n\n return footer;\n };\n\nexport const generateAngularFooter: ClientFooterBuilder = (params) =>\n createAngularFooter(standaloneFooterReturnTypesToWrite)(params);\n\nconst generateImplementation = (\n returnTypesToWrite: ReturnTypesToWrite,\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props,\n verb,\n override,\n formData,\n formUrlEncoded,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route, context }: GeneratorOptions,\n) => {\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n const dataType = response.definition.success || 'unknown';\n\n // Detect if Zod runtime validation should be applied\n const isPrimitiveType = isPrimitiveResponseType(dataType);\n const hasSchema = hasSchemaImport(response.imports, dataType);\n const isZodOutput =\n typeof context.output.schemas === 'object' &&\n context.output.schemas.type === 'zod';\n const shouldValidateResponse =\n override.angular.runtimeValidation &&\n isZodOutput &&\n !isPrimitiveType &&\n hasSchema;\n const schemaValueRef = shouldValidateResponse\n ? getSchemaValueRef(dataType)\n : dataType;\n // The observe-mode branches use <TData> generics, so cast the parse\n // result to keep TypeScript happy. The multi-content-type branch uses\n // concrete types and does not need the cast (see jsonValidationPipe).\n const validationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data) as TData))`\n : '';\n\n returnTypesToWrite.set(\n operationName,\n `export type ${pascal(\n operationName,\n )}ClientResult = NonNullable<${dataType}>`,\n );\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal: false,\n isExactOptionalPropertyTypes,\n isAngular: true,\n });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasThirdArg,\n )\n : '';\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(String.raw`(\\w*):\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return ` ${operationName}<TData = ${dataType}>(\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasThirdArg\n ? `options?: ThirdParameter<typeof ${mutator.name}>`\n : ''\n }) {${bodyForm}\n return ${mutator.name}<TData>(\n ${mutatorConfig},\n this.http,\n ${requestOptions});\n }\n `;\n }\n\n const optionsBase = {\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override.paramsSerializerOptions,\n isAngular: true,\n isExactOptionalPropertyTypes,\n hasSignal: false,\n } as const;\n\n const propsDefinition = toObjectString(props, 'definition');\n\n // Check for multiple content types in success responses\n const successTypes = response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n const hasMultipleContentTypes = uniqueContentTypes.length > 1;\n\n // When observe branching is active AND there are query params, extract\n // the params computation to a local const to avoid duplicating it in\n // every observe branch.\n const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;\n const angularParamsRef =\n needsObserveBranching && queryParams ? 'filteredParams' : undefined;\n\n let paramsDeclaration = '';\n if (angularParamsRef && queryParams) {\n const callExpr = getAngularFilteredParamsCallExpression(\n '{...params, ...options?.params}',\n queryParams.requiredNullableKeys ?? [],\n );\n paramsDeclaration = paramsSerializer\n ? `const ${angularParamsRef} = ${paramsSerializer.name}(${callExpr});\\n\\n `\n : `const ${angularParamsRef} = ${callExpr};\\n\\n `;\n }\n\n const optionsInput = {\n ...optionsBase,\n ...(angularParamsRef ? { angularParamsRef } : {}),\n } as const;\n\n const options = generateOptions(optionsInput);\n\n // For multiple content types, determine the default\n const defaultContentType = hasMultipleContentTypes\n ? uniqueContentTypes.includes('text/plain')\n ? 'text/plain'\n : getDefaultContentType(uniqueContentTypes)\n : (uniqueContentTypes[0] ?? 'application/json');\n const getContentTypeReturnType = (\n contentType: string | undefined,\n value: string,\n ): string => {\n if (!contentType) {\n return value;\n }\n\n if (contentType.includes('json') || contentType.includes('+json')) {\n return value;\n }\n\n if (contentType.startsWith('text/') || contentType.includes('xml')) {\n return 'string';\n }\n\n return 'Blob';\n };\n\n const jsonSuccessValues = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') || contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n\n const jsonReturnType =\n jsonSuccessValues.length > 0 ? jsonSuccessValues.join(' | ') : 'unknown';\n\n // For multi-content-type operations the overall dataType may be primitive\n // (e.g., 'string' when text/plain is the first content type) but the JSON\n // branch still needs validation against its own schema. Multi-content-type\n // branches use concrete return types (not <TData>), so no generic cast.\n let jsonValidationPipe = shouldValidateResponse\n ? `.pipe(map(data => ${schemaValueRef}.parse(data)))`\n : '';\n if (\n hasMultipleContentTypes &&\n !shouldValidateResponse &&\n override.angular.runtimeValidation &&\n isZodOutput &&\n jsonSuccessValues.length === 1\n ) {\n const jsonType = jsonSuccessValues[0];\n const jsonIsPrimitive = isPrimitiveResponseType(jsonType);\n const jsonHasSchema = hasSchemaImport(response.imports, jsonType);\n if (!jsonIsPrimitive && jsonHasSchema) {\n const jsonSchemaRef = getSchemaValueRef(jsonType);\n jsonValidationPipe = `.pipe(map(data => ${jsonSchemaRef}.parse(data)))`;\n }\n }\n\n const multiImplementationReturnType = `Observable<${jsonReturnType} | string | Blob>`;\n\n const observeOptions = needsObserveBranching\n ? {\n body: generateOptions({ ...optionsInput, angularObserve: 'body' }),\n events: generateOptions({ ...optionsInput, angularObserve: 'events' }),\n response: generateOptions({\n ...optionsInput,\n angularObserve: 'response',\n }),\n }\n : undefined;\n\n const isModelType = dataType !== 'Blob' && dataType !== 'string';\n let functionName = operationName;\n if (isModelType && !hasMultipleContentTypes) {\n functionName += `<TData = ${dataType}>`;\n }\n\n let contentTypeOverloads = '';\n if (hasMultipleContentTypes && isRequestOptions) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n contentTypeOverloads = successTypes\n .filter((t) => t.contentType)\n .map(({ contentType, value }) => {\n const returnType = getContentTypeReturnType(contentType, value);\n const requiredPart = requiredProps\n .map((p) => p.definition)\n .join(',\\n ');\n const acceptPart = `accept: '${contentType}'`;\n const optionalPart = optionalProps\n .map((p) => p.definition)\n .join(',\\n ');\n\n const allParams = [requiredPart, acceptPart, optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n return `${operationName}(${allParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n })\n .join('\\n ');\n\n const requiredPart = requiredProps.map((p) => p.definition).join(',\\n ');\n const optionalPart = optionalProps.map((p) => p.definition).join(',\\n ');\n const allParams = [requiredPart, 'accept?: string', optionalPart]\n .filter(Boolean)\n .join(',\\n ');\n contentTypeOverloads += `\\n ${operationName}(${allParams}, options?: HttpClientOptions): ${multiImplementationReturnType};`;\n }\n\n const observeOverloads =\n isRequestOptions && !hasMultipleContentTypes\n ? `${functionName}(${propsDefinition} options?: HttpClientOptions & { observe?: 'body' }): Observable<${isModelType ? 'TData' : dataType}>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'events' }): Observable<HttpEvent<${isModelType ? 'TData' : dataType}>>;\n ${functionName}(${propsDefinition} options?: HttpClientOptions & { observe: 'response' }): Observable<AngularHttpResponse<${isModelType ? 'TData' : dataType}>>;`\n : '';\n\n const overloads = contentTypeOverloads || observeOverloads;\n\n const observableDataType = isModelType ? 'TData' : dataType;\n const singleImplementationReturnType = isRequestOptions\n ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n : `Observable<${observableDataType}>`;\n\n if (hasMultipleContentTypes) {\n const requiredProps = props.filter((p) => p.required && !p.default);\n const optionalProps = props.filter((p) => !p.required || p.default);\n\n const requiredPart = requiredProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const optionalPart = optionalProps\n .map((p) => p.implementation)\n .join(',\\n ');\n const allParams = [\n requiredPart,\n `accept: string = '${defaultContentType}'`,\n optionalPart,\n ]\n .filter(Boolean)\n .join(',\\n ');\n\n return ` ${overloads}\n ${operationName}(\n ${allParams},\n ${isRequestOptions ? 'options?: HttpClientOptions' : ''}\n ): ${multiImplementationReturnType} {${bodyForm}\n const headers = options?.headers instanceof HttpHeaders\n ? options.headers.set('Accept', accept)\n : { ...(options?.headers ?? {}), Accept: accept };\n\n if (accept.includes('json') || accept.includes('+json')) {\n return this.http.${verb}<${jsonReturnType}>(\\`${route}\\`, {\n ...options,\n responseType: 'json',\n headers,\n })${jsonValidationPipe};\n } else if (accept.startsWith('text/') || accept.includes('xml')) {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'text',\n headers,\n }) as Observable<string>;\n } else {\n return this.http.${verb}(\\`${route}\\`, {\n ...options,\n responseType: 'blob',\n headers,\n }) as Observable<Blob>;\n }\n }\n`;\n }\n\n const observeImplementation = isRequestOptions\n ? `${paramsDeclaration}if (options?.observe === 'events') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.events ?? options\n });\n }\n\n if (options?.observe === 'response') {\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.response ?? options\n });\n }\n\n return this.http.${verb}${isModelType ? '<TData>' : ''}(${\n observeOptions?.body ?? options\n })${validationPipe};`\n : `return this.http.${verb}${isModelType ? '<TData>' : ''}(${options})${validationPipe};`;\n\n return ` ${overloads}\n ${functionName}(\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions\n ? `options?: HttpClientOptions & { observe?: 'body' | 'events' | 'response' }`\n : ''\n }): ${singleImplementationReturnType} {${bodyForm}\n ${observeImplementation}\n }\n`;\n};\n\nconst createAngularClient =\n (returnTypesToWrite: ReturnTypesToWrite): ClientBuilder =>\n (verbOptions, options, _outputClient, _output) => {\n // Keep signature aligned with ClientBuilder without tripping TS noUnusedParameters\n void _outputClient;\n void _output;\n\n // Detect if Zod runtime validation should be applied\n const isZodOutput =\n typeof options.context.output.schemas === 'object' &&\n options.context.output.schemas.type === 'zod';\n const responseType = verbOptions.response.definition.success;\n const isPrimitiveResponse = isPrimitiveResponseType(responseType);\n const shouldUseRuntimeValidation =\n verbOptions.override.angular.runtimeValidation && isZodOutput;\n\n // Promote schema import from type-only to value import when runtime\n // validation is active, so the generated code can call Schema.parse()\n const normalizedVerbOptions = (() => {\n if (!shouldUseRuntimeValidation) return verbOptions;\n\n let result = verbOptions;\n\n // Promote the primary response schema\n if (\n !isPrimitiveResponse &&\n hasSchemaImport(result.response.imports, responseType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: result.response.imports.map((imp) =>\n imp.name === responseType ? { ...imp, values: true } : imp,\n ),\n },\n };\n }\n\n // For multi-content-type operations, also promote the JSON-specific\n // schema even when the primary content type is non-JSON (e.g.,\n // showPetById where text/plain is the default but application/json\n // returns Pet which needs .parse()).\n const successTypes = result.response.types.success;\n const uniqueContentTypes = [\n ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n ];\n if (uniqueContentTypes.length > 1) {\n const jsonSchemaNames = [\n ...new Set(\n successTypes\n .filter(\n ({ contentType }) =>\n !!contentType &&\n (contentType.includes('json') ||\n contentType.includes('+json')),\n )\n .map(({ value }) => value),\n ),\n ];\n if (jsonSchemaNames.length === 1) {\n const jsonType = jsonSchemaNames[0];\n const jsonIsPrimitive = isPrimitiveResponseType(jsonType);\n if (\n !jsonIsPrimitive &&\n hasSchemaImport(result.response.imports, jsonType)\n ) {\n result = {\n ...result,\n response: {\n ...result.response,\n imports: result.response.imports.map((imp) =>\n imp.name === jsonType ? { ...imp, values: true } : imp,\n ),\n },\n };\n }\n }\n }\n\n return result;\n })();\n\n const implementation = generateImplementation(\n returnTypesToWrite,\n normalizedVerbOptions,\n options,\n );\n\n const imports = [\n ...generateVerbImports(normalizedVerbOptions),\n ...(implementation.includes('.pipe(map(')\n ? [{ name: 'map', values: true, importPath: 'rxjs' }]\n : []),\n ];\n\n return { implementation, imports };\n };\n\nconst standaloneReturnTypesToWrite = new Map<string, string>();\n\nexport const generateAngular: ClientBuilder = (\n verbOptions,\n options,\n outputClient,\n output,\n) =>\n createAngularClient(standaloneReturnTypesToWrite)(\n verbOptions,\n options,\n outputClient,\n output,\n );\n\nconst createAngularClientBuilder = (): ClientGeneratorsBuilder => {\n const returnTypesToWrite = new Map<string, string>();\n\n return {\n client: createAngularClient(returnTypesToWrite),\n header: createAngularHeader(),\n dependencies: getAngularDependencies,\n footer: createAngularFooter(returnTypesToWrite),\n title: generateAngularTitle,\n };\n};\n\nexport const builder: () => () => ClientGeneratorsBuilder = () => {\n return () => createAngularClientBuilder();\n};\n\nexport default builder;\n"],"mappings":";;;AAwBA,MAAM,uBAAuB;CAC3B;EACE,SAAS;GACP;IAAE,MAAM;IAAc,QAAQ;IAAM;GACpC;IAAE,MAAM;IAAe,QAAQ;IAAM;GACrC,EAAE,MAAM,cAAc;GACtB,EAAE,MAAM,eAAe;GACvB;IAAE,MAAM;IAAgB,OAAO;IAAuB;GACtD,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,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,2BAA2B,aAC/B,YAAY,UACX,yBAA+C,SAAS,SAAS;AAEpE,MAAM,mBACJ,SACA,aAEA,YAAY,UAAa,QAAQ,MAAM,QAAQ,IAAI,SAAS,SAAS;AAEvE,MAAM,qBAAqB,aACzB,aAAa,UAAU,gBAAgB;AAIzC,MAAaA,+BAA0D,CACrE,GAAG,qBACJ;AAED,MAAaC,wBAA4C,UAAU;AAEjE,QAAO,GAAG,OADO,SAAS,MAAM,CACN,CAAC;;AAG7B,MAAM,6BAEH,EACC,OACA,kBACA,WACA,iBACA,WACA,aACA,UACI;CAIJ,MAAM,kBAHgB,MAClB,OAAO,OAAO,YAAY,CAAC,QAAQ,MAAM,EAAE,KAAK,SAAS,IAAc,CAAC,GACxE,OAAO,OAAO,YAAY,EACO,MAAM,MAAM,EAAE,YAAY;AAC/D,QAAO;EAET,oBAAoB,CAAC,kBACjB;;;;;;;;;;;;;;;;;;;;EAoBJ,iBAAiB,oCAAoC,GAAG,OAC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,aACA,SACA,cACA,OACD;AAEH,MAAM,mCAA4D;CAChE,MAAM,qCAAqB,IAAI,KAAqB;AAEpD,QAAO;EACL,QAAQ,oBAAoB,mBAAmB;EAC/C,QAAQ,qBAAqB;EAC7B,cAAc;EACd,QAAQ,oBAAoB,mBAAmB;EAC/C,OAAO;EACR;;AAGH,MAAaC,gBAAqD;AAChE,cAAa,4BAA4B;;AAG3C,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/angular",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"nuke": "rimraf .turbo dist node_modules"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@orval/core": "8.4.
|
|
24
|
+
"@orval/core": "8.4.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"eslint": "9.39.2",
|
|
28
28
|
"rimraf": "6.1.2",
|
|
29
29
|
"tsdown": "0.18.2",
|
|
30
30
|
"typescript": "5.9.3",
|
|
31
|
-
"vitest": "4.0.
|
|
31
|
+
"vitest": "4.0.18"
|
|
32
32
|
},
|
|
33
33
|
"main": "./dist/index.mjs",
|
|
34
34
|
"module": "./dist/index.mjs",
|