@hey-api/openapi-ts 0.85.1 → 0.86.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/README.md +1 -1
- package/bin/index.cjs +3 -2
- package/dist/chunk-BJUc-MpE.js +1 -0
- package/dist/clients/axios/client.ts +17 -8
- package/dist/clients/nuxt/utils.ts +12 -4
- package/dist/getSpec-CZ8YOkGf.js +24 -0
- package/dist/getSpec-CZ8YOkGf.js.map +1 -0
- package/dist/getSpec-_5jk-wUD.cjs +24 -0
- package/dist/getSpec-_5jk-wUD.cjs.map +1 -0
- package/dist/index.cjs +180 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +822 -1468
- package/dist/index.d.ts +822 -1468
- package/dist/index.js +172 -183
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +1 -25
- package/dist/internal.d.cts +36 -41
- package/dist/internal.d.ts +36 -41
- package/dist/internal.js +1 -2
- package/dist/{types.d-DIu3K5QP.d.cts → types-BesMf-H-.d.ts} +7950 -6898
- package/dist/{types.d-DIu3K5QP.d.ts → types-CFN6tBkJ.d.cts} +7950 -6898
- package/package.json +8 -8
- package/dist/chunk-SA4IKOSG.js +0 -47
- package/dist/chunk-SA4IKOSG.js.map +0 -1
- package/dist/internal.cjs.map +0 -1
- package/dist/internal.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,1567 +1,920 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { FetchOptions as FetchOptions$1, ofetch, ResponseType } from 'ofetch';
|
|
9
|
-
import * as typescript from 'typescript';
|
|
10
|
-
import typescript__default from 'typescript';
|
|
11
|
-
import 'semver';
|
|
12
|
-
import '@hey-api/codegen-core';
|
|
13
|
-
import 'node:fs';
|
|
14
|
-
|
|
15
|
-
declare module '@hey-api/codegen-core' {
|
|
16
|
-
interface ProjectRenderMeta {
|
|
17
|
-
/**
|
|
18
|
-
* If specified, this will be the file extension used when importing
|
|
19
|
-
* other modules. By default, we don't add a file extension and let the
|
|
20
|
-
* runtime resolve it.
|
|
21
|
-
*
|
|
22
|
-
* @default null
|
|
23
|
-
*/
|
|
24
|
-
importFileExtension?: (string & {}) | null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface SymbolMeta {
|
|
28
|
-
/**
|
|
29
|
-
* Name of the plugin that registered this symbol.
|
|
30
|
-
*/
|
|
31
|
-
pluginName?: string;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type AccessLevel = 'private' | 'protected' | 'public';
|
|
36
|
-
type FunctionParameter = {
|
|
37
|
-
accessLevel?: AccessLevel;
|
|
38
|
-
default?: any;
|
|
39
|
-
isReadOnly?: boolean;
|
|
40
|
-
isRequired?: boolean;
|
|
41
|
-
name: string;
|
|
42
|
-
type?: any | typescript__default.TypeNode;
|
|
43
|
-
} | {
|
|
44
|
-
destructure: ReadonlyArray<FunctionParameter>;
|
|
45
|
-
type?: any | typescript__default.TypeNode;
|
|
46
|
-
};
|
|
47
|
-
interface FunctionTypeParameter {
|
|
48
|
-
default?: any;
|
|
49
|
-
extends?: string | typescript__default.TypeNode;
|
|
50
|
-
name: string | typescript__default.Identifier;
|
|
51
|
-
}
|
|
52
|
-
type SyntaxKindKeyword = 'any' | 'async' | 'boolean' | 'export' | 'never' | 'number' | 'private' | 'protected' | 'public' | 'readonly' | 'static' | 'string' | 'undefined' | 'unknown' | 'void';
|
|
53
|
-
type ObjectValue = {
|
|
54
|
-
assertion?: 'any' | typescript__default.TypeNode;
|
|
55
|
-
comments?: Comments;
|
|
56
|
-
spread: string;
|
|
57
|
-
} | {
|
|
58
|
-
comments?: Comments;
|
|
59
|
-
isValueAccess?: boolean;
|
|
60
|
-
key: string;
|
|
61
|
-
shorthand?: boolean;
|
|
62
|
-
value: any;
|
|
63
|
-
};
|
|
1
|
+
import { Client as Client$2, Client$1 as Client$7, DefinePlugin, ExpressionTransformer, IR, LazyOrAsync, LegacyIR, Logger, MaybeArray, OpenApi, OpenApiMetaObject, OpenApiOperationObject, OpenApiParameterObject, OpenApiRequestBodyObject, OpenApiResponseObject, OpenApiSchemaObject, Plugin, PluginHandler, StringCase, TypeTransformer, UserConfig, compiler, tsc } from "./types-CFN6tBkJ.cjs";
|
|
2
|
+
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
|
|
3
|
+
import { Injector } from "@angular/core";
|
|
4
|
+
import { AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosStatic, CreateAxiosDefaults } from "axios";
|
|
5
|
+
import { AsyncDataOptions, UseFetchOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from "nuxt/app";
|
|
6
|
+
import { Ref } from "vue";
|
|
7
|
+
import { FetchOptions, ResponseType, ofetch } from "ofetch";
|
|
64
8
|
|
|
9
|
+
//#region src/plugins/@hey-api/client-core/bundle/auth.d.ts
|
|
65
10
|
type AuthToken = string | undefined;
|
|
66
11
|
interface Auth {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Which part of the request do we use to send the auth?
|
|
14
|
+
*
|
|
15
|
+
* @default 'header'
|
|
16
|
+
*/
|
|
17
|
+
in?: 'header' | 'query' | 'cookie';
|
|
18
|
+
/**
|
|
19
|
+
* Header or query parameter name.
|
|
20
|
+
*
|
|
21
|
+
* @default 'Authorization'
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
scheme?: 'basic' | 'bearer';
|
|
25
|
+
type: 'apiKey' | 'http';
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/plugins/@hey-api/client-core/bundle/pathSerializer.d.ts
|
|
29
|
+
interface SerializerOptions<T$1> {
|
|
30
|
+
/**
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
explode: boolean;
|
|
34
|
+
style: T$1;
|
|
89
35
|
}
|
|
90
36
|
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
91
37
|
type ObjectStyle = 'form' | 'deepObject';
|
|
92
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/plugins/@hey-api/client-core/bundle/bodySerializer.d.ts
|
|
93
40
|
type QuerySerializer$1 = (query: Record<string, unknown>) => string;
|
|
94
41
|
type BodySerializer = (body: any) => any;
|
|
95
42
|
interface QuerySerializerOptions {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
43
|
+
allowReserved?: boolean;
|
|
44
|
+
array?: SerializerOptions<ArrayStyle>;
|
|
45
|
+
object?: SerializerOptions<ObjectStyle>;
|
|
99
46
|
}
|
|
100
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/plugins/@hey-api/client-core/bundle/types.d.ts
|
|
101
49
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
102
|
-
type Client$
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} & {
|
|
111
|
-
|
|
112
|
-
} & ([SseFn] extends [never] ? {
|
|
113
|
-
sse?: never;
|
|
50
|
+
type Client$8<RequestFn$6 = never, Config$7 = unknown, MethodFn$6 = never, BuildUrlFn$6 = never, SseFn$6 = never> = {
|
|
51
|
+
/**
|
|
52
|
+
* Returns the final request URL.
|
|
53
|
+
*/
|
|
54
|
+
buildUrl: BuildUrlFn$6;
|
|
55
|
+
getConfig: () => Config$7;
|
|
56
|
+
request: RequestFn$6;
|
|
57
|
+
setConfig: (config: Config$7) => Config$7;
|
|
58
|
+
} & { [K in HttpMethod]: MethodFn$6 } & ([SseFn$6] extends [never] ? {
|
|
59
|
+
sse?: never;
|
|
114
60
|
} : {
|
|
115
|
-
|
|
116
|
-
[K in HttpMethod]: SseFn;
|
|
117
|
-
};
|
|
61
|
+
sse: { [K in HttpMethod]: SseFn$6 };
|
|
118
62
|
});
|
|
119
|
-
interface Config
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
63
|
+
interface Config {
|
|
64
|
+
/**
|
|
65
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
66
|
+
* added to the request payload as defined by its `security` array.
|
|
67
|
+
*/
|
|
68
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
69
|
+
/**
|
|
70
|
+
* A function for serializing request body parameter. By default,
|
|
71
|
+
* {@link JSON.stringify()} will be used.
|
|
72
|
+
*/
|
|
73
|
+
bodySerializer?: BodySerializer | null;
|
|
74
|
+
/**
|
|
75
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
76
|
+
* `Headers` object with.
|
|
77
|
+
*
|
|
78
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
79
|
+
*/
|
|
80
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
81
|
+
/**
|
|
82
|
+
* The request method.
|
|
83
|
+
*
|
|
84
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
85
|
+
*/
|
|
86
|
+
method?: Uppercase<HttpMethod>;
|
|
87
|
+
/**
|
|
88
|
+
* A function for serializing request query parameters. By default, arrays
|
|
89
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
90
|
+
* style, and reserved characters are percent-encoded.
|
|
91
|
+
*
|
|
92
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
93
|
+
* API function is used.
|
|
94
|
+
*
|
|
95
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
96
|
+
*/
|
|
97
|
+
querySerializer?: QuerySerializer$1 | QuerySerializerOptions;
|
|
98
|
+
/**
|
|
99
|
+
* A function validating request data. This is useful if you want to ensure
|
|
100
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
101
|
+
* the server.
|
|
102
|
+
*/
|
|
103
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
104
|
+
/**
|
|
105
|
+
* A function transforming response data before it's returned. This is useful
|
|
106
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
107
|
+
*/
|
|
108
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
109
|
+
/**
|
|
110
|
+
* A function validating response data. This is useful if you want to ensure
|
|
111
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
112
|
+
* the transformers and returned to the user.
|
|
113
|
+
*/
|
|
114
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/plugins/@hey-api/client-core/bundle/serverSentEvents.d.ts
|
|
118
|
+
type ServerSentEventsOptions<TData$1 = unknown> = Omit<RequestInit, 'method'> & Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
119
|
+
/**
|
|
120
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
121
|
+
* fetch instance.
|
|
122
|
+
*
|
|
123
|
+
* @default globalThis.fetch
|
|
124
|
+
*/
|
|
125
|
+
fetch?: typeof fetch;
|
|
126
|
+
/**
|
|
127
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
128
|
+
*/
|
|
129
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
130
|
+
/**
|
|
131
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
132
|
+
*
|
|
133
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
134
|
+
*
|
|
135
|
+
* @param error The error that occurred.
|
|
136
|
+
*/
|
|
137
|
+
onSseError?: (error: unknown) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Callback invoked when an event is streamed from the server.
|
|
140
|
+
*
|
|
141
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
142
|
+
*
|
|
143
|
+
* @param event Event streamed from the server.
|
|
144
|
+
* @returns Nothing (void).
|
|
145
|
+
*/
|
|
146
|
+
onSseEvent?: (event: StreamEvent<TData$1>) => void;
|
|
147
|
+
serializedBody?: RequestInit['body'];
|
|
148
|
+
/**
|
|
149
|
+
* Default retry delay in milliseconds.
|
|
150
|
+
*
|
|
151
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
152
|
+
*
|
|
153
|
+
* @default 3000
|
|
154
|
+
*/
|
|
155
|
+
sseDefaultRetryDelay?: number;
|
|
156
|
+
/**
|
|
157
|
+
* Maximum number of retry attempts before giving up.
|
|
158
|
+
*/
|
|
159
|
+
sseMaxRetryAttempts?: number;
|
|
160
|
+
/**
|
|
161
|
+
* Maximum retry delay in milliseconds.
|
|
162
|
+
*
|
|
163
|
+
* Applies only when exponential backoff is used.
|
|
164
|
+
*
|
|
165
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
166
|
+
*
|
|
167
|
+
* @default 30000
|
|
168
|
+
*/
|
|
169
|
+
sseMaxRetryDelay?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Optional sleep function for retry backoff.
|
|
172
|
+
*
|
|
173
|
+
* Defaults to using `setTimeout`.
|
|
174
|
+
*/
|
|
175
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
176
|
+
url: string;
|
|
232
177
|
};
|
|
233
|
-
interface StreamEvent<TData = unknown> {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
240
|
-
|
|
178
|
+
interface StreamEvent<TData$1 = unknown> {
|
|
179
|
+
data: TData$1;
|
|
180
|
+
event?: string;
|
|
181
|
+
id?: string;
|
|
182
|
+
retry?: number;
|
|
183
|
+
}
|
|
184
|
+
type ServerSentEventsResult<TData$1 = unknown, TReturn = void, TNext = unknown> = {
|
|
185
|
+
stream: AsyncGenerator<TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1, TReturn, TNext>;
|
|
241
186
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
type
|
|
245
|
-
type
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/plugins/@hey-api/client-angular/bundle/utils.d.ts
|
|
189
|
+
type ErrInterceptor$3<Err$1, Res$1, Req$1, Options$7> = (error: Err$1, response: Res$1, request: Req$1, options: Options$7) => Err$1 | Promise<Err$1>;
|
|
190
|
+
type ReqInterceptor$3<Req$1, Options$7> = (request: Req$1, options: Options$7) => Req$1 | Promise<Req$1>;
|
|
191
|
+
type ResInterceptor$3<Res$1, Req$1, Options$7> = (response: Res$1, request: Req$1, options: Options$7) => Res$1 | Promise<Res$1>;
|
|
246
192
|
declare class Interceptors$3<Interceptor> {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
interface Middleware$3<Req, Res, Err, Options> {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
193
|
+
fns: Array<Interceptor | null>;
|
|
194
|
+
clear(): void;
|
|
195
|
+
eject(id: number | Interceptor): void;
|
|
196
|
+
exists(id: number | Interceptor): boolean;
|
|
197
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
198
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
199
|
+
use(fn: Interceptor): number;
|
|
200
|
+
}
|
|
201
|
+
interface Middleware$3<Req$1, Res$1, Err$1, Options$7> {
|
|
202
|
+
error: Interceptors$3<ErrInterceptor$3<Err$1, Res$1, Req$1, Options$7>>;
|
|
203
|
+
request: Interceptors$3<ReqInterceptor$3<Req$1, Options$7>>;
|
|
204
|
+
response: Interceptors$3<ResInterceptor$3<Res$1, Req$1, Options$7>>;
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/plugins/@hey-api/client-angular/bundle/types.d.ts
|
|
261
208
|
type ResponseStyle$2 = 'data' | 'fields';
|
|
262
|
-
interface Config$
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
interface RequestOptions$5<TData = unknown, TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
interface ResolvedRequestOptions$3<TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$5<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
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 : {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
} : TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
209
|
+
interface Config$6<T$1 extends ClientOptions$5 = ClientOptions$5> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Omit<Config, 'headers'> {
|
|
210
|
+
/**
|
|
211
|
+
* Base URL for all requests made by this client.
|
|
212
|
+
*/
|
|
213
|
+
baseUrl?: T$1['baseUrl'];
|
|
214
|
+
/**
|
|
215
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
216
|
+
* `HttpHeaders` object with.
|
|
217
|
+
*
|
|
218
|
+
* {@link https://angular.dev/api/common/http/HttpHeaders#constructor See more}
|
|
219
|
+
*/
|
|
220
|
+
headers?: HttpHeaders | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
221
|
+
/**
|
|
222
|
+
* The HTTP client to use for making requests.
|
|
223
|
+
*/
|
|
224
|
+
httpClient?: HttpClient;
|
|
225
|
+
/**
|
|
226
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
227
|
+
*
|
|
228
|
+
* @default 'fields'
|
|
229
|
+
*/
|
|
230
|
+
responseStyle?: ResponseStyle$2;
|
|
231
|
+
/**
|
|
232
|
+
* Throw an error instead of returning it in the response?
|
|
233
|
+
*
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
throwOnError?: T$1['throwOnError'];
|
|
237
|
+
}
|
|
238
|
+
interface RequestOptions$5<TData$1 = unknown, TResponseStyle$1 extends ResponseStyle$2 = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends Config$6<{
|
|
239
|
+
responseStyle: TResponseStyle$1;
|
|
240
|
+
throwOnError: ThrowOnError$1;
|
|
241
|
+
}>, Pick<ServerSentEventsOptions<TData$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
242
|
+
/**
|
|
243
|
+
* Any body that you want to add to your request.
|
|
244
|
+
*
|
|
245
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
246
|
+
*/
|
|
247
|
+
body?: unknown;
|
|
248
|
+
/**
|
|
249
|
+
* Optional custom injector for dependency resolution if you don't implicitly or explicitly provide one.
|
|
250
|
+
*/
|
|
251
|
+
injector?: Injector;
|
|
252
|
+
path?: Record<string, unknown>;
|
|
253
|
+
query?: Record<string, unknown>;
|
|
254
|
+
/**
|
|
255
|
+
* Security mechanism(s) to use for the request.
|
|
256
|
+
*/
|
|
257
|
+
security?: ReadonlyArray<Auth>;
|
|
258
|
+
url: Url;
|
|
259
|
+
}
|
|
260
|
+
interface ResolvedRequestOptions$3<TResponseStyle$1 extends ResponseStyle$2 = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends RequestOptions$5<unknown, TResponseStyle$1, ThrowOnError$1, Url> {
|
|
261
|
+
serializedBody?: string;
|
|
262
|
+
}
|
|
263
|
+
type RequestResult$5<TData$1 = unknown, TError$1 = unknown, ThrowOnError$1 extends boolean = boolean, TResponseStyle$1 extends ResponseStyle$2 = 'fields'> = Promise<ThrowOnError$1 extends true ? TResponseStyle$1 extends 'data' ? TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1 : {
|
|
264
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
265
|
+
request: HttpRequest<unknown>;
|
|
266
|
+
response: HttpResponse<TData$1>;
|
|
267
|
+
} : TResponseStyle$1 extends 'data' ? (TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1) | undefined : {
|
|
268
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
269
|
+
error: undefined;
|
|
270
|
+
request: HttpRequest<unknown>;
|
|
271
|
+
response: HttpResponse<TData$1>;
|
|
325
272
|
} | {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
273
|
+
data: undefined;
|
|
274
|
+
error: TError$1[keyof TError$1];
|
|
275
|
+
request: HttpRequest<unknown>;
|
|
276
|
+
response: HttpErrorResponse & {
|
|
277
|
+
error: TError$1[keyof TError$1] | null;
|
|
278
|
+
};
|
|
332
279
|
}>;
|
|
333
280
|
interface ClientOptions$5 {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
281
|
+
baseUrl?: string;
|
|
282
|
+
responseStyle?: ResponseStyle$2;
|
|
283
|
+
throwOnError?: boolean;
|
|
337
284
|
}
|
|
338
285
|
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>;
|
|
339
286
|
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>>;
|
|
340
287
|
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>;
|
|
341
288
|
type RequestOptionsFn = <ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: RequestOptions$5<unknown, TResponseStyle, ThrowOnError>) => HttpRequest<unknown>;
|
|
342
289
|
type BuildUrlFn$5 = <TData extends {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
348
|
-
type Client
|
|
349
|
-
|
|
350
|
-
|
|
290
|
+
body?: unknown;
|
|
291
|
+
path?: Record<string, unknown>;
|
|
292
|
+
query?: Record<string, unknown>;
|
|
293
|
+
url: string;
|
|
294
|
+
}>(options: Pick<TData, 'url'> & Options$6<TData>) => string;
|
|
295
|
+
type Client = Client$8<RequestFn$5, Config$6, MethodFn$5, BuildUrlFn$5, SseFn$5> & {
|
|
296
|
+
interceptors: Middleware$3<HttpRequest<unknown>, HttpResponse<unknown>, unknown, ResolvedRequestOptions$3>;
|
|
297
|
+
requestOptions: RequestOptionsFn;
|
|
351
298
|
};
|
|
352
299
|
interface TDataShape$5 {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
type OmitKeys$5<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
360
|
-
type Options$
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
300
|
+
body?: unknown;
|
|
301
|
+
headers?: unknown;
|
|
302
|
+
path?: unknown;
|
|
303
|
+
query?: unknown;
|
|
304
|
+
url: string;
|
|
305
|
+
}
|
|
306
|
+
type OmitKeys$5<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
307
|
+
type Options$6<TData$1 extends TDataShape$5 = TDataShape$5, ThrowOnError$1 extends boolean = boolean, TResponse = unknown, TResponseStyle$1 extends ResponseStyle$2 = 'fields'> = OmitKeys$5<RequestOptions$5<TResponse, TResponseStyle$1, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/plugins/@hey-api/client-axios/bundle/types.d.ts
|
|
310
|
+
interface Config$5<T$1 extends ClientOptions$4 = ClientOptions$4> extends Omit<CreateAxiosDefaults, 'auth' | 'baseURL' | 'headers' | 'method'>, Config {
|
|
311
|
+
/**
|
|
312
|
+
* Axios implementation. You can use this option to provide either an
|
|
313
|
+
* `AxiosStatic` or an `AxiosInstance`.
|
|
314
|
+
*
|
|
315
|
+
* @default axios
|
|
316
|
+
*/
|
|
317
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
318
|
+
/**
|
|
319
|
+
* Base URL for all requests made by this client.
|
|
320
|
+
*/
|
|
321
|
+
baseURL?: T$1['baseURL'];
|
|
322
|
+
/**
|
|
323
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
324
|
+
* `Headers` object with.
|
|
325
|
+
*
|
|
326
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
327
|
+
*/
|
|
328
|
+
headers?: AxiosRequestHeaders | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
329
|
+
/**
|
|
330
|
+
* Throw an error instead of returning it in the response?
|
|
331
|
+
*
|
|
332
|
+
* @default false
|
|
333
|
+
*/
|
|
334
|
+
throwOnError?: T$1['throwOnError'];
|
|
335
|
+
}
|
|
336
|
+
interface RequestOptions$4<TData$1 = unknown, ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends Config$5<{
|
|
337
|
+
throwOnError: ThrowOnError$1;
|
|
338
|
+
}>, Pick<ServerSentEventsOptions<TData$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
339
|
+
/**
|
|
340
|
+
* Any body that you want to add to your request.
|
|
341
|
+
*
|
|
342
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
343
|
+
*/
|
|
344
|
+
body?: unknown;
|
|
345
|
+
path?: Record<string, unknown>;
|
|
346
|
+
query?: Record<string, unknown>;
|
|
347
|
+
/**
|
|
348
|
+
* Security mechanism(s) to use for the request.
|
|
349
|
+
*/
|
|
350
|
+
security?: ReadonlyArray<Auth>;
|
|
351
|
+
url: Url;
|
|
404
352
|
}
|
|
405
353
|
interface ClientOptions$4 {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
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> & {
|
|
410
|
-
|
|
411
|
-
}) | (AxiosError<TError extends Record<string, unknown> ? TError[keyof TError] : TError> & {
|
|
412
|
-
|
|
413
|
-
|
|
354
|
+
baseURL?: string;
|
|
355
|
+
throwOnError?: boolean;
|
|
356
|
+
}
|
|
357
|
+
type RequestResult$4<TData$1 = unknown, TError$1 = unknown, ThrowOnError$1 extends boolean = boolean> = ThrowOnError$1 extends true ? Promise<AxiosResponse<TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1>> : Promise<(AxiosResponse<TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1> & {
|
|
358
|
+
error: undefined;
|
|
359
|
+
}) | (AxiosError<TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1> & {
|
|
360
|
+
data: undefined;
|
|
361
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
414
362
|
})>;
|
|
415
363
|
type MethodFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => RequestResult$4<TData, TError, ThrowOnError>;
|
|
416
364
|
type SseFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
417
365
|
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>;
|
|
418
366
|
type BuildUrlFn$4 = <TData extends {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
424
|
-
type Client$
|
|
425
|
-
|
|
367
|
+
body?: unknown;
|
|
368
|
+
path?: Record<string, unknown>;
|
|
369
|
+
query?: Record<string, unknown>;
|
|
370
|
+
url: string;
|
|
371
|
+
}>(options: Pick<TData, 'url'> & Options$5<TData>) => string;
|
|
372
|
+
type Client$1 = Client$8<RequestFn$4, Config$5, MethodFn$4, BuildUrlFn$4, SseFn$4> & {
|
|
373
|
+
instance: AxiosInstance;
|
|
426
374
|
};
|
|
427
375
|
interface TDataShape$4 {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
type OmitKeys$4<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
435
|
-
type Options$
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
type
|
|
439
|
-
type
|
|
376
|
+
body?: unknown;
|
|
377
|
+
headers?: unknown;
|
|
378
|
+
path?: unknown;
|
|
379
|
+
query?: unknown;
|
|
380
|
+
url: string;
|
|
381
|
+
}
|
|
382
|
+
type OmitKeys$4<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
383
|
+
type Options$5<TData$1 extends TDataShape$4 = TDataShape$4, ThrowOnError$1 extends boolean = boolean, TResponse = unknown> = OmitKeys$4<RequestOptions$4<TResponse, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/plugins/@hey-api/client-fetch/bundle/utils.d.ts
|
|
386
|
+
type ErrInterceptor$2<Err$1, Res$1, Req$1, Options$7> = (error: Err$1, response: Res$1, request: Req$1, options: Options$7) => Err$1 | Promise<Err$1>;
|
|
387
|
+
type ReqInterceptor$2<Req$1, Options$7> = (request: Req$1, options: Options$7) => Req$1 | Promise<Req$1>;
|
|
388
|
+
type ResInterceptor$2<Res$1, Req$1, Options$7> = (response: Res$1, request: Req$1, options: Options$7) => Res$1 | Promise<Res$1>;
|
|
440
389
|
declare class Interceptors$2<Interceptor> {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
interface Middleware$2<Req, Res, Err, Options> {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
|
|
390
|
+
fns: Array<Interceptor | null>;
|
|
391
|
+
clear(): void;
|
|
392
|
+
eject(id: number | Interceptor): void;
|
|
393
|
+
exists(id: number | Interceptor): boolean;
|
|
394
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
395
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
396
|
+
use(fn: Interceptor): number;
|
|
397
|
+
}
|
|
398
|
+
interface Middleware$2<Req$1, Res$1, Err$1, Options$7> {
|
|
399
|
+
error: Interceptors$2<ErrInterceptor$2<Err$1, Res$1, Req$1, Options$7>>;
|
|
400
|
+
request: Interceptors$2<ReqInterceptor$2<Req$1, Options$7>>;
|
|
401
|
+
response: Interceptors$2<ResInterceptor$2<Res$1, Req$1, Options$7>>;
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/plugins/@hey-api/client-fetch/bundle/types.d.ts
|
|
455
405
|
type ResponseStyle$1 = 'data' | 'fields';
|
|
456
|
-
interface Config$
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
interface RequestOptions$3<TData = unknown, TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
interface ResolvedRequestOptions$2<TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$3<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
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 : {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
523
|
-
|
|
524
|
-
|
|
406
|
+
interface Config$4<T$1 extends ClientOptions$3 = ClientOptions$3> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config {
|
|
407
|
+
/**
|
|
408
|
+
* Base URL for all requests made by this client.
|
|
409
|
+
*/
|
|
410
|
+
baseUrl?: T$1['baseUrl'];
|
|
411
|
+
/**
|
|
412
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
413
|
+
* fetch instance.
|
|
414
|
+
*
|
|
415
|
+
* @default globalThis.fetch
|
|
416
|
+
*/
|
|
417
|
+
fetch?: typeof fetch;
|
|
418
|
+
/**
|
|
419
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
420
|
+
* options won't have any effect.
|
|
421
|
+
*
|
|
422
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
423
|
+
*/
|
|
424
|
+
next?: never;
|
|
425
|
+
/**
|
|
426
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
427
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
428
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
429
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
430
|
+
*
|
|
431
|
+
* @default 'auto'
|
|
432
|
+
*/
|
|
433
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
434
|
+
/**
|
|
435
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
436
|
+
*
|
|
437
|
+
* @default 'fields'
|
|
438
|
+
*/
|
|
439
|
+
responseStyle?: ResponseStyle$1;
|
|
440
|
+
/**
|
|
441
|
+
* Throw an error instead of returning it in the response?
|
|
442
|
+
*
|
|
443
|
+
* @default false
|
|
444
|
+
*/
|
|
445
|
+
throwOnError?: T$1['throwOnError'];
|
|
446
|
+
}
|
|
447
|
+
interface RequestOptions$3<TData$1 = unknown, TResponseStyle$1 extends ResponseStyle$1 = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends Config$4<{
|
|
448
|
+
responseStyle: TResponseStyle$1;
|
|
449
|
+
throwOnError: ThrowOnError$1;
|
|
450
|
+
}>, Pick<ServerSentEventsOptions<TData$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
451
|
+
/**
|
|
452
|
+
* Any body that you want to add to your request.
|
|
453
|
+
*
|
|
454
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
455
|
+
*/
|
|
456
|
+
body?: unknown;
|
|
457
|
+
path?: Record<string, unknown>;
|
|
458
|
+
query?: Record<string, unknown>;
|
|
459
|
+
/**
|
|
460
|
+
* Security mechanism(s) to use for the request.
|
|
461
|
+
*/
|
|
462
|
+
security?: ReadonlyArray<Auth>;
|
|
463
|
+
url: Url;
|
|
464
|
+
}
|
|
465
|
+
interface ResolvedRequestOptions$2<TResponseStyle$1 extends ResponseStyle$1 = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends RequestOptions$3<unknown, TResponseStyle$1, ThrowOnError$1, Url> {
|
|
466
|
+
serializedBody?: string;
|
|
467
|
+
}
|
|
468
|
+
type RequestResult$3<TData$1 = unknown, TError$1 = unknown, ThrowOnError$1 extends boolean = boolean, TResponseStyle$1 extends ResponseStyle$1 = 'fields'> = ThrowOnError$1 extends true ? Promise<TResponseStyle$1 extends 'data' ? TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1 : {
|
|
469
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
470
|
+
request: Request;
|
|
471
|
+
response: Response;
|
|
472
|
+
}> : Promise<TResponseStyle$1 extends 'data' ? (TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1) | undefined : ({
|
|
473
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
474
|
+
error: undefined;
|
|
525
475
|
} | {
|
|
526
|
-
|
|
527
|
-
|
|
476
|
+
data: undefined;
|
|
477
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
528
478
|
}) & {
|
|
529
|
-
|
|
530
|
-
|
|
479
|
+
request: Request;
|
|
480
|
+
response: Response;
|
|
531
481
|
}>;
|
|
532
482
|
interface ClientOptions$3 {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
483
|
+
baseUrl?: string;
|
|
484
|
+
responseStyle?: ResponseStyle$1;
|
|
485
|
+
throwOnError?: boolean;
|
|
536
486
|
}
|
|
537
487
|
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>;
|
|
538
488
|
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>>;
|
|
539
489
|
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>;
|
|
540
490
|
type BuildUrlFn$3 = <TData extends {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
546
|
-
type Client$3 = Client$
|
|
547
|
-
|
|
491
|
+
body?: unknown;
|
|
492
|
+
path?: Record<string, unknown>;
|
|
493
|
+
query?: Record<string, unknown>;
|
|
494
|
+
url: string;
|
|
495
|
+
}>(options: Pick<TData, 'url'> & Options$4<TData>) => string;
|
|
496
|
+
type Client$3 = Client$8<RequestFn$3, Config$4, MethodFn$3, BuildUrlFn$3, SseFn$3> & {
|
|
497
|
+
interceptors: Middleware$2<Request, Response, unknown, ResolvedRequestOptions$2>;
|
|
548
498
|
};
|
|
549
499
|
interface TDataShape$3 {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}
|
|
556
|
-
type OmitKeys$3<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
557
|
-
type Options$
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
type
|
|
561
|
-
type
|
|
500
|
+
body?: unknown;
|
|
501
|
+
headers?: unknown;
|
|
502
|
+
path?: unknown;
|
|
503
|
+
query?: unknown;
|
|
504
|
+
url: string;
|
|
505
|
+
}
|
|
506
|
+
type OmitKeys$3<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
507
|
+
type Options$4<TData$1 extends TDataShape$3 = TDataShape$3, ThrowOnError$1 extends boolean = boolean, TResponse = unknown, TResponseStyle$1 extends ResponseStyle$1 = 'fields'> = OmitKeys$3<RequestOptions$3<TResponse, TResponseStyle$1, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region src/plugins/@hey-api/client-next/bundle/utils.d.ts
|
|
510
|
+
type ErrInterceptor$1<Err$1, Res$1, Options$7> = (error: Err$1, response: Res$1, options: Options$7) => Err$1 | Promise<Err$1>;
|
|
511
|
+
type ReqInterceptor$1<Options$7> = (options: Options$7) => void | Promise<void>;
|
|
512
|
+
type ResInterceptor$1<Res$1, Options$7> = (response: Res$1, options: Options$7) => Res$1 | Promise<Res$1>;
|
|
562
513
|
declare class Interceptors$1<Interceptor> {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
interface Middleware$1<Res, Err, Options> {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
514
|
+
fns: Array<Interceptor | null>;
|
|
515
|
+
clear(): void;
|
|
516
|
+
eject(id: number | Interceptor): void;
|
|
517
|
+
exists(id: number | Interceptor): boolean;
|
|
518
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
519
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
520
|
+
use(fn: Interceptor): number;
|
|
521
|
+
}
|
|
522
|
+
interface Middleware$1<Res$1, Err$1, Options$7> {
|
|
523
|
+
error: Interceptors$1<ErrInterceptor$1<Err$1, Res$1, Options$7>>;
|
|
524
|
+
request: Interceptors$1<ReqInterceptor$1<Options$7>>;
|
|
525
|
+
response: Interceptors$1<ResInterceptor$1<Res$1, Options$7>>;
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region src/plugins/@hey-api/client-next/bundle/types.d.ts
|
|
529
|
+
interface Config$3<T$1 extends ClientOptions$2 = ClientOptions$2> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config {
|
|
530
|
+
/**
|
|
531
|
+
* Base URL for all requests made by this client.
|
|
532
|
+
*/
|
|
533
|
+
baseUrl?: T$1['baseUrl'];
|
|
534
|
+
/**
|
|
535
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
536
|
+
* fetch instance.
|
|
537
|
+
*
|
|
538
|
+
* @default globalThis.fetch
|
|
539
|
+
*/
|
|
540
|
+
fetch?: typeof fetch;
|
|
541
|
+
/**
|
|
542
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
543
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
544
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
545
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
546
|
+
*
|
|
547
|
+
* @default 'auto'
|
|
548
|
+
*/
|
|
549
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
550
|
+
/**
|
|
551
|
+
* Throw an error instead of returning it in the response?
|
|
552
|
+
*
|
|
553
|
+
* @default false
|
|
554
|
+
*/
|
|
555
|
+
throwOnError?: T$1['throwOnError'];
|
|
556
|
+
}
|
|
557
|
+
interface RequestOptions$2<TData$1 = unknown, ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends Config$3<{
|
|
558
|
+
throwOnError: ThrowOnError$1;
|
|
559
|
+
}>, Pick<ServerSentEventsOptions<TData$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
560
|
+
/**
|
|
561
|
+
* Any body that you want to add to your request.
|
|
562
|
+
*
|
|
563
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
564
|
+
*/
|
|
565
|
+
body?: unknown;
|
|
566
|
+
path?: Record<string, unknown>;
|
|
567
|
+
query?: Record<string, unknown>;
|
|
568
|
+
/**
|
|
569
|
+
* Security mechanism(s) to use for the request.
|
|
570
|
+
*/
|
|
571
|
+
security?: ReadonlyArray<Auth>;
|
|
572
|
+
url: Url;
|
|
573
|
+
}
|
|
574
|
+
interface ResolvedRequestOptions$1<ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends RequestOptions$2<unknown, ThrowOnError$1, Url> {
|
|
575
|
+
serializedBody?: string;
|
|
576
|
+
}
|
|
577
|
+
type RequestResult$2<TData$1 = unknown, TError$1 = unknown, ThrowOnError$1 extends boolean = boolean> = ThrowOnError$1 extends true ? Promise<{
|
|
578
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
579
|
+
response: Response;
|
|
628
580
|
}> : Promise<({
|
|
629
|
-
|
|
630
|
-
|
|
581
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
582
|
+
error: undefined;
|
|
631
583
|
} | {
|
|
632
|
-
|
|
633
|
-
|
|
584
|
+
data: undefined;
|
|
585
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
634
586
|
}) & {
|
|
635
|
-
|
|
587
|
+
response: Response;
|
|
636
588
|
}>;
|
|
637
589
|
interface ClientOptions$2 {
|
|
638
|
-
|
|
639
|
-
|
|
590
|
+
baseUrl?: string;
|
|
591
|
+
throwOnError?: boolean;
|
|
640
592
|
}
|
|
641
593
|
type MethodFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => RequestResult$2<TData, TError, ThrowOnError>;
|
|
642
594
|
type SseFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
643
595
|
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>;
|
|
644
596
|
type BuildUrlFn$2 = <TData extends {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
650
|
-
type Client$
|
|
651
|
-
|
|
597
|
+
body?: unknown;
|
|
598
|
+
path?: Record<string, unknown>;
|
|
599
|
+
query?: Record<string, unknown>;
|
|
600
|
+
url: string;
|
|
601
|
+
}>(options: Pick<TData, 'url'> & Options$3<TData>) => string;
|
|
602
|
+
type Client$4 = Client$8<RequestFn$2, Config$3, MethodFn$2, BuildUrlFn$2, SseFn$2> & {
|
|
603
|
+
interceptors: Middleware$1<Response, unknown, ResolvedRequestOptions$1>;
|
|
652
604
|
};
|
|
653
605
|
interface TDataShape$2 {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
type OmitKeys$2<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
661
|
-
type Options$
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
type
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
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;
|
|
606
|
+
body?: unknown;
|
|
607
|
+
headers?: unknown;
|
|
608
|
+
path?: unknown;
|
|
609
|
+
query?: unknown;
|
|
610
|
+
url: string;
|
|
611
|
+
}
|
|
612
|
+
type OmitKeys$2<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
613
|
+
type Options$3<TData$1 extends TDataShape$2 = TDataShape$2, ThrowOnError$1 extends boolean = boolean, TResponse = unknown> = OmitKeys$2<RequestOptions$2<TResponse, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region src/plugins/@hey-api/client-nuxt/bundle/types.d.ts
|
|
616
|
+
type QuerySerializer = (query: Parameters<Client$5['buildUrl']>[0]['query']) => string;
|
|
617
|
+
type WithRefs<TData$1> = { [K in keyof TData$1]: NonNullable<TData$1[K]> extends object ? WithRefs<NonNullable<TData$1[K]>> | Ref<NonNullable<TData$1[K]>> : NonNullable<TData$1[K]> | Ref<NonNullable<TData$1[K]>> };
|
|
618
|
+
type KeysOf<T$1> = Array<T$1 extends T$1 ? (keyof T$1 extends string ? keyof T$1 : never) : never>;
|
|
619
|
+
interface Config$2<T$1 extends ClientOptions$1 = ClientOptions$1> extends Omit<FetchOptions$1<unknown>, 'baseURL' | 'body' | 'headers' | 'method' | 'query'>, WithRefs<Pick<FetchOptions$1<unknown>, 'query'>>, Omit<Config, 'querySerializer'> {
|
|
620
|
+
/**
|
|
621
|
+
* Base URL for all requests made by this client.
|
|
622
|
+
*/
|
|
623
|
+
baseURL?: T$1['baseURL'];
|
|
624
|
+
/**
|
|
625
|
+
* A function for serializing request query parameters. By default, arrays
|
|
626
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
627
|
+
* style, and reserved characters are percent-encoded.
|
|
628
|
+
*
|
|
629
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
630
|
+
*/
|
|
631
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
632
|
+
}
|
|
633
|
+
interface RequestOptions$1<TComposable$1 extends Composable = '$fetch', ResT$1 = unknown, DefaultT$1 = undefined, Url extends string = string> extends Config$2, WithRefs<{
|
|
634
|
+
/**
|
|
635
|
+
* Any body that you want to add to your request.
|
|
636
|
+
*
|
|
637
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
638
|
+
*/
|
|
639
|
+
body?: unknown;
|
|
640
|
+
path?: FetchOptions$1<unknown>['query'];
|
|
641
|
+
query?: FetchOptions$1<unknown>['query'];
|
|
642
|
+
rawBody?: unknown;
|
|
643
|
+
}>, Pick<ServerSentEventsOptions<ResT$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
644
|
+
asyncDataOptions?: AsyncDataOptions<ResT$1, ResT$1, KeysOf<ResT$1>, DefaultT$1>;
|
|
645
|
+
composable?: TComposable$1;
|
|
646
|
+
key?: string;
|
|
647
|
+
/**
|
|
648
|
+
* Security mechanism(s) to use for the request.
|
|
649
|
+
*/
|
|
650
|
+
security?: ReadonlyArray<Auth>;
|
|
651
|
+
url: Url;
|
|
652
|
+
}
|
|
653
|
+
type RequestResult$1<TComposable$1 extends Composable, ResT$1, TError$1> = TComposable$1 extends '$fetch' ? ReturnType<typeof $fetch<ResT$1>> : TComposable$1 extends 'useAsyncData' ? ReturnType<typeof useAsyncData<ResT$1 | null, TError$1>> : TComposable$1 extends 'useFetch' ? ReturnType<typeof useFetch<ResT$1 | null, TError$1>> : TComposable$1 extends 'useLazyAsyncData' ? ReturnType<typeof useLazyAsyncData<ResT$1 | null, TError$1>> : TComposable$1 extends 'useLazyFetch' ? ReturnType<typeof useLazyFetch<ResT$1 | null, TError$1>> : never;
|
|
703
654
|
interface ClientOptions$1 {
|
|
704
|
-
|
|
655
|
+
baseURL?: string;
|
|
705
656
|
}
|
|
706
657
|
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>;
|
|
707
658
|
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>>>;
|
|
708
659
|
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>;
|
|
660
|
+
/**
|
|
661
|
+
* The `createClientConfig()` function will be called on client initialization
|
|
662
|
+
* and the returned object will become the client's initial configuration.
|
|
663
|
+
*
|
|
664
|
+
* You may want to initialize your client this way instead of calling
|
|
665
|
+
* `setConfig()`. This is useful for example if you're using Next.js
|
|
666
|
+
* to ensure your client always has the correct values.
|
|
667
|
+
*/
|
|
668
|
+
|
|
709
669
|
interface TDataShape$1 {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
670
|
+
body?: unknown;
|
|
671
|
+
headers?: unknown;
|
|
672
|
+
path?: FetchOptions$1<unknown>['query'];
|
|
673
|
+
query?: FetchOptions$1<unknown>['query'];
|
|
674
|
+
url: string;
|
|
715
675
|
}
|
|
716
|
-
type BuildUrlOptions<TData extends Omit<TDataShape$1, 'headers'> = Omit<TDataShape$1, 'headers'>> = Pick<WithRefs<TData>, 'path' | 'query'> & Pick<TData, 'url'> & Pick<Options$
|
|
676
|
+
type BuildUrlOptions<TData$1 extends Omit<TDataShape$1, 'headers'> = Omit<TDataShape$1, 'headers'>> = Pick<WithRefs<TData$1>, 'path' | 'query'> & Pick<TData$1, 'url'> & Pick<Options$2<'$fetch', TData$1>, 'baseURL' | 'querySerializer'>;
|
|
717
677
|
type BuildUrlFn$1 = <TData extends Omit<TDataShape$1, 'headers'>>(options: BuildUrlOptions<TData>) => string;
|
|
718
|
-
type Client$
|
|
719
|
-
type OmitKeys$1<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
720
|
-
type Options$
|
|
721
|
-
type FetchOptions<TData> = Omit<UseFetchOptions<TData, TData>, keyof AsyncDataOptions<TData>>;
|
|
678
|
+
type Client$5 = Client$8<RequestFn$1, Config$2, MethodFn$1, BuildUrlFn$1, SseFn$1>;
|
|
679
|
+
type OmitKeys$1<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
680
|
+
type Options$2<TComposable$1 extends Composable = '$fetch', TData$1 extends TDataShape$1 = TDataShape$1, ResT$1 = unknown, DefaultT$1 = undefined> = OmitKeys$1<RequestOptions$1<TComposable$1, ResT$1, DefaultT$1>, 'body' | 'path' | 'query' | 'url'> & WithRefs<Omit<TData$1, 'url'>>;
|
|
681
|
+
type FetchOptions$1<TData$1> = Omit<UseFetchOptions<TData$1, TData$1>, keyof AsyncDataOptions<TData$1>>;
|
|
722
682
|
type Composable = '$fetch' | 'useAsyncData' | 'useFetch' | 'useLazyAsyncData' | 'useLazyFetch';
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
type
|
|
726
|
-
type
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/plugins/@hey-api/client-ofetch/bundle/utils.d.ts
|
|
685
|
+
type ErrInterceptor<Err$1, Res$1, Req$1, Options$7> = (error: Err$1, response: Res$1, request: Req$1, options: Options$7) => Err$1 | Promise<Err$1>;
|
|
686
|
+
type ReqInterceptor<Req$1, Options$7> = (request: Req$1, options: Options$7) => Req$1 | Promise<Req$1>;
|
|
687
|
+
type ResInterceptor<Res$1, Req$1, Options$7> = (response: Res$1, request: Req$1, options: Options$7) => Res$1 | Promise<Res$1>;
|
|
727
688
|
declare class Interceptors<Interceptor> {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}
|
|
736
|
-
interface Middleware<Req, Res, Err, Options> {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
|
|
689
|
+
fns: Array<Interceptor | null>;
|
|
690
|
+
clear(): void;
|
|
691
|
+
eject(id: number | Interceptor): void;
|
|
692
|
+
exists(id: number | Interceptor): boolean;
|
|
693
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
694
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
695
|
+
use(fn: Interceptor): number;
|
|
696
|
+
}
|
|
697
|
+
interface Middleware<Req$1, Res$1, Err$1, Options$7> {
|
|
698
|
+
error: Interceptors<ErrInterceptor<Err$1, Res$1, Req$1, Options$7>>;
|
|
699
|
+
request: Interceptors<ReqInterceptor<Req$1, Options$7>>;
|
|
700
|
+
response: Interceptors<ResInterceptor<Res$1, Req$1, Options$7>>;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/plugins/@hey-api/client-ofetch/bundle/types.d.ts
|
|
742
704
|
type ResponseStyle = 'data' | 'fields';
|
|
743
|
-
interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
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 : {
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
870
|
-
|
|
871
|
-
|
|
705
|
+
interface Config$1<T$1 extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config {
|
|
706
|
+
/**
|
|
707
|
+
* HTTP(S) agent configuration (Node.js only). Passed through to ofetch.
|
|
708
|
+
*/
|
|
709
|
+
agent?: FetchOptions['agent'];
|
|
710
|
+
/**
|
|
711
|
+
* Base URL for all requests made by this client.
|
|
712
|
+
*/
|
|
713
|
+
baseUrl?: T$1['baseUrl'];
|
|
714
|
+
/**
|
|
715
|
+
* Node-only proxy/agent options.
|
|
716
|
+
*/
|
|
717
|
+
dispatcher?: FetchOptions['dispatcher'];
|
|
718
|
+
/**
|
|
719
|
+
* Fetch API implementation. Used for SSE streaming. You can use this option
|
|
720
|
+
* to provide a custom fetch instance.
|
|
721
|
+
*
|
|
722
|
+
* @default globalThis.fetch
|
|
723
|
+
*/
|
|
724
|
+
fetch?: typeof fetch;
|
|
725
|
+
/**
|
|
726
|
+
* Controls the native ofetch behaviour that throws `FetchError` when
|
|
727
|
+
* `response.ok === false`. We default to suppressing it to match the fetch
|
|
728
|
+
* client semantics and let `throwOnError` drive the outcome.
|
|
729
|
+
*/
|
|
730
|
+
ignoreResponseError?: FetchOptions['ignoreResponseError'];
|
|
731
|
+
/**
|
|
732
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
733
|
+
* options won't have any effect.
|
|
734
|
+
*
|
|
735
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
736
|
+
*/
|
|
737
|
+
next?: never;
|
|
738
|
+
/**
|
|
739
|
+
* Custom ofetch instance created via `ofetch.create()`. If provided, it will
|
|
740
|
+
* be used for requests instead of the default `ofetch` export.
|
|
741
|
+
*/
|
|
742
|
+
ofetch?: typeof ofetch;
|
|
743
|
+
/**
|
|
744
|
+
* ofetch hook called before a request is sent.
|
|
745
|
+
*/
|
|
746
|
+
onRequest?: FetchOptions['onRequest'];
|
|
747
|
+
/**
|
|
748
|
+
* ofetch hook called when a request fails before receiving a response
|
|
749
|
+
* (e.g., network errors or aborted requests).
|
|
750
|
+
*/
|
|
751
|
+
onRequestError?: FetchOptions['onRequestError'];
|
|
752
|
+
/**
|
|
753
|
+
* ofetch hook called after a successful response is received and parsed.
|
|
754
|
+
*/
|
|
755
|
+
onResponse?: FetchOptions['onResponse'];
|
|
756
|
+
/**
|
|
757
|
+
* ofetch hook called when the response indicates an error (non-ok status)
|
|
758
|
+
* or when response parsing fails.
|
|
759
|
+
*/
|
|
760
|
+
onResponseError?: FetchOptions['onResponseError'];
|
|
761
|
+
/**
|
|
762
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
763
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
764
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
765
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
766
|
+
*
|
|
767
|
+
* @default 'auto'
|
|
768
|
+
*/
|
|
769
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
770
|
+
/** Custom response parser (ofetch). */
|
|
771
|
+
parseResponse?: FetchOptions['parseResponse'];
|
|
772
|
+
/**
|
|
773
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
774
|
+
*
|
|
775
|
+
* @default 'fields'
|
|
776
|
+
*/
|
|
777
|
+
responseStyle?: ResponseStyle;
|
|
778
|
+
/**
|
|
779
|
+
* ofetch responseType override. If provided, it will be passed directly to
|
|
780
|
+
* ofetch and take precedence over `parseAs`.
|
|
781
|
+
*/
|
|
782
|
+
responseType?: ResponseType;
|
|
783
|
+
/**
|
|
784
|
+
* Automatically retry failed requests.
|
|
785
|
+
*/
|
|
786
|
+
retry?: FetchOptions['retry'];
|
|
787
|
+
/**
|
|
788
|
+
* Delay (in ms) between retry attempts.
|
|
789
|
+
*/
|
|
790
|
+
retryDelay?: FetchOptions['retryDelay'];
|
|
791
|
+
/**
|
|
792
|
+
* HTTP status codes that should trigger a retry.
|
|
793
|
+
*/
|
|
794
|
+
retryStatusCodes?: FetchOptions['retryStatusCodes'];
|
|
795
|
+
/**
|
|
796
|
+
* Throw an error instead of returning it in the response?
|
|
797
|
+
*
|
|
798
|
+
* @default false
|
|
799
|
+
*/
|
|
800
|
+
throwOnError?: T$1['throwOnError'];
|
|
801
|
+
/**
|
|
802
|
+
* Abort the request after the given milliseconds.
|
|
803
|
+
*/
|
|
804
|
+
timeout?: number;
|
|
805
|
+
}
|
|
806
|
+
interface RequestOptions<TData$1 = unknown, TResponseStyle$1 extends ResponseStyle = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends Config$1<{
|
|
807
|
+
responseStyle: TResponseStyle$1;
|
|
808
|
+
throwOnError: ThrowOnError$1;
|
|
809
|
+
}>, Pick<ServerSentEventsOptions<TData$1>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
810
|
+
/**
|
|
811
|
+
* Any body that you want to add to your request.
|
|
812
|
+
*
|
|
813
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
814
|
+
*/
|
|
815
|
+
body?: unknown;
|
|
816
|
+
path?: Record<string, unknown>;
|
|
817
|
+
query?: Record<string, unknown>;
|
|
818
|
+
/**
|
|
819
|
+
* Security mechanism(s) to use for the request.
|
|
820
|
+
*/
|
|
821
|
+
security?: ReadonlyArray<Auth>;
|
|
822
|
+
url: Url;
|
|
823
|
+
}
|
|
824
|
+
interface ResolvedRequestOptions<TResponseStyle$1 extends ResponseStyle = 'fields', ThrowOnError$1 extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle$1, ThrowOnError$1, Url> {
|
|
825
|
+
serializedBody?: string;
|
|
826
|
+
}
|
|
827
|
+
type RequestResult<TData$1 = unknown, TError$1 = unknown, ThrowOnError$1 extends boolean = boolean, TResponseStyle$1 extends ResponseStyle = 'fields'> = ThrowOnError$1 extends true ? Promise<TResponseStyle$1 extends 'data' ? TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1 : {
|
|
828
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
829
|
+
request: Request;
|
|
830
|
+
response: Response;
|
|
831
|
+
}> : Promise<TResponseStyle$1 extends 'data' ? (TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1) | undefined : ({
|
|
832
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
833
|
+
error: undefined;
|
|
872
834
|
} | {
|
|
873
|
-
|
|
874
|
-
|
|
835
|
+
data: undefined;
|
|
836
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
875
837
|
}) & {
|
|
876
|
-
|
|
877
|
-
|
|
838
|
+
request: Request;
|
|
839
|
+
response: Response;
|
|
878
840
|
}>;
|
|
879
841
|
interface ClientOptions {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
842
|
+
baseUrl?: string;
|
|
843
|
+
responseStyle?: ResponseStyle;
|
|
844
|
+
throwOnError?: boolean;
|
|
883
845
|
}
|
|
884
846
|
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>;
|
|
885
847
|
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>>;
|
|
886
848
|
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>;
|
|
887
849
|
type BuildUrlFn = <TData extends {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
}>(options: Pick<TData, 'url'> & Options<TData>) => string;
|
|
893
|
-
type Client = Client$
|
|
894
|
-
|
|
850
|
+
body?: unknown;
|
|
851
|
+
path?: Record<string, unknown>;
|
|
852
|
+
query?: Record<string, unknown>;
|
|
853
|
+
url: string;
|
|
854
|
+
}>(options: Pick<TData, 'url'> & Options$1<TData>) => string;
|
|
855
|
+
type Client$6 = Client$8<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
|
|
856
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
895
857
|
};
|
|
896
858
|
interface TDataShape {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
904
|
-
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'> & Omit<TData, 'url'>;
|
|
905
|
-
|
|
859
|
+
body?: unknown;
|
|
860
|
+
headers?: unknown;
|
|
861
|
+
path?: unknown;
|
|
862
|
+
query?: unknown;
|
|
863
|
+
url: string;
|
|
864
|
+
}
|
|
865
|
+
type OmitKeys<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
866
|
+
type Options$1<TData$1 extends TDataShape = TDataShape, ThrowOnError$1 extends boolean = boolean, TResponse = unknown, TResponseStyle$1 extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle$1, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
867
|
+
//#endregion
|
|
868
|
+
//#region src/config/parser.d.ts
|
|
906
869
|
declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
|
|
907
|
-
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region src/config/plugins.d.ts
|
|
908
872
|
/**
|
|
909
873
|
* Default plugins used to generate artifacts if plugins aren't specified.
|
|
910
874
|
*/
|
|
911
875
|
declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
|
|
912
|
-
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/plugins/@hey-api/client-core/config.d.ts
|
|
913
878
|
declare const clientDefaultConfig: {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
879
|
+
readonly baseUrl: true;
|
|
880
|
+
readonly bundle: true;
|
|
881
|
+
readonly exportFromIndex: false;
|
|
917
882
|
};
|
|
918
883
|
declare const clientDefaultMeta: {
|
|
919
|
-
|
|
920
|
-
|
|
884
|
+
readonly dependencies: readonly ["@hey-api/typescript"];
|
|
885
|
+
readonly tags: readonly ["client"];
|
|
921
886
|
};
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region src/plugins/@hey-api/client-core/plugin.d.ts
|
|
889
|
+
declare const clientPluginHandler: ({
|
|
890
|
+
plugin
|
|
891
|
+
}: Parameters<PluginHandler>[0]) => void;
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/plugins/shared/utils/config.d.ts
|
|
925
894
|
declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<Plugin.UserConfig<T["config"]>, "name">) => Omit<Plugin.Config<T>, "name"> & {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
type ImportExportItem = ImportExportItemObject | string;
|
|
936
|
-
|
|
937
|
-
type Property = {
|
|
938
|
-
comment?: Comments;
|
|
939
|
-
isReadOnly?: boolean;
|
|
940
|
-
isRequired?: boolean;
|
|
941
|
-
name: string | typescript__default.PropertyName;
|
|
942
|
-
type: any | typescript__default.TypeNode;
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
declare const tsc: {
|
|
946
|
-
anonymousFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
947
|
-
async?: boolean;
|
|
948
|
-
comment?: Comments;
|
|
949
|
-
multiLine?: boolean;
|
|
950
|
-
parameters?: FunctionParameter[];
|
|
951
|
-
returnType?: string | typescript.TypeNode;
|
|
952
|
-
statements?: ReadonlyArray<typescript.Statement>;
|
|
953
|
-
types?: FunctionTypeParameter[];
|
|
954
|
-
}) => typescript.FunctionExpression;
|
|
955
|
-
arrayLiteralExpression: <T>({ elements, multiLine, }: {
|
|
956
|
-
elements: T[];
|
|
957
|
-
multiLine?: boolean;
|
|
958
|
-
}) => typescript.ArrayLiteralExpression;
|
|
959
|
-
arrowFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
960
|
-
async?: boolean;
|
|
961
|
-
comment?: Comments;
|
|
962
|
-
multiLine?: boolean;
|
|
963
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
964
|
-
returnType?: string | typescript.TypeNode;
|
|
965
|
-
statements?: typescript.Statement[] | typescript.Expression;
|
|
966
|
-
types?: FunctionTypeParameter[];
|
|
967
|
-
}) => typescript.ArrowFunction;
|
|
968
|
-
asExpression: ({ expression, type, }: {
|
|
969
|
-
expression: typescript.Expression;
|
|
970
|
-
type: typescript.TypeNode;
|
|
971
|
-
}) => typescript.AsExpression;
|
|
972
|
-
assignment: ({ left, right, }: {
|
|
973
|
-
left: typescript.Expression;
|
|
974
|
-
right: typescript.Expression;
|
|
975
|
-
}) => typescript.AssignmentExpression<typescript.EqualsToken>;
|
|
976
|
-
awaitExpression: ({ expression, }: {
|
|
977
|
-
expression: typescript.Expression;
|
|
978
|
-
}) => typescript.AwaitExpression;
|
|
979
|
-
binaryExpression: ({ left, operator, right, }: {
|
|
980
|
-
left: typescript.Expression;
|
|
981
|
-
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
982
|
-
right: typescript.Expression | string;
|
|
983
|
-
}) => typescript.BinaryExpression;
|
|
984
|
-
block: ({ multiLine, statements, }: {
|
|
985
|
-
multiLine?: boolean;
|
|
986
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
987
|
-
}) => typescript.Block;
|
|
988
|
-
callExpression: ({ functionName, parameters, types, }: {
|
|
989
|
-
functionName: string | typescript.PropertyAccessExpression | typescript.PropertyAccessChain | typescript.ElementAccessExpression | typescript.Expression;
|
|
990
|
-
parameters?: Array<string | typescript.Expression | undefined>;
|
|
991
|
-
types?: ReadonlyArray<typescript.TypeNode>;
|
|
992
|
-
}) => typescript.CallExpression;
|
|
993
|
-
classDeclaration: ({ decorator, exportClass, extendedClasses, name, nodes, }: {
|
|
994
|
-
decorator?: {
|
|
995
|
-
args: any[];
|
|
996
|
-
name: string;
|
|
997
|
-
};
|
|
998
|
-
exportClass?: boolean;
|
|
999
|
-
extendedClasses?: ReadonlyArray<string>;
|
|
1000
|
-
name: string;
|
|
1001
|
-
nodes: ReadonlyArray<typescript.ClassElement>;
|
|
1002
|
-
}) => typescript.ClassDeclaration;
|
|
1003
|
-
conditionalExpression: ({ condition, whenFalse, whenTrue, }: {
|
|
1004
|
-
condition: typescript.Expression;
|
|
1005
|
-
whenFalse: typescript.Expression;
|
|
1006
|
-
whenTrue: typescript.Expression;
|
|
1007
|
-
}) => typescript.ConditionalExpression;
|
|
1008
|
-
constVariable: ({ assertion, comment, destructure, exportConst, expression, name, typeName, }: {
|
|
1009
|
-
assertion?: "const" | typescript.TypeNode;
|
|
1010
|
-
comment?: Comments;
|
|
1011
|
-
destructure?: boolean;
|
|
1012
|
-
exportConst?: boolean;
|
|
1013
|
-
expression: typescript.Expression;
|
|
1014
|
-
name: string | typescript.TypeReferenceNode;
|
|
1015
|
-
typeName?: string | typescript.IndexedAccessTypeNode | typescript.TypeNode;
|
|
1016
|
-
}) => typescript.VariableStatement;
|
|
1017
|
-
constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
|
|
1018
|
-
accessLevel?: AccessLevel;
|
|
1019
|
-
comment?: Comments;
|
|
1020
|
-
multiLine?: boolean;
|
|
1021
|
-
parameters?: FunctionParameter[];
|
|
1022
|
-
statements?: typescript.Statement[];
|
|
1023
|
-
}) => typescript.ConstructorDeclaration;
|
|
1024
|
-
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ asConst, comments: enumMemberComments, leadingComment: comments, name, obj, }: {
|
|
1025
|
-
asConst: boolean;
|
|
1026
|
-
comments?: Record<string | number, Comments>;
|
|
1027
|
-
leadingComment?: Comments;
|
|
1028
|
-
name: string | typescript.TypeReferenceNode;
|
|
1029
|
-
obj: T;
|
|
1030
|
-
}) => typescript.EnumDeclaration;
|
|
1031
|
-
exportAllDeclaration: ({ module, shouldAppendJs, }: {
|
|
1032
|
-
module: string;
|
|
1033
|
-
shouldAppendJs?: boolean;
|
|
1034
|
-
}) => typescript.ExportDeclaration;
|
|
1035
|
-
exportNamedDeclaration: ({ exports, module, }: {
|
|
1036
|
-
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1037
|
-
module: string;
|
|
1038
|
-
}) => typescript.ExportDeclaration;
|
|
1039
|
-
expressionToStatement: ({ expression, }: {
|
|
1040
|
-
expression: typescript.Expression;
|
|
1041
|
-
}) => typescript.ExpressionStatement;
|
|
1042
|
-
forOfStatement: ({ awaitModifier, expression, initializer, statement, }: {
|
|
1043
|
-
awaitModifier?: typescript.AwaitKeyword;
|
|
1044
|
-
expression: typescript.Expression;
|
|
1045
|
-
initializer: typescript.ForInitializer;
|
|
1046
|
-
statement: typescript.Statement;
|
|
1047
|
-
}) => typescript.ForOfStatement;
|
|
1048
|
-
functionTypeNode: ({ parameters, returnType, typeParameters, }: {
|
|
1049
|
-
parameters?: typescript.ParameterDeclaration[];
|
|
1050
|
-
returnType: typescript.TypeNode;
|
|
1051
|
-
typeParameters?: typescript.TypeParameterDeclaration[];
|
|
1052
|
-
}) => typescript.FunctionTypeNode;
|
|
1053
|
-
getAccessorDeclaration: ({ name, returnType, statements, }: {
|
|
1054
|
-
name: string | typescript.PropertyName;
|
|
1055
|
-
returnType?: string | typescript.Identifier;
|
|
1056
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1057
|
-
}) => typescript.GetAccessorDeclaration;
|
|
1058
|
-
identifier: ({ text }: {
|
|
1059
|
-
text: string;
|
|
1060
|
-
}) => typescript.Identifier;
|
|
1061
|
-
ifStatement: ({ elseStatement, expression, thenStatement, }: {
|
|
1062
|
-
elseStatement?: typescript.Statement;
|
|
1063
|
-
expression: typescript.Expression;
|
|
1064
|
-
thenStatement: typescript.Statement;
|
|
1065
|
-
}) => typescript.IfStatement;
|
|
1066
|
-
indexedAccessTypeNode: ({ indexType, objectType, }: {
|
|
1067
|
-
indexType: typescript.TypeNode;
|
|
1068
|
-
objectType: typescript.TypeNode;
|
|
1069
|
-
}) => typescript.IndexedAccessTypeNode;
|
|
1070
|
-
isTsNode: (node: any) => node is typescript.Expression;
|
|
1071
|
-
keywordTypeNode: ({ keyword, }: {
|
|
1072
|
-
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1073
|
-
}) => typescript.KeywordTypeNode<typescript.SyntaxKind.VoidKeyword | typescript.SyntaxKind.AnyKeyword | typescript.SyntaxKind.BooleanKeyword | typescript.SyntaxKind.NeverKeyword | typescript.SyntaxKind.NumberKeyword | typescript.SyntaxKind.StringKeyword | typescript.SyntaxKind.UndefinedKeyword | typescript.SyntaxKind.UnknownKeyword>;
|
|
1074
|
-
literalTypeNode: ({ literal, }: {
|
|
1075
|
-
literal: typescript.LiteralTypeNode["literal"];
|
|
1076
|
-
}) => typescript.LiteralTypeNode;
|
|
1077
|
-
mappedTypeNode: ({ members, nameType, questionToken, readonlyToken, type, typeParameter, }: {
|
|
1078
|
-
members?: typescript.NodeArray<typescript.TypeElement>;
|
|
1079
|
-
nameType?: typescript.TypeNode;
|
|
1080
|
-
questionToken?: typescript.QuestionToken | typescript.PlusToken | typescript.MinusToken;
|
|
1081
|
-
readonlyToken?: typescript.ReadonlyKeyword | typescript.PlusToken | typescript.MinusToken;
|
|
1082
|
-
type?: typescript.TypeNode;
|
|
1083
|
-
typeParameter: typescript.TypeParameterDeclaration;
|
|
1084
|
-
}) => typescript.MappedTypeNode;
|
|
1085
|
-
methodDeclaration: ({ accessLevel, comment, isStatic, multiLine, name, parameters, returnType, statements, types, }: {
|
|
1086
|
-
accessLevel?: AccessLevel;
|
|
1087
|
-
comment?: Comments;
|
|
1088
|
-
isStatic?: boolean;
|
|
1089
|
-
multiLine?: boolean;
|
|
1090
|
-
name: string;
|
|
1091
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1092
|
-
returnType?: string | typescript.TypeNode;
|
|
1093
|
-
statements?: typescript.Statement[];
|
|
1094
|
-
types?: FunctionTypeParameter[];
|
|
1095
|
-
}) => typescript.MethodDeclaration;
|
|
1096
|
-
namedImportDeclarations: ({ imports, module, }: {
|
|
1097
|
-
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1098
|
-
module: string;
|
|
1099
|
-
}) => typescript.ImportDeclaration;
|
|
1100
|
-
namespaceDeclaration: ({ name, statements, }: {
|
|
1101
|
-
name: string;
|
|
1102
|
-
statements: Array<typescript.Statement>;
|
|
1103
|
-
}) => typescript.ModuleDeclaration;
|
|
1104
|
-
newExpression: ({ argumentsArray, expression, typeArguments, }: {
|
|
1105
|
-
argumentsArray?: Array<typescript.Expression>;
|
|
1106
|
-
expression: typescript.Expression;
|
|
1107
|
-
typeArguments?: Array<typescript.TypeNode>;
|
|
1108
|
-
}) => typescript.NewExpression;
|
|
1109
|
-
nodeToString: typeof tsNodeToString;
|
|
1110
|
-
null: () => typescript.NullLiteral;
|
|
1111
|
-
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({ comments, identifiers, multiLine, obj, shorthand, unescape, }: {
|
|
1112
|
-
comments?: Comments;
|
|
1113
|
-
identifiers?: string[];
|
|
1114
|
-
multiLine?: boolean;
|
|
1115
|
-
obj: T;
|
|
1116
|
-
shorthand?: boolean;
|
|
1117
|
-
unescape?: boolean;
|
|
1118
|
-
}) => typescript.ObjectLiteralExpression;
|
|
1119
|
-
ots: {
|
|
1120
|
-
boolean: (value: boolean) => typescript.TrueLiteral | typescript.FalseLiteral;
|
|
1121
|
-
export: ({ alias, asType, name }: ImportExportItemObject) => typescript.ExportSpecifier;
|
|
1122
|
-
import: ({ alias, asType, name }: ImportExportItemObject) => typescript.ImportSpecifier;
|
|
1123
|
-
number: (value: number) => typescript.NumericLiteral | typescript.PrefixUnaryExpression;
|
|
1124
|
-
string: (value: string, unescape?: boolean) => typescript.Identifier | typescript.StringLiteral;
|
|
1125
|
-
};
|
|
1126
|
-
parameterDeclaration: ({ initializer, modifiers, name, required, type, }: {
|
|
1127
|
-
initializer?: typescript.Expression;
|
|
1128
|
-
modifiers?: ReadonlyArray<typescript.ModifierLike>;
|
|
1129
|
-
name: string | typescript.BindingName;
|
|
1130
|
-
required?: boolean;
|
|
1131
|
-
type?: typescript.TypeNode;
|
|
1132
|
-
}) => typescript.ParameterDeclaration;
|
|
1133
|
-
propertyAccessExpression: ({ expression, isOptional, name, }: {
|
|
1134
|
-
expression: string | typescript.Expression;
|
|
1135
|
-
isOptional?: boolean;
|
|
1136
|
-
name: string | number | typescript.MemberName;
|
|
1137
|
-
}) => typescript.PropertyAccessChain | typescript.PropertyAccessExpression | typescript.ElementAccessExpression;
|
|
1138
|
-
propertyAccessExpressions: ({ expressions, }: {
|
|
1139
|
-
expressions: Array<string | typescript.Expression | typescript.MemberName>;
|
|
1140
|
-
}) => typescript.PropertyAccessExpression;
|
|
1141
|
-
propertyAssignment: ({ initializer, name, }: {
|
|
1142
|
-
initializer: typescript.Expression;
|
|
1143
|
-
name: string | typescript.PropertyName;
|
|
1144
|
-
}) => typescript.PropertyAssignment;
|
|
1145
|
-
propertyDeclaration: ({ initializer, modifier, name, type, }: {
|
|
1146
|
-
initializer?: typescript.Expression;
|
|
1147
|
-
modifier?: AccessLevel | "async" | "export" | "readonly" | "static";
|
|
1148
|
-
name: string | typescript.PropertyName;
|
|
1149
|
-
type?: typescript.TypeNode;
|
|
1150
|
-
}) => typescript.PropertyDeclaration;
|
|
1151
|
-
regularExpressionLiteral: ({ flags, text, }: {
|
|
1152
|
-
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1153
|
-
text: string;
|
|
1154
|
-
}) => typescript.RegularExpressionLiteral;
|
|
1155
|
-
returnFunctionCall: ({ args, name, types, }: {
|
|
1156
|
-
args: any[];
|
|
1157
|
-
name: string | typescript.Expression;
|
|
1158
|
-
types?: ReadonlyArray<string | typescript.StringLiteral>;
|
|
1159
|
-
}) => typescript.ReturnStatement;
|
|
1160
|
-
returnStatement: ({ expression, }: {
|
|
1161
|
-
expression?: typescript.Expression;
|
|
1162
|
-
}) => typescript.ReturnStatement;
|
|
1163
|
-
returnVariable: ({ expression, }: {
|
|
1164
|
-
expression: string | typescript.Expression;
|
|
1165
|
-
}) => typescript.ReturnStatement;
|
|
1166
|
-
safeAccessExpression: (path: string[]) => typescript.Expression;
|
|
1167
|
-
stringLiteral: ({ isSingleQuote, text, }: {
|
|
1168
|
-
isSingleQuote?: boolean;
|
|
1169
|
-
text: string;
|
|
1170
|
-
}) => typescript.StringLiteral;
|
|
1171
|
-
templateLiteralType: ({ value, }: {
|
|
1172
|
-
value: ReadonlyArray<string | typescript.TypeNode>;
|
|
1173
|
-
}) => typescript.TemplateLiteralTypeNode;
|
|
1174
|
-
this: () => typescript.ThisExpression;
|
|
1175
|
-
transformArrayMap: ({ path, transformExpression, }: {
|
|
1176
|
-
path: string[];
|
|
1177
|
-
transformExpression: typescript.Expression;
|
|
1178
|
-
}) => typescript.IfStatement;
|
|
1179
|
-
transformArrayMutation: ({ path, transformerName, }: {
|
|
1180
|
-
path: string[];
|
|
1181
|
-
transformerName: string;
|
|
1182
|
-
}) => typescript.Statement;
|
|
1183
|
-
transformDateMutation: ({ path, }: {
|
|
1184
|
-
path: string[];
|
|
1185
|
-
}) => typescript.Statement;
|
|
1186
|
-
transformFunctionMutation: ({ path, transformerName, }: {
|
|
1187
|
-
path: string[];
|
|
1188
|
-
transformerName: string;
|
|
1189
|
-
}) => typescript.IfStatement[];
|
|
1190
|
-
transformNewDate: ({ parameterName, }: {
|
|
1191
|
-
parameterName: string;
|
|
1192
|
-
}) => typescript.NewExpression;
|
|
1193
|
-
typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
|
|
1194
|
-
comment?: Comments;
|
|
1195
|
-
exportType?: boolean;
|
|
1196
|
-
name: string | typescript.TypeReferenceNode;
|
|
1197
|
-
type: string | typescript.TypeNode | typescript.Identifier;
|
|
1198
|
-
typeParameters?: FunctionTypeParameter[];
|
|
1199
|
-
}) => typescript.TypeAliasDeclaration;
|
|
1200
|
-
typeArrayNode: (types: ReadonlyArray<any | typescript.TypeNode> | typescript.TypeNode | typescript.Identifier | string, isNullable?: boolean) => typescript.TypeNode;
|
|
1201
|
-
typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
|
|
1202
|
-
indexKey?: typescript.TypeReferenceNode;
|
|
1203
|
-
indexProperty?: Property;
|
|
1204
|
-
isNullable?: boolean;
|
|
1205
|
-
properties: Property[];
|
|
1206
|
-
useLegacyResolution: boolean;
|
|
1207
|
-
}) => typescript.TypeNode;
|
|
1208
|
-
typeIntersectionNode: ({ isNullable, types, }: {
|
|
1209
|
-
isNullable?: boolean;
|
|
1210
|
-
types: (any | typescript.TypeNode)[];
|
|
1211
|
-
}) => typescript.TypeNode;
|
|
1212
|
-
typeNode: (base: any | typescript.TypeNode, args?: (any | typescript.TypeNode)[]) => typescript.TypeNode;
|
|
1213
|
-
typeOfExpression: ({ text, }: {
|
|
1214
|
-
text: string | typescript.Identifier;
|
|
1215
|
-
}) => typescript.TypeOfExpression;
|
|
1216
|
-
typeOperatorNode: ({ operator, type, }: {
|
|
1217
|
-
operator: "keyof" | "readonly" | "unique";
|
|
1218
|
-
type: typescript.TypeNode;
|
|
1219
|
-
}) => typescript.TypeOperatorNode;
|
|
1220
|
-
typeParameterDeclaration: ({ constraint, defaultType, modifiers, name, }: {
|
|
1221
|
-
constraint?: typescript.TypeNode;
|
|
1222
|
-
defaultType?: typescript.TypeNode;
|
|
1223
|
-
modifiers?: Array<typescript.Modifier>;
|
|
1224
|
-
name: string | typescript.Identifier;
|
|
1225
|
-
}) => typescript.TypeParameterDeclaration;
|
|
1226
|
-
typeParenthesizedNode: ({ type }: {
|
|
1227
|
-
type: typescript.TypeNode;
|
|
1228
|
-
}) => typescript.ParenthesizedTypeNode;
|
|
1229
|
-
typeRecordNode: (keys: (any | typescript.TypeNode)[], values: (any | typescript.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript.TypeNode;
|
|
1230
|
-
typeReferenceNode: ({ typeArguments, typeName, }: {
|
|
1231
|
-
typeArguments?: typescript.TypeNode[];
|
|
1232
|
-
typeName: string | typescript.EntityName;
|
|
1233
|
-
}) => typescript.TypeReferenceNode;
|
|
1234
|
-
typeTupleNode: ({ isNullable, types, }: {
|
|
1235
|
-
isNullable?: boolean;
|
|
1236
|
-
types: Array<any | typescript.TypeNode>;
|
|
1237
|
-
}) => typescript.TypeNode;
|
|
1238
|
-
typeUnionNode: ({ isNullable, types, }: {
|
|
1239
|
-
isNullable?: boolean;
|
|
1240
|
-
types: ReadonlyArray<any | typescript.TypeNode>;
|
|
1241
|
-
}) => typescript.TypeNode;
|
|
1242
|
-
valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
|
|
1243
|
-
identifiers?: string[];
|
|
1244
|
-
isValueAccess?: boolean;
|
|
1245
|
-
shorthand?: boolean;
|
|
1246
|
-
unescape?: boolean;
|
|
1247
|
-
value: T;
|
|
1248
|
-
}) => typescript.Expression | undefined;
|
|
1249
|
-
};
|
|
1250
|
-
/** @deprecated use tsc */
|
|
1251
|
-
declare const compiler: {
|
|
1252
|
-
anonymousFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
1253
|
-
async?: boolean;
|
|
1254
|
-
comment?: Comments;
|
|
1255
|
-
multiLine?: boolean;
|
|
1256
|
-
parameters?: FunctionParameter[];
|
|
1257
|
-
returnType?: string | typescript.TypeNode;
|
|
1258
|
-
statements?: ReadonlyArray<typescript.Statement>;
|
|
1259
|
-
types?: FunctionTypeParameter[];
|
|
1260
|
-
}) => typescript.FunctionExpression;
|
|
1261
|
-
arrayLiteralExpression: <T>({ elements, multiLine, }: {
|
|
1262
|
-
elements: T[];
|
|
1263
|
-
multiLine?: boolean;
|
|
1264
|
-
}) => typescript.ArrayLiteralExpression;
|
|
1265
|
-
arrowFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
1266
|
-
async?: boolean;
|
|
1267
|
-
comment?: Comments;
|
|
1268
|
-
multiLine?: boolean;
|
|
1269
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1270
|
-
returnType?: string | typescript.TypeNode;
|
|
1271
|
-
statements?: typescript.Statement[] | typescript.Expression;
|
|
1272
|
-
types?: FunctionTypeParameter[];
|
|
1273
|
-
}) => typescript.ArrowFunction;
|
|
1274
|
-
asExpression: ({ expression, type, }: {
|
|
1275
|
-
expression: typescript.Expression;
|
|
1276
|
-
type: typescript.TypeNode;
|
|
1277
|
-
}) => typescript.AsExpression;
|
|
1278
|
-
assignment: ({ left, right, }: {
|
|
1279
|
-
left: typescript.Expression;
|
|
1280
|
-
right: typescript.Expression;
|
|
1281
|
-
}) => typescript.AssignmentExpression<typescript.EqualsToken>;
|
|
1282
|
-
awaitExpression: ({ expression, }: {
|
|
1283
|
-
expression: typescript.Expression;
|
|
1284
|
-
}) => typescript.AwaitExpression;
|
|
1285
|
-
binaryExpression: ({ left, operator, right, }: {
|
|
1286
|
-
left: typescript.Expression;
|
|
1287
|
-
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
1288
|
-
right: typescript.Expression | string;
|
|
1289
|
-
}) => typescript.BinaryExpression;
|
|
1290
|
-
block: ({ multiLine, statements, }: {
|
|
1291
|
-
multiLine?: boolean;
|
|
1292
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1293
|
-
}) => typescript.Block;
|
|
1294
|
-
callExpression: ({ functionName, parameters, types, }: {
|
|
1295
|
-
functionName: string | typescript.PropertyAccessExpression | typescript.PropertyAccessChain | typescript.ElementAccessExpression | typescript.Expression;
|
|
1296
|
-
parameters?: Array<string | typescript.Expression | undefined>;
|
|
1297
|
-
types?: ReadonlyArray<typescript.TypeNode>;
|
|
1298
|
-
}) => typescript.CallExpression;
|
|
1299
|
-
classDeclaration: ({ decorator, exportClass, extendedClasses, name, nodes, }: {
|
|
1300
|
-
decorator?: {
|
|
1301
|
-
args: any[];
|
|
1302
|
-
name: string;
|
|
1303
|
-
};
|
|
1304
|
-
exportClass?: boolean;
|
|
1305
|
-
extendedClasses?: ReadonlyArray<string>;
|
|
1306
|
-
name: string;
|
|
1307
|
-
nodes: ReadonlyArray<typescript.ClassElement>;
|
|
1308
|
-
}) => typescript.ClassDeclaration;
|
|
1309
|
-
conditionalExpression: ({ condition, whenFalse, whenTrue, }: {
|
|
1310
|
-
condition: typescript.Expression;
|
|
1311
|
-
whenFalse: typescript.Expression;
|
|
1312
|
-
whenTrue: typescript.Expression;
|
|
1313
|
-
}) => typescript.ConditionalExpression;
|
|
1314
|
-
constVariable: ({ assertion, comment, destructure, exportConst, expression, name, typeName, }: {
|
|
1315
|
-
assertion?: "const" | typescript.TypeNode;
|
|
1316
|
-
comment?: Comments;
|
|
1317
|
-
destructure?: boolean;
|
|
1318
|
-
exportConst?: boolean;
|
|
1319
|
-
expression: typescript.Expression;
|
|
1320
|
-
name: string | typescript.TypeReferenceNode;
|
|
1321
|
-
typeName?: string | typescript.IndexedAccessTypeNode | typescript.TypeNode;
|
|
1322
|
-
}) => typescript.VariableStatement;
|
|
1323
|
-
constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
|
|
1324
|
-
accessLevel?: AccessLevel;
|
|
1325
|
-
comment?: Comments;
|
|
1326
|
-
multiLine?: boolean;
|
|
1327
|
-
parameters?: FunctionParameter[];
|
|
1328
|
-
statements?: typescript.Statement[];
|
|
1329
|
-
}) => typescript.ConstructorDeclaration;
|
|
1330
|
-
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ asConst, comments: enumMemberComments, leadingComment: comments, name, obj, }: {
|
|
1331
|
-
asConst: boolean;
|
|
1332
|
-
comments?: Record<string | number, Comments>;
|
|
1333
|
-
leadingComment?: Comments;
|
|
1334
|
-
name: string | typescript.TypeReferenceNode;
|
|
1335
|
-
obj: T;
|
|
1336
|
-
}) => typescript.EnumDeclaration;
|
|
1337
|
-
exportAllDeclaration: ({ module, shouldAppendJs, }: {
|
|
1338
|
-
module: string;
|
|
1339
|
-
shouldAppendJs?: boolean;
|
|
1340
|
-
}) => typescript.ExportDeclaration;
|
|
1341
|
-
exportNamedDeclaration: ({ exports, module, }: {
|
|
1342
|
-
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1343
|
-
module: string;
|
|
1344
|
-
}) => typescript.ExportDeclaration;
|
|
1345
|
-
expressionToStatement: ({ expression, }: {
|
|
1346
|
-
expression: typescript.Expression;
|
|
1347
|
-
}) => typescript.ExpressionStatement;
|
|
1348
|
-
forOfStatement: ({ awaitModifier, expression, initializer, statement, }: {
|
|
1349
|
-
awaitModifier?: typescript.AwaitKeyword;
|
|
1350
|
-
expression: typescript.Expression;
|
|
1351
|
-
initializer: typescript.ForInitializer;
|
|
1352
|
-
statement: typescript.Statement;
|
|
1353
|
-
}) => typescript.ForOfStatement;
|
|
1354
|
-
functionTypeNode: ({ parameters, returnType, typeParameters, }: {
|
|
1355
|
-
parameters?: typescript.ParameterDeclaration[];
|
|
1356
|
-
returnType: typescript.TypeNode;
|
|
1357
|
-
typeParameters?: typescript.TypeParameterDeclaration[];
|
|
1358
|
-
}) => typescript.FunctionTypeNode;
|
|
1359
|
-
getAccessorDeclaration: ({ name, returnType, statements, }: {
|
|
1360
|
-
name: string | typescript.PropertyName;
|
|
1361
|
-
returnType?: string | typescript.Identifier;
|
|
1362
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1363
|
-
}) => typescript.GetAccessorDeclaration;
|
|
1364
|
-
identifier: ({ text }: {
|
|
1365
|
-
text: string;
|
|
1366
|
-
}) => typescript.Identifier;
|
|
1367
|
-
ifStatement: ({ elseStatement, expression, thenStatement, }: {
|
|
1368
|
-
elseStatement?: typescript.Statement;
|
|
1369
|
-
expression: typescript.Expression;
|
|
1370
|
-
thenStatement: typescript.Statement;
|
|
1371
|
-
}) => typescript.IfStatement;
|
|
1372
|
-
indexedAccessTypeNode: ({ indexType, objectType, }: {
|
|
1373
|
-
indexType: typescript.TypeNode;
|
|
1374
|
-
objectType: typescript.TypeNode;
|
|
1375
|
-
}) => typescript.IndexedAccessTypeNode;
|
|
1376
|
-
isTsNode: (node: any) => node is typescript.Expression;
|
|
1377
|
-
keywordTypeNode: ({ keyword, }: {
|
|
1378
|
-
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1379
|
-
}) => typescript.KeywordTypeNode<typescript.SyntaxKind.VoidKeyword | typescript.SyntaxKind.AnyKeyword | typescript.SyntaxKind.BooleanKeyword | typescript.SyntaxKind.NeverKeyword | typescript.SyntaxKind.NumberKeyword | typescript.SyntaxKind.StringKeyword | typescript.SyntaxKind.UndefinedKeyword | typescript.SyntaxKind.UnknownKeyword>;
|
|
1380
|
-
literalTypeNode: ({ literal, }: {
|
|
1381
|
-
literal: typescript.LiteralTypeNode["literal"];
|
|
1382
|
-
}) => typescript.LiteralTypeNode;
|
|
1383
|
-
mappedTypeNode: ({ members, nameType, questionToken, readonlyToken, type, typeParameter, }: {
|
|
1384
|
-
members?: typescript.NodeArray<typescript.TypeElement>;
|
|
1385
|
-
nameType?: typescript.TypeNode;
|
|
1386
|
-
questionToken?: typescript.QuestionToken | typescript.PlusToken | typescript.MinusToken;
|
|
1387
|
-
readonlyToken?: typescript.ReadonlyKeyword | typescript.PlusToken | typescript.MinusToken;
|
|
1388
|
-
type?: typescript.TypeNode;
|
|
1389
|
-
typeParameter: typescript.TypeParameterDeclaration;
|
|
1390
|
-
}) => typescript.MappedTypeNode;
|
|
1391
|
-
methodDeclaration: ({ accessLevel, comment, isStatic, multiLine, name, parameters, returnType, statements, types, }: {
|
|
1392
|
-
accessLevel?: AccessLevel;
|
|
1393
|
-
comment?: Comments;
|
|
1394
|
-
isStatic?: boolean;
|
|
1395
|
-
multiLine?: boolean;
|
|
1396
|
-
name: string;
|
|
1397
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1398
|
-
returnType?: string | typescript.TypeNode;
|
|
1399
|
-
statements?: typescript.Statement[];
|
|
1400
|
-
types?: FunctionTypeParameter[];
|
|
1401
|
-
}) => typescript.MethodDeclaration;
|
|
1402
|
-
namedImportDeclarations: ({ imports, module, }: {
|
|
1403
|
-
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1404
|
-
module: string;
|
|
1405
|
-
}) => typescript.ImportDeclaration;
|
|
1406
|
-
namespaceDeclaration: ({ name, statements, }: {
|
|
1407
|
-
name: string;
|
|
1408
|
-
statements: Array<typescript.Statement>;
|
|
1409
|
-
}) => typescript.ModuleDeclaration;
|
|
1410
|
-
newExpression: ({ argumentsArray, expression, typeArguments, }: {
|
|
1411
|
-
argumentsArray?: Array<typescript.Expression>;
|
|
1412
|
-
expression: typescript.Expression;
|
|
1413
|
-
typeArguments?: Array<typescript.TypeNode>;
|
|
1414
|
-
}) => typescript.NewExpression;
|
|
1415
|
-
nodeToString: typeof tsNodeToString;
|
|
1416
|
-
null: () => typescript.NullLiteral;
|
|
1417
|
-
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({ comments, identifiers, multiLine, obj, shorthand, unescape, }: {
|
|
1418
|
-
comments?: Comments;
|
|
1419
|
-
identifiers?: string[];
|
|
1420
|
-
multiLine?: boolean;
|
|
1421
|
-
obj: T;
|
|
1422
|
-
shorthand?: boolean;
|
|
1423
|
-
unescape?: boolean;
|
|
1424
|
-
}) => typescript.ObjectLiteralExpression;
|
|
1425
|
-
ots: {
|
|
1426
|
-
boolean: (value: boolean) => typescript.TrueLiteral | typescript.FalseLiteral;
|
|
1427
|
-
export: ({ alias, asType, name }: ImportExportItemObject) => typescript.ExportSpecifier;
|
|
1428
|
-
import: ({ alias, asType, name }: ImportExportItemObject) => typescript.ImportSpecifier;
|
|
1429
|
-
number: (value: number) => typescript.NumericLiteral | typescript.PrefixUnaryExpression;
|
|
1430
|
-
string: (value: string, unescape?: boolean) => typescript.Identifier | typescript.StringLiteral;
|
|
1431
|
-
};
|
|
1432
|
-
parameterDeclaration: ({ initializer, modifiers, name, required, type, }: {
|
|
1433
|
-
initializer?: typescript.Expression;
|
|
1434
|
-
modifiers?: ReadonlyArray<typescript.ModifierLike>;
|
|
1435
|
-
name: string | typescript.BindingName;
|
|
1436
|
-
required?: boolean;
|
|
1437
|
-
type?: typescript.TypeNode;
|
|
1438
|
-
}) => typescript.ParameterDeclaration;
|
|
1439
|
-
propertyAccessExpression: ({ expression, isOptional, name, }: {
|
|
1440
|
-
expression: string | typescript.Expression;
|
|
1441
|
-
isOptional?: boolean;
|
|
1442
|
-
name: string | number | typescript.MemberName;
|
|
1443
|
-
}) => typescript.PropertyAccessChain | typescript.PropertyAccessExpression | typescript.ElementAccessExpression;
|
|
1444
|
-
propertyAccessExpressions: ({ expressions, }: {
|
|
1445
|
-
expressions: Array<string | typescript.Expression | typescript.MemberName>;
|
|
1446
|
-
}) => typescript.PropertyAccessExpression;
|
|
1447
|
-
propertyAssignment: ({ initializer, name, }: {
|
|
1448
|
-
initializer: typescript.Expression;
|
|
1449
|
-
name: string | typescript.PropertyName;
|
|
1450
|
-
}) => typescript.PropertyAssignment;
|
|
1451
|
-
propertyDeclaration: ({ initializer, modifier, name, type, }: {
|
|
1452
|
-
initializer?: typescript.Expression;
|
|
1453
|
-
modifier?: AccessLevel | "async" | "export" | "readonly" | "static";
|
|
1454
|
-
name: string | typescript.PropertyName;
|
|
1455
|
-
type?: typescript.TypeNode;
|
|
1456
|
-
}) => typescript.PropertyDeclaration;
|
|
1457
|
-
regularExpressionLiteral: ({ flags, text, }: {
|
|
1458
|
-
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1459
|
-
text: string;
|
|
1460
|
-
}) => typescript.RegularExpressionLiteral;
|
|
1461
|
-
returnFunctionCall: ({ args, name, types, }: {
|
|
1462
|
-
args: any[];
|
|
1463
|
-
name: string | typescript.Expression;
|
|
1464
|
-
types?: ReadonlyArray<string | typescript.StringLiteral>;
|
|
1465
|
-
}) => typescript.ReturnStatement;
|
|
1466
|
-
returnStatement: ({ expression, }: {
|
|
1467
|
-
expression?: typescript.Expression;
|
|
1468
|
-
}) => typescript.ReturnStatement;
|
|
1469
|
-
returnVariable: ({ expression, }: {
|
|
1470
|
-
expression: string | typescript.Expression;
|
|
1471
|
-
}) => typescript.ReturnStatement;
|
|
1472
|
-
safeAccessExpression: (path: string[]) => typescript.Expression;
|
|
1473
|
-
stringLiteral: ({ isSingleQuote, text, }: {
|
|
1474
|
-
isSingleQuote?: boolean;
|
|
1475
|
-
text: string;
|
|
1476
|
-
}) => typescript.StringLiteral;
|
|
1477
|
-
templateLiteralType: ({ value, }: {
|
|
1478
|
-
value: ReadonlyArray<string | typescript.TypeNode>;
|
|
1479
|
-
}) => typescript.TemplateLiteralTypeNode;
|
|
1480
|
-
this: () => typescript.ThisExpression;
|
|
1481
|
-
transformArrayMap: ({ path, transformExpression, }: {
|
|
1482
|
-
path: string[];
|
|
1483
|
-
transformExpression: typescript.Expression;
|
|
1484
|
-
}) => typescript.IfStatement;
|
|
1485
|
-
transformArrayMutation: ({ path, transformerName, }: {
|
|
1486
|
-
path: string[];
|
|
1487
|
-
transformerName: string;
|
|
1488
|
-
}) => typescript.Statement;
|
|
1489
|
-
transformDateMutation: ({ path, }: {
|
|
1490
|
-
path: string[];
|
|
1491
|
-
}) => typescript.Statement;
|
|
1492
|
-
transformFunctionMutation: ({ path, transformerName, }: {
|
|
1493
|
-
path: string[];
|
|
1494
|
-
transformerName: string;
|
|
1495
|
-
}) => typescript.IfStatement[];
|
|
1496
|
-
transformNewDate: ({ parameterName, }: {
|
|
1497
|
-
parameterName: string;
|
|
1498
|
-
}) => typescript.NewExpression;
|
|
1499
|
-
typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
|
|
1500
|
-
comment?: Comments;
|
|
1501
|
-
exportType?: boolean;
|
|
1502
|
-
name: string | typescript.TypeReferenceNode;
|
|
1503
|
-
type: string | typescript.TypeNode | typescript.Identifier;
|
|
1504
|
-
typeParameters?: FunctionTypeParameter[];
|
|
1505
|
-
}) => typescript.TypeAliasDeclaration;
|
|
1506
|
-
typeArrayNode: (types: ReadonlyArray<any | typescript.TypeNode> | typescript.TypeNode | typescript.Identifier | string, isNullable?: boolean) => typescript.TypeNode;
|
|
1507
|
-
typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
|
|
1508
|
-
indexKey?: typescript.TypeReferenceNode;
|
|
1509
|
-
indexProperty?: Property;
|
|
1510
|
-
isNullable?: boolean;
|
|
1511
|
-
properties: Property[];
|
|
1512
|
-
useLegacyResolution: boolean;
|
|
1513
|
-
}) => typescript.TypeNode;
|
|
1514
|
-
typeIntersectionNode: ({ isNullable, types, }: {
|
|
1515
|
-
isNullable?: boolean;
|
|
1516
|
-
types: (any | typescript.TypeNode)[];
|
|
1517
|
-
}) => typescript.TypeNode;
|
|
1518
|
-
typeNode: (base: any | typescript.TypeNode, args?: (any | typescript.TypeNode)[]) => typescript.TypeNode;
|
|
1519
|
-
typeOfExpression: ({ text, }: {
|
|
1520
|
-
text: string | typescript.Identifier;
|
|
1521
|
-
}) => typescript.TypeOfExpression;
|
|
1522
|
-
typeOperatorNode: ({ operator, type, }: {
|
|
1523
|
-
operator: "keyof" | "readonly" | "unique";
|
|
1524
|
-
type: typescript.TypeNode;
|
|
1525
|
-
}) => typescript.TypeOperatorNode;
|
|
1526
|
-
typeParameterDeclaration: ({ constraint, defaultType, modifiers, name, }: {
|
|
1527
|
-
constraint?: typescript.TypeNode;
|
|
1528
|
-
defaultType?: typescript.TypeNode;
|
|
1529
|
-
modifiers?: Array<typescript.Modifier>;
|
|
1530
|
-
name: string | typescript.Identifier;
|
|
1531
|
-
}) => typescript.TypeParameterDeclaration;
|
|
1532
|
-
typeParenthesizedNode: ({ type }: {
|
|
1533
|
-
type: typescript.TypeNode;
|
|
1534
|
-
}) => typescript.ParenthesizedTypeNode;
|
|
1535
|
-
typeRecordNode: (keys: (any | typescript.TypeNode)[], values: (any | typescript.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript.TypeNode;
|
|
1536
|
-
typeReferenceNode: ({ typeArguments, typeName, }: {
|
|
1537
|
-
typeArguments?: typescript.TypeNode[];
|
|
1538
|
-
typeName: string | typescript.EntityName;
|
|
1539
|
-
}) => typescript.TypeReferenceNode;
|
|
1540
|
-
typeTupleNode: ({ isNullable, types, }: {
|
|
1541
|
-
isNullable?: boolean;
|
|
1542
|
-
types: Array<any | typescript.TypeNode>;
|
|
1543
|
-
}) => typescript.TypeNode;
|
|
1544
|
-
typeUnionNode: ({ isNullable, types, }: {
|
|
1545
|
-
isNullable?: boolean;
|
|
1546
|
-
types: ReadonlyArray<any | typescript.TypeNode>;
|
|
1547
|
-
}) => typescript.TypeNode;
|
|
1548
|
-
valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
|
|
1549
|
-
identifiers?: string[];
|
|
1550
|
-
isValueAccess?: boolean;
|
|
1551
|
-
shorthand?: boolean;
|
|
1552
|
-
unescape?: boolean;
|
|
1553
|
-
value: T;
|
|
1554
|
-
}) => typescript.Expression | undefined;
|
|
895
|
+
/**
|
|
896
|
+
* Cast name to `any` so it doesn't throw type error in `plugins` array.
|
|
897
|
+
* We could allow any `string` as plugin `name` in the object syntax, but
|
|
898
|
+
* that TypeScript trick would cause all string methods to appear as
|
|
899
|
+
* suggested auto completions, which is undesirable.
|
|
900
|
+
*/
|
|
901
|
+
name: any;
|
|
1555
902
|
};
|
|
1556
|
-
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region src/utils/exports.d.ts
|
|
1557
905
|
declare const utils: {
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
906
|
+
stringCase: ({
|
|
907
|
+
case: _case,
|
|
908
|
+
stripLeadingSeparators,
|
|
909
|
+
value
|
|
910
|
+
}: {
|
|
911
|
+
readonly case: StringCase | undefined;
|
|
912
|
+
stripLeadingSeparators?: boolean;
|
|
913
|
+
value: string;
|
|
914
|
+
}) => string;
|
|
1563
915
|
};
|
|
1564
|
-
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/index.d.ts
|
|
1565
918
|
/**
|
|
1566
919
|
* Generate a client from the provided configuration.
|
|
1567
920
|
*
|
|
@@ -1572,5 +925,6 @@ declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, l
|
|
|
1572
925
|
* Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s)
|
|
1573
926
|
*/
|
|
1574
927
|
declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>;
|
|
1575
|
-
|
|
1576
|
-
export { type Client
|
|
928
|
+
//#endregion
|
|
929
|
+
export { type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, type ExpressionTransformer, type Client$3 as FetchClient, type IR, type LegacyIR, Logger, 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, type Plugin, type TypeTransformer, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, compiler, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, tsc, utils };
|
|
930
|
+
//# sourceMappingURL=index.d.cts.map
|