btrz-api-client 6.0.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.js CHANGED
@@ -102,7 +102,7 @@ function createInventory(_ref) {
102
102
  scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
103
103
  bundles: require("./endpoints/inventory/bundles.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
104
104
  stationGroups: require("./endpoints/inventory/station-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
105
- stationTypes: require("./endpoints/inventory/station-types.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
105
+ stationClasses: require("./endpoints/inventory/station-classes.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
106
106
  zonePrices: require("./endpoints/inventory/zone-prices.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
107
107
  zonePriceOverages: require("./endpoints/inventory/zone-price-overages.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
108
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("./../endpoints_helpers.js"),
3
+ var _require = require("../endpoints_helpers.js"),
4
4
  authorizationHeaders = _require.authorizationHeaders;
5
5
 
6
- function stationTypeFactory(_ref) {
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-types",
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
- stationTypeId = _ref3.stationTypeId,
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-types/" + stationTypeId,
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
- stationTypeId = _ref4.stationTypeId,
44
+ stationClassId = _ref4.stationClassId,
45
45
  data = _ref4.data,
46
46
  headers = _ref4.headers;
47
47
 
48
48
  return client({
49
- url: "/station-types/" + stationTypeId,
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
- stationTypeId = _ref5.stationTypeId,
59
+ stationClassId = _ref5.stationClassId,
60
60
  headers = _ref5.headers;
61
61
 
62
62
  return client({
63
- url: "/station-types/" + stationTypeId,
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-types",
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 = stationTypeFactory;
92
+ module.exports = stationClassFactory;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/client.js CHANGED
@@ -89,7 +89,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
89
89
  scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({client, internalAuthTokenProvider}),
90
90
  bundles: require("./endpoints/inventory/bundles.js")({client, internalAuthTokenProvider}),
91
91
  stationGroups: require("./endpoints/inventory/station-groups.js")({client, internalAuthTokenProvider}),
92
- stationTypes: require("./endpoints/inventory/station-types.js")({client, internalAuthTokenProvider}),
92
+ stationClasses: require("./endpoints/inventory/station-classes.js")({client, internalAuthTokenProvider}),
93
93
  zonePrices: require("./endpoints/inventory/zone-prices.js")({client, internalAuthTokenProvider}),
94
94
  zonePriceOverages: require("./endpoints/inventory/zone-price-overages.js")({client, internalAuthTokenProvider}),
95
95
  travellerCardProviders: require("./endpoints/inventory/traveller-card-providers.js")({client, internalAuthTokenProvider}),
@@ -1,36 +1,36 @@
1
- const {authorizationHeaders} = require("./../endpoints_helpers.js");
1
+ const {authorizationHeaders} = require("../endpoints_helpers.js");
2
2
 
3
- function stationTypeFactory({client, internalAuthTokenProvider}) {
3
+ function stationClassFactory({client, internalAuthTokenProvider}) {
4
4
  function all({token, jwtToken, query = {}, headers}) {
5
5
  return client({
6
- url: "/station-types",
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, stationTypeId, query = {}, headers}) {
13
+ function get({token, jwtToken, stationClassId, query = {}, headers}) {
14
14
  return client({
15
- url: `/station-types/${stationTypeId}`,
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, stationTypeId, data, headers}) {
22
+ function update({token, jwtToken, stationClassId, data, headers}) {
23
23
  return client({
24
- url: `/station-types/${stationTypeId}`,
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, stationTypeId, headers}) {
31
+ function remove({token, jwtToken, stationClassId, headers}) {
32
32
  return client({
33
- url: `/station-types/${stationTypeId}`,
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-types",
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 = stationTypeFactory;
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-types", () => {
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-types", () => {
13
- axiosMock.onGet("/station-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
- return api.inventory.stationTypes.all({token, jwtToken});
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-types", () => {
18
- const stationTypeId = "123123123123";
19
- axiosMock.onGet(`/station-types/${stationTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
20
- return api.inventory.stationTypes.get({token, jwtToken, stationTypeId});
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-types", () => {
24
- axiosMock.onPost("/station-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
25
- return api.inventory.stationTypes.create({
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-types", () => {
37
- const stationTypeId = "123123123123";
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-types/${stationTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
44
- return api.inventory.stationTypes.update({jwtToken, token, stationTypeId, data});
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-types", () => {
48
- const stationTypeId = "123123123123";
49
- axiosMock.onDelete(`/station-types/${stationTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
- return api.inventory.stationTypes.remove({jwtToken, token, stationTypeId});
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
@@ -1352,31 +1352,31 @@ export function createApiClient(options: {
1352
1352
  headers: any;
1353
1353
  }) => any;
1354
1354
  };
1355
- stationTypes: {
1355
+ stationClasses: {
1356
1356
  all: ({ token, jwtToken, query, headers }: {
1357
1357
  token: any;
1358
1358
  jwtToken: any;
1359
1359
  query?: {};
1360
1360
  headers: any;
1361
1361
  }) => any;
1362
- get: ({ token, jwtToken, stationTypeId, query, headers }: {
1362
+ get: ({ token, jwtToken, stationClassId, query, headers }: {
1363
1363
  token: any;
1364
1364
  jwtToken: any;
1365
- stationTypeId: any;
1365
+ stationClassId: any;
1366
1366
  query?: {};
1367
1367
  headers: any;
1368
1368
  }) => any;
1369
- update: ({ token, jwtToken, stationTypeId, data, headers }: {
1369
+ update: ({ token, jwtToken, stationClassId, data, headers }: {
1370
1370
  token: any;
1371
1371
  jwtToken: any;
1372
- stationTypeId: any;
1372
+ stationClassId: any;
1373
1373
  data: any;
1374
1374
  headers: any;
1375
1375
  }) => any;
1376
- remove: ({ token, jwtToken, stationTypeId, headers }: {
1376
+ remove: ({ token, jwtToken, stationClassId, headers }: {
1377
1377
  token: any;
1378
1378
  jwtToken: any;
1379
- stationTypeId: any;
1379
+ stationClassId: any;
1380
1380
  headers: any;
1381
1381
  }) => any;
1382
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 = stationTypeFactory;
2
- declare function stationTypeFactory({ client, internalAuthTokenProvider }: {
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, stationTypeId, query, headers }: {
12
+ get: ({ token, jwtToken, stationClassId, query, headers }: {
13
13
  token: any;
14
14
  jwtToken: any;
15
- stationTypeId: any;
15
+ stationClassId: any;
16
16
  query?: {};
17
17
  headers: any;
18
18
  }) => any;
19
- update: ({ token, jwtToken, stationTypeId, data, headers }: {
19
+ update: ({ token, jwtToken, stationClassId, data, headers }: {
20
20
  token: any;
21
21
  jwtToken: any;
22
- stationTypeId: any;
22
+ stationClassId: any;
23
23
  data: any;
24
24
  headers: any;
25
25
  }) => any;
26
- remove: ({ token, jwtToken, stationTypeId, headers }: {
26
+ remove: ({ token, jwtToken, stationClassId, headers }: {
27
27
  token: any;
28
28
  jwtToken: any;
29
- stationTypeId: any;
29
+ stationClassId: any;
30
30
  headers: any;
31
31
  }) => any;
32
32
  create: ({ token, jwtToken, data, headers }: {
@@ -1306,31 +1306,31 @@ declare const _exports: {
1306
1306
  headers: any;
1307
1307
  }) => any;
1308
1308
  };
1309
- stationTypes: {
1309
+ stationClasses: {
1310
1310
  all: ({ token, jwtToken, query, headers }: {
1311
1311
  token: any;
1312
1312
  jwtToken: any;
1313
1313
  query?: {};
1314
1314
  headers: any;
1315
1315
  }) => any;
1316
- get: ({ token, jwtToken, stationTypeId, query, headers }: {
1316
+ get: ({ token, jwtToken, stationClassId, query, headers }: {
1317
1317
  token: any;
1318
1318
  jwtToken: any;
1319
- stationTypeId: any;
1319
+ stationClassId: any;
1320
1320
  query?: {};
1321
1321
  headers: any;
1322
1322
  }) => any;
1323
- update: ({ token, jwtToken, stationTypeId, data, headers }: {
1323
+ update: ({ token, jwtToken, stationClassId, data, headers }: {
1324
1324
  token: any;
1325
1325
  jwtToken: any;
1326
- stationTypeId: any;
1326
+ stationClassId: any;
1327
1327
  data: any;
1328
1328
  headers: any;
1329
1329
  }) => any;
1330
- remove: ({ token, jwtToken, stationTypeId, headers }: {
1330
+ remove: ({ token, jwtToken, stationClassId, headers }: {
1331
1331
  token: any;
1332
1332
  jwtToken: any;
1333
- stationTypeId: any;
1333
+ stationClassId: any;
1334
1334
  headers: any;
1335
1335
  }) => any;
1336
1336
  create: ({ token, jwtToken, data, headers }: {