@cranberry-money/shared-utils 8.23.411 → 8.23.413
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/dist/formatting.d.ts +0 -130
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +4 -203
- package/dist/formatting.js.map +1 -1
- package/dist/index.d.ts +6 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -35
- package/dist/index.js.map +1 -1
- package/dist/validation.d.ts +0 -5
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +3 -62
- package/dist/validation.js.map +1 -1
- package/package.json +3 -3
- package/dist/address.d.ts +0 -7
- package/dist/address.d.ts.map +0 -1
- package/dist/address.js +0 -104
- package/dist/address.js.map +0 -1
- package/dist/badges.d.ts +0 -2
- package/dist/badges.d.ts.map +0 -1
- package/dist/badges.js +0 -2
- package/dist/badges.js.map +0 -1
- package/dist/phoneFormatting.d.ts +0 -21
- package/dist/phoneFormatting.d.ts.map +0 -1
- package/dist/phoneFormatting.js +0 -146
- package/dist/phoneFormatting.js.map +0 -1
- package/dist/portfolio.d.ts +0 -12
- package/dist/portfolio.d.ts.map +0 -1
- package/dist/portfolio.js +0 -37
- package/dist/portfolio.js.map +0 -1
- package/dist/user-preferences.d.ts +0 -28
- package/dist/user-preferences.d.ts.map +0 -1
- package/dist/user-preferences.js +0 -88
- package/dist/user-preferences.js.map +0 -1
- package/dist/user-validation.d.ts +0 -3
- package/dist/user-validation.d.ts.map +0 -1
- package/dist/user-validation.js +0 -60
- package/dist/user-validation.js.map +0 -1
- package/dist/user-verification.d.ts +0 -40
- package/dist/user-verification.d.ts.map +0 -1
- package/dist/user-verification.js +0 -60
- package/dist/user-verification.js.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User verification status utilities for consistent verification status display
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Gets the verification status for a user profile
|
|
6
|
-
* @param userProfile - User profile object or null
|
|
7
|
-
* @returns Verification status with type and label
|
|
8
|
-
*/
|
|
9
|
-
export function getUserVerificationStatus(userProfile) {
|
|
10
|
-
if (!userProfile) {
|
|
11
|
-
return { type: 'unknown', label: 'Unknown' };
|
|
12
|
-
}
|
|
13
|
-
// User is verified through SumSub
|
|
14
|
-
if (userProfile.isIdVerified) {
|
|
15
|
-
return { type: 'verified', label: 'Verified ✓' };
|
|
16
|
-
}
|
|
17
|
-
// Verification is in progress
|
|
18
|
-
if (userProfile.sumsubVerificationStatus === 'pending' ||
|
|
19
|
-
userProfile.sumsubVerificationStatus === 'queued' ||
|
|
20
|
-
userProfile.sumsubVerificationStatus === 'init') {
|
|
21
|
-
return { type: 'pending', label: 'Pending' };
|
|
22
|
-
}
|
|
23
|
-
// Verification was rejected
|
|
24
|
-
if (userProfile.sumsubVerificationStatus === 'completed' && userProfile.sumsubReviewAnswer === 'RED') {
|
|
25
|
-
return { type: 'rejected', label: 'Rejected' };
|
|
26
|
-
}
|
|
27
|
-
// Not yet verified
|
|
28
|
-
return { type: 'not_verified', label: 'Not Verified' };
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Checks if a user profile is verified
|
|
32
|
-
* @param userProfile - User profile object or null
|
|
33
|
-
* @returns True if user is verified
|
|
34
|
-
*/
|
|
35
|
-
export function isUserVerified(userProfile) {
|
|
36
|
-
return userProfile?.isIdVerified === true;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Checks if a user profile has pending verification
|
|
40
|
-
* @param userProfile - User profile object or null
|
|
41
|
-
* @returns True if verification is pending
|
|
42
|
-
*/
|
|
43
|
-
export function isVerificationPending(userProfile) {
|
|
44
|
-
if (!userProfile)
|
|
45
|
-
return false;
|
|
46
|
-
return (userProfile.sumsubVerificationStatus === 'pending' ||
|
|
47
|
-
userProfile.sumsubVerificationStatus === 'queued' ||
|
|
48
|
-
userProfile.sumsubVerificationStatus === 'init');
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Checks if a user profile verification was rejected
|
|
52
|
-
* @param userProfile - User profile object or null
|
|
53
|
-
* @returns True if verification was rejected
|
|
54
|
-
*/
|
|
55
|
-
export function isVerificationRejected(userProfile) {
|
|
56
|
-
if (!userProfile)
|
|
57
|
-
return false;
|
|
58
|
-
return userProfile.sumsubVerificationStatus === 'completed' && userProfile.sumsubReviewAnswer === 'RED';
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=user-verification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-verification.js","sourceRoot":"","sources":["../src/user-verification.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,WAA2C;IACnF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC/C,CAAC;IAED,kCAAkC;IAClC,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IACnD,CAAC;IAED,8BAA8B;IAC9B,IACE,WAAW,CAAC,wBAAwB,KAAK,SAAS;QAClD,WAAW,CAAC,wBAAwB,KAAK,QAAQ;QACjD,WAAW,CAAC,wBAAwB,KAAK,MAAM,EAC/C,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC/C,CAAC;IAED,4BAA4B;IAC5B,IAAI,WAAW,CAAC,wBAAwB,KAAK,WAAW,IAAI,WAAW,CAAC,kBAAkB,KAAK,KAAK,EAAE,CAAC;QACrG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IACjD,CAAC;IAED,mBAAmB;IACnB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc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