@riocrypto/common-server 1.0.673 → 1.0.676

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.
@@ -1,4 +1,4 @@
1
- import { BusinessUser, KapstarInvoiceResponse, User } from "@riocrypto/common";
1
+ import { KapstarInvoiceResponse, User } from "@riocrypto/common";
2
2
  import { Axios } from "axios";
3
3
  declare class KapstarClient {
4
4
  private userId;
@@ -6,7 +6,7 @@ declare class KapstarClient {
6
6
  axiosInstance: Axios;
7
7
  constructor(userId: string, apiKey: string);
8
8
  getBRLExchangeRateUSD(): Promise<number>;
9
- createInvoice(amount: number, orderId: string, user: User | BusinessUser): Promise<KapstarInvoiceResponse>;
9
+ createInvoice(amount: number, orderId: string, user: User): Promise<KapstarInvoiceResponse>;
10
10
  createPIXPayment(amount: number, pixKey: string): Promise<KapstarInvoiceResponse>;
11
11
  }
12
12
  export declare const buildKapstarClient: () => Promise<KapstarClient>;
@@ -1,12 +1,12 @@
1
- import { BusinessUser, Order, User } from "@riocrypto/common";
1
+ import { Order, User } from "@riocrypto/common";
2
2
  declare class KushkiClient {
3
3
  private privateMerchantId;
4
4
  private environment;
5
5
  private baseUrl;
6
6
  constructor(privateMerchantId: string, environment: "sandbox" | "production");
7
7
  createPaymentLink(order: Order, user: User, token: string): Promise<any>;
8
- createBankPaymentToken(order: Order, user: User | BusinessUser): Promise<any>;
9
- createBankPayment(order: Order, user: User | BusinessUser, token: string): Promise<any>;
8
+ createBankPaymentToken(order: Order, user: User): Promise<any>;
9
+ createBankPayment(order: Order, user: User, token: string): Promise<any>;
10
10
  }
11
11
  export declare const buildKushkiClient: () => Promise<KushkiClient>;
12
12
  export {};
@@ -1,14 +1,12 @@
1
- import { Admin, Auth, AuthUpdate, BankPayout, BusinessUser, BusinessUserInput, BusinessUserUpdate, CheckedAddress, Country, Fiat, Order, OrderInput, Partner, PaymentMethod, PayoutMethod, RioSettings, RioSettingsUpdate, SecurityQuestion, User, UserInput, UserUpdate } from "@riocrypto/common";
1
+ import { Admin, Auth, AuthUpdate, BankPayout, CheckedAddress, Country, Fiat, Order, OrderInput, Partner, PaymentMethod, PayoutMethod, RioSettings, RioSettingsUpdate, SecurityQuestion, User, UserInput, UserUpdate } from "@riocrypto/common";
2
2
  import { AxiosInstance, AxiosStatic } from "axios";
3
3
  export declare class RioClient {
4
4
  private axios;
5
5
  constructor(axios: AxiosStatic | AxiosInstance);
6
6
  getOrders(): Promise<Order[]>;
7
7
  getUsers(): Promise<User[]>;
8
- getBusinessUsers(): Promise<BusinessUser[]>;
9
8
  signin(email: string, password: string): Promise<any>;
10
9
  updateUser(update: UserUpdate, userId?: string): Promise<User>;
11
- updateBusinessUser(update: BusinessUserUpdate, businessUserId?: string): Promise<BusinessUser>;
12
10
  updateAdminUserPassword({ password, newPassword, }: {
13
11
  password: string;
14
12
  newPassword: string;
@@ -22,14 +20,12 @@ export declare class RioClient {
22
20
  updateRioSettings(update: RioSettingsUpdate): Promise<void>;
23
21
  confirmBankPayment(orderId: string): Promise<any>;
24
22
  getUser(): Promise<User>;
25
- getBusinessUser(): Promise<BusinessUser>;
26
23
  createUser(user: UserInput): Promise<void>;
27
- createBusinessUser(businessUser: BusinessUserInput): Promise<BusinessUser>;
28
- createBrokerCustomer(businessUser: BusinessUserInput): Promise<BusinessUser>;
24
+ createBrokerCustomer(userInput: UserInput): Promise<User>;
29
25
  sendPhoneAuthCode(phoneNumber: string): Promise<void>;
30
26
  authExists(phoneNumber: string): Promise<boolean>;
31
- uploadCOI(businessUserId: string, formData: FormData): Promise<BusinessUser>;
32
- uploadKYCReport(businessUserId: string, formData: FormData): Promise<BusinessUser>;
27
+ uploadCOI(businessUserId: string, formData: FormData): Promise<User>;
28
+ uploadKYCReport(businessUserId: string, formData: FormData): Promise<User>;
33
29
  getSecurityQuestion(): Promise<SecurityQuestion>;
34
30
  signout(): Promise<void>;
35
31
  verifyPhoneCode(phoneNumber: string, code: string): Promise<void>;
@@ -40,7 +36,6 @@ export declare class RioClient {
40
36
  getBankPayout(orderId: string): Promise<BankPayout>;
41
37
  checkAddress(address: string, crypto: Crypto): Promise<CheckedAddress>;
42
38
  getSupportedPaymentMethods(fiat: Fiat, country: Country): Promise<PaymentMethod[]>;
43
- getBrokerCustomers(): Promise<BusinessUser[]>;
44
39
  getSupportedPayoutMethods(fiat: Fiat, country: Country): Promise<PayoutMethod[]>;
45
40
  getPartnerLayout(partnerId: string): Promise<Partner>;
46
41
  createClipCardPayment(orderId: string): Promise<{
@@ -26,12 +26,6 @@ class RioClient {
26
26
  return data;
27
27
  });
28
28
  }
29
- getBusinessUsers() {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- const { data } = yield this.axios.get(`/api/business/users`);
32
- return data;
33
- });
34
- }
35
29
  signin(email, password) {
36
30
  return __awaiter(this, void 0, void 0, function* () {
37
31
  const { data } = yield this.axios.post(`/api/admin/signin`, {
@@ -47,12 +41,6 @@ class RioClient {
47
41
  return data;
48
42
  });
49
43
  }
50
- updateBusinessUser(update, businessUserId) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const { data } = yield this.axios.patch(`/api/business/users/${businessUserId}`, update);
53
- return data;
54
- });
55
- }
56
44
  updateAdminUserPassword({ password, newPassword, }) {
57
45
  return __awaiter(this, void 0, void 0, function* () {
58
46
  const { data } = yield this.axios.patch(`/api/admin`, {
@@ -104,26 +92,14 @@ class RioClient {
104
92
  return data;
105
93
  });
106
94
  }
107
- getBusinessUser() {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- const { data } = yield this.axios.get("/api/business/users/current");
110
- return data;
111
- });
112
- }
113
95
  createUser(user) {
114
96
  return __awaiter(this, void 0, void 0, function* () {
115
97
  yield this.axios.post("/api/users/current-auth", user);
116
98
  });
117
99
  }
118
- createBusinessUser(businessUser) {
119
- 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) {
100
+ createBrokerCustomer(userInput) {
125
101
  return __awaiter(this, void 0, void 0, function* () {
126
- const response = yield this.axios.post("/api/business/users/broker-customers/current-auth", businessUser);
102
+ const response = yield this.axios.post("/api/users/broker-customers/current-auth", userInput);
127
103
  return response.data;
128
104
  });
129
105
  }
@@ -222,12 +198,6 @@ class RioClient {
222
198
  return response.data;
223
199
  });
224
200
  }
225
- getBrokerCustomers() {
226
- return __awaiter(this, void 0, void 0, function* () {
227
- const response = yield this.axios.get(`/api/business/users/broker-customers`);
228
- return response.data;
229
- });
230
- }
231
201
  getSupportedPayoutMethods(fiat, country) {
232
202
  return __awaiter(this, void 0, void 0, function* () {
233
203
  const response = yield this.axios.get(`/api/payout-methods/supported?fiat=${fiat}&country=${country}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.673",
3
+ "version": "1.0.676",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@everapi/currencyapi-js": "^1.0.6",
26
26
  "@google-cloud/storage": "^6.9.5",
27
- "@riocrypto/common": "^1.0.609",
27
+ "@riocrypto/common": "^1.0.617",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",