seatsio 86.3.0 → 86.5.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.
@@ -6,9 +6,9 @@ export declare class Accounts {
6
6
  retrieveMyAccount(): Promise<Account>;
7
7
  regenerateSecretKey(): Promise<any>;
8
8
  regenerateDesignerKey(): Promise<any>;
9
- enableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any>>;
10
- disableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any>>;
11
- changePassword(password: string): Promise<import("axios").AxiosResponse<any, any>>;
12
- changeHoldPeriod(holdPeriodInMinutes: number): Promise<import("axios").AxiosResponse<any, any>>;
13
- updateSetting(key: string, value: string): Promise<import("axios").AxiosResponse<any, any>>;
9
+ enableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any, {}>>;
10
+ disableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any, {}>>;
11
+ changePassword(password: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
12
+ changeHoldPeriod(holdPeriodInMinutes: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
13
+ updateSetting(key: string, value: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
14
14
  }
@@ -1,12 +1,5 @@
1
- import { SeasonJson } from './Seasons/Season';
2
- import { ChartJson } from './Charts/Chart';
3
1
  import { Page } from './Page';
4
- import { StatusChangeJson } from './Events/StatusChange';
5
- import { WorkspaceJson } from './Workspaces/Workspace';
6
- import { UserJson } from './Users/User';
7
- import { EventJson } from './Events/Event';
8
2
  import { Axios } from 'axios';
9
- import { EventLogItemJson } from './EventLog/EventLogItem';
10
3
  export interface PaginatedJson<T> {
11
4
  items: T[];
12
5
  next_page_starts_after?: number;
@@ -16,25 +9,17 @@ interface PaginationParams {
16
9
  start_after_id?: number;
17
10
  end_before_id?: number;
18
11
  }
19
- export declare class AsyncIterator<T> {
12
+ export declare class AsyncIterator<T, Y> {
20
13
  client: Axios;
21
14
  index: number;
22
15
  items: T[];
23
16
  nextPageMustBeFetched: boolean;
24
17
  nextPageStartsAfter?: number;
25
- objType: string;
18
+ pageCreator: (data: PaginatedJson<Y>) => Page<T>;
26
19
  pages: Page<T>[];
27
20
  params: PaginationParams;
28
21
  url: string;
29
- constructor(url: string, client: Axios, objType: string, params?: {});
30
- charts(json: PaginatedJson<ChartJson>): void;
31
- events(data: PaginatedJson<EventJson>): void;
32
- seasons(data: PaginatedJson<SeasonJson>): void;
33
- statusChanges(data: PaginatedJson<StatusChangeJson>): void;
34
- workspaces(data: PaginatedJson<WorkspaceJson>): void;
35
- eventLogItems(data: PaginatedJson<EventLogItemJson>): void;
36
- ticketBuyerIds(data: PaginatedJson<string>): void;
37
- users(data: PaginatedJson<UserJson>): void;
22
+ constructor(url: string, client: Axios, pageCreator: (data: PaginatedJson<Y>) => Page<T>, params?: {});
38
23
  fetch(fetchParams?: {}): Promise<void>;
39
24
  [Symbol.asyncIterator](): {
40
25
  next(): Promise<any>;
@@ -35,118 +35,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
38
47
  Object.defineProperty(exports, "__esModule", { value: true });
39
48
  exports.AsyncIterator = void 0;
40
- var Season_1 = require("./Seasons/Season");
41
- var Chart_1 = require("./Charts/Chart");
42
- var Page_1 = require("./Page");
43
- var EventDeserializer_1 = require("./Events/EventDeserializer");
44
- var StatusChange_1 = require("./Events/StatusChange");
45
- var Workspace_1 = require("./Workspaces/Workspace");
46
- var User_1 = require("./Users/User");
47
- var EventLogItem_1 = require("./EventLog/EventLogItem");
48
49
  var AsyncIterator = /** @class */ (function () {
49
- function AsyncIterator(url, client, objType, params) {
50
+ function AsyncIterator(url, client, pageCreator, params) {
50
51
  if (params === void 0) { params = {}; }
51
52
  this.url = url;
52
53
  this.client = client;
53
- this.objType = objType;
54
+ this.pageCreator = pageCreator;
54
55
  this.params = params;
55
56
  this.items = [];
56
57
  this.pages = [];
57
58
  this.index = 0;
58
59
  this.nextPageMustBeFetched = true;
59
60
  }
60
- AsyncIterator.prototype.charts = function (json) {
61
- var _this_1 = this;
62
- var charts = [];
63
- json.items.forEach(function (chartData) {
64
- var chart = new Chart_1.Chart(chartData);
65
- // @ts-ignore
66
- _this_1.items.push(chart);
67
- charts.push(chart);
68
- });
69
- // @ts-ignore
70
- this.pages.push(new Page_1.Page(charts, json.next_page_starts_after, json.previous_page_ends_before));
71
- };
72
- AsyncIterator.prototype.events = function (data) {
73
- var _this_1 = this;
74
- var events = [];
75
- data.items.forEach(function (eventData) {
76
- var event = new EventDeserializer_1.EventDeserializer().fromJson(eventData);
77
- // @ts-ignore
78
- _this_1.items.push(event);
79
- events.push(event);
80
- });
81
- // @ts-ignore
82
- this.pages.push(new Page_1.Page(events, data.next_page_starts_after, data.previous_page_ends_before));
83
- };
84
- AsyncIterator.prototype.seasons = function (data) {
85
- var _this_1 = this;
86
- var seasons = [];
87
- data.items.forEach(function (seasonData) {
88
- var season = new Season_1.Season(seasonData);
89
- // @ts-ignore
90
- _this_1.items.push(season);
91
- seasons.push(season);
92
- });
93
- // @ts-ignore
94
- this.pages.push(new Page_1.Page(seasons, data.next_page_starts_after, data.previous_page_ends_before));
95
- };
96
- AsyncIterator.prototype.statusChanges = function (data) {
97
- var _this_1 = this;
98
- var statusChanges = [];
99
- data.items.forEach(function (statusData) {
100
- var statusChange = new StatusChange_1.StatusChange(statusData);
101
- // @ts-ignore
102
- _this_1.items.push(statusChange);
103
- statusChanges.push(statusChange);
104
- });
105
- // @ts-ignore
106
- this.pages.push(new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before));
107
- };
108
- AsyncIterator.prototype.workspaces = function (data) {
109
- var _this_1 = this;
110
- var workspaces = [];
111
- data.items.forEach(function (json) {
112
- var workspace = new Workspace_1.Workspace(json);
113
- // @ts-ignore
114
- _this_1.items.push(workspace);
115
- workspaces.push(workspace);
116
- });
117
- // @ts-ignore
118
- this.pages.push(new Page_1.Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before));
119
- };
120
- AsyncIterator.prototype.eventLogItems = function (data) {
121
- var _this_1 = this;
122
- var eventLogItems = [];
123
- data.items.forEach(function (json) {
124
- var eventLogItem = new EventLogItem_1.EventLogItem(json);
125
- // @ts-ignore
126
- _this_1.items.push(eventLogItem);
127
- eventLogItems.push(eventLogItem);
128
- });
129
- // @ts-ignore
130
- this.pages.push(new Page_1.Page(eventLogItems, data.next_page_starts_after, data.previous_page_ends_before));
131
- };
132
- AsyncIterator.prototype.ticketBuyerIds = function (data) {
133
- // @ts-ignore
134
- this.items = data.items;
135
- // @ts-ignore
136
- this.pages.push(new Page_1.Page(data.items, data.next_page_starts_after, data.previous_page_ends_before));
137
- };
138
- AsyncIterator.prototype.users = function (data) {
139
- var _this_1 = this;
140
- var users = [];
141
- data.items.forEach(function (userData) {
142
- var user = new User_1.User(userData);
143
- // @ts-ignore
144
- _this_1.items.push(user);
145
- users.push(user);
146
- });
147
- // @ts-ignore
148
- this.pages.push(new Page_1.Page(users, data.next_page_starts_after, data.previous_page_ends_before));
149
- };
150
61
  AsyncIterator.prototype.fetch = function (fetchParams) {
151
62
  var _this_1 = this;
152
63
  if (fetchParams === void 0) { fetchParams = {}; }
@@ -159,34 +70,9 @@ var AsyncIterator = /** @class */ (function () {
159
70
  else {
160
71
  _this_1.nextPageMustBeFetched = false;
161
72
  }
162
- switch (_this_1.objType) {
163
- case 'charts':
164
- _this_1.charts(res.data);
165
- break;
166
- case 'events':
167
- _this_1.events(res.data);
168
- break;
169
- case 'seasons':
170
- _this_1.seasons(res.data);
171
- break;
172
- case 'statusChanges':
173
- _this_1.statusChanges(res.data);
174
- break;
175
- case 'users':
176
- _this_1.users(res.data);
177
- break;
178
- case 'workspaces':
179
- _this_1.workspaces(res.data);
180
- break;
181
- case 'eventLogItems':
182
- _this_1.eventLogItems(res.data);
183
- break;
184
- case 'ticketBuyerIds':
185
- _this_1.ticketBuyerIds(res.data);
186
- break;
187
- default:
188
- throw new Error("Unknown object type '".concat(_this_1.objType, "'"));
189
- }
73
+ var page = _this_1.pageCreator(res.data);
74
+ _this_1.items = __spreadArray(__spreadArray([], _this_1.items, true), page.items, true);
75
+ _this_1.pages.push(page);
190
76
  });
191
77
  };
192
78
  AsyncIterator.prototype[Symbol.asyncIterator] = function () {
@@ -10,21 +10,21 @@ export declare class Charts {
10
10
  client: Axios;
11
11
  constructor(client: Axios);
12
12
  create(name?: string | null, venueType?: Venue | null, categories?: CategoryJson[] | null): Promise<Chart>;
13
- update(key: string, name?: string | null, categories?: CategoryJson[] | null): Promise<import("axios").AxiosResponse<any, any>>;
14
- addCategory(key: string, category: CategoryJson): Promise<import("axios").AxiosResponse<any, any>>;
15
- removeCategory(chartKey: string, categoryKey: CategoryKey): Promise<import("axios").AxiosResponse<any, any>>;
13
+ update(key: string, name?: string | null, categories?: CategoryJson[] | null): Promise<import("axios").AxiosResponse<any, any, {}>>;
14
+ addCategory(key: string, category: CategoryJson): Promise<import("axios").AxiosResponse<any, any, {}>>;
15
+ removeCategory(chartKey: string, categoryKey: CategoryKey): Promise<import("axios").AxiosResponse<any, any, {}>>;
16
16
  listCategories(key: string): Promise<any>;
17
- updateCategory(chartKey: string, categoryKey: CategoryKey, params: CategoryUpdateParams): Promise<import("axios").AxiosResponse<any, any>>;
17
+ updateCategory(chartKey: string, categoryKey: CategoryKey, params: CategoryUpdateParams): Promise<import("axios").AxiosResponse<any, any, {}>>;
18
18
  validatePublishedVersion(key: string): Promise<any>;
19
19
  validateDraftVersion(key: string): Promise<any>;
20
20
  retrieve(key: string): Promise<Chart>;
21
21
  retrieveWithEvents(key: string): Promise<Chart>;
22
22
  retrievePublishedVersion(key: string): Promise<any>;
23
23
  retrieveDraftVersion(key: string): Promise<any>;
24
- publishDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any>>;
25
- discardDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any>>;
26
- moveToArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
27
- moveOutOfArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
24
+ publishDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
25
+ discardDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
26
+ moveToArchive(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
27
+ moveOutOfArchive(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
28
28
  copy(key: string): Promise<Chart>;
29
29
  copyDraftVersion(key: string): Promise<Chart>;
30
30
  copyToWorkspace(key: string, workspaceKey: string): Promise<Chart>;
@@ -32,9 +32,9 @@ export declare class Charts {
32
32
  retrievePublishedVersionThumbnail(key: string): Promise<any>;
33
33
  retrieveDraftVersionThumbnail(key: string): Promise<any>;
34
34
  listAllTags(): Promise<any>;
35
- addTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any>>;
36
- removeTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any>>;
37
- listAll(chartListParams?: ChartListParams | null): import("..").AsyncIterator<Chart>;
35
+ addTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
36
+ removeTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
37
+ listAll(chartListParams?: ChartListParams | null): import("..").AsyncIterator<Chart, ChartJson>;
38
38
  listFirstPage(chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
39
39
  listPageAfter(afterId: number, chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
40
40
  listPageBefore(beforeId: number, chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
@@ -7,7 +7,7 @@ var Chart_1 = require("./Chart");
7
7
  var Charts = /** @class */ (function () {
8
8
  function Charts(client) {
9
9
  this.client = client;
10
- this.archive = new Lister_1.Lister('/charts/archive', this.client, 'charts', function (data) {
10
+ this.archive = new Lister_1.Lister('/charts/archive', this.client, function (data) {
11
11
  var charts = data.items.map(function (chartData) { return new Chart_1.Chart(chartData); });
12
12
  return new Page_1.Page(charts, data.next_page_starts_after, data.previous_page_ends_before);
13
13
  });
@@ -146,7 +146,7 @@ var Charts = /** @class */ (function () {
146
146
  return this.iterator().pageBefore(beforeId, chartListParams, pageSize);
147
147
  };
148
148
  Charts.prototype.iterator = function () {
149
- return new Lister_1.Lister('/charts', this.client, 'charts', function (data) {
149
+ return new Lister_1.Lister('/charts', this.client, function (data) {
150
150
  var charts = data.items.map(function (chartData) { return new Chart_1.Chart(chartData); });
151
151
  return new Page_1.Page(charts, data.next_page_starts_after, data.previous_page_ends_before);
152
152
  });
@@ -7,7 +7,7 @@ export declare class EventLog {
7
7
  client: Axios;
8
8
  seatsioClient: SeatsioClient;
9
9
  constructor(client: Axios, seatsioClient: SeatsioClient);
10
- listAll(): import("..").AsyncIterator<EventLogItem>;
10
+ listAll(): import("..").AsyncIterator<EventLogItem, EventLogItemJson>;
11
11
  listFirstPage(pageSize?: number | null): Promise<Page<EventLogItem>>;
12
12
  listPageAfter(afterId: number, pageSize?: number | null): Promise<Page<EventLogItem>>;
13
13
  listPageBefore(beforeId: number, pageSize?: number | null): Promise<Page<EventLogItem>>;
@@ -25,7 +25,7 @@ var EventLog = /** @class */ (function () {
25
25
  return this.iterator().pageBefore(beforeId, null, pageSize);
26
26
  };
27
27
  EventLog.prototype.iterator = function () {
28
- return new Lister_1.Lister('/event-log', this.client, 'eventLogItems', function (data) {
28
+ return new Lister_1.Lister('/event-log', this.client, function (data) {
29
29
  var eventLogItems = data.items.map(function (json) { return new EventLogItem_1.EventLogItem(json); });
30
30
  return new Page_1.Page(eventLogItems, data.next_page_starts_after, data.previous_page_ends_before);
31
31
  });
@@ -3,11 +3,11 @@ import { Channel } from './Channel';
3
3
  export declare class Channels {
4
4
  client: Axios;
5
5
  constructor(client: Axios);
6
- add(eventKey: string, channelKey: string, name: string, color: string | undefined, index: number | undefined, objects: string[] | undefined): Promise<import("axios").AxiosResponse<any, any>>;
7
- addMultiple(eventKey: string, channelCreationParams: any): Promise<import("axios").AxiosResponse<any, any>>;
8
- remove(eventKey: string, channelKey: string): Promise<import("axios").AxiosResponse<any, any>>;
9
- update(eventKey: string, channelKey: string, newChannelName: any, newColor: any, newObjects: any): Promise<import("axios").AxiosResponse<any, any>>;
10
- addObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
11
- removeObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
12
- replace(eventKey: string, channels: Channel[]): Promise<import("axios").AxiosResponse<any, any>>;
6
+ add(eventKey: string, channelKey: string, name: string, color: string | undefined, index: number | undefined, objects: string[] | undefined): Promise<import("axios").AxiosResponse<any, any, {}>>;
7
+ addMultiple(eventKey: string, channelCreationParams: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
8
+ remove(eventKey: string, channelKey: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
9
+ update(eventKey: string, channelKey: string, newChannelName: any, newColor: any, newObjects: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
10
+ addObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any, {}>>;
11
+ removeObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any, {}>>;
12
+ replace(eventKey: string, channels: Channel[]): Promise<import("axios").AxiosResponse<any, any, {}>>;
13
13
  }
@@ -25,23 +25,23 @@ export declare class Events {
25
25
  create(chartKey: string, params?: CreateEventParams): Promise<Event>;
26
26
  createMultiple(chartKey: string, events?: CreateEventParams[]): Promise<Event[]>;
27
27
  retrieve(eventKey: string): Promise<Event>;
28
- update(eventKey: string, params: UpdateEventParams): Promise<import("axios").AxiosResponse<any, any>>;
29
- delete(eventKey: string): Promise<import("axios").AxiosResponse<any, any>>;
28
+ update(eventKey: string, params: UpdateEventParams): Promise<import("axios").AxiosResponse<any, any, {}>>;
29
+ delete(eventKey: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
30
30
  moveEventToChartCopy(eventKey: string): Promise<Event>;
31
- listAll(requestParameters?: {}): import("..").AsyncIterator<Event>;
31
+ listAll(requestParameters?: {}): import("..").AsyncIterator<Event, EventJson>;
32
32
  listFirstPage(pageSize?: number | null): Promise<Page<Event>>;
33
33
  listPageAfter(afterId: number, pageSize?: number | null): Promise<Page<Event>>;
34
34
  listPageBefore(beforeId: number, pageSize?: number | null): Promise<Page<Event>>;
35
35
  iterator(): Lister<Event, EventJson>;
36
36
  statusChanges(eventKey: string): Lister<StatusChange, StatusChangeJson>;
37
37
  statusChangesForObject(eventKey: string, objectId: string): Lister<StatusChange, StatusChangeJson>;
38
- markAsForSale(eventKey: string, objects?: string[] | null, areaPlaces?: object | null, categories?: string[] | null): Promise<import("axios").AxiosResponse<any, any>>;
39
- markAsNotForSale(eventKey: string, objects?: string[] | null, areaPlaces?: object | null, categories?: string[] | null): Promise<import("axios").AxiosResponse<any, any>>;
40
- markEverythingAsForSale(eventKey: string): Promise<import("axios").AxiosResponse<any, any>>;
41
- overrideSeasonObjectStatus(eventKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
42
- useSeasonObjectStatus(eventKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
43
- updateExtraData(eventKey: string, obj: string, extraData: object): Promise<import("axios").AxiosResponse<any, any>>;
44
- updateExtraDatas(eventKey: string, extraData: Dict<any>): Promise<import("axios").AxiosResponse<any, any>>;
38
+ markAsForSale(eventKey: string, objects?: string[] | null, areaPlaces?: object | null, categories?: string[] | null): Promise<import("axios").AxiosResponse<any, any, {}>>;
39
+ markAsNotForSale(eventKey: string, objects?: string[] | null, areaPlaces?: object | null, categories?: string[] | null): Promise<import("axios").AxiosResponse<any, any, {}>>;
40
+ markEverythingAsForSale(eventKey: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
41
+ overrideSeasonObjectStatus(eventKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any, {}>>;
42
+ useSeasonObjectStatus(eventKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any, {}>>;
43
+ updateExtraData(eventKey: string, obj: string, extraData: object): Promise<import("axios").AxiosResponse<any, any, {}>>;
44
+ updateExtraDatas(eventKey: string, extraData: Dict<any>): Promise<import("axios").AxiosResponse<any, any, {}>>;
45
45
  retrieveObjectInfo(eventKey: string, label: string): Promise<EventObjectInfo>;
46
46
  retrieveObjectInfos(eventKey: string, labels: string[]): Promise<Dict<EventObjectInfo>>;
47
47
  changeObjectStatus(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, status: string, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, allowedPreviousStatuses?: string[] | null, rejectedPreviousStatuses?: string[] | null, resaleListingId?: string | null): Promise<ChangeObjectStatusResult>;
@@ -182,19 +182,19 @@ var Events = /** @class */ (function () {
182
182
  return this.iterator().pageBefore(beforeId, null, pageSize);
183
183
  };
184
184
  Events.prototype.iterator = function () {
185
- return new Lister_1.Lister('/events', this.client, 'events', function (data) {
185
+ return new Lister_1.Lister('/events', this.client, function (data) {
186
186
  var events = data.items.map(function (eventData) { return new EventDeserializer_1.EventDeserializer().fromJson(eventData); });
187
187
  return new Page_1.Page(events, data.next_page_starts_after, data.previous_page_ends_before);
188
188
  });
189
189
  };
190
190
  Events.prototype.statusChanges = function (eventKey) {
191
- return new Lister_1.Lister("/events/".concat(encodeURIComponent(eventKey), "/status-changes"), this.client, 'statusChanges', function (data) {
191
+ return new Lister_1.Lister("/events/".concat(encodeURIComponent(eventKey), "/status-changes"), this.client, function (data) {
192
192
  var statusChanges = data.items.map(function (statusChangesData) { return new StatusChange_1.StatusChange(statusChangesData); });
193
193
  return new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before);
194
194
  });
195
195
  };
196
196
  Events.prototype.statusChangesForObject = function (eventKey, objectId) {
197
- return new Lister_1.Lister("/events/".concat(encodeURIComponent(eventKey), "/objects/").concat(encodeURIComponent(objectId), "/status-changes"), this.client, 'statusChanges', function (data) {
197
+ return new Lister_1.Lister("/events/".concat(encodeURIComponent(eventKey), "/objects/").concat(encodeURIComponent(objectId), "/status-changes"), this.client, function (data) {
198
198
  var statusChanges = data.items.map(function (statusChangesData) { return new StatusChange_1.StatusChange(statusChangesData); });
199
199
  return new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before);
200
200
  });
@@ -5,10 +5,9 @@ import { Page } from './Page';
5
5
  export declare class Lister<T, Y> {
6
6
  client: Axios;
7
7
  pageFetcher: PageFetcher<T, Y>;
8
- type: string;
9
8
  url: string;
10
- constructor(url: string, client: Axios, type: string, pageCreatorFunction: (data: PaginatedJson<Y>) => Page<T>);
11
- all(queryParams?: object | null): AsyncIterator<T>;
9
+ constructor(url: string, client: Axios, pageCreatorFunction: (data: PaginatedJson<Y>) => Page<T>);
10
+ all(queryParams?: object | null): AsyncIterator<T, Y>;
12
11
  firstPage(queryParams?: object | null, pageSize?: number | null): Promise<Page<T>>;
13
12
  pageAfter(afterId: number, queryParams?: object | null, pageSize?: number | null): Promise<Page<T>>;
14
13
  pageBefore(beforeId: number, queryParams?: object | null, pageSize?: number | null): Promise<Page<T>>;
@@ -4,15 +4,14 @@ exports.Lister = void 0;
4
4
  var PageFetcher_1 = require("./PageFetcher");
5
5
  var AsyncIterator_1 = require("./AsyncIterator");
6
6
  var Lister = /** @class */ (function () {
7
- function Lister(url, client, type, pageCreatorFunction) {
7
+ function Lister(url, client, pageCreatorFunction) {
8
8
  this.pageFetcher = new PageFetcher_1.PageFetcher(url, client, pageCreatorFunction);
9
9
  this.url = url;
10
10
  this.client = client;
11
- this.type = type;
12
11
  }
13
12
  Lister.prototype.all = function (queryParams) {
14
13
  if (queryParams === void 0) { queryParams = null; }
15
- return new AsyncIterator_1.AsyncIterator(this.url, this.client, this.type, Lister.serialize(queryParams) || {});
14
+ return new AsyncIterator_1.AsyncIterator(this.url, this.client, this.pageFetcher.pageCreator, Lister.serialize(queryParams) || {});
16
15
  };
17
16
  Lister.prototype.firstPage = function (queryParams, pageSize) {
18
17
  if (queryParams === void 0) { queryParams = null; }
@@ -1,6 +1,4 @@
1
1
  import { Accounts } from './Accounts/Accounts';
2
- import { Users } from './Users/Users';
3
- import { Invitations } from './Invitations/Invitations';
4
2
  import { Charts } from './Charts/Charts';
5
3
  import { Events } from './Events/Events';
6
4
  import { Workspaces } from './Workspaces/Workspaces';
@@ -22,11 +20,9 @@ export declare class SeatsioClient {
22
20
  eventReports: EventReports;
23
21
  events: Events;
24
22
  holdTokens: HoldTokens;
25
- invitations: Invitations;
26
23
  requestListener: any;
27
24
  seasons: Seasons;
28
25
  usageReports: UsageReports;
29
- users: Users;
30
26
  workspaces: Workspaces;
31
27
  eventLog: EventLog;
32
28
  ticketBuyers: TicketBuyers;
@@ -5,8 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SeatsioClient = void 0;
7
7
  var Accounts_1 = require("./Accounts/Accounts");
8
- var Users_1 = require("./Users/Users");
9
- var Invitations_1 = require("./Invitations/Invitations");
10
8
  var Charts_1 = require("./Charts/Charts");
11
9
  var Events_1 = require("./Events/Events");
12
10
  var Workspaces_1 = require("./Workspaces/Workspaces");
@@ -33,8 +31,6 @@ var SeatsioClient = /** @class */ (function () {
33
31
  this.charts = new Charts_1.Charts(this.client);
34
32
  this.events = new Events_1.Events(this.client);
35
33
  this.workspaces = new Workspaces_1.Workspaces(this.client);
36
- this.users = new Users_1.Users(this.client);
37
- this.invitations = new Invitations_1.Invitations(this.client);
38
34
  this.holdTokens = new HoldTokens_1.HoldTokens(this.client);
39
35
  this.accounts = new Accounts_1.Accounts(this.client);
40
36
  this.chartReports = new ChartReports_1.ChartReports(this.client);
@@ -9,6 +9,6 @@ export declare class TicketBuyers {
9
9
  constructor(client: Axios, seatsioClient: SeatsioClient);
10
10
  add(ids: string[]): Promise<AddTicketBuyerIdsResponse>;
11
11
  remove(ids: string[]): Promise<RemoveTicketBuyerIdsResponse>;
12
- listAll(): import("..").AsyncIterator<string>;
12
+ listAll(): import("..").AsyncIterator<string, string>;
13
13
  iterator(): Lister<string, string>;
14
14
  }
@@ -72,7 +72,7 @@ var TicketBuyers = /** @class */ (function () {
72
72
  return this.iterator().all();
73
73
  };
74
74
  TicketBuyers.prototype.iterator = function () {
75
- return new Lister_1.Lister('/ticket-buyers', this.client, 'ticketBuyerIds', function (data) {
75
+ return new Lister_1.Lister('/ticket-buyers', this.client, function (data) {
76
76
  return new Page_1.Page(data.items, data.next_page_starts_after, data.previous_page_ends_before);
77
77
  });
78
78
  };
@@ -6,22 +6,22 @@ export declare class Workspaces {
6
6
  client: Axios;
7
7
  constructor(client: Axios);
8
8
  create(name: string, isTest?: boolean): Promise<Workspace>;
9
- update(key: string, name: string): Promise<import("axios").AxiosResponse<any, any>>;
10
- setDefault(key: string): Promise<import("axios").AxiosResponse<any, any>>;
9
+ update(key: string, name: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
10
+ setDefault(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
11
11
  regenerateSecretKey(key: string): Promise<any>;
12
- activate(key: string): Promise<import("axios").AxiosResponse<any, any>>;
13
- deactivate(key: string): Promise<import("axios").AxiosResponse<any, any>>;
14
- delete(key: string): Promise<import("axios").AxiosResponse<any, any>>;
12
+ activate(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
13
+ deactivate(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
14
+ delete(key: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
15
15
  retrieve(key: string): Promise<Workspace>;
16
- listAll(filter?: string | null): import("..").AsyncIterator<Workspace>;
16
+ listAll(filter?: string | null): import("..").AsyncIterator<Workspace, WorkspaceJson>;
17
17
  listFirstPage(filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
18
18
  listPageAfter(afterId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
19
19
  listPageBefore(beforeId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
20
- listActive(filter?: string | null): import("..").AsyncIterator<Workspace>;
20
+ listActive(filter?: string | null): import("..").AsyncIterator<Workspace, WorkspaceJson>;
21
21
  listActiveFirstPage(filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
22
22
  listActivePageAfter(afterId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
23
23
  listActivePageBefore(beforeId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
24
- listInactive(filter?: string | null): import("..").AsyncIterator<Workspace>;
24
+ listInactive(filter?: string | null): import("..").AsyncIterator<Workspace, WorkspaceJson>;
25
25
  listInactiveFirstPage(filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
26
26
  listInactivePageAfter(afterId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
27
27
  listInactivePageBefore(beforeId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Workspace>>;
@@ -108,19 +108,19 @@ var Workspaces = /** @class */ (function () {
108
108
  return this.inactiveWorkspacesIterator().pageBefore(beforeId, requestParameters, pageSize);
109
109
  };
110
110
  Workspaces.prototype.iterator = function () {
111
- return new Lister_1.Lister('/workspaces', this.client, 'workspaces', function (data) {
111
+ return new Lister_1.Lister('/workspaces', this.client, function (data) {
112
112
  var workspaces = data.items.map(function (json) { return new Workspace_1.Workspace(json); });
113
113
  return new Page_1.Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before);
114
114
  });
115
115
  };
116
116
  Workspaces.prototype.activeWorkspacesIterator = function () {
117
- return new Lister_1.Lister('/workspaces/active', this.client, 'workspaces', function (data) {
117
+ return new Lister_1.Lister('/workspaces/active', this.client, function (data) {
118
118
  var workspaces = data.items.map(function (json) { return new Workspace_1.Workspace(json); });
119
119
  return new Page_1.Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before);
120
120
  });
121
121
  };
122
122
  Workspaces.prototype.inactiveWorkspacesIterator = function () {
123
- return new Lister_1.Lister('/workspaces/inactive', this.client, 'workspaces', function (data) {
123
+ return new Lister_1.Lister('/workspaces/inactive', this.client, function (data) {
124
124
  var workspaces = data.items.map(function (json) { return new Workspace_1.Workspace(json); });
125
125
  return new Page_1.Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before);
126
126
  });
@@ -46,8 +46,6 @@ export * from './Events/TableBookingConfig';
46
46
  export * from './Events/UpdateEventParams';
47
47
  export * from './HoldTokens/HoldToken';
48
48
  export * from './HoldTokens/HoldTokens';
49
- export * from './Invitations/Invitation';
50
- export * from './Invitations/Invitations';
51
49
  export * from './Reports/ChartReports';
52
50
  export * from './Reports/EventReports';
53
51
  export * from './Reports/UsageReports';
@@ -57,7 +55,5 @@ export * from './Seasons/Seasons';
57
55
  export * from './TicketBuyers/AddTicketBuyerIdsResponse';
58
56
  export * from './TicketBuyers/RemoveTicketBuyerIdsResponse';
59
57
  export * from './TicketBuyers/TicketBuyers';
60
- export * from './Users/User';
61
- export * from './Users/Users';
62
58
  export * from './Workspaces/Workspace';
63
59
  export * from './Workspaces/Workspaces';
package/dist/src/index.js CHANGED
@@ -62,8 +62,6 @@ __exportStar(require("./Events/TableBookingConfig"), exports);
62
62
  __exportStar(require("./Events/UpdateEventParams"), exports);
63
63
  __exportStar(require("./HoldTokens/HoldToken"), exports);
64
64
  __exportStar(require("./HoldTokens/HoldTokens"), exports);
65
- __exportStar(require("./Invitations/Invitation"), exports);
66
- __exportStar(require("./Invitations/Invitations"), exports);
67
65
  __exportStar(require("./Reports/ChartReports"), exports);
68
66
  __exportStar(require("./Reports/EventReports"), exports);
69
67
  __exportStar(require("./Reports/UsageReports"), exports);
@@ -73,7 +71,5 @@ __exportStar(require("./Seasons/Seasons"), exports);
73
71
  __exportStar(require("./TicketBuyers/AddTicketBuyerIdsResponse"), exports);
74
72
  __exportStar(require("./TicketBuyers/RemoveTicketBuyerIdsResponse"), exports);
75
73
  __exportStar(require("./TicketBuyers/TicketBuyers"), exports);
76
- __exportStar(require("./Users/User"), exports);
77
- __exportStar(require("./Users/Users"), exports);
78
74
  __exportStar(require("./Workspaces/Workspace"), exports);
79
75
  __exportStar(require("./Workspaces/Workspaces"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "86.3.0",
3
+ "version": "86.5.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/seatsio/seatsio-js"
19
19
  },
20
20
  "dependencies": {
21
- "axios": "1.11.0"
21
+ "axios": "1.12.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@jest/globals": "30.1.2",
@@ -1,9 +0,0 @@
1
- import { Dict } from '../Dict';
2
- export type InvitationJson = Dict<any>;
3
- export declare class Invitation {
4
- date: Date;
5
- email: string;
6
- id: number;
7
- status: string;
8
- constructor(json: InvitationJson);
9
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Invitation = void 0;
4
- var Invitation = /** @class */ (function () {
5
- function Invitation(json) {
6
- this.id = json.id;
7
- this.status = json.status;
8
- this.email = json.email;
9
- this.date = new Date(json.date);
10
- }
11
- return Invitation;
12
- }());
13
- exports.Invitation = Invitation;
@@ -1,6 +0,0 @@
1
- import { Axios } from 'axios';
2
- export declare class Invitations {
3
- client: Axios;
4
- constructor(client: Axios);
5
- listAll(): Promise<any>;
6
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Invitations = void 0;
4
- var Invitation_1 = require("./Invitation");
5
- var Invitations = /** @class */ (function () {
6
- function Invitations(client) {
7
- this.client = client;
8
- }
9
- Invitations.prototype.listAll = function () {
10
- return this.client.get('/invitations')
11
- .then(function (res) { return res.data.map(function (json) { return new Invitation_1.Invitation(json); }); });
12
- };
13
- return Invitations;
14
- }());
15
- exports.Invitations = Invitations;
@@ -1,14 +0,0 @@
1
- import { Dict } from '../Dict';
2
- export type UserJson = Dict<any>;
3
- export declare class User {
4
- createdOn: Date | null;
5
- email: string;
6
- id: number;
7
- isActive: boolean;
8
- name: string;
9
- role: string;
10
- status: string;
11
- workspaces: any;
12
- nonAdminHasAccessToAllWorkspaces?: boolean;
13
- constructor(json: UserJson);
14
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.User = void 0;
4
- var User = /** @class */ (function () {
5
- function User(json) {
6
- this.id = json.id;
7
- this.email = json.email;
8
- this.name = json.name;
9
- this.role = json.role;
10
- this.createdOn = json.createdOn ? new Date(json.createdOn) : null;
11
- this.isActive = json.isActive;
12
- this.status = json.status;
13
- this.workspaces = json.workspaces;
14
- this.nonAdminHasAccessToAllWorkspaces = json.nonAdminHasAccessToAllWorkspaces;
15
- }
16
- return User;
17
- }());
18
- exports.User = User;
@@ -1,18 +0,0 @@
1
- import { Invitation } from '../Invitations/Invitation';
2
- import { Page } from '../Page';
3
- import { User, UserJson } from './User';
4
- import { Lister } from '../Lister';
5
- import { Axios } from 'axios';
6
- export declare class Users {
7
- client: Axios;
8
- constructor(client: Axios);
9
- invite(email: string, role: string, workspaces?: string[]): Promise<Invitation>;
10
- retrieve(id: number): Promise<User>;
11
- activate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
12
- deactivate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
13
- listAll(role?: string | null): import("..").AsyncIterator<User>;
14
- listFirstPage(role?: string | null, pageSize?: number | null): Promise<Page<User>>;
15
- listPageAfter(afterId: number, role?: string | null, pageSize?: number | null): Promise<Page<User>>;
16
- listPageBefore(beforeId: number, role?: string | null, pageSize?: number | null): Promise<Page<User>>;
17
- iterator(): Lister<User, UserJson>;
18
- }
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Users = void 0;
4
- var Invitation_1 = require("../Invitations/Invitation");
5
- var Page_1 = require("../Page");
6
- var User_1 = require("./User");
7
- var Lister_1 = require("../Lister");
8
- var Users = /** @class */ (function () {
9
- function Users(client) {
10
- this.client = client;
11
- }
12
- Users.prototype.invite = function (email, role, workspaces) {
13
- var requestParameters = { email: email, role: role, workspaces: workspaces };
14
- return this.client.post('/users/actions/invite', requestParameters)
15
- .then(function (res) { return new Invitation_1.Invitation(res.data); });
16
- };
17
- Users.prototype.retrieve = function (id) {
18
- return this.client.get("/users/".concat(id)).then(function (res) { return new User_1.User(res.data); });
19
- };
20
- Users.prototype.activate = function (id) {
21
- return this.client.post("/users/".concat(id, "/actions/activate"));
22
- };
23
- Users.prototype.deactivate = function (id) {
24
- return this.client.post("/users/".concat(id, "/actions/deactivate"));
25
- };
26
- Users.prototype.listAll = function (role) {
27
- if (role === void 0) { role = null; }
28
- var requestParameters = role !== null ? { role: role } : {};
29
- return this.iterator().all(requestParameters);
30
- };
31
- Users.prototype.listFirstPage = function (role, pageSize) {
32
- if (role === void 0) { role = null; }
33
- if (pageSize === void 0) { pageSize = null; }
34
- var requestParameters = role !== null ? { role: role } : {};
35
- return this.iterator().firstPage(requestParameters, pageSize);
36
- };
37
- Users.prototype.listPageAfter = function (afterId, role, pageSize) {
38
- if (role === void 0) { role = null; }
39
- if (pageSize === void 0) { pageSize = null; }
40
- var requestParameters = role !== null ? { role: role } : {};
41
- return this.iterator().pageAfter(afterId, requestParameters, pageSize);
42
- };
43
- Users.prototype.listPageBefore = function (beforeId, role, pageSize) {
44
- if (role === void 0) { role = null; }
45
- if (pageSize === void 0) { pageSize = null; }
46
- var requestParameters = role !== null ? { role: role } : {};
47
- return this.iterator().pageBefore(beforeId, requestParameters, pageSize);
48
- };
49
- Users.prototype.iterator = function () {
50
- return new Lister_1.Lister('/users', this.client, 'users', function (data) {
51
- var users = data.items.map(function (usersData) { return new User_1.User(usersData); });
52
- return new Page_1.Page(users, data.next_page_starts_after, data.previous_page_ends_before);
53
- });
54
- };
55
- return Users;
56
- }());
57
- exports.Users = Users;