noibu-react-native 0.1.3 → 0.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.
Files changed (48) hide show
  1. package/android/.gitignore +13 -0
  2. package/android/build.gradle +79 -0
  3. package/android/gradle.properties +7 -0
  4. package/android/src/main/AndroidManifest.xml +5 -0
  5. package/android/src/main/java/com/noibu/sessionreplay/reactnative/NoibuSessionReplayModule.kt +107 -0
  6. package/android/src/main/java/com/noibu/sessionreplay/reactnative/NoibuSessionReplayPackage.kt +17 -0
  7. package/dist/api/clientConfig.d.ts +2 -2
  8. package/dist/api/clientConfig.js +1 -1
  9. package/dist/api/helpCode.d.ts +29 -0
  10. package/dist/api/inputManager.d.ts +87 -0
  11. package/dist/api/metroplexSocket.d.ts +7 -6
  12. package/dist/api/metroplexSocket.js +14 -18
  13. package/dist/api/storedMetrics.d.ts +73 -0
  14. package/dist/api/storedPageVisit.d.ts +49 -0
  15. package/dist/const_matchers.d.ts +1 -0
  16. package/dist/constants.d.ts +6 -1
  17. package/dist/constants.js +13 -2
  18. package/dist/entry/index.d.ts +1 -1
  19. package/dist/entry/init.js +8 -4
  20. package/dist/monitors/clickMonitor.d.ts +44 -0
  21. package/dist/monitors/gqlErrorValidator.d.ts +82 -0
  22. package/dist/monitors/httpDataBundler.d.ts +161 -0
  23. package/dist/monitors/inputMonitor.d.ts +34 -0
  24. package/dist/monitors/keyboardInputMonitor.d.ts +17 -0
  25. package/dist/monitors/pageMonitor.d.ts +22 -0
  26. package/dist/monitors/requestMonitor.d.ts +10 -0
  27. package/dist/pageVisit/pageVisit.d.ts +52 -0
  28. package/dist/pageVisit/pageVisit.js +4 -2
  29. package/dist/pageVisit/pageVisitEventError.d.ts +15 -0
  30. package/dist/pageVisit/pageVisitEventHTTP.d.ts +18 -0
  31. package/dist/pageVisit/userStep.d.ts +5 -0
  32. package/dist/react/ErrorBoundary.js +17 -9
  33. package/dist/sessionRecorder/nativeSessionRecorderSubscription.d.ts +64 -0
  34. package/dist/sessionRecorder/nativeSessionRecorderSubscription.js +58 -0
  35. package/dist/sessionRecorder/sessionRecorder.d.ts +60 -0
  36. package/dist/sessionRecorder/sessionRecorder.js +287 -0
  37. package/dist/sessionRecorder/types.d.ts +91 -0
  38. package/dist/types/StoredPageVisit.types.d.ts +54 -0
  39. package/dist/types/globals.d.ts +0 -1
  40. package/dist/utils/date.d.ts +6 -0
  41. package/dist/utils/eventlistener.d.ts +8 -0
  42. package/dist/utils/eventlistener.js +2 -2
  43. package/dist/utils/function.d.ts +4 -0
  44. package/dist/utils/function.js +13 -1
  45. package/dist/utils/log.d.ts +0 -1
  46. package/dist/utils/log.js +3 -5
  47. package/dist/utils/object.d.ts +2 -2
  48. package/package.json +11 -3
@@ -269,5 +269,17 @@ function isInstanceOf(instance, type) {
269
269
  return false;
270
270
  }
271
271
  }
272
+ /**
273
+ * To grab the video recorder type based on the device we run the app on.
274
+ */
275
+ async function getVideoRecorderType() {
276
+ if (Platform.OS === 'android') {
277
+ return 'AndroidNative';
278
+ }
279
+ if (Platform.OS === 'ios') {
280
+ return 'IOSNative';
281
+ }
282
+ return '';
283
+ }
272
284
 
273
- export { asString, getJSStack, getMaxSubstringAllowed, getUserAgent, isInstanceOf, isInvalidURLConfig, isNoibuJSAlreadyLoaded, isStackTrace, isValidURL, makeRequest, maskTextInput, processFrames, stringifyJSON };
285
+ export { asString, getJSStack, getMaxSubstringAllowed, getUserAgent, getVideoRecorderType, isInstanceOf, isInvalidURLConfig, isNoibuJSAlreadyLoaded, isStackTrace, isValidURL, makeRequest, maskTextInput, processFrames, stringifyJSON };
@@ -1,4 +1,3 @@
1
- /// <reference types="react-native" />
2
1
  /**
3
2
  * log with level = info
4
3
  */
package/dist/utils/log.js CHANGED
@@ -1,17 +1,15 @@
1
1
  /* eslint-disable no-console,@typescript-eslint/no-empty-function */
2
2
  /** no operation */
3
- const noop = () => { };
4
3
  /**
5
4
  * checks if was overridden and calls original console function
6
5
  */
7
6
  const getConsoleMethod = (ogProp) => {
8
- {
9
- return noop;
10
- }
7
+ // @ts-ignore
8
+ return console[ogProp].__noibu_original__ || console[ogProp];
11
9
  };
12
10
  /**
13
11
  * log with level = info
14
12
  */
15
- const noibuLog = (...msgs) => getConsoleMethod()('Noibu', ...msgs);
13
+ const noibuLog = (...msgs) => getConsoleMethod('log')('Noibu', ...msgs);
16
14
 
17
15
  export { noibuLog };
@@ -26,7 +26,7 @@ export declare function unwrapNoibuWrapped<T>(anything: {
26
26
  * @param {string} property
27
27
  * @returns {boolean} Whether the property on the prototype is (or is now) writeable
28
28
  */
29
- export declare const propWriteableOrMadeWriteable: (proto: object, property: never) => boolean;
29
+ export declare const propWriteableOrMadeWriteable: (proto: object, property: keyof typeof proto) => boolean;
30
30
  /**
31
31
  * Iterates object recursively and calls visit function
32
32
  * for each property allowing to override its value
@@ -35,7 +35,7 @@ export declare const propWriteableOrMadeWriteable: (proto: object, property: nev
35
35
  * There are 3 arguments: current object, current property and its value
36
36
  * @param {{depth: number}} limit Use limit config object to set depth of the recursion
37
37
  */
38
- export declare const iterateObjectRecursively: (instance: Record<any, any>, visit: (i: Record<any, any>, p: any, v: any) => any, limit?: {
38
+ export declare const iterateObjectRecursively: (instance: Record<any, any>, visit: (i: typeof instance, p: keyof typeof i, v: (typeof i)[typeof p]) => typeof v, limit?: {
39
39
  depth: number;
40
40
  }) => void;
41
41
  export {};
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "noibu-react-native",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "targetNjsVersion": "1.0.104",
5
5
  "description": "React-Native SDK for NoibuJS to collect errors in React-Native applications",
6
6
  "main": "dist/entry/index.js",
7
7
  "types": "dist/entry/index.d.ts",
8
8
  "files": [
9
+ "android/*",
9
10
  "dist/*",
10
11
  "README.md"
11
12
  ],
@@ -28,6 +29,7 @@
28
29
  },
29
30
  "dependencies": {
30
31
  "@react-native-async-storage/async-storage": "^1.19.0",
32
+ "fflate": "^0.8.2",
31
33
  "react": ">=16.11.0",
32
34
  "react-native": ">=0.63.0",
33
35
  "react-native-url-polyfill": "^1.3.0",
@@ -41,10 +43,12 @@
41
43
  "@rollup/plugin-typescript": "^11.1.1",
42
44
  "@tsconfig/react-native": "^3.0.2",
43
45
  "@types/jest": "^29.5.1",
46
+ "@jest/globals": "^29.7.0",
44
47
  "@types/node": "^20.2.3",
45
48
  "@types/react": "^18.2.6",
46
49
  "@types/react-test-renderer": "^18.0.0",
47
50
  "@typescript-eslint/eslint-plugin": "^5.59.6",
51
+ "babel-plugin-transform-flow-strip-types": "^6.22.0",
48
52
  "codecov": "^3.8.3",
49
53
  "dotenv": "^16.1.3",
50
54
  "eslint": "^8.41.0",
@@ -52,10 +56,14 @@
52
56
  "eslint-config-prettier": "^8.8.0",
53
57
  "eslint-plugin-jsdoc": "^44.2.4",
54
58
  "eslint-plugin-prettier": "^4.2.1",
55
- "jest": "^29.5.0",
59
+ "jest": "^29.7.0",
60
+ "@babel/preset-env": "^7.24.8",
61
+ "babel-jest": "^29.7.0",
56
62
  "prettier": "^2.8.8",
57
63
  "rimraf": "^5.0.1",
58
64
  "rollup": "^3.24.0",
59
- "rollup-plugin-dotenv": "^0.5.0"
65
+ "rollup-plugin-dotenv": "^0.5.0",
66
+ "ts-jest": "^29.2.3",
67
+ "typescript": "^5.5.3"
60
68
  }
61
69
  }