@riocrypto/common-server 1.0.1408 → 1.0.1411
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,7 +3,7 @@ declare class AiPriseClient {
|
|
|
3
3
|
private decafApiKey;
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
constructor(apiKey: string, decafApiKey: string);
|
|
6
|
-
createVerificationLink(userId: string, firstName: string, lastName: string): Promise<string>;
|
|
6
|
+
createVerificationLink(userId: string, firstName: string, lastName: string, metadata?: Object): Promise<string>;
|
|
7
7
|
getVerificationResult(sessionId: string, partner?: "decaf"): Promise<any>;
|
|
8
8
|
private getCallbackUrl;
|
|
9
9
|
private getRedirectUrl;
|
|
@@ -52,7 +52,7 @@ class AiPriseClient {
|
|
|
52
52
|
? "api"
|
|
53
53
|
: "api-sandbox";
|
|
54
54
|
}
|
|
55
|
-
createVerificationLink(userId, firstName, lastName) {
|
|
55
|
+
createVerificationLink(userId, firstName, lastName, metadata) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
const response = yield axios_1.default.post(`https://${this.baseUrl}.aiprise.com/api/v1/verify/get_user_verification_url`, {
|
|
58
58
|
template_id: "15cd1203-5c60-470b-8cbc-4d806433c7b7",
|
|
@@ -63,6 +63,7 @@ class AiPriseClient {
|
|
|
63
63
|
},
|
|
64
64
|
redirect_uri: this.getRedirectUrl(process.env.RIO_ENV),
|
|
65
65
|
callback_url: this.getCallbackUrl(process.env.RIO_ENV),
|
|
66
|
+
client_reference_data: metadata,
|
|
66
67
|
}, {
|
|
67
68
|
headers: {
|
|
68
69
|
"X-API-KEY": this.apiKey,
|
|
@@ -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.
|
|
130
|
-
((_h = (_g = user.
|
|
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) {
|
|
131
131
|
req.user = user;
|
|
132
132
|
}
|
|
133
133
|
}
|
package/build/models/user.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ interface UserAttrs {
|
|
|
90
90
|
mexicoFiscalName?: string;
|
|
91
91
|
taxId?: string;
|
|
92
92
|
usKYCStatus?: "none" | "pending" | "failed" | "approved";
|
|
93
|
-
|
|
93
|
+
onboarding?: {
|
|
94
94
|
[country in CountryOfOrigin]?: {
|
|
95
95
|
status?: KYCStatus;
|
|
96
96
|
personalId?: string;
|
|
@@ -228,7 +228,7 @@ interface UserDoc extends Document {
|
|
|
228
228
|
mexicoFiscalName?: string;
|
|
229
229
|
taxId?: string;
|
|
230
230
|
usKYCStatus?: "none" | "pending" | "failed" | "approved";
|
|
231
|
-
|
|
231
|
+
onboarding?: {
|
|
232
232
|
[country in CountryOfOrigin]?: {
|
|
233
233
|
status?: KYCStatus;
|
|
234
234
|
personalId?: string;
|
package/build/models/user.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1411",
|
|
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.
|
|
30
|
+
"@riocrypto/common": "^1.0.1241",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|