contentful 9.2.5 → 9.2.7
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/dist/contentful.browser.js +973 -194
- package/dist/contentful.browser.js.map +1 -1
- package/dist/contentful.browser.min.js +3 -3
- package/dist/contentful.node.js +976 -206
- package/dist/contentful.node.js.map +1 -1
- package/dist/contentful.node.min.js +3 -3
- package/dist/es-modules/contentful.js +4 -16
- package/dist/es-modules/create-contentful-api.js +15 -56
- package/dist/es-modules/create-global-options.js +0 -1
- package/dist/es-modules/entities/asset-key.js +0 -4
- package/dist/es-modules/entities/asset.js +1 -6
- package/dist/es-modules/entities/content-type.js +1 -6
- package/dist/es-modules/entities/entry.js +1 -10
- package/dist/es-modules/entities/index.js +0 -10
- package/dist/es-modules/entities/locale.js +1 -6
- package/dist/es-modules/entities/space.js +0 -2
- package/dist/es-modules/entities/tag.js +1 -6
- package/dist/es-modules/mixins/stringify-safe.js +0 -3
- package/dist/es-modules/paged-sync.js +7 -35
- package/dist/es-modules/utils/normalize-select.js +12 -13
- package/dist/es-modules/utils/validate-timestamp.js +0 -7
- package/package.json +1 -1
package/dist/contentful.node.js
CHANGED
|
@@ -4344,7 +4344,7 @@ CombinedStream.prototype._emitError = function(err) {
|
|
|
4344
4344
|
|
|
4345
4345
|
"use strict";
|
|
4346
4346
|
__webpack_require__.r(__webpack_exports__);
|
|
4347
|
-
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/
|
|
4347
|
+
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/contentful-resolve-response/node_modules/fast-copy/dist/esm/index.mjs");
|
|
4348
4348
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
4349
4349
|
|
|
4350
4350
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
@@ -4498,6 +4498,420 @@ var resolveResponse = function resolveResponse(response, options) {
|
|
|
4498
4498
|
|
|
4499
4499
|
/* harmony default export */ __webpack_exports__["default"] = (resolveResponse);
|
|
4500
4500
|
|
|
4501
|
+
/***/ }),
|
|
4502
|
+
|
|
4503
|
+
/***/ "../node_modules/contentful-resolve-response/node_modules/fast-copy/dist/esm/index.mjs":
|
|
4504
|
+
/*!*********************************************************************************************!*\
|
|
4505
|
+
!*** ../node_modules/contentful-resolve-response/node_modules/fast-copy/dist/esm/index.mjs ***!
|
|
4506
|
+
\*********************************************************************************************/
|
|
4507
|
+
/*! exports provided: copyStrict, createCopier, createStrictCopier, default */
|
|
4508
|
+
/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
4509
|
+
|
|
4510
|
+
"use strict";
|
|
4511
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4512
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyStrict", function() { return copyStrict; });
|
|
4513
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCopier", function() { return createCopier; });
|
|
4514
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStrictCopier", function() { return createStrictCopier; });
|
|
4515
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return index; });
|
|
4516
|
+
var toStringFunction = Function.prototype.toString;
|
|
4517
|
+
var create = Object.create;
|
|
4518
|
+
var toStringObject = Object.prototype.toString;
|
|
4519
|
+
/**
|
|
4520
|
+
* @classdesc Fallback cache for when WeakMap is not natively supported
|
|
4521
|
+
*/
|
|
4522
|
+
var LegacyCache = /** @class */ (function () {
|
|
4523
|
+
function LegacyCache() {
|
|
4524
|
+
this._keys = [];
|
|
4525
|
+
this._values = [];
|
|
4526
|
+
}
|
|
4527
|
+
LegacyCache.prototype.has = function (key) {
|
|
4528
|
+
return !!~this._keys.indexOf(key);
|
|
4529
|
+
};
|
|
4530
|
+
LegacyCache.prototype.get = function (key) {
|
|
4531
|
+
return this._values[this._keys.indexOf(key)];
|
|
4532
|
+
};
|
|
4533
|
+
LegacyCache.prototype.set = function (key, value) {
|
|
4534
|
+
this._keys.push(key);
|
|
4535
|
+
this._values.push(value);
|
|
4536
|
+
};
|
|
4537
|
+
return LegacyCache;
|
|
4538
|
+
}());
|
|
4539
|
+
function createCacheLegacy() {
|
|
4540
|
+
return new LegacyCache();
|
|
4541
|
+
}
|
|
4542
|
+
function createCacheModern() {
|
|
4543
|
+
return new WeakMap();
|
|
4544
|
+
}
|
|
4545
|
+
/**
|
|
4546
|
+
* Get a new cache object to prevent circular references.
|
|
4547
|
+
*/
|
|
4548
|
+
var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
|
|
4549
|
+
/**
|
|
4550
|
+
* Get an empty version of the object with the same prototype it has.
|
|
4551
|
+
*/
|
|
4552
|
+
function getCleanClone(prototype) {
|
|
4553
|
+
if (!prototype) {
|
|
4554
|
+
return create(null);
|
|
4555
|
+
}
|
|
4556
|
+
var Constructor = prototype.constructor;
|
|
4557
|
+
if (Constructor === Object) {
|
|
4558
|
+
return prototype === Object.prototype ? {} : create(prototype);
|
|
4559
|
+
}
|
|
4560
|
+
if (~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
4561
|
+
try {
|
|
4562
|
+
return new Constructor();
|
|
4563
|
+
}
|
|
4564
|
+
catch (_a) { }
|
|
4565
|
+
}
|
|
4566
|
+
return create(prototype);
|
|
4567
|
+
}
|
|
4568
|
+
function getRegExpFlagsLegacy(regExp) {
|
|
4569
|
+
var flags = '';
|
|
4570
|
+
if (regExp.global) {
|
|
4571
|
+
flags += 'g';
|
|
4572
|
+
}
|
|
4573
|
+
if (regExp.ignoreCase) {
|
|
4574
|
+
flags += 'i';
|
|
4575
|
+
}
|
|
4576
|
+
if (regExp.multiline) {
|
|
4577
|
+
flags += 'm';
|
|
4578
|
+
}
|
|
4579
|
+
if (regExp.unicode) {
|
|
4580
|
+
flags += 'u';
|
|
4581
|
+
}
|
|
4582
|
+
if (regExp.sticky) {
|
|
4583
|
+
flags += 'y';
|
|
4584
|
+
}
|
|
4585
|
+
return flags;
|
|
4586
|
+
}
|
|
4587
|
+
function getRegExpFlagsModern(regExp) {
|
|
4588
|
+
return regExp.flags;
|
|
4589
|
+
}
|
|
4590
|
+
/**
|
|
4591
|
+
* Get the flags to apply to the copied regexp.
|
|
4592
|
+
*/
|
|
4593
|
+
var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
|
|
4594
|
+
function getTagLegacy(value) {
|
|
4595
|
+
var type = toStringObject.call(value);
|
|
4596
|
+
return type.substring(8, type.length - 1);
|
|
4597
|
+
}
|
|
4598
|
+
function getTagModern(value) {
|
|
4599
|
+
return value[Symbol.toStringTag] || getTagLegacy(value);
|
|
4600
|
+
}
|
|
4601
|
+
/**
|
|
4602
|
+
* Get the tag of the value passed, so that the correct copier can be used.
|
|
4603
|
+
*/
|
|
4604
|
+
var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
|
|
4605
|
+
|
|
4606
|
+
var defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
4607
|
+
var _a = Object.prototype, hasOwnProperty = _a.hasOwnProperty, propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
4608
|
+
var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
|
|
4609
|
+
function getStrictPropertiesModern(object) {
|
|
4610
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
4611
|
+
}
|
|
4612
|
+
/**
|
|
4613
|
+
* Get the properites used when copying objects strictly. This includes both keys and symbols.
|
|
4614
|
+
*/
|
|
4615
|
+
var getStrictProperties = SUPPORTS_SYMBOL
|
|
4616
|
+
? getStrictPropertiesModern
|
|
4617
|
+
: getOwnPropertyNames;
|
|
4618
|
+
/**
|
|
4619
|
+
* Striclty copy all properties contained on the object.
|
|
4620
|
+
*/
|
|
4621
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
4622
|
+
var properties = getStrictProperties(value);
|
|
4623
|
+
for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
|
|
4624
|
+
property = properties[index];
|
|
4625
|
+
if (property === 'callee' || property === 'caller') {
|
|
4626
|
+
continue;
|
|
4627
|
+
}
|
|
4628
|
+
descriptor = getOwnPropertyDescriptor(value, property);
|
|
4629
|
+
if (!descriptor) {
|
|
4630
|
+
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
4631
|
+
// the loose assignment.
|
|
4632
|
+
clone[property] = state.copier(value[property], state);
|
|
4633
|
+
continue;
|
|
4634
|
+
}
|
|
4635
|
+
// Only clone the value if actually a value, not a getter / setter.
|
|
4636
|
+
if (!descriptor.get && !descriptor.set) {
|
|
4637
|
+
descriptor.value = state.copier(descriptor.value, state);
|
|
4638
|
+
}
|
|
4639
|
+
try {
|
|
4640
|
+
defineProperty(clone, property, descriptor);
|
|
4641
|
+
}
|
|
4642
|
+
catch (error) {
|
|
4643
|
+
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
4644
|
+
clone[property] = descriptor.value;
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
return clone;
|
|
4648
|
+
}
|
|
4649
|
+
/**
|
|
4650
|
+
* Deeply copy the indexed values in the array.
|
|
4651
|
+
*/
|
|
4652
|
+
function copyArrayLoose(array, state) {
|
|
4653
|
+
var clone = new state.Constructor();
|
|
4654
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4655
|
+
state.cache.set(array, clone);
|
|
4656
|
+
for (var index = 0, length_2 = array.length; index < length_2; ++index) {
|
|
4657
|
+
clone[index] = state.copier(array[index], state);
|
|
4658
|
+
}
|
|
4659
|
+
return clone;
|
|
4660
|
+
}
|
|
4661
|
+
/**
|
|
4662
|
+
* Deeply copy the indexed values in the array, as well as any custom properties.
|
|
4663
|
+
*/
|
|
4664
|
+
function copyArrayStrict(array, state) {
|
|
4665
|
+
var clone = new state.Constructor();
|
|
4666
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4667
|
+
state.cache.set(array, clone);
|
|
4668
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
4669
|
+
}
|
|
4670
|
+
/**
|
|
4671
|
+
* Copy the contents of the ArrayBuffer.
|
|
4672
|
+
*/
|
|
4673
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
4674
|
+
return arrayBuffer.slice(0);
|
|
4675
|
+
}
|
|
4676
|
+
/**
|
|
4677
|
+
* Create a new Blob with the contents of the original.
|
|
4678
|
+
*/
|
|
4679
|
+
function copyBlob(blob, _state) {
|
|
4680
|
+
return blob.slice(0, blob.size, blob.type);
|
|
4681
|
+
}
|
|
4682
|
+
/**
|
|
4683
|
+
* Create a new DataView with the contents of the original.
|
|
4684
|
+
*/
|
|
4685
|
+
function copyDataView(dataView, state) {
|
|
4686
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
4687
|
+
}
|
|
4688
|
+
/**
|
|
4689
|
+
* Create a new Date based on the time of the original.
|
|
4690
|
+
*/
|
|
4691
|
+
function copyDate(date, state) {
|
|
4692
|
+
return new state.Constructor(date.getTime());
|
|
4693
|
+
}
|
|
4694
|
+
/**
|
|
4695
|
+
* Deeply copy the keys and values of the original.
|
|
4696
|
+
*/
|
|
4697
|
+
function copyMapLoose(map, state) {
|
|
4698
|
+
var clone = new state.Constructor();
|
|
4699
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4700
|
+
state.cache.set(map, clone);
|
|
4701
|
+
map.forEach(function (value, key) {
|
|
4702
|
+
clone.set(key, state.copier(value, state));
|
|
4703
|
+
});
|
|
4704
|
+
return clone;
|
|
4705
|
+
}
|
|
4706
|
+
/**
|
|
4707
|
+
* Deeply copy the keys and values of the original, as well as any custom properties.
|
|
4708
|
+
*/
|
|
4709
|
+
function copyMapStrict(map, state) {
|
|
4710
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
4711
|
+
}
|
|
4712
|
+
function copyObjectLooseLegacy(object, state) {
|
|
4713
|
+
var clone = getCleanClone(state.prototype);
|
|
4714
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4715
|
+
state.cache.set(object, clone);
|
|
4716
|
+
for (var key in object) {
|
|
4717
|
+
if (hasOwnProperty.call(object, key)) {
|
|
4718
|
+
clone[key] = state.copier(object[key], state);
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
return clone;
|
|
4722
|
+
}
|
|
4723
|
+
function copyObjectLooseModern(object, state) {
|
|
4724
|
+
var clone = getCleanClone(state.prototype);
|
|
4725
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4726
|
+
state.cache.set(object, clone);
|
|
4727
|
+
for (var key in object) {
|
|
4728
|
+
if (hasOwnProperty.call(object, key)) {
|
|
4729
|
+
clone[key] = state.copier(object[key], state);
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
var symbols = getOwnPropertySymbols(object);
|
|
4733
|
+
for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
|
|
4734
|
+
symbol = symbols[index];
|
|
4735
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
4736
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
4737
|
+
}
|
|
4738
|
+
}
|
|
4739
|
+
return clone;
|
|
4740
|
+
}
|
|
4741
|
+
/**
|
|
4742
|
+
* Deeply copy the properties (keys and symbols) and values of the original.
|
|
4743
|
+
*/
|
|
4744
|
+
var copyObjectLoose = SUPPORTS_SYMBOL
|
|
4745
|
+
? copyObjectLooseModern
|
|
4746
|
+
: copyObjectLooseLegacy;
|
|
4747
|
+
/**
|
|
4748
|
+
* Deeply copy the properties (keys and symbols) and values of the original, as well
|
|
4749
|
+
* as any hidden or non-enumerable properties.
|
|
4750
|
+
*/
|
|
4751
|
+
function copyObjectStrict(object, state) {
|
|
4752
|
+
var clone = getCleanClone(state.prototype);
|
|
4753
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4754
|
+
state.cache.set(object, clone);
|
|
4755
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
4756
|
+
}
|
|
4757
|
+
/**
|
|
4758
|
+
* Create a new primitive wrapper from the value of the original.
|
|
4759
|
+
*/
|
|
4760
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
4761
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
4762
|
+
}
|
|
4763
|
+
/**
|
|
4764
|
+
* Create a new RegExp based on the value and flags of the original.
|
|
4765
|
+
*/
|
|
4766
|
+
function copyRegExp(regExp, state) {
|
|
4767
|
+
var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
|
|
4768
|
+
clone.lastIndex = regExp.lastIndex;
|
|
4769
|
+
return clone;
|
|
4770
|
+
}
|
|
4771
|
+
/**
|
|
4772
|
+
* Return the original value (an identity function).
|
|
4773
|
+
*
|
|
4774
|
+
* @note
|
|
4775
|
+
* THis is used for objects that cannot be copied, such as WeakMap.
|
|
4776
|
+
*/
|
|
4777
|
+
function copySelf(value, _state) {
|
|
4778
|
+
return value;
|
|
4779
|
+
}
|
|
4780
|
+
/**
|
|
4781
|
+
* Deeply copy the values of the original.
|
|
4782
|
+
*/
|
|
4783
|
+
function copySetLoose(set, state) {
|
|
4784
|
+
var clone = new state.Constructor();
|
|
4785
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4786
|
+
state.cache.set(set, clone);
|
|
4787
|
+
set.forEach(function (value) {
|
|
4788
|
+
clone.add(state.copier(value, state));
|
|
4789
|
+
});
|
|
4790
|
+
return clone;
|
|
4791
|
+
}
|
|
4792
|
+
/**
|
|
4793
|
+
* Deeply copy the values of the original, as well as any custom properties.
|
|
4794
|
+
*/
|
|
4795
|
+
function copySetStrict(set, state) {
|
|
4796
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
4797
|
+
}
|
|
4798
|
+
|
|
4799
|
+
var isArray = Array.isArray;
|
|
4800
|
+
var assign = Object.assign, getPrototypeOf = Object.getPrototypeOf;
|
|
4801
|
+
var DEFAULT_LOOSE_OPTIONS = {
|
|
4802
|
+
array: copyArrayLoose,
|
|
4803
|
+
arrayBuffer: copyArrayBuffer,
|
|
4804
|
+
blob: copyBlob,
|
|
4805
|
+
dataView: copyDataView,
|
|
4806
|
+
date: copyDate,
|
|
4807
|
+
error: copySelf,
|
|
4808
|
+
map: copyMapLoose,
|
|
4809
|
+
object: copyObjectLoose,
|
|
4810
|
+
regExp: copyRegExp,
|
|
4811
|
+
set: copySetLoose,
|
|
4812
|
+
};
|
|
4813
|
+
var DEFAULT_STRICT_OPTIONS = assign({}, DEFAULT_LOOSE_OPTIONS, {
|
|
4814
|
+
array: copyArrayStrict,
|
|
4815
|
+
map: copyMapStrict,
|
|
4816
|
+
object: copyObjectStrict,
|
|
4817
|
+
set: copySetStrict,
|
|
4818
|
+
});
|
|
4819
|
+
/**
|
|
4820
|
+
* Get the copiers used for each specific object tag.
|
|
4821
|
+
*/
|
|
4822
|
+
function getTagSpecificCopiers(options) {
|
|
4823
|
+
return {
|
|
4824
|
+
Arguments: options.object,
|
|
4825
|
+
Array: options.array,
|
|
4826
|
+
ArrayBuffer: options.arrayBuffer,
|
|
4827
|
+
Blob: options.blob,
|
|
4828
|
+
Boolean: copyPrimitiveWrapper,
|
|
4829
|
+
DataView: options.dataView,
|
|
4830
|
+
Date: options.date,
|
|
4831
|
+
Error: options.error,
|
|
4832
|
+
Float32Array: options.arrayBuffer,
|
|
4833
|
+
Float64Array: options.arrayBuffer,
|
|
4834
|
+
Int8Array: options.arrayBuffer,
|
|
4835
|
+
Int16Array: options.arrayBuffer,
|
|
4836
|
+
Int32Array: options.arrayBuffer,
|
|
4837
|
+
Map: options.map,
|
|
4838
|
+
Number: copyPrimitiveWrapper,
|
|
4839
|
+
Object: options.object,
|
|
4840
|
+
Promise: copySelf,
|
|
4841
|
+
RegExp: options.regExp,
|
|
4842
|
+
Set: options.set,
|
|
4843
|
+
String: copyPrimitiveWrapper,
|
|
4844
|
+
WeakMap: copySelf,
|
|
4845
|
+
WeakSet: copySelf,
|
|
4846
|
+
Uint8Array: options.arrayBuffer,
|
|
4847
|
+
Uint8ClampedArray: options.arrayBuffer,
|
|
4848
|
+
Uint16Array: options.arrayBuffer,
|
|
4849
|
+
Uint32Array: options.arrayBuffer,
|
|
4850
|
+
Uint64Array: options.arrayBuffer,
|
|
4851
|
+
};
|
|
4852
|
+
}
|
|
4853
|
+
/**
|
|
4854
|
+
* Create a custom copier based on the object-specific copy methods passed.
|
|
4855
|
+
*/
|
|
4856
|
+
function createCopier(options) {
|
|
4857
|
+
var normalizedOptions = assign({}, DEFAULT_LOOSE_OPTIONS, options);
|
|
4858
|
+
var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
|
|
4859
|
+
var array = tagSpecificCopiers.Array, object = tagSpecificCopiers.Object;
|
|
4860
|
+
function copier(value, state) {
|
|
4861
|
+
state.prototype = state.Constructor = undefined;
|
|
4862
|
+
if (!value || typeof value !== 'object') {
|
|
4863
|
+
return value;
|
|
4864
|
+
}
|
|
4865
|
+
if (state.cache.has(value)) {
|
|
4866
|
+
return state.cache.get(value);
|
|
4867
|
+
}
|
|
4868
|
+
state.prototype = value.__proto__ || getPrototypeOf(value);
|
|
4869
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
4870
|
+
// plain objects
|
|
4871
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
4872
|
+
return object(value, state);
|
|
4873
|
+
}
|
|
4874
|
+
// arrays
|
|
4875
|
+
if (isArray(value)) {
|
|
4876
|
+
return array(value, state);
|
|
4877
|
+
}
|
|
4878
|
+
var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
|
|
4879
|
+
if (tagSpecificCopier) {
|
|
4880
|
+
return tagSpecificCopier(value, state);
|
|
4881
|
+
}
|
|
4882
|
+
return typeof value.then === 'function' ? value : object(value, state);
|
|
4883
|
+
}
|
|
4884
|
+
return function copy(value) {
|
|
4885
|
+
return copier(value, {
|
|
4886
|
+
Constructor: undefined,
|
|
4887
|
+
cache: createCache(),
|
|
4888
|
+
copier: copier,
|
|
4889
|
+
prototype: undefined,
|
|
4890
|
+
});
|
|
4891
|
+
};
|
|
4892
|
+
}
|
|
4893
|
+
/**
|
|
4894
|
+
* Create a custom copier based on the object-specific copy methods passed, defaulting to the
|
|
4895
|
+
* same internals as `copyStrict`.
|
|
4896
|
+
*/
|
|
4897
|
+
function createStrictCopier(options) {
|
|
4898
|
+
return createCopier(assign({}, DEFAULT_STRICT_OPTIONS, options));
|
|
4899
|
+
}
|
|
4900
|
+
/**
|
|
4901
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
4902
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
4903
|
+
* original property descriptors on both objects and arrays.
|
|
4904
|
+
*/
|
|
4905
|
+
var copyStrict = createStrictCopier({});
|
|
4906
|
+
/**
|
|
4907
|
+
* Copy an value deeply as much as possible.
|
|
4908
|
+
*/
|
|
4909
|
+
var index = createCopier({});
|
|
4910
|
+
|
|
4911
|
+
|
|
4912
|
+
//# sourceMappingURL=index.mjs.map
|
|
4913
|
+
|
|
4914
|
+
|
|
4501
4915
|
/***/ }),
|
|
4502
4916
|
|
|
4503
4917
|
/***/ "../node_modules/contentful-sdk-core/dist/index.es-modules.js":
|
|
@@ -4516,7 +4930,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4516
4930
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "freezeSys", function() { return freezeSys; });
|
|
4517
4931
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUserAgentHeader", function() { return getUserAgentHeader; });
|
|
4518
4932
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return toPlainObject; });
|
|
4519
|
-
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/
|
|
4933
|
+
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/contentful-sdk-core/node_modules/fast-copy/dist/esm/index.mjs");
|
|
4520
4934
|
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! qs */ "../node_modules/qs/lib/index.js");
|
|
4521
4935
|
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
|
|
4522
4936
|
/* harmony import */ var lodash_isstring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.isstring */ "../node_modules/lodash.isstring/index.js");
|
|
@@ -4585,7 +4999,13 @@ function _wrapRegExp() {
|
|
|
4585
4999
|
var g = _groups.get(re);
|
|
4586
5000
|
|
|
4587
5001
|
return Object.keys(g).reduce(function (groups, name) {
|
|
4588
|
-
|
|
5002
|
+
var i = g[name];
|
|
5003
|
+
if ("number" == typeof i) groups[name] = result[i];else {
|
|
5004
|
+
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++;
|
|
5005
|
+
|
|
5006
|
+
groups[name] = result[i[k]];
|
|
5007
|
+
}
|
|
5008
|
+
return groups;
|
|
4589
5009
|
}, Object.create(null));
|
|
4590
5010
|
}
|
|
4591
5011
|
|
|
@@ -4649,11 +5069,10 @@ function _inherits(subClass, superClass) {
|
|
|
4649
5069
|
}
|
|
4650
5070
|
|
|
4651
5071
|
function _setPrototypeOf(o, p) {
|
|
4652
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
5072
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
4653
5073
|
o.__proto__ = p;
|
|
4654
5074
|
return o;
|
|
4655
5075
|
};
|
|
4656
|
-
|
|
4657
5076
|
return _setPrototypeOf(o, p);
|
|
4658
5077
|
}
|
|
4659
5078
|
|
|
@@ -5273,99 +5692,513 @@ function getUserAgentHeader(sdk, application, integration, feature) {
|
|
|
5273
5692
|
}
|
|
5274
5693
|
|
|
5275
5694
|
/**
|
|
5276
|
-
* Mixes in a method to return just a plain object with no additional methods
|
|
5277
|
-
* @private
|
|
5278
|
-
* @param data - Any plain JSON response returned from the API
|
|
5279
|
-
* @return Enhanced object with toPlainObject method
|
|
5695
|
+
* Mixes in a method to return just a plain object with no additional methods
|
|
5696
|
+
* @private
|
|
5697
|
+
* @param data - Any plain JSON response returned from the API
|
|
5698
|
+
* @return Enhanced object with toPlainObject method
|
|
5699
|
+
*/
|
|
5700
|
+
|
|
5701
|
+
function toPlainObject(data) {
|
|
5702
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5703
|
+
// @ts-expect-error
|
|
5704
|
+
return Object.defineProperty(data, 'toPlainObject', {
|
|
5705
|
+
enumerable: false,
|
|
5706
|
+
configurable: false,
|
|
5707
|
+
writable: false,
|
|
5708
|
+
value: function value() {
|
|
5709
|
+
return Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
|
|
5710
|
+
}
|
|
5711
|
+
});
|
|
5712
|
+
}
|
|
5713
|
+
|
|
5714
|
+
/**
|
|
5715
|
+
* Handles errors received from the server. Parses the error into a more useful
|
|
5716
|
+
* format, places it in an exception and throws it.
|
|
5717
|
+
* See https://www.contentful.com/developers/docs/references/errors/
|
|
5718
|
+
* for more details on the data received on the errorResponse.data property
|
|
5719
|
+
* and the expected error codes.
|
|
5720
|
+
* @private
|
|
5721
|
+
*/
|
|
5722
|
+
function errorHandler(errorResponse) {
|
|
5723
|
+
var config = errorResponse.config,
|
|
5724
|
+
response = errorResponse.response;
|
|
5725
|
+
var errorName; // Obscure the Management token
|
|
5726
|
+
|
|
5727
|
+
if (config && config.headers && config.headers['Authorization']) {
|
|
5728
|
+
var token = "...".concat(config.headers['Authorization'].toString().substr(-5));
|
|
5729
|
+
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
5730
|
+
}
|
|
5731
|
+
|
|
5732
|
+
if (!lodash_isplainobject__WEBPACK_IMPORTED_MODULE_4___default()(response) || !lodash_isplainobject__WEBPACK_IMPORTED_MODULE_4___default()(config)) {
|
|
5733
|
+
throw errorResponse;
|
|
5734
|
+
}
|
|
5735
|
+
|
|
5736
|
+
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
5737
|
+
var errorData = {
|
|
5738
|
+
status: response === null || response === void 0 ? void 0 : response.status,
|
|
5739
|
+
statusText: response === null || response === void 0 ? void 0 : response.statusText,
|
|
5740
|
+
message: '',
|
|
5741
|
+
details: {}
|
|
5742
|
+
};
|
|
5743
|
+
|
|
5744
|
+
if (lodash_isplainobject__WEBPACK_IMPORTED_MODULE_4___default()(config)) {
|
|
5745
|
+
errorData.request = {
|
|
5746
|
+
url: config.url,
|
|
5747
|
+
headers: config.headers,
|
|
5748
|
+
method: config.method,
|
|
5749
|
+
payloadData: config.data
|
|
5750
|
+
};
|
|
5751
|
+
}
|
|
5752
|
+
|
|
5753
|
+
if (data && lodash_isplainobject__WEBPACK_IMPORTED_MODULE_4___default()(data)) {
|
|
5754
|
+
if ('requestId' in data) {
|
|
5755
|
+
errorData.requestId = data.requestId || 'UNKNOWN';
|
|
5756
|
+
}
|
|
5757
|
+
|
|
5758
|
+
if ('message' in data) {
|
|
5759
|
+
errorData.message = data.message || '';
|
|
5760
|
+
}
|
|
5761
|
+
|
|
5762
|
+
if ('details' in data) {
|
|
5763
|
+
errorData.details = data.details || {};
|
|
5764
|
+
}
|
|
5765
|
+
|
|
5766
|
+
if ('sys' in data) {
|
|
5767
|
+
if ('id' in data.sys) {
|
|
5768
|
+
errorName = data.sys.id;
|
|
5769
|
+
}
|
|
5770
|
+
}
|
|
5771
|
+
}
|
|
5772
|
+
|
|
5773
|
+
var error = new Error();
|
|
5774
|
+
error.name = errorName && errorName !== 'Unknown' ? errorName : "".concat(response === null || response === void 0 ? void 0 : response.status, " ").concat(response === null || response === void 0 ? void 0 : response.statusText);
|
|
5775
|
+
|
|
5776
|
+
try {
|
|
5777
|
+
error.message = JSON.stringify(errorData, null, ' ');
|
|
5778
|
+
} catch (_unused) {
|
|
5779
|
+
var _errorData$message;
|
|
5780
|
+
|
|
5781
|
+
error.message = (_errorData$message = errorData === null || errorData === void 0 ? void 0 : errorData.message) !== null && _errorData$message !== void 0 ? _errorData$message : '';
|
|
5782
|
+
}
|
|
5783
|
+
|
|
5784
|
+
throw error;
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
|
|
5788
|
+
|
|
5789
|
+
|
|
5790
|
+
/***/ }),
|
|
5791
|
+
|
|
5792
|
+
/***/ "../node_modules/contentful-sdk-core/node_modules/fast-copy/dist/esm/index.mjs":
|
|
5793
|
+
/*!*************************************************************************************!*\
|
|
5794
|
+
!*** ../node_modules/contentful-sdk-core/node_modules/fast-copy/dist/esm/index.mjs ***!
|
|
5795
|
+
\*************************************************************************************/
|
|
5796
|
+
/*! exports provided: copyStrict, createCopier, createStrictCopier, default */
|
|
5797
|
+
/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5798
|
+
|
|
5799
|
+
"use strict";
|
|
5800
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5801
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyStrict", function() { return copyStrict; });
|
|
5802
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCopier", function() { return createCopier; });
|
|
5803
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStrictCopier", function() { return createStrictCopier; });
|
|
5804
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return index; });
|
|
5805
|
+
var toStringFunction = Function.prototype.toString;
|
|
5806
|
+
var create = Object.create;
|
|
5807
|
+
var toStringObject = Object.prototype.toString;
|
|
5808
|
+
/**
|
|
5809
|
+
* @classdesc Fallback cache for when WeakMap is not natively supported
|
|
5810
|
+
*/
|
|
5811
|
+
var LegacyCache = /** @class */ (function () {
|
|
5812
|
+
function LegacyCache() {
|
|
5813
|
+
this._keys = [];
|
|
5814
|
+
this._values = [];
|
|
5815
|
+
}
|
|
5816
|
+
LegacyCache.prototype.has = function (key) {
|
|
5817
|
+
return !!~this._keys.indexOf(key);
|
|
5818
|
+
};
|
|
5819
|
+
LegacyCache.prototype.get = function (key) {
|
|
5820
|
+
return this._values[this._keys.indexOf(key)];
|
|
5821
|
+
};
|
|
5822
|
+
LegacyCache.prototype.set = function (key, value) {
|
|
5823
|
+
this._keys.push(key);
|
|
5824
|
+
this._values.push(value);
|
|
5825
|
+
};
|
|
5826
|
+
return LegacyCache;
|
|
5827
|
+
}());
|
|
5828
|
+
function createCacheLegacy() {
|
|
5829
|
+
return new LegacyCache();
|
|
5830
|
+
}
|
|
5831
|
+
function createCacheModern() {
|
|
5832
|
+
return new WeakMap();
|
|
5833
|
+
}
|
|
5834
|
+
/**
|
|
5835
|
+
* Get a new cache object to prevent circular references.
|
|
5836
|
+
*/
|
|
5837
|
+
var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
|
|
5838
|
+
/**
|
|
5839
|
+
* Get an empty version of the object with the same prototype it has.
|
|
5840
|
+
*/
|
|
5841
|
+
function getCleanClone(prototype) {
|
|
5842
|
+
if (!prototype) {
|
|
5843
|
+
return create(null);
|
|
5844
|
+
}
|
|
5845
|
+
var Constructor = prototype.constructor;
|
|
5846
|
+
if (Constructor === Object) {
|
|
5847
|
+
return prototype === Object.prototype ? {} : create(prototype);
|
|
5848
|
+
}
|
|
5849
|
+
if (~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
5850
|
+
try {
|
|
5851
|
+
return new Constructor();
|
|
5852
|
+
}
|
|
5853
|
+
catch (_a) { }
|
|
5854
|
+
}
|
|
5855
|
+
return create(prototype);
|
|
5856
|
+
}
|
|
5857
|
+
function getRegExpFlagsLegacy(regExp) {
|
|
5858
|
+
var flags = '';
|
|
5859
|
+
if (regExp.global) {
|
|
5860
|
+
flags += 'g';
|
|
5861
|
+
}
|
|
5862
|
+
if (regExp.ignoreCase) {
|
|
5863
|
+
flags += 'i';
|
|
5864
|
+
}
|
|
5865
|
+
if (regExp.multiline) {
|
|
5866
|
+
flags += 'm';
|
|
5867
|
+
}
|
|
5868
|
+
if (regExp.unicode) {
|
|
5869
|
+
flags += 'u';
|
|
5870
|
+
}
|
|
5871
|
+
if (regExp.sticky) {
|
|
5872
|
+
flags += 'y';
|
|
5873
|
+
}
|
|
5874
|
+
return flags;
|
|
5875
|
+
}
|
|
5876
|
+
function getRegExpFlagsModern(regExp) {
|
|
5877
|
+
return regExp.flags;
|
|
5878
|
+
}
|
|
5879
|
+
/**
|
|
5880
|
+
* Get the flags to apply to the copied regexp.
|
|
5881
|
+
*/
|
|
5882
|
+
var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
|
|
5883
|
+
function getTagLegacy(value) {
|
|
5884
|
+
var type = toStringObject.call(value);
|
|
5885
|
+
return type.substring(8, type.length - 1);
|
|
5886
|
+
}
|
|
5887
|
+
function getTagModern(value) {
|
|
5888
|
+
return value[Symbol.toStringTag] || getTagLegacy(value);
|
|
5889
|
+
}
|
|
5890
|
+
/**
|
|
5891
|
+
* Get the tag of the value passed, so that the correct copier can be used.
|
|
5892
|
+
*/
|
|
5893
|
+
var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
|
|
5894
|
+
|
|
5895
|
+
var defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
5896
|
+
var _a = Object.prototype, hasOwnProperty = _a.hasOwnProperty, propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
5897
|
+
var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
|
|
5898
|
+
function getStrictPropertiesModern(object) {
|
|
5899
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
5900
|
+
}
|
|
5901
|
+
/**
|
|
5902
|
+
* Get the properites used when copying objects strictly. This includes both keys and symbols.
|
|
5903
|
+
*/
|
|
5904
|
+
var getStrictProperties = SUPPORTS_SYMBOL
|
|
5905
|
+
? getStrictPropertiesModern
|
|
5906
|
+
: getOwnPropertyNames;
|
|
5907
|
+
/**
|
|
5908
|
+
* Striclty copy all properties contained on the object.
|
|
5909
|
+
*/
|
|
5910
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
5911
|
+
var properties = getStrictProperties(value);
|
|
5912
|
+
for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
|
|
5913
|
+
property = properties[index];
|
|
5914
|
+
if (property === 'callee' || property === 'caller') {
|
|
5915
|
+
continue;
|
|
5916
|
+
}
|
|
5917
|
+
descriptor = getOwnPropertyDescriptor(value, property);
|
|
5918
|
+
if (!descriptor) {
|
|
5919
|
+
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
5920
|
+
// the loose assignment.
|
|
5921
|
+
clone[property] = state.copier(value[property], state);
|
|
5922
|
+
continue;
|
|
5923
|
+
}
|
|
5924
|
+
// Only clone the value if actually a value, not a getter / setter.
|
|
5925
|
+
if (!descriptor.get && !descriptor.set) {
|
|
5926
|
+
descriptor.value = state.copier(descriptor.value, state);
|
|
5927
|
+
}
|
|
5928
|
+
try {
|
|
5929
|
+
defineProperty(clone, property, descriptor);
|
|
5930
|
+
}
|
|
5931
|
+
catch (error) {
|
|
5932
|
+
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
5933
|
+
clone[property] = descriptor.value;
|
|
5934
|
+
}
|
|
5935
|
+
}
|
|
5936
|
+
return clone;
|
|
5937
|
+
}
|
|
5938
|
+
/**
|
|
5939
|
+
* Deeply copy the indexed values in the array.
|
|
5940
|
+
*/
|
|
5941
|
+
function copyArrayLoose(array, state) {
|
|
5942
|
+
var clone = new state.Constructor();
|
|
5943
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
5944
|
+
state.cache.set(array, clone);
|
|
5945
|
+
for (var index = 0, length_2 = array.length; index < length_2; ++index) {
|
|
5946
|
+
clone[index] = state.copier(array[index], state);
|
|
5947
|
+
}
|
|
5948
|
+
return clone;
|
|
5949
|
+
}
|
|
5950
|
+
/**
|
|
5951
|
+
* Deeply copy the indexed values in the array, as well as any custom properties.
|
|
5952
|
+
*/
|
|
5953
|
+
function copyArrayStrict(array, state) {
|
|
5954
|
+
var clone = new state.Constructor();
|
|
5955
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
5956
|
+
state.cache.set(array, clone);
|
|
5957
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
5958
|
+
}
|
|
5959
|
+
/**
|
|
5960
|
+
* Copy the contents of the ArrayBuffer.
|
|
5961
|
+
*/
|
|
5962
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
5963
|
+
return arrayBuffer.slice(0);
|
|
5964
|
+
}
|
|
5965
|
+
/**
|
|
5966
|
+
* Create a new Blob with the contents of the original.
|
|
5967
|
+
*/
|
|
5968
|
+
function copyBlob(blob, _state) {
|
|
5969
|
+
return blob.slice(0, blob.size, blob.type);
|
|
5970
|
+
}
|
|
5971
|
+
/**
|
|
5972
|
+
* Create a new DataView with the contents of the original.
|
|
5973
|
+
*/
|
|
5974
|
+
function copyDataView(dataView, state) {
|
|
5975
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
5976
|
+
}
|
|
5977
|
+
/**
|
|
5978
|
+
* Create a new Date based on the time of the original.
|
|
5979
|
+
*/
|
|
5980
|
+
function copyDate(date, state) {
|
|
5981
|
+
return new state.Constructor(date.getTime());
|
|
5982
|
+
}
|
|
5983
|
+
/**
|
|
5984
|
+
* Deeply copy the keys and values of the original.
|
|
5985
|
+
*/
|
|
5986
|
+
function copyMapLoose(map, state) {
|
|
5987
|
+
var clone = new state.Constructor();
|
|
5988
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
5989
|
+
state.cache.set(map, clone);
|
|
5990
|
+
map.forEach(function (value, key) {
|
|
5991
|
+
clone.set(key, state.copier(value, state));
|
|
5992
|
+
});
|
|
5993
|
+
return clone;
|
|
5994
|
+
}
|
|
5995
|
+
/**
|
|
5996
|
+
* Deeply copy the keys and values of the original, as well as any custom properties.
|
|
5997
|
+
*/
|
|
5998
|
+
function copyMapStrict(map, state) {
|
|
5999
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
6000
|
+
}
|
|
6001
|
+
function copyObjectLooseLegacy(object, state) {
|
|
6002
|
+
var clone = getCleanClone(state.prototype);
|
|
6003
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
6004
|
+
state.cache.set(object, clone);
|
|
6005
|
+
for (var key in object) {
|
|
6006
|
+
if (hasOwnProperty.call(object, key)) {
|
|
6007
|
+
clone[key] = state.copier(object[key], state);
|
|
6008
|
+
}
|
|
6009
|
+
}
|
|
6010
|
+
return clone;
|
|
6011
|
+
}
|
|
6012
|
+
function copyObjectLooseModern(object, state) {
|
|
6013
|
+
var clone = getCleanClone(state.prototype);
|
|
6014
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
6015
|
+
state.cache.set(object, clone);
|
|
6016
|
+
for (var key in object) {
|
|
6017
|
+
if (hasOwnProperty.call(object, key)) {
|
|
6018
|
+
clone[key] = state.copier(object[key], state);
|
|
6019
|
+
}
|
|
6020
|
+
}
|
|
6021
|
+
var symbols = getOwnPropertySymbols(object);
|
|
6022
|
+
for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
|
|
6023
|
+
symbol = symbols[index];
|
|
6024
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
6025
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
6026
|
+
}
|
|
6027
|
+
}
|
|
6028
|
+
return clone;
|
|
6029
|
+
}
|
|
6030
|
+
/**
|
|
6031
|
+
* Deeply copy the properties (keys and symbols) and values of the original.
|
|
6032
|
+
*/
|
|
6033
|
+
var copyObjectLoose = SUPPORTS_SYMBOL
|
|
6034
|
+
? copyObjectLooseModern
|
|
6035
|
+
: copyObjectLooseLegacy;
|
|
6036
|
+
/**
|
|
6037
|
+
* Deeply copy the properties (keys and symbols) and values of the original, as well
|
|
6038
|
+
* as any hidden or non-enumerable properties.
|
|
6039
|
+
*/
|
|
6040
|
+
function copyObjectStrict(object, state) {
|
|
6041
|
+
var clone = getCleanClone(state.prototype);
|
|
6042
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
6043
|
+
state.cache.set(object, clone);
|
|
6044
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
6045
|
+
}
|
|
6046
|
+
/**
|
|
6047
|
+
* Create a new primitive wrapper from the value of the original.
|
|
6048
|
+
*/
|
|
6049
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
6050
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
6051
|
+
}
|
|
6052
|
+
/**
|
|
6053
|
+
* Create a new RegExp based on the value and flags of the original.
|
|
6054
|
+
*/
|
|
6055
|
+
function copyRegExp(regExp, state) {
|
|
6056
|
+
var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
|
|
6057
|
+
clone.lastIndex = regExp.lastIndex;
|
|
6058
|
+
return clone;
|
|
6059
|
+
}
|
|
6060
|
+
/**
|
|
6061
|
+
* Return the original value (an identity function).
|
|
6062
|
+
*
|
|
6063
|
+
* @note
|
|
6064
|
+
* THis is used for objects that cannot be copied, such as WeakMap.
|
|
6065
|
+
*/
|
|
6066
|
+
function copySelf(value, _state) {
|
|
6067
|
+
return value;
|
|
6068
|
+
}
|
|
6069
|
+
/**
|
|
6070
|
+
* Deeply copy the values of the original.
|
|
6071
|
+
*/
|
|
6072
|
+
function copySetLoose(set, state) {
|
|
6073
|
+
var clone = new state.Constructor();
|
|
6074
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
6075
|
+
state.cache.set(set, clone);
|
|
6076
|
+
set.forEach(function (value) {
|
|
6077
|
+
clone.add(state.copier(value, state));
|
|
6078
|
+
});
|
|
6079
|
+
return clone;
|
|
6080
|
+
}
|
|
6081
|
+
/**
|
|
6082
|
+
* Deeply copy the values of the original, as well as any custom properties.
|
|
6083
|
+
*/
|
|
6084
|
+
function copySetStrict(set, state) {
|
|
6085
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
6086
|
+
}
|
|
6087
|
+
|
|
6088
|
+
var isArray = Array.isArray;
|
|
6089
|
+
var assign = Object.assign, getPrototypeOf = Object.getPrototypeOf;
|
|
6090
|
+
var DEFAULT_LOOSE_OPTIONS = {
|
|
6091
|
+
array: copyArrayLoose,
|
|
6092
|
+
arrayBuffer: copyArrayBuffer,
|
|
6093
|
+
blob: copyBlob,
|
|
6094
|
+
dataView: copyDataView,
|
|
6095
|
+
date: copyDate,
|
|
6096
|
+
error: copySelf,
|
|
6097
|
+
map: copyMapLoose,
|
|
6098
|
+
object: copyObjectLoose,
|
|
6099
|
+
regExp: copyRegExp,
|
|
6100
|
+
set: copySetLoose,
|
|
6101
|
+
};
|
|
6102
|
+
var DEFAULT_STRICT_OPTIONS = assign({}, DEFAULT_LOOSE_OPTIONS, {
|
|
6103
|
+
array: copyArrayStrict,
|
|
6104
|
+
map: copyMapStrict,
|
|
6105
|
+
object: copyObjectStrict,
|
|
6106
|
+
set: copySetStrict,
|
|
6107
|
+
});
|
|
6108
|
+
/**
|
|
6109
|
+
* Get the copiers used for each specific object tag.
|
|
5280
6110
|
*/
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
6111
|
+
function getTagSpecificCopiers(options) {
|
|
6112
|
+
return {
|
|
6113
|
+
Arguments: options.object,
|
|
6114
|
+
Array: options.array,
|
|
6115
|
+
ArrayBuffer: options.arrayBuffer,
|
|
6116
|
+
Blob: options.blob,
|
|
6117
|
+
Boolean: copyPrimitiveWrapper,
|
|
6118
|
+
DataView: options.dataView,
|
|
6119
|
+
Date: options.date,
|
|
6120
|
+
Error: options.error,
|
|
6121
|
+
Float32Array: options.arrayBuffer,
|
|
6122
|
+
Float64Array: options.arrayBuffer,
|
|
6123
|
+
Int8Array: options.arrayBuffer,
|
|
6124
|
+
Int16Array: options.arrayBuffer,
|
|
6125
|
+
Int32Array: options.arrayBuffer,
|
|
6126
|
+
Map: options.map,
|
|
6127
|
+
Number: copyPrimitiveWrapper,
|
|
6128
|
+
Object: options.object,
|
|
6129
|
+
Promise: copySelf,
|
|
6130
|
+
RegExp: options.regExp,
|
|
6131
|
+
Set: options.set,
|
|
6132
|
+
String: copyPrimitiveWrapper,
|
|
6133
|
+
WeakMap: copySelf,
|
|
6134
|
+
WeakSet: copySelf,
|
|
6135
|
+
Uint8Array: options.arrayBuffer,
|
|
6136
|
+
Uint8ClampedArray: options.arrayBuffer,
|
|
6137
|
+
Uint16Array: options.arrayBuffer,
|
|
6138
|
+
Uint32Array: options.arrayBuffer,
|
|
6139
|
+
Uint64Array: options.arrayBuffer,
|
|
6140
|
+
};
|
|
5293
6141
|
}
|
|
5294
|
-
|
|
5295
6142
|
/**
|
|
5296
|
-
*
|
|
5297
|
-
* format, places it in an exception and throws it.
|
|
5298
|
-
* See https://www.contentful.com/developers/docs/references/errors/
|
|
5299
|
-
* for more details on the data received on the errorResponse.data property
|
|
5300
|
-
* and the expected error codes.
|
|
5301
|
-
* @private
|
|
6143
|
+
* Create a custom copier based on the object-specific copy methods passed.
|
|
5302
6144
|
*/
|
|
5303
|
-
function
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
6145
|
+
function createCopier(options) {
|
|
6146
|
+
var normalizedOptions = assign({}, DEFAULT_LOOSE_OPTIONS, options);
|
|
6147
|
+
var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
|
|
6148
|
+
var array = tagSpecificCopiers.Array, object = tagSpecificCopiers.Object;
|
|
6149
|
+
function copier(value, state) {
|
|
6150
|
+
state.prototype = state.Constructor = undefined;
|
|
6151
|
+
if (!value || typeof value !== 'object') {
|
|
6152
|
+
return value;
|
|
6153
|
+
}
|
|
6154
|
+
if (state.cache.has(value)) {
|
|
6155
|
+
return state.cache.get(value);
|
|
6156
|
+
}
|
|
6157
|
+
state.prototype = value.__proto__ || getPrototypeOf(value);
|
|
6158
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
6159
|
+
// plain objects
|
|
6160
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
6161
|
+
return object(value, state);
|
|
6162
|
+
}
|
|
6163
|
+
// arrays
|
|
6164
|
+
if (isArray(value)) {
|
|
6165
|
+
return array(value, state);
|
|
6166
|
+
}
|
|
6167
|
+
var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
|
|
6168
|
+
if (tagSpecificCopier) {
|
|
6169
|
+
return tagSpecificCopier(value, state);
|
|
6170
|
+
}
|
|
6171
|
+
return typeof value.then === 'function' ? value : object(value, state);
|
|
6172
|
+
}
|
|
6173
|
+
return function copy(value) {
|
|
6174
|
+
return copier(value, {
|
|
6175
|
+
Constructor: undefined,
|
|
6176
|
+
cache: createCache(),
|
|
6177
|
+
copier: copier,
|
|
6178
|
+
prototype: undefined,
|
|
6179
|
+
});
|
|
5331
6180
|
};
|
|
5332
|
-
}
|
|
5333
|
-
|
|
5334
|
-
if (data && lodash_isplainobject__WEBPACK_IMPORTED_MODULE_4___default()(data)) {
|
|
5335
|
-
if ('requestId' in data) {
|
|
5336
|
-
errorData.requestId = data.requestId || 'UNKNOWN';
|
|
5337
|
-
}
|
|
5338
|
-
|
|
5339
|
-
if ('message' in data) {
|
|
5340
|
-
errorData.message = data.message || '';
|
|
5341
|
-
}
|
|
5342
|
-
|
|
5343
|
-
if ('details' in data) {
|
|
5344
|
-
errorData.details = data.details || {};
|
|
5345
|
-
}
|
|
5346
|
-
|
|
5347
|
-
if ('sys' in data) {
|
|
5348
|
-
if ('id' in data.sys) {
|
|
5349
|
-
errorName = data.sys.id;
|
|
5350
|
-
}
|
|
5351
|
-
}
|
|
5352
|
-
}
|
|
5353
|
-
|
|
5354
|
-
var error = new Error();
|
|
5355
|
-
error.name = errorName && errorName !== 'Unknown' ? errorName : "".concat(response === null || response === void 0 ? void 0 : response.status, " ").concat(response === null || response === void 0 ? void 0 : response.statusText);
|
|
5356
|
-
|
|
5357
|
-
try {
|
|
5358
|
-
error.message = JSON.stringify(errorData, null, ' ');
|
|
5359
|
-
} catch (_unused) {
|
|
5360
|
-
var _errorData$message;
|
|
5361
|
-
|
|
5362
|
-
error.message = (_errorData$message = errorData === null || errorData === void 0 ? void 0 : errorData.message) !== null && _errorData$message !== void 0 ? _errorData$message : '';
|
|
5363
|
-
}
|
|
5364
|
-
|
|
5365
|
-
throw error;
|
|
5366
6181
|
}
|
|
6182
|
+
/**
|
|
6183
|
+
* Create a custom copier based on the object-specific copy methods passed, defaulting to the
|
|
6184
|
+
* same internals as `copyStrict`.
|
|
6185
|
+
*/
|
|
6186
|
+
function createStrictCopier(options) {
|
|
6187
|
+
return createCopier(assign({}, DEFAULT_STRICT_OPTIONS, options));
|
|
6188
|
+
}
|
|
6189
|
+
/**
|
|
6190
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
6191
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
6192
|
+
* original property descriptors on both objects and arrays.
|
|
6193
|
+
*/
|
|
6194
|
+
var copyStrict = createStrictCopier({});
|
|
6195
|
+
/**
|
|
6196
|
+
* Copy an value deeply as much as possible.
|
|
6197
|
+
*/
|
|
6198
|
+
var index = createCopier({});
|
|
5367
6199
|
|
|
5368
6200
|
|
|
6201
|
+
//# sourceMappingURL=index.mjs.map
|
|
5369
6202
|
|
|
5370
6203
|
|
|
5371
6204
|
/***/ }),
|
|
@@ -10041,11 +10874,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10041
10874
|
/* harmony import */ var _create_contentful_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-contentful-api */ "./create-contentful-api.js");
|
|
10042
10875
|
/* harmony import */ var _create_global_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./create-global-options */ "./create-global-options.js");
|
|
10043
10876
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10044
|
-
|
|
10045
10877
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10046
|
-
|
|
10047
10878
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10048
|
-
|
|
10049
10879
|
/**
|
|
10050
10880
|
* Contentful Delivery API SDK. Allows you to create instances of a client
|
|
10051
10881
|
* with access to the Contentful Content Delivery API.
|
|
@@ -10056,6 +10886,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
10056
10886
|
|
|
10057
10887
|
|
|
10058
10888
|
|
|
10889
|
+
|
|
10890
|
+
|
|
10059
10891
|
/**
|
|
10060
10892
|
* Create a client instance
|
|
10061
10893
|
* @func
|
|
@@ -10094,21 +10926,17 @@ function createClient(params) {
|
|
|
10094
10926
|
if (!params.accessToken) {
|
|
10095
10927
|
throw new TypeError('Expected parameter accessToken');
|
|
10096
10928
|
}
|
|
10097
|
-
|
|
10098
10929
|
if (!params.space) {
|
|
10099
10930
|
throw new TypeError('Expected parameter space');
|
|
10100
10931
|
}
|
|
10101
|
-
|
|
10102
10932
|
const defaultConfig = {
|
|
10103
10933
|
resolveLinks: true,
|
|
10104
10934
|
removeUnresolved: false,
|
|
10105
10935
|
defaultHostname: 'cdn.contentful.com',
|
|
10106
10936
|
environment: 'master'
|
|
10107
10937
|
};
|
|
10108
|
-
|
|
10109
10938
|
const config = _objectSpread(_objectSpread({}, defaultConfig), params);
|
|
10110
|
-
|
|
10111
|
-
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.2.5"}`, config.application, config.integration);
|
|
10939
|
+
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.2.7"}`, config.application, config.integration);
|
|
10112
10940
|
config.headers = _objectSpread(_objectSpread({}, config.headers), {}, {
|
|
10113
10941
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10114
10942
|
'X-Contentful-User-Agent': userAgentHeader
|
|
@@ -10120,8 +10948,8 @@ function createClient(params) {
|
|
|
10120
10948
|
removeUnresolved: config.removeUnresolved,
|
|
10121
10949
|
spaceBaseUrl: http.defaults.baseURL,
|
|
10122
10950
|
environmentBaseUrl: `${http.defaults.baseURL}environments/${config.environment}`
|
|
10123
|
-
});
|
|
10124
|
-
|
|
10951
|
+
});
|
|
10952
|
+
// Append environment to baseURL
|
|
10125
10953
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10126
10954
|
return Object(_create_contentful_api__WEBPACK_IMPORTED_MODULE_2__["default"])({
|
|
10127
10955
|
http,
|
|
@@ -10147,11 +10975,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10147
10975
|
/* harmony import */ var _utils_normalize_select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/normalize-select */ "./utils/normalize-select.js");
|
|
10148
10976
|
/* harmony import */ var _utils_validate_timestamp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/validate-timestamp */ "./utils/validate-timestamp.js");
|
|
10149
10977
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10150
|
-
|
|
10151
10978
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10152
|
-
|
|
10153
10979
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10154
|
-
|
|
10155
10980
|
/**
|
|
10156
10981
|
* Contentful Delivery API Client. Contains methods which allow access to the
|
|
10157
10982
|
* different kinds of entities present in Contentful (Entries, Assets, etc).
|
|
@@ -10215,7 +11040,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
10215
11040
|
|
|
10216
11041
|
|
|
10217
11042
|
|
|
11043
|
+
|
|
10218
11044
|
const ASSET_KEY_MAX_LIFETIME = 48 * 60 * 60;
|
|
11045
|
+
|
|
10219
11046
|
/**
|
|
10220
11047
|
* Creates API object with methods to access functionality from Contentful's
|
|
10221
11048
|
* Delivery API
|
|
@@ -10226,7 +11053,6 @@ const ASSET_KEY_MAX_LIFETIME = 48 * 60 * 60;
|
|
|
10226
11053
|
* @prop {Function} getGlobalOptions - Link resolver preconfigured with global setting
|
|
10227
11054
|
* @return {ClientAPI}
|
|
10228
11055
|
*/
|
|
10229
|
-
|
|
10230
11056
|
function createContentfulApi({
|
|
10231
11057
|
http,
|
|
10232
11058
|
getGlobalOptions
|
|
@@ -10256,7 +11082,6 @@ function createContentfulApi({
|
|
|
10256
11082
|
const {
|
|
10257
11083
|
wrapLocaleCollection
|
|
10258
11084
|
} = _entities__WEBPACK_IMPORTED_MODULE_1__["default"].locale;
|
|
10259
|
-
|
|
10260
11085
|
const notFoundError = id => {
|
|
10261
11086
|
const error = new Error('The resource could not be found.');
|
|
10262
11087
|
error.sys = {
|
|
@@ -10271,6 +11096,7 @@ function createContentfulApi({
|
|
|
10271
11096
|
};
|
|
10272
11097
|
return error;
|
|
10273
11098
|
};
|
|
11099
|
+
|
|
10274
11100
|
/**
|
|
10275
11101
|
* Gets the Space which the client is currently configured to use
|
|
10276
11102
|
* @memberof ContentfulClientAPI
|
|
@@ -10286,11 +11112,8 @@ function createContentfulApi({
|
|
|
10286
11112
|
* const space = await client.getSpace()
|
|
10287
11113
|
* console.log(space)
|
|
10288
11114
|
*/
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
11115
|
async function getSpace() {
|
|
10292
11116
|
switchToSpace(http);
|
|
10293
|
-
|
|
10294
11117
|
try {
|
|
10295
11118
|
const response = await http.get('/');
|
|
10296
11119
|
return wrapSpace(response.data);
|
|
@@ -10298,6 +11121,7 @@ function createContentfulApi({
|
|
|
10298
11121
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10299
11122
|
}
|
|
10300
11123
|
}
|
|
11124
|
+
|
|
10301
11125
|
/**
|
|
10302
11126
|
* Gets a Content Type
|
|
10303
11127
|
* @memberof ContentfulClientAPI
|
|
@@ -10314,11 +11138,8 @@ function createContentfulApi({
|
|
|
10314
11138
|
* const contentType = await client.getContentType('<content_type_id>')
|
|
10315
11139
|
* console.log(contentType)
|
|
10316
11140
|
*/
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
11141
|
async function getContentType(id) {
|
|
10320
11142
|
switchToEnvironment(http);
|
|
10321
|
-
|
|
10322
11143
|
try {
|
|
10323
11144
|
const response = await http.get(`content_types/${id}`);
|
|
10324
11145
|
return wrapContentType(response.data);
|
|
@@ -10326,6 +11147,7 @@ function createContentfulApi({
|
|
|
10326
11147
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10327
11148
|
}
|
|
10328
11149
|
}
|
|
11150
|
+
|
|
10329
11151
|
/**
|
|
10330
11152
|
* Gets a collection of Content Types
|
|
10331
11153
|
* @memberof ContentfulClientAPI
|
|
@@ -10342,11 +11164,8 @@ function createContentfulApi({
|
|
|
10342
11164
|
* const response = await client.getContentTypes()
|
|
10343
11165
|
* console.log(response.items)
|
|
10344
11166
|
*/
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
11167
|
async function getContentTypes(query = {}) {
|
|
10348
11168
|
switchToEnvironment(http);
|
|
10349
|
-
|
|
10350
11169
|
try {
|
|
10351
11170
|
const response = await http.get('content_types', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10352
11171
|
query: query
|
|
@@ -10356,6 +11175,7 @@ function createContentfulApi({
|
|
|
10356
11175
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10357
11176
|
}
|
|
10358
11177
|
}
|
|
11178
|
+
|
|
10359
11179
|
/**
|
|
10360
11180
|
* Gets an Entry
|
|
10361
11181
|
* @memberof ContentfulClientAPI
|
|
@@ -10373,18 +11193,14 @@ function createContentfulApi({
|
|
|
10373
11193
|
* const entry = await client.getEntry('<entry_id>')
|
|
10374
11194
|
* console.log(entry)
|
|
10375
11195
|
*/
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
11196
|
async function getEntry(id, query = {}) {
|
|
10379
11197
|
if (!id) {
|
|
10380
11198
|
throw notFoundError(id);
|
|
10381
11199
|
}
|
|
10382
|
-
|
|
10383
11200
|
try {
|
|
10384
11201
|
const response = await this.getEntries(_objectSpread({
|
|
10385
11202
|
'sys.id': id
|
|
10386
11203
|
}, query));
|
|
10387
|
-
|
|
10388
11204
|
if (response.items.length > 0) {
|
|
10389
11205
|
return wrapEntry(response.items[0]);
|
|
10390
11206
|
} else {
|
|
@@ -10394,6 +11210,7 @@ function createContentfulApi({
|
|
|
10394
11210
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10395
11211
|
}
|
|
10396
11212
|
}
|
|
11213
|
+
|
|
10397
11214
|
/**
|
|
10398
11215
|
* Gets a collection of Entries
|
|
10399
11216
|
* @memberof ContentfulClientAPI
|
|
@@ -10410,8 +11227,6 @@ function createContentfulApi({
|
|
|
10410
11227
|
* const response = await client.getEntries()
|
|
10411
11228
|
* console.log(response.items)
|
|
10412
11229
|
*/
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
11230
|
async function getEntries(query = {}) {
|
|
10416
11231
|
switchToEnvironment(http);
|
|
10417
11232
|
const {
|
|
@@ -10419,7 +11234,6 @@ function createContentfulApi({
|
|
|
10419
11234
|
removeUnresolved
|
|
10420
11235
|
} = getGlobalOptions(query);
|
|
10421
11236
|
query = Object(_utils_normalize_select__WEBPACK_IMPORTED_MODULE_3__["default"])(query);
|
|
10422
|
-
|
|
10423
11237
|
try {
|
|
10424
11238
|
const response = await http.get('entries', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10425
11239
|
query: query
|
|
@@ -10449,12 +11263,9 @@ function createContentfulApi({
|
|
|
10449
11263
|
* const asset = await client.getAsset('<asset_id>')
|
|
10450
11264
|
* console.log(asset)
|
|
10451
11265
|
*/
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
11266
|
async function getAsset(id, query = {}) {
|
|
10455
11267
|
switchToEnvironment(http);
|
|
10456
11268
|
query = Object(_utils_normalize_select__WEBPACK_IMPORTED_MODULE_3__["default"])(query);
|
|
10457
|
-
|
|
10458
11269
|
try {
|
|
10459
11270
|
const response = await http.get(`assets/${id}`, Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10460
11271
|
query: query
|
|
@@ -10464,6 +11275,7 @@ function createContentfulApi({
|
|
|
10464
11275
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10465
11276
|
}
|
|
10466
11277
|
}
|
|
11278
|
+
|
|
10467
11279
|
/**
|
|
10468
11280
|
* Gets a collection of Assets
|
|
10469
11281
|
* @memberof ContentfulClientAPI
|
|
@@ -10480,12 +11292,9 @@ function createContentfulApi({
|
|
|
10480
11292
|
* const response = await client.getAssets()
|
|
10481
11293
|
* console.log(response.items)
|
|
10482
11294
|
*/
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
11295
|
async function getAssets(query = {}) {
|
|
10486
11296
|
switchToEnvironment(http);
|
|
10487
11297
|
query = Object(_utils_normalize_select__WEBPACK_IMPORTED_MODULE_3__["default"])(query);
|
|
10488
|
-
|
|
10489
11298
|
try {
|
|
10490
11299
|
const response = await http.get('assets', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10491
11300
|
query: query
|
|
@@ -10495,6 +11304,7 @@ function createContentfulApi({
|
|
|
10495
11304
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10496
11305
|
}
|
|
10497
11306
|
}
|
|
11307
|
+
|
|
10498
11308
|
/**
|
|
10499
11309
|
* Gets a Tag
|
|
10500
11310
|
* @memberof ContentfulClientAPI
|
|
@@ -10511,11 +11321,8 @@ function createContentfulApi({
|
|
|
10511
11321
|
* const tag = await client.getTag('<asset_id>')
|
|
10512
11322
|
* console.log(tag)
|
|
10513
11323
|
*/
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
11324
|
async function getTag(id) {
|
|
10517
11325
|
switchToEnvironment(http);
|
|
10518
|
-
|
|
10519
11326
|
try {
|
|
10520
11327
|
const response = await http.get(`tags/${id}`);
|
|
10521
11328
|
return wrapTag(response.data);
|
|
@@ -10523,6 +11330,7 @@ function createContentfulApi({
|
|
|
10523
11330
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10524
11331
|
}
|
|
10525
11332
|
}
|
|
11333
|
+
|
|
10526
11334
|
/**
|
|
10527
11335
|
* Gets a collection of Tags
|
|
10528
11336
|
* @memberof ContentfulClientAPI
|
|
@@ -10539,12 +11347,9 @@ function createContentfulApi({
|
|
|
10539
11347
|
* const response = await client.getTags()
|
|
10540
11348
|
* console.log(response.items)
|
|
10541
11349
|
*/
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
11350
|
async function getTags(query = {}) {
|
|
10545
11351
|
switchToEnvironment(http);
|
|
10546
11352
|
query = Object(_utils_normalize_select__WEBPACK_IMPORTED_MODULE_3__["default"])(query);
|
|
10547
|
-
|
|
10548
11353
|
try {
|
|
10549
11354
|
const response = await http.get('tags', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10550
11355
|
query: query
|
|
@@ -10554,6 +11359,7 @@ function createContentfulApi({
|
|
|
10554
11359
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10555
11360
|
}
|
|
10556
11361
|
}
|
|
11362
|
+
|
|
10557
11363
|
/**
|
|
10558
11364
|
* Creates an asset key for signing asset URLs (Embargoed Assets)
|
|
10559
11365
|
* @memberof ContentfulClientAPI
|
|
@@ -10570,11 +11376,8 @@ function createContentfulApi({
|
|
|
10570
11376
|
* const assetKey = await client.getAssetKey(<UNIX timestamp>)
|
|
10571
11377
|
* console.log(assetKey)
|
|
10572
11378
|
*/
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
11379
|
async function createAssetKey(expiresAt) {
|
|
10576
11380
|
switchToEnvironment(http);
|
|
10577
|
-
|
|
10578
11381
|
try {
|
|
10579
11382
|
const now = Math.floor(Date.now() / 1000);
|
|
10580
11383
|
const currentMaxLifetime = now + ASSET_KEY_MAX_LIFETIME;
|
|
@@ -10591,6 +11394,7 @@ function createContentfulApi({
|
|
|
10591
11394
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10592
11395
|
}
|
|
10593
11396
|
}
|
|
11397
|
+
|
|
10594
11398
|
/**
|
|
10595
11399
|
* Gets a collection of Locale
|
|
10596
11400
|
* @memberof ContentfulClientAPI
|
|
@@ -10607,11 +11411,8 @@ function createContentfulApi({
|
|
|
10607
11411
|
* const response = await client.getLocales()
|
|
10608
11412
|
* console.log(response.items)
|
|
10609
11413
|
*/
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
11414
|
async function getLocales(query = {}) {
|
|
10613
11415
|
switchToEnvironment(http);
|
|
10614
|
-
|
|
10615
11416
|
try {
|
|
10616
11417
|
const response = await http.get('locales', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
10617
11418
|
query: query
|
|
@@ -10621,6 +11422,7 @@ function createContentfulApi({
|
|
|
10621
11422
|
Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["errorHandler"])(error);
|
|
10622
11423
|
}
|
|
10623
11424
|
}
|
|
11425
|
+
|
|
10624
11426
|
/**
|
|
10625
11427
|
* Synchronizes either all the content or only new content since last sync
|
|
10626
11428
|
* See <a href="https://www.contentful.com/developers/docs/concepts/sync/">Synchronization</a> for more information.
|
|
@@ -10654,8 +11456,6 @@ function createContentfulApi({
|
|
|
10654
11456
|
* nextSyncToken: response.nextSyncToken
|
|
10655
11457
|
* })
|
|
10656
11458
|
*/
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
11459
|
async function sync(query = {}, options = {
|
|
10660
11460
|
paginate: true
|
|
10661
11461
|
}) {
|
|
@@ -10669,6 +11469,7 @@ function createContentfulApi({
|
|
|
10669
11469
|
removeUnresolved
|
|
10670
11470
|
}, options));
|
|
10671
11471
|
}
|
|
11472
|
+
|
|
10672
11473
|
/**
|
|
10673
11474
|
* Parse raw json data into collection of entry objects.Links will be resolved also
|
|
10674
11475
|
* @memberof ContentfulClientAPI
|
|
@@ -10699,8 +11500,6 @@ function createContentfulApi({
|
|
|
10699
11500
|
* let parsedData = client.parseEntries(data);
|
|
10700
11501
|
* console.log( parsedData.items[0].fields.foo ); // foo
|
|
10701
11502
|
*/
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
11503
|
function parseEntries(data) {
|
|
10705
11504
|
const {
|
|
10706
11505
|
resolveLinks,
|
|
@@ -10711,23 +11510,20 @@ function createContentfulApi({
|
|
|
10711
11510
|
removeUnresolved
|
|
10712
11511
|
});
|
|
10713
11512
|
}
|
|
11513
|
+
|
|
10714
11514
|
/*
|
|
10715
11515
|
* Switches BaseURL to use /environments path
|
|
10716
11516
|
* */
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
11517
|
function switchToEnvironment(http) {
|
|
10720
11518
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10721
11519
|
}
|
|
11520
|
+
|
|
10722
11521
|
/*
|
|
10723
11522
|
* Switches BaseURL to use /spaces path
|
|
10724
11523
|
* */
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
11524
|
function switchToSpace(http) {
|
|
10728
11525
|
http.defaults.baseURL = getGlobalOptions().spaceBaseUrl;
|
|
10729
11526
|
}
|
|
10730
|
-
|
|
10731
11527
|
return {
|
|
10732
11528
|
getSpace,
|
|
10733
11529
|
getContentType,
|
|
@@ -10790,6 +11586,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10790
11586
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
10791
11587
|
|
|
10792
11588
|
|
|
11589
|
+
|
|
10793
11590
|
/**
|
|
10794
11591
|
* @memberof Entities
|
|
10795
11592
|
* @typedef AssetKey
|
|
@@ -10803,7 +11600,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10803
11600
|
* @param {Object} data - Raw asset key data
|
|
10804
11601
|
* @return {Asset} Wrapped asset key data
|
|
10805
11602
|
*/
|
|
10806
|
-
|
|
10807
11603
|
function wrapAssetKey(data) {
|
|
10808
11604
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
10809
11605
|
}
|
|
@@ -10825,6 +11621,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10825
11621
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
10826
11622
|
|
|
10827
11623
|
|
|
11624
|
+
|
|
10828
11625
|
/**
|
|
10829
11626
|
* @memberof Entities
|
|
10830
11627
|
* @typedef Asset
|
|
@@ -10846,10 +11643,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10846
11643
|
* @param {Object} data - Raw asset data
|
|
10847
11644
|
* @return {Asset} Wrapped asset data
|
|
10848
11645
|
*/
|
|
10849
|
-
|
|
10850
11646
|
function wrapAsset(data) {
|
|
10851
11647
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
10852
11648
|
}
|
|
11649
|
+
|
|
10853
11650
|
/**
|
|
10854
11651
|
* @memberof Entities
|
|
10855
11652
|
* @typedef AssetCollection
|
|
@@ -10865,7 +11662,6 @@ function wrapAsset(data) {
|
|
|
10865
11662
|
* @param {Object} data - Raw asset collection data
|
|
10866
11663
|
* @return {AssetCollection} Wrapped asset collection data
|
|
10867
11664
|
*/
|
|
10868
|
-
|
|
10869
11665
|
function wrapAssetCollection(data) {
|
|
10870
11666
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
10871
11667
|
}
|
|
@@ -10887,6 +11683,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10887
11683
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
10888
11684
|
|
|
10889
11685
|
|
|
11686
|
+
|
|
10890
11687
|
/**
|
|
10891
11688
|
* @memberof Entities
|
|
10892
11689
|
* @typedef ContentType
|
|
@@ -10903,10 +11700,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10903
11700
|
* @param {Object} data - Raw content type data
|
|
10904
11701
|
* @return {ContentType} Wrapped content type data
|
|
10905
11702
|
*/
|
|
10906
|
-
|
|
10907
11703
|
function wrapContentType(data) {
|
|
10908
11704
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
10909
11705
|
}
|
|
11706
|
+
|
|
10910
11707
|
/**
|
|
10911
11708
|
* @memberof Entities
|
|
10912
11709
|
* @typedef ContentTypeCollection
|
|
@@ -10922,7 +11719,6 @@ function wrapContentType(data) {
|
|
|
10922
11719
|
* @param {Object} data - Raw content type collection data
|
|
10923
11720
|
* @return {ContentTypeCollection} Wrapped content type collection data
|
|
10924
11721
|
*/
|
|
10925
|
-
|
|
10926
11722
|
function wrapContentTypeCollection(data) {
|
|
10927
11723
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
10928
11724
|
}
|
|
@@ -10948,6 +11744,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10948
11744
|
|
|
10949
11745
|
|
|
10950
11746
|
|
|
11747
|
+
|
|
10951
11748
|
/**
|
|
10952
11749
|
* Types of fields found in an Entry
|
|
10953
11750
|
* @namespace EntryFields
|
|
@@ -11018,10 +11815,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11018
11815
|
* @param {Object} data - Raw entry data
|
|
11019
11816
|
* @return {Entry} Wrapped entry data
|
|
11020
11817
|
*/
|
|
11021
|
-
|
|
11022
11818
|
function wrapEntry(data) {
|
|
11023
11819
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11024
11820
|
}
|
|
11821
|
+
|
|
11025
11822
|
/**
|
|
11026
11823
|
* @memberof Entities
|
|
11027
11824
|
* @typedef EntryCollection
|
|
@@ -11042,20 +11839,17 @@ function wrapEntry(data) {
|
|
|
11042
11839
|
* @param {Object} options - wrapper options
|
|
11043
11840
|
* @return {EntryCollection} Wrapped entry collection data
|
|
11044
11841
|
*/
|
|
11045
|
-
|
|
11046
11842
|
function wrapEntryCollection(data, {
|
|
11047
11843
|
resolveLinks,
|
|
11048
11844
|
removeUnresolved
|
|
11049
11845
|
}) {
|
|
11050
11846
|
const wrappedData = Object(_mixins_stringify_safe__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11051
|
-
|
|
11052
11847
|
if (resolveLinks) {
|
|
11053
11848
|
wrappedData.items = Object(contentful_resolve_response__WEBPACK_IMPORTED_MODULE_3__["default"])(wrappedData, {
|
|
11054
11849
|
removeUnresolved,
|
|
11055
11850
|
itemEntryPoints: ['fields']
|
|
11056
11851
|
});
|
|
11057
11852
|
}
|
|
11058
|
-
|
|
11059
11853
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(wrappedData);
|
|
11060
11854
|
}
|
|
11061
11855
|
|
|
@@ -11111,6 +11905,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11111
11905
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
11112
11906
|
|
|
11113
11907
|
|
|
11908
|
+
|
|
11114
11909
|
/**
|
|
11115
11910
|
* @memberof Entities
|
|
11116
11911
|
* @typedef Locale
|
|
@@ -11128,10 +11923,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11128
11923
|
* @param {Object} data - Raw locale data
|
|
11129
11924
|
* @return {Locale} Wrapped locale data
|
|
11130
11925
|
*/
|
|
11131
|
-
|
|
11132
11926
|
function wrapLocale(data) {
|
|
11133
11927
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11134
11928
|
}
|
|
11929
|
+
|
|
11135
11930
|
/**
|
|
11136
11931
|
* @memberof Entities
|
|
11137
11932
|
* @typedef LocaleCollection
|
|
@@ -11147,7 +11942,6 @@ function wrapLocale(data) {
|
|
|
11147
11942
|
* @param {Object} data - Raw locale collection data
|
|
11148
11943
|
* @return {LocaleCollection} Wrapped locale collection data
|
|
11149
11944
|
*/
|
|
11150
|
-
|
|
11151
11945
|
function wrapLocaleCollection(data) {
|
|
11152
11946
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11153
11947
|
}
|
|
@@ -11166,6 +11960,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11166
11960
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapSpace", function() { return wrapSpace; });
|
|
11167
11961
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
11168
11962
|
|
|
11963
|
+
|
|
11169
11964
|
/**
|
|
11170
11965
|
* @memberof Entities
|
|
11171
11966
|
* @typedef Space
|
|
@@ -11182,7 +11977,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11182
11977
|
* @param {Object} data - API response for a Space
|
|
11183
11978
|
* @return {Space}
|
|
11184
11979
|
*/
|
|
11185
|
-
|
|
11186
11980
|
function wrapSpace(data) {
|
|
11187
11981
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(data));
|
|
11188
11982
|
}
|
|
@@ -11204,6 +11998,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11204
11998
|
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
|
|
11205
11999
|
|
|
11206
12000
|
|
|
12001
|
+
|
|
11207
12002
|
/**
|
|
11208
12003
|
* @memberof Entities
|
|
11209
12004
|
* @typedef Tag
|
|
@@ -11217,10 +12012,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11217
12012
|
* @param {Object} data - Raw tag data
|
|
11218
12013
|
* @return {Tag} Wrapped tag data
|
|
11219
12014
|
*/
|
|
11220
|
-
|
|
11221
12015
|
function wrapTag(data) {
|
|
11222
12016
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11223
12017
|
}
|
|
12018
|
+
|
|
11224
12019
|
/**
|
|
11225
12020
|
* @memberof Entities
|
|
11226
12021
|
* @typedef TagCollection
|
|
@@ -11236,7 +12031,6 @@ function wrapTag(data) {
|
|
|
11236
12031
|
* @param {Object} data - Raw tag collection data
|
|
11237
12032
|
* @return {TagCollection} Wrapped tag collection data
|
|
11238
12033
|
*/
|
|
11239
|
-
|
|
11240
12034
|
function wrapTagCollection(data) {
|
|
11241
12035
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["freezeSys"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["toPlainObject"])(Object(fast_copy__WEBPACK_IMPORTED_MODULE_0__["default"])(data)));
|
|
11242
12036
|
}
|
|
@@ -11292,11 +12086,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11292
12086
|
/* harmony import */ var contentful_resolve_response__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! contentful-resolve-response */ "../node_modules/contentful-resolve-response/dist/esm/index.js");
|
|
11293
12087
|
/* harmony import */ var _mixins_stringify_safe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mixins/stringify-safe */ "./mixins/stringify-safe.js");
|
|
11294
12088
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11295
|
-
|
|
11296
12089
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11297
|
-
|
|
11298
12090
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11299
|
-
|
|
11300
12091
|
/**
|
|
11301
12092
|
* See <a href="https://www.contentful.com/developers/docs/concepts/sync/">Synchronization</a> for more information.
|
|
11302
12093
|
* @namespace Sync
|
|
@@ -11304,6 +12095,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
11304
12095
|
|
|
11305
12096
|
|
|
11306
12097
|
|
|
12098
|
+
|
|
11307
12099
|
/**
|
|
11308
12100
|
* @memberof Sync
|
|
11309
12101
|
* @typedef SyncCollection
|
|
@@ -11341,72 +12133,61 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
11341
12133
|
* @param {boolean} [options.paginate = true] - If further sync pages should automatically be crawled
|
|
11342
12134
|
* @return {Promise<SyncCollection>}
|
|
11343
12135
|
*/
|
|
11344
|
-
|
|
11345
12136
|
async function pagedSync(http, query, options = {}) {
|
|
11346
12137
|
if (!query || !query.initial && !query.nextSyncToken && !query.nextPageToken) {
|
|
11347
12138
|
throw new Error('Please provide one of `initial`, `nextSyncToken` or `nextPageToken` parameters for syncing');
|
|
11348
12139
|
}
|
|
11349
|
-
|
|
11350
12140
|
if (query && query.content_type && !query.type) {
|
|
11351
12141
|
query.type = 'Entry';
|
|
11352
12142
|
} else if (query && query.content_type && query.type && query.type !== 'Entry') {
|
|
11353
12143
|
throw new Error('When using the `content_type` filter your `type` parameter cannot be different from `Entry`.');
|
|
11354
12144
|
}
|
|
11355
|
-
|
|
11356
12145
|
const defaultOptions = {
|
|
11357
12146
|
resolveLinks: true,
|
|
11358
12147
|
removeUnresolved: false,
|
|
11359
12148
|
paginate: true
|
|
11360
12149
|
};
|
|
11361
|
-
|
|
11362
12150
|
const {
|
|
11363
12151
|
resolveLinks,
|
|
11364
12152
|
removeUnresolved,
|
|
11365
12153
|
paginate
|
|
11366
12154
|
} = _objectSpread(_objectSpread({}, defaultOptions), options);
|
|
11367
|
-
|
|
11368
12155
|
const syncOptions = {
|
|
11369
12156
|
paginate
|
|
11370
12157
|
};
|
|
11371
|
-
const response = await getSyncPage(http, [], query, syncOptions);
|
|
11372
|
-
|
|
12158
|
+
const response = await getSyncPage(http, [], query, syncOptions);
|
|
12159
|
+
// clones response.items used in includes because we don't want these to be mutated
|
|
11373
12160
|
if (resolveLinks) {
|
|
11374
12161
|
response.items = Object(contentful_resolve_response__WEBPACK_IMPORTED_MODULE_1__["default"])(response, {
|
|
11375
12162
|
removeUnresolved,
|
|
11376
12163
|
itemEntryPoints: ['fields']
|
|
11377
12164
|
});
|
|
11378
|
-
}
|
|
11379
|
-
|
|
11380
|
-
|
|
12165
|
+
}
|
|
12166
|
+
// maps response items again after getters are attached
|
|
11381
12167
|
const mappedResponseItems = mapResponseItems(response.items);
|
|
11382
|
-
|
|
11383
12168
|
if (response.nextSyncToken) {
|
|
11384
12169
|
mappedResponseItems.nextSyncToken = response.nextSyncToken;
|
|
11385
12170
|
}
|
|
11386
|
-
|
|
11387
12171
|
if (response.nextPageToken) {
|
|
11388
12172
|
mappedResponseItems.nextPageToken = response.nextPageToken;
|
|
11389
12173
|
}
|
|
11390
|
-
|
|
11391
12174
|
return Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["freezeSys"])(Object(_mixins_stringify_safe__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(mappedResponseItems)));
|
|
11392
12175
|
}
|
|
12176
|
+
|
|
11393
12177
|
/**
|
|
11394
12178
|
* @private
|
|
11395
12179
|
* @param {Array<Entities.Entry|Entities.Array|Sync.DeletedEntry|Sync.DeletedAsset>} items
|
|
11396
12180
|
* @return {Object} Entities mapped to an object for each entity type
|
|
11397
12181
|
*/
|
|
11398
|
-
|
|
11399
12182
|
function mapResponseItems(items) {
|
|
11400
12183
|
const reducer = type => {
|
|
11401
12184
|
return (accumulated, item) => {
|
|
11402
12185
|
if (item.sys.type === type) {
|
|
11403
12186
|
accumulated.push(Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["toPlainObject"])(item));
|
|
11404
12187
|
}
|
|
11405
|
-
|
|
11406
12188
|
return accumulated;
|
|
11407
12189
|
};
|
|
11408
12190
|
};
|
|
11409
|
-
|
|
11410
12191
|
return {
|
|
11411
12192
|
entries: items.reduce(reducer('Entry'), []),
|
|
11412
12193
|
assets: items.reduce(reducer('Asset'), []),
|
|
@@ -11414,6 +12195,7 @@ function mapResponseItems(items) {
|
|
|
11414
12195
|
deletedAssets: items.reduce(reducer('DeletedAsset'), [])
|
|
11415
12196
|
};
|
|
11416
12197
|
}
|
|
12198
|
+
|
|
11417
12199
|
/**
|
|
11418
12200
|
* If the response contains a nextPageUrl, extracts the sync token to get the
|
|
11419
12201
|
* next page and calls itself again with that token.
|
|
@@ -11429,8 +12211,6 @@ function mapResponseItems(items) {
|
|
|
11429
12211
|
* @param {boolean} [options.paginate = true] - If further sync pages should automatically be crawled
|
|
11430
12212
|
* @return {Promise<{items: Array, nextSyncToken: string}>}
|
|
11431
12213
|
*/
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
12214
|
async function getSyncPage(http, items, query, {
|
|
11435
12215
|
paginate
|
|
11436
12216
|
}) {
|
|
@@ -11438,25 +12218,21 @@ async function getSyncPage(http, items, query, {
|
|
|
11438
12218
|
query.sync_token = query.nextSyncToken;
|
|
11439
12219
|
delete query.nextSyncToken;
|
|
11440
12220
|
}
|
|
11441
|
-
|
|
11442
12221
|
if (query.nextPageToken) {
|
|
11443
12222
|
query.sync_token = query.nextPageToken;
|
|
11444
12223
|
delete query.nextPageToken;
|
|
11445
12224
|
}
|
|
11446
|
-
|
|
11447
12225
|
if (query.sync_token) {
|
|
11448
12226
|
delete query.initial;
|
|
11449
12227
|
delete query.type;
|
|
11450
12228
|
delete query.content_type;
|
|
11451
12229
|
delete query.limit;
|
|
11452
12230
|
}
|
|
11453
|
-
|
|
11454
12231
|
const response = await http.get('sync', Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["createRequestConfig"])({
|
|
11455
12232
|
query: query
|
|
11456
12233
|
}));
|
|
11457
12234
|
const data = response.data || {};
|
|
11458
12235
|
items = items.concat(data.items || []);
|
|
11459
|
-
|
|
11460
12236
|
if (data.nextPageUrl) {
|
|
11461
12237
|
if (paginate) {
|
|
11462
12238
|
delete query.initial;
|
|
@@ -11465,7 +12241,6 @@ async function getSyncPage(http, items, query, {
|
|
|
11465
12241
|
paginate
|
|
11466
12242
|
});
|
|
11467
12243
|
}
|
|
11468
|
-
|
|
11469
12244
|
return {
|
|
11470
12245
|
items: items,
|
|
11471
12246
|
nextPageToken: getToken(data.nextPageUrl)
|
|
@@ -11481,12 +12256,11 @@ async function getSyncPage(http, items, query, {
|
|
|
11481
12256
|
};
|
|
11482
12257
|
}
|
|
11483
12258
|
}
|
|
12259
|
+
|
|
11484
12260
|
/**
|
|
11485
12261
|
* Extracts token out of an url
|
|
11486
12262
|
* @private
|
|
11487
12263
|
*/
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
12264
|
function getToken(url) {
|
|
11491
12265
|
const urlParts = url.split('?');
|
|
11492
12266
|
return urlParts.length > 0 ? urlParts[1].replace('sync_token=', '') : '';
|
|
@@ -11505,36 +12279,36 @@ function getToken(url) {
|
|
|
11505
12279
|
__webpack_require__.r(__webpack_exports__);
|
|
11506
12280
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeSelect; });
|
|
11507
12281
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11508
|
-
|
|
11509
12282
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11510
|
-
|
|
11511
12283
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11512
|
-
|
|
11513
12284
|
/*
|
|
11514
12285
|
* sdk relies heavily on sys metadata
|
|
11515
12286
|
* so we cannot omit the sys property on sdk level entirely
|
|
11516
12287
|
* and we have to ensure that at least `id` and `type` are present
|
|
11517
12288
|
* */
|
|
12289
|
+
|
|
11518
12290
|
function normalizeSelect(query) {
|
|
11519
12291
|
if (!query.select) {
|
|
11520
12292
|
return query;
|
|
11521
|
-
}
|
|
11522
|
-
// Get the different parts that are listed for selection
|
|
11523
|
-
|
|
12293
|
+
}
|
|
11524
12294
|
|
|
11525
|
-
|
|
12295
|
+
// The selection of fields for the query is limited
|
|
12296
|
+
// Get the different parts that are listed for selection
|
|
12297
|
+
const allSelects = Array.isArray(query.select) ? query.select : query.select.split(',');
|
|
12298
|
+
// Move the parts into a set for easy access and deduplication
|
|
12299
|
+
const selectedSet = new Set(allSelects);
|
|
11526
12300
|
|
|
11527
|
-
|
|
12301
|
+
// If we already select all of `sys` we can just return
|
|
11528
12302
|
// since we're anyway fetching everything that is needed
|
|
11529
|
-
|
|
11530
12303
|
if (selectedSet.has('sys')) {
|
|
11531
12304
|
return query;
|
|
11532
|
-
}
|
|
11533
|
-
|
|
12305
|
+
}
|
|
11534
12306
|
|
|
12307
|
+
// We don't select `sys` so we need to ensure the minimum set
|
|
11535
12308
|
selectedSet.add('sys.id');
|
|
11536
|
-
selectedSet.add('sys.type');
|
|
12309
|
+
selectedSet.add('sys.type');
|
|
11537
12310
|
|
|
12311
|
+
// Reassign the normalized sys properties
|
|
11538
12312
|
return _objectSpread(_objectSpread({}, query), {}, {
|
|
11539
12313
|
select: [...selectedSet].join(',')
|
|
11540
12314
|
});
|
|
@@ -11558,19 +12332,15 @@ class ValidationError extends Error {
|
|
|
11558
12332
|
super(`Invalid "${name}" provided, ` + message);
|
|
11559
12333
|
this.name = 'ValidationError';
|
|
11560
12334
|
}
|
|
11561
|
-
|
|
11562
12335
|
}
|
|
11563
12336
|
function validateTimestamp(name, timestamp, options) {
|
|
11564
12337
|
options = options || {};
|
|
11565
|
-
|
|
11566
12338
|
if (typeof timestamp !== 'number') {
|
|
11567
12339
|
throw new ValidationError(name, `only numeric values are allowed for timestamps, provided type was "${typeof timestamp}"`);
|
|
11568
12340
|
}
|
|
11569
|
-
|
|
11570
12341
|
if (options.maximum && timestamp > options.maximum) {
|
|
11571
12342
|
throw new ValidationError(name, `value (${timestamp}) cannot be further in the future than expected maximum (${options.maximum})`);
|
|
11572
12343
|
}
|
|
11573
|
-
|
|
11574
12344
|
if (options.now && timestamp < options.now) {
|
|
11575
12345
|
throw new ValidationError(name, `value (${timestamp}) cannot be in the past, current time was ${options.now}`);
|
|
11576
12346
|
}
|