@riocrypto/common-server 1.0.1413 → 1.0.1415
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
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { OnboardingStatus, CountryOfOrigin } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface UBOAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
individualData?: {
|
|
6
|
+
firstName: string;
|
|
7
|
+
middleName?: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
secondLastName?: string;
|
|
10
|
+
birthday: Date;
|
|
11
|
+
countryOfOrigin: CountryOfOrigin;
|
|
12
|
+
};
|
|
13
|
+
phoneNumber: string;
|
|
14
|
+
email: string;
|
|
15
|
+
birthday?: Date;
|
|
16
|
+
associatedUserId?: string;
|
|
17
|
+
onboarding?: {
|
|
18
|
+
[country in CountryOfOrigin]?: {
|
|
19
|
+
status?: OnboardingStatus;
|
|
20
|
+
personalId?: string;
|
|
21
|
+
taxId?: string;
|
|
22
|
+
isResident?: boolean;
|
|
23
|
+
individualIdentityVerification?: {
|
|
24
|
+
status?: "passed" | "failed" | "review";
|
|
25
|
+
};
|
|
26
|
+
files?: {
|
|
27
|
+
certificateOfIncorporation?: string;
|
|
28
|
+
KYCReport?: string;
|
|
29
|
+
taxTranscript?: string;
|
|
30
|
+
proofOfAddress?: string;
|
|
31
|
+
businessRegistration?: string;
|
|
32
|
+
taxIdentificationCertificate?: string;
|
|
33
|
+
legalRepresentativeIdPowerOfAttorney?: string;
|
|
34
|
+
personalIdentificationCertificate?: string;
|
|
35
|
+
extraFiles?: string[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
address: {
|
|
40
|
+
street1: string;
|
|
41
|
+
street2?: string;
|
|
42
|
+
city: string;
|
|
43
|
+
state: string;
|
|
44
|
+
postalCode: string;
|
|
45
|
+
country: CountryOfOrigin;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface UBOModel extends Model<UBODoc> {
|
|
49
|
+
build(attrs: UBOAttrs): UBODoc;
|
|
50
|
+
}
|
|
51
|
+
interface UBODoc extends Document {
|
|
52
|
+
_id: string;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
individualData?: {
|
|
55
|
+
firstName: string;
|
|
56
|
+
middleName?: string;
|
|
57
|
+
lastName: string;
|
|
58
|
+
secondLastName?: string;
|
|
59
|
+
birthday: Date;
|
|
60
|
+
countryOfOrigin: CountryOfOrigin;
|
|
61
|
+
};
|
|
62
|
+
phoneNumber: string;
|
|
63
|
+
email: string;
|
|
64
|
+
birthday?: Date;
|
|
65
|
+
associatedUserId?: string;
|
|
66
|
+
onboarding?: {
|
|
67
|
+
[country in CountryOfOrigin]?: {
|
|
68
|
+
status?: OnboardingStatus;
|
|
69
|
+
personalId?: string;
|
|
70
|
+
taxId?: string;
|
|
71
|
+
isResident?: boolean;
|
|
72
|
+
individualIdentityVerification?: {
|
|
73
|
+
status?: "passed" | "failed" | "review";
|
|
74
|
+
};
|
|
75
|
+
files?: {
|
|
76
|
+
certificateOfIncorporation?: string;
|
|
77
|
+
KYCReport?: string;
|
|
78
|
+
taxTranscript?: string;
|
|
79
|
+
proofOfAddress?: string;
|
|
80
|
+
businessRegistration?: string;
|
|
81
|
+
taxIdentificationCertificate?: string;
|
|
82
|
+
legalRepresentativeIdPowerOfAttorney?: string;
|
|
83
|
+
personalIdentificationCertificate?: string;
|
|
84
|
+
extraFiles?: string[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
address: {
|
|
89
|
+
street1: string;
|
|
90
|
+
street2?: string;
|
|
91
|
+
city: string;
|
|
92
|
+
state: string;
|
|
93
|
+
postalCode: string;
|
|
94
|
+
country: CountryOfOrigin;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
declare const buildUBO: (mongoose: Mongoose) => UBOModel;
|
|
98
|
+
export { buildUBO, UBODoc };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildUBO = void 0;
|
|
4
|
+
const buildUBO = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.UBO) {
|
|
7
|
+
return mongoose.model("UBO");
|
|
8
|
+
}
|
|
9
|
+
const UBOSchema = new mongoose.Schema({
|
|
10
|
+
createdAt: {
|
|
11
|
+
type: mongoose.Schema.Types.Date,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
individualData: {
|
|
15
|
+
type: mongoose.Schema.Types.Mixed,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
phoneNumber: {
|
|
19
|
+
type: mongoose.Schema.Types.String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
email: {
|
|
23
|
+
type: mongoose.Schema.Types.String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
birthday: {
|
|
27
|
+
type: mongoose.Schema.Types.Date,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
associatedUserId: {
|
|
31
|
+
type: mongoose.Schema.Types.String,
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
onboarding: {
|
|
35
|
+
type: mongoose.Schema.Types.Mixed,
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
address: {
|
|
39
|
+
type: mongoose.Schema.Types.Mixed,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
}, {
|
|
43
|
+
toJSON: {
|
|
44
|
+
transform(doc, ret) {
|
|
45
|
+
ret.id = ret._id.valueOf();
|
|
46
|
+
delete ret._id;
|
|
47
|
+
delete ret.__v;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
UBOSchema.statics.build = (attrs) => {
|
|
52
|
+
return new UBO(attrs);
|
|
53
|
+
};
|
|
54
|
+
const UBO = mongoose.model("UBO", UBOSchema);
|
|
55
|
+
return UBO;
|
|
56
|
+
};
|
|
57
|
+
exports.buildUBO = buildUBO;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1415",
|
|
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.1250",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|