seatsio 82.1.0 → 83.0.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.
@@ -27,6 +27,7 @@ export declare class Events {
27
27
  retrieve(eventKey: string): Promise<Event>;
28
28
  update(eventKey: string, params: UpdateEventParams): Promise<import("axios").AxiosResponse<any, any>>;
29
29
  delete(eventKey: string): Promise<import("axios").AxiosResponse<any, any>>;
30
+ moveEventToChartCopy(eventKey: string): Promise<Event>;
30
31
  listAll(requestParameters?: {}): import("..").AsyncIterator<Event>;
31
32
  listFirstPage(pageSize?: number | null): Promise<Page<Event>>;
32
33
  listPageAfter(afterId: number, pageSize?: number | null): Promise<Page<Event>>;
@@ -46,7 +47,7 @@ export declare class Events {
46
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): Promise<ChangeObjectStatusResult>;
47
48
  private doChangeStatus;
48
49
  changeObjectStatusInBatch(statusChangeRequests: StatusChangeRequest[]): Promise<any>;
49
- changeObjectStatusRequest(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): Dict<any>;
50
+ changeStatusToRequest(type: 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): Dict<any>;
50
51
  private releaseObjectsRequest;
51
52
  private buildChangeObjectStatusRequest;
52
53
  book(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null): Promise<ChangeObjectStatusResult>;
@@ -45,6 +45,7 @@ var StatusChange_1 = require("./StatusChange");
45
45
  var EventDeserializer_1 = require("./EventDeserializer");
46
46
  var ChangeObjectStatusResult_1 = require("./ChangeObjectStatusResult");
47
47
  var BestAvailableObjects_1 = require("./BestAvailableObjects");
48
+ var StatusChangeRequest_1 = require("./StatusChangeRequest");
48
49
  var Events = /** @class */ (function () {
49
50
  function Events(client) {
50
51
  this.client = client;
@@ -163,6 +164,10 @@ var Events = /** @class */ (function () {
163
164
  Events.prototype.delete = function (eventKey) {
164
165
  return this.client.delete("/events/".concat(encodeURIComponent(eventKey)));
165
166
  };
167
+ Events.prototype.moveEventToChartCopy = function (eventKey) {
168
+ return this.client.post("events/".concat(encodeURIComponent(eventKey), "/actions/move-to-new-chart-copy"))
169
+ .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
170
+ };
166
171
  Events.prototype.listAll = function (requestParameters) {
167
172
  if (requestParameters === void 0) { requestParameters = {}; }
168
173
  return this.iterator().all(requestParameters);
@@ -284,7 +289,7 @@ var Events = /** @class */ (function () {
284
289
  if (channelKeys === void 0) { channelKeys = null; }
285
290
  if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
286
291
  if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
287
- var request = this.changeObjectStatusRequest(objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
292
+ var request = this.changeStatusToRequest(StatusChangeRequest_1.StatusChangeRequest.TYPE_CHANGE_STATUS_TO, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
288
293
  return this.doChangeStatus(request, eventKeyOrKeys);
289
294
  };
290
295
  Events.prototype.doChangeStatus = function (request, eventKeyOrKeys) {
@@ -295,7 +300,7 @@ var Events = /** @class */ (function () {
295
300
  Events.prototype.changeObjectStatusInBatch = function (statusChangeRequests) {
296
301
  var _this = this;
297
302
  var requests = statusChangeRequests.map(function (r) {
298
- var json = _this.changeObjectStatusRequest(r.objectOrObjects, r.status, r.holdToken, r.orderId, r.keepExtraData, r.ignoreChannels, r.channelKeys, r.allowedPreviousStatuses, r.rejectedPreviousStatuses);
303
+ var json = _this.changeStatusToRequest(r.type, r.objectOrObjects, r.status, r.holdToken, r.orderId, r.keepExtraData, r.ignoreChannels, r.channelKeys, r.allowedPreviousStatuses, r.rejectedPreviousStatuses);
299
304
  json.event = r.eventKey;
300
305
  return json;
301
306
  });
@@ -303,13 +308,13 @@ var Events = /** @class */ (function () {
303
308
  return this.client.post('/events/actions/change-object-status?expand=objects', request)
304
309
  .then(function (res) { return res.data.results.map(function (r) { return new ChangeObjectStatusResult_1.ChangeObjectStatusResult(r.objects); }); });
305
310
  };
306
- Events.prototype.changeObjectStatusRequest = function (objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
311
+ Events.prototype.changeStatusToRequest = function (type, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
307
312
  if (channelKeys === void 0) { channelKeys = null; }
308
313
  if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
309
314
  if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
310
315
  var request = this.buildChangeObjectStatusRequest(objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
311
- request.type = 'CHANGE_STATUS_TO';
312
- request.status = status;
316
+ request.type = type;
317
+ request.status = type !== StatusChangeRequest_1.StatusChangeRequest.TYPE_RELEASE ? status : undefined;
313
318
  return request;
314
319
  };
315
320
  Events.prototype.releaseObjectsRequest = function (objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
@@ -1,8 +1,11 @@
1
1
  import { ObjectOrObjects } from './Events';
2
2
  export declare class StatusChangeRequest {
3
- eventKey: string;
4
- objectOrObjects: ObjectOrObjects;
5
- status: string;
3
+ static TYPE_RELEASE: string;
4
+ static TYPE_CHANGE_STATUS_TO: string;
5
+ type: string;
6
+ eventKey: string | null;
7
+ objectOrObjects: ObjectOrObjects | null;
8
+ status: string | null;
6
9
  holdToken: string | null;
7
10
  orderId: string | null;
8
11
  keepExtraData: boolean | null;
@@ -10,5 +13,15 @@ export declare class StatusChangeRequest {
10
13
  channelKeys: string[] | null;
11
14
  allowedPreviousStatuses: string[] | null;
12
15
  rejectedPreviousStatuses: string[] | null;
13
- constructor(eventKey: 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);
16
+ withType(type: string): this;
17
+ withEventKey(eventKey: string): this;
18
+ withObjects(objectOrObjects: ObjectOrObjects): this;
19
+ withStatus(status: string): this;
20
+ withHoldToken(holdToken: string): this;
21
+ withOrderId(orderId: string): this;
22
+ withKeepExtraData(keepExtraData: boolean): this;
23
+ withIgnoreChannels(ignoreChannels: boolean): this;
24
+ withChannelKeys(channelKeys: string[]): this;
25
+ withAllowedPreviousStatuses(allowedPreviousStatuses: string[]): this;
26
+ withRejectedPreviousStatuses(rejectedPreviousStatuses: string[]): this;
14
27
  }
@@ -2,18 +2,65 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatusChangeRequest = void 0;
4
4
  var StatusChangeRequest = /** @class */ (function () {
5
- function StatusChangeRequest(eventKey, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
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
+ }
18
+ StatusChangeRequest.prototype.withType = function (type) {
19
+ this.type = type;
20
+ return this;
21
+ };
22
+ StatusChangeRequest.prototype.withEventKey = function (eventKey) {
6
23
  this.eventKey = eventKey;
24
+ return this;
25
+ };
26
+ StatusChangeRequest.prototype.withObjects = function (objectOrObjects) {
7
27
  this.objectOrObjects = objectOrObjects;
28
+ return this;
29
+ };
30
+ StatusChangeRequest.prototype.withStatus = function (status) {
8
31
  this.status = status;
32
+ return this;
33
+ };
34
+ StatusChangeRequest.prototype.withHoldToken = function (holdToken) {
9
35
  this.holdToken = holdToken;
36
+ return this;
37
+ };
38
+ StatusChangeRequest.prototype.withOrderId = function (orderId) {
10
39
  this.orderId = orderId;
40
+ return this;
41
+ };
42
+ StatusChangeRequest.prototype.withKeepExtraData = function (keepExtraData) {
11
43
  this.keepExtraData = keepExtraData;
44
+ return this;
45
+ };
46
+ StatusChangeRequest.prototype.withIgnoreChannels = function (ignoreChannels) {
12
47
  this.ignoreChannels = ignoreChannels;
48
+ return this;
49
+ };
50
+ StatusChangeRequest.prototype.withChannelKeys = function (channelKeys) {
13
51
  this.channelKeys = channelKeys;
52
+ return this;
53
+ };
54
+ StatusChangeRequest.prototype.withAllowedPreviousStatuses = function (allowedPreviousStatuses) {
14
55
  this.allowedPreviousStatuses = allowedPreviousStatuses;
56
+ return this;
57
+ };
58
+ StatusChangeRequest.prototype.withRejectedPreviousStatuses = function (rejectedPreviousStatuses) {
15
59
  this.rejectedPreviousStatuses = rejectedPreviousStatuses;
16
- }
60
+ return this;
61
+ };
62
+ StatusChangeRequest.TYPE_RELEASE = 'RELEASE';
63
+ StatusChangeRequest.TYPE_CHANGE_STATUS_TO = 'CHANGE_STATUS_TO';
17
64
  return StatusChangeRequest;
18
65
  }());
19
66
  exports.StatusChangeRequest = StatusChangeRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "82.1.0",
3
+ "version": "83.0.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [