btrz-api-client 7.22.0 → 7.24.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 +49 -49
- package/lib/endpoints/inventory/getnet-terminals.js +91 -0
- package/lib/endpoints/notifications/{notify-tickets.js → notify.js} +18 -1
- package/package.json +1 -1
- package/src/client.js +49 -49
- package/src/endpoints/inventory/getnet-terminals.js +67 -0
- package/src/endpoints/notifications/{notify-tickets.js → notify.js} +12 -1
- package/test/endpoints/inventory/getnet-terminals.test.js +98 -0
- package/test/endpoints/notifications/{notify-tickets.test.js → notify.test.js} +22 -2
- package/types/client.d.ts +917 -887
- package/types/endpoints/inventory/getnet-terminals.d.ts +34 -0
- package/types/endpoints/notifications/notify.d.ts +26 -0
- package/types/initializedClient.d.ts +917 -887
- package/lib/endpoints/notifications/notify-vouchers.js +0 -29
- package/src/endpoints/notifications/notify-vouchers.js +0 -21
- package/test/endpoints/notifications/notify-vouchers.test.js +0 -31
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _require = require("./../endpoints_helpers.js"),
|
|
4
|
-
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
-
|
|
6
|
-
function notifyVoucherFactory(_ref) {
|
|
7
|
-
var client = _ref.client,
|
|
8
|
-
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
create: function create(_ref2) {
|
|
12
|
-
var token = _ref2.token,
|
|
13
|
-
jwtToken = _ref2.jwtToken,
|
|
14
|
-
query = _ref2.query,
|
|
15
|
-
data = _ref2.data,
|
|
16
|
-
headers = _ref2.headers;
|
|
17
|
-
|
|
18
|
-
return client({
|
|
19
|
-
url: "/notify-vouchers",
|
|
20
|
-
method: "post",
|
|
21
|
-
params: query,
|
|
22
|
-
data: data,
|
|
23
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = notifyVoucherFactory;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
authorizationHeaders
|
|
3
|
-
} = require("./../endpoints_helpers.js");
|
|
4
|
-
|
|
5
|
-
function notifyVoucherFactory({
|
|
6
|
-
client, internalAuthTokenProvider
|
|
7
|
-
}) {
|
|
8
|
-
return {
|
|
9
|
-
create({token, jwtToken, query, data, headers}) {
|
|
10
|
-
return client({
|
|
11
|
-
url: "/notify-vouchers",
|
|
12
|
-
method: "post",
|
|
13
|
-
params: query,
|
|
14
|
-
data,
|
|
15
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
module.exports = notifyVoucherFactory;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const {axiosMock} = require("./../../test-helpers.js");
|
|
2
|
-
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
-
|
|
4
|
-
describe("notifications/notify-vouchers", () => {
|
|
5
|
-
const token = "my-api-key";
|
|
6
|
-
const jwtToken = "my-jwt";
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
axiosMock.reset();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("should post send an email with voucher", () => {
|
|
13
|
-
const query = {
|
|
14
|
-
lang: "en"
|
|
15
|
-
};
|
|
16
|
-
axiosMock.onPost("/notify-vouchers").reply(({headers}) => {
|
|
17
|
-
if (headers["x-api-key"] === token && headers.authorization === `Bearer ${jwtToken}`) {
|
|
18
|
-
return [200];
|
|
19
|
-
}
|
|
20
|
-
return [403];
|
|
21
|
-
});
|
|
22
|
-
return api.notifications.notifyVoucher.create({
|
|
23
|
-
token,
|
|
24
|
-
jwtToken,
|
|
25
|
-
query,
|
|
26
|
-
data: {
|
|
27
|
-
voucherIds: []
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|