groove-dev 0.27.144 → 0.27.145
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/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/daemon/src/conversations.js +18 -48
- package/node_modules/@groove-dev/daemon/src/routes/agents.js +6 -83
- package/node_modules/@groove-dev/gui/dist/assets/{index-BcoF6_eF.js → index-Bxc0gU06.js} +232 -238
- package/node_modules/@groove-dev/gui/dist/assets/index-C0pztKBn.css +1 -0
- package/node_modules/@groove-dev/gui/dist/index.html +2 -2
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +80 -95
- package/node_modules/@groove-dev/gui/src/components/agents/agent-panel.jsx +2 -70
- package/node_modules/@groove-dev/gui/src/components/chat/chat-header.jsx +2 -0
- package/node_modules/@groove-dev/gui/src/components/chat/chat-input.jsx +68 -66
- package/node_modules/@groove-dev/gui/src/components/chat/chat-view.jsx +4 -8
- package/node_modules/@groove-dev/gui/src/components/lab/chat-playground.jsx +39 -31
- package/node_modules/@groove-dev/gui/src/components/lab/parameter-panel.jsx +66 -65
- package/node_modules/@groove-dev/gui/src/components/lab/preset-manager.jsx +17 -14
- package/node_modules/@groove-dev/gui/src/components/lab/runtime-config.jsx +126 -127
- package/node_modules/@groove-dev/gui/src/components/lab/system-prompt-editor.jsx +10 -8
- package/node_modules/@groove-dev/gui/src/components/ui/slider.jsx +8 -8
- package/node_modules/@groove-dev/gui/src/lib/status.js +1 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +17 -0
- package/node_modules/@groove-dev/gui/src/stores/slices/agents-slice.js +8 -1
- package/node_modules/@groove-dev/gui/src/stores/slices/chat-slice.js +13 -14
- package/node_modules/@groove-dev/gui/src/views/model-lab.jsx +41 -10
- package/node_modules/@groove-dev/gui/src/views/models.jsx +57 -36
- package/node_modules/axios/CHANGELOG.md +260 -0
- package/node_modules/axios/README.md +595 -223
- package/node_modules/axios/dist/axios.js +1460 -1090
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +1560 -1132
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +1557 -1128
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +1594 -1057
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +40 -41
- package/node_modules/axios/index.d.ts +151 -227
- package/node_modules/axios/index.js +2 -0
- package/node_modules/axios/lib/adapters/adapters.js +4 -2
- package/node_modules/axios/lib/adapters/fetch.js +147 -16
- package/node_modules/axios/lib/adapters/http.js +306 -58
- package/node_modules/axios/lib/adapters/xhr.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +7 -3
- package/node_modules/axios/lib/core/AxiosError.js +120 -34
- package/node_modules/axios/lib/core/AxiosHeaders.js +27 -25
- package/node_modules/axios/lib/core/buildFullPath.js +1 -1
- package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
- package/node_modules/axios/lib/core/mergeConfig.js +21 -4
- package/node_modules/axios/lib/core/settle.js +7 -11
- package/node_modules/axios/lib/defaults/index.js +14 -9
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -2
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +14 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +3 -2
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +5 -5
- package/node_modules/axios/lib/helpers/resolveConfig.js +54 -18
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +74 -2
- package/node_modules/axios/lib/helpers/toFormData.js +10 -2
- package/node_modules/axios/lib/helpers/validator.js +3 -1
- package/node_modules/axios/lib/utils.js +33 -21
- package/node_modules/axios/package.json +17 -24
- package/node_modules/follow-redirects/README.md +7 -5
- package/node_modules/follow-redirects/index.js +24 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/daemon/src/conversations.js +18 -48
- package/packages/daemon/src/routes/agents.js +6 -83
- package/packages/gui/dist/assets/{index-BcoF6_eF.js → index-Bxc0gU06.js} +232 -238
- package/packages/gui/dist/assets/index-C0pztKBn.css +1 -0
- package/packages/gui/dist/index.html +2 -2
- package/packages/gui/package.json +1 -1
- package/packages/gui/src/components/agents/agent-feed.jsx +80 -95
- package/packages/gui/src/components/agents/agent-panel.jsx +2 -70
- package/packages/gui/src/components/chat/chat-header.jsx +2 -0
- package/packages/gui/src/components/chat/chat-input.jsx +68 -66
- package/packages/gui/src/components/chat/chat-view.jsx +4 -8
- package/packages/gui/src/components/lab/chat-playground.jsx +39 -31
- package/packages/gui/src/components/lab/parameter-panel.jsx +66 -65
- package/packages/gui/src/components/lab/preset-manager.jsx +17 -14
- package/packages/gui/src/components/lab/runtime-config.jsx +126 -127
- package/packages/gui/src/components/lab/system-prompt-editor.jsx +10 -8
- package/packages/gui/src/components/ui/slider.jsx +8 -8
- package/packages/gui/src/lib/status.js +1 -0
- package/packages/gui/src/stores/groove.js +17 -0
- package/packages/gui/src/stores/slices/agents-slice.js +8 -1
- package/packages/gui/src/stores/slices/chat-slice.js +13 -14
- package/packages/gui/src/views/model-lab.jsx +41 -10
- package/packages/gui/src/views/models.jsx +57 -36
- package/node_modules/@groove-dev/gui/dist/assets/index-Dd7qhiEd.css +0 -1
- package/packages/gui/dist/assets/index-Dd7qhiEd.css +0 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
// TypeScript Version: 4.7
|
|
2
2
|
type StringLiteralsOrString<Literals extends string> = Literals | (string & {});
|
|
3
3
|
|
|
4
|
-
export type AxiosHeaderValue =
|
|
5
|
-
| AxiosHeaders
|
|
6
|
-
| string
|
|
7
|
-
| string[]
|
|
8
|
-
| number
|
|
9
|
-
| boolean
|
|
10
|
-
| null;
|
|
4
|
+
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
|
11
5
|
|
|
12
|
-
interface RawAxiosHeaders {
|
|
6
|
+
export interface RawAxiosHeaders {
|
|
13
7
|
[key: string]: AxiosHeaderValue;
|
|
14
8
|
}
|
|
15
9
|
|
|
@@ -24,11 +18,7 @@ type AxiosHeaderMatcher =
|
|
|
24
18
|
| RegExp
|
|
25
19
|
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
26
20
|
|
|
27
|
-
type AxiosHeaderParser = (
|
|
28
|
-
this: AxiosHeaders,
|
|
29
|
-
value: AxiosHeaderValue,
|
|
30
|
-
header: string,
|
|
31
|
-
) => any;
|
|
21
|
+
type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
|
32
22
|
|
|
33
23
|
export class AxiosHeaders {
|
|
34
24
|
constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);
|
|
@@ -38,12 +28,9 @@ export class AxiosHeaders {
|
|
|
38
28
|
set(
|
|
39
29
|
headerName?: string,
|
|
40
30
|
value?: AxiosHeaderValue,
|
|
41
|
-
rewrite?: boolean | AxiosHeaderMatcher
|
|
42
|
-
): AxiosHeaders;
|
|
43
|
-
set(
|
|
44
|
-
headers?: RawAxiosHeaders | AxiosHeaders | string,
|
|
45
|
-
rewrite?: boolean,
|
|
31
|
+
rewrite?: boolean | AxiosHeaderMatcher
|
|
46
32
|
): AxiosHeaders;
|
|
33
|
+
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
|
47
34
|
|
|
48
35
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
49
36
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
@@ -57,9 +44,7 @@ export class AxiosHeaders {
|
|
|
57
44
|
normalize(format: boolean): AxiosHeaders;
|
|
58
45
|
|
|
59
46
|
concat(
|
|
60
|
-
...targets: Array<
|
|
61
|
-
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
|
62
|
-
>
|
|
47
|
+
...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
|
|
63
48
|
): AxiosHeaders;
|
|
64
49
|
|
|
65
50
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
|
@@ -69,55 +54,35 @@ export class AxiosHeaders {
|
|
|
69
54
|
static accessor(header: string | string[]): AxiosHeaders;
|
|
70
55
|
|
|
71
56
|
static concat(
|
|
72
|
-
...targets: Array<
|
|
73
|
-
AxiosHeaders | RawAxiosHeaders | string | undefined | null
|
|
74
|
-
>
|
|
57
|
+
...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
|
|
75
58
|
): AxiosHeaders;
|
|
76
59
|
|
|
77
|
-
setContentType(
|
|
78
|
-
value: ContentType,
|
|
79
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
80
|
-
): AxiosHeaders;
|
|
60
|
+
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
81
61
|
getContentType(parser?: RegExp): RegExpExecArray | null;
|
|
82
62
|
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
83
63
|
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
|
84
64
|
|
|
85
|
-
setContentLength(
|
|
86
|
-
value: AxiosHeaderValue,
|
|
87
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
88
|
-
): AxiosHeaders;
|
|
65
|
+
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
89
66
|
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
|
90
67
|
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
91
68
|
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
|
92
69
|
|
|
93
|
-
setAccept(
|
|
94
|
-
value: AxiosHeaderValue,
|
|
95
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
96
|
-
): AxiosHeaders;
|
|
70
|
+
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
97
71
|
getAccept(parser?: RegExp): RegExpExecArray | null;
|
|
98
72
|
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
99
73
|
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
|
100
74
|
|
|
101
|
-
setUserAgent(
|
|
102
|
-
value: AxiosHeaderValue,
|
|
103
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
104
|
-
): AxiosHeaders;
|
|
75
|
+
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
105
76
|
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
|
106
77
|
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
107
78
|
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
|
108
79
|
|
|
109
|
-
setContentEncoding(
|
|
110
|
-
value: AxiosHeaderValue,
|
|
111
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
112
|
-
): AxiosHeaders;
|
|
80
|
+
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
113
81
|
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
|
114
82
|
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
115
83
|
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
|
116
84
|
|
|
117
|
-
setAuthorization(
|
|
118
|
-
value: AxiosHeaderValue,
|
|
119
|
-
rewrite?: boolean | AxiosHeaderMatcher,
|
|
120
|
-
): AxiosHeaders;
|
|
85
|
+
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
|
121
86
|
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
|
122
87
|
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
|
123
88
|
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
|
@@ -128,56 +93,53 @@ export class AxiosHeaders {
|
|
|
128
93
|
}
|
|
129
94
|
|
|
130
95
|
type CommonRequestHeadersList =
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
96
|
+
| 'Accept'
|
|
97
|
+
| 'Content-Length'
|
|
98
|
+
| 'User-Agent'
|
|
99
|
+
| 'Content-Encoding'
|
|
100
|
+
| 'Authorization'
|
|
101
|
+
| 'Location';
|
|
136
102
|
|
|
137
103
|
type ContentType =
|
|
138
104
|
| AxiosHeaderValue
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
105
|
+
| 'text/html'
|
|
106
|
+
| 'text/plain'
|
|
107
|
+
| 'multipart/form-data'
|
|
108
|
+
| 'application/json'
|
|
109
|
+
| 'application/x-www-form-urlencoded'
|
|
110
|
+
| 'application/octet-stream';
|
|
145
111
|
|
|
146
112
|
export type RawAxiosRequestHeaders = Partial<
|
|
147
113
|
RawAxiosHeaders & {
|
|
148
114
|
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
|
149
115
|
} & {
|
|
150
|
-
|
|
116
|
+
'Content-Type': ContentType;
|
|
151
117
|
}
|
|
152
118
|
>;
|
|
153
119
|
|
|
154
120
|
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
|
155
121
|
|
|
156
122
|
type CommonResponseHeadersList =
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
123
|
+
| 'Server'
|
|
124
|
+
| 'Content-Type'
|
|
125
|
+
| 'Content-Length'
|
|
126
|
+
| 'Cache-Control'
|
|
127
|
+
| 'Content-Encoding';
|
|
128
|
+
|
|
129
|
+
type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>;
|
|
162
130
|
|
|
163
131
|
type RawCommonResponseHeaders = {
|
|
164
|
-
[Key in
|
|
132
|
+
[Key in CommonResponseHeaderKey]: AxiosHeaderValue;
|
|
165
133
|
} & {
|
|
166
|
-
|
|
134
|
+
'set-cookie': string[];
|
|
167
135
|
};
|
|
168
136
|
|
|
169
|
-
export type RawAxiosResponseHeaders = Partial<
|
|
170
|
-
RawAxiosHeaders & RawCommonResponseHeaders
|
|
171
|
-
>;
|
|
137
|
+
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
|
172
138
|
|
|
173
139
|
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
|
174
140
|
|
|
175
141
|
export interface AxiosRequestTransformer {
|
|
176
|
-
(
|
|
177
|
-
this: InternalAxiosRequestConfig,
|
|
178
|
-
data: any,
|
|
179
|
-
headers: AxiosRequestHeaders,
|
|
180
|
-
): any;
|
|
142
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
|
181
143
|
}
|
|
182
144
|
|
|
183
145
|
export interface AxiosResponseTransformer {
|
|
@@ -185,7 +147,7 @@ export interface AxiosResponseTransformer {
|
|
|
185
147
|
this: InternalAxiosRequestConfig,
|
|
186
148
|
data: any,
|
|
187
149
|
headers: AxiosResponseHeaders,
|
|
188
|
-
status?: number
|
|
150
|
+
status?: number
|
|
189
151
|
): any;
|
|
190
152
|
}
|
|
191
153
|
|
|
@@ -271,62 +233,48 @@ export enum HttpStatusCode {
|
|
|
271
233
|
NetworkAuthenticationRequired = 511,
|
|
272
234
|
}
|
|
273
235
|
|
|
274
|
-
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
|
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
| "PATCH"
|
|
289
|
-
| "purge"
|
|
290
|
-
| "PURGE"
|
|
291
|
-
| "link"
|
|
292
|
-
| "LINK"
|
|
293
|
-
| "unlink"
|
|
294
|
-
| "UNLINK";
|
|
236
|
+
type UppercaseMethod =
|
|
237
|
+
| 'GET'
|
|
238
|
+
| 'DELETE'
|
|
239
|
+
| 'HEAD'
|
|
240
|
+
| 'OPTIONS'
|
|
241
|
+
| 'POST'
|
|
242
|
+
| 'PUT'
|
|
243
|
+
| 'PATCH'
|
|
244
|
+
| 'PURGE'
|
|
245
|
+
| 'LINK'
|
|
246
|
+
| 'UNLINK'
|
|
247
|
+
| 'QUERY';
|
|
248
|
+
|
|
249
|
+
export type Method = (UppercaseMethod | Lowercase<UppercaseMethod>) & {};
|
|
295
250
|
|
|
296
251
|
export type ResponseType =
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
|
|
|
300
|
-
|
|
|
301
|
-
|
|
|
302
|
-
|
|
|
303
|
-
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
|
307
|
-
|
|
|
308
|
-
|
|
|
309
|
-
|
|
|
310
|
-
|
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
|
314
|
-
|
|
|
315
|
-
|
|
|
316
|
-
|
|
|
317
|
-
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
323
|
-
| "UCS2"
|
|
324
|
-
| "utf-8"
|
|
325
|
-
| "UTF-8"
|
|
326
|
-
| "utf8"
|
|
327
|
-
| "UTF8"
|
|
328
|
-
| "utf16le"
|
|
329
|
-
| "UTF16LE";
|
|
252
|
+
| 'arraybuffer'
|
|
253
|
+
| 'blob'
|
|
254
|
+
| 'document'
|
|
255
|
+
| 'json'
|
|
256
|
+
| 'text'
|
|
257
|
+
| 'stream'
|
|
258
|
+
| 'formdata';
|
|
259
|
+
|
|
260
|
+
type UppercaseResponseEncoding =
|
|
261
|
+
| 'ASCII'
|
|
262
|
+
| 'ANSI'
|
|
263
|
+
| 'BINARY'
|
|
264
|
+
| 'BASE64'
|
|
265
|
+
| 'BASE64URL'
|
|
266
|
+
| 'HEX'
|
|
267
|
+
| 'LATIN1'
|
|
268
|
+
| 'UCS-2'
|
|
269
|
+
| 'UCS2'
|
|
270
|
+
| 'UTF-8'
|
|
271
|
+
| 'UTF8'
|
|
272
|
+
| 'UTF16LE';
|
|
273
|
+
|
|
274
|
+
export type responseEncoding = (
|
|
275
|
+
| UppercaseResponseEncoding
|
|
276
|
+
| Lowercase<UppercaseResponseEncoding>
|
|
277
|
+
) & {};
|
|
330
278
|
|
|
331
279
|
export interface TransitionalOptions {
|
|
332
280
|
silentJSONParsing?: boolean;
|
|
@@ -354,7 +302,7 @@ export interface SerializerVisitor {
|
|
|
354
302
|
value: any,
|
|
355
303
|
key: string | number,
|
|
356
304
|
path: null | Array<string | number>,
|
|
357
|
-
helpers: FormDataVisitorHelpers
|
|
305
|
+
helpers: FormDataVisitorHelpers
|
|
358
306
|
): boolean;
|
|
359
307
|
}
|
|
360
308
|
|
|
@@ -402,7 +350,7 @@ export interface AxiosProgressEvent {
|
|
|
402
350
|
|
|
403
351
|
type Milliseconds = number;
|
|
404
352
|
|
|
405
|
-
type AxiosAdapterName = StringLiteralsOrString<
|
|
353
|
+
type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>;
|
|
406
354
|
|
|
407
355
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
408
356
|
|
|
@@ -448,8 +396,14 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
448
396
|
headers: Record<string, string>;
|
|
449
397
|
statusCode: HttpStatusCode;
|
|
450
398
|
},
|
|
399
|
+
requestDetails: {
|
|
400
|
+
headers: Record<string, string>;
|
|
401
|
+
url: string;
|
|
402
|
+
method: string;
|
|
403
|
+
},
|
|
451
404
|
) => void;
|
|
452
405
|
socketPath?: string | null;
|
|
406
|
+
allowedSocketPaths?: string | string[] | null;
|
|
453
407
|
transport?: any;
|
|
454
408
|
httpAgent?: any;
|
|
455
409
|
httpsAgent?: any;
|
|
@@ -461,24 +415,11 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
461
415
|
insecureHTTPParser?: boolean;
|
|
462
416
|
env?: {
|
|
463
417
|
FormData?: new (...args: any[]) => object;
|
|
464
|
-
fetch?: (
|
|
465
|
-
|
|
466
|
-
init?: RequestInit,
|
|
467
|
-
) => Promise<Response>;
|
|
468
|
-
Request?: new (
|
|
469
|
-
input: URL | Request | string,
|
|
470
|
-
init?: RequestInit,
|
|
471
|
-
) => Request;
|
|
418
|
+
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
|
419
|
+
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
|
472
420
|
Response?: new (
|
|
473
|
-
body?:
|
|
474
|
-
|
|
475
|
-
| ArrayBufferView
|
|
476
|
-
| Blob
|
|
477
|
-
| FormData
|
|
478
|
-
| URLSearchParams
|
|
479
|
-
| string
|
|
480
|
-
| null,
|
|
481
|
-
init?: ResponseInit,
|
|
421
|
+
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
|
422
|
+
init?: ResponseInit
|
|
482
423
|
) => Response;
|
|
483
424
|
};
|
|
484
425
|
formSerializer?: FormSerializerOptions;
|
|
@@ -490,38 +431,30 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
490
431
|
cb: (
|
|
491
432
|
err: Error | null,
|
|
492
433
|
address: LookupAddress | LookupAddress[],
|
|
493
|
-
family?: AddressFamily
|
|
494
|
-
) => void
|
|
434
|
+
family?: AddressFamily
|
|
435
|
+
) => void
|
|
495
436
|
) => void)
|
|
496
437
|
| ((
|
|
497
438
|
hostname: string,
|
|
498
|
-
options: object
|
|
439
|
+
options: object
|
|
499
440
|
) => Promise<
|
|
500
|
-
| [
|
|
501
|
-
address: LookupAddressEntry | LookupAddressEntry[],
|
|
502
|
-
family?: AddressFamily,
|
|
503
|
-
]
|
|
504
|
-
| LookupAddress
|
|
441
|
+
[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress
|
|
505
442
|
>);
|
|
506
|
-
withXSRFToken?:
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
parseReviver?: (this: any, key: string, value: any) => any;
|
|
510
|
-
fetchOptions?:
|
|
511
|
-
| Omit<RequestInit, "body" | "headers" | "method" | "signal">
|
|
512
|
-
| Record<string, any>;
|
|
443
|
+
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
|
444
|
+
parseReviver?: (this: any, key: string, value: any, context?: { source: string }) => any;
|
|
445
|
+
fetchOptions?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | Record<string, any>;
|
|
513
446
|
httpVersion?: 1 | 2;
|
|
514
447
|
http2Options?: Record<string, any> & {
|
|
515
448
|
sessionTimeout?: number;
|
|
516
449
|
};
|
|
450
|
+
formDataHeaderPolicy?: 'legacy' | 'content-only';
|
|
451
|
+
redact?: string[];
|
|
517
452
|
}
|
|
518
453
|
|
|
519
454
|
// Alias
|
|
520
455
|
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
|
521
456
|
|
|
522
|
-
export interface InternalAxiosRequestConfig<
|
|
523
|
-
D = any,
|
|
524
|
-
> extends AxiosRequestConfig<D> {
|
|
457
|
+
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
|
525
458
|
headers: AxiosRequestHeaders;
|
|
526
459
|
}
|
|
527
460
|
|
|
@@ -537,19 +470,14 @@ export interface HeadersDefaults {
|
|
|
537
470
|
purge?: RawAxiosRequestHeaders;
|
|
538
471
|
link?: RawAxiosRequestHeaders;
|
|
539
472
|
unlink?: RawAxiosRequestHeaders;
|
|
473
|
+
query?: RawAxiosRequestHeaders;
|
|
540
474
|
}
|
|
541
475
|
|
|
542
|
-
export interface AxiosDefaults<D = any> extends Omit<
|
|
543
|
-
AxiosRequestConfig<D>,
|
|
544
|
-
"headers"
|
|
545
|
-
> {
|
|
476
|
+
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
|
546
477
|
headers: HeadersDefaults;
|
|
547
478
|
}
|
|
548
479
|
|
|
549
|
-
export interface CreateAxiosDefaults<D = any> extends Omit<
|
|
550
|
-
AxiosRequestConfig<D>,
|
|
551
|
-
"headers"
|
|
552
|
-
> {
|
|
480
|
+
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
|
553
481
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
|
554
482
|
}
|
|
555
483
|
|
|
@@ -568,7 +496,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|
|
568
496
|
code?: string,
|
|
569
497
|
config?: InternalAxiosRequestConfig<D>,
|
|
570
498
|
request?: any,
|
|
571
|
-
response?: AxiosResponse<T, D
|
|
499
|
+
response?: AxiosResponse<T, D>
|
|
572
500
|
);
|
|
573
501
|
|
|
574
502
|
config?: InternalAxiosRequestConfig<D>;
|
|
@@ -586,24 +514,26 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|
|
586
514
|
config?: InternalAxiosRequestConfig<D>,
|
|
587
515
|
request?: any,
|
|
588
516
|
response?: AxiosResponse<T, D>,
|
|
589
|
-
customProps?: object
|
|
517
|
+
customProps?: object
|
|
590
518
|
): AxiosError<T, D>;
|
|
591
|
-
static readonly ERR_FR_TOO_MANY_REDIRECTS =
|
|
592
|
-
static readonly ERR_BAD_OPTION_VALUE =
|
|
593
|
-
static readonly ERR_BAD_OPTION =
|
|
594
|
-
static readonly ERR_NETWORK =
|
|
595
|
-
static readonly ERR_DEPRECATED =
|
|
596
|
-
static readonly ERR_BAD_RESPONSE =
|
|
597
|
-
static readonly ERR_BAD_REQUEST =
|
|
598
|
-
static readonly ERR_NOT_SUPPORT =
|
|
599
|
-
static readonly ERR_INVALID_URL =
|
|
600
|
-
static readonly ERR_CANCELED =
|
|
601
|
-
static readonly
|
|
602
|
-
static readonly
|
|
519
|
+
static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
520
|
+
static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
521
|
+
static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
522
|
+
static readonly ERR_NETWORK = 'ERR_NETWORK';
|
|
523
|
+
static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
524
|
+
static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
525
|
+
static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
526
|
+
static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
527
|
+
static readonly ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
528
|
+
static readonly ERR_CANCELED = 'ERR_CANCELED';
|
|
529
|
+
static readonly ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
530
|
+
static readonly ECONNABORTED = 'ECONNABORTED';
|
|
531
|
+
static readonly ECONNREFUSED = 'ECONNREFUSED';
|
|
532
|
+
static readonly ETIMEDOUT = 'ETIMEDOUT';
|
|
603
533
|
}
|
|
604
534
|
|
|
605
535
|
export class CanceledError<T> extends AxiosError<T> {
|
|
606
|
-
readonly name:
|
|
536
|
+
readonly name: 'CanceledError';
|
|
607
537
|
}
|
|
608
538
|
|
|
609
539
|
export type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
|
@@ -638,7 +568,7 @@ export interface CancelTokenSource {
|
|
|
638
568
|
|
|
639
569
|
export interface AxiosInterceptorOptions {
|
|
640
570
|
synchronous?: boolean;
|
|
641
|
-
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
|
571
|
+
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
|
642
572
|
}
|
|
643
573
|
|
|
644
574
|
type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
|
|
@@ -647,25 +577,23 @@ type AxiosInterceptorRejected = (error: any) => any;
|
|
|
647
577
|
type AxiosRequestInterceptorUse<T> = (
|
|
648
578
|
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
649
579
|
onRejected?: AxiosInterceptorRejected | null,
|
|
650
|
-
options?: AxiosInterceptorOptions
|
|
580
|
+
options?: AxiosInterceptorOptions
|
|
651
581
|
) => number;
|
|
652
582
|
|
|
653
583
|
type AxiosResponseInterceptorUse<T> = (
|
|
654
584
|
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
655
|
-
onRejected?: AxiosInterceptorRejected | null
|
|
585
|
+
onRejected?: AxiosInterceptorRejected | null
|
|
656
586
|
) => number;
|
|
657
587
|
|
|
658
588
|
interface AxiosInterceptorHandler<T> {
|
|
659
589
|
fulfilled: AxiosInterceptorFulfilled<T>;
|
|
660
590
|
rejected?: AxiosInterceptorRejected;
|
|
661
591
|
synchronous: boolean;
|
|
662
|
-
runWhen
|
|
592
|
+
runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null;
|
|
663
593
|
}
|
|
664
594
|
|
|
665
595
|
export interface AxiosInterceptorManager<V> {
|
|
666
|
-
use: V extends AxiosResponse
|
|
667
|
-
? AxiosResponseInterceptorUse<V>
|
|
668
|
-
: AxiosRequestInterceptorUse<V>;
|
|
596
|
+
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
|
669
597
|
eject(id: number): void;
|
|
670
598
|
clear(): void;
|
|
671
599
|
handlers?: Array<AxiosInterceptorHandler<V>>;
|
|
@@ -679,68 +607,66 @@ export class Axios {
|
|
|
679
607
|
response: AxiosInterceptorManager<AxiosResponse>;
|
|
680
608
|
};
|
|
681
609
|
getUri(config?: AxiosRequestConfig): string;
|
|
682
|
-
request<T = any, R = AxiosResponse<T>, D = any>(
|
|
683
|
-
config: AxiosRequestConfig<D>,
|
|
684
|
-
): Promise<R>;
|
|
610
|
+
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
685
611
|
get<T = any, R = AxiosResponse<T>, D = any>(
|
|
686
612
|
url: string,
|
|
687
|
-
config?: AxiosRequestConfig<D
|
|
613
|
+
config?: AxiosRequestConfig<D>
|
|
688
614
|
): Promise<R>;
|
|
689
615
|
delete<T = any, R = AxiosResponse<T>, D = any>(
|
|
690
616
|
url: string,
|
|
691
|
-
config?: AxiosRequestConfig<D
|
|
617
|
+
config?: AxiosRequestConfig<D>
|
|
692
618
|
): Promise<R>;
|
|
693
619
|
head<T = any, R = AxiosResponse<T>, D = any>(
|
|
694
620
|
url: string,
|
|
695
|
-
config?: AxiosRequestConfig<D
|
|
621
|
+
config?: AxiosRequestConfig<D>
|
|
696
622
|
): Promise<R>;
|
|
697
623
|
options<T = any, R = AxiosResponse<T>, D = any>(
|
|
698
624
|
url: string,
|
|
699
|
-
config?: AxiosRequestConfig<D
|
|
625
|
+
config?: AxiosRequestConfig<D>
|
|
700
626
|
): Promise<R>;
|
|
701
627
|
post<T = any, R = AxiosResponse<T>, D = any>(
|
|
702
628
|
url: string,
|
|
703
629
|
data?: D,
|
|
704
|
-
config?: AxiosRequestConfig<D
|
|
630
|
+
config?: AxiosRequestConfig<D>
|
|
705
631
|
): Promise<R>;
|
|
706
632
|
put<T = any, R = AxiosResponse<T>, D = any>(
|
|
707
633
|
url: string,
|
|
708
634
|
data?: D,
|
|
709
|
-
config?: AxiosRequestConfig<D
|
|
635
|
+
config?: AxiosRequestConfig<D>
|
|
710
636
|
): Promise<R>;
|
|
711
637
|
patch<T = any, R = AxiosResponse<T>, D = any>(
|
|
712
638
|
url: string,
|
|
713
639
|
data?: D,
|
|
714
|
-
config?: AxiosRequestConfig<D
|
|
640
|
+
config?: AxiosRequestConfig<D>
|
|
715
641
|
): Promise<R>;
|
|
716
642
|
postForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
717
643
|
url: string,
|
|
718
644
|
data?: D,
|
|
719
|
-
config?: AxiosRequestConfig<D
|
|
645
|
+
config?: AxiosRequestConfig<D>
|
|
720
646
|
): Promise<R>;
|
|
721
647
|
putForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
722
648
|
url: string,
|
|
723
649
|
data?: D,
|
|
724
|
-
config?: AxiosRequestConfig<D
|
|
650
|
+
config?: AxiosRequestConfig<D>
|
|
725
651
|
): Promise<R>;
|
|
726
652
|
patchForm<T = any, R = AxiosResponse<T>, D = any>(
|
|
727
653
|
url: string,
|
|
728
654
|
data?: D,
|
|
729
|
-
config?: AxiosRequestConfig<D
|
|
655
|
+
config?: AxiosRequestConfig<D>
|
|
656
|
+
): Promise<R>;
|
|
657
|
+
query<T = any, R = AxiosResponse<T>, D = any>(
|
|
658
|
+
url: string,
|
|
659
|
+
data?: D,
|
|
660
|
+
config?: AxiosRequestConfig<D>
|
|
730
661
|
): Promise<R>;
|
|
731
662
|
}
|
|
732
663
|
|
|
733
664
|
export interface AxiosInstance extends Axios {
|
|
734
|
-
<T = any, R = AxiosResponse<T>, D = any>(
|
|
735
|
-
|
|
736
|
-
): Promise<R>;
|
|
737
|
-
<T = any, R = AxiosResponse<T>, D = any>(
|
|
738
|
-
url: string,
|
|
739
|
-
config?: AxiosRequestConfig<D>,
|
|
740
|
-
): Promise<R>;
|
|
665
|
+
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
666
|
+
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
741
667
|
|
|
742
668
|
create(config?: CreateAxiosDefaults): AxiosInstance;
|
|
743
|
-
defaults: Omit<AxiosDefaults,
|
|
669
|
+
defaults: Omit<AxiosDefaults, 'headers'> & {
|
|
744
670
|
headers: HeadersDefaults & {
|
|
745
671
|
[key: string]: AxiosHeaderValue;
|
|
746
672
|
};
|
|
@@ -758,22 +684,18 @@ export interface GenericHTMLFormElement {
|
|
|
758
684
|
}
|
|
759
685
|
|
|
760
686
|
export function getAdapter(
|
|
761
|
-
adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined
|
|
687
|
+
adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined
|
|
762
688
|
): AxiosAdapter;
|
|
763
689
|
|
|
764
690
|
export function toFormData(
|
|
765
691
|
sourceObj: object,
|
|
766
692
|
targetFormData?: GenericFormData,
|
|
767
|
-
options?: FormSerializerOptions
|
|
693
|
+
options?: FormSerializerOptions
|
|
768
694
|
): GenericFormData;
|
|
769
695
|
|
|
770
|
-
export function formToJSON(
|
|
771
|
-
form: GenericFormData | GenericHTMLFormElement,
|
|
772
|
-
): object;
|
|
696
|
+
export function formToJSON(form: GenericFormData | GenericHTMLFormElement): object;
|
|
773
697
|
|
|
774
|
-
export function isAxiosError<T = any, D = any>(
|
|
775
|
-
payload: any,
|
|
776
|
-
): payload is AxiosError<T, D>;
|
|
698
|
+
export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
|
777
699
|
|
|
778
700
|
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
|
779
701
|
|
|
@@ -783,9 +705,11 @@ export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
|
|
783
705
|
|
|
784
706
|
export function mergeConfig<D = any>(
|
|
785
707
|
config1: AxiosRequestConfig<D>,
|
|
786
|
-
config2: AxiosRequestConfig<D
|
|
708
|
+
config2: AxiosRequestConfig<D>
|
|
787
709
|
): AxiosRequestConfig<D>;
|
|
788
710
|
|
|
711
|
+
export function create(config?: CreateAxiosDefaults): AxiosInstance;
|
|
712
|
+
|
|
789
713
|
export interface AxiosStatic extends AxiosInstance {
|
|
790
714
|
Cancel: CancelStatic;
|
|
791
715
|
CancelToken: CancelTokenStatic;
|
|
@@ -25,11 +25,13 @@ const knownAdapters = {
|
|
|
25
25
|
utils.forEach(knownAdapters, (fn, value) => {
|
|
26
26
|
if (fn) {
|
|
27
27
|
try {
|
|
28
|
-
Object.
|
|
28
|
+
// Null-proto descriptors so a polluted Object.prototype.get cannot turn
|
|
29
|
+
// these data descriptors into accessor descriptors on the way in.
|
|
30
|
+
Object.defineProperty(fn, 'name', { __proto__: null, value });
|
|
29
31
|
} catch (e) {
|
|
30
32
|
// eslint-disable-next-line no-empty
|
|
31
33
|
}
|
|
32
|
-
Object.defineProperty(fn, 'adapterName', { value });
|
|
34
|
+
Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
|
|
33
35
|
}
|
|
34
36
|
});
|
|
35
37
|
|