@dereekb/trello 13.11.14 → 13.11.16

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/index.cjs.js CHANGED
@@ -298,8 +298,9 @@ function _ts_generator$3(thisArg, body) {
298
298
  /**
299
299
  * Creates a logTrelloServerErrorFunction that logs the error to console.
300
300
  *
301
- * @param trelloApiNamePrefix Prefix to use when logging.
302
- * @returns A function that logs Trello server errors to the console.
301
+ * @param trelloApiNamePrefix - Prefix to use when logging.
302
+ * @returns Logs Trello server errors to the console.
303
+ *
303
304
  * @__NO_SIDE_EFFECTS__
304
305
  */ function logTrelloServerErrorFunction(trelloApiNamePrefix) {
305
306
  return function(error) {
@@ -323,7 +324,7 @@ var logTrelloErrorToConsole = logTrelloServerErrorFunction('Trello');
323
324
  /**
324
325
  * Parses a FetchResponseError into a typed Trello API error.
325
326
  *
326
- * @param responseError The fetch response error to parse.
327
+ * @param responseError - The fetch response error to parse.
327
328
  * @returns A typed Trello error, or undefined if the response could not be parsed.
328
329
  */ function parseTrelloApiError(responseError) {
329
330
  return _async_to_generator$3(function() {
@@ -373,9 +374,10 @@ var logTrelloErrorToConsole = logTrelloServerErrorFunction('Trello');
373
374
  /**
374
375
  * Wraps a ConfiguredFetch to translate FetchResponseError into typed Trello errors.
375
376
  *
376
- * @param fetch The fetch to wrap.
377
- * @param logError Optional logger.
377
+ * @param fetch - The fetch to wrap.
378
+ * @param logError - Optional logger.
378
379
  * @returns A ConfiguredFetch that throws typed Trello errors for known error responses.
380
+ *
379
381
  * @__NO_SIDE_EFFECTS__
380
382
  */ function handleTrelloErrorFetch(fetch$1) {
381
383
  var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : logTrelloErrorToConsole;
@@ -442,8 +444,9 @@ var logTrelloErrorToConsole = logTrelloServerErrorFunction('Trello');
442
444
  *
443
445
  * Backs off after 429 responses and respects the documented per-token rate limit.
444
446
  *
445
- * @param config Optional configuration for rate limiting behavior.
447
+ * @param config - Optional configuration for rate limiting behavior.
446
448
  * @returns A configured rate-limited fetch handler.
449
+ *
447
450
  * @__NO_SIDE_EFFECTS__
448
451
  */ function trelloRateLimitedFetchHandler(config) {
449
452
  var _ref, _ref1;
@@ -462,10 +465,7 @@ var logTrelloErrorToConsole = logTrelloServerErrorFunction('Trello');
462
465
  updateWithResponse: function updateWithResponse(response) {
463
466
  // Trello does not document rate limit headers, but it does return 429 when exceeded.
464
467
  // Schedule a retry after the rate limiter cooldown when a 429 is observed.
465
- if (response.status === 429) {
466
- return true;
467
- }
468
- return false;
468
+ return response.status === 429;
469
469
  }
470
470
  });
471
471
  }
@@ -479,8 +479,9 @@ var logTrelloErrorToConsole = logTrelloServerErrorFunction('Trello');
479
479
  *
480
480
  * Auth uses Trello's `Authorization: OAuth oauth_consumer_key=..., oauth_token=...` header form so credentials never appear in URLs or logs.
481
481
  *
482
- * @param factoryConfig Factory-level configuration shared across created Trello instances.
482
+ * @param factoryConfig - Factory-level configuration shared across created Trello instances.
483
483
  * @returns A factory function that creates a configured Trello API instance.
484
+ *
484
485
  * @__NO_SIDE_EFFECTS__
485
486
  */ function trelloFactory() {
486
487
  var factoryConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -686,20 +687,20 @@ function _ts_generator$2(thisArg, body) {
686
687
  }
687
688
  }
688
689
  /**
689
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-get
690
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-get.
690
691
  *
691
- * @param context The Trello API context.
692
- * @returns A function that retrieves a board by id.
692
+ * @param context - The Trello API context.
693
+ * @returns Retrieves a board by id.
693
694
  */ function getBoard(context) {
694
695
  return function(input) {
695
696
  return context.fetchJson("/boards/".concat(input.boardId), 'GET');
696
697
  };
697
698
  }
698
699
  /**
699
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post
700
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post.
700
701
  *
701
- * @param context The Trello API context.
702
- * @returns A function that creates a new board.
702
+ * @param context - The Trello API context.
703
+ * @returns Creates a new board.
703
704
  */ function createBoard(context) {
704
705
  return function(input) {
705
706
  var queryString = fetch.makeUrlSearchParams(input);
@@ -707,10 +708,10 @@ function _ts_generator$2(thisArg, body) {
707
708
  };
708
709
  }
709
710
  /**
710
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put
711
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put.
711
712
  *
712
- * @param context The Trello API context.
713
- * @returns A function that updates an existing board.
713
+ * @param context - The Trello API context.
714
+ * @returns Updates an existing board.
714
715
  */ function updateBoard(context) {
715
716
  return function(input) {
716
717
  var boardId = input.boardId, body = _object_without_properties$3(input, [
@@ -720,10 +721,10 @@ function _ts_generator$2(thisArg, body) {
720
721
  };
721
722
  }
722
723
  /**
723
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-delete
724
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-delete.
724
725
  *
725
- * @param context The Trello API context.
726
- * @returns A function that deletes a board.
726
+ * @param context - The Trello API context.
727
+ * @returns Deletes a board.
727
728
  */ function deleteBoard(context) {
728
729
  return function(input) {
729
730
  return _async_to_generator$2(function() {
@@ -745,10 +746,10 @@ function _ts_generator$2(thisArg, body) {
745
746
  };
746
747
  }
747
748
  /**
748
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-lists-get
749
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-lists-get.
749
750
  *
750
- * @param context The Trello API context.
751
- * @returns A function that lists all lists on a board.
751
+ * @param context - The Trello API context.
752
+ * @returns Lists all lists on a board.
752
753
  */ function listBoardLists(context) {
753
754
  return function(input) {
754
755
  var boardId = input.boardId, query = _object_without_properties$3(input, [
@@ -759,10 +760,10 @@ function _ts_generator$2(thisArg, body) {
759
760
  };
760
761
  }
761
762
  /**
762
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-get
763
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-get.
763
764
  *
764
- * @param context The Trello API context.
765
- * @returns A function that lists all cards on a board.
765
+ * @param context - The Trello API context.
766
+ * @returns Lists all cards on a board.
766
767
  */ function listBoardCards(context) {
767
768
  return function(input) {
768
769
  var boardId = input.boardId, query = _object_without_properties$3(input, [
@@ -773,10 +774,10 @@ function _ts_generator$2(thisArg, body) {
773
774
  };
774
775
  }
775
776
  /**
776
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get
777
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get.
777
778
  *
778
- * @param context The Trello API context.
779
- * @returns A function that lists every label defined on a board.
779
+ * @param context - The Trello API context.
780
+ * @returns Lists every label defined on a board.
780
781
  */ function listBoardLabels(context) {
781
782
  return function(input) {
782
783
  var boardId = input.boardId, query = _object_without_properties$3(input, [
@@ -787,10 +788,10 @@ function _ts_generator$2(thisArg, body) {
787
788
  };
788
789
  }
789
790
  /**
790
- * https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-get
791
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-get.
791
792
  *
792
- * @param context The Trello API context.
793
- * @returns A function that lists all members of a board.
793
+ * @param context - The Trello API context.
794
+ * @returns Lists all members of a board.
794
795
  */ function listBoardMembers(context) {
795
796
  return function(input) {
796
797
  return context.fetchJson("/boards/".concat(input.boardId, "/members"), 'GET');
@@ -834,20 +835,20 @@ function _object_without_properties_loose$2(source, excluded) {
834
835
  return target;
835
836
  }
836
837
  /**
837
- * https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-get
838
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-get.
838
839
  *
839
- * @param context The Trello API context.
840
- * @returns A function that retrieves a list by id.
840
+ * @param context - The Trello API context.
841
+ * @returns Retrieves a list by id.
841
842
  */ function getList(context) {
842
843
  return function(input) {
843
844
  return context.fetchJson("/lists/".concat(input.listId), 'GET');
844
845
  };
845
846
  }
846
847
  /**
847
- * https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-post
848
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-post.
848
849
  *
849
- * @param context The Trello API context.
850
- * @returns A function that creates a new list on a board.
850
+ * @param context - The Trello API context.
851
+ * @returns Creates a new list on a board.
851
852
  */ function createList(context) {
852
853
  return function(input) {
853
854
  var queryString = fetch.makeUrlSearchParams(input);
@@ -855,10 +856,10 @@ function _object_without_properties_loose$2(source, excluded) {
855
856
  };
856
857
  }
857
858
  /**
858
- * https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-put
859
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-put.
859
860
  *
860
- * @param context The Trello API context.
861
- * @returns A function that updates an existing list.
861
+ * @param context - The Trello API context.
862
+ * @returns Updates an existing list.
862
863
  */ function updateList(context) {
863
864
  return function(input) {
864
865
  var listId = input.listId, body = _object_without_properties$2(input, [
@@ -868,10 +869,10 @@ function _object_without_properties_loose$2(source, excluded) {
868
869
  };
869
870
  }
870
871
  /**
871
- * https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-cards-get
872
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-cards-get.
872
873
  *
873
- * @param context The Trello API context.
874
- * @returns A function that lists all cards on a list.
874
+ * @param context - The Trello API context.
875
+ * @returns Lists all cards on a list.
875
876
  */ function listCardsInList(context) {
876
877
  return function(input) {
877
878
  var listId = input.listId, query = _object_without_properties$2(input, [
@@ -1075,20 +1076,20 @@ function _ts_generator$1(thisArg, body) {
1075
1076
  }
1076
1077
  }
1077
1078
  /**
1078
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-get
1079
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-get.
1079
1080
  *
1080
- * @param context The Trello API context.
1081
- * @returns A function that retrieves a card by id.
1081
+ * @param context - The Trello API context.
1082
+ * @returns Retrieves a card by id.
1082
1083
  */ function getCard(context) {
1083
1084
  return function(input) {
1084
1085
  return context.fetchJson("/cards/".concat(input.cardId), 'GET');
1085
1086
  };
1086
1087
  }
1087
1088
  /**
1088
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post
1089
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post.
1089
1090
  *
1090
- * @param context The Trello API context.
1091
- * @returns A function that creates a card on a list.
1091
+ * @param context - The Trello API context.
1092
+ * @returns Creates a card on a list.
1092
1093
  */ function createCard(context) {
1093
1094
  return function(input) {
1094
1095
  var idLabels = input.idLabels, idMembers = input.idMembers, rest = _object_without_properties$1(input, [
@@ -1107,10 +1108,10 @@ function _ts_generator$1(thisArg, body) {
1107
1108
  };
1108
1109
  }
1109
1110
  /**
1110
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put
1111
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put.
1111
1112
  *
1112
- * @param context The Trello API context.
1113
- * @returns A function that updates an existing card.
1113
+ * @param context - The Trello API context.
1114
+ * @returns Updates an existing card.
1114
1115
  */ function updateCard(context) {
1115
1116
  return function(input) {
1116
1117
  var cardId = input.cardId, idLabels = input.idLabels, idMembers = input.idMembers, rest = _object_without_properties$1(input, [
@@ -1129,10 +1130,10 @@ function _ts_generator$1(thisArg, body) {
1129
1130
  };
1130
1131
  }
1131
1132
  /**
1132
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-delete
1133
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-delete.
1133
1134
  *
1134
- * @param context The Trello API context.
1135
- * @returns A function that deletes a card.
1135
+ * @param context - The Trello API context.
1136
+ * @returns Deletes a card.
1136
1137
  */ function deleteCard(context) {
1137
1138
  return function(input) {
1138
1139
  return _async_to_generator$1(function() {
@@ -1154,13 +1155,13 @@ function _ts_generator$1(thisArg, body) {
1154
1155
  };
1155
1156
  }
1156
1157
  /**
1157
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-get
1158
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-get.
1158
1159
  *
1159
1160
  * Comments are returned as actions with `type === 'commentCard'`; pass `filter: 'commentCard'` and the generic
1160
1161
  * type parameter `TrelloCommentCardActionData` to get a comment-typed result.
1161
1162
  *
1162
- * @param context The Trello API context.
1163
- * @returns A function that lists actions on a card.
1163
+ * @param context - The Trello API context.
1164
+ * @returns Lists actions on a card.
1164
1165
  */ function listCardActions(context) {
1165
1166
  return function(input) {
1166
1167
  var cardId = input.cardId, query = _object_without_properties$1(input, [
@@ -1171,10 +1172,10 @@ function _ts_generator$1(thisArg, body) {
1171
1172
  };
1172
1173
  }
1173
1174
  /**
1174
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-comments-post
1175
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-comments-post.
1175
1176
  *
1176
- * @param context The Trello API context.
1177
- * @returns A function that adds a comment to a card.
1177
+ * @param context - The Trello API context.
1178
+ * @returns Adds a comment to a card.
1178
1179
  */ function addCommentToCard(context) {
1179
1180
  return function(input) {
1180
1181
  var queryString = fetch.makeUrlSearchParams({
@@ -1184,10 +1185,10 @@ function _ts_generator$1(thisArg, body) {
1184
1185
  };
1185
1186
  }
1186
1187
  /**
1187
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post
1188
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post.
1188
1189
  *
1189
- * @param context The Trello API context.
1190
- * @returns A function that adds a member to a card.
1190
+ * @param context - The Trello API context.
1191
+ * @returns Adds a member to a card.
1191
1192
  */ function addMemberToCard(context) {
1192
1193
  return function(input) {
1193
1194
  var queryString = fetch.makeUrlSearchParams({
@@ -1197,10 +1198,10 @@ function _ts_generator$1(thisArg, body) {
1197
1198
  };
1198
1199
  }
1199
1200
  /**
1200
- * https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post
1201
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post.
1201
1202
  *
1202
- * @param context The Trello API context.
1203
- * @returns A function that adds an existing label to a card.
1203
+ * @param context - The Trello API context.
1204
+ * @returns Adds an existing label to a card.
1204
1205
  */ function addLabelToCard(context) {
1205
1206
  return function(input) {
1206
1207
  var queryString = fetch.makeUrlSearchParams({
@@ -1211,10 +1212,10 @@ function _ts_generator$1(thisArg, body) {
1211
1212
  }
1212
1213
 
1213
1214
  /**
1214
- * https://developer.atlassian.com/cloud/trello/rest/api-group-members/#api-members-id-get
1215
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-members/#api-members-id-get.
1215
1216
  *
1216
- * @param context The Trello API context.
1217
- * @returns A function that retrieves a member by id (or `me`).
1217
+ * @param context - The Trello API context.
1218
+ * @returns Retrieves a member by id (or `me`).
1218
1219
  */ function getMember(context) {
1219
1220
  return function(input) {
1220
1221
  return context.fetchJson("/members/".concat(input.memberId), 'GET');
@@ -1223,8 +1224,8 @@ function _ts_generator$1(thisArg, body) {
1223
1224
  /**
1224
1225
  * Convenience wrapper around `getMember({ memberId: 'me' })`.
1225
1226
  *
1226
- * @param context The Trello API context.
1227
- * @returns A function that retrieves the authenticated user.
1227
+ * @param context - The Trello API context.
1228
+ * @returns Retrieves the authenticated user.
1228
1229
  */ function getMe(context) {
1229
1230
  return function() {
1230
1231
  return context.fetchJson("/members/me", 'GET');
@@ -1400,8 +1401,8 @@ function _ts_generator(thisArg, body) {
1400
1401
  *
1401
1402
  * https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#creating-a-webhook
1402
1403
  *
1403
- * @param context The Trello API context.
1404
- * @returns A function that registers a new webhook.
1404
+ * @param context - The Trello API context.
1405
+ * @returns Registers a new webhook.
1405
1406
  */ function createWebhook(context) {
1406
1407
  return function(input) {
1407
1408
  var queryString = fetch.makeUrlSearchParams(input);
@@ -1409,20 +1410,20 @@ function _ts_generator(thisArg, body) {
1409
1410
  };
1410
1411
  }
1411
1412
  /**
1412
- * https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#retrieving-a-webhook
1413
+ * Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#retrieving-a-webhook.
1413
1414
  *
1414
- * @param context The Trello API context.
1415
- * @returns A function that retrieves a webhook by id.
1415
+ * @param context - The Trello API context.
1416
+ * @returns Retrieves a webhook by id.
1416
1417
  */ function getWebhook(context) {
1417
1418
  return function(input) {
1418
1419
  return context.fetchJson("/webhooks/".concat(input.webhookId), 'GET');
1419
1420
  };
1420
1421
  }
1421
1422
  /**
1422
- * https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#updating-a-webhook
1423
+ * Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#updating-a-webhook.
1423
1424
  *
1424
- * @param context The Trello API context.
1425
- * @returns A function that updates an existing webhook.
1425
+ * @param context - The Trello API context.
1426
+ * @returns Updates an existing webhook.
1426
1427
  */ function updateWebhook(context) {
1427
1428
  return function(input) {
1428
1429
  var webhookId = input.webhookId, body = _object_without_properties(input, [
@@ -1432,10 +1433,10 @@ function _ts_generator(thisArg, body) {
1432
1433
  };
1433
1434
  }
1434
1435
  /**
1435
- * https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#deleting-a-webhook
1436
+ * Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#deleting-a-webhook.
1436
1437
  *
1437
- * @param context The Trello API context.
1438
- * @returns A function that deletes a webhook.
1438
+ * @param context - The Trello API context.
1439
+ * @returns Deletes a webhook.
1439
1440
  */ function deleteWebhook(context) {
1440
1441
  return function(input) {
1441
1442
  return _async_to_generator(function() {
@@ -1457,10 +1458,10 @@ function _ts_generator(thisArg, body) {
1457
1458
  };
1458
1459
  }
1459
1460
  /**
1460
- * https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/
1461
+ * Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/.
1461
1462
  *
1462
- * @param context The Trello API context.
1463
- * @returns A function that lists all webhooks registered for a token.
1463
+ * @param context - The Trello API context.
1464
+ * @returns Lists all webhooks registered for a token.
1464
1465
  */ function listWebhooksForToken(context) {
1465
1466
  return function(input) {
1466
1467
  var _ref;
@@ -1524,7 +1525,7 @@ function _object_spread_props(target, source) {
1524
1525
  /**
1525
1526
  * Default reader that pulls `id` off the item. Works for most Trello resource types.
1526
1527
  *
1527
- * @param item The page item whose id to read.
1528
+ * @param item - The page item whose id to read.
1528
1529
  * @returns The item's id.
1529
1530
  */ var defaultTrelloPageItemIdReader = function defaultTrelloPageItemIdReader(item) {
1530
1531
  return item.id;
@@ -1532,7 +1533,7 @@ function _object_spread_props(target, source) {
1532
1533
  /**
1533
1534
  * Reader that pulls the action id off a Trello action item.
1534
1535
  *
1535
- * @param item The action page item whose id to read.
1536
+ * @param item - The action page item whose id to read.
1536
1537
  * @returns The item's action id.
1537
1538
  */ var trelloActionIdReader = function trelloActionIdReader(item) {
1538
1539
  return item.id;
@@ -1540,16 +1541,18 @@ function _object_spread_props(target, source) {
1540
1541
  /**
1541
1542
  * Wraps a raw Trello collection fetch into a {@link TrelloPageResult}.
1542
1543
  *
1543
- * @param input The page filter that was used.
1544
- * @param data The raw page items.
1545
- * @param idReader Function to read the id from the last item.
1544
+ * @param input - The page filter that was used.
1545
+ * @param data - The raw page items.
1546
+ * @param idReader - Function to read the id from the last item.
1546
1547
  * @returns A page result with the data and a cursor for the next page.
1548
+ *
1547
1549
  * @__NO_SIDE_EFFECTS__
1548
1550
  */ function buildTrelloPageResult(input, data, idReader) {
1549
1551
  var _input_limit;
1550
1552
  var limit = (_input_limit = input.limit) !== null && _input_limit !== void 0 ? _input_limit : data.length;
1551
1553
  var hasMore = data.length === limit && data.length > 0;
1552
- var nextBefore = hasMore ? idReader(data[data.length - 1]) : undefined;
1554
+ var lastItem = hasMore ? data.at(-1) : undefined;
1555
+ var nextBefore = lastItem === undefined ? undefined : idReader(lastItem);
1553
1556
  return {
1554
1557
  data: data,
1555
1558
  limit: limit,
@@ -1559,9 +1562,10 @@ function _object_spread_props(target, source) {
1559
1562
  /**
1560
1563
  * Creates a FetchPageFactory using the input TrelloFetchPageFetchFunction.
1561
1564
  *
1562
- * @param fetch Function that fetches a single page of results from the Trello API.
1563
- * @param defaults Optional default pagination configuration.
1565
+ * @param fetch - Function that fetches a single page of results from the Trello API.
1566
+ * @param defaults - Optional default pagination configuration.
1564
1567
  * @returns A configured FetchPageFactory that handles Trello's cursor-based pagination using `before`.
1568
+ *
1565
1569
  * @__NO_SIDE_EFFECTS__
1566
1570
  */ function trelloFetchPageFactory(fetch$1, defaults) {
1567
1571
  return fetch.fetchPageFactory(_object_spread_props(_object_spread({}, defaults), {