btrz-api-client 8.46.0 → 8.48.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 +1 -1
- package/lib/endpoints/accounts/external-customers.js +34 -0
- package/lib/endpoints/inventory/external-wallets.js +35 -6
- package/package.json +1 -1
- package/src/endpoints/accounts/external-customers.js +29 -0
- package/src/endpoints/inventory/external-wallets.js +23 -0
|
@@ -42,7 +42,41 @@ function externalCustomersFactory(_ref) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
var saldoMax = {
|
|
46
|
+
/**
|
|
47
|
+
* GET /external-customers/ado - get SaldoMax user by email, phone or walletId.
|
|
48
|
+
* The querying precedence is (from higher to lower precedence):
|
|
49
|
+
*
|
|
50
|
+
* - email
|
|
51
|
+
* - phone
|
|
52
|
+
* - walletId
|
|
53
|
+
*
|
|
54
|
+
* Only the first option found is used in the lookup.
|
|
55
|
+
* @param {Object} opts
|
|
56
|
+
* @param {string} [opts.token] - API key
|
|
57
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
58
|
+
* @param {{email?: string, phone?: string, walletId?: string}} opts.query - Query to get the SaldoMax user
|
|
59
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
60
|
+
* @returns {Promise<import("axios").AxiosResponse<{ adoUsers: Array<Object> }>>}
|
|
61
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
62
|
+
*/
|
|
63
|
+
get: function get(_ref3) {
|
|
64
|
+
var token = _ref3.token,
|
|
65
|
+
jwtToken = _ref3.jwtToken,
|
|
66
|
+
query = _ref3.query,
|
|
67
|
+
headers = _ref3.headers;
|
|
68
|
+
|
|
69
|
+
return client.get("/external-customers/ado", {
|
|
70
|
+
params: query,
|
|
71
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
create: registerSaldoMax
|
|
75
|
+
};
|
|
76
|
+
|
|
45
77
|
return {
|
|
78
|
+
saldoMax: saldoMax,
|
|
79
|
+
// Keep here for backwards compat
|
|
46
80
|
registerSaldoMax: registerSaldoMax
|
|
47
81
|
};
|
|
48
82
|
}
|
|
@@ -114,6 +114,35 @@ function externalWalletsFactory(_ref) {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
|
+
nip: {
|
|
118
|
+
/**
|
|
119
|
+
* PUT /external-wallets/saldo-max/:walletId/nip - update SaldoMax external wallet's NIP.
|
|
120
|
+
* @param {Object} opts
|
|
121
|
+
* @param {string} [opts.token] - API key
|
|
122
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
123
|
+
* @param {Object} opts.walletId - The walletId of the SaldoMax wallet
|
|
124
|
+
* @param {Object} opts.nip - The new NIP
|
|
125
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
126
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
127
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
128
|
+
*/
|
|
129
|
+
update: function update(_ref6) {
|
|
130
|
+
var token = _ref6.token,
|
|
131
|
+
jwtToken = _ref6.jwtToken,
|
|
132
|
+
walletId = _ref6.walletId,
|
|
133
|
+
nip = _ref6.nip,
|
|
134
|
+
headers = _ref6.headers;
|
|
135
|
+
|
|
136
|
+
return client({
|
|
137
|
+
url: "/external-wallets/saldo-max/" + walletId + "/nip",
|
|
138
|
+
method: "put",
|
|
139
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
140
|
+
data: {
|
|
141
|
+
nip: nip
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
},
|
|
117
146
|
/** @type {{ create: function }} */
|
|
118
147
|
movements: {
|
|
119
148
|
/**
|
|
@@ -127,12 +156,12 @@ function externalWalletsFactory(_ref) {
|
|
|
127
156
|
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
128
157
|
* @throws When response is 4xx/5xx (400, 401, 403 INVALID_NIP/WALLET_BLOCKED/WALLET_NOT_ACTIVE, 404, 500)
|
|
129
158
|
*/
|
|
130
|
-
create: function create(
|
|
131
|
-
var token =
|
|
132
|
-
jwtToken =
|
|
133
|
-
walletId =
|
|
134
|
-
movement =
|
|
135
|
-
headers =
|
|
159
|
+
create: function create(_ref7) {
|
|
160
|
+
var token = _ref7.token,
|
|
161
|
+
jwtToken = _ref7.jwtToken,
|
|
162
|
+
walletId = _ref7.walletId,
|
|
163
|
+
movement = _ref7.movement,
|
|
164
|
+
headers = _ref7.headers;
|
|
136
165
|
|
|
137
166
|
return client({
|
|
138
167
|
url: "/external-wallets/saldo-max/" + walletId + "/movements",
|
package/package.json
CHANGED
|
@@ -29,7 +29,36 @@ function externalCustomersFactory({client, internalAuthTokenProvider}) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
const saldoMax = {
|
|
33
|
+
/**
|
|
34
|
+
* GET /external-customers/ado - get SaldoMax user by email, phone or walletId.
|
|
35
|
+
* The querying precedence is (from higher to lower precedence):
|
|
36
|
+
*
|
|
37
|
+
* - email
|
|
38
|
+
* - phone
|
|
39
|
+
* - walletId
|
|
40
|
+
*
|
|
41
|
+
* Only the first option found is used in the lookup.
|
|
42
|
+
* @param {Object} opts
|
|
43
|
+
* @param {string} [opts.token] - API key
|
|
44
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
45
|
+
* @param {{email?: string, phone?: string, walletId?: string}} opts.query - Query to get the SaldoMax user
|
|
46
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
47
|
+
* @returns {Promise<import("axios").AxiosResponse<{ adoUsers: Array<Object> }>>}
|
|
48
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
49
|
+
*/
|
|
50
|
+
get: ({token, jwtToken, query, headers}) => {
|
|
51
|
+
return client.get("/external-customers/ado", {
|
|
52
|
+
params: query,
|
|
53
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
create: registerSaldoMax
|
|
57
|
+
};
|
|
58
|
+
|
|
32
59
|
return {
|
|
60
|
+
saldoMax,
|
|
61
|
+
// Keep here for backwards compat
|
|
33
62
|
registerSaldoMax
|
|
34
63
|
};
|
|
35
64
|
}
|
|
@@ -87,6 +87,29 @@ function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
},
|
|
90
|
+
nip: {
|
|
91
|
+
/**
|
|
92
|
+
* PUT /external-wallets/saldo-max/:walletId/nip - update SaldoMax external wallet's NIP.
|
|
93
|
+
* @param {Object} opts
|
|
94
|
+
* @param {string} [opts.token] - API key
|
|
95
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
96
|
+
* @param {Object} opts.walletId - The walletId of the SaldoMax wallet
|
|
97
|
+
* @param {Object} opts.nip - The new NIP
|
|
98
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
99
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
100
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
101
|
+
*/
|
|
102
|
+
update: ({token, jwtToken, walletId, nip, headers}) => {
|
|
103
|
+
return client({
|
|
104
|
+
url: `/external-wallets/saldo-max/${walletId}/nip`,
|
|
105
|
+
method: "put",
|
|
106
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
107
|
+
data: {
|
|
108
|
+
nip
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
},
|
|
90
113
|
/** @type {{ create: function }} */
|
|
91
114
|
movements: {
|
|
92
115
|
/**
|