@tryghost/content-api 1.9.1 → 1.9.2
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 +12 -12
- package/es/content-api.js +506 -155
- package/es/content-api.js.map +1 -1
- package/lib/{index.js → content-api.js} +0 -0
- package/package.json +12 -12
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/es/content-api.js
CHANGED
|
@@ -19,6 +19,10 @@ function createCommonjsModule(fn, module) {
|
|
|
19
19
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function getCjsExportFromNamespace (n) {
|
|
23
|
+
return n && n['default'] || n;
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
var check = function (it) {
|
|
23
27
|
return it && it.Math == Math && it;
|
|
24
28
|
};
|
|
@@ -163,26 +167,26 @@ var process$4 = global_1.process;
|
|
|
163
167
|
var Deno$1 = global_1.Deno;
|
|
164
168
|
var versions = process$4 && process$4.versions || Deno$1 && Deno$1.version;
|
|
165
169
|
var v8 = versions && versions.v8;
|
|
166
|
-
var match, version$
|
|
170
|
+
var match, version$2;
|
|
167
171
|
|
|
168
172
|
if (v8) {
|
|
169
173
|
match = v8.split('.');
|
|
170
174
|
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
171
175
|
// but their correct versions are not interesting for us
|
|
172
|
-
version$
|
|
176
|
+
version$2 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
176
180
|
// so check `userAgent` even if `.v8` exists, but 0
|
|
177
|
-
if (!version$
|
|
181
|
+
if (!version$2 && engineUserAgent) {
|
|
178
182
|
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
179
183
|
if (!match || match[1] >= 74) {
|
|
180
184
|
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
181
|
-
if (match) version$
|
|
185
|
+
if (match) version$2 = +match[1];
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
|
|
185
|
-
var engineV8Version = version$
|
|
189
|
+
var engineV8Version = version$2;
|
|
186
190
|
|
|
187
191
|
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
188
192
|
|
|
@@ -271,10 +275,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
271
275
|
(module.exports = function (key, value) {
|
|
272
276
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
273
277
|
})('versions', []).push({
|
|
274
|
-
version: '3.22.
|
|
278
|
+
version: '3.22.4',
|
|
275
279
|
mode: 'global',
|
|
276
280
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
277
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.22.
|
|
281
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
|
|
278
282
|
source: 'https://github.com/zloirock/core-js'
|
|
279
283
|
});
|
|
280
284
|
});
|
|
@@ -450,6 +454,21 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
450
454
|
return object;
|
|
451
455
|
};
|
|
452
456
|
|
|
457
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
458
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
459
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
460
|
+
|
|
461
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype$2, 'name');
|
|
462
|
+
// additional protection from minified / mangled / dropped function names
|
|
463
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
464
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$2, 'name').configurable));
|
|
465
|
+
|
|
466
|
+
var functionName = {
|
|
467
|
+
EXISTS: EXISTS,
|
|
468
|
+
PROPER: PROPER,
|
|
469
|
+
CONFIGURABLE: CONFIGURABLE
|
|
470
|
+
};
|
|
471
|
+
|
|
453
472
|
var functionToString$1 = functionUncurryThis(Function.toString);
|
|
454
473
|
|
|
455
474
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
@@ -533,50 +552,56 @@ var internalState = {
|
|
|
533
552
|
getterFor: getterFor
|
|
534
553
|
};
|
|
535
554
|
|
|
536
|
-
var
|
|
537
|
-
|
|
538
|
-
var
|
|
539
|
-
|
|
540
|
-
var EXISTS = hasOwnProperty_1(FunctionPrototype$2, 'name');
|
|
541
|
-
// additional protection from minified / mangled / dropped function names
|
|
542
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
543
|
-
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$2, 'name').configurable));
|
|
555
|
+
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
556
|
+
var defineProperty = objectDefineProperty.f;
|
|
557
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
544
558
|
|
|
545
|
-
var functionName = {
|
|
546
|
-
EXISTS: EXISTS,
|
|
547
|
-
PROPER: PROPER,
|
|
548
|
-
CONFIGURABLE: CONFIGURABLE
|
|
549
|
-
};
|
|
550
559
|
|
|
551
|
-
var redefine = createCommonjsModule(function (module) {
|
|
552
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
553
560
|
|
|
554
|
-
var getInternalState = internalState.get;
|
|
555
561
|
var enforceInternalState = internalState.enforce;
|
|
562
|
+
var getInternalState = internalState.get;
|
|
563
|
+
|
|
564
|
+
var CONFIGURABLE_LENGTH = !fails(function () {
|
|
565
|
+
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
566
|
+
});
|
|
567
|
+
|
|
556
568
|
var TEMPLATE = String(String).split('String');
|
|
557
569
|
|
|
558
|
-
|
|
570
|
+
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
571
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
572
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
573
|
+
}
|
|
574
|
+
if (options && options.getter) name = 'get ' + name;
|
|
575
|
+
if (options && options.setter) name = 'set ' + name;
|
|
576
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
577
|
+
defineProperty(value, 'name', { value: name, configurable: true });
|
|
578
|
+
}
|
|
579
|
+
if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
|
|
580
|
+
defineProperty(value, 'length', { value: options.arity });
|
|
581
|
+
}
|
|
582
|
+
var state = enforceInternalState(value);
|
|
583
|
+
if (!hasOwnProperty_1(state, 'source')) {
|
|
584
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
585
|
+
} return value;
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
589
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
590
|
+
Function.prototype.toString = makeBuiltIn(function toString() {
|
|
591
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
592
|
+
}, 'toString');
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
var defineBuiltIn = function (O, key, value, options) {
|
|
559
596
|
var unsafe = options ? !!options.unsafe : false;
|
|
560
597
|
var simple = options ? !!options.enumerable : false;
|
|
561
598
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
562
599
|
var name = options && options.name !== undefined ? options.name : key;
|
|
563
|
-
|
|
564
|
-
if (isCallable(value)) {
|
|
565
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
566
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
567
|
-
}
|
|
568
|
-
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
569
|
-
createNonEnumerableProperty(value, 'name', name);
|
|
570
|
-
}
|
|
571
|
-
state = enforceInternalState(value);
|
|
572
|
-
if (!state.source) {
|
|
573
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
574
|
-
}
|
|
575
|
-
}
|
|
600
|
+
if (isCallable(value)) makeBuiltIn_1(value, name, options);
|
|
576
601
|
if (O === global_1) {
|
|
577
602
|
if (simple) O[key] = value;
|
|
578
603
|
else setGlobal(key, value);
|
|
579
|
-
return;
|
|
604
|
+
return O;
|
|
580
605
|
} else if (!unsafe) {
|
|
581
606
|
delete O[key];
|
|
582
607
|
} else if (!noTargetGet && O[key]) {
|
|
@@ -584,11 +609,8 @@ var TEMPLATE = String(String).split('String');
|
|
|
584
609
|
}
|
|
585
610
|
if (simple) O[key] = value;
|
|
586
611
|
else createNonEnumerableProperty(O, key, value);
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
590
|
-
});
|
|
591
|
-
});
|
|
612
|
+
return O;
|
|
613
|
+
};
|
|
592
614
|
|
|
593
615
|
var ceil = Math.ceil;
|
|
594
616
|
var floor = Math.floor;
|
|
@@ -795,8 +817,7 @@ var _export = function (options, source) {
|
|
|
795
817
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
796
818
|
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
797
819
|
}
|
|
798
|
-
|
|
799
|
-
redefine(target, key, sourceProperty, options);
|
|
820
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
800
821
|
}
|
|
801
822
|
};
|
|
802
823
|
|
|
@@ -844,6 +865,7 @@ var toString_1 = function (argument) {
|
|
|
844
865
|
var regexpFlags = function () {
|
|
845
866
|
var that = anObject(this);
|
|
846
867
|
var result = '';
|
|
868
|
+
if (that.hasIndices) result += 'd';
|
|
847
869
|
if (that.global) result += 'g';
|
|
848
870
|
if (that.ignoreCase) result += 'i';
|
|
849
871
|
if (that.multiline) result += 'm';
|
|
@@ -1199,8 +1221,8 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
1199
1221
|
return { done: false };
|
|
1200
1222
|
});
|
|
1201
1223
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1224
|
+
defineBuiltIn(String.prototype, KEY, methods[0]);
|
|
1225
|
+
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
|
|
1204
1226
|
}
|
|
1205
1227
|
|
|
1206
1228
|
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
@@ -1328,7 +1350,7 @@ var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
|
1328
1350
|
// `Object.prototype.toString` method
|
|
1329
1351
|
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1330
1352
|
if (!toStringTagSupport) {
|
|
1331
|
-
|
|
1353
|
+
defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1332
1354
|
}
|
|
1333
1355
|
|
|
1334
1356
|
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
|
@@ -1467,7 +1489,7 @@ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
|
1467
1489
|
// `Array.prototype.concat` method
|
|
1468
1490
|
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
1469
1491
|
// with adding support of @@isConcatSpreadable and @@species
|
|
1470
|
-
_export({ target: 'Array', proto: true, forced: FORCED }, {
|
|
1492
|
+
_export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
|
1471
1493
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1472
1494
|
concat: function concat(arg) {
|
|
1473
1495
|
var O = toObject(this);
|
|
@@ -1510,9 +1532,15 @@ var addToUnscopables = function (key) {
|
|
|
1510
1532
|
var $includes = arrayIncludes.includes;
|
|
1511
1533
|
|
|
1512
1534
|
|
|
1535
|
+
|
|
1536
|
+
// FF99+ bug
|
|
1537
|
+
var BROKEN_ON_SPARSE = fails(function () {
|
|
1538
|
+
return !Array(1).includes();
|
|
1539
|
+
});
|
|
1540
|
+
|
|
1513
1541
|
// `Array.prototype.includes` method
|
|
1514
1542
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
1515
|
-
_export({ target: 'Array', proto: true }, {
|
|
1543
|
+
_export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
1516
1544
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
1517
1545
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
1518
1546
|
}
|
|
@@ -1624,11 +1652,6 @@ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_I
|
|
|
1624
1652
|
|
|
1625
1653
|
var engineIsNode = classofRaw(global_1.process) == 'process';
|
|
1626
1654
|
|
|
1627
|
-
var redefineAll = function (target, src, options) {
|
|
1628
|
-
for (var key in src) redefine(target, key, src[key], options);
|
|
1629
|
-
return target;
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1632
1655
|
var String$2 = global_1.String;
|
|
1633
1656
|
var TypeError$7 = global_1.TypeError;
|
|
1634
1657
|
|
|
@@ -2249,23 +2272,20 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
|
|
|
2249
2272
|
});
|
|
2250
2273
|
};
|
|
2251
2274
|
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
});
|
|
2267
|
-
return reaction.promise;
|
|
2268
|
-
}
|
|
2275
|
+
// `Promise.prototype.then` method
|
|
2276
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
2277
|
+
Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
2278
|
+
var state = getInternalPromiseState(this);
|
|
2279
|
+
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
|
2280
|
+
state.parent = true;
|
|
2281
|
+
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
|
2282
|
+
reaction.fail = isCallable(onRejected) && onRejected;
|
|
2283
|
+
reaction.domain = engineIsNode ? process$1.domain : undefined;
|
|
2284
|
+
if (state.state == PENDING) state.reactions.add(reaction);
|
|
2285
|
+
else microtask(function () {
|
|
2286
|
+
callReaction(reaction, state);
|
|
2287
|
+
});
|
|
2288
|
+
return reaction.promise;
|
|
2269
2289
|
});
|
|
2270
2290
|
|
|
2271
2291
|
OwnPromiseCapability = function () {
|
|
@@ -2287,7 +2307,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
|
|
|
2287
2307
|
|
|
2288
2308
|
if (!NATIVE_PROMISE_SUBCLASSING) {
|
|
2289
2309
|
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
2290
|
-
|
|
2310
|
+
defineBuiltIn(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
|
|
2291
2311
|
var that = this;
|
|
2292
2312
|
return new PromiseConstructor(function (resolve, reject) {
|
|
2293
2313
|
functionCall(nativeThen, that, resolve, reject);
|
|
@@ -2510,7 +2530,7 @@ _export({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2,
|
|
|
2510
2530
|
if (isCallable(promiseNativeConstructor)) {
|
|
2511
2531
|
var method = getBuiltIn('Promise').prototype['catch'];
|
|
2512
2532
|
if (NativePromisePrototype['catch'] !== method) {
|
|
2513
|
-
|
|
2533
|
+
defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
|
|
2514
2534
|
}
|
|
2515
2535
|
}
|
|
2516
2536
|
|
|
@@ -2616,7 +2636,7 @@ var objectAssign = !$assign || fails(function () {
|
|
|
2616
2636
|
// `Object.assign` method
|
|
2617
2637
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
2618
2638
|
// eslint-disable-next-line es-x/no-object-assign -- required for testing
|
|
2619
|
-
_export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
|
|
2639
|
+
_export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, {
|
|
2620
2640
|
assign: objectAssign
|
|
2621
2641
|
});
|
|
2622
2642
|
|
|
@@ -2795,8 +2815,6 @@ var bind = function bind(fn, thisArg) {
|
|
|
2795
2815
|
};
|
|
2796
2816
|
};
|
|
2797
2817
|
|
|
2798
|
-
/*global toString:true*/
|
|
2799
|
-
|
|
2800
2818
|
// utils is a library of generic helper functions non-specific to axios
|
|
2801
2819
|
|
|
2802
2820
|
var toString = Object.prototype.toString;
|
|
@@ -2980,7 +2998,7 @@ function isURLSearchParams(val) {
|
|
|
2980
2998
|
* @returns {String} The String freed of excess whitespace
|
|
2981
2999
|
*/
|
|
2982
3000
|
function trim(str) {
|
|
2983
|
-
return str.
|
|
3001
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
2984
3002
|
}
|
|
2985
3003
|
|
|
2986
3004
|
/**
|
|
@@ -3222,10 +3240,12 @@ function InterceptorManager() {
|
|
|
3222
3240
|
*
|
|
3223
3241
|
* @return {Number} An ID used to remove interceptor later
|
|
3224
3242
|
*/
|
|
3225
|
-
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
|
3243
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
3226
3244
|
this.handlers.push({
|
|
3227
3245
|
fulfilled: fulfilled,
|
|
3228
|
-
rejected: rejected
|
|
3246
|
+
rejected: rejected,
|
|
3247
|
+
synchronous: options ? options.synchronous : false,
|
|
3248
|
+
runWhen: options ? options.runWhen : null
|
|
3229
3249
|
});
|
|
3230
3250
|
return this.handlers.length - 1;
|
|
3231
3251
|
};
|
|
@@ -3259,27 +3279,6 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
3259
3279
|
|
|
3260
3280
|
var InterceptorManager_1 = InterceptorManager;
|
|
3261
3281
|
|
|
3262
|
-
/**
|
|
3263
|
-
* Transform the data for a request or a response
|
|
3264
|
-
*
|
|
3265
|
-
* @param {Object|String} data The data to be transformed
|
|
3266
|
-
* @param {Array} headers The headers for the request or response
|
|
3267
|
-
* @param {Array|Function} fns A single function or Array of functions
|
|
3268
|
-
* @returns {*} The resulting transformed data
|
|
3269
|
-
*/
|
|
3270
|
-
var transformData = function transformData(data, headers, fns) {
|
|
3271
|
-
/*eslint no-param-reassign:0*/
|
|
3272
|
-
utils.forEach(fns, function transform(fn) {
|
|
3273
|
-
data = fn(data, headers);
|
|
3274
|
-
});
|
|
3275
|
-
|
|
3276
|
-
return data;
|
|
3277
|
-
};
|
|
3278
|
-
|
|
3279
|
-
var isCancel = function isCancel(value) {
|
|
3280
|
-
return !!(value && value.__CANCEL__);
|
|
3281
|
-
};
|
|
3282
|
-
|
|
3283
3282
|
var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
|
|
3284
3283
|
utils.forEach(headers, function processHeader(value, name) {
|
|
3285
3284
|
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
@@ -3578,6 +3577,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
3578
3577
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3579
3578
|
var requestData = config.data;
|
|
3580
3579
|
var requestHeaders = config.headers;
|
|
3580
|
+
var responseType = config.responseType;
|
|
3581
3581
|
|
|
3582
3582
|
if (utils.isFormData(requestData)) {
|
|
3583
3583
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
@@ -3598,23 +3598,14 @@ var xhr = function xhrAdapter(config) {
|
|
|
3598
3598
|
// Set the request timeout in MS
|
|
3599
3599
|
request.timeout = config.timeout;
|
|
3600
3600
|
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
if (!request || request.readyState !== 4) {
|
|
3604
|
-
return;
|
|
3605
|
-
}
|
|
3606
|
-
|
|
3607
|
-
// The request errored out and we didn't get a response, this will be
|
|
3608
|
-
// handled by onerror instead
|
|
3609
|
-
// With one exception: request that using file: protocol, most browsers
|
|
3610
|
-
// will return status as 0 even though it's a successful request
|
|
3611
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
3601
|
+
function onloadend() {
|
|
3602
|
+
if (!request) {
|
|
3612
3603
|
return;
|
|
3613
3604
|
}
|
|
3614
|
-
|
|
3615
3605
|
// Prepare the response
|
|
3616
3606
|
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
3617
|
-
var responseData = !
|
|
3607
|
+
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
3608
|
+
request.responseText : request.response;
|
|
3618
3609
|
var response = {
|
|
3619
3610
|
data: responseData,
|
|
3620
3611
|
status: request.status,
|
|
@@ -3628,7 +3619,30 @@ var xhr = function xhrAdapter(config) {
|
|
|
3628
3619
|
|
|
3629
3620
|
// Clean up request
|
|
3630
3621
|
request = null;
|
|
3631
|
-
}
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
if ('onloadend' in request) {
|
|
3625
|
+
// Use onloadend if available
|
|
3626
|
+
request.onloadend = onloadend;
|
|
3627
|
+
} else {
|
|
3628
|
+
// Listen for ready state to emulate onloadend
|
|
3629
|
+
request.onreadystatechange = function handleLoad() {
|
|
3630
|
+
if (!request || request.readyState !== 4) {
|
|
3631
|
+
return;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
// The request errored out and we didn't get a response, this will be
|
|
3635
|
+
// handled by onerror instead
|
|
3636
|
+
// With one exception: request that using file: protocol, most browsers
|
|
3637
|
+
// will return status as 0 even though it's a successful request
|
|
3638
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
3639
|
+
return;
|
|
3640
|
+
}
|
|
3641
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
3642
|
+
// so we should call onloadend on the next 'tick'
|
|
3643
|
+
setTimeout(onloadend);
|
|
3644
|
+
};
|
|
3645
|
+
}
|
|
3632
3646
|
|
|
3633
3647
|
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
3634
3648
|
request.onabort = function handleAbort() {
|
|
@@ -3658,7 +3672,10 @@ var xhr = function xhrAdapter(config) {
|
|
|
3658
3672
|
if (config.timeoutErrorMessage) {
|
|
3659
3673
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
3660
3674
|
}
|
|
3661
|
-
reject(createError(
|
|
3675
|
+
reject(createError(
|
|
3676
|
+
timeoutErrorMessage,
|
|
3677
|
+
config,
|
|
3678
|
+
config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
3662
3679
|
request));
|
|
3663
3680
|
|
|
3664
3681
|
// Clean up request
|
|
@@ -3698,16 +3715,8 @@ var xhr = function xhrAdapter(config) {
|
|
|
3698
3715
|
}
|
|
3699
3716
|
|
|
3700
3717
|
// Add responseType to request if needed
|
|
3701
|
-
if (
|
|
3702
|
-
|
|
3703
|
-
request.responseType = config.responseType;
|
|
3704
|
-
} catch (e) {
|
|
3705
|
-
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
|
|
3706
|
-
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
|
|
3707
|
-
if (config.responseType !== 'json') {
|
|
3708
|
-
throw e;
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3718
|
+
if (responseType && responseType !== 'json') {
|
|
3719
|
+
request.responseType = config.responseType;
|
|
3711
3720
|
}
|
|
3712
3721
|
|
|
3713
3722
|
// Handle progress if needed
|
|
@@ -3765,12 +3774,35 @@ function getDefaultAdapter() {
|
|
|
3765
3774
|
return adapter;
|
|
3766
3775
|
}
|
|
3767
3776
|
|
|
3777
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
3778
|
+
if (utils.isString(rawValue)) {
|
|
3779
|
+
try {
|
|
3780
|
+
(parser || JSON.parse)(rawValue);
|
|
3781
|
+
return utils.trim(rawValue);
|
|
3782
|
+
} catch (e) {
|
|
3783
|
+
if (e.name !== 'SyntaxError') {
|
|
3784
|
+
throw e;
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3768
3792
|
var defaults = {
|
|
3793
|
+
|
|
3794
|
+
transitional: {
|
|
3795
|
+
silentJSONParsing: true,
|
|
3796
|
+
forcedJSONParsing: true,
|
|
3797
|
+
clarifyTimeoutError: false
|
|
3798
|
+
},
|
|
3799
|
+
|
|
3769
3800
|
adapter: getDefaultAdapter(),
|
|
3770
3801
|
|
|
3771
3802
|
transformRequest: [function transformRequest(data, headers) {
|
|
3772
3803
|
normalizeHeaderName(headers, 'Accept');
|
|
3773
3804
|
normalizeHeaderName(headers, 'Content-Type');
|
|
3805
|
+
|
|
3774
3806
|
if (utils.isFormData(data) ||
|
|
3775
3807
|
utils.isArrayBuffer(data) ||
|
|
3776
3808
|
utils.isBuffer(data) ||
|
|
@@ -3787,20 +3819,32 @@ var defaults = {
|
|
|
3787
3819
|
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
3788
3820
|
return data.toString();
|
|
3789
3821
|
}
|
|
3790
|
-
if (utils.isObject(data)) {
|
|
3791
|
-
setContentTypeIfUnset(headers, 'application/json
|
|
3792
|
-
return
|
|
3822
|
+
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
|
3823
|
+
setContentTypeIfUnset(headers, 'application/json');
|
|
3824
|
+
return stringifySafely(data);
|
|
3793
3825
|
}
|
|
3794
3826
|
return data;
|
|
3795
3827
|
}],
|
|
3796
3828
|
|
|
3797
3829
|
transformResponse: [function transformResponse(data) {
|
|
3798
|
-
|
|
3799
|
-
|
|
3830
|
+
var transitional = this.transitional;
|
|
3831
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
3832
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
3833
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
3834
|
+
|
|
3835
|
+
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
|
3800
3836
|
try {
|
|
3801
|
-
|
|
3802
|
-
} catch (e) {
|
|
3837
|
+
return JSON.parse(data);
|
|
3838
|
+
} catch (e) {
|
|
3839
|
+
if (strictJSONParsing) {
|
|
3840
|
+
if (e.name === 'SyntaxError') {
|
|
3841
|
+
throw enhanceError(e, this, 'E_JSON_PARSE');
|
|
3842
|
+
}
|
|
3843
|
+
throw e;
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3803
3846
|
}
|
|
3847
|
+
|
|
3804
3848
|
return data;
|
|
3805
3849
|
}],
|
|
3806
3850
|
|
|
@@ -3837,6 +3881,28 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
3837
3881
|
|
|
3838
3882
|
var defaults_1 = defaults;
|
|
3839
3883
|
|
|
3884
|
+
/**
|
|
3885
|
+
* Transform the data for a request or a response
|
|
3886
|
+
*
|
|
3887
|
+
* @param {Object|String} data The data to be transformed
|
|
3888
|
+
* @param {Array} headers The headers for the request or response
|
|
3889
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
3890
|
+
* @returns {*} The resulting transformed data
|
|
3891
|
+
*/
|
|
3892
|
+
var transformData = function transformData(data, headers, fns) {
|
|
3893
|
+
var context = this || defaults_1;
|
|
3894
|
+
/*eslint no-param-reassign:0*/
|
|
3895
|
+
utils.forEach(fns, function transform(fn) {
|
|
3896
|
+
data = fn.call(context, data, headers);
|
|
3897
|
+
});
|
|
3898
|
+
|
|
3899
|
+
return data;
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3902
|
+
var isCancel = function isCancel(value) {
|
|
3903
|
+
return !!(value && value.__CANCEL__);
|
|
3904
|
+
};
|
|
3905
|
+
|
|
3840
3906
|
/**
|
|
3841
3907
|
* Throws a `Cancel` if cancellation has been requested.
|
|
3842
3908
|
*/
|
|
@@ -3859,7 +3925,8 @@ var dispatchRequest = function dispatchRequest(config) {
|
|
|
3859
3925
|
config.headers = config.headers || {};
|
|
3860
3926
|
|
|
3861
3927
|
// Transform request data
|
|
3862
|
-
config.data = transformData(
|
|
3928
|
+
config.data = transformData.call(
|
|
3929
|
+
config,
|
|
3863
3930
|
config.data,
|
|
3864
3931
|
config.headers,
|
|
3865
3932
|
config.transformRequest
|
|
@@ -3885,7 +3952,8 @@ var dispatchRequest = function dispatchRequest(config) {
|
|
|
3885
3952
|
throwIfCancellationRequested(config);
|
|
3886
3953
|
|
|
3887
3954
|
// Transform response data
|
|
3888
|
-
response.data = transformData(
|
|
3955
|
+
response.data = transformData.call(
|
|
3956
|
+
config,
|
|
3889
3957
|
response.data,
|
|
3890
3958
|
response.headers,
|
|
3891
3959
|
config.transformResponse
|
|
@@ -3898,7 +3966,8 @@ var dispatchRequest = function dispatchRequest(config) {
|
|
|
3898
3966
|
|
|
3899
3967
|
// Transform response data
|
|
3900
3968
|
if (reason && reason.response) {
|
|
3901
|
-
reason.response.data = transformData(
|
|
3969
|
+
reason.response.data = transformData.call(
|
|
3970
|
+
config,
|
|
3902
3971
|
reason.response.data,
|
|
3903
3972
|
reason.response.headers,
|
|
3904
3973
|
config.transformResponse
|
|
@@ -3994,6 +4063,237 @@ var mergeConfig = function mergeConfig(config1, config2) {
|
|
|
3994
4063
|
return config;
|
|
3995
4064
|
};
|
|
3996
4065
|
|
|
4066
|
+
var name$2 = "axios";
|
|
4067
|
+
var version$1 = "0.21.4";
|
|
4068
|
+
var description = "Promise based HTTP client for the browser and node.js";
|
|
4069
|
+
var main$1 = "index.js";
|
|
4070
|
+
var scripts$1 = {
|
|
4071
|
+
test: "grunt test",
|
|
4072
|
+
start: "node ./sandbox/server.js",
|
|
4073
|
+
build: "NODE_ENV=production grunt build",
|
|
4074
|
+
preversion: "npm test",
|
|
4075
|
+
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
4076
|
+
postversion: "git push && git push --tags",
|
|
4077
|
+
examples: "node ./examples/server.js",
|
|
4078
|
+
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
4079
|
+
fix: "eslint --fix lib/**/*.js"
|
|
4080
|
+
};
|
|
4081
|
+
var repository$1 = {
|
|
4082
|
+
type: "git",
|
|
4083
|
+
url: "https://github.com/axios/axios.git"
|
|
4084
|
+
};
|
|
4085
|
+
var keywords = [
|
|
4086
|
+
"xhr",
|
|
4087
|
+
"http",
|
|
4088
|
+
"ajax",
|
|
4089
|
+
"promise",
|
|
4090
|
+
"node"
|
|
4091
|
+
];
|
|
4092
|
+
var author$1 = "Matt Zabriskie";
|
|
4093
|
+
var license$1 = "MIT";
|
|
4094
|
+
var bugs = {
|
|
4095
|
+
url: "https://github.com/axios/axios/issues"
|
|
4096
|
+
};
|
|
4097
|
+
var homepage = "https://axios-http.com";
|
|
4098
|
+
var devDependencies$1 = {
|
|
4099
|
+
coveralls: "^3.0.0",
|
|
4100
|
+
"es6-promise": "^4.2.4",
|
|
4101
|
+
grunt: "^1.3.0",
|
|
4102
|
+
"grunt-banner": "^0.6.0",
|
|
4103
|
+
"grunt-cli": "^1.2.0",
|
|
4104
|
+
"grunt-contrib-clean": "^1.1.0",
|
|
4105
|
+
"grunt-contrib-watch": "^1.0.0",
|
|
4106
|
+
"grunt-eslint": "^23.0.0",
|
|
4107
|
+
"grunt-karma": "^4.0.0",
|
|
4108
|
+
"grunt-mocha-test": "^0.13.3",
|
|
4109
|
+
"grunt-ts": "^6.0.0-beta.19",
|
|
4110
|
+
"grunt-webpack": "^4.0.2",
|
|
4111
|
+
"istanbul-instrumenter-loader": "^1.0.0",
|
|
4112
|
+
"jasmine-core": "^2.4.1",
|
|
4113
|
+
karma: "^6.3.2",
|
|
4114
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
4115
|
+
"karma-firefox-launcher": "^2.1.0",
|
|
4116
|
+
"karma-jasmine": "^1.1.1",
|
|
4117
|
+
"karma-jasmine-ajax": "^0.1.13",
|
|
4118
|
+
"karma-safari-launcher": "^1.0.0",
|
|
4119
|
+
"karma-sauce-launcher": "^4.3.6",
|
|
4120
|
+
"karma-sinon": "^1.0.5",
|
|
4121
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
4122
|
+
"karma-webpack": "^4.0.2",
|
|
4123
|
+
"load-grunt-tasks": "^3.5.2",
|
|
4124
|
+
minimist: "^1.2.0",
|
|
4125
|
+
mocha: "^8.2.1",
|
|
4126
|
+
sinon: "^4.5.0",
|
|
4127
|
+
"terser-webpack-plugin": "^4.2.3",
|
|
4128
|
+
typescript: "^4.0.5",
|
|
4129
|
+
"url-search-params": "^0.10.0",
|
|
4130
|
+
webpack: "^4.44.2",
|
|
4131
|
+
"webpack-dev-server": "^3.11.0"
|
|
4132
|
+
};
|
|
4133
|
+
var browser = {
|
|
4134
|
+
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
4135
|
+
};
|
|
4136
|
+
var jsdelivr = "dist/axios.min.js";
|
|
4137
|
+
var unpkg$1 = "dist/axios.min.js";
|
|
4138
|
+
var typings = "./index.d.ts";
|
|
4139
|
+
var dependencies$1 = {
|
|
4140
|
+
"follow-redirects": "^1.14.0"
|
|
4141
|
+
};
|
|
4142
|
+
var bundlesize = [
|
|
4143
|
+
{
|
|
4144
|
+
path: "./dist/axios.min.js",
|
|
4145
|
+
threshold: "5kB"
|
|
4146
|
+
}
|
|
4147
|
+
];
|
|
4148
|
+
var _package = {
|
|
4149
|
+
name: name$2,
|
|
4150
|
+
version: version$1,
|
|
4151
|
+
description: description,
|
|
4152
|
+
main: main$1,
|
|
4153
|
+
scripts: scripts$1,
|
|
4154
|
+
repository: repository$1,
|
|
4155
|
+
keywords: keywords,
|
|
4156
|
+
author: author$1,
|
|
4157
|
+
license: license$1,
|
|
4158
|
+
bugs: bugs,
|
|
4159
|
+
homepage: homepage,
|
|
4160
|
+
devDependencies: devDependencies$1,
|
|
4161
|
+
browser: browser,
|
|
4162
|
+
jsdelivr: jsdelivr,
|
|
4163
|
+
unpkg: unpkg$1,
|
|
4164
|
+
typings: typings,
|
|
4165
|
+
dependencies: dependencies$1,
|
|
4166
|
+
bundlesize: bundlesize
|
|
4167
|
+
};
|
|
4168
|
+
|
|
4169
|
+
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
4170
|
+
__proto__: null,
|
|
4171
|
+
name: name$2,
|
|
4172
|
+
version: version$1,
|
|
4173
|
+
description: description,
|
|
4174
|
+
main: main$1,
|
|
4175
|
+
scripts: scripts$1,
|
|
4176
|
+
repository: repository$1,
|
|
4177
|
+
keywords: keywords,
|
|
4178
|
+
author: author$1,
|
|
4179
|
+
license: license$1,
|
|
4180
|
+
bugs: bugs,
|
|
4181
|
+
homepage: homepage,
|
|
4182
|
+
devDependencies: devDependencies$1,
|
|
4183
|
+
browser: browser,
|
|
4184
|
+
jsdelivr: jsdelivr,
|
|
4185
|
+
unpkg: unpkg$1,
|
|
4186
|
+
typings: typings,
|
|
4187
|
+
dependencies: dependencies$1,
|
|
4188
|
+
bundlesize: bundlesize,
|
|
4189
|
+
'default': _package
|
|
4190
|
+
});
|
|
4191
|
+
|
|
4192
|
+
var pkg = getCjsExportFromNamespace(_package$1);
|
|
4193
|
+
|
|
4194
|
+
var validators$1 = {};
|
|
4195
|
+
|
|
4196
|
+
// eslint-disable-next-line func-names
|
|
4197
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
|
|
4198
|
+
validators$1[type] = function validator(thing) {
|
|
4199
|
+
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
4200
|
+
};
|
|
4201
|
+
});
|
|
4202
|
+
|
|
4203
|
+
var deprecatedWarnings = {};
|
|
4204
|
+
var currentVerArr = pkg.version.split('.');
|
|
4205
|
+
|
|
4206
|
+
/**
|
|
4207
|
+
* Compare package versions
|
|
4208
|
+
* @param {string} version
|
|
4209
|
+
* @param {string?} thanVersion
|
|
4210
|
+
* @returns {boolean}
|
|
4211
|
+
*/
|
|
4212
|
+
function isOlderVersion(version, thanVersion) {
|
|
4213
|
+
var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;
|
|
4214
|
+
var destVer = version.split('.');
|
|
4215
|
+
for (var i = 0; i < 3; i++) {
|
|
4216
|
+
if (pkgVersionArr[i] > destVer[i]) {
|
|
4217
|
+
return true;
|
|
4218
|
+
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
4219
|
+
return false;
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
return false;
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4225
|
+
/**
|
|
4226
|
+
* Transitional option validator
|
|
4227
|
+
* @param {function|boolean?} validator
|
|
4228
|
+
* @param {string?} version
|
|
4229
|
+
* @param {string} message
|
|
4230
|
+
* @returns {function}
|
|
4231
|
+
*/
|
|
4232
|
+
validators$1.transitional = function transitional(validator, version, message) {
|
|
4233
|
+
var isDeprecated = version && isOlderVersion(version);
|
|
4234
|
+
|
|
4235
|
+
function formatMessage(opt, desc) {
|
|
4236
|
+
return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
4237
|
+
}
|
|
4238
|
+
|
|
4239
|
+
// eslint-disable-next-line func-names
|
|
4240
|
+
return function(value, opt, opts) {
|
|
4241
|
+
if (validator === false) {
|
|
4242
|
+
throw new Error(formatMessage(opt, ' has been removed in ' + version));
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4245
|
+
if (isDeprecated && !deprecatedWarnings[opt]) {
|
|
4246
|
+
deprecatedWarnings[opt] = true;
|
|
4247
|
+
// eslint-disable-next-line no-console
|
|
4248
|
+
console.warn(
|
|
4249
|
+
formatMessage(
|
|
4250
|
+
opt,
|
|
4251
|
+
' has been deprecated since v' + version + ' and will be removed in the near future'
|
|
4252
|
+
)
|
|
4253
|
+
);
|
|
4254
|
+
}
|
|
4255
|
+
|
|
4256
|
+
return validator ? validator(value, opt, opts) : true;
|
|
4257
|
+
};
|
|
4258
|
+
};
|
|
4259
|
+
|
|
4260
|
+
/**
|
|
4261
|
+
* Assert object's properties type
|
|
4262
|
+
* @param {object} options
|
|
4263
|
+
* @param {object} schema
|
|
4264
|
+
* @param {boolean?} allowUnknown
|
|
4265
|
+
*/
|
|
4266
|
+
|
|
4267
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
4268
|
+
if (typeof options !== 'object') {
|
|
4269
|
+
throw new TypeError('options must be an object');
|
|
4270
|
+
}
|
|
4271
|
+
var keys = Object.keys(options);
|
|
4272
|
+
var i = keys.length;
|
|
4273
|
+
while (i-- > 0) {
|
|
4274
|
+
var opt = keys[i];
|
|
4275
|
+
var validator = schema[opt];
|
|
4276
|
+
if (validator) {
|
|
4277
|
+
var value = options[opt];
|
|
4278
|
+
var result = value === undefined || validator(value, opt, options);
|
|
4279
|
+
if (result !== true) {
|
|
4280
|
+
throw new TypeError('option ' + opt + ' must be ' + result);
|
|
4281
|
+
}
|
|
4282
|
+
continue;
|
|
4283
|
+
}
|
|
4284
|
+
if (allowUnknown !== true) {
|
|
4285
|
+
throw Error('Unknown option ' + opt);
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
var validator = {
|
|
4291
|
+
isOlderVersion: isOlderVersion,
|
|
4292
|
+
assertOptions: assertOptions,
|
|
4293
|
+
validators: validators$1
|
|
4294
|
+
};
|
|
4295
|
+
|
|
4296
|
+
var validators = validator.validators;
|
|
3997
4297
|
/**
|
|
3998
4298
|
* Create a new instance of Axios
|
|
3999
4299
|
*
|
|
@@ -4033,20 +4333,71 @@ Axios.prototype.request = function request(config) {
|
|
|
4033
4333
|
config.method = 'get';
|
|
4034
4334
|
}
|
|
4035
4335
|
|
|
4036
|
-
|
|
4037
|
-
var chain = [dispatchRequest, undefined];
|
|
4038
|
-
var promise = Promise.resolve(config);
|
|
4336
|
+
var transitional = config.transitional;
|
|
4039
4337
|
|
|
4338
|
+
if (transitional !== undefined) {
|
|
4339
|
+
validator.assertOptions(transitional, {
|
|
4340
|
+
silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
|
|
4341
|
+
forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
|
|
4342
|
+
clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')
|
|
4343
|
+
}, false);
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
// filter out skipped interceptors
|
|
4347
|
+
var requestInterceptorChain = [];
|
|
4348
|
+
var synchronousRequestInterceptors = true;
|
|
4040
4349
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
4041
|
-
|
|
4350
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
4351
|
+
return;
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
4355
|
+
|
|
4356
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
4042
4357
|
});
|
|
4043
4358
|
|
|
4359
|
+
var responseInterceptorChain = [];
|
|
4044
4360
|
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
4045
|
-
|
|
4361
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
4046
4362
|
});
|
|
4047
4363
|
|
|
4048
|
-
|
|
4049
|
-
|
|
4364
|
+
var promise;
|
|
4365
|
+
|
|
4366
|
+
if (!synchronousRequestInterceptors) {
|
|
4367
|
+
var chain = [dispatchRequest, undefined];
|
|
4368
|
+
|
|
4369
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
4370
|
+
chain = chain.concat(responseInterceptorChain);
|
|
4371
|
+
|
|
4372
|
+
promise = Promise.resolve(config);
|
|
4373
|
+
while (chain.length) {
|
|
4374
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
return promise;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
|
|
4381
|
+
var newConfig = config;
|
|
4382
|
+
while (requestInterceptorChain.length) {
|
|
4383
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
4384
|
+
var onRejected = requestInterceptorChain.shift();
|
|
4385
|
+
try {
|
|
4386
|
+
newConfig = onFulfilled(newConfig);
|
|
4387
|
+
} catch (error) {
|
|
4388
|
+
onRejected(error);
|
|
4389
|
+
break;
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
|
|
4393
|
+
try {
|
|
4394
|
+
promise = dispatchRequest(newConfig);
|
|
4395
|
+
} catch (error) {
|
|
4396
|
+
return Promise.reject(error);
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
while (responseInterceptorChain.length) {
|
|
4400
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
4050
4401
|
}
|
|
4051
4402
|
|
|
4052
4403
|
return promise;
|
|
@@ -4243,14 +4594,14 @@ axios_1.default = default_1;
|
|
|
4243
4594
|
var axios = axios_1;
|
|
4244
4595
|
|
|
4245
4596
|
var name$1 = "@tryghost/content-api";
|
|
4246
|
-
var version = "1.9.
|
|
4597
|
+
var version = "1.9.2";
|
|
4247
4598
|
var repository = "https://github.com/TryGhost/SDK/tree/master/packages/content-api";
|
|
4248
4599
|
var author = "Ghost Foundation";
|
|
4249
4600
|
var license = "MIT";
|
|
4250
4601
|
var main = "cjs/content-api.js";
|
|
4251
4602
|
var unpkg = "umd/content-api.min.js";
|
|
4252
4603
|
var module = "es/content-api.js";
|
|
4253
|
-
var source = "lib/
|
|
4604
|
+
var source = "lib/content-api.js";
|
|
4254
4605
|
var files = [
|
|
4255
4606
|
"LICENSE",
|
|
4256
4607
|
"README.md",
|
|
@@ -4272,27 +4623,27 @@ var publishConfig = {
|
|
|
4272
4623
|
access: "public"
|
|
4273
4624
|
};
|
|
4274
4625
|
var devDependencies = {
|
|
4275
|
-
"@babel/core": "7.17.
|
|
4626
|
+
"@babel/core": "7.17.10",
|
|
4276
4627
|
"@babel/polyfill": "7.12.1",
|
|
4277
|
-
"@babel/preset-env": "7.
|
|
4628
|
+
"@babel/preset-env": "7.17.10",
|
|
4278
4629
|
"@rollup/plugin-json": "4.1.0",
|
|
4279
|
-
c8: "7.11.
|
|
4280
|
-
"core-js": "3.22.
|
|
4281
|
-
"eslint-plugin-ghost": "
|
|
4282
|
-
mocha: "
|
|
4283
|
-
rollup: "2.
|
|
4630
|
+
c8: "7.11.2",
|
|
4631
|
+
"core-js": "3.22.4",
|
|
4632
|
+
"eslint-plugin-ghost": "2.13.0",
|
|
4633
|
+
mocha: "10.0.0",
|
|
4634
|
+
rollup: "2.71.1",
|
|
4284
4635
|
"rollup-plugin-babel": "4.4.0",
|
|
4285
4636
|
"rollup-plugin-commonjs": "10.1.0",
|
|
4286
4637
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
4287
4638
|
"rollup-plugin-replace": "2.2.0",
|
|
4288
4639
|
"rollup-plugin-terser": "7.0.2",
|
|
4289
4640
|
should: "13.2.3",
|
|
4290
|
-
sinon: "
|
|
4641
|
+
sinon: "13.0.2"
|
|
4291
4642
|
};
|
|
4292
4643
|
var dependencies = {
|
|
4293
|
-
axios: "^0.
|
|
4644
|
+
axios: "^0.27.0"
|
|
4294
4645
|
};
|
|
4295
|
-
var gitHead = "
|
|
4646
|
+
var gitHead = "0a30384f3d568a43bfe0cee5fcf7e21c17a17842";
|
|
4296
4647
|
var packageInfo = {
|
|
4297
4648
|
name: name$1,
|
|
4298
4649
|
version: version,
|