@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.
Files changed (41) hide show
  1. package/dist/formatting.d.ts +0 -130
  2. package/dist/formatting.d.ts.map +1 -1
  3. package/dist/formatting.js +4 -203
  4. package/dist/formatting.js.map +1 -1
  5. package/dist/index.d.ts +6 -13
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -35
  8. package/dist/index.js.map +1 -1
  9. package/dist/validation.d.ts +0 -5
  10. package/dist/validation.d.ts.map +1 -1
  11. package/dist/validation.js +3 -62
  12. package/dist/validation.js.map +1 -1
  13. package/package.json +3 -3
  14. package/dist/address.d.ts +0 -7
  15. package/dist/address.d.ts.map +0 -1
  16. package/dist/address.js +0 -104
  17. package/dist/address.js.map +0 -1
  18. package/dist/badges.d.ts +0 -2
  19. package/dist/badges.d.ts.map +0 -1
  20. package/dist/badges.js +0 -2
  21. package/dist/badges.js.map +0 -1
  22. package/dist/phoneFormatting.d.ts +0 -21
  23. package/dist/phoneFormatting.d.ts.map +0 -1
  24. package/dist/phoneFormatting.js +0 -146
  25. package/dist/phoneFormatting.js.map +0 -1
  26. package/dist/portfolio.d.ts +0 -12
  27. package/dist/portfolio.d.ts.map +0 -1
  28. package/dist/portfolio.js +0 -37
  29. package/dist/portfolio.js.map +0 -1
  30. package/dist/user-preferences.d.ts +0 -28
  31. package/dist/user-preferences.d.ts.map +0 -1
  32. package/dist/user-preferences.js +0 -88
  33. package/dist/user-preferences.js.map +0 -1
  34. package/dist/user-validation.d.ts +0 -3
  35. package/dist/user-validation.d.ts.map +0 -1
  36. package/dist/user-validation.js +0 -60
  37. package/dist/user-validation.js.map +0 -1
  38. package/dist/user-verification.d.ts +0 -40
  39. package/dist/user-verification.d.ts.map +0 -1
  40. package/dist/user-verification.js +0 -60
  41. 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;AAiB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