btrz-api-client 5.185.1 → 5.187.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 +6 -1
- package/lib/endpoints/accounts/transport-regulation-settings.js +43 -0
- package/lib/endpoints/inventory/schedule-groups.js +72 -0
- package/lib/endpoints/operations/rms.js +1 -1
- package/package.json +1 -1
- package/src/client.js +6 -1
- package/src/endpoints/accounts/transport-regulation-settings.js +30 -0
- package/src/endpoints/inventory/schedule-groups.js +44 -0
- package/src/endpoints/operations/rms.js +1 -1
- package/test/endpoints/accounts/transport-regulation-settings.test.js +33 -0
- package/test/endpoints/inventory/schedule-groups.test.js +56 -0
- package/test/endpoints/operations/rms.js +1 -1
- package/test-integration/endpoints/inventory/schedule-groups.test.js +83 -0
- package/types/client.d.ts +53 -4
- package/types/endpoints/accounts/dynamic-forms.d.ts +6 -1
- package/types/endpoints/accounts/transport-regulation-settings.d.ts +17 -0
- package/types/endpoints/accounts/users.d.ts +6 -1
- package/types/endpoints/inventory/schedule-groups.d.ts +30 -0
- package/types/initializedClient.d.ts +52 -3
package/lib/client.js
CHANGED
|
@@ -98,6 +98,7 @@ function createInventory(_ref) {
|
|
|
98
98
|
giftCertificateDefinitions: require("./endpoints/inventory/gift-certificate-definitions.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
99
99
|
amenities: require("./endpoints/inventory/amenities.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
100
100
|
amenityGroups: require("./endpoints/inventory/amenity-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
101
|
+
scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
101
102
|
bundles: require("./endpoints/inventory/bundles.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
102
103
|
stationGroups: require("./endpoints/inventory/station-groups.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
103
104
|
zonePrices: require("./endpoints/inventory/zone-prices.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -217,7 +218,11 @@ function createAccounts(_ref4) {
|
|
|
217
218
|
__test: {
|
|
218
219
|
client: client
|
|
219
220
|
},
|
|
220
|
-
websalesConfig: require("./endpoints/accounts/websales-config.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
221
|
+
websalesConfig: require("./endpoints/accounts/websales-config.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
222
|
+
transportRegulationSettingsForCNRT: require("./endpoints/accounts/transport-regulation-settings.js")({
|
|
223
|
+
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
224
|
+
})
|
|
225
|
+
|
|
221
226
|
};
|
|
222
227
|
}
|
|
223
228
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function transportRegulationSettingsForCNRT(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function get(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
headers = _ref2.headers;
|
|
14
|
+
|
|
15
|
+
return client({
|
|
16
|
+
url: "/transport-regulation-settings/cnrt",
|
|
17
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function update(_ref3) {
|
|
22
|
+
var token = _ref3.token,
|
|
23
|
+
jwtToken = _ref3.jwtToken,
|
|
24
|
+
transportRegulationSettings = _ref3.transportRegulationSettings,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/transport-regulation-settings/cnrt",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({
|
|
31
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
32
|
+
}),
|
|
33
|
+
data: transportRegulationSettings
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
get: get,
|
|
39
|
+
update: update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = transportRegulationSettingsForCNRT;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("./../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function scheduleGroupsFactory(_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.get("/schedule-groups", {
|
|
17
|
+
params: query,
|
|
18
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function get(_ref3) {
|
|
23
|
+
var token = _ref3.token,
|
|
24
|
+
scheduleGroupId = _ref3.scheduleGroupId,
|
|
25
|
+
_ref3$query = _ref3.query,
|
|
26
|
+
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
27
|
+
headers = _ref3.headers;
|
|
28
|
+
|
|
29
|
+
return client.get("/schedule-groups/" + scheduleGroupId, {
|
|
30
|
+
params: query,
|
|
31
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function create(_ref4) {
|
|
36
|
+
var token = _ref4.token,
|
|
37
|
+
jwtToken = _ref4.jwtToken,
|
|
38
|
+
scheduleGroup = _ref4.scheduleGroup,
|
|
39
|
+
headers = _ref4.headers;
|
|
40
|
+
|
|
41
|
+
return client({
|
|
42
|
+
url: "/schedule-groups",
|
|
43
|
+
method: "post",
|
|
44
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
45
|
+
data: { scheduleGroup: scheduleGroup }
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function update(_ref5) {
|
|
50
|
+
var token = _ref5.token,
|
|
51
|
+
jwtToken = _ref5.jwtToken,
|
|
52
|
+
scheduleGroupId = _ref5.scheduleGroupId,
|
|
53
|
+
scheduleGroup = _ref5.scheduleGroup,
|
|
54
|
+
headers = _ref5.headers;
|
|
55
|
+
|
|
56
|
+
return client({
|
|
57
|
+
url: "/schedule-groups/" + scheduleGroupId,
|
|
58
|
+
method: "put",
|
|
59
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
60
|
+
data: { scheduleGroup: scheduleGroup }
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
all: all,
|
|
66
|
+
get: get,
|
|
67
|
+
create: create,
|
|
68
|
+
update: update
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = scheduleGroupsFactory;
|
|
@@ -15,7 +15,7 @@ function rmsFactory(_ref) {
|
|
|
15
15
|
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
16
16
|
headers = _ref2.headers;
|
|
17
17
|
|
|
18
|
-
return client.get("/rms/manifest-forecast
|
|
18
|
+
return client.get("/rms/manifest-forecast", {
|
|
19
19
|
params: query,
|
|
20
20
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
21
21
|
});
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -85,6 +85,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
85
85
|
giftCertificateDefinitions: require("./endpoints/inventory/gift-certificate-definitions.js")({client, internalAuthTokenProvider}),
|
|
86
86
|
amenities: require("./endpoints/inventory/amenities.js")({client, internalAuthTokenProvider}),
|
|
87
87
|
amenityGroups: require("./endpoints/inventory/amenity-groups.js")({client, internalAuthTokenProvider}),
|
|
88
|
+
scheduleGroups: require("./endpoints/inventory/schedule-groups.js")({client, internalAuthTokenProvider}),
|
|
88
89
|
bundles: require("./endpoints/inventory/bundles.js")({client, internalAuthTokenProvider}),
|
|
89
90
|
stationGroups: require("./endpoints/inventory/station-groups.js")({client, internalAuthTokenProvider}),
|
|
90
91
|
zonePrices: require("./endpoints/inventory/zone-prices.js")({client, internalAuthTokenProvider}),
|
|
@@ -183,7 +184,11 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
183
184
|
__test: {
|
|
184
185
|
client
|
|
185
186
|
},
|
|
186
|
-
websalesConfig: require("./endpoints/accounts/websales-config.js")({client, internalAuthTokenProvider})
|
|
187
|
+
websalesConfig: require("./endpoints/accounts/websales-config.js")({client, internalAuthTokenProvider}),
|
|
188
|
+
transportRegulationSettingsForCNRT: require("./endpoints/accounts/transport-regulation-settings.js")({
|
|
189
|
+
client, internalAuthTokenProvider
|
|
190
|
+
})
|
|
191
|
+
|
|
187
192
|
};
|
|
188
193
|
}
|
|
189
194
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function transportRegulationSettingsForCNRT({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/transport-regulation-settings/cnrt",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, transportRegulationSettings, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/transport-regulation-settings/cnrt",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({
|
|
18
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
19
|
+
}),
|
|
20
|
+
data: transportRegulationSettings
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
get,
|
|
26
|
+
update
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = transportRegulationSettingsForCNRT;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
|
+
|
|
3
|
+
function scheduleGroupsFactory({client, internalAuthTokenProvider}) {
|
|
4
|
+
function all({token, query = {}, headers}) {
|
|
5
|
+
return client.get("/schedule-groups", {
|
|
6
|
+
params: query,
|
|
7
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function get({token, scheduleGroupId, query = {}, headers}) {
|
|
12
|
+
return client.get(`/schedule-groups/${scheduleGroupId}`, {
|
|
13
|
+
params: query,
|
|
14
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function create({token, jwtToken, scheduleGroup, headers}) {
|
|
19
|
+
return client({
|
|
20
|
+
url: "/schedule-groups",
|
|
21
|
+
method: "post",
|
|
22
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
23
|
+
data: {scheduleGroup}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function update({token, jwtToken, scheduleGroupId, scheduleGroup, headers}) {
|
|
28
|
+
return client({
|
|
29
|
+
url: `/schedule-groups/${scheduleGroupId}`,
|
|
30
|
+
method: "put",
|
|
31
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
32
|
+
data: {scheduleGroup}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
all,
|
|
38
|
+
get,
|
|
39
|
+
create,
|
|
40
|
+
update
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
module.exports = scheduleGroupsFactory;
|
|
@@ -12,7 +12,7 @@ function rmsFactory({
|
|
|
12
12
|
query = {},
|
|
13
13
|
headers
|
|
14
14
|
}) {
|
|
15
|
-
return client.get("/rms/manifest-forecast
|
|
15
|
+
return client.get("/rms/manifest-forecast", {
|
|
16
16
|
params: query,
|
|
17
17
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
18
18
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/transport-regulation-settings/cnrt", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "secret";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get the transport regulation settings for CNRT", () => {
|
|
13
|
+
axiosMock.onGet("/transport-regulation-settings/cnrt")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
return api.accounts.transportRegulationSettingsForCNRT.get({token, jwtToken});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should update transport regulation settings for CNRT", () => {
|
|
19
|
+
const transportRegulationSettingsForCNRT = {
|
|
20
|
+
enabled: true
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
axiosMock.onPut("/transport-regulation-settings/cnrt")
|
|
24
|
+
.reply(expectRequest({
|
|
25
|
+
statusCode: 200,
|
|
26
|
+
token,
|
|
27
|
+
jwtToken
|
|
28
|
+
}));
|
|
29
|
+
return api.accounts.transportRegulationSettingsForCNRT.update({
|
|
30
|
+
token, jwtToken, transportRegulationSettingsForCNRT
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("inventory/schedule-groups", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should list Schedule Groups", () => {
|
|
13
|
+
axiosMock.onGet("/schedule-groups").reply(expectRequest({statusCode: 200, token}));
|
|
14
|
+
return api.inventory.scheduleGroups.all({token});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
it("should get a Schedule Group", () => {
|
|
19
|
+
const scheduleGroupId = "5ad7804216b426412c19f06f";
|
|
20
|
+
axiosMock.onGet(`/schedule-groups/${scheduleGroupId}`).reply(expectRequest({statusCode: 200, token}));
|
|
21
|
+
return api.inventory.scheduleGroups.get({
|
|
22
|
+
token,
|
|
23
|
+
scheduleGroupId
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should create an Schedule Group", () => {
|
|
28
|
+
axiosMock.onPost("/schedule-groups").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
29
|
+
return api.inventory.scheduleGroups.create({
|
|
30
|
+
jwtToken,
|
|
31
|
+
token,
|
|
32
|
+
scheduleGroup: {
|
|
33
|
+
name: "schedule group name",
|
|
34
|
+
colour: "#1414b8",
|
|
35
|
+
enabled: "true",
|
|
36
|
+
rule: {}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should update an Schedule Group", () => {
|
|
42
|
+
const scheduleGroupId = "5ad7804216b426412c19f06f";
|
|
43
|
+
axiosMock.onPut(`/schedule-groups/${scheduleGroupId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
44
|
+
return api.inventory.scheduleGroups.update({
|
|
45
|
+
jwtToken,
|
|
46
|
+
token,
|
|
47
|
+
scheduleGroupId,
|
|
48
|
+
update: {
|
|
49
|
+
name: "updated schedule group name",
|
|
50
|
+
colour: "#1515b8",
|
|
51
|
+
enabled: "true",
|
|
52
|
+
rule: {}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -12,7 +12,7 @@ describe("operations/accounting-items", () => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it("should get all manifest forecast information in a single day", () => {
|
|
15
|
-
axiosMock.onGet("/rms/manifest-forecast
|
|
15
|
+
axiosMock.onGet("/rms/manifest-forecast").reply(expectRequest({
|
|
16
16
|
statusCode: 200, token, jwtToken
|
|
17
17
|
}));
|
|
18
18
|
return api.operations.rms.manifestForecasts.all({
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const {expect} = require("chai");
|
|
2
|
+
const port = process.env.INVENTORY_API_PORT;
|
|
3
|
+
const token = process.env.API_TOKEN;
|
|
4
|
+
const jwtToken = process.env.JWT_TOKEN;
|
|
5
|
+
const scheduleGroupId = process.env.SCHEDULE_GROUP_ID;
|
|
6
|
+
|
|
7
|
+
const api = require("./../../../src/client.js").createApiClient({
|
|
8
|
+
baseURL: `http://localhost:${port}`,
|
|
9
|
+
baseURLOverride: {
|
|
10
|
+
inventory: (baseUrl) => `${baseUrl}/inventory`
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe("inventory/schedule-groups", () => {
|
|
15
|
+
it("should get an Schedule Group", () => {
|
|
16
|
+
return api.inventory.scheduleGroups.get({
|
|
17
|
+
token,
|
|
18
|
+
scheduleGroupId
|
|
19
|
+
})
|
|
20
|
+
.then(({status, data}) => {
|
|
21
|
+
expect(status).to.equal(200);
|
|
22
|
+
expect(data.scheduleGroup).to.exist;
|
|
23
|
+
expect(data.scheduleGroup._id).to.eql(scheduleGroupId);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should create an Schedule Group", () => {
|
|
28
|
+
const newName = "New Name 97";
|
|
29
|
+
const newColour = "#000017";
|
|
30
|
+
const newState = false;
|
|
31
|
+
return api.inventory.scheduleGroups.create({
|
|
32
|
+
jwtToken,
|
|
33
|
+
token,
|
|
34
|
+
scheduleGroup: {
|
|
35
|
+
name: newName,
|
|
36
|
+
enabled: newState,
|
|
37
|
+
colour: newColour,
|
|
38
|
+
rule: {}
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
.then(({status, data}) => {
|
|
42
|
+
expect(status).to.equal(200);
|
|
43
|
+
expect(data.scheduleGroup).to.exist;
|
|
44
|
+
expect(data.scheduleGroup.name).to.eql(newName);
|
|
45
|
+
expect(data.scheduleGroup.enabled).to.eql(newState);
|
|
46
|
+
expect(data.scheduleGroup.colour).to.eql(newColour);
|
|
47
|
+
expect(data.amenityGroup.createdAt).to.exist;
|
|
48
|
+
expect(data.amenityGroup.createdBy).to.exist;
|
|
49
|
+
expect(data.amenityGroup.updatedAt).to.exist;
|
|
50
|
+
expect(data.amenityGroup.updatedBy).to.exist;
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("should update an Schedule Group", () => {
|
|
55
|
+
const newName = "Schedule Group New Name";
|
|
56
|
+
const newState = false;
|
|
57
|
+
const newColour = "#000044";
|
|
58
|
+
|
|
59
|
+
return api.inventory.scheduleGroups.update({
|
|
60
|
+
jwtToken,
|
|
61
|
+
token,
|
|
62
|
+
scheduleGroupId,
|
|
63
|
+
amenityGroup: {
|
|
64
|
+
name: newName,
|
|
65
|
+
colour: newColour,
|
|
66
|
+
enabled: newState,
|
|
67
|
+
amenityIds: [],
|
|
68
|
+
lexiconKeys: {}
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
.then(({status, data}) => {
|
|
72
|
+
expect(status).to.equal(200);
|
|
73
|
+
expect(data.amenityGroup).to.exist;
|
|
74
|
+
expect(data.amenityGroup.name).to.eql(newName);
|
|
75
|
+
expect(data.amenityGroup.enabled).to.eql(newState);
|
|
76
|
+
expect(data.amenityGroup.colour).to.eql(newColour);
|
|
77
|
+
expect(data.amenityGroup.createdAt).to.exist;
|
|
78
|
+
expect(data.amenityGroup.createdBy).to.exist;
|
|
79
|
+
expect(data.amenityGroup.updatedAt).to.exist;
|
|
80
|
+
expect(data.amenityGroup.updatedBy).to.exist;
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -1224,6 +1224,32 @@ export function createApiClient(options: {
|
|
|
1224
1224
|
headers: any;
|
|
1225
1225
|
}) => any;
|
|
1226
1226
|
};
|
|
1227
|
+
scheduleGroups: {
|
|
1228
|
+
all: ({ token, query, headers }: {
|
|
1229
|
+
token: any;
|
|
1230
|
+
query?: {};
|
|
1231
|
+
headers: any;
|
|
1232
|
+
}) => any;
|
|
1233
|
+
get: ({ token, scheduleGroupId, query, headers }: {
|
|
1234
|
+
token: any;
|
|
1235
|
+
scheduleGroupId: any;
|
|
1236
|
+
query?: {};
|
|
1237
|
+
headers: any;
|
|
1238
|
+
}) => any;
|
|
1239
|
+
create: ({ token, jwtToken, scheduleGroup, headers }: {
|
|
1240
|
+
token: any;
|
|
1241
|
+
jwtToken: any;
|
|
1242
|
+
scheduleGroup: any;
|
|
1243
|
+
headers: any;
|
|
1244
|
+
}) => any;
|
|
1245
|
+
update: ({ token, jwtToken, scheduleGroupId, scheduleGroup, headers }: {
|
|
1246
|
+
token: any;
|
|
1247
|
+
jwtToken: any;
|
|
1248
|
+
scheduleGroupId: any;
|
|
1249
|
+
scheduleGroup: any;
|
|
1250
|
+
headers: any;
|
|
1251
|
+
}) => any;
|
|
1252
|
+
};
|
|
1227
1253
|
bundles: {
|
|
1228
1254
|
all: ({ token, jwtToken, query, headers }: {
|
|
1229
1255
|
token: any;
|
|
@@ -1798,7 +1824,12 @@ export function createApiClient(options: {
|
|
|
1798
1824
|
};
|
|
1799
1825
|
dynamicForms: {
|
|
1800
1826
|
fields: {
|
|
1801
|
-
get({ token, jwtToken, dynamicFormFieldId, headers }?: {
|
|
1827
|
+
get({ token, jwtToken, dynamicFormFieldId, headers }?: {
|
|
1828
|
+
token: any;
|
|
1829
|
+
jwtToken: any;
|
|
1830
|
+
dynamicFormFieldId: any;
|
|
1831
|
+
headers: any;
|
|
1832
|
+
}): any;
|
|
1802
1833
|
all({ token, jwtToken, query, headers }: {
|
|
1803
1834
|
token: any;
|
|
1804
1835
|
jwtToken: any;
|
|
@@ -2500,7 +2531,12 @@ export function createApiClient(options: {
|
|
|
2500
2531
|
}) => any;
|
|
2501
2532
|
};
|
|
2502
2533
|
users: {
|
|
2503
|
-
get: ({ token, jwtToken, id, headers }?: {
|
|
2534
|
+
get: ({ token, jwtToken, id, headers }?: {
|
|
2535
|
+
token: any;
|
|
2536
|
+
jwtToken: any;
|
|
2537
|
+
id: any;
|
|
2538
|
+
headers: any;
|
|
2539
|
+
}) => any;
|
|
2504
2540
|
all: ({ token, jwtToken, query, headers }: {
|
|
2505
2541
|
token: any;
|
|
2506
2542
|
jwtToken: any;
|
|
@@ -2578,6 +2614,19 @@ export function createApiClient(options: {
|
|
|
2578
2614
|
headers: any;
|
|
2579
2615
|
}) => any;
|
|
2580
2616
|
};
|
|
2617
|
+
transportRegulationSettingsForCNRT: {
|
|
2618
|
+
get: ({ token, jwtToken, headers }: {
|
|
2619
|
+
token: any;
|
|
2620
|
+
jwtToken: any;
|
|
2621
|
+
headers: any;
|
|
2622
|
+
}) => any;
|
|
2623
|
+
update: ({ token, jwtToken, transportRegulationSettings, headers }: {
|
|
2624
|
+
token: any;
|
|
2625
|
+
jwtToken: any;
|
|
2626
|
+
transportRegulationSettings: any;
|
|
2627
|
+
headers: any;
|
|
2628
|
+
}) => any;
|
|
2629
|
+
};
|
|
2581
2630
|
};
|
|
2582
2631
|
sales: {
|
|
2583
2632
|
docs: {
|
|
@@ -2787,7 +2836,7 @@ export function createApiClient(options: {
|
|
|
2787
2836
|
create: ({ token, jwtToken, cancelData, headers }: {
|
|
2788
2837
|
token: string;
|
|
2789
2838
|
jwtToken: string;
|
|
2790
|
-
cancelData: CancelSetData;
|
|
2839
|
+
cancelData: import("./endpoints/sales/cancellations.js").CancelSetData;
|
|
2791
2840
|
headers: any;
|
|
2792
2841
|
}) => Promise<any>;
|
|
2793
2842
|
};
|
|
@@ -3616,7 +3665,7 @@ export function createApiClient(options: {
|
|
|
3616
3665
|
jwtToken: any;
|
|
3617
3666
|
phoneNumberData?: {};
|
|
3618
3667
|
headers: any;
|
|
3619
|
-
}): any;
|
|
3668
|
+
}): any; /** @type {import("axios").AxiosRequestConfig} */
|
|
3620
3669
|
};
|
|
3621
3670
|
sms: {
|
|
3622
3671
|
create({ token, jwtToken, smsMsg, headers }: {
|
|
@@ -4,7 +4,12 @@ declare function dynamicFormsFactory({ client, internalAuthTokenProvider }: {
|
|
|
4
4
|
internalAuthTokenProvider: any;
|
|
5
5
|
}): {
|
|
6
6
|
fields: {
|
|
7
|
-
get({ token, jwtToken, dynamicFormFieldId, headers }?: {
|
|
7
|
+
get({ token, jwtToken, dynamicFormFieldId, headers }?: {
|
|
8
|
+
token: any;
|
|
9
|
+
jwtToken: any;
|
|
10
|
+
dynamicFormFieldId: any;
|
|
11
|
+
headers: any;
|
|
12
|
+
}): any;
|
|
8
13
|
all({ token, jwtToken, query, headers }: {
|
|
9
14
|
token: any;
|
|
10
15
|
jwtToken: any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = transportRegulationSettingsForCNRT;
|
|
2
|
+
declare function transportRegulationSettingsForCNRT({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
get: ({ token, jwtToken, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
headers: any;
|
|
10
|
+
}) => any;
|
|
11
|
+
update: ({ token, jwtToken, transportRegulationSettings, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
transportRegulationSettings: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -3,7 +3,12 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
|
|
|
3
3
|
client: any;
|
|
4
4
|
internalAuthTokenProvider: any;
|
|
5
5
|
}): {
|
|
6
|
-
get: ({ token, jwtToken, id, headers }?: {
|
|
6
|
+
get: ({ token, jwtToken, id, headers }?: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
id: any;
|
|
10
|
+
headers: any;
|
|
11
|
+
}) => any;
|
|
7
12
|
all: ({ token, jwtToken, query, headers }: {
|
|
8
13
|
token: any;
|
|
9
14
|
jwtToken: any;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export = scheduleGroupsFactory;
|
|
2
|
+
declare function scheduleGroupsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
all: ({ token, query, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
query?: {};
|
|
9
|
+
headers: any;
|
|
10
|
+
}) => any;
|
|
11
|
+
get: ({ token, scheduleGroupId, query, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
scheduleGroupId: any;
|
|
14
|
+
query?: {};
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
create: ({ token, jwtToken, scheduleGroup, headers }: {
|
|
18
|
+
token: any;
|
|
19
|
+
jwtToken: any;
|
|
20
|
+
scheduleGroup: any;
|
|
21
|
+
headers: any;
|
|
22
|
+
}) => any;
|
|
23
|
+
update: ({ token, jwtToken, scheduleGroupId, scheduleGroup, headers }: {
|
|
24
|
+
token: any;
|
|
25
|
+
jwtToken: any;
|
|
26
|
+
scheduleGroupId: any;
|
|
27
|
+
scheduleGroup: any;
|
|
28
|
+
headers: any;
|
|
29
|
+
}) => any;
|
|
30
|
+
};
|