@riocrypto/common-server 1.0.2362 → 1.0.2364
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.
- package/build/middlewares/authorize.js +1 -4
- package/build/models/user.d.ts +37 -48
- package/package.json +2 -2
|
@@ -109,7 +109,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
109
109
|
const accessToken = (_b = req.cookies) === null || _b === void 0 ? void 0 : _b.accessToken;
|
|
110
110
|
if (apiKey || accessToken) {
|
|
111
111
|
promises.push((() => __awaiter(void 0, void 0, void 0, function* () {
|
|
112
|
-
var _c, _d, _e, _f, _g, _h;
|
|
113
112
|
const Auth = yield (0, auth_1.buildAuth)(mongoose);
|
|
114
113
|
let authId = null;
|
|
115
114
|
if (apiKey) {
|
|
@@ -165,9 +164,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
165
164
|
req.user = user;
|
|
166
165
|
}
|
|
167
166
|
else if (authorizationTypes.includes(common_1.AuthorizationType.User)) {
|
|
168
|
-
if (
|
|
169
|
-
((_f = (_e = user.onboarding) === null || _e === void 0 ? void 0 : _e.PE) === null || _f === void 0 ? void 0 : _f.status) === common_1.OnboardingStatus.Approved ||
|
|
170
|
-
((_h = (_g = user.onboarding) === null || _g === void 0 ? void 0 : _g.US) === null || _h === void 0 ? void 0 : _h.status) === common_1.OnboardingStatus.Approved) {
|
|
167
|
+
if (user.onboarding.status === common_1.OnboardingStatus.Approved) {
|
|
171
168
|
req.user = user;
|
|
172
169
|
}
|
|
173
170
|
}
|
package/build/models/user.d.ts
CHANGED
|
@@ -1,50 +1,5 @@
|
|
|
1
|
-
import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier,
|
|
1
|
+
import { OnboardingStatus, PlatformFeeRange, UserAttribute, UserType, CountryOfOrigin, RiskTier, Country, Fiat, Side, Crypto } from "@riocrypto/common";
|
|
2
2
|
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
-
interface OnboardingBase {
|
|
4
|
-
aipriseBusinessProfileId?: string;
|
|
5
|
-
aipriseUserProfileId?: string;
|
|
6
|
-
}
|
|
7
|
-
type OnboardingCountryData = {
|
|
8
|
-
[country in CountryOfOrigin]?: {
|
|
9
|
-
status?: OnboardingStatus;
|
|
10
|
-
hasAcceptedTerms?: boolean;
|
|
11
|
-
onboardingId?: string;
|
|
12
|
-
bridgeId?: string;
|
|
13
|
-
personalId?: string;
|
|
14
|
-
taxId?: string;
|
|
15
|
-
immigrationStatus?: ImmigrationStatus;
|
|
16
|
-
individualIdentityVerification?: {
|
|
17
|
-
status?: "passed" | "failed" | "review";
|
|
18
|
-
};
|
|
19
|
-
legalRepresentative?: {
|
|
20
|
-
firstName?: string;
|
|
21
|
-
middleName?: string;
|
|
22
|
-
lastName?: string;
|
|
23
|
-
secondLastName?: string;
|
|
24
|
-
verificationStatus?: "passed" | "failed" | "review";
|
|
25
|
-
email?: string;
|
|
26
|
-
};
|
|
27
|
-
files?: {
|
|
28
|
-
certificateOfIncorporation?: string;
|
|
29
|
-
KYCReport?: string;
|
|
30
|
-
taxTranscript?: string;
|
|
31
|
-
proofOfAddress?: string;
|
|
32
|
-
businessRegistration?: string;
|
|
33
|
-
taxIdentificationCertificate?: string;
|
|
34
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
35
|
-
personalIdentificationCertificate?: string;
|
|
36
|
-
extraFiles?: string[];
|
|
37
|
-
};
|
|
38
|
-
address?: {
|
|
39
|
-
street1?: string;
|
|
40
|
-
street2?: string;
|
|
41
|
-
city?: string;
|
|
42
|
-
state?: string;
|
|
43
|
-
postalCode?: string;
|
|
44
|
-
country?: CountryOfOrigin;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
3
|
interface UserAttrs {
|
|
49
4
|
createdAt: Date;
|
|
50
5
|
authIds?: string[];
|
|
@@ -114,7 +69,24 @@ interface UserAttrs {
|
|
|
114
69
|
};
|
|
115
70
|
};
|
|
116
71
|
authorizedPhoneNumbers?: string[];
|
|
117
|
-
onboarding
|
|
72
|
+
onboarding: {
|
|
73
|
+
country: Country;
|
|
74
|
+
aipriseBusinessProfileId?: string;
|
|
75
|
+
aipriseUserProfileId?: string;
|
|
76
|
+
bridgeCustomerId?: string;
|
|
77
|
+
aipriseBusinessVerificationSessionUrl?: string;
|
|
78
|
+
aipriseUserVerificationSessionUrl?: string;
|
|
79
|
+
status: OnboardingStatus;
|
|
80
|
+
hasAcceptedTerms: boolean;
|
|
81
|
+
address?: {
|
|
82
|
+
street1?: string;
|
|
83
|
+
street2?: string;
|
|
84
|
+
city?: string;
|
|
85
|
+
state?: string;
|
|
86
|
+
postalCode?: string;
|
|
87
|
+
country?: CountryOfOrigin;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
118
90
|
invoicing?: {
|
|
119
91
|
MX: {
|
|
120
92
|
shouldInvoice: boolean;
|
|
@@ -210,7 +182,24 @@ interface UserDoc extends Document {
|
|
|
210
182
|
};
|
|
211
183
|
};
|
|
212
184
|
authorizedPhoneNumbers?: string[];
|
|
213
|
-
onboarding
|
|
185
|
+
onboarding: {
|
|
186
|
+
country: Country;
|
|
187
|
+
aipriseBusinessProfileId?: string;
|
|
188
|
+
aipriseUserProfileId?: string;
|
|
189
|
+
bridgeCustomerId?: string;
|
|
190
|
+
aipriseBusinessVerificationSessionUrl?: string;
|
|
191
|
+
aipriseUserVerificationSessionUrl?: string;
|
|
192
|
+
status: OnboardingStatus;
|
|
193
|
+
hasAcceptedTerms: boolean;
|
|
194
|
+
address?: {
|
|
195
|
+
street1?: string;
|
|
196
|
+
street2?: string;
|
|
197
|
+
city?: string;
|
|
198
|
+
state?: string;
|
|
199
|
+
postalCode?: string;
|
|
200
|
+
country?: CountryOfOrigin;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
214
203
|
invoicing?: {
|
|
215
204
|
MX: {
|
|
216
205
|
shouldInvoice: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2364",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2082",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|