contentful-management 11.62.0 → 11.63.0-dx-542-update-to-gha.1
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/README.md +13 -0
- package/dist/contentful-management.browser.js +49 -14
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +76 -37
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/bulk-action.js +12 -0
- package/dist/es-modules/common-utils.js +12 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/create-environment-api.js +11 -10
- package/dist/es-modules/plain/plain-client.js +5 -1
- package/dist/typings/adapters/REST/endpoints/bulk-action.d.ts +4 -0
- package/dist/typings/common-types.d.ts +47 -1
- package/dist/typings/common-utils.d.ts +8 -1
- package/dist/typings/create-environment-api.d.ts +5 -5
- package/dist/typings/entities/bulk-action.d.ts +31 -3
- package/dist/typings/export-types.d.ts +2 -2
- package/dist/typings/plain/common-types.d.ts +20 -2
- package/package.json +13 -10
- package/dist/es-modules/methods/bulk-action.js +0 -15
- package/dist/typings/methods/bulk-action.d.ts +0 -14
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
- [Authentication](#authentication)
|
|
54
54
|
- [Using ES6 import](#using-es6-import)
|
|
55
55
|
- [Your first Request](#your-first-request)
|
|
56
|
+
- [Cursor based pagination](#cursor-based-pagination)
|
|
56
57
|
- [Alternative plain API](#alternative-plain-api)
|
|
57
58
|
- [App Framework](#app-framework)
|
|
58
59
|
- [Troubleshooting](#troubleshooting)
|
|
@@ -227,6 +228,18 @@ The benefits of using the "plain" version of the client, over the legacy version
|
|
|
227
228
|
- The ability to scope CMA client instance to a specific `spaceId`, `environmentId`, and `organizationId` when initializing the client.
|
|
228
229
|
- You can pass a concrete values to `defaults` and omit specifying these params in actual CMA methods calls.
|
|
229
230
|
|
|
231
|
+
## Cursor Based Pagination
|
|
232
|
+
|
|
233
|
+
Cursor-based pagination is supported on collection endpoints for content types, entries, and assets. To use cursor-based pagination, pass the `cursor: true` parameter in your query:
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
const response = await environment.getEntries({ cursor: true, limit: 10 });
|
|
237
|
+
console.log(response.items); // Array of items
|
|
238
|
+
console.log(response.pages?.next); // Cursor for next page
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Use the value from `response.pages.next` to fetch the next page.
|
|
242
|
+
|
|
230
243
|
## Legacy Client Interface
|
|
231
244
|
|
|
232
245
|
The following code snippet is an example of the legacy client interface, which reads and writes data as a sequence of nested requests:
|
|
@@ -1479,9 +1479,13 @@ var processForAllLocales = /*#__PURE__*/function () {
|
|
|
1479
1479
|
__webpack_require__.r(__webpack_exports__);
|
|
1480
1480
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1481
1481
|
/* harmony export */ get: function() { return /* binding */ get; },
|
|
1482
|
+
/* harmony export */ getV2: function() { return /* binding */ getV2; },
|
|
1482
1483
|
/* harmony export */ publish: function() { return /* binding */ publish; },
|
|
1484
|
+
/* harmony export */ publishV2: function() { return /* binding */ publishV2; },
|
|
1483
1485
|
/* harmony export */ unpublish: function() { return /* binding */ unpublish; },
|
|
1484
|
-
/* harmony export */
|
|
1486
|
+
/* harmony export */ unpublishV2: function() { return /* binding */ unpublishV2; },
|
|
1487
|
+
/* harmony export */ validate: function() { return /* binding */ validate; },
|
|
1488
|
+
/* harmony export */ validateV2: function() { return /* binding */ validateV2; }
|
|
1485
1489
|
/* harmony export */ });
|
|
1486
1490
|
/* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
|
|
1487
1491
|
|
|
@@ -1497,6 +1501,18 @@ var unpublish = function unpublish(http, params, payload) {
|
|
|
1497
1501
|
var validate = function validate(http, params, payload) {
|
|
1498
1502
|
return _raw__WEBPACK_IMPORTED_MODULE_0__.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/bulk_actions/validate"), payload);
|
|
1499
1503
|
};
|
|
1504
|
+
var getV2 = function getV2(http, params) {
|
|
1505
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.get(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/bulk_actions/").concat(params.bulkActionId));
|
|
1506
|
+
};
|
|
1507
|
+
var publishV2 = function publishV2(http, params, payload) {
|
|
1508
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/bulk_actions"), payload);
|
|
1509
|
+
};
|
|
1510
|
+
var unpublishV2 = function unpublishV2(http, params, payload) {
|
|
1511
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/bulk_actions"), payload);
|
|
1512
|
+
};
|
|
1513
|
+
var validateV2 = function validateV2(http, params, payload) {
|
|
1514
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.post(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/bulk_actions"), payload);
|
|
1515
|
+
};
|
|
1500
1516
|
|
|
1501
1517
|
/***/ }),
|
|
1502
1518
|
|
|
@@ -5531,6 +5547,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5531
5547
|
/* harmony export */ isSuccessful: function() { return /* binding */ isSuccessful; },
|
|
5532
5548
|
/* harmony export */ shouldRePoll: function() { return /* binding */ shouldRePoll; },
|
|
5533
5549
|
/* harmony export */ waitFor: function() { return /* binding */ waitFor; },
|
|
5550
|
+
/* harmony export */ withOptionalCursorApi: function() { return /* binding */ withOptionalCursorApi; },
|
|
5534
5551
|
/* harmony export */ wrapCollection: function() { return /* binding */ wrapCollection; },
|
|
5535
5552
|
/* harmony export */ wrapCursorPaginatedCollection: function() { return /* binding */ wrapCursorPaginatedCollection; }
|
|
5536
5553
|
/* harmony export */ });
|
|
@@ -5561,6 +5578,18 @@ var wrapCollection = function wrapCollection(fn) {
|
|
|
5561
5578
|
return collectionData;
|
|
5562
5579
|
};
|
|
5563
5580
|
};
|
|
5581
|
+
|
|
5582
|
+
/**
|
|
5583
|
+
* @private
|
|
5584
|
+
* Function for endpoints allowing `?cursor=true` wrapping the call
|
|
5585
|
+
* to ensure the correct return type for cursor based pagination
|
|
5586
|
+
* when `cursor: true`.
|
|
5587
|
+
*/
|
|
5588
|
+
var withOptionalCursorApi = function withOptionalCursorApi(fn) {
|
|
5589
|
+
return function (args) {
|
|
5590
|
+
return fn.call(this, args);
|
|
5591
|
+
};
|
|
5592
|
+
};
|
|
5564
5593
|
var wrapCursorPaginatedCollection = function wrapCursorPaginatedCollection(fn) {
|
|
5565
5594
|
return function (makeRequest, data) {
|
|
5566
5595
|
for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
@@ -7689,6 +7718,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7689
7718
|
/* harmony import */ var _entities_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entities/function */ "./entities/function.ts");
|
|
7690
7719
|
/* harmony import */ var _entities_function_log__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entities/function-log */ "./entities/function-log.ts");
|
|
7691
7720
|
/* harmony import */ var _entities_ai_action_invocation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./entities/ai-action-invocation */ "./entities/ai-action-invocation.ts");
|
|
7721
|
+
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./common-utils */ "./common-utils.ts");
|
|
7692
7722
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7693
7723
|
var _excluded = ["installationId"];
|
|
7694
7724
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -7714,6 +7744,7 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
7714
7744
|
|
|
7715
7745
|
|
|
7716
7746
|
|
|
7747
|
+
|
|
7717
7748
|
/**
|
|
7718
7749
|
* @private
|
|
7719
7750
|
*/
|
|
@@ -8149,7 +8180,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8149
8180
|
* .catch(console.error)
|
|
8150
8181
|
* ```
|
|
8151
8182
|
*/
|
|
8152
|
-
getContentTypes: function
|
|
8183
|
+
getContentTypes: (0,_common_utils__WEBPACK_IMPORTED_MODULE_11__.withOptionalCursorApi)(function () {
|
|
8153
8184
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8154
8185
|
var raw = this.toPlainObject();
|
|
8155
8186
|
return makeRequest({
|
|
@@ -8165,7 +8196,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8165
8196
|
}).then(function (data) {
|
|
8166
8197
|
return wrapContentTypeCollection(makeRequest, data);
|
|
8167
8198
|
});
|
|
8168
|
-
},
|
|
8199
|
+
}),
|
|
8169
8200
|
/**
|
|
8170
8201
|
* Creates a Content Type
|
|
8171
8202
|
* @param data - Object representation of the Content Type to be created
|
|
@@ -8407,7 +8438,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8407
8438
|
* .catch(console.error)
|
|
8408
8439
|
* ```
|
|
8409
8440
|
*/
|
|
8410
|
-
getEntries: function
|
|
8441
|
+
getEntries: (0,_common_utils__WEBPACK_IMPORTED_MODULE_11__.withOptionalCursorApi)(function () {
|
|
8411
8442
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8412
8443
|
var raw = this.toPlainObject();
|
|
8413
8444
|
return makeRequest({
|
|
@@ -8423,7 +8454,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8423
8454
|
}).then(function (data) {
|
|
8424
8455
|
return wrapEntryCollection(makeRequest, data);
|
|
8425
8456
|
});
|
|
8426
|
-
},
|
|
8457
|
+
}),
|
|
8427
8458
|
/**
|
|
8428
8459
|
* Gets a collection of published Entries
|
|
8429
8460
|
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
@@ -8442,7 +8473,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8442
8473
|
* .catch(console.error)
|
|
8443
8474
|
* ```
|
|
8444
8475
|
*/
|
|
8445
|
-
getPublishedEntries: function
|
|
8476
|
+
getPublishedEntries: (0,_common_utils__WEBPACK_IMPORTED_MODULE_11__.withOptionalCursorApi)(function () {
|
|
8446
8477
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8447
8478
|
var raw = this.toPlainObject();
|
|
8448
8479
|
return makeRequest({
|
|
@@ -8458,7 +8489,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8458
8489
|
}).then(function (data) {
|
|
8459
8490
|
return wrapEntryCollection(makeRequest, data);
|
|
8460
8491
|
});
|
|
8461
|
-
},
|
|
8492
|
+
}),
|
|
8462
8493
|
/**
|
|
8463
8494
|
* Creates a Entry
|
|
8464
8495
|
* @param contentTypeId - The Content Type ID of the newly created Entry
|
|
@@ -8638,7 +8669,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8638
8669
|
* .catch(console.error)
|
|
8639
8670
|
* ```
|
|
8640
8671
|
*/
|
|
8641
|
-
getAssets: function
|
|
8672
|
+
getAssets: (0,_common_utils__WEBPACK_IMPORTED_MODULE_11__.withOptionalCursorApi)(function () {
|
|
8642
8673
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8643
8674
|
var raw = this.toPlainObject();
|
|
8644
8675
|
return makeRequest({
|
|
@@ -8654,7 +8685,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8654
8685
|
}).then(function (data) {
|
|
8655
8686
|
return wrapAssetCollection(makeRequest, data);
|
|
8656
8687
|
});
|
|
8657
|
-
},
|
|
8688
|
+
}),
|
|
8658
8689
|
/**
|
|
8659
8690
|
* Gets a collection of published Assets
|
|
8660
8691
|
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
@@ -8673,7 +8704,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8673
8704
|
* .catch(console.error)
|
|
8674
8705
|
* ```
|
|
8675
8706
|
*/
|
|
8676
|
-
getPublishedAssets: function
|
|
8707
|
+
getPublishedAssets: (0,_common_utils__WEBPACK_IMPORTED_MODULE_11__.withOptionalCursorApi)(function () {
|
|
8677
8708
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8678
8709
|
var raw = this.toPlainObject();
|
|
8679
8710
|
return makeRequest({
|
|
@@ -8689,7 +8720,7 @@ function createEnvironmentApi(makeRequest) {
|
|
|
8689
8720
|
}).then(function (data) {
|
|
8690
8721
|
return wrapAssetCollection(makeRequest, data);
|
|
8691
8722
|
});
|
|
8692
|
-
},
|
|
8723
|
+
}),
|
|
8693
8724
|
/**
|
|
8694
8725
|
* Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
|
|
8695
8726
|
* @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
|
|
@@ -19602,7 +19633,11 @@ var createPlainClient = function createPlainClient(makeRequest, defaults) {
|
|
|
19602
19633
|
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'get'),
|
|
19603
19634
|
publish: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'publish'),
|
|
19604
19635
|
unpublish: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'unpublish'),
|
|
19605
|
-
validate: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'validate')
|
|
19636
|
+
validate: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'validate'),
|
|
19637
|
+
getV2: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'getV2'),
|
|
19638
|
+
publishV2: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'publishV2'),
|
|
19639
|
+
unpublishV2: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'unpublishV2'),
|
|
19640
|
+
validateV2: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'BulkAction', 'validateV2')
|
|
19606
19641
|
},
|
|
19607
19642
|
comment: {
|
|
19608
19643
|
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Comment', 'get'),
|
|
@@ -25993,7 +26028,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25993
26028
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
25994
26029
|
/* harmony export */ VERSION: function() { return /* binding */ VERSION; }
|
|
25995
26030
|
/* harmony export */ });
|
|
25996
|
-
const VERSION = "1.13.
|
|
26031
|
+
const VERSION = "1.13.2";
|
|
25997
26032
|
|
|
25998
26033
|
/***/ }),
|
|
25999
26034
|
|
|
@@ -29945,7 +29980,7 @@ function createClient(params) {
|
|
|
29945
29980
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29946
29981
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
29947
29982
|
var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(// @ts-expect-error
|
|
29948
|
-
"".concat(sdkMain, "/").concat("11.
|
|
29983
|
+
"".concat(sdkMain, "/").concat("11.63.0-dx-542-update-to-gha.1"), params.application, params.integration, params.feature);
|
|
29949
29984
|
var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
|
|
29950
29985
|
userAgent: userAgent
|
|
29951
29986
|
}));
|