@riocrypto/common 1.0.1296 → 1.0.1298

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.
@@ -41,6 +41,7 @@ import { UserType } from "../types/user-type";
41
41
  import { UBOInput } from "../types/UBO-input";
42
42
  import { UBO } from "../types/UBO";
43
43
  import { UBOUpdate } from "../types/UBO-update";
44
+ import { IdentityVerificationType } from "../types/IdentityVerificationType";
44
45
  export declare class RioAdminClient {
45
46
  private axios;
46
47
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -75,8 +76,7 @@ export declare class RioAdminClient {
75
76
  uploadCSF(id: string, formData: FormData): Promise<User>;
76
77
  uploadProofOfAddress(id: string, formData: FormData): Promise<User>;
77
78
  createVerificationLink(userId: string, firstName: string, lastName: string): Promise<string>;
78
- sendVerificationEmail(userId: string, country: Country): Promise<void>;
79
- sendUBOVerificationEmail(uboId: string, country: Country): Promise<void>;
79
+ sendVerificationEmail(type: IdentityVerificationType, id: string, country: Country): Promise<void>;
80
80
  sendBridgeOnboardingEmail(userId: string): Promise<void>;
81
81
  createUBO(user: UBOInput): Promise<UBO>;
82
82
  updateAdmin(update: {
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RioAdminClient = void 0;
13
+ const IdentityVerificationType_1 = require("../types/IdentityVerificationType");
13
14
  class RioAdminClient {
14
15
  constructor(axios) {
15
16
  this.axios = axios;
@@ -187,18 +188,15 @@ class RioAdminClient {
187
188
  return data.link;
188
189
  });
189
190
  }
190
- sendVerificationEmail(userId, country) {
191
+ sendVerificationEmail(type, id, country) {
191
192
  return __awaiter(this, void 0, void 0, function* () {
192
193
  yield this.axios.post("/api/kyc/email", {
193
- userId,
194
- country,
195
- });
196
- });
197
- }
198
- sendUBOVerificationEmail(uboId, country) {
199
- return __awaiter(this, void 0, void 0, function* () {
200
- yield this.axios.post("/api/kyc/email/ubo", {
201
- uboId,
194
+ type,
195
+ userId: type === IdentityVerificationType_1.IdentityVerificationType.user ||
196
+ type === IdentityVerificationType_1.IdentityVerificationType.legalRepresentative
197
+ ? id
198
+ : undefined,
199
+ uboId: type === IdentityVerificationType_1.IdentityVerificationType.UBO ? id : undefined,
202
200
  country,
203
201
  });
204
202
  });
@@ -37,6 +37,7 @@ import { UserType } from "../types/user-type";
37
37
  import { UBOInput } from "../types/UBO-input";
38
38
  import { UBO } from "../types/UBO";
39
39
  import { UBOUpdate } from "../types/UBO-update";
40
+ import { IdentityVerificationType } from "../types/IdentityVerificationType";
40
41
  export declare class RioClient {
41
42
  private axios;
42
43
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -54,8 +55,7 @@ export declare class RioClient {
54
55
  uploadKYCReport(id: string, formData: FormData): Promise<User>;
55
56
  uploadCSF(id: string, formData: FormData): Promise<User>;
56
57
  getRioSettings(): Promise<RioSettings>;
57
- sendVerificationEmail(userId: string, country: Country): Promise<void>;
58
- sendUBOVerificationEmail(uboId: string, country: Country): Promise<void>;
58
+ sendVerificationEmail(type: IdentityVerificationType, id: string, country: Country): Promise<void>;
59
59
  sendUBOOnboardingEmail(email: string, associatedUserId: string, country: Country): Promise<void>;
60
60
  sendBridgeOnboardingEmail(userId: string): Promise<void>;
61
61
  getOnboardingRequirements(userType: UserType, country: Country, countryOfOrigin: CountryOfOrigin): Promise<{
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RioClient = void 0;
13
+ const IdentityVerificationType_1 = require("../types/IdentityVerificationType");
13
14
  class RioClient {
14
15
  constructor(axios) {
15
16
  this.axios = axios;
@@ -123,18 +124,15 @@ class RioClient {
123
124
  return data;
124
125
  });
125
126
  }
126
- sendVerificationEmail(userId, country) {
127
+ sendVerificationEmail(type, id, country) {
127
128
  return __awaiter(this, void 0, void 0, function* () {
128
129
  yield this.axios.post("/api/kyc/email", {
129
- userId,
130
- country,
131
- });
132
- });
133
- }
134
- sendUBOVerificationEmail(uboId, country) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- yield this.axios.post("/api/kyc/email/ubo", {
137
- uboId,
130
+ type,
131
+ userId: type === IdentityVerificationType_1.IdentityVerificationType.user ||
132
+ type === IdentityVerificationType_1.IdentityVerificationType.legalRepresentative
133
+ ? id
134
+ : undefined,
135
+ uboId: type === IdentityVerificationType_1.IdentityVerificationType.UBO ? id : undefined,
138
136
  country,
139
137
  });
140
138
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1296",
3
+ "version": "1.0.1298",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",