@riocrypto/common 1.0.609 → 1.0.613

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.
@@ -3,9 +3,6 @@ import { Admin } from "../types/admin";
3
3
  import { Auth } from "../types/auth";
4
4
  import { AuthUpdate } from "../types/auth-update";
5
5
  import { BankPayout } from "../types/bank-payout";
6
- import { BusinessUser } from "../types/business-user";
7
- import { BusinessUserInput } from "../types/business-user-input";
8
- import { BusinessUserUpdate } from "../types/business-user-update";
9
6
  import { CheckedAddress } from "../types/checked-address";
10
7
  import { Country } from "../types/country";
11
8
  import { Fiat } from "../types/fiat";
@@ -26,12 +23,10 @@ export declare class RioClient {
26
23
  constructor(axios: AxiosStatic | AxiosInstance);
27
24
  getOrders(): Promise<Order[]>;
28
25
  getUsers(): Promise<User[]>;
29
- getBusinessUsers(brokerId?: string): Promise<BusinessUser[]>;
30
26
  signinAdmin(email: string, password: string): Promise<any>;
31
27
  updateUser(update: UserUpdate, userId?: string): Promise<User>;
32
- uploadBusinessCOI(id: string, formData: FormData): Promise<BusinessUser>;
33
- uploadBusinessKYCReport(id: string, formData: FormData): Promise<BusinessUser>;
34
- updateBusinessUser(update: BusinessUserUpdate, businessUserId?: string): Promise<BusinessUser>;
28
+ uploadBusinessCOI(id: string, formData: FormData): Promise<User>;
29
+ uploadBusinessKYCReport(id: string, formData: FormData): Promise<User>;
35
30
  updateAdmin(update: {
36
31
  email?: string;
37
32
  password?: string;
@@ -47,11 +42,9 @@ export declare class RioClient {
47
42
  confirmBankPayment(orderId: string, amountFiat?: number): Promise<any>;
48
43
  confirmBankPayout(orderId: string): Promise<any>;
49
44
  getUser(): Promise<User>;
50
- getBusinessUser(): Promise<BusinessUser>;
51
45
  createUser(user: UserInput): Promise<void>;
52
46
  getBankPayment(orderId: string): Promise<BankPayment>;
53
47
  verifyBankPayment(orderId: string): Promise<any>;
54
- createBusinessUser(businessUser: BusinessUserInput): Promise<BusinessUser>;
55
48
  sendPhoneAuthCode(phoneNumber: string): Promise<void>;
56
49
  getAuth(phoneNumber?: string): Promise<{
57
50
  auth: Auth;
@@ -26,12 +26,6 @@ class RioClient {
26
26
  return data;
27
27
  });
28
28
  }
29
- getBusinessUsers(brokerId) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- const { data } = yield this.axios.get(`/api/business/users${brokerId ? `?brokerId=${brokerId}` : ""}`);
32
- return data;
33
- });
34
- }
35
29
  signinAdmin(email, password) {
36
30
  return __awaiter(this, void 0, void 0, function* () {
37
31
  const { data } = yield this.axios.post(`/api/auth/admin/signin`, {
@@ -49,19 +43,13 @@ class RioClient {
49
43
  }
50
44
  uploadBusinessCOI(id, formData) {
51
45
  return __awaiter(this, void 0, void 0, function* () {
52
- const { data } = yield this.axios.post(`/api/business/users/${id}/coi`, formData);
46
+ const { data } = yield this.axios.post(`/api/users/${id}/coi`, formData);
53
47
  return data;
54
48
  });
55
49
  }
56
50
  uploadBusinessKYCReport(id, formData) {
57
51
  return __awaiter(this, void 0, void 0, function* () {
58
- const { data } = yield this.axios.post(`/api/business/users/${id}/kyc-report`, formData);
59
- return data;
60
- });
61
- }
62
- updateBusinessUser(update, businessUserId) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const { data } = yield this.axios.patch(`/api/business/users/${businessUserId || ""}`, update);
52
+ const { data } = yield this.axios.post(`/api/users/${id}/kyc-report`, formData);
65
53
  return data;
66
54
  });
67
55
  }
@@ -122,12 +110,6 @@ class RioClient {
122
110
  return data;
123
111
  });
124
112
  }
125
- getBusinessUser() {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- const { data } = yield this.axios.get("/api/business/users");
128
- return data;
129
- });
130
- }
131
113
  createUser(user) {
132
114
  return __awaiter(this, void 0, void 0, function* () {
133
115
  yield this.axios.post("/api/users", user);
@@ -146,12 +128,6 @@ class RioClient {
146
128
  });
147
129
  });
148
130
  }
149
- createBusinessUser(businessUser) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- const response = yield this.axios.post("/api/business/users", businessUser);
152
- return response.data;
153
- });
154
- }
155
131
  sendPhoneAuthCode(phoneNumber) {
156
132
  return __awaiter(this, void 0, void 0, function* () {
157
133
  yield this.axios.post("/api/auth/phone/send", {
@@ -1,3 +1,3 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { BusinessUser } from "../types/business-user";
3
- export declare const getUserFromClientHelper: (client: AxiosInstance, includeDeleted?: boolean) => Promise<BusinessUser | null>;
2
+ import { User } from "../types/user";
3
+ export declare const getUserFromClientHelper: (client: AxiosInstance, includeDeleted?: boolean) => Promise<User | null>;
@@ -14,21 +14,13 @@ const rio_client_1 = require("../clients/rio-client");
14
14
  const user_attribute_1 = require("../types/user-attribute");
15
15
  const getUserFromClientHelper = (client, includeDeleted) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  var _a;
17
- let individualUser;
18
- let businessUser;
17
+ let user;
19
18
  try {
20
- individualUser = yield new rio_client_1.RioClient(client).getUser();
19
+ user = yield new rio_client_1.RioClient(client).getUser();
21
20
  }
22
21
  catch (error) {
23
- individualUser = null;
22
+ user = null;
24
23
  }
25
- try {
26
- businessUser = yield new rio_client_1.RioClient(client).getBusinessUser();
27
- }
28
- catch (error) {
29
- businessUser = null;
30
- }
31
- const user = individualUser || businessUser;
32
24
  if (includeDeleted) {
33
25
  return user;
34
26
  }
package/build/index.d.ts CHANGED
@@ -117,9 +117,6 @@ export * from "./types/rio-env";
117
117
  export * from "./types/bank-payout";
118
118
  export * from "./types/checked-address";
119
119
  export * from "./types/address-check-result";
120
- export * from "./types/business-user";
121
- export * from "./types/business-user-input";
122
- export * from "./types/business-user-update";
123
120
  export * from "./types/user-type";
124
121
  export * from "./types/platform-fee-range";
125
122
  export * from "./types/api-key";
package/build/index.js CHANGED
@@ -133,9 +133,6 @@ __exportStar(require("./types/rio-env"), exports);
133
133
  __exportStar(require("./types/bank-payout"), exports);
134
134
  __exportStar(require("./types/checked-address"), exports);
135
135
  __exportStar(require("./types/address-check-result"), exports);
136
- __exportStar(require("./types/business-user"), exports);
137
- __exportStar(require("./types/business-user-input"), exports);
138
- __exportStar(require("./types/business-user-update"), exports);
139
136
  __exportStar(require("./types/user-type"), exports);
140
137
  __exportStar(require("./types/platform-fee-range"), exports);
141
138
  __exportStar(require("./types/api-key"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.609",
3
+ "version": "1.0.613",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,27 +0,0 @@
1
- import { Country } from "./country";
2
- import { KYCStatus } from "./kyc-status";
3
- import { Language } from "./language";
4
- import { PlatformFeeRange } from "./platform-fee-range";
5
- import { USState } from "./us-state";
6
- import { UserAttribute } from "./user-attribute";
7
- export interface BusinessUserInput {
8
- authIds?: string[];
9
- companyName: string;
10
- legalRepresentative: string;
11
- phoneNumber?: string;
12
- email: string;
13
- street1: string;
14
- street2?: string;
15
- city: string;
16
- state: USState | string;
17
- postalCode: string;
18
- country: Country;
19
- language: Language;
20
- cpf?: string;
21
- kycStatus?: KYCStatus;
22
- COIFile?: string;
23
- KYCReportFile?: string;
24
- attributes?: UserAttribute[];
25
- brokerId?: string;
26
- platformFeeRanges?: PlatformFeeRange[];
27
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,26 +0,0 @@
1
- import { Country } from "./country";
2
- import { KYCStatus } from "./kyc-status";
3
- import { Language } from "./language";
4
- import { PlatformFeeRange } from "./platform-fee-range";
5
- import { UserAttribute } from "./user-attribute";
6
- export interface BusinessUserUpdate {
7
- authIds?: string[];
8
- companyName?: string;
9
- legalRepresentative?: string;
10
- phoneNumber?: string;
11
- email?: string;
12
- street1?: string;
13
- street2?: string;
14
- city?: string;
15
- state?: string;
16
- postalCode?: string;
17
- cpf?: string;
18
- country?: Country;
19
- kycStatus?: KYCStatus;
20
- language?: Language;
21
- COIFile?: string;
22
- KYCReportFile?: string;
23
- attributes?: UserAttribute[];
24
- brokerId?: string;
25
- platformFeeRanges?: PlatformFeeRange[];
26
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,30 +0,0 @@
1
- import { Country } from "./country";
2
- import { KYCStatus } from "./kyc-status";
3
- import { Language } from "./language";
4
- import { PlatformFeeRange } from "./platform-fee-range";
5
- import { USState } from "./us-state";
6
- import { UserAttribute } from "./user-attribute";
7
- import { UserType } from "./user-type";
8
- export interface BusinessUser {
9
- id: string;
10
- authIds?: string[];
11
- type: UserType;
12
- companyName: string;
13
- legalRepresentative: string;
14
- phoneNumber: string;
15
- email: string;
16
- street1: string;
17
- street2?: string;
18
- city: string;
19
- state: USState | string;
20
- postalCode: string;
21
- country: Country;
22
- kycStatus: KYCStatus;
23
- cpf?: string;
24
- language?: Language;
25
- COIFile?: string;
26
- KYCReportFile?: string;
27
- attributes?: UserAttribute[];
28
- brokerId?: string;
29
- platformFeeRanges?: PlatformFeeRange[];
30
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });