seatsio 87.7.0 → 87.9.0

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.
Files changed (73) hide show
  1. package/dist/src/Accounts/Account.js +12 -10
  2. package/dist/src/Accounts/AccountSettings.js +12 -12
  3. package/dist/src/Accounts/Accounts.js +28 -32
  4. package/dist/src/Accounts/ChartValidationSettings.js +9 -8
  5. package/dist/src/Accounts/DefaultRendererSettings.js +6 -8
  6. package/dist/src/AsyncIterator.js +39 -97
  7. package/dist/src/Charts/Category.js +17 -18
  8. package/dist/src/Charts/CategoryUpdateParams.js +13 -17
  9. package/dist/src/Charts/Chart.js +21 -14
  10. package/dist/src/Charts/ChartListParams.js +30 -34
  11. package/dist/src/Charts/ChartObjectInfo.js +33 -14
  12. package/dist/src/Charts/ChartValidation.js +5 -8
  13. package/dist/src/Charts/Charts.js +114 -129
  14. package/dist/src/Charts/Zone.js +11 -14
  15. package/dist/src/Common/Floor.js +9 -12
  16. package/dist/src/Common/IDs.js +6 -10
  17. package/dist/src/Common/LabelAndType.js +5 -8
  18. package/dist/src/Common/Labels.js +10 -12
  19. package/dist/src/Dict.js +1 -2
  20. package/dist/src/EventLog/EventLog.js +21 -27
  21. package/dist/src/EventLog/EventLogItem.js +7 -8
  22. package/dist/src/Events/AbstractEventParams.js +17 -19
  23. package/dist/src/Events/BestAvailableObjects.js +8 -10
  24. package/dist/src/Events/BestAvailableParams.js +26 -25
  25. package/dist/src/Events/ChangeObjectStatusResult.js +6 -10
  26. package/dist/src/Events/Channel.d.ts +11 -0
  27. package/dist/src/Events/Channel.js +15 -8
  28. package/dist/src/Events/Channels.d.ts +8 -7
  29. package/dist/src/Events/Channels.js +35 -36
  30. package/dist/src/Events/CreateEventParams.d.ts +3 -3
  31. package/dist/src/Events/CreateEventParams.js +12 -33
  32. package/dist/src/Events/EditForSaleConfigResult.js +10 -13
  33. package/dist/src/Events/Event.js +33 -18
  34. package/dist/src/Events/EventDeserializer.js +8 -15
  35. package/dist/src/Events/EventObjectInfo.js +58 -18
  36. package/dist/src/Events/Events.js +178 -310
  37. package/dist/src/Events/ForSaleConfig.js +9 -10
  38. package/dist/src/Events/ForSaleConfigParams.js +8 -13
  39. package/dist/src/Events/ForSaleRateLimitInfo.js +7 -10
  40. package/dist/src/Events/ObjectProperties.js +13 -14
  41. package/dist/src/Events/StatusChange.js +16 -8
  42. package/dist/src/Events/StatusChangeOrigin.js +5 -8
  43. package/dist/src/Events/StatusChangeRequest.js +45 -52
  44. package/dist/src/Events/StatusChangesParams.js +23 -26
  45. package/dist/src/Events/TableBookingConfig.js +13 -16
  46. package/dist/src/Events/UpdateEventParams.js +9 -31
  47. package/dist/src/HoldTokens/HoldToken.js +7 -8
  48. package/dist/src/HoldTokens/HoldTokens.js +16 -21
  49. package/dist/src/Lister.js +21 -30
  50. package/dist/src/LocalDate.js +13 -15
  51. package/dist/src/Page.js +12 -16
  52. package/dist/src/PageFetcher.js +21 -69
  53. package/dist/src/Region.js +16 -20
  54. package/dist/src/Reports/ChartReports.js +39 -47
  55. package/dist/src/Reports/EventReports.js +102 -117
  56. package/dist/src/Reports/UsageReports.js +19 -23
  57. package/dist/src/Seasons/CreateSeasonParams.d.ts +3 -3
  58. package/dist/src/Seasons/CreateSeasonParams.js +32 -29
  59. package/dist/src/Seasons/Season.js +11 -31
  60. package/dist/src/Seasons/Seasons.d.ts +1 -1
  61. package/dist/src/Seasons/Seasons.js +54 -108
  62. package/dist/src/Seasons/UpdateSeasonParams.js +6 -29
  63. package/dist/src/SeatsioClient.js +72 -77
  64. package/dist/src/TicketBuyers/AddTicketBuyerIdsResponse.js +5 -8
  65. package/dist/src/TicketBuyers/RemoveTicketBuyerIdsResponse.js +5 -8
  66. package/dist/src/TicketBuyers/TicketBuyers.js +27 -76
  67. package/dist/src/Workspaces/Workspace.js +11 -8
  68. package/dist/src/Workspaces/Workspaces.js +86 -112
  69. package/dist/src/errorInterceptor.js +2 -5
  70. package/dist/src/index.js +63 -79
  71. package/dist/src/utilities/helperFunctions.js +9 -16
  72. package/dist/src/utilities/reportUtility.js +19 -28
  73. package/package.json +5 -5
@@ -1,17 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForSaleConfigParams = void 0;
4
- var ForSaleConfigParams = /** @class */ (function () {
5
- function ForSaleConfigParams() {
6
- }
7
- ForSaleConfigParams.prototype.withForSale = function (forSale) {
1
+ export class ForSaleConfigParams {
2
+ forSale;
3
+ notForSale;
4
+ withForSale(forSale) {
8
5
  this.forSale = forSale;
9
6
  return this;
10
- };
11
- ForSaleConfigParams.prototype.withNotForSale = function (notForSale) {
7
+ }
8
+ withNotForSale(notForSale) {
12
9
  this.notForSale = notForSale;
13
10
  return this;
14
- };
15
- return ForSaleConfigParams;
16
- }());
17
- exports.ForSaleConfigParams = ForSaleConfigParams;
11
+ }
12
+ }
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForSaleRateLimitInfo = void 0;
4
- var ForSaleRateLimitInfo = /** @class */ (function () {
5
- function ForSaleRateLimitInfo(rateLimitRemainingCalls, rateLimitResetDate) {
1
+ export class ForSaleRateLimitInfo {
2
+ rateLimitRemainingCalls;
3
+ rateLimitResetDate;
4
+ constructor(rateLimitRemainingCalls, rateLimitResetDate) {
6
5
  this.rateLimitRemainingCalls = rateLimitRemainingCalls;
7
6
  this.rateLimitResetDate = rateLimitResetDate;
8
7
  }
9
- ForSaleRateLimitInfo.fromJson = function (json) {
8
+ static fromJson(json) {
10
9
  return new ForSaleRateLimitInfo(json.rateLimitRemainingCalls, new Date(json.rateLimitResetDate));
11
- };
12
- return ForSaleRateLimitInfo;
13
- }());
14
- exports.ForSaleRateLimitInfo = ForSaleRateLimitInfo;
10
+ }
11
+ }
@@ -1,22 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ObjectProperties = void 0;
4
- var ObjectProperties = /** @class */ (function () {
5
- function ObjectProperties(objectId) {
1
+ export class ObjectProperties {
2
+ extraData;
3
+ objectId;
4
+ quantity;
5
+ ticketType;
6
+ constructor(objectId) {
6
7
  this.objectId = objectId;
7
8
  }
8
- ObjectProperties.prototype.setTicketType = function (ticketType) {
9
+ setTicketType(ticketType) {
9
10
  this.ticketType = ticketType;
10
11
  return this;
11
- };
12
- ObjectProperties.prototype.setQuantity = function (quantity) {
12
+ }
13
+ setQuantity(quantity) {
13
14
  this.quantity = quantity;
14
15
  return this;
15
- };
16
- ObjectProperties.prototype.setExtraData = function (extraData) {
16
+ }
17
+ setExtraData(extraData) {
17
18
  this.extraData = extraData;
18
19
  return this;
19
- };
20
- return ObjectProperties;
21
- }());
22
- exports.ObjectProperties = ObjectProperties;
20
+ }
21
+ }
@@ -1,8 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusChange = void 0;
4
- var StatusChange = /** @class */ (function () {
5
- function StatusChange(json) {
1
+ export class StatusChange {
2
+ date;
3
+ displayedLabel;
4
+ eventId;
5
+ extraData;
6
+ holdToken;
7
+ id;
8
+ isPresentOnChart;
9
+ notPresentOnChartReason;
10
+ objectLabel;
11
+ orderId;
12
+ origin;
13
+ quantity;
14
+ status;
15
+ constructor(json) {
6
16
  this.id = json.id;
7
17
  this.eventId = json.eventId;
8
18
  this.status = json.status;
@@ -17,6 +27,4 @@ var StatusChange = /** @class */ (function () {
17
27
  this.notPresentOnChartReason = json.notPresentOnChartReason;
18
28
  this.displayedLabel = json.displayedLabel ? json.displayedLabel : null;
19
29
  }
20
- return StatusChange;
21
- }());
22
- exports.StatusChange = StatusChange;
30
+ }
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusChangeOrigin = void 0;
4
- var StatusChangeOrigin = /** @class */ (function () {
5
- function StatusChangeOrigin(json) {
1
+ export class StatusChangeOrigin {
2
+ type;
3
+ ip;
4
+ constructor(json) {
6
5
  this.type = json.type;
7
6
  this.ip = json.ip;
8
7
  }
9
- return StatusChangeOrigin;
10
- }());
11
- exports.StatusChangeOrigin = StatusChangeOrigin;
8
+ }
@@ -1,78 +1,71 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusChangeRequest = void 0;
4
- var StatusChangeRequest = /** @class */ (function () {
5
- function StatusChangeRequest() {
6
- this.type = StatusChangeRequest.TYPE_CHANGE_STATUS_TO;
7
- this.eventKey = null;
8
- this.objectOrObjects = null;
9
- this.status = null;
10
- this.holdToken = null;
11
- this.orderId = null;
12
- this.keepExtraData = null;
13
- this.ignoreChannels = null;
14
- this.channelKeys = null;
15
- this.allowedPreviousStatuses = null;
16
- this.rejectedPreviousStatuses = null;
17
- this.resaleListingId = null;
18
- this.season = null;
19
- }
20
- StatusChangeRequest.prototype.withType = function (type) {
1
+ export class StatusChangeRequest {
2
+ static TYPE_RELEASE = 'RELEASE';
3
+ static TYPE_CHANGE_STATUS_TO = 'CHANGE_STATUS_TO';
4
+ static TYPE_OVERRIDE_SEASON_STATUS = 'OVERRIDE_SEASON_STATUS';
5
+ static TYPE_USE_SEASON_STATUS = 'USE_SEASON_STATUS';
6
+ type = StatusChangeRequest.TYPE_CHANGE_STATUS_TO;
7
+ eventKey = null;
8
+ objectOrObjects = null;
9
+ status = null;
10
+ holdToken = null;
11
+ orderId = null;
12
+ keepExtraData = null;
13
+ ignoreChannels = null;
14
+ channelKeys = null;
15
+ allowedPreviousStatuses = null;
16
+ rejectedPreviousStatuses = null;
17
+ resaleListingId = null;
18
+ season = null;
19
+ withType(type) {
21
20
  this.type = type;
22
21
  return this;
23
- };
24
- StatusChangeRequest.prototype.withEventKey = function (eventKey) {
22
+ }
23
+ withEventKey(eventKey) {
25
24
  this.eventKey = eventKey;
26
25
  return this;
27
- };
28
- StatusChangeRequest.prototype.withObjects = function (objectOrObjects) {
26
+ }
27
+ withObjects(objectOrObjects) {
29
28
  this.objectOrObjects = objectOrObjects;
30
29
  return this;
31
- };
32
- StatusChangeRequest.prototype.withStatus = function (status) {
30
+ }
31
+ withStatus(status) {
33
32
  this.status = status;
34
33
  return this;
35
- };
36
- StatusChangeRequest.prototype.withHoldToken = function (holdToken) {
34
+ }
35
+ withHoldToken(holdToken) {
37
36
  this.holdToken = holdToken;
38
37
  return this;
39
- };
40
- StatusChangeRequest.prototype.withOrderId = function (orderId) {
38
+ }
39
+ withOrderId(orderId) {
41
40
  this.orderId = orderId;
42
41
  return this;
43
- };
44
- StatusChangeRequest.prototype.withKeepExtraData = function (keepExtraData) {
42
+ }
43
+ withKeepExtraData(keepExtraData) {
45
44
  this.keepExtraData = keepExtraData;
46
45
  return this;
47
- };
48
- StatusChangeRequest.prototype.withIgnoreChannels = function (ignoreChannels) {
46
+ }
47
+ withIgnoreChannels(ignoreChannels) {
49
48
  this.ignoreChannels = ignoreChannels;
50
49
  return this;
51
- };
52
- StatusChangeRequest.prototype.withChannelKeys = function (channelKeys) {
50
+ }
51
+ withChannelKeys(channelKeys) {
53
52
  this.channelKeys = channelKeys;
54
53
  return this;
55
- };
56
- StatusChangeRequest.prototype.withAllowedPreviousStatuses = function (allowedPreviousStatuses) {
54
+ }
55
+ withAllowedPreviousStatuses(allowedPreviousStatuses) {
57
56
  this.allowedPreviousStatuses = allowedPreviousStatuses;
58
57
  return this;
59
- };
60
- StatusChangeRequest.prototype.withRejectedPreviousStatuses = function (rejectedPreviousStatuses) {
58
+ }
59
+ withRejectedPreviousStatuses(rejectedPreviousStatuses) {
61
60
  this.rejectedPreviousStatuses = rejectedPreviousStatuses;
62
61
  return this;
63
- };
64
- StatusChangeRequest.prototype.withResaleListingId = function (resaleListingId) {
62
+ }
63
+ withResaleListingId(resaleListingId) {
65
64
  this.resaleListingId = resaleListingId;
66
65
  return this;
67
- };
68
- StatusChangeRequest.prototype.withSeasonKey = function (seasonKey) {
66
+ }
67
+ withSeasonKey(seasonKey) {
69
68
  this.season = seasonKey;
70
69
  return this;
71
- };
72
- StatusChangeRequest.TYPE_RELEASE = 'RELEASE';
73
- StatusChangeRequest.TYPE_CHANGE_STATUS_TO = 'CHANGE_STATUS_TO';
74
- StatusChangeRequest.TYPE_OVERRIDE_SEASON_STATUS = 'OVERRIDE_SEASON_STATUS';
75
- StatusChangeRequest.TYPE_USE_SEASON_STATUS = 'USE_SEASON_STATUS';
76
- return StatusChangeRequest;
77
- }());
78
- exports.StatusChangeRequest = StatusChangeRequest;
70
+ }
71
+ }
@@ -1,40 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusChangesParams = void 0;
4
- var StatusChangesParams = /** @class */ (function () {
5
- function StatusChangesParams(filter, filterType) {
6
- if (filterType === void 0) { filterType = 'CONTAINS'; }
1
+ export class StatusChangesParams {
2
+ filter;
3
+ filterType;
4
+ sortDirection;
5
+ sortField;
6
+ constructor(filter, filterType = 'CONTAINS') {
7
7
  this.filter = filter;
8
8
  this.filterType = filterType;
9
9
  }
10
- StatusChangesParams.prototype.sortByObjectLabel = function () {
10
+ sortByObjectLabel() {
11
11
  this.sortField = 'objectLabel';
12
12
  return this;
13
- };
14
- StatusChangesParams.prototype.sortByStatus = function () {
13
+ }
14
+ sortByStatus() {
15
15
  this.sortField = 'status';
16
16
  return this;
17
- };
18
- StatusChangesParams.prototype.sortByDate = function () {
17
+ }
18
+ sortByDate() {
19
19
  this.sortField = 'date';
20
20
  return this;
21
- };
22
- StatusChangesParams.prototype.sortAscending = function () {
21
+ }
22
+ sortAscending() {
23
23
  this.sortDirection = 'asc';
24
24
  return this;
25
- };
26
- StatusChangesParams.prototype.sortDescending = function () {
25
+ }
26
+ sortDescending() {
27
27
  this.sortDirection = 'desc';
28
28
  return this;
29
- };
30
- StatusChangesParams.prototype.withFilter = function (filter, filterType) {
31
- if (filterType === void 0) { filterType = 'CONTAINS'; }
29
+ }
30
+ withFilter(filter, filterType = 'CONTAINS') {
32
31
  this.filter = filter;
33
32
  this.filterType = filterType;
34
33
  return this;
35
- };
36
- StatusChangesParams.prototype.serialize = function () {
37
- var sort = null;
34
+ }
35
+ serialize() {
36
+ let sort = null;
38
37
  if (this.sortField && this.sortDirection) {
39
38
  sort = this.sortField + ':' + this.sortDirection;
40
39
  }
@@ -47,9 +46,7 @@ var StatusChangesParams = /** @class */ (function () {
47
46
  return {
48
47
  filter: this.filter,
49
48
  filterType: this.filterType,
50
- sort: sort
49
+ sort
51
50
  };
52
- };
53
- return StatusChangesParams;
54
- }());
55
- exports.StatusChangesParams = StatusChangesParams;
51
+ }
52
+ }
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableBookingConfig = void 0;
4
- var TableBookingConfig = /** @class */ (function () {
5
- function TableBookingConfig(mode, tables) {
1
+ export class TableBookingConfig {
2
+ mode;
3
+ tables;
4
+ constructor(mode, tables) {
6
5
  this.mode = mode;
7
6
  this.tables = tables;
8
7
  }
9
- TableBookingConfig.inherit = function () {
8
+ static inherit() {
10
9
  return new TableBookingConfig('INHERIT');
11
- };
12
- TableBookingConfig.allByTable = function () {
10
+ }
11
+ static allByTable() {
13
12
  return new TableBookingConfig('ALL_BY_TABLE');
14
- };
15
- TableBookingConfig.allBySeat = function () {
13
+ }
14
+ static allBySeat() {
16
15
  return new TableBookingConfig('ALL_BY_SEAT');
17
- };
18
- TableBookingConfig.custom = function (tables) {
16
+ }
17
+ static custom(tables) {
19
18
  return new TableBookingConfig('CUSTOM', tables);
20
- };
21
- return TableBookingConfig;
22
- }());
23
- exports.TableBookingConfig = TableBookingConfig;
19
+ }
20
+ }
@@ -1,35 +1,13 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.UpdateEventParams = void 0;
19
- var AbstractEventParams_1 = require("./AbstractEventParams");
20
- var UpdateEventParams = /** @class */ (function (_super) {
21
- __extends(UpdateEventParams, _super);
22
- function UpdateEventParams() {
23
- return _super !== null && _super.apply(this, arguments) || this;
24
- }
25
- UpdateEventParams.prototype.withIsInThePast = function (isInThePast) {
1
+ import { AbstractEventParams } from './AbstractEventParams';
2
+ export class UpdateEventParams extends AbstractEventParams {
3
+ isInThePast;
4
+ date;
5
+ withIsInThePast(isInThePast) {
26
6
  this.isInThePast = isInThePast;
27
7
  return this;
28
- };
29
- UpdateEventParams.prototype.withDate = function (date) {
8
+ }
9
+ withDate(date) {
30
10
  this.date = date;
31
11
  return this;
32
- };
33
- return UpdateEventParams;
34
- }(AbstractEventParams_1.AbstractEventParams));
35
- exports.UpdateEventParams = UpdateEventParams;
12
+ }
13
+ }
@@ -1,13 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HoldToken = void 0;
4
- var HoldToken = /** @class */ (function () {
5
- function HoldToken(json) {
1
+ export class HoldToken {
2
+ expiresAt;
3
+ expiresInSeconds;
4
+ holdToken;
5
+ workspaceKey;
6
+ constructor(json) {
6
7
  this.holdToken = json.holdToken;
7
8
  this.expiresAt = new Date(json.expiresAt);
8
9
  this.expiresInSeconds = json.expiresInSeconds;
9
10
  this.workspaceKey = json.workspaceKey;
10
11
  }
11
- return HoldToken;
12
- }());
13
- exports.HoldToken = HoldToken;
12
+ }
@@ -1,27 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HoldTokens = void 0;
4
- var HoldToken_1 = require("./HoldToken");
5
- var HoldTokens = /** @class */ (function () {
6
- function HoldTokens(client) {
1
+ import { HoldToken } from './HoldToken';
2
+ export class HoldTokens {
3
+ client;
4
+ constructor(client) {
7
5
  this.client = client;
8
6
  }
9
- HoldTokens.prototype.create = function (expiresInMinutes) {
10
- if (expiresInMinutes === void 0) { expiresInMinutes = null; }
11
- var request = {};
7
+ create(expiresInMinutes = null) {
8
+ const request = {};
12
9
  if (expiresInMinutes !== null) {
13
10
  request.expiresInMinutes = expiresInMinutes;
14
11
  }
15
- return this.client.post('/hold-tokens', request).then(function (res) { return new HoldToken_1.HoldToken(res.data); });
16
- };
17
- HoldTokens.prototype.expiresInMinutes = function (holdToken, minutes) {
18
- var request = {};
12
+ return this.client.post('/hold-tokens', request).then(res => new HoldToken(res.data));
13
+ }
14
+ expiresInMinutes(holdToken, minutes) {
15
+ const request = {};
19
16
  request.expiresInMinutes = minutes;
20
- return this.client.post("/hold-tokens/".concat(holdToken), request).then(function (res) { return new HoldToken_1.HoldToken(res.data); });
21
- };
22
- HoldTokens.prototype.retrieve = function (holdToken) {
23
- return this.client.get("/hold-tokens/".concat(holdToken)).then(function (res) { return new HoldToken_1.HoldToken(res.data); });
24
- };
25
- return HoldTokens;
26
- }());
27
- exports.HoldTokens = HoldTokens;
17
+ return this.client.post(`/hold-tokens/${holdToken}`, request).then(res => new HoldToken(res.data));
18
+ }
19
+ retrieve(holdToken) {
20
+ return this.client.get(`/hold-tokens/${holdToken}`).then(res => new HoldToken(res.data));
21
+ }
22
+ }
@@ -1,41 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Lister = void 0;
4
- var PageFetcher_1 = require("./PageFetcher");
5
- var AsyncIterator_1 = require("./AsyncIterator");
6
- var Lister = /** @class */ (function () {
7
- function Lister(url, client, pageCreatorFunction) {
8
- this.pageFetcher = new PageFetcher_1.PageFetcher(url, client, pageCreatorFunction);
1
+ import { PageFetcher } from './PageFetcher';
2
+ import { AsyncIterator } from './AsyncIterator';
3
+ export class Lister {
4
+ client;
5
+ pageFetcher;
6
+ url;
7
+ constructor(url, client, pageCreatorFunction) {
8
+ this.pageFetcher = new PageFetcher(url, client, pageCreatorFunction);
9
9
  this.url = url;
10
10
  this.client = client;
11
11
  }
12
- Lister.prototype.all = function (queryParams) {
13
- if (queryParams === void 0) { queryParams = null; }
14
- return new AsyncIterator_1.AsyncIterator(this.url, this.client, this.pageFetcher.pageCreator, Lister.serialize(queryParams) || {});
15
- };
16
- Lister.prototype.firstPage = function (queryParams, pageSize) {
17
- if (queryParams === void 0) { queryParams = null; }
18
- if (pageSize === void 0) { pageSize = null; }
12
+ all(queryParams = null) {
13
+ return new AsyncIterator(this.url, this.client, this.pageFetcher.pageCreator, Lister.serialize(queryParams) || {});
14
+ }
15
+ firstPage(queryParams = null, pageSize = null) {
19
16
  return this.pageFetcher.fetchAfter(null, Lister.serialize(queryParams), pageSize);
20
- };
21
- Lister.prototype.pageAfter = function (afterId, queryParams, pageSize) {
22
- if (queryParams === void 0) { queryParams = null; }
23
- if (pageSize === void 0) { pageSize = null; }
17
+ }
18
+ pageAfter(afterId, queryParams = null, pageSize = null) {
24
19
  return this.pageFetcher.fetchAfter(afterId, Lister.serialize(queryParams), pageSize);
25
- };
26
- Lister.prototype.pageBefore = function (beforeId, queryParams, pageSize) {
27
- if (queryParams === void 0) { queryParams = null; }
28
- if (pageSize === void 0) { pageSize = null; }
20
+ }
21
+ pageBefore(beforeId, queryParams = null, pageSize = null) {
29
22
  return this.pageFetcher.fetchBefore(beforeId, Lister.serialize(queryParams), pageSize);
30
- };
31
- Lister.serialize = function (queryParams) {
23
+ }
24
+ static serialize(queryParams) {
32
25
  // @ts-ignore
33
- if (queryParams === null || queryParams === void 0 ? void 0 : queryParams.serialize) {
26
+ if (queryParams?.serialize) {
34
27
  // @ts-ignore
35
28
  return queryParams.serialize();
36
29
  }
37
30
  return queryParams;
38
- };
39
- return Lister;
40
- }());
41
- exports.Lister = Lister;
31
+ }
32
+ }
@@ -1,21 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalDate = void 0;
4
- var LocalDate = /** @class */ (function () {
5
- function LocalDate(year, month, day) {
1
+ export class LocalDate {
2
+ year;
3
+ month;
4
+ day;
5
+ constructor(year, month, day) {
6
6
  this.year = year;
7
7
  this.month = month;
8
8
  this.day = day;
9
9
  }
10
- LocalDate.prototype.toString = function () {
10
+ toString() {
11
11
  return this.year + '-' + String(this.month).padStart(2, '0') + '-' + String(this.day).padStart(2, '0');
12
- };
13
- LocalDate.parse = function (date) {
14
- var year = parseInt(date.substring(0, 4));
15
- var month = parseInt(date.substring(5, 7));
16
- var day = parseInt(date.substring(8, 10));
12
+ }
13
+ static parse(date) {
14
+ const year = parseInt(date.substring(0, 4));
15
+ const month = parseInt(date.substring(5, 7));
16
+ const day = parseInt(date.substring(8, 10));
17
17
  return new LocalDate(year, month, day);
18
- };
19
- return LocalDate;
20
- }());
21
- exports.LocalDate = LocalDate;
18
+ }
19
+ }
package/dist/src/Page.js CHANGED
@@ -1,21 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Page = void 0;
4
- var Page = /** @class */ (function () {
5
- function Page(items, afterId, beforeId) {
6
- if (afterId === void 0) { afterId = null; }
7
- if (beforeId === void 0) { beforeId = null; }
1
+ export class Page {
2
+ items;
3
+ nextPageStartsAfter;
4
+ previousPageEndsBefore;
5
+ constructor(items, afterId = null, beforeId = null) {
8
6
  this.items = items;
9
7
  this.nextPageStartsAfter = afterId;
10
8
  this.previousPageEndsBefore = beforeId;
11
9
  }
12
- Page.prototype[Symbol.iterator] = function () {
13
- var index = 0;
14
- var charts = this.items;
10
+ [Symbol.iterator]() {
11
+ let index = 0;
12
+ const charts = this.items;
15
13
  return {
16
- next: function () {
14
+ next() {
17
15
  if (index < charts.length) {
18
- var chart = charts[index];
16
+ const chart = charts[index];
19
17
  index++;
20
18
  return { value: chart, done: false };
21
19
  }
@@ -24,7 +22,5 @@ var Page = /** @class */ (function () {
24
22
  }
25
23
  }
26
24
  };
27
- };
28
- return Page;
29
- }());
30
- exports.Page = Page;
25
+ }
26
+ }