btrz-api-client 5.185.1 → 5.186.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 +5 -1
- package/lib/endpoints/accounts/transport-regulation-settings.js +43 -0
- package/package.json +1 -1
- package/src/client.js +5 -1
- package/src/endpoints/accounts/transport-regulation-settings.js +30 -0
- package/test/endpoints/accounts/transport-regulation-settings.test.js +33 -0
- package/types/client.d.ts +13 -0
- package/types/endpoints/accounts/transport-regulation-settings.d.ts +17 -0
- package/types/initializedClient.d.ts +13 -0
package/lib/client.js
CHANGED
|
@@ -217,7 +217,11 @@ function createAccounts(_ref4) {
|
|
|
217
217
|
__test: {
|
|
218
218
|
client: client
|
|
219
219
|
},
|
|
220
|
-
websalesConfig: require("./endpoints/accounts/websales-config.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
220
|
+
websalesConfig: require("./endpoints/accounts/websales-config.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
221
|
+
transportRegulationSettingsForCNRT: require("./endpoints/accounts/transport-regulation-settings.js")({
|
|
222
|
+
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
223
|
+
})
|
|
224
|
+
|
|
221
225
|
};
|
|
222
226
|
}
|
|
223
227
|
|
|
@@ -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;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -183,7 +183,11 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
183
183
|
__test: {
|
|
184
184
|
client
|
|
185
185
|
},
|
|
186
|
-
websalesConfig: require("./endpoints/accounts/websales-config.js")({client, internalAuthTokenProvider})
|
|
186
|
+
websalesConfig: require("./endpoints/accounts/websales-config.js")({client, internalAuthTokenProvider}),
|
|
187
|
+
transportRegulationSettingsForCNRT: require("./endpoints/accounts/transport-regulation-settings.js")({
|
|
188
|
+
client, internalAuthTokenProvider
|
|
189
|
+
})
|
|
190
|
+
|
|
187
191
|
};
|
|
188
192
|
}
|
|
189
193
|
|
|
@@ -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,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
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2578,6 +2578,19 @@ export function createApiClient(options: {
|
|
|
2578
2578
|
headers: any;
|
|
2579
2579
|
}) => any;
|
|
2580
2580
|
};
|
|
2581
|
+
transportRegulationSettingsForCNRT: {
|
|
2582
|
+
get: ({ token, jwtToken, headers }: {
|
|
2583
|
+
token: any;
|
|
2584
|
+
jwtToken: any;
|
|
2585
|
+
headers: any;
|
|
2586
|
+
}) => any;
|
|
2587
|
+
update: ({ token, jwtToken, transportRegulationSettings, headers }: {
|
|
2588
|
+
token: any;
|
|
2589
|
+
jwtToken: any;
|
|
2590
|
+
transportRegulationSettings: any;
|
|
2591
|
+
headers: any;
|
|
2592
|
+
}) => any;
|
|
2593
|
+
};
|
|
2581
2594
|
};
|
|
2582
2595
|
sales: {
|
|
2583
2596
|
docs: {
|
|
@@ -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
|
+
};
|
|
@@ -2532,6 +2532,19 @@ declare const _exports: {
|
|
|
2532
2532
|
headers: any;
|
|
2533
2533
|
}) => any;
|
|
2534
2534
|
};
|
|
2535
|
+
transportRegulationSettingsForCNRT: {
|
|
2536
|
+
get: ({ token, jwtToken, headers }: {
|
|
2537
|
+
token: any;
|
|
2538
|
+
jwtToken: any;
|
|
2539
|
+
headers: any;
|
|
2540
|
+
}) => any;
|
|
2541
|
+
update: ({ token, jwtToken, transportRegulationSettings, headers }: {
|
|
2542
|
+
token: any;
|
|
2543
|
+
jwtToken: any;
|
|
2544
|
+
transportRegulationSettings: any;
|
|
2545
|
+
headers: any;
|
|
2546
|
+
}) => any;
|
|
2547
|
+
};
|
|
2535
2548
|
};
|
|
2536
2549
|
sales: {
|
|
2537
2550
|
docs: {
|