noibu-react-native 0.2.5 → 0.2.7

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 (98) hide show
  1. package/README.md +15 -15
  2. package/android/build.gradle +1 -1
  3. package/dist/api/{clientConfig.js → ClientConfig.js} +69 -52
  4. package/dist/api/{helpCode.js → HelpCode.js} +6 -13
  5. package/dist/api/InputManager.js +156 -0
  6. package/dist/api/{metroplexSocket.js → MetroplexSocket.js} +189 -178
  7. package/dist/api/StoredMetrics.js +158 -0
  8. package/dist/api/{storedPageVisit.js → StoredPageVisit.js} +61 -48
  9. package/dist/const_matchers.js +1 -5
  10. package/dist/constants.js +15 -390
  11. package/dist/entry/index.js +3 -4
  12. package/dist/entry/init.js +33 -19
  13. package/dist/monitors/AppNavigationMonitor.js +19 -19
  14. package/dist/monitors/BaseMonitor.js +9 -4
  15. package/dist/monitors/ClickMonitor.js +72 -76
  16. package/dist/monitors/ErrorMonitor.js +45 -55
  17. package/dist/monitors/KeyboardInputMonitor.js +13 -11
  18. package/dist/monitors/PageMonitor.js +25 -2
  19. package/dist/monitors/RequestMonitor.js +46 -57
  20. package/dist/monitors/http-tools/GqlErrorValidator.js +39 -69
  21. package/dist/monitors/http-tools/HTTPDataBundler.js +71 -66
  22. package/dist/monitors/integrations/{react-native-navigation-integration.js → ReactNativeNavigationIntegration.js} +15 -12
  23. package/dist/pageVisit/EventDebouncer.js +43 -74
  24. package/dist/pageVisit/HttpEventManager.js +88 -0
  25. package/dist/pageVisit/PageVisitManager.js +99 -0
  26. package/dist/pageVisit/pageVisitEventError.js +170 -280
  27. package/dist/react/ErrorBoundary.js +3 -6
  28. package/dist/sessionRecorder/{sessionRecorder.js → SessionRecorder.js} +58 -70
  29. package/dist/sessionRecorder/nativeSessionRecorderSubscription.js +3 -5
  30. package/dist/storage/{rnStorageProvider.js → RNStorageProvider.js} +3 -7
  31. package/dist/storage/{storage.js → Storage.js} +17 -30
  32. package/dist/storage/{storageProvider.js → StorageProvider.js} +7 -8
  33. package/dist/utils/date.js +39 -50
  34. package/dist/utils/eventlistener.js +5 -12
  35. package/dist/utils/function.js +42 -113
  36. package/dist/utils/log.js +5 -5
  37. package/dist/utils/object.js +12 -12
  38. package/dist/utils/piiRedactor.js +31 -3
  39. package/dist/utils/stacktrace-parser.js +29 -21
  40. package/package.json +14 -14
  41. package/dist/api/inputManager.js +0 -227
  42. package/dist/api/storedMetrics.js +0 -198
  43. package/dist/pageVisit/pageVisit.js +0 -181
  44. package/dist/pageVisit/pageVisitEventHTTP.js +0 -98
  45. package/dist/pageVisit/userStep.js +0 -20
  46. package/dist/src/api/clientConfig.d.ts +0 -100
  47. package/dist/src/api/clientConfig.test.d.ts +0 -1
  48. package/dist/src/api/helpCode.d.ts +0 -23
  49. package/dist/src/api/inputManager.d.ts +0 -87
  50. package/dist/src/api/metroplexSocket.d.ts +0 -137
  51. package/dist/src/api/storedMetrics.d.ts +0 -73
  52. package/dist/src/api/storedPageVisit.d.ts +0 -40
  53. package/dist/src/const_matchers.d.ts +0 -1
  54. package/dist/src/constants.d.ts +0 -290
  55. package/dist/src/entry/index.d.ts +0 -14
  56. package/dist/src/entry/init.d.ts +0 -5
  57. package/dist/src/monitors/AppNavigationMonitor.d.ts +0 -18
  58. package/dist/src/monitors/BaseMonitor.d.ts +0 -13
  59. package/dist/src/monitors/BaseMonitor.test.d.ts +0 -1
  60. package/dist/src/monitors/ClickMonitor.d.ts +0 -31
  61. package/dist/src/monitors/ErrorMonitor.d.ts +0 -63
  62. package/dist/src/monitors/KeyboardInputMonitor.d.ts +0 -20
  63. package/dist/src/monitors/PageMonitor.d.ts +0 -20
  64. package/dist/src/monitors/RequestMonitor.d.ts +0 -94
  65. package/dist/src/monitors/http-tools/GqlErrorValidator.d.ts +0 -59
  66. package/dist/src/monitors/http-tools/HTTPDataBundler.d.ts +0 -112
  67. package/dist/src/monitors/integrations/react-native-navigation-integration.d.ts +0 -20
  68. package/dist/src/pageVisit/EventDebouncer.d.ts +0 -24
  69. package/dist/src/pageVisit/pageVisit.d.ts +0 -52
  70. package/dist/src/pageVisit/pageVisitEventError.d.ts +0 -15
  71. package/dist/src/pageVisit/pageVisitEventHTTP.d.ts +0 -25
  72. package/dist/src/pageVisit/userStep.d.ts +0 -5
  73. package/dist/src/react/ErrorBoundary.d.ts +0 -72
  74. package/dist/src/sessionRecorder/nativeSessionRecorderSubscription.d.ts +0 -79
  75. package/dist/src/sessionRecorder/sessionRecorder.d.ts +0 -60
  76. package/dist/src/sessionRecorder/types.d.ts +0 -91
  77. package/dist/src/storage/rnStorageProvider.d.ts +0 -23
  78. package/dist/src/storage/storage.d.ts +0 -39
  79. package/dist/src/storage/storageProvider.d.ts +0 -26
  80. package/dist/src/utils/date.d.ts +0 -6
  81. package/dist/src/utils/eventlistener.d.ts +0 -8
  82. package/dist/src/utils/function.d.ts +0 -102
  83. package/dist/src/utils/log.d.ts +0 -4
  84. package/dist/src/utils/object.d.ts +0 -44
  85. package/dist/src/utils/performance.d.ts +0 -6
  86. package/dist/src/utils/piiRedactor.d.ts +0 -11
  87. package/dist/src/utils/polyfills.d.ts +0 -4
  88. package/dist/src/utils/stacktrace-parser.d.ts +0 -7
  89. package/dist/types/Config.d.ts +0 -31
  90. package/dist/types/Metroplex.types.d.ts +0 -73
  91. package/dist/types/NavigationIntegration.d.ts +0 -6
  92. package/dist/types/PageVisit.types.d.ts +0 -8
  93. package/dist/types/PageVisitErrors.types.d.ts +0 -114
  94. package/dist/types/PageVisitEvents.types.d.ts +0 -91
  95. package/dist/types/PageVisitMetrics.types.d.ts +0 -27
  96. package/dist/types/Storage.d.ts +0 -14
  97. package/dist/types/StoredPageVisit.types.d.ts +0 -11
  98. package/dist/types/WrappedObjects.d.ts +0 -6
@@ -1,290 +0,0 @@
1
- /** @module Constants */
2
- export declare const CURRENT_NOIBUJS_VERSION: 2;
3
- export declare const MAX_FRAMES_IN_ARRAY: 50;
4
- export declare const MAX_STRING_LENGTH: 1024;
5
- export declare const MAX_STRING_LENGTH_2048: 2048;
6
- export declare const MAX_HTTP_DATA_PAYLOAD_LENGTH: 50000;
7
- export declare const MAX_COLLECT_ERROR_LOG: 50;
8
- export declare const MAX_PAGEVISIT_PARTS: 10000;
9
- export declare const MAX_HTTP_DATA_EVENT_COUNT: 100;
10
- export declare const MAX_TIME_FOR_UNSENT_DATA_MILLIS: 500;
11
- export declare const NOIBU_BROWSER_ID_KYWRD: "n_browser_data";
12
- export declare const NOIBU_STORED_PAGE_VISIT: "n_stored_page_visit";
13
- export declare const NOIBU_LOCAL_STORAGE_TEST_KEY: "n_key";
14
- export declare const LOCAL_STORAGE_WRITE_TIMEOUT_MILLIS: 2500;
15
- export declare const CLIENT_LOCK_TIME_MINUTES: 45;
16
- export declare const PV_SEQ_NUM_RESET_TIME_MINUTES: 45;
17
- export declare const REQUIRED_DATA_PROCESSING_URLS: readonly ["metroplexSocketBase", "metroplexHTTPBase", "domain"];
18
- export declare const HTTP_BODY_DROPPED_TYPE_MSG: "Dropped due to unsupported type.";
19
- export declare const HTTP_BODY_DROPPED_LENGTH_MSG: "Dropped due to length.";
20
- export declare const HTTP_BODY_NULL_STRING: "null";
21
- export declare const BLOCKED_HTTP_HEADER_KEYS: string[];
22
- export declare const PII_DIGIT_PATTERN: RegExp;
23
- export declare const PII_EMAIL_PATTERN: RegExp;
24
- export declare const HTTP_PII_BLOCKING_PATTERNS: RegExp[];
25
- export declare const DEFAULT_WEBSITE_SUBDOMAIN_PATTERN: RegExp;
26
- export declare const PII_REDACTION_REPLACEMENT_STRING: "******";
27
- export declare const DEFAULT_STACK_FRAME_FIELD_VALUE: "_";
28
- export declare const CURRENT_PV_VERSION: 5;
29
- export declare const CURRENT_METRICS_VERSION: 1;
30
- export declare const SEVERITY: {
31
- readonly error: "error";
32
- readonly warn: "warn";
33
- readonly info: "info";
34
- readonly debug: "debug";
35
- };
36
- export declare const MAX_METROPLEX_SOCKET_INNACTIVE_TIME: number;
37
- export declare const MAX_PAGEVISIT_VISITED: 300;
38
- export declare const IMG_EXTENSIONS: readonly ["jpg", "jpeg", "bmp", "gif", "png"];
39
- export declare const MAX_PAGEVISIT_EVENTS: 200;
40
- export declare const POSSIBLE_HTML_ATTRIBUTES_FOR_TEXT_VALUES: string[];
41
- export declare const MAX_CUSTOM_IDS_PER_PAGEVISIT: 10;
42
- export declare const MAX_CUSTOM_ERRORS_PER_PAGEVISIT: 500;
43
- export declare const NOIBUJS_SDK_REQUEST_HELP_CODE: "requestHelpCode";
44
- export declare const NOIBUJS_SDK_ADD_ID_FUNCTION: "addCustomAttribute";
45
- export declare const NOIBUJS_SDK_ADD_ERROR_FUNCTION: "addError";
46
- export declare const NOIBUJS_SDK_ADD_ERROR_FROM_JS_FMW_FUNCTION: "addJsSdkError";
47
- export declare const ERROR_PROPS: readonly ["url", "type", "str", "http_code", "js_err"];
48
- export declare const EVENT_TARGETS: string[];
49
- export declare const WHITELIST_HTML_ID_TEXT_REGEX = "method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button";
50
- export declare const HUMAN_READABLE_CONTENT_TYPE_REGEX = "text|json|xml|html|graphql|x-www-form-urlencoded|form-data";
51
- export declare const PV_METROPLEX_TYPE: "p";
52
- export declare const VIDEO_METROPLEX_TYPE: "v";
53
- export declare const META_DATA_METROPLEX_TYPE: "m";
54
- export declare const HTTP_DATA_METROPLEX_TYPE: "h";
55
- export declare const CUSTOM_ID_NAME_TYPE: "id_name";
56
- export declare const CUSTOM_ID_VALUE_TYPE: "id_val";
57
- export declare const BROWSER_ID_ATT_NAME: "br_id";
58
- export declare const PV_ID_ATT_NAME: "pv_id";
59
- export declare const VER_ATT_NAME: "v";
60
- export declare const PV_SEQ_ATT_NAME: "seq";
61
- export declare const VIDEO_RECORDER_ATT_NAME: "video_recorder";
62
- export declare const ON_URL_ATT_NAME: "on_url";
63
- export declare const PAGE_GROUPS_ATT_NAME = "page_groups";
64
- export declare const PAGE_TITLE_ATT_NAME = "page_title";
65
- export declare const URL_ATT_NAME: "url";
66
- export declare const REF_URL_ATT_NAME: "ref_url";
67
- export declare const STARTED_AT_ATT_NAME: "start_at";
68
- export declare const PV_EVENTS_ATT_NAME: "events";
69
- export declare const PV_PART_COUNTER_ATT_NAME: "pc";
70
- export declare const CONN_COUNT_ATT_NAME: "conc";
71
- export declare const COLLECT_VER_ATT_NAME: "cv";
72
- export declare const VIDEO_FRAG_ATT_NAME: "vid";
73
- export declare const CSS_URLS_ATT_NAME: "css_urls";
74
- export declare const END_AT_ATT_NAME: "end_at";
75
- export declare const LENGTH_ATT_NAME: "len";
76
- export declare const IS_LAST_ATT_NAME: "last";
77
- export declare const TYPE_ATT_NAME: "type";
78
- export declare const OCCURRED_AT_ATT_NAME: "occ_at";
79
- export declare const HTTP_CODE_ATT_NAME: "h_code";
80
- export declare const JS_ERROR_ATT_NAME: "j_err";
81
- export declare const GQL_ERROR_ATT_NAME: "gql_err";
82
- export declare const EVENT_EVENT_TYPE: "events";
83
- export declare const TAGNAME_ATT_NAME: "tag";
84
- export declare const SOURCE_ATT_NAME: "src";
85
- export declare const TEXT_ATT_NAME: "txt";
86
- export declare const HTMLID_ATT_NAME: "hid";
87
- export declare const HTTP_METHOD_ATT_NAME: "mtd";
88
- export declare const HTTP_RESP_CODE_ATT_NAME: "code";
89
- export declare const HTTP_RESP_TIME_ATT_NAME: "r_time";
90
- export declare const HTTP_RESP_LENGTH_ATT_NAME: "resp_len";
91
- export declare const HTTP_DATA_PAYLOAD_ATT_NAME: "rqp";
92
- export declare const HTTP_DATA_RESP_PAYLOAD_ATT_NAME: "rsp";
93
- export declare const HTTP_DATA_REQ_HEADERS_ATT_NAME: "rqh";
94
- export declare const HTTP_DATA_RESP_HEADERS_ATT_NAME: "rsh";
95
- export declare const JS_STACK_LINE_ATT_NAME: "line";
96
- export declare const JS_STACK_COL_ATT_NAME: "column";
97
- export declare const JS_STACK_METHOD_ATT_NAME: "mname";
98
- export declare const JS_STACK_FILE_ATT_NAME: "file";
99
- export declare const JS_STACK_FRAMES_ATT_NAME: "frames";
100
- export declare const JS_STACK_MESSAGE_ATT_NAME: "msg";
101
- export declare const ERROR_SOURCE_ATT_NAME: "err_src";
102
- export declare const CSS_CLASS_ATT_NAME: "class";
103
- export declare const SEQ_NUM_ATT_NAME: "seq_num";
104
- export declare const HELP_CODE_ATT_NAME: "hc";
105
- export declare const WORK_REQUEST_ATT_NAME: "wr";
106
- export declare const LANG_ATT_NAME: "lang";
107
- export declare const SCRIPT_ID_ATT_NAME: "script_id";
108
- export declare const SCRIPT_INSTANCE_ID_ATT_NAME: "script_inst_id";
109
- export declare const METROPLEX_SOCKET_INSTANCE_ID_ATT_NAME: "mp_sock_inst_id";
110
- export declare const SOCKET_INSTANCE_ID_ATT_NAME: "sock_inst_id";
111
- export declare const EXP_VIDEO_LENGTH_ATT_NAME: "exp_vid_len";
112
- export declare const PV_EXP_VF_SEQ_ATT_NAME: "exp_vf_seq";
113
- export declare const PV_EXP_PART_COUNTER_ATT_NAME: "exp_pc_seq";
114
- export declare const VIDEO_CLICKS_ATT_NAME: "vid_clicks";
115
- export declare const PV_CLICKS_ATT_NAME: "pv_clicks";
116
- export declare const DID_CUT_PV_ATT_NAME: "did_cut_pv";
117
- export declare const DID_CUT_VID_ATT_NAME: "did_cut_vid";
118
- export declare const DID_START_VID_ATT_NAME: "did_start_vid";
119
- export declare const HTTP_COUNT_EXPECTED_ATT_NAME: "exp_http";
120
- export declare const ERR_COUNT_EXPECTED_ATT_NAME: "exp_err";
121
- export declare const PV_EXP_HTTP_DATA_SEQ_ATT_NAME: "exp_http_seq";
122
- export declare const PV_HTTP_PAYLOADS_COLLECTED_ATT_NAME: "http_payloads";
123
- export declare const PV_HTTP_PAYLOADS_DROPPED_OVERSIZE_ATT_NAME: "http_drop_oversize";
124
- export declare const PV_HTTP_PAYLOADS_DROPPED_TYPE_ATT_NAME: "http_drop_type";
125
- export declare const PV_HTTP_REQUESTS_DROPPED_OVER_LIMIT: "http_over_limit";
126
- export declare const HTTP_EVENT_TYPE: "http";
127
- export declare const JS_EVENT_TYPE: "js";
128
- export declare const GQL_EVENT_TYPE: "gql";
129
- export declare const USERSTEP_EVENT_TYPE: "userstep";
130
- export declare const CLICK_EVENT_TYPE: "click";
131
- export declare const KEYBOARD_EVENT_TYPE: "kbd";
132
- export declare const ERROR_EVENT_TYPE: "err";
133
- export declare const PAGE_EVENT_TYPE: "page";
134
- export declare const APP_NAVIGATION_EVENT_TYPE = "app_nav";
135
- export declare const PAGE_VISIT_INFORMATION_ATT_NAME: "pvi";
136
- export declare const PAGE_VISIT_PART_ATT_NAME: "pvp";
137
- export declare const PAGE_VISIT_VID_FRAG_ATT_NAME: "pvvf";
138
- export declare const PAGE_VISIT_META_DATA_ATT_NAME: "pvm";
139
- export declare const PAGE_VISIT_HTTP_DATA_ATT_NAME: "pvh";
140
- export declare const VIDEO_PART_COUNT_ATT_NAME: "vpnum";
141
- export declare const CSS_SEQ_SENT: "seq_sent";
142
- export declare const CSS_RECEIVED: "received";
143
- export declare const MAX_BEACON_PAYLOAD_SIZE: 59000;
144
- export declare const MAX_RETRY_MSG_Q_SIZE = 500;
145
- export declare const MAX_METROPLEX_CONNECTION_COUNT: 100;
146
- export declare const NOIBU_INPUT_URLS: string[];
147
- export declare const METROPLEX_FRAG_ROUTE: "pv_part";
148
- export declare const METROPLEX_ERROR_ROUTE: "collect_error";
149
- export declare const METROPLEX_METRICS_ROUTE: "metrics";
150
- export declare const METROPLEX_FULL_PV_ROUTE: "pv";
151
- export declare const STOP_STORING_VID_SOCKET_MESSAGE: "vid_block";
152
- export declare const STOP_STORING_PV_SOCKET_MESSAGE: "pv_block";
153
- export declare const BLOCK_SOCKET_MESSAGE: "full_block";
154
- export declare const CLOSE_CONNECTION_FORCEFULLY: "close_conn";
155
- export declare const OK_SOCKET_MESSAGE: "ok";
156
- export declare const XML_HTTP_REQUEST_ERROR_TYPE: "XMLHttpRequest";
157
- export declare const ERROR_EVENT_ERROR_TYPE: "ErrorEvent";
158
- export declare const ERROR_EVENT_UNHANDLED_REJECTION_TYPE: "UnhandledRejectionError";
159
- export declare const EVENT_ERROR_TYPE: "Event";
160
- export declare const RESPONSE_ERROR_TYPE: "Response";
161
- export declare const GQL_ERROR_TYPE: "GQLError";
162
- export declare const WRAPPED_EXCEPTION_ERROR_TYPE: "WrappedException";
163
- export declare const FETCH_EXCEPTION_ERROR_TYPE: "FetchException";
164
- export declare const ERROR_LOG_EVENT_ERROR_TYPE: "ErrorLogEvent";
165
- export declare const CUSTOM_ERROR_EVENT_TYPE: "CustomError";
166
- export declare const CONSOLE_FUNCTION_OVERRIDES: readonly ["error", "warn", "log"];
167
- export declare const PAGE_EVENTS_WINDOW: string[];
168
- export declare const PAGE_EVENTS_DOCUMENT: string[];
169
- export declare const CONTENT_TYPE: "content-type";
170
- export declare const CONTENT_LENGTH: "content-length";
171
- /**
172
- *
173
- * frequency of video posts to metroplex
174
- */
175
- export declare function VIDEO_POST_FREQUENCY(): string | 10000;
176
- /**
177
- *
178
- * frequency of pv posts to metroplex
179
- */
180
- export declare function PV_POST_FREQUENCY(): string | 10000;
181
- /**
182
- *
183
- * Gets the script id from the cookie object, returns default if cannot be found
184
- */
185
- export declare function GET_SCRIPT_ID(): string;
186
- /**
187
- *
188
- * Checks if the script version is beta
189
- */
190
- export declare function IS_NJS_VERSION_BETA(): boolean;
191
- /**
192
- *
193
- * Gets the max metro recon number
194
- */
195
- export declare function GET_MAX_METROPLEX_RECONNECTION_NUMBER(): number;
196
- /**
197
- *
198
- * Returns the amount of time in milliseconds to delay a new connection by
199
- * if we have exceeded the max consecutive connection count
200
- */
201
- export declare function GET_METROPLEX_CONSECUTIVE_CONNECTION_DELAY(): number;
202
- /**
203
- *
204
- * gets the max page visit size buffer
205
- */
206
- export declare function GET_MAX_PAGEVISIT_SIZE(): string | 20000;
207
- /**
208
- *
209
- * gets the base url for metroplex's websocket connection
210
- */
211
- export declare function GET_METROPLEX_BASE_SOCKET_URL(): string;
212
- /**
213
- * gets the base url for metroplex's HTTP requests
214
- */
215
- export declare function GET_METROPLEX_BASE_HTTP_URL(): string;
216
- /**
217
- *
218
- * Returns the URL that accepts http post requests
219
- */
220
- export declare function GET_METROPLEX_POST_URL(): string;
221
- /**
222
- *
223
- * Returns the URL for posting metrics data to Metroplex
224
- */
225
- export declare function GET_METROPLEX_METRICS_URL(): string;
226
- /**
227
- *
228
- * gets the current env
229
- */
230
- export declare function JS_ENV(): string;
231
- /**
232
- * gets the current env
233
- */
234
- export declare function GET_DEVICE_ENV(): string;
235
- export declare const METROPLEX_RETRY_FREQUENCY: 30000;
236
- export declare const STACK_TRACE_SANITIZE_REGEXP: RegExp;
237
- export declare const BLOCKLISTED_DOMAINS: {
238
- 'input.noibu.com': boolean;
239
- 'input.staging.noibu.com': boolean;
240
- 'vf.noibu.com': boolean;
241
- 'vf.staging.noibu.com': boolean;
242
- 'cdn.noibu.com': boolean;
243
- };
244
- export declare const MAX_RECORDER_EVENT_BUFFER = 10;
245
- export declare const MAX_TIME_FOR_RECORDER_USER_EVENTS = 2000;
246
- export declare const POST_METRICS_EVENT_NAME = "noibuPostMetrics";
247
- export declare const PAGE_CHECK_ERROR_ATT_NAME = "pagecheck_err";
248
- export declare const RESOURCE_ERROR_ATT_NAME = "res_err";
249
- export declare const GQL_EXTENSIONS_ATT_NAME = "extensions";
250
- export declare const GQL_LOCATIONS_ATT_NAME = "locations";
251
- export declare const GQL_SRC_ATT_NAME = "src";
252
- export declare const GQL_PATH_ATT_NAME = "path";
253
- export declare const GQL_LINE_ATT_NAME = "line";
254
- export declare const GQL_COLUMN_ATT_NAME = "column";
255
- export declare const GQL_MESSAGE_ATT_NAME = "message";
256
- export declare const GLOBAL_REASSIGN_ERROR_TYPE = "GlobalReassignError";
257
- export declare const PAGE_CHECK_ERROR_TYPE = "PageCheckError";
258
- export declare const IMAGE_ERROR_TYPE = "ImageError";
259
- export declare const JS_STACK_CAUSE_ATT_NAME = "cause";
260
- export declare const CUSTOM_ATTRIBUTE_TOTAL_COUNT_ATT_NAME = "cust_attr_total";
261
- export declare const CUSTOM_ATTRIBUTE_FAIL_COUNT_ATT_NAME = "cust_attr_fail";
262
- export declare const CUSTOM_ATTRIBUTE_KEY_COUNT_ATT_NAME = "cust_attr_key";
263
- export declare const OTHER_METRICS_ATT_NAME = "omm";
264
- export declare const OTHER_METRICS_KEYS: {
265
- readonly STORAGE_FULL: "sf";
266
- readonly STORAGE_UNAVAILABLE: "su";
267
- readonly STORAGE_UNAVAILABLE_SECURITY_ERROR: "suse";
268
- };
269
- export declare const BODY_USED_ERROR = "Response data unavailable due to an improperly wrapped fetch call";
270
- export declare const MAX_HTTP_DATA_IF_ERROR_EVENT_COUNT = 120;
271
- export declare const MAX_SUCCESS_HTTP_DATA_PAYLOAD_LENGTH = 65536;
272
- export declare const LOCATION_EVENT_TYPE = "loc";
273
- export declare const ECOMMERCE_EVENT_TYPE = "ecommerce";
274
- export declare const NETWORK_STATS_EVENT_TYPE = "network";
275
- export declare const TITLE_EVENT_TYPE = "title";
276
- export declare const PAGE_TYPE_EVENT_TYPE = "page_type";
277
- export declare const HTTP_DATA_COLLECTION_FLAG_NAME = "http_data_collection";
278
- export declare const HTTP_DATA_PAYLOAD_URL_REGEXES_FLAG_NAME = "http_re";
279
- export declare const HELP_CODE_EVENT_NAME = "noibuHelpCode";
280
- export declare const ATTRIBUTE_SELECTORS_ATT_NAME = "att_sel";
281
- export declare const WIN_NJS_VERSION_ATT_NAME = "njs_version";
282
- export declare const WIN_SCRIPT_ID_ATT_NAME = "scriptID";
283
- export declare const WIN_BLOCKED_SELECTOR_ATT_NAME = "sel";
284
- export declare const DISABLED_STATUS_KEY = "DisabledStatus";
285
- export declare const CLIENT_UNLOCK_TIME_KEY = "ClientUnlockTime";
286
- export declare const BROWSER_ID_KEY = "BrowserId";
287
- export declare const CURRENT_PAGE_VISIT_COUNT_KEY = "CurrentPageVisitCount";
288
- export declare const PAGE_VISIT_ID_KEY = "pvId";
289
- export declare const LAST_ACTIVE_TIME_KEY = "LastActive";
290
- export declare const HELP_CODE_HASH_PARAM_NAME = "#helpcode";
@@ -1,14 +0,0 @@
1
- import 'react-native-url-polyfill/auto';
2
- import globalInit from './init';
3
- import { ErrorBoundary as _ErrorBoundary } from '../react/ErrorBoundary';
4
- /**
5
- * @param config
6
- */
7
- export declare const setupNoibu: typeof globalInit;
8
- export declare const NoibuJS: {
9
- requestHelpCode: (alert?: boolean) => Promise<string>;
10
- addCustomAttribute: (name: string, value: string) => Promise<string>;
11
- addError: (customError: Error) => string;
12
- addJsSdkError: (customError: string, errorSource: string) => string;
13
- };
14
- export declare const ErrorBoundary: typeof _ErrorBoundary;
@@ -1,5 +0,0 @@
1
- import { CustomerConfig } from '../../types/Config';
2
- /**
3
- * initilializes the script to start executing all of NJS features
4
- */
5
- export default function globalInit(customerConfig: CustomerConfig): Promise<void>;
@@ -1,18 +0,0 @@
1
- import { Monitor, Singleton } from './BaseMonitor';
2
- /**
3
- * Attaches corresponding listener to the passed navigation integration
4
- */
5
- export declare class AppNavigationMonitor extends Singleton implements Monitor {
6
- /**
7
- * Main method for starting the monitoring
8
- */
9
- monitor(): void;
10
- /**
11
- * handler for updating navigation breadcrumbs and notifying metro of location change
12
- */
13
- private static onNavigation;
14
- /**
15
- * Called when the event needs to be emitted
16
- */
17
- private static reportLocationChange;
18
- }
@@ -1,13 +0,0 @@
1
- export interface Monitor {
2
- monitor(): void;
3
- }
4
- /**
5
- * Singleton pattern with our flavor
6
- */
7
- export declare abstract class Singleton {
8
- private static instances;
9
- /** returns singleton instance */
10
- static getInstance<T extends Singleton, A extends any[]>(this: new (...args: A) => T, ...args: A): T;
11
- /** used for testing only */
12
- protected resetInstances(): void;
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,31 +0,0 @@
1
- /** @module ClickMonitor */
2
- import { Monitor, Singleton } from './BaseMonitor';
3
- /** Monitors the clicks which we capture and later process */
4
- export declare class ClickMonitor extends Singleton implements Monitor {
5
- private static textCapturedWhiteListRegex;
6
- private static htmlIDAllowListRegex;
7
- private static originalCreateEventHandlers;
8
- /** Starts monitoring clicks on every Press-able component */
9
- monitor(): void;
10
- /**
11
- * Handles a single click event
12
- */
13
- private static onClickHandle;
14
- /** Gets the textual content from an element, if any
15
- */
16
- private static getTextualContentFromEl;
17
- /** Parse and trim text */
18
- private static trimText;
19
- /**
20
- * Recursively parses element's inner content and masks blocked css classes
21
- */
22
- private static parseInnerContent;
23
- /**
24
- * Gets selectors to prevent those elements from being recorded
25
- */
26
- private static getBlockedElements;
27
- /**
28
- * normalize value and append to the resulting text if not empty
29
- */
30
- private static parseAndAppendText;
31
- }
@@ -1,63 +0,0 @@
1
- import { Monitor, Singleton } from './BaseMonitor';
2
- type WrappedFunction<T extends Function = Function> = T & Partial<{
3
- __noibu__: boolean;
4
- __noibu_wrapped__: T;
5
- }>;
6
- /**
7
- * wraps a provided function into a function that try and catches
8
- * the original function, doing so allows us to catch errors
9
- * functionToWrap: function to be wrapped
10
- * @param {} functionToWrap
11
- */
12
- export declare function wrap(functionToWrap: WrappedFunction): Function;
13
- /**
14
- * Monitors the errors happening on the window
15
- */
16
- export declare class ErrorMonitor extends Singleton implements Monitor {
17
- /** base method */
18
- monitor(): void;
19
- /** proxy error utils */
20
- private static configureErrorUtilsHandler;
21
- /**
22
- * Handles a single error event
23
- */
24
- private static onErrorHandler;
25
- /** proxy hermes engine */
26
- private static configureHermesHooks;
27
- /**
28
- * handler for promise rejection failures
29
- */
30
- private static onPromiseRejectionHandler;
31
- /**
32
- * wraps and replaces the addEventListener property
33
- * of event targets to try and catch errors
34
- * eventTargetString: event target name
35
- */
36
- private static configureEventListeners;
37
- /** iterates arguments to try to extract errors from them
38
- */
39
- private static processErrorLogArguments;
40
- /**
41
- * Constructs error objects based on console args.
42
- * Relies on isStackTrace() to determine if arg is a stack trace, otherwise the arg must be a message.
43
- *
44
- * If there are multiple stack traces or the number of error messages is not equal to one,
45
- * it maps the stack traces to objects with their respective first lines as messages.
46
- * Otherwise, if there is exactly one stack trace and one error message,
47
- * it constructs an array with a single object containing the first stack trace and the first error message.
48
- * @param {Array<string>} args
49
- */
50
- private static constructErrors;
51
- /**
52
- * returns boolean that indicates wether we should
53
- * ignore the next error event caught by the error event
54
- * listener.
55
- */
56
- private static shouldIgnoreError;
57
- /**
58
- * transform a log into an error since React hides component errors
59
- * https://reactjs.org/docs/error-boundaries.html
60
- */
61
- private static processErrorLog;
62
- }
63
- export {};
@@ -1,20 +0,0 @@
1
- import { Monitor, Singleton } from './BaseMonitor';
2
- /**
3
- * KeyboardInputMonitor is a listener class that attaches a
4
- * keyboard input listener of the document object.
5
- */
6
- export declare class KeyboardInputMonitor extends Singleton implements Monitor {
7
- private static originalRender;
8
- /**
9
- * Begins the monitoring process
10
- * we currently only monitor two input locations: textarea and input
11
- */
12
- monitor(): void;
13
- /**
14
- * Validates an event
15
- */
16
- static handle(uiViewClassName: string, props: {
17
- placeholder?: string;
18
- testID?: string;
19
- }): void;
20
- }
@@ -1,20 +0,0 @@
1
- import { Monitor, Singleton } from './BaseMonitor';
2
- type Event = any;
3
- /** Monitors the page events which we capture and later process */
4
- export declare class PageMonitor extends Singleton implements Monitor {
5
- /** Starts monitoring page events on the document */
6
- monitor(): void;
7
- /**
8
- * Handles a single page event
9
- * todo: don't think these events exist in RN world
10
- */
11
- _onPageEventHandle(event: Event): void;
12
- /** Returns document state */
13
- getDocumentState(): "hidden" | "active" | "passive";
14
- /**
15
- * Returns object size in bytes
16
- * @param {} obj
17
- */
18
- getSizeInBytes(obj: any): number;
19
- }
20
- export {};
@@ -1,94 +0,0 @@
1
- /** @module RequestMonitor */
2
- import 'react-native/Libraries/Network/fetch';
3
- import { Monitor, Singleton } from './BaseMonitor';
4
- /**
5
- * Monitors all requests
6
- */
7
- export default class RequestMonitor extends Singleton implements Monitor {
8
- /** main method */
9
- monitor(): void;
10
- /**
11
- * Gets a response text Promise out of Response & headers. Returns reason if bundler decides to drop text.
12
- * Due to async nature of text() and async function sent to Promise.all,
13
- * our code race competes with client's code consuming the response.
14
- * So at this point engine somehow gets access to the original ReadableStream and marks it as locked,
15
- * thus client code may throw an error.
16
- */
17
- private static consumeResponseAndGetBodyText;
18
- /**
19
- * Generates new PVEventHTTP
20
- */
21
- private static getPvEventHttp;
22
- /**
23
- * Gets headers from request or request options. Handles different scenarios where simple conversion is not possible
24
- */
25
- private static getRequestHeaders;
26
- /**
27
- * Gets response headers.
28
- * It is always a Headers object.
29
- */
30
- private static getResponseHeaders;
31
- /**
32
- * Gets request body from body strings or Request options
33
- */
34
- private static getRequestBody;
35
- /**
36
- * Returns the parameters to pass the PageVisitEventHTTP constructor. Specific to the fetch wrapper.
37
- */
38
- private static getHttpDataFromFetch;
39
- /** Clones Response / Request or returns original object if cloning is not possible */
40
- private static cloneResponse;
41
- /**
42
- * Handles fetch response safely. Reports PageVisitEventHTTP and error to Pagevisit if needed.
43
- */
44
- private static safeHandleFetchResponse;
45
- /**
46
- * Safe function to get method and url from fetch args
47
- */
48
- private static getMethodUrlFromFetchArgs;
49
- /**
50
- * Setting up the wrapper around fetch functions to try and
51
- * catch http errors
52
- */
53
- private static setupGlobalFetchWrapper;
54
- /**
55
- * Does a check if data collection is enabled and combines it into HttpDataBundle
56
- */
57
- private static getHttpDataFromXhr;
58
- /**
59
- * on loadend we catch the event and
60
- * make sure it was correct
61
- */
62
- private static loadendHandler;
63
- /**
64
- * Handles fetch failure
65
- */
66
- private static handleFetchFailure;
67
- /** gets method from xhr */
68
- private static getMethodFromXHR;
69
- /**
70
- * Wraps the send prototype of the xmlhttp object
71
- * We set nbuWrapper to the handler function so if this returns an error
72
- * the trace message will start with nbuWrapper which would allow us to
73
- * detect that this is a wrapped function and not a NoibuJS error
74
- */
75
- private static wrapXMLHTTPSend;
76
- /**
77
- * Wraps the open prototype of the xmlhttp object
78
- * We set nbuWrapper to the handler function so if this returns an error
79
- * the trace message will start with nbuWrapper which would allow us to
80
- * detect that this is a wrapped function and not a NoibuJS error
81
- */
82
- private static wrapXMLHTTPOpen;
83
- /**
84
- * Replaces the native XMLHTTPRequest.setHeader() function. We use this to build an array of
85
- * request headers as these are not stored by the XMLHTTPRequest object.
86
- * @param {object} proto window.XMLHTTPRequest's prototype
87
- */
88
- private static wrapXMLHTTPSetRequestHeader;
89
- /**
90
- * Setting up the wrapper around send functions to try and
91
- * catch http errors
92
- */
93
- private static setupGlobalXMLHttpWrapper;
94
- }
@@ -1,59 +0,0 @@
1
- /**
2
- * Try detecting GraphQL errors from http response
3
- */
4
- export default class GqlErrorValidator {
5
- /**
6
- * Retrieves GQL error object based on fetch request/response
7
- */
8
- static fromFetch(url: string, options: RequestInit | undefined, request: Request | undefined, response: Response): Promise<unknown[]>;
9
- /**
10
- * Retrieves GQL error object based on XHR object
11
- */
12
- static fromXhr(url: string, xhr: unknown): Promise<unknown[]>;
13
- /**
14
- * Try safely parse a string and return null if fails
15
- */
16
- static _parseJsonSafely(content: string): any;
17
- /**
18
- * Try to get content type for fetch arguments
19
- */
20
- static _getContentTypeFromFetchArguments(options?: RequestInit, request?: Request): string;
21
- /**
22
- * Checks if request is aborted
23
- * If it has been aborted we are not able to consume the response
24
- */
25
- static _isRequestAborted(options?: RequestInit, request?: RequestInit): boolean;
26
- /**
27
- * Determines if request should be processed
28
- */
29
- static _shouldHandleRequest(url: string, contentType?: string | null): boolean;
30
- /**
31
- * Sanitizes payload object
32
- */
33
- static _validate(data: unknown, validationIssues: string[]): unknown[];
34
- /**
35
- * Sanitizes message object
36
- */
37
- static _validateMessage(error: object): void;
38
- /**
39
- * Sanitizes extensions object
40
- * @param {any} error
41
- */
42
- static _validateExtensions(error: any): void;
43
- /**
44
- * Sanitizes locations object
45
- */
46
- static _validateLocations(error: object, validationIssues: string[]): void;
47
- /**
48
- * Sanitizes path object
49
- */
50
- static _validatePath(error: object, validationIssues: string[]): void;
51
- /**
52
- * Posts error
53
- */
54
- static _postError(message: unknown): void;
55
- /**
56
- * Posts issue found during object sanitization
57
- */
58
- static _postValidationIssues(validationIssues: string[]): void;
59
- }