@leanbase.com/js 0.2.2-alpha.0 → 0.2.2

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 (71) hide show
  1. package/dist/leanbase.d.ts +0 -3
  2. package/dist/leanbase.iife.js +1 -1
  3. package/dist/leanbase.iife.js.map +1 -1
  4. package/dist/main.js +1 -1
  5. package/dist/main.js.map +1 -1
  6. package/dist/module.d.ts +0 -708
  7. package/dist/module.js +1 -1
  8. package/dist/module.js.map +1 -1
  9. package/dist/types.d.ts +0 -135
  10. package/dist/version.d.ts +1 -1
  11. package/lib/leanbase.d.ts +0 -3
  12. package/lib/leanbase.js +0 -25
  13. package/lib/leanbase.js.map +1 -1
  14. package/lib/types.d.ts +0 -135
  15. package/lib/types.js.map +1 -1
  16. package/lib/version.d.ts +1 -1
  17. package/lib/version.js +1 -1
  18. package/lib/version.js.map +1 -1
  19. package/package.json +1 -6
  20. package/dist/extensions/replay/external/config.d.ts +0 -9
  21. package/dist/extensions/replay/external/denylist.d.ts +0 -5
  22. package/dist/extensions/replay/external/lazy-loaded-session-recorder.d.ts +0 -153
  23. package/dist/extensions/replay/external/mutation-throttler.d.ts +0 -20
  24. package/dist/extensions/replay/external/network-plugin.d.ts +0 -15
  25. package/dist/extensions/replay/external/sessionrecording-utils.d.ts +0 -19
  26. package/dist/extensions/replay/external/triggerMatching.d.ts +0 -102
  27. package/dist/extensions/replay/rrweb-plugins/patch.d.ts +0 -3
  28. package/dist/extensions/replay/session-recording.d.ts +0 -75
  29. package/dist/extensions/replay/types/rrweb-types.d.ts +0 -439
  30. package/dist/extensions/replay/types/rrweb.d.ts +0 -82
  31. package/dist/extensions/sampling.d.ts +0 -4
  32. package/dist/utils/logger.d.ts +0 -10
  33. package/lib/extensions/replay/external/config.d.ts +0 -9
  34. package/lib/extensions/replay/external/config.js +0 -221
  35. package/lib/extensions/replay/external/config.js.map +0 -1
  36. package/lib/extensions/replay/external/denylist.d.ts +0 -5
  37. package/lib/extensions/replay/external/denylist.js +0 -28
  38. package/lib/extensions/replay/external/denylist.js.map +0 -1
  39. package/lib/extensions/replay/external/lazy-loaded-session-recorder.d.ts +0 -153
  40. package/lib/extensions/replay/external/lazy-loaded-session-recorder.js +0 -1042
  41. package/lib/extensions/replay/external/lazy-loaded-session-recorder.js.map +0 -1
  42. package/lib/extensions/replay/external/mutation-throttler.d.ts +0 -20
  43. package/lib/extensions/replay/external/mutation-throttler.js +0 -77
  44. package/lib/extensions/replay/external/mutation-throttler.js.map +0 -1
  45. package/lib/extensions/replay/external/network-plugin.d.ts +0 -15
  46. package/lib/extensions/replay/external/network-plugin.js +0 -503
  47. package/lib/extensions/replay/external/network-plugin.js.map +0 -1
  48. package/lib/extensions/replay/external/sessionrecording-utils.d.ts +0 -19
  49. package/lib/extensions/replay/external/sessionrecording-utils.js +0 -125
  50. package/lib/extensions/replay/external/sessionrecording-utils.js.map +0 -1
  51. package/lib/extensions/replay/external/triggerMatching.d.ts +0 -102
  52. package/lib/extensions/replay/external/triggerMatching.js +0 -342
  53. package/lib/extensions/replay/external/triggerMatching.js.map +0 -1
  54. package/lib/extensions/replay/rrweb-plugins/patch.d.ts +0 -3
  55. package/lib/extensions/replay/rrweb-plugins/patch.js +0 -32
  56. package/lib/extensions/replay/rrweb-plugins/patch.js.map +0 -1
  57. package/lib/extensions/replay/session-recording.d.ts +0 -75
  58. package/lib/extensions/replay/session-recording.js +0 -279
  59. package/lib/extensions/replay/session-recording.js.map +0 -1
  60. package/lib/extensions/replay/types/rrweb-types.d.ts +0 -439
  61. package/lib/extensions/replay/types/rrweb-types.js +0 -83
  62. package/lib/extensions/replay/types/rrweb-types.js.map +0 -1
  63. package/lib/extensions/replay/types/rrweb.d.ts +0 -82
  64. package/lib/extensions/replay/types/rrweb.js +0 -9
  65. package/lib/extensions/replay/types/rrweb.js.map +0 -1
  66. package/lib/extensions/sampling.d.ts +0 -4
  67. package/lib/extensions/sampling.js +0 -23
  68. package/lib/extensions/sampling.js.map +0 -1
  69. package/lib/utils/logger.d.ts +0 -10
  70. package/lib/utils/logger.js +0 -15
  71. package/lib/utils/logger.js.map +0 -1
@@ -1,503 +0,0 @@
1
- /// <reference lib="dom" />
2
- import { isArray, isBoolean, isFormData, isNull, isNullish, isString, isUndefined, isObject } from '@posthog/core';
3
- import { createLogger } from '../../../utils/logger';
4
- import { formDataToQuery } from '../../../utils/request-utils';
5
- import { patch } from '../rrweb-plugins/patch';
6
- import { isHostOnDenyList } from '../../../extensions/replay/external/denylist';
7
- import { defaultNetworkOptions } from './config';
8
- const logger = createLogger('[Recorder]');
9
- const isNavigationTiming = (entry) => entry.entryType === 'navigation';
10
- const isResourceTiming = (entry) => entry.entryType === 'resource';
11
- export function findLast(array, predicate) {
12
- const length = array.length;
13
- for (let i = length - 1; i >= 0; i -= 1) {
14
- if (predicate(array[i])) {
15
- return array[i];
16
- }
17
- }
18
- return undefined;
19
- }
20
- function isDocument(value) {
21
- return !!value && typeof value === 'object' && 'nodeType' in value && value.nodeType === 9;
22
- }
23
- function initPerformanceObserver(cb, win, options) {
24
- // if we are only observing timings then we could have a single observer for all types, with buffer true,
25
- // but we are going to filter by initiatorType _if we are wrapping fetch and xhr as the wrapped functions
26
- // will deal with those.
27
- // so we have a block which captures requests from before fetch/xhr is wrapped
28
- // these are marked `isInitial` so playback can display them differently if needed
29
- // they will never have method/status/headers/body because they are pre-wrapping that provides that
30
- if (options.recordInitialRequests) {
31
- const initialPerformanceEntries = win.performance
32
- .getEntries()
33
- .filter((entry) => isNavigationTiming(entry) ||
34
- (isResourceTiming(entry) && options.initiatorTypes.includes(entry.initiatorType)));
35
- cb({
36
- requests: initialPerformanceEntries.flatMap((entry) => prepareRequest({ entry, method: undefined, status: undefined, networkRequest: {}, isInitial: true })),
37
- isInitial: true,
38
- });
39
- }
40
- const observer = new win.PerformanceObserver((entries) => {
41
- // if recordBody or recordHeaders is true then we don't want to record fetch or xhr here
42
- // as the wrapped functions will do that. Otherwise, this filter becomes a noop
43
- // because we do want to record them here
44
- const wrappedInitiatorFilter = (entry) => options.recordBody || options.recordHeaders
45
- ? entry.initiatorType !== 'xmlhttprequest' && entry.initiatorType !== 'fetch'
46
- : true;
47
- const performanceEntries = entries.getEntries().filter((entry) => isNavigationTiming(entry) ||
48
- (isResourceTiming(entry) &&
49
- options.initiatorTypes.includes(entry.initiatorType) &&
50
- // TODO if we are _only_ capturing timing we don't want to filter initiator here
51
- wrappedInitiatorFilter(entry)));
52
- cb({
53
- requests: performanceEntries.flatMap((entry) => prepareRequest({ entry, method: undefined, status: undefined, networkRequest: {} })),
54
- });
55
- });
56
- // compat checked earlier
57
- // eslint-disable-next-line compat/compat
58
- const entryTypes = PerformanceObserver.supportedEntryTypes.filter((x) => options.performanceEntryTypeToObserve.includes(x));
59
- // initial records are gathered above, so we don't need to observe and buffer each type separately
60
- observer.observe({ entryTypes });
61
- return () => {
62
- observer.disconnect();
63
- };
64
- }
65
- function shouldRecordHeaders(type, recordHeaders) {
66
- return !!recordHeaders && (isBoolean(recordHeaders) || recordHeaders[type]);
67
- }
68
- export function shouldRecordBody({ type, recordBody, headers, url, }) {
69
- function matchesContentType(contentTypes) {
70
- const contentTypeHeader = Object.keys(headers).find((key) => key.toLowerCase() === 'content-type');
71
- const contentType = contentTypeHeader && headers[contentTypeHeader];
72
- return contentTypes.some((ct) => contentType?.includes(ct));
73
- }
74
- /**
75
- * particularly in canvas applications we see many requests to blob URLs
76
- * e.g. blob:https://video_url
77
- * these blob/object URLs are local to the browser, we can never capture that body
78
- * so we can just return false here
79
- */
80
- function isBlobURL(url) {
81
- try {
82
- if (typeof url === 'string') {
83
- return url.startsWith('blob:');
84
- }
85
- if (url instanceof URL) {
86
- return url.protocol === 'blob:';
87
- }
88
- if (url instanceof Request) {
89
- return isBlobURL(url.url);
90
- }
91
- return false;
92
- }
93
- catch {
94
- return false;
95
- }
96
- }
97
- if (!recordBody)
98
- return false;
99
- if (isBlobURL(url))
100
- return false;
101
- if (isBoolean(recordBody))
102
- return true;
103
- if (isArray(recordBody))
104
- return matchesContentType(recordBody);
105
- const recordBodyType = recordBody[type];
106
- if (isBoolean(recordBodyType))
107
- return recordBodyType;
108
- return matchesContentType(recordBodyType);
109
- }
110
- async function getRequestPerformanceEntry(win, initiatorType, url, start, end, attempt = 0) {
111
- if (attempt > 10) {
112
- logger.warn('Failed to get performance entry for request', { url, initiatorType });
113
- return null;
114
- }
115
- const urlPerformanceEntries = win.performance.getEntriesByName(url);
116
- const performanceEntry = findLast(urlPerformanceEntries, (entry) => isResourceTiming(entry) &&
117
- entry.initiatorType === initiatorType &&
118
- (isUndefined(start) || entry.startTime >= start) &&
119
- (isUndefined(end) || entry.startTime <= end));
120
- if (!performanceEntry) {
121
- await new Promise((resolve) => setTimeout(resolve, 50 * attempt));
122
- return getRequestPerformanceEntry(win, initiatorType, url, start, end, attempt + 1);
123
- }
124
- return performanceEntry;
125
- }
126
- /**
127
- * According to MDN https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response
128
- * xhr response is typed as any but can be an ArrayBuffer, a Blob, a Document, a JavaScript object,
129
- * or a string, depending on the value of XMLHttpRequest.responseType, that contains the response entity body.
130
- *
131
- * XHR request body is Document | XMLHttpRequestBodyInit | null | undefined
132
- */
133
- function _tryReadXHRBody({ body, options, url, }) {
134
- if (isNullish(body)) {
135
- return null;
136
- }
137
- const { hostname, isHostDenied } = isHostOnDenyList(url, options);
138
- if (isHostDenied) {
139
- return hostname + ' is in deny list';
140
- }
141
- if (isString(body)) {
142
- return body;
143
- }
144
- if (isDocument(body)) {
145
- return body.textContent;
146
- }
147
- if (isFormData(body)) {
148
- return formDataToQuery(body);
149
- }
150
- if (isObject(body)) {
151
- try {
152
- return JSON.stringify(body);
153
- }
154
- catch {
155
- return '[SessionReplay] Failed to stringify response object';
156
- }
157
- }
158
- return '[SessionReplay] Cannot read body of type ' + toString.call(body);
159
- }
160
- function initXhrObserver(cb, win, options) {
161
- if (!options.initiatorTypes.includes('xmlhttprequest')) {
162
- return () => {
163
- //
164
- };
165
- }
166
- const recordRequestHeaders = shouldRecordHeaders('request', options.recordHeaders);
167
- const recordResponseHeaders = shouldRecordHeaders('response', options.recordHeaders);
168
- const restorePatch = patch(win.XMLHttpRequest.prototype, 'open',
169
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
170
- // @ts-ignore
171
- (originalOpen) => {
172
- return function (method, url, async = true, username, password) {
173
- // because this function is returned in its actual context `this` _is_ an XMLHttpRequest
174
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
175
- // @ts-ignore
176
- const xhr = this;
177
- // check IE earlier than this, we only initialize if Request is present
178
- // eslint-disable-next-line compat/compat
179
- const req = new Request(url);
180
- const networkRequest = {};
181
- let start;
182
- let end;
183
- const requestHeaders = {};
184
- const originalSetRequestHeader = xhr.setRequestHeader.bind(xhr);
185
- xhr.setRequestHeader = (header, value) => {
186
- requestHeaders[header] = value;
187
- return originalSetRequestHeader(header, value);
188
- };
189
- if (recordRequestHeaders) {
190
- networkRequest.requestHeaders = requestHeaders;
191
- }
192
- const originalSend = xhr.send.bind(xhr);
193
- xhr.send = (body) => {
194
- if (shouldRecordBody({
195
- type: 'request',
196
- headers: requestHeaders,
197
- url,
198
- recordBody: options.recordBody,
199
- })) {
200
- networkRequest.requestBody = _tryReadXHRBody({ body, options, url });
201
- }
202
- start = win.performance.now();
203
- return originalSend(body);
204
- };
205
- const readyStateListener = () => {
206
- if (xhr.readyState !== xhr.DONE) {
207
- return;
208
- }
209
- // Clean up the listener immediately when done to prevent memory leaks
210
- xhr.removeEventListener('readystatechange', readyStateListener);
211
- end = win.performance.now();
212
- const responseHeaders = {};
213
- const rawHeaders = xhr.getAllResponseHeaders();
214
- const headers = rawHeaders.trim().split(/[\r\n]+/);
215
- headers.forEach((line) => {
216
- const parts = line.split(': ');
217
- const header = parts.shift();
218
- const value = parts.join(': ');
219
- if (header) {
220
- responseHeaders[header] = value;
221
- }
222
- });
223
- if (recordResponseHeaders) {
224
- networkRequest.responseHeaders = responseHeaders;
225
- }
226
- if (shouldRecordBody({
227
- type: 'response',
228
- headers: responseHeaders,
229
- url,
230
- recordBody: options.recordBody,
231
- })) {
232
- networkRequest.responseBody = _tryReadXHRBody({ body: xhr.response, options, url });
233
- }
234
- getRequestPerformanceEntry(win, 'xmlhttprequest', req.url, start, end)
235
- .then((entry) => {
236
- const requests = prepareRequest({
237
- entry,
238
- method: method,
239
- status: xhr?.status,
240
- networkRequest,
241
- start,
242
- end,
243
- url: url.toString(),
244
- initiatorType: 'xmlhttprequest',
245
- });
246
- cb({ requests });
247
- })
248
- .catch(() => {
249
- //
250
- });
251
- };
252
- // This is very tricky code, and making it passive won't bring many performance benefits,
253
- // so let's ignore the rule here.
254
- // eslint-disable-next-line posthog-js/no-add-event-listener
255
- xhr.addEventListener('readystatechange', readyStateListener);
256
- originalOpen.call(xhr, method, url, async, username, password);
257
- };
258
- });
259
- return () => {
260
- restorePatch();
261
- };
262
- }
263
- /**
264
- * Check if this PerformanceEntry is either a PerformanceResourceTiming or a PerformanceNavigationTiming
265
- * NB PerformanceNavigationTiming extends PerformanceResourceTiming
266
- * Here we don't care which interface it implements as both expose `serverTimings`
267
- */
268
- const exposesServerTiming = (event) => !isNull(event) && (event.entryType === 'navigation' || event.entryType === 'resource');
269
- function prepareRequest({ entry, method, status, networkRequest, isInitial, start, end, url, initiatorType, }) {
270
- start = entry ? entry.startTime : start;
271
- end = entry ? entry.responseEnd : end;
272
- // kudos to sentry javascript sdk for excellent background on why to use Date.now() here
273
- // https://github.com/getsentry/sentry-javascript/blob/e856e40b6e71a73252e788cd42b5260f81c9c88e/packages/utils/src/time.ts#L70
274
- // can't start observer if performance.now() is not available
275
- // eslint-disable-next-line compat/compat
276
- const timeOrigin = Math.floor(Date.now() - performance.now());
277
- // clickhouse can't ingest timestamps that are floats
278
- // (in this case representing fractions of a millisecond we don't care about anyway)
279
- // use timeOrigin if we really can't gather a start time
280
- const timestamp = Math.floor(timeOrigin + (start || 0));
281
- const entryJSON = entry ? entry.toJSON() : { name: url };
282
- const requests = [
283
- {
284
- ...entryJSON,
285
- startTime: isUndefined(start) ? undefined : Math.round(start),
286
- endTime: isUndefined(end) ? undefined : Math.round(end),
287
- timeOrigin,
288
- timestamp,
289
- method: method,
290
- initiatorType: initiatorType ? initiatorType : entry ? entry.initiatorType : undefined,
291
- status,
292
- requestHeaders: networkRequest.requestHeaders,
293
- requestBody: networkRequest.requestBody,
294
- responseHeaders: networkRequest.responseHeaders,
295
- responseBody: networkRequest.responseBody,
296
- isInitial,
297
- },
298
- ];
299
- if (exposesServerTiming(entry)) {
300
- for (const timing of entry.serverTiming || []) {
301
- requests.push({
302
- timeOrigin,
303
- timestamp,
304
- startTime: Math.round(entry.startTime),
305
- name: timing.name,
306
- duration: timing.duration,
307
- // the spec has a closed list of possible types
308
- // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
309
- // but, we need to know this was a server timing so that we know to
310
- // match it to the appropriate navigation or resource timing
311
- // that matching will have to be on timestamp and $current_url
312
- entryType: 'serverTiming',
313
- });
314
- }
315
- }
316
- return requests;
317
- }
318
- const contentTypePrefixDenyList = ['video/', 'audio/'];
319
- function _checkForCannotReadResponseBody({ r, options, url, }) {
320
- if (r.headers.get('Transfer-Encoding') === 'chunked') {
321
- return 'Chunked Transfer-Encoding is not supported';
322
- }
323
- // `get` and `has` are case-insensitive
324
- // but return the header value with the casing that was supplied
325
- const contentType = r.headers.get('Content-Type')?.toLowerCase();
326
- const contentTypeIsDenied = contentTypePrefixDenyList.some((prefix) => contentType?.startsWith(prefix));
327
- if (contentType && contentTypeIsDenied) {
328
- return `Content-Type ${contentType} is not supported`;
329
- }
330
- const { hostname, isHostDenied } = isHostOnDenyList(url, options);
331
- if (isHostDenied) {
332
- return hostname + ' is in deny list';
333
- }
334
- return null;
335
- }
336
- function _tryReadBody(r) {
337
- // there are now already multiple places where we're using Promise...
338
- // eslint-disable-next-line compat/compat
339
- return new Promise((resolve, reject) => {
340
- const timeout = setTimeout(() => resolve('[SessionReplay] Timeout while trying to read body'), 500);
341
- try {
342
- r.clone()
343
- .text()
344
- .then((txt) => resolve(txt), (reason) => reject(reason))
345
- .finally(() => clearTimeout(timeout));
346
- }
347
- catch {
348
- clearTimeout(timeout);
349
- resolve('[SessionReplay] Failed to read body');
350
- }
351
- });
352
- }
353
- async function _tryReadRequestBody({ r, options, url, }) {
354
- const { hostname, isHostDenied } = isHostOnDenyList(url, options);
355
- if (isHostDenied) {
356
- return Promise.resolve(hostname + ' is in deny list');
357
- }
358
- return _tryReadBody(r);
359
- }
360
- async function _tryReadResponseBody({ r, options, url, }) {
361
- const cannotReadBodyReason = _checkForCannotReadResponseBody({ r, options, url });
362
- if (!isNull(cannotReadBodyReason)) {
363
- return Promise.resolve(cannotReadBodyReason);
364
- }
365
- return _tryReadBody(r);
366
- }
367
- function initFetchObserver(cb, win, options) {
368
- if (!options.initiatorTypes.includes('fetch')) {
369
- return () => {
370
- //
371
- };
372
- }
373
- const recordRequestHeaders = shouldRecordHeaders('request', options.recordHeaders);
374
- const recordResponseHeaders = shouldRecordHeaders('response', options.recordHeaders);
375
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
376
- // @ts-ignore
377
- const restorePatch = patch(win, 'fetch', (originalFetch) => {
378
- return async function (url, init) {
379
- // check IE earlier than this, we only initialize if Request is present
380
- // eslint-disable-next-line compat/compat
381
- const req = new Request(url, init);
382
- let res;
383
- const networkRequest = {};
384
- let start;
385
- let end;
386
- try {
387
- const requestHeaders = {};
388
- req.headers.forEach((value, header) => {
389
- requestHeaders[header] = value;
390
- });
391
- if (recordRequestHeaders) {
392
- networkRequest.requestHeaders = requestHeaders;
393
- }
394
- if (shouldRecordBody({
395
- type: 'request',
396
- headers: requestHeaders,
397
- url,
398
- recordBody: options.recordBody,
399
- })) {
400
- networkRequest.requestBody = await _tryReadRequestBody({ r: req, options, url });
401
- }
402
- start = win.performance.now();
403
- res = await originalFetch(req);
404
- end = win.performance.now();
405
- const responseHeaders = {};
406
- res.headers.forEach((value, header) => {
407
- responseHeaders[header] = value;
408
- });
409
- if (recordResponseHeaders) {
410
- networkRequest.responseHeaders = responseHeaders;
411
- }
412
- if (shouldRecordBody({
413
- type: 'response',
414
- headers: responseHeaders,
415
- url,
416
- recordBody: options.recordBody,
417
- })) {
418
- networkRequest.responseBody = await _tryReadResponseBody({ r: res, options, url });
419
- }
420
- return res;
421
- }
422
- finally {
423
- getRequestPerformanceEntry(win, 'fetch', req.url, start, end)
424
- .then((entry) => {
425
- const requests = prepareRequest({
426
- entry,
427
- method: req.method,
428
- status: res?.status,
429
- networkRequest,
430
- start,
431
- end,
432
- url: req.url,
433
- initiatorType: 'fetch',
434
- });
435
- cb({ requests });
436
- })
437
- .catch(() => {
438
- //
439
- });
440
- }
441
- };
442
- });
443
- return () => {
444
- restorePatch();
445
- };
446
- }
447
- let initialisedHandler = null;
448
- function initNetworkObserver(callback, win, // top window or in an iframe
449
- options) {
450
- if (!('performance' in win)) {
451
- return () => {
452
- //
453
- };
454
- }
455
- if (initialisedHandler) {
456
- logger.warn('Network observer already initialised, doing nothing');
457
- return () => {
458
- // the first caller should already have this handler and will be responsible for teardown
459
- };
460
- }
461
- const networkOptions = (options ? Object.assign({}, defaultNetworkOptions, options) : defaultNetworkOptions);
462
- const cb = (data) => {
463
- const requests = [];
464
- data.requests.forEach((request) => {
465
- const maskedRequest = networkOptions.maskRequestFn(request);
466
- if (maskedRequest) {
467
- requests.push(maskedRequest);
468
- }
469
- });
470
- if (requests.length > 0) {
471
- callback({ ...data, requests });
472
- }
473
- };
474
- const performanceObserver = initPerformanceObserver(cb, win, networkOptions);
475
- // only wrap fetch and xhr if headers or body are being recorded
476
- let xhrObserver = () => { };
477
- let fetchObserver = () => { };
478
- if (networkOptions.recordHeaders || networkOptions.recordBody) {
479
- xhrObserver = initXhrObserver(cb, win, networkOptions);
480
- fetchObserver = initFetchObserver(cb, win, networkOptions);
481
- }
482
- initialisedHandler = () => {
483
- performanceObserver();
484
- xhrObserver();
485
- fetchObserver();
486
- };
487
- return initialisedHandler;
488
- }
489
- // use the plugin name so that when this functionality is adopted into rrweb
490
- // we can remove this plugin and use the core functionality with the same data
491
- export const NETWORK_PLUGIN_NAME = 'rrweb/network@1';
492
- // TODO how should this be typed?
493
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
494
- // @ts-ignore
495
- export const getRecordNetworkPlugin = (options) => {
496
- return {
497
- name: NETWORK_PLUGIN_NAME,
498
- observer: initNetworkObserver,
499
- options: options,
500
- };
501
- };
502
- // rrweb/networ@1 ends
503
- //# sourceMappingURL=network-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-plugin.js","sourceRoot":"","sources":["../../../../src/extensions/replay/external/network-plugin.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAa3B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAClH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;AASzC,MAAM,kBAAkB,GAAG,CAAC,KAAuB,EAAwC,EAAE,CACzF,KAAK,CAAC,SAAS,KAAK,YAAY,CAAA;AACpC,MAAM,gBAAgB,GAAG,CAAC,KAAuB,EAAsC,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,UAAU,CAAA;AAMxH,MAAM,UAAU,QAAQ,CAAI,KAAe,EAAE,SAAgC;IACzE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAA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;AACb,MAAM,CAAC,MAAM,sBAAsB,GAAqD,CAAC,OAAO,EAAE,EAAE;IAChG,OAAO;QACH,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,OAAO;KACnB,CAAA;AACL,CAAC,CAAA;AAED,sBAAsB"}
@@ -1,19 +0,0 @@
1
- import type { eventWithTime } from '../types/rrweb-types';
2
- import { SnapshotBuffer } from './lazy-loaded-session-recorder';
3
- export declare function circularReferenceReplacer(): (this: any, _key: string, value: any) => any;
4
- export declare function estimateSize(sizeable: unknown): number;
5
- export declare const replacementImageURI = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==";
6
- export declare const FULL_SNAPSHOT_EVENT_TYPE = 2;
7
- export declare const META_EVENT_TYPE = 4;
8
- export declare const INCREMENTAL_SNAPSHOT_EVENT_TYPE = 3;
9
- export declare const PLUGIN_EVENT_TYPE = 6;
10
- export declare const MUTATION_SOURCE_TYPE = 0;
11
- export declare const MAX_MESSAGE_SIZE = 5000000;
12
- export declare function ensureMaxMessageSize(data: eventWithTime): {
13
- event: eventWithTime;
14
- size: number;
15
- };
16
- export declare const CONSOLE_LOG_PLUGIN_NAME = "rrweb/console@1";
17
- export declare function truncateLargeConsoleLogs(_event: eventWithTime): eventWithTime;
18
- export declare const SEVEN_MEGABYTES: number;
19
- export declare function splitBuffer(buffer: SnapshotBuffer, sizeLimit?: number): SnapshotBuffer[];