@riocrypto/common 1.0.509 → 1.0.511

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.
@@ -16,7 +16,6 @@ import { PaymentMethod } from "../types/payment-method";
16
16
  import { PayoutMethod } from "../types/payout-method";
17
17
  import { RioSettings } from "../types/rio-settings";
18
18
  import { RioSettingsUpdate } from "../types/rio-settings-update";
19
- import { SecurityQuestion } from "../types/security-question";
20
19
  import { User } from "../types/user";
21
20
  import { UserInput } from "../types/user-input";
22
21
  import { UserUpdate } from "../types/user-update";
@@ -26,14 +25,15 @@ export declare class RioClient {
26
25
  getOrders(): Promise<Order[]>;
27
26
  getUsers(): Promise<User[]>;
28
27
  getBusinessUsers(): Promise<BusinessUser[]>;
29
- signin(email: string, password: string): Promise<any>;
28
+ signinAdmin(email: string, password: string): Promise<any>;
30
29
  updateUser(update: UserUpdate, userId?: string): Promise<User>;
31
30
  updateBusinessUser(update: BusinessUserUpdate, businessUserId?: string): Promise<BusinessUser>;
32
- updateAdminUserPassword({ password, newPassword, }: {
33
- password: string;
34
- newPassword: string;
31
+ updateAdmin(update: {
32
+ email?: string;
33
+ password?: "string";
34
+ newPassword?: string;
35
35
  }): Promise<Admin>;
36
- getAdminUser(): Promise<any>;
36
+ getAdmin(): Promise<any>;
37
37
  signoutAdmin(): Promise<void>;
38
38
  getRioSettings(): Promise<RioSettings>;
39
39
  createRioSettings(rioSettings: {
@@ -45,31 +45,18 @@ export declare class RioClient {
45
45
  getBusinessUser(): Promise<BusinessUser>;
46
46
  createUser(user: UserInput): Promise<void>;
47
47
  createBusinessUser(businessUser: BusinessUserInput): Promise<BusinessUser>;
48
- createBrokerCustomer(businessUser: BusinessUserInput): Promise<BusinessUser>;
49
48
  sendPhoneAuthCode(phoneNumber: string): Promise<void>;
50
- authExists(phoneNumber: string): Promise<boolean>;
51
- uploadCOI(businessUserId: string, formData: FormData): Promise<BusinessUser>;
52
- uploadKYCReport(businessUserId: string, formData: FormData): Promise<BusinessUser>;
53
- getSecurityQuestion(): Promise<SecurityQuestion>;
49
+ getAuth(): Promise<Auth>;
54
50
  signout(): Promise<void>;
55
51
  verifyPhoneCode(phoneNumber: string, code: string): Promise<void>;
56
- createAuth(password: string): Promise<void>;
57
52
  createOrder(order: OrderInput): Promise<Order>;
58
53
  getOrder(id: string): Promise<Order>;
59
- initBankPayout(oid: string, accountNumber: string): Promise<BankPayout>;
54
+ createBankPayout(oid: string, accountNumber: string): Promise<BankPayout>;
60
55
  getBankPayout(orderId: string): Promise<BankPayout>;
61
- checkAddress(address: string, crypto: Crypto): Promise<CheckedAddress>;
62
- getSupportedPaymentMethods(fiat: Fiat, country: Country): Promise<PaymentMethod[]>;
63
- getBrokerCustomers(): Promise<BusinessUser[]>;
56
+ createCheckedAddress(address: string, crypto: Crypto): Promise<CheckedAddress>;
57
+ getPaymentMethods(fiat: Fiat, country: Country): Promise<PaymentMethod[]>;
64
58
  getSupportedPayoutMethods(fiat: Fiat, country: Country): Promise<PayoutMethod[]>;
65
- getPartnerLayout(partnerId: string): Promise<Partner>;
66
- createClipCardPayment(orderId: string): Promise<{
67
- paymentId: string;
68
- paymentRequestUrl: string;
69
- }>;
70
- createConektaPayment(orderId: string): Promise<{
71
- checkoutRequestId: string;
72
- }>;
59
+ getPartner(partnerId: string): Promise<Partner>;
73
60
  createKushkiPayment(orderId: string, token: string): Promise<{
74
61
  paymentId: string;
75
62
  }>;
@@ -32,7 +32,7 @@ class RioClient {
32
32
  return data;
33
33
  });
34
34
  }
35
- signin(email, password) {
35
+ signinAdmin(email, password) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
37
  const { data } = yield this.axios.post(`/api/admin/signin`, {
38
38
  email,
@@ -53,24 +53,21 @@ class RioClient {
53
53
  return data;
54
54
  });
55
55
  }
56
- updateAdminUserPassword({ password, newPassword, }) {
56
+ updateAdmin(update) {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- const { data } = yield this.axios.patch(`/api/admin`, {
59
- password,
60
- newPassword,
61
- });
58
+ const { data } = yield this.axios.patch(`/api/auth/admin`, update);
62
59
  return data;
63
60
  });
64
61
  }
65
- getAdminUser() {
62
+ getAdmin() {
66
63
  return __awaiter(this, void 0, void 0, function* () {
67
- const { data } = yield this.axios.get(`/api/admin`);
64
+ const { data } = yield this.axios.get(`/api/auth/admin`);
68
65
  return data;
69
66
  });
70
67
  }
71
68
  signoutAdmin() {
72
69
  return __awaiter(this, void 0, void 0, function* () {
73
- yield this.axios.post("/api/admin/signout", {});
70
+ yield this.axios.post("/api/admin/auth/signout", {});
74
71
  });
75
72
  }
76
73
  getRioSettings() {
@@ -100,64 +97,38 @@ class RioClient {
100
97
  }
101
98
  getUser() {
102
99
  return __awaiter(this, void 0, void 0, function* () {
103
- const { data } = yield this.axios.get("/api/users/current");
100
+ const { data } = yield this.axios.get("/api/users");
104
101
  return data;
105
102
  });
106
103
  }
107
104
  getBusinessUser() {
108
105
  return __awaiter(this, void 0, void 0, function* () {
109
- const { data } = yield this.axios.get("/api/business/users/current");
106
+ const { data } = yield this.axios.get("/api/business/users");
110
107
  return data;
111
108
  });
112
109
  }
113
110
  createUser(user) {
114
111
  return __awaiter(this, void 0, void 0, function* () {
115
- yield this.axios.post("/api/users/current-auth", user);
112
+ yield this.axios.post("/api/users", user);
116
113
  });
117
114
  }
118
115
  createBusinessUser(businessUser) {
119
116
  return __awaiter(this, void 0, void 0, function* () {
120
- const response = yield this.axios.post("/api/business/users/current-auth", businessUser);
121
- return response.data;
122
- });
123
- }
124
- createBrokerCustomer(businessUser) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- const response = yield this.axios.post("/api/business/users/broker-customers/current-auth", businessUser);
117
+ const response = yield this.axios.post("/api/business/users", businessUser);
127
118
  return response.data;
128
119
  });
129
120
  }
130
121
  sendPhoneAuthCode(phoneNumber) {
131
122
  return __awaiter(this, void 0, void 0, function* () {
132
- yield this.axios.post("/api/auth/sendCode", {
133
- phoneNumber,
134
- });
135
- });
136
- }
137
- authExists(phoneNumber) {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- const response = yield this.axios.post("/api/auth/exists", {
123
+ yield this.axios.post("/api/auth/phone/send", {
140
124
  phoneNumber,
141
125
  });
142
- return response.data.exists;
143
126
  });
144
127
  }
145
- uploadCOI(businessUserId, formData) {
128
+ getAuth() {
146
129
  return __awaiter(this, void 0, void 0, function* () {
147
- const { data } = yield this.axios.patch(`/api/business/users/${businessUserId}/coi`, formData);
148
- return data;
149
- });
150
- }
151
- uploadKYCReport(businessUserId, formData) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- const { data } = yield this.axios.patch(`/api/business/users/${businessUserId}/kyc-report`, formData);
154
- return data;
155
- });
156
- }
157
- getSecurityQuestion() {
158
- return __awaiter(this, void 0, void 0, function* () {
159
- const response = yield this.axios.get("/api/auth/security-question", {});
160
- return response.data.question;
130
+ const response = yield this.axios.get("/api/auth");
131
+ return response.data;
161
132
  });
162
133
  }
163
134
  signout() {
@@ -167,19 +138,12 @@ class RioClient {
167
138
  }
168
139
  verifyPhoneCode(phoneNumber, code) {
169
140
  return __awaiter(this, void 0, void 0, function* () {
170
- yield this.axios.post("/api/auth/verifycode", {
141
+ yield this.axios.post("/api/auth/phone/verify", {
171
142
  phoneNumber,
172
143
  code,
173
144
  });
174
145
  });
175
146
  }
176
- createAuth(password) {
177
- return __awaiter(this, void 0, void 0, function* () {
178
- yield this.axios.post("/api/auth", {
179
- password,
180
- });
181
- });
182
- }
183
147
  createOrder(order) {
184
148
  return __awaiter(this, void 0, void 0, function* () {
185
149
  const response = yield this.axios.post("/api/orders", order);
@@ -192,7 +156,7 @@ class RioClient {
192
156
  return response.data;
193
157
  });
194
158
  }
195
- initBankPayout(oid, accountNumber) {
159
+ createBankPayout(oid, accountNumber) {
196
160
  return __awaiter(this, void 0, void 0, function* () {
197
161
  const response = yield this.axios.post(`/api/payouts/bank`, {
198
162
  orderId: oid,
@@ -207,7 +171,7 @@ class RioClient {
207
171
  return response.data;
208
172
  });
209
173
  }
210
- checkAddress(address, crypto) {
174
+ createCheckedAddress(address, crypto) {
211
175
  return __awaiter(this, void 0, void 0, function* () {
212
176
  const response = yield this.axios.post(`/api/kyt/address`, {
213
177
  address,
@@ -216,43 +180,21 @@ class RioClient {
216
180
  return response.data;
217
181
  });
218
182
  }
219
- getSupportedPaymentMethods(fiat, country) {
220
- return __awaiter(this, void 0, void 0, function* () {
221
- const response = yield this.axios.get(`/api/payment-methods/supported?fiat=${fiat}&country=${country}`);
222
- return response.data;
223
- });
224
- }
225
- getBrokerCustomers() {
183
+ getPaymentMethods(fiat, country) {
226
184
  return __awaiter(this, void 0, void 0, function* () {
227
- const response = yield this.axios.get(`/api/business/users/broker-customers`);
185
+ const response = yield this.axios.get(`/api/payment-methods?fiat=${fiat}&country=${country}`);
228
186
  return response.data;
229
187
  });
230
188
  }
231
189
  getSupportedPayoutMethods(fiat, country) {
232
190
  return __awaiter(this, void 0, void 0, function* () {
233
- const response = yield this.axios.get(`/api/payout-methods/supported?fiat=${fiat}&country=${country}`);
191
+ const response = yield this.axios.get(`/api/payout-methods?fiat=${fiat}&country=${country}`);
234
192
  return response.data;
235
193
  });
236
194
  }
237
- getPartnerLayout(partnerId) {
238
- return __awaiter(this, void 0, void 0, function* () {
239
- const { data } = yield this.axios.get(`/api/partners/${partnerId}/layout`);
240
- return data;
241
- });
242
- }
243
- createClipCardPayment(orderId) {
244
- return __awaiter(this, void 0, void 0, function* () {
245
- const { data } = yield this.axios.post(`/api/payments/card/clip`, {
246
- orderId,
247
- });
248
- return data;
249
- });
250
- }
251
- createConektaPayment(orderId) {
195
+ getPartner(partnerId) {
252
196
  return __awaiter(this, void 0, void 0, function* () {
253
- const { data } = yield this.axios.post(`/api/payments/card/conekta`, {
254
- orderId,
255
- });
197
+ const { data } = yield this.axios.get(`/api/partners/${partnerId}`);
256
198
  return data;
257
199
  });
258
200
  }
@@ -275,7 +217,7 @@ class RioClient {
275
217
  }
276
218
  createSPEIPayment(orderId) {
277
219
  return __awaiter(this, void 0, void 0, function* () {
278
- const { data } = yield this.axios.post(`/api/payments/bank/spei`, {
220
+ const { data } = yield this.axios.post(`/api/payments/bank/init/spei`, {
279
221
  orderId,
280
222
  });
281
223
  return data;
@@ -291,7 +233,7 @@ class RioClient {
291
233
  }
292
234
  createSWIFTPayment(orderId) {
293
235
  return __awaiter(this, void 0, void 0, function* () {
294
- const { data } = yield this.axios.post(`/api/payments/bank/swift`, {
236
+ const { data } = yield this.axios.post(`/api/payments/bank/init/swift`, {
295
237
  orderId,
296
238
  });
297
239
  return data;
@@ -299,7 +241,7 @@ class RioClient {
299
241
  }
300
242
  createInterbankPayment(orderId) {
301
243
  return __awaiter(this, void 0, void 0, function* () {
302
- const { data } = yield this.axios.post(`/api/payments/bank/interbank`, {
244
+ const { data } = yield this.axios.post(`/api/payments/bank/init/interbank`, {
303
245
  orderId,
304
246
  });
305
247
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.509",
3
+ "version": "1.0.511",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",