btrz-api-client 7.17.0 → 7.18.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.
@@ -29,6 +29,23 @@ function notifyTicketFactory(_ref) {
29
29
  headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
30
30
  });
31
31
  }
32
+ },
33
+ vouchers: {
34
+ create: function create(_ref3) {
35
+ var token = _ref3.token,
36
+ jwtToken = _ref3.jwtToken,
37
+ query = _ref3.query,
38
+ data = _ref3.data,
39
+ headers = _ref3.headers;
40
+
41
+ return client({
42
+ url: "/notify-vouchers",
43
+ method: "post",
44
+ params: query,
45
+ data: data,
46
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
47
+ });
48
+ }
32
49
  }
33
50
  };
34
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "7.17.0",
3
+ "version": "7.18.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,6 +19,17 @@ function notifyTicketFactory({
19
19
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
20
20
  });
21
21
  }
22
+ },
23
+ vouchers: {
24
+ create({token, jwtToken, query, data, headers}) {
25
+ return client({
26
+ url: "/notify-vouchers",
27
+ method: "post",
28
+ params: query,
29
+ data,
30
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
31
+ });
32
+ }
22
33
  }
23
34
  };
24
35
  }
@@ -9,7 +9,7 @@ describe("notifications/notify-tickets", () => {
9
9
  axiosMock.reset();
10
10
  });
11
11
 
12
- it("should post send an email", () => {
12
+ it("should post send an email with ticket", () => {
13
13
  const query = {
14
14
  lang: "en"
15
15
  };
@@ -29,4 +29,24 @@ describe("notifications/notify-tickets", () => {
29
29
  ticketId
30
30
  });
31
31
  });
32
+
33
+ it("should post send an email with voucher", () => {
34
+ const query = {
35
+ lang: "en"
36
+ };
37
+ axiosMock.onPost("/notify-vouchers").reply(({headers}) => {
38
+ if (headers["x-api-key"] === token && headers.authorization === `Bearer ${jwtToken}`) {
39
+ return [200];
40
+ }
41
+ return [403];
42
+ });
43
+ return api.notifications.notify.vouchers.create({
44
+ token,
45
+ jwtToken,
46
+ query,
47
+ data: {
48
+ voucherIds: []
49
+ }
50
+ });
51
+ });
32
52
  });
package/types/client.d.ts CHANGED
@@ -4237,6 +4237,15 @@ export function createApiClient(options: {
4237
4237
  headers: any;
4238
4238
  }): any;
4239
4239
  };
4240
+ vouchers: {
4241
+ create({ token, jwtToken, query, data, headers }: {
4242
+ token: any;
4243
+ jwtToken: any;
4244
+ query: any;
4245
+ data: any;
4246
+ headers: any;
4247
+ }): any;
4248
+ };
4240
4249
  };
4241
4250
  ordersRulesValidations: {
4242
4251
  create: ({ token, jwtToken, query, orderRulesValidation, headers }: {
@@ -14,4 +14,13 @@ declare function notifyTicketFactory({ client, internalAuthTokenProvider }: {
14
14
  headers: any;
15
15
  }): any;
16
16
  };
17
+ vouchers: {
18
+ create({ token, jwtToken, query, data, headers }: {
19
+ token: any;
20
+ jwtToken: any;
21
+ query: any;
22
+ data: any;
23
+ headers: any;
24
+ }): any;
25
+ };
17
26
  };
@@ -4191,6 +4191,15 @@ declare const _exports: {
4191
4191
  headers: any;
4192
4192
  }): any;
4193
4193
  };
4194
+ vouchers: {
4195
+ create({ token, jwtToken, query, data, headers }: {
4196
+ token: any;
4197
+ jwtToken: any;
4198
+ query: any;
4199
+ data: any;
4200
+ headers: any;
4201
+ }): any;
4202
+ };
4194
4203
  };
4195
4204
  ordersRulesValidations: {
4196
4205
  create: ({ token, jwtToken, query, orderRulesValidation, headers }: {