@riocrypto/common-server 1.0.752 → 1.0.753
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.
|
@@ -2,6 +2,8 @@ declare class AiPriseClient {
|
|
|
2
2
|
private apiKey;
|
|
3
3
|
constructor(apiKey: string);
|
|
4
4
|
createVerificationLink(userId: string, firstName: string, lastName: string): Promise<string>;
|
|
5
|
+
private getCallbackUrl;
|
|
6
|
+
private getRedirectUrl;
|
|
5
7
|
}
|
|
6
8
|
export declare const buildAiPriseClient: () => Promise<AiPriseClient>;
|
|
7
9
|
export {};
|
|
@@ -15,22 +15,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.buildAiPriseClient = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const secret_manager_client_1 = require("./secret-manager-client");
|
|
18
|
+
const common_1 = require("@riocrypto/common");
|
|
18
19
|
class AiPriseClient {
|
|
19
20
|
constructor(apiKey) {
|
|
20
21
|
this.apiKey = apiKey;
|
|
22
|
+
this.getCallbackUrl = (rioEnv) => {
|
|
23
|
+
switch (rioEnv) {
|
|
24
|
+
case common_1.RioEnv.Development:
|
|
25
|
+
return "https://dev.riocrypto.com/api/kyc/notifications/aiprise";
|
|
26
|
+
case common_1.RioEnv.Sandbox:
|
|
27
|
+
return "https://sandbox.riocrypto.com/api/kyc/notifications/aiprise";
|
|
28
|
+
case common_1.RioEnv.Staging:
|
|
29
|
+
return "https://staging.riocrypto.com/api/kyc/notifications/aiprise";
|
|
30
|
+
case common_1.RioEnv.Production:
|
|
31
|
+
return "https://www.riocrypto.com/api/kyc/notifications/aiprise";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.getRedirectUrl = (rioEnv) => {
|
|
35
|
+
switch (rioEnv) {
|
|
36
|
+
case common_1.RioEnv.Development:
|
|
37
|
+
return "https://dev.riotransfer.co";
|
|
38
|
+
case common_1.RioEnv.Sandbox:
|
|
39
|
+
return "https://sandbox.riotransfer.co";
|
|
40
|
+
case common_1.RioEnv.Staging:
|
|
41
|
+
return "https://staging.riotransfer.co";
|
|
42
|
+
case common_1.RioEnv.Production:
|
|
43
|
+
return "https://www.riotransfer.co";
|
|
44
|
+
}
|
|
45
|
+
};
|
|
21
46
|
}
|
|
22
47
|
createVerificationLink(userId, firstName, lastName) {
|
|
23
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
console.log(this.getRedirectUrl(process.env.RIO_ENV));
|
|
50
|
+
console.log(this.getCallbackUrl(process.env.RIO_ENV));
|
|
24
51
|
const response = yield axios_1.default.post("https://api.aiprise.com/api/v1/verify/get_user_verification_url", {
|
|
25
52
|
template_id: "15cd1203-5c60-470b-8cbc-4d806433c7b7",
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
client_reference_id: userId,
|
|
54
|
+
user_data: {
|
|
28
55
|
first_name: firstName,
|
|
29
56
|
last_name: lastName,
|
|
30
57
|
},
|
|
58
|
+
redirect_uri: this.getRedirectUrl(process.env.RIO_ENV),
|
|
59
|
+
callback_url: this.getCallbackUrl(process.env.RIO_ENV),
|
|
31
60
|
}, {
|
|
32
61
|
headers: {
|
|
33
|
-
"
|
|
62
|
+
"X-API-KEY": this.apiKey,
|
|
34
63
|
},
|
|
35
64
|
});
|
|
36
65
|
return response.data.verification_url;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.753",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.670",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|