@jerome-benoit/sap-ai-provider-v2 4.9.1 → 5.0.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 +114 -66
- package/dist/{chunk-5ZKQJNHO.js → chunk-2KOXKYVT.js} +482 -220
- package/dist/chunk-2KOXKYVT.js.map +1 -0
- package/dist/{chunk-5EDF6MHL.js → chunk-643USI3B.js} +8 -7
- package/dist/chunk-643USI3B.js.map +1 -0
- package/dist/{chunk-VHZSAQBJ.js → chunk-AFZC2DH2.js} +2 -2
- package/dist/chunk-AFZC2DH2.js.map +1 -0
- package/dist/{chunk-5JVF4555.js → chunk-JRUSQTKB.js} +3 -3
- package/dist/{chunk-4JIMBRMV.js → chunk-MF3VO3ER.js} +154 -20
- package/dist/chunk-MF3VO3ER.js.map +1 -0
- package/dist/{chunk-RJFB6VFO.js → chunk-U23M3VYO.js} +2 -2
- package/dist/{foundation-models-embedding-model-strategy-VKBRG7RT.js → foundation-models-embedding-model-strategy-2GUADNXT.js} +4 -4
- package/dist/{foundation-models-language-model-strategy-FBGKZSTU.js → foundation-models-language-model-strategy-5AYZ5KHA.js} +5 -5
- package/dist/index.cjs +712 -352
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1680 -34
- package/dist/index.d.ts +1680 -34
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/{orchestration-embedding-model-strategy-DVPO2TP3.js → orchestration-embedding-model-strategy-F7WHDLX7.js} +5 -5
- package/dist/{orchestration-language-model-strategy-KEJWB4E2.js → orchestration-language-model-strategy-Z72AFW62.js} +42 -78
- package/dist/orchestration-language-model-strategy-Z72AFW62.js.map +1 -0
- package/package.json +30 -22
- package/dist/chunk-4JIMBRMV.js.map +0 -1
- package/dist/chunk-5EDF6MHL.js.map +0 -1
- package/dist/chunk-5ZKQJNHO.js.map +0 -1
- package/dist/chunk-VHZSAQBJ.js.map +0 -1
- package/dist/orchestration-language-model-strategy-KEJWB4E2.js.map +0 -1
- /package/dist/{chunk-5JVF4555.js.map → chunk-JRUSQTKB.js.map} +0 -0
- /package/dist/{chunk-RJFB6VFO.js.map → chunk-U23M3VYO.js.map} +0 -0
- /package/dist/{foundation-models-embedding-model-strategy-VKBRG7RT.js.map → foundation-models-embedding-model-strategy-2GUADNXT.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-FBGKZSTU.js.map → foundation-models-language-model-strategy-5AYZ5KHA.js.map} +0 -0
- /package/dist/{orchestration-embedding-model-strategy-DVPO2TP3.js.map → orchestration-embedding-model-strategy-F7WHDLX7.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,60 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
36
|
// src/convert-to-sap-messages.ts
|
|
37
|
+
function getURLHref(value) {
|
|
38
|
+
if (typeof value !== "object" || value === null || URL_HREF_DESCRIPTOR?.get === void 0) {
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const href = URL_HREF_DESCRIPTOR.get.call(value);
|
|
43
|
+
return typeof href === "string" ? href : void 0;
|
|
44
|
+
} catch {
|
|
45
|
+
return void 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function base64SextetValue(charCode) {
|
|
49
|
+
if (charCode >= 65 && charCode <= 90) return charCode - 65;
|
|
50
|
+
if (charCode >= 97 && charCode <= 122) return charCode - 97 + 26;
|
|
51
|
+
if (charCode >= 48 && charCode <= 57) return charCode - 48 + 52;
|
|
52
|
+
if (charCode === 43) return 62;
|
|
53
|
+
if (charCode === 47) return 63;
|
|
54
|
+
return -1;
|
|
55
|
+
}
|
|
56
|
+
function isArrayBuffer(value) {
|
|
57
|
+
if (typeof value !== "object" || value === null || ARRAY_BUFFER_BYTE_LENGTH_DESCRIPTOR?.get === void 0) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
ARRAY_BUFFER_BYTE_LENGTH_DESCRIPTOR.get.call(value);
|
|
62
|
+
return true;
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function isCanonicalBase64(value) {
|
|
68
|
+
const length = value.length;
|
|
69
|
+
if (length % 4 !== 0) return false;
|
|
70
|
+
let padding = 0;
|
|
71
|
+
if (length > 0 && value.charCodeAt(length - 1) === 61) padding++;
|
|
72
|
+
if (length > 1 && value.charCodeAt(length - 2) === 61) padding++;
|
|
73
|
+
const payloadLength = length - padding;
|
|
74
|
+
for (let index = 0; index < payloadLength; index++) {
|
|
75
|
+
if (base64SextetValue(value.charCodeAt(index)) < 0) return false;
|
|
76
|
+
}
|
|
77
|
+
if (padding === 0) return true;
|
|
78
|
+
const lastValue = base64SextetValue(value.charCodeAt(payloadLength - 1));
|
|
79
|
+
return padding === 1 ? (lastValue & 3) === 0 : (lastValue & 15) === 0;
|
|
80
|
+
}
|
|
81
|
+
function isUint8Array(value) {
|
|
82
|
+
if (typeof value !== "object" || value === null || TYPED_ARRAY_TAG_DESCRIPTOR?.get === void 0) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
return TYPED_ARRAY_TAG_DESCRIPTOR.get.call(value) === "Uint8Array";
|
|
87
|
+
} catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
37
91
|
function safeJsonStringify(value) {
|
|
38
92
|
try {
|
|
39
93
|
return JSON.stringify(
|
|
@@ -47,6 +101,39 @@ function safeJsonStringify(value) {
|
|
|
47
101
|
function wrapAsTextContent(text, cacheControl) {
|
|
48
102
|
return cacheControl ? { cache_control: cacheControl, text, type: "text" } : { text, type: "text" };
|
|
49
103
|
}
|
|
104
|
+
function base64FromBytes(bytes) {
|
|
105
|
+
const CHUNK_SIZE = 32768;
|
|
106
|
+
let byteLength;
|
|
107
|
+
try {
|
|
108
|
+
byteLength = TYPED_ARRAY_LENGTH_DESCRIPTOR?.get?.call(bytes);
|
|
109
|
+
} catch {
|
|
110
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
111
|
+
functionality: "Invalid Uint8Array file data."
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (typeof byteLength !== "number") {
|
|
115
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
116
|
+
functionality: "Invalid Uint8Array file data."
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const codeUnits = new Array(Math.min(CHUNK_SIZE, byteLength));
|
|
120
|
+
let binary = "";
|
|
121
|
+
for (let offset = 0; offset < byteLength; offset += CHUNK_SIZE) {
|
|
122
|
+
const chunkLength = Math.min(CHUNK_SIZE, byteLength - offset);
|
|
123
|
+
codeUnits.length = chunkLength;
|
|
124
|
+
for (let index = 0; index < chunkLength; index++) {
|
|
125
|
+
const byte = bytes[offset + index];
|
|
126
|
+
if (byte === void 0) {
|
|
127
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
128
|
+
functionality: "Invalid Uint8Array file data."
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
codeUnits[index] = byte;
|
|
132
|
+
}
|
|
133
|
+
binary += String.fromCharCode(...codeUnits);
|
|
134
|
+
}
|
|
135
|
+
return btoa(binary);
|
|
136
|
+
}
|
|
50
137
|
function convertToSAPMessages(prompt, options = {}) {
|
|
51
138
|
const messages = [];
|
|
52
139
|
const includeReasoning = options.includeReasoning ?? false;
|
|
@@ -54,6 +141,12 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
54
141
|
const maybeEscape = (text) => escapeTemplatePlaceholders ? escapeOrchestrationPlaceholders(text) : text;
|
|
55
142
|
const parser = options.parsePartProviderOptions;
|
|
56
143
|
const parsePart = parser ? (providerOptions) => parser(providerOptions, options.warnings) : () => void 0;
|
|
144
|
+
const pushWarningOnce = (feature, details) => {
|
|
145
|
+
if (!options.warnings) return;
|
|
146
|
+
if (!options.warnings.some((w) => w.feature === feature)) {
|
|
147
|
+
options.warnings.push({ details, feature, type: "unsupported" });
|
|
148
|
+
}
|
|
149
|
+
};
|
|
57
150
|
for (const message of prompt) {
|
|
58
151
|
switch (message.role) {
|
|
59
152
|
case "assistant": {
|
|
@@ -63,6 +156,13 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
63
156
|
const toolCalls = [];
|
|
64
157
|
for (const part of message.content) {
|
|
65
158
|
switch (part.type) {
|
|
159
|
+
case "file": {
|
|
160
|
+
pushWarningOnce(
|
|
161
|
+
"file content in assistant message",
|
|
162
|
+
"SAP orchestration assistant messages carry text and tool calls only; file parts are ignored."
|
|
163
|
+
);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
66
166
|
case "reasoning": {
|
|
67
167
|
if (includeReasoning && part.text) {
|
|
68
168
|
const escaped = `<think>${maybeEscape(part.text)}</think>`;
|
|
@@ -109,6 +209,13 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
109
209
|
});
|
|
110
210
|
break;
|
|
111
211
|
}
|
|
212
|
+
default: {
|
|
213
|
+
pushWarningOnce(
|
|
214
|
+
"unsupported assistant content",
|
|
215
|
+
"Unsupported assistant content type; part ignored."
|
|
216
|
+
);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
112
219
|
}
|
|
113
220
|
}
|
|
114
221
|
if (text || toolCalls.length > 0) {
|
|
@@ -145,6 +252,11 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
145
252
|
tool_call_id: part.toolCallId
|
|
146
253
|
};
|
|
147
254
|
messages.push(toolMessage);
|
|
255
|
+
} else {
|
|
256
|
+
pushWarningOnce(
|
|
257
|
+
"non-tool-result content in tool message",
|
|
258
|
+
"Only tool-result parts are forwarded to SAP; other tool content is ignored."
|
|
259
|
+
);
|
|
148
260
|
}
|
|
149
261
|
}
|
|
150
262
|
break;
|
|
@@ -165,7 +277,9 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
165
277
|
"image/gif",
|
|
166
278
|
"image/webp"
|
|
167
279
|
];
|
|
168
|
-
|
|
280
|
+
const normalizedMediaType = part.mediaType.toLowerCase();
|
|
281
|
+
const isWildcardImageUrl = getURLHref(part.data) !== void 0 && normalizedMediaType === "image/*";
|
|
282
|
+
if (!isWildcardImageUrl && !supportedFormats.includes(normalizedMediaType)) {
|
|
169
283
|
console.warn(
|
|
170
284
|
`Image format ${part.mediaType} may not be supported by all models. Recommended formats: PNG, JPEG, GIF, WebP`
|
|
171
285
|
);
|
|
@@ -235,36 +349,56 @@ function unescapeOrchestrationPlaceholders(text) {
|
|
|
235
349
|
return text.replaceAll(JINJA2_DELIMITERS_ESCAPED_PATTERN, "{$1");
|
|
236
350
|
}
|
|
237
351
|
function buildDataUrl(part) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (typeof
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
352
|
+
const { data, mediaType } = part;
|
|
353
|
+
const href = getURLHref(data);
|
|
354
|
+
if (href !== void 0) return href;
|
|
355
|
+
if (typeof data === "string") return `data:${mediaType};base64,${data}`;
|
|
356
|
+
if (isUint8Array(data)) {
|
|
357
|
+
return `data:${mediaType};base64,${base64FromBytes(data)}`;
|
|
358
|
+
}
|
|
359
|
+
if (isArrayBuffer(data)) {
|
|
360
|
+
let bytes;
|
|
361
|
+
try {
|
|
362
|
+
bytes = new Uint8Array(data);
|
|
363
|
+
} catch {
|
|
364
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
365
|
+
functionality: "Detached ArrayBuffer file data is unsupported."
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
return `data:${mediaType};base64,${base64FromBytes(bytes)}`;
|
|
251
369
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
370
|
+
if (typeof data === "object" && data !== null) {
|
|
371
|
+
const toString2 = data.toString;
|
|
372
|
+
if (typeof toString2 === "function" && toString2 !== Object.prototype.toString) {
|
|
373
|
+
const encoded = toString2.call(data, "base64");
|
|
374
|
+
if (typeof encoded === "string" && isCanonicalBase64(encoded)) {
|
|
375
|
+
return `data:${mediaType};base64,${encoded}`;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
256
378
|
}
|
|
257
379
|
throw new import_provider.UnsupportedFunctionalityError({
|
|
258
|
-
functionality: "Unsupported file data type. Expected
|
|
380
|
+
functionality: "Unsupported file data type. Expected base64 string, Uint8Array, ArrayBuffer, URL, or a buffer-like object returning canonical base64."
|
|
259
381
|
});
|
|
260
382
|
}
|
|
261
|
-
var import_provider,
|
|
383
|
+
var import_provider, ZERO_WIDTH_SPACE, ARRAY_BUFFER_BYTE_LENGTH_DESCRIPTOR, TYPED_ARRAY_LENGTH_DESCRIPTOR, TYPED_ARRAY_TAG_DESCRIPTOR, URL_HREF_DESCRIPTOR, JINJA2_DELIMITERS_PATTERN, JINJA2_DELIMITERS_ESCAPED_PATTERN;
|
|
262
384
|
var init_convert_to_sap_messages = __esm({
|
|
263
385
|
"src/convert-to-sap-messages.ts"() {
|
|
264
386
|
"use strict";
|
|
265
387
|
import_provider = require("@ai-sdk/provider");
|
|
266
|
-
import_node_buffer = require("buffer");
|
|
267
388
|
ZERO_WIDTH_SPACE = "\u200B";
|
|
389
|
+
ARRAY_BUFFER_BYTE_LENGTH_DESCRIPTOR = Object.getOwnPropertyDescriptor(
|
|
390
|
+
ArrayBuffer.prototype,
|
|
391
|
+
"byteLength"
|
|
392
|
+
);
|
|
393
|
+
TYPED_ARRAY_LENGTH_DESCRIPTOR = Object.getOwnPropertyDescriptor(
|
|
394
|
+
Object.getPrototypeOf(Uint8Array.prototype),
|
|
395
|
+
"length"
|
|
396
|
+
);
|
|
397
|
+
TYPED_ARRAY_TAG_DESCRIPTOR = Object.getOwnPropertyDescriptor(
|
|
398
|
+
Object.getPrototypeOf(Uint8Array.prototype),
|
|
399
|
+
Symbol.toStringTag
|
|
400
|
+
);
|
|
401
|
+
URL_HREF_DESCRIPTOR = Object.getOwnPropertyDescriptor(URL.prototype, "href");
|
|
268
402
|
JINJA2_DELIMITERS_PATTERN = /\{(?=[{%#])/g;
|
|
269
403
|
JINJA2_DELIMITERS_ESCAPED_PATTERN = new RegExp(`\\{${ZERO_WIDTH_SPACE}([{%#])`, "g");
|
|
270
404
|
}
|
|
@@ -3721,12 +3855,12 @@ var require_buffer_list = __commonJS({
|
|
|
3721
3855
|
return (hint === "string" ? String : Number)(input);
|
|
3722
3856
|
}
|
|
3723
3857
|
var _require = require("buffer");
|
|
3724
|
-
var
|
|
3858
|
+
var Buffer2 = _require.Buffer;
|
|
3725
3859
|
var _require2 = require("util");
|
|
3726
3860
|
var inspect = _require2.inspect;
|
|
3727
3861
|
var custom = inspect && inspect.custom || "inspect";
|
|
3728
3862
|
function copyBuffer(src, target, offset) {
|
|
3729
|
-
|
|
3863
|
+
Buffer2.prototype.copy.call(src, target, offset);
|
|
3730
3864
|
}
|
|
3731
3865
|
module2.exports = /* @__PURE__ */ (function() {
|
|
3732
3866
|
function BufferList() {
|
|
@@ -3786,8 +3920,8 @@ var require_buffer_list = __commonJS({
|
|
|
3786
3920
|
}, {
|
|
3787
3921
|
key: "concat",
|
|
3788
3922
|
value: function concat(n) {
|
|
3789
|
-
if (this.length === 0) return
|
|
3790
|
-
var ret =
|
|
3923
|
+
if (this.length === 0) return Buffer2.alloc(0);
|
|
3924
|
+
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
3791
3925
|
var p = this.head;
|
|
3792
3926
|
var i = 0;
|
|
3793
3927
|
while (p) {
|
|
@@ -3851,7 +3985,7 @@ var require_buffer_list = __commonJS({
|
|
|
3851
3985
|
}, {
|
|
3852
3986
|
key: "_getBuffer",
|
|
3853
3987
|
value: function _getBuffer(n) {
|
|
3854
|
-
var ret =
|
|
3988
|
+
var ret = Buffer2.allocUnsafe(n);
|
|
3855
3989
|
var p = this.head;
|
|
3856
3990
|
var c = 1;
|
|
3857
3991
|
p.data.copy(ret);
|
|
@@ -3899,34 +4033,34 @@ var require_safe_buffer = __commonJS({
|
|
|
3899
4033
|
"node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
3900
4034
|
"use strict";
|
|
3901
4035
|
var buffer = require("buffer");
|
|
3902
|
-
var
|
|
4036
|
+
var Buffer2 = buffer.Buffer;
|
|
3903
4037
|
function copyProps(src, dst) {
|
|
3904
4038
|
for (var key in src) {
|
|
3905
4039
|
dst[key] = src[key];
|
|
3906
4040
|
}
|
|
3907
4041
|
}
|
|
3908
|
-
if (
|
|
4042
|
+
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
3909
4043
|
module2.exports = buffer;
|
|
3910
4044
|
} else {
|
|
3911
4045
|
copyProps(buffer, exports2);
|
|
3912
4046
|
exports2.Buffer = SafeBuffer;
|
|
3913
4047
|
}
|
|
3914
4048
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
3915
|
-
return
|
|
4049
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
3916
4050
|
}
|
|
3917
|
-
SafeBuffer.prototype = Object.create(
|
|
3918
|
-
copyProps(
|
|
4051
|
+
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
4052
|
+
copyProps(Buffer2, SafeBuffer);
|
|
3919
4053
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
3920
4054
|
if (typeof arg === "number") {
|
|
3921
4055
|
throw new TypeError("Argument must not be a number");
|
|
3922
4056
|
}
|
|
3923
|
-
return
|
|
4057
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
3924
4058
|
};
|
|
3925
4059
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
3926
4060
|
if (typeof size !== "number") {
|
|
3927
4061
|
throw new TypeError("Argument must be a number");
|
|
3928
4062
|
}
|
|
3929
|
-
var buf =
|
|
4063
|
+
var buf = Buffer2(size);
|
|
3930
4064
|
if (fill !== void 0) {
|
|
3931
4065
|
if (typeof encoding === "string") {
|
|
3932
4066
|
buf.fill(fill, encoding);
|
|
@@ -3942,7 +4076,7 @@ var require_safe_buffer = __commonJS({
|
|
|
3942
4076
|
if (typeof size !== "number") {
|
|
3943
4077
|
throw new TypeError("Argument must be a number");
|
|
3944
4078
|
}
|
|
3945
|
-
return
|
|
4079
|
+
return Buffer2(size);
|
|
3946
4080
|
};
|
|
3947
4081
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
3948
4082
|
if (typeof size !== "number") {
|
|
@@ -3957,8 +4091,8 @@ var require_safe_buffer = __commonJS({
|
|
|
3957
4091
|
var require_string_decoder = __commonJS({
|
|
3958
4092
|
"node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
3959
4093
|
"use strict";
|
|
3960
|
-
var
|
|
3961
|
-
var isEncoding =
|
|
4094
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
4095
|
+
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
3962
4096
|
encoding = "" + encoding;
|
|
3963
4097
|
switch (encoding && encoding.toLowerCase()) {
|
|
3964
4098
|
case "hex":
|
|
@@ -4006,7 +4140,7 @@ var require_string_decoder = __commonJS({
|
|
|
4006
4140
|
}
|
|
4007
4141
|
function normalizeEncoding(enc) {
|
|
4008
4142
|
var nenc = _normalizeEncoding(enc);
|
|
4009
|
-
if (typeof nenc !== "string" && (
|
|
4143
|
+
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
4010
4144
|
return nenc || enc;
|
|
4011
4145
|
}
|
|
4012
4146
|
exports2.StringDecoder = StringDecoder;
|
|
@@ -4035,7 +4169,7 @@ var require_string_decoder = __commonJS({
|
|
|
4035
4169
|
}
|
|
4036
4170
|
this.lastNeed = 0;
|
|
4037
4171
|
this.lastTotal = 0;
|
|
4038
|
-
this.lastChar =
|
|
4172
|
+
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
4039
4173
|
}
|
|
4040
4174
|
StringDecoder.prototype.write = function(buf) {
|
|
4041
4175
|
if (buf.length === 0) return "";
|
|
@@ -4596,14 +4730,14 @@ var require_stream_readable = __commonJS({
|
|
|
4596
4730
|
return emitter.listeners(type).length;
|
|
4597
4731
|
};
|
|
4598
4732
|
var Stream = require_stream();
|
|
4599
|
-
var
|
|
4733
|
+
var Buffer2 = require("buffer").Buffer;
|
|
4600
4734
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
4601
4735
|
};
|
|
4602
4736
|
function _uint8ArrayToBuffer(chunk) {
|
|
4603
|
-
return
|
|
4737
|
+
return Buffer2.from(chunk);
|
|
4604
4738
|
}
|
|
4605
4739
|
function _isUint8Array(obj) {
|
|
4606
|
-
return
|
|
4740
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
4607
4741
|
}
|
|
4608
4742
|
var debugUtil = require("util");
|
|
4609
4743
|
var debug;
|
|
@@ -4711,7 +4845,7 @@ var require_stream_readable = __commonJS({
|
|
|
4711
4845
|
if (typeof chunk === "string") {
|
|
4712
4846
|
encoding = encoding || state.defaultEncoding;
|
|
4713
4847
|
if (encoding !== state.encoding) {
|
|
4714
|
-
chunk =
|
|
4848
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
4715
4849
|
encoding = "";
|
|
4716
4850
|
}
|
|
4717
4851
|
skipChunkCheck = true;
|
|
@@ -4736,7 +4870,7 @@ var require_stream_readable = __commonJS({
|
|
|
4736
4870
|
if (er) {
|
|
4737
4871
|
errorOrDestroy(stream, er);
|
|
4738
4872
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
4739
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !==
|
|
4873
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
4740
4874
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
4741
4875
|
}
|
|
4742
4876
|
if (addToFront) {
|
|
@@ -5429,14 +5563,14 @@ var require_stream_writable = __commonJS({
|
|
|
5429
5563
|
deprecate: require_node()
|
|
5430
5564
|
};
|
|
5431
5565
|
var Stream = require_stream();
|
|
5432
|
-
var
|
|
5566
|
+
var Buffer2 = require("buffer").Buffer;
|
|
5433
5567
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
5434
5568
|
};
|
|
5435
5569
|
function _uint8ArrayToBuffer(chunk) {
|
|
5436
|
-
return
|
|
5570
|
+
return Buffer2.from(chunk);
|
|
5437
5571
|
}
|
|
5438
5572
|
function _isUint8Array(obj) {
|
|
5439
|
-
return
|
|
5573
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
5440
5574
|
}
|
|
5441
5575
|
var destroyImpl = require_destroy();
|
|
5442
5576
|
var _require = require_state();
|
|
@@ -5564,7 +5698,7 @@ var require_stream_writable = __commonJS({
|
|
|
5564
5698
|
var state = this._writableState;
|
|
5565
5699
|
var ret = false;
|
|
5566
5700
|
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
5567
|
-
if (isBuf && !
|
|
5701
|
+
if (isBuf && !Buffer2.isBuffer(chunk)) {
|
|
5568
5702
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
5569
5703
|
}
|
|
5570
5704
|
if (typeof encoding === "function") {
|
|
@@ -5608,7 +5742,7 @@ var require_stream_writable = __commonJS({
|
|
|
5608
5742
|
});
|
|
5609
5743
|
function decodeChunk(state, chunk, encoding) {
|
|
5610
5744
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
5611
|
-
chunk =
|
|
5745
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
5612
5746
|
}
|
|
5613
5747
|
return chunk;
|
|
5614
5748
|
}
|
|
@@ -24343,121 +24477,6 @@ var require_browser = __commonJS({
|
|
|
24343
24477
|
}
|
|
24344
24478
|
});
|
|
24345
24479
|
|
|
24346
|
-
// node_modules/has-flag/index.js
|
|
24347
|
-
var require_has_flag2 = __commonJS({
|
|
24348
|
-
"node_modules/has-flag/index.js"(exports2, module2) {
|
|
24349
|
-
"use strict";
|
|
24350
|
-
module2.exports = (flag, argv = process.argv) => {
|
|
24351
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
24352
|
-
const position = argv.indexOf(prefix + flag);
|
|
24353
|
-
const terminatorPosition = argv.indexOf("--");
|
|
24354
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
24355
|
-
};
|
|
24356
|
-
}
|
|
24357
|
-
});
|
|
24358
|
-
|
|
24359
|
-
// node_modules/supports-color/index.js
|
|
24360
|
-
var require_supports_color = __commonJS({
|
|
24361
|
-
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
24362
|
-
"use strict";
|
|
24363
|
-
var os = require("os");
|
|
24364
|
-
var tty = require("tty");
|
|
24365
|
-
var hasFlag = require_has_flag2();
|
|
24366
|
-
var { env } = process;
|
|
24367
|
-
var forceColor;
|
|
24368
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
24369
|
-
forceColor = 0;
|
|
24370
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
24371
|
-
forceColor = 1;
|
|
24372
|
-
}
|
|
24373
|
-
if ("FORCE_COLOR" in env) {
|
|
24374
|
-
if (env.FORCE_COLOR === "true") {
|
|
24375
|
-
forceColor = 1;
|
|
24376
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
24377
|
-
forceColor = 0;
|
|
24378
|
-
} else {
|
|
24379
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
24380
|
-
}
|
|
24381
|
-
}
|
|
24382
|
-
function translateLevel(level) {
|
|
24383
|
-
if (level === 0) {
|
|
24384
|
-
return false;
|
|
24385
|
-
}
|
|
24386
|
-
return {
|
|
24387
|
-
level,
|
|
24388
|
-
hasBasic: true,
|
|
24389
|
-
has256: level >= 2,
|
|
24390
|
-
has16m: level >= 3
|
|
24391
|
-
};
|
|
24392
|
-
}
|
|
24393
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
24394
|
-
if (forceColor === 0) {
|
|
24395
|
-
return 0;
|
|
24396
|
-
}
|
|
24397
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
24398
|
-
return 3;
|
|
24399
|
-
}
|
|
24400
|
-
if (hasFlag("color=256")) {
|
|
24401
|
-
return 2;
|
|
24402
|
-
}
|
|
24403
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
24404
|
-
return 0;
|
|
24405
|
-
}
|
|
24406
|
-
const min = forceColor || 0;
|
|
24407
|
-
if (env.TERM === "dumb") {
|
|
24408
|
-
return min;
|
|
24409
|
-
}
|
|
24410
|
-
if (process.platform === "win32") {
|
|
24411
|
-
const osRelease = os.release().split(".");
|
|
24412
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
24413
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
24414
|
-
}
|
|
24415
|
-
return 1;
|
|
24416
|
-
}
|
|
24417
|
-
if ("CI" in env) {
|
|
24418
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
24419
|
-
return 1;
|
|
24420
|
-
}
|
|
24421
|
-
return min;
|
|
24422
|
-
}
|
|
24423
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
24424
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
24425
|
-
}
|
|
24426
|
-
if (env.COLORTERM === "truecolor") {
|
|
24427
|
-
return 3;
|
|
24428
|
-
}
|
|
24429
|
-
if ("TERM_PROGRAM" in env) {
|
|
24430
|
-
const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
24431
|
-
switch (env.TERM_PROGRAM) {
|
|
24432
|
-
case "iTerm.app":
|
|
24433
|
-
return version2 >= 3 ? 3 : 2;
|
|
24434
|
-
case "Apple_Terminal":
|
|
24435
|
-
return 2;
|
|
24436
|
-
}
|
|
24437
|
-
}
|
|
24438
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
24439
|
-
return 2;
|
|
24440
|
-
}
|
|
24441
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
24442
|
-
return 1;
|
|
24443
|
-
}
|
|
24444
|
-
if ("COLORTERM" in env) {
|
|
24445
|
-
return 1;
|
|
24446
|
-
}
|
|
24447
|
-
return min;
|
|
24448
|
-
}
|
|
24449
|
-
function getSupportLevel(stream) {
|
|
24450
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
24451
|
-
return translateLevel(level);
|
|
24452
|
-
}
|
|
24453
|
-
module2.exports = {
|
|
24454
|
-
supportsColor: getSupportLevel,
|
|
24455
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
24456
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
24457
|
-
};
|
|
24458
|
-
}
|
|
24459
|
-
});
|
|
24460
|
-
|
|
24461
24480
|
// node_modules/debug/src/node.js
|
|
24462
24481
|
var require_node3 = __commonJS({
|
|
24463
24482
|
"node_modules/debug/src/node.js"(exports2, module2) {
|
|
@@ -24477,7 +24496,7 @@ var require_node3 = __commonJS({
|
|
|
24477
24496
|
);
|
|
24478
24497
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
24479
24498
|
try {
|
|
24480
|
-
const supportsColor =
|
|
24499
|
+
const supportsColor = require("supports-color");
|
|
24481
24500
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
24482
24501
|
exports2.colors = [
|
|
24483
24502
|
20,
|
|
@@ -25663,22 +25682,82 @@ var require_axios = __commonJS({
|
|
|
25663
25682
|
var hasOwnProperty = (({
|
|
25664
25683
|
hasOwnProperty: hasOwnProperty2
|
|
25665
25684
|
}) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
25685
|
+
var isUnsafeObjectKey = (prop) => typeof prop === "string" && (prop === "__proto__" || prop === "constructor" || prop === "prototype");
|
|
25686
|
+
var isPrototypeBoundary = (obj, prototype2, source) => obj === Object.prototype || !source && prototype2 === null;
|
|
25687
|
+
var isSafeAndFullyMutable = (obj) => {
|
|
25688
|
+
if (!Object.isExtensible(obj)) {
|
|
25689
|
+
return false;
|
|
25690
|
+
}
|
|
25691
|
+
const props = Object.getOwnPropertyNames(obj);
|
|
25692
|
+
if (Object.getOwnPropertySymbols) {
|
|
25693
|
+
props.push(...Object.getOwnPropertySymbols(obj));
|
|
25694
|
+
}
|
|
25695
|
+
return props.every((prop) => {
|
|
25696
|
+
if (isUnsafeObjectKey(prop)) {
|
|
25697
|
+
return false;
|
|
25698
|
+
}
|
|
25699
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
25700
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
25701
|
+
});
|
|
25702
|
+
};
|
|
25666
25703
|
var hasOwnInPrototypeChain = (thing, prop) => {
|
|
25667
25704
|
let obj = thing;
|
|
25668
25705
|
const seen = [];
|
|
25669
|
-
while (obj != null
|
|
25706
|
+
while (obj != null) {
|
|
25670
25707
|
if (seen.indexOf(obj) !== -1) {
|
|
25671
25708
|
return false;
|
|
25672
25709
|
}
|
|
25673
25710
|
seen.push(obj);
|
|
25711
|
+
const prototype2 = getPrototypeOf(obj);
|
|
25712
|
+
if (isPrototypeBoundary(obj, prototype2, obj === thing)) {
|
|
25713
|
+
return false;
|
|
25714
|
+
}
|
|
25674
25715
|
if (hasOwnProperty(obj, prop)) {
|
|
25675
25716
|
return true;
|
|
25676
25717
|
}
|
|
25677
|
-
obj =
|
|
25718
|
+
obj = prototype2;
|
|
25678
25719
|
}
|
|
25679
25720
|
return false;
|
|
25680
25721
|
};
|
|
25681
25722
|
var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
|
|
25723
|
+
var toSafeFlatObject = (thing) => {
|
|
25724
|
+
if (thing == null || typeof thing !== "object" && typeof thing !== "function") {
|
|
25725
|
+
return thing;
|
|
25726
|
+
}
|
|
25727
|
+
const sourcePrototype = getPrototypeOf(thing);
|
|
25728
|
+
if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {
|
|
25729
|
+
return thing;
|
|
25730
|
+
}
|
|
25731
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
25732
|
+
const merged = /* @__PURE__ */ Object.create(null);
|
|
25733
|
+
const seen = [];
|
|
25734
|
+
let current = thing;
|
|
25735
|
+
while (current != null) {
|
|
25736
|
+
if (seen.indexOf(current) !== -1) {
|
|
25737
|
+
break;
|
|
25738
|
+
}
|
|
25739
|
+
seen.push(current);
|
|
25740
|
+
const prototype2 = current === thing ? sourcePrototype : getPrototypeOf(current);
|
|
25741
|
+
if (isPrototypeBoundary(current, prototype2, current === thing)) {
|
|
25742
|
+
break;
|
|
25743
|
+
}
|
|
25744
|
+
const props = Object.getOwnPropertyNames(current);
|
|
25745
|
+
if (Object.getOwnPropertySymbols) {
|
|
25746
|
+
props.push(...Object.getOwnPropertySymbols(current));
|
|
25747
|
+
}
|
|
25748
|
+
for (const prop of props) {
|
|
25749
|
+
if (isUnsafeObjectKey(prop)) {
|
|
25750
|
+
continue;
|
|
25751
|
+
}
|
|
25752
|
+
if (!hasOwnProperty(merged, prop)) {
|
|
25753
|
+
result[prop] = thing[prop];
|
|
25754
|
+
merged[prop] = true;
|
|
25755
|
+
}
|
|
25756
|
+
}
|
|
25757
|
+
current = prototype2;
|
|
25758
|
+
}
|
|
25759
|
+
return result;
|
|
25760
|
+
};
|
|
25682
25761
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
25683
25762
|
const str = toString2.call(thing);
|
|
25684
25763
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -25695,13 +25774,13 @@ var require_axios = __commonJS({
|
|
|
25695
25774
|
function isBuffer(val) {
|
|
25696
25775
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
25697
25776
|
}
|
|
25698
|
-
var
|
|
25777
|
+
var isArrayBuffer2 = kindOfTest("ArrayBuffer");
|
|
25699
25778
|
function isArrayBufferView(val) {
|
|
25700
25779
|
let result;
|
|
25701
25780
|
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
25702
25781
|
result = ArrayBuffer.isView(val);
|
|
25703
25782
|
} else {
|
|
25704
|
-
result = val && val.buffer &&
|
|
25783
|
+
result = val && val.buffer && isArrayBuffer2(val.buffer);
|
|
25705
25784
|
}
|
|
25706
25785
|
return result;
|
|
25707
25786
|
}
|
|
@@ -25715,9 +25794,9 @@ var require_axios = __commonJS({
|
|
|
25715
25794
|
return false;
|
|
25716
25795
|
}
|
|
25717
25796
|
const prototype2 = getPrototypeOf(val);
|
|
25718
|
-
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat
|
|
25719
|
-
//
|
|
25720
|
-
//
|
|
25797
|
+
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
|
|
25798
|
+
// evidence the value is tagged/iterable, while ignoring members reachable
|
|
25799
|
+
// only through shared or terminal prototype boundaries.
|
|
25721
25800
|
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
25722
25801
|
};
|
|
25723
25802
|
var isEmptyObject = (val) => {
|
|
@@ -26084,7 +26163,7 @@ var require_axios = __commonJS({
|
|
|
26084
26163
|
var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
|
|
26085
26164
|
var utils$1 = {
|
|
26086
26165
|
isArray,
|
|
26087
|
-
isArrayBuffer,
|
|
26166
|
+
isArrayBuffer: isArrayBuffer2,
|
|
26088
26167
|
isBuffer,
|
|
26089
26168
|
isFormData,
|
|
26090
26169
|
isArrayBufferView,
|
|
@@ -26129,6 +26208,7 @@ var require_axios = __commonJS({
|
|
|
26129
26208
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
26130
26209
|
hasOwnInPrototypeChain,
|
|
26131
26210
|
getSafeProp,
|
|
26211
|
+
toSafeFlatObject,
|
|
26132
26212
|
reduceDescriptors,
|
|
26133
26213
|
freezeMethods,
|
|
26134
26214
|
toObjectSet,
|
|
@@ -26209,7 +26289,7 @@ var require_axios = __commonJS({
|
|
|
26209
26289
|
});
|
|
26210
26290
|
return byteStringHeaders;
|
|
26211
26291
|
}
|
|
26212
|
-
var $internals = /* @__PURE__ */ Symbol("internals");
|
|
26292
|
+
var $internals$1 = /* @__PURE__ */ Symbol("internals");
|
|
26213
26293
|
function normalizeHeader(header) {
|
|
26214
26294
|
return header && String(header).trim().toLowerCase();
|
|
26215
26295
|
}
|
|
@@ -26505,7 +26585,7 @@ var require_axios = __commonJS({
|
|
|
26505
26585
|
return computed;
|
|
26506
26586
|
}
|
|
26507
26587
|
static accessor(header) {
|
|
26508
|
-
const internals = this[$internals] = this[$internals] = {
|
|
26588
|
+
const internals = this[$internals$1] = this[$internals$1] = {
|
|
26509
26589
|
accessors: {}
|
|
26510
26590
|
};
|
|
26511
26591
|
const accessors = internals.accessors;
|
|
@@ -26726,19 +26806,16 @@ var require_axios = __commonJS({
|
|
|
26726
26806
|
throw new TypeError("target must be an object");
|
|
26727
26807
|
}
|
|
26728
26808
|
formData = formData || new (FormData$1 || FormData)();
|
|
26729
|
-
|
|
26730
|
-
|
|
26731
|
-
|
|
26732
|
-
|
|
26733
|
-
|
|
26734
|
-
|
|
26735
|
-
|
|
26736
|
-
const
|
|
26737
|
-
const
|
|
26738
|
-
const
|
|
26739
|
-
const indexes = options.indexes;
|
|
26740
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
26741
|
-
const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
|
|
26809
|
+
const option = (name, fallback) => {
|
|
26810
|
+
const value = utils$1.getSafeProp(options, name);
|
|
26811
|
+
return utils$1.isUndefined(value) ? fallback : value;
|
|
26812
|
+
};
|
|
26813
|
+
const metaTokens = option("metaTokens", true);
|
|
26814
|
+
const visitor = option("visitor") || defaultVisitor;
|
|
26815
|
+
const dots = option("dots", false);
|
|
26816
|
+
const indexes = option("indexes", false);
|
|
26817
|
+
const _Blob = option("Blob") || typeof Blob !== "undefined" && Blob;
|
|
26818
|
+
const maxDepth = option("maxDepth", DEFAULT_FORM_DATA_MAX_DEPTH);
|
|
26742
26819
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
26743
26820
|
const stack = [];
|
|
26744
26821
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -26897,9 +26974,47 @@ var require_axios = __commonJS({
|
|
|
26897
26974
|
}
|
|
26898
26975
|
return url2;
|
|
26899
26976
|
}
|
|
26977
|
+
var $internals = /* @__PURE__ */ Symbol("internals");
|
|
26978
|
+
function countHandlers(handlers) {
|
|
26979
|
+
return handlers ? handlers.length : 0;
|
|
26980
|
+
}
|
|
26981
|
+
function trimHandlers(handlers) {
|
|
26982
|
+
if (!handlers) {
|
|
26983
|
+
return;
|
|
26984
|
+
}
|
|
26985
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
26986
|
+
handlers.pop();
|
|
26987
|
+
}
|
|
26988
|
+
}
|
|
26989
|
+
function syncHandlerEntries(manager, internals) {
|
|
26990
|
+
const handlers = manager.handlers;
|
|
26991
|
+
const length = countHandlers(handlers);
|
|
26992
|
+
if (handlers !== internals.handlersRef) {
|
|
26993
|
+
internals.handlersRef = handlers;
|
|
26994
|
+
internals.handlerEntries.clear();
|
|
26995
|
+
} else if (length !== internals.handlersLength) {
|
|
26996
|
+
if (!length) {
|
|
26997
|
+
internals.handlerEntries.clear();
|
|
26998
|
+
} else {
|
|
26999
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
27000
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
27001
|
+
internals.handlerEntries.delete(id);
|
|
27002
|
+
}
|
|
27003
|
+
});
|
|
27004
|
+
}
|
|
27005
|
+
}
|
|
27006
|
+
internals.handlersLength = length;
|
|
27007
|
+
}
|
|
26900
27008
|
var InterceptorManager = class {
|
|
26901
27009
|
constructor() {
|
|
26902
27010
|
this.handlers = [];
|
|
27011
|
+
this[$internals] = {
|
|
27012
|
+
handlersRef: this.handlers,
|
|
27013
|
+
handlersLength: this.handlers.length,
|
|
27014
|
+
handlerEntries: /* @__PURE__ */ new Map(),
|
|
27015
|
+
iterationDepth: 0,
|
|
27016
|
+
nextId: 0
|
|
27017
|
+
};
|
|
26903
27018
|
}
|
|
26904
27019
|
/**
|
|
26905
27020
|
* Add a new interceptor to the stack
|
|
@@ -26911,13 +27026,25 @@ var require_axios = __commonJS({
|
|
|
26911
27026
|
* @return {Number} An ID used to remove interceptor later
|
|
26912
27027
|
*/
|
|
26913
27028
|
use(fulfilled, rejected, options) {
|
|
26914
|
-
|
|
27029
|
+
const handler = {
|
|
26915
27030
|
fulfilled,
|
|
26916
27031
|
rejected,
|
|
26917
27032
|
synchronous: options ? options.synchronous : false,
|
|
26918
27033
|
runWhen: options ? options.runWhen : null
|
|
27034
|
+
};
|
|
27035
|
+
const internals = this[$internals];
|
|
27036
|
+
if (this.handlers == null) {
|
|
27037
|
+
this.handlers = [];
|
|
27038
|
+
}
|
|
27039
|
+
syncHandlerEntries(this, internals);
|
|
27040
|
+
const id = internals.nextId++;
|
|
27041
|
+
this.handlers.push(handler);
|
|
27042
|
+
internals.handlerEntries.set(id, {
|
|
27043
|
+
handler,
|
|
27044
|
+
index: this.handlers.length - 1
|
|
26919
27045
|
});
|
|
26920
|
-
|
|
27046
|
+
internals.handlersLength = this.handlers.length;
|
|
27047
|
+
return id;
|
|
26921
27048
|
}
|
|
26922
27049
|
/**
|
|
26923
27050
|
* Remove an interceptor from the stack
|
|
@@ -26927,8 +27054,19 @@ var require_axios = __commonJS({
|
|
|
26927
27054
|
* @returns {void}
|
|
26928
27055
|
*/
|
|
26929
27056
|
eject(id) {
|
|
26930
|
-
|
|
26931
|
-
|
|
27057
|
+
const internals = this[$internals];
|
|
27058
|
+
syncHandlerEntries(this, internals);
|
|
27059
|
+
const entry = internals.handlerEntries.get(id);
|
|
27060
|
+
if (entry) {
|
|
27061
|
+
internals.handlerEntries.delete(id);
|
|
27062
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
27063
|
+
return;
|
|
27064
|
+
}
|
|
27065
|
+
this.handlers[entry.index] = null;
|
|
27066
|
+
if (!internals.iterationDepth) {
|
|
27067
|
+
trimHandlers(this.handlers);
|
|
27068
|
+
internals.handlersLength = this.handlers.length;
|
|
27069
|
+
}
|
|
26932
27070
|
}
|
|
26933
27071
|
}
|
|
26934
27072
|
/**
|
|
@@ -26939,6 +27077,7 @@ var require_axios = __commonJS({
|
|
|
26939
27077
|
clear() {
|
|
26940
27078
|
if (this.handlers) {
|
|
26941
27079
|
this.handlers = [];
|
|
27080
|
+
syncHandlerEntries(this, this[$internals]);
|
|
26942
27081
|
}
|
|
26943
27082
|
}
|
|
26944
27083
|
/**
|
|
@@ -26952,11 +27091,22 @@ var require_axios = __commonJS({
|
|
|
26952
27091
|
* @returns {void}
|
|
26953
27092
|
*/
|
|
26954
27093
|
forEach(fn) {
|
|
26955
|
-
|
|
26956
|
-
|
|
26957
|
-
|
|
27094
|
+
const internals = this[$internals];
|
|
27095
|
+
syncHandlerEntries(this, internals);
|
|
27096
|
+
internals.iterationDepth++;
|
|
27097
|
+
try {
|
|
27098
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
27099
|
+
if (h !== null) {
|
|
27100
|
+
fn(h);
|
|
27101
|
+
}
|
|
27102
|
+
});
|
|
27103
|
+
} finally {
|
|
27104
|
+
if (!--internals.iterationDepth) {
|
|
27105
|
+
syncHandlerEntries(this, internals);
|
|
27106
|
+
trimHandlers(this.handlers);
|
|
27107
|
+
internals.handlersLength = countHandlers(this.handlers);
|
|
26958
27108
|
}
|
|
26959
|
-
}
|
|
27109
|
+
}
|
|
26960
27110
|
}
|
|
26961
27111
|
};
|
|
26962
27112
|
var transitionalDefaults = {
|
|
@@ -27092,6 +27242,7 @@ var require_axios = __commonJS({
|
|
|
27092
27242
|
}
|
|
27093
27243
|
return null;
|
|
27094
27244
|
}
|
|
27245
|
+
var methodList = Object.freeze(["get", "delete", "head", "options", "post", "put", "patch", "purge", "link", "unlink", "query"]);
|
|
27095
27246
|
var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
27096
27247
|
function stringifySafely(rawValue, parser, encoder) {
|
|
27097
27248
|
if (utils$1.isString(rawValue)) {
|
|
@@ -27197,7 +27348,7 @@ var require_axios = __commonJS({
|
|
|
27197
27348
|
}
|
|
27198
27349
|
}
|
|
27199
27350
|
};
|
|
27200
|
-
utils$1.forEach(
|
|
27351
|
+
utils$1.forEach(methodList, (method) => {
|
|
27201
27352
|
defaults.headers[method] = {};
|
|
27202
27353
|
});
|
|
27203
27354
|
function transformData(fns, response) {
|
|
@@ -27254,18 +27405,18 @@ var require_axios = __commonJS({
|
|
|
27254
27405
|
}
|
|
27255
27406
|
return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
|
|
27256
27407
|
}
|
|
27257
|
-
var
|
|
27258
|
-
var httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
27259
|
-
function stripLeadingC0ControlOrSpace(url2) {
|
|
27260
|
-
let i = 0;
|
|
27261
|
-
while (i < url2.length && url2.charCodeAt(i) <= 32) {
|
|
27262
|
-
i++;
|
|
27263
|
-
}
|
|
27264
|
-
return url2.slice(i);
|
|
27265
|
-
}
|
|
27408
|
+
var urlParserControlCharacters = /[\t\n\r]/g;
|
|
27266
27409
|
function normalizeURLForProtocolCheck(url2) {
|
|
27267
|
-
|
|
27410
|
+
if (typeof url2 !== "string") {
|
|
27411
|
+
return url2;
|
|
27412
|
+
}
|
|
27413
|
+
let start = 0;
|
|
27414
|
+
while (start < url2.length && url2.charCodeAt(start) <= 32) {
|
|
27415
|
+
start++;
|
|
27416
|
+
}
|
|
27417
|
+
return url2.slice(start).replace(urlParserControlCharacters, "");
|
|
27268
27418
|
}
|
|
27419
|
+
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
27269
27420
|
function redactFragment(fragment) {
|
|
27270
27421
|
if (!fragment) {
|
|
27271
27422
|
return fragment;
|
|
@@ -27366,12 +27517,12 @@ var require_axios = __commonJS({
|
|
|
27366
27517
|
function getEnv(key) {
|
|
27367
27518
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
27368
27519
|
}
|
|
27369
|
-
var VERSION2 = "1.
|
|
27520
|
+
var VERSION2 = "1.20.0";
|
|
27370
27521
|
function parseProtocol(url2) {
|
|
27371
27522
|
const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
|
|
27372
27523
|
return match2 && match2[1] || "";
|
|
27373
27524
|
}
|
|
27374
|
-
var DATA_URL_PATTERN = /^([
|
|
27525
|
+
var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
|
|
27375
27526
|
function fromDataURI(uri, asBlob, options) {
|
|
27376
27527
|
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
27377
27528
|
const protocol = parseProtocol(uri);
|
|
@@ -27648,7 +27799,7 @@ var require_axios = __commonJS({
|
|
|
27648
27799
|
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
27649
27800
|
}
|
|
27650
27801
|
getSession(authority, options) {
|
|
27651
|
-
options = Object.assign({
|
|
27802
|
+
options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
27652
27803
|
sessionTimeout: 1e3
|
|
27653
27804
|
}, options);
|
|
27654
27805
|
let authoritySessions = this.sessions[authority];
|
|
@@ -27713,6 +27864,7 @@ var require_axios = __commonJS({
|
|
|
27713
27864
|
};
|
|
27714
27865
|
}
|
|
27715
27866
|
session.once("close", removeSession);
|
|
27867
|
+
session.once("error", removeSession);
|
|
27716
27868
|
let entry = [session, options];
|
|
27717
27869
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
27718
27870
|
return session;
|
|
@@ -27731,6 +27883,13 @@ var require_axios = __commonJS({
|
|
|
27731
27883
|
} : fn;
|
|
27732
27884
|
};
|
|
27733
27885
|
var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
|
|
27886
|
+
var trimTrailingDots = (value) => {
|
|
27887
|
+
let end = value.length;
|
|
27888
|
+
while (end && value.charCodeAt(end - 1) === 46) {
|
|
27889
|
+
end--;
|
|
27890
|
+
}
|
|
27891
|
+
return end === value.length ? value : value.slice(0, end);
|
|
27892
|
+
};
|
|
27734
27893
|
var isIPv4Loopback = (host) => {
|
|
27735
27894
|
const parts = host.split(".");
|
|
27736
27895
|
if (parts.length !== 4) return false;
|
|
@@ -27763,7 +27922,7 @@ var require_axios = __commonJS({
|
|
|
27763
27922
|
if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
|
|
27764
27923
|
h = h.slice(1, -1);
|
|
27765
27924
|
}
|
|
27766
|
-
h = h
|
|
27925
|
+
h = trimTrailingDots(h);
|
|
27767
27926
|
if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
|
|
27768
27927
|
const parts = h.split(".");
|
|
27769
27928
|
if (parts.some((p) => p === "")) return host;
|
|
@@ -27875,6 +28034,40 @@ var require_axios = __commonJS({
|
|
|
27875
28034
|
}
|
|
27876
28035
|
return host;
|
|
27877
28036
|
};
|
|
28037
|
+
var IPV4_OCTET_RE = /^(?:0|[1-9]\d{0,2})$/;
|
|
28038
|
+
var ipv4ToBytes = (host) => {
|
|
28039
|
+
const parts = host.split(".");
|
|
28040
|
+
return parts.length === 4 && parts.every((part) => IPV4_OCTET_RE.test(part) && Number(part) <= 255) ? parts.map(Number) : null;
|
|
28041
|
+
};
|
|
28042
|
+
var IPV6_GROUP_RE = /^[0-9a-f]{1,4}$/i;
|
|
28043
|
+
var ipv6ToBytes = (host) => {
|
|
28044
|
+
const halves = host.split("::");
|
|
28045
|
+
if (halves.length > 2) {
|
|
28046
|
+
return null;
|
|
28047
|
+
}
|
|
28048
|
+
const groups = halves[0] ? halves[0].split(":") : [];
|
|
28049
|
+
if (halves.length === 2) {
|
|
28050
|
+
const rear = halves[1] ? halves[1].split(":") : [];
|
|
28051
|
+
const missing = 8 - groups.length - rear.length;
|
|
28052
|
+
if (missing < 1) {
|
|
28053
|
+
return null;
|
|
28054
|
+
}
|
|
28055
|
+
groups.push(...new Array(missing).fill("0"), ...rear);
|
|
28056
|
+
}
|
|
28057
|
+
if (groups.length !== 8 || groups.some((group) => !IPV6_GROUP_RE.test(group))) {
|
|
28058
|
+
return null;
|
|
28059
|
+
}
|
|
28060
|
+
return groups.flatMap((group) => {
|
|
28061
|
+
const value = Number.parseInt(group, 16);
|
|
28062
|
+
return [value >> 8 & 255, value & 255];
|
|
28063
|
+
});
|
|
28064
|
+
};
|
|
28065
|
+
var ipToBytes = (host) => {
|
|
28066
|
+
if (typeof host !== "string" || !host) {
|
|
28067
|
+
return null;
|
|
28068
|
+
}
|
|
28069
|
+
return host.indexOf(":") !== -1 ? ipv6ToBytes(host) : ipv4ToBytes(host);
|
|
28070
|
+
};
|
|
27878
28071
|
var normalizeNoProxyHost = (hostname) => {
|
|
27879
28072
|
if (!hostname) {
|
|
27880
28073
|
return hostname;
|
|
@@ -27882,13 +28075,99 @@ var require_axios = __commonJS({
|
|
|
27882
28075
|
if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
|
|
27883
28076
|
hostname = hostname.slice(1, -1);
|
|
27884
28077
|
}
|
|
27885
|
-
const trimmed = hostname
|
|
28078
|
+
const trimmed = trimTrailingDots(hostname);
|
|
27886
28079
|
const ipv4 = normalizeIPAddress(trimmed);
|
|
27887
28080
|
if (ipv4 !== trimmed) {
|
|
27888
28081
|
return ipv4;
|
|
27889
28082
|
}
|
|
27890
28083
|
return unmapIPv4MappedIPv6(trimmed);
|
|
27891
28084
|
};
|
|
28085
|
+
var normalizeCidrBase = (input) => {
|
|
28086
|
+
let base2 = input;
|
|
28087
|
+
const startsBracket = base2.charAt(0) === "[";
|
|
28088
|
+
const endsBracket = base2.charAt(base2.length - 1) === "]";
|
|
28089
|
+
const hasBracket = base2.includes("[") || base2.includes("]");
|
|
28090
|
+
if (startsBracket || endsBracket) {
|
|
28091
|
+
if (!startsBracket || !endsBracket) {
|
|
28092
|
+
return null;
|
|
28093
|
+
}
|
|
28094
|
+
base2 = base2.slice(1, -1);
|
|
28095
|
+
if (base2.indexOf(":") === -1 || base2.includes("[") || base2.includes("]")) {
|
|
28096
|
+
return null;
|
|
28097
|
+
}
|
|
28098
|
+
} else if (hasBracket) {
|
|
28099
|
+
return null;
|
|
28100
|
+
}
|
|
28101
|
+
if (!base2 || base2.charAt(base2.length - 1) === ".") {
|
|
28102
|
+
return null;
|
|
28103
|
+
}
|
|
28104
|
+
const wasIPv6 = base2.indexOf(":") !== -1;
|
|
28105
|
+
if (wasIPv6) {
|
|
28106
|
+
try {
|
|
28107
|
+
base2 = new URL(`http://[${base2}]/`).hostname.slice(1, -1);
|
|
28108
|
+
} catch (_err) {
|
|
28109
|
+
return null;
|
|
28110
|
+
}
|
|
28111
|
+
} else {
|
|
28112
|
+
base2 = normalizeIPAddress(base2);
|
|
28113
|
+
if (!ipv4ToBytes(base2)) {
|
|
28114
|
+
return null;
|
|
28115
|
+
}
|
|
28116
|
+
}
|
|
28117
|
+
return {
|
|
28118
|
+
normalized: unmapIPv4MappedIPv6(base2),
|
|
28119
|
+
wasIPv6
|
|
28120
|
+
};
|
|
28121
|
+
};
|
|
28122
|
+
var CIDR_ENTRY_RE = /^(.+)\/(0|[1-9]\d{0,2})$/;
|
|
28123
|
+
var parseCidrEntry = (entry) => {
|
|
28124
|
+
if (entry.indexOf("/") === -1) {
|
|
28125
|
+
return void 0;
|
|
28126
|
+
}
|
|
28127
|
+
const match2 = CIDR_ENTRY_RE.exec(entry);
|
|
28128
|
+
if (!match2) {
|
|
28129
|
+
return null;
|
|
28130
|
+
}
|
|
28131
|
+
let prefix = Number(match2[2]);
|
|
28132
|
+
const parsedBase = normalizeCidrBase(match2[1]);
|
|
28133
|
+
if (!parsedBase) {
|
|
28134
|
+
return null;
|
|
28135
|
+
}
|
|
28136
|
+
const {
|
|
28137
|
+
normalized,
|
|
28138
|
+
wasIPv6
|
|
28139
|
+
} = parsedBase;
|
|
28140
|
+
if (wasIPv6 && normalized.indexOf(":") === -1) {
|
|
28141
|
+
if (prefix < 96) {
|
|
28142
|
+
return null;
|
|
28143
|
+
}
|
|
28144
|
+
prefix -= 96;
|
|
28145
|
+
}
|
|
28146
|
+
const bytes = ipToBytes(normalized);
|
|
28147
|
+
if (!bytes || prefix > bytes.length * 8) {
|
|
28148
|
+
return null;
|
|
28149
|
+
}
|
|
28150
|
+
return {
|
|
28151
|
+
bytes,
|
|
28152
|
+
prefix
|
|
28153
|
+
};
|
|
28154
|
+
};
|
|
28155
|
+
var isInSubnet = (addressBytes, networkBytes, prefix) => {
|
|
28156
|
+
const fullBytes = prefix >> 3;
|
|
28157
|
+
for (let i = 0; i < fullBytes; i++) {
|
|
28158
|
+
if (addressBytes[i] !== networkBytes[i]) {
|
|
28159
|
+
return false;
|
|
28160
|
+
}
|
|
28161
|
+
}
|
|
28162
|
+
const remainingBits = prefix & 7;
|
|
28163
|
+
if (remainingBits) {
|
|
28164
|
+
const mask = 255 << 8 - remainingBits & 255;
|
|
28165
|
+
if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) {
|
|
28166
|
+
return false;
|
|
28167
|
+
}
|
|
28168
|
+
}
|
|
28169
|
+
return true;
|
|
28170
|
+
};
|
|
27892
28171
|
function shouldBypassProxy(location) {
|
|
27893
28172
|
let parsed;
|
|
27894
28173
|
try {
|
|
@@ -27905,6 +28184,7 @@ var require_axios = __commonJS({
|
|
|
27905
28184
|
}
|
|
27906
28185
|
const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0;
|
|
27907
28186
|
const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
|
|
28187
|
+
const hostnameBytes = ipToBytes(hostname);
|
|
27908
28188
|
return noProxy.split(/[\s,]+/).some((entry) => {
|
|
27909
28189
|
if (!entry) {
|
|
27910
28190
|
return false;
|
|
@@ -27912,6 +28192,10 @@ var require_axios = __commonJS({
|
|
|
27912
28192
|
if (entry === "*") {
|
|
27913
28193
|
return true;
|
|
27914
28194
|
}
|
|
28195
|
+
const cidr = parseCidrEntry(entry);
|
|
28196
|
+
if (cidr !== void 0) {
|
|
28197
|
+
return cidr !== null && !!hostnameBytes && hostnameBytes.length === cidr.bytes.length && isInSubnet(hostnameBytes, cidr.bytes, cidr.prefix);
|
|
28198
|
+
}
|
|
27915
28199
|
let [entryHost, entryPort] = parseNoProxyEntry(entry);
|
|
27916
28200
|
entryHost = normalizeNoProxyHost(entryHost);
|
|
27917
28201
|
if (!entryHost) {
|
|
@@ -27992,13 +28276,14 @@ var require_axios = __commonJS({
|
|
|
27992
28276
|
}
|
|
27993
28277
|
};
|
|
27994
28278
|
const flush = () => lastArgs && invoke(lastArgs);
|
|
27995
|
-
|
|
28279
|
+
const flushWith = (...args) => invoke(args);
|
|
28280
|
+
return [throttled, flush, flushWith];
|
|
27996
28281
|
}
|
|
27997
28282
|
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
27998
28283
|
let bytesNotified = 0;
|
|
27999
28284
|
const _speedometer = speedometer(50, 250);
|
|
28000
28285
|
return throttle((e) => {
|
|
28001
|
-
if (!e ||
|
|
28286
|
+
if (!e || !utils$1.isNumber(e.loaded)) {
|
|
28002
28287
|
return;
|
|
28003
28288
|
}
|
|
28004
28289
|
const rawLoaded = e.loaded;
|
|
@@ -28152,6 +28437,12 @@ var require_axios = __commonJS({
|
|
|
28152
28437
|
var isHttps = /https:?/;
|
|
28153
28438
|
var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
|
|
28154
28439
|
var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq");
|
|
28440
|
+
function handleSocketError(err) {
|
|
28441
|
+
const current = this[kAxiosCurrentReq];
|
|
28442
|
+
if (current && !current.destroyed) {
|
|
28443
|
+
current.destroy(err);
|
|
28444
|
+
}
|
|
28445
|
+
}
|
|
28155
28446
|
var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
|
|
28156
28447
|
var tunnelingAgentCache = /* @__PURE__ */ new Map();
|
|
28157
28448
|
var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
|
|
@@ -28260,10 +28551,10 @@ var require_axios = __commonJS({
|
|
|
28260
28551
|
return false;
|
|
28261
28552
|
}
|
|
28262
28553
|
}
|
|
28263
|
-
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
|
|
28554
|
+
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent, allowEnvProxy = true) {
|
|
28264
28555
|
let proxy = configProxy;
|
|
28265
28556
|
const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
|
|
28266
|
-
if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
28557
|
+
if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
28267
28558
|
const proxyUrl = getProxyForUrl(location);
|
|
28268
28559
|
if (proxyUrl) {
|
|
28269
28560
|
if (!shouldBypassProxy(location)) {
|
|
@@ -28354,8 +28645,9 @@ var require_axios = __commonJS({
|
|
|
28354
28645
|
}
|
|
28355
28646
|
}
|
|
28356
28647
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
28357
|
-
setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
|
|
28648
|
+
setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent, allowEnvProxy);
|
|
28358
28649
|
};
|
|
28650
|
+
return Boolean(proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent));
|
|
28359
28651
|
}
|
|
28360
28652
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
|
|
28361
28653
|
var wrapAsync = (asyncExecutor) => {
|
|
@@ -28383,7 +28675,7 @@ var require_axios = __commonJS({
|
|
|
28383
28675
|
family
|
|
28384
28676
|
}) => {
|
|
28385
28677
|
if (!utils$1.isString(address)) {
|
|
28386
|
-
throw
|
|
28678
|
+
throw new AxiosError("address must be a string", AxiosError.ERR_BAD_OPTION_VALUE);
|
|
28387
28679
|
}
|
|
28388
28680
|
return {
|
|
28389
28681
|
address,
|
|
@@ -28394,6 +28686,30 @@ var require_axios = __commonJS({
|
|
|
28394
28686
|
address,
|
|
28395
28687
|
family
|
|
28396
28688
|
});
|
|
28689
|
+
var normalizedLookupCache = /* @__PURE__ */ new WeakMap();
|
|
28690
|
+
var normalizeLookup = (lookup) => {
|
|
28691
|
+
let normalized = normalizedLookupCache.get(lookup);
|
|
28692
|
+
if (normalized) {
|
|
28693
|
+
return normalized;
|
|
28694
|
+
}
|
|
28695
|
+
const callbackLookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
|
|
28696
|
+
normalized = (hostname, opt, cb) => {
|
|
28697
|
+
callbackLookup(hostname, opt, (err, arg0, arg1) => {
|
|
28698
|
+
if (err) {
|
|
28699
|
+
return cb(err);
|
|
28700
|
+
}
|
|
28701
|
+
let addresses;
|
|
28702
|
+
try {
|
|
28703
|
+
addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
28704
|
+
} catch (error) {
|
|
28705
|
+
return cb(error);
|
|
28706
|
+
}
|
|
28707
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
28708
|
+
});
|
|
28709
|
+
};
|
|
28710
|
+
normalizedLookupCache.set(lookup, normalized);
|
|
28711
|
+
return normalized;
|
|
28712
|
+
};
|
|
28397
28713
|
var http2Transport = {
|
|
28398
28714
|
request(options, cb) {
|
|
28399
28715
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
@@ -28438,6 +28754,7 @@ var require_axios = __commonJS({
|
|
|
28438
28754
|
let family = own2("family");
|
|
28439
28755
|
let httpVersion = own2("httpVersion");
|
|
28440
28756
|
if (httpVersion === void 0) httpVersion = 1;
|
|
28757
|
+
const rawHttpVersion = httpVersion;
|
|
28441
28758
|
let http2Options = own2("http2Options");
|
|
28442
28759
|
const httpAgent = own2("httpAgent");
|
|
28443
28760
|
const httpsAgent = own2("httpsAgent");
|
|
@@ -28454,25 +28771,20 @@ var require_axios = __commonJS({
|
|
|
28454
28771
|
let rejected = false;
|
|
28455
28772
|
let req;
|
|
28456
28773
|
let connectPhaseTimer;
|
|
28457
|
-
|
|
28774
|
+
try {
|
|
28775
|
+
httpVersion = +httpVersion;
|
|
28776
|
+
} catch (err) {
|
|
28777
|
+
throw new AxiosError("Invalid protocol version: value is not a number", AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
28778
|
+
}
|
|
28458
28779
|
if (Number.isNaN(httpVersion)) {
|
|
28459
|
-
throw
|
|
28780
|
+
throw new AxiosError(`Invalid protocol version: '${rawHttpVersion}' is not a number`, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
28460
28781
|
}
|
|
28461
28782
|
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
28462
|
-
throw
|
|
28783
|
+
throw new AxiosError(`Unsupported protocol version '${httpVersion}'`, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
28463
28784
|
}
|
|
28464
28785
|
const isHttp2 = httpVersion === 2;
|
|
28465
28786
|
if (lookup) {
|
|
28466
|
-
|
|
28467
|
-
lookup = (hostname, opt, cb) => {
|
|
28468
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
28469
|
-
if (err) {
|
|
28470
|
-
return cb(err);
|
|
28471
|
-
}
|
|
28472
|
-
const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
28473
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
28474
|
-
});
|
|
28475
|
-
};
|
|
28787
|
+
lookup = normalizeLookup(lookup);
|
|
28476
28788
|
}
|
|
28477
28789
|
const abortEmitter = new events.EventEmitter();
|
|
28478
28790
|
function abort(reason) {
|
|
@@ -28665,6 +28977,11 @@ var require_axios = __commonJS({
|
|
|
28665
28977
|
}));
|
|
28666
28978
|
}
|
|
28667
28979
|
headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
|
|
28980
|
+
if (isHttp2 && lookup) {
|
|
28981
|
+
http2Options = Object.assign(/* @__PURE__ */ Object.create(null), http2Options, {
|
|
28982
|
+
lookup
|
|
28983
|
+
});
|
|
28984
|
+
}
|
|
28668
28985
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
28669
28986
|
path: path$1,
|
|
28670
28987
|
method,
|
|
@@ -28678,9 +28995,11 @@ var require_axios = __commonJS({
|
|
|
28678
28995
|
family,
|
|
28679
28996
|
beforeRedirect: dispatchBeforeRedirect,
|
|
28680
28997
|
beforeRedirects: /* @__PURE__ */ Object.create(null),
|
|
28681
|
-
http2Options
|
|
28998
|
+
http2Options,
|
|
28999
|
+
createConnection: void 0
|
|
28682
29000
|
});
|
|
28683
29001
|
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
29002
|
+
let proxyApplied = false;
|
|
28684
29003
|
if (socketPath) {
|
|
28685
29004
|
if (typeof socketPath !== "string") {
|
|
28686
29005
|
return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config));
|
|
@@ -28698,7 +29017,18 @@ var require_axios = __commonJS({
|
|
|
28698
29017
|
} else {
|
|
28699
29018
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
28700
29019
|
options.port = parsed.port;
|
|
28701
|
-
|
|
29020
|
+
proxyApplied = setProxy(
|
|
29021
|
+
options,
|
|
29022
|
+
configProxy,
|
|
29023
|
+
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path,
|
|
29024
|
+
false,
|
|
29025
|
+
httpsAgent,
|
|
29026
|
+
httpAgent,
|
|
29027
|
+
// The HTTP/2 transport connects independently of HTTP/1 agents, so it
|
|
29028
|
+
// cannot apply either axios-resolved or agent-local environment proxies.
|
|
29029
|
+
// Explicit proxy config is still processed and rejected below.
|
|
29030
|
+
!isHttp2
|
|
29031
|
+
);
|
|
28702
29032
|
}
|
|
28703
29033
|
let transport;
|
|
28704
29034
|
let isNativeTransport = false;
|
|
@@ -28708,6 +29038,9 @@ var require_axios = __commonJS({
|
|
|
28708
29038
|
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
28709
29039
|
}
|
|
28710
29040
|
if (isHttp2) {
|
|
29041
|
+
if (proxyApplied) {
|
|
29042
|
+
return reject(new AxiosError("HTTP/2 requests with a proxy are not supported", AxiosError.ERR_NOT_SUPPORT, config));
|
|
29043
|
+
}
|
|
28711
29044
|
transport = http2Transport;
|
|
28712
29045
|
} else {
|
|
28713
29046
|
const configTransport = own2("transport");
|
|
@@ -28905,12 +29238,7 @@ var require_axios = __commonJS({
|
|
|
28905
29238
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
28906
29239
|
}
|
|
28907
29240
|
if (!socket[kAxiosSocketListener]) {
|
|
28908
|
-
socket.on("error",
|
|
28909
|
-
const current = socket[kAxiosCurrentReq];
|
|
28910
|
-
if (current && !current.destroyed) {
|
|
28911
|
-
current.destroy(err);
|
|
28912
|
-
}
|
|
28913
|
-
});
|
|
29241
|
+
socket.on("error", handleSocketError);
|
|
28914
29242
|
socket[kAxiosSocketListener] = true;
|
|
28915
29243
|
}
|
|
28916
29244
|
socket[kAxiosCurrentReq] = req;
|
|
@@ -29126,7 +29454,7 @@ var require_axios = __commonJS({
|
|
|
29126
29454
|
transformResponse: defaultToConfig2,
|
|
29127
29455
|
paramsSerializer: defaultToConfig2,
|
|
29128
29456
|
timeout: defaultToConfig2,
|
|
29129
|
-
|
|
29457
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
29130
29458
|
withCredentials: defaultToConfig2,
|
|
29131
29459
|
withXSRFToken: defaultToConfig2,
|
|
29132
29460
|
adapter: defaultToConfig2,
|
|
@@ -29194,10 +29522,11 @@ var require_axios = __commonJS({
|
|
|
29194
29522
|
}
|
|
29195
29523
|
}
|
|
29196
29524
|
if (utils$1.isFormData(data)) {
|
|
29525
|
+
const getHeaders = utils$1.getSafeProp(data, "getHeaders");
|
|
29197
29526
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
29198
29527
|
headers.setContentType(void 0);
|
|
29199
|
-
} else if (utils$1.isFunction(
|
|
29200
|
-
setFormDataHeaders(headers,
|
|
29528
|
+
} else if (utils$1.isFunction(getHeaders)) {
|
|
29529
|
+
setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy"));
|
|
29201
29530
|
}
|
|
29202
29531
|
}
|
|
29203
29532
|
if (platform.hasStandardBrowserEnv) {
|
|
@@ -29227,7 +29556,7 @@ var require_axios = __commonJS({
|
|
|
29227
29556
|
} = _config;
|
|
29228
29557
|
let onCanceled;
|
|
29229
29558
|
let uploadThrottled, downloadThrottled;
|
|
29230
|
-
let flushUpload, flushDownload;
|
|
29559
|
+
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
29231
29560
|
function done() {
|
|
29232
29561
|
flushUpload && flushUpload();
|
|
29233
29562
|
flushDownload && flushDownload();
|
|
@@ -29237,7 +29566,27 @@ var require_axios = __commonJS({
|
|
|
29237
29566
|
let request = new XMLHttpRequest();
|
|
29238
29567
|
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
29239
29568
|
request.timeout = _config.timeout;
|
|
29240
|
-
function onloadend() {
|
|
29569
|
+
function onloadend(event) {
|
|
29570
|
+
if (!request) {
|
|
29571
|
+
return;
|
|
29572
|
+
}
|
|
29573
|
+
if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) {
|
|
29574
|
+
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
|
|
29575
|
+
done();
|
|
29576
|
+
request = null;
|
|
29577
|
+
return;
|
|
29578
|
+
}
|
|
29579
|
+
try {
|
|
29580
|
+
if (event) {
|
|
29581
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
29582
|
+
} else {
|
|
29583
|
+
flushDownload && flushDownload();
|
|
29584
|
+
}
|
|
29585
|
+
} catch (err) {
|
|
29586
|
+
setTimeout(() => {
|
|
29587
|
+
throw err;
|
|
29588
|
+
});
|
|
29589
|
+
}
|
|
29241
29590
|
if (!request) {
|
|
29242
29591
|
return;
|
|
29243
29592
|
}
|
|
@@ -29312,7 +29661,7 @@ var require_axios = __commonJS({
|
|
|
29312
29661
|
request.responseType = _config.responseType;
|
|
29313
29662
|
}
|
|
29314
29663
|
if (onDownloadProgress) {
|
|
29315
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
29664
|
+
[downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(onDownloadProgress, true);
|
|
29316
29665
|
request.addEventListener("progress", downloadThrottled);
|
|
29317
29666
|
}
|
|
29318
29667
|
if (onUploadProgress && request.upload) {
|
|
@@ -29474,6 +29823,17 @@ var require_axios = __commonJS({
|
|
|
29474
29823
|
});
|
|
29475
29824
|
};
|
|
29476
29825
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
29826
|
+
var DEFAULT_REQUEST_OPTIONS = {
|
|
29827
|
+
cache: "default",
|
|
29828
|
+
redirect: "follow",
|
|
29829
|
+
referrer: "about:client",
|
|
29830
|
+
referrerPolicy: "",
|
|
29831
|
+
mode: "cors",
|
|
29832
|
+
integrity: "",
|
|
29833
|
+
keepalive: false,
|
|
29834
|
+
priority: "auto",
|
|
29835
|
+
window: null
|
|
29836
|
+
};
|
|
29477
29837
|
var {
|
|
29478
29838
|
isFunction
|
|
29479
29839
|
} = utils$1;
|
|
@@ -29602,7 +29962,8 @@ var require_axios = __commonJS({
|
|
|
29602
29962
|
withCredentials = "same-origin",
|
|
29603
29963
|
fetchOptions,
|
|
29604
29964
|
maxContentLength,
|
|
29605
|
-
maxBodyLength
|
|
29965
|
+
maxBodyLength,
|
|
29966
|
+
maxRedirects
|
|
29606
29967
|
} = resolveConfig(config);
|
|
29607
29968
|
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
29608
29969
|
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
@@ -29703,17 +30064,44 @@ var require_axios = __commonJS({
|
|
|
29703
30064
|
}
|
|
29704
30065
|
}
|
|
29705
30066
|
headers.set("User-Agent", "axios/" + VERSION2, false);
|
|
29706
|
-
const
|
|
29707
|
-
|
|
30067
|
+
const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(/* @__PURE__ */ Object.create(null), fetchOptions);
|
|
30068
|
+
if (safeFetchOptions) {
|
|
30069
|
+
delete safeFetchOptions.body;
|
|
30070
|
+
delete safeFetchOptions.headers;
|
|
30071
|
+
delete safeFetchOptions.method;
|
|
30072
|
+
delete safeFetchOptions.signal;
|
|
30073
|
+
delete safeFetchOptions.duplex;
|
|
30074
|
+
delete safeFetchOptions.credentials;
|
|
30075
|
+
}
|
|
30076
|
+
const resolvedOptions = Object.assign(/* @__PURE__ */ Object.create(null), safeFetchOptions, {
|
|
29708
30077
|
signal: composedSignal,
|
|
29709
30078
|
method: method.toUpperCase(),
|
|
29710
30079
|
headers: toByteStringHeaderObject(headers.normalize()),
|
|
29711
30080
|
body: data,
|
|
29712
30081
|
duplex: "half",
|
|
29713
30082
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
29714
|
-
};
|
|
30083
|
+
});
|
|
30084
|
+
if (isRequestSupported) {
|
|
30085
|
+
utils$1.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
|
|
30086
|
+
if (resolvedOptions[key] === void 0) {
|
|
30087
|
+
resolvedOptions[key] = value;
|
|
30088
|
+
}
|
|
30089
|
+
});
|
|
30090
|
+
if (resolvedOptions.signal === void 0) {
|
|
30091
|
+
resolvedOptions.signal = null;
|
|
30092
|
+
}
|
|
30093
|
+
if (resolvedOptions.body === void 0) {
|
|
30094
|
+
resolvedOptions.body = null;
|
|
30095
|
+
}
|
|
30096
|
+
}
|
|
30097
|
+
if (maxRedirects === 0) {
|
|
30098
|
+
resolvedOptions.redirect = "manual";
|
|
30099
|
+
if (safeFetchOptions) {
|
|
30100
|
+
safeFetchOptions.redirect = "manual";
|
|
30101
|
+
}
|
|
30102
|
+
}
|
|
29715
30103
|
request = isRequestSupported && new Request(url2, resolvedOptions);
|
|
29716
|
-
let response = await (isRequestSupported ? _fetch(request,
|
|
30104
|
+
let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url2, resolvedOptions));
|
|
29717
30105
|
const responseHeaders = AxiosHeaders.from(response.headers);
|
|
29718
30106
|
if (hasMaxContentLength) {
|
|
29719
30107
|
const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
@@ -29905,9 +30293,10 @@ var require_axios = __commonJS({
|
|
|
29905
30293
|
throw new CanceledError(null, config);
|
|
29906
30294
|
}
|
|
29907
30295
|
}
|
|
29908
|
-
function dispatchRequest(
|
|
30296
|
+
function dispatchRequest(_config) {
|
|
30297
|
+
const config = utils$1.toSafeFlatObject(_config);
|
|
29909
30298
|
throwIfCancellationRequested(config);
|
|
29910
|
-
config.headers = AxiosHeaders.from(config
|
|
30299
|
+
config.headers = AxiosHeaders.from(utils$1.getSafeProp(config, "headers"));
|
|
29911
30300
|
config.data = transformData.call(config, config.transformRequest);
|
|
29912
30301
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
29913
30302
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
@@ -30015,16 +30404,15 @@ var require_axios = __commonJS({
|
|
|
30015
30404
|
return await this._request(configOrUrl, config);
|
|
30016
30405
|
} catch (err) {
|
|
30017
30406
|
if (err instanceof Error) {
|
|
30018
|
-
let dummy = {};
|
|
30019
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
30020
|
-
const stack = (() => {
|
|
30021
|
-
if (!dummy.stack) {
|
|
30022
|
-
return "";
|
|
30023
|
-
}
|
|
30024
|
-
const firstNewlineIndex = dummy.stack.indexOf("\n");
|
|
30025
|
-
return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
|
|
30026
|
-
})();
|
|
30027
30407
|
try {
|
|
30408
|
+
let dummy = {};
|
|
30409
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
30410
|
+
const dummyStack = dummy.stack;
|
|
30411
|
+
let stack = "";
|
|
30412
|
+
if (typeof dummyStack === "string") {
|
|
30413
|
+
const firstNewlineIndex = dummyStack.indexOf("\n");
|
|
30414
|
+
stack = firstNewlineIndex === -1 ? "" : dummyStack.slice(firstNewlineIndex + 1);
|
|
30415
|
+
}
|
|
30028
30416
|
if (!err.stack) {
|
|
30029
30417
|
err.stack = stack;
|
|
30030
30418
|
} else if (stack) {
|
|
@@ -30086,9 +30474,9 @@ var require_axios = __commonJS({
|
|
|
30086
30474
|
baseUrl: validators.spelling("baseURL"),
|
|
30087
30475
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
30088
30476
|
}, true);
|
|
30089
|
-
config.method = (config
|
|
30477
|
+
config.method = (utils$1.getSafeProp(config, "method") || utils$1.getSafeProp(this.defaults, "method") || "get").toLowerCase();
|
|
30090
30478
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
30091
|
-
headers && utils$1.forEach(
|
|
30479
|
+
headers && utils$1.forEach(methodList.concat("common"), (method) => {
|
|
30092
30480
|
delete headers[method];
|
|
30093
30481
|
});
|
|
30094
30482
|
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
@@ -30335,14 +30723,22 @@ var require_axios = __commonJS({
|
|
|
30335
30723
|
Gone: 410,
|
|
30336
30724
|
LengthRequired: 411,
|
|
30337
30725
|
PreconditionFailed: 412,
|
|
30726
|
+
/**
|
|
30727
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
30728
|
+
*/
|
|
30338
30729
|
PayloadTooLarge: 413,
|
|
30730
|
+
ContentTooLarge: 413,
|
|
30339
30731
|
UriTooLong: 414,
|
|
30340
30732
|
UnsupportedMediaType: 415,
|
|
30341
30733
|
RangeNotSatisfiable: 416,
|
|
30342
30734
|
ExpectationFailed: 417,
|
|
30343
30735
|
ImATeapot: 418,
|
|
30344
30736
|
MisdirectedRequest: 421,
|
|
30737
|
+
/**
|
|
30738
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
30739
|
+
*/
|
|
30345
30740
|
UnprocessableEntity: 422,
|
|
30741
|
+
UnprocessableContent: 422,
|
|
30346
30742
|
Locked: 423,
|
|
30347
30743
|
FailedDependency: 424,
|
|
30348
30744
|
TooEarly: 425,
|
|
@@ -30371,7 +30767,9 @@ var require_axios = __commonJS({
|
|
|
30371
30767
|
InvalidSslCertificate: 526
|
|
30372
30768
|
};
|
|
30373
30769
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
30374
|
-
HttpStatusCode[value]
|
|
30770
|
+
if (HttpStatusCode[value] === void 0) {
|
|
30771
|
+
HttpStatusCode[value] = key;
|
|
30772
|
+
}
|
|
30375
30773
|
});
|
|
30376
30774
|
function createInstance(defaultConfig) {
|
|
30377
30775
|
const context = new Axios(defaultConfig);
|
|
@@ -30516,7 +30914,7 @@ Request ID: ${requestId}`;
|
|
|
30516
30914
|
if (statusCode === HTTP_STATUS.RATE_LIMIT) {
|
|
30517
30915
|
enhancedMessage += "\n\nRate limit exceeded. Please try again later or contact your SAP administrator.\nSee: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/rate-limits";
|
|
30518
30916
|
} else if (statusCode >= HTTP_STATUS.INTERNAL_ERROR) {
|
|
30519
|
-
enhancedMessage += "\n\nSAP AI Core service error. This is typically a temporary issue.
|
|
30917
|
+
enhancedMessage += "\n\nSAP AI Core service error. This is typically a temporary issue. Retries depend on the caller's retry configuration.\nSee: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/troubleshooting";
|
|
30520
30918
|
} else if (location) {
|
|
30521
30919
|
enhancedMessage += `
|
|
30522
30920
|
|
|
@@ -30991,15 +31389,13 @@ The model's response was blocked by content safety filters. Try a different prom
|
|
|
30991
31389
|
/**
|
|
30992
31390
|
* Creates a new UnsupportedFeatureError.
|
|
30993
31391
|
* @param feature - The name of the unsupported feature (e.g., "Content filtering").
|
|
30994
|
-
* @param api - The API being used
|
|
31392
|
+
* @param api - The API being used that does not support the feature.
|
|
30995
31393
|
* @param suggestedApi - The API that supports this feature.
|
|
30996
31394
|
*/
|
|
30997
31395
|
constructor(feature, api, suggestedApi) {
|
|
30998
31396
|
const apiName = api === "foundation-models" ? "Foundation Models" : "Orchestration";
|
|
30999
31397
|
const suggestedApiName = suggestedApi === "foundation-models" ? "Foundation Models" : "Orchestration";
|
|
31000
|
-
super(
|
|
31001
|
-
`${feature} is only available with ${suggestedApiName} API and will be ignored by ${apiName} API.`
|
|
31002
|
-
);
|
|
31398
|
+
super(`${feature} is not supported by ${apiName} API. Use ${suggestedApiName} API instead.`);
|
|
31003
31399
|
this.feature = feature;
|
|
31004
31400
|
this.api = api;
|
|
31005
31401
|
this.suggestedApi = suggestedApi;
|
|
@@ -31833,7 +32229,7 @@ var VERSION;
|
|
|
31833
32229
|
var init_version = __esm({
|
|
31834
32230
|
"src/version.ts"() {
|
|
31835
32231
|
"use strict";
|
|
31836
|
-
VERSION = true ? "
|
|
32232
|
+
VERSION = true ? "5.0.1" : "0.0.0-test";
|
|
31837
32233
|
}
|
|
31838
32234
|
});
|
|
31839
32235
|
|
|
@@ -32262,6 +32658,7 @@ var init_base_language_model_strategy = __esm({
|
|
|
32262
32658
|
outputKey: "presence_penalty"
|
|
32263
32659
|
},
|
|
32264
32660
|
{ camelCaseKey: "seed", optionKey: "seed", outputKey: "seed" },
|
|
32661
|
+
{ optionKey: "reasoning", outputKey: "reasoning_effort" },
|
|
32265
32662
|
{ camelCaseKey: "parallel_tool_calls", outputKey: "parallel_tool_calls" }
|
|
32266
32663
|
];
|
|
32267
32664
|
async doGenerate(config, settings, options) {
|
|
@@ -32419,17 +32816,17 @@ var init_base_language_model_strategy = __esm({
|
|
|
32419
32816
|
* Returns whether to escape template placeholders for this API.
|
|
32420
32817
|
* @param _sapOptions - Parsed provider options (unused in base implementation).
|
|
32421
32818
|
* @param _settings - Model settings (unused in base implementation).
|
|
32422
|
-
* @returns false by default; Orchestration
|
|
32819
|
+
* @returns false by default; the Orchestration override defaults to true unless disabled.
|
|
32423
32820
|
* @internal
|
|
32424
32821
|
*/
|
|
32425
32822
|
getEscapeTemplatePlaceholders(_sapOptions, _settings) {
|
|
32426
32823
|
return false;
|
|
32427
32824
|
}
|
|
32428
32825
|
/**
|
|
32429
|
-
* Returns whether
|
|
32826
|
+
* Returns whether assistant reasoning in the input history is forwarded as text.
|
|
32430
32827
|
* @param sapOptions - Parsed provider options.
|
|
32431
32828
|
* @param settings - Model settings.
|
|
32432
|
-
* @returns Whether to
|
|
32829
|
+
* @returns Whether to forward input reasoning (checks sapOptions then settings, defaults to false).
|
|
32433
32830
|
* @internal
|
|
32434
32831
|
*/
|
|
32435
32832
|
getIncludeReasoning(sapOptions, settings) {
|
|
@@ -32629,13 +33026,13 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32629
33026
|
super();
|
|
32630
33027
|
this.ClientClass = ClientClass;
|
|
32631
33028
|
}
|
|
32632
|
-
buildRequest(
|
|
33029
|
+
buildRequest(_config, settings, options, commonParts) {
|
|
32633
33030
|
const warnings = [];
|
|
32634
33031
|
const { configRef } = commonParts.resolvedState;
|
|
32635
33032
|
if (configRef) {
|
|
32636
|
-
return this.buildConfigRefRequest(settings, options, commonParts,
|
|
33033
|
+
return this.buildConfigRefRequest(settings, options, commonParts, warnings);
|
|
32637
33034
|
}
|
|
32638
|
-
return this.buildStandardRequest(
|
|
33035
|
+
return this.buildStandardRequest(settings, commonParts, warnings);
|
|
32639
33036
|
}
|
|
32640
33037
|
/**
|
|
32641
33038
|
* Collects stream-specific warnings for orchestration.
|
|
@@ -32661,20 +33058,17 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32661
33058
|
return warnings;
|
|
32662
33059
|
}
|
|
32663
33060
|
createClient(config, settings, commonParts) {
|
|
32664
|
-
const { configRef, promptTemplateRef, tools } = commonParts.resolvedState;
|
|
33061
|
+
const { configRef, promptTemplateRef, responseFormat, tools } = commonParts.resolvedState;
|
|
32665
33062
|
if (configRef) {
|
|
32666
33063
|
return new this.ClientClass(configRef, config.deploymentConfig, config.destination);
|
|
32667
33064
|
}
|
|
32668
|
-
const
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
prompt: promptConfig
|
|
32676
|
-
}
|
|
32677
|
-
};
|
|
33065
|
+
const clientConfig = this.buildOrchestrationModuleConfig(config, settings, {
|
|
33066
|
+
modelParams: commonParts.modelParams,
|
|
33067
|
+
promptTemplateRef,
|
|
33068
|
+
responseFormat,
|
|
33069
|
+
toolChoice: commonParts.toolChoice,
|
|
33070
|
+
tools
|
|
33071
|
+
});
|
|
32678
33072
|
if (settings.fallbackModuleConfigs && settings.fallbackModuleConfigs.length > 0) {
|
|
32679
33073
|
const configList = [
|
|
32680
33074
|
clientConfig,
|
|
@@ -32754,26 +33148,30 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32754
33148
|
resolveAdditionalState(_config, settings, sapOptions, options, warnings) {
|
|
32755
33149
|
const configRef = this.resolveConfigRef(sapOptions, settings, warnings);
|
|
32756
33150
|
const promptTemplateRef = this.resolvePromptTemplateRef(sapOptions, settings);
|
|
33151
|
+
let responseFormat;
|
|
32757
33152
|
if (configRef === void 0) {
|
|
32758
33153
|
validateMaskingProvidersDeprecation(settings, warnings);
|
|
33154
|
+
const converted = convertResponseFormat(options.responseFormat, settings.responseFormat);
|
|
33155
|
+
responseFormat = converted.responseFormat;
|
|
33156
|
+
if (converted.warning) warnings.push(converted.warning);
|
|
32759
33157
|
}
|
|
32760
33158
|
const tools = this.resolveTools(settings, options, warnings);
|
|
32761
|
-
return { configRef, promptTemplateRef, tools };
|
|
33159
|
+
return { configRef, promptTemplateRef, responseFormat, tools };
|
|
32762
33160
|
}
|
|
32763
33161
|
/**
|
|
32764
33162
|
* Builds request for orchestrationConfigRef mode.
|
|
32765
33163
|
*
|
|
32766
33164
|
* In configRef mode, the full configuration is managed server-side.
|
|
32767
|
-
*
|
|
33165
|
+
* This request contains messages and placeholderValues; createClient separately
|
|
33166
|
+
* passes the reference, including overrideConfig, to the SAP SDK.
|
|
32768
33167
|
* @param settings - Model settings.
|
|
32769
33168
|
* @param options - Call options.
|
|
32770
33169
|
* @param commonParts - Common build result.
|
|
32771
|
-
* @param _configRef - The config reference (unused, passed for signature consistency).
|
|
32772
33170
|
* @param warnings - Warnings array to populate.
|
|
32773
33171
|
* @returns Request body and warnings.
|
|
32774
33172
|
* @internal
|
|
32775
33173
|
*/
|
|
32776
|
-
buildConfigRefRequest(settings, options, commonParts,
|
|
33174
|
+
buildConfigRefRequest(settings, options, commonParts, warnings) {
|
|
32777
33175
|
warnings.push(
|
|
32778
33176
|
...this.collectConfigRefIgnoredWarnings(settings, options, commonParts.sapOptions)
|
|
32779
33177
|
);
|
|
@@ -32831,33 +33229,6 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32831
33229
|
);
|
|
32832
33230
|
return moduleConfig;
|
|
32833
33231
|
}
|
|
32834
|
-
/**
|
|
32835
|
-
* Builds the final request body for the orchestration API.
|
|
32836
|
-
* @param messages - Chat messages.
|
|
32837
|
-
* @param orchestrationConfig - Module configuration.
|
|
32838
|
-
* @param placeholderValues - Optional placeholder values.
|
|
32839
|
-
* @param hasTemplateRef - Whether template_ref mode is active.
|
|
32840
|
-
* @returns Request body.
|
|
32841
|
-
* @internal
|
|
32842
|
-
*/
|
|
32843
|
-
buildRequestBody(messages, orchestrationConfig, placeholderValues, hasTemplateRef) {
|
|
32844
|
-
const promptTemplating = orchestrationConfig.promptTemplating;
|
|
32845
|
-
const messagesField = hasTemplateRef ? { messagesHistory: messages } : { messages };
|
|
32846
|
-
const requestBody = {
|
|
32847
|
-
...messagesField,
|
|
32848
|
-
model: {
|
|
32849
|
-
...orchestrationConfig.promptTemplating.model
|
|
32850
|
-
},
|
|
32851
|
-
...placeholderValues ? { placeholderValues } : {},
|
|
32852
|
-
...promptTemplating.prompt.tools ? { tools: promptTemplating.prompt.tools } : {},
|
|
32853
|
-
...promptTemplating.prompt.response_format ? { response_format: promptTemplating.prompt.response_format } : {}
|
|
32854
|
-
};
|
|
32855
|
-
copyOrchestrationModules(
|
|
32856
|
-
requestBody,
|
|
32857
|
-
orchestrationConfig
|
|
32858
|
-
);
|
|
32859
|
-
return requestBody;
|
|
32860
|
-
}
|
|
32861
33232
|
/**
|
|
32862
33233
|
* Builds SAP SDK stream options from user-facing stream options.
|
|
32863
33234
|
* @param streamOptions - User-provided stream options.
|
|
@@ -32885,38 +33256,19 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32885
33256
|
}
|
|
32886
33257
|
/**
|
|
32887
33258
|
* Builds request for standard (non-configRef) mode.
|
|
32888
|
-
* @param config - Strategy configuration.
|
|
32889
33259
|
* @param settings - Model settings.
|
|
32890
|
-
* @param options - Call options.
|
|
32891
33260
|
* @param commonParts - Common build result.
|
|
32892
33261
|
* @param warnings - Warnings array to populate.
|
|
32893
33262
|
* @returns Request body and warnings.
|
|
32894
33263
|
* @internal
|
|
32895
33264
|
*/
|
|
32896
|
-
buildStandardRequest(
|
|
32897
|
-
const { promptTemplateRef
|
|
32898
|
-
const { responseFormat, warning: responseFormatWarning } = convertResponseFormat(
|
|
32899
|
-
options.responseFormat,
|
|
32900
|
-
settings.responseFormat
|
|
32901
|
-
);
|
|
32902
|
-
if (responseFormatWarning) {
|
|
32903
|
-
warnings.push(responseFormatWarning);
|
|
32904
|
-
}
|
|
32905
|
-
const { toolChoice } = commonParts;
|
|
32906
|
-
const orchestrationConfig = this.buildOrchestrationModuleConfig(config, settings, {
|
|
32907
|
-
modelParams: commonParts.modelParams,
|
|
32908
|
-
promptTemplateRef,
|
|
32909
|
-
responseFormat,
|
|
32910
|
-
toolChoice,
|
|
32911
|
-
tools
|
|
32912
|
-
});
|
|
33265
|
+
buildStandardRequest(settings, commonParts, warnings) {
|
|
33266
|
+
const { promptTemplateRef } = commonParts.resolvedState;
|
|
32913
33267
|
const placeholderValues = resolvePlaceholderValues(settings, commonParts.sapOptions);
|
|
32914
|
-
const request =
|
|
32915
|
-
commonParts.messages,
|
|
32916
|
-
|
|
32917
|
-
|
|
32918
|
-
Boolean(promptTemplateRef)
|
|
32919
|
-
);
|
|
33268
|
+
const request = {
|
|
33269
|
+
...promptTemplateRef ? { messagesHistory: commonParts.messages } : { messages: commonParts.messages },
|
|
33270
|
+
...placeholderValues ? { placeholderValues } : {}
|
|
33271
|
+
};
|
|
32920
33272
|
return { request, warnings };
|
|
32921
33273
|
}
|
|
32922
33274
|
/**
|
|
@@ -32959,6 +33311,15 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32959
33311
|
ignoredSettings.push(`providerOptions.${key}`);
|
|
32960
33312
|
}
|
|
32961
33313
|
}
|
|
33314
|
+
const optionValues = options;
|
|
33315
|
+
for (const { optionKey } of this.getParamMappings()) {
|
|
33316
|
+
if (optionKey && optionValues[optionKey] !== void 0) {
|
|
33317
|
+
ignoredSettings.push(`options.${optionKey}`);
|
|
33318
|
+
}
|
|
33319
|
+
}
|
|
33320
|
+
if (options.stopSequences && options.stopSequences.length > 0) {
|
|
33321
|
+
ignoredSettings.push("options.stopSequences");
|
|
33322
|
+
}
|
|
32962
33323
|
if (options.tools && options.tools.length > 0) {
|
|
32963
33324
|
ignoredSettings.push("options.tools");
|
|
32964
33325
|
}
|
|
@@ -32978,8 +33339,8 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32978
33339
|
}
|
|
32979
33340
|
/**
|
|
32980
33341
|
* Resolves the orchestrationConfigRef from provider options or settings.
|
|
32981
|
-
*
|
|
32982
|
-
* ignored with a warning
|
|
33342
|
+
* Parsed provider options take priority over settings. An invalid settings reference
|
|
33343
|
+
* is ignored with a warning; invalid per-call references fail schema parsing earlier.
|
|
32983
33344
|
* @param sapOptions - Parsed provider options from commonParts.
|
|
32984
33345
|
* @param settings - The model settings.
|
|
32985
33346
|
* @param warnings - Shared warnings sink for degradation signals.
|
|
@@ -33227,12 +33588,13 @@ function convertStreamPartToV2(internalPart) {
|
|
|
33227
33588
|
case "tool-result":
|
|
33228
33589
|
return withProviderMetadata(
|
|
33229
33590
|
{
|
|
33591
|
+
// V3 tool results are provider-executed, independent of dynamic tool classification.
|
|
33592
|
+
providerExecuted: true,
|
|
33230
33593
|
result: internalPart.result,
|
|
33231
33594
|
toolCallId: internalPart.toolCallId,
|
|
33232
33595
|
toolName: internalPart.toolName,
|
|
33233
33596
|
type: "tool-result",
|
|
33234
|
-
...internalPart.isError !== void 0 && { isError: internalPart.isError }
|
|
33235
|
-
...internalPart.dynamic !== void 0 && { providerExecuted: internalPart.dynamic }
|
|
33597
|
+
...internalPart.isError !== void 0 && { isError: internalPart.isError }
|
|
33236
33598
|
},
|
|
33237
33599
|
internalPart.providerMetadata
|
|
33238
33600
|
);
|
|
@@ -33426,9 +33788,7 @@ var SAPAIEmbeddingModelV2 = class {
|
|
|
33426
33788
|
if (result.warnings && result.warnings.length > 0) {
|
|
33427
33789
|
const warnings = convertWarningsToV2(result.warnings);
|
|
33428
33790
|
for (const warning of warnings) {
|
|
33429
|
-
|
|
33430
|
-
console.warn(`[SAP AI Embedding] ${warning.message}`);
|
|
33431
|
-
}
|
|
33791
|
+
console.warn(`[SAP AI Embedding] ${warning.message}`);
|
|
33432
33792
|
}
|
|
33433
33793
|
}
|
|
33434
33794
|
return {
|
|
@@ -33605,7 +33965,7 @@ function createSAPAIProvider(options = {}) {
|
|
|
33605
33965
|
"createSAPAIProvider: both 'deploymentId' and 'resourceGroup' were provided; using 'deploymentId' and ignoring 'resourceGroup'."
|
|
33606
33966
|
);
|
|
33607
33967
|
}
|
|
33608
|
-
if (!process.env.SAP_CLOUD_SDK_LOG_LEVEL) {
|
|
33968
|
+
if (typeof process === "undefined" || !process.env.SAP_CLOUD_SDK_LOG_LEVEL) {
|
|
33609
33969
|
const logLevel = options.logLevel ?? "warn";
|
|
33610
33970
|
(0, import_util2.setGlobalLogLevel)(logLevel);
|
|
33611
33971
|
}
|
|
@@ -33734,6 +34094,6 @@ mime-types/index.js:
|
|
|
33734
34094
|
*)
|
|
33735
34095
|
|
|
33736
34096
|
axios/dist/node/axios.cjs:
|
|
33737
|
-
(*! Axios v1.
|
|
34097
|
+
(*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
33738
34098
|
*/
|
|
33739
|
-
//# sourceMappingURL=index
|
|
34099
|
+
//# sourceMappingURL=index.cjs.map
|