@umituz/react-native-exception 1.1.0 → 1.2.1

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/LICENSE CHANGED
@@ -34,3 +34,7 @@ SOFTWARE.
34
34
 
35
35
 
36
36
 
37
+
38
+
39
+
40
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-exception",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Exception handling and error tracking for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -32,6 +32,8 @@
32
32
  "react": ">=18.2.0",
33
33
  "react-native": ">=0.74.0",
34
34
  "zustand": "^5.0.2",
35
+ "uuid": "^9.0.0",
36
+ "react-native-get-random-values": "^1.11.0",
35
37
  "@umituz/react-native-design-system-theme": "*",
36
38
  "@umituz/react-native-design-system": "*"
37
39
  },
@@ -41,6 +43,7 @@
41
43
  }
42
44
  },
43
45
  "devDependencies": {
46
+ "@types/uuid": "^10.0.0",
44
47
  "typescript": "^5.3.3",
45
48
  "@types/react": "^18.2.45",
46
49
  "@types/react-native": "^0.73.0",
@@ -3,6 +3,9 @@
3
3
  * Pure business logic representation of errors and exceptions
4
4
  */
5
5
 
6
+ import 'react-native-get-random-values';
7
+ import { v4 as uuidv4 } from 'uuid';
8
+
6
9
  export type ExceptionSeverity = 'fatal' | 'error' | 'warning' | 'info';
7
10
  export type ExceptionCategory = 'network' | 'validation' | 'authentication' | 'authorization' | 'business-logic' | 'system' | 'storage' | 'unknown';
8
11
 
@@ -48,7 +51,7 @@ export function createException(
48
51
  context: ExceptionContext = {}
49
52
  ): ExceptionEntity {
50
53
  return {
51
- id: crypto.randomUUID(),
54
+ id: uuidv4(),
52
55
  message: error.message,
53
56
  stack: error.stack,
54
57
  severity,
@@ -67,7 +70,7 @@ export function createErrorLog(
67
70
  exception: ExceptionEntity
68
71
  ): ErrorLog {
69
72
  return {
70
- id: crypto.randomUUID(),
73
+ id: uuidv4(),
71
74
  exceptionId: exception.id,
72
75
  userId: exception.context.userId,
73
76
  message: exception.message,
@@ -58,3 +58,7 @@ export interface IExceptionRepository {
58
58
 
59
59
 
60
60
 
61
+
62
+
63
+
64
+
@@ -114,3 +114,7 @@ export const exceptionService = ExceptionService.getInstance();
114
114
 
115
115
 
116
116
 
117
+
118
+
119
+
120
+
@@ -107,3 +107,7 @@ export const useExceptions = () => {
107
107
 
108
108
 
109
109
 
110
+
111
+
112
+
113
+