@oodle-ai/mobile-sdk-reactnative 0.0.0-stage → 0.1.0

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 (166) hide show
  1. package/LICENSE +201 -0
  2. package/OodleMobileSdkReactNative.podspec +24 -0
  3. package/README.md +191 -2
  4. package/android/build.gradle +55 -0
  5. package/android/proguard-rules.pro +5 -0
  6. package/android/src/main/AndroidManifest.xml +4 -0
  7. package/android/src/main/java/ai/oodle/rum/Connectivity.kt +19 -0
  8. package/android/src/main/java/ai/oodle/rum/CrashReporter.kt +88 -0
  9. package/android/src/main/java/ai/oodle/rum/DeviceInfo.kt +50 -0
  10. package/android/src/main/java/ai/oodle/rum/ExitReasons.kt +104 -0
  11. package/android/src/main/java/ai/oodle/rum/NativeEvents.kt +24 -0
  12. package/android/src/main/java/ai/oodle/rum/OodleRumModule.kt +96 -0
  13. package/android/src/main/java/ai/oodle/rum/OodleRumPackage.kt +26 -0
  14. package/android/src/main/java/ai/oodle/rum/Storage.kt +84 -0
  15. package/android/src/main/java/ai/oodle/rum/Vitals.kt +188 -0
  16. package/android/src/main/java/ai/oodle/rum/Watchdog.kt +81 -0
  17. package/android/src/main/java/ai/oodle/rum/WireframeCapture.kt +398 -0
  18. package/bin/oodle-rum-upload.mjs +104 -0
  19. package/ios/OodleCrashReporter.h +16 -0
  20. package/ios/OodleCrashReporter.m +202 -0
  21. package/ios/OodleRum.h +18 -0
  22. package/ios/OodleRum.mm +129 -0
  23. package/ios/OodleRumImpl.swift +450 -0
  24. package/ios/WireframeWalker.swift +279 -0
  25. package/lib/core/clock.d.ts +19 -0
  26. package/lib/core/clock.js +47 -0
  27. package/lib/core/clock.js.map +1 -0
  28. package/lib/core/config.d.ts +142 -0
  29. package/lib/core/config.js +178 -0
  30. package/lib/core/config.js.map +1 -0
  31. package/lib/core/consent.d.ts +5 -0
  32. package/lib/core/consent.js +33 -0
  33. package/lib/core/consent.js.map +1 -0
  34. package/lib/core/context.d.ts +36 -0
  35. package/lib/core/context.js +172 -0
  36. package/lib/core/context.js.map +1 -0
  37. package/lib/core/flags.d.ts +3 -0
  38. package/lib/core/flags.js +20 -0
  39. package/lib/core/flags.js.map +1 -0
  40. package/lib/core/ids.d.ts +7 -0
  41. package/lib/core/ids.js +40 -0
  42. package/lib/core/ids.js.map +1 -0
  43. package/lib/core/internal.d.ts +6 -0
  44. package/lib/core/internal.js +10 -0
  45. package/lib/core/internal.js.map +1 -0
  46. package/lib/core/logger.d.ts +8 -0
  47. package/lib/core/logger.js +38 -0
  48. package/lib/core/logger.js.map +1 -0
  49. package/lib/core/native.d.ts +71 -0
  50. package/lib/core/native.js +156 -0
  51. package/lib/core/native.js.map +1 -0
  52. package/lib/core/rate-limiter.d.ts +7 -0
  53. package/lib/core/rate-limiter.js +31 -0
  54. package/lib/core/rate-limiter.js.map +1 -0
  55. package/lib/core/session.d.ts +51 -0
  56. package/lib/core/session.js +196 -0
  57. package/lib/core/session.js.map +1 -0
  58. package/lib/core/size.d.ts +15 -0
  59. package/lib/core/size.js +68 -0
  60. package/lib/core/size.js.map +1 -0
  61. package/lib/core/tags.d.ts +10 -0
  62. package/lib/core/tags.js +33 -0
  63. package/lib/core/tags.js.map +1 -0
  64. package/lib/core/telemetry.d.ts +6 -0
  65. package/lib/core/telemetry.js +37 -0
  66. package/lib/core/telemetry.js.map +1 -0
  67. package/lib/core/tracing.d.ts +9 -0
  68. package/lib/core/tracing.js +57 -0
  69. package/lib/core/tracing.js.map +1 -0
  70. package/lib/core/transport.d.ts +76 -0
  71. package/lib/core/transport.js +560 -0
  72. package/lib/core/transport.js.map +1 -0
  73. package/lib/core/user.d.ts +12 -0
  74. package/lib/core/user.js +41 -0
  75. package/lib/core/user.js.map +1 -0
  76. package/lib/events/actions.d.ts +13 -0
  77. package/lib/events/actions.js +147 -0
  78. package/lib/events/actions.js.map +1 -0
  79. package/lib/events/emit.d.ts +21 -0
  80. package/lib/events/emit.js +144 -0
  81. package/lib/events/emit.js.map +1 -0
  82. package/lib/events/errors.d.ts +19 -0
  83. package/lib/events/errors.js +257 -0
  84. package/lib/events/errors.js.map +1 -0
  85. package/lib/events/lifecycle.d.ts +7 -0
  86. package/lib/events/lifecycle.js +101 -0
  87. package/lib/events/lifecycle.js.map +1 -0
  88. package/lib/events/longtasks.d.ts +2 -0
  89. package/lib/events/longtasks.js +42 -0
  90. package/lib/events/longtasks.js.map +1 -0
  91. package/lib/events/resources.d.ts +15 -0
  92. package/lib/events/resources.js +156 -0
  93. package/lib/events/resources.js.map +1 -0
  94. package/lib/events/tap-target.d.ts +42 -0
  95. package/lib/events/tap-target.js +191 -0
  96. package/lib/events/tap-target.js.map +1 -0
  97. package/lib/events/view-state.d.ts +13 -0
  98. package/lib/events/view-state.js +25 -0
  99. package/lib/events/view-state.js.map +1 -0
  100. package/lib/events/views.d.ts +21 -0
  101. package/lib/events/views.js +347 -0
  102. package/lib/events/views.js.map +1 -0
  103. package/lib/index.d.ts +16 -0
  104. package/lib/index.js +24 -0
  105. package/lib/index.js.map +1 -0
  106. package/lib/navigation/react-navigation.d.ts +33 -0
  107. package/lib/navigation/react-navigation.js +61 -0
  108. package/lib/navigation/react-navigation.js.map +1 -0
  109. package/lib/react/OodlePrivacy.d.ts +15 -0
  110. package/lib/react/OodlePrivacy.js +13 -0
  111. package/lib/react/OodlePrivacy.js.map +1 -0
  112. package/lib/react/OodleProvider.d.ts +18 -0
  113. package/lib/react/OodleProvider.js +72 -0
  114. package/lib/react/OodleProvider.js.map +1 -0
  115. package/lib/replay/recorder.d.ts +22 -0
  116. package/lib/replay/recorder.js +317 -0
  117. package/lib/replay/recorder.js.map +1 -0
  118. package/lib/replay/rrweb.d.ts +105 -0
  119. package/lib/replay/rrweb.js +335 -0
  120. package/lib/replay/rrweb.js.map +1 -0
  121. package/lib/rum.d.ts +52 -0
  122. package/lib/rum.js +281 -0
  123. package/lib/rum.js.map +1 -0
  124. package/lib/specs/NativeOodleRum.d.ts +43 -0
  125. package/lib/specs/NativeOodleRum.js +5 -0
  126. package/lib/specs/NativeOodleRum.js.map +1 -0
  127. package/lib/version.d.ts +1 -0
  128. package/lib/version.js +6 -0
  129. package/lib/version.js.map +1 -0
  130. package/package.json +91 -4
  131. package/react-native.config.js +10 -0
  132. package/src/core/clock.ts +43 -0
  133. package/src/core/config.ts +344 -0
  134. package/src/core/consent.ts +32 -0
  135. package/src/core/context.ts +189 -0
  136. package/src/core/flags.ts +15 -0
  137. package/src/core/ids.ts +35 -0
  138. package/src/core/internal.ts +6 -0
  139. package/src/core/logger.ts +37 -0
  140. package/src/core/native.ts +201 -0
  141. package/src/core/rate-limiter.ts +34 -0
  142. package/src/core/session.ts +209 -0
  143. package/src/core/size.ts +79 -0
  144. package/src/core/tags.ts +30 -0
  145. package/src/core/telemetry.ts +35 -0
  146. package/src/core/tracing.ts +60 -0
  147. package/src/core/transport.ts +590 -0
  148. package/src/core/user.ts +45 -0
  149. package/src/events/actions.ts +157 -0
  150. package/src/events/emit.ts +131 -0
  151. package/src/events/errors.ts +283 -0
  152. package/src/events/lifecycle.ts +102 -0
  153. package/src/events/longtasks.ts +40 -0
  154. package/src/events/resources.ts +167 -0
  155. package/src/events/tap-target.ts +210 -0
  156. package/src/events/view-state.ts +30 -0
  157. package/src/events/views.ts +356 -0
  158. package/src/index.ts +34 -0
  159. package/src/navigation/react-navigation.ts +72 -0
  160. package/src/react/OodlePrivacy.tsx +25 -0
  161. package/src/react/OodleProvider.tsx +88 -0
  162. package/src/replay/recorder.ts +310 -0
  163. package/src/replay/rrweb.ts +460 -0
  164. package/src/rum.ts +295 -0
  165. package/src/specs/NativeOodleRum.ts +51 -0
  166. package/src/version.ts +2 -0
@@ -0,0 +1,347 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onViewStart = onViewStart;
4
+ exports.startView = startView;
5
+ exports.stopView = stopView;
6
+ exports.getActiveView = getActiveView;
7
+ exports.reportViewLoaded = reportViewLoaded;
8
+ exports.reportAppFullyDisplayed = reportAppFullyDisplayed;
9
+ exports.viewElapsedMs = viewElapsedMs;
10
+ exports.addViewAttributes = addViewAttributes;
11
+ exports.pauseViews = pauseViews;
12
+ exports.resumeViews = resumeViews;
13
+ exports.restartViewForNewSession = restartViewForNewSession;
14
+ exports.flushActiveView = flushActiveView;
15
+ exports.resetViews = resetViews;
16
+ const config_1 = require("../core/config");
17
+ const context_1 = require("../core/context");
18
+ const ids_1 = require("../core/ids");
19
+ const native_1 = require("../core/native");
20
+ const session_1 = require("../core/session");
21
+ const emit_1 = require("./emit");
22
+ const view_state_1 = require("./view-state");
23
+ const clock_1 = require("../core/clock");
24
+ /** How often an open view is re-sent with its time spent so far. */
25
+ const VIEW_REFRESH_MS = 30000;
26
+ /** A change in a view's counts is sent at most this often. */
27
+ const UPDATE_THROTTLE_MS = 3000;
28
+ /** A first view later than this after process start is not a cold start. */
29
+ const COLD_START_WINDOW_MS = 60000;
30
+ let active = null;
31
+ /** The view to restart when the app returns to the foreground. */
32
+ let paused = null;
33
+ let refreshTimer = null;
34
+ let throttleTimer = null;
35
+ let firstViewSeen = false;
36
+ let fullyDisplayedReported = false;
37
+ let coldStart = null;
38
+ const startListeners = [];
39
+ function emptyVitals() {
40
+ return {
41
+ durationMs: 0,
42
+ refreshSum: 0,
43
+ slow: 0,
44
+ frozen: 0,
45
+ memSum: 0,
46
+ memDuration: 0,
47
+ memMax: 0,
48
+ cpuSum: 0,
49
+ cpuDuration: 0,
50
+ };
51
+ }
52
+ function onViewStart(fn) {
53
+ startListeners.push(fn);
54
+ }
55
+ function mergeVitals(acc, v) {
56
+ const d = typeof v.duration_ms === 'number' && v.duration_ms > 0 ? v.duration_ms : 0;
57
+ if (d === 0)
58
+ return;
59
+ acc.durationMs += d;
60
+ if (typeof v.refresh_rate_avg === 'number')
61
+ acc.refreshSum += v.refresh_rate_avg * d;
62
+ if (typeof v.refresh_rate_min === 'number' && v.refresh_rate_min > 0) {
63
+ acc.refreshMin =
64
+ acc.refreshMin === undefined ? v.refresh_rate_min : Math.min(acc.refreshMin, v.refresh_rate_min);
65
+ }
66
+ acc.slow += v.slow_frame_count ?? 0;
67
+ acc.frozen += v.frozen_frame_count ?? 0;
68
+ if (typeof v.memory_avg_bytes === 'number' && v.memory_avg_bytes > 0) {
69
+ acc.memSum += v.memory_avg_bytes * d;
70
+ acc.memDuration += d;
71
+ }
72
+ acc.memMax = Math.max(acc.memMax, v.memory_max_bytes ?? 0);
73
+ if (typeof v.cpu_ms_per_sec === 'number') {
74
+ acc.cpuSum += v.cpu_ms_per_sec * d;
75
+ acc.cpuDuration += d;
76
+ }
77
+ }
78
+ function collectVitals() {
79
+ if (!active || !(0, config_1.getConfig)()?.vitals)
80
+ return;
81
+ mergeVitals(active.vitals, native_1.native.collectVitals());
82
+ }
83
+ function vitalsFields(acc) {
84
+ const out = {};
85
+ if (acc.durationMs <= 0)
86
+ return out;
87
+ if (acc.refreshSum > 0)
88
+ out.refresh_rate_avg = round(acc.refreshSum / acc.durationMs, 1);
89
+ if (acc.refreshMin !== undefined)
90
+ out.refresh_rate_min = round(acc.refreshMin, 1);
91
+ out.slow_frame_count = acc.slow;
92
+ out.frozen_frame_count = acc.frozen;
93
+ if (acc.memDuration > 0)
94
+ out.memory_avg_bytes = Math.round(acc.memSum / acc.memDuration);
95
+ if (acc.memMax > 0)
96
+ out.memory_max_bytes = acc.memMax;
97
+ if (acc.cpuDuration > 0)
98
+ out.cpu_ms_per_sec = round(acc.cpuSum / acc.cpuDuration, 1);
99
+ return out;
100
+ }
101
+ function round(n, digits) {
102
+ const f = Math.pow(10, digits);
103
+ return Math.round(n * f) / f;
104
+ }
105
+ function send(v, final) {
106
+ collectVitals();
107
+ v.seq++;
108
+ const now = Date.now();
109
+ const d = (0, native_1.getDeviceInfo)();
110
+ const data = {
111
+ event_type: 'view',
112
+ timestamp: (0, clock_1.isoTime)(now),
113
+ view_id: v.id,
114
+ app_screen_name: v.name,
115
+ view_loading_type: v.loadingType,
116
+ view_update_seq: v.seq,
117
+ view_is_active: final ? 0 : 1,
118
+ view_start: (0, clock_1.isoTime)(v.startMs),
119
+ view_time_spent_ms: Math.max(0, now - v.startMs),
120
+ view_action_count: v.actionCount,
121
+ view_error_count: v.errorCount,
122
+ view_resource_count: v.resourceCount,
123
+ view_long_task_count: v.longTaskCount,
124
+ view_frustration_count: v.frustrationCount,
125
+ screen_width: Math.round(d.screenWidth),
126
+ screen_height: Math.round(d.screenHeight),
127
+ ...vitalsFields(v.vitals),
128
+ };
129
+ if (v.loadingTimeMs !== undefined)
130
+ data.view_loading_time_ms = v.loadingTimeMs;
131
+ if (v.appStartMs !== undefined) {
132
+ data.app_start_ms = v.appStartMs;
133
+ data.app_start_type = v.appStartType;
134
+ }
135
+ if (v.ttfdMs !== undefined)
136
+ data.app_ttfd_ms = v.ttfdMs;
137
+ const attrs = (0, emit_1.attributesJSON)(v.attributes);
138
+ if (attrs)
139
+ data.event_attributes = attrs;
140
+ // Only the active view is sent, and a view's last update is sent before
141
+ // the next view becomes current, so the event context is this view.
142
+ (0, emit_1.emitViewUpdate)(data);
143
+ }
144
+ /** Counts an event in the view it happened in, and sends the view soon. */
145
+ function countInView(data) {
146
+ if (!active)
147
+ return;
148
+ switch (data.event_type) {
149
+ case 'action':
150
+ if (data.is_frustration === 1)
151
+ active.frustrationCount++;
152
+ else
153
+ active.actionCount++;
154
+ break;
155
+ case 'error':
156
+ active.errorCount++;
157
+ break;
158
+ case 'resource':
159
+ active.resourceCount++;
160
+ break;
161
+ case 'long_task':
162
+ active.longTaskCount++;
163
+ break;
164
+ default:
165
+ return;
166
+ }
167
+ if (throttleTimer)
168
+ return;
169
+ const view = active;
170
+ throttleTimer = setTimeout(() => {
171
+ throttleTimer = null;
172
+ if (active === view)
173
+ send(view, false);
174
+ }, UPDATE_THROTTLE_MS);
175
+ }
176
+ (0, emit_1.setViewCounter)(countInView);
177
+ function ensureRefreshTimer() {
178
+ if (refreshTimer)
179
+ return;
180
+ refreshTimer = setInterval(() => {
181
+ if (active)
182
+ send(active, false);
183
+ }, VIEW_REFRESH_MS);
184
+ }
185
+ function stopRefreshTimer() {
186
+ if (refreshTimer)
187
+ clearInterval(refreshTimer);
188
+ refreshTimer = null;
189
+ if (throttleTimer)
190
+ clearTimeout(throttleTimer);
191
+ throttleTimer = null;
192
+ }
193
+ function measureColdStart(view) {
194
+ const processStart = (0, native_1.getDeviceInfo)().processStartMs;
195
+ if (!processStart || view.startMs - processStart > COLD_START_WINDOW_MS)
196
+ return;
197
+ const done = () => {
198
+ const ms = Date.now() - processStart;
199
+ coldStart = { ms, viewId: view.id };
200
+ view.appStartMs = ms;
201
+ view.appStartType = 'cold';
202
+ if (active === view)
203
+ send(view, false);
204
+ };
205
+ // The frame after the first view's render is the first one the user sees.
206
+ if (typeof requestAnimationFrame === 'function') {
207
+ requestAnimationFrame(() => setTimeout(done, 0));
208
+ }
209
+ else {
210
+ setTimeout(done, 0);
211
+ }
212
+ }
213
+ function startView(key, name, attributes, startMs = Date.now()) {
214
+ if (!(0, emit_1.canRecord)())
215
+ return;
216
+ if (active) {
217
+ if (active.key === key)
218
+ return;
219
+ stopView(active.key);
220
+ }
221
+ const viewName = name || key;
222
+ const { url, path } = (0, context_1.viewUrlFor)(viewName);
223
+ // Start or renew the session first, so a renewal cannot restart the
224
+ // view that is being created here.
225
+ const sessionId = (0, session_1.getSession)(true).id;
226
+ if ((0, config_1.getConfig)()?.vitals)
227
+ native_1.native.collectVitals(); // reset the interval
228
+ const view = {
229
+ id: (0, ids_1.uuid)(),
230
+ sessionId,
231
+ key,
232
+ name: viewName,
233
+ url,
234
+ path,
235
+ startMs,
236
+ loadingType: firstViewSeen ? 'route_change' : 'initial_load',
237
+ seq: 0,
238
+ attributes,
239
+ actionCount: 0,
240
+ errorCount: 0,
241
+ resourceCount: 0,
242
+ longTaskCount: 0,
243
+ frustrationCount: 0,
244
+ vitals: emptyVitals(),
245
+ };
246
+ active = view;
247
+ paused = null;
248
+ (0, view_state_1.setCurrentViewInfo)(view);
249
+ send(view, false);
250
+ (0, context_1.saveLastContext)();
251
+ ensureRefreshTimer();
252
+ if (!firstViewSeen) {
253
+ firstViewSeen = true;
254
+ measureColdStart(view);
255
+ }
256
+ for (const fn of startListeners) {
257
+ try {
258
+ fn(view);
259
+ }
260
+ catch {
261
+ // listeners are best effort
262
+ }
263
+ }
264
+ }
265
+ function stopView(key) {
266
+ if (!active || (key !== undefined && active.key !== key))
267
+ return;
268
+ const v = active;
269
+ active = null;
270
+ send(v, true);
271
+ stopRefreshTimer();
272
+ }
273
+ function getActiveView() {
274
+ return active;
275
+ }
276
+ /** Marks the current view as loaded. Sets `view_loading_time_ms`. */
277
+ function reportViewLoaded(overwrite = false) {
278
+ if (!active)
279
+ return;
280
+ if (active.loadingTimeMs !== undefined && !overwrite)
281
+ return;
282
+ active.loadingTimeMs = Date.now() - active.startMs;
283
+ send(active, false);
284
+ }
285
+ /** Time to full display: the app start until its first screen has its data. */
286
+ function reportAppFullyDisplayed() {
287
+ if (fullyDisplayedReported)
288
+ return;
289
+ const processStart = (0, native_1.getDeviceInfo)().processStartMs;
290
+ if (!processStart || !coldStart)
291
+ return;
292
+ fullyDisplayedReported = true;
293
+ const ms = Date.now() - processStart;
294
+ if (active) {
295
+ active.ttfdMs = ms;
296
+ send(active, false);
297
+ }
298
+ }
299
+ /** Time since the current view started, or -1 when there is none. */
300
+ function viewElapsedMs() {
301
+ return active ? Date.now() - active.startMs : -1;
302
+ }
303
+ function addViewAttributes(attrs) {
304
+ if (!active)
305
+ return;
306
+ active.attributes = { ...(active.attributes ?? {}), ...attrs };
307
+ }
308
+ /** Ends the view while the app is in the background, so time away is not counted. */
309
+ function pauseViews() {
310
+ if (!active)
311
+ return;
312
+ paused = { key: active.key, name: active.name, attributes: active.attributes };
313
+ stopView(active.key);
314
+ }
315
+ /** Starts the paused view again as a new view instance. */
316
+ function resumeViews() {
317
+ if (!paused || active)
318
+ return;
319
+ const p = paused;
320
+ paused = null;
321
+ startView(p.key, p.name, p.attributes);
322
+ }
323
+ /** Session ended: the open view belongs to the old session. */
324
+ function restartViewForNewSession(sessionId) {
325
+ if (!active || active.sessionId === sessionId)
326
+ return;
327
+ const { key, name, attributes } = active;
328
+ active = null;
329
+ stopRefreshTimer();
330
+ startView(key, name, attributes);
331
+ }
332
+ function flushActiveView() {
333
+ if (active)
334
+ send(active, false);
335
+ }
336
+ /** Test hook. */
337
+ function resetViews() {
338
+ stopRefreshTimer();
339
+ active = null;
340
+ paused = null;
341
+ firstViewSeen = false;
342
+ fullyDisplayedReported = false;
343
+ coldStart = null;
344
+ startListeners.length = 0;
345
+ (0, view_state_1.setCurrentViewInfo)(null);
346
+ }
347
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../../src/events/views.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAA8D;AAC9D,qCAAmC;AACnC,2CAA0E;AAC1E,6CAA6C;AAC7C,iCAAmG;AACnG,6CAAiE;AACjE,yCAAwC;AAExC,oEAAoE;AACpE,MAAM,eAAe,GAAG,KAAM,CAAC;AAC/B,8DAA8D;AAC9D,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,4EAA4E;AAC5E,MAAM,oBAAoB,GAAG,KAAM,CAAC;AAkCpC,IAAI,MAAM,GAAsB,IAAI,CAAC;AACrC,kEAAkE;AAClE,IAAI,MAAM,GAA+E,IAAI,CAAC;AAC9F,IAAI,YAAY,GAA0C,IAAI,CAAC;AAC/D,IAAI,aAAa,GAAyC,IAAI,CAAC;AAC/D,IAAI,aAAa,GAAG,KAAK,CAAC;AAC1B,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,IAAI,SAAS,GAA0C,IAAI,CAAC;AAC5D,MAAM,cAAc,GAAiC,EAAE,CAAC;AAExD,SAAS,WAAW;IAClB,OAAO;QACL,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,CAAC;QACb,IAA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,IAAI,MAAM;QAAE,OAAO;IAC9B,MAAM,CAAC,GAAG,MAAM,CAAC;IACjB,MAAM,GAAG,IAAI,CAAC;IACd,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AAED,+DAA+D;AAC/D,kCAAyC,SAAiB;IACxD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO;IACtD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,GAAG,IAAI,CAAC;IACd,gBAAgB,EAAE,CAAC;IACnB,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AACnC,CAAC;AAED;IACE,IAAI,MAAM;QAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,iBAAiB;AACjB;IACE,gBAAgB,EAAE,CAAC;IACnB,MAAM,GAAG,IAAI,CAAC;IACd,MAAM,GAAG,IAAI,CAAC;IACd,aAAa,GAAG,KAAK,CAAC;IACtB,sBAAsB,GAAG,KAAK,CAAC;IAC/B,SAAS,GAAG,IAAI,CAAC;IACjB,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,IAAA,+BAAkB,EAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { isRecording, startRecording, stopRecording } from './replay/recorder';
2
+ export { OodleRum } from './rum';
3
+ export { OodleProvider, type OodleProviderProps } from './react/OodleProvider';
4
+ export { OodlePrivacy, type OodlePrivacyProps, type PrivacyLevel } from './react/OodlePrivacy';
5
+ export { trackNavigation, useOodleNavigationTracking, type NavigationRefLike, type NavigationTrackingOptions, } from './navigation/react-navigation';
6
+ export type { OodleRumConfig, SessionReplayConfig, TrackingConsent, TracingUrl, Propagator, TextAndInputPrivacy, TouchPrivacy, ImagePrivacy, UrlMatcher, TagValue, } from './core/config';
7
+ export type { UserInfo } from './core/user';
8
+ export { SDK_VERSION } from './version';
9
+ /** Session replay controls. Recording also needs consent `granted`. */
10
+ export declare const OodleSessionReplay: {
11
+ /** Starts recording, if the session is sampled for replay. */
12
+ start: typeof startRecording;
13
+ /** Stops recording. Already recorded segments are still sent. */
14
+ stop: typeof stopRecording;
15
+ isRecording: typeof isRecording;
16
+ };
package/lib/index.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OodleSessionReplay = exports.SDK_VERSION = exports.useOodleNavigationTracking = exports.trackNavigation = exports.OodlePrivacy = exports.OodleProvider = exports.OodleRum = void 0;
4
+ const recorder_1 = require("./replay/recorder");
5
+ var rum_1 = require("./rum");
6
+ Object.defineProperty(exports, "OodleRum", { enumerable: true, get: function () { return rum_1.OodleRum; } });
7
+ var OodleProvider_1 = require("./react/OodleProvider");
8
+ Object.defineProperty(exports, "OodleProvider", { enumerable: true, get: function () { return OodleProvider_1.OodleProvider; } });
9
+ var OodlePrivacy_1 = require("./react/OodlePrivacy");
10
+ Object.defineProperty(exports, "OodlePrivacy", { enumerable: true, get: function () { return OodlePrivacy_1.OodlePrivacy; } });
11
+ var react_navigation_1 = require("./navigation/react-navigation");
12
+ Object.defineProperty(exports, "trackNavigation", { enumerable: true, get: function () { return react_navigation_1.trackNavigation; } });
13
+ Object.defineProperty(exports, "useOodleNavigationTracking", { enumerable: true, get: function () { return react_navigation_1.useOodleNavigationTracking; } });
14
+ var version_1 = require("./version");
15
+ Object.defineProperty(exports, "SDK_VERSION", { enumerable: true, get: function () { return version_1.SDK_VERSION; } });
16
+ /** Session replay controls. Recording also needs consent `granted`. */
17
+ exports.OodleSessionReplay = {
18
+ /** Starts recording, if the session is sampled for replay. */
19
+ start: recorder_1.startRecording,
20
+ /** Stops recording. Already recorded segments are still sent. */
21
+ stop: recorder_1.stopRecording,
22
+ isRecording: recorder_1.isRecording,
23
+ };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAA+E;AAE/E,6BAAiC;AAAxB,+FAAA,QAAQ,OAAA;AACjB,uDAA+E;AAAtE,8GAAA,aAAa,OAAA;AACtB,qDAA+F;AAAtF,4GAAA,YAAY,OAAA;AACrB,kEAKuC;AAJrC,mHAAA,eAAe,OAAA;AACf,8HAAA,0BAA0B,OAAA;AAiB5B,qCAAwC;AAA/B,sGAAA,WAAW,OAAA;AAEpB,uEAAuE;AAC1D,QAAA,kBAAkB,GAAG;IAChC,8DAA8D;IAC9D,KAAK,EAAE,yBAAc;IACrB,iEAAiE;IACjE,IAAI,EAAE,wBAAa;IACnB,WAAW,EAAX,sBAAW;CACZ,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** The parts of a react-navigation container ref the SDK uses. */
2
+ export interface NavigationRefLike {
3
+ current?: NavigationContainerLike | null;
4
+ getCurrentRoute?: () => {
5
+ key: string;
6
+ name: string;
7
+ } | undefined;
8
+ addListener?: (event: 'state', cb: () => void) => () => void;
9
+ isReady?: () => boolean;
10
+ }
11
+ interface NavigationContainerLike {
12
+ getCurrentRoute(): {
13
+ key: string;
14
+ name: string;
15
+ } | undefined;
16
+ addListener(event: 'state', cb: () => void): () => void;
17
+ isReady?(): boolean;
18
+ }
19
+ export interface NavigationTrackingOptions {
20
+ /** Screen name for a route. Return null to skip the route. */
21
+ viewName?: (route: {
22
+ key: string;
23
+ name: string;
24
+ }) => string | null;
25
+ }
26
+ /**
27
+ * Starts a view for each screen the navigator shows. Returns a function
28
+ * that stops tracking.
29
+ */
30
+ export declare function trackNavigation(ref: NavigationRefLike, options?: NavigationTrackingOptions): () => void;
31
+ /** React hook form of `trackNavigation`. */
32
+ export declare function useOodleNavigationTracking(ref: NavigationRefLike, options?: NavigationTrackingOptions): void;
33
+ export {};
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trackNavigation = trackNavigation;
4
+ exports.useOodleNavigationTracking = useOodleNavigationTracking;
5
+ const react_1 = require("react");
6
+ const rum_1 = require("../rum");
7
+ function container(ref) {
8
+ // createNavigationContainerRef() returns the container itself; useRef()
9
+ // holds it in `current`.
10
+ if (typeof ref.getCurrentRoute === 'function' && typeof ref.addListener === 'function') {
11
+ return ref;
12
+ }
13
+ return ref.current ?? null;
14
+ }
15
+ /**
16
+ * Starts a view for each screen the navigator shows. Returns a function
17
+ * that stops tracking.
18
+ */
19
+ function trackNavigation(ref, options = {}) {
20
+ const nav = container(ref);
21
+ if (!nav)
22
+ return () => { };
23
+ const update = () => {
24
+ const route = nav.getCurrentRoute();
25
+ if (!route)
26
+ return;
27
+ const name = options.viewName ? options.viewName(route) : route.name;
28
+ if (name === null)
29
+ return;
30
+ rum_1.OodleRum.startView(route.key, name);
31
+ };
32
+ const unsubscribe = nav.addListener('state', update);
33
+ // A container that is not ready yet has no route. Its first state may
34
+ // not fire a 'state' event, so readiness is polled for a short time.
35
+ let tries = 0;
36
+ let poll = null;
37
+ if (!nav.isReady || nav.isReady()) {
38
+ update();
39
+ }
40
+ else {
41
+ poll = setInterval(() => {
42
+ tries++;
43
+ if (nav.isReady?.())
44
+ update();
45
+ if ((nav.isReady?.() || tries >= 50) && poll) {
46
+ clearInterval(poll);
47
+ poll = null;
48
+ }
49
+ }, 100);
50
+ }
51
+ return () => {
52
+ if (poll)
53
+ clearInterval(poll);
54
+ unsubscribe();
55
+ };
56
+ }
57
+ /** React hook form of `trackNavigation`. */
58
+ function useOodleNavigationTracking(ref, options) {
59
+ (0, react_1.useEffect)(() => trackNavigation(ref, options), [ref]);
60
+ }
61
+ //# sourceMappingURL=react-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-navigation.js","sourceRoot":"","sources":["../../src/navigation/react-navigation.ts"],"names":[],"mappings":";;;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K,EAAE,CAAC;YACR,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE;gBAAE,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;gBAC7C,aAAa,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,GAAG,IAAI,CAAC;YACd,CAAC;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IACD,OAAO,GAAG,EAAE;QACV,IAAI,IAAI;YAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,WAAW,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED,4CAA4C;AAC5C,oCAA2C,GAAsB,EAAE,OAAmC;IACpG,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type ViewProps } from 'react-native';
2
+ export type PrivacyLevel = 'hidden' | 'mask' | 'allow';
3
+ export interface OodlePrivacyProps extends ViewProps {
4
+ /**
5
+ * `hidden`: the subtree is replaced by an empty box in replays.
6
+ * `mask`: all text and input values in the subtree are masked.
7
+ * `allow`: text and input values are shown, except sensitive inputs
8
+ * such as passwords.
9
+ */
10
+ level: PrivacyLevel;
11
+ }
12
+ /** The native view tree walker reads this marker from the view's nativeID. */
13
+ export declare const PRIVACY_NATIVE_ID_PREFIX = "oodle-privacy-";
14
+ /** Sets the replay privacy of everything inside it. */
15
+ export declare function OodlePrivacy({ level, children, ...rest }: OodlePrivacyProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRIVACY_NATIVE_ID_PREFIX = void 0;
4
+ exports.OodlePrivacy = OodlePrivacy;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_native_1 = require("react-native");
7
+ /** The native view tree walker reads this marker from the view's nativeID. */
8
+ exports.PRIVACY_NATIVE_ID_PREFIX = 'oodle-privacy-';
9
+ /** Sets the replay privacy of everything inside it. */
10
+ function OodlePrivacy({ level, children, ...rest }) {
11
+ return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ...rest, nativeID: `${exports.PRIVACY_NATIVE_ID_PREFIX}${level}`, collapsable: false, children: children }));
12
+ }
13
+ //# sourceMappingURL=OodlePrivacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OodlePrivacy.js","sourceRoot":"","sources":["../../src/react/OodlePrivacy.tsx"],"names":[],"mappings":";;;;;AAAA,+CAAoD;AAcpD,8EAA8E;AACjE,QAAA,wBAAwB,GAAG,gBAAgB,CAAC;AAEzD,uDAAuD;AACvD,sBAA6B,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAqB;IAC1E,OAAO,CACL,uBAAC,mBAAI,OAAK,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAA,wBAAwB,GAAG,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,YAChF,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { OodleRumConfig } from '../core/config';
4
+ export interface OodleProviderProps {
5
+ children?: React.ReactNode;
6
+ /**
7
+ * Starts the SDK during the first render, so the first screen is
8
+ * recorded. Leave it out when the app calls `OodleRum.init()` itself.
9
+ */
10
+ config?: OodleRumConfig;
11
+ style?: StyleProp<ViewStyle>;
12
+ }
13
+ /**
14
+ * Wraps the app to record taps and replay touches. It listens in the
15
+ * capture phase and never claims the responder, so it does not change
16
+ * how any touch is handled.
17
+ */
18
+ export declare function OodleProvider({ children, config, style }: OodleProviderProps): React.JSX.Element;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OodleProvider = OodleProvider;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const actions_1 = require("../events/actions");
8
+ const recorder_1 = require("../replay/recorder");
9
+ const rum_1 = require("../rum");
10
+ function point(e) {
11
+ const n = e.nativeEvent;
12
+ return { x: n.pageX, y: n.pageY, t: Date.now() };
13
+ }
14
+ /**
15
+ * Wraps the app to record taps and replay touches. It listens in the
16
+ * capture phase and never claims the responder, so it does not change
17
+ * how any touch is handled.
18
+ */
19
+ function OodleProvider({ children, config, style }) {
20
+ const initialized = (0, react_1.useRef)(false);
21
+ if (config && !initialized.current) {
22
+ initialized.current = true;
23
+ rum_1.OodleRum.init(config);
24
+ }
25
+ const start = (0, react_1.useRef)(null);
26
+ const touchCount = (0, react_1.useRef)(0);
27
+ return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.root, style], collapsable: false, onTouchStartCapture: (e) => {
28
+ try {
29
+ const touches = e.nativeEvent.touches?.length ?? 1;
30
+ touchCount.current = touches;
31
+ const p = point(e);
32
+ // A second finger turns the gesture into a pinch, not a tap.
33
+ start.current = touches > 1 ? null : { point: p, event: e };
34
+ (0, recorder_1.recordTouchStart)(p.x, p.y);
35
+ }
36
+ catch {
37
+ // instrumentation must never break a touch
38
+ }
39
+ }, onTouchMoveCapture: (e) => {
40
+ try {
41
+ const p = point(e);
42
+ (0, recorder_1.recordTouchMove)(p.x, p.y);
43
+ }
44
+ catch {
45
+ // ignore
46
+ }
47
+ }, onTouchEndCapture: (e) => {
48
+ try {
49
+ const p = point(e);
50
+ const s = start.current;
51
+ start.current = null;
52
+ const tap = Boolean(s) && touchCount.current <= 1;
53
+ if (s && tap)
54
+ (0, actions_1.recordTap)(s.event, s.point, p);
55
+ (0, recorder_1.recordTouchEnd)(p.x, p.y, tap);
56
+ }
57
+ catch {
58
+ // ignore
59
+ }
60
+ }, onTouchCancelCapture: (e) => {
61
+ try {
62
+ start.current = null;
63
+ const p = point(e);
64
+ (0, recorder_1.recordTouchEnd)(p.x, p.y, false);
65
+ }
66
+ catch {
67
+ // ignore
68
+ }
69
+ }, children: children }));
70
+ }
71
+ const styles = react_native_1.StyleSheet.create({ root: { flex: 1 } });
72
+ //# sourceMappingURL=OodleProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OodleProvider.js","sourceRoot":"","sources":["../../src/react/OodleProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAsC;AACtC,+CAA4G;AAC5G,+CAA+D;AAC/D,iDAAuF;AACvF,gCAAkC;AAalC,SAAS,KAAK,CAAC,CAAwB;IACrC,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;IACxB,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,uBAA8B,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAsB;IAC3E,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IAClC,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACnC,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,cAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IACD,MAAM,KAAK,GAAG,IAAA,cAAM,EAA6D,IAAI,CAAC,CAAC;IACvF,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAC3B,WAAW,EAAE,KAAK,EAClB,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE;YACzB,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,CAAC,CAAC,WA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,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC,EACD,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE;YAC1B,IAAI,CAAC;gBACH,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;gBACrB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACnB,IAAA,yBAAc,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YAClC,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type SessionData } from '../core/session';
2
+ /** The session id once part of its replay is queued, for `replay_id` on events. */
3
+ export declare function replayIdForEvents(): string;
4
+ /** Starts or stops recording to match the settings, consent and app state. */
5
+ export declare function syncRecording(): void;
6
+ export declare function initReplay(): void;
7
+ export declare function startRecording(): void;
8
+ export declare function stopRecording(): void;
9
+ export declare function isRecording(): boolean;
10
+ /** A lost segment breaks the deltas after it; the next capture is a full snapshot. */
11
+ export declare function onSegmentDropped(): void;
12
+ export declare function onViewChanged(): void;
13
+ export declare function onReplaySessionRenew(previous: SessionData | null): void;
14
+ export declare function onReplayBackground(): void;
15
+ export declare function onReplayForeground(): void;
16
+ export declare function recordTouchStart(x: number, y: number): void;
17
+ export declare function recordTouchMove(x: number, y: number): void;
18
+ export declare function recordTouchEnd(x: number, y: number, tap: boolean): void;
19
+ /** Sends the open segment now (app going to the background, fatal error). */
20
+ export declare function flushReplay(): void;
21
+ /** Test hook. */
22
+ export declare function resetReplay(): void;