btrz-api-client 8.70.0 → 8.71.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.
@@ -42,6 +42,30 @@ function externalCustomersFactory(_ref) {
42
42
  });
43
43
  }
44
44
 
45
+ /**
46
+ * POST /external-customers/ado/confirmation – Confirm a Saldo Max Profile V2 quick registration OTP.
47
+ * Requires BETTEREZ_APP JWT.
48
+ * @param {Object} opts
49
+ * @param {string} [opts.token] - API key
50
+ * @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
51
+ * @param {{confirmationToken: string, confirmationCode: string}} opts.data - Confirmation token and OTP code
52
+ * @param {Object} [opts.headers] - Optional headers
53
+ * @returns {Promise<import("axios").AxiosResponse<{ code: string, userId?: string, isConfirmed?: boolean, message?: string }>>}
54
+ */
55
+ function confirmSaldoMaxRegistration(_ref3) {
56
+ var data = _ref3.data,
57
+ token = _ref3.token,
58
+ jwtToken = _ref3.jwtToken,
59
+ headers = _ref3.headers;
60
+
61
+ return client({
62
+ url: "/external-customers/ado/confirmation",
63
+ method: "post",
64
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
65
+ data: data
66
+ });
67
+ }
68
+
45
69
  var saldoMax = {
46
70
  /**
47
71
  * GET /external-customers/ado - get SaldoMax user by email, phone or walletId.
@@ -60,18 +84,21 @@ function externalCustomersFactory(_ref) {
60
84
  * @returns {Promise<import("axios").AxiosResponse<{ adoUsers: Array<Object> }>>}
61
85
  * @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
62
86
  */
63
- get: function get(_ref3) {
64
- var token = _ref3.token,
65
- jwtToken = _ref3.jwtToken,
66
- query = _ref3.query,
67
- headers = _ref3.headers;
87
+ get: function get(_ref4) {
88
+ var token = _ref4.token,
89
+ jwtToken = _ref4.jwtToken,
90
+ query = _ref4.query,
91
+ headers = _ref4.headers;
68
92
 
69
93
  return client.get("/external-customers/ado", {
70
94
  params: query,
71
95
  headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
72
96
  });
73
97
  },
74
- create: registerSaldoMax
98
+ create: registerSaldoMax,
99
+ confirmation: {
100
+ create: confirmSaldoMaxRegistration
101
+ }
75
102
  };
76
103
 
77
104
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "8.70.0",
3
+ "version": "8.71.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,25 @@ function externalCustomersFactory({client, internalAuthTokenProvider}) {
29
29
  });
30
30
  }
31
31
 
32
+ /**
33
+ * POST /external-customers/ado/confirmation – Confirm a Saldo Max Profile V2 quick registration OTP.
34
+ * Requires BETTEREZ_APP JWT.
35
+ * @param {Object} opts
36
+ * @param {string} [opts.token] - API key
37
+ * @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
38
+ * @param {{confirmationToken: string, confirmationCode: string}} opts.data - Confirmation token and OTP code
39
+ * @param {Object} [opts.headers] - Optional headers
40
+ * @returns {Promise<import("axios").AxiosResponse<{ code: string, userId?: string, isConfirmed?: boolean, message?: string }>>}
41
+ */
42
+ function confirmSaldoMaxRegistration({data, token, jwtToken, headers}) {
43
+ return client({
44
+ url: "/external-customers/ado/confirmation",
45
+ method: "post",
46
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
47
+ data
48
+ });
49
+ }
50
+
32
51
  const saldoMax = {
33
52
  /**
34
53
  * GET /external-customers/ado - get SaldoMax user by email, phone or walletId.
@@ -53,7 +72,10 @@ function externalCustomersFactory({client, internalAuthTokenProvider}) {
53
72
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
54
73
  });
55
74
  },
56
- create: registerSaldoMax
75
+ create: registerSaldoMax,
76
+ confirmation: {
77
+ create: confirmSaldoMaxRegistration
78
+ }
57
79
  };
58
80
 
59
81
  return {
@@ -59,4 +59,22 @@ describe("accounts/external-customers", () => {
59
59
  data
60
60
  });
61
61
  });
62
+
63
+ it("should POST Saldo Max Profile V2 registration confirmation", () => {
64
+ const data = {
65
+ confirmationToken: "confirmation-token",
66
+ confirmationCode: "123456"
67
+ };
68
+ axiosMock.onPost("/external-customers/ado/confirmation").reply(expectRequest({
69
+ statusCode: 200,
70
+ token,
71
+ jwtToken,
72
+ body: data
73
+ }));
74
+ return api.accounts.externalCustomers.saldoMax.confirmation.create({
75
+ token,
76
+ jwtToken,
77
+ data
78
+ });
79
+ });
62
80
  });