@hey-api/openapi-ts 0.87.1 → 0.87.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/README.md +2 -0
- package/dist/clients/ky/client.ts +339 -0
- package/dist/clients/ky/index.ts +24 -0
- package/dist/clients/ky/types.ts +271 -0
- package/dist/clients/ky/utils.ts +328 -0
- package/dist/{config-PWeoedFF.d.cts → config-CQeoZYf_.d.cts} +59 -22
- package/dist/{config-CNi83ZTD.d.ts → config-U5JEpxGS.d.ts} +59 -22
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/openApi-CT-iM-D8.cjs +19 -0
- package/dist/openApi-CT-iM-D8.cjs.map +1 -0
- package/dist/openApi-HKXoyF4o.js +19 -0
- package/dist/openApi-HKXoyF4o.js.map +1 -0
- package/dist/run.cjs +1 -1
- package/dist/run.cjs.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/{src-CZCpIWy7.js → src-Ba-zyEiS.js} +2 -2
- package/dist/{src-CZCpIWy7.js.map → src-Ba-zyEiS.js.map} +1 -1
- package/dist/{src-Cvd6zAsc.cjs → src-CNO_U6s-.cjs} +2 -2
- package/dist/{src-Cvd6zAsc.cjs.map → src-CNO_U6s-.cjs.map} +1 -1
- package/package.json +4 -3
- package/dist/openApi-CCTdD3hW.cjs +0 -19
- package/dist/openApi-CCTdD3hW.cjs.map +0 -1
- package/dist/openApi-D7xrG_wR.js +0 -19
- package/dist/openApi-D7xrG_wR.js.map +0 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { getAuthToken } from '../core/auth';
|
|
2
|
+
import type { QuerySerializerOptions } from '../core/bodySerializer';
|
|
3
|
+
import { jsonBodySerializer } from '../core/bodySerializer';
|
|
4
|
+
import {
|
|
5
|
+
serializeArrayParam,
|
|
6
|
+
serializeObjectParam,
|
|
7
|
+
serializePrimitiveParam,
|
|
8
|
+
} from '../core/pathSerializer';
|
|
9
|
+
import { getUrl } from '../core/utils';
|
|
10
|
+
import type { Client, ClientOptions, Config, RequestOptions } from './types';
|
|
11
|
+
|
|
12
|
+
export const createQuerySerializer = <T = unknown>({
|
|
13
|
+
parameters = {},
|
|
14
|
+
...args
|
|
15
|
+
}: QuerySerializerOptions = {}) => {
|
|
16
|
+
const querySerializer = (queryParams: T) => {
|
|
17
|
+
const search: string[] = [];
|
|
18
|
+
if (queryParams && typeof queryParams === 'object') {
|
|
19
|
+
for (const name in queryParams) {
|
|
20
|
+
const value = queryParams[name];
|
|
21
|
+
|
|
22
|
+
if (value === undefined || value === null) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const options = parameters[name] || args;
|
|
27
|
+
|
|
28
|
+
if (Array.isArray(value)) {
|
|
29
|
+
const serializedArray = serializeArrayParam({
|
|
30
|
+
allowReserved: options.allowReserved,
|
|
31
|
+
explode: true,
|
|
32
|
+
name,
|
|
33
|
+
style: 'form',
|
|
34
|
+
value,
|
|
35
|
+
...options.array,
|
|
36
|
+
});
|
|
37
|
+
if (serializedArray) search.push(serializedArray);
|
|
38
|
+
} else if (typeof value === 'object') {
|
|
39
|
+
const serializedObject = serializeObjectParam({
|
|
40
|
+
allowReserved: options.allowReserved,
|
|
41
|
+
explode: true,
|
|
42
|
+
name,
|
|
43
|
+
style: 'deepObject',
|
|
44
|
+
value: value as Record<string, unknown>,
|
|
45
|
+
...options.object,
|
|
46
|
+
});
|
|
47
|
+
if (serializedObject) search.push(serializedObject);
|
|
48
|
+
} else {
|
|
49
|
+
const serializedPrimitive = serializePrimitiveParam({
|
|
50
|
+
allowReserved: options.allowReserved,
|
|
51
|
+
name,
|
|
52
|
+
value: value as string,
|
|
53
|
+
});
|
|
54
|
+
if (serializedPrimitive) search.push(serializedPrimitive);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return search.join('&');
|
|
59
|
+
};
|
|
60
|
+
return querySerializer;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Infers parseAs value from provided Content-Type header.
|
|
65
|
+
*/
|
|
66
|
+
export const getParseAs = (
|
|
67
|
+
contentType: string | null,
|
|
68
|
+
): Exclude<Config['parseAs'], 'auto'> => {
|
|
69
|
+
if (!contentType) {
|
|
70
|
+
return 'stream';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const cleanContent = contentType.split(';')[0]?.trim();
|
|
74
|
+
|
|
75
|
+
if (!cleanContent) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
cleanContent.startsWith('application/json') ||
|
|
81
|
+
cleanContent.endsWith('+json')
|
|
82
|
+
) {
|
|
83
|
+
return 'json';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (cleanContent === 'multipart/form-data') {
|
|
87
|
+
return 'formData';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (
|
|
91
|
+
['application/', 'audio/', 'image/', 'video/'].some((type) =>
|
|
92
|
+
cleanContent.startsWith(type),
|
|
93
|
+
)
|
|
94
|
+
) {
|
|
95
|
+
return 'blob';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (cleanContent.startsWith('text/')) {
|
|
99
|
+
return 'text';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const checkForExistence = (
|
|
106
|
+
options: Pick<RequestOptions, 'auth' | 'query'> & {
|
|
107
|
+
headers: Headers;
|
|
108
|
+
},
|
|
109
|
+
name?: string,
|
|
110
|
+
): boolean => {
|
|
111
|
+
if (!name) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (
|
|
115
|
+
options.headers.has(name) ||
|
|
116
|
+
options.query?.[name] ||
|
|
117
|
+
options.headers.get('Cookie')?.includes(`${name}=`)
|
|
118
|
+
) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const setAuthParams = async ({
|
|
125
|
+
security,
|
|
126
|
+
...options
|
|
127
|
+
}: Pick<Required<RequestOptions>, 'security'> &
|
|
128
|
+
Pick<RequestOptions, 'auth' | 'query'> & {
|
|
129
|
+
headers: Headers;
|
|
130
|
+
}) => {
|
|
131
|
+
for (const auth of security) {
|
|
132
|
+
if (checkForExistence(options, auth.name)) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const token = await getAuthToken(auth, options.auth);
|
|
137
|
+
|
|
138
|
+
if (!token) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const name = auth.name ?? 'Authorization';
|
|
143
|
+
|
|
144
|
+
switch (auth.in) {
|
|
145
|
+
case 'query':
|
|
146
|
+
if (!options.query) {
|
|
147
|
+
options.query = {};
|
|
148
|
+
}
|
|
149
|
+
options.query[name] = token;
|
|
150
|
+
break;
|
|
151
|
+
case 'cookie':
|
|
152
|
+
options.headers.append('Cookie', `${name}=${token}`);
|
|
153
|
+
break;
|
|
154
|
+
case 'header':
|
|
155
|
+
default:
|
|
156
|
+
options.headers.set(name, token);
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const buildUrl: Client['buildUrl'] = (options) =>
|
|
163
|
+
getUrl({
|
|
164
|
+
baseUrl: options.baseUrl as string,
|
|
165
|
+
path: options.path,
|
|
166
|
+
query: options.query,
|
|
167
|
+
querySerializer:
|
|
168
|
+
typeof options.querySerializer === 'function'
|
|
169
|
+
? options.querySerializer
|
|
170
|
+
: createQuerySerializer(options.querySerializer),
|
|
171
|
+
url: options.url,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export const mergeConfigs = (a: Config, b: Config): Config => {
|
|
175
|
+
const config = { ...a, ...b };
|
|
176
|
+
if (config.baseUrl?.endsWith('/')) {
|
|
177
|
+
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
|
178
|
+
}
|
|
179
|
+
config.headers = mergeHeaders(a.headers, b.headers);
|
|
180
|
+
return config;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const headersEntries = (headers: Headers): Array<[string, string]> => {
|
|
184
|
+
const entries: Array<[string, string]> = [];
|
|
185
|
+
headers.forEach((value, key) => {
|
|
186
|
+
entries.push([key, value]);
|
|
187
|
+
});
|
|
188
|
+
return entries;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const mergeHeaders = (
|
|
192
|
+
...headers: Array<Required<Config>['headers'] | undefined>
|
|
193
|
+
): Headers => {
|
|
194
|
+
const mergedHeaders = new Headers();
|
|
195
|
+
for (const header of headers) {
|
|
196
|
+
if (!header) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const iterator =
|
|
201
|
+
header instanceof Headers
|
|
202
|
+
? headersEntries(header)
|
|
203
|
+
: Object.entries(header);
|
|
204
|
+
|
|
205
|
+
for (const [key, value] of iterator) {
|
|
206
|
+
if (value === null) {
|
|
207
|
+
mergedHeaders.delete(key);
|
|
208
|
+
} else if (Array.isArray(value)) {
|
|
209
|
+
for (const v of value) {
|
|
210
|
+
mergedHeaders.append(key, v as string);
|
|
211
|
+
}
|
|
212
|
+
} else if (value !== undefined) {
|
|
213
|
+
mergedHeaders.set(
|
|
214
|
+
key,
|
|
215
|
+
typeof value === 'object' ? JSON.stringify(value) : (value as string),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return mergedHeaders;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
type ErrInterceptor<Err, Res, Req, Options> = (
|
|
224
|
+
error: Err,
|
|
225
|
+
response: Res,
|
|
226
|
+
request: Req,
|
|
227
|
+
options: Options,
|
|
228
|
+
) => Err | Promise<Err>;
|
|
229
|
+
|
|
230
|
+
type ReqInterceptor<Req, Options> = (
|
|
231
|
+
request: Req,
|
|
232
|
+
options: Options,
|
|
233
|
+
) => Req | Promise<Req>;
|
|
234
|
+
|
|
235
|
+
type ResInterceptor<Res, Req, Options> = (
|
|
236
|
+
response: Res,
|
|
237
|
+
request: Req,
|
|
238
|
+
options: Options,
|
|
239
|
+
) => Res | Promise<Res>;
|
|
240
|
+
|
|
241
|
+
class Interceptors<Interceptor> {
|
|
242
|
+
fns: Array<Interceptor | null> = [];
|
|
243
|
+
|
|
244
|
+
clear(): void {
|
|
245
|
+
this.fns = [];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
eject(id: number | Interceptor): void {
|
|
249
|
+
const index = this.getInterceptorIndex(id);
|
|
250
|
+
if (this.fns[index]) {
|
|
251
|
+
this.fns[index] = null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
exists(id: number | Interceptor): boolean {
|
|
256
|
+
const index = this.getInterceptorIndex(id);
|
|
257
|
+
return Boolean(this.fns[index]);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
getInterceptorIndex(id: number | Interceptor): number {
|
|
261
|
+
if (typeof id === 'number') {
|
|
262
|
+
return this.fns[id] ? id : -1;
|
|
263
|
+
}
|
|
264
|
+
return this.fns.indexOf(id);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
update(
|
|
268
|
+
id: number | Interceptor,
|
|
269
|
+
fn: Interceptor,
|
|
270
|
+
): number | Interceptor | false {
|
|
271
|
+
const index = this.getInterceptorIndex(id);
|
|
272
|
+
if (this.fns[index]) {
|
|
273
|
+
this.fns[index] = fn;
|
|
274
|
+
return id;
|
|
275
|
+
}
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
use(fn: Interceptor): number {
|
|
280
|
+
this.fns.push(fn);
|
|
281
|
+
return this.fns.length - 1;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface Middleware<Req, Res, Err, Options> {
|
|
286
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
287
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
288
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const createInterceptors = <Req, Res, Err, Options>(): Middleware<
|
|
292
|
+
Req,
|
|
293
|
+
Res,
|
|
294
|
+
Err,
|
|
295
|
+
Options
|
|
296
|
+
> => ({
|
|
297
|
+
error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),
|
|
298
|
+
request: new Interceptors<ReqInterceptor<Req, Options>>(),
|
|
299
|
+
response: new Interceptors<ResInterceptor<Res, Req, Options>>(),
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const defaultQuerySerializer = createQuerySerializer({
|
|
303
|
+
allowReserved: false,
|
|
304
|
+
array: {
|
|
305
|
+
explode: true,
|
|
306
|
+
style: 'form',
|
|
307
|
+
},
|
|
308
|
+
object: {
|
|
309
|
+
explode: true,
|
|
310
|
+
style: 'deepObject',
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
const defaultHeaders = {
|
|
315
|
+
'Content-Type': 'application/json',
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export const createConfig = <T extends ClientOptions = ClientOptions>(
|
|
319
|
+
override: Config<Omit<ClientOptions, keyof T> & T> = {},
|
|
320
|
+
): Config<Omit<ClientOptions, keyof T> & T> => ({
|
|
321
|
+
...jsonBodySerializer,
|
|
322
|
+
headers: defaultHeaders,
|
|
323
|
+
parseAs: 'auto',
|
|
324
|
+
querySerializer: defaultQuerySerializer,
|
|
325
|
+
throwOnError: false,
|
|
326
|
+
timeout: 10000,
|
|
327
|
+
...override,
|
|
328
|
+
});
|
|
@@ -2796,7 +2796,7 @@ type StringCase = 'camelCase' | 'PascalCase' | 'preserve' | 'snake_case' | 'SCRE
|
|
|
2796
2796
|
type StringName = string | ((name: string) => string);
|
|
2797
2797
|
//#endregion
|
|
2798
2798
|
//#region src/plugins/@angular/common/types.d.ts
|
|
2799
|
-
type UserConfig$
|
|
2799
|
+
type UserConfig$23 = Plugin.Name<'@angular/common'> & Plugin.Hooks & {
|
|
2800
2800
|
/**
|
|
2801
2801
|
* Should the exports from the generated files be re-exported in the index
|
|
2802
2802
|
* barrel file?
|
|
@@ -2927,10 +2927,10 @@ type Config$14 = Plugin.Name<'@angular/common'> & Plugin.Hooks & {
|
|
|
2927
2927
|
methodNameBuilder: (operation: IR.OperationObject) => string;
|
|
2928
2928
|
};
|
|
2929
2929
|
};
|
|
2930
|
-
type AngularCommonPlugin = DefinePlugin<UserConfig$
|
|
2930
|
+
type AngularCommonPlugin = DefinePlugin<UserConfig$23, Config$14>;
|
|
2931
2931
|
//#endregion
|
|
2932
2932
|
//#region src/plugins/@hey-api/client-axios/types.d.ts
|
|
2933
|
-
type UserConfig$
|
|
2933
|
+
type UserConfig$22 = Plugin.Name<'@hey-api/client-axios'> & Client.Config & {
|
|
2934
2934
|
/**
|
|
2935
2935
|
* Throw an error instead of returning it in the response?
|
|
2936
2936
|
*
|
|
@@ -2938,10 +2938,10 @@ type UserConfig$21 = Plugin.Name<'@hey-api/client-axios'> & Client.Config & {
|
|
|
2938
2938
|
*/
|
|
2939
2939
|
throwOnError?: boolean;
|
|
2940
2940
|
};
|
|
2941
|
-
type HeyApiClientAxiosPlugin = DefinePlugin<UserConfig$
|
|
2941
|
+
type HeyApiClientAxiosPlugin = DefinePlugin<UserConfig$22, UserConfig$22>;
|
|
2942
2942
|
//#endregion
|
|
2943
2943
|
//#region src/plugins/@hey-api/client-fetch/types.d.ts
|
|
2944
|
-
type UserConfig$
|
|
2944
|
+
type UserConfig$21 = Plugin.Name<'@hey-api/client-fetch'> & Client.Config & {
|
|
2945
2945
|
/**
|
|
2946
2946
|
* Throw an error instead of returning it in the response?
|
|
2947
2947
|
*
|
|
@@ -2949,10 +2949,10 @@ type UserConfig$20 = Plugin.Name<'@hey-api/client-fetch'> & Client.Config & {
|
|
|
2949
2949
|
*/
|
|
2950
2950
|
throwOnError?: boolean;
|
|
2951
2951
|
};
|
|
2952
|
-
type HeyApiClientFetchPlugin = DefinePlugin<UserConfig$
|
|
2952
|
+
type HeyApiClientFetchPlugin = DefinePlugin<UserConfig$21, UserConfig$21>;
|
|
2953
2953
|
//#endregion
|
|
2954
2954
|
//#region src/plugins/@hey-api/client-next/types.d.ts
|
|
2955
|
-
type UserConfig$
|
|
2955
|
+
type UserConfig$20 = Plugin.Name<'@hey-api/client-next'> & Client.Config & {
|
|
2956
2956
|
/**
|
|
2957
2957
|
* Throw an error instead of returning it in the response?
|
|
2958
2958
|
*
|
|
@@ -2960,14 +2960,14 @@ type UserConfig$19 = Plugin.Name<'@hey-api/client-next'> & Client.Config & {
|
|
|
2960
2960
|
*/
|
|
2961
2961
|
throwOnError?: boolean;
|
|
2962
2962
|
};
|
|
2963
|
-
type HeyApiClientNextPlugin = DefinePlugin<UserConfig$
|
|
2963
|
+
type HeyApiClientNextPlugin = DefinePlugin<UserConfig$20, UserConfig$20>;
|
|
2964
2964
|
//#endregion
|
|
2965
2965
|
//#region src/plugins/@hey-api/client-nuxt/types.d.ts
|
|
2966
|
-
type UserConfig$
|
|
2967
|
-
type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig$
|
|
2966
|
+
type UserConfig$19 = Plugin.Name<'@hey-api/client-nuxt'> & Client.Config;
|
|
2967
|
+
type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig$19, UserConfig$19>;
|
|
2968
2968
|
//#endregion
|
|
2969
2969
|
//#region src/plugins/@hey-api/client-ofetch/types.d.ts
|
|
2970
|
-
type UserConfig$
|
|
2970
|
+
type UserConfig$18 = Plugin.Name<'@hey-api/client-ofetch'> & Client.Config & {
|
|
2971
2971
|
/**
|
|
2972
2972
|
* Throw an error instead of returning it in the response?
|
|
2973
2973
|
*
|
|
@@ -2975,7 +2975,7 @@ type UserConfig$17 = Plugin.Name<'@hey-api/client-ofetch'> & Client.Config & {
|
|
|
2975
2975
|
*/
|
|
2976
2976
|
throwOnError?: boolean;
|
|
2977
2977
|
};
|
|
2978
|
-
type HeyApiClientOfetchPlugin = DefinePlugin<UserConfig$
|
|
2978
|
+
type HeyApiClientOfetchPlugin = DefinePlugin<UserConfig$18, UserConfig$18>;
|
|
2979
2979
|
//#endregion
|
|
2980
2980
|
//#region src/plugins/@hey-api/client-core/types.d.ts
|
|
2981
2981
|
interface PluginHandler {
|
|
@@ -3045,7 +3045,7 @@ declare namespace Client {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
//#endregion
|
|
3047
3047
|
//#region src/plugins/@hey-api/client-angular/types.d.ts
|
|
3048
|
-
type UserConfig$
|
|
3048
|
+
type UserConfig$17 = Plugin.Name<'@hey-api/client-angular'> & Client.Config & {
|
|
3049
3049
|
/**
|
|
3050
3050
|
* Throw an error instead of returning it in the response?
|
|
3051
3051
|
*
|
|
@@ -3053,7 +3053,18 @@ type UserConfig$16 = Plugin.Name<'@hey-api/client-angular'> & Client.Config & {
|
|
|
3053
3053
|
*/
|
|
3054
3054
|
throwOnError?: boolean;
|
|
3055
3055
|
};
|
|
3056
|
-
type HeyApiClientAngularPlugin = DefinePlugin<UserConfig$
|
|
3056
|
+
type HeyApiClientAngularPlugin = DefinePlugin<UserConfig$17, UserConfig$17>;
|
|
3057
|
+
//#endregion
|
|
3058
|
+
//#region src/plugins/@hey-api/client-ky/types.d.ts
|
|
3059
|
+
type UserConfig$16 = Plugin.Name<'@hey-api/client-ky'> & Client.Config & {
|
|
3060
|
+
/**
|
|
3061
|
+
* Throw an error instead of returning it in the response?
|
|
3062
|
+
*
|
|
3063
|
+
* @default false
|
|
3064
|
+
*/
|
|
3065
|
+
throwOnError?: boolean;
|
|
3066
|
+
};
|
|
3067
|
+
type HeyApiClientKyPlugin = DefinePlugin<UserConfig$16, UserConfig$16>;
|
|
3057
3068
|
//#endregion
|
|
3058
3069
|
//#region src/openApi/2.0.x/types/json-schema-draft-4.d.ts
|
|
3059
3070
|
interface JsonSchemaDraft4 extends EnumExtensions {
|
|
@@ -9919,6 +9930,31 @@ type Config$5 = Plugin.Name<'@tanstack/vue-query'> & Plugin.Hooks & {
|
|
|
9919
9930
|
};
|
|
9920
9931
|
type TanStackVueQueryPlugin = DefinePlugin<UserConfig$6, Config$5>;
|
|
9921
9932
|
//#endregion
|
|
9933
|
+
//#region src/ts-dsl/base.d.ts
|
|
9934
|
+
type MaybeArray$1<T> = T | ReadonlyArray<T>;
|
|
9935
|
+
type WithStatement<T = ts.Expression> = T | ts.Statement;
|
|
9936
|
+
type WithString<T = ts.Expression> = T | string;
|
|
9937
|
+
interface ITsDsl<T extends ts.Node = ts.Node> {
|
|
9938
|
+
$render(): T;
|
|
9939
|
+
}
|
|
9940
|
+
declare abstract class TsDsl<T extends ts.Node = ts.Node> implements ITsDsl<T> {
|
|
9941
|
+
abstract $render(): T;
|
|
9942
|
+
protected $expr<T>(expr: WithString<T>): T;
|
|
9943
|
+
/** Conditionally applies a callback to this builder. */
|
|
9944
|
+
$if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: (self: T, v: Exclude<V$1, false | null | undefined>) => R | void, ifFalse?: (self: T, v: Extract<V$1, false | null | undefined>) => R | void): R | T;
|
|
9945
|
+
$if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: (v: Exclude<V$1, false | null | undefined>) => R | void, ifFalse?: (v: Extract<V$1, false | null | undefined>) => R | void): R | T;
|
|
9946
|
+
$if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
|
|
9947
|
+
protected $node<I>(input: I): NodeOfMaybe<I>;
|
|
9948
|
+
protected $stmt(input: MaybeArray$1<MaybeTsDsl<WithString<WithStatement>>>): ReadonlyArray<ts.Statement>;
|
|
9949
|
+
protected $type<I>(input: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
|
|
9950
|
+
private _render;
|
|
9951
|
+
}
|
|
9952
|
+
type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<I>> | undefined : NodeOf<I>;
|
|
9953
|
+
type NodeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<U extends TsDsl<infer N> ? N : U> : I extends string ? ts.Expression : I extends boolean ? ts.Expression : I extends TsDsl<infer N> ? N : I extends ts.Node ? I : never;
|
|
9954
|
+
type MaybeTsDsl<T> = string extends T ? Exclude<T, string> extends ts.Node ? string | Exclude<T, string> | TsDsl<Exclude<T, string>> : string : T extends TsDsl<any> ? T : T extends ts.Node ? T | TsDsl<T> : never;
|
|
9955
|
+
type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<I>> | undefined : TypeOf<I>;
|
|
9956
|
+
type TypeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<TypeOf<U>> : I extends string ? ts.TypeNode : I extends boolean ? ts.LiteralTypeNode : I extends TsDsl<infer N> ? N : I extends ts.TypeNode ? I : never;
|
|
9957
|
+
//#endregion
|
|
9922
9958
|
//#region src/plugins/arktype/shared/types.d.ts
|
|
9923
9959
|
type ValidatorArgs$2 = {
|
|
9924
9960
|
operation: IR$1.OperationObject;
|
|
@@ -9927,8 +9963,8 @@ type ValidatorArgs$2 = {
|
|
|
9927
9963
|
//#endregion
|
|
9928
9964
|
//#region src/plugins/arktype/api.d.ts
|
|
9929
9965
|
type IApi$2 = {
|
|
9930
|
-
createRequestValidator: (args: ValidatorArgs$2) =>
|
|
9931
|
-
createResponseValidator: (args: ValidatorArgs$2) =>
|
|
9966
|
+
createRequestValidator: (args: ValidatorArgs$2) => TsDsl | undefined;
|
|
9967
|
+
createResponseValidator: (args: ValidatorArgs$2) => TsDsl | undefined;
|
|
9932
9968
|
};
|
|
9933
9969
|
//#endregion
|
|
9934
9970
|
//#region src/plugins/arktype/types.d.ts
|
|
@@ -11183,8 +11219,8 @@ type ValidatorArgs$1 = {
|
|
|
11183
11219
|
//#endregion
|
|
11184
11220
|
//#region src/plugins/valibot/api.d.ts
|
|
11185
11221
|
type IApi$1 = {
|
|
11186
|
-
createRequestValidator: (args: ValidatorArgs$1) =>
|
|
11187
|
-
createResponseValidator: (args: ValidatorArgs$1) =>
|
|
11222
|
+
createRequestValidator: (args: ValidatorArgs$1) => TsDsl | undefined;
|
|
11223
|
+
createResponseValidator: (args: ValidatorArgs$1) => TsDsl | undefined;
|
|
11188
11224
|
};
|
|
11189
11225
|
//#endregion
|
|
11190
11226
|
//#region src/plugins/valibot/types.d.ts
|
|
@@ -11492,8 +11528,8 @@ type ValidatorArgs = {
|
|
|
11492
11528
|
//#endregion
|
|
11493
11529
|
//#region src/plugins/zod/api.d.ts
|
|
11494
11530
|
type IApi = {
|
|
11495
|
-
createRequestValidator: (args: ValidatorArgs) =>
|
|
11496
|
-
createResponseValidator: (args: ValidatorArgs) =>
|
|
11531
|
+
createRequestValidator: (args: ValidatorArgs) => TsDsl | undefined;
|
|
11532
|
+
createResponseValidator: (args: ValidatorArgs) => TsDsl | undefined;
|
|
11497
11533
|
};
|
|
11498
11534
|
//#endregion
|
|
11499
11535
|
//#region src/plugins/zod/types.d.ts
|
|
@@ -12210,6 +12246,7 @@ interface PluginConfigMap {
|
|
|
12210
12246
|
'@hey-api/client-angular': HeyApiClientAngularPlugin['Types'];
|
|
12211
12247
|
'@hey-api/client-axios': HeyApiClientAxiosPlugin['Types'];
|
|
12212
12248
|
'@hey-api/client-fetch': HeyApiClientFetchPlugin['Types'];
|
|
12249
|
+
'@hey-api/client-ky': HeyApiClientKyPlugin['Types'];
|
|
12213
12250
|
'@hey-api/client-next': HeyApiClientNextPlugin['Types'];
|
|
12214
12251
|
'@hey-api/client-nuxt': HeyApiClientNuxtPlugin['Types'];
|
|
12215
12252
|
'@hey-api/client-ofetch': HeyApiClientOfetchPlugin['Types'];
|
|
@@ -12683,7 +12720,7 @@ type Hooks = {
|
|
|
12683
12720
|
};
|
|
12684
12721
|
//#endregion
|
|
12685
12722
|
//#region src/plugins/types.d.ts
|
|
12686
|
-
type PluginClientNames = '@hey-api/client-angular' | '@hey-api/client-axios' | '@hey-api/client-fetch' | '@hey-api/client-next' | '@hey-api/client-nuxt' | '@hey-api/client-ofetch';
|
|
12723
|
+
type PluginClientNames = '@hey-api/client-angular' | '@hey-api/client-axios' | '@hey-api/client-fetch' | '@hey-api/client-ky' | '@hey-api/client-next' | '@hey-api/client-nuxt' | '@hey-api/client-ofetch';
|
|
12687
12724
|
type PluginValidatorNames = 'arktype' | 'valibot' | 'zod';
|
|
12688
12725
|
type PluginNames = PluginClientNames | '@angular/common' | '@hey-api/schemas' | '@hey-api/sdk' | '@hey-api/transformers' | '@hey-api/typescript' | '@pinia/colada' | '@tanstack/angular-query-experimental' | '@tanstack/react-query' | '@tanstack/solid-query' | '@tanstack/svelte-query' | '@tanstack/vue-query' | 'fastify' | 'swr' | PluginValidatorNames;
|
|
12689
12726
|
type AnyPluginName = PluginNames | (string & {});
|
|
@@ -13820,4 +13857,4 @@ type Config = Omit<Required<UserConfig>, 'input' | 'logs' | 'output' | 'parser'
|
|
|
13820
13857
|
};
|
|
13821
13858
|
//#endregion
|
|
13822
13859
|
export { MaybeArray as S, Client as _, Plugin as a, IR$1 as b, OpenApiOperationObject as c, OpenApiResponseObject as d, OpenApiSchemaObject as f, ExpressionTransformer as g, TypeTransformer as h, DefinePlugin as i, OpenApiParameterObject as l, Logger as m, UserConfig as n, OpenApi as o, Context as p, Input as r, OpenApiMetaObject as s, Config as t, OpenApiRequestBodyObject as u, PluginHandler as v, LazyOrAsync as x, StringCase as y };
|
|
13823
|
-
//# sourceMappingURL=config-
|
|
13860
|
+
//# sourceMappingURL=config-CQeoZYf_.d.cts.map
|