btrz-api-client 5.168.0 → 5.170.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.
- package/lib/client-standalone-min.js +3 -3
- package/lib/endpoints/inventory/seatmaps.js +16 -1
- package/lib/endpoints/sales/order.js +17 -1
- package/package.json +1 -1
- package/src/endpoints/inventory/seatmaps.js +9 -1
- package/src/endpoints/sales/order.js +12 -2
- package/test/endpoints/inventory/seatmaps.test.js +13 -0
- package/test/endpoints/sales/order.test.js +7 -1
- package/types/client.d.ts +14 -0
- package/types/endpoints/inventory/seatmaps.d.ts +7 -0
- package/types/endpoints/sales/order.d.ts +7 -0
- package/types/initializedClient.d.ts +14 -0
|
@@ -94,13 +94,28 @@ function seatmapsFactory(_ref) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
function getOccupiedSeats(_ref8) {
|
|
98
|
+
var token = _ref8.token,
|
|
99
|
+
jwtToken = _ref8.jwtToken,
|
|
100
|
+
seatmapId = _ref8.seatmapId,
|
|
101
|
+
_ref8$query = _ref8.query,
|
|
102
|
+
query = _ref8$query === undefined ? {} : _ref8$query,
|
|
103
|
+
headers = _ref8.headers;
|
|
104
|
+
|
|
105
|
+
return client.get("/seatmaps/" + seatmapId + "/occupied-seats", {
|
|
106
|
+
params: query,
|
|
107
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
97
111
|
return {
|
|
98
112
|
all: all,
|
|
99
113
|
get: get,
|
|
100
114
|
getById: getById,
|
|
101
115
|
create: create,
|
|
102
116
|
remove: remove,
|
|
103
|
-
update: update
|
|
117
|
+
update: update,
|
|
118
|
+
getOccupiedSeats: getOccupiedSeats
|
|
104
119
|
};
|
|
105
120
|
}
|
|
106
121
|
|
|
@@ -35,9 +35,25 @@ function orderFactory(_ref) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function overwrite(_ref4) {
|
|
39
|
+
var token = _ref4.token,
|
|
40
|
+
orderId = _ref4.orderId,
|
|
41
|
+
payments = _ref4.payments,
|
|
42
|
+
jwtToken = _ref4.jwtToken,
|
|
43
|
+
headers = _ref4.headers;
|
|
44
|
+
|
|
45
|
+
return client({
|
|
46
|
+
url: "/orders/" + orderId + "/payments",
|
|
47
|
+
method: "post",
|
|
48
|
+
data: payments,
|
|
49
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
38
53
|
return {
|
|
39
54
|
create: create,
|
|
40
|
-
get: get
|
|
55
|
+
get: get,
|
|
56
|
+
overwrite: overwrite
|
|
41
57
|
};
|
|
42
58
|
}
|
|
43
59
|
|
package/package.json
CHANGED
|
@@ -51,13 +51,21 @@ function seatmapsFactory({client, internalAuthTokenProvider}) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
function getOccupiedSeats({token, jwtToken, seatmapId, query = {}, headers}) {
|
|
55
|
+
return client.get(`/seatmaps/${seatmapId}/occupied-seats`, {
|
|
56
|
+
params: query,
|
|
57
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
return {
|
|
55
62
|
all,
|
|
56
63
|
get,
|
|
57
64
|
getById,
|
|
58
65
|
create,
|
|
59
66
|
remove,
|
|
60
|
-
update
|
|
67
|
+
update,
|
|
68
|
+
getOccupiedSeats
|
|
61
69
|
};
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -18,10 +18,20 @@ function orderFactory({ client, internalAuthTokenProvider }) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function overwrite({token, orderId, payments, jwtToken, headers}) {
|
|
22
|
+
return client({
|
|
23
|
+
url: `/orders/${orderId}/payments`,
|
|
24
|
+
method: "post",
|
|
25
|
+
data: payments,
|
|
26
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
return {
|
|
22
31
|
create,
|
|
23
|
-
get
|
|
32
|
+
get,
|
|
33
|
+
overwrite
|
|
24
34
|
};
|
|
25
35
|
}
|
|
26
36
|
|
|
27
|
-
module.exports = orderFactory;
|
|
37
|
+
module.exports = orderFactory;
|
|
@@ -53,4 +53,17 @@ describe("inventory/seatmaps", () => {
|
|
|
53
53
|
expect(httpResponse.data).eql(response);
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
|
+
|
|
57
|
+
it("should get a seatmap occupied seats", () => {
|
|
58
|
+
const seatmapId = "1234";
|
|
59
|
+
axiosMock.onGet(`/seatmaps/${seatmapId}/occupied-seats`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
60
|
+
return api.inventory.seatmaps.getOccupiedSeats({
|
|
61
|
+
jwtToken,
|
|
62
|
+
token,
|
|
63
|
+
seatmapId,
|
|
64
|
+
query: {
|
|
65
|
+
newdesign: true
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
56
69
|
});
|
|
@@ -5,7 +5,8 @@ const expect = require("chai").expect;
|
|
|
5
5
|
describe('sales/order', function() {
|
|
6
6
|
const token = 'I owe you a token';
|
|
7
7
|
const jwtToken = 'I owe you a JWT token'
|
|
8
|
-
|
|
8
|
+
const orderId = "orderId1";
|
|
9
|
+
|
|
9
10
|
afterEach(function() {
|
|
10
11
|
axiosMock.reset();
|
|
11
12
|
});
|
|
@@ -20,4 +21,9 @@ describe('sales/order', function() {
|
|
|
20
21
|
axiosMock.onPost(`/order`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
|
|
21
22
|
return api.sales.order.create({ jwtToken, token, order: { cartId: 1234 } });
|
|
22
23
|
});
|
|
24
|
+
|
|
25
|
+
it("should overwrite an order payment by id", function() {
|
|
26
|
+
axiosMock.onPost(`/orders/${orderId}/payments`).reply(expectRequest({ statusCode: 200, token, jwtToken}));
|
|
27
|
+
return api.sales.order.overwrite({ jwtToken, token, payments: [], orderId: "orderId1" });
|
|
28
|
+
});
|
|
23
29
|
});
|
package/types/client.d.ts
CHANGED
|
@@ -461,6 +461,13 @@ export function createApiClient(options: {
|
|
|
461
461
|
seatmap: any;
|
|
462
462
|
headers: any;
|
|
463
463
|
}) => any;
|
|
464
|
+
getOccupiedSeats: ({ token, jwtToken, seatmapId, query, headers }: {
|
|
465
|
+
token: any;
|
|
466
|
+
jwtToken: any;
|
|
467
|
+
seatmapId: any;
|
|
468
|
+
query?: {};
|
|
469
|
+
headers: any;
|
|
470
|
+
}) => any;
|
|
464
471
|
};
|
|
465
472
|
fees: {
|
|
466
473
|
all: ({ token, query, headers }: {
|
|
@@ -2582,6 +2589,13 @@ export function createApiClient(options: {
|
|
|
2582
2589
|
query?: {};
|
|
2583
2590
|
headers: any;
|
|
2584
2591
|
}) => any;
|
|
2592
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
2593
|
+
token: any;
|
|
2594
|
+
orderId: any;
|
|
2595
|
+
payments: any;
|
|
2596
|
+
jwtToken: any;
|
|
2597
|
+
headers: any;
|
|
2598
|
+
}) => any;
|
|
2585
2599
|
};
|
|
2586
2600
|
voucher: {
|
|
2587
2601
|
get: ({ token, voucher, headers }: {
|
|
@@ -43,4 +43,11 @@ declare function seatmapsFactory({ client, internalAuthTokenProvider }: {
|
|
|
43
43
|
seatmap: any;
|
|
44
44
|
headers: any;
|
|
45
45
|
}) => any;
|
|
46
|
+
getOccupiedSeats: ({ token, jwtToken, seatmapId, query, headers }: {
|
|
47
|
+
token: any;
|
|
48
|
+
jwtToken: any;
|
|
49
|
+
seatmapId: any;
|
|
50
|
+
query?: {};
|
|
51
|
+
headers: any;
|
|
52
|
+
}) => any;
|
|
46
53
|
};
|
|
@@ -15,4 +15,11 @@ declare function orderFactory({ client, internalAuthTokenProvider }: {
|
|
|
15
15
|
query?: {};
|
|
16
16
|
headers: any;
|
|
17
17
|
}) => any;
|
|
18
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
19
|
+
token: any;
|
|
20
|
+
orderId: any;
|
|
21
|
+
payments: any;
|
|
22
|
+
jwtToken: any;
|
|
23
|
+
headers: any;
|
|
24
|
+
}) => any;
|
|
18
25
|
};
|
|
@@ -415,6 +415,13 @@ declare const _exports: {
|
|
|
415
415
|
seatmap: any;
|
|
416
416
|
headers: any;
|
|
417
417
|
}) => any;
|
|
418
|
+
getOccupiedSeats: ({ token, jwtToken, seatmapId, query, headers }: {
|
|
419
|
+
token: any;
|
|
420
|
+
jwtToken: any;
|
|
421
|
+
seatmapId: any;
|
|
422
|
+
query?: {};
|
|
423
|
+
headers: any;
|
|
424
|
+
}) => any;
|
|
418
425
|
};
|
|
419
426
|
fees: {
|
|
420
427
|
all: ({ token, query, headers }: {
|
|
@@ -2536,6 +2543,13 @@ declare const _exports: {
|
|
|
2536
2543
|
query?: {};
|
|
2537
2544
|
headers: any;
|
|
2538
2545
|
}) => any;
|
|
2546
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
2547
|
+
token: any;
|
|
2548
|
+
orderId: any;
|
|
2549
|
+
payments: any;
|
|
2550
|
+
jwtToken: any;
|
|
2551
|
+
headers: any;
|
|
2552
|
+
}) => any;
|
|
2539
2553
|
};
|
|
2540
2554
|
voucher: {
|
|
2541
2555
|
get: ({ token, voucher, headers }: {
|