noibu-react-native 0.2.2 → 0.2.4
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/README.md +1 -1
- package/dist/api/clientConfig.js +225 -217
- package/dist/api/helpCode.js +61 -87
- package/dist/api/metroplexSocket.js +460 -463
- package/dist/api/storedPageVisit.js +150 -208
- package/dist/constants.js +10 -2
- package/dist/entry/init.js +65 -63
- package/dist/monitors/{appNavigationMonitor.js → AppNavigationMonitor.js} +12 -22
- package/dist/monitors/ClickMonitor.js +198 -0
- package/dist/monitors/ErrorMonitor.js +206 -0
- package/dist/monitors/KeyboardInputMonitor.js +60 -0
- package/dist/monitors/PageMonitor.js +98 -0
- package/dist/monitors/RequestMonitor.js +390 -0
- package/dist/monitors/http-tools/GqlErrorValidator.js +259 -0
- package/dist/monitors/http-tools/HTTPDataBundler.js +458 -0
- package/dist/monitors/integrations/react-native-navigation-integration.js +4 -2
- package/dist/pageVisit/EventDebouncer.js +99 -0
- package/dist/pageVisit/pageVisitEventError.js +2 -2
- package/dist/pageVisit/pageVisitEventHTTP.js +79 -93
- package/dist/react/ErrorBoundary.js +18 -15
- package/dist/sessionRecorder/nativeSessionRecorderSubscription.js +3 -2
- package/dist/sessionRecorder/sessionRecorder.js +152 -151
- package/dist/{api → src/api}/clientConfig.d.ts +2 -2
- package/dist/{api → src/api}/helpCode.d.ts +10 -16
- package/dist/{api → src/api}/metroplexSocket.d.ts +48 -67
- package/dist/{api → src/api}/storedPageVisit.d.ts +12 -21
- package/dist/{constants.d.ts → src/constants.d.ts} +45 -0
- package/dist/{entry → src/entry}/init.d.ts +1 -1
- package/dist/src/monitors/AppNavigationMonitor.d.ts +18 -0
- package/dist/src/monitors/ClickMonitor.d.ts +31 -0
- package/dist/src/monitors/ErrorMonitor.d.ts +63 -0
- package/dist/{monitors/keyboardInputMonitor.d.ts → src/monitors/KeyboardInputMonitor.d.ts} +7 -4
- package/dist/{monitors/pageMonitor.d.ts → src/monitors/PageMonitor.d.ts} +6 -8
- package/dist/src/monitors/RequestMonitor.d.ts +94 -0
- package/dist/src/monitors/http-tools/GqlErrorValidator.d.ts +59 -0
- package/dist/src/monitors/http-tools/HTTPDataBundler.d.ts +112 -0
- package/dist/{monitors → src/monitors}/integrations/react-native-navigation-integration.d.ts +3 -2
- package/dist/src/pageVisit/EventDebouncer.d.ts +24 -0
- package/dist/{pageVisit → src/pageVisit}/pageVisit.d.ts +1 -1
- package/dist/src/pageVisit/pageVisitEventHTTP.d.ts +25 -0
- package/dist/{sessionRecorder → src/sessionRecorder}/types.d.ts +1 -1
- package/dist/{storage → src/storage}/rnStorageProvider.d.ts +1 -1
- package/dist/{storage → src/storage}/storage.d.ts +2 -2
- package/dist/{storage → src/storage}/storageProvider.d.ts +3 -3
- package/dist/{utils → src/utils}/function.d.ts +27 -7
- package/dist/{utils → src/utils}/object.d.ts +11 -8
- package/dist/src/utils/piiRedactor.d.ts +11 -0
- package/dist/src/utils/polyfills.d.ts +4 -0
- package/dist/storage/rnStorageProvider.js +7 -4
- package/dist/storage/storage.js +43 -35
- package/dist/storage/storageProvider.js +23 -19
- package/dist/types/Config.d.ts +24 -20
- package/dist/types/Metroplex.types.d.ts +73 -0
- package/dist/types/Monitor.d.ts +11 -0
- package/dist/types/Monitor.js +19 -0
- package/dist/types/PageVisit.types.d.ts +8 -0
- package/dist/types/PageVisitErrors.types.d.ts +114 -0
- package/dist/types/PageVisitEvents.types.d.ts +91 -0
- package/dist/types/PageVisitMetrics.types.d.ts +27 -0
- package/dist/types/Storage.d.ts +1 -1
- package/dist/types/StoredPageVisit.types.d.ts +4 -47
- package/dist/types/WrappedObjects.d.ts +6 -0
- package/dist/utils/function.js +110 -77
- package/dist/utils/object.js +59 -6
- package/dist/utils/piiRedactor.js +98 -0
- package/dist/utils/polyfills.js +24 -0
- package/package.json +8 -8
- package/dist/monitors/appNavigationMonitor.d.ts +0 -22
- package/dist/monitors/clickMonitor.d.ts +0 -44
- package/dist/monitors/clickMonitor.js +0 -251
- package/dist/monitors/errorMonitor.d.ts +0 -28
- package/dist/monitors/errorMonitor.js +0 -180
- package/dist/monitors/gqlErrorValidator.d.ts +0 -82
- package/dist/monitors/gqlErrorValidator.js +0 -306
- package/dist/monitors/httpDataBundler.d.ts +0 -161
- package/dist/monitors/httpDataBundler.js +0 -725
- package/dist/monitors/inputMonitor.d.ts +0 -34
- package/dist/monitors/inputMonitor.js +0 -138
- package/dist/monitors/keyboardInputMonitor.js +0 -66
- package/dist/monitors/pageMonitor.js +0 -122
- package/dist/monitors/requestMonitor.d.ts +0 -10
- package/dist/monitors/requestMonitor.js +0 -401
- package/dist/pageVisit/pageVisitEventHTTP.d.ts +0 -18
- package/dist/types/PageVisit.d.ts +0 -22
- package/dist/types/ReactNative.d.ts +0 -4
- package/dist/types/globals.d.ts +0 -45
- /package/dist/{api → src/api}/inputManager.d.ts +0 -0
- /package/dist/{api → src/api}/storedMetrics.d.ts +0 -0
- /package/dist/{const_matchers.d.ts → src/const_matchers.d.ts} +0 -0
- /package/dist/{entry → src/entry}/index.d.ts +0 -0
- /package/dist/{pageVisit → src/pageVisit}/pageVisitEventError.d.ts +0 -0
- /package/dist/{pageVisit → src/pageVisit}/userStep.d.ts +0 -0
- /package/dist/{react → src/react}/ErrorBoundary.d.ts +0 -0
- /package/dist/{sessionRecorder → src/sessionRecorder}/nativeSessionRecorderSubscription.d.ts +0 -0
- /package/dist/{sessionRecorder → src/sessionRecorder}/sessionRecorder.d.ts +0 -0
- /package/dist/{utils → src/utils}/date.d.ts +0 -0
- /package/dist/{utils → src/utils}/eventlistener.d.ts +0 -0
- /package/dist/{utils → src/utils}/log.d.ts +0 -0
- /package/dist/{utils → src/utils}/performance.d.ts +0 -0
- /package/dist/{utils → src/utils}/stacktrace-parser.d.ts +0 -0
package/dist/api/helpCode.js
CHANGED
|
@@ -1,100 +1,74 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
1
2
|
import MetroplexSocket from './metroplexSocket.js';
|
|
2
3
|
import { SEVERITY } from '../constants.js';
|
|
3
4
|
import ClientConfig from './clientConfig.js';
|
|
5
|
+
import { Singleton } from '../types/Monitor.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* HelpCode class is responsible for help code feature related functionality
|
|
7
9
|
*/
|
|
8
|
-
class HelpCode {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
class HelpCode extends Singleton {
|
|
11
|
+
/**
|
|
12
|
+
* Constructs instance and sets up event listeners
|
|
13
|
+
*/
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.requestContext = null;
|
|
17
|
+
this.receiveHelpCode = this.receiveHelpCode.bind(this);
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
context.promise = new Promise((resolve, reject) => {
|
|
48
|
-
context.resolve = resolve;
|
|
49
|
-
context.reject = reject;
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
this.requestContext = context;
|
|
53
|
-
|
|
54
|
-
const result = await MetroplexSocket.getInstance().requestHelpCode(
|
|
55
|
-
this.receiveHelpCode,
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
if (result === false) {
|
|
59
|
-
this.requestContext = null;
|
|
60
|
-
return Promise.reject(new Error('noibu connection is unavailable'));
|
|
19
|
+
/**
|
|
20
|
+
* Requests a help code and returns a Promise that resolves when the help code is obtained
|
|
21
|
+
* or rejects if the noibu connection is unavailable.
|
|
22
|
+
|
|
23
|
+
* @returns {Promise<string>} Promise object representing the help code request.
|
|
24
|
+
* @throws {string} Throws an error if the noibu connection is unavailable.
|
|
25
|
+
*/
|
|
26
|
+
requestHelpCode() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (this.requestContext !== null) {
|
|
29
|
+
return this.requestContext.promise;
|
|
30
|
+
}
|
|
31
|
+
const context = {
|
|
32
|
+
resolve: null,
|
|
33
|
+
reject: null,
|
|
34
|
+
promise: null,
|
|
35
|
+
};
|
|
36
|
+
context.promise = new Promise((resolve, reject) => {
|
|
37
|
+
context.resolve = resolve;
|
|
38
|
+
context.reject = reject;
|
|
39
|
+
});
|
|
40
|
+
this.requestContext = context;
|
|
41
|
+
const result = yield MetroplexSocket.getInstance().requestHelpCode(this.receiveHelpCode);
|
|
42
|
+
if (!result) {
|
|
43
|
+
this.requestContext = null;
|
|
44
|
+
return Promise.reject(new Error('noibu connection is unavailable'));
|
|
45
|
+
}
|
|
46
|
+
return this.requestContext.promise;
|
|
47
|
+
});
|
|
61
48
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const context = this.requestContext;
|
|
88
|
-
this.requestContext = null;
|
|
89
|
-
|
|
90
|
-
const { success, data } = event.detail;
|
|
91
|
-
|
|
92
|
-
if (success) {
|
|
93
|
-
context.resolve(data);
|
|
94
|
-
} else {
|
|
95
|
-
context.reject(new Error(data));
|
|
49
|
+
/**
|
|
50
|
+
* Handles the received help code event.
|
|
51
|
+
*/
|
|
52
|
+
receiveHelpCode(event) {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
if (this.requestContext === null) {
|
|
55
|
+
const { success, data } = event.detail;
|
|
56
|
+
if (!success) {
|
|
57
|
+
const message = `Noibu help code is not available due to ${data}`;
|
|
58
|
+
ClientConfig.getInstance().postNoibuErrorAndOptionallyDisableClient(message, false, SEVERITY.error);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const context = this.requestContext;
|
|
63
|
+
this.requestContext = null;
|
|
64
|
+
const { success, data } = event.detail;
|
|
65
|
+
if (success) {
|
|
66
|
+
(_a = context.resolve) === null || _a === void 0 ? void 0 : _a.call(context, data);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
(_b = context.reject) === null || _b === void 0 ? void 0 : _b.call(context, new Error(data));
|
|
70
|
+
}
|
|
96
71
|
}
|
|
97
|
-
}
|
|
98
72
|
}
|
|
99
73
|
|
|
100
74
|
export { HelpCode as default };
|