@tryghost/content-api 1.11.18 → 1.11.20
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/cjs/content-api.js +8 -8
- package/es/content-api.js +150 -148
- package/es/content-api.js.map +1 -1
- package/package.json +8 -8
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/es/content-api.js
CHANGED
|
@@ -670,7 +670,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
670
670
|
const isThenable = (thing) =>
|
|
671
671
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
672
672
|
|
|
673
|
-
var utils = {
|
|
673
|
+
var utils$1 = {
|
|
674
674
|
isArray,
|
|
675
675
|
isArrayBuffer,
|
|
676
676
|
isBuffer,
|
|
@@ -752,7 +752,7 @@ function AxiosError(message, code, config, request, response) {
|
|
|
752
752
|
response && (this.response = response);
|
|
753
753
|
}
|
|
754
754
|
|
|
755
|
-
utils.inherits(AxiosError, Error, {
|
|
755
|
+
utils$1.inherits(AxiosError, Error, {
|
|
756
756
|
toJSON: function toJSON() {
|
|
757
757
|
return {
|
|
758
758
|
// Standard
|
|
@@ -767,7 +767,7 @@ utils.inherits(AxiosError, Error, {
|
|
|
767
767
|
columnNumber: this.columnNumber,
|
|
768
768
|
stack: this.stack,
|
|
769
769
|
// Axios
|
|
770
|
-
config: utils.toJSONObject(this.config),
|
|
770
|
+
config: utils$1.toJSONObject(this.config),
|
|
771
771
|
code: this.code,
|
|
772
772
|
status: this.response && this.response.status ? this.response.status : null
|
|
773
773
|
};
|
|
@@ -802,7 +802,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
|
802
802
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
803
803
|
const axiosError = Object.create(prototype$1);
|
|
804
804
|
|
|
805
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
805
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
806
806
|
return obj !== Error.prototype;
|
|
807
807
|
}, prop => {
|
|
808
808
|
return prop !== 'isAxiosError';
|
|
@@ -830,7 +830,7 @@ var httpAdapter = null;
|
|
|
830
830
|
* @returns {boolean}
|
|
831
831
|
*/
|
|
832
832
|
function isVisitable(thing) {
|
|
833
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
833
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
834
834
|
}
|
|
835
835
|
|
|
836
836
|
/**
|
|
@@ -841,7 +841,7 @@ function isVisitable(thing) {
|
|
|
841
841
|
* @returns {string} the key without the brackets.
|
|
842
842
|
*/
|
|
843
843
|
function removeBrackets(key) {
|
|
844
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
844
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
/**
|
|
@@ -870,10 +870,10 @@ function renderKey(path, key, dots) {
|
|
|
870
870
|
* @returns {boolean}
|
|
871
871
|
*/
|
|
872
872
|
function isFlatArray(arr) {
|
|
873
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
|
873
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
876
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
877
877
|
return /^is[A-Z]/.test(prop);
|
|
878
878
|
});
|
|
879
879
|
|
|
@@ -901,7 +901,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
|
901
901
|
* @returns
|
|
902
902
|
*/
|
|
903
903
|
function toFormData(obj, formData, options) {
|
|
904
|
-
if (!utils.isObject(obj)) {
|
|
904
|
+
if (!utils$1.isObject(obj)) {
|
|
905
905
|
throw new TypeError('target must be an object');
|
|
906
906
|
}
|
|
907
907
|
|
|
@@ -909,13 +909,13 @@ function toFormData(obj, formData, options) {
|
|
|
909
909
|
formData = formData || new (FormData)();
|
|
910
910
|
|
|
911
911
|
// eslint-disable-next-line no-param-reassign
|
|
912
|
-
options = utils.toFlatObject(options, {
|
|
912
|
+
options = utils$1.toFlatObject(options, {
|
|
913
913
|
metaTokens: true,
|
|
914
914
|
dots: false,
|
|
915
915
|
indexes: false
|
|
916
916
|
}, false, function defined(option, source) {
|
|
917
917
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
918
|
-
return !utils.isUndefined(source[option]);
|
|
918
|
+
return !utils$1.isUndefined(source[option]);
|
|
919
919
|
});
|
|
920
920
|
|
|
921
921
|
const metaTokens = options.metaTokens;
|
|
@@ -924,24 +924,24 @@ function toFormData(obj, formData, options) {
|
|
|
924
924
|
const dots = options.dots;
|
|
925
925
|
const indexes = options.indexes;
|
|
926
926
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
927
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
927
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
928
928
|
|
|
929
|
-
if (!utils.isFunction(visitor)) {
|
|
929
|
+
if (!utils$1.isFunction(visitor)) {
|
|
930
930
|
throw new TypeError('visitor must be a function');
|
|
931
931
|
}
|
|
932
932
|
|
|
933
933
|
function convertValue(value) {
|
|
934
934
|
if (value === null) return '';
|
|
935
935
|
|
|
936
|
-
if (utils.isDate(value)) {
|
|
936
|
+
if (utils$1.isDate(value)) {
|
|
937
937
|
return value.toISOString();
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
-
if (!useBlob && utils.isBlob(value)) {
|
|
940
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
941
941
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
944
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
945
945
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
946
946
|
}
|
|
947
947
|
|
|
@@ -962,20 +962,20 @@ function toFormData(obj, formData, options) {
|
|
|
962
962
|
let arr = value;
|
|
963
963
|
|
|
964
964
|
if (value && !path && typeof value === 'object') {
|
|
965
|
-
if (utils.endsWith(key, '{}')) {
|
|
965
|
+
if (utils$1.endsWith(key, '{}')) {
|
|
966
966
|
// eslint-disable-next-line no-param-reassign
|
|
967
967
|
key = metaTokens ? key : key.slice(0, -2);
|
|
968
968
|
// eslint-disable-next-line no-param-reassign
|
|
969
969
|
value = JSON.stringify(value);
|
|
970
970
|
} else if (
|
|
971
|
-
(utils.isArray(value) && isFlatArray(value)) ||
|
|
972
|
-
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
|
971
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
972
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
973
973
|
)) {
|
|
974
974
|
// eslint-disable-next-line no-param-reassign
|
|
975
975
|
key = removeBrackets(key);
|
|
976
976
|
|
|
977
977
|
arr.forEach(function each(el, index) {
|
|
978
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
|
978
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
979
979
|
// eslint-disable-next-line no-nested-ternary
|
|
980
980
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
|
981
981
|
convertValue(el)
|
|
@@ -1003,7 +1003,7 @@ function toFormData(obj, formData, options) {
|
|
|
1003
1003
|
});
|
|
1004
1004
|
|
|
1005
1005
|
function build(value, path) {
|
|
1006
|
-
if (utils.isUndefined(value)) return;
|
|
1006
|
+
if (utils$1.isUndefined(value)) return;
|
|
1007
1007
|
|
|
1008
1008
|
if (stack.indexOf(value) !== -1) {
|
|
1009
1009
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
@@ -1011,9 +1011,9 @@ function toFormData(obj, formData, options) {
|
|
|
1011
1011
|
|
|
1012
1012
|
stack.push(value);
|
|
1013
1013
|
|
|
1014
|
-
utils.forEach(value, function each(el, key) {
|
|
1015
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
|
1016
|
-
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
1014
|
+
utils$1.forEach(value, function each(el, key) {
|
|
1015
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
1016
|
+
formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
1017
1017
|
);
|
|
1018
1018
|
|
|
1019
1019
|
if (result === true) {
|
|
@@ -1024,7 +1024,7 @@ function toFormData(obj, formData, options) {
|
|
|
1024
1024
|
stack.pop();
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
-
if (!utils.isObject(obj)) {
|
|
1027
|
+
if (!utils$1.isObject(obj)) {
|
|
1028
1028
|
throw new TypeError('data must be an object');
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
@@ -1128,7 +1128,7 @@ function buildURL(url, params, options) {
|
|
|
1128
1128
|
if (serializeFn) {
|
|
1129
1129
|
serializedParams = serializeFn(params, options);
|
|
1130
1130
|
} else {
|
|
1131
|
-
serializedParams = utils.isURLSearchParams(params) ?
|
|
1131
|
+
serializedParams = utils$1.isURLSearchParams(params) ?
|
|
1132
1132
|
params.toString() :
|
|
1133
1133
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
|
1134
1134
|
}
|
|
@@ -1203,7 +1203,7 @@ class InterceptorManager {
|
|
|
1203
1203
|
* @returns {void}
|
|
1204
1204
|
*/
|
|
1205
1205
|
forEach(fn) {
|
|
1206
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
1206
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
1207
1207
|
if (h !== null) {
|
|
1208
1208
|
fn(h);
|
|
1209
1209
|
}
|
|
@@ -1225,6 +1225,18 @@ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
|
1225
1225
|
|
|
1226
1226
|
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
1227
1227
|
|
|
1228
|
+
var platform$1 = {
|
|
1229
|
+
isBrowser: true,
|
|
1230
|
+
classes: {
|
|
1231
|
+
URLSearchParams: URLSearchParams$1,
|
|
1232
|
+
FormData: FormData$1,
|
|
1233
|
+
Blob: Blob$1
|
|
1234
|
+
},
|
|
1235
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1239
|
+
|
|
1228
1240
|
/**
|
|
1229
1241
|
* Determine if we're running in a standard browser environment
|
|
1230
1242
|
*
|
|
@@ -1242,18 +1254,10 @@ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
|
1242
1254
|
*
|
|
1243
1255
|
* @returns {boolean}
|
|
1244
1256
|
*/
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
product === 'NativeScript' ||
|
|
1250
|
-
product === 'NS')
|
|
1251
|
-
) {
|
|
1252
|
-
return false;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1256
|
-
})();
|
|
1257
|
+
const hasStandardBrowserEnv = (
|
|
1258
|
+
(product) => {
|
|
1259
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
1260
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
|
1257
1261
|
|
|
1258
1262
|
/**
|
|
1259
1263
|
* Determine if we're running in a standard browser webWorker environment
|
|
@@ -1264,7 +1268,7 @@ const isStandardBrowserEnv = (() => {
|
|
|
1264
1268
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
1265
1269
|
* This leads to a problem when axios post `FormData` in webWorker
|
|
1266
1270
|
*/
|
|
1267
|
-
|
|
1271
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
1268
1272
|
return (
|
|
1269
1273
|
typeof WorkerGlobalScope !== 'undefined' &&
|
|
1270
1274
|
// eslint-disable-next-line no-undef
|
|
@@ -1273,23 +1277,22 @@ const isStandardBrowserEnv = (() => {
|
|
|
1273
1277
|
);
|
|
1274
1278
|
})();
|
|
1275
1279
|
|
|
1280
|
+
var utils = /*#__PURE__*/Object.freeze({
|
|
1281
|
+
__proto__: null,
|
|
1282
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
1283
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1284
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
1285
|
+
});
|
|
1276
1286
|
|
|
1277
1287
|
var platform = {
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
URLSearchParams: URLSearchParams$1,
|
|
1281
|
-
FormData: FormData$1,
|
|
1282
|
-
Blob: Blob$1
|
|
1283
|
-
},
|
|
1284
|
-
isStandardBrowserEnv,
|
|
1285
|
-
isStandardBrowserWebWorkerEnv,
|
|
1286
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
1288
|
+
...utils,
|
|
1289
|
+
...platform$1
|
|
1287
1290
|
};
|
|
1288
1291
|
|
|
1289
1292
|
function toURLEncodedForm(data, options) {
|
|
1290
1293
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
1291
1294
|
visitor: function(value, key, path, helpers) {
|
|
1292
|
-
if (platform.isNode && utils.isBuffer(value)) {
|
|
1295
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
1293
1296
|
this.append(key, value.toString('base64'));
|
|
1294
1297
|
return false;
|
|
1295
1298
|
}
|
|
@@ -1311,7 +1314,7 @@ function parsePropPath(name) {
|
|
|
1311
1314
|
// foo.x.y.z
|
|
1312
1315
|
// foo-x-y-z
|
|
1313
1316
|
// foo x y z
|
|
1314
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
1317
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
1315
1318
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
1316
1319
|
});
|
|
1317
1320
|
}
|
|
@@ -1348,10 +1351,10 @@ function formDataToJSON(formData) {
|
|
|
1348
1351
|
let name = path[index++];
|
|
1349
1352
|
const isNumericKey = Number.isFinite(+name);
|
|
1350
1353
|
const isLast = index >= path.length;
|
|
1351
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
|
1354
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
1352
1355
|
|
|
1353
1356
|
if (isLast) {
|
|
1354
|
-
if (utils.hasOwnProp(target, name)) {
|
|
1357
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
1355
1358
|
target[name] = [target[name], value];
|
|
1356
1359
|
} else {
|
|
1357
1360
|
target[name] = value;
|
|
@@ -1360,23 +1363,23 @@ function formDataToJSON(formData) {
|
|
|
1360
1363
|
return !isNumericKey;
|
|
1361
1364
|
}
|
|
1362
1365
|
|
|
1363
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
|
1366
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
1364
1367
|
target[name] = [];
|
|
1365
1368
|
}
|
|
1366
1369
|
|
|
1367
1370
|
const result = buildPath(path, value, target[name], index);
|
|
1368
1371
|
|
|
1369
|
-
if (result && utils.isArray(target[name])) {
|
|
1372
|
+
if (result && utils$1.isArray(target[name])) {
|
|
1370
1373
|
target[name] = arrayToObject(target[name]);
|
|
1371
1374
|
}
|
|
1372
1375
|
|
|
1373
1376
|
return !isNumericKey;
|
|
1374
1377
|
}
|
|
1375
1378
|
|
|
1376
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
1379
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
1377
1380
|
const obj = {};
|
|
1378
1381
|
|
|
1379
|
-
utils.forEachEntry(formData, (name, value) => {
|
|
1382
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
1380
1383
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
1381
1384
|
});
|
|
1382
1385
|
|
|
@@ -1397,10 +1400,10 @@ function formDataToJSON(formData) {
|
|
|
1397
1400
|
* @returns {string} A stringified version of the rawValue.
|
|
1398
1401
|
*/
|
|
1399
1402
|
function stringifySafely(rawValue, parser, encoder) {
|
|
1400
|
-
if (utils.isString(rawValue)) {
|
|
1403
|
+
if (utils$1.isString(rawValue)) {
|
|
1401
1404
|
try {
|
|
1402
1405
|
(parser || JSON.parse)(rawValue);
|
|
1403
|
-
return utils.trim(rawValue);
|
|
1406
|
+
return utils$1.trim(rawValue);
|
|
1404
1407
|
} catch (e) {
|
|
1405
1408
|
if (e.name !== 'SyntaxError') {
|
|
1406
1409
|
throw e;
|
|
@@ -1420,13 +1423,13 @@ const defaults = {
|
|
|
1420
1423
|
transformRequest: [function transformRequest(data, headers) {
|
|
1421
1424
|
const contentType = headers.getContentType() || '';
|
|
1422
1425
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
1423
|
-
const isObjectPayload = utils.isObject(data);
|
|
1426
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
1424
1427
|
|
|
1425
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
1428
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
1426
1429
|
data = new FormData(data);
|
|
1427
1430
|
}
|
|
1428
1431
|
|
|
1429
|
-
const isFormData = utils.isFormData(data);
|
|
1432
|
+
const isFormData = utils$1.isFormData(data);
|
|
1430
1433
|
|
|
1431
1434
|
if (isFormData) {
|
|
1432
1435
|
if (!hasJSONContentType) {
|
|
@@ -1435,18 +1438,18 @@ const defaults = {
|
|
|
1435
1438
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
1436
1439
|
}
|
|
1437
1440
|
|
|
1438
|
-
if (utils.isArrayBuffer(data) ||
|
|
1439
|
-
utils.isBuffer(data) ||
|
|
1440
|
-
utils.isStream(data) ||
|
|
1441
|
-
utils.isFile(data) ||
|
|
1442
|
-
utils.isBlob(data)
|
|
1441
|
+
if (utils$1.isArrayBuffer(data) ||
|
|
1442
|
+
utils$1.isBuffer(data) ||
|
|
1443
|
+
utils$1.isStream(data) ||
|
|
1444
|
+
utils$1.isFile(data) ||
|
|
1445
|
+
utils$1.isBlob(data)
|
|
1443
1446
|
) {
|
|
1444
1447
|
return data;
|
|
1445
1448
|
}
|
|
1446
|
-
if (utils.isArrayBufferView(data)) {
|
|
1449
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
1447
1450
|
return data.buffer;
|
|
1448
1451
|
}
|
|
1449
|
-
if (utils.isURLSearchParams(data)) {
|
|
1452
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
1450
1453
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
1451
1454
|
return data.toString();
|
|
1452
1455
|
}
|
|
@@ -1458,7 +1461,7 @@ const defaults = {
|
|
|
1458
1461
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
1459
1462
|
}
|
|
1460
1463
|
|
|
1461
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
1464
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
1462
1465
|
const _FormData = this.env && this.env.FormData;
|
|
1463
1466
|
|
|
1464
1467
|
return toFormData(
|
|
@@ -1482,7 +1485,7 @@ const defaults = {
|
|
|
1482
1485
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1483
1486
|
const JSONRequested = this.responseType === 'json';
|
|
1484
1487
|
|
|
1485
|
-
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
1488
|
+
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
1486
1489
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1487
1490
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1488
1491
|
|
|
@@ -1530,7 +1533,7 @@ const defaults = {
|
|
|
1530
1533
|
}
|
|
1531
1534
|
};
|
|
1532
1535
|
|
|
1533
|
-
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
1536
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
1534
1537
|
defaults.headers[method] = {};
|
|
1535
1538
|
});
|
|
1536
1539
|
|
|
@@ -1538,7 +1541,7 @@ var defaults$1 = defaults;
|
|
|
1538
1541
|
|
|
1539
1542
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
1540
1543
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
1541
|
-
const ignoreDuplicateOf = utils.toObjectSet([
|
|
1544
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
1542
1545
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
1543
1546
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
1544
1547
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
@@ -1599,7 +1602,7 @@ function normalizeValue(value) {
|
|
|
1599
1602
|
return value;
|
|
1600
1603
|
}
|
|
1601
1604
|
|
|
1602
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1605
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1603
1606
|
}
|
|
1604
1607
|
|
|
1605
1608
|
function parseTokens(str) {
|
|
@@ -1617,7 +1620,7 @@ function parseTokens(str) {
|
|
|
1617
1620
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1618
1621
|
|
|
1619
1622
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1620
|
-
if (utils.isFunction(filter)) {
|
|
1623
|
+
if (utils$1.isFunction(filter)) {
|
|
1621
1624
|
return filter.call(this, value, header);
|
|
1622
1625
|
}
|
|
1623
1626
|
|
|
@@ -1625,13 +1628,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
1625
1628
|
value = header;
|
|
1626
1629
|
}
|
|
1627
1630
|
|
|
1628
|
-
if (!utils.isString(value)) return;
|
|
1631
|
+
if (!utils$1.isString(value)) return;
|
|
1629
1632
|
|
|
1630
|
-
if (utils.isString(filter)) {
|
|
1633
|
+
if (utils$1.isString(filter)) {
|
|
1631
1634
|
return value.indexOf(filter) !== -1;
|
|
1632
1635
|
}
|
|
1633
1636
|
|
|
1634
|
-
if (utils.isRegExp(filter)) {
|
|
1637
|
+
if (utils$1.isRegExp(filter)) {
|
|
1635
1638
|
return filter.test(value);
|
|
1636
1639
|
}
|
|
1637
1640
|
}
|
|
@@ -1644,7 +1647,7 @@ function formatHeader(header) {
|
|
|
1644
1647
|
}
|
|
1645
1648
|
|
|
1646
1649
|
function buildAccessors(obj, header) {
|
|
1647
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
|
1650
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
1648
1651
|
|
|
1649
1652
|
['get', 'set', 'has'].forEach(methodName => {
|
|
1650
1653
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
@@ -1671,7 +1674,7 @@ class AxiosHeaders {
|
|
|
1671
1674
|
throw new Error('header name must be a non-empty string');
|
|
1672
1675
|
}
|
|
1673
1676
|
|
|
1674
|
-
const key = utils.findKey(self, lHeader);
|
|
1677
|
+
const key = utils$1.findKey(self, lHeader);
|
|
1675
1678
|
|
|
1676
1679
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
1677
1680
|
self[key || _header] = normalizeValue(_value);
|
|
@@ -1679,11 +1682,11 @@ class AxiosHeaders {
|
|
|
1679
1682
|
}
|
|
1680
1683
|
|
|
1681
1684
|
const setHeaders = (headers, _rewrite) =>
|
|
1682
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
1685
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
1683
1686
|
|
|
1684
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
1687
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
1685
1688
|
setHeaders(header, valueOrRewrite);
|
|
1686
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1689
|
+
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1687
1690
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1688
1691
|
} else {
|
|
1689
1692
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
@@ -1696,7 +1699,7 @@ class AxiosHeaders {
|
|
|
1696
1699
|
header = normalizeHeader(header);
|
|
1697
1700
|
|
|
1698
1701
|
if (header) {
|
|
1699
|
-
const key = utils.findKey(this, header);
|
|
1702
|
+
const key = utils$1.findKey(this, header);
|
|
1700
1703
|
|
|
1701
1704
|
if (key) {
|
|
1702
1705
|
const value = this[key];
|
|
@@ -1709,11 +1712,11 @@ class AxiosHeaders {
|
|
|
1709
1712
|
return parseTokens(value);
|
|
1710
1713
|
}
|
|
1711
1714
|
|
|
1712
|
-
if (utils.isFunction(parser)) {
|
|
1715
|
+
if (utils$1.isFunction(parser)) {
|
|
1713
1716
|
return parser.call(this, value, key);
|
|
1714
1717
|
}
|
|
1715
1718
|
|
|
1716
|
-
if (utils.isRegExp(parser)) {
|
|
1719
|
+
if (utils$1.isRegExp(parser)) {
|
|
1717
1720
|
return parser.exec(value);
|
|
1718
1721
|
}
|
|
1719
1722
|
|
|
@@ -1726,7 +1729,7 @@ class AxiosHeaders {
|
|
|
1726
1729
|
header = normalizeHeader(header);
|
|
1727
1730
|
|
|
1728
1731
|
if (header) {
|
|
1729
|
-
const key = utils.findKey(this, header);
|
|
1732
|
+
const key = utils$1.findKey(this, header);
|
|
1730
1733
|
|
|
1731
1734
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
1732
1735
|
}
|
|
@@ -1742,7 +1745,7 @@ class AxiosHeaders {
|
|
|
1742
1745
|
_header = normalizeHeader(_header);
|
|
1743
1746
|
|
|
1744
1747
|
if (_header) {
|
|
1745
|
-
const key = utils.findKey(self, _header);
|
|
1748
|
+
const key = utils$1.findKey(self, _header);
|
|
1746
1749
|
|
|
1747
1750
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
1748
1751
|
delete self[key];
|
|
@@ -1752,7 +1755,7 @@ class AxiosHeaders {
|
|
|
1752
1755
|
}
|
|
1753
1756
|
}
|
|
1754
1757
|
|
|
1755
|
-
if (utils.isArray(header)) {
|
|
1758
|
+
if (utils$1.isArray(header)) {
|
|
1756
1759
|
header.forEach(deleteHeader);
|
|
1757
1760
|
} else {
|
|
1758
1761
|
deleteHeader(header);
|
|
@@ -1781,8 +1784,8 @@ class AxiosHeaders {
|
|
|
1781
1784
|
const self = this;
|
|
1782
1785
|
const headers = {};
|
|
1783
1786
|
|
|
1784
|
-
utils.forEach(this, (value, header) => {
|
|
1785
|
-
const key = utils.findKey(headers, header);
|
|
1787
|
+
utils$1.forEach(this, (value, header) => {
|
|
1788
|
+
const key = utils$1.findKey(headers, header);
|
|
1786
1789
|
|
|
1787
1790
|
if (key) {
|
|
1788
1791
|
self[key] = normalizeValue(value);
|
|
@@ -1811,8 +1814,8 @@ class AxiosHeaders {
|
|
|
1811
1814
|
toJSON(asStrings) {
|
|
1812
1815
|
const obj = Object.create(null);
|
|
1813
1816
|
|
|
1814
|
-
utils.forEach(this, (value, header) => {
|
|
1815
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
1817
|
+
utils$1.forEach(this, (value, header) => {
|
|
1818
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
1816
1819
|
});
|
|
1817
1820
|
|
|
1818
1821
|
return obj;
|
|
@@ -1859,7 +1862,7 @@ class AxiosHeaders {
|
|
|
1859
1862
|
}
|
|
1860
1863
|
}
|
|
1861
1864
|
|
|
1862
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1865
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1863
1866
|
|
|
1864
1867
|
return this;
|
|
1865
1868
|
}
|
|
@@ -1868,7 +1871,7 @@ class AxiosHeaders {
|
|
|
1868
1871
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
1869
1872
|
|
|
1870
1873
|
// reserved names hotfix
|
|
1871
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
1874
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
1872
1875
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
1873
1876
|
return {
|
|
1874
1877
|
get: () => value,
|
|
@@ -1878,7 +1881,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
|
1878
1881
|
}
|
|
1879
1882
|
});
|
|
1880
1883
|
|
|
1881
|
-
utils.freezeMethods(AxiosHeaders);
|
|
1884
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
1882
1885
|
|
|
1883
1886
|
var AxiosHeaders$1 = AxiosHeaders;
|
|
1884
1887
|
|
|
@@ -1896,7 +1899,7 @@ function transformData(fns, response) {
|
|
|
1896
1899
|
const headers = AxiosHeaders$1.from(context.headers);
|
|
1897
1900
|
let data = context.data;
|
|
1898
1901
|
|
|
1899
|
-
utils.forEach(fns, function transform(fn) {
|
|
1902
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
1900
1903
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
1901
1904
|
});
|
|
1902
1905
|
|
|
@@ -1924,7 +1927,7 @@ function CanceledError(message, config, request) {
|
|
|
1924
1927
|
this.name = 'CanceledError';
|
|
1925
1928
|
}
|
|
1926
1929
|
|
|
1927
|
-
utils.inherits(CanceledError, AxiosError, {
|
|
1930
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
|
1928
1931
|
__CANCEL__: true
|
|
1929
1932
|
});
|
|
1930
1933
|
|
|
@@ -1952,7 +1955,7 @@ function settle(resolve, reject, response) {
|
|
|
1952
1955
|
}
|
|
1953
1956
|
}
|
|
1954
1957
|
|
|
1955
|
-
var cookies = platform.
|
|
1958
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
|
1956
1959
|
|
|
1957
1960
|
// Standard browser envs support document.cookie
|
|
1958
1961
|
(function standardBrowserEnv() {
|
|
@@ -1961,15 +1964,15 @@ var cookies = platform.isStandardBrowserEnv ?
|
|
|
1961
1964
|
const cookie = [];
|
|
1962
1965
|
cookie.push(name + '=' + encodeURIComponent(value));
|
|
1963
1966
|
|
|
1964
|
-
if (utils.isNumber(expires)) {
|
|
1967
|
+
if (utils$1.isNumber(expires)) {
|
|
1965
1968
|
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
1966
1969
|
}
|
|
1967
1970
|
|
|
1968
|
-
if (utils.isString(path)) {
|
|
1971
|
+
if (utils$1.isString(path)) {
|
|
1969
1972
|
cookie.push('path=' + path);
|
|
1970
1973
|
}
|
|
1971
1974
|
|
|
1972
|
-
if (utils.isString(domain)) {
|
|
1975
|
+
if (utils$1.isString(domain)) {
|
|
1973
1976
|
cookie.push('domain=' + domain);
|
|
1974
1977
|
}
|
|
1975
1978
|
|
|
@@ -2045,7 +2048,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
|
2045
2048
|
return requestedURL;
|
|
2046
2049
|
}
|
|
2047
2050
|
|
|
2048
|
-
var isURLSameOrigin = platform.
|
|
2051
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
2049
2052
|
|
|
2050
2053
|
// Standard browser envs have full support of the APIs needed to test
|
|
2051
2054
|
// whether the request URL is of the same origin as current location.
|
|
@@ -2095,7 +2098,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
|
2095
2098
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
2096
2099
|
*/
|
|
2097
2100
|
return function isURLSameOrigin(requestURL) {
|
|
2098
|
-
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
2101
|
+
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
2099
2102
|
return (parsed.protocol === originURL.protocol &&
|
|
2100
2103
|
parsed.host === originURL.host);
|
|
2101
2104
|
};
|
|
@@ -2214,14 +2217,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2214
2217
|
|
|
2215
2218
|
let contentType;
|
|
2216
2219
|
|
|
2217
|
-
if (utils.isFormData(requestData)) {
|
|
2218
|
-
if (platform.
|
|
2220
|
+
if (utils$1.isFormData(requestData)) {
|
|
2221
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2219
2222
|
requestHeaders.setContentType(false); // Let the browser set it
|
|
2220
|
-
} else if(
|
|
2221
|
-
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
|
2222
|
-
} else if(utils.isString(contentType = requestHeaders.getContentType())){
|
|
2223
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
2223
2224
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
2224
|
-
|
|
2225
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
2226
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
2225
2227
|
}
|
|
2226
2228
|
}
|
|
2227
2229
|
|
|
@@ -2337,10 +2339,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2337
2339
|
// Add xsrf header
|
|
2338
2340
|
// This is only done if running in a standard browser environment.
|
|
2339
2341
|
// Specifically not if we're in a web worker, or react-native.
|
|
2340
|
-
if (platform.
|
|
2342
|
+
if (platform.hasStandardBrowserEnv) {
|
|
2341
2343
|
// Add xsrf header
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
+
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
|
|
2345
|
+
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
2344
2346
|
|
|
2345
2347
|
if (xsrfValue) {
|
|
2346
2348
|
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
@@ -2352,13 +2354,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2352
2354
|
|
|
2353
2355
|
// Add headers to the request
|
|
2354
2356
|
if ('setRequestHeader' in request) {
|
|
2355
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
2357
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
2356
2358
|
request.setRequestHeader(key, val);
|
|
2357
2359
|
});
|
|
2358
2360
|
}
|
|
2359
2361
|
|
|
2360
2362
|
// Add withCredentials to request if needed
|
|
2361
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
|
2363
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
|
2362
2364
|
request.withCredentials = !!config.withCredentials;
|
|
2363
2365
|
}
|
|
2364
2366
|
|
|
@@ -2413,7 +2415,7 @@ const knownAdapters = {
|
|
|
2413
2415
|
xhr: xhrAdapter
|
|
2414
2416
|
};
|
|
2415
2417
|
|
|
2416
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
|
2418
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
2417
2419
|
if (fn) {
|
|
2418
2420
|
try {
|
|
2419
2421
|
Object.defineProperty(fn, 'name', {value});
|
|
@@ -2426,11 +2428,11 @@ utils.forEach(knownAdapters, (fn, value) => {
|
|
|
2426
2428
|
|
|
2427
2429
|
const renderReason = (reason) => `- ${reason}`;
|
|
2428
2430
|
|
|
2429
|
-
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
|
2431
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
2430
2432
|
|
|
2431
2433
|
var adapters = {
|
|
2432
2434
|
getAdapter: (adapters) => {
|
|
2433
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
|
2435
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
2434
2436
|
|
|
2435
2437
|
const {length} = adapters;
|
|
2436
2438
|
let nameOrAdapter;
|
|
@@ -2571,11 +2573,11 @@ function mergeConfig(config1, config2) {
|
|
|
2571
2573
|
const config = {};
|
|
2572
2574
|
|
|
2573
2575
|
function getMergedValue(target, source, caseless) {
|
|
2574
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
2575
|
-
return utils.merge.call({caseless}, target, source);
|
|
2576
|
-
} else if (utils.isPlainObject(source)) {
|
|
2577
|
-
return utils.merge({}, source);
|
|
2578
|
-
} else if (utils.isArray(source)) {
|
|
2576
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2577
|
+
return utils$1.merge.call({caseless}, target, source);
|
|
2578
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2579
|
+
return utils$1.merge({}, source);
|
|
2580
|
+
} else if (utils$1.isArray(source)) {
|
|
2579
2581
|
return source.slice();
|
|
2580
2582
|
}
|
|
2581
2583
|
return source;
|
|
@@ -2583,25 +2585,25 @@ function mergeConfig(config1, config2) {
|
|
|
2583
2585
|
|
|
2584
2586
|
// eslint-disable-next-line consistent-return
|
|
2585
2587
|
function mergeDeepProperties(a, b, caseless) {
|
|
2586
|
-
if (!utils.isUndefined(b)) {
|
|
2588
|
+
if (!utils$1.isUndefined(b)) {
|
|
2587
2589
|
return getMergedValue(a, b, caseless);
|
|
2588
|
-
} else if (!utils.isUndefined(a)) {
|
|
2590
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2589
2591
|
return getMergedValue(undefined, a, caseless);
|
|
2590
2592
|
}
|
|
2591
2593
|
}
|
|
2592
2594
|
|
|
2593
2595
|
// eslint-disable-next-line consistent-return
|
|
2594
2596
|
function valueFromConfig2(a, b) {
|
|
2595
|
-
if (!utils.isUndefined(b)) {
|
|
2597
|
+
if (!utils$1.isUndefined(b)) {
|
|
2596
2598
|
return getMergedValue(undefined, b);
|
|
2597
2599
|
}
|
|
2598
2600
|
}
|
|
2599
2601
|
|
|
2600
2602
|
// eslint-disable-next-line consistent-return
|
|
2601
2603
|
function defaultToConfig2(a, b) {
|
|
2602
|
-
if (!utils.isUndefined(b)) {
|
|
2604
|
+
if (!utils$1.isUndefined(b)) {
|
|
2603
2605
|
return getMergedValue(undefined, b);
|
|
2604
|
-
} else if (!utils.isUndefined(a)) {
|
|
2606
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2605
2607
|
return getMergedValue(undefined, a);
|
|
2606
2608
|
}
|
|
2607
2609
|
}
|
|
@@ -2646,16 +2648,16 @@ function mergeConfig(config1, config2) {
|
|
|
2646
2648
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
2647
2649
|
};
|
|
2648
2650
|
|
|
2649
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
2651
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
2650
2652
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
2651
2653
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2652
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2654
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2653
2655
|
});
|
|
2654
2656
|
|
|
2655
2657
|
return config;
|
|
2656
2658
|
}
|
|
2657
2659
|
|
|
2658
|
-
const VERSION = "1.
|
|
2660
|
+
const VERSION = "1.6.1";
|
|
2659
2661
|
|
|
2660
2662
|
const validators$1 = {};
|
|
2661
2663
|
|
|
@@ -2793,7 +2795,7 @@ class Axios {
|
|
|
2793
2795
|
}
|
|
2794
2796
|
|
|
2795
2797
|
if (paramsSerializer != null) {
|
|
2796
|
-
if (utils.isFunction(paramsSerializer)) {
|
|
2798
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
2797
2799
|
config.paramsSerializer = {
|
|
2798
2800
|
serialize: paramsSerializer
|
|
2799
2801
|
};
|
|
@@ -2809,12 +2811,12 @@ class Axios {
|
|
|
2809
2811
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
2810
2812
|
|
|
2811
2813
|
// Flatten headers
|
|
2812
|
-
let contextHeaders = headers && utils.merge(
|
|
2814
|
+
let contextHeaders = headers && utils$1.merge(
|
|
2813
2815
|
headers.common,
|
|
2814
2816
|
headers[config.method]
|
|
2815
2817
|
);
|
|
2816
2818
|
|
|
2817
|
-
headers && utils.forEach(
|
|
2819
|
+
headers && utils$1.forEach(
|
|
2818
2820
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
2819
2821
|
(method) => {
|
|
2820
2822
|
delete headers[method];
|
|
@@ -2901,7 +2903,7 @@ class Axios {
|
|
|
2901
2903
|
}
|
|
2902
2904
|
|
|
2903
2905
|
// Provide aliases for supported request methods
|
|
2904
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
2906
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
2905
2907
|
/*eslint func-names:0*/
|
|
2906
2908
|
Axios.prototype[method] = function(url, config) {
|
|
2907
2909
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -2912,7 +2914,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
|
2912
2914
|
};
|
|
2913
2915
|
});
|
|
2914
2916
|
|
|
2915
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
2917
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
2916
2918
|
/*eslint func-names:0*/
|
|
2917
2919
|
|
|
2918
2920
|
function generateHTTPMethod(isForm) {
|
|
@@ -3088,7 +3090,7 @@ function spread(callback) {
|
|
|
3088
3090
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
3089
3091
|
*/
|
|
3090
3092
|
function isAxiosError(payload) {
|
|
3091
|
-
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
3093
|
+
return utils$1.isObject(payload) && (payload.isAxiosError === true);
|
|
3092
3094
|
}
|
|
3093
3095
|
|
|
3094
3096
|
const HttpStatusCode = {
|
|
@@ -3175,10 +3177,10 @@ function createInstance(defaultConfig) {
|
|
|
3175
3177
|
const instance = bind(Axios$1.prototype.request, context);
|
|
3176
3178
|
|
|
3177
3179
|
// Copy axios.prototype to instance
|
|
3178
|
-
utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
3180
|
+
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
3179
3181
|
|
|
3180
3182
|
// Copy context to instance
|
|
3181
|
-
utils.extend(instance, context, null, {allOwnKeys: true});
|
|
3183
|
+
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
3182
3184
|
|
|
3183
3185
|
// Factory for creating new instances
|
|
3184
3186
|
instance.create = function create(instanceConfig) {
|
|
@@ -3222,7 +3224,7 @@ axios.mergeConfig = mergeConfig;
|
|
|
3222
3224
|
|
|
3223
3225
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
3224
3226
|
|
|
3225
|
-
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3227
|
+
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3226
3228
|
|
|
3227
3229
|
axios.getAdapter = adapters.getAdapter;
|
|
3228
3230
|
|
|
@@ -3234,7 +3236,7 @@ axios.default = axios;
|
|
|
3234
3236
|
var axios$1 = axios;
|
|
3235
3237
|
|
|
3236
3238
|
var name$1 = "@tryghost/content-api";
|
|
3237
|
-
var version = "1.11.
|
|
3239
|
+
var version = "1.11.20";
|
|
3238
3240
|
var repository = "https://github.com/TryGhost/SDK/tree/main/packages/content-api";
|
|
3239
3241
|
var author = "Ghost Foundation";
|
|
3240
3242
|
var license = "MIT";
|
|
@@ -3263,13 +3265,13 @@ var publishConfig = {
|
|
|
3263
3265
|
access: "public"
|
|
3264
3266
|
};
|
|
3265
3267
|
var devDependencies = {
|
|
3266
|
-
"@babel/core": "7.23.
|
|
3268
|
+
"@babel/core": "7.23.3",
|
|
3267
3269
|
"@babel/polyfill": "7.12.1",
|
|
3268
|
-
"@babel/preset-env": "7.23.
|
|
3270
|
+
"@babel/preset-env": "7.23.3",
|
|
3269
3271
|
"@rollup/plugin-json": "6.0.1",
|
|
3270
|
-
c8: "
|
|
3271
|
-
"core-js": "3.33.
|
|
3272
|
-
"eslint-plugin-ghost": "
|
|
3272
|
+
c8: "8.0.1",
|
|
3273
|
+
"core-js": "3.33.2",
|
|
3274
|
+
"eslint-plugin-ghost": "3.4.0",
|
|
3273
3275
|
mocha: "10.2.0",
|
|
3274
3276
|
rollup: "2.79.1",
|
|
3275
3277
|
"rollup-plugin-babel": "4.4.0",
|
|
@@ -3279,12 +3281,12 @@ var devDependencies = {
|
|
|
3279
3281
|
"rollup-plugin-replace": "2.2.0",
|
|
3280
3282
|
"rollup-plugin-terser": "7.0.2",
|
|
3281
3283
|
should: "13.2.3",
|
|
3282
|
-
sinon: "
|
|
3284
|
+
sinon: "17.0.1"
|
|
3283
3285
|
};
|
|
3284
3286
|
var dependencies = {
|
|
3285
3287
|
axios: "^1.0.0"
|
|
3286
3288
|
};
|
|
3287
|
-
var gitHead = "
|
|
3289
|
+
var gitHead = "4839d3f97de2120d98fa47677eed7591dfa20e64";
|
|
3288
3290
|
var packageInfo = {
|
|
3289
3291
|
name: name$1,
|
|
3290
3292
|
version: version,
|