@cccsaurora/clue-ui 1.2.0-dev.194 → 1.2.0-dev.236
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/{ActionForm-Hg3A_2XX.js → ActionForm-U5a2mLUv.js} +2 -1
- package/{AnnotationDetails-CbXSCkTF.js → AnnotationDetails-BEHFNNv3.js} +1 -1
- package/{AnnotationPreview-D5NX8_su.js → AnnotationPreview-MO5UsP5l.js} +1 -1
- package/{ClueEnrichContext-DzZhWGxh.js → ClueEnrichContext-DoOHQeVr.js} +1 -1
- package/components/AnnotationDetailPopover.js +1 -1
- package/components/AnnotationDetails.js +2 -2
- package/components/AnnotationEntry.js +2 -1
- package/components/AnnotationPreview.js +1 -1
- package/components/EnrichedCard.js +1 -1
- package/components/EnrichedChip.js +1 -1
- package/components/EnrichedTypography.js +1 -1
- package/components/actions/ActionForm.js +1 -1
- package/components/actions/ResultModal.js +1 -1
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/fetchers/Fetcher.js +41 -4
- package/components/group/GroupControl.js +1 -1
- package/hooks/ClueActionContext.js +2 -2
- package/hooks/ClueEnrichContext.js +2 -2
- package/hooks/ClueFetcherContext.d.ts +1 -0
- package/hooks/ClueFetcherContext.js +43 -24
- package/hooks/CluePopupContext.js +2 -2
- package/hooks/ClueProvider.js +3 -3
- package/hooks/selectors.js +2 -2
- package/hooks/useActionResult.js +1 -1
- package/hooks/useAnnotations.js +1 -1
- package/hooks/useClue.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/hooks/useClueTypeConfig.js +1 -1
- package/hooks/useFetcherResult.d.ts +14 -0
- package/hooks/useFetcherResult.js +40 -0
- package/icons/Action.js +2 -2
- package/icons/Assessment.js +1 -1
- package/icons/Context.js +1 -1
- package/icons/Opinion.js +1 -1
- package/main.js +4 -4
- package/package.json +1 -1
- package/types/fetcher.d.ts +19 -7
- package/{useClueTypeConfig-CHWm5uda.js → useClueTypeConfig-D2tf4-NM.js} +264 -183
|
@@ -11,7 +11,7 @@ import { useState, useEffect } from "react";
|
|
|
11
11
|
function uniq(array) {
|
|
12
12
|
return array && array.length ? baseUniq(array) : [];
|
|
13
13
|
}
|
|
14
|
-
const get$
|
|
14
|
+
const get$9 = (actionId, taskId, options = { timeout: null }, config) => {
|
|
15
15
|
const searchParams = [];
|
|
16
16
|
if (!isNil(options.timeout)) {
|
|
17
17
|
searchParams.push(`max_timeout=${options.timeout}`);
|
|
@@ -22,14 +22,14 @@ const get$8 = (actionId, taskId, options = { timeout: null }, config) => {
|
|
|
22
22
|
config
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
|
-
const status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
|
+
const status$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
26
|
__proto__: null,
|
|
27
|
-
get: get$
|
|
27
|
+
get: get$9
|
|
28
28
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
29
29
|
const uri$c = () => {
|
|
30
30
|
return joinUri(uri(), "actions");
|
|
31
31
|
};
|
|
32
|
-
const get$
|
|
32
|
+
const get$8 = (config) => {
|
|
33
33
|
return hget(uri$c(), null, config);
|
|
34
34
|
};
|
|
35
35
|
const post$3 = (actionId, selectors, params, context, options = { timeout: null }, config) => {
|
|
@@ -60,9 +60,9 @@ const post$3 = (actionId, selectors, params, context, options = { timeout: null
|
|
|
60
60
|
};
|
|
61
61
|
const actions = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
62
62
|
__proto__: null,
|
|
63
|
-
get: get$
|
|
63
|
+
get: get$8,
|
|
64
64
|
post: post$3,
|
|
65
|
-
status,
|
|
65
|
+
status: status$1,
|
|
66
66
|
uri: uri$c
|
|
67
67
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
68
68
|
const uri$b = (searchParams) => {
|
|
@@ -71,7 +71,7 @@ const uri$b = (searchParams) => {
|
|
|
71
71
|
const post$2 = (body) => {
|
|
72
72
|
return hpost(uri$b(), body);
|
|
73
73
|
};
|
|
74
|
-
const get$
|
|
74
|
+
const get$7 = (search) => {
|
|
75
75
|
const nonce = localStorage.getItem(`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.LOGIN_NONCE}`);
|
|
76
76
|
if (nonce) {
|
|
77
77
|
search.set("nonce", JSON.parse(nonce));
|
|
@@ -81,7 +81,7 @@ const get$6 = (search) => {
|
|
|
81
81
|
};
|
|
82
82
|
const login = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
83
83
|
__proto__: null,
|
|
84
|
-
get: get$
|
|
84
|
+
get: get$7,
|
|
85
85
|
post: post$2,
|
|
86
86
|
uri: uri$b
|
|
87
87
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -96,14 +96,29 @@ const auth = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
96
96
|
const uri$9 = () => {
|
|
97
97
|
return joinUri(uri(), "configs");
|
|
98
98
|
};
|
|
99
|
-
const get$
|
|
99
|
+
const get$6 = (config) => {
|
|
100
100
|
return hget(uri$9(), null, config);
|
|
101
101
|
};
|
|
102
102
|
const configs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
103
103
|
__proto__: null,
|
|
104
|
-
get: get$
|
|
104
|
+
get: get$6,
|
|
105
105
|
uri: uri$9
|
|
106
106
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
107
|
+
const get$5 = (fetcherId, taskId, options = { timeout: null }, config) => {
|
|
108
|
+
const searchParams = [];
|
|
109
|
+
if (!isNil(options.timeout)) {
|
|
110
|
+
searchParams.push(`max_timeout=${options.timeout}`);
|
|
111
|
+
}
|
|
112
|
+
return hget(
|
|
113
|
+
joinUri(uri$c(), `${fetcherId.replace(".", "/")}/status/${taskId}`),
|
|
114
|
+
searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null,
|
|
115
|
+
config
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
const status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
119
|
+
__proto__: null,
|
|
120
|
+
get: get$5
|
|
121
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
107
122
|
const uri$8 = () => {
|
|
108
123
|
return joinUri(uri(), "fetchers");
|
|
109
124
|
};
|
|
@@ -117,6 +132,7 @@ const fetchers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
117
132
|
__proto__: null,
|
|
118
133
|
get: get$4,
|
|
119
134
|
post: post$1,
|
|
135
|
+
status,
|
|
120
136
|
uri: uri$8
|
|
121
137
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
122
138
|
const uri$7 = () => {
|
|
@@ -278,7 +294,12 @@ const isFormData = (thing) => {
|
|
|
278
294
|
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
279
295
|
};
|
|
280
296
|
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
281
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
297
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
298
|
+
"ReadableStream",
|
|
299
|
+
"Request",
|
|
300
|
+
"Response",
|
|
301
|
+
"Headers"
|
|
302
|
+
].map(kindOfTest);
|
|
282
303
|
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
283
304
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
284
305
|
if (obj === null || typeof obj === "undefined") {
|
|
@@ -331,6 +352,9 @@ function merge() {
|
|
|
331
352
|
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
332
353
|
const result = {};
|
|
333
354
|
const assignValue = (val, key) => {
|
|
355
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
334
358
|
const targetKey = caseless && findKey(result, key) || key;
|
|
335
359
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
336
360
|
result[targetKey] = merge(result[targetKey], val);
|
|
@@ -338,10 +362,8 @@ function merge() {
|
|
|
338
362
|
result[targetKey] = merge({}, val);
|
|
339
363
|
} else if (isArray(val)) {
|
|
340
364
|
result[targetKey] = val.slice();
|
|
341
|
-
} else {
|
|
342
|
-
|
|
343
|
-
result[targetKey] = val;
|
|
344
|
-
}
|
|
365
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
366
|
+
result[targetKey] = val;
|
|
345
367
|
}
|
|
346
368
|
};
|
|
347
369
|
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
@@ -350,13 +372,27 @@ function merge() {
|
|
|
350
372
|
return result;
|
|
351
373
|
}
|
|
352
374
|
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
353
|
-
forEach(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
375
|
+
forEach(
|
|
376
|
+
b,
|
|
377
|
+
(val, key) => {
|
|
378
|
+
if (thisArg && isFunction$1(val)) {
|
|
379
|
+
Object.defineProperty(a, key, {
|
|
380
|
+
value: bind(val, thisArg),
|
|
381
|
+
writable: true,
|
|
382
|
+
enumerable: true,
|
|
383
|
+
configurable: true
|
|
384
|
+
});
|
|
385
|
+
} else {
|
|
386
|
+
Object.defineProperty(a, key, {
|
|
387
|
+
value: val,
|
|
388
|
+
writable: true,
|
|
389
|
+
enumerable: true,
|
|
390
|
+
configurable: true
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
{ allOwnKeys }
|
|
395
|
+
);
|
|
360
396
|
return a;
|
|
361
397
|
};
|
|
362
398
|
const stripBOM = (content) => {
|
|
@@ -365,9 +401,17 @@ const stripBOM = (content) => {
|
|
|
365
401
|
}
|
|
366
402
|
return content;
|
|
367
403
|
};
|
|
368
|
-
const inherits = (constructor, superConstructor, props,
|
|
369
|
-
constructor.prototype = Object.create(
|
|
370
|
-
|
|
404
|
+
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
405
|
+
constructor.prototype = Object.create(
|
|
406
|
+
superConstructor.prototype,
|
|
407
|
+
descriptors
|
|
408
|
+
);
|
|
409
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
410
|
+
value: constructor,
|
|
411
|
+
writable: true,
|
|
412
|
+
enumerable: false,
|
|
413
|
+
configurable: true
|
|
414
|
+
});
|
|
371
415
|
Object.defineProperty(constructor, "super", {
|
|
372
416
|
value: superConstructor.prototype
|
|
373
417
|
});
|
|
@@ -438,19 +482,16 @@ const matchAll = (regExp, str) => {
|
|
|
438
482
|
};
|
|
439
483
|
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
440
484
|
const toCamelCase = (str) => {
|
|
441
|
-
return str.toLowerCase().replace(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
return p1.toUpperCase() + p2;
|
|
445
|
-
}
|
|
446
|
-
);
|
|
485
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
486
|
+
return p1.toUpperCase() + p2;
|
|
487
|
+
});
|
|
447
488
|
};
|
|
448
489
|
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
449
490
|
const isRegExp = kindOfTest("RegExp");
|
|
450
491
|
const reduceDescriptors = (obj, reducer) => {
|
|
451
|
-
const
|
|
492
|
+
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
452
493
|
const reducedDescriptors = {};
|
|
453
|
-
forEach(
|
|
494
|
+
forEach(descriptors, (descriptor, name) => {
|
|
454
495
|
let ret;
|
|
455
496
|
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
456
497
|
reducedDescriptors[name] = ret || descriptor;
|
|
@@ -527,20 +568,21 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
527
568
|
return setImmediate;
|
|
528
569
|
}
|
|
529
570
|
return postMessageSupported ? ((token, callbacks) => {
|
|
530
|
-
_global.addEventListener(
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
571
|
+
_global.addEventListener(
|
|
572
|
+
"message",
|
|
573
|
+
({ source, data }) => {
|
|
574
|
+
if (source === _global && data === token) {
|
|
575
|
+
callbacks.length && callbacks.shift()();
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
false
|
|
579
|
+
);
|
|
535
580
|
return (cb) => {
|
|
536
581
|
callbacks.push(cb);
|
|
537
582
|
_global.postMessage(token, "*");
|
|
538
583
|
};
|
|
539
584
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
540
|
-
})(
|
|
541
|
-
typeof setImmediate === "function",
|
|
542
|
-
isFunction$1(_global.postMessage)
|
|
543
|
-
);
|
|
585
|
+
})(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
544
586
|
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
545
587
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
546
588
|
const utils$1 = {
|
|
@@ -603,25 +645,38 @@ const utils$1 = {
|
|
|
603
645
|
asap,
|
|
604
646
|
isIterable
|
|
605
647
|
};
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
648
|
+
let AxiosError$1 = class AxiosError extends Error {
|
|
649
|
+
static from(error, code, config, request, response, customProps) {
|
|
650
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
651
|
+
axiosError.cause = error;
|
|
652
|
+
axiosError.name = error.name;
|
|
653
|
+
customProps && Object.assign(axiosError, customProps);
|
|
654
|
+
return axiosError;
|
|
612
655
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
656
|
+
/**
|
|
657
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
658
|
+
*
|
|
659
|
+
* @param {string} message The error message.
|
|
660
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
661
|
+
* @param {Object} [config] The config.
|
|
662
|
+
* @param {Object} [request] The request.
|
|
663
|
+
* @param {Object} [response] The response.
|
|
664
|
+
*
|
|
665
|
+
* @returns {Error} The created error.
|
|
666
|
+
*/
|
|
667
|
+
constructor(message, code, config, request, response) {
|
|
668
|
+
super(message);
|
|
669
|
+
this.name = "AxiosError";
|
|
670
|
+
this.isAxiosError = true;
|
|
671
|
+
code && (this.code = code);
|
|
672
|
+
config && (this.config = config);
|
|
673
|
+
request && (this.request = request);
|
|
674
|
+
if (response) {
|
|
675
|
+
this.response = response;
|
|
676
|
+
this.status = response.status;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
toJSON() {
|
|
625
680
|
return {
|
|
626
681
|
// Standard
|
|
627
682
|
message: this.message,
|
|
@@ -640,45 +695,19 @@ utils$1.inherits(AxiosError$1, Error, {
|
|
|
640
695
|
status: this.status
|
|
641
696
|
};
|
|
642
697
|
}
|
|
643
|
-
});
|
|
644
|
-
const prototype$1 = AxiosError$1.prototype;
|
|
645
|
-
const descriptors = {};
|
|
646
|
-
[
|
|
647
|
-
"ERR_BAD_OPTION_VALUE",
|
|
648
|
-
"ERR_BAD_OPTION",
|
|
649
|
-
"ECONNABORTED",
|
|
650
|
-
"ETIMEDOUT",
|
|
651
|
-
"ERR_NETWORK",
|
|
652
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
653
|
-
"ERR_DEPRECATED",
|
|
654
|
-
"ERR_BAD_RESPONSE",
|
|
655
|
-
"ERR_BAD_REQUEST",
|
|
656
|
-
"ERR_CANCELED",
|
|
657
|
-
"ERR_NOT_SUPPORT",
|
|
658
|
-
"ERR_INVALID_URL"
|
|
659
|
-
// eslint-disable-next-line func-names
|
|
660
|
-
].forEach((code) => {
|
|
661
|
-
descriptors[code] = { value: code };
|
|
662
|
-
});
|
|
663
|
-
Object.defineProperties(AxiosError$1, descriptors);
|
|
664
|
-
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
|
|
665
|
-
AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
666
|
-
const axiosError = Object.create(prototype$1);
|
|
667
|
-
utils$1.toFlatObject(error, axiosError, function filter2(obj) {
|
|
668
|
-
return obj !== Error.prototype;
|
|
669
|
-
}, (prop) => {
|
|
670
|
-
return prop !== "isAxiosError";
|
|
671
|
-
});
|
|
672
|
-
const msg = error && error.message ? error.message : "Error";
|
|
673
|
-
const errCode = code == null && error ? error.code : code;
|
|
674
|
-
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
675
|
-
if (error && axiosError.cause == null) {
|
|
676
|
-
Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
|
|
677
|
-
}
|
|
678
|
-
axiosError.name = error && error.name || "Error";
|
|
679
|
-
customProps && Object.assign(axiosError, customProps);
|
|
680
|
-
return axiosError;
|
|
681
698
|
};
|
|
699
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
700
|
+
AxiosError$1.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
701
|
+
AxiosError$1.ECONNABORTED = "ECONNABORTED";
|
|
702
|
+
AxiosError$1.ETIMEDOUT = "ETIMEDOUT";
|
|
703
|
+
AxiosError$1.ERR_NETWORK = "ERR_NETWORK";
|
|
704
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
705
|
+
AxiosError$1.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
706
|
+
AxiosError$1.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
707
|
+
AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
708
|
+
AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
|
|
709
|
+
AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
710
|
+
AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
682
711
|
const httpAdapter = null;
|
|
683
712
|
function isVisitable(thing) {
|
|
684
713
|
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
@@ -830,17 +859,15 @@ function buildURL(url, params, options) {
|
|
|
830
859
|
return url;
|
|
831
860
|
}
|
|
832
861
|
const _encode = options && options.encode || encode;
|
|
833
|
-
|
|
834
|
-
options
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
const serializeFn = options && options.serialize;
|
|
862
|
+
const _options = utils$1.isFunction(options) ? {
|
|
863
|
+
serialize: options
|
|
864
|
+
} : options;
|
|
865
|
+
const serializeFn = _options && _options.serialize;
|
|
839
866
|
let serializedParams;
|
|
840
867
|
if (serializeFn) {
|
|
841
|
-
serializedParams = serializeFn(params,
|
|
868
|
+
serializedParams = serializeFn(params, _options);
|
|
842
869
|
} else {
|
|
843
|
-
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params,
|
|
870
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
844
871
|
}
|
|
845
872
|
if (serializedParams) {
|
|
846
873
|
const hashmarkIndex = url.indexOf("#");
|
|
@@ -860,6 +887,7 @@ class InterceptorManager {
|
|
|
860
887
|
*
|
|
861
888
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
862
889
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
890
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
863
891
|
*
|
|
864
892
|
* @return {Number} An ID used to remove interceptor later
|
|
865
893
|
*/
|
|
@@ -877,7 +905,7 @@ class InterceptorManager {
|
|
|
877
905
|
*
|
|
878
906
|
* @param {Number} id The ID that was returned by `use`
|
|
879
907
|
*
|
|
880
|
-
* @returns {
|
|
908
|
+
* @returns {void}
|
|
881
909
|
*/
|
|
882
910
|
eject(id) {
|
|
883
911
|
if (this.handlers[id]) {
|
|
@@ -915,7 +943,8 @@ class InterceptorManager {
|
|
|
915
943
|
const transitionalDefaults = {
|
|
916
944
|
silentJSONParsing: true,
|
|
917
945
|
forcedJSONParsing: true,
|
|
918
|
-
clarifyTimeoutError: false
|
|
946
|
+
clarifyTimeoutError: false,
|
|
947
|
+
legacyInterceptorReqResOrdering: true
|
|
919
948
|
};
|
|
920
949
|
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
921
950
|
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
@@ -1400,13 +1429,22 @@ function transformData(fns, response) {
|
|
|
1400
1429
|
function isCancel$1(value) {
|
|
1401
1430
|
return !!(value && value.__CANCEL__);
|
|
1402
1431
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
}
|
|
1432
|
+
let CanceledError$1 = class CanceledError extends AxiosError$1 {
|
|
1433
|
+
/**
|
|
1434
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1435
|
+
*
|
|
1436
|
+
* @param {string=} message The message.
|
|
1437
|
+
* @param {Object=} config The config.
|
|
1438
|
+
* @param {Object=} request The request.
|
|
1439
|
+
*
|
|
1440
|
+
* @returns {CanceledError} The created error.
|
|
1441
|
+
*/
|
|
1442
|
+
constructor(message, config, request) {
|
|
1443
|
+
super(message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
1444
|
+
this.name = "CanceledError";
|
|
1445
|
+
this.__CANCEL__ = true;
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1410
1448
|
function settle(resolve, reject, response) {
|
|
1411
1449
|
const validateStatus2 = response.config.validateStatus;
|
|
1412
1450
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -1533,20 +1571,33 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origi
|
|
|
1533
1571
|
const cookies = platform.hasStandardBrowserEnv ? (
|
|
1534
1572
|
// Standard browser envs support document.cookie
|
|
1535
1573
|
{
|
|
1536
|
-
write(name, value, expires, path, domain, secure) {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
utils$1.
|
|
1540
|
-
|
|
1541
|
-
|
|
1574
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
1575
|
+
if (typeof document === "undefined") return;
|
|
1576
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
1577
|
+
if (utils$1.isNumber(expires)) {
|
|
1578
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
1579
|
+
}
|
|
1580
|
+
if (utils$1.isString(path)) {
|
|
1581
|
+
cookie.push(`path=${path}`);
|
|
1582
|
+
}
|
|
1583
|
+
if (utils$1.isString(domain)) {
|
|
1584
|
+
cookie.push(`domain=${domain}`);
|
|
1585
|
+
}
|
|
1586
|
+
if (secure === true) {
|
|
1587
|
+
cookie.push("secure");
|
|
1588
|
+
}
|
|
1589
|
+
if (utils$1.isString(sameSite)) {
|
|
1590
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
1591
|
+
}
|
|
1542
1592
|
document.cookie = cookie.join("; ");
|
|
1543
1593
|
},
|
|
1544
1594
|
read(name) {
|
|
1545
|
-
|
|
1546
|
-
|
|
1595
|
+
if (typeof document === "undefined") return null;
|
|
1596
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
1597
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
1547
1598
|
},
|
|
1548
1599
|
remove(name) {
|
|
1549
|
-
this.write(name, "", Date.now() - 864e5);
|
|
1600
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
1550
1601
|
}
|
|
1551
1602
|
}
|
|
1552
1603
|
) : (
|
|
@@ -1562,6 +1613,9 @@ const cookies = platform.hasStandardBrowserEnv ? (
|
|
|
1562
1613
|
}
|
|
1563
1614
|
);
|
|
1564
1615
|
function isAbsoluteURL(url) {
|
|
1616
|
+
if (typeof url !== "string") {
|
|
1617
|
+
return false;
|
|
1618
|
+
}
|
|
1565
1619
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1566
1620
|
}
|
|
1567
1621
|
function combineURLs(baseURL, relativeURL) {
|
|
@@ -1645,11 +1699,16 @@ function mergeConfig$1(config1, config2) {
|
|
|
1645
1699
|
validateStatus: mergeDirectKeys,
|
|
1646
1700
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
1647
1701
|
};
|
|
1648
|
-
utils$1.forEach(
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1702
|
+
utils$1.forEach(
|
|
1703
|
+
Object.keys({ ...config1, ...config2 }),
|
|
1704
|
+
function computeConfigValue(prop) {
|
|
1705
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
|
|
1706
|
+
return;
|
|
1707
|
+
const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
1708
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
1709
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1653
1712
|
return config;
|
|
1654
1713
|
}
|
|
1655
1714
|
const resolveConfig = (config) => {
|
|
@@ -1830,7 +1889,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
1830
1889
|
};
|
|
1831
1890
|
let timer = timeout && setTimeout(() => {
|
|
1832
1891
|
timer = null;
|
|
1833
|
-
onabort(new AxiosError$1(`timeout ${timeout}
|
|
1892
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
1834
1893
|
}, timeout);
|
|
1835
1894
|
const unsubscribe = () => {
|
|
1836
1895
|
if (signals) {
|
|
@@ -1925,8 +1984,7 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
1925
1984
|
};
|
|
1926
1985
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
1927
1986
|
const { isFunction } = utils$1;
|
|
1928
|
-
const globalFetchAPI = (({
|
|
1929
|
-
fetch,
|
|
1987
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
1930
1988
|
Request,
|
|
1931
1989
|
Response
|
|
1932
1990
|
}))(utils$1.global);
|
|
@@ -1942,8 +2000,11 @@ const test = (fn, ...args) => {
|
|
|
1942
2000
|
}
|
|
1943
2001
|
};
|
|
1944
2002
|
const factory = (env) => {
|
|
1945
|
-
|
|
1946
|
-
|
|
2003
|
+
env = utils$1.merge.call({
|
|
2004
|
+
skipUndefined: true
|
|
2005
|
+
}, globalFetchAPI, env);
|
|
2006
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
2007
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
1947
2008
|
const isRequestSupported = isFunction(Request);
|
|
1948
2009
|
const isResponseSupported = isFunction(Response);
|
|
1949
2010
|
if (!isFetchSupported) {
|
|
@@ -2021,6 +2082,7 @@ const factory = (env) => {
|
|
|
2021
2082
|
withCredentials = "same-origin",
|
|
2022
2083
|
fetchOptions
|
|
2023
2084
|
} = resolveConfig(config);
|
|
2085
|
+
let _fetch = envFetch || fetch;
|
|
2024
2086
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
2025
2087
|
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
2026
2088
|
let request = null;
|
|
@@ -2061,7 +2123,7 @@ const factory = (env) => {
|
|
|
2061
2123
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
2062
2124
|
};
|
|
2063
2125
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
2064
|
-
let response = await (isRequestSupported ?
|
|
2126
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
2065
2127
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
2066
2128
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
2067
2129
|
const options = {};
|
|
@@ -2098,26 +2160,24 @@ const factory = (env) => {
|
|
|
2098
2160
|
unsubscribe && unsubscribe();
|
|
2099
2161
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
2100
2162
|
throw Object.assign(
|
|
2101
|
-
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
|
|
2163
|
+
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request, err && err.response),
|
|
2102
2164
|
{
|
|
2103
2165
|
cause: err.cause || err
|
|
2104
2166
|
}
|
|
2105
2167
|
);
|
|
2106
2168
|
}
|
|
2107
|
-
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
2169
|
+
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
2108
2170
|
}
|
|
2109
2171
|
};
|
|
2110
2172
|
};
|
|
2111
2173
|
const seedCache = /* @__PURE__ */ new Map();
|
|
2112
2174
|
const getFetch = (config) => {
|
|
2113
|
-
let env =
|
|
2114
|
-
|
|
2115
|
-
}, globalFetchAPI, config ? config.env : null);
|
|
2116
|
-
const { fetch, Request, Response } = env;
|
|
2175
|
+
let env = config && config.env || {};
|
|
2176
|
+
const { fetch: fetch2, Request, Response } = env;
|
|
2117
2177
|
const seeds = [
|
|
2118
2178
|
Request,
|
|
2119
2179
|
Response,
|
|
2120
|
-
|
|
2180
|
+
fetch2
|
|
2121
2181
|
];
|
|
2122
2182
|
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
2123
2183
|
while (i--) {
|
|
@@ -2147,40 +2207,49 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
2147
2207
|
});
|
|
2148
2208
|
const renderReason = (reason) => `- ${reason}`;
|
|
2149
2209
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
2210
|
+
function getAdapter$1(adapters2, config) {
|
|
2211
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
2212
|
+
const { length } = adapters2;
|
|
2213
|
+
let nameOrAdapter;
|
|
2214
|
+
let adapter;
|
|
2215
|
+
const rejectedReasons = {};
|
|
2216
|
+
for (let i = 0; i < length; i++) {
|
|
2217
|
+
nameOrAdapter = adapters2[i];
|
|
2218
|
+
let id;
|
|
2219
|
+
adapter = nameOrAdapter;
|
|
2220
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
2221
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
2222
|
+
if (adapter === void 0) {
|
|
2223
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
2227
|
+
break;
|
|
2228
|
+
}
|
|
2229
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
2230
|
+
}
|
|
2231
|
+
if (!adapter) {
|
|
2232
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
2233
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
2234
|
+
);
|
|
2235
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
2236
|
+
throw new AxiosError$1(
|
|
2237
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
2238
|
+
"ERR_NOT_SUPPORT"
|
|
2239
|
+
);
|
|
2240
|
+
}
|
|
2241
|
+
return adapter;
|
|
2242
|
+
}
|
|
2150
2243
|
const adapters = {
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
adapter = nameOrAdapter;
|
|
2161
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
2162
|
-
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
2163
|
-
if (adapter === void 0) {
|
|
2164
|
-
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
|
-
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
2168
|
-
break;
|
|
2169
|
-
}
|
|
2170
|
-
rejectedReasons[id || "#" + i] = adapter;
|
|
2171
|
-
}
|
|
2172
|
-
if (!adapter) {
|
|
2173
|
-
const reasons = Object.entries(rejectedReasons).map(
|
|
2174
|
-
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
2175
|
-
);
|
|
2176
|
-
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
2177
|
-
throw new AxiosError$1(
|
|
2178
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
2179
|
-
"ERR_NOT_SUPPORT"
|
|
2180
|
-
);
|
|
2181
|
-
}
|
|
2182
|
-
return adapter;
|
|
2183
|
-
},
|
|
2244
|
+
/**
|
|
2245
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
2246
|
+
* @type {Function}
|
|
2247
|
+
*/
|
|
2248
|
+
getAdapter: getAdapter$1,
|
|
2249
|
+
/**
|
|
2250
|
+
* Exposes all known adapters
|
|
2251
|
+
* @type {Object<string, Function|Object>}
|
|
2252
|
+
*/
|
|
2184
2253
|
adapters: knownAdapters
|
|
2185
2254
|
};
|
|
2186
2255
|
function throwIfCancellationRequested(config) {
|
|
@@ -2226,7 +2295,7 @@ function dispatchRequest(config) {
|
|
|
2226
2295
|
return Promise.reject(reason);
|
|
2227
2296
|
});
|
|
2228
2297
|
}
|
|
2229
|
-
const VERSION$1 = "1.
|
|
2298
|
+
const VERSION$1 = "1.13.5";
|
|
2230
2299
|
const validators$1 = {};
|
|
2231
2300
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
2232
2301
|
validators$1[type] = function validator2(thing) {
|
|
@@ -2339,7 +2408,8 @@ let Axios$1 = class Axios {
|
|
|
2339
2408
|
validator.assertOptions(transitional2, {
|
|
2340
2409
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
2341
2410
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
2342
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
2411
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
2412
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
2343
2413
|
}, false);
|
|
2344
2414
|
}
|
|
2345
2415
|
if (paramsSerializer != null) {
|
|
@@ -2383,7 +2453,13 @@ let Axios$1 = class Axios {
|
|
|
2383
2453
|
return;
|
|
2384
2454
|
}
|
|
2385
2455
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
2386
|
-
|
|
2456
|
+
const transitional3 = config.transitional || transitionalDefaults;
|
|
2457
|
+
const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering;
|
|
2458
|
+
if (legacyInterceptorReqResOrdering) {
|
|
2459
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
2460
|
+
} else {
|
|
2461
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
2462
|
+
}
|
|
2387
2463
|
});
|
|
2388
2464
|
const responseInterceptorChain = [];
|
|
2389
2465
|
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
@@ -2405,7 +2481,6 @@ let Axios$1 = class Axios {
|
|
|
2405
2481
|
}
|
|
2406
2482
|
len = requestInterceptorChain.length;
|
|
2407
2483
|
let newConfig = config;
|
|
2408
|
-
i = 0;
|
|
2409
2484
|
while (i < len) {
|
|
2410
2485
|
const onFulfilled = requestInterceptorChain[i++];
|
|
2411
2486
|
const onRejected = requestInterceptorChain[i++];
|
|
@@ -2625,7 +2700,13 @@ const HttpStatusCode$1 = {
|
|
|
2625
2700
|
InsufficientStorage: 507,
|
|
2626
2701
|
LoopDetected: 508,
|
|
2627
2702
|
NotExtended: 510,
|
|
2628
|
-
NetworkAuthenticationRequired: 511
|
|
2703
|
+
NetworkAuthenticationRequired: 511,
|
|
2704
|
+
WebServerIsDown: 521,
|
|
2705
|
+
ConnectionTimedOut: 522,
|
|
2706
|
+
OriginIsUnreachable: 523,
|
|
2707
|
+
TimeoutOccurred: 524,
|
|
2708
|
+
SslHandshakeFailed: 525,
|
|
2709
|
+
InvalidSslCertificate: 526
|
|
2629
2710
|
};
|
|
2630
2711
|
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
|
|
2631
2712
|
HttpStatusCode$1[value] = key;
|
|
@@ -2662,8 +2743,8 @@ axios.HttpStatusCode = HttpStatusCode$1;
|
|
|
2662
2743
|
axios.default = axios;
|
|
2663
2744
|
const {
|
|
2664
2745
|
Axios: Axios2,
|
|
2665
|
-
AxiosError,
|
|
2666
|
-
CanceledError,
|
|
2746
|
+
AxiosError: AxiosError2,
|
|
2747
|
+
CanceledError: CanceledError2,
|
|
2667
2748
|
isCancel,
|
|
2668
2749
|
CancelToken: CancelToken2,
|
|
2669
2750
|
VERSION,
|
|
@@ -2970,7 +3051,7 @@ class AxiosClient {
|
|
|
2970
3051
|
const response = await this.client(config);
|
|
2971
3052
|
return [response.data, response.status, response.headers];
|
|
2972
3053
|
} catch (e) {
|
|
2973
|
-
if (e instanceof
|
|
3054
|
+
if (e instanceof AxiosError2 && ((_a = e.response) == null ? void 0 : _a.data)) {
|
|
2974
3055
|
return [e.response.data, e.response.status, e.response.headers];
|
|
2975
3056
|
}
|
|
2976
3057
|
throw e;
|