agent-relay 4.0.30 → 4.0.32
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 +88 -48
- package/bin/agent-relay-broker-darwin-arm64 +0 -0
- package/bin/agent-relay-broker-darwin-x64 +0 -0
- package/bin/agent-relay-broker-linux-arm64 +0 -0
- package/bin/agent-relay-broker-linux-x64 +0 -0
- package/dist/index.cjs +309 -129
- package/dist/src/cli/bootstrap.d.ts +2 -1
- package/dist/src/cli/bootstrap.d.ts.map +1 -1
- package/dist/src/cli/bootstrap.js +223 -17
- package/dist/src/cli/bootstrap.js.map +1 -1
- package/dist/src/cli/commands/agent-management.d.ts.map +1 -1
- package/dist/src/cli/commands/agent-management.js +1 -3
- package/dist/src/cli/commands/agent-management.js.map +1 -1
- package/dist/src/cli/commands/auth.d.ts.map +1 -1
- package/dist/src/cli/commands/auth.js +32 -3
- package/dist/src/cli/commands/auth.js.map +1 -1
- package/dist/src/cli/commands/cloud.d.ts.map +1 -1
- package/dist/src/cli/commands/cloud.js +242 -144
- package/dist/src/cli/commands/cloud.js.map +1 -1
- package/dist/src/cli/commands/core.d.ts.map +1 -1
- package/dist/src/cli/commands/core.js +11 -6
- package/dist/src/cli/commands/core.js.map +1 -1
- package/dist/src/cli/commands/messaging.d.ts.map +1 -1
- package/dist/src/cli/commands/messaging.js +1 -3
- package/dist/src/cli/commands/messaging.js.map +1 -1
- package/dist/src/cli/commands/monitoring.d.ts.map +1 -1
- package/dist/src/cli/commands/monitoring.js +5 -4
- package/dist/src/cli/commands/monitoring.js.map +1 -1
- package/dist/src/cli/commands/on.d.ts.map +1 -1
- package/dist/src/cli/commands/on.js +1 -3
- package/dist/src/cli/commands/on.js.map +1 -1
- package/dist/src/cli/commands/setup.d.ts.map +1 -1
- package/dist/src/cli/commands/setup.js +62 -7
- package/dist/src/cli/commands/setup.js.map +1 -1
- package/dist/src/cli/commands/swarm.d.ts.map +1 -1
- package/dist/src/cli/commands/swarm.js +34 -4
- package/dist/src/cli/commands/swarm.js.map +1 -1
- package/dist/src/cli/index.js +9 -1
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/lib/exit.d.ts +49 -0
- package/dist/src/cli/lib/exit.d.ts.map +1 -0
- package/dist/src/cli/lib/exit.js +73 -0
- package/dist/src/cli/lib/exit.js.map +1 -0
- package/dist/src/cli/lib/telemetry-helpers.d.ts +20 -0
- package/dist/src/cli/lib/telemetry-helpers.d.ts.map +1 -0
- package/dist/src/cli/lib/telemetry-helpers.js +31 -0
- package/dist/src/cli/lib/telemetry-helpers.js.map +1 -0
- package/node_modules/@agent-relay/cloud/package.json +2 -2
- package/node_modules/@agent-relay/config/package.json +1 -1
- package/node_modules/@agent-relay/hooks/package.json +4 -4
- package/node_modules/@agent-relay/sdk/README.md +3 -0
- package/node_modules/@agent-relay/sdk/dist/relay.d.ts +16 -0
- package/node_modules/@agent-relay/sdk/dist/relay.d.ts.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/relay.js +83 -0
- package/node_modules/@agent-relay/sdk/dist/relay.js.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/file-db.d.ts +62 -12
- package/node_modules/@agent-relay/sdk/dist/workflows/file-db.d.ts.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/file-db.js +137 -47
- package/node_modules/@agent-relay/sdk/dist/workflows/file-db.js.map +1 -1
- package/node_modules/@agent-relay/sdk/package.json +2 -2
- package/node_modules/@agent-relay/telemetry/dist/client.d.ts +14 -2
- package/node_modules/@agent-relay/telemetry/dist/client.d.ts.map +1 -1
- package/node_modules/@agent-relay/telemetry/dist/client.js +22 -4
- package/node_modules/@agent-relay/telemetry/dist/client.js.map +1 -1
- package/node_modules/@agent-relay/telemetry/dist/events.d.ts +217 -10
- package/node_modules/@agent-relay/telemetry/dist/events.d.ts.map +1 -1
- package/node_modules/@agent-relay/telemetry/dist/events.js +11 -0
- package/node_modules/@agent-relay/telemetry/dist/events.js.map +1 -1
- package/node_modules/@agent-relay/telemetry/dist/index.d.ts +2 -2
- package/node_modules/@agent-relay/telemetry/dist/index.d.ts.map +1 -1
- package/node_modules/@agent-relay/telemetry/dist/index.js.map +1 -1
- package/node_modules/@agent-relay/telemetry/package.json +2 -2
- package/node_modules/@agent-relay/trajectory/package.json +2 -2
- package/node_modules/@agent-relay/user-directory/package.json +2 -2
- package/node_modules/@agent-relay/utils/package.json +2 -2
- package/node_modules/@relaycast/sdk/dist/version.d.ts +1 -1
- package/node_modules/@relaycast/sdk/dist/version.js +1 -1
- package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/package.json +1 -1
- package/node_modules/@relaycast/sdk/package.json +2 -2
- package/node_modules/agent-trajectories/dist/{chunk-2XT3DOJC.js → chunk-27AQPWHK.js} +136 -72
- package/node_modules/agent-trajectories/dist/chunk-27AQPWHK.js.map +1 -0
- package/node_modules/agent-trajectories/dist/cli/index.js +135 -71
- package/node_modules/agent-trajectories/dist/cli/index.js.map +1 -1
- package/node_modules/agent-trajectories/dist/{index-thTh5iI8.d.ts → index-C7XhwsoN.d.ts} +24 -0
- package/node_modules/agent-trajectories/dist/index.d.ts +2 -2
- package/node_modules/agent-trajectories/dist/index.js +1 -1
- package/node_modules/agent-trajectories/dist/sdk/index.d.ts +1 -1
- package/node_modules/agent-trajectories/dist/sdk/index.js +1 -1
- package/node_modules/agent-trajectories/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +166 -0
- package/node_modules/axios/README.md +210 -204
- package/node_modules/axios/dist/axios.js +92 -63
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +140 -101
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +140 -101
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +199 -75
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +14 -28
- package/node_modules/axios/index.d.ts +132 -226
- package/node_modules/axios/lib/adapters/fetch.js +21 -6
- package/node_modules/axios/lib/adapters/http.js +88 -6
- package/node_modules/axios/lib/core/AxiosError.js +34 -33
- package/node_modules/axios/lib/core/AxiosHeaders.js +24 -25
- package/node_modules/axios/lib/core/buildFullPath.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +5 -3
- package/node_modules/axios/lib/defaults/index.js +13 -8
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -2
- package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +5 -5
- package/node_modules/axios/lib/helpers/resolveConfig.js +11 -3
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +48 -1
- package/node_modules/axios/lib/helpers/toFormData.js +10 -2
- package/node_modules/axios/lib/utils.js +10 -10
- package/node_modules/axios/package.json +4 -4
- package/package.json +9 -9
- package/packages/cloud/package.json +2 -2
- package/packages/config/package.json +1 -1
- package/packages/hooks/package.json +4 -4
- package/packages/sdk/README.md +3 -0
- package/packages/sdk/dist/relay.d.ts +16 -0
- package/packages/sdk/dist/relay.d.ts.map +1 -1
- package/packages/sdk/dist/relay.js +83 -0
- package/packages/sdk/dist/relay.js.map +1 -1
- package/packages/sdk/dist/workflows/file-db.d.ts +62 -12
- package/packages/sdk/dist/workflows/file-db.d.ts.map +1 -1
- package/packages/sdk/dist/workflows/file-db.js +137 -47
- package/packages/sdk/dist/workflows/file-db.js.map +1 -1
- package/packages/sdk/package.json +2 -2
- package/packages/telemetry/dist/client.d.ts +14 -2
- package/packages/telemetry/dist/client.d.ts.map +1 -1
- package/packages/telemetry/dist/client.js +22 -4
- package/packages/telemetry/dist/client.js.map +1 -1
- package/packages/telemetry/dist/events.d.ts +217 -10
- package/packages/telemetry/dist/events.d.ts.map +1 -1
- package/packages/telemetry/dist/events.js +11 -0
- package/packages/telemetry/dist/events.js.map +1 -1
- package/packages/telemetry/dist/index.d.ts +2 -2
- package/packages/telemetry/dist/index.d.ts.map +1 -1
- package/packages/telemetry/dist/index.js.map +1 -1
- package/packages/telemetry/package.json +2 -2
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/package.json +2 -2
- package/node_modules/@clack/prompts/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/node_modules/@clack/prompts/node_modules/is-unicode-supported/index.js +0 -17
- package/node_modules/@clack/prompts/node_modules/is-unicode-supported/license +0 -9
- package/node_modules/@clack/prompts/node_modules/is-unicode-supported/package.json +0 -43
- package/node_modules/@clack/prompts/node_modules/is-unicode-supported/readme.md +0 -35
- package/node_modules/agent-trajectories/dist/chunk-2XT3DOJC.js.map +0 -1
- package/node_modules/color-convert/CHANGELOG.md +0 -54
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.15.
|
|
1
|
+
/*! Axios v1.15.1 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -269,16 +269,16 @@ const G = getGlobal();
|
|
|
269
269
|
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
270
270
|
|
|
271
271
|
const isFormData = (thing) => {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
272
|
+
if (!thing) return false;
|
|
273
|
+
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
274
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
|
|
275
|
+
const proto = getPrototypeOf(thing);
|
|
276
|
+
if (!proto || proto === Object.prototype) return false;
|
|
277
|
+
if (!isFunction$1(thing.append)) return false;
|
|
278
|
+
const kind = kindOf(thing);
|
|
279
|
+
return kind === 'formdata' ||
|
|
280
|
+
// detect form-data instance
|
|
281
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
/**
|
|
@@ -945,40 +945,40 @@ class AxiosError extends Error {
|
|
|
945
945
|
return axiosError;
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}
|
|
948
|
+
/**
|
|
949
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
950
|
+
*
|
|
951
|
+
* @param {string} message The error message.
|
|
952
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
953
|
+
* @param {Object} [config] The config.
|
|
954
|
+
* @param {Object} [request] The request.
|
|
955
|
+
* @param {Object} [response] The response.
|
|
956
|
+
*
|
|
957
|
+
* @returns {Error} The created error.
|
|
958
|
+
*/
|
|
959
|
+
constructor(message, code, config, request, response) {
|
|
960
|
+
super(message);
|
|
961
|
+
|
|
962
|
+
// Make message enumerable to maintain backward compatibility
|
|
963
|
+
// The native Error constructor sets message as non-enumerable,
|
|
964
|
+
// but axios < v1.13.3 had it as enumerable
|
|
965
|
+
Object.defineProperty(this, 'message', {
|
|
966
|
+
value: message,
|
|
967
|
+
enumerable: true,
|
|
968
|
+
writable: true,
|
|
969
|
+
configurable: true,
|
|
970
|
+
});
|
|
971
|
+
|
|
972
|
+
this.name = 'AxiosError';
|
|
973
|
+
this.isAxiosError = true;
|
|
974
|
+
code && (this.code = code);
|
|
975
|
+
config && (this.config = config);
|
|
976
|
+
request && (this.request = request);
|
|
977
|
+
if (response) {
|
|
978
|
+
this.response = response;
|
|
979
|
+
this.status = response.status;
|
|
981
980
|
}
|
|
981
|
+
}
|
|
982
982
|
|
|
983
983
|
toJSON() {
|
|
984
984
|
return {
|
|
@@ -1014,6 +1014,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
|
1014
1014
|
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
1015
1015
|
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
1016
1016
|
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
1017
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
1017
1018
|
|
|
1018
1019
|
// eslint-disable-next-line strict
|
|
1019
1020
|
var httpAdapter = null;
|
|
@@ -1128,6 +1129,7 @@ function toFormData(obj, formData, options) {
|
|
|
1128
1129
|
const dots = options.dots;
|
|
1129
1130
|
const indexes = options.indexes;
|
|
1130
1131
|
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1132
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
1131
1133
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1132
1134
|
|
|
1133
1135
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -1220,9 +1222,16 @@ function toFormData(obj, formData, options) {
|
|
|
1220
1222
|
isVisitable,
|
|
1221
1223
|
});
|
|
1222
1224
|
|
|
1223
|
-
function build(value, path) {
|
|
1225
|
+
function build(value, path, depth = 0) {
|
|
1224
1226
|
if (utils$1.isUndefined(value)) return;
|
|
1225
1227
|
|
|
1228
|
+
if (depth > maxDepth) {
|
|
1229
|
+
throw new AxiosError(
|
|
1230
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1231
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1232
|
+
);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1226
1235
|
if (stack.indexOf(value) !== -1) {
|
|
1227
1236
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
1228
1237
|
}
|
|
@@ -1235,7 +1244,7 @@ function toFormData(obj, formData, options) {
|
|
|
1235
1244
|
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
1236
1245
|
|
|
1237
1246
|
if (result === true) {
|
|
1238
|
-
build(el, path ? path.concat(key) : [key]);
|
|
1247
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
1239
1248
|
}
|
|
1240
1249
|
});
|
|
1241
1250
|
|
|
@@ -1267,9 +1276,8 @@ function encode$1(str) {
|
|
|
1267
1276
|
')': '%29',
|
|
1268
1277
|
'~': '%7E',
|
|
1269
1278
|
'%20': '+',
|
|
1270
|
-
'%00': '\x00',
|
|
1271
1279
|
};
|
|
1272
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20
|
|
1280
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
1273
1281
|
return charMap[match];
|
|
1274
1282
|
});
|
|
1275
1283
|
}
|
|
@@ -1589,7 +1597,9 @@ function formDataToJSON(formData) {
|
|
|
1589
1597
|
|
|
1590
1598
|
if (isLast) {
|
|
1591
1599
|
if (utils$1.hasOwnProp(target, name)) {
|
|
1592
|
-
target[name] =
|
|
1600
|
+
target[name] = utils$1.isArray(target[name])
|
|
1601
|
+
? target[name].concat(value)
|
|
1602
|
+
: [target[name], value];
|
|
1593
1603
|
} else {
|
|
1594
1604
|
target[name] = value;
|
|
1595
1605
|
}
|
|
@@ -1623,6 +1633,8 @@ function formDataToJSON(formData) {
|
|
|
1623
1633
|
return null;
|
|
1624
1634
|
}
|
|
1625
1635
|
|
|
1636
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
1637
|
+
|
|
1626
1638
|
/**
|
|
1627
1639
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
1628
1640
|
* of the input
|
|
@@ -1690,20 +1702,22 @@ const defaults = {
|
|
|
1690
1702
|
let isFileList;
|
|
1691
1703
|
|
|
1692
1704
|
if (isObjectPayload) {
|
|
1705
|
+
const formSerializer = own(this, 'formSerializer');
|
|
1693
1706
|
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
1694
|
-
return toURLEncodedForm(data,
|
|
1707
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
1695
1708
|
}
|
|
1696
1709
|
|
|
1697
1710
|
if (
|
|
1698
1711
|
(isFileList = utils$1.isFileList(data)) ||
|
|
1699
1712
|
contentType.indexOf('multipart/form-data') > -1
|
|
1700
1713
|
) {
|
|
1701
|
-
const
|
|
1714
|
+
const env = own(this, 'env');
|
|
1715
|
+
const _FormData = env && env.FormData;
|
|
1702
1716
|
|
|
1703
1717
|
return toFormData(
|
|
1704
1718
|
isFileList ? { 'files[]': data } : data,
|
|
1705
1719
|
_FormData && new _FormData(),
|
|
1706
|
-
|
|
1720
|
+
formSerializer
|
|
1707
1721
|
);
|
|
1708
1722
|
}
|
|
1709
1723
|
}
|
|
@@ -1719,9 +1733,10 @@ const defaults = {
|
|
|
1719
1733
|
|
|
1720
1734
|
transformResponse: [
|
|
1721
1735
|
function transformResponse(data) {
|
|
1722
|
-
const transitional = this
|
|
1736
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
1723
1737
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1724
|
-
const
|
|
1738
|
+
const responseType = own(this, 'responseType');
|
|
1739
|
+
const JSONRequested = responseType === 'json';
|
|
1725
1740
|
|
|
1726
1741
|
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1727
1742
|
return data;
|
|
@@ -1730,17 +1745,17 @@ const defaults = {
|
|
|
1730
1745
|
if (
|
|
1731
1746
|
data &&
|
|
1732
1747
|
utils$1.isString(data) &&
|
|
1733
|
-
((forcedJSONParsing && !
|
|
1748
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
1734
1749
|
) {
|
|
1735
1750
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1736
1751
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1737
1752
|
|
|
1738
1753
|
try {
|
|
1739
|
-
return JSON.parse(data, this
|
|
1754
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
1740
1755
|
} catch (e) {
|
|
1741
1756
|
if (strictJSONParsing) {
|
|
1742
1757
|
if (e.name === 'SyntaxError') {
|
|
1743
|
-
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this
|
|
1758
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
1744
1759
|
}
|
|
1745
1760
|
throw e;
|
|
1746
1761
|
}
|
|
@@ -1852,41 +1867,41 @@ var parseHeaders = (rawHeaders) => {
|
|
|
1852
1867
|
|
|
1853
1868
|
const $internals = Symbol('internals');
|
|
1854
1869
|
|
|
1855
|
-
const
|
|
1870
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
1856
1871
|
|
|
1857
|
-
function
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
if (utils$1.isArray(value)) {
|
|
1863
|
-
value.forEach((v) => assertValidHeaderValue(v, header));
|
|
1864
|
-
return;
|
|
1865
|
-
}
|
|
1872
|
+
function trimSPorHTAB(str) {
|
|
1873
|
+
let start = 0;
|
|
1874
|
+
let end = str.length;
|
|
1866
1875
|
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1876
|
+
while (start < end) {
|
|
1877
|
+
const code = str.charCodeAt(start);
|
|
1871
1878
|
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
}
|
|
1879
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1880
|
+
break;
|
|
1881
|
+
}
|
|
1875
1882
|
|
|
1876
|
-
|
|
1877
|
-
|
|
1883
|
+
start += 1;
|
|
1884
|
+
}
|
|
1878
1885
|
|
|
1879
|
-
while (end >
|
|
1880
|
-
const
|
|
1886
|
+
while (end > start) {
|
|
1887
|
+
const code = str.charCodeAt(end - 1);
|
|
1881
1888
|
|
|
1882
|
-
if (
|
|
1889
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1883
1890
|
break;
|
|
1884
1891
|
}
|
|
1885
1892
|
|
|
1886
1893
|
end -= 1;
|
|
1887
1894
|
}
|
|
1888
1895
|
|
|
1889
|
-
return end === str.length ? str : str.slice(
|
|
1896
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
function normalizeHeader(header) {
|
|
1900
|
+
return header && String(header).trim().toLowerCase();
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
function sanitizeHeaderValue(str) {
|
|
1904
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
1890
1905
|
}
|
|
1891
1906
|
|
|
1892
1907
|
function normalizeValue(value) {
|
|
@@ -1894,7 +1909,7 @@ function normalizeValue(value) {
|
|
|
1894
1909
|
return value;
|
|
1895
1910
|
}
|
|
1896
1911
|
|
|
1897
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) :
|
|
1912
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
1898
1913
|
}
|
|
1899
1914
|
|
|
1900
1915
|
function parseTokens(str) {
|
|
@@ -1976,7 +1991,6 @@ class AxiosHeaders {
|
|
|
1976
1991
|
_rewrite === true ||
|
|
1977
1992
|
(_rewrite === undefined && self[key] !== false)
|
|
1978
1993
|
) {
|
|
1979
|
-
assertValidHeaderValue(_value, _header);
|
|
1980
1994
|
self[key || _header] = normalizeValue(_value);
|
|
1981
1995
|
}
|
|
1982
1996
|
}
|
|
@@ -2399,13 +2413,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2399
2413
|
const _speedometer = speedometer(50, 250);
|
|
2400
2414
|
|
|
2401
2415
|
return throttle((e) => {
|
|
2402
|
-
const
|
|
2416
|
+
const rawLoaded = e.loaded;
|
|
2403
2417
|
const total = e.lengthComputable ? e.total : undefined;
|
|
2404
|
-
const
|
|
2418
|
+
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
2419
|
+
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
2405
2420
|
const rate = _speedometer(progressBytes);
|
|
2406
|
-
const inRange = loaded <= total;
|
|
2407
2421
|
|
|
2408
|
-
bytesNotified = loaded;
|
|
2422
|
+
bytesNotified = Math.max(bytesNotified, loaded);
|
|
2409
2423
|
|
|
2410
2424
|
const data = {
|
|
2411
2425
|
loaded,
|
|
@@ -2413,7 +2427,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2413
2427
|
progress: total ? loaded / total : undefined,
|
|
2414
2428
|
bytes: progressBytes,
|
|
2415
2429
|
rate: rate ? rate : undefined,
|
|
2416
|
-
estimated: rate && total
|
|
2430
|
+
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
2417
2431
|
event: e,
|
|
2418
2432
|
lengthComputable: total != null,
|
|
2419
2433
|
[isDownloadStream ? 'download' : 'upload']: true,
|
|
@@ -2547,7 +2561,7 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
2547
2561
|
*/
|
|
2548
2562
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2549
2563
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2550
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls
|
|
2564
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
2551
2565
|
return combineURLs(baseURL, requestedURL);
|
|
2552
2566
|
}
|
|
2553
2567
|
return requestedURL;
|
|
@@ -2606,9 +2620,9 @@ function mergeConfig(config1, config2) {
|
|
|
2606
2620
|
|
|
2607
2621
|
// eslint-disable-next-line consistent-return
|
|
2608
2622
|
function mergeDirectKeys(a, b, prop) {
|
|
2609
|
-
if (prop
|
|
2623
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
2610
2624
|
return getMergedValue(a, b);
|
|
2611
|
-
} else if (prop
|
|
2625
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
2612
2626
|
return getMergedValue(undefined, a);
|
|
2613
2627
|
}
|
|
2614
2628
|
}
|
|
@@ -2649,7 +2663,9 @@ function mergeConfig(config1, config2) {
|
|
|
2649
2663
|
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
2650
2664
|
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
2651
2665
|
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
2652
|
-
const
|
|
2666
|
+
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
2667
|
+
const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
2668
|
+
const configValue = merge(a, b, prop);
|
|
2653
2669
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2654
2670
|
});
|
|
2655
2671
|
|
|
@@ -2703,10 +2719,18 @@ var resolveConfig = (config) => {
|
|
|
2703
2719
|
// Specifically not if we're in a web worker, or react-native.
|
|
2704
2720
|
|
|
2705
2721
|
if (platform.hasStandardBrowserEnv) {
|
|
2706
|
-
|
|
2722
|
+
if (utils$1.isFunction(withXSRFToken)) {
|
|
2723
|
+
withXSRFToken = withXSRFToken(newConfig);
|
|
2724
|
+
}
|
|
2707
2725
|
|
|
2708
|
-
|
|
2709
|
-
|
|
2726
|
+
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
2727
|
+
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
2728
|
+
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
2729
|
+
const shouldSendXSRF =
|
|
2730
|
+
withXSRFToken === true ||
|
|
2731
|
+
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
2732
|
+
|
|
2733
|
+
if (shouldSendXSRF) {
|
|
2710
2734
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2711
2735
|
|
|
2712
2736
|
if (xsrfValue) {
|
|
@@ -3125,18 +3149,20 @@ const factory = (env) => {
|
|
|
3125
3149
|
test(() => {
|
|
3126
3150
|
let duplexAccessed = false;
|
|
3127
3151
|
|
|
3128
|
-
const
|
|
3129
|
-
|
|
3130
|
-
const hasContentType = new Request(platform.origin, {
|
|
3131
|
-
body,
|
|
3152
|
+
const request = new Request(platform.origin, {
|
|
3153
|
+
body: new ReadableStream$1(),
|
|
3132
3154
|
method: 'POST',
|
|
3133
3155
|
get duplex() {
|
|
3134
3156
|
duplexAccessed = true;
|
|
3135
3157
|
return 'half';
|
|
3136
3158
|
},
|
|
3137
|
-
})
|
|
3159
|
+
});
|
|
3138
3160
|
|
|
3139
|
-
|
|
3161
|
+
const hasContentType = request.headers.has('Content-Type');
|
|
3162
|
+
|
|
3163
|
+
if (request.body != null) {
|
|
3164
|
+
request.body.cancel();
|
|
3165
|
+
}
|
|
3140
3166
|
|
|
3141
3167
|
return duplexAccessed && !hasContentType;
|
|
3142
3168
|
});
|
|
@@ -3280,6 +3306,19 @@ const factory = (env) => {
|
|
|
3280
3306
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
3281
3307
|
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
3282
3308
|
|
|
3309
|
+
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
|
3310
|
+
// delete it so fetch can set it correctly with the boundary
|
|
3311
|
+
if (utils$1.isFormData(data)) {
|
|
3312
|
+
const contentType = headers.getContentType();
|
|
3313
|
+
if (
|
|
3314
|
+
contentType &&
|
|
3315
|
+
/^multipart\/form-data/i.test(contentType) &&
|
|
3316
|
+
!/boundary=/i.test(contentType)
|
|
3317
|
+
) {
|
|
3318
|
+
headers.delete('content-type');
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3283
3322
|
const resolvedOptions = {
|
|
3284
3323
|
...fetchOptions,
|
|
3285
3324
|
signal: composedSignal,
|
|
@@ -3588,7 +3627,7 @@ function dispatchRequest(config) {
|
|
|
3588
3627
|
);
|
|
3589
3628
|
}
|
|
3590
3629
|
|
|
3591
|
-
const VERSION = "1.15.
|
|
3630
|
+
const VERSION = "1.15.1";
|
|
3592
3631
|
|
|
3593
3632
|
const validators$1 = {};
|
|
3594
3633
|
|