@hey-api/openapi-ts 0.90.9 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts DELETED
@@ -1,990 +0,0 @@
1
-
2
- import { A as CallArgs, C as keywords, D as ExampleOptions, E as TypeTsDsl, M as OperationStrategy, N as Casing, O as TsDslContext, P as IR, S as regexp, T as TsDsl, _ as PluginHandler, a as Plugin, b as reserved, c as OpenApiOperationObject, d as OpenApiResponseObject, f as OpenApiSchemaObject, g as Client$2, h as ExpressionTransformer, i as DefinePlugin, j as OperationPath, k as ctx, l as OpenApiParameterObject, m as TypeTransformer, n as UserConfig, o as OpenApi, p as Context, s as OpenApiMetaObject, u as OpenApiRequestBodyObject, v as $, w as MaybeTsDsl, x as TypeScriptRenderer, y as DollarTsDsl } from "./types-WLqvV8HC.cjs";
3
- import { Logger } from "@hey-api/codegen-core";
4
- import { LazyOrAsync, MaybeArray } from "@hey-api/types";
5
- import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
6
- import { Injector } from "@angular/core";
7
- import { AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosStatic, CreateAxiosDefaults } from "axios";
8
- import { AsyncDataOptions, UseFetchOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from "nuxt/app";
9
- import { Ref as Ref$1 } from "vue";
10
- import { FetchOptions, ResponseType, ofetch } from "ofetch";
11
-
12
- //#region src/plugins/@hey-api/client-core/bundle/auth.d.ts
13
- type AuthToken = string | undefined;
14
- interface Auth {
15
- /**
16
- * Which part of the request do we use to send the auth?
17
- *
18
- * @default 'header'
19
- */
20
- in?: 'header' | 'query' | 'cookie';
21
- /**
22
- * Header or query parameter name.
23
- *
24
- * @default 'Authorization'
25
- */
26
- name?: string;
27
- scheme?: 'basic' | 'bearer';
28
- type: 'apiKey' | 'http';
29
- }
30
- //#endregion
31
- //#region src/plugins/@hey-api/client-core/bundle/pathSerializer.d.ts
32
- interface SerializerOptions<T> {
33
- /**
34
- * @default true
35
- */
36
- explode: boolean;
37
- style: T;
38
- }
39
- type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
40
- type ObjectStyle = 'form' | 'deepObject';
41
- //#endregion
42
- //#region src/plugins/@hey-api/client-core/bundle/bodySerializer.d.ts
43
- type QuerySerializer$1 = (query: Record<string, unknown>) => string;
44
- type BodySerializer = (body: any) => any;
45
- type QuerySerializerOptionsObject = {
46
- allowReserved?: boolean;
47
- array?: Partial<SerializerOptions<ArrayStyle>>;
48
- object?: Partial<SerializerOptions<ObjectStyle>>;
49
- };
50
- type QuerySerializerOptions = QuerySerializerOptionsObject & {
51
- /**
52
- * Per-parameter serialization overrides. When provided, these settings
53
- * override the global array/object settings for specific parameter names.
54
- */
55
- parameters?: Record<string, QuerySerializerOptionsObject>;
56
- };
57
- //#endregion
58
- //#region src/plugins/@hey-api/client-core/bundle/types.d.ts
59
- type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
60
- type Client$7<RequestFn$6 = never, Config$7 = unknown, MethodFn$6 = never, BuildUrlFn$6 = never, SseFn$6 = never> = {
61
- /**
62
- * Returns the final request URL.
63
- */
64
- buildUrl: BuildUrlFn$6;
65
- getConfig: () => Config$7;
66
- request: RequestFn$6;
67
- setConfig: (config: Config$7) => Config$7;
68
- } & { [K in HttpMethod]: MethodFn$6 } & ([SseFn$6] extends [never] ? {
69
- sse?: never;
70
- } : {
71
- sse: { [K in HttpMethod]: SseFn$6 };
72
- });
73
- interface Config$6 {
74
- /**
75
- * Auth token or a function returning auth token. The resolved value will be
76
- * added to the request payload as defined by its `security` array.
77
- */
78
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
79
- /**
80
- * A function for serializing request body parameter. By default,
81
- * {@link JSON.stringify()} will be used.
82
- */
83
- bodySerializer?: BodySerializer | null;
84
- /**
85
- * An object containing any HTTP headers that you want to pre-populate your
86
- * `Headers` object with.
87
- *
88
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
89
- */
90
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
91
- /**
92
- * The request method.
93
- *
94
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
95
- */
96
- method?: Uppercase<HttpMethod>;
97
- /**
98
- * A function for serializing request query parameters. By default, arrays
99
- * will be exploded in form style, objects will be exploded in deepObject
100
- * style, and reserved characters are percent-encoded.
101
- *
102
- * This method will have no effect if the native `paramsSerializer()` Axios
103
- * API function is used.
104
- *
105
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
106
- */
107
- querySerializer?: QuerySerializer$1 | QuerySerializerOptions;
108
- /**
109
- * A function validating request data. This is useful if you want to ensure
110
- * the request conforms to the desired shape, so it can be safely sent to
111
- * the server.
112
- */
113
- requestValidator?: (data: unknown) => Promise<unknown>;
114
- /**
115
- * A function transforming response data before it's returned. This is useful
116
- * for post-processing data, e.g. converting ISO strings into Date objects.
117
- */
118
- responseTransformer?: (data: unknown) => Promise<unknown>;
119
- /**
120
- * A function validating response data. This is useful if you want to ensure
121
- * the response conforms to the desired shape, so it can be safely passed to
122
- * the transformers and returned to the user.
123
- */
124
- responseValidator?: (data: unknown) => Promise<unknown>;
125
- }
126
- //#endregion
127
- //#region src/plugins/@hey-api/client-core/bundle/serverSentEvents.d.ts
128
- type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$6, 'method' | 'responseTransformer' | 'responseValidator'> & {
129
- /**
130
- * Fetch API implementation. You can use this option to provide a custom
131
- * fetch instance.
132
- *
133
- * @default globalThis.fetch
134
- */
135
- fetch?: typeof fetch;
136
- /**
137
- * Implementing clients can call request interceptors inside this hook.
138
- */
139
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
140
- /**
141
- * Callback invoked when a network or parsing error occurs during streaming.
142
- *
143
- * This option applies only if the endpoint returns a stream of events.
144
- *
145
- * @param error The error that occurred.
146
- */
147
- onSseError?: (error: unknown) => void;
148
- /**
149
- * Callback invoked when an event is streamed from the server.
150
- *
151
- * This option applies only if the endpoint returns a stream of events.
152
- *
153
- * @param event Event streamed from the server.
154
- * @returns Nothing (void).
155
- */
156
- onSseEvent?: (event: StreamEvent<TData>) => void;
157
- serializedBody?: RequestInit['body'];
158
- /**
159
- * Default retry delay in milliseconds.
160
- *
161
- * This option applies only if the endpoint returns a stream of events.
162
- *
163
- * @default 3000
164
- */
165
- sseDefaultRetryDelay?: number;
166
- /**
167
- * Maximum number of retry attempts before giving up.
168
- */
169
- sseMaxRetryAttempts?: number;
170
- /**
171
- * Maximum retry delay in milliseconds.
172
- *
173
- * Applies only when exponential backoff is used.
174
- *
175
- * This option applies only if the endpoint returns a stream of events.
176
- *
177
- * @default 30000
178
- */
179
- sseMaxRetryDelay?: number;
180
- /**
181
- * Optional sleep function for retry backoff.
182
- *
183
- * Defaults to using `setTimeout`.
184
- */
185
- sseSleepFn?: (ms: number) => Promise<void>;
186
- url: string;
187
- };
188
- interface StreamEvent<TData = unknown> {
189
- data: TData;
190
- event?: string;
191
- id?: string;
192
- retry?: number;
193
- }
194
- type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
195
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
196
- };
197
- //#endregion
198
- //#region src/plugins/@hey-api/client-angular/bundle/utils.d.ts
199
- type ErrInterceptor$3<Err, Res, Req, Options$6> = (error: Err, response: Res, request: Req, options: Options$6) => Err | Promise<Err>;
200
- type ReqInterceptor$3<Req, Options$6> = (request: Req, options: Options$6) => Req | Promise<Req>;
201
- type ResInterceptor$3<Res, Req, Options$6> = (response: Res, request: Req, options: Options$6) => Res | Promise<Res>;
202
- declare class Interceptors$3<Interceptor> {
203
- fns: Array<Interceptor | null>;
204
- clear(): void;
205
- eject(id: number | Interceptor): void;
206
- exists(id: number | Interceptor): boolean;
207
- getInterceptorIndex(id: number | Interceptor): number;
208
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
209
- use(fn: Interceptor): number;
210
- }
211
- interface Middleware$3<Req, Res, Err, Options$6> {
212
- error: Interceptors$3<ErrInterceptor$3<Err, Res, Req, Options$6>>;
213
- request: Interceptors$3<ReqInterceptor$3<Req, Options$6>>;
214
- response: Interceptors$3<ResInterceptor$3<Res, Req, Options$6>>;
215
- }
216
- //#endregion
217
- //#region src/plugins/@hey-api/client-angular/bundle/types.d.ts
218
- type ResponseStyle$2 = 'data' | 'fields';
219
- interface Config$5<T extends ClientOptions$5 = ClientOptions$5> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Omit<Config$6, 'headers'> {
220
- /**
221
- * Base URL for all requests made by this client.
222
- */
223
- baseUrl?: T['baseUrl'];
224
- /**
225
- * An object containing any HTTP headers that you want to pre-populate your
226
- * `HttpHeaders` object with.
227
- *
228
- * {@link https://angular.dev/api/common/http/HttpHeaders#constructor See more}
229
- */
230
- headers?: HttpHeaders | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
231
- /**
232
- * The HTTP client to use for making requests.
233
- */
234
- httpClient?: HttpClient;
235
- /**
236
- * Should we return only data or multiple fields (data, error, response, etc.)?
237
- *
238
- * @default 'fields'
239
- */
240
- responseStyle?: ResponseStyle$2;
241
- /**
242
- * Throw an error instead of returning it in the response?
243
- *
244
- * @default false
245
- */
246
- throwOnError?: T['throwOnError'];
247
- }
248
- interface RequestOptions$5<TData = unknown, TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$5<{
249
- responseStyle: TResponseStyle;
250
- throwOnError: ThrowOnError;
251
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
252
- /**
253
- * Any body that you want to add to your request.
254
- *
255
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
256
- */
257
- body?: unknown;
258
- /**
259
- * Optional custom injector for dependency resolution if you don't implicitly or explicitly provide one.
260
- */
261
- injector?: Injector;
262
- path?: Record<string, unknown>;
263
- query?: Record<string, unknown>;
264
- /**
265
- * Security mechanism(s) to use for the request.
266
- */
267
- security?: ReadonlyArray<Auth>;
268
- url: Url;
269
- }
270
- interface ResolvedRequestOptions$3<TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$5<unknown, TResponseStyle, ThrowOnError, Url> {
271
- serializedBody?: string;
272
- }
273
- type RequestResult$5<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle$2 = 'fields'> = Promise<ThrowOnError extends true ? TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
274
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
275
- request: HttpRequest<unknown>;
276
- response: HttpResponse<TData>;
277
- } : TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : {
278
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
279
- error: undefined;
280
- request: HttpRequest<unknown>;
281
- response: HttpResponse<TData>;
282
- } | {
283
- data: undefined;
284
- error: TError[keyof TError];
285
- request: HttpRequest<unknown>;
286
- response: HttpErrorResponse & {
287
- error: TError[keyof TError] | null;
288
- };
289
- }>;
290
- interface ClientOptions$5 {
291
- baseUrl?: string;
292
- responseStyle?: ResponseStyle$2;
293
- throwOnError?: boolean;
294
- }
295
- type MethodFn$5 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: Omit<RequestOptions$5<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult$5<TData, TError, ThrowOnError, TResponseStyle>;
296
- type SseFn$5 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: Omit<RequestOptions$5<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
297
- type RequestFn$5 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: Omit<RequestOptions$5<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$5<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult$5<TData, TError, ThrowOnError, TResponseStyle>;
298
- type RequestOptionsFn = <ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: RequestOptions$5<unknown, TResponseStyle, ThrowOnError>) => HttpRequest<unknown>;
299
- type BuildUrlFn$5 = <TData extends {
300
- body?: unknown;
301
- path?: Record<string, unknown>;
302
- query?: Record<string, unknown>;
303
- url: string;
304
- }>(options: TData & Options$5<TData>) => string;
305
- type Client = Client$7<RequestFn$5, Config$5, MethodFn$5, BuildUrlFn$5, SseFn$5> & {
306
- interceptors: Middleware$3<HttpRequest<unknown>, HttpResponse<unknown>, unknown, ResolvedRequestOptions$3>;
307
- requestOptions: RequestOptionsFn;
308
- };
309
- interface TDataShape$5 {
310
- body?: unknown;
311
- headers?: unknown;
312
- path?: unknown;
313
- query?: unknown;
314
- url: string;
315
- }
316
- type OmitKeys$5<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
317
- type Options$5<TData extends TDataShape$5 = TDataShape$5, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle$2 = 'fields'> = OmitKeys$5<RequestOptions$5<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
318
- //#endregion
319
- //#region src/plugins/@hey-api/client-axios/bundle/types.d.ts
320
- interface Config$4<T extends ClientOptions$4 = ClientOptions$4> extends Omit<CreateAxiosDefaults, 'auth' | 'baseURL' | 'headers' | 'method'>, Config$6 {
321
- /**
322
- * Axios implementation. You can use this option to provide either an
323
- * `AxiosStatic` or an `AxiosInstance`.
324
- *
325
- * @default axios
326
- */
327
- axios?: AxiosStatic | AxiosInstance;
328
- /**
329
- * Base URL for all requests made by this client.
330
- */
331
- baseURL?: T['baseURL'];
332
- /**
333
- * An object containing any HTTP headers that you want to pre-populate your
334
- * `Headers` object with.
335
- *
336
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
337
- */
338
- headers?: AxiosRequestHeaders | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
339
- /**
340
- * Throw an error instead of returning it in the response?
341
- *
342
- * @default false
343
- */
344
- throwOnError?: T['throwOnError'];
345
- }
346
- interface RequestOptions$4<TData = unknown, ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$4<{
347
- throwOnError: ThrowOnError;
348
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
349
- /**
350
- * Any body that you want to add to your request.
351
- *
352
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
353
- */
354
- body?: unknown;
355
- path?: Record<string, unknown>;
356
- query?: Record<string, unknown>;
357
- /**
358
- * Security mechanism(s) to use for the request.
359
- */
360
- security?: ReadonlyArray<Auth>;
361
- url: Url;
362
- }
363
- interface ClientOptions$4 {
364
- baseURL?: string;
365
- throwOnError?: boolean;
366
- }
367
- type RequestResult$4<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean> = ThrowOnError extends true ? Promise<AxiosResponse<TData extends Record<string, unknown> ? TData[keyof TData] : TData>> : Promise<(AxiosResponse<TData extends Record<string, unknown> ? TData[keyof TData] : TData> & {
368
- error: undefined;
369
- }) | (AxiosError<TError extends Record<string, unknown> ? TError[keyof TError] : TError> & {
370
- data: undefined;
371
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
372
- })>;
373
- type MethodFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => RequestResult$4<TData, TError, ThrowOnError>;
374
- type SseFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
375
- type RequestFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$4<TData, ThrowOnError>>, 'method'>) => RequestResult$4<TData, TError, ThrowOnError>;
376
- type BuildUrlFn$4 = <TData extends {
377
- body?: unknown;
378
- path?: Record<string, unknown>;
379
- query?: Record<string, unknown>;
380
- url: string;
381
- }>(options: TData & Options$4<TData>) => string;
382
- type Client$1 = Client$7<RequestFn$4, Config$4, MethodFn$4, BuildUrlFn$4, SseFn$4> & {
383
- instance: AxiosInstance;
384
- };
385
- interface TDataShape$4 {
386
- body?: unknown;
387
- headers?: unknown;
388
- path?: unknown;
389
- query?: unknown;
390
- url: string;
391
- }
392
- type OmitKeys$4<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
393
- type Options$4<TData extends TDataShape$4 = TDataShape$4, ThrowOnError extends boolean = boolean, TResponse = unknown> = OmitKeys$4<RequestOptions$4<TResponse, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
394
- //#endregion
395
- //#region src/plugins/@hey-api/client-fetch/bundle/utils.d.ts
396
- type ErrInterceptor$2<Err, Res, Req, Options$6> = (error: Err, response: Res, request: Req, options: Options$6) => Err | Promise<Err>;
397
- type ReqInterceptor$2<Req, Options$6> = (request: Req, options: Options$6) => Req | Promise<Req>;
398
- type ResInterceptor$2<Res, Req, Options$6> = (response: Res, request: Req, options: Options$6) => Res | Promise<Res>;
399
- declare class Interceptors$2<Interceptor> {
400
- fns: Array<Interceptor | null>;
401
- clear(): void;
402
- eject(id: number | Interceptor): void;
403
- exists(id: number | Interceptor): boolean;
404
- getInterceptorIndex(id: number | Interceptor): number;
405
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
406
- use(fn: Interceptor): number;
407
- }
408
- interface Middleware$2<Req, Res, Err, Options$6> {
409
- error: Interceptors$2<ErrInterceptor$2<Err, Res, Req, Options$6>>;
410
- request: Interceptors$2<ReqInterceptor$2<Req, Options$6>>;
411
- response: Interceptors$2<ResInterceptor$2<Res, Req, Options$6>>;
412
- }
413
- //#endregion
414
- //#region src/plugins/@hey-api/client-fetch/bundle/types.d.ts
415
- type ResponseStyle$1 = 'data' | 'fields';
416
- interface Config$3<T extends ClientOptions$3 = ClientOptions$3> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$6 {
417
- /**
418
- * Base URL for all requests made by this client.
419
- */
420
- baseUrl?: T['baseUrl'];
421
- /**
422
- * Fetch API implementation. You can use this option to provide a custom
423
- * fetch instance.
424
- *
425
- * @default globalThis.fetch
426
- */
427
- fetch?: typeof fetch;
428
- /**
429
- * Please don't use the Fetch client for Next.js applications. The `next`
430
- * options won't have any effect.
431
- *
432
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
433
- */
434
- next?: never;
435
- /**
436
- * Return the response data parsed in a specified format. By default, `auto`
437
- * will infer the appropriate method from the `Content-Type` response header.
438
- * You can override this behavior with any of the {@link Body} methods.
439
- * Select `stream` if you don't want to parse response data at all.
440
- *
441
- * @default 'auto'
442
- */
443
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
444
- /**
445
- * Should we return only data or multiple fields (data, error, response, etc.)?
446
- *
447
- * @default 'fields'
448
- */
449
- responseStyle?: ResponseStyle$1;
450
- /**
451
- * Throw an error instead of returning it in the response?
452
- *
453
- * @default false
454
- */
455
- throwOnError?: T['throwOnError'];
456
- }
457
- interface RequestOptions$3<TData = unknown, TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$3<{
458
- responseStyle: TResponseStyle;
459
- throwOnError: ThrowOnError;
460
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
461
- /**
462
- * Any body that you want to add to your request.
463
- *
464
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
465
- */
466
- body?: unknown;
467
- path?: Record<string, unknown>;
468
- query?: Record<string, unknown>;
469
- /**
470
- * Security mechanism(s) to use for the request.
471
- */
472
- security?: ReadonlyArray<Auth>;
473
- url: Url;
474
- }
475
- interface ResolvedRequestOptions$2<TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$3<unknown, TResponseStyle, ThrowOnError, Url> {
476
- serializedBody?: string;
477
- }
478
- type RequestResult$3<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle$1 = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
479
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
480
- request: Request;
481
- response: Response;
482
- }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
483
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
484
- error: undefined;
485
- } | {
486
- data: undefined;
487
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
488
- }) & {
489
- request: Request;
490
- response: Response;
491
- }>;
492
- interface ClientOptions$3 {
493
- baseUrl?: string;
494
- responseStyle?: ResponseStyle$1;
495
- throwOnError?: boolean;
496
- }
497
- type MethodFn$3 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$1 = 'fields'>(options: Omit<RequestOptions$3<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult$3<TData, TError, ThrowOnError, TResponseStyle>;
498
- type SseFn$3 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$1 = 'fields'>(options: Omit<RequestOptions$3<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
499
- type RequestFn$3 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$1 = 'fields'>(options: Omit<RequestOptions$3<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$3<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult$3<TData, TError, ThrowOnError, TResponseStyle>;
500
- type BuildUrlFn$3 = <TData extends {
501
- body?: unknown;
502
- path?: Record<string, unknown>;
503
- query?: Record<string, unknown>;
504
- url: string;
505
- }>(options: TData & Options$3<TData>) => string;
506
- type Client$3 = Client$7<RequestFn$3, Config$3, MethodFn$3, BuildUrlFn$3, SseFn$3> & {
507
- interceptors: Middleware$2<Request, Response, unknown, ResolvedRequestOptions$2>;
508
- };
509
- interface TDataShape$3 {
510
- body?: unknown;
511
- headers?: unknown;
512
- path?: unknown;
513
- query?: unknown;
514
- url: string;
515
- }
516
- type OmitKeys$3<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
517
- type Options$3<TData extends TDataShape$3 = TDataShape$3, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle$1 = 'fields'> = OmitKeys$3<RequestOptions$3<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
518
- //#endregion
519
- //#region src/plugins/@hey-api/client-next/bundle/utils.d.ts
520
- type ErrInterceptor$1<Err, Res, Options$6> = (error: Err, response: Res, options: Options$6) => Err | Promise<Err>;
521
- type ReqInterceptor$1<Options$6> = (options: Options$6) => void | Promise<void>;
522
- type ResInterceptor$1<Res, Options$6> = (response: Res, options: Options$6) => Res | Promise<Res>;
523
- declare class Interceptors$1<Interceptor> {
524
- fns: Array<Interceptor | null>;
525
- clear(): void;
526
- eject(id: number | Interceptor): void;
527
- exists(id: number | Interceptor): boolean;
528
- getInterceptorIndex(id: number | Interceptor): number;
529
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
530
- use(fn: Interceptor): number;
531
- }
532
- interface Middleware$1<Res, Err, Options$6> {
533
- error: Interceptors$1<ErrInterceptor$1<Err, Res, Options$6>>;
534
- request: Interceptors$1<ReqInterceptor$1<Options$6>>;
535
- response: Interceptors$1<ResInterceptor$1<Res, Options$6>>;
536
- }
537
- //#endregion
538
- //#region src/plugins/@hey-api/client-next/bundle/types.d.ts
539
- interface Config$2<T extends ClientOptions$2 = ClientOptions$2> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$6 {
540
- /**
541
- * Base URL for all requests made by this client.
542
- */
543
- baseUrl?: T['baseUrl'];
544
- /**
545
- * Fetch API implementation. You can use this option to provide a custom
546
- * fetch instance.
547
- *
548
- * @default globalThis.fetch
549
- */
550
- fetch?: typeof fetch;
551
- /**
552
- * Return the response data parsed in a specified format. By default, `auto`
553
- * will infer the appropriate method from the `Content-Type` response header.
554
- * You can override this behavior with any of the {@link Body} methods.
555
- * Select `stream` if you don't want to parse response data at all.
556
- *
557
- * @default 'auto'
558
- */
559
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
560
- /**
561
- * Throw an error instead of returning it in the response?
562
- *
563
- * @default false
564
- */
565
- throwOnError?: T['throwOnError'];
566
- }
567
- interface RequestOptions$2<TData = unknown, ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$2<{
568
- throwOnError: ThrowOnError;
569
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
570
- /**
571
- * Any body that you want to add to your request.
572
- *
573
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
574
- */
575
- body?: unknown;
576
- path?: Record<string, unknown>;
577
- query?: Record<string, unknown>;
578
- /**
579
- * Security mechanism(s) to use for the request.
580
- */
581
- security?: ReadonlyArray<Auth>;
582
- url: Url;
583
- }
584
- interface ResolvedRequestOptions$1<ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$2<unknown, ThrowOnError, Url> {
585
- serializedBody?: string;
586
- }
587
- type RequestResult$2<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean> = ThrowOnError extends true ? Promise<{
588
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
589
- response: Response;
590
- }> : Promise<({
591
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
592
- error: undefined;
593
- } | {
594
- data: undefined;
595
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
596
- }) & {
597
- response: Response;
598
- }>;
599
- interface ClientOptions$2 {
600
- baseUrl?: string;
601
- throwOnError?: boolean;
602
- }
603
- type MethodFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => RequestResult$2<TData, TError, ThrowOnError>;
604
- type SseFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
605
- type RequestFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'> & Pick<Required<RequestOptions$2<TData, ThrowOnError>>, 'method'>) => RequestResult$2<TData, TError, ThrowOnError>;
606
- type BuildUrlFn$2 = <TData extends {
607
- body?: unknown;
608
- path?: Record<string, unknown>;
609
- query?: Record<string, unknown>;
610
- url: string;
611
- }>(options: TData & Options$2<TData>) => string;
612
- type Client$4 = Client$7<RequestFn$2, Config$2, MethodFn$2, BuildUrlFn$2, SseFn$2> & {
613
- interceptors: Middleware$1<Response, unknown, ResolvedRequestOptions$1>;
614
- };
615
- interface TDataShape$2 {
616
- body?: unknown;
617
- headers?: unknown;
618
- path?: unknown;
619
- query?: unknown;
620
- url: string;
621
- }
622
- type OmitKeys$2<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
623
- type Options$2<TData extends TDataShape$2 = TDataShape$2, ThrowOnError extends boolean = boolean, TResponse = unknown> = OmitKeys$2<RequestOptions$2<TResponse, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
624
- //#endregion
625
- //#region src/plugins/@hey-api/client-nuxt/bundle/types.d.ts
626
- type QuerySerializer = (query: Parameters<Client$5['buildUrl']>[0]['query']) => string;
627
- type WithRefs<TData> = { [K in keyof TData]: NonNullable<TData[K]> extends object ? WithRefs<NonNullable<TData[K]>> | Ref$1<NonNullable<TData[K]>> | Extract<TData[K], null> : NonNullable<TData[K]> | Ref$1<NonNullable<TData[K]>> | Extract<TData[K], null> };
628
- type KeysOf<T> = Array<T extends T ? (keyof T extends string ? keyof T : never) : never>;
629
- interface Config$1<T extends ClientOptions$1 = ClientOptions$1> extends Omit<FetchOptions$1<unknown>, 'baseURL' | 'body' | 'headers' | 'method' | 'query'>, WithRefs<Pick<FetchOptions$1<unknown>, 'query'>>, Omit<Config$6, 'querySerializer'> {
630
- /**
631
- * Base URL for all requests made by this client.
632
- */
633
- baseURL?: T['baseURL'];
634
- /**
635
- * A function for serializing request query parameters. By default, arrays
636
- * will be exploded in form style, objects will be exploded in deepObject
637
- * style, and reserved characters are percent-encoded.
638
- *
639
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
640
- */
641
- querySerializer?: QuerySerializer | QuerySerializerOptions;
642
- }
643
- interface RequestOptions$1<TComposable extends Composable = '$fetch', ResT = unknown, DefaultT = undefined, Url extends string = string> extends Config$1, WithRefs<{
644
- path?: FetchOptions$1<unknown>['query'];
645
- query?: FetchOptions$1<unknown>['query'];
646
- }>, Pick<ServerSentEventsOptions<ResT>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
647
- asyncDataOptions?: AsyncDataOptions<ResT, ResT, KeysOf<ResT>, DefaultT>;
648
- /**
649
- * Any body that you want to add to your request.
650
- *
651
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
652
- */
653
- body?: NonNullable<unknown> | Ref$1<NonNullable<unknown>> | null;
654
- composable?: TComposable;
655
- key?: string;
656
- rawBody?: NonNullable<unknown> | Ref$1<NonNullable<unknown>> | null;
657
- /**
658
- * Security mechanism(s) to use for the request.
659
- */
660
- security?: ReadonlyArray<Auth>;
661
- url: Url;
662
- }
663
- type RequestResult$1<TComposable extends Composable, ResT, TError> = TComposable extends '$fetch' ? ReturnType<typeof $fetch<ResT>> : TComposable extends 'useAsyncData' ? ReturnType<typeof useAsyncData<ResT | null, TError>> : TComposable extends 'useFetch' ? ReturnType<typeof useFetch<ResT | null, TError>> : TComposable extends 'useLazyAsyncData' ? ReturnType<typeof useLazyAsyncData<ResT | null, TError>> : TComposable extends 'useLazyFetch' ? ReturnType<typeof useLazyFetch<ResT | null, TError>> : never;
664
- interface ClientOptions$1 {
665
- baseURL?: string;
666
- }
667
- type MethodFn$1 = <TComposable extends Composable = '$fetch', ResT = unknown, TError = unknown, DefaultT = undefined>(options: Omit<RequestOptions$1<TComposable, ResT, DefaultT>, 'method'>) => RequestResult$1<TComposable, ResT, TError>;
668
- type SseFn$1 = <TComposable extends Composable = '$fetch', ResT = unknown, TError = unknown, DefaultT = undefined>(options: Omit<RequestOptions$1<TComposable, ResT, DefaultT>, 'method'>) => Promise<ServerSentEventsResult<RequestResult$1<TComposable, ResT, TError>>>;
669
- type RequestFn$1 = <TComposable extends Composable = '$fetch', ResT = unknown, TError = unknown, DefaultT = undefined>(options: Omit<RequestOptions$1<TComposable, ResT, DefaultT>, 'method'> & Pick<Required<RequestOptions$1<TComposable, ResT, DefaultT>>, 'method'>) => RequestResult$1<TComposable, ResT, TError>;
670
- /**
671
- * The `createClientConfig()` function will be called on client initialization
672
- * and the returned object will become the client's initial configuration.
673
- *
674
- * You may want to initialize your client this way instead of calling
675
- * `setConfig()`. This is useful for example if you're using Next.js
676
- * to ensure your client always has the correct values.
677
- */
678
-
679
- interface TDataShape$1 {
680
- body?: unknown;
681
- headers?: unknown;
682
- path?: FetchOptions$1<unknown>['query'];
683
- query?: FetchOptions$1<unknown>['query'];
684
- url: string;
685
- }
686
- type BuildUrlOptions<TData extends Omit<TDataShape$1, 'headers'> = Omit<TDataShape$1, 'headers'>> = Pick<WithRefs<TData>, 'path' | 'query'> & Pick<TData, 'url'> & Pick<Options$1<'$fetch', TData>, 'baseURL' | 'querySerializer'>;
687
- type BuildUrlFn$1 = <TData extends Omit<TDataShape$1, 'headers'>>(options: BuildUrlOptions<TData>) => string;
688
- type Client$5 = Client$7<RequestFn$1, Config$1, MethodFn$1, BuildUrlFn$1, SseFn$1>;
689
- type OmitKeys$1<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
690
- type Options$1<TComposable extends Composable = '$fetch', TData extends TDataShape$1 = TDataShape$1, ResT = unknown, DefaultT = undefined> = OmitKeys$1<RequestOptions$1<TComposable, ResT, DefaultT>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : WithRefs<Omit<TData, 'url'>>);
691
- type FetchOptions$1<TData> = Omit<UseFetchOptions<TData, TData>, keyof AsyncDataOptions<TData>>;
692
- type Composable = '$fetch' | 'useAsyncData' | 'useFetch' | 'useLazyAsyncData' | 'useLazyFetch';
693
- //#endregion
694
- //#region src/plugins/@hey-api/client-ofetch/bundle/utils.d.ts
695
- type ErrInterceptor<Err, Res, Req, Options$6> = (error: Err, response: Res, request: Req, options: Options$6) => Err | Promise<Err>;
696
- type ReqInterceptor<Req, Options$6> = (request: Req, options: Options$6) => Req | Promise<Req>;
697
- type ResInterceptor<Res, Req, Options$6> = (response: Res, request: Req, options: Options$6) => Res | Promise<Res>;
698
- declare class Interceptors<Interceptor> {
699
- fns: Array<Interceptor | null>;
700
- clear(): void;
701
- eject(id: number | Interceptor): void;
702
- exists(id: number | Interceptor): boolean;
703
- getInterceptorIndex(id: number | Interceptor): number;
704
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
705
- use(fn: Interceptor): number;
706
- }
707
- interface Middleware<Req, Res, Err, Options$6> {
708
- error: Interceptors<ErrInterceptor<Err, Res, Req, Options$6>>;
709
- request: Interceptors<ReqInterceptor<Req, Options$6>>;
710
- response: Interceptors<ResInterceptor<Res, Req, Options$6>>;
711
- }
712
- //#endregion
713
- //#region src/plugins/@hey-api/client-ofetch/bundle/types.d.ts
714
- type ResponseStyle = 'data' | 'fields';
715
- interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$6 {
716
- /**
717
- * HTTP(S) agent configuration (Node.js only). Passed through to ofetch.
718
- */
719
- agent?: FetchOptions['agent'];
720
- /**
721
- * Base URL for all requests made by this client.
722
- */
723
- baseUrl?: T['baseUrl'];
724
- /**
725
- * Node-only proxy/agent options.
726
- */
727
- dispatcher?: FetchOptions['dispatcher'];
728
- /**
729
- * Fetch API implementation. Used for SSE streaming. You can use this option
730
- * to provide a custom fetch instance.
731
- *
732
- * @default globalThis.fetch
733
- */
734
- fetch?: typeof fetch;
735
- /**
736
- * Controls the native ofetch behaviour that throws `FetchError` when
737
- * `response.ok === false`. We default to suppressing it to match the fetch
738
- * client semantics and let `throwOnError` drive the outcome.
739
- */
740
- ignoreResponseError?: FetchOptions['ignoreResponseError'];
741
- /**
742
- * Please don't use the Fetch client for Next.js applications. The `next`
743
- * options won't have any effect.
744
- *
745
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
746
- */
747
- next?: never;
748
- /**
749
- * Custom ofetch instance created via `ofetch.create()`. If provided, it will
750
- * be used for requests instead of the default `ofetch` export.
751
- */
752
- ofetch?: typeof ofetch;
753
- /**
754
- * ofetch hook called before a request is sent.
755
- */
756
- onRequest?: FetchOptions['onRequest'];
757
- /**
758
- * ofetch hook called when a request fails before receiving a response
759
- * (e.g., network errors or aborted requests).
760
- */
761
- onRequestError?: FetchOptions['onRequestError'];
762
- /**
763
- * ofetch hook called after a successful response is received and parsed.
764
- */
765
- onResponse?: FetchOptions['onResponse'];
766
- /**
767
- * ofetch hook called when the response indicates an error (non-ok status)
768
- * or when response parsing fails.
769
- */
770
- onResponseError?: FetchOptions['onResponseError'];
771
- /**
772
- * Return the response data parsed in a specified format. By default, `auto`
773
- * will infer the appropriate method from the `Content-Type` response header.
774
- * You can override this behavior with any of the {@link Body} methods.
775
- * Select `stream` if you don't want to parse response data at all.
776
- *
777
- * @default 'auto'
778
- */
779
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
780
- /** Custom response parser (ofetch). */
781
- parseResponse?: FetchOptions['parseResponse'];
782
- /**
783
- * Should we return only data or multiple fields (data, error, response, etc.)?
784
- *
785
- * @default 'fields'
786
- */
787
- responseStyle?: ResponseStyle;
788
- /**
789
- * ofetch responseType override. If provided, it will be passed directly to
790
- * ofetch and take precedence over `parseAs`.
791
- */
792
- responseType?: ResponseType;
793
- /**
794
- * Automatically retry failed requests.
795
- */
796
- retry?: FetchOptions['retry'];
797
- /**
798
- * Delay (in ms) between retry attempts.
799
- */
800
- retryDelay?: FetchOptions['retryDelay'];
801
- /**
802
- * HTTP status codes that should trigger a retry.
803
- */
804
- retryStatusCodes?: FetchOptions['retryStatusCodes'];
805
- /**
806
- * Throw an error instead of returning it in the response?
807
- *
808
- * @default false
809
- */
810
- throwOnError?: T['throwOnError'];
811
- /**
812
- * Abort the request after the given milliseconds.
813
- */
814
- timeout?: number;
815
- }
816
- interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
817
- responseStyle: TResponseStyle;
818
- throwOnError: ThrowOnError;
819
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
820
- /**
821
- * Any body that you want to add to your request.
822
- *
823
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
824
- */
825
- body?: unknown;
826
- path?: Record<string, unknown>;
827
- query?: Record<string, unknown>;
828
- /**
829
- * Security mechanism(s) to use for the request.
830
- */
831
- security?: ReadonlyArray<Auth>;
832
- url: Url;
833
- }
834
- interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
835
- serializedBody?: string;
836
- }
837
- type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
838
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
839
- request: Request;
840
- response: Response;
841
- }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
842
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
843
- error: undefined;
844
- } | {
845
- data: undefined;
846
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
847
- }) & {
848
- request: Request;
849
- response: Response;
850
- }>;
851
- interface ClientOptions {
852
- baseUrl?: string;
853
- responseStyle?: ResponseStyle;
854
- throwOnError?: boolean;
855
- }
856
- type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
857
- type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
858
- type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
859
- type BuildUrlFn = <TData extends {
860
- body?: unknown;
861
- path?: Record<string, unknown>;
862
- query?: Record<string, unknown>;
863
- url: string;
864
- }>(options: TData & Options<TData>) => string;
865
- type Client$6 = Client$7<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
866
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
867
- };
868
- interface TDataShape {
869
- body?: unknown;
870
- headers?: unknown;
871
- path?: unknown;
872
- query?: unknown;
873
- url: string;
874
- }
875
- type OmitKeys<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
876
- type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
877
- //#endregion
878
- //#region src/generate.d.ts
879
- /**
880
- * Generate a client from the provided configuration.
881
- *
882
- * @param userConfig User provided {@link UserConfig} configuration(s).
883
- */
884
- declare function createClient(userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: any): Promise<ReadonlyArray<Context>>;
885
- //#endregion
886
- //#region src/config/parser.d.ts
887
- declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
888
- //#endregion
889
- //#region src/config/plugins.d.ts
890
- /**
891
- * Default plugins used to generate artifacts if plugins aren't specified.
892
- */
893
- declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
894
- //#endregion
895
- //#region src/plugins/@hey-api/client-core/config.d.ts
896
- declare const clientDefaultConfig: {
897
- readonly baseUrl: true;
898
- readonly bundle: true;
899
- readonly exportFromIndex: false;
900
- };
901
- declare const clientDefaultMeta: {
902
- readonly dependencies: readonly ["@hey-api/typescript"];
903
- readonly tags: readonly ["client"];
904
- };
905
- //#endregion
906
- //#region src/plugins/@hey-api/client-core/plugin.d.ts
907
- declare const clientPluginHandler: ({
908
- plugin
909
- }: Parameters<PluginHandler>[0]) => void;
910
- //#endregion
911
- //#region src/plugins/shared/utils/config.d.ts
912
- declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<T["config"], "name">) => Omit<Plugin.Config<T>, "name"> & {
913
- /**
914
- * Cast name to `any` so it doesn't throw type error in `plugins` array.
915
- * We could allow any `string` as plugin `name` in the object syntax, but
916
- * that TypeScript trick would cause all string methods to appear as
917
- * suggested auto completions, which is undesirable.
918
- */
919
- name: any;
920
- };
921
- //#endregion
922
- //#region src/utils/exports.d.ts
923
- /**
924
- * Utilities shared across the package.
925
- */
926
- declare const utils: {
927
- /**
928
- * @deprecated use `toCase` instead
929
- */
930
- stringCase({
931
- case: casing,
932
- stripLeadingSeparators,
933
- value
934
- }: {
935
- readonly case: Casing | undefined;
936
- /**
937
- * If leading separators have a semantic meaning, we might not want to
938
- * remove them.
939
- */
940
- stripLeadingSeparators?: boolean;
941
- value: string;
942
- }): string;
943
- /**
944
- * Converts the given string to the specified casing.
945
- */
946
- toCase: (value: string, casing: Casing | undefined, options?: {
947
- stripLeadingSeparators?: boolean;
948
- }) => string;
949
- };
950
- //#endregion
951
- //#region src/index.d.ts
952
- declare module '@hey-api/codegen-core' {
953
- interface ProjectRenderMeta {
954
- /**
955
- * If specified, this will be the file extension used when importing
956
- * other modules. By default, we don't add a file extension and let the
957
- * runtime resolve it.
958
- *
959
- * @default null
960
- */
961
- importFileExtension?: (string & {}) | null;
962
- }
963
- interface SymbolMeta {
964
- category?: 'client' | 'external' | 'hook' | 'schema' | 'sdk' | 'transform' | 'type' | 'utility' | (string & {});
965
- /**
966
- * Path to the resource this symbol represents.
967
- */
968
- path?: ReadonlyArray<string | number>;
969
- /**
970
- * Name of the plugin that registered this symbol.
971
- */
972
- pluginName?: string;
973
- resource?: 'client' | 'definition' | 'operation' | 'webhook' | (string & {});
974
- resourceId?: string;
975
- role?: 'data' | 'error' | 'errors' | 'options' | 'response' | 'responses' | (string & {});
976
- /**
977
- * Tags associated with this symbol.
978
- */
979
- tags?: ReadonlyArray<string>;
980
- tool?: 'angular' | 'arktype' | 'fastify' | 'json-schema' | 'sdk' | 'typescript' | 'valibot' | 'zod' | (string & {});
981
- variant?: 'container' | (string & {});
982
- }
983
- }
984
- /**
985
- * Type helper for configuration object, returns {@link MaybeArray<UserConfig>} object(s)
986
- */
987
- declare function defineConfig<T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>): Promise<T>;
988
- //#endregion
989
- export { $, type Client as AngularClient, type Client$1 as AxiosClient, CallArgs, type Client$2 as Client, type DefinePlugin, DollarTsDsl, ExampleOptions, type ExpressionTransformer, type Client$3 as FetchClient, type IR, Logger, MaybeTsDsl, type Client$4 as NextClient, type Client$5 as NuxtClient, type Client$6 as OfetchClient, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, OperationPath, OperationStrategy, type Plugin, TsDsl, TsDslContext, TypeScriptRenderer, type TypeTransformer, TypeTsDsl, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, createClient, ctx, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, keywords, regexp, reserved, utils };
990
- //# sourceMappingURL=index.d.cts.map