@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 = 60000;
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 = 60000;
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, _ref20$depth, depth, _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, _ref20$depth = _ref20.depth, depth = _ref20$depth === void 0 ? 0 : _ref20$depth, _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;_context11.next = 3;return (
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 3:_context11.t0 = _context11.sent;if (_context11.t0) {_context11.next = 6;break;}_context11.t0 =
11471
- [];case 6:lst = _context11.t0;if (!(
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 = 9;break;}throw (
11474
- new Error("If you specify depth > 0, you must also specify the take parameter."));case 9:if (!(
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 = 11;break;}throw (
11478
- new Error("If you specify expandAllContentLinks=true, you must also specify the take parameter."));case 11:
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 = 23;break;}
11492
- i = 0;case 16:if (!(i < lst.length)) {_context11.next = 23;break;}_context11.next = 19;return (
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 19:lst[i] = _context11.sent;case 20:i++;_context11.next = 16;break;case 23:if (!(
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 = 27;break;}return _context11.abrupt("return",
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 27:return _context11.abrupt("return",
11512
+ totalCount: totalCount });case 28:return _context11.abrupt("return",
11507
11513
 
11508
11514
 
11509
11515
 
11510
- lst);case 28:case "end":return _context11.stop();}}}, _callee11);}));return function getContentList(_x11) {return _ref21.apply(this, arguments);};}();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/content-sync",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "JavaScript SDK for synchronizing content from Agility CMS",
5
5
  "main": "dist/agility-sync-sdk.node.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@ export default async function (languageCode, token) {
12
12
  let itemCount = 0
13
13
  let busy = false
14
14
  let waitMS = 0
15
- const waitMaxMS = 60000
15
+ const waitMaxMS = 10 * 60 * 1000
16
16
  const waitIntervalMS = 1000
17
17
 
18
18
  do {
@@ -8,7 +8,7 @@ export default async function (languageCode, token) {
8
8
 
9
9
  let busy = false
10
10
  let waitMS = 0
11
- const waitMaxMS = 60000
11
+ const waitMaxMS = 10 * 60 * 1000
12
12
  const waitIntervalMS = 1000
13
13
 
14
14
 
@@ -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 = 0, expandAllContentLinks = false, skip = -1, take = -1 }) => {
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,