contentful 11.7.17 → 11.7.19
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.
|
@@ -979,10 +979,8 @@ var contentful = (function (exports) {
|
|
|
979
979
|
result[targetKey] = merge$1({}, val);
|
|
980
980
|
} else if (isArray$7(val)) {
|
|
981
981
|
result[targetKey] = val.slice();
|
|
982
|
-
} else {
|
|
983
|
-
|
|
984
|
-
result[targetKey] = val;
|
|
985
|
-
}
|
|
982
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
983
|
+
result[targetKey] = val;
|
|
986
984
|
}
|
|
987
985
|
};
|
|
988
986
|
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
@@ -3277,11 +3275,9 @@ var contentful = (function (exports) {
|
|
|
3277
3275
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3278
3276
|
var isFunction = utils$1$1.isFunction;
|
|
3279
3277
|
var globalFetchAPI = function (_ref13) {
|
|
3280
|
-
var
|
|
3281
|
-
Request = _ref13.Request,
|
|
3278
|
+
var Request = _ref13.Request,
|
|
3282
3279
|
Response = _ref13.Response;
|
|
3283
3280
|
return {
|
|
3284
|
-
fetch: fetch,
|
|
3285
3281
|
Request: Request,
|
|
3286
3282
|
Response: Response
|
|
3287
3283
|
};
|
|
@@ -3300,11 +3296,14 @@ var contentful = (function (exports) {
|
|
|
3300
3296
|
}
|
|
3301
3297
|
};
|
|
3302
3298
|
var factory = function factory(env) {
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3299
|
+
env = utils$1$1.merge.call({
|
|
3300
|
+
skipUndefined: true
|
|
3301
|
+
}, globalFetchAPI, env);
|
|
3302
|
+
var _env = env,
|
|
3303
|
+
envFetch = _env.fetch,
|
|
3304
|
+
Request = _env.Request,
|
|
3305
|
+
Response = _env.Response;
|
|
3306
|
+
var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
3308
3307
|
var isRequestSupported = isFunction(Request);
|
|
3309
3308
|
var isResponseSupported = isFunction(Response);
|
|
3310
3309
|
if (!isFetchSupported) {
|
|
@@ -3445,31 +3444,32 @@ var contentful = (function (exports) {
|
|
|
3445
3444
|
}();
|
|
3446
3445
|
return /*#__PURE__*/function () {
|
|
3447
3446
|
var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(config) {
|
|
3448
|
-
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref18, _ref19, _onProgress, _flush, responseData;
|
|
3447
|
+
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, _fetch, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref18, _ref19, _onProgress, _flush, responseData;
|
|
3449
3448
|
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
3450
3449
|
while (1) switch (_context8.prev = _context8.next) {
|
|
3451
3450
|
case 0:
|
|
3452
3451
|
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
|
|
3452
|
+
_fetch = envFetch || fetch;
|
|
3453
3453
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
3454
3454
|
composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
3455
3455
|
request = null;
|
|
3456
3456
|
unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
|
|
3457
3457
|
composedSignal.unsubscribe();
|
|
3458
3458
|
};
|
|
3459
|
-
_context8.prev =
|
|
3459
|
+
_context8.prev = 6;
|
|
3460
3460
|
_context8.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head';
|
|
3461
3461
|
if (!_context8.t0) {
|
|
3462
|
-
_context8.next =
|
|
3462
|
+
_context8.next = 13;
|
|
3463
3463
|
break;
|
|
3464
3464
|
}
|
|
3465
|
-
_context8.next =
|
|
3465
|
+
_context8.next = 11;
|
|
3466
3466
|
return resolveBodyLength(headers, data);
|
|
3467
|
-
case
|
|
3467
|
+
case 11:
|
|
3468
3468
|
_context8.t1 = requestContentLength = _context8.sent;
|
|
3469
3469
|
_context8.t0 = _context8.t1 !== 0;
|
|
3470
|
-
case
|
|
3470
|
+
case 13:
|
|
3471
3471
|
if (!_context8.t0) {
|
|
3472
|
-
_context8.next =
|
|
3472
|
+
_context8.next = 17;
|
|
3473
3473
|
break;
|
|
3474
3474
|
}
|
|
3475
3475
|
_request = new Request(url, {
|
|
@@ -3484,7 +3484,7 @@ var contentful = (function (exports) {
|
|
|
3484
3484
|
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray$1(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
|
|
3485
3485
|
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3486
3486
|
}
|
|
3487
|
-
case
|
|
3487
|
+
case 17:
|
|
3488
3488
|
if (!utils$1$1.isString(withCredentials)) {
|
|
3489
3489
|
withCredentials = withCredentials ? 'include' : 'omit';
|
|
3490
3490
|
}
|
|
@@ -3501,9 +3501,9 @@ var contentful = (function (exports) {
|
|
|
3501
3501
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
3502
3502
|
});
|
|
3503
3503
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
3504
|
-
_context8.next =
|
|
3505
|
-
return isRequestSupported ?
|
|
3506
|
-
case
|
|
3504
|
+
_context8.next = 23;
|
|
3505
|
+
return isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions);
|
|
3506
|
+
case 23:
|
|
3507
3507
|
response = _context8.sent;
|
|
3508
3508
|
isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
3509
3509
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
@@ -3519,12 +3519,12 @@ var contentful = (function (exports) {
|
|
|
3519
3519
|
}), options);
|
|
3520
3520
|
}
|
|
3521
3521
|
responseType = responseType || 'text';
|
|
3522
|
-
_context8.next =
|
|
3522
|
+
_context8.next = 29;
|
|
3523
3523
|
return resolvers[utils$1$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
3524
|
-
case
|
|
3524
|
+
case 29:
|
|
3525
3525
|
responseData = _context8.sent;
|
|
3526
3526
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3527
|
-
_context8.next =
|
|
3527
|
+
_context8.next = 33;
|
|
3528
3528
|
return new Promise(function (resolve, reject) {
|
|
3529
3529
|
settle(resolve, reject, {
|
|
3530
3530
|
data: responseData,
|
|
@@ -3535,26 +3535,26 @@ var contentful = (function (exports) {
|
|
|
3535
3535
|
request: request
|
|
3536
3536
|
});
|
|
3537
3537
|
});
|
|
3538
|
-
case
|
|
3538
|
+
case 33:
|
|
3539
3539
|
return _context8.abrupt("return", _context8.sent);
|
|
3540
|
-
case
|
|
3541
|
-
_context8.prev =
|
|
3542
|
-
_context8.t2 = _context8["catch"](
|
|
3540
|
+
case 36:
|
|
3541
|
+
_context8.prev = 36;
|
|
3542
|
+
_context8.t2 = _context8["catch"](6);
|
|
3543
3543
|
unsubscribe && unsubscribe();
|
|
3544
3544
|
if (!(_context8.t2 && _context8.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context8.t2.message))) {
|
|
3545
|
-
_context8.next =
|
|
3545
|
+
_context8.next = 41;
|
|
3546
3546
|
break;
|
|
3547
3547
|
}
|
|
3548
3548
|
throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
|
|
3549
3549
|
cause: _context8.t2.cause || _context8.t2
|
|
3550
3550
|
});
|
|
3551
|
-
case 40:
|
|
3552
|
-
throw AxiosError.from(_context8.t2, _context8.t2 && _context8.t2.code, config, request);
|
|
3553
3551
|
case 41:
|
|
3552
|
+
throw AxiosError.from(_context8.t2, _context8.t2 && _context8.t2.code, config, request);
|
|
3553
|
+
case 42:
|
|
3554
3554
|
case "end":
|
|
3555
3555
|
return _context8.stop();
|
|
3556
3556
|
}
|
|
3557
|
-
}, _callee7, null, [[
|
|
3557
|
+
}, _callee7, null, [[6, 36]]);
|
|
3558
3558
|
}));
|
|
3559
3559
|
return function (_x8) {
|
|
3560
3560
|
return _ref17.apply(this, arguments);
|
|
@@ -3563,9 +3563,7 @@ var contentful = (function (exports) {
|
|
|
3563
3563
|
};
|
|
3564
3564
|
var seedCache = new Map();
|
|
3565
3565
|
var getFetch = function getFetch(config) {
|
|
3566
|
-
var env =
|
|
3567
|
-
skipUndefined: true
|
|
3568
|
-
}, globalFetchAPI, config ? config.env : null);
|
|
3566
|
+
var env = config ? config.env : {};
|
|
3569
3567
|
var fetch = env.fetch,
|
|
3570
3568
|
Request = env.Request,
|
|
3571
3569
|
Response = env.Response;
|
|
@@ -3702,7 +3700,7 @@ var contentful = (function (exports) {
|
|
|
3702
3700
|
return Promise.reject(reason);
|
|
3703
3701
|
});
|
|
3704
3702
|
}
|
|
3705
|
-
var VERSION = "1.12.
|
|
3703
|
+
var VERSION = "1.12.2";
|
|
3706
3704
|
var validators$1 = {};
|
|
3707
3705
|
|
|
3708
3706
|
// eslint-disable-next-line func-names
|
|
@@ -3943,7 +3941,6 @@ var contentful = (function (exports) {
|
|
|
3943
3941
|
}
|
|
3944
3942
|
len = requestInterceptorChain.length;
|
|
3945
3943
|
var newConfig = config;
|
|
3946
|
-
i = 0;
|
|
3947
3944
|
while (i < len) {
|
|
3948
3945
|
var onFulfilled = requestInterceptorChain[i++];
|
|
3949
3946
|
var onRejected = requestInterceptorChain[i++];
|
|
@@ -10518,7 +10515,7 @@ var contentful = (function (exports) {
|
|
|
10518
10515
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10519
10516
|
}
|
|
10520
10517
|
return {
|
|
10521
|
-
version: "11.7.
|
|
10518
|
+
version: "11.7.19",
|
|
10522
10519
|
getSpace: getSpace,
|
|
10523
10520
|
getContentType: getContentType,
|
|
10524
10521
|
getContentTypes: getContentTypes,
|
|
@@ -10645,7 +10642,7 @@ var contentful = (function (exports) {
|
|
|
10645
10642
|
environment: 'master'
|
|
10646
10643
|
};
|
|
10647
10644
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10648
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.7.
|
|
10645
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.7.19"), config.application, config.integration);
|
|
10649
10646
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10650
10647
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10651
10648
|
'X-Contentful-User-Agent': userAgentHeader
|