btrz-api-client 7.28.0 → 7.29.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 -0
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +41 -0
- package/package.json +1 -1
- package/src/client.js +1 -0
- package/src/endpoints/accounts/multiproduct-sales-settings.js +28 -0
- package/test/endpoints/accounts/multiproduct-sales-settings.test.js +36 -0
- package/types/client.d.ts +13 -0
- package/types/endpoints/accounts/multiproduct-sales-settings.d.ts +17 -0
- package/types/initializedClient.d.ts +13 -0
package/lib/client.js
CHANGED
|
@@ -202,6 +202,7 @@ function createAccounts(_ref4) {
|
|
|
202
202
|
}),
|
|
203
203
|
pointToPointSettings: require("./endpoints/accounts/point-to-point-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
204
204
|
marketPricingSettings: require("./endpoints/accounts/market-pricing-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
205
|
+
multiproductSalesSettings: require("./endpoints/accounts/multiproduct-sales-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
205
206
|
printers: require("./endpoints/accounts/printers.js")({
|
|
206
207
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
207
208
|
}),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function multiproductSalesSettingsFactory(_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: "/multiproduct-sales-settings",
|
|
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
|
+
data = _ref3.data,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/multiproduct-sales-settings",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
31
|
+
data: data
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
get: get,
|
|
37
|
+
update: update
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = multiproductSalesSettingsFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -168,6 +168,7 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
168
168
|
}),
|
|
169
169
|
pointToPointSettings: require("./endpoints/accounts/point-to-point-settings.js")({client, internalAuthTokenProvider}),
|
|
170
170
|
marketPricingSettings: require("./endpoints/accounts/market-pricing-settings.js")({client, internalAuthTokenProvider}),
|
|
171
|
+
multiproductSalesSettings: require("./endpoints/accounts/multiproduct-sales-settings.js")({client, internalAuthTokenProvider}),
|
|
171
172
|
printers: require("./endpoints/accounts/printers.js")({
|
|
172
173
|
client, internalAuthTokenProvider
|
|
173
174
|
}),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function multiproductSalesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/multiproduct-sales-settings",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, data, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/multiproduct-sales-settings",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
18
|
+
data
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
get,
|
|
24
|
+
update
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = multiproductSalesSettingsFactory;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/multiproduct-sales-settings", () => {
|
|
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 multiproduct sales settings", () => {
|
|
13
|
+
axiosMock.onGet("/multiproduct-sales-settings")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
|
|
16
|
+
return api.accounts.multiproductSalesSettings.get({token, jwtToken});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should update multiproduct sales settings", () => {
|
|
20
|
+
const data = {
|
|
21
|
+
productsMapping: {"507f1f77bcf86cd799439011": ["507f1f77bcf86cd799439012"]},
|
|
22
|
+
stationsMapping: {"507f1f77bcf86cd799439014": ["507f1f77bcf86cd799439015"]}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
axiosMock.onPut("/multiproduct-sales-settings")
|
|
26
|
+
.reply(expectRequest({
|
|
27
|
+
statusCode: 200,
|
|
28
|
+
token,
|
|
29
|
+
jwtToken
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
return api.accounts.multiproductSalesSettings.update({
|
|
33
|
+
token, jwtToken, data
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2541,6 +2541,19 @@ export function createApiClient(options: {
|
|
|
2541
2541
|
headers: any;
|
|
2542
2542
|
}) => any;
|
|
2543
2543
|
};
|
|
2544
|
+
multiproductSalesSettings: {
|
|
2545
|
+
get: ({ token, jwtToken, headers }: {
|
|
2546
|
+
token: any;
|
|
2547
|
+
jwtToken: any;
|
|
2548
|
+
headers: any;
|
|
2549
|
+
}) => any;
|
|
2550
|
+
update: ({ token, jwtToken, data, headers }: {
|
|
2551
|
+
token: any;
|
|
2552
|
+
jwtToken: any;
|
|
2553
|
+
data: any;
|
|
2554
|
+
headers: any;
|
|
2555
|
+
}) => any;
|
|
2556
|
+
};
|
|
2544
2557
|
printers: {
|
|
2545
2558
|
all: ({ token, query, headers }: {
|
|
2546
2559
|
token: any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = multiproductSalesSettingsFactory;
|
|
2
|
+
declare function multiproductSalesSettingsFactory({ 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, data, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
data: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -2495,6 +2495,19 @@ declare const _exports: {
|
|
|
2495
2495
|
headers: any;
|
|
2496
2496
|
}) => any;
|
|
2497
2497
|
};
|
|
2498
|
+
multiproductSalesSettings: {
|
|
2499
|
+
get: ({ token, jwtToken, headers }: {
|
|
2500
|
+
token: any;
|
|
2501
|
+
jwtToken: any;
|
|
2502
|
+
headers: any;
|
|
2503
|
+
}) => any;
|
|
2504
|
+
update: ({ token, jwtToken, data, headers }: {
|
|
2505
|
+
token: any;
|
|
2506
|
+
jwtToken: any;
|
|
2507
|
+
data: any;
|
|
2508
|
+
headers: any;
|
|
2509
|
+
}) => any;
|
|
2510
|
+
};
|
|
2498
2511
|
printers: {
|
|
2499
2512
|
all: ({ token, query, headers }: {
|
|
2500
2513
|
token: any;
|