@riocrypto/common 1.0.1317 → 1.0.1320

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.
@@ -128,10 +128,8 @@ export declare class RioAdminClient {
128
128
  sendPhoneAuthCode(phoneNumber: string): Promise<{
129
129
  hasAuthenticatorEnabled: boolean;
130
130
  }>;
131
- getAuth(phoneNumber?: string): Promise<{
132
- auth: Auth;
133
- missing: string[];
134
- }>;
131
+ getAuth(id: string): Promise<Auth>;
132
+ getAuths(): Promise<Auth[]>;
135
133
  authHasSecurityQuestion(): Promise<Boolean>;
136
134
  createBridgePlaidLink(userId: string): Promise<string>;
137
135
  refreshAdminToken(): Promise<void>;
@@ -214,6 +212,6 @@ export declare class RioAdminClient {
214
212
  addAuthorizedPhoneNumber(phoneNumber: string): Promise<User>;
215
213
  deleteAuthorizedPhoneNumber(phoneNumber: string): Promise<User>;
216
214
  createKushkiBankPayment(orderId: string): Promise<any>;
217
- updateAuth(update: AuthUpdate, id?: string): Promise<Auth>;
215
+ updateAuth(update: AuthUpdate, id: string): Promise<Auth>;
218
216
  getInvoice(orderId: string): Promise<Invoice>;
219
217
  }
@@ -394,9 +394,15 @@ class RioAdminClient {
394
394
  return response.data;
395
395
  });
396
396
  }
397
- getAuth(phoneNumber) {
397
+ getAuth(id) {
398
398
  return __awaiter(this, void 0, void 0, function* () {
399
- const response = yield this.axios.get(`/api/auth?${phoneNumber ? "phoneNumber=" + phoneNumber : ""}`);
399
+ const response = yield this.axios.get(`/api/auth/${id}`);
400
+ return response.data;
401
+ });
402
+ }
403
+ getAuths() {
404
+ return __awaiter(this, void 0, void 0, function* () {
405
+ const response = yield this.axios.get(`/api/auth`);
400
406
  return response.data;
401
407
  });
402
408
  }
@@ -721,7 +727,7 @@ class RioAdminClient {
721
727
  }
722
728
  updateAuth(update, id) {
723
729
  return __awaiter(this, void 0, void 0, function* () {
724
- const { data } = yield this.axios.patch(`/api/auth/${id || ""}`, update);
730
+ const { data } = yield this.axios.patch(`/api/auth/${id}`, update);
725
731
  return data;
726
732
  });
727
733
  }
@@ -88,7 +88,8 @@ export declare class RioClient {
88
88
  sendPhoneAuthCode(phoneNumber: string): Promise<{
89
89
  hasAuthenticatorEnabled: boolean;
90
90
  }>;
91
- getAuth(phoneNumber?: string): Promise<Auth>;
91
+ getAuth(id: string): Promise<Auth>;
92
+ getAuths(): Promise<Auth[]>;
92
93
  getSecurityQuestion(): Promise<SecurityQuestion>;
93
94
  authHasSecurityQuestion(): Promise<Boolean>;
94
95
  signout(): Promise<void>;
@@ -163,7 +164,7 @@ export declare class RioClient {
163
164
  addAuthorizedPhoneNumber(phoneNumber: string): Promise<User>;
164
165
  deleteAuthorizedPhoneNumber(phoneNumber: string): Promise<User>;
165
166
  createKushkiBankPayment(orderId: string): Promise<any>;
166
- updateAuth(update: AuthUpdate, id?: string): Promise<Auth>;
167
+ updateAuth(update: AuthUpdate, id: string): Promise<Auth>;
167
168
  getInvoice(orderId: string): Promise<Invoice>;
168
169
  getCryptoBalance(asset: Crypto, userId?: string): Promise<number>;
169
170
  }
@@ -281,9 +281,15 @@ class RioClient {
281
281
  return response.data;
282
282
  });
283
283
  }
284
- getAuth(phoneNumber) {
284
+ getAuth(id) {
285
285
  return __awaiter(this, void 0, void 0, function* () {
286
- const response = yield this.axios.get(`/api/auth?${phoneNumber ? "phoneNumber=" + phoneNumber : ""}`);
286
+ const response = yield this.axios.get(`/api/auth/${id}`);
287
+ return response.data;
288
+ });
289
+ }
290
+ getAuths() {
291
+ return __awaiter(this, void 0, void 0, function* () {
292
+ const response = yield this.axios.get(`/api/auth`);
287
293
  return response.data;
288
294
  });
289
295
  }
@@ -578,7 +584,7 @@ class RioClient {
578
584
  }
579
585
  updateAuth(update, id) {
580
586
  return __awaiter(this, void 0, void 0, function* () {
581
- const { data } = yield this.axios.patch(`/api/auth/${id || ""}`, update);
587
+ const { data } = yield this.axios.patch(`/api/auth/${id}`, update);
582
588
  return data;
583
589
  });
584
590
  }
package/build/index.d.ts CHANGED
@@ -215,6 +215,7 @@ export * from "./types/IdentityVerificationType";
215
215
  export * from "./types/KYC";
216
216
  export * from "./types/bid";
217
217
  export * from "./types/bid-status";
218
+ export * from "./types/auth-role";
218
219
  export * from "./classes/Asset";
219
220
  export * from "./classes/KYCFieldClass";
220
221
  export * from "./classes/KYCFileClass";
package/build/index.js CHANGED
@@ -231,6 +231,7 @@ __exportStar(require("./types/IdentityVerificationType"), exports);
231
231
  __exportStar(require("./types/KYC"), exports);
232
232
  __exportStar(require("./types/bid"), exports);
233
233
  __exportStar(require("./types/bid-status"), exports);
234
+ __exportStar(require("./types/auth-role"), exports);
234
235
  __exportStar(require("./classes/Asset"), exports);
235
236
  __exportStar(require("./classes/KYCFieldClass"), exports);
236
237
  __exportStar(require("./classes/KYCFileClass"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum AuthRole {
2
+ Owner = "owner",
3
+ Write = "write",
4
+ Read = "read"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthRole = void 0;
4
+ var AuthRole;
5
+ (function (AuthRole) {
6
+ AuthRole["Owner"] = "owner";
7
+ AuthRole["Write"] = "write";
8
+ AuthRole["Read"] = "read";
9
+ })(AuthRole = exports.AuthRole || (exports.AuthRole = {}));
@@ -1,7 +1,13 @@
1
+ import { AuthRole } from "./auth-role";
1
2
  import { SecurityQuestion } from "./security-question";
2
3
  export interface AuthUpdate {
3
4
  phoneNumber?: string;
4
5
  password?: string;
5
6
  securityQuestion?: SecurityQuestion;
6
7
  securityAnswer?: string;
8
+ firstName?: string;
9
+ middleName?: string;
10
+ lastName?: string;
11
+ secondLastName?: string;
12
+ role?: AuthRole;
7
13
  }
@@ -1,4 +1,5 @@
1
1
  import { APIKey } from "./api-key";
2
+ import { AuthRole } from "./auth-role";
2
3
  import { SecurityQuestion } from "./security-question";
3
4
  export interface Auth {
4
5
  id: string;
@@ -17,4 +18,9 @@ export interface Auth {
17
18
  username?: string;
18
19
  lastVerified?: Date;
19
20
  };
21
+ firstName?: string;
22
+ middleName?: string;
23
+ lastName?: string;
24
+ secondLastName?: string;
25
+ role: AuthRole;
20
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1317",
3
+ "version": "1.0.1320",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",