@jerome-benoit/sap-ai-provider-v2 4.9.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -51
- package/dist/{chunk-4PLJVJX4.js → chunk-BIBSYTMU.js} +517 -216
- package/dist/chunk-BIBSYTMU.js.map +1 -0
- package/dist/{chunk-RW6WSPU2.js → chunk-FY2HO62O.js} +3 -3
- package/dist/{chunk-33WLQYKB.js → chunk-Q5JV4I6D.js} +2 -2
- package/dist/{chunk-4JIMBRMV.js → chunk-QDUZRLMI.js} +154 -20
- package/dist/chunk-QDUZRLMI.js.map +1 -0
- package/dist/{chunk-4SQ5HC6Y.js → chunk-TXZZURBA.js} +2 -2
- package/dist/{chunk-3KCERYUB.js → chunk-WNR7DC4V.js} +5 -4
- package/dist/chunk-WNR7DC4V.js.map +1 -0
- package/dist/{foundation-models-embedding-model-strategy-RVJQSJPU.js → foundation-models-embedding-model-strategy-JJBN3TQI.js} +4 -4
- package/dist/{foundation-models-language-model-strategy-UWJ6FHBI.js → foundation-models-language-model-strategy-6ELKE34K.js} +5 -5
- package/dist/index.cjs +754 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1638 -10
- package/dist/index.d.ts +1638 -10
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/{orchestration-embedding-model-strategy-OMIXGLHJ.js → orchestration-embedding-model-strategy-QI72OB3E.js} +5 -5
- package/dist/{orchestration-language-model-strategy-UE7OQO5K.js → orchestration-language-model-strategy-X4FZNLSA.js} +51 -79
- package/dist/orchestration-language-model-strategy-X4FZNLSA.js.map +1 -0
- package/package.json +30 -24
- package/dist/chunk-3KCERYUB.js.map +0 -1
- package/dist/chunk-4JIMBRMV.js.map +0 -1
- package/dist/chunk-4PLJVJX4.js.map +0 -1
- package/dist/orchestration-language-model-strategy-UE7OQO5K.js.map +0 -1
- /package/dist/{chunk-RW6WSPU2.js.map → chunk-FY2HO62O.js.map} +0 -0
- /package/dist/{chunk-33WLQYKB.js.map → chunk-Q5JV4I6D.js.map} +0 -0
- /package/dist/{chunk-4SQ5HC6Y.js.map → chunk-TXZZURBA.js.map} +0 -0
- /package/dist/{foundation-models-embedding-model-strategy-RVJQSJPU.js.map → foundation-models-embedding-model-strategy-JJBN3TQI.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-UWJ6FHBI.js.map → foundation-models-language-model-strategy-6ELKE34K.js.map} +0 -0
- /package/dist/{orchestration-embedding-model-strategy-OMIXGLHJ.js.map → orchestration-embedding-model-strategy-QI72OB3E.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
|
}
|
|
@@ -317,7 +451,7 @@ function parseSAPPartProviderOptions(providerOptions, warnings) {
|
|
|
317
451
|
}
|
|
318
452
|
return void 0;
|
|
319
453
|
}
|
|
320
|
-
var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
|
|
454
|
+
var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefOverrideSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
|
|
321
455
|
var init_sap_ai_provider_options = __esm({
|
|
322
456
|
"src/sap-ai-provider-options.ts"() {
|
|
323
457
|
"use strict";
|
|
@@ -361,11 +495,48 @@ var init_sap_ai_provider_options = __esm({
|
|
|
361
495
|
promptTemplateRefByIdSchema,
|
|
362
496
|
promptTemplateRefByScenarioNameVersionSchema
|
|
363
497
|
]);
|
|
498
|
+
orchestrationConfigRefOverrideSchema = import_zod.z.custom(
|
|
499
|
+
(value) => typeof value === "object" && value !== null && !Array.isArray(value),
|
|
500
|
+
{ message: "overrideConfig must be an object" }
|
|
501
|
+
).refine(
|
|
502
|
+
(value) => {
|
|
503
|
+
let stream;
|
|
504
|
+
try {
|
|
505
|
+
stream = value.stream;
|
|
506
|
+
} catch {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
return stream === void 0 || Boolean(stream) && typeof stream === "object" && !Array.isArray(stream);
|
|
510
|
+
},
|
|
511
|
+
{ message: "overrideConfig.stream must be an object" }
|
|
512
|
+
).refine(
|
|
513
|
+
(value) => {
|
|
514
|
+
let stream;
|
|
515
|
+
try {
|
|
516
|
+
stream = value.stream;
|
|
517
|
+
} catch {
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
if (stream === void 0 || stream === null || typeof stream !== "object") {
|
|
521
|
+
return true;
|
|
522
|
+
}
|
|
523
|
+
try {
|
|
524
|
+
return !("enabled" in stream);
|
|
525
|
+
} catch {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
message: "stream.enabled is not allowed in overrideConfig: it is controlled by the call site (stream() or chatCompletion())"
|
|
531
|
+
}
|
|
532
|
+
);
|
|
364
533
|
orchestrationConfigRefByIdSchema = import_zod.z.object({
|
|
365
|
-
id: import_zod.z.string().min(1, "Config ID cannot be empty")
|
|
534
|
+
id: import_zod.z.string().min(1, "Config ID cannot be empty"),
|
|
535
|
+
overrideConfig: orchestrationConfigRefOverrideSchema.optional()
|
|
366
536
|
});
|
|
367
537
|
orchestrationConfigRefByScenarioNameVersionSchema = import_zod.z.object({
|
|
368
538
|
name: import_zod.z.string().min(1, "Config name cannot be empty"),
|
|
539
|
+
overrideConfig: orchestrationConfigRefOverrideSchema.optional(),
|
|
369
540
|
scenario: import_zod.z.string().min(1, "Scenario cannot be empty"),
|
|
370
541
|
version: import_zod.z.string().min(1, "Version cannot be empty")
|
|
371
542
|
});
|
|
@@ -3684,12 +3855,12 @@ var require_buffer_list = __commonJS({
|
|
|
3684
3855
|
return (hint === "string" ? String : Number)(input);
|
|
3685
3856
|
}
|
|
3686
3857
|
var _require = require("buffer");
|
|
3687
|
-
var
|
|
3858
|
+
var Buffer2 = _require.Buffer;
|
|
3688
3859
|
var _require2 = require("util");
|
|
3689
3860
|
var inspect = _require2.inspect;
|
|
3690
3861
|
var custom = inspect && inspect.custom || "inspect";
|
|
3691
3862
|
function copyBuffer(src, target, offset) {
|
|
3692
|
-
|
|
3863
|
+
Buffer2.prototype.copy.call(src, target, offset);
|
|
3693
3864
|
}
|
|
3694
3865
|
module2.exports = /* @__PURE__ */ (function() {
|
|
3695
3866
|
function BufferList() {
|
|
@@ -3749,8 +3920,8 @@ var require_buffer_list = __commonJS({
|
|
|
3749
3920
|
}, {
|
|
3750
3921
|
key: "concat",
|
|
3751
3922
|
value: function concat(n) {
|
|
3752
|
-
if (this.length === 0) return
|
|
3753
|
-
var ret =
|
|
3923
|
+
if (this.length === 0) return Buffer2.alloc(0);
|
|
3924
|
+
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
3754
3925
|
var p = this.head;
|
|
3755
3926
|
var i = 0;
|
|
3756
3927
|
while (p) {
|
|
@@ -3814,7 +3985,7 @@ var require_buffer_list = __commonJS({
|
|
|
3814
3985
|
}, {
|
|
3815
3986
|
key: "_getBuffer",
|
|
3816
3987
|
value: function _getBuffer(n) {
|
|
3817
|
-
var ret =
|
|
3988
|
+
var ret = Buffer2.allocUnsafe(n);
|
|
3818
3989
|
var p = this.head;
|
|
3819
3990
|
var c = 1;
|
|
3820
3991
|
p.data.copy(ret);
|
|
@@ -3862,34 +4033,34 @@ var require_safe_buffer = __commonJS({
|
|
|
3862
4033
|
"node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
3863
4034
|
"use strict";
|
|
3864
4035
|
var buffer = require("buffer");
|
|
3865
|
-
var
|
|
4036
|
+
var Buffer2 = buffer.Buffer;
|
|
3866
4037
|
function copyProps(src, dst) {
|
|
3867
4038
|
for (var key in src) {
|
|
3868
4039
|
dst[key] = src[key];
|
|
3869
4040
|
}
|
|
3870
4041
|
}
|
|
3871
|
-
if (
|
|
4042
|
+
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
3872
4043
|
module2.exports = buffer;
|
|
3873
4044
|
} else {
|
|
3874
4045
|
copyProps(buffer, exports2);
|
|
3875
4046
|
exports2.Buffer = SafeBuffer;
|
|
3876
4047
|
}
|
|
3877
4048
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
3878
|
-
return
|
|
4049
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
3879
4050
|
}
|
|
3880
|
-
SafeBuffer.prototype = Object.create(
|
|
3881
|
-
copyProps(
|
|
4051
|
+
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
4052
|
+
copyProps(Buffer2, SafeBuffer);
|
|
3882
4053
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
3883
4054
|
if (typeof arg === "number") {
|
|
3884
4055
|
throw new TypeError("Argument must not be a number");
|
|
3885
4056
|
}
|
|
3886
|
-
return
|
|
4057
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
3887
4058
|
};
|
|
3888
4059
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
3889
4060
|
if (typeof size !== "number") {
|
|
3890
4061
|
throw new TypeError("Argument must be a number");
|
|
3891
4062
|
}
|
|
3892
|
-
var buf =
|
|
4063
|
+
var buf = Buffer2(size);
|
|
3893
4064
|
if (fill !== void 0) {
|
|
3894
4065
|
if (typeof encoding === "string") {
|
|
3895
4066
|
buf.fill(fill, encoding);
|
|
@@ -3905,7 +4076,7 @@ var require_safe_buffer = __commonJS({
|
|
|
3905
4076
|
if (typeof size !== "number") {
|
|
3906
4077
|
throw new TypeError("Argument must be a number");
|
|
3907
4078
|
}
|
|
3908
|
-
return
|
|
4079
|
+
return Buffer2(size);
|
|
3909
4080
|
};
|
|
3910
4081
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
3911
4082
|
if (typeof size !== "number") {
|
|
@@ -3920,8 +4091,8 @@ var require_safe_buffer = __commonJS({
|
|
|
3920
4091
|
var require_string_decoder = __commonJS({
|
|
3921
4092
|
"node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
3922
4093
|
"use strict";
|
|
3923
|
-
var
|
|
3924
|
-
var isEncoding =
|
|
4094
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
4095
|
+
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
3925
4096
|
encoding = "" + encoding;
|
|
3926
4097
|
switch (encoding && encoding.toLowerCase()) {
|
|
3927
4098
|
case "hex":
|
|
@@ -3969,7 +4140,7 @@ var require_string_decoder = __commonJS({
|
|
|
3969
4140
|
}
|
|
3970
4141
|
function normalizeEncoding(enc) {
|
|
3971
4142
|
var nenc = _normalizeEncoding(enc);
|
|
3972
|
-
if (typeof nenc !== "string" && (
|
|
4143
|
+
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
3973
4144
|
return nenc || enc;
|
|
3974
4145
|
}
|
|
3975
4146
|
exports2.StringDecoder = StringDecoder;
|
|
@@ -3998,7 +4169,7 @@ var require_string_decoder = __commonJS({
|
|
|
3998
4169
|
}
|
|
3999
4170
|
this.lastNeed = 0;
|
|
4000
4171
|
this.lastTotal = 0;
|
|
4001
|
-
this.lastChar =
|
|
4172
|
+
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
4002
4173
|
}
|
|
4003
4174
|
StringDecoder.prototype.write = function(buf) {
|
|
4004
4175
|
if (buf.length === 0) return "";
|
|
@@ -4559,14 +4730,14 @@ var require_stream_readable = __commonJS({
|
|
|
4559
4730
|
return emitter.listeners(type).length;
|
|
4560
4731
|
};
|
|
4561
4732
|
var Stream = require_stream();
|
|
4562
|
-
var
|
|
4733
|
+
var Buffer2 = require("buffer").Buffer;
|
|
4563
4734
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
4564
4735
|
};
|
|
4565
4736
|
function _uint8ArrayToBuffer(chunk) {
|
|
4566
|
-
return
|
|
4737
|
+
return Buffer2.from(chunk);
|
|
4567
4738
|
}
|
|
4568
4739
|
function _isUint8Array(obj) {
|
|
4569
|
-
return
|
|
4740
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
4570
4741
|
}
|
|
4571
4742
|
var debugUtil = require("util");
|
|
4572
4743
|
var debug;
|
|
@@ -4674,7 +4845,7 @@ var require_stream_readable = __commonJS({
|
|
|
4674
4845
|
if (typeof chunk === "string") {
|
|
4675
4846
|
encoding = encoding || state.defaultEncoding;
|
|
4676
4847
|
if (encoding !== state.encoding) {
|
|
4677
|
-
chunk =
|
|
4848
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
4678
4849
|
encoding = "";
|
|
4679
4850
|
}
|
|
4680
4851
|
skipChunkCheck = true;
|
|
@@ -4699,7 +4870,7 @@ var require_stream_readable = __commonJS({
|
|
|
4699
4870
|
if (er) {
|
|
4700
4871
|
errorOrDestroy(stream, er);
|
|
4701
4872
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
4702
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !==
|
|
4873
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
4703
4874
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
4704
4875
|
}
|
|
4705
4876
|
if (addToFront) {
|
|
@@ -5392,14 +5563,14 @@ var require_stream_writable = __commonJS({
|
|
|
5392
5563
|
deprecate: require_node()
|
|
5393
5564
|
};
|
|
5394
5565
|
var Stream = require_stream();
|
|
5395
|
-
var
|
|
5566
|
+
var Buffer2 = require("buffer").Buffer;
|
|
5396
5567
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
5397
5568
|
};
|
|
5398
5569
|
function _uint8ArrayToBuffer(chunk) {
|
|
5399
|
-
return
|
|
5570
|
+
return Buffer2.from(chunk);
|
|
5400
5571
|
}
|
|
5401
5572
|
function _isUint8Array(obj) {
|
|
5402
|
-
return
|
|
5573
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
5403
5574
|
}
|
|
5404
5575
|
var destroyImpl = require_destroy();
|
|
5405
5576
|
var _require = require_state();
|
|
@@ -5527,7 +5698,7 @@ var require_stream_writable = __commonJS({
|
|
|
5527
5698
|
var state = this._writableState;
|
|
5528
5699
|
var ret = false;
|
|
5529
5700
|
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
5530
|
-
if (isBuf && !
|
|
5701
|
+
if (isBuf && !Buffer2.isBuffer(chunk)) {
|
|
5531
5702
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
5532
5703
|
}
|
|
5533
5704
|
if (typeof encoding === "function") {
|
|
@@ -5571,7 +5742,7 @@ var require_stream_writable = __commonJS({
|
|
|
5571
5742
|
});
|
|
5572
5743
|
function decodeChunk(state, chunk, encoding) {
|
|
5573
5744
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
5574
|
-
chunk =
|
|
5745
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
5575
5746
|
}
|
|
5576
5747
|
return chunk;
|
|
5577
5748
|
}
|
|
@@ -24306,121 +24477,6 @@ var require_browser = __commonJS({
|
|
|
24306
24477
|
}
|
|
24307
24478
|
});
|
|
24308
24479
|
|
|
24309
|
-
// node_modules/has-flag/index.js
|
|
24310
|
-
var require_has_flag2 = __commonJS({
|
|
24311
|
-
"node_modules/has-flag/index.js"(exports2, module2) {
|
|
24312
|
-
"use strict";
|
|
24313
|
-
module2.exports = (flag, argv = process.argv) => {
|
|
24314
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
24315
|
-
const position = argv.indexOf(prefix + flag);
|
|
24316
|
-
const terminatorPosition = argv.indexOf("--");
|
|
24317
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
24318
|
-
};
|
|
24319
|
-
}
|
|
24320
|
-
});
|
|
24321
|
-
|
|
24322
|
-
// node_modules/supports-color/index.js
|
|
24323
|
-
var require_supports_color = __commonJS({
|
|
24324
|
-
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
24325
|
-
"use strict";
|
|
24326
|
-
var os = require("os");
|
|
24327
|
-
var tty = require("tty");
|
|
24328
|
-
var hasFlag = require_has_flag2();
|
|
24329
|
-
var { env } = process;
|
|
24330
|
-
var forceColor;
|
|
24331
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
24332
|
-
forceColor = 0;
|
|
24333
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
24334
|
-
forceColor = 1;
|
|
24335
|
-
}
|
|
24336
|
-
if ("FORCE_COLOR" in env) {
|
|
24337
|
-
if (env.FORCE_COLOR === "true") {
|
|
24338
|
-
forceColor = 1;
|
|
24339
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
24340
|
-
forceColor = 0;
|
|
24341
|
-
} else {
|
|
24342
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
24343
|
-
}
|
|
24344
|
-
}
|
|
24345
|
-
function translateLevel(level) {
|
|
24346
|
-
if (level === 0) {
|
|
24347
|
-
return false;
|
|
24348
|
-
}
|
|
24349
|
-
return {
|
|
24350
|
-
level,
|
|
24351
|
-
hasBasic: true,
|
|
24352
|
-
has256: level >= 2,
|
|
24353
|
-
has16m: level >= 3
|
|
24354
|
-
};
|
|
24355
|
-
}
|
|
24356
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
24357
|
-
if (forceColor === 0) {
|
|
24358
|
-
return 0;
|
|
24359
|
-
}
|
|
24360
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
24361
|
-
return 3;
|
|
24362
|
-
}
|
|
24363
|
-
if (hasFlag("color=256")) {
|
|
24364
|
-
return 2;
|
|
24365
|
-
}
|
|
24366
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
24367
|
-
return 0;
|
|
24368
|
-
}
|
|
24369
|
-
const min = forceColor || 0;
|
|
24370
|
-
if (env.TERM === "dumb") {
|
|
24371
|
-
return min;
|
|
24372
|
-
}
|
|
24373
|
-
if (process.platform === "win32") {
|
|
24374
|
-
const osRelease = os.release().split(".");
|
|
24375
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
24376
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
24377
|
-
}
|
|
24378
|
-
return 1;
|
|
24379
|
-
}
|
|
24380
|
-
if ("CI" in env) {
|
|
24381
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
24382
|
-
return 1;
|
|
24383
|
-
}
|
|
24384
|
-
return min;
|
|
24385
|
-
}
|
|
24386
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
24387
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
24388
|
-
}
|
|
24389
|
-
if (env.COLORTERM === "truecolor") {
|
|
24390
|
-
return 3;
|
|
24391
|
-
}
|
|
24392
|
-
if ("TERM_PROGRAM" in env) {
|
|
24393
|
-
const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
24394
|
-
switch (env.TERM_PROGRAM) {
|
|
24395
|
-
case "iTerm.app":
|
|
24396
|
-
return version2 >= 3 ? 3 : 2;
|
|
24397
|
-
case "Apple_Terminal":
|
|
24398
|
-
return 2;
|
|
24399
|
-
}
|
|
24400
|
-
}
|
|
24401
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
24402
|
-
return 2;
|
|
24403
|
-
}
|
|
24404
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
24405
|
-
return 1;
|
|
24406
|
-
}
|
|
24407
|
-
if ("COLORTERM" in env) {
|
|
24408
|
-
return 1;
|
|
24409
|
-
}
|
|
24410
|
-
return min;
|
|
24411
|
-
}
|
|
24412
|
-
function getSupportLevel(stream) {
|
|
24413
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
24414
|
-
return translateLevel(level);
|
|
24415
|
-
}
|
|
24416
|
-
module2.exports = {
|
|
24417
|
-
supportsColor: getSupportLevel,
|
|
24418
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
24419
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
24420
|
-
};
|
|
24421
|
-
}
|
|
24422
|
-
});
|
|
24423
|
-
|
|
24424
24480
|
// node_modules/debug/src/node.js
|
|
24425
24481
|
var require_node3 = __commonJS({
|
|
24426
24482
|
"node_modules/debug/src/node.js"(exports2, module2) {
|
|
@@ -24440,7 +24496,7 @@ var require_node3 = __commonJS({
|
|
|
24440
24496
|
);
|
|
24441
24497
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
24442
24498
|
try {
|
|
24443
|
-
const supportsColor =
|
|
24499
|
+
const supportsColor = require("supports-color");
|
|
24444
24500
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
24445
24501
|
exports2.colors = [
|
|
24446
24502
|
20,
|
|
@@ -25626,22 +25682,82 @@ var require_axios = __commonJS({
|
|
|
25626
25682
|
var hasOwnProperty = (({
|
|
25627
25683
|
hasOwnProperty: hasOwnProperty2
|
|
25628
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
|
+
};
|
|
25629
25703
|
var hasOwnInPrototypeChain = (thing, prop) => {
|
|
25630
25704
|
let obj = thing;
|
|
25631
25705
|
const seen = [];
|
|
25632
|
-
while (obj != null
|
|
25706
|
+
while (obj != null) {
|
|
25633
25707
|
if (seen.indexOf(obj) !== -1) {
|
|
25634
25708
|
return false;
|
|
25635
25709
|
}
|
|
25636
25710
|
seen.push(obj);
|
|
25711
|
+
const prototype2 = getPrototypeOf(obj);
|
|
25712
|
+
if (isPrototypeBoundary(obj, prototype2, obj === thing)) {
|
|
25713
|
+
return false;
|
|
25714
|
+
}
|
|
25637
25715
|
if (hasOwnProperty(obj, prop)) {
|
|
25638
25716
|
return true;
|
|
25639
25717
|
}
|
|
25640
|
-
obj =
|
|
25718
|
+
obj = prototype2;
|
|
25641
25719
|
}
|
|
25642
25720
|
return false;
|
|
25643
25721
|
};
|
|
25644
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
|
+
};
|
|
25645
25761
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
25646
25762
|
const str = toString2.call(thing);
|
|
25647
25763
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -25658,13 +25774,13 @@ var require_axios = __commonJS({
|
|
|
25658
25774
|
function isBuffer(val) {
|
|
25659
25775
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
25660
25776
|
}
|
|
25661
|
-
var
|
|
25777
|
+
var isArrayBuffer2 = kindOfTest("ArrayBuffer");
|
|
25662
25778
|
function isArrayBufferView(val) {
|
|
25663
25779
|
let result;
|
|
25664
25780
|
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
25665
25781
|
result = ArrayBuffer.isView(val);
|
|
25666
25782
|
} else {
|
|
25667
|
-
result = val && val.buffer &&
|
|
25783
|
+
result = val && val.buffer && isArrayBuffer2(val.buffer);
|
|
25668
25784
|
}
|
|
25669
25785
|
return result;
|
|
25670
25786
|
}
|
|
@@ -25678,9 +25794,9 @@ var require_axios = __commonJS({
|
|
|
25678
25794
|
return false;
|
|
25679
25795
|
}
|
|
25680
25796
|
const prototype2 = getPrototypeOf(val);
|
|
25681
|
-
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat
|
|
25682
|
-
//
|
|
25683
|
-
//
|
|
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.
|
|
25684
25800
|
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
25685
25801
|
};
|
|
25686
25802
|
var isEmptyObject = (val) => {
|
|
@@ -26047,7 +26163,7 @@ var require_axios = __commonJS({
|
|
|
26047
26163
|
var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
|
|
26048
26164
|
var utils$1 = {
|
|
26049
26165
|
isArray,
|
|
26050
|
-
isArrayBuffer,
|
|
26166
|
+
isArrayBuffer: isArrayBuffer2,
|
|
26051
26167
|
isBuffer,
|
|
26052
26168
|
isFormData,
|
|
26053
26169
|
isArrayBufferView,
|
|
@@ -26092,6 +26208,7 @@ var require_axios = __commonJS({
|
|
|
26092
26208
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
26093
26209
|
hasOwnInPrototypeChain,
|
|
26094
26210
|
getSafeProp,
|
|
26211
|
+
toSafeFlatObject,
|
|
26095
26212
|
reduceDescriptors,
|
|
26096
26213
|
freezeMethods,
|
|
26097
26214
|
toObjectSet,
|
|
@@ -26172,7 +26289,7 @@ var require_axios = __commonJS({
|
|
|
26172
26289
|
});
|
|
26173
26290
|
return byteStringHeaders;
|
|
26174
26291
|
}
|
|
26175
|
-
var $internals = /* @__PURE__ */ Symbol("internals");
|
|
26292
|
+
var $internals$1 = /* @__PURE__ */ Symbol("internals");
|
|
26176
26293
|
function normalizeHeader(header) {
|
|
26177
26294
|
return header && String(header).trim().toLowerCase();
|
|
26178
26295
|
}
|
|
@@ -26468,7 +26585,7 @@ var require_axios = __commonJS({
|
|
|
26468
26585
|
return computed;
|
|
26469
26586
|
}
|
|
26470
26587
|
static accessor(header) {
|
|
26471
|
-
const internals = this[$internals] = this[$internals] = {
|
|
26588
|
+
const internals = this[$internals$1] = this[$internals$1] = {
|
|
26472
26589
|
accessors: {}
|
|
26473
26590
|
};
|
|
26474
26591
|
const accessors = internals.accessors;
|
|
@@ -26689,19 +26806,16 @@ var require_axios = __commonJS({
|
|
|
26689
26806
|
throw new TypeError("target must be an object");
|
|
26690
26807
|
}
|
|
26691
26808
|
formData = formData || new (FormData$1 || FormData)();
|
|
26692
|
-
|
|
26693
|
-
|
|
26694
|
-
|
|
26695
|
-
|
|
26696
|
-
|
|
26697
|
-
|
|
26698
|
-
|
|
26699
|
-
const
|
|
26700
|
-
const
|
|
26701
|
-
const
|
|
26702
|
-
const indexes = options.indexes;
|
|
26703
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
26704
|
-
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);
|
|
26705
26819
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
26706
26820
|
const stack = [];
|
|
26707
26821
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -26860,9 +26974,47 @@ var require_axios = __commonJS({
|
|
|
26860
26974
|
}
|
|
26861
26975
|
return url2;
|
|
26862
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
|
+
}
|
|
26863
27008
|
var InterceptorManager = class {
|
|
26864
27009
|
constructor() {
|
|
26865
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
|
+
};
|
|
26866
27018
|
}
|
|
26867
27019
|
/**
|
|
26868
27020
|
* Add a new interceptor to the stack
|
|
@@ -26874,13 +27026,25 @@ var require_axios = __commonJS({
|
|
|
26874
27026
|
* @return {Number} An ID used to remove interceptor later
|
|
26875
27027
|
*/
|
|
26876
27028
|
use(fulfilled, rejected, options) {
|
|
26877
|
-
|
|
27029
|
+
const handler = {
|
|
26878
27030
|
fulfilled,
|
|
26879
27031
|
rejected,
|
|
26880
27032
|
synchronous: options ? options.synchronous : false,
|
|
26881
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
|
|
26882
27045
|
});
|
|
26883
|
-
|
|
27046
|
+
internals.handlersLength = this.handlers.length;
|
|
27047
|
+
return id;
|
|
26884
27048
|
}
|
|
26885
27049
|
/**
|
|
26886
27050
|
* Remove an interceptor from the stack
|
|
@@ -26890,8 +27054,19 @@ var require_axios = __commonJS({
|
|
|
26890
27054
|
* @returns {void}
|
|
26891
27055
|
*/
|
|
26892
27056
|
eject(id) {
|
|
26893
|
-
|
|
26894
|
-
|
|
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
|
+
}
|
|
26895
27070
|
}
|
|
26896
27071
|
}
|
|
26897
27072
|
/**
|
|
@@ -26902,6 +27077,7 @@ var require_axios = __commonJS({
|
|
|
26902
27077
|
clear() {
|
|
26903
27078
|
if (this.handlers) {
|
|
26904
27079
|
this.handlers = [];
|
|
27080
|
+
syncHandlerEntries(this, this[$internals]);
|
|
26905
27081
|
}
|
|
26906
27082
|
}
|
|
26907
27083
|
/**
|
|
@@ -26915,11 +27091,22 @@ var require_axios = __commonJS({
|
|
|
26915
27091
|
* @returns {void}
|
|
26916
27092
|
*/
|
|
26917
27093
|
forEach(fn) {
|
|
26918
|
-
|
|
26919
|
-
|
|
26920
|
-
|
|
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);
|
|
26921
27108
|
}
|
|
26922
|
-
}
|
|
27109
|
+
}
|
|
26923
27110
|
}
|
|
26924
27111
|
};
|
|
26925
27112
|
var transitionalDefaults = {
|
|
@@ -27055,6 +27242,7 @@ var require_axios = __commonJS({
|
|
|
27055
27242
|
}
|
|
27056
27243
|
return null;
|
|
27057
27244
|
}
|
|
27245
|
+
var methodList = Object.freeze(["get", "delete", "head", "options", "post", "put", "patch", "purge", "link", "unlink", "query"]);
|
|
27058
27246
|
var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
27059
27247
|
function stringifySafely(rawValue, parser, encoder) {
|
|
27060
27248
|
if (utils$1.isString(rawValue)) {
|
|
@@ -27160,7 +27348,7 @@ var require_axios = __commonJS({
|
|
|
27160
27348
|
}
|
|
27161
27349
|
}
|
|
27162
27350
|
};
|
|
27163
|
-
utils$1.forEach(
|
|
27351
|
+
utils$1.forEach(methodList, (method) => {
|
|
27164
27352
|
defaults.headers[method] = {};
|
|
27165
27353
|
});
|
|
27166
27354
|
function transformData(fns, response) {
|
|
@@ -27217,18 +27405,18 @@ var require_axios = __commonJS({
|
|
|
27217
27405
|
}
|
|
27218
27406
|
return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
|
|
27219
27407
|
}
|
|
27220
|
-
var
|
|
27221
|
-
var httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
27222
|
-
function stripLeadingC0ControlOrSpace(url2) {
|
|
27223
|
-
let i = 0;
|
|
27224
|
-
while (i < url2.length && url2.charCodeAt(i) <= 32) {
|
|
27225
|
-
i++;
|
|
27226
|
-
}
|
|
27227
|
-
return url2.slice(i);
|
|
27228
|
-
}
|
|
27408
|
+
var urlParserControlCharacters = /[\t\n\r]/g;
|
|
27229
27409
|
function normalizeURLForProtocolCheck(url2) {
|
|
27230
|
-
|
|
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, "");
|
|
27231
27418
|
}
|
|
27419
|
+
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
27232
27420
|
function redactFragment(fragment) {
|
|
27233
27421
|
if (!fragment) {
|
|
27234
27422
|
return fragment;
|
|
@@ -27329,12 +27517,12 @@ var require_axios = __commonJS({
|
|
|
27329
27517
|
function getEnv(key) {
|
|
27330
27518
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
27331
27519
|
}
|
|
27332
|
-
var VERSION2 = "1.
|
|
27520
|
+
var VERSION2 = "1.20.0";
|
|
27333
27521
|
function parseProtocol(url2) {
|
|
27334
27522
|
const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
|
|
27335
27523
|
return match2 && match2[1] || "";
|
|
27336
27524
|
}
|
|
27337
|
-
var DATA_URL_PATTERN = /^([
|
|
27525
|
+
var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
|
|
27338
27526
|
function fromDataURI(uri, asBlob, options) {
|
|
27339
27527
|
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
27340
27528
|
const protocol = parseProtocol(uri);
|
|
@@ -27611,7 +27799,7 @@ var require_axios = __commonJS({
|
|
|
27611
27799
|
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
27612
27800
|
}
|
|
27613
27801
|
getSession(authority, options) {
|
|
27614
|
-
options = Object.assign({
|
|
27802
|
+
options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
27615
27803
|
sessionTimeout: 1e3
|
|
27616
27804
|
}, options);
|
|
27617
27805
|
let authoritySessions = this.sessions[authority];
|
|
@@ -27676,6 +27864,7 @@ var require_axios = __commonJS({
|
|
|
27676
27864
|
};
|
|
27677
27865
|
}
|
|
27678
27866
|
session.once("close", removeSession);
|
|
27867
|
+
session.once("error", removeSession);
|
|
27679
27868
|
let entry = [session, options];
|
|
27680
27869
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
27681
27870
|
return session;
|
|
@@ -27694,6 +27883,13 @@ var require_axios = __commonJS({
|
|
|
27694
27883
|
} : fn;
|
|
27695
27884
|
};
|
|
27696
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
|
+
};
|
|
27697
27893
|
var isIPv4Loopback = (host) => {
|
|
27698
27894
|
const parts = host.split(".");
|
|
27699
27895
|
if (parts.length !== 4) return false;
|
|
@@ -27726,7 +27922,7 @@ var require_axios = __commonJS({
|
|
|
27726
27922
|
if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
|
|
27727
27923
|
h = h.slice(1, -1);
|
|
27728
27924
|
}
|
|
27729
|
-
h = h
|
|
27925
|
+
h = trimTrailingDots(h);
|
|
27730
27926
|
if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
|
|
27731
27927
|
const parts = h.split(".");
|
|
27732
27928
|
if (parts.some((p) => p === "")) return host;
|
|
@@ -27838,6 +28034,40 @@ var require_axios = __commonJS({
|
|
|
27838
28034
|
}
|
|
27839
28035
|
return host;
|
|
27840
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
|
+
};
|
|
27841
28071
|
var normalizeNoProxyHost = (hostname) => {
|
|
27842
28072
|
if (!hostname) {
|
|
27843
28073
|
return hostname;
|
|
@@ -27845,13 +28075,99 @@ var require_axios = __commonJS({
|
|
|
27845
28075
|
if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
|
|
27846
28076
|
hostname = hostname.slice(1, -1);
|
|
27847
28077
|
}
|
|
27848
|
-
const trimmed = hostname
|
|
28078
|
+
const trimmed = trimTrailingDots(hostname);
|
|
27849
28079
|
const ipv4 = normalizeIPAddress(trimmed);
|
|
27850
28080
|
if (ipv4 !== trimmed) {
|
|
27851
28081
|
return ipv4;
|
|
27852
28082
|
}
|
|
27853
28083
|
return unmapIPv4MappedIPv6(trimmed);
|
|
27854
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
|
+
};
|
|
27855
28171
|
function shouldBypassProxy(location) {
|
|
27856
28172
|
let parsed;
|
|
27857
28173
|
try {
|
|
@@ -27868,6 +28184,7 @@ var require_axios = __commonJS({
|
|
|
27868
28184
|
}
|
|
27869
28185
|
const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0;
|
|
27870
28186
|
const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
|
|
28187
|
+
const hostnameBytes = ipToBytes(hostname);
|
|
27871
28188
|
return noProxy.split(/[\s,]+/).some((entry) => {
|
|
27872
28189
|
if (!entry) {
|
|
27873
28190
|
return false;
|
|
@@ -27875,6 +28192,10 @@ var require_axios = __commonJS({
|
|
|
27875
28192
|
if (entry === "*") {
|
|
27876
28193
|
return true;
|
|
27877
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
|
+
}
|
|
27878
28199
|
let [entryHost, entryPort] = parseNoProxyEntry(entry);
|
|
27879
28200
|
entryHost = normalizeNoProxyHost(entryHost);
|
|
27880
28201
|
if (!entryHost) {
|
|
@@ -27955,13 +28276,14 @@ var require_axios = __commonJS({
|
|
|
27955
28276
|
}
|
|
27956
28277
|
};
|
|
27957
28278
|
const flush = () => lastArgs && invoke(lastArgs);
|
|
27958
|
-
|
|
28279
|
+
const flushWith = (...args) => invoke(args);
|
|
28280
|
+
return [throttled, flush, flushWith];
|
|
27959
28281
|
}
|
|
27960
28282
|
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
27961
28283
|
let bytesNotified = 0;
|
|
27962
28284
|
const _speedometer = speedometer(50, 250);
|
|
27963
28285
|
return throttle((e) => {
|
|
27964
|
-
if (!e ||
|
|
28286
|
+
if (!e || !utils$1.isNumber(e.loaded)) {
|
|
27965
28287
|
return;
|
|
27966
28288
|
}
|
|
27967
28289
|
const rawLoaded = e.loaded;
|
|
@@ -28115,6 +28437,12 @@ var require_axios = __commonJS({
|
|
|
28115
28437
|
var isHttps = /https:?/;
|
|
28116
28438
|
var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
|
|
28117
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
|
+
}
|
|
28118
28446
|
var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
|
|
28119
28447
|
var tunnelingAgentCache = /* @__PURE__ */ new Map();
|
|
28120
28448
|
var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
|
|
@@ -28223,10 +28551,10 @@ var require_axios = __commonJS({
|
|
|
28223
28551
|
return false;
|
|
28224
28552
|
}
|
|
28225
28553
|
}
|
|
28226
|
-
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
|
|
28554
|
+
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent, allowEnvProxy = true) {
|
|
28227
28555
|
let proxy = configProxy;
|
|
28228
28556
|
const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
|
|
28229
|
-
if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
28557
|
+
if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
28230
28558
|
const proxyUrl = getProxyForUrl(location);
|
|
28231
28559
|
if (proxyUrl) {
|
|
28232
28560
|
if (!shouldBypassProxy(location)) {
|
|
@@ -28317,8 +28645,9 @@ var require_axios = __commonJS({
|
|
|
28317
28645
|
}
|
|
28318
28646
|
}
|
|
28319
28647
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
28320
|
-
setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
|
|
28648
|
+
setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent, allowEnvProxy);
|
|
28321
28649
|
};
|
|
28650
|
+
return Boolean(proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent));
|
|
28322
28651
|
}
|
|
28323
28652
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
|
|
28324
28653
|
var wrapAsync = (asyncExecutor) => {
|
|
@@ -28346,7 +28675,7 @@ var require_axios = __commonJS({
|
|
|
28346
28675
|
family
|
|
28347
28676
|
}) => {
|
|
28348
28677
|
if (!utils$1.isString(address)) {
|
|
28349
|
-
throw
|
|
28678
|
+
throw new AxiosError("address must be a string", AxiosError.ERR_BAD_OPTION_VALUE);
|
|
28350
28679
|
}
|
|
28351
28680
|
return {
|
|
28352
28681
|
address,
|
|
@@ -28357,6 +28686,30 @@ var require_axios = __commonJS({
|
|
|
28357
28686
|
address,
|
|
28358
28687
|
family
|
|
28359
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
|
+
};
|
|
28360
28713
|
var http2Transport = {
|
|
28361
28714
|
request(options, cb) {
|
|
28362
28715
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
@@ -28401,6 +28754,7 @@ var require_axios = __commonJS({
|
|
|
28401
28754
|
let family = own2("family");
|
|
28402
28755
|
let httpVersion = own2("httpVersion");
|
|
28403
28756
|
if (httpVersion === void 0) httpVersion = 1;
|
|
28757
|
+
const rawHttpVersion = httpVersion;
|
|
28404
28758
|
let http2Options = own2("http2Options");
|
|
28405
28759
|
const httpAgent = own2("httpAgent");
|
|
28406
28760
|
const httpsAgent = own2("httpsAgent");
|
|
@@ -28417,25 +28771,20 @@ var require_axios = __commonJS({
|
|
|
28417
28771
|
let rejected = false;
|
|
28418
28772
|
let req;
|
|
28419
28773
|
let connectPhaseTimer;
|
|
28420
|
-
|
|
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
|
+
}
|
|
28421
28779
|
if (Number.isNaN(httpVersion)) {
|
|
28422
|
-
throw
|
|
28780
|
+
throw new AxiosError(`Invalid protocol version: '${rawHttpVersion}' is not a number`, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
28423
28781
|
}
|
|
28424
28782
|
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
28425
|
-
throw
|
|
28783
|
+
throw new AxiosError(`Unsupported protocol version '${httpVersion}'`, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
28426
28784
|
}
|
|
28427
28785
|
const isHttp2 = httpVersion === 2;
|
|
28428
28786
|
if (lookup) {
|
|
28429
|
-
|
|
28430
|
-
lookup = (hostname, opt, cb) => {
|
|
28431
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
28432
|
-
if (err) {
|
|
28433
|
-
return cb(err);
|
|
28434
|
-
}
|
|
28435
|
-
const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
28436
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
28437
|
-
});
|
|
28438
|
-
};
|
|
28787
|
+
lookup = normalizeLookup(lookup);
|
|
28439
28788
|
}
|
|
28440
28789
|
const abortEmitter = new events.EventEmitter();
|
|
28441
28790
|
function abort(reason) {
|
|
@@ -28628,6 +28977,11 @@ var require_axios = __commonJS({
|
|
|
28628
28977
|
}));
|
|
28629
28978
|
}
|
|
28630
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
|
+
}
|
|
28631
28985
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
28632
28986
|
path: path$1,
|
|
28633
28987
|
method,
|
|
@@ -28641,9 +28995,11 @@ var require_axios = __commonJS({
|
|
|
28641
28995
|
family,
|
|
28642
28996
|
beforeRedirect: dispatchBeforeRedirect,
|
|
28643
28997
|
beforeRedirects: /* @__PURE__ */ Object.create(null),
|
|
28644
|
-
http2Options
|
|
28998
|
+
http2Options,
|
|
28999
|
+
createConnection: void 0
|
|
28645
29000
|
});
|
|
28646
29001
|
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
29002
|
+
let proxyApplied = false;
|
|
28647
29003
|
if (socketPath) {
|
|
28648
29004
|
if (typeof socketPath !== "string") {
|
|
28649
29005
|
return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config));
|
|
@@ -28661,7 +29017,18 @@ var require_axios = __commonJS({
|
|
|
28661
29017
|
} else {
|
|
28662
29018
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
28663
29019
|
options.port = parsed.port;
|
|
28664
|
-
|
|
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
|
+
);
|
|
28665
29032
|
}
|
|
28666
29033
|
let transport;
|
|
28667
29034
|
let isNativeTransport = false;
|
|
@@ -28671,6 +29038,9 @@ var require_axios = __commonJS({
|
|
|
28671
29038
|
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
28672
29039
|
}
|
|
28673
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
|
+
}
|
|
28674
29044
|
transport = http2Transport;
|
|
28675
29045
|
} else {
|
|
28676
29046
|
const configTransport = own2("transport");
|
|
@@ -28868,12 +29238,7 @@ var require_axios = __commonJS({
|
|
|
28868
29238
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
28869
29239
|
}
|
|
28870
29240
|
if (!socket[kAxiosSocketListener]) {
|
|
28871
|
-
socket.on("error",
|
|
28872
|
-
const current = socket[kAxiosCurrentReq];
|
|
28873
|
-
if (current && !current.destroyed) {
|
|
28874
|
-
current.destroy(err);
|
|
28875
|
-
}
|
|
28876
|
-
});
|
|
29241
|
+
socket.on("error", handleSocketError);
|
|
28877
29242
|
socket[kAxiosSocketListener] = true;
|
|
28878
29243
|
}
|
|
28879
29244
|
socket[kAxiosCurrentReq] = req;
|
|
@@ -29089,7 +29454,7 @@ var require_axios = __commonJS({
|
|
|
29089
29454
|
transformResponse: defaultToConfig2,
|
|
29090
29455
|
paramsSerializer: defaultToConfig2,
|
|
29091
29456
|
timeout: defaultToConfig2,
|
|
29092
|
-
|
|
29457
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
29093
29458
|
withCredentials: defaultToConfig2,
|
|
29094
29459
|
withXSRFToken: defaultToConfig2,
|
|
29095
29460
|
adapter: defaultToConfig2,
|
|
@@ -29157,10 +29522,11 @@ var require_axios = __commonJS({
|
|
|
29157
29522
|
}
|
|
29158
29523
|
}
|
|
29159
29524
|
if (utils$1.isFormData(data)) {
|
|
29525
|
+
const getHeaders = utils$1.getSafeProp(data, "getHeaders");
|
|
29160
29526
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
29161
29527
|
headers.setContentType(void 0);
|
|
29162
|
-
} else if (utils$1.isFunction(
|
|
29163
|
-
setFormDataHeaders(headers,
|
|
29528
|
+
} else if (utils$1.isFunction(getHeaders)) {
|
|
29529
|
+
setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy"));
|
|
29164
29530
|
}
|
|
29165
29531
|
}
|
|
29166
29532
|
if (platform.hasStandardBrowserEnv) {
|
|
@@ -29190,7 +29556,7 @@ var require_axios = __commonJS({
|
|
|
29190
29556
|
} = _config;
|
|
29191
29557
|
let onCanceled;
|
|
29192
29558
|
let uploadThrottled, downloadThrottled;
|
|
29193
|
-
let flushUpload, flushDownload;
|
|
29559
|
+
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
29194
29560
|
function done() {
|
|
29195
29561
|
flushUpload && flushUpload();
|
|
29196
29562
|
flushDownload && flushDownload();
|
|
@@ -29200,7 +29566,27 @@ var require_axios = __commonJS({
|
|
|
29200
29566
|
let request = new XMLHttpRequest();
|
|
29201
29567
|
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
29202
29568
|
request.timeout = _config.timeout;
|
|
29203
|
-
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
|
+
}
|
|
29204
29590
|
if (!request) {
|
|
29205
29591
|
return;
|
|
29206
29592
|
}
|
|
@@ -29275,7 +29661,7 @@ var require_axios = __commonJS({
|
|
|
29275
29661
|
request.responseType = _config.responseType;
|
|
29276
29662
|
}
|
|
29277
29663
|
if (onDownloadProgress) {
|
|
29278
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
29664
|
+
[downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(onDownloadProgress, true);
|
|
29279
29665
|
request.addEventListener("progress", downloadThrottled);
|
|
29280
29666
|
}
|
|
29281
29667
|
if (onUploadProgress && request.upload) {
|
|
@@ -29437,6 +29823,17 @@ var require_axios = __commonJS({
|
|
|
29437
29823
|
});
|
|
29438
29824
|
};
|
|
29439
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
|
+
};
|
|
29440
29837
|
var {
|
|
29441
29838
|
isFunction
|
|
29442
29839
|
} = utils$1;
|
|
@@ -29565,7 +29962,8 @@ var require_axios = __commonJS({
|
|
|
29565
29962
|
withCredentials = "same-origin",
|
|
29566
29963
|
fetchOptions,
|
|
29567
29964
|
maxContentLength,
|
|
29568
|
-
maxBodyLength
|
|
29965
|
+
maxBodyLength,
|
|
29966
|
+
maxRedirects
|
|
29569
29967
|
} = resolveConfig(config);
|
|
29570
29968
|
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
29571
29969
|
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
@@ -29666,17 +30064,44 @@ var require_axios = __commonJS({
|
|
|
29666
30064
|
}
|
|
29667
30065
|
}
|
|
29668
30066
|
headers.set("User-Agent", "axios/" + VERSION2, false);
|
|
29669
|
-
const
|
|
29670
|
-
|
|
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, {
|
|
29671
30077
|
signal: composedSignal,
|
|
29672
30078
|
method: method.toUpperCase(),
|
|
29673
30079
|
headers: toByteStringHeaderObject(headers.normalize()),
|
|
29674
30080
|
body: data,
|
|
29675
30081
|
duplex: "half",
|
|
29676
30082
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
29677
|
-
};
|
|
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
|
+
}
|
|
29678
30103
|
request = isRequestSupported && new Request(url2, resolvedOptions);
|
|
29679
|
-
let response = await (isRequestSupported ? _fetch(request,
|
|
30104
|
+
let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url2, resolvedOptions));
|
|
29680
30105
|
const responseHeaders = AxiosHeaders.from(response.headers);
|
|
29681
30106
|
if (hasMaxContentLength) {
|
|
29682
30107
|
const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
@@ -29868,9 +30293,10 @@ var require_axios = __commonJS({
|
|
|
29868
30293
|
throw new CanceledError(null, config);
|
|
29869
30294
|
}
|
|
29870
30295
|
}
|
|
29871
|
-
function dispatchRequest(
|
|
30296
|
+
function dispatchRequest(_config) {
|
|
30297
|
+
const config = utils$1.toSafeFlatObject(_config);
|
|
29872
30298
|
throwIfCancellationRequested(config);
|
|
29873
|
-
config.headers = AxiosHeaders.from(config
|
|
30299
|
+
config.headers = AxiosHeaders.from(utils$1.getSafeProp(config, "headers"));
|
|
29874
30300
|
config.data = transformData.call(config, config.transformRequest);
|
|
29875
30301
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
29876
30302
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
@@ -29978,16 +30404,15 @@ var require_axios = __commonJS({
|
|
|
29978
30404
|
return await this._request(configOrUrl, config);
|
|
29979
30405
|
} catch (err) {
|
|
29980
30406
|
if (err instanceof Error) {
|
|
29981
|
-
let dummy = {};
|
|
29982
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
29983
|
-
const stack = (() => {
|
|
29984
|
-
if (!dummy.stack) {
|
|
29985
|
-
return "";
|
|
29986
|
-
}
|
|
29987
|
-
const firstNewlineIndex = dummy.stack.indexOf("\n");
|
|
29988
|
-
return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
|
|
29989
|
-
})();
|
|
29990
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
|
+
}
|
|
29991
30416
|
if (!err.stack) {
|
|
29992
30417
|
err.stack = stack;
|
|
29993
30418
|
} else if (stack) {
|
|
@@ -30049,9 +30474,9 @@ var require_axios = __commonJS({
|
|
|
30049
30474
|
baseUrl: validators.spelling("baseURL"),
|
|
30050
30475
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
30051
30476
|
}, true);
|
|
30052
|
-
config.method = (config
|
|
30477
|
+
config.method = (utils$1.getSafeProp(config, "method") || utils$1.getSafeProp(this.defaults, "method") || "get").toLowerCase();
|
|
30053
30478
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
30054
|
-
headers && utils$1.forEach(
|
|
30479
|
+
headers && utils$1.forEach(methodList.concat("common"), (method) => {
|
|
30055
30480
|
delete headers[method];
|
|
30056
30481
|
});
|
|
30057
30482
|
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
@@ -30298,14 +30723,22 @@ var require_axios = __commonJS({
|
|
|
30298
30723
|
Gone: 410,
|
|
30299
30724
|
LengthRequired: 411,
|
|
30300
30725
|
PreconditionFailed: 412,
|
|
30726
|
+
/**
|
|
30727
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
30728
|
+
*/
|
|
30301
30729
|
PayloadTooLarge: 413,
|
|
30730
|
+
ContentTooLarge: 413,
|
|
30302
30731
|
UriTooLong: 414,
|
|
30303
30732
|
UnsupportedMediaType: 415,
|
|
30304
30733
|
RangeNotSatisfiable: 416,
|
|
30305
30734
|
ExpectationFailed: 417,
|
|
30306
30735
|
ImATeapot: 418,
|
|
30307
30736
|
MisdirectedRequest: 421,
|
|
30737
|
+
/**
|
|
30738
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
30739
|
+
*/
|
|
30308
30740
|
UnprocessableEntity: 422,
|
|
30741
|
+
UnprocessableContent: 422,
|
|
30309
30742
|
Locked: 423,
|
|
30310
30743
|
FailedDependency: 424,
|
|
30311
30744
|
TooEarly: 425,
|
|
@@ -30334,7 +30767,9 @@ var require_axios = __commonJS({
|
|
|
30334
30767
|
InvalidSslCertificate: 526
|
|
30335
30768
|
};
|
|
30336
30769
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
30337
|
-
HttpStatusCode[value]
|
|
30770
|
+
if (HttpStatusCode[value] === void 0) {
|
|
30771
|
+
HttpStatusCode[value] = key;
|
|
30772
|
+
}
|
|
30338
30773
|
});
|
|
30339
30774
|
function createInstance(defaultConfig) {
|
|
30340
30775
|
const context = new Axios(defaultConfig);
|
|
@@ -31796,7 +32231,7 @@ var VERSION;
|
|
|
31796
32231
|
var init_version = __esm({
|
|
31797
32232
|
"src/version.ts"() {
|
|
31798
32233
|
"use strict";
|
|
31799
|
-
VERSION = true ? "
|
|
32234
|
+
VERSION = true ? "5.0.0" : "0.0.0-test";
|
|
31800
32235
|
}
|
|
31801
32236
|
});
|
|
31802
32237
|
|
|
@@ -32225,6 +32660,7 @@ var init_base_language_model_strategy = __esm({
|
|
|
32225
32660
|
outputKey: "presence_penalty"
|
|
32226
32661
|
},
|
|
32227
32662
|
{ camelCaseKey: "seed", optionKey: "seed", outputKey: "seed" },
|
|
32663
|
+
{ optionKey: "reasoning", outputKey: "reasoning_effort" },
|
|
32228
32664
|
{ camelCaseKey: "parallel_tool_calls", outputKey: "parallel_tool_calls" }
|
|
32229
32665
|
];
|
|
32230
32666
|
async doGenerate(config, settings, options) {
|
|
@@ -32592,13 +33028,13 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32592
33028
|
super();
|
|
32593
33029
|
this.ClientClass = ClientClass;
|
|
32594
33030
|
}
|
|
32595
|
-
buildRequest(
|
|
33031
|
+
buildRequest(_config, settings, options, commonParts) {
|
|
32596
33032
|
const warnings = [];
|
|
32597
33033
|
const { configRef } = commonParts.resolvedState;
|
|
32598
33034
|
if (configRef) {
|
|
32599
|
-
return this.buildConfigRefRequest(settings, options, commonParts,
|
|
33035
|
+
return this.buildConfigRefRequest(settings, options, commonParts, warnings);
|
|
32600
33036
|
}
|
|
32601
|
-
return this.buildStandardRequest(
|
|
33037
|
+
return this.buildStandardRequest(settings, commonParts, warnings);
|
|
32602
33038
|
}
|
|
32603
33039
|
/**
|
|
32604
33040
|
* Collects stream-specific warnings for orchestration.
|
|
@@ -32624,20 +33060,17 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32624
33060
|
return warnings;
|
|
32625
33061
|
}
|
|
32626
33062
|
createClient(config, settings, commonParts) {
|
|
32627
|
-
const { configRef, promptTemplateRef, tools } = commonParts.resolvedState;
|
|
33063
|
+
const { configRef, promptTemplateRef, responseFormat, tools } = commonParts.resolvedState;
|
|
32628
33064
|
if (configRef) {
|
|
32629
33065
|
return new this.ClientClass(configRef, config.deploymentConfig, config.destination);
|
|
32630
33066
|
}
|
|
32631
|
-
const
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
prompt: promptConfig
|
|
32639
|
-
}
|
|
32640
|
-
};
|
|
33067
|
+
const clientConfig = this.buildOrchestrationModuleConfig(config, settings, {
|
|
33068
|
+
modelParams: commonParts.modelParams,
|
|
33069
|
+
promptTemplateRef,
|
|
33070
|
+
responseFormat,
|
|
33071
|
+
toolChoice: commonParts.toolChoice,
|
|
33072
|
+
tools
|
|
33073
|
+
});
|
|
32641
33074
|
if (settings.fallbackModuleConfigs && settings.fallbackModuleConfigs.length > 0) {
|
|
32642
33075
|
const configList = [
|
|
32643
33076
|
clientConfig,
|
|
@@ -32715,13 +33148,17 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32715
33148
|
* @internal
|
|
32716
33149
|
*/
|
|
32717
33150
|
resolveAdditionalState(_config, settings, sapOptions, options, warnings) {
|
|
32718
|
-
const configRef = this.resolveConfigRef(sapOptions, settings);
|
|
33151
|
+
const configRef = this.resolveConfigRef(sapOptions, settings, warnings);
|
|
32719
33152
|
const promptTemplateRef = this.resolvePromptTemplateRef(sapOptions, settings);
|
|
33153
|
+
let responseFormat;
|
|
32720
33154
|
if (configRef === void 0) {
|
|
32721
33155
|
validateMaskingProvidersDeprecation(settings, warnings);
|
|
33156
|
+
const converted = convertResponseFormat(options.responseFormat, settings.responseFormat);
|
|
33157
|
+
responseFormat = converted.responseFormat;
|
|
33158
|
+
if (converted.warning) warnings.push(converted.warning);
|
|
32722
33159
|
}
|
|
32723
33160
|
const tools = this.resolveTools(settings, options, warnings);
|
|
32724
|
-
return { configRef, promptTemplateRef, tools };
|
|
33161
|
+
return { configRef, promptTemplateRef, responseFormat, tools };
|
|
32725
33162
|
}
|
|
32726
33163
|
/**
|
|
32727
33164
|
* Builds request for orchestrationConfigRef mode.
|
|
@@ -32731,12 +33168,11 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32731
33168
|
* @param settings - Model settings.
|
|
32732
33169
|
* @param options - Call options.
|
|
32733
33170
|
* @param commonParts - Common build result.
|
|
32734
|
-
* @param _configRef - The config reference (unused, passed for signature consistency).
|
|
32735
33171
|
* @param warnings - Warnings array to populate.
|
|
32736
33172
|
* @returns Request body and warnings.
|
|
32737
33173
|
* @internal
|
|
32738
33174
|
*/
|
|
32739
|
-
buildConfigRefRequest(settings, options, commonParts,
|
|
33175
|
+
buildConfigRefRequest(settings, options, commonParts, warnings) {
|
|
32740
33176
|
warnings.push(
|
|
32741
33177
|
...this.collectConfigRefIgnoredWarnings(settings, options, commonParts.sapOptions)
|
|
32742
33178
|
);
|
|
@@ -32794,33 +33230,6 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32794
33230
|
);
|
|
32795
33231
|
return moduleConfig;
|
|
32796
33232
|
}
|
|
32797
|
-
/**
|
|
32798
|
-
* Builds the final request body for the orchestration API.
|
|
32799
|
-
* @param messages - Chat messages.
|
|
32800
|
-
* @param orchestrationConfig - Module configuration.
|
|
32801
|
-
* @param placeholderValues - Optional placeholder values.
|
|
32802
|
-
* @param hasTemplateRef - Whether template_ref mode is active.
|
|
32803
|
-
* @returns Request body.
|
|
32804
|
-
* @internal
|
|
32805
|
-
*/
|
|
32806
|
-
buildRequestBody(messages, orchestrationConfig, placeholderValues, hasTemplateRef) {
|
|
32807
|
-
const promptTemplating = orchestrationConfig.promptTemplating;
|
|
32808
|
-
const messagesField = hasTemplateRef ? { messagesHistory: messages } : { messages };
|
|
32809
|
-
const requestBody = {
|
|
32810
|
-
...messagesField,
|
|
32811
|
-
model: {
|
|
32812
|
-
...orchestrationConfig.promptTemplating.model
|
|
32813
|
-
},
|
|
32814
|
-
...placeholderValues ? { placeholderValues } : {},
|
|
32815
|
-
...promptTemplating.prompt.tools ? { tools: promptTemplating.prompt.tools } : {},
|
|
32816
|
-
...promptTemplating.prompt.response_format ? { response_format: promptTemplating.prompt.response_format } : {}
|
|
32817
|
-
};
|
|
32818
|
-
copyOrchestrationModules(
|
|
32819
|
-
requestBody,
|
|
32820
|
-
orchestrationConfig
|
|
32821
|
-
);
|
|
32822
|
-
return requestBody;
|
|
32823
|
-
}
|
|
32824
33233
|
/**
|
|
32825
33234
|
* Builds SAP SDK stream options from user-facing stream options.
|
|
32826
33235
|
* @param streamOptions - User-provided stream options.
|
|
@@ -32848,38 +33257,19 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32848
33257
|
}
|
|
32849
33258
|
/**
|
|
32850
33259
|
* Builds request for standard (non-configRef) mode.
|
|
32851
|
-
* @param config - Strategy configuration.
|
|
32852
33260
|
* @param settings - Model settings.
|
|
32853
|
-
* @param options - Call options.
|
|
32854
33261
|
* @param commonParts - Common build result.
|
|
32855
33262
|
* @param warnings - Warnings array to populate.
|
|
32856
33263
|
* @returns Request body and warnings.
|
|
32857
33264
|
* @internal
|
|
32858
33265
|
*/
|
|
32859
|
-
buildStandardRequest(
|
|
32860
|
-
const { promptTemplateRef
|
|
32861
|
-
const { responseFormat, warning: responseFormatWarning } = convertResponseFormat(
|
|
32862
|
-
options.responseFormat,
|
|
32863
|
-
settings.responseFormat
|
|
32864
|
-
);
|
|
32865
|
-
if (responseFormatWarning) {
|
|
32866
|
-
warnings.push(responseFormatWarning);
|
|
32867
|
-
}
|
|
32868
|
-
const { toolChoice } = commonParts;
|
|
32869
|
-
const orchestrationConfig = this.buildOrchestrationModuleConfig(config, settings, {
|
|
32870
|
-
modelParams: commonParts.modelParams,
|
|
32871
|
-
promptTemplateRef,
|
|
32872
|
-
responseFormat,
|
|
32873
|
-
toolChoice,
|
|
32874
|
-
tools
|
|
32875
|
-
});
|
|
33266
|
+
buildStandardRequest(settings, commonParts, warnings) {
|
|
33267
|
+
const { promptTemplateRef } = commonParts.resolvedState;
|
|
32876
33268
|
const placeholderValues = resolvePlaceholderValues(settings, commonParts.sapOptions);
|
|
32877
|
-
const request =
|
|
32878
|
-
commonParts.messages,
|
|
32879
|
-
|
|
32880
|
-
|
|
32881
|
-
Boolean(promptTemplateRef)
|
|
32882
|
-
);
|
|
33269
|
+
const request = {
|
|
33270
|
+
...promptTemplateRef ? { messagesHistory: commonParts.messages } : { messages: commonParts.messages },
|
|
33271
|
+
...placeholderValues ? { placeholderValues } : {}
|
|
33272
|
+
};
|
|
32883
33273
|
return { request, warnings };
|
|
32884
33274
|
}
|
|
32885
33275
|
/**
|
|
@@ -32922,6 +33312,15 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32922
33312
|
ignoredSettings.push(`providerOptions.${key}`);
|
|
32923
33313
|
}
|
|
32924
33314
|
}
|
|
33315
|
+
const optionValues = options;
|
|
33316
|
+
for (const { optionKey } of this.getParamMappings()) {
|
|
33317
|
+
if (optionKey && optionValues[optionKey] !== void 0) {
|
|
33318
|
+
ignoredSettings.push(`options.${optionKey}`);
|
|
33319
|
+
}
|
|
33320
|
+
}
|
|
33321
|
+
if (options.stopSequences && options.stopSequences.length > 0) {
|
|
33322
|
+
ignoredSettings.push("options.stopSequences");
|
|
33323
|
+
}
|
|
32925
33324
|
if (options.tools && options.tools.length > 0) {
|
|
32926
33325
|
ignoredSettings.push("options.tools");
|
|
32927
33326
|
}
|
|
@@ -32941,17 +33340,26 @@ var init_orchestration_language_model_strategy = __esm({
|
|
|
32941
33340
|
}
|
|
32942
33341
|
/**
|
|
32943
33342
|
* Resolves the orchestrationConfigRef from provider options or settings.
|
|
32944
|
-
* Provider options take priority over settings.
|
|
33343
|
+
* Provider options take priority over settings. A present-but-invalid reference is
|
|
33344
|
+
* ignored with a warning instead of failing the request.
|
|
32945
33345
|
* @param sapOptions - Parsed provider options from commonParts.
|
|
32946
33346
|
* @param settings - The model settings.
|
|
33347
|
+
* @param warnings - Shared warnings sink for degradation signals.
|
|
32947
33348
|
* @returns The resolved config reference or undefined.
|
|
32948
33349
|
* @internal
|
|
32949
33350
|
*/
|
|
32950
|
-
resolveConfigRef(sapOptions, settings) {
|
|
33351
|
+
resolveConfigRef(sapOptions, settings, warnings) {
|
|
32951
33352
|
const configRefCandidate = sapOptions?.orchestrationConfigRef ?? settings.orchestrationConfigRef;
|
|
32952
|
-
if (configRefCandidate
|
|
33353
|
+
if (!configRefCandidate) {
|
|
33354
|
+
return void 0;
|
|
33355
|
+
}
|
|
33356
|
+
if (isOrchestrationConfigRef(configRefCandidate)) {
|
|
32953
33357
|
return configRefCandidate;
|
|
32954
33358
|
}
|
|
33359
|
+
warnings.push({
|
|
33360
|
+
message: "orchestrationConfigRef is invalid and was ignored; falling back to local module settings.",
|
|
33361
|
+
type: "other"
|
|
33362
|
+
});
|
|
32955
33363
|
return void 0;
|
|
32956
33364
|
}
|
|
32957
33365
|
/**
|
|
@@ -33181,12 +33589,13 @@ function convertStreamPartToV2(internalPart) {
|
|
|
33181
33589
|
case "tool-result":
|
|
33182
33590
|
return withProviderMetadata(
|
|
33183
33591
|
{
|
|
33592
|
+
// V3 tool results are provider-executed, independent of dynamic tool classification.
|
|
33593
|
+
providerExecuted: true,
|
|
33184
33594
|
result: internalPart.result,
|
|
33185
33595
|
toolCallId: internalPart.toolCallId,
|
|
33186
33596
|
toolName: internalPart.toolName,
|
|
33187
33597
|
type: "tool-result",
|
|
33188
|
-
...internalPart.isError !== void 0 && { isError: internalPart.isError }
|
|
33189
|
-
...internalPart.dynamic !== void 0 && { providerExecuted: internalPart.dynamic }
|
|
33598
|
+
...internalPart.isError !== void 0 && { isError: internalPart.isError }
|
|
33190
33599
|
},
|
|
33191
33600
|
internalPart.providerMetadata
|
|
33192
33601
|
);
|
|
@@ -33380,9 +33789,7 @@ var SAPAIEmbeddingModelV2 = class {
|
|
|
33380
33789
|
if (result.warnings && result.warnings.length > 0) {
|
|
33381
33790
|
const warnings = convertWarningsToV2(result.warnings);
|
|
33382
33791
|
for (const warning of warnings) {
|
|
33383
|
-
|
|
33384
|
-
console.warn(`[SAP AI Embedding] ${warning.message}`);
|
|
33385
|
-
}
|
|
33792
|
+
console.warn(`[SAP AI Embedding] ${warning.message}`);
|
|
33386
33793
|
}
|
|
33387
33794
|
}
|
|
33388
33795
|
return {
|
|
@@ -33559,7 +33966,7 @@ function createSAPAIProvider(options = {}) {
|
|
|
33559
33966
|
"createSAPAIProvider: both 'deploymentId' and 'resourceGroup' were provided; using 'deploymentId' and ignoring 'resourceGroup'."
|
|
33560
33967
|
);
|
|
33561
33968
|
}
|
|
33562
|
-
if (!process.env.SAP_CLOUD_SDK_LOG_LEVEL) {
|
|
33969
|
+
if (typeof process === "undefined" || !process.env.SAP_CLOUD_SDK_LOG_LEVEL) {
|
|
33563
33970
|
const logLevel = options.logLevel ?? "warn";
|
|
33564
33971
|
(0, import_util2.setGlobalLogLevel)(logLevel);
|
|
33565
33972
|
}
|
|
@@ -33688,6 +34095,6 @@ mime-types/index.js:
|
|
|
33688
34095
|
*)
|
|
33689
34096
|
|
|
33690
34097
|
axios/dist/node/axios.cjs:
|
|
33691
|
-
(*! Axios v1.
|
|
34098
|
+
(*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
33692
34099
|
*/
|
|
33693
|
-
//# sourceMappingURL=index
|
|
34100
|
+
//# sourceMappingURL=index.cjs.map
|