@orval/axios 7.11.2 → 7.12.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.d.ts +11 -7
- package/dist/index.js +155 -219
- package/dist/index.js.map +1 -1
- package/package.json +22 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as _orval_core0 from "@orval/core";
|
|
2
|
+
import { ClientBuilder, ClientDependenciesBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientTitleBuilder, GeneratorOptions, GeneratorVerbOptions } from "@orval/core";
|
|
3
3
|
|
|
4
|
+
//#region src/index.d.ts
|
|
4
5
|
declare const getAxiosDependencies: ClientDependenciesBuilder;
|
|
5
6
|
declare const generateAxiosTitle: ClientTitleBuilder;
|
|
6
7
|
declare const generateAxiosHeader: ClientHeaderBuilder;
|
|
7
8
|
declare const generateAxiosFooter: ClientFooterBuilder;
|
|
8
9
|
declare const generateAxios: (verbOptions: GeneratorVerbOptions, options: GeneratorOptions) => {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
implementation: string;
|
|
11
|
+
imports: _orval_core0.GeneratorImport[];
|
|
11
12
|
};
|
|
12
13
|
declare const generateAxiosFunctions: ClientBuilder;
|
|
13
|
-
declare const builder: ({
|
|
14
|
-
|
|
14
|
+
declare const builder: ({
|
|
15
|
+
type
|
|
16
|
+
}?: {
|
|
17
|
+
type?: "axios" | "axios-functions";
|
|
15
18
|
}) => () => ClientGeneratorsBuilder;
|
|
16
|
-
|
|
19
|
+
//#endregion
|
|
17
20
|
export { builder, builder as default, generateAxios, generateAxiosFooter, generateAxiosFunctions, generateAxiosHeader, generateAxiosTitle, getAxiosDependencies };
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,243 +1,179 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
9
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
17
18
|
};
|
|
18
|
-
var
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
paramsSerializer
|
|
80
|
-
}, { route, context }) => {
|
|
81
|
-
var _a, _b;
|
|
82
|
-
const isRequestOptions = (override == null ? void 0 : override.requestOptions) !== false;
|
|
83
|
-
const isFormData = (override == null ? void 0 : override.formData.disabled) === false;
|
|
84
|
-
const isFormUrlEncoded = (override == null ? void 0 : override.formUrlEncoded) !== false;
|
|
85
|
-
const isExactOptionalPropertyTypes = !!((_b = (_a = context.output.tsconfig) == null ? void 0 : _a.compilerOptions) == null ? void 0 : _b.exactOptionalPropertyTypes);
|
|
86
|
-
const isSyntheticDefaultImportsAllowed = (0, import_core.isSyntheticDefaultImportsAllow)(
|
|
87
|
-
context.output.tsconfig
|
|
88
|
-
);
|
|
89
|
-
const bodyForm = (0, import_core.generateFormDataAndUrlEncodedFunction)({
|
|
90
|
-
formData,
|
|
91
|
-
formUrlEncoded,
|
|
92
|
-
body,
|
|
93
|
-
isFormData,
|
|
94
|
-
isFormUrlEncoded
|
|
95
|
-
});
|
|
96
|
-
if (mutator) {
|
|
97
|
-
const mutatorConfig = (0, import_core.generateMutatorConfig)({
|
|
98
|
-
route,
|
|
99
|
-
body,
|
|
100
|
-
headers,
|
|
101
|
-
queryParams,
|
|
102
|
-
response,
|
|
103
|
-
verb,
|
|
104
|
-
isFormData,
|
|
105
|
-
isFormUrlEncoded,
|
|
106
|
-
hasSignal: false,
|
|
107
|
-
isExactOptionalPropertyTypes
|
|
108
|
-
});
|
|
109
|
-
const requestOptions = isRequestOptions ? (0, import_core.generateMutatorRequestOptions)(
|
|
110
|
-
override == null ? void 0 : override.requestOptions,
|
|
111
|
-
mutator.hasSecondArg
|
|
112
|
-
) : "";
|
|
113
|
-
returnTypesToWrite.set(
|
|
114
|
-
operationName,
|
|
115
|
-
(title) => `export type ${(0, import_core.pascal)(
|
|
116
|
-
operationName
|
|
117
|
-
)}Result = NonNullable<Awaited<ReturnType<${title ? `ReturnType<typeof ${title}>['${operationName}']` : `typeof ${operationName}`}>>>`
|
|
118
|
-
);
|
|
119
|
-
const propsImplementation = mutator.bodyTypeName && body.definition ? (0, import_core.toObjectString)(props, "implementation").replace(
|
|
120
|
-
new RegExp(`(\\w*):\\s?${body.definition}`),
|
|
121
|
-
`$1: ${mutator.bodyTypeName}<${body.definition}>`
|
|
122
|
-
) : (0, import_core.toObjectString)(props, "implementation");
|
|
123
|
-
return `const ${operationName} = (
|
|
124
|
-
${propsImplementation}
|
|
125
|
-
${isRequestOptions && mutator.hasSecondArg ? `options${context.output.optionsParamRequired ? "" : "?"}: SecondParameter<typeof ${mutator.name}>,` : ""}) => {${bodyForm}
|
|
24
|
+
//#endregion
|
|
25
|
+
let __orval_core = require("@orval/core");
|
|
26
|
+
__orval_core = __toESM(__orval_core);
|
|
27
|
+
|
|
28
|
+
//#region src/index.ts
|
|
29
|
+
const AXIOS_DEPENDENCIES = [{
|
|
30
|
+
exports: [
|
|
31
|
+
{
|
|
32
|
+
name: "axios",
|
|
33
|
+
default: true,
|
|
34
|
+
values: true,
|
|
35
|
+
syntheticDefaultImport: true
|
|
36
|
+
},
|
|
37
|
+
{ name: "AxiosRequestConfig" },
|
|
38
|
+
{ name: "AxiosResponse" }
|
|
39
|
+
],
|
|
40
|
+
dependency: "axios"
|
|
41
|
+
}];
|
|
42
|
+
const PARAMS_SERIALIZER_DEPENDENCIES = [{
|
|
43
|
+
exports: [{
|
|
44
|
+
name: "qs",
|
|
45
|
+
default: true,
|
|
46
|
+
values: true,
|
|
47
|
+
syntheticDefaultImport: true
|
|
48
|
+
}],
|
|
49
|
+
dependency: "qs"
|
|
50
|
+
}];
|
|
51
|
+
const returnTypesToWrite = /* @__PURE__ */ new Map();
|
|
52
|
+
const getAxiosDependencies = (hasGlobalMutator, hasParamsSerializerOptions) => [...hasGlobalMutator ? [] : AXIOS_DEPENDENCIES, ...hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []];
|
|
53
|
+
const generateAxiosImplementation = ({ headers, queryParams, operationName, response, mutator, body, props, verb, override, formData, formUrlEncoded, paramsSerializer }, { route, context }) => {
|
|
54
|
+
const isRequestOptions = override?.requestOptions !== false;
|
|
55
|
+
const isFormData = !override?.formData.disabled;
|
|
56
|
+
const isFormUrlEncoded = override?.formUrlEncoded !== false;
|
|
57
|
+
const isExactOptionalPropertyTypes = !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;
|
|
58
|
+
const isSyntheticDefaultImportsAllowed = (0, __orval_core.isSyntheticDefaultImportsAllow)(context.output.tsconfig);
|
|
59
|
+
const bodyForm = (0, __orval_core.generateFormDataAndUrlEncodedFunction)({
|
|
60
|
+
formData,
|
|
61
|
+
formUrlEncoded,
|
|
62
|
+
body,
|
|
63
|
+
isFormData,
|
|
64
|
+
isFormUrlEncoded
|
|
65
|
+
});
|
|
66
|
+
if (mutator) {
|
|
67
|
+
const mutatorConfig = (0, __orval_core.generateMutatorConfig)({
|
|
68
|
+
route,
|
|
69
|
+
body,
|
|
70
|
+
headers,
|
|
71
|
+
queryParams,
|
|
72
|
+
response,
|
|
73
|
+
verb,
|
|
74
|
+
isFormData,
|
|
75
|
+
isFormUrlEncoded,
|
|
76
|
+
hasSignal: false,
|
|
77
|
+
isExactOptionalPropertyTypes
|
|
78
|
+
});
|
|
79
|
+
const requestOptions = isRequestOptions ? (0, __orval_core.generateMutatorRequestOptions)(override?.requestOptions, mutator.hasSecondArg) : "";
|
|
80
|
+
returnTypesToWrite.set(operationName, (title) => `export type ${(0, __orval_core.pascal)(operationName)}Result = NonNullable<Awaited<ReturnType<${title ? `ReturnType<typeof ${title}>['${operationName}']` : `typeof ${operationName}`}>>>`);
|
|
81
|
+
const propsImplementation = mutator.bodyTypeName && body.definition ? (0, __orval_core.toObjectString)(props, "implementation").replace(/* @__PURE__ */ new RegExp(`(\\w*):\\s?${body.definition}`), `$1: ${mutator.bodyTypeName}<${body.definition}>`) : (0, __orval_core.toObjectString)(props, "implementation");
|
|
82
|
+
return `const ${operationName} = (\n ${propsImplementation}\n ${isRequestOptions && mutator.hasSecondArg ? `options${context.output.optionsParamRequired ? "" : "?"}: SecondParameter<typeof ${mutator.name}<${response.definition.success || "unknown"}>>,` : ""}) => {${bodyForm}
|
|
126
83
|
return ${mutator.name}<${response.definition.success || "unknown"}>(
|
|
127
84
|
${mutatorConfig},
|
|
128
85
|
${requestOptions});
|
|
129
86
|
}
|
|
130
87
|
`;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
151
|
-
return `const ${operationName} = <TData = AxiosResponse<${response.definition.success || "unknown"}>>(
|
|
152
|
-
${(0, import_core.toObjectString)(props, "implementation")} ${isRequestOptions ? `options?: AxiosRequestConfig
|
|
153
|
-
` : ""} ): Promise<TData> => {${bodyForm}
|
|
154
|
-
return axios${!isSyntheticDefaultImportsAllowed ? ".default" : ""}.${verb}(${options})${response.types.success.some((x) => x.type === "null") ? '.then((res) => {if (res.data === "") res.data = null; return res as TData;})' : ""};
|
|
88
|
+
}
|
|
89
|
+
const options = (0, __orval_core.generateOptions)({
|
|
90
|
+
route,
|
|
91
|
+
body,
|
|
92
|
+
headers,
|
|
93
|
+
queryParams,
|
|
94
|
+
response,
|
|
95
|
+
verb,
|
|
96
|
+
requestOptions: override?.requestOptions,
|
|
97
|
+
isFormData,
|
|
98
|
+
isFormUrlEncoded,
|
|
99
|
+
paramsSerializer,
|
|
100
|
+
paramsSerializerOptions: override?.paramsSerializerOptions,
|
|
101
|
+
isExactOptionalPropertyTypes,
|
|
102
|
+
hasSignal: false
|
|
103
|
+
});
|
|
104
|
+
returnTypesToWrite.set(operationName, () => `export type ${(0, __orval_core.pascal)(operationName)}Result = AxiosResponse<${response.definition.success || "unknown"}>`);
|
|
105
|
+
return `const ${operationName} = <TData = AxiosResponse<${response.definition.success || "unknown"}>>(\n ${(0, __orval_core.toObjectString)(props, "implementation")} ${isRequestOptions ? `options?: AxiosRequestConfig\n` : ""} ): Promise<TData> => {${bodyForm}
|
|
106
|
+
return axios${isSyntheticDefaultImportsAllowed ? "" : ".default"}.${verb}(${options});
|
|
155
107
|
}
|
|
156
108
|
`;
|
|
157
109
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
110
|
+
const generateAxiosTitle = (title) => {
|
|
111
|
+
const sanTitle = (0, __orval_core.sanitize)(title);
|
|
112
|
+
return `get${(0, __orval_core.pascal)(sanTitle)}`;
|
|
161
113
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
` : ""}
|
|
171
|
-
${!noFunction ? `export const ${title} = () => {
|
|
172
|
-
` : ""}`;
|
|
173
|
-
var generateAxiosFooter = ({
|
|
174
|
-
operationNames,
|
|
175
|
-
title,
|
|
176
|
-
noFunction,
|
|
177
|
-
hasMutator,
|
|
178
|
-
hasAwaitedType
|
|
179
|
-
}) => {
|
|
180
|
-
let footer = "";
|
|
181
|
-
if (!noFunction) {
|
|
182
|
-
footer += `return {${operationNames.join(",")}}};
|
|
183
|
-
`;
|
|
184
|
-
}
|
|
185
|
-
if (hasMutator && !hasAwaitedType) {
|
|
186
|
-
footer += `
|
|
187
|
-
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
188
|
-
|
|
114
|
+
const generateAxiosHeader = ({ title, isRequestOptions, isMutator, noFunction }) => `
|
|
115
|
+
${isRequestOptions && isMutator ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n` : ""}
|
|
116
|
+
${noFunction ? "" : `export const ${title} = () => {\n`}`;
|
|
117
|
+
const generateAxiosFooter = ({ operationNames, title, noFunction, hasMutator, hasAwaitedType }) => {
|
|
118
|
+
let footer = "";
|
|
119
|
+
if (!noFunction) footer += `return {${operationNames.join(",")}}};\n`;
|
|
120
|
+
if (hasMutator && !hasAwaitedType) footer += `\ntype AwaitedInput<T> = PromiseLike<T> | T;\n
|
|
189
121
|
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
footer += func(!noFunction ? title : void 0) + "\n";
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
return footer;
|
|
122
|
+
\n`;
|
|
123
|
+
for (const operationName of operationNames) if (returnTypesToWrite.has(operationName)) {
|
|
124
|
+
const func = returnTypesToWrite.get(operationName);
|
|
125
|
+
footer += func(noFunction ? void 0 : title) + "\n";
|
|
126
|
+
}
|
|
127
|
+
return footer;
|
|
200
128
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
129
|
+
const generateAxios = (verbOptions, options) => {
|
|
130
|
+
const imports = (0, __orval_core.generateVerbImports)(verbOptions);
|
|
131
|
+
return {
|
|
132
|
+
implementation: generateAxiosImplementation(verbOptions, options),
|
|
133
|
+
imports
|
|
134
|
+
};
|
|
205
135
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
136
|
+
const generateAxiosFunctions = async (verbOptions, options) => {
|
|
137
|
+
const { implementation, imports } = generateAxios(verbOptions, options);
|
|
138
|
+
return {
|
|
139
|
+
implementation: "export " + implementation,
|
|
140
|
+
imports
|
|
141
|
+
};
|
|
212
142
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
143
|
+
const axiosClientBuilder = {
|
|
144
|
+
client: generateAxios,
|
|
145
|
+
header: generateAxiosHeader,
|
|
146
|
+
dependencies: getAxiosDependencies,
|
|
147
|
+
footer: generateAxiosFooter,
|
|
148
|
+
title: generateAxiosTitle
|
|
219
149
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
150
|
+
const axiosFunctionsClientBuilder = {
|
|
151
|
+
client: generateAxiosFunctions,
|
|
152
|
+
header: (options) => generateAxiosHeader({
|
|
153
|
+
...options,
|
|
154
|
+
noFunction: true
|
|
155
|
+
}),
|
|
156
|
+
dependencies: getAxiosDependencies,
|
|
157
|
+
footer: (options) => generateAxiosFooter({
|
|
158
|
+
...options,
|
|
159
|
+
noFunction: true
|
|
160
|
+
}),
|
|
161
|
+
title: generateAxiosTitle
|
|
226
162
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
163
|
+
const builders = {
|
|
164
|
+
axios: axiosClientBuilder,
|
|
165
|
+
"axios-functions": axiosFunctionsClientBuilder
|
|
230
166
|
};
|
|
231
|
-
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
167
|
+
const builder = ({ type = "axios-functions" } = {}) => () => builders[type];
|
|
168
|
+
var src_default = builder;
|
|
169
|
+
|
|
170
|
+
//#endregion
|
|
171
|
+
exports.builder = builder;
|
|
172
|
+
exports.default = src_default;
|
|
173
|
+
exports.generateAxios = generateAxios;
|
|
174
|
+
exports.generateAxiosFooter = generateAxiosFooter;
|
|
175
|
+
exports.generateAxiosFunctions = generateAxiosFunctions;
|
|
176
|
+
exports.generateAxiosHeader = generateAxiosHeader;
|
|
177
|
+
exports.generateAxiosTitle = generateAxiosTitle;
|
|
178
|
+
exports.getAxiosDependencies = getAxiosDependencies;
|
|
243
179
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n ClientBuilder,\n ClientDependenciesBuilder,\n ClientFooterBuilder,\n ClientGeneratorsBuilder,\n ClientHeaderBuilder,\n ClientTitleBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n GeneratorDependency,\n GeneratorOptions,\n GeneratorVerbOptions,\n isSyntheticDefaultImportsAllow,\n pascal,\n sanitize,\n toObjectString,\n} from '@orval/core';\n\nconst AXIOS_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'axios',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n { name: 'AxiosRequestConfig' },\n { name: 'AxiosResponse' },\n ],\n dependency: 'axios',\n },\n];\n\nconst PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'qs',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n ],\n dependency: 'qs',\n },\n];\n\nconst returnTypesToWrite: Map<string, (title?: string) => string> = new Map();\n\nexport const getAxiosDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions: boolean,\n) => [\n ...(!hasGlobalMutator ? AXIOS_DEPENDENCIES : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n];\n\nconst generateAxiosImplementation = (\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 === false;\n const isFormUrlEncoded = override?.formUrlEncoded !== false;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n\n const isSyntheticDefaultImportsAllowed = isSyntheticDefaultImportsAllow(\n context.output.tsconfig,\n );\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\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 });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override?.requestOptions,\n mutator.hasSecondArg,\n )\n : '';\n\n returnTypesToWrite.set(\n operationName,\n (title?: string) =>\n `export type ${pascal(\n operationName,\n )}Result = NonNullable<Awaited<ReturnType<${\n title\n ? `ReturnType<typeof ${title}>['${operationName}']`\n : `typeof ${operationName}`\n }>>>`,\n );\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(`(\\\\w*):\\\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return `const ${operationName} = (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<typeof ${mutator.name}>,`\n : ''\n }) => {${bodyForm}\n return ${mutator.name}<${response.definition.success || 'unknown'}>(\n ${mutatorConfig},\n ${requestOptions});\n }\n `;\n }\n\n const options = generateOptions({\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 isExactOptionalPropertyTypes,\n hasSignal: false,\n });\n\n returnTypesToWrite.set(\n operationName,\n () =>\n `export type ${pascal(operationName)}Result = AxiosResponse<${\n response.definition.success || 'unknown'\n }>`,\n );\n\n return `const ${operationName} = <TData = AxiosResponse<${\n response.definition.success || 'unknown'\n }>>(\\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions ? `options?: AxiosRequestConfig\\n` : ''\n } ): Promise<TData> => {${bodyForm}\n return axios${\n !isSyntheticDefaultImportsAllowed ? '.default' : ''\n }.${verb}(${options})${response.types.success.some((x) => x.type === 'null') ? '.then((res) => {if (res.data === \"\") res.data = null; return res as TData;})' : ''};\n }\n`;\n};\n\nexport const generateAxiosTitle: ClientTitleBuilder = (title) => {\n const sanTitle = sanitize(title);\n return `get${pascal(sanTitle)}`;\n};\n\nexport const generateAxiosHeader: ClientHeaderBuilder = ({\n title,\n isRequestOptions,\n isMutator,\n noFunction,\n}) => `\n${\n isRequestOptions && isMutator\n ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\\n\\n`\n : ''\n}\n ${!noFunction ? `export const ${title} = () => {\\n` : ''}`;\n\nexport const generateAxiosFooter: ClientFooterBuilder = ({\n operationNames,\n title,\n noFunction,\n hasMutator,\n hasAwaitedType,\n}) => {\n let footer = '';\n\n if (!noFunction) {\n footer += `return {${operationNames.join(',')}}};\\n`;\n }\n\n if (hasMutator && !hasAwaitedType) {\n footer += `\\ntype AwaitedInput<T> = PromiseLike<T> | T;\\n\n type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\\n`;\n }\n\n operationNames.forEach((operationName) => {\n if (returnTypesToWrite.has(operationName)) {\n const func = returnTypesToWrite.get(operationName)!;\n footer += func(!noFunction ? title : undefined) + '\\n';\n }\n });\n\n return footer;\n};\n\nexport const generateAxios = (\n verbOptions: GeneratorVerbOptions,\n options: GeneratorOptions,\n) => {\n const imports = generateVerbImports(verbOptions);\n const implementation = generateAxiosImplementation(verbOptions, options);\n\n return { implementation, imports };\n};\n\nexport const generateAxiosFunctions: ClientBuilder = async (\n verbOptions,\n options,\n) => {\n const { implementation, imports } = generateAxios(verbOptions, options);\n\n return {\n implementation: 'export ' + implementation,\n imports,\n };\n};\n\nconst axiosClientBuilder: ClientGeneratorsBuilder = {\n client: generateAxios,\n header: generateAxiosHeader,\n dependencies: getAxiosDependencies,\n footer: generateAxiosFooter,\n title: generateAxiosTitle,\n};\n\nconst axiosFunctionsClientBuilder: ClientGeneratorsBuilder = {\n client: generateAxiosFunctions,\n header: (options) => generateAxiosHeader({ ...options, noFunction: true }),\n dependencies: getAxiosDependencies,\n footer: (options) => generateAxiosFooter({ ...options, noFunction: true }),\n title: generateAxiosTitle,\n};\n\nconst builders: Record<'axios' | 'axios-functions', ClientGeneratorsBuilder> = {\n axios: axiosClientBuilder,\n 'axios-functions': axiosFunctionsClientBuilder,\n};\n\nexport const builder =\n ({ type = 'axios-functions' }: { type?: 'axios' | 'axios-functions' } = {}) =>\n () =>\n builders[type];\n\nexport default builder;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAmBO;AAEP,IAAM,qBAA4C;AAAA,EAChD;AAAA,IACE,SAAS;AAAA,MACP;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,wBAAwB;AAAA,MAC1B;AAAA,MACA,EAAE,MAAM,qBAAqB;AAAA,MAC7B,EAAE,MAAM,gBAAgB;AAAA,IAC1B;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAEA,IAAM,iCAAwD;AAAA,EAC5D;AAAA,IACE,SAAS;AAAA,MACP;AAAA,QAC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,SAAS,YAAY,KAAK,CAAC;AAAA,EACzE,cAAc;AAAA,EACd,QAAQ,CAAC,YAAY,oBAAoB,EAAE,GAAG,SAAS,YAAY,KAAK,CAAC;AAAA,EACzE,OAAO;AACT;AAEA,IAAM,WAAyE;AAAA,EAC7E,OAAO;AAAA,EACP,mBAAmB;AACrB;AAEO,IAAM,UACX,CAAC,EAAE,OAAO,kBAAkB,IAA4C,CAAC,MACzE,MACE,SAAS,IAAI;AAEjB,IAAO,gBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["AXIOS_DEPENDENCIES: GeneratorDependency[]","PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[]","getAxiosDependencies: ClientDependenciesBuilder","generateAxiosTitle: ClientTitleBuilder","generateAxiosHeader: ClientHeaderBuilder","generateAxiosFooter: ClientFooterBuilder","generateAxiosFunctions: ClientBuilder","axiosClientBuilder: ClientGeneratorsBuilder","axiosFunctionsClientBuilder: ClientGeneratorsBuilder","builders: Record<'axios' | 'axios-functions', ClientGeneratorsBuilder>"],"sources":["../src/index.ts"],"sourcesContent":["import {\n ClientBuilder,\n ClientDependenciesBuilder,\n ClientFooterBuilder,\n ClientGeneratorsBuilder,\n ClientHeaderBuilder,\n ClientTitleBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n generateVerbImports,\n GeneratorDependency,\n GeneratorOptions,\n GeneratorVerbOptions,\n isSyntheticDefaultImportsAllow,\n pascal,\n sanitize,\n toObjectString,\n} from '@orval/core';\n\nconst AXIOS_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'axios',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n { name: 'AxiosRequestConfig' },\n { name: 'AxiosResponse' },\n ],\n dependency: 'axios',\n },\n];\n\nconst PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'qs',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n ],\n dependency: 'qs',\n },\n];\n\nconst returnTypesToWrite = new Map<string, (title?: string) => string>();\n\nexport const getAxiosDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions: boolean,\n) => [\n ...(hasGlobalMutator ? [] : AXIOS_DEPENDENCIES),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n];\n\nconst generateAxiosImplementation = (\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\n const isSyntheticDefaultImportsAllowed = isSyntheticDefaultImportsAllow(\n context.output.tsconfig,\n );\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\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 });\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override?.requestOptions,\n mutator.hasSecondArg,\n )\n : '';\n\n returnTypesToWrite.set(\n operationName,\n (title?: string) =>\n `export type ${pascal(\n operationName,\n )}Result = NonNullable<Awaited<ReturnType<${\n title\n ? `ReturnType<typeof ${title}>['${operationName}']`\n : `typeof ${operationName}`\n }>>>`,\n );\n\n const propsImplementation =\n mutator.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(`(\\\\w*):\\\\s?${body.definition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n return `const ${operationName} = (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<typeof ${mutator.name}<${response.definition.success || 'unknown'}>>,`\n : ''\n }) => {${bodyForm}\n return ${mutator.name}<${response.definition.success || 'unknown'}>(\n ${mutatorConfig},\n ${requestOptions});\n }\n `;\n }\n\n const options = generateOptions({\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 isExactOptionalPropertyTypes,\n hasSignal: false,\n });\n\n returnTypesToWrite.set(\n operationName,\n () =>\n `export type ${pascal(operationName)}Result = AxiosResponse<${\n response.definition.success || 'unknown'\n }>`,\n );\n\n return `const ${operationName} = <TData = AxiosResponse<${\n response.definition.success || 'unknown'\n }>>(\\n ${toObjectString(props, 'implementation')} ${\n isRequestOptions ? `options?: AxiosRequestConfig\\n` : ''\n } ): Promise<TData> => {${bodyForm}\n return axios${\n isSyntheticDefaultImportsAllowed ? '' : '.default'\n }.${verb}(${options});\n }\n`;\n};\n\nexport const generateAxiosTitle: ClientTitleBuilder = (title) => {\n const sanTitle = sanitize(title);\n return `get${pascal(sanTitle)}`;\n};\n\nexport const generateAxiosHeader: ClientHeaderBuilder = ({\n title,\n isRequestOptions,\n isMutator,\n noFunction,\n}) => `\n${\n isRequestOptions && isMutator\n ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\\n\\n`\n : ''\n}\n ${noFunction ? '' : `export const ${title} = () => {\\n`}`;\n\nexport const generateAxiosFooter: ClientFooterBuilder = ({\n operationNames,\n title,\n noFunction,\n hasMutator,\n hasAwaitedType,\n}) => {\n let footer = '';\n\n if (!noFunction) {\n footer += `return {${operationNames.join(',')}}};\\n`;\n }\n\n if (hasMutator && !hasAwaitedType) {\n footer += `\\ntype AwaitedInput<T> = PromiseLike<T> | T;\\n\n type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\\n`;\n }\n\n for (const operationName of operationNames) {\n if (returnTypesToWrite.has(operationName)) {\n const func = returnTypesToWrite.get(operationName)!;\n footer += func(noFunction ? undefined : title) + '\\n';\n }\n }\n\n return footer;\n};\n\nexport const generateAxios = (\n verbOptions: GeneratorVerbOptions,\n options: GeneratorOptions,\n) => {\n const imports = generateVerbImports(verbOptions);\n const implementation = generateAxiosImplementation(verbOptions, options);\n\n return { implementation, imports };\n};\n\nexport const generateAxiosFunctions: ClientBuilder = async (\n verbOptions,\n options,\n) => {\n const { implementation, imports } = generateAxios(verbOptions, options);\n\n return {\n implementation: 'export ' + implementation,\n imports,\n };\n};\n\nconst axiosClientBuilder: ClientGeneratorsBuilder = {\n client: generateAxios,\n header: generateAxiosHeader,\n dependencies: getAxiosDependencies,\n footer: generateAxiosFooter,\n title: generateAxiosTitle,\n};\n\nconst axiosFunctionsClientBuilder: ClientGeneratorsBuilder = {\n client: generateAxiosFunctions,\n header: (options) => generateAxiosHeader({ ...options, noFunction: true }),\n dependencies: getAxiosDependencies,\n footer: (options) => generateAxiosFooter({ ...options, noFunction: true }),\n title: generateAxiosTitle,\n};\n\nconst builders: Record<'axios' | 'axios-functions', ClientGeneratorsBuilder> = {\n axios: axiosClientBuilder,\n 'axios-functions': axiosFunctionsClientBuilder,\n};\n\nexport const builder =\n ({ type = 'axios-functions' }: { type?: 'axios' | 'axios-functions' } = {}) =>\n () =>\n builders[type];\n\nexport default builder;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,qBAA4C,CAChD;CACE,SAAS;EACP;GACE,MAAM;GACN,SAAS;GACT,QAAQ;GACR,wBAAwB;GACzB;EACD,EAAE,MAAM,sBAAsB;EAC9B,EAAE,MAAM,iBAAiB;EAC1B;CACD,YAAY;CACb,CACF;AAED,MAAMC,iCAAwD,CAC5D;CACE,SAAS,CACP;EACE,MAAM;EACN,S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,MAAMC,qBAA8C;CAClD,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,OAAO;CACR;AAED,MAAMC,8BAAuD;CAC3D,QAAQ;CACR,SAAS,YAAY,oBAAoB;EAAE,GAAG;EAAS,YAAY;EAAM,CAAC;CAC1E,cAAc;CACd,SAAS,YAAY,oBAAoB;EAAE,GAAG;EAAS,YAAY;EAAM,CAAC;CAC1E,OAAO;CACR;AAED,MAAMC,WAAyE;CAC7E,OAAO;CACP,mBAAmB;CACpB;AAED,MAAa,WACV,EAAE,OAAO,sBAA8D,EAAE,WAExE,SAAS;AAEb,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/axios",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.12.2",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"!dist/**/*.d.ts.map"
|
|
9
14
|
],
|
|
10
15
|
"scripts": {
|
|
11
|
-
"build": "
|
|
12
|
-
"dev": "
|
|
13
|
-
"lint": "eslint
|
|
16
|
+
"build": "tsdown --config-loader unconfig",
|
|
17
|
+
"dev": "tsdown --config-loader unconfig --watch src",
|
|
18
|
+
"lint": "eslint .",
|
|
19
|
+
"clean": "rimraf .turbo dist",
|
|
20
|
+
"nuke": "rimraf .turbo dist node_modules"
|
|
14
21
|
},
|
|
15
22
|
"dependencies": {
|
|
16
|
-
"@orval/core": "7.
|
|
23
|
+
"@orval/core": "7.12.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"eslint": "^9.35.0",
|
|
27
|
+
"rimraf": "^6.0.1",
|
|
28
|
+
"tsdown": "^0.15.2",
|
|
29
|
+
"typescript": "^5.9.2"
|
|
17
30
|
}
|
|
18
|
-
}
|
|
31
|
+
}
|