@agility/content-sync 1.1.2 → 1.1.3
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.
|
@@ -10856,7 +10856,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try
|
|
|
10856
10856
|
itemCount = 0;
|
|
10857
10857
|
busy = false;
|
|
10858
10858
|
waitMS = 0;
|
|
10859
|
-
waitMaxMS =
|
|
10859
|
+
waitMaxMS = 10 * 60 * 1000;
|
|
10860
10860
|
waitIntervalMS = 1000;case 7:_context.next = 9;return (
|
|
10861
10861
|
|
|
10862
10862
|
|
|
@@ -10940,7 +10940,7 @@ function syncPages_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key,
|
|
|
10940
10940
|
|
|
10941
10941
|
busy = false;
|
|
10942
10942
|
waitMS = 0;
|
|
10943
|
-
waitMaxMS =
|
|
10943
|
+
waitMaxMS = 10 * 60 * 1000;
|
|
10944
10944
|
waitIntervalMS = 1000;case 7:_context.next = 9;return (
|
|
10945
10945
|
|
|
10946
10946
|
|
|
@@ -11461,21 +11461,27 @@ var expandContentItem = /*#__PURE__*/function () {var _ref19 = store_interface_a
|
|
|
11461
11461
|
* @param {number} [requestParams.skip] - The number of items to skip from the list. Used for implementing pagination.
|
|
11462
11462
|
* @returns {Promise<[] | Object>} - Returns a list of content items, or, if skip or take has been specified, an object with an items array and totalCount property.
|
|
11463
11463
|
*/
|
|
11464
|
-
var getContentList = /*#__PURE__*/function () {var _ref21 = store_interface_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(_ref20) {var referenceName, languageCode,
|
|
11464
|
+
var getContentList = /*#__PURE__*/function () {var _ref21 = store_interface_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(_ref20) {var referenceName, languageCode, depth, contentLinkDepth, _ref20$expandAllConte, expandAllContentLinks, _ref20$skip, skip, _ref20$take, take, lst, totalCount, i;return regeneratorRuntime.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0:referenceName = _ref20.referenceName, languageCode = _ref20.languageCode, depth = _ref20.depth, contentLinkDepth = _ref20.contentLinkDepth, _ref20$expandAllConte = _ref20.expandAllContentLinks, expandAllContentLinks = _ref20$expandAllConte === void 0 ? false : _ref20$expandAllConte, _ref20$skip = _ref20.skip, skip = _ref20$skip === void 0 ? -1 : _ref20$skip, _ref20$take = _ref20.take, take = _ref20$take === void 0 ? -1 : _ref20$take;
|
|
11465
|
+
|
|
11466
|
+
if (depth === undefined && contentLinkDepth !== undefined) {
|
|
11467
|
+
depth = contentLinkDepth;
|
|
11468
|
+
} else if (depth === undefined && contentLinkDepth === undefined) {
|
|
11469
|
+
depth = 2;
|
|
11470
|
+
}_context11.next = 4;return (
|
|
11465
11471
|
|
|
11466
11472
|
store_interface_store.getItem({
|
|
11467
11473
|
options: options,
|
|
11468
11474
|
itemType: "list",
|
|
11469
11475
|
languageCode: languageCode,
|
|
11470
|
-
itemID: referenceName }));case
|
|
11471
|
-
[];case
|
|
11476
|
+
itemID: referenceName }));case 4:_context11.t0 = _context11.sent;if (_context11.t0) {_context11.next = 7;break;}_context11.t0 =
|
|
11477
|
+
[];case 7:lst = _context11.t0;if (!(
|
|
11472
11478
|
|
|
11473
|
-
depth > 0 && take === -1)) {_context11.next =
|
|
11474
|
-
new Error("If you specify depth > 0, you must also specify the take parameter."));case
|
|
11479
|
+
depth > 0 && take === -1)) {_context11.next = 10;break;}throw (
|
|
11480
|
+
new Error("If you specify depth > 0, you must also specify the take parameter."));case 10:if (!(
|
|
11475
11481
|
|
|
11476
11482
|
|
|
11477
|
-
expandAllContentLinks && take === -1)) {_context11.next =
|
|
11478
|
-
new Error("If you specify expandAllContentLinks=true, you must also specify the take parameter."));case
|
|
11483
|
+
expandAllContentLinks && take === -1)) {_context11.next = 12;break;}throw (
|
|
11484
|
+
new Error("If you specify expandAllContentLinks=true, you must also specify the take parameter."));case 12:
|
|
11479
11485
|
|
|
11480
11486
|
|
|
11481
11487
|
totalCount = lst.length;
|
|
@@ -11488,26 +11494,26 @@ var getContentList = /*#__PURE__*/function () {var _ref21 = store_interface_asyn
|
|
|
11488
11494
|
lst = lst.slice(0, take);
|
|
11489
11495
|
}if (!(
|
|
11490
11496
|
|
|
11491
|
-
depth > 0)) {_context11.next =
|
|
11492
|
-
i = 0;case
|
|
11497
|
+
depth > 0)) {_context11.next = 24;break;}
|
|
11498
|
+
i = 0;case 17:if (!(i < lst.length)) {_context11.next = 24;break;}_context11.next = 20;return (
|
|
11493
11499
|
expandContentItem({
|
|
11494
11500
|
contentItem: lst[i],
|
|
11495
11501
|
depth: depth - 1,
|
|
11496
11502
|
languageCode: languageCode,
|
|
11497
|
-
expandAllContentLinks: expandAllContentLinks }));case
|
|
11503
|
+
expandAllContentLinks: expandAllContentLinks }));case 20:lst[i] = _context11.sent;case 21:i++;_context11.next = 17;break;case 24:if (!(
|
|
11498
11504
|
|
|
11499
11505
|
|
|
11500
11506
|
|
|
11501
11507
|
|
|
11502
|
-
skip > 0 || take > 0)) {_context11.next =
|
|
11508
|
+
skip > 0 || take > 0)) {_context11.next = 28;break;}return _context11.abrupt("return",
|
|
11503
11509
|
|
|
11504
11510
|
{
|
|
11505
11511
|
items: lst,
|
|
11506
|
-
totalCount: totalCount });case
|
|
11512
|
+
totalCount: totalCount });case 28:return _context11.abrupt("return",
|
|
11507
11513
|
|
|
11508
11514
|
|
|
11509
11515
|
|
|
11510
|
-
lst);case
|
|
11516
|
+
lst);case 29:case "end":return _context11.stop();}}}, _callee11);}));return function getContentList(_x11) {return _ref21.apply(this, arguments);};}();
|
|
11511
11517
|
|
|
11512
11518
|
|
|
11513
11519
|
|
package/package.json
CHANGED
package/src/methods/syncPages.js
CHANGED
package/src/store-interface.js
CHANGED
|
@@ -364,7 +364,13 @@ const expandContentItem = async ({ contentItem, languageCode, depth, expandAllCo
|
|
|
364
364
|
* @param {number} [requestParams.skip] - The number of items to skip from the list. Used for implementing pagination.
|
|
365
365
|
* @returns {Promise<[] | Object>} - Returns a list of content items, or, if skip or take has been specified, an object with an items array and totalCount property.
|
|
366
366
|
*/
|
|
367
|
-
const getContentList = async ({ referenceName, languageCode, depth
|
|
367
|
+
const getContentList = async ({ referenceName, languageCode, depth, contentLinkDepth, expandAllContentLinks = false, skip = -1, take = -1 }) => {
|
|
368
|
+
|
|
369
|
+
if (depth === undefined && contentLinkDepth !== undefined) {
|
|
370
|
+
depth = contentLinkDepth
|
|
371
|
+
} else if (depth === undefined && contentLinkDepth === undefined) {
|
|
372
|
+
depth = 0
|
|
373
|
+
}
|
|
368
374
|
|
|
369
375
|
let lst = await store.getItem({
|
|
370
376
|
options,
|