seatsio 82.2.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.
|
@@ -47,7 +47,7 @@ export declare class Events {
|
|
|
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): Promise<ChangeObjectStatusResult>;
|
|
48
48
|
private doChangeStatus;
|
|
49
49
|
changeObjectStatusInBatch(statusChangeRequests: StatusChangeRequest[]): Promise<any>;
|
|
50
|
-
|
|
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>;
|
|
51
51
|
private releaseObjectsRequest;
|
|
52
52
|
private buildChangeObjectStatusRequest;
|
|
53
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;
|
|
@@ -288,7 +289,7 @@ var Events = /** @class */ (function () {
|
|
|
288
289
|
if (channelKeys === void 0) { channelKeys = null; }
|
|
289
290
|
if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
|
|
290
291
|
if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
|
|
291
|
-
var request = this.
|
|
292
|
+
var request = this.changeStatusToRequest(StatusChangeRequest_1.StatusChangeRequest.TYPE_CHANGE_STATUS_TO, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
|
|
292
293
|
return this.doChangeStatus(request, eventKeyOrKeys);
|
|
293
294
|
};
|
|
294
295
|
Events.prototype.doChangeStatus = function (request, eventKeyOrKeys) {
|
|
@@ -299,7 +300,7 @@ var Events = /** @class */ (function () {
|
|
|
299
300
|
Events.prototype.changeObjectStatusInBatch = function (statusChangeRequests) {
|
|
300
301
|
var _this = this;
|
|
301
302
|
var requests = statusChangeRequests.map(function (r) {
|
|
302
|
-
var json = _this.
|
|
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);
|
|
303
304
|
json.event = r.eventKey;
|
|
304
305
|
return json;
|
|
305
306
|
});
|
|
@@ -307,13 +308,13 @@ var Events = /** @class */ (function () {
|
|
|
307
308
|
return this.client.post('/events/actions/change-object-status?expand=objects', request)
|
|
308
309
|
.then(function (res) { return res.data.results.map(function (r) { return new ChangeObjectStatusResult_1.ChangeObjectStatusResult(r.objects); }); });
|
|
309
310
|
};
|
|
310
|
-
Events.prototype.
|
|
311
|
+
Events.prototype.changeStatusToRequest = function (type, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
|
|
311
312
|
if (channelKeys === void 0) { channelKeys = null; }
|
|
312
313
|
if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
|
|
313
314
|
if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
|
|
314
315
|
var request = this.buildChangeObjectStatusRequest(objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
|
|
315
|
-
request.type =
|
|
316
|
-
request.status = status;
|
|
316
|
+
request.type = type;
|
|
317
|
+
request.status = type !== StatusChangeRequest_1.StatusChangeRequest.TYPE_RELEASE ? status : undefined;
|
|
317
318
|
return request;
|
|
318
319
|
};
|
|
319
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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(
|
|
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;
|