btrz-api-client 5.68.0 → 5.70.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 +1 -1
- package/lib/client.js +1 -0
- package/lib/endpoints/accounts/shifts.js +43 -1
- package/lib/endpoints/inventory/external-passes.js +40 -0
- package/lib/endpoints/inventory/marketplace-modifiers.js +1 -2
- package/package.json +1 -1
- package/src/client.js +1 -0
- package/src/endpoints/accounts/shifts.js +28 -1
- package/src/endpoints/inventory/external-passes.js +30 -0
- package/src/endpoints/inventory/marketplace-modifiers.js +1 -2
- package/test/endpoints/accounts/shifts.test.js +23 -1
- package/test/endpoints/inventory/external-passes.test.js +39 -0
- package/test/endpoints/inventory/marketplace-modifiers.test.js +2 -2
- package/test/endpoints/operations/vouchers.test.js +1 -1
- package/types/client.d.ts +34 -0
- package/types/endpoints/accounts/shifts.d.ts +20 -0
- package/types/endpoints/inventory/external-passes.d.ts +18 -0
- package/types/initializedClient.d.ts +34 -0
package/lib/client.js
CHANGED
|
@@ -70,6 +70,7 @@ function createInventory(_ref) {
|
|
|
70
70
|
seatmaps: require("./endpoints/inventory/seatmaps.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
71
71
|
fees: require("./endpoints/inventory/fees.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
72
72
|
items: require("./endpoints/inventory/items.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
73
|
+
externalPasses: require("./endpoints/inventory/external-passes.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
73
74
|
filteredTrips: require("./endpoints/inventory/filtered-trips.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
74
75
|
filteredTripsV2: require("./endpoints/inventory/filtered-trips-v2.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
75
76
|
ssrs: require("./endpoints/inventory/ssrs.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -68,11 +68,53 @@ function shiftsFactory(_ref) {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
var locationClosures = {
|
|
72
|
+
create: function create(_ref6) {
|
|
73
|
+
var jwtToken = _ref6.jwtToken,
|
|
74
|
+
token = _ref6.token,
|
|
75
|
+
locationClosure = _ref6.locationClosure,
|
|
76
|
+
headers = _ref6.headers;
|
|
77
|
+
|
|
78
|
+
return client({
|
|
79
|
+
url: "/shifts/location-closures",
|
|
80
|
+
method: "post",
|
|
81
|
+
headers: authorizationHeaders({
|
|
82
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
83
|
+
}),
|
|
84
|
+
data: locationClosure
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
all: function all(_ref7) {
|
|
88
|
+
var jwtToken = _ref7.jwtToken,
|
|
89
|
+
token = _ref7.token,
|
|
90
|
+
query = _ref7.query,
|
|
91
|
+
headers = _ref7.headers;
|
|
92
|
+
|
|
93
|
+
return client.get("/shifts/location-closures", {
|
|
94
|
+
headers: authorizationHeaders({
|
|
95
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
96
|
+
}),
|
|
97
|
+
params: query
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
get: function get(_ref8) {
|
|
101
|
+
var token = _ref8.token,
|
|
102
|
+
jwtToken = _ref8.jwtToken,
|
|
103
|
+
locationClosureId = _ref8.locationClosureId,
|
|
104
|
+
headers = _ref8.headers;
|
|
105
|
+
|
|
106
|
+
return client.get("/shifts/location-closures/" + locationClosureId, {
|
|
107
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
71
112
|
return {
|
|
72
113
|
all: all,
|
|
73
114
|
get: get,
|
|
74
115
|
create: create,
|
|
75
|
-
update: update
|
|
116
|
+
update: update,
|
|
117
|
+
locationClosures: locationClosures
|
|
76
118
|
};
|
|
77
119
|
}
|
|
78
120
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function externalPassesFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function all(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
_ref2$query = _ref2.query,
|
|
14
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
15
|
+
headers = _ref2.headers;
|
|
16
|
+
|
|
17
|
+
return client.get("/external-passes", {
|
|
18
|
+
params: query,
|
|
19
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, jwtToken: jwtToken, headers: headers })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function get(_ref3) {
|
|
24
|
+
var externalPassId = _ref3.externalPassId,
|
|
25
|
+
token = _ref3.token,
|
|
26
|
+
jwtToken = _ref3.jwtToken,
|
|
27
|
+
headers = _ref3.headers;
|
|
28
|
+
|
|
29
|
+
return client.get("/external-passes/" + externalPassId, {
|
|
30
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, jwtToken: jwtToken, headers: headers })
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
all: all,
|
|
36
|
+
get: get
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = externalPassesFactory;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _require = require("../endpoints_helpers"),
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
6
|
function marketplaceModifierFactory(_ref) {
|
|
7
7
|
var client = _ref.client,
|
|
8
8
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
function all(_ref2) {
|
|
12
11
|
var token = _ref2.token,
|
|
13
12
|
_ref2$query = _ref2.query,
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -57,6 +57,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
57
57
|
seatmaps: require("./endpoints/inventory/seatmaps.js")({client, internalAuthTokenProvider}),
|
|
58
58
|
fees: require("./endpoints/inventory/fees.js")({client, internalAuthTokenProvider}),
|
|
59
59
|
items: require("./endpoints/inventory/items.js")({client, internalAuthTokenProvider}),
|
|
60
|
+
externalPasses: require("./endpoints/inventory/external-passes.js")({client, internalAuthTokenProvider}),
|
|
60
61
|
filteredTrips: require("./endpoints/inventory/filtered-trips.js")({client, internalAuthTokenProvider}),
|
|
61
62
|
filteredTripsV2: require("./endpoints/inventory/filtered-trips-v2.js")({client, internalAuthTokenProvider}),
|
|
62
63
|
ssrs: require("./endpoints/inventory/ssrs.js")({client, internalAuthTokenProvider}),
|
|
@@ -41,11 +41,38 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
const locationClosures = {
|
|
45
|
+
create({jwtToken, token, locationClosure, headers}) {
|
|
46
|
+
return client({
|
|
47
|
+
url: "/shifts/location-closures",
|
|
48
|
+
method: "post",
|
|
49
|
+
headers: authorizationHeaders({
|
|
50
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
51
|
+
}),
|
|
52
|
+
data: locationClosure
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
all({jwtToken, token, query, headers}) {
|
|
56
|
+
return client.get("/shifts/location-closures", {
|
|
57
|
+
headers: authorizationHeaders({
|
|
58
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
59
|
+
}),
|
|
60
|
+
params: query
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
get({token, jwtToken, locationClosureId, headers}) {
|
|
64
|
+
return client.get(`/shifts/location-closures/${locationClosureId}`, {
|
|
65
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
44
70
|
return {
|
|
45
71
|
all,
|
|
46
72
|
get,
|
|
47
73
|
create,
|
|
48
|
-
update
|
|
74
|
+
update,
|
|
75
|
+
locationClosures
|
|
49
76
|
};
|
|
50
77
|
}
|
|
51
78
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function externalPassesFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function all({
|
|
7
|
+
token,
|
|
8
|
+
jwtToken,
|
|
9
|
+
query = {},
|
|
10
|
+
headers
|
|
11
|
+
}) {
|
|
12
|
+
return client.get("/external-passes", {
|
|
13
|
+
params: query,
|
|
14
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken, headers})
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function get({externalPassId, token, jwtToken, headers}) {
|
|
19
|
+
return client.get(`/external-passes/${externalPassId}`, {
|
|
20
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken, headers})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
all,
|
|
26
|
+
get
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = externalPassesFactory;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
describe("accounts/
|
|
1
|
+
describe("accounts/shifts", () => {
|
|
2
2
|
const {
|
|
3
3
|
axiosMock,
|
|
4
4
|
expectRequest
|
|
@@ -49,4 +49,26 @@ describe("accounts/shift/user", () => {
|
|
|
49
49
|
query
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
+
|
|
53
|
+
it("should get all shifts/location-closures", () => {
|
|
54
|
+
const query = {status: "closed"};
|
|
55
|
+
axiosMock.onGet("/shifts/location-closures").reply(expectRequest({statusCode: 200, token, jwtToken, query}));
|
|
56
|
+
return api.accounts.shifts.locationClosures.all({token, jwtToken, query});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("should get shifts-location-closures", () => {
|
|
60
|
+
const locationClosureId = "locationClosure1";
|
|
61
|
+
axiosMock.onGet(`/shifts/location-closures/${locationClosureId}`).reply(expectRequest({statusCode: 200, token}));
|
|
62
|
+
return api.accounts.shifts.locationClosures.get({token, locationClosureId});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("should create the shift-location-closure", () => {
|
|
66
|
+
const locationClosure = {};
|
|
67
|
+
axiosMock.onPost("/shifts/location-closures").reply(expectRequest({statusCode: 200, token, jwtToken, body: locationClosure}));
|
|
68
|
+
return api.accounts.shifts.locationClosures.create({
|
|
69
|
+
jwtToken,
|
|
70
|
+
token,
|
|
71
|
+
locationClosure
|
|
72
|
+
});
|
|
73
|
+
});
|
|
52
74
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const {
|
|
2
|
+
axiosMock,
|
|
3
|
+
expectRequest
|
|
4
|
+
} = require("./../../test-helpers.js");
|
|
5
|
+
const api = require("./../../../src/client.js").createApiClient({
|
|
6
|
+
baseURL: "http://test.com"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe("inventory/external-passes", () => {
|
|
10
|
+
const token = "I owe you a token";
|
|
11
|
+
const jwtToken = "I owe you a JWT token";
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
axiosMock.restore();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should get all esternal passes", () => {
|
|
18
|
+
axiosMock.onGet("/external-passes").reply(expectRequest({
|
|
19
|
+
statusCode: 200, token, jwtToken
|
|
20
|
+
}));
|
|
21
|
+
return api.inventory.externalPasses.all({
|
|
22
|
+
jwtToken,
|
|
23
|
+
token,
|
|
24
|
+
query: {}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should get a esternal passes", () => {
|
|
29
|
+
const externalPassId = "1234";
|
|
30
|
+
axiosMock.onGet(`/external-passes/${externalPassId}`).reply(expectRequest({
|
|
31
|
+
statusCode: 200, token, jwtToken
|
|
32
|
+
}));
|
|
33
|
+
return api.inventory.externalPasses.get({
|
|
34
|
+
jwtToken,
|
|
35
|
+
token,
|
|
36
|
+
externalPassId
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
axiosMock, expectRequest
|
|
3
|
-
} = require("./../../test-helpers");
|
|
4
|
-
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
} = require("./../../test-helpers.js");
|
|
4
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
5
5
|
|
|
6
6
|
describe("inventory/marketplace-modifiers", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
@@ -3,7 +3,7 @@ const api = require("./../../../src/client.js").createApiClient({
|
|
|
3
3
|
baseURL: "http://test.com"
|
|
4
4
|
});
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe("operations/vouchers", () => {
|
|
7
7
|
const token = "I owe you a token";
|
|
8
8
|
const jwtToken = "I owe you a JWT token";
|
|
9
9
|
|
package/types/client.d.ts
CHANGED
|
@@ -380,6 +380,20 @@ export function createApiClient(options: {
|
|
|
380
380
|
headers: any;
|
|
381
381
|
}) => any;
|
|
382
382
|
};
|
|
383
|
+
externalPasses: {
|
|
384
|
+
all: ({ token, jwtToken, query, headers }: {
|
|
385
|
+
token: any;
|
|
386
|
+
jwtToken: any;
|
|
387
|
+
query?: {};
|
|
388
|
+
headers: any;
|
|
389
|
+
}) => any;
|
|
390
|
+
get: ({ externalPassId, token, jwtToken, headers }: {
|
|
391
|
+
externalPassId: any;
|
|
392
|
+
token: any;
|
|
393
|
+
jwtToken: any;
|
|
394
|
+
headers: any;
|
|
395
|
+
}) => any;
|
|
396
|
+
};
|
|
383
397
|
filteredTrips: {
|
|
384
398
|
create: ({ token, jwtToken, tripSegmentsId, headers }: {
|
|
385
399
|
token: any;
|
|
@@ -1717,6 +1731,26 @@ export function createApiClient(options: {
|
|
|
1717
1731
|
headers: any;
|
|
1718
1732
|
query: any;
|
|
1719
1733
|
}) => any;
|
|
1734
|
+
locationClosures: {
|
|
1735
|
+
create({ jwtToken, token, locationClosure, headers }: {
|
|
1736
|
+
jwtToken: any;
|
|
1737
|
+
token: any;
|
|
1738
|
+
locationClosure: any;
|
|
1739
|
+
headers: any;
|
|
1740
|
+
}): any;
|
|
1741
|
+
all({ jwtToken, token, query, headers }: {
|
|
1742
|
+
jwtToken: any;
|
|
1743
|
+
token: any;
|
|
1744
|
+
query: any;
|
|
1745
|
+
headers: any;
|
|
1746
|
+
}): any;
|
|
1747
|
+
get({ token, jwtToken, locationClosureId, headers }: {
|
|
1748
|
+
token: any;
|
|
1749
|
+
jwtToken: any;
|
|
1750
|
+
locationClosureId: any;
|
|
1751
|
+
headers: any;
|
|
1752
|
+
}): any;
|
|
1753
|
+
};
|
|
1720
1754
|
};
|
|
1721
1755
|
shiftSettings: {
|
|
1722
1756
|
get: ({ token, jwtToken, query, headers }: {
|
|
@@ -28,4 +28,24 @@ declare function shiftsFactory({ client, internalAuthTokenProvider }: {
|
|
|
28
28
|
headers: any;
|
|
29
29
|
query: any;
|
|
30
30
|
}) => any;
|
|
31
|
+
locationClosures: {
|
|
32
|
+
create({ jwtToken, token, locationClosure, headers }: {
|
|
33
|
+
jwtToken: any;
|
|
34
|
+
token: any;
|
|
35
|
+
locationClosure: any;
|
|
36
|
+
headers: any;
|
|
37
|
+
}): any;
|
|
38
|
+
all({ jwtToken, token, query, headers }: {
|
|
39
|
+
jwtToken: any;
|
|
40
|
+
token: any;
|
|
41
|
+
query: any;
|
|
42
|
+
headers: any;
|
|
43
|
+
}): any;
|
|
44
|
+
get({ token, jwtToken, locationClosureId, headers }: {
|
|
45
|
+
token: any;
|
|
46
|
+
jwtToken: any;
|
|
47
|
+
locationClosureId: any;
|
|
48
|
+
headers: any;
|
|
49
|
+
}): any;
|
|
50
|
+
};
|
|
31
51
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export = externalPassesFactory;
|
|
2
|
+
declare function externalPassesFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
all: ({ token, jwtToken, query, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
query?: {};
|
|
10
|
+
headers: any;
|
|
11
|
+
}) => any;
|
|
12
|
+
get: ({ externalPassId, token, jwtToken, headers }: {
|
|
13
|
+
externalPassId: any;
|
|
14
|
+
token: any;
|
|
15
|
+
jwtToken: any;
|
|
16
|
+
headers: any;
|
|
17
|
+
}) => any;
|
|
18
|
+
};
|
|
@@ -334,6 +334,20 @@ declare const _exports: {
|
|
|
334
334
|
headers: any;
|
|
335
335
|
}) => any;
|
|
336
336
|
};
|
|
337
|
+
externalPasses: {
|
|
338
|
+
all: ({ token, jwtToken, query, headers }: {
|
|
339
|
+
token: any;
|
|
340
|
+
jwtToken: any;
|
|
341
|
+
query?: {};
|
|
342
|
+
headers: any;
|
|
343
|
+
}) => any;
|
|
344
|
+
get: ({ externalPassId, token, jwtToken, headers }: {
|
|
345
|
+
externalPassId: any;
|
|
346
|
+
token: any;
|
|
347
|
+
jwtToken: any;
|
|
348
|
+
headers: any;
|
|
349
|
+
}) => any;
|
|
350
|
+
};
|
|
337
351
|
filteredTrips: {
|
|
338
352
|
create: ({ token, jwtToken, tripSegmentsId, headers }: {
|
|
339
353
|
token: any;
|
|
@@ -1671,6 +1685,26 @@ declare const _exports: {
|
|
|
1671
1685
|
headers: any;
|
|
1672
1686
|
query: any;
|
|
1673
1687
|
}) => any;
|
|
1688
|
+
locationClosures: {
|
|
1689
|
+
create({ jwtToken, token, locationClosure, headers }: {
|
|
1690
|
+
jwtToken: any;
|
|
1691
|
+
token: any;
|
|
1692
|
+
locationClosure: any;
|
|
1693
|
+
headers: any;
|
|
1694
|
+
}): any;
|
|
1695
|
+
all({ jwtToken, token, query, headers }: {
|
|
1696
|
+
jwtToken: any;
|
|
1697
|
+
token: any;
|
|
1698
|
+
query: any;
|
|
1699
|
+
headers: any;
|
|
1700
|
+
}): any;
|
|
1701
|
+
get({ token, jwtToken, locationClosureId, headers }: {
|
|
1702
|
+
token: any;
|
|
1703
|
+
jwtToken: any;
|
|
1704
|
+
locationClosureId: any;
|
|
1705
|
+
headers: any;
|
|
1706
|
+
}): any;
|
|
1707
|
+
};
|
|
1674
1708
|
};
|
|
1675
1709
|
shiftSettings: {
|
|
1676
1710
|
get: ({ token, jwtToken, query, headers }: {
|