@hey-api/openapi-ts 0.85.2 → 0.86.1
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/dist/chunk-C-EqMg7d.js +1 -0
- package/dist/clients/nuxt/utils.ts +12 -4
- package/dist/getSpec-BlRTbnm6.js +24 -0
- package/dist/getSpec-BlRTbnm6.js.map +1 -0
- package/dist/getSpec-D8vjI0RE.cjs +24 -0
- package/dist/getSpec-D8vjI0RE.cjs.map +1 -0
- package/dist/index.cjs +180 -215
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +822 -1478
- package/dist/index.d.ts +822 -1478
- package/dist/index.js +171 -172
- 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-CGoxqmT9.d.cts → types-C7EJ2jAV.d.cts} +7948 -6907
- package/dist/{types.d-CGoxqmT9.d.ts → types-k8CRHWYM.d.ts} +7949 -6907
- package/package.json +7 -12
- package/dist/chunk-F2CVRHGI.js +0 -47
- package/dist/chunk-F2CVRHGI.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,1577 +1,920 @@
|
|
|
1
|
-
import { C as
|
|
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
|
-
* Type of resource this symbol represents.
|
|
34
|
-
*/
|
|
35
|
-
resourceType?:
|
|
36
|
-
| 'operation'
|
|
37
|
-
| 'parameter'
|
|
38
|
-
| 'requestBody'
|
|
39
|
-
| 'schema'
|
|
40
|
-
| 'server'
|
|
41
|
-
| 'webhook';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type AccessLevel = 'private' | 'protected' | 'public';
|
|
46
|
-
type FunctionParameter = {
|
|
47
|
-
accessLevel?: AccessLevel;
|
|
48
|
-
default?: any;
|
|
49
|
-
isReadOnly?: boolean;
|
|
50
|
-
isRequired?: boolean;
|
|
51
|
-
name: string;
|
|
52
|
-
type?: any | typescript__default.TypeNode;
|
|
53
|
-
} | {
|
|
54
|
-
destructure: ReadonlyArray<FunctionParameter>;
|
|
55
|
-
type?: any | typescript__default.TypeNode;
|
|
56
|
-
};
|
|
57
|
-
interface FunctionTypeParameter {
|
|
58
|
-
default?: any;
|
|
59
|
-
extends?: string | typescript__default.TypeNode;
|
|
60
|
-
name: string | typescript__default.Identifier;
|
|
61
|
-
}
|
|
62
|
-
type SyntaxKindKeyword = 'any' | 'async' | 'boolean' | 'export' | 'never' | 'number' | 'private' | 'protected' | 'public' | 'readonly' | 'static' | 'string' | 'undefined' | 'unknown' | 'void';
|
|
63
|
-
type ObjectValue = {
|
|
64
|
-
assertion?: 'any' | typescript__default.TypeNode;
|
|
65
|
-
comments?: Comments;
|
|
66
|
-
spread: string;
|
|
67
|
-
} | {
|
|
68
|
-
comments?: Comments;
|
|
69
|
-
isValueAccess?: boolean;
|
|
70
|
-
key: string;
|
|
71
|
-
shorthand?: boolean;
|
|
72
|
-
value: any;
|
|
73
|
-
};
|
|
1
|
+
import { C as OpenApiSchemaObject, D as MaybeArray, E as LazyOrAsync, S as OpenApiResponseObject, T as StringCase, _ as OpenApi, a as ExpressionTransformer, b as OpenApiParameterObject, c as Client$2, d as Plugin, f as Client$7, g as UserConfig, i as TypeTransformer, l as PluginHandler, m as Logger, o as compiler, r as IR, s as tsc, t as LegacyIR, u as DefinePlugin, v as OpenApiMetaObject, x as OpenApiRequestBodyObject, y as OpenApiOperationObject } from "./types-C7EJ2jAV.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";
|
|
74
8
|
|
|
9
|
+
//#region src/plugins/@hey-api/client-core/bundle/auth.d.ts
|
|
75
10
|
type AuthToken = string | undefined;
|
|
76
11
|
interface Auth {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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;
|
|
99
35
|
}
|
|
100
36
|
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
101
37
|
type ObjectStyle = 'form' | 'deepObject';
|
|
102
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/plugins/@hey-api/client-core/bundle/bodySerializer.d.ts
|
|
103
40
|
type QuerySerializer$1 = (query: Record<string, unknown>) => string;
|
|
104
41
|
type BodySerializer = (body: any) => any;
|
|
105
42
|
interface QuerySerializerOptions {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
43
|
+
allowReserved?: boolean;
|
|
44
|
+
array?: SerializerOptions<ArrayStyle>;
|
|
45
|
+
object?: SerializerOptions<ObjectStyle>;
|
|
109
46
|
}
|
|
110
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/plugins/@hey-api/client-core/bundle/types.d.ts
|
|
111
49
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
112
|
-
type Client$
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
} & {
|
|
121
|
-
|
|
122
|
-
} & ([SseFn] extends [never] ? {
|
|
123
|
-
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;
|
|
124
60
|
} : {
|
|
125
|
-
|
|
126
|
-
[K in HttpMethod]: SseFn;
|
|
127
|
-
};
|
|
61
|
+
sse: { [K in HttpMethod]: SseFn$6 };
|
|
128
62
|
});
|
|
129
|
-
interface Config
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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;
|
|
242
177
|
};
|
|
243
|
-
interface StreamEvent<TData = unknown> {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
250
|
-
|
|
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>;
|
|
251
186
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
type
|
|
255
|
-
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>;
|
|
256
192
|
declare class Interceptors$3<Interceptor> {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
interface Middleware$3<Req, Res, Err, Options> {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
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
|
|
271
208
|
type ResponseStyle$2 = 'data' | 'fields';
|
|
272
|
-
interface Config$
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
interface RequestOptions$5<TData = unknown, TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
interface ResolvedRequestOptions$3<TResponseStyle extends ResponseStyle$2 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$5<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
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 : {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
} : TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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>;
|
|
335
272
|
} | {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
+
};
|
|
342
279
|
}>;
|
|
343
280
|
interface ClientOptions$5 {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
281
|
+
baseUrl?: string;
|
|
282
|
+
responseStyle?: ResponseStyle$2;
|
|
283
|
+
throwOnError?: boolean;
|
|
347
284
|
}
|
|
348
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>;
|
|
349
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>>;
|
|
350
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>;
|
|
351
288
|
type RequestOptionsFn = <ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle$2 = 'fields'>(options: RequestOptions$5<unknown, TResponseStyle, ThrowOnError>) => HttpRequest<unknown>;
|
|
352
289
|
type BuildUrlFn$5 = <TData extends {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
358
|
-
type Client
|
|
359
|
-
|
|
360
|
-
|
|
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;
|
|
361
298
|
};
|
|
362
299
|
interface TDataShape$5 {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
type OmitKeys$5<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
370
|
-
type Options$
|
|
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
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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;
|
|
414
352
|
}
|
|
415
353
|
interface ClientOptions$4 {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
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> & {
|
|
420
|
-
|
|
421
|
-
}) | (AxiosError<TError extends Record<string, unknown> ? TError[keyof TError] : TError> & {
|
|
422
|
-
|
|
423
|
-
|
|
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;
|
|
424
362
|
})>;
|
|
425
363
|
type MethodFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => RequestResult$4<TData, TError, ThrowOnError>;
|
|
426
364
|
type SseFn$4 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$4<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
427
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>;
|
|
428
366
|
type BuildUrlFn$4 = <TData extends {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
434
|
-
type Client$
|
|
435
|
-
|
|
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;
|
|
436
374
|
};
|
|
437
375
|
interface TDataShape$4 {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
type OmitKeys$4<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
445
|
-
type Options$
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
type
|
|
449
|
-
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>;
|
|
450
389
|
declare class Interceptors$2<Interceptor> {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
interface Middleware$2<Req, Res, Err, Options> {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
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
|
|
465
405
|
type ResponseStyle$1 = 'data' | 'fields';
|
|
466
|
-
interface Config$
|
|
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
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
interface RequestOptions$3<TData = unknown, TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
interface ResolvedRequestOptions$2<TResponseStyle extends ResponseStyle$1 = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions$3<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
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 : {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
533
|
-
|
|
534
|
-
|
|
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;
|
|
535
475
|
} | {
|
|
536
|
-
|
|
537
|
-
|
|
476
|
+
data: undefined;
|
|
477
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
538
478
|
}) & {
|
|
539
|
-
|
|
540
|
-
|
|
479
|
+
request: Request;
|
|
480
|
+
response: Response;
|
|
541
481
|
}>;
|
|
542
482
|
interface ClientOptions$3 {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
483
|
+
baseUrl?: string;
|
|
484
|
+
responseStyle?: ResponseStyle$1;
|
|
485
|
+
throwOnError?: boolean;
|
|
546
486
|
}
|
|
547
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>;
|
|
548
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>>;
|
|
549
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>;
|
|
550
490
|
type BuildUrlFn$3 = <TData extends {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
556
|
-
type Client$3 = Client$
|
|
557
|
-
|
|
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>;
|
|
558
498
|
};
|
|
559
499
|
interface TDataShape$3 {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
type OmitKeys$3<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
567
|
-
type Options$
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
type
|
|
571
|
-
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>;
|
|
572
513
|
declare class Interceptors$1<Interceptor> {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
interface Middleware$1<Res, Err, Options> {
|
|
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
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
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;
|
|
638
580
|
}> : Promise<({
|
|
639
|
-
|
|
640
|
-
|
|
581
|
+
data: TData$1 extends Record<string, unknown> ? TData$1[keyof TData$1] : TData$1;
|
|
582
|
+
error: undefined;
|
|
641
583
|
} | {
|
|
642
|
-
|
|
643
|
-
|
|
584
|
+
data: undefined;
|
|
585
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
644
586
|
}) & {
|
|
645
|
-
|
|
587
|
+
response: Response;
|
|
646
588
|
}>;
|
|
647
589
|
interface ClientOptions$2 {
|
|
648
|
-
|
|
649
|
-
|
|
590
|
+
baseUrl?: string;
|
|
591
|
+
throwOnError?: boolean;
|
|
650
592
|
}
|
|
651
593
|
type MethodFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => RequestResult$2<TData, TError, ThrowOnError>;
|
|
652
594
|
type SseFn$2 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions$2<TData, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
653
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>;
|
|
654
596
|
type BuildUrlFn$2 = <TData extends {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}>(options: Pick<TData, 'url'> & Options$
|
|
660
|
-
type Client$
|
|
661
|
-
|
|
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>;
|
|
662
604
|
};
|
|
663
605
|
interface TDataShape$2 {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
type OmitKeys$2<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
671
|
-
type Options$
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
type
|
|
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
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
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;
|
|
713
654
|
interface ClientOptions$1 {
|
|
714
|
-
|
|
655
|
+
baseURL?: string;
|
|
715
656
|
}
|
|
716
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>;
|
|
717
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>>>;
|
|
718
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
|
+
|
|
719
669
|
interface TDataShape$1 {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
670
|
+
body?: unknown;
|
|
671
|
+
headers?: unknown;
|
|
672
|
+
path?: FetchOptions$1<unknown>['query'];
|
|
673
|
+
query?: FetchOptions$1<unknown>['query'];
|
|
674
|
+
url: string;
|
|
725
675
|
}
|
|
726
|
-
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'>;
|
|
727
677
|
type BuildUrlFn$1 = <TData extends Omit<TDataShape$1, 'headers'>>(options: BuildUrlOptions<TData>) => string;
|
|
728
|
-
type Client$
|
|
729
|
-
type OmitKeys$1<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
730
|
-
type Options$
|
|
731
|
-
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>>;
|
|
732
682
|
type Composable = '$fetch' | 'useAsyncData' | 'useFetch' | 'useLazyAsyncData' | 'useLazyFetch';
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
type
|
|
736
|
-
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>;
|
|
737
688
|
declare class Interceptors<Interceptor> {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
}
|
|
746
|
-
interface Middleware<Req, Res, Err, Options> {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
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
|
|
752
704
|
type ResponseStyle = 'data' | 'fields';
|
|
753
|
-
interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config
|
|
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
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
}
|
|
854
|
-
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
873
|
-
|
|
874
|
-
}
|
|
875
|
-
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 : {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
880
|
-
|
|
881
|
-
|
|
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;
|
|
882
834
|
} | {
|
|
883
|
-
|
|
884
|
-
|
|
835
|
+
data: undefined;
|
|
836
|
+
error: TError$1 extends Record<string, unknown> ? TError$1[keyof TError$1] : TError$1;
|
|
885
837
|
}) & {
|
|
886
|
-
|
|
887
|
-
|
|
838
|
+
request: Request;
|
|
839
|
+
response: Response;
|
|
888
840
|
}>;
|
|
889
841
|
interface ClientOptions {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
842
|
+
baseUrl?: string;
|
|
843
|
+
responseStyle?: ResponseStyle;
|
|
844
|
+
throwOnError?: boolean;
|
|
893
845
|
}
|
|
894
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>;
|
|
895
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>>;
|
|
896
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>;
|
|
897
849
|
type BuildUrlFn = <TData extends {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}>(options: Pick<TData, 'url'> & Options<TData>) => string;
|
|
903
|
-
type Client = Client$
|
|
904
|
-
|
|
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>;
|
|
905
857
|
};
|
|
906
858
|
interface TDataShape {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}
|
|
913
|
-
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
914
|
-
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'>;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
type Property = {
|
|
919
|
-
comment?: Comments;
|
|
920
|
-
isReadOnly?: boolean;
|
|
921
|
-
isRequired?: boolean;
|
|
922
|
-
name: string | typescript__default.PropertyName;
|
|
923
|
-
type: any | typescript__default.TypeNode;
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
declare const tsc: {
|
|
927
|
-
anonymousFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
928
|
-
async?: boolean;
|
|
929
|
-
comment?: Comments;
|
|
930
|
-
multiLine?: boolean;
|
|
931
|
-
parameters?: FunctionParameter[];
|
|
932
|
-
returnType?: string | typescript.TypeNode;
|
|
933
|
-
statements?: ReadonlyArray<typescript.Statement>;
|
|
934
|
-
types?: FunctionTypeParameter[];
|
|
935
|
-
}) => typescript.FunctionExpression;
|
|
936
|
-
arrayLiteralExpression: <T>({ elements, multiLine, }: {
|
|
937
|
-
elements: T[];
|
|
938
|
-
multiLine?: boolean;
|
|
939
|
-
}) => typescript.ArrayLiteralExpression;
|
|
940
|
-
arrowFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
941
|
-
async?: boolean;
|
|
942
|
-
comment?: Comments;
|
|
943
|
-
multiLine?: boolean;
|
|
944
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
945
|
-
returnType?: string | typescript.TypeNode;
|
|
946
|
-
statements?: typescript.Statement[] | typescript.Expression;
|
|
947
|
-
types?: FunctionTypeParameter[];
|
|
948
|
-
}) => typescript.ArrowFunction;
|
|
949
|
-
asExpression: ({ expression, type, }: {
|
|
950
|
-
expression: typescript.Expression;
|
|
951
|
-
type: typescript.TypeNode;
|
|
952
|
-
}) => typescript.AsExpression;
|
|
953
|
-
assignment: ({ left, right, }: {
|
|
954
|
-
left: typescript.Expression;
|
|
955
|
-
right: typescript.Expression;
|
|
956
|
-
}) => typescript.AssignmentExpression<typescript.EqualsToken>;
|
|
957
|
-
awaitExpression: ({ expression, }: {
|
|
958
|
-
expression: typescript.Expression;
|
|
959
|
-
}) => typescript.AwaitExpression;
|
|
960
|
-
binaryExpression: ({ left, operator, right, }: {
|
|
961
|
-
left: typescript.Expression;
|
|
962
|
-
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
963
|
-
right: typescript.Expression | string;
|
|
964
|
-
}) => typescript.BinaryExpression;
|
|
965
|
-
block: ({ multiLine, statements, }: {
|
|
966
|
-
multiLine?: boolean;
|
|
967
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
968
|
-
}) => typescript.Block;
|
|
969
|
-
callExpression: ({ functionName, parameters, types, }: {
|
|
970
|
-
functionName: string | typescript.PropertyAccessExpression | typescript.PropertyAccessChain | typescript.ElementAccessExpression | typescript.Expression;
|
|
971
|
-
parameters?: Array<string | typescript.Expression | undefined>;
|
|
972
|
-
types?: ReadonlyArray<typescript.TypeNode>;
|
|
973
|
-
}) => typescript.CallExpression;
|
|
974
|
-
classDeclaration: ({ decorator, exportClass, extendedClasses, name, nodes, }: {
|
|
975
|
-
decorator?: {
|
|
976
|
-
args: any[];
|
|
977
|
-
name: string;
|
|
978
|
-
};
|
|
979
|
-
exportClass?: boolean;
|
|
980
|
-
extendedClasses?: ReadonlyArray<string>;
|
|
981
|
-
name: string;
|
|
982
|
-
nodes: ReadonlyArray<typescript.ClassElement>;
|
|
983
|
-
}) => typescript.ClassDeclaration;
|
|
984
|
-
conditionalExpression: ({ condition, whenFalse, whenTrue, }: {
|
|
985
|
-
condition: typescript.Expression;
|
|
986
|
-
whenFalse: typescript.Expression;
|
|
987
|
-
whenTrue: typescript.Expression;
|
|
988
|
-
}) => typescript.ConditionalExpression;
|
|
989
|
-
constVariable: ({ assertion, comment, destructure, exportConst, expression, name, typeName, }: {
|
|
990
|
-
assertion?: "const" | typescript.TypeNode;
|
|
991
|
-
comment?: Comments;
|
|
992
|
-
destructure?: boolean;
|
|
993
|
-
exportConst?: boolean;
|
|
994
|
-
expression: typescript.Expression;
|
|
995
|
-
name: string | typescript.TypeReferenceNode;
|
|
996
|
-
typeName?: string | typescript.IndexedAccessTypeNode | typescript.TypeNode;
|
|
997
|
-
}) => typescript.VariableStatement;
|
|
998
|
-
constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
|
|
999
|
-
accessLevel?: AccessLevel;
|
|
1000
|
-
comment?: Comments;
|
|
1001
|
-
multiLine?: boolean;
|
|
1002
|
-
parameters?: FunctionParameter[];
|
|
1003
|
-
statements?: typescript.Statement[];
|
|
1004
|
-
}) => typescript.ConstructorDeclaration;
|
|
1005
|
-
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ asConst, comments: enumMemberComments, leadingComment: comments, name, obj, }: {
|
|
1006
|
-
asConst: boolean;
|
|
1007
|
-
comments?: Record<string | number, Comments>;
|
|
1008
|
-
leadingComment?: Comments;
|
|
1009
|
-
name: string | typescript.TypeReferenceNode;
|
|
1010
|
-
obj: T;
|
|
1011
|
-
}) => typescript.EnumDeclaration;
|
|
1012
|
-
exportAllDeclaration: ({ module, shouldAppendJs, }: {
|
|
1013
|
-
module: string;
|
|
1014
|
-
shouldAppendJs?: boolean;
|
|
1015
|
-
}) => typescript.ExportDeclaration;
|
|
1016
|
-
exportNamedDeclaration: ({ exports, module, }: {
|
|
1017
|
-
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1018
|
-
module: string;
|
|
1019
|
-
}) => typescript.ExportDeclaration;
|
|
1020
|
-
expressionToStatement: ({ expression, }: {
|
|
1021
|
-
expression: typescript.Expression;
|
|
1022
|
-
}) => typescript.ExpressionStatement;
|
|
1023
|
-
forOfStatement: ({ awaitModifier, expression, initializer, statement, }: {
|
|
1024
|
-
awaitModifier?: typescript.AwaitKeyword;
|
|
1025
|
-
expression: typescript.Expression;
|
|
1026
|
-
initializer: typescript.ForInitializer;
|
|
1027
|
-
statement: typescript.Statement;
|
|
1028
|
-
}) => typescript.ForOfStatement;
|
|
1029
|
-
functionTypeNode: ({ parameters, returnType, typeParameters, }: {
|
|
1030
|
-
parameters?: typescript.ParameterDeclaration[];
|
|
1031
|
-
returnType: typescript.TypeNode;
|
|
1032
|
-
typeParameters?: typescript.TypeParameterDeclaration[];
|
|
1033
|
-
}) => typescript.FunctionTypeNode;
|
|
1034
|
-
getAccessorDeclaration: ({ name, returnType, statements, }: {
|
|
1035
|
-
name: string | typescript.PropertyName;
|
|
1036
|
-
returnType?: string | typescript.Identifier;
|
|
1037
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1038
|
-
}) => typescript.GetAccessorDeclaration;
|
|
1039
|
-
identifier: ({ text }: {
|
|
1040
|
-
text: string;
|
|
1041
|
-
}) => typescript.Identifier;
|
|
1042
|
-
ifStatement: ({ elseStatement, expression, thenStatement, }: {
|
|
1043
|
-
elseStatement?: typescript.Statement;
|
|
1044
|
-
expression: typescript.Expression;
|
|
1045
|
-
thenStatement: typescript.Statement;
|
|
1046
|
-
}) => typescript.IfStatement;
|
|
1047
|
-
indexedAccessTypeNode: ({ indexType, objectType, }: {
|
|
1048
|
-
indexType: typescript.TypeNode;
|
|
1049
|
-
objectType: typescript.TypeNode;
|
|
1050
|
-
}) => typescript.IndexedAccessTypeNode;
|
|
1051
|
-
isTsNode: (node: any) => node is typescript.Expression;
|
|
1052
|
-
keywordTypeNode: ({ keyword, }: {
|
|
1053
|
-
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1054
|
-
}) => 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>;
|
|
1055
|
-
literalTypeNode: ({ literal, }: {
|
|
1056
|
-
literal: typescript.LiteralTypeNode["literal"];
|
|
1057
|
-
}) => typescript.LiteralTypeNode;
|
|
1058
|
-
mappedTypeNode: ({ members, nameType, questionToken, readonlyToken, type, typeParameter, }: {
|
|
1059
|
-
members?: typescript.NodeArray<typescript.TypeElement>;
|
|
1060
|
-
nameType?: typescript.TypeNode;
|
|
1061
|
-
questionToken?: typescript.QuestionToken | typescript.PlusToken | typescript.MinusToken;
|
|
1062
|
-
readonlyToken?: typescript.ReadonlyKeyword | typescript.PlusToken | typescript.MinusToken;
|
|
1063
|
-
type?: typescript.TypeNode;
|
|
1064
|
-
typeParameter: typescript.TypeParameterDeclaration;
|
|
1065
|
-
}) => typescript.MappedTypeNode;
|
|
1066
|
-
methodDeclaration: ({ accessLevel, comment, isStatic, multiLine, name, parameters, returnType, statements, types, }: {
|
|
1067
|
-
accessLevel?: AccessLevel;
|
|
1068
|
-
comment?: Comments;
|
|
1069
|
-
isStatic?: boolean;
|
|
1070
|
-
multiLine?: boolean;
|
|
1071
|
-
name: string;
|
|
1072
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1073
|
-
returnType?: string | typescript.TypeNode;
|
|
1074
|
-
statements?: typescript.Statement[];
|
|
1075
|
-
types?: FunctionTypeParameter[];
|
|
1076
|
-
}) => typescript.MethodDeclaration;
|
|
1077
|
-
namedImportDeclarations: ({ imports, module, }: {
|
|
1078
|
-
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1079
|
-
module: string;
|
|
1080
|
-
}) => typescript.ImportDeclaration;
|
|
1081
|
-
namespaceDeclaration: ({ name, statements, }: {
|
|
1082
|
-
name: string;
|
|
1083
|
-
statements: Array<typescript.Statement>;
|
|
1084
|
-
}) => typescript.ModuleDeclaration;
|
|
1085
|
-
newExpression: ({ argumentsArray, expression, typeArguments, }: {
|
|
1086
|
-
argumentsArray?: Array<typescript.Expression>;
|
|
1087
|
-
expression: typescript.Expression;
|
|
1088
|
-
typeArguments?: Array<typescript.TypeNode>;
|
|
1089
|
-
}) => typescript.NewExpression;
|
|
1090
|
-
nodeToString: typeof tsNodeToString;
|
|
1091
|
-
null: () => typescript.NullLiteral;
|
|
1092
|
-
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({ comments, identifiers, multiLine, obj, shorthand, unescape, }: {
|
|
1093
|
-
comments?: Comments;
|
|
1094
|
-
identifiers?: string[];
|
|
1095
|
-
multiLine?: boolean;
|
|
1096
|
-
obj: T;
|
|
1097
|
-
shorthand?: boolean;
|
|
1098
|
-
unescape?: boolean;
|
|
1099
|
-
}) => typescript.ObjectLiteralExpression;
|
|
1100
|
-
ots: {
|
|
1101
|
-
boolean: (value: boolean) => typescript.TrueLiteral | typescript.FalseLiteral;
|
|
1102
|
-
export: ({ alias, asType, name }: ImportExportItemObject) => typescript.ExportSpecifier;
|
|
1103
|
-
import: ({ alias, asType, name }: ImportExportItemObject) => typescript.ImportSpecifier;
|
|
1104
|
-
number: (value: number) => typescript.NumericLiteral | typescript.PrefixUnaryExpression;
|
|
1105
|
-
string: (value: string, unescape?: boolean) => typescript.Identifier | typescript.StringLiteral;
|
|
1106
|
-
};
|
|
1107
|
-
parameterDeclaration: ({ initializer, modifiers, name, required, type, }: {
|
|
1108
|
-
initializer?: typescript.Expression;
|
|
1109
|
-
modifiers?: ReadonlyArray<typescript.ModifierLike>;
|
|
1110
|
-
name: string | typescript.BindingName;
|
|
1111
|
-
required?: boolean;
|
|
1112
|
-
type?: typescript.TypeNode;
|
|
1113
|
-
}) => typescript.ParameterDeclaration;
|
|
1114
|
-
propertyAccessExpression: ({ expression, isOptional, name, }: {
|
|
1115
|
-
expression: string | typescript.Expression;
|
|
1116
|
-
isOptional?: boolean;
|
|
1117
|
-
name: string | number | typescript.MemberName;
|
|
1118
|
-
}) => typescript.PropertyAccessChain | typescript.PropertyAccessExpression | typescript.ElementAccessExpression;
|
|
1119
|
-
propertyAccessExpressions: ({ expressions, }: {
|
|
1120
|
-
expressions: Array<string | typescript.Expression | typescript.MemberName>;
|
|
1121
|
-
}) => typescript.PropertyAccessExpression;
|
|
1122
|
-
propertyAssignment: ({ initializer, name, }: {
|
|
1123
|
-
initializer: typescript.Expression;
|
|
1124
|
-
name: string | typescript.PropertyName;
|
|
1125
|
-
}) => typescript.PropertyAssignment;
|
|
1126
|
-
propertyDeclaration: ({ initializer, modifier, name, type, }: {
|
|
1127
|
-
initializer?: typescript.Expression;
|
|
1128
|
-
modifier?: AccessLevel | "async" | "export" | "readonly" | "static";
|
|
1129
|
-
name: string | typescript.PropertyName;
|
|
1130
|
-
type?: typescript.TypeNode;
|
|
1131
|
-
}) => typescript.PropertyDeclaration;
|
|
1132
|
-
regularExpressionLiteral: ({ flags, text, }: {
|
|
1133
|
-
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1134
|
-
text: string;
|
|
1135
|
-
}) => typescript.RegularExpressionLiteral;
|
|
1136
|
-
returnFunctionCall: ({ args, name, types, }: {
|
|
1137
|
-
args: any[];
|
|
1138
|
-
name: string | typescript.Expression;
|
|
1139
|
-
types?: ReadonlyArray<string | typescript.StringLiteral>;
|
|
1140
|
-
}) => typescript.ReturnStatement;
|
|
1141
|
-
returnStatement: ({ expression, }: {
|
|
1142
|
-
expression?: typescript.Expression;
|
|
1143
|
-
}) => typescript.ReturnStatement;
|
|
1144
|
-
returnVariable: ({ expression, }: {
|
|
1145
|
-
expression: string | typescript.Expression;
|
|
1146
|
-
}) => typescript.ReturnStatement;
|
|
1147
|
-
safeAccessExpression: (path: string[]) => typescript.Expression;
|
|
1148
|
-
stringLiteral: ({ isSingleQuote, text, }: {
|
|
1149
|
-
isSingleQuote?: boolean;
|
|
1150
|
-
text: string;
|
|
1151
|
-
}) => typescript.StringLiteral;
|
|
1152
|
-
templateLiteralType: ({ value, }: {
|
|
1153
|
-
value: ReadonlyArray<string | typescript.TypeNode>;
|
|
1154
|
-
}) => typescript.TemplateLiteralTypeNode;
|
|
1155
|
-
this: () => typescript.ThisExpression;
|
|
1156
|
-
transformArrayMap: ({ path, transformExpression, }: {
|
|
1157
|
-
path: string[];
|
|
1158
|
-
transformExpression: typescript.Expression;
|
|
1159
|
-
}) => typescript.IfStatement;
|
|
1160
|
-
transformArrayMutation: ({ path, transformerName, }: {
|
|
1161
|
-
path: string[];
|
|
1162
|
-
transformerName: string;
|
|
1163
|
-
}) => typescript.Statement;
|
|
1164
|
-
transformDateMutation: ({ path, }: {
|
|
1165
|
-
path: string[];
|
|
1166
|
-
}) => typescript.Statement;
|
|
1167
|
-
transformFunctionMutation: ({ path, transformerName, }: {
|
|
1168
|
-
path: string[];
|
|
1169
|
-
transformerName: string;
|
|
1170
|
-
}) => typescript.IfStatement[];
|
|
1171
|
-
transformNewDate: ({ parameterName, }: {
|
|
1172
|
-
parameterName: string;
|
|
1173
|
-
}) => typescript.NewExpression;
|
|
1174
|
-
typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
|
|
1175
|
-
comment?: Comments;
|
|
1176
|
-
exportType?: boolean;
|
|
1177
|
-
name: string | typescript.TypeReferenceNode;
|
|
1178
|
-
type: string | typescript.TypeNode | typescript.Identifier;
|
|
1179
|
-
typeParameters?: FunctionTypeParameter[];
|
|
1180
|
-
}) => typescript.TypeAliasDeclaration;
|
|
1181
|
-
typeArrayNode: (types: ReadonlyArray<any | typescript.TypeNode> | typescript.TypeNode | typescript.Identifier | string, isNullable?: boolean) => typescript.TypeNode;
|
|
1182
|
-
typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
|
|
1183
|
-
indexKey?: typescript.TypeReferenceNode;
|
|
1184
|
-
indexProperty?: Property;
|
|
1185
|
-
isNullable?: boolean;
|
|
1186
|
-
properties: Property[];
|
|
1187
|
-
useLegacyResolution: boolean;
|
|
1188
|
-
}) => typescript.TypeNode;
|
|
1189
|
-
typeIntersectionNode: ({ isNullable, types, }: {
|
|
1190
|
-
isNullable?: boolean;
|
|
1191
|
-
types: (any | typescript.TypeNode)[];
|
|
1192
|
-
}) => typescript.TypeNode;
|
|
1193
|
-
typeNode: (base: any | typescript.TypeNode, args?: (any | typescript.TypeNode)[]) => typescript.TypeNode;
|
|
1194
|
-
typeOfExpression: ({ text, }: {
|
|
1195
|
-
text: string | typescript.Identifier;
|
|
1196
|
-
}) => typescript.TypeOfExpression;
|
|
1197
|
-
typeOperatorNode: ({ operator, type, }: {
|
|
1198
|
-
operator: "keyof" | "readonly" | "unique";
|
|
1199
|
-
type: typescript.TypeNode;
|
|
1200
|
-
}) => typescript.TypeOperatorNode;
|
|
1201
|
-
typeParameterDeclaration: ({ constraint, defaultType, modifiers, name, }: {
|
|
1202
|
-
constraint?: typescript.TypeNode;
|
|
1203
|
-
defaultType?: typescript.TypeNode;
|
|
1204
|
-
modifiers?: Array<typescript.Modifier>;
|
|
1205
|
-
name: string | typescript.Identifier;
|
|
1206
|
-
}) => typescript.TypeParameterDeclaration;
|
|
1207
|
-
typeParenthesizedNode: ({ type }: {
|
|
1208
|
-
type: typescript.TypeNode;
|
|
1209
|
-
}) => typescript.ParenthesizedTypeNode;
|
|
1210
|
-
typeRecordNode: (keys: (any | typescript.TypeNode)[], values: (any | typescript.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript.TypeNode;
|
|
1211
|
-
typeReferenceNode: ({ typeArguments, typeName, }: {
|
|
1212
|
-
typeArguments?: typescript.TypeNode[];
|
|
1213
|
-
typeName: string | typescript.EntityName;
|
|
1214
|
-
}) => typescript.TypeReferenceNode;
|
|
1215
|
-
typeTupleNode: ({ isNullable, types, }: {
|
|
1216
|
-
isNullable?: boolean;
|
|
1217
|
-
types: Array<any | typescript.TypeNode>;
|
|
1218
|
-
}) => typescript.TypeNode;
|
|
1219
|
-
typeUnionNode: ({ isNullable, types, }: {
|
|
1220
|
-
isNullable?: boolean;
|
|
1221
|
-
types: ReadonlyArray<any | typescript.TypeNode>;
|
|
1222
|
-
}) => typescript.TypeNode;
|
|
1223
|
-
valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
|
|
1224
|
-
identifiers?: string[];
|
|
1225
|
-
isValueAccess?: boolean;
|
|
1226
|
-
shorthand?: boolean;
|
|
1227
|
-
unescape?: boolean;
|
|
1228
|
-
value: T;
|
|
1229
|
-
}) => typescript.Expression | undefined;
|
|
1230
|
-
};
|
|
1231
|
-
/** @deprecated use tsc */
|
|
1232
|
-
declare const compiler: {
|
|
1233
|
-
anonymousFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
1234
|
-
async?: boolean;
|
|
1235
|
-
comment?: Comments;
|
|
1236
|
-
multiLine?: boolean;
|
|
1237
|
-
parameters?: FunctionParameter[];
|
|
1238
|
-
returnType?: string | typescript.TypeNode;
|
|
1239
|
-
statements?: ReadonlyArray<typescript.Statement>;
|
|
1240
|
-
types?: FunctionTypeParameter[];
|
|
1241
|
-
}) => typescript.FunctionExpression;
|
|
1242
|
-
arrayLiteralExpression: <T>({ elements, multiLine, }: {
|
|
1243
|
-
elements: T[];
|
|
1244
|
-
multiLine?: boolean;
|
|
1245
|
-
}) => typescript.ArrayLiteralExpression;
|
|
1246
|
-
arrowFunction: ({ async, comment, multiLine, parameters, returnType, statements, types, }: {
|
|
1247
|
-
async?: boolean;
|
|
1248
|
-
comment?: Comments;
|
|
1249
|
-
multiLine?: boolean;
|
|
1250
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1251
|
-
returnType?: string | typescript.TypeNode;
|
|
1252
|
-
statements?: typescript.Statement[] | typescript.Expression;
|
|
1253
|
-
types?: FunctionTypeParameter[];
|
|
1254
|
-
}) => typescript.ArrowFunction;
|
|
1255
|
-
asExpression: ({ expression, type, }: {
|
|
1256
|
-
expression: typescript.Expression;
|
|
1257
|
-
type: typescript.TypeNode;
|
|
1258
|
-
}) => typescript.AsExpression;
|
|
1259
|
-
assignment: ({ left, right, }: {
|
|
1260
|
-
left: typescript.Expression;
|
|
1261
|
-
right: typescript.Expression;
|
|
1262
|
-
}) => typescript.AssignmentExpression<typescript.EqualsToken>;
|
|
1263
|
-
awaitExpression: ({ expression, }: {
|
|
1264
|
-
expression: typescript.Expression;
|
|
1265
|
-
}) => typescript.AwaitExpression;
|
|
1266
|
-
binaryExpression: ({ left, operator, right, }: {
|
|
1267
|
-
left: typescript.Expression;
|
|
1268
|
-
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
1269
|
-
right: typescript.Expression | string;
|
|
1270
|
-
}) => typescript.BinaryExpression;
|
|
1271
|
-
block: ({ multiLine, statements, }: {
|
|
1272
|
-
multiLine?: boolean;
|
|
1273
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1274
|
-
}) => typescript.Block;
|
|
1275
|
-
callExpression: ({ functionName, parameters, types, }: {
|
|
1276
|
-
functionName: string | typescript.PropertyAccessExpression | typescript.PropertyAccessChain | typescript.ElementAccessExpression | typescript.Expression;
|
|
1277
|
-
parameters?: Array<string | typescript.Expression | undefined>;
|
|
1278
|
-
types?: ReadonlyArray<typescript.TypeNode>;
|
|
1279
|
-
}) => typescript.CallExpression;
|
|
1280
|
-
classDeclaration: ({ decorator, exportClass, extendedClasses, name, nodes, }: {
|
|
1281
|
-
decorator?: {
|
|
1282
|
-
args: any[];
|
|
1283
|
-
name: string;
|
|
1284
|
-
};
|
|
1285
|
-
exportClass?: boolean;
|
|
1286
|
-
extendedClasses?: ReadonlyArray<string>;
|
|
1287
|
-
name: string;
|
|
1288
|
-
nodes: ReadonlyArray<typescript.ClassElement>;
|
|
1289
|
-
}) => typescript.ClassDeclaration;
|
|
1290
|
-
conditionalExpression: ({ condition, whenFalse, whenTrue, }: {
|
|
1291
|
-
condition: typescript.Expression;
|
|
1292
|
-
whenFalse: typescript.Expression;
|
|
1293
|
-
whenTrue: typescript.Expression;
|
|
1294
|
-
}) => typescript.ConditionalExpression;
|
|
1295
|
-
constVariable: ({ assertion, comment, destructure, exportConst, expression, name, typeName, }: {
|
|
1296
|
-
assertion?: "const" | typescript.TypeNode;
|
|
1297
|
-
comment?: Comments;
|
|
1298
|
-
destructure?: boolean;
|
|
1299
|
-
exportConst?: boolean;
|
|
1300
|
-
expression: typescript.Expression;
|
|
1301
|
-
name: string | typescript.TypeReferenceNode;
|
|
1302
|
-
typeName?: string | typescript.IndexedAccessTypeNode | typescript.TypeNode;
|
|
1303
|
-
}) => typescript.VariableStatement;
|
|
1304
|
-
constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
|
|
1305
|
-
accessLevel?: AccessLevel;
|
|
1306
|
-
comment?: Comments;
|
|
1307
|
-
multiLine?: boolean;
|
|
1308
|
-
parameters?: FunctionParameter[];
|
|
1309
|
-
statements?: typescript.Statement[];
|
|
1310
|
-
}) => typescript.ConstructorDeclaration;
|
|
1311
|
-
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ asConst, comments: enumMemberComments, leadingComment: comments, name, obj, }: {
|
|
1312
|
-
asConst: boolean;
|
|
1313
|
-
comments?: Record<string | number, Comments>;
|
|
1314
|
-
leadingComment?: Comments;
|
|
1315
|
-
name: string | typescript.TypeReferenceNode;
|
|
1316
|
-
obj: T;
|
|
1317
|
-
}) => typescript.EnumDeclaration;
|
|
1318
|
-
exportAllDeclaration: ({ module, shouldAppendJs, }: {
|
|
1319
|
-
module: string;
|
|
1320
|
-
shouldAppendJs?: boolean;
|
|
1321
|
-
}) => typescript.ExportDeclaration;
|
|
1322
|
-
exportNamedDeclaration: ({ exports, module, }: {
|
|
1323
|
-
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1324
|
-
module: string;
|
|
1325
|
-
}) => typescript.ExportDeclaration;
|
|
1326
|
-
expressionToStatement: ({ expression, }: {
|
|
1327
|
-
expression: typescript.Expression;
|
|
1328
|
-
}) => typescript.ExpressionStatement;
|
|
1329
|
-
forOfStatement: ({ awaitModifier, expression, initializer, statement, }: {
|
|
1330
|
-
awaitModifier?: typescript.AwaitKeyword;
|
|
1331
|
-
expression: typescript.Expression;
|
|
1332
|
-
initializer: typescript.ForInitializer;
|
|
1333
|
-
statement: typescript.Statement;
|
|
1334
|
-
}) => typescript.ForOfStatement;
|
|
1335
|
-
functionTypeNode: ({ parameters, returnType, typeParameters, }: {
|
|
1336
|
-
parameters?: typescript.ParameterDeclaration[];
|
|
1337
|
-
returnType: typescript.TypeNode;
|
|
1338
|
-
typeParameters?: typescript.TypeParameterDeclaration[];
|
|
1339
|
-
}) => typescript.FunctionTypeNode;
|
|
1340
|
-
getAccessorDeclaration: ({ name, returnType, statements, }: {
|
|
1341
|
-
name: string | typescript.PropertyName;
|
|
1342
|
-
returnType?: string | typescript.Identifier;
|
|
1343
|
-
statements: ReadonlyArray<typescript.Statement>;
|
|
1344
|
-
}) => typescript.GetAccessorDeclaration;
|
|
1345
|
-
identifier: ({ text }: {
|
|
1346
|
-
text: string;
|
|
1347
|
-
}) => typescript.Identifier;
|
|
1348
|
-
ifStatement: ({ elseStatement, expression, thenStatement, }: {
|
|
1349
|
-
elseStatement?: typescript.Statement;
|
|
1350
|
-
expression: typescript.Expression;
|
|
1351
|
-
thenStatement: typescript.Statement;
|
|
1352
|
-
}) => typescript.IfStatement;
|
|
1353
|
-
indexedAccessTypeNode: ({ indexType, objectType, }: {
|
|
1354
|
-
indexType: typescript.TypeNode;
|
|
1355
|
-
objectType: typescript.TypeNode;
|
|
1356
|
-
}) => typescript.IndexedAccessTypeNode;
|
|
1357
|
-
isTsNode: (node: any) => node is typescript.Expression;
|
|
1358
|
-
keywordTypeNode: ({ keyword, }: {
|
|
1359
|
-
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1360
|
-
}) => 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>;
|
|
1361
|
-
literalTypeNode: ({ literal, }: {
|
|
1362
|
-
literal: typescript.LiteralTypeNode["literal"];
|
|
1363
|
-
}) => typescript.LiteralTypeNode;
|
|
1364
|
-
mappedTypeNode: ({ members, nameType, questionToken, readonlyToken, type, typeParameter, }: {
|
|
1365
|
-
members?: typescript.NodeArray<typescript.TypeElement>;
|
|
1366
|
-
nameType?: typescript.TypeNode;
|
|
1367
|
-
questionToken?: typescript.QuestionToken | typescript.PlusToken | typescript.MinusToken;
|
|
1368
|
-
readonlyToken?: typescript.ReadonlyKeyword | typescript.PlusToken | typescript.MinusToken;
|
|
1369
|
-
type?: typescript.TypeNode;
|
|
1370
|
-
typeParameter: typescript.TypeParameterDeclaration;
|
|
1371
|
-
}) => typescript.MappedTypeNode;
|
|
1372
|
-
methodDeclaration: ({ accessLevel, comment, isStatic, multiLine, name, parameters, returnType, statements, types, }: {
|
|
1373
|
-
accessLevel?: AccessLevel;
|
|
1374
|
-
comment?: Comments;
|
|
1375
|
-
isStatic?: boolean;
|
|
1376
|
-
multiLine?: boolean;
|
|
1377
|
-
name: string;
|
|
1378
|
-
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1379
|
-
returnType?: string | typescript.TypeNode;
|
|
1380
|
-
statements?: typescript.Statement[];
|
|
1381
|
-
types?: FunctionTypeParameter[];
|
|
1382
|
-
}) => typescript.MethodDeclaration;
|
|
1383
|
-
namedImportDeclarations: ({ imports, module, }: {
|
|
1384
|
-
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1385
|
-
module: string;
|
|
1386
|
-
}) => typescript.ImportDeclaration;
|
|
1387
|
-
namespaceDeclaration: ({ name, statements, }: {
|
|
1388
|
-
name: string;
|
|
1389
|
-
statements: Array<typescript.Statement>;
|
|
1390
|
-
}) => typescript.ModuleDeclaration;
|
|
1391
|
-
newExpression: ({ argumentsArray, expression, typeArguments, }: {
|
|
1392
|
-
argumentsArray?: Array<typescript.Expression>;
|
|
1393
|
-
expression: typescript.Expression;
|
|
1394
|
-
typeArguments?: Array<typescript.TypeNode>;
|
|
1395
|
-
}) => typescript.NewExpression;
|
|
1396
|
-
nodeToString: typeof tsNodeToString;
|
|
1397
|
-
null: () => typescript.NullLiteral;
|
|
1398
|
-
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({ comments, identifiers, multiLine, obj, shorthand, unescape, }: {
|
|
1399
|
-
comments?: Comments;
|
|
1400
|
-
identifiers?: string[];
|
|
1401
|
-
multiLine?: boolean;
|
|
1402
|
-
obj: T;
|
|
1403
|
-
shorthand?: boolean;
|
|
1404
|
-
unescape?: boolean;
|
|
1405
|
-
}) => typescript.ObjectLiteralExpression;
|
|
1406
|
-
ots: {
|
|
1407
|
-
boolean: (value: boolean) => typescript.TrueLiteral | typescript.FalseLiteral;
|
|
1408
|
-
export: ({ alias, asType, name }: ImportExportItemObject) => typescript.ExportSpecifier;
|
|
1409
|
-
import: ({ alias, asType, name }: ImportExportItemObject) => typescript.ImportSpecifier;
|
|
1410
|
-
number: (value: number) => typescript.NumericLiteral | typescript.PrefixUnaryExpression;
|
|
1411
|
-
string: (value: string, unescape?: boolean) => typescript.Identifier | typescript.StringLiteral;
|
|
1412
|
-
};
|
|
1413
|
-
parameterDeclaration: ({ initializer, modifiers, name, required, type, }: {
|
|
1414
|
-
initializer?: typescript.Expression;
|
|
1415
|
-
modifiers?: ReadonlyArray<typescript.ModifierLike>;
|
|
1416
|
-
name: string | typescript.BindingName;
|
|
1417
|
-
required?: boolean;
|
|
1418
|
-
type?: typescript.TypeNode;
|
|
1419
|
-
}) => typescript.ParameterDeclaration;
|
|
1420
|
-
propertyAccessExpression: ({ expression, isOptional, name, }: {
|
|
1421
|
-
expression: string | typescript.Expression;
|
|
1422
|
-
isOptional?: boolean;
|
|
1423
|
-
name: string | number | typescript.MemberName;
|
|
1424
|
-
}) => typescript.PropertyAccessChain | typescript.PropertyAccessExpression | typescript.ElementAccessExpression;
|
|
1425
|
-
propertyAccessExpressions: ({ expressions, }: {
|
|
1426
|
-
expressions: Array<string | typescript.Expression | typescript.MemberName>;
|
|
1427
|
-
}) => typescript.PropertyAccessExpression;
|
|
1428
|
-
propertyAssignment: ({ initializer, name, }: {
|
|
1429
|
-
initializer: typescript.Expression;
|
|
1430
|
-
name: string | typescript.PropertyName;
|
|
1431
|
-
}) => typescript.PropertyAssignment;
|
|
1432
|
-
propertyDeclaration: ({ initializer, modifier, name, type, }: {
|
|
1433
|
-
initializer?: typescript.Expression;
|
|
1434
|
-
modifier?: AccessLevel | "async" | "export" | "readonly" | "static";
|
|
1435
|
-
name: string | typescript.PropertyName;
|
|
1436
|
-
type?: typescript.TypeNode;
|
|
1437
|
-
}) => typescript.PropertyDeclaration;
|
|
1438
|
-
regularExpressionLiteral: ({ flags, text, }: {
|
|
1439
|
-
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1440
|
-
text: string;
|
|
1441
|
-
}) => typescript.RegularExpressionLiteral;
|
|
1442
|
-
returnFunctionCall: ({ args, name, types, }: {
|
|
1443
|
-
args: any[];
|
|
1444
|
-
name: string | typescript.Expression;
|
|
1445
|
-
types?: ReadonlyArray<string | typescript.StringLiteral>;
|
|
1446
|
-
}) => typescript.ReturnStatement;
|
|
1447
|
-
returnStatement: ({ expression, }: {
|
|
1448
|
-
expression?: typescript.Expression;
|
|
1449
|
-
}) => typescript.ReturnStatement;
|
|
1450
|
-
returnVariable: ({ expression, }: {
|
|
1451
|
-
expression: string | typescript.Expression;
|
|
1452
|
-
}) => typescript.ReturnStatement;
|
|
1453
|
-
safeAccessExpression: (path: string[]) => typescript.Expression;
|
|
1454
|
-
stringLiteral: ({ isSingleQuote, text, }: {
|
|
1455
|
-
isSingleQuote?: boolean;
|
|
1456
|
-
text: string;
|
|
1457
|
-
}) => typescript.StringLiteral;
|
|
1458
|
-
templateLiteralType: ({ value, }: {
|
|
1459
|
-
value: ReadonlyArray<string | typescript.TypeNode>;
|
|
1460
|
-
}) => typescript.TemplateLiteralTypeNode;
|
|
1461
|
-
this: () => typescript.ThisExpression;
|
|
1462
|
-
transformArrayMap: ({ path, transformExpression, }: {
|
|
1463
|
-
path: string[];
|
|
1464
|
-
transformExpression: typescript.Expression;
|
|
1465
|
-
}) => typescript.IfStatement;
|
|
1466
|
-
transformArrayMutation: ({ path, transformerName, }: {
|
|
1467
|
-
path: string[];
|
|
1468
|
-
transformerName: string;
|
|
1469
|
-
}) => typescript.Statement;
|
|
1470
|
-
transformDateMutation: ({ path, }: {
|
|
1471
|
-
path: string[];
|
|
1472
|
-
}) => typescript.Statement;
|
|
1473
|
-
transformFunctionMutation: ({ path, transformerName, }: {
|
|
1474
|
-
path: string[];
|
|
1475
|
-
transformerName: string;
|
|
1476
|
-
}) => typescript.IfStatement[];
|
|
1477
|
-
transformNewDate: ({ parameterName, }: {
|
|
1478
|
-
parameterName: string;
|
|
1479
|
-
}) => typescript.NewExpression;
|
|
1480
|
-
typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
|
|
1481
|
-
comment?: Comments;
|
|
1482
|
-
exportType?: boolean;
|
|
1483
|
-
name: string | typescript.TypeReferenceNode;
|
|
1484
|
-
type: string | typescript.TypeNode | typescript.Identifier;
|
|
1485
|
-
typeParameters?: FunctionTypeParameter[];
|
|
1486
|
-
}) => typescript.TypeAliasDeclaration;
|
|
1487
|
-
typeArrayNode: (types: ReadonlyArray<any | typescript.TypeNode> | typescript.TypeNode | typescript.Identifier | string, isNullable?: boolean) => typescript.TypeNode;
|
|
1488
|
-
typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
|
|
1489
|
-
indexKey?: typescript.TypeReferenceNode;
|
|
1490
|
-
indexProperty?: Property;
|
|
1491
|
-
isNullable?: boolean;
|
|
1492
|
-
properties: Property[];
|
|
1493
|
-
useLegacyResolution: boolean;
|
|
1494
|
-
}) => typescript.TypeNode;
|
|
1495
|
-
typeIntersectionNode: ({ isNullable, types, }: {
|
|
1496
|
-
isNullable?: boolean;
|
|
1497
|
-
types: (any | typescript.TypeNode)[];
|
|
1498
|
-
}) => typescript.TypeNode;
|
|
1499
|
-
typeNode: (base: any | typescript.TypeNode, args?: (any | typescript.TypeNode)[]) => typescript.TypeNode;
|
|
1500
|
-
typeOfExpression: ({ text, }: {
|
|
1501
|
-
text: string | typescript.Identifier;
|
|
1502
|
-
}) => typescript.TypeOfExpression;
|
|
1503
|
-
typeOperatorNode: ({ operator, type, }: {
|
|
1504
|
-
operator: "keyof" | "readonly" | "unique";
|
|
1505
|
-
type: typescript.TypeNode;
|
|
1506
|
-
}) => typescript.TypeOperatorNode;
|
|
1507
|
-
typeParameterDeclaration: ({ constraint, defaultType, modifiers, name, }: {
|
|
1508
|
-
constraint?: typescript.TypeNode;
|
|
1509
|
-
defaultType?: typescript.TypeNode;
|
|
1510
|
-
modifiers?: Array<typescript.Modifier>;
|
|
1511
|
-
name: string | typescript.Identifier;
|
|
1512
|
-
}) => typescript.TypeParameterDeclaration;
|
|
1513
|
-
typeParenthesizedNode: ({ type }: {
|
|
1514
|
-
type: typescript.TypeNode;
|
|
1515
|
-
}) => typescript.ParenthesizedTypeNode;
|
|
1516
|
-
typeRecordNode: (keys: (any | typescript.TypeNode)[], values: (any | typescript.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript.TypeNode;
|
|
1517
|
-
typeReferenceNode: ({ typeArguments, typeName, }: {
|
|
1518
|
-
typeArguments?: typescript.TypeNode[];
|
|
1519
|
-
typeName: string | typescript.EntityName;
|
|
1520
|
-
}) => typescript.TypeReferenceNode;
|
|
1521
|
-
typeTupleNode: ({ isNullable, types, }: {
|
|
1522
|
-
isNullable?: boolean;
|
|
1523
|
-
types: Array<any | typescript.TypeNode>;
|
|
1524
|
-
}) => typescript.TypeNode;
|
|
1525
|
-
typeUnionNode: ({ isNullable, types, }: {
|
|
1526
|
-
isNullable?: boolean;
|
|
1527
|
-
types: ReadonlyArray<any | typescript.TypeNode>;
|
|
1528
|
-
}) => typescript.TypeNode;
|
|
1529
|
-
valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
|
|
1530
|
-
identifiers?: string[];
|
|
1531
|
-
isValueAccess?: boolean;
|
|
1532
|
-
shorthand?: boolean;
|
|
1533
|
-
unescape?: boolean;
|
|
1534
|
-
value: T;
|
|
1535
|
-
}) => typescript.Expression | undefined;
|
|
1536
|
-
};
|
|
1537
|
-
|
|
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
|
|
1538
869
|
declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
|
|
1539
|
-
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region src/config/plugins.d.ts
|
|
1540
872
|
/**
|
|
1541
873
|
* Default plugins used to generate artifacts if plugins aren't specified.
|
|
1542
874
|
*/
|
|
1543
875
|
declare const defaultPlugins: readonly ["@hey-api/typescript", "@hey-api/sdk"];
|
|
1544
|
-
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/plugins/@hey-api/client-core/config.d.ts
|
|
1545
878
|
declare const clientDefaultConfig: {
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
879
|
+
readonly baseUrl: true;
|
|
880
|
+
readonly bundle: true;
|
|
881
|
+
readonly exportFromIndex: false;
|
|
1549
882
|
};
|
|
1550
883
|
declare const clientDefaultMeta: {
|
|
1551
|
-
|
|
1552
|
-
|
|
884
|
+
readonly dependencies: readonly ["@hey-api/typescript"];
|
|
885
|
+
readonly tags: readonly ["client"];
|
|
1553
886
|
};
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
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
|
|
1557
894
|
declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<Plugin.UserConfig<T["config"]>, "name">) => Omit<Plugin.Config<T>, "name"> & {
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
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;
|
|
1565
902
|
};
|
|
1566
|
-
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region src/utils/exports.d.ts
|
|
1567
905
|
declare const utils: {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
906
|
+
stringCase: ({
|
|
907
|
+
case: _case,
|
|
908
|
+
stripLeadingSeparators,
|
|
909
|
+
value
|
|
910
|
+
}: {
|
|
911
|
+
readonly case: StringCase | undefined;
|
|
912
|
+
stripLeadingSeparators?: boolean;
|
|
913
|
+
value: string;
|
|
914
|
+
}) => string;
|
|
1573
915
|
};
|
|
1574
|
-
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/index.d.ts
|
|
1575
918
|
/**
|
|
1576
919
|
* Generate a client from the provided configuration.
|
|
1577
920
|
*
|
|
@@ -1582,5 +925,6 @@ declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, l
|
|
|
1582
925
|
* Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s)
|
|
1583
926
|
*/
|
|
1584
927
|
declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>;
|
|
1585
|
-
|
|
1586
|
-
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
|