btrz-api-client 5.237.0 → 7.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.
- package/lib/client-standalone-min.js +3 -3
- package/lib/client.js +1 -2
- package/lib/endpoints/inventory/{station-types.js → station-classes.js} +11 -11
- package/package.json +1 -1
- package/src/client.js +1 -2
- package/src/endpoints/inventory/{station-types.js → station-classes.js} +11 -11
- package/test/endpoints/inventory/station-types.test.js +19 -19
- package/types/client.d.ts +7 -14
- package/types/endpoints/inventory/station-classes.d.ts +38 -0
- package/types/endpoints/inventory/station-types.d.ts +8 -8
- package/types/initializedClient.d.ts +7 -14
- package/lib/endpoints/inventory/stations-types.js +0 -28
- package/src/endpoints/inventory/stations-types.js +0 -19
- package/test/endpoints/inventory/stations-types.test.js +0 -21
package/lib/client.js
CHANGED
|
@@ -62,7 +62,6 @@ function createInventory(_ref) {
|
|
|
62
62
|
insurancesCost: require("./endpoints/inventory/insurancesCost.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
63
63
|
stations: require("./endpoints/inventory/stations.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
64
64
|
stationsProvinces: require("./endpoints/inventory/stations-provinces.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
65
|
-
stationsTypes: require("./endpoints/inventory/stations-types.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
66
65
|
stationsZones: require("./endpoints/inventory/stations-zones.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
67
66
|
parcelZones: require("./endpoints/inventory/parcel-zones.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
68
67
|
countries: require("./endpoints/inventory/countries.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -103,7 +102,7 @@ function createInventory(_ref) {
|
|
|
103
102
|
scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
104
103
|
bundles: require("./endpoints/inventory/bundles.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
105
104
|
stationGroups: require("./endpoints/inventory/station-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
106
|
-
|
|
105
|
+
stationClasses: require("./endpoints/inventory/station-classes.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
107
106
|
zonePrices: require("./endpoints/inventory/zone-prices.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
108
107
|
zonePriceOverages: require("./endpoints/inventory/zone-price-overages.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
109
108
|
travellerCardProviders: require("./endpoints/inventory/traveller-card-providers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _require = require("
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function stationClassFactory(_ref) {
|
|
7
7
|
var client = _ref.client,
|
|
8
8
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ function stationTypeFactory(_ref) {
|
|
|
15
15
|
headers = _ref2.headers;
|
|
16
16
|
|
|
17
17
|
return client({
|
|
18
|
-
url: "/station-
|
|
18
|
+
url: "/station-classes",
|
|
19
19
|
method: "get",
|
|
20
20
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
21
21
|
params: query
|
|
@@ -25,13 +25,13 @@ function stationTypeFactory(_ref) {
|
|
|
25
25
|
function get(_ref3) {
|
|
26
26
|
var token = _ref3.token,
|
|
27
27
|
jwtToken = _ref3.jwtToken,
|
|
28
|
-
|
|
28
|
+
stationClassId = _ref3.stationClassId,
|
|
29
29
|
_ref3$query = _ref3.query,
|
|
30
30
|
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
31
31
|
headers = _ref3.headers;
|
|
32
32
|
|
|
33
33
|
return client({
|
|
34
|
-
url: "/station-
|
|
34
|
+
url: "/station-classes/" + stationClassId,
|
|
35
35
|
method: "get",
|
|
36
36
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
37
37
|
params: query
|
|
@@ -41,12 +41,12 @@ function stationTypeFactory(_ref) {
|
|
|
41
41
|
function update(_ref4) {
|
|
42
42
|
var token = _ref4.token,
|
|
43
43
|
jwtToken = _ref4.jwtToken,
|
|
44
|
-
|
|
44
|
+
stationClassId = _ref4.stationClassId,
|
|
45
45
|
data = _ref4.data,
|
|
46
46
|
headers = _ref4.headers;
|
|
47
47
|
|
|
48
48
|
return client({
|
|
49
|
-
url: "/station-
|
|
49
|
+
url: "/station-classes/" + stationClassId,
|
|
50
50
|
method: "put",
|
|
51
51
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
52
52
|
data: data
|
|
@@ -56,11 +56,11 @@ function stationTypeFactory(_ref) {
|
|
|
56
56
|
function remove(_ref5) {
|
|
57
57
|
var token = _ref5.token,
|
|
58
58
|
jwtToken = _ref5.jwtToken,
|
|
59
|
-
|
|
59
|
+
stationClassId = _ref5.stationClassId,
|
|
60
60
|
headers = _ref5.headers;
|
|
61
61
|
|
|
62
62
|
return client({
|
|
63
|
-
url: "/station-
|
|
63
|
+
url: "/station-classes/" + stationClassId,
|
|
64
64
|
method: "delete",
|
|
65
65
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
66
66
|
});
|
|
@@ -73,7 +73,7 @@ function stationTypeFactory(_ref) {
|
|
|
73
73
|
headers = _ref6.headers;
|
|
74
74
|
|
|
75
75
|
return client({
|
|
76
|
-
url: "/station-
|
|
76
|
+
url: "/station-classes",
|
|
77
77
|
method: "post",
|
|
78
78
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
79
79
|
data: data
|
|
@@ -89,4 +89,4 @@ function stationTypeFactory(_ref) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
module.exports =
|
|
92
|
+
module.exports = stationClassFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -49,7 +49,6 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
49
49
|
insurancesCost: require("./endpoints/inventory/insurancesCost.js")({client, internalAuthTokenProvider}),
|
|
50
50
|
stations: require("./endpoints/inventory/stations.js")({client, internalAuthTokenProvider}),
|
|
51
51
|
stationsProvinces: require("./endpoints/inventory/stations-provinces.js")({client, internalAuthTokenProvider}),
|
|
52
|
-
stationsTypes: require("./endpoints/inventory/stations-types.js")({client, internalAuthTokenProvider}),
|
|
53
52
|
stationsZones: require("./endpoints/inventory/stations-zones.js")({client, internalAuthTokenProvider}),
|
|
54
53
|
parcelZones: require("./endpoints/inventory/parcel-zones.js")({client, internalAuthTokenProvider}),
|
|
55
54
|
countries: require("./endpoints/inventory/countries.js")({client, internalAuthTokenProvider}),
|
|
@@ -90,7 +89,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
90
89
|
scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({client, internalAuthTokenProvider}),
|
|
91
90
|
bundles: require("./endpoints/inventory/bundles.js")({client, internalAuthTokenProvider}),
|
|
92
91
|
stationGroups: require("./endpoints/inventory/station-groups.js")({client, internalAuthTokenProvider}),
|
|
93
|
-
|
|
92
|
+
stationClasses: require("./endpoints/inventory/station-classes.js")({client, internalAuthTokenProvider}),
|
|
94
93
|
zonePrices: require("./endpoints/inventory/zone-prices.js")({client, internalAuthTokenProvider}),
|
|
95
94
|
zonePriceOverages: require("./endpoints/inventory/zone-price-overages.js")({client, internalAuthTokenProvider}),
|
|
96
95
|
travellerCardProviders: require("./endpoints/inventory/traveller-card-providers.js")({client, internalAuthTokenProvider}),
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const {authorizationHeaders} = require("
|
|
1
|
+
const {authorizationHeaders} = require("../endpoints_helpers.js");
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function stationClassFactory({client, internalAuthTokenProvider}) {
|
|
4
4
|
function all({token, jwtToken, query = {}, headers}) {
|
|
5
5
|
return client({
|
|
6
|
-
url: "/station-
|
|
6
|
+
url: "/station-classes",
|
|
7
7
|
method: "get",
|
|
8
8
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
9
9
|
params: query
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function get({token, jwtToken,
|
|
13
|
+
function get({token, jwtToken, stationClassId, query = {}, headers}) {
|
|
14
14
|
return client({
|
|
15
|
-
url: `/station-
|
|
15
|
+
url: `/station-classes/${stationClassId}`,
|
|
16
16
|
method: "get",
|
|
17
17
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
18
18
|
params: query
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function update({token, jwtToken,
|
|
22
|
+
function update({token, jwtToken, stationClassId, data, headers}) {
|
|
23
23
|
return client({
|
|
24
|
-
url: `/station-
|
|
24
|
+
url: `/station-classes/${stationClassId}`,
|
|
25
25
|
method: "put",
|
|
26
26
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
27
27
|
data
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function remove({token, jwtToken,
|
|
31
|
+
function remove({token, jwtToken, stationClassId, headers}) {
|
|
32
32
|
return client({
|
|
33
|
-
url: `/station-
|
|
33
|
+
url: `/station-classes/${stationClassId}`,
|
|
34
34
|
method: "delete",
|
|
35
35
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
36
36
|
});
|
|
@@ -38,7 +38,7 @@ function stationTypeFactory({client, internalAuthTokenProvider}) {
|
|
|
38
38
|
|
|
39
39
|
function create({token, jwtToken, data, headers}) {
|
|
40
40
|
return client({
|
|
41
|
-
url: "/station-
|
|
41
|
+
url: "/station-classes",
|
|
42
42
|
method: "post",
|
|
43
43
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
44
44
|
data
|
|
@@ -54,4 +54,4 @@ function stationTypeFactory({client, internalAuthTokenProvider}) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
module.exports =
|
|
57
|
+
module.exports = stationClassFactory;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
2
|
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
3
|
|
|
4
|
-
describe("inventory/station-
|
|
4
|
+
describe("inventory/station-classes", () => {
|
|
5
5
|
const token = "I owe you a token";
|
|
6
6
|
const jwtToken = "I owe you a JWT token";
|
|
7
7
|
|
|
@@ -9,20 +9,20 @@ describe("inventory/station-types", () => {
|
|
|
9
9
|
axiosMock.restore();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("should list station-
|
|
13
|
-
axiosMock.onGet("/station-
|
|
14
|
-
return api.inventory.
|
|
12
|
+
it("should list station-classes", () => {
|
|
13
|
+
axiosMock.onGet("/station-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
|
+
return api.inventory.stationClasses.all({token, jwtToken});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
it("should get a station-
|
|
18
|
-
const
|
|
19
|
-
axiosMock.onGet(`/station-
|
|
20
|
-
return api.inventory.
|
|
17
|
+
it("should get a station-classes", () => {
|
|
18
|
+
const stationClassId = "123123123123";
|
|
19
|
+
axiosMock.onGet(`/station-classes/${stationClassId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
20
|
+
return api.inventory.stationClasses.get({token, jwtToken, stationClassId});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
it("should create a station-
|
|
24
|
-
axiosMock.onPost("/station-
|
|
25
|
-
return api.inventory.
|
|
23
|
+
it("should create a station-classes", () => {
|
|
24
|
+
axiosMock.onPost("/station-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
25
|
+
return api.inventory.stationClasses.create({
|
|
26
26
|
jwtToken,
|
|
27
27
|
token,
|
|
28
28
|
data: {
|
|
@@ -33,20 +33,20 @@ describe("inventory/station-types", () => {
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it("should update a station-
|
|
37
|
-
const
|
|
36
|
+
it("should update a station-classes", () => {
|
|
37
|
+
const stationClassId = "123123123123";
|
|
38
38
|
const data = {
|
|
39
39
|
name: "new",
|
|
40
40
|
code: 100,
|
|
41
41
|
ord: 10
|
|
42
42
|
};
|
|
43
|
-
axiosMock.onPut(`/station-
|
|
44
|
-
return api.inventory.
|
|
43
|
+
axiosMock.onPut(`/station-classes/${stationClassId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
44
|
+
return api.inventory.stationClasses.update({jwtToken, token, stationClassId, data});
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
it("should delete a station-
|
|
48
|
-
const
|
|
49
|
-
axiosMock.onDelete(`/station-
|
|
50
|
-
return api.inventory.
|
|
47
|
+
it("should delete a station-classes", () => {
|
|
48
|
+
const stationClassId = "123123123123";
|
|
49
|
+
axiosMock.onDelete(`/station-classes/${stationClassId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
50
|
+
return api.inventory.stationClasses.remove({jwtToken, token, stationClassId});
|
|
51
51
|
});
|
|
52
52
|
});
|
package/types/client.d.ts
CHANGED
|
@@ -225,13 +225,6 @@ export function createApiClient(options: {
|
|
|
225
225
|
headers: any;
|
|
226
226
|
}) => any;
|
|
227
227
|
};
|
|
228
|
-
stationsTypes: {
|
|
229
|
-
all: ({ token, query, headers }: {
|
|
230
|
-
token: any;
|
|
231
|
-
query?: {};
|
|
232
|
-
headers: any;
|
|
233
|
-
}) => any;
|
|
234
|
-
};
|
|
235
228
|
stationsZones: {
|
|
236
229
|
get: ({ token, query, headers }: {
|
|
237
230
|
token: any;
|
|
@@ -1359,31 +1352,31 @@ export function createApiClient(options: {
|
|
|
1359
1352
|
headers: any;
|
|
1360
1353
|
}) => any;
|
|
1361
1354
|
};
|
|
1362
|
-
|
|
1355
|
+
stationClasses: {
|
|
1363
1356
|
all: ({ token, jwtToken, query, headers }: {
|
|
1364
1357
|
token: any;
|
|
1365
1358
|
jwtToken: any;
|
|
1366
1359
|
query?: {};
|
|
1367
1360
|
headers: any;
|
|
1368
1361
|
}) => any;
|
|
1369
|
-
get: ({ token, jwtToken,
|
|
1362
|
+
get: ({ token, jwtToken, stationClassId, query, headers }: {
|
|
1370
1363
|
token: any;
|
|
1371
1364
|
jwtToken: any;
|
|
1372
|
-
|
|
1365
|
+
stationClassId: any;
|
|
1373
1366
|
query?: {};
|
|
1374
1367
|
headers: any;
|
|
1375
1368
|
}) => any;
|
|
1376
|
-
update: ({ token, jwtToken,
|
|
1369
|
+
update: ({ token, jwtToken, stationClassId, data, headers }: {
|
|
1377
1370
|
token: any;
|
|
1378
1371
|
jwtToken: any;
|
|
1379
|
-
|
|
1372
|
+
stationClassId: any;
|
|
1380
1373
|
data: any;
|
|
1381
1374
|
headers: any;
|
|
1382
1375
|
}) => any;
|
|
1383
|
-
remove: ({ token, jwtToken,
|
|
1376
|
+
remove: ({ token, jwtToken, stationClassId, headers }: {
|
|
1384
1377
|
token: any;
|
|
1385
1378
|
jwtToken: any;
|
|
1386
|
-
|
|
1379
|
+
stationClassId: any;
|
|
1387
1380
|
headers: any;
|
|
1388
1381
|
}) => any;
|
|
1389
1382
|
create: ({ token, jwtToken, data, headers }: {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export = stationClassFactory;
|
|
2
|
+
declare function stationClassFactory({ 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: ({ token, jwtToken, stationClassId, query, headers }: {
|
|
13
|
+
token: any;
|
|
14
|
+
jwtToken: any;
|
|
15
|
+
stationClassId: any;
|
|
16
|
+
query?: {};
|
|
17
|
+
headers: any;
|
|
18
|
+
}) => any;
|
|
19
|
+
update: ({ token, jwtToken, stationClassId, data, headers }: {
|
|
20
|
+
token: any;
|
|
21
|
+
jwtToken: any;
|
|
22
|
+
stationClassId: any;
|
|
23
|
+
data: any;
|
|
24
|
+
headers: any;
|
|
25
|
+
}) => any;
|
|
26
|
+
remove: ({ token, jwtToken, stationClassId, headers }: {
|
|
27
|
+
token: any;
|
|
28
|
+
jwtToken: any;
|
|
29
|
+
stationClassId: any;
|
|
30
|
+
headers: any;
|
|
31
|
+
}) => any;
|
|
32
|
+
create: ({ token, jwtToken, data, headers }: {
|
|
33
|
+
token: any;
|
|
34
|
+
jwtToken: any;
|
|
35
|
+
data: any;
|
|
36
|
+
headers: any;
|
|
37
|
+
}) => any;
|
|
38
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export =
|
|
2
|
-
declare function
|
|
1
|
+
export = stationClassFactory;
|
|
2
|
+
declare function stationClassFactory({ client, internalAuthTokenProvider }: {
|
|
3
3
|
client: any;
|
|
4
4
|
internalAuthTokenProvider: any;
|
|
5
5
|
}): {
|
|
@@ -9,24 +9,24 @@ declare function stationTypeFactory({ client, internalAuthTokenProvider }: {
|
|
|
9
9
|
query?: {};
|
|
10
10
|
headers: any;
|
|
11
11
|
}) => any;
|
|
12
|
-
get: ({ token, jwtToken,
|
|
12
|
+
get: ({ token, jwtToken, stationClassId, query, headers }: {
|
|
13
13
|
token: any;
|
|
14
14
|
jwtToken: any;
|
|
15
|
-
|
|
15
|
+
stationClassId: any;
|
|
16
16
|
query?: {};
|
|
17
17
|
headers: any;
|
|
18
18
|
}) => any;
|
|
19
|
-
update: ({ token, jwtToken,
|
|
19
|
+
update: ({ token, jwtToken, stationClassId, data, headers }: {
|
|
20
20
|
token: any;
|
|
21
21
|
jwtToken: any;
|
|
22
|
-
|
|
22
|
+
stationClassId: any;
|
|
23
23
|
data: any;
|
|
24
24
|
headers: any;
|
|
25
25
|
}) => any;
|
|
26
|
-
remove: ({ token, jwtToken,
|
|
26
|
+
remove: ({ token, jwtToken, stationClassId, headers }: {
|
|
27
27
|
token: any;
|
|
28
28
|
jwtToken: any;
|
|
29
|
-
|
|
29
|
+
stationClassId: any;
|
|
30
30
|
headers: any;
|
|
31
31
|
}) => any;
|
|
32
32
|
create: ({ token, jwtToken, data, headers }: {
|
|
@@ -179,13 +179,6 @@ declare const _exports: {
|
|
|
179
179
|
headers: any;
|
|
180
180
|
}) => any;
|
|
181
181
|
};
|
|
182
|
-
stationsTypes: {
|
|
183
|
-
all: ({ token, query, headers }: {
|
|
184
|
-
token: any;
|
|
185
|
-
query?: {};
|
|
186
|
-
headers: any;
|
|
187
|
-
}) => any;
|
|
188
|
-
};
|
|
189
182
|
stationsZones: {
|
|
190
183
|
get: ({ token, query, headers }: {
|
|
191
184
|
token: any;
|
|
@@ -1313,31 +1306,31 @@ declare const _exports: {
|
|
|
1313
1306
|
headers: any;
|
|
1314
1307
|
}) => any;
|
|
1315
1308
|
};
|
|
1316
|
-
|
|
1309
|
+
stationClasses: {
|
|
1317
1310
|
all: ({ token, jwtToken, query, headers }: {
|
|
1318
1311
|
token: any;
|
|
1319
1312
|
jwtToken: any;
|
|
1320
1313
|
query?: {};
|
|
1321
1314
|
headers: any;
|
|
1322
1315
|
}) => any;
|
|
1323
|
-
get: ({ token, jwtToken,
|
|
1316
|
+
get: ({ token, jwtToken, stationClassId, query, headers }: {
|
|
1324
1317
|
token: any;
|
|
1325
1318
|
jwtToken: any;
|
|
1326
|
-
|
|
1319
|
+
stationClassId: any;
|
|
1327
1320
|
query?: {};
|
|
1328
1321
|
headers: any;
|
|
1329
1322
|
}) => any;
|
|
1330
|
-
update: ({ token, jwtToken,
|
|
1323
|
+
update: ({ token, jwtToken, stationClassId, data, headers }: {
|
|
1331
1324
|
token: any;
|
|
1332
1325
|
jwtToken: any;
|
|
1333
|
-
|
|
1326
|
+
stationClassId: any;
|
|
1334
1327
|
data: any;
|
|
1335
1328
|
headers: any;
|
|
1336
1329
|
}) => any;
|
|
1337
|
-
remove: ({ token, jwtToken,
|
|
1330
|
+
remove: ({ token, jwtToken, stationClassId, headers }: {
|
|
1338
1331
|
token: any;
|
|
1339
1332
|
jwtToken: any;
|
|
1340
|
-
|
|
1333
|
+
stationClassId: any;
|
|
1341
1334
|
headers: any;
|
|
1342
1335
|
}) => any;
|
|
1343
1336
|
create: ({ token, jwtToken, data, headers }: {
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _require = require("../endpoints_helpers.js"),
|
|
4
|
-
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
-
|
|
6
|
-
function stationsTypesFactory(_ref) {
|
|
7
|
-
var client = _ref.client,
|
|
8
|
-
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
-
|
|
10
|
-
function all(_ref2) {
|
|
11
|
-
var token = _ref2.token,
|
|
12
|
-
_ref2$query = _ref2.query,
|
|
13
|
-
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
14
|
-
headers = _ref2.headers;
|
|
15
|
-
|
|
16
|
-
return client({
|
|
17
|
-
url: "/stations/types",
|
|
18
|
-
params: query,
|
|
19
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
all: all
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = stationsTypesFactory;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
authorizationHeaders
|
|
3
|
-
} = require("../endpoints_helpers.js");
|
|
4
|
-
|
|
5
|
-
function stationsTypesFactory({client, internalAuthTokenProvider}) {
|
|
6
|
-
function all({token, query = {}, headers}) {
|
|
7
|
-
return client({
|
|
8
|
-
url: "/stations/types",
|
|
9
|
-
params: query,
|
|
10
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
all
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = stationsTypesFactory;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
axiosMock, expectRequest
|
|
3
|
-
} = require("./../../test-helpers.js");
|
|
4
|
-
const api = require("./../../../src/client.js").createApiClient({
|
|
5
|
-
baseURL: "http://test.com"
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
describe("inventory/stations/types", () => {
|
|
9
|
-
const token = "I owe you a token";
|
|
10
|
-
|
|
11
|
-
afterEach(() => {
|
|
12
|
-
axiosMock.reset();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should list zones", () => {
|
|
16
|
-
axiosMock.onGet("/stations/types").reply(expectRequest({statusCode: 200, token}));
|
|
17
|
-
return api.inventory.stationsTypes.all({
|
|
18
|
-
token
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|