@newrelic/browser-agent 1.297.0 → 1.297.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +3 -0
  3. package/dist/cjs/common/constants/agent-constants.js +3 -2
  4. package/dist/cjs/common/constants/env.cdn.js +1 -1
  5. package/dist/cjs/common/constants/env.npm.js +1 -1
  6. package/dist/cjs/common/harvest/types.js +0 -1
  7. package/dist/cjs/common/wrap/wrap-function.js +9 -4
  8. package/dist/cjs/features/ajax/aggregate/index.js +10 -2
  9. package/dist/cjs/features/ajax/instrument/index.js +1 -0
  10. package/dist/cjs/features/jserrors/aggregate/index.js +9 -4
  11. package/dist/cjs/features/session_replay/aggregate/index.js +18 -21
  12. package/dist/cjs/features/session_replay/constants.js +5 -1
  13. package/dist/cjs/features/session_replay/instrument/index.js +36 -50
  14. package/dist/cjs/features/session_replay/shared/recorder.js +47 -25
  15. package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +11 -3
  16. package/dist/cjs/features/soft_navigations/aggregate/index.js +38 -14
  17. package/dist/cjs/features/soft_navigations/aggregate/interaction.js +34 -20
  18. package/dist/cjs/features/soft_navigations/constants.js +8 -4
  19. package/dist/cjs/features/soft_navigations/instrument/index.js +9 -6
  20. package/dist/cjs/features/utils/instrument-base.js +6 -2
  21. package/dist/cjs/loaders/api/interaction-types.js +0 -1
  22. package/dist/cjs/loaders/micro-agent.js +5 -2
  23. package/dist/esm/common/constants/agent-constants.js +2 -1
  24. package/dist/esm/common/constants/env.cdn.js +1 -1
  25. package/dist/esm/common/constants/env.npm.js +1 -1
  26. package/dist/esm/common/harvest/types.js +0 -1
  27. package/dist/esm/common/wrap/wrap-function.js +9 -4
  28. package/dist/esm/features/ajax/aggregate/index.js +10 -2
  29. package/dist/esm/features/ajax/instrument/index.js +1 -0
  30. package/dist/esm/features/jserrors/aggregate/index.js +9 -4
  31. package/dist/esm/features/session_replay/aggregate/index.js +18 -21
  32. package/dist/esm/features/session_replay/constants.js +5 -1
  33. package/dist/esm/features/session_replay/instrument/index.js +36 -50
  34. package/dist/esm/features/session_replay/shared/recorder.js +48 -26
  35. package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +11 -3
  36. package/dist/esm/features/soft_navigations/aggregate/index.js +39 -15
  37. package/dist/esm/features/soft_navigations/aggregate/interaction.js +35 -21
  38. package/dist/esm/features/soft_navigations/constants.js +7 -3
  39. package/dist/esm/features/soft_navigations/instrument/index.js +10 -7
  40. package/dist/esm/features/utils/instrument-base.js +6 -2
  41. package/dist/esm/loaders/api/interaction-types.js +0 -1
  42. package/dist/esm/loaders/micro-agent.js +5 -2
  43. package/dist/types/common/constants/agent-constants.d.ts +1 -0
  44. package/dist/types/common/constants/agent-constants.d.ts.map +1 -1
  45. package/dist/types/common/harvest/types.d.ts.map +1 -1
  46. package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
  47. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  48. package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
  49. package/dist/types/features/jserrors/aggregate/index.d.ts +1 -1
  50. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  51. package/dist/types/features/session_replay/aggregate/index.d.ts +9 -2
  52. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  53. package/dist/types/features/session_replay/constants.d.ts +4 -0
  54. package/dist/types/features/session_replay/instrument/index.d.ts +7 -0
  55. package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -1
  56. package/dist/types/features/session_replay/shared/recorder.d.ts +10 -4
  57. package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
  58. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts +2 -1
  59. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts.map +1 -1
  60. package/dist/types/features/soft_navigations/aggregate/index.d.ts +1 -1
  61. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  62. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts +6 -3
  63. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts.map +1 -1
  64. package/dist/types/features/soft_navigations/constants.d.ts +4 -0
  65. package/dist/types/features/soft_navigations/constants.d.ts.map +1 -1
  66. package/dist/types/features/soft_navigations/instrument/index.d.ts.map +1 -1
  67. package/dist/types/features/utils/instrument-base.d.ts +2 -1
  68. package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
  69. package/dist/types/loaders/api/interaction-types.d.ts.map +1 -1
  70. package/dist/types/loaders/micro-agent.d.ts +5 -2
  71. package/dist/types/loaders/micro-agent.d.ts.map +1 -1
  72. package/package.json +2 -6
  73. package/src/common/constants/agent-constants.js +1 -0
  74. package/src/common/harvest/types.js +0 -1
  75. package/src/common/wrap/wrap-function.js +9 -4
  76. package/src/features/ajax/aggregate/index.js +10 -2
  77. package/src/features/ajax/instrument/index.js +1 -0
  78. package/src/features/jserrors/aggregate/index.js +10 -6
  79. package/src/features/session_replay/aggregate/index.js +18 -19
  80. package/src/features/session_replay/constants.js +5 -1
  81. package/src/features/session_replay/instrument/index.js +39 -40
  82. package/src/features/session_replay/shared/recorder.js +53 -26
  83. package/src/features/soft_navigations/aggregate/ajax-node.js +8 -4
  84. package/src/features/soft_navigations/aggregate/index.js +39 -15
  85. package/src/features/soft_navigations/aggregate/interaction.js +33 -19
  86. package/src/features/soft_navigations/constants.js +5 -2
  87. package/src/features/soft_navigations/instrument/index.js +9 -8
  88. package/src/features/utils/instrument-base.js +7 -2
  89. package/src/loaders/api/interaction-types.js +0 -1
  90. package/src/loaders/micro-agent.js +5 -2
@@ -7,7 +7,7 @@ import { generateUuid } from '../../../common/ids/unique-id';
7
7
  import { addCustomAttributes, getAddStringContext, nullable, numeric } from '../../../common/serialize/bel-serializer';
8
8
  import { now } from '../../../common/timing/now';
9
9
  import { cleanURL } from '../../../common/url/clean-url';
10
- import { NODE_TYPE, INTERACTION_STATUS, INTERACTION_TYPE, API_TRIGGER_NAME, IPL_TRIGGER_NAME } from '../constants';
10
+ import { NODE_TYPE, INTERACTION_STATUS, INTERACTION_TYPE, API_TRIGGER_NAME, IPL_TRIGGER_NAME, NO_LONG_TASK_WINDOW } from '../constants';
11
11
  import { BelNode } from './bel-node';
12
12
 
13
13
  /**
@@ -29,7 +29,9 @@ export class Interaction extends BelNode {
29
29
  createdByApi = false;
30
30
  keepOpenUntilEndApi = false;
31
31
  onDone = [];
32
+ customEnd = 0;
32
33
  cancellationTimer;
34
+ watchLongtaskTimer;
33
35
  constructor(uiEvent, uiEventTimestamp, currentRouteKnown, currentUrl) {
34
36
  super();
35
37
  this.belType = NODE_TYPE.INTERACTION;
@@ -41,36 +43,48 @@ export class Interaction extends BelNode {
41
43
  if (this.trigger === API_TRIGGER_NAME) this.createdByApi = true;
42
44
  this.newURL = this.oldURL = currentUrl || globalScope?.location.href;
43
45
  }
44
- updateDom(timestamp) {
45
- this.domTimestamp = timestamp || now(); // default timestamp should be precise for accurate isActiveDuring calculations
46
- }
47
46
  updateHistory(timestamp, newUrl) {
48
- this.newURL = newUrl || '' + globalScope?.location;
47
+ if (this.domTimestamp > 0) return; // url is locked once ui>url>dom change sequence is seen
48
+ if (!newUrl || newUrl === this.oldURL) return; // url must be different for interaction heuristic to proceed
49
+ this.newURL = newUrl;
49
50
  this.historyTimestamp = timestamp || now();
50
51
  }
51
- seenHistoryAndDomChange() {
52
- return this.historyTimestamp > 0 && this.domTimestamp > this.historyTimestamp; // URL must change before DOM does
52
+ updateDom(timestamp) {
53
+ if (!this.historyTimestamp || timestamp < this.historyTimestamp) return; // dom change must come after (any) url change, though this can be updated multiple times, taking the last dom timestamp
54
+ this.domTimestamp = timestamp || now(); // default timestamp should be precise for accurate isActiveDuring calculations
55
+ }
56
+ checkHistoryAndDomChange() {
57
+ if (!(this.historyTimestamp > 0 && this.domTimestamp > this.historyTimestamp)) return false;
58
+ if (this.status === INTERACTION_STATUS.PF) return true; // indicate the finishing process has already started for this interaction
59
+ this.status = INTERACTION_STATUS.PF; // set for eventual harvest
60
+
61
+ // Once the fixed reqs for a nav has been met, start a X countdown timer that watches for any long task, if it doesn't already exist, before completing the interaction.
62
+ clearTimeout(this.cancellationTimer); // "pending-finish" ixns cannot be auto cancelled anymore
63
+ this.watchLongtaskTimer ??= setTimeout(() => this.done(), NO_LONG_TASK_WINDOW);
64
+ // Notice that by not providing a specific end time to `.done()`, the ixn will use the dom timestamp in the event of no long task, which is what we want.
65
+ return true;
53
66
  }
54
67
  on(event, cb) {
55
68
  if (!this.eventSubscription.has(event)) throw new Error('Cannot subscribe to non pre-defined events.');
56
69
  if (typeof cb !== 'function') throw new Error('Must supply function as callback.');
57
70
  this.eventSubscription.get(event).push(cb);
58
71
  }
59
- done(customEndTime) {
60
- // User could've mark this interaction--regardless UI or api started--as "don't close until .end() is called on it". Only .end provides a timestamp; the default flows do not.
61
- if (this.keepOpenUntilEndApi && customEndTime === undefined) return false;
72
+ done(customEndTime = this.customEnd, calledByApi = false) {
73
+ // User could've mark this interaction--regardless UI or api started--as "don't close until .end() is called on it".
74
+ if (this.keepOpenUntilEndApi && !calledByApi) return false;
62
75
  // If interaction is already closed, this is a no-op. However, returning true lets startUIInteraction know that it CAN start a new interaction, as this one is done.
63
- if (this.status !== INTERACTION_STATUS.IP) return true;
76
+ if (this.status === INTERACTION_STATUS.FIN || this.status === INTERACTION_STATUS.CAN) return true;
77
+ clearTimeout(this.cancellationTimer); // clean up timers in case this is called by any flow that doesn't already do so
78
+ clearTimeout(this.watchLongtaskTimer);
64
79
  this.onDone.forEach(apiProvidedCb => apiProvidedCb(this.customDataByApi)); // this interaction's .save or .ignore can still be set by these user provided callbacks for example
65
80
 
66
81
  if (this.forceIgnore) this.#cancel(); // .ignore() always has precedence over save actions
67
- else if (this.seenHistoryAndDomChange()) this.#finish(customEndTime); // then this should've already finished while it was the interactionInProgress, with a natural end time
82
+ else if (this.status === INTERACTION_STATUS.PF) this.#finish(customEndTime); // then this should've already finished while it was the interactionInProgress, with a natural end time
68
83
  else if (this.forceSave) this.#finish(customEndTime || performance.now()); // a manually saved ixn (did not fulfill conditions) must have a specified end time, if one wasn't provided
69
84
  else this.#cancel();
70
85
  return true;
71
86
  }
72
- #finish(customEndTime = 0) {
73
- clearTimeout(this.cancellationTimer);
87
+ #finish(customEndTime) {
74
88
  this.end = Math.max(this.domTimestamp, this.historyTimestamp, customEndTime);
75
89
  this.status = INTERACTION_STATUS.FIN;
76
90
 
@@ -79,7 +93,6 @@ export class Interaction extends BelNode {
79
93
  callbacks.forEach(fn => fn());
80
94
  }
81
95
  #cancel() {
82
- clearTimeout(this.cancellationTimer);
83
96
  this.status = INTERACTION_STATUS.CAN;
84
97
 
85
98
  // Run all the callbacks listening to this interaction's potential cancellation.
@@ -90,12 +103,13 @@ export class Interaction extends BelNode {
90
103
  /**
91
104
  * Given a timestamp, determine if it falls within this interaction's span, i.e. if this was the active interaction during that time.
92
105
  * For in-progress interactions, this only compares the time with the start of span. Cancelled interactions are not considered active at all.
106
+ * Pending-finish interactions are also considered still active wrt assigning ajax or jserrors to them during the wait period.
93
107
  * @param {DOMHighResTimeStamp} timestamp
94
108
  * @returns True or false boolean.
95
109
  */
96
110
  isActiveDuring(timestamp) {
97
- if (this.status === INTERACTION_STATUS.IP) return this.start <= timestamp;
98
- return this.status === INTERACTION_STATUS.FIN && this.start <= timestamp && this.end > timestamp;
111
+ if (this.status === INTERACTION_STATUS.IP || this.status === INTERACTION_STATUS.PF) return this.start <= timestamp;
112
+ return this.status === INTERACTION_STATUS.FIN && this.start <= timestamp && timestamp < this.end;
99
113
  }
100
114
 
101
115
  // Following are virtual properties overridden by a subclass:
@@ -123,10 +137,10 @@ export class Interaction extends BelNode {
123
137
  // the very 1st ixn does not require offset so it should fallback to a 0 while rest is offset by the very 1st ixn's start
124
138
  numeric(this.end - this.start),
125
139
  // end -- relative to start
126
- numeric(this.callbackEnd),
127
- // cbEnd -- relative to start; not used by BrowserInteraction events
128
- numeric(this.callbackDuration),
129
- // not relative
140
+ numeric(0),
141
+ // callbackEnd -- relative to start; not used by BrowserInteraction events so these are always 0
142
+ numeric(0),
143
+ // not relative; always 0 for BrowserInteraction
130
144
  addString(this.trigger), addString(cleanURL(this.initialPageURL, true)), addString(cleanURL(this.oldURL, true)), addString(cleanURL(this.newURL, true)), addString(this.customName), ixnType, nullable(this.queueTime, numeric, true) + nullable(this.appTime, numeric, true) + nullable(this.oldRoute, addString, true) + nullable(this.newRoute, addString, true) + addString(this.id), addString(this.nodeId), nullable(this.firstPaint, numeric, true) + nullable(this.firstContentfulPaint, numeric)];
131
145
  const customAttributes = {
132
146
  ...agentRef.info.jsAttributes,
@@ -7,13 +7,15 @@ export const INTERACTION_TRIGGERS = ['click',
7
7
  // e.g. user clicks link or the page back/forward buttons
8
8
  'keydown',
9
9
  // e.g. user presses left and right arrow key to switch between displayed photo gallery
10
- 'submit',
11
- // e.g. user clicks submit butotn or presses enter while editing a form field
12
- 'popstate' // history api is used to navigate back and forward
10
+ 'submit' // e.g. user clicks submit butotn or presses enter while editing a form field
13
11
  ];
12
+ export const POPSTATE_TRIGGER = 'popstate'; // e.g. user clicks browser back/forward button or history API is used programmatically
14
13
  export const API_TRIGGER_NAME = 'api';
15
14
  export const IPL_TRIGGER_NAME = 'initialPageLoad';
16
15
  export const FEATURE_NAME = FEATURE_NAMES.softNav;
16
+ export const NO_LONG_TASK_WINDOW = 5000; // purpose is to wait 5 seconds wherein no long task is detected
17
+ export const POPSTATE_MERGE_WINDOW = 500; // "coalesce" (discard) a popstate that happen within this period following an INTERACTION_TRIGGER opening ixn, e.g. click->popstate
18
+
17
19
  export const INTERACTION_TYPE = {
18
20
  INITIAL_PAGE_LOAD: '',
19
21
  ROUTE_CHANGE: 1,
@@ -27,6 +29,8 @@ export const NODE_TYPE = {
27
29
  };
28
30
  export const INTERACTION_STATUS = {
29
31
  IP: 'in progress',
32
+ PF: 'pending finish',
33
+ // interaction meets the hard criteria but is awaiting flexible conditions to fully finish
30
34
  FIN: 'finished',
31
35
  CAN: 'cancelled'
32
36
  };
@@ -9,7 +9,7 @@ import { windowAddEventListener } from '../../../common/event-listener/event-lis
9
9
  import { debounce } from '../../../common/util/invoke';
10
10
  import { wrapHistory } from '../../../common/wrap/wrap-history';
11
11
  import { InstrumentBase } from '../../utils/instrument-base';
12
- import { FEATURE_NAME, INTERACTION_TRIGGERS } from '../constants';
12
+ import { FEATURE_NAME, INTERACTION_TRIGGERS, POPSTATE_TRIGGER } from '../constants';
13
13
  import { now } from '../../../common/timing/now';
14
14
  import { setupInteractionAPI } from '../../../loaders/api/interaction';
15
15
 
@@ -30,19 +30,22 @@ export class Instrument extends InstrumentBase {
30
30
  if (!isBrowserScope || !gosNREUMOriginals().o.MO) return; // soft navigations is not supported outside web env or browsers without the mutation observer API
31
31
 
32
32
  const historyEE = wrapHistory(this.ee);
33
+ try {
34
+ this.removeOnAbort = new AbortController();
35
+ } catch (e) {}
33
36
  INTERACTION_TRIGGERS.forEach(trigger => {
34
37
  windowAddEventListener(trigger, evt => {
35
38
  processUserInteraction(evt);
36
- }, true);
39
+ }, true, this.removeOnAbort?.signal);
37
40
  });
38
41
  const trackURLChange = () => handle('newURL', [now(), '' + window.location], undefined, this.featureName, this.ee);
39
42
  historyEE.on('pushState-end', trackURLChange);
40
43
  historyEE.on('replaceState-end', trackURLChange);
41
- try {
42
- this.removeOnAbort = new AbortController();
43
- } catch (e) {}
44
- const trackURLChangeEvent = evt => handle('newURL', [evt.timeStamp, '' + window.location], undefined, this.featureName, this.ee);
45
- windowAddEventListener('popstate', trackURLChangeEvent, true, this.removeOnAbort?.signal);
44
+ windowAddEventListener(POPSTATE_TRIGGER, evt => {
45
+ // popstate is unique in that it serves as BOTH a UI event and a notification of URL change
46
+ processUserInteraction(evt);
47
+ handle('newURL', [evt.timeStamp, '' + window.location], undefined, this.featureName, this.ee);
48
+ }, true, this.removeOnAbort?.signal);
46
49
  let oncePerFrame = false; // attempt to reduce dom noice since the observer runs very frequently with below options
47
50
  const domObserver = new (gosNREUMOriginals().o.MO)((domChanges, observer) => {
48
51
  if (oncePerFrame) return;
@@ -18,6 +18,8 @@ import { FEATURE_NAMES } from '../../loaders/features/features';
18
18
  import { hasReplayPrerequisite } from '../session_replay/shared/utils';
19
19
  import { canEnableSessionTracking } from './feature-gates';
20
20
  import { single } from '../../common/util/invoke';
21
+ import { SESSION_ERROR } from '../../common/constants/agent-constants';
22
+ import { handle } from '../../common/event-emitter/handle';
21
23
 
22
24
  /**
23
25
  * Base class for instrumenting a feature.
@@ -31,6 +33,7 @@ export class InstrumentBase extends FeatureBase {
31
33
  */
32
34
  constructor(agentRef, featureName) {
33
35
  super(agentRef.agentIdentifier, featureName);
36
+ this.agentRef = agentRef;
34
37
 
35
38
  /** @type {Function | undefined} This should be set by any derived Instrument class if it has things to do when feature fails or is killed. */
36
39
  this.abortHandler = undefined;
@@ -73,7 +76,7 @@ export class InstrumentBase extends FeatureBase {
73
76
  * @param {Object} agentRef - reference to the base agent ancestor that this feature belongs to
74
77
  * @param {Function} fetchAggregator - a function that returns a promise that resolves to the aggregate module
75
78
  * @param {Object} [argsObjFromInstrument] - any values or references to pass down to aggregate
76
- * @returns void
79
+ * @returns
77
80
  */
78
81
  importAggregator(agentRef, fetchAggregator, argsObjFromInstrument = {}) {
79
82
  if (this.featAggregate) return;
@@ -98,7 +101,7 @@ export class InstrumentBase extends FeatureBase {
98
101
  } catch (e) {
99
102
  warn(20, e);
100
103
  this.ee.emit('internal-error', [e]);
101
- if (this.featureName === FEATURE_NAMES.sessionReplay) this.abortHandler?.(); // SR should stop recording if session DNE
104
+ handle(SESSION_ERROR, [e], undefined, this.featureName, this.ee);
102
105
  }
103
106
 
104
107
  /**
@@ -139,6 +142,7 @@ export class InstrumentBase extends FeatureBase {
139
142
  * @returns
140
143
  */
141
144
  #shouldImportAgg(featureName, session, agentInit) {
145
+ if (this.blocked) return false;
142
146
  switch (featureName) {
143
147
  case FEATURE_NAMES.sessionReplay:
144
148
  // the session manager must be initialized successfully for Replay & Trace features
@@ -86,5 +86,4 @@
86
86
  * @returns {InteractionInstance} Returns the same interaction object allowing method chaining.
87
87
  */
88
88
 
89
- /* istanbul ignore next */
90
89
  export const unused = {};
@@ -28,10 +28,13 @@ import { setupWrapLoggerAPI } from './api/wrapLogger';
28
28
  const nonAutoFeatures = [FEATURE_NAMES.jserrors, FEATURE_NAMES.genericEvents, FEATURE_NAMES.metrics, FEATURE_NAMES.logging];
29
29
 
30
30
  /**
31
- * @deprecated This feature has been deprecated and will be removed in a future release. A future product centralizing around a single agent instance will be released as a replacement, at which time this loader will be removed.
32
- * --- A minimal agent class designed to only respond to manual user input. As such, this class does not
31
+ * A minimal agent class designed to only respond to manual user input. As such, this class does not
33
32
  * automatically instrument. Instead, each MicroAgent instance will lazy load the required features and can support loading multiple instances on one page.
34
33
  * Out of the box, it can manually handle and report Page View, Page Action, and Error events.
34
+ *
35
+ * @note This loader strategy is slated to be deprecated and eventually removed in a future product release. For better memory usage, build size impacts, entity management and relationships -- a new strategy focused around using a single centralized browser agent instance is actively being worked on. Reach out by email to browser-agent@newrelic.com for more information or if you would like to participate in a limited preview when the feature is ready for early adoption.
36
+ *
37
+ * @see {@link https://www.npmjs.com/package/@newrelic/browser-agent#deploying-one-or-more-micro-agents-per-page} for more information in the documentation.
35
38
  */
36
39
  export class MicroAgent extends MicroAgentBase {
37
40
  /**
@@ -5,4 +5,5 @@
5
5
  export const IDEAL_PAYLOAD_SIZE: 16000;
6
6
  export const MAX_PAYLOAD_SIZE: 1000000;
7
7
  export const DEFAULT_KEY: "NR_CONTAINER_AGENT";
8
+ export const SESSION_ERROR: "SESSION_ERROR";
8
9
  //# sourceMappingURL=agent-constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-constants.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/agent-constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iCAAkC,KAAK,CAAA;AACvC,+BAAgC,OAAO,CAAA;AACvC,0BAA2B,oBAAoB,CAAA"}
1
+ {"version":3,"file":"agent-constants.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/agent-constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iCAAkC,KAAK,CAAA;AACvC,+BAAgC,OAAO,CAAA;AACvC,0BAA2B,oBAAoB,CAAA;AAC/C,4BAA6B,eAAe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/types.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAGH,wBAAwB;wCAtBX,KAAK,GAAC,UAAU,GAAC,QAAQ,GAAC,KAAK,GAAC,WAAW,GAAC,MAAM;;;;;QAKjD,MAAM;;;;UACN,MAAM;;;;;;cAKN,yBAAyB;;;;aACzB,cAAc;;;;eAEzB;QAA8B,YAAY,EAA/B,OAAO;QACY,cAAc,EAAjC,OAAO;QACY,aAAa,EAAhC,OAAO;QACY,YAAY,EAA/B,OAAO;KAClB;;;;kBAAW,OAAO,wBAAwB,EAAE,cAAc"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/types.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAEH,wBAAwB;wCArBX,KAAK,GAAC,UAAU,GAAC,QAAQ,GAAC,KAAK,GAAC,WAAW,GAAC,MAAM;;;;;QAKjD,MAAM;;;;UACN,MAAM;;;;;;cAKN,yBAAyB;;;;aACzB,cAAc;;;;eAEzB;QAA8B,YAAY,EAA/B,OAAO;QACY,cAAc,EAAjC,OAAO;QACY,aAAa,EAAhC,OAAO;QACY,YAAY,EAA/B,OAAO;KAClB;;;;kBAAW,OAAO,wBAAwB,EAAE,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,mDAJW,MAAM,UACN,OAAO,YA+IjB;AAgBD;;;;;;;;GAQG;AACH,2BANW,MAAM,MACN,MAAM,YACN,MAAM,GAEJ,MAAM,CA2BlB;AArND,0BAA6C"}
1
+ {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,mDAJW,MAAM,UACN,OAAO,YAmJjB;AAgBD;;;;;;;;GAQG;AACH,2BANW,MAAM,MACN,MAAM,YACN,MAAM,GAEJ,MAAM,CA2BlB;AA1ND,0BAA6C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAcA;IACE,2BAAiC;IAEjC,2BA+BC;IA5BC,mBAAwB;IA8B1B,6FA0EC;IAED,iDA6CC;CACF;8BAlK6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IAEjC,2BAsCC;IAnCC,mBAAwB;IAqC1B,6FA0EC;IAED,iDA6CC;CACF;8BA1K6B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"AA6BA;IACE,2BAAiC;IACjC,2BAkCC;IA/BC,OAA0B;IAE1B,8DAAkF;CA8BrF;AAkWD,qCAA8B;+BArZC,6BAA6B;mBAFzC,uBAAuB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"AA6BA;IACE,2BAAiC;IACjC,2BAkCC;IA/BC,OAA0B;IAE1B,8DAAkF;CA8BrF;AAmWD,qCAA8B;+BAtZC,6BAA6B;mBAFzC,uBAAuB"}
@@ -42,7 +42,7 @@ export class Aggregate extends AggregateBase {
42
42
  */
43
43
  shouldAllowMainAgentToCapture(entityGuid: string): boolean;
44
44
  onInteractionDone(interaction: any, wasSaved: any): void;
45
- onSoftNavNotification(interactionId: any, wasFinished: any, softNavAttrs: any): void;
45
+ onSoftNavNotification(interactionId: any, wasFinished: any, softNavAttrs: any, interactionEndTime: any): void;
46
46
  #private;
47
47
  }
48
48
  export type StackInfo = import("./compute-stack-trace.js").StackInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAyBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,2BA4BC;IAzBC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,2BAAgC;IAChC,qBAAwB;IAuB1B,oDAEC;IAED;;;MAcC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED;;;;;;;;;;OAUG;IACH,gBATW,KAAK,GAAC,aAAa,QACnB,MAAM,aACN,OAAO,YAAC,qBACR,MAAM,YAAC,cACP,OAAO,YAAC,kBACR,MAAM,YAAC,+BAiHjB;IA4BD;;;;;MAKE;IACF,0CAHU,MAAM,GACJ,OAAO,CAIlB;IAGD,yDA6BC;IAED,qFAOC;;CACF;wBApRY,OAAO,0BAA0B,EAAE,SAAS;8BAT3B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAyBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,2BA4BC;IAzBC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,2BAAgC;IAChC,qBAAwB;IAuB1B,oDAEC;IAED;;;MAcC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED;;;;;;;;;;OAUG;IACH,gBATW,KAAK,GAAC,aAAa,QACnB,MAAM,aACN,OAAO,YAAC,qBACR,MAAM,YAAC,cACP,OAAO,YAAC,kBACR,MAAM,YAAC,+BAiHjB;IA4BD;;;;;MAKE;IACF,0CAHU,MAAM,GACJ,OAAO,CAIlB;IAGD,yDA6BC;IAED,8GAWC;;CACF;wBAxRY,OAAO,0BAA0B,EAAE,SAAS;8BAT3B,4BAA4B"}
@@ -12,8 +12,8 @@ export class Aggregate extends AggregateBase {
12
12
  entitled: boolean;
13
13
  /** set at BCS response, stored in runtime */
14
14
  timeKeeper: any;
15
+ instrumentClass: any;
15
16
  recorder: any;
16
- errorNoticed: any;
17
17
  isSessionTrackingEnabled: boolean;
18
18
  replayIsActive(): boolean;
19
19
  handleError(e: any): void;
@@ -22,9 +22,16 @@ export class Aggregate extends AggregateBase {
22
22
  * Evaluate entitlements and sampling before starting feature mechanics, importing and configuring recording library, and setting storage state
23
23
  * @param {boolean} srMode - the true/false state of the "sr" flag (aka. entitlements) from RUM response
24
24
  * @param {boolean} ignoreSession - whether to force the method to ignore the session state and use just the sample flags
25
+ * @param {TRIGGERS} [trigger=TRIGGERS.INITIALIZE] - the trigger that initiated the recording. Usually TRIGGERS.INITIALIZE, but could be TRIGGERS.API since in certain cases that trigger calls this method
25
26
  * @returns {void}
26
27
  */
27
- initializeRecording(srMode: boolean, ignoreSession: boolean): void;
28
+ initializeRecording(srMode: boolean, ignoreSession: boolean, trigger?: {
29
+ API: string;
30
+ RESUME: string;
31
+ SWITCH_TO_FULL: string;
32
+ INITIALIZE: string;
33
+ PRELOAD: string;
34
+ }): void;
28
35
  prepUtils(): Promise<void>;
29
36
  makeHarvestPayload(shouldRetryOnFail: any): {
30
37
  targetApp: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AAwBA;IACE,2BAAiC;IAIjC,sCAqFC;IAxFD,aAAe;IAKb,iFAAiF;IACjF,qBAAwB;IAGxB,2CAA2C;IAC3C,sDAAwB;IACxB,6CAA6C;IAC7C,gDAAmB;IAEnB,0BAA0B;IAC1B,kBAAqB;IACrB,6CAA6C;IAC7C,gBAA2B;IAE3B,cAA8B;IAC9B,kBAA+C;IAG/C,kCAAqG;IAmEvG,0BAEC;IAED,0BAMC;IAED,qBAUC;IAED;;;;;OAKG;IACH,4BAJW,OAAO,iBACP,OAAO,GACL,IAAI,CAkDhB;IAED,2BASC;IAED;;;oBAyCC;IAED;;;;OAIG;IACH,6BAHW,MAAM,EAAE,GACN;QAAE,UAAU,EAAE,MAAM,GAAC,SAAS,CAAC;QAAC,SAAS,EAAE,MAAM,GAAC,SAAS,CAAA;KAAE,CAUzE;IAED;;;;;;;;;;MAsEC;IAED,sCAKC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,+CASC;IAED,yCAIC;CACF;8BA3W6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AAwBA;IACE,2BAAiC;IAIjC,sCAuFC;IA1FD,aAAe;IAKb,iFAAiF;IACjF,qBAAwB;IAGxB,2CAA2C;IAC3C,sDAAwB;IACxB,6CAA6C;IAC7C,gDAAmB;IAEnB,0BAA0B;IAC1B,kBAAqB;IACrB,6CAA6C;IAC7C,gBAA2B;IAE3B,qBAA2B;IAE3B,cAA8C;IAI9C,kCAAqG;IAmEvG,0BAEC;IAED,0BAMC;IAED,qBAUC;IAED;;;;;;OAMG;IACH,4BALW,OAAO,iBACP,OAAO;;;;;;QAEL,IAAI,CA8ChB;IAED,2BASC;IAED;;;oBAyCC;IAED;;;;OAIG;IACH,6BAHW,MAAM,EAAE,GACN;QAAE,UAAU,EAAE,MAAM,GAAC,SAAS,CAAC;QAAC,SAAS,EAAE,MAAM,GAAC,SAAS,CAAA;KAAE,CAUzE;IAED;;;;;;;;;;MAsEC;IAED,sCAKC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,+CASC;IAED,yCAIC;CACF;8BA1W6B,4BAA4B"}
@@ -57,5 +57,9 @@ export namespace ABORT_REASONS {
57
57
  export const QUERY_PARAM_PADDING: 5000;
58
58
  export namespace TRIGGERS {
59
59
  let API: string;
60
+ let RESUME: string;
61
+ let SWITCH_TO_FULL: string;
62
+ let INITIALIZE: string;
63
+ let PRELOAD: string;
60
64
  }
61
65
  //# sourceMappingURL=constants.d.ts.map
@@ -1,7 +1,14 @@
1
1
  export class Instrument extends InstrumentBase {
2
2
  static featureName: string;
3
3
  constructor(agentRef: any);
4
+ /** The RRWEB recorder instance, if imported */
5
+ recorder: any;
4
6
  errorNoticed: boolean;
7
+ /**
8
+ * Returns a promise that imports the recorder module. Only lets the recorder module be imported and instantiated once. Rejects if failed to import/instantiate.
9
+ * @returns {Promise}
10
+ */
11
+ importRecorder(): Promise<any>;
5
12
  #private;
6
13
  }
7
14
  export const SessionReplay: typeof Instrument;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/instrument/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IAIjC,2BA+BC;IAJK,sBAAwB;;CA6D/B;AAED,8CAAuC;+BArGR,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/instrument/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IAMjC,2BAgCC;IAnCD,+CAA+C;IAC/C,cAAQ;IA8BF,sBAAwB;IAmB9B;;;OAGG;IACH,+BAkBC;;CAgBF;AAED,8CAAuC;+BApGR,6BAA6B"}
@@ -1,7 +1,12 @@
1
1
  export class Recorder {
2
- constructor(parent: any);
3
- /** The parent class that instantiated the recorder */
4
- parent: any;
2
+ constructor(srInstrument: any);
3
+ triggerHistory: any[];
4
+ /** The parent classes that share the recorder */
5
+ srInstrument: any;
6
+ ee: any;
7
+ srFeatureName: any;
8
+ agentRef: any;
9
+ isErrorMode: boolean;
5
10
  /** A flag that can be set to false by failing conversions to stop the fetching process */
6
11
  shouldFix: any;
7
12
  /** Each page mutation or event will be stored (raw) in this array. This array will be cleared on each harvest */
@@ -14,6 +19,7 @@ export class Recorder {
14
19
  lastMeta: boolean;
15
20
  /** The method to stop recording. This defaults to a noop, but is overwritten once the recording library is imported and initialized */
16
21
  stopRecording: () => void;
22
+ get trigger(): any;
17
23
  getEvents(): {
18
24
  events: any[];
19
25
  type: string;
@@ -27,7 +33,7 @@ export class Recorder {
27
33
  /** Clears the buffer (this.events), and resets all payload metadata properties */
28
34
  clearBuffer(): void;
29
35
  /** Begin recording using configured recording lib */
30
- startRecording(): void;
36
+ startRecording(trigger: any, mode: any): void;
31
37
  /**
32
38
  * audit - Checks if the event node payload is missing certain attributes
33
39
  * will forward on to the "store" method if nothing needs async fixing
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAME,yBAkBC;IAjBC,sDAAsD;IACtD,YAAoB;IACpB,0FAA0F;IAC1F,eAAyE;IAEzE,iHAAiH;IACjH,uBAAgD;IAChD,mFAAmF;IACnF,iCAA0D;IAC1D,uIAAuI;IACvI,yBAA4B;IAC5B,kIAAkI;IAClI,kBAAqB;IACrB,uIAAuI;IACvI,0BAA+E;IAKjF;;;;;;;;;MAWC;IAED,kFAAkF;IAClF,oBAGC;IAED,qDAAqD;IACrD,uBAiCC;IAED;;;;;OAKG;IACH,aAHW,GAAC,cACD,GAAC,QAiCX;IAED,yHAAyH;IACzH,yCAgCC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BArM8B,mBAAmB"}
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAUE,+BA6BC;IA/BD,sBAAmB;IAGjB,iDAAiD;IACjD,kBAAgC;IAEhC,QAAyB;IACzB,mBAA6C;IAC7C,cAAqC;IAErC,qBAAwB;IACxB,0FAA0F;IAC1F,eAAkE;IAElE,iHAAiH;IACjH,uBAAgD;IAChD,mFAAmF;IACnF,iCAA0D;IAC1D,uIAAuI;IACvI,yBAA4B;IAC5B,kIAAkI;IAClI,kBAAqB;IACrB,uIAAuI;IACvI,0BAAwE;IAU1E,mBAEC;IAED;;;;;;;;;MAWC;IAED,kFAAkF;IAClF,oBAGC;IAED,qDAAqD;IACrD,8CAyCC;IAED;;;;;OAKG;IACH,aAHW,GAAC,cACD,GAAC,QAiCX;IAED,yHAAyH;IACzH,yCAgCC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BAhO8B,mBAAmB"}
@@ -1,5 +1,5 @@
1
1
  export class AjaxNode extends BelNode {
2
- constructor(ajaxEvent: any);
2
+ constructor(ajaxEvent: any, ajaxContext: any);
3
3
  belType: number;
4
4
  method: any;
5
5
  status: any;
@@ -12,6 +12,7 @@ export class AjaxNode extends BelNode {
12
12
  traceId: any;
13
13
  spanTimestamp: any;
14
14
  gql: any;
15
+ callbackEnd: any;
15
16
  serialize(parentStartTimestamp: any, agentRef: any): string;
16
17
  }
17
18
  import { BelNode } from './bel-node';
@@ -1 +1 @@
1
- {"version":3,"file":"ajax-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/ajax-node.js"],"names":[],"mappings":"AAQA;IACE,4BAiBC;IAfC,gBAA6B;IAC7B,YAA8B;IAC9B,YAA8B;IAC9B,YAA8B;IAC9B,UAA0B;IAC1B,YAAmC;IACnC,YAAoC;IACpC,+BAAwD;IACxD,YAA8B;IAC9B,aAAgC;IAChC,mBAA4C;IAC5C,SAAwB;IAM1B,4DA+BC;CACF;wBAtDuB,YAAY"}
1
+ {"version":3,"file":"ajax-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/ajax-node.js"],"names":[],"mappings":"AAQA;IACE,8CAqBC;IAnBC,gBAA6B;IAC7B,YAA8B;IAC9B,YAA8B;IAC9B,YAA8B;IAC9B,UAA0B;IAC1B,YAAmC;IACnC,YAAoC;IACpC,+BAAwD;IACxD,YAA8B;IAC9B,aAAgC;IAChC,mBAA4C;IAC5C,SAAwB;IAKtB,iBAAoE;IAKxE,4DA+BC;CACF;wBA1DuB,YAAY"}
@@ -8,7 +8,7 @@ export class Aggregate extends AggregateBase {
8
8
  initialPageLoadInteraction: InitialPageLoadInteraction;
9
9
  latestRouteSetByApi: any;
10
10
  interactionInProgress: Interaction | null;
11
- latestHistoryUrl: any;
11
+ latestHistoryUrl: string;
12
12
  serializer(eventBuffer: any): string;
13
13
  startUIInteraction(eventName: any, startedAt: any, sourceElem: any): void;
14
14
  setClosureHandlers(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC;;OAsDC;IAjDC,2BAAwC;IACxC,iBAA8B;IAE9B,uDAA0E;IAe1E,yBAA+B;IAC/B,0CAAiC;IACjC,sBAA4B;IA+B9B,qCAUC;IAED,0EAiBC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAsB7B;;CA6FF;8BA1O6B,4BAA4B;2CAGf,iCAAiC;4BAChD,eAAe"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC;;OAiEC;IA5DC,2BAAwC;IACxC,iBAA8B;IAE9B,uDAA0E;IAe1E,yBAA+B;IAC/B,0CAAiC;IACjC,yBAA4C;IA0C9C,qCAUC;IAED,0EAmBC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAsB7B;;CAwGF;8BAlQ6B,4BAA4B;2CAGf,iCAAiC;4BAChD,eAAe"}
@@ -18,7 +18,9 @@ export class Interaction extends BelNode {
18
18
  createdByApi: boolean;
19
19
  keepOpenUntilEndApi: boolean;
20
20
  onDone: any[];
21
+ customEnd: number;
21
22
  cancellationTimer: any;
23
+ watchLongtaskTimer: any;
22
24
  belType: number;
23
25
  trigger: any;
24
26
  oldRoute: any;
@@ -27,14 +29,15 @@ export class Interaction extends BelNode {
27
29
  forceIgnore: boolean;
28
30
  newURL: any;
29
31
  oldURL: any;
30
- updateDom(timestamp: any): void;
31
32
  updateHistory(timestamp: any, newUrl: any): void;
32
- seenHistoryAndDomChange(): boolean;
33
+ updateDom(timestamp: any): void;
34
+ checkHistoryAndDomChange(): boolean;
33
35
  on(event: any, cb: any): void;
34
- done(customEndTime: any): boolean;
36
+ done(customEndTime?: number, calledByApi?: boolean): boolean;
35
37
  /**
36
38
  * Given a timestamp, determine if it falls within this interaction's span, i.e. if this was the active interaction during that time.
37
39
  * For in-progress interactions, this only compares the time with the start of span. Cancelled interactions are not considered active at all.
40
+ * Pending-finish interactions are also considered still active wrt assigning ajax or jserrors to them during the wait period.
38
41
  * @param {DOMHighResTimeStamp} timestamp
39
42
  * @returns True or false boolean.
40
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/interaction.js"],"names":[],"mappings":"AAYA;;IAEI;AACJ;IAkBE,0FAaC;IA9BD,WAAmB;IACnB,uBAAgC;IAChC,gBAAU;IACV,qBAAqB;IACrB,oBAAoB;IACpB,eAAS;IACT,aAAO;IACP,cAAQ;IACR,+EAA+E;IAC/E,eAA8B;IAC9B,qBAAgB;IAChB,yBAAoB;IACpB,sBAAoB;IACpB,6BAA2B;IAC3B,cAAW;IACX,uBAAiB;IAIf,gBAAoC;IACpC,aAAsB;IAEtB,cAAiC;IACjC,wCAGE;IACF,mBAAyC;IAAxB,qBAAwB;IAEzC,YAAsE;IAAxD,YAAwD;IAGxE,gCAEC;IAED,iDAGC;IAED,mCAEC;IAED,8BAIC;IAED,kCAaC;IAqBD;;;;;OAKG;IACH,0BAHW,mBAAmB,WAM7B;IAGD,uBAAoB;IACpB,iCAA8B;IAC9B,sBAAmB;IAEnB;;;;;OAKG;IACH,qDAHW,KAAK,UAgDf;;CACF;wBA/JuB,YAAY"}
1
+ {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/interaction.js"],"names":[],"mappings":"AAYA;;IAEI;AACJ;IAoBE,0FAaC;IAhCD,WAAmB;IACnB,uBAAgC;IAChC,gBAAU;IACV,qBAAqB;IACrB,oBAAoB;IACpB,eAAS;IACT,aAAO;IACP,cAAQ;IACR,+EAA+E;IAC/E,eAA8B;IAC9B,qBAAgB;IAChB,yBAAoB;IACpB,sBAAoB;IACpB,6BAA2B;IAC3B,cAAW;IACX,kBAAa;IACb,uBAAiB;IACjB,wBAAkB;IAIhB,gBAAoC;IACpC,aAAsB;IAEtB,cAAiC;IACjC,wCAGE;IACF,mBAAyC;IAAxB,qBAAwB;IAEzC,YAAsE;IAAxD,YAAwD;IAGxE,iDAKC;IAED,gCAGC;IAED,oCAUC;IAED,8BAIC;IAED,6DAeC;IAmBD;;;;;;OAMG;IACH,0BAHW,mBAAmB,WAM7B;IAGD,uBAAoB;IACpB,iCAA8B;IAC9B,sBAAmB;IAEnB;;;;;OAKG;IACH,qDAHW,KAAK,UAgDf;;CACF;wBA7KuB,YAAY"}
@@ -1,7 +1,10 @@
1
1
  export const INTERACTION_TRIGGERS: string[];
2
+ export const POPSTATE_TRIGGER: "popstate";
2
3
  export const API_TRIGGER_NAME: "api";
3
4
  export const IPL_TRIGGER_NAME: "initialPageLoad";
4
5
  export const FEATURE_NAME: string;
6
+ export const NO_LONG_TASK_WINDOW: 5000;
7
+ export const POPSTATE_MERGE_WINDOW: 500;
5
8
  export namespace INTERACTION_TYPE {
6
9
  let INITIAL_PAGE_LOAD: string;
7
10
  let ROUTE_CHANGE: number;
@@ -15,6 +18,7 @@ export namespace NODE_TYPE {
15
18
  }
16
19
  export namespace INTERACTION_STATUS {
17
20
  let IP: string;
21
+ let PF: string;
18
22
  let FIN: string;
19
23
  let CAN: string;
20
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAKC;AACD,+BAAgC,KAAK,CAAA;AACrC,+BAAgC,iBAAiB,CAAA;AAEjD,kCAAiD"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAIC;AACD,+BAAgC,UAAU,CAAA;AAC1C,+BAAgC,KAAK,CAAA;AACrC,+BAAgC,iBAAiB,CAAA;AAEjD,kCAAiD;AACjD,kCAAmC,IAAI,CAAA;AACvC,oCAAqC,GAAG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/instrument/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IACjC,2BAiDC;IA5BG,2CAA0C;CA6B/C;AAED,wCAAiC;+BAlEF,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/instrument/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IACjC,2BAkDC;IAxCG,2CAA0C;CAyC/C;AAED,wCAAiC;+BAnEF,6BAA6B"}
@@ -9,6 +9,7 @@ export class InstrumentBase extends FeatureBase {
9
9
  * @param {string} featureName - The name of the feature module (used to construct file path).
10
10
  */
11
11
  constructor(agentRef: any, featureName: string);
12
+ agentRef: any;
12
13
  /** @type {Function | undefined} This should be set by any derived Instrument class if it has things to do when feature fails or is killed. */
13
14
  abortHandler: Function | undefined;
14
15
  /**
@@ -32,7 +33,7 @@ export class InstrumentBase extends FeatureBase {
32
33
  * @param {Object} agentRef - reference to the base agent ancestor that this feature belongs to
33
34
  * @param {Function} fetchAggregator - a function that returns a promise that resolves to the aggregate module
34
35
  * @param {Object} [argsObjFromInstrument] - any values or references to pass down to aggregate
35
- * @returns void
36
+ * @returns
36
37
  */
37
38
  importAggregator(agentRef: Object, fetchAggregator: Function, argsObjFromInstrument?: Object): void;
38
39
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;;;OAIG;IACH,wCAFW,MAAM,EAuChB;IAlCC,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAEpC;;;MAGE;IACF,uBAAiC;IAiBnC;;;;;;;OAOG;IACH,2BALW,MAAM,qDAEN,MAAM,QA0DhB;;CAkBF;4BA3I2B,gBAAgB"}
1
+ {"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAuBA;;;GAGG;AACH;IACE;;;;OAIG;IACH,wCAFW,MAAM,EAyChB;IApCC,cAAwB;IAExB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAEpC;;;MAGE;IACF,uBAAiC;IAiBnC;;;;;;;OAOG;IACH,2BALW,MAAM,qDAEN,MAAM,QA0DhB;;CAmBF;4BAhJ2B,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-types.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/interaction-types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAGH,wBAAwB;;;;;;gBApFV,UAAU;kBACV,YAAY;SACZ,GAAG;gBACH,UAAU;YACV,MAAM;WACN,KAAK;UACL,IAAI;kBACJ,YAAY;aACZ,OAAO;;;;;;iCAOV,MAAM,KACJ,mBAAmB;;;;;kCAOrB,MAAM,wBACI,GAAG,EAAE,KAAK,GAAG,kBACrB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;;;;;wBAOvB,mBAAmB;;;;;oCAOrB,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;2BAOnB,mBAAmB;;;;;+BAOrB,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;yBAOnB,mBAAmB;;;;;iCAOrB,MAAM,SACN,GAAG,KACD,mBAAmB;;;;;6BAOrB,MAAM,mCAEJ,mBAAmB"}
1
+ {"version":3,"file":"interaction-types.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/interaction-types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH,wBAAwB;;;;;;gBAnFV,UAAU;kBACV,YAAY;SACZ,GAAG;gBACH,UAAU;YACV,MAAM;WACN,KAAK;UACL,IAAI;kBACJ,YAAY;aACZ,OAAO;;;;;;iCAOV,MAAM,KACJ,mBAAmB;;;;;kCAOrB,MAAM,wBACI,GAAG,EAAE,KAAK,GAAG,kBACrB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;;;;;wBAOvB,mBAAmB;;;;;oCAOrB,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;2BAOnB,mBAAmB;;;;;+BAOrB,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;yBAOnB,mBAAmB;;;;;iCAOrB,MAAM,SACN,GAAG,KACD,mBAAmB;;;;;6BAOrB,MAAM,mCAEJ,mBAAmB"}
@@ -1,8 +1,11 @@
1
1
  /**
2
- * @deprecated This feature has been deprecated and will be removed in a future release. A future product centralizing around a single agent instance will be released as a replacement, at which time this loader will be removed.
3
- * --- A minimal agent class designed to only respond to manual user input. As such, this class does not
2
+ * A minimal agent class designed to only respond to manual user input. As such, this class does not
4
3
  * automatically instrument. Instead, each MicroAgent instance will lazy load the required features and can support loading multiple instances on one page.
5
4
  * Out of the box, it can manually handle and report Page View, Page Action, and Error events.
5
+ *
6
+ * @note This loader strategy is slated to be deprecated and eventually removed in a future product release. For better memory usage, build size impacts, entity management and relationships -- a new strategy focused around using a single centralized browser agent instance is actively being worked on. Reach out by email to browser-agent@newrelic.com for more information or if you would like to participate in a limited preview when the feature is ready for early adoption.
7
+ *
8
+ * @see {@link https://www.npmjs.com/package/@newrelic/browser-agent#deploying-one-or-more-micro-agents-per-page} for more information in the documentation.
6
9
  */
7
10
  export class MicroAgent extends MicroAgentBase {
8
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAmCA;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,SAAS,EAAE,YAAY,EAsExC;IAjEC,aAAkB;IAwBlB;;;;OAIG;IACH,uBAFW,MAAM,GAAC,MAAM,EAAE,aAmCzB;IAKH;;;;;MAOC;IAED,gBAEC;CACF;+BAlH8B,oBAAoB"}
1
+ {"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAmCA;;;;;;;;GAQG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,SAAS,EAAE,YAAY,EAsExC;IAjEC,aAAkB;IAwBlB;;;;OAIG;IACH,uBAFW,MAAM,GAAC,MAAM,EAAE,aAmCzB;IAKH;;;;;MAOC;IAED,gBAEC;CACF;+BArH8B,oBAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.297.0",
3
+ "version": "1.297.1-rc.1",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -264,10 +264,6 @@
264
264
  "glob": "^11.0.0",
265
265
  "html-webpack-plugin": "^5.6.0",
266
266
  "husky": "^8.0.3",
267
- "istanbul-lib-coverage": "^3.2.2",
268
- "istanbul-lib-instrument": "^6.0.1",
269
- "istanbul-lib-report": "^3.0.1",
270
- "istanbul-reports": "^3.1.6",
271
267
  "jest": "^29.7.0",
272
268
  "jest-environment-jsdom": "29.7.0",
273
269
  "jest-extended": "^4.0.2",
@@ -295,4 +291,4 @@
295
291
  "README.md",
296
292
  "CHANGELOG.md"
297
293
  ]
298
- }
294
+ }
@@ -5,3 +5,4 @@
5
5
  export const IDEAL_PAYLOAD_SIZE = 16000
6
6
  export const MAX_PAYLOAD_SIZE = 1000000
7
7
  export const DEFAULT_KEY = 'NR_CONTAINER_AGENT'
8
+ export const SESSION_ERROR = 'SESSION_ERROR'
@@ -31,5 +31,4 @@
31
31
  * @property {import('../util/submit-data.js').NetworkMethods} submitMethod The network method to use {@link ../util/submit-data.js}
32
32
  */
33
33
 
34
- /* istanbul ignore next */
35
34
  export const unused = {}