@botpress/runtime 1.8.4 → 1.9.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/dist/define-config.d.ts +19 -19
- package/dist/definition.js +258 -99
- package/dist/definition.js.map +3 -3
- package/dist/internal.js +246 -87
- package/dist/internal.js.map +3 -3
- package/dist/library.js +246 -87
- package/dist/library.js.map +3 -3
- package/dist/primitives/data-sources/source-base.d.ts +49 -49
- package/dist/primitives/data-sources/source-directory.d.ts +23 -23
- package/dist/primitives/data-sources/source-directory.d.ts.map +1 -1
- package/dist/primitives/data-sources/source-table.d.ts +24 -24
- package/dist/primitives/data-sources/source-website.d.ts +31 -31
- package/dist/primitives/index.d.ts +23 -23
- package/dist/primitives/workflow-instance.d.ts +4 -4
- package/dist/runtime/actions/computed-columns.d.ts +10 -10
- package/dist/runtime/actions/index.d.ts +10 -10
- package/dist/runtime/chat/components.d.ts +76 -76
- package/dist/runtime/chat/transcript.d.ts +10 -10
- package/dist/runtime/events.d.ts +21 -21
- package/dist/runtime/tracked-state-schema.d.ts +7 -7
- package/dist/runtime/workflows/knowledge-indexing.d.ts +21 -21
- package/dist/runtime.js +246 -87
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
|
|
|
48
48
|
var define_PACKAGE_VERSIONS_default;
|
|
49
49
|
var init_define_PACKAGE_VERSIONS = __esm({
|
|
50
50
|
"<define:__PACKAGE_VERSIONS__>"() {
|
|
51
|
-
define_PACKAGE_VERSIONS_default = { runtime: "1.
|
|
51
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.9.0", adk: "1.9.0", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -36461,7 +36461,7 @@ var InterceptorManager = class {
|
|
|
36461
36461
|
*
|
|
36462
36462
|
* @param {Number} id The ID that was returned by `use`
|
|
36463
36463
|
*
|
|
36464
|
-
* @returns {
|
|
36464
|
+
* @returns {void}
|
|
36465
36465
|
*/
|
|
36466
36466
|
eject(id) {
|
|
36467
36467
|
if (this.handlers[id]) {
|
|
@@ -37142,13 +37142,14 @@ var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
|
37142
37142
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
37143
37143
|
import http2 from "http";
|
|
37144
37144
|
import https2 from "https";
|
|
37145
|
+
import http22 from "http2";
|
|
37145
37146
|
import util2 from "util";
|
|
37146
37147
|
import zlib from "zlib";
|
|
37147
37148
|
|
|
37148
37149
|
// ../../node_modules/axios/lib/env/data.js
|
|
37149
37150
|
init_define_BUILD();
|
|
37150
37151
|
init_define_PACKAGE_VERSIONS();
|
|
37151
|
-
var VERSION2 = "1.
|
|
37152
|
+
var VERSION2 = "1.13.2";
|
|
37152
37153
|
|
|
37153
37154
|
// ../../node_modules/axios/lib/helpers/fromDataURI.js
|
|
37154
37155
|
init_define_BUILD();
|
|
@@ -37643,6 +37644,76 @@ var flushOnFinish = (stream5, [throttled, flush]) => {
|
|
|
37643
37644
|
stream5.on("end", flush).on("error", flush);
|
|
37644
37645
|
return throttled;
|
|
37645
37646
|
};
|
|
37647
|
+
var Http2Sessions = class {
|
|
37648
|
+
constructor() {
|
|
37649
|
+
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
37650
|
+
}
|
|
37651
|
+
getSession(authority, options) {
|
|
37652
|
+
options = Object.assign({
|
|
37653
|
+
sessionTimeout: 1e3
|
|
37654
|
+
}, options);
|
|
37655
|
+
let authoritySessions = this.sessions[authority];
|
|
37656
|
+
if (authoritySessions) {
|
|
37657
|
+
let len = authoritySessions.length;
|
|
37658
|
+
for (let i = 0; i < len; i++) {
|
|
37659
|
+
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
37660
|
+
if (!sessionHandle.destroyed && !sessionHandle.closed && util2.isDeepStrictEqual(sessionOptions, options)) {
|
|
37661
|
+
return sessionHandle;
|
|
37662
|
+
}
|
|
37663
|
+
}
|
|
37664
|
+
}
|
|
37665
|
+
const session = http22.connect(authority, options);
|
|
37666
|
+
let removed;
|
|
37667
|
+
const removeSession = () => {
|
|
37668
|
+
if (removed) {
|
|
37669
|
+
return;
|
|
37670
|
+
}
|
|
37671
|
+
removed = true;
|
|
37672
|
+
let entries = authoritySessions, len = entries.length, i = len;
|
|
37673
|
+
while (i--) {
|
|
37674
|
+
if (entries[i][0] === session) {
|
|
37675
|
+
if (len === 1) {
|
|
37676
|
+
delete this.sessions[authority];
|
|
37677
|
+
} else {
|
|
37678
|
+
entries.splice(i, 1);
|
|
37679
|
+
}
|
|
37680
|
+
return;
|
|
37681
|
+
}
|
|
37682
|
+
}
|
|
37683
|
+
};
|
|
37684
|
+
const originalRequestFn = session.request;
|
|
37685
|
+
const { sessionTimeout } = options;
|
|
37686
|
+
if (sessionTimeout != null) {
|
|
37687
|
+
let timer;
|
|
37688
|
+
let streamsCount = 0;
|
|
37689
|
+
session.request = function() {
|
|
37690
|
+
const stream5 = originalRequestFn.apply(this, arguments);
|
|
37691
|
+
streamsCount++;
|
|
37692
|
+
if (timer) {
|
|
37693
|
+
clearTimeout(timer);
|
|
37694
|
+
timer = null;
|
|
37695
|
+
}
|
|
37696
|
+
stream5.once("close", () => {
|
|
37697
|
+
if (!--streamsCount) {
|
|
37698
|
+
timer = setTimeout(() => {
|
|
37699
|
+
timer = null;
|
|
37700
|
+
removeSession();
|
|
37701
|
+
}, sessionTimeout);
|
|
37702
|
+
}
|
|
37703
|
+
});
|
|
37704
|
+
return stream5;
|
|
37705
|
+
};
|
|
37706
|
+
}
|
|
37707
|
+
session.once("close", removeSession);
|
|
37708
|
+
let entry = [
|
|
37709
|
+
session,
|
|
37710
|
+
options
|
|
37711
|
+
];
|
|
37712
|
+
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
37713
|
+
return session;
|
|
37714
|
+
}
|
|
37715
|
+
};
|
|
37716
|
+
var http2Sessions = new Http2Sessions();
|
|
37646
37717
|
function dispatchBeforeRedirect(options, responseDetails) {
|
|
37647
37718
|
if (options.beforeRedirects.proxy) {
|
|
37648
37719
|
options.beforeRedirects.proxy(options);
|
|
@@ -37715,14 +37786,54 @@ var resolveFamily = ({ address, family }) => {
|
|
|
37715
37786
|
};
|
|
37716
37787
|
};
|
|
37717
37788
|
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
37789
|
+
var http2Transport = {
|
|
37790
|
+
request(options, cb) {
|
|
37791
|
+
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80);
|
|
37792
|
+
const { http2Options, headers } = options;
|
|
37793
|
+
const session = http2Sessions.getSession(authority, http2Options);
|
|
37794
|
+
const {
|
|
37795
|
+
HTTP2_HEADER_SCHEME,
|
|
37796
|
+
HTTP2_HEADER_METHOD,
|
|
37797
|
+
HTTP2_HEADER_PATH,
|
|
37798
|
+
HTTP2_HEADER_STATUS
|
|
37799
|
+
} = http22.constants;
|
|
37800
|
+
const http2Headers = {
|
|
37801
|
+
[HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
|
|
37802
|
+
[HTTP2_HEADER_METHOD]: options.method,
|
|
37803
|
+
[HTTP2_HEADER_PATH]: options.path
|
|
37804
|
+
};
|
|
37805
|
+
utils_default.forEach(headers, (header, name) => {
|
|
37806
|
+
name.charAt(0) !== ":" && (http2Headers[name] = header);
|
|
37807
|
+
});
|
|
37808
|
+
const req = session.request(http2Headers);
|
|
37809
|
+
req.once("response", (responseHeaders) => {
|
|
37810
|
+
const response = req;
|
|
37811
|
+
responseHeaders = Object.assign({}, responseHeaders);
|
|
37812
|
+
const status = responseHeaders[HTTP2_HEADER_STATUS];
|
|
37813
|
+
delete responseHeaders[HTTP2_HEADER_STATUS];
|
|
37814
|
+
response.headers = responseHeaders;
|
|
37815
|
+
response.statusCode = +status;
|
|
37816
|
+
cb(response);
|
|
37817
|
+
});
|
|
37818
|
+
return req;
|
|
37819
|
+
}
|
|
37820
|
+
};
|
|
37718
37821
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
37719
37822
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
37720
|
-
let { data, lookup, family } = config;
|
|
37823
|
+
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
37721
37824
|
const { responseType, responseEncoding } = config;
|
|
37722
37825
|
const method = config.method.toUpperCase();
|
|
37723
37826
|
let isDone;
|
|
37724
37827
|
let rejected = false;
|
|
37725
37828
|
let req;
|
|
37829
|
+
httpVersion = +httpVersion;
|
|
37830
|
+
if (Number.isNaN(httpVersion)) {
|
|
37831
|
+
throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
|
|
37832
|
+
}
|
|
37833
|
+
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
37834
|
+
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
37835
|
+
}
|
|
37836
|
+
const isHttp2 = httpVersion === 2;
|
|
37726
37837
|
if (lookup) {
|
|
37727
37838
|
const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
|
|
37728
37839
|
lookup = (hostname, opt, cb) => {
|
|
@@ -37735,7 +37846,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
37735
37846
|
});
|
|
37736
37847
|
};
|
|
37737
37848
|
}
|
|
37738
|
-
const
|
|
37849
|
+
const abortEmitter = new EventEmitter();
|
|
37850
|
+
function abort(reason) {
|
|
37851
|
+
try {
|
|
37852
|
+
abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
|
|
37853
|
+
} catch (err) {
|
|
37854
|
+
console.warn("emit error", err);
|
|
37855
|
+
}
|
|
37856
|
+
}
|
|
37857
|
+
abortEmitter.once("abort", reject);
|
|
37739
37858
|
const onFinished = () => {
|
|
37740
37859
|
if (config.cancelToken) {
|
|
37741
37860
|
config.cancelToken.unsubscribe(abort);
|
|
@@ -37743,25 +37862,31 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
37743
37862
|
if (config.signal) {
|
|
37744
37863
|
config.signal.removeEventListener("abort", abort);
|
|
37745
37864
|
}
|
|
37746
|
-
|
|
37865
|
+
abortEmitter.removeAllListeners();
|
|
37747
37866
|
};
|
|
37748
|
-
onDone((value, isRejected) => {
|
|
37749
|
-
isDone = true;
|
|
37750
|
-
if (isRejected) {
|
|
37751
|
-
rejected = true;
|
|
37752
|
-
onFinished();
|
|
37753
|
-
}
|
|
37754
|
-
});
|
|
37755
|
-
function abort(reason) {
|
|
37756
|
-
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
|
|
37757
|
-
}
|
|
37758
|
-
emitter.once("abort", reject);
|
|
37759
37867
|
if (config.cancelToken || config.signal) {
|
|
37760
37868
|
config.cancelToken && config.cancelToken.subscribe(abort);
|
|
37761
37869
|
if (config.signal) {
|
|
37762
37870
|
config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
|
|
37763
37871
|
}
|
|
37764
37872
|
}
|
|
37873
|
+
onDone((response, isRejected) => {
|
|
37874
|
+
isDone = true;
|
|
37875
|
+
if (isRejected) {
|
|
37876
|
+
rejected = true;
|
|
37877
|
+
onFinished();
|
|
37878
|
+
return;
|
|
37879
|
+
}
|
|
37880
|
+
const { data: data2 } = response;
|
|
37881
|
+
if (data2 instanceof stream3.Readable || data2 instanceof stream3.Duplex) {
|
|
37882
|
+
const offListeners = stream3.finished(data2, () => {
|
|
37883
|
+
offListeners();
|
|
37884
|
+
onFinished();
|
|
37885
|
+
});
|
|
37886
|
+
} else {
|
|
37887
|
+
onFinished();
|
|
37888
|
+
}
|
|
37889
|
+
});
|
|
37765
37890
|
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
37766
37891
|
const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
|
|
37767
37892
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
@@ -37927,7 +38052,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
37927
38052
|
protocol,
|
|
37928
38053
|
family,
|
|
37929
38054
|
beforeRedirect: dispatchBeforeRedirect,
|
|
37930
|
-
beforeRedirects: {}
|
|
38055
|
+
beforeRedirects: {},
|
|
38056
|
+
http2Options
|
|
37931
38057
|
};
|
|
37932
38058
|
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
37933
38059
|
if (config.socketPath) {
|
|
@@ -37940,18 +38066,22 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
37940
38066
|
let transport;
|
|
37941
38067
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
37942
38068
|
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
37943
|
-
if (
|
|
37944
|
-
transport =
|
|
37945
|
-
} else if (config.maxRedirects === 0) {
|
|
37946
|
-
transport = isHttpsRequest ? https2 : http2;
|
|
38069
|
+
if (isHttp2) {
|
|
38070
|
+
transport = http2Transport;
|
|
37947
38071
|
} else {
|
|
37948
|
-
if (config.
|
|
37949
|
-
|
|
37950
|
-
}
|
|
37951
|
-
|
|
37952
|
-
|
|
38072
|
+
if (config.transport) {
|
|
38073
|
+
transport = config.transport;
|
|
38074
|
+
} else if (config.maxRedirects === 0) {
|
|
38075
|
+
transport = isHttpsRequest ? https2 : http2;
|
|
38076
|
+
} else {
|
|
38077
|
+
if (config.maxRedirects) {
|
|
38078
|
+
options.maxRedirects = config.maxRedirects;
|
|
38079
|
+
}
|
|
38080
|
+
if (config.beforeRedirect) {
|
|
38081
|
+
options.beforeRedirects.config = config.beforeRedirect;
|
|
38082
|
+
}
|
|
38083
|
+
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
37953
38084
|
}
|
|
37954
|
-
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
37955
38085
|
}
|
|
37956
38086
|
if (config.maxBodyLength > -1) {
|
|
37957
38087
|
options.maxBodyLength = config.maxBodyLength;
|
|
@@ -37964,7 +38094,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
37964
38094
|
req = transport.request(options, function handleResponse(res) {
|
|
37965
38095
|
if (req.destroyed) return;
|
|
37966
38096
|
const streams2 = [res];
|
|
37967
|
-
const responseLength =
|
|
38097
|
+
const responseLength = utils_default.toFiniteNumber(res.headers["content-length"]);
|
|
37968
38098
|
if (onDownloadProgress || maxDownloadRate) {
|
|
37969
38099
|
const transformStream = new AxiosTransformStream_default({
|
|
37970
38100
|
maxRate: utils_default.toFiniteNumber(maxDownloadRate)
|
|
@@ -38006,10 +38136,6 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38006
38136
|
}
|
|
38007
38137
|
}
|
|
38008
38138
|
responseStream = streams2.length > 1 ? stream3.pipeline(streams2, utils_default.noop) : streams2[0];
|
|
38009
|
-
const offListeners = stream3.finished(responseStream, () => {
|
|
38010
|
-
offListeners();
|
|
38011
|
-
onFinished();
|
|
38012
|
-
});
|
|
38013
38139
|
const response = {
|
|
38014
38140
|
status: res.statusCode,
|
|
38015
38141
|
statusText: res.statusMessage,
|
|
@@ -38029,7 +38155,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38029
38155
|
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
38030
38156
|
rejected = true;
|
|
38031
38157
|
responseStream.destroy();
|
|
38032
|
-
|
|
38158
|
+
abort(new AxiosError_default(
|
|
38033
38159
|
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
38034
38160
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
38035
38161
|
config,
|
|
@@ -38070,16 +38196,19 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38070
38196
|
settle(resolve, reject, response);
|
|
38071
38197
|
});
|
|
38072
38198
|
}
|
|
38073
|
-
|
|
38199
|
+
abortEmitter.once("abort", (err) => {
|
|
38074
38200
|
if (!responseStream.destroyed) {
|
|
38075
38201
|
responseStream.emit("error", err);
|
|
38076
38202
|
responseStream.destroy();
|
|
38077
38203
|
}
|
|
38078
38204
|
});
|
|
38079
38205
|
});
|
|
38080
|
-
|
|
38081
|
-
|
|
38082
|
-
|
|
38206
|
+
abortEmitter.once("abort", (err) => {
|
|
38207
|
+
if (req.close) {
|
|
38208
|
+
req.close();
|
|
38209
|
+
} else {
|
|
38210
|
+
req.destroy(err);
|
|
38211
|
+
}
|
|
38083
38212
|
});
|
|
38084
38213
|
req.on("error", function handleRequestError(err) {
|
|
38085
38214
|
reject(AxiosError_default.from(err, null, config, req));
|
|
@@ -38090,7 +38219,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38090
38219
|
if (config.timeout) {
|
|
38091
38220
|
const timeout = parseInt(config.timeout, 10);
|
|
38092
38221
|
if (Number.isNaN(timeout)) {
|
|
38093
|
-
|
|
38222
|
+
abort(new AxiosError_default(
|
|
38094
38223
|
"error trying to parse `config.timeout` to int",
|
|
38095
38224
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
38096
38225
|
config,
|
|
@@ -38105,14 +38234,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38105
38234
|
if (config.timeoutErrorMessage) {
|
|
38106
38235
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
38107
38236
|
}
|
|
38108
|
-
|
|
38237
|
+
abort(new AxiosError_default(
|
|
38109
38238
|
timeoutErrorMessage,
|
|
38110
38239
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
38111
38240
|
config,
|
|
38112
38241
|
req
|
|
38113
38242
|
));
|
|
38114
|
-
abort();
|
|
38115
38243
|
});
|
|
38244
|
+
} else {
|
|
38245
|
+
req.setTimeout(0);
|
|
38116
38246
|
}
|
|
38117
38247
|
if (utils_default.isStream(data)) {
|
|
38118
38248
|
let ended = false;
|
|
@@ -38131,7 +38261,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
38131
38261
|
});
|
|
38132
38262
|
data.pipe(req);
|
|
38133
38263
|
} else {
|
|
38134
|
-
req.
|
|
38264
|
+
data && req.write(data);
|
|
38265
|
+
req.end();
|
|
38135
38266
|
}
|
|
38136
38267
|
});
|
|
38137
38268
|
};
|
|
@@ -38161,20 +38292,33 @@ init_define_PACKAGE_VERSIONS();
|
|
|
38161
38292
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
38162
38293
|
// Standard browser envs support document.cookie
|
|
38163
38294
|
{
|
|
38164
|
-
write(name, value, expires, path4, domain, secure) {
|
|
38165
|
-
|
|
38166
|
-
|
|
38167
|
-
utils_default.
|
|
38168
|
-
|
|
38169
|
-
|
|
38295
|
+
write(name, value, expires, path4, domain, secure, sameSite) {
|
|
38296
|
+
if (typeof document === "undefined") return;
|
|
38297
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
38298
|
+
if (utils_default.isNumber(expires)) {
|
|
38299
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
38300
|
+
}
|
|
38301
|
+
if (utils_default.isString(path4)) {
|
|
38302
|
+
cookie.push(`path=${path4}`);
|
|
38303
|
+
}
|
|
38304
|
+
if (utils_default.isString(domain)) {
|
|
38305
|
+
cookie.push(`domain=${domain}`);
|
|
38306
|
+
}
|
|
38307
|
+
if (secure === true) {
|
|
38308
|
+
cookie.push("secure");
|
|
38309
|
+
}
|
|
38310
|
+
if (utils_default.isString(sameSite)) {
|
|
38311
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
38312
|
+
}
|
|
38170
38313
|
document.cookie = cookie.join("; ");
|
|
38171
38314
|
},
|
|
38172
38315
|
read(name) {
|
|
38173
|
-
|
|
38174
|
-
|
|
38316
|
+
if (typeof document === "undefined") return null;
|
|
38317
|
+
const match2 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
38318
|
+
return match2 ? decodeURIComponent(match2[1]) : null;
|
|
38175
38319
|
},
|
|
38176
38320
|
remove(name) {
|
|
38177
|
-
this.write(name, "", Date.now() - 864e5);
|
|
38321
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
38178
38322
|
}
|
|
38179
38323
|
}
|
|
38180
38324
|
) : (
|
|
@@ -38751,7 +38895,7 @@ var factory = (env2) => {
|
|
|
38751
38895
|
};
|
|
38752
38896
|
var seedCache = /* @__PURE__ */ new Map();
|
|
38753
38897
|
var getFetch = (config) => {
|
|
38754
|
-
let env2 = config
|
|
38898
|
+
let env2 = config && config.env || {};
|
|
38755
38899
|
const { fetch: fetch2, Request, Response } = env2;
|
|
38756
38900
|
const seeds = [
|
|
38757
38901
|
Request,
|
|
@@ -38788,40 +38932,49 @@ utils_default.forEach(knownAdapters, (fn, value) => {
|
|
|
38788
38932
|
});
|
|
38789
38933
|
var renderReason = (reason) => `- ${reason}`;
|
|
38790
38934
|
var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
|
|
38791
|
-
|
|
38792
|
-
|
|
38793
|
-
|
|
38794
|
-
|
|
38795
|
-
|
|
38796
|
-
|
|
38797
|
-
|
|
38798
|
-
|
|
38799
|
-
|
|
38800
|
-
|
|
38801
|
-
|
|
38802
|
-
|
|
38803
|
-
|
|
38804
|
-
|
|
38805
|
-
|
|
38806
|
-
|
|
38807
|
-
|
|
38808
|
-
|
|
38809
|
-
break;
|
|
38810
|
-
}
|
|
38811
|
-
rejectedReasons[id || "#" + i] = adapter2;
|
|
38812
|
-
}
|
|
38813
|
-
if (!adapter2) {
|
|
38814
|
-
const reasons = Object.entries(rejectedReasons).map(
|
|
38815
|
-
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
38816
|
-
);
|
|
38817
|
-
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
38818
|
-
throw new AxiosError_default(
|
|
38819
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
38820
|
-
"ERR_NOT_SUPPORT"
|
|
38821
|
-
);
|
|
38935
|
+
function getAdapter(adapters, config) {
|
|
38936
|
+
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
38937
|
+
const { length } = adapters;
|
|
38938
|
+
let nameOrAdapter;
|
|
38939
|
+
let adapter2;
|
|
38940
|
+
const rejectedReasons = {};
|
|
38941
|
+
for (let i = 0; i < length; i++) {
|
|
38942
|
+
nameOrAdapter = adapters[i];
|
|
38943
|
+
let id;
|
|
38944
|
+
adapter2 = nameOrAdapter;
|
|
38945
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
38946
|
+
adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
38947
|
+
if (adapter2 === void 0) {
|
|
38948
|
+
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
38949
|
+
}
|
|
38950
|
+
}
|
|
38951
|
+
if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
|
|
38952
|
+
break;
|
|
38822
38953
|
}
|
|
38823
|
-
|
|
38824
|
-
}
|
|
38954
|
+
rejectedReasons[id || "#" + i] = adapter2;
|
|
38955
|
+
}
|
|
38956
|
+
if (!adapter2) {
|
|
38957
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
38958
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
38959
|
+
);
|
|
38960
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
38961
|
+
throw new AxiosError_default(
|
|
38962
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
38963
|
+
"ERR_NOT_SUPPORT"
|
|
38964
|
+
);
|
|
38965
|
+
}
|
|
38966
|
+
return adapter2;
|
|
38967
|
+
}
|
|
38968
|
+
var adapters_default = {
|
|
38969
|
+
/**
|
|
38970
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
38971
|
+
* @type {Function}
|
|
38972
|
+
*/
|
|
38973
|
+
getAdapter,
|
|
38974
|
+
/**
|
|
38975
|
+
* Exposes all known adapters
|
|
38976
|
+
* @type {Object<string, Function|Object>}
|
|
38977
|
+
*/
|
|
38825
38978
|
adapters: knownAdapters
|
|
38826
38979
|
};
|
|
38827
38980
|
|
|
@@ -39290,7 +39443,13 @@ var HttpStatusCode = {
|
|
|
39290
39443
|
InsufficientStorage: 507,
|
|
39291
39444
|
LoopDetected: 508,
|
|
39292
39445
|
NotExtended: 510,
|
|
39293
|
-
NetworkAuthenticationRequired: 511
|
|
39446
|
+
NetworkAuthenticationRequired: 511,
|
|
39447
|
+
WebServerIsDown: 521,
|
|
39448
|
+
ConnectionTimedOut: 522,
|
|
39449
|
+
OriginIsUnreachable: 523,
|
|
39450
|
+
TimeoutOccurred: 524,
|
|
39451
|
+
SslHandshakeFailed: 525,
|
|
39452
|
+
InvalidSslCertificate: 526
|
|
39294
39453
|
};
|
|
39295
39454
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
39296
39455
|
HttpStatusCode[value] = key;
|
|
@@ -39346,7 +39505,7 @@ var {
|
|
|
39346
39505
|
AxiosHeaders: AxiosHeaders2,
|
|
39347
39506
|
HttpStatusCode: HttpStatusCode2,
|
|
39348
39507
|
formToJSON,
|
|
39349
|
-
getAdapter,
|
|
39508
|
+
getAdapter: getAdapter2,
|
|
39350
39509
|
mergeConfig: mergeConfig2
|
|
39351
39510
|
} = axios_default;
|
|
39352
39511
|
|