contentful 11.8.2 → 11.8.4
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.
|
@@ -8582,367 +8582,6 @@ var contentful = (function (exports) {
|
|
|
8582
8582
|
return e;
|
|
8583
8583
|
};
|
|
8584
8584
|
|
|
8585
|
-
var fastCopy = {exports: {}};
|
|
8586
|
-
|
|
8587
|
-
(function (module, exports) {
|
|
8588
|
-
(function (global, factory) {
|
|
8589
|
-
module.exports = factory() ;
|
|
8590
|
-
})(this, function () {
|
|
8591
|
-
|
|
8592
|
-
var toStringFunction = Function.prototype.toString;
|
|
8593
|
-
var create = Object.create,
|
|
8594
|
-
defineProperty = Object.defineProperty,
|
|
8595
|
-
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
|
|
8596
|
-
getOwnPropertyNames = Object.getOwnPropertyNames,
|
|
8597
|
-
getOwnPropertySymbols = Object.getOwnPropertySymbols,
|
|
8598
|
-
getPrototypeOf$1 = Object.getPrototypeOf;
|
|
8599
|
-
var _a = Object.prototype,
|
|
8600
|
-
hasOwnProperty = _a.hasOwnProperty,
|
|
8601
|
-
propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
8602
|
-
var SYMBOL_PROPERTIES = typeof getOwnPropertySymbols === 'function';
|
|
8603
|
-
var WEAK_MAP = typeof WeakMap === 'function';
|
|
8604
|
-
/**
|
|
8605
|
-
* @function createCache
|
|
8606
|
-
*
|
|
8607
|
-
* @description
|
|
8608
|
-
* get a new cache object to prevent circular references
|
|
8609
|
-
*
|
|
8610
|
-
* @returns the new cache object
|
|
8611
|
-
*/
|
|
8612
|
-
var createCache = function () {
|
|
8613
|
-
if (WEAK_MAP) {
|
|
8614
|
-
return function () {
|
|
8615
|
-
return new WeakMap();
|
|
8616
|
-
};
|
|
8617
|
-
}
|
|
8618
|
-
var Cache = /** @class */function () {
|
|
8619
|
-
function Cache() {
|
|
8620
|
-
this._keys = [];
|
|
8621
|
-
this._values = [];
|
|
8622
|
-
}
|
|
8623
|
-
Cache.prototype.has = function (key) {
|
|
8624
|
-
return !!~this._keys.indexOf(key);
|
|
8625
|
-
};
|
|
8626
|
-
Cache.prototype.get = function (key) {
|
|
8627
|
-
return this._values[this._keys.indexOf(key)];
|
|
8628
|
-
};
|
|
8629
|
-
Cache.prototype.set = function (key, value) {
|
|
8630
|
-
this._keys.push(key);
|
|
8631
|
-
this._values.push(value);
|
|
8632
|
-
};
|
|
8633
|
-
return Cache;
|
|
8634
|
-
}();
|
|
8635
|
-
return function () {
|
|
8636
|
-
return new Cache();
|
|
8637
|
-
};
|
|
8638
|
-
}();
|
|
8639
|
-
/**
|
|
8640
|
-
* @function getCleanClone
|
|
8641
|
-
*
|
|
8642
|
-
* @description
|
|
8643
|
-
* get an empty version of the object with the same prototype it has
|
|
8644
|
-
*
|
|
8645
|
-
* @param object the object to build a clean clone from
|
|
8646
|
-
* @param realm the realm the object resides in
|
|
8647
|
-
* @returns the empty cloned object
|
|
8648
|
-
*/
|
|
8649
|
-
var getCleanClone = function getCleanClone(object, realm) {
|
|
8650
|
-
var prototype = object.__proto__ || getPrototypeOf$1(object);
|
|
8651
|
-
if (!prototype) {
|
|
8652
|
-
return create(null);
|
|
8653
|
-
}
|
|
8654
|
-
var Constructor = prototype.constructor;
|
|
8655
|
-
if (Constructor === realm.Object) {
|
|
8656
|
-
return prototype === realm.Object.prototype ? {} : create(prototype);
|
|
8657
|
-
}
|
|
8658
|
-
if (~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
8659
|
-
try {
|
|
8660
|
-
return new Constructor();
|
|
8661
|
-
} catch (_a) {}
|
|
8662
|
-
}
|
|
8663
|
-
return create(prototype);
|
|
8664
|
-
};
|
|
8665
|
-
/**
|
|
8666
|
-
* @function getObjectCloneLoose
|
|
8667
|
-
*
|
|
8668
|
-
* @description
|
|
8669
|
-
* get a copy of the object based on loose rules, meaning all enumerable keys
|
|
8670
|
-
* and symbols are copied, but property descriptors are not considered
|
|
8671
|
-
*
|
|
8672
|
-
* @param object the object to clone
|
|
8673
|
-
* @param realm the realm the object resides in
|
|
8674
|
-
* @param handleCopy the function that handles copying the object
|
|
8675
|
-
* @returns the copied object
|
|
8676
|
-
*/
|
|
8677
|
-
var getObjectCloneLoose = function getObjectCloneLoose(object, realm, handleCopy, cache) {
|
|
8678
|
-
var clone = getCleanClone(object, realm);
|
|
8679
|
-
// set in the cache immediately to be able to reuse the object recursively
|
|
8680
|
-
cache.set(object, clone);
|
|
8681
|
-
for (var key in object) {
|
|
8682
|
-
if (hasOwnProperty.call(object, key)) {
|
|
8683
|
-
clone[key] = handleCopy(object[key], cache);
|
|
8684
|
-
}
|
|
8685
|
-
}
|
|
8686
|
-
if (SYMBOL_PROPERTIES) {
|
|
8687
|
-
var symbols = getOwnPropertySymbols(object);
|
|
8688
|
-
for (var index = 0, length_1 = symbols.length, symbol = void 0; index < length_1; ++index) {
|
|
8689
|
-
symbol = symbols[index];
|
|
8690
|
-
if (propertyIsEnumerable.call(object, symbol)) {
|
|
8691
|
-
clone[symbol] = handleCopy(object[symbol], cache);
|
|
8692
|
-
}
|
|
8693
|
-
}
|
|
8694
|
-
}
|
|
8695
|
-
return clone;
|
|
8696
|
-
};
|
|
8697
|
-
/**
|
|
8698
|
-
* @function getObjectCloneStrict
|
|
8699
|
-
*
|
|
8700
|
-
* @description
|
|
8701
|
-
* get a copy of the object based on strict rules, meaning all keys and symbols
|
|
8702
|
-
* are copied based on the original property descriptors
|
|
8703
|
-
*
|
|
8704
|
-
* @param object the object to clone
|
|
8705
|
-
* @param realm the realm the object resides in
|
|
8706
|
-
* @param handleCopy the function that handles copying the object
|
|
8707
|
-
* @returns the copied object
|
|
8708
|
-
*/
|
|
8709
|
-
var getObjectCloneStrict = function getObjectCloneStrict(object, realm, handleCopy, cache) {
|
|
8710
|
-
var clone = getCleanClone(object, realm);
|
|
8711
|
-
// set in the cache immediately to be able to reuse the object recursively
|
|
8712
|
-
cache.set(object, clone);
|
|
8713
|
-
var properties = SYMBOL_PROPERTIES ? getOwnPropertyNames(object).concat(getOwnPropertySymbols(object)) : getOwnPropertyNames(object);
|
|
8714
|
-
for (var index = 0, length_2 = properties.length, property = void 0, descriptor = void 0; index < length_2; ++index) {
|
|
8715
|
-
property = properties[index];
|
|
8716
|
-
if (property !== 'callee' && property !== 'caller') {
|
|
8717
|
-
descriptor = getOwnPropertyDescriptor(object, property);
|
|
8718
|
-
if (descriptor) {
|
|
8719
|
-
// Only clone the value if actually a value, not a getter / setter.
|
|
8720
|
-
if (!descriptor.get && !descriptor.set) {
|
|
8721
|
-
descriptor.value = handleCopy(object[property], cache);
|
|
8722
|
-
}
|
|
8723
|
-
try {
|
|
8724
|
-
defineProperty(clone, property, descriptor);
|
|
8725
|
-
} catch (error) {
|
|
8726
|
-
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
8727
|
-
clone[property] = descriptor.value;
|
|
8728
|
-
}
|
|
8729
|
-
} else {
|
|
8730
|
-
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
8731
|
-
// the loose assignment.
|
|
8732
|
-
clone[property] = handleCopy(object[property], cache);
|
|
8733
|
-
}
|
|
8734
|
-
}
|
|
8735
|
-
}
|
|
8736
|
-
return clone;
|
|
8737
|
-
};
|
|
8738
|
-
/**
|
|
8739
|
-
* @function getRegExpFlags
|
|
8740
|
-
*
|
|
8741
|
-
* @description
|
|
8742
|
-
* get the flags to apply to the copied regexp
|
|
8743
|
-
*
|
|
8744
|
-
* @param regExp the regexp to get the flags of
|
|
8745
|
-
* @returns the flags for the regexp
|
|
8746
|
-
*/
|
|
8747
|
-
var getRegExpFlags = function getRegExpFlags(regExp) {
|
|
8748
|
-
var flags = '';
|
|
8749
|
-
if (regExp.global) {
|
|
8750
|
-
flags += 'g';
|
|
8751
|
-
}
|
|
8752
|
-
if (regExp.ignoreCase) {
|
|
8753
|
-
flags += 'i';
|
|
8754
|
-
}
|
|
8755
|
-
if (regExp.multiline) {
|
|
8756
|
-
flags += 'm';
|
|
8757
|
-
}
|
|
8758
|
-
if (regExp.unicode) {
|
|
8759
|
-
flags += 'u';
|
|
8760
|
-
}
|
|
8761
|
-
if (regExp.sticky) {
|
|
8762
|
-
flags += 'y';
|
|
8763
|
-
}
|
|
8764
|
-
return flags;
|
|
8765
|
-
};
|
|
8766
|
-
|
|
8767
|
-
// utils
|
|
8768
|
-
var isArray = Array.isArray;
|
|
8769
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
8770
|
-
var GLOBAL_THIS = function () {
|
|
8771
|
-
if (typeof globalThis !== 'undefined') {
|
|
8772
|
-
return globalThis;
|
|
8773
|
-
}
|
|
8774
|
-
if (typeof self !== 'undefined') {
|
|
8775
|
-
return self;
|
|
8776
|
-
}
|
|
8777
|
-
if (typeof window !== 'undefined') {
|
|
8778
|
-
return window;
|
|
8779
|
-
}
|
|
8780
|
-
if (typeof global !== 'undefined') {
|
|
8781
|
-
return global;
|
|
8782
|
-
}
|
|
8783
|
-
if (console && console.error) {
|
|
8784
|
-
console.error('Unable to locate global object, returning "this".');
|
|
8785
|
-
}
|
|
8786
|
-
return this;
|
|
8787
|
-
}();
|
|
8788
|
-
/**
|
|
8789
|
-
* @function copy
|
|
8790
|
-
*
|
|
8791
|
-
* @description
|
|
8792
|
-
* copy an value deeply as much as possible
|
|
8793
|
-
*
|
|
8794
|
-
* If `strict` is applied, then all properties (including non-enumerable ones)
|
|
8795
|
-
* are copied with their original property descriptors on both objects and arrays.
|
|
8796
|
-
*
|
|
8797
|
-
* The value is compared to the global constructors in the `realm` provided,
|
|
8798
|
-
* and the native constructor is always used to ensure that extensions of native
|
|
8799
|
-
* objects (allows in ES2015+) are maintained.
|
|
8800
|
-
*
|
|
8801
|
-
* @param value the value to copy
|
|
8802
|
-
* @param [options] the options for copying with
|
|
8803
|
-
* @param [options.isStrict] should the copy be strict
|
|
8804
|
-
* @param [options.realm] the realm (this) value the value is copied from
|
|
8805
|
-
* @returns the copied value
|
|
8806
|
-
*/
|
|
8807
|
-
function copy(value, options) {
|
|
8808
|
-
// manually coalesced instead of default parameters for performance
|
|
8809
|
-
var isStrict = !!(options && options.isStrict);
|
|
8810
|
-
var realm = options && options.realm || GLOBAL_THIS;
|
|
8811
|
-
var getObjectClone = isStrict ? getObjectCloneStrict : getObjectCloneLoose;
|
|
8812
|
-
/**
|
|
8813
|
-
* @function handleCopy
|
|
8814
|
-
*
|
|
8815
|
-
* @description
|
|
8816
|
-
* copy the value recursively based on its type
|
|
8817
|
-
*
|
|
8818
|
-
* @param value the value to copy
|
|
8819
|
-
* @returns the copied value
|
|
8820
|
-
*/
|
|
8821
|
-
var _handleCopy = function handleCopy(value, cache) {
|
|
8822
|
-
if (!value || _typeof$2(value) !== 'object') {
|
|
8823
|
-
return value;
|
|
8824
|
-
}
|
|
8825
|
-
if (cache.has(value)) {
|
|
8826
|
-
return cache.get(value);
|
|
8827
|
-
}
|
|
8828
|
-
var prototype = value.__proto__ || getPrototypeOf(value);
|
|
8829
|
-
var Constructor = prototype && prototype.constructor;
|
|
8830
|
-
// plain objects
|
|
8831
|
-
if (!Constructor || Constructor === realm.Object) {
|
|
8832
|
-
return getObjectClone(value, realm, _handleCopy, cache);
|
|
8833
|
-
}
|
|
8834
|
-
var clone;
|
|
8835
|
-
// arrays
|
|
8836
|
-
if (isArray(value)) {
|
|
8837
|
-
// if strict, include non-standard properties
|
|
8838
|
-
if (isStrict) {
|
|
8839
|
-
return getObjectCloneStrict(value, realm, _handleCopy, cache);
|
|
8840
|
-
}
|
|
8841
|
-
clone = new Constructor();
|
|
8842
|
-
cache.set(value, clone);
|
|
8843
|
-
for (var index = 0, length_1 = value.length; index < length_1; ++index) {
|
|
8844
|
-
clone[index] = _handleCopy(value[index], cache);
|
|
8845
|
-
}
|
|
8846
|
-
return clone;
|
|
8847
|
-
}
|
|
8848
|
-
// dates
|
|
8849
|
-
if (value instanceof realm.Date) {
|
|
8850
|
-
return new Constructor(value.getTime());
|
|
8851
|
-
}
|
|
8852
|
-
// regexps
|
|
8853
|
-
if (value instanceof realm.RegExp) {
|
|
8854
|
-
clone = new Constructor(value.source, value.flags || getRegExpFlags(value));
|
|
8855
|
-
clone.lastIndex = value.lastIndex;
|
|
8856
|
-
return clone;
|
|
8857
|
-
}
|
|
8858
|
-
// maps
|
|
8859
|
-
if (realm.Map && value instanceof realm.Map) {
|
|
8860
|
-
clone = new Constructor();
|
|
8861
|
-
cache.set(value, clone);
|
|
8862
|
-
value.forEach(function (value, key) {
|
|
8863
|
-
clone.set(key, _handleCopy(value, cache));
|
|
8864
|
-
});
|
|
8865
|
-
return clone;
|
|
8866
|
-
}
|
|
8867
|
-
// sets
|
|
8868
|
-
if (realm.Set && value instanceof realm.Set) {
|
|
8869
|
-
clone = new Constructor();
|
|
8870
|
-
cache.set(value, clone);
|
|
8871
|
-
value.forEach(function (value) {
|
|
8872
|
-
clone.add(_handleCopy(value, cache));
|
|
8873
|
-
});
|
|
8874
|
-
return clone;
|
|
8875
|
-
}
|
|
8876
|
-
// blobs
|
|
8877
|
-
if (realm.Blob && value instanceof realm.Blob) {
|
|
8878
|
-
return value.slice(0, value.size, value.type);
|
|
8879
|
-
}
|
|
8880
|
-
// buffers (node-only)
|
|
8881
|
-
if (realm.Buffer && realm.Buffer.isBuffer(value)) {
|
|
8882
|
-
clone = realm.Buffer.allocUnsafe ? realm.Buffer.allocUnsafe(value.length) : new Constructor(value.length);
|
|
8883
|
-
cache.set(value, clone);
|
|
8884
|
-
value.copy(clone);
|
|
8885
|
-
return clone;
|
|
8886
|
-
}
|
|
8887
|
-
// arraybuffers / dataviews
|
|
8888
|
-
if (realm.ArrayBuffer) {
|
|
8889
|
-
// dataviews
|
|
8890
|
-
if (realm.ArrayBuffer.isView(value)) {
|
|
8891
|
-
clone = new Constructor(value.buffer.slice(0));
|
|
8892
|
-
cache.set(value, clone);
|
|
8893
|
-
return clone;
|
|
8894
|
-
}
|
|
8895
|
-
// arraybuffers
|
|
8896
|
-
if (value instanceof realm.ArrayBuffer) {
|
|
8897
|
-
clone = value.slice(0);
|
|
8898
|
-
cache.set(value, clone);
|
|
8899
|
-
return clone;
|
|
8900
|
-
}
|
|
8901
|
-
}
|
|
8902
|
-
// if the value cannot / should not be cloned, don't
|
|
8903
|
-
if (
|
|
8904
|
-
// promise-like
|
|
8905
|
-
typeof value.then === 'function' ||
|
|
8906
|
-
// errors
|
|
8907
|
-
value instanceof Error ||
|
|
8908
|
-
// weakmaps
|
|
8909
|
-
realm.WeakMap && value instanceof realm.WeakMap ||
|
|
8910
|
-
// weaksets
|
|
8911
|
-
realm.WeakSet && value instanceof realm.WeakSet) {
|
|
8912
|
-
return value;
|
|
8913
|
-
}
|
|
8914
|
-
// assume anything left is a custom constructor
|
|
8915
|
-
return getObjectClone(value, realm, _handleCopy, cache);
|
|
8916
|
-
};
|
|
8917
|
-
return _handleCopy(value, createCache());
|
|
8918
|
-
}
|
|
8919
|
-
// Adding reference to allow usage in CommonJS libraries compiled using TSC, which
|
|
8920
|
-
// expects there to be a default property on the exported value. See
|
|
8921
|
-
// [#37](https://github.com/planttheidea/fast-copy/issues/37) for details.
|
|
8922
|
-
copy.default = copy;
|
|
8923
|
-
/**
|
|
8924
|
-
* @function strictCopy
|
|
8925
|
-
*
|
|
8926
|
-
* @description
|
|
8927
|
-
* copy the value with `strict` option pre-applied
|
|
8928
|
-
*
|
|
8929
|
-
* @param value the value to copy
|
|
8930
|
-
* @param [options] the options for copying with
|
|
8931
|
-
* @param [options.realm] the realm (this) value the value is copied from
|
|
8932
|
-
* @returns the copied value
|
|
8933
|
-
*/
|
|
8934
|
-
copy.strict = function strictCopy(value, options) {
|
|
8935
|
-
return copy(value, {
|
|
8936
|
-
isStrict: true,
|
|
8937
|
-
realm: options ? options.realm : void 0
|
|
8938
|
-
});
|
|
8939
|
-
};
|
|
8940
|
-
return copy;
|
|
8941
|
-
});
|
|
8942
|
-
})(fastCopy);
|
|
8943
|
-
var fastCopyExports = fastCopy.exports;
|
|
8944
|
-
var copy = /*@__PURE__*/getDefaultExportFromCjs(fastCopyExports);
|
|
8945
|
-
|
|
8946
8585
|
var _typeof = typeof Symbol === "function" && _typeof$2(Symbol.iterator) === "symbol" ? function (obj) {
|
|
8947
8586
|
return _typeof$2(obj);
|
|
8948
8587
|
} : function (obj) {
|
|
@@ -9186,7 +8825,7 @@ var contentful = (function (exports) {
|
|
|
9186
8825
|
if (!response.items) {
|
|
9187
8826
|
return [];
|
|
9188
8827
|
}
|
|
9189
|
-
var responseClone =
|
|
8828
|
+
var responseClone = index(response);
|
|
9190
8829
|
var allIncludes = Object.keys(responseClone.includes || {}).reduce(function (all, type) {
|
|
9191
8830
|
return [].concat(_toConsumableArray(all), _toConsumableArray(response.includes[type]));
|
|
9192
8831
|
}, []);
|
|
@@ -10585,7 +10224,7 @@ var contentful = (function (exports) {
|
|
|
10585
10224
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10586
10225
|
}
|
|
10587
10226
|
return {
|
|
10588
|
-
version: "11.8.
|
|
10227
|
+
version: "11.8.4",
|
|
10589
10228
|
getSpace: getSpace,
|
|
10590
10229
|
getContentType: getContentType,
|
|
10591
10230
|
getContentTypes: getContentTypes,
|
|
@@ -10714,7 +10353,7 @@ var contentful = (function (exports) {
|
|
|
10714
10353
|
environment: 'master'
|
|
10715
10354
|
};
|
|
10716
10355
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10717
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.8.
|
|
10356
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.8.4"), config.application, config.integration);
|
|
10718
10357
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10719
10358
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10720
10359
|
'X-Contentful-User-Agent': userAgentHeader
|