@riocrypto/common-server 1.0.1411 → 1.0.1414

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.
@@ -27,6 +27,7 @@ declare class ClusterClient {
27
27
  hasAuthenticatorEnabled: boolean;
28
28
  }>;
29
29
  verifyCode(phoneNumber: string, code?: string, authenticatorCode?: string): Promise<void>;
30
+ sendVerificationEmail(userId: string, country?: Country): Promise<void>;
30
31
  }
31
32
  export declare const buildClusterClient: () => Promise<ClusterClient>;
32
33
  export {};
@@ -217,6 +217,18 @@ class ClusterClient {
217
217
  });
218
218
  });
219
219
  }
220
+ sendVerificationEmail(userId, country) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ yield this.axios.post(`${this.baseUrl}/api/kyc/email`, {
223
+ userId,
224
+ country,
225
+ }, {
226
+ headers: {
227
+ "x-cluster-api-key": this.clusterApiKey,
228
+ },
229
+ });
230
+ });
231
+ }
220
232
  }
221
233
  const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
222
234
  // Retrieve secrets asynchronously
@@ -68,7 +68,7 @@ class InvopopClient {
68
68
  zone: ((_e = (_d = user.invoicing) === null || _d === void 0 ? void 0 : _d.MX) === null || _e === void 0 ? void 0 : _e.shouldInvoice)
69
69
  ? user.address.postalCode
70
70
  : "66260",
71
- code: ((_g = (_f = user.KYC) === null || _f === void 0 ? void 0 : _f.MX) === null || _g === void 0 ? void 0 : _g.taxId) || "XAXX010101000",
71
+ code: ((_g = (_f = user.onboarding) === null || _f === void 0 ? void 0 : _f.MX) === null || _g === void 0 ? void 0 : _g.taxId) || "XAXX010101000",
72
72
  },
73
73
  identities: [
74
74
  {
@@ -41,7 +41,7 @@ class KapstarClient {
41
41
  amount,
42
42
  name: (0, common_1.getUserName)(user),
43
43
  tags: [orderId],
44
- tax_id: (_b = (_a = user.KYC) === null || _a === void 0 ? void 0 : _a.BR) === null || _b === void 0 ? void 0 : _b.taxId,
44
+ tax_id: (_b = (_a = user.onboarding) === null || _a === void 0 ? void 0 : _a.BR) === null || _b === void 0 ? void 0 : _b.taxId,
45
45
  });
46
46
  return kapstarResponse.data;
47
47
  });
@@ -126,8 +126,8 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
126
126
  req.user = user;
127
127
  }
128
128
  else {
129
- if (((_f = (_e = user.onboarding) === null || _e === void 0 ? void 0 : _e.MX) === null || _f === void 0 ? void 0 : _f.status) === common_1.KYCStatus.Approved ||
130
- ((_h = (_g = user.onboarding) === null || _g === void 0 ? void 0 : _g.PE) === null || _h === void 0 ? void 0 : _h.status) === common_1.KYCStatus.Approved) {
129
+ if (((_f = (_e = user.onboarding) === null || _e === void 0 ? void 0 : _e.MX) === null || _f === void 0 ? void 0 : _f.status) === common_1.OnboardingStatus.Approved ||
130
+ ((_h = (_g = user.onboarding) === null || _g === void 0 ? void 0 : _g.PE) === null || _h === void 0 ? void 0 : _h.status) === common_1.OnboardingStatus.Approved) {
131
131
  req.user = user;
132
132
  }
133
133
  }
@@ -1,4 +1,4 @@
1
- import { Country, KYCStatus, Language, PlatformFeeRange, USState, UserAttribute, UserType, CountryOfOrigin, RiskTier } from "@riocrypto/common";
1
+ import { Country, OnboardingStatus, Language, PlatformFeeRange, USState, UserAttribute, UserType, CountryOfOrigin, RiskTier } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface UserAttrs {
4
4
  createdAt: Date;
@@ -35,7 +35,7 @@ interface UserAttrs {
35
35
  state: USState | string;
36
36
  postalCode: string;
37
37
  country: CountryOfOrigin;
38
- kycStatus: KYCStatus;
38
+ kycStatus: OnboardingStatus;
39
39
  hasPassedEDD: boolean;
40
40
  firstName?: string;
41
41
  middleName?: string;
@@ -92,7 +92,7 @@ interface UserAttrs {
92
92
  usKYCStatus?: "none" | "pending" | "failed" | "approved";
93
93
  onboarding?: {
94
94
  [country in CountryOfOrigin]?: {
95
- status?: KYCStatus;
95
+ status?: OnboardingStatus;
96
96
  personalId?: string;
97
97
  taxId?: string;
98
98
  isResident?: boolean;
@@ -173,7 +173,7 @@ interface UserDoc extends Document {
173
173
  state: USState | string;
174
174
  postalCode: string;
175
175
  country: CountryOfOrigin;
176
- kycStatus: KYCStatus;
176
+ kycStatus: OnboardingStatus;
177
177
  hasPassedEDD: boolean;
178
178
  firstName?: string;
179
179
  middleName?: string;
@@ -230,7 +230,7 @@ interface UserDoc extends Document {
230
230
  usKYCStatus?: "none" | "pending" | "failed" | "approved";
231
231
  onboarding?: {
232
232
  [country in CountryOfOrigin]?: {
233
- status?: KYCStatus;
233
+ status?: OnboardingStatus;
234
234
  personalId?: string;
235
235
  taxId?: string;
236
236
  isResident?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1411",
3
+ "version": "1.0.1414",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "@everapi/currencyapi-js": "^1.0.6",
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
- "@riocrypto/common": "^1.0.1241",
30
+ "@riocrypto/common": "^1.0.1248",
31
31
  "@types/express": "^4.17.13",
32
32
  "axios": "^0.27.2",
33
33
  "ccxt": "^3.0.30",