@newrelic/browser-agent 1.252.0 → 1.253.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 (217) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +6 -6
  3. package/dist/cjs/cdn/experimental.js +6 -2
  4. package/dist/cjs/cdn/spa.js +5 -3
  5. package/dist/cjs/common/aggregate/aggregator.js +1 -8
  6. package/dist/cjs/common/config/state/init.js +7 -0
  7. package/dist/cjs/common/constants/env.cdn.js +1 -1
  8. package/dist/cjs/common/constants/env.npm.js +1 -1
  9. package/dist/cjs/common/context/observation-context-manager.js +56 -0
  10. package/dist/cjs/common/event-emitter/contextual-ee.js +12 -9
  11. package/dist/cjs/common/session/constants.js +2 -1
  12. package/dist/cjs/common/session/session-entity.js +3 -1
  13. package/dist/cjs/common/timing/nav-timing.js +8 -3
  14. package/dist/cjs/common/timing/now.js +1 -1
  15. package/dist/cjs/common/util/feature-flags.js +1 -1
  16. package/dist/cjs/common/wrap/index.js +0 -7
  17. package/dist/cjs/common/wrap/wrap-events.js +2 -2
  18. package/dist/cjs/common/wrap/wrap-fetch.js +2 -1
  19. package/dist/cjs/common/wrap/wrap-function.js +5 -7
  20. package/dist/cjs/common/wrap/wrap-promise.js +2 -1
  21. package/dist/cjs/features/ajax/aggregate/index.js +34 -16
  22. package/dist/cjs/features/jserrors/aggregate/index.js +77 -66
  23. package/dist/cjs/features/page_view_event/aggregate/index.js +1 -1
  24. package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -0
  25. package/dist/cjs/features/session_replay/aggregate/index.js +96 -94
  26. package/dist/cjs/features/session_replay/constants.js +5 -1
  27. package/dist/cjs/features/session_replay/instrument/index.js +24 -8
  28. package/dist/cjs/features/session_replay/shared/recorder.js +5 -4
  29. package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +8 -7
  30. package/dist/cjs/features/session_replay/shared/utils.js +26 -0
  31. package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +50 -0
  32. package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +29 -0
  33. package/dist/cjs/features/soft_navigations/aggregate/index.js +263 -0
  34. package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +62 -0
  35. package/dist/cjs/features/soft_navigations/aggregate/interaction.js +146 -0
  36. package/dist/cjs/features/soft_navigations/constants.js +31 -0
  37. package/dist/cjs/features/soft_navigations/index.js +12 -0
  38. package/dist/cjs/features/soft_navigations/instrument/index.js +79 -0
  39. package/dist/cjs/features/spa/aggregate/index.js +4 -4
  40. package/dist/cjs/features/utils/agent-session.js +2 -1
  41. package/dist/cjs/features/utils/instrument-base.js +6 -9
  42. package/dist/cjs/features/utils/lazy-feature-loader.js +2 -0
  43. package/dist/cjs/loaders/agent-base.js +18 -3
  44. package/dist/cjs/loaders/agent.js +15 -18
  45. package/dist/cjs/loaders/api/api-methods.js +9 -0
  46. package/dist/cjs/loaders/api/api.js +17 -18
  47. package/dist/cjs/loaders/configure/configure.js +5 -2
  48. package/dist/cjs/loaders/features/enabled-features.js +1 -1
  49. package/dist/cjs/loaders/features/features.js +3 -1
  50. package/dist/esm/cdn/experimental.js +5 -2
  51. package/dist/esm/cdn/spa.js +3 -1
  52. package/dist/esm/common/aggregate/aggregator.js +1 -8
  53. package/dist/esm/common/config/state/init.js +7 -0
  54. package/dist/esm/common/constants/env.cdn.js +1 -1
  55. package/dist/esm/common/constants/env.npm.js +1 -1
  56. package/dist/esm/common/context/observation-context-manager.js +49 -0
  57. package/dist/esm/common/event-emitter/contextual-ee.js +12 -9
  58. package/dist/esm/common/session/constants.js +1 -0
  59. package/dist/esm/common/session/session-entity.js +3 -1
  60. package/dist/esm/common/timing/nav-timing.js +8 -3
  61. package/dist/esm/common/timing/now.js +1 -1
  62. package/dist/esm/common/util/feature-flags.js +1 -1
  63. package/dist/esm/common/wrap/index.js +1 -2
  64. package/dist/esm/common/wrap/wrap-events.js +3 -3
  65. package/dist/esm/common/wrap/wrap-fetch.js +3 -2
  66. package/dist/esm/common/wrap/wrap-function.js +4 -5
  67. package/dist/esm/common/wrap/wrap-promise.js +3 -2
  68. package/dist/esm/features/ajax/aggregate/index.js +36 -18
  69. package/dist/esm/features/jserrors/aggregate/index.js +77 -66
  70. package/dist/esm/features/page_view_event/aggregate/index.js +1 -1
  71. package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -0
  72. package/dist/esm/features/session_replay/aggregate/index.js +97 -95
  73. package/dist/esm/features/session_replay/constants.js +4 -0
  74. package/dist/esm/features/session_replay/instrument/index.js +25 -9
  75. package/dist/esm/features/session_replay/shared/recorder.js +5 -4
  76. package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +8 -7
  77. package/dist/esm/features/session_replay/shared/utils.js +17 -0
  78. package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +43 -0
  79. package/dist/esm/features/soft_navigations/aggregate/bel-node.js +22 -0
  80. package/dist/esm/features/soft_navigations/aggregate/index.js +256 -0
  81. package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +55 -0
  82. package/dist/esm/features/soft_navigations/aggregate/interaction.js +140 -0
  83. package/dist/esm/features/soft_navigations/constants.js +25 -0
  84. package/dist/esm/features/soft_navigations/index.js +1 -0
  85. package/dist/esm/features/soft_navigations/instrument/index.js +73 -0
  86. package/dist/esm/features/spa/aggregate/index.js +4 -4
  87. package/dist/esm/features/utils/agent-session.js +2 -1
  88. package/dist/esm/features/utils/instrument-base.js +7 -10
  89. package/dist/esm/features/utils/lazy-feature-loader.js +2 -0
  90. package/dist/esm/loaders/agent-base.js +18 -3
  91. package/dist/esm/loaders/agent.js +15 -18
  92. package/dist/esm/loaders/api/api-methods.js +3 -0
  93. package/dist/esm/loaders/api/api.js +17 -17
  94. package/dist/esm/loaders/configure/configure.js +5 -2
  95. package/dist/esm/loaders/features/enabled-features.js +1 -1
  96. package/dist/esm/loaders/features/features.js +3 -1
  97. package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
  98. package/dist/types/common/config/state/init.d.ts.map +1 -1
  99. package/dist/types/common/context/event-context.d.ts.map +1 -0
  100. package/dist/types/common/context/observation-context-manager.d.ts +28 -0
  101. package/dist/types/common/context/observation-context-manager.d.ts.map +1 -0
  102. package/dist/types/common/event-emitter/contextual-ee.d.ts +2 -2
  103. package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -1
  104. package/dist/types/common/session/constants.d.ts +1 -0
  105. package/dist/types/common/session/constants.d.ts.map +1 -1
  106. package/dist/types/common/session/session-entity.d.ts +0 -1
  107. package/dist/types/common/session/session-entity.d.ts.map +1 -1
  108. package/dist/types/common/timing/nav-timing.d.ts.map +1 -1
  109. package/dist/types/common/wrap/index.d.ts +1 -2
  110. package/dist/types/common/wrap/index.d.ts.map +1 -1
  111. package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -1
  112. package/dist/types/common/wrap/wrap-function.d.ts +0 -1
  113. package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
  114. package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -1
  115. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  116. package/dist/types/features/jserrors/aggregate/index.d.ts +4 -3
  117. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  118. package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -1
  119. package/dist/types/features/session_replay/aggregate/index.d.ts +1 -1
  120. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  121. package/dist/types/features/session_replay/constants.d.ts +4 -0
  122. package/dist/types/features/session_replay/constants.d.ts.map +1 -1
  123. package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -1
  124. package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
  125. package/dist/types/features/session_replay/shared/stylesheet-evaluator.d.ts.map +1 -1
  126. package/dist/types/features/session_replay/shared/utils.d.ts +4 -0
  127. package/dist/types/features/session_replay/shared/utils.d.ts.map +1 -0
  128. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts +19 -0
  129. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts.map +1 -0
  130. package/dist/types/features/soft_navigations/aggregate/bel-node.d.ts +16 -0
  131. package/dist/types/features/soft_navigations/aggregate/bel-node.d.ts.map +1 -0
  132. package/dist/types/features/soft_navigations/aggregate/index.d.ts +36 -0
  133. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -0
  134. package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts +12 -0
  135. package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts.map +1 -0
  136. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts +50 -0
  137. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts.map +1 -0
  138. package/dist/types/features/soft_navigations/constants.d.ts +20 -0
  139. package/dist/types/features/soft_navigations/constants.d.ts.map +1 -0
  140. package/dist/types/features/soft_navigations/index.d.ts +2 -0
  141. package/dist/types/features/soft_navigations/index.d.ts.map +1 -0
  142. package/dist/types/features/soft_navigations/instrument/index.d.ts +7 -0
  143. package/dist/types/features/soft_navigations/instrument/index.d.ts.map +1 -0
  144. package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
  145. package/dist/types/features/utils/agent-session.d.ts.map +1 -1
  146. package/dist/types/features/utils/instrument-base.d.ts +1 -7
  147. package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
  148. package/dist/types/features/utils/lazy-feature-loader.d.ts.map +1 -1
  149. package/dist/types/loaders/agent-base.d.ts +5 -1
  150. package/dist/types/loaders/agent-base.d.ts.map +1 -1
  151. package/dist/types/loaders/agent.d.ts +2 -2
  152. package/dist/types/loaders/agent.d.ts.map +1 -1
  153. package/dist/types/loaders/api/api-methods.d.ts +3 -0
  154. package/dist/types/loaders/api/api-methods.d.ts.map +1 -0
  155. package/dist/types/loaders/api/api.d.ts +3 -6
  156. package/dist/types/loaders/api/api.d.ts.map +1 -1
  157. package/dist/types/loaders/configure/configure.d.ts.map +1 -1
  158. package/dist/types/loaders/features/features.d.ts +1 -0
  159. package/dist/types/loaders/features/features.d.ts.map +1 -1
  160. package/dist/types/loaders/micro-agent.d.ts +0 -1
  161. package/dist/types/loaders/micro-agent.d.ts.map +1 -1
  162. package/package.json +1 -1
  163. package/src/cdn/experimental.js +4 -2
  164. package/src/cdn/spa.js +3 -1
  165. package/src/common/aggregate/aggregator.js +2 -11
  166. package/src/common/config/state/init.js +3 -1
  167. package/src/common/context/observation-context-manager.js +55 -0
  168. package/src/common/event-emitter/contextual-ee.js +20 -10
  169. package/src/common/session/constants.js +1 -0
  170. package/src/common/session/session-entity.js +3 -1
  171. package/src/common/timing/nav-timing.js +7 -3
  172. package/src/common/timing/now.js +1 -1
  173. package/src/common/util/feature-flags.js +1 -1
  174. package/src/common/wrap/index.js +1 -2
  175. package/src/common/wrap/wrap-events.js +3 -3
  176. package/src/common/wrap/wrap-fetch.js +3 -2
  177. package/src/common/wrap/wrap-function.js +4 -6
  178. package/src/common/wrap/wrap-promise.js +3 -2
  179. package/src/features/ajax/aggregate/index.js +36 -18
  180. package/src/features/jserrors/aggregate/index.js +70 -73
  181. package/src/features/page_view_event/aggregate/index.js +1 -1
  182. package/src/features/page_view_event/aggregate/initialized-features.js +1 -0
  183. package/src/features/session_replay/aggregate/index.js +92 -95
  184. package/src/features/session_replay/constants.js +5 -0
  185. package/src/features/session_replay/instrument/index.js +24 -9
  186. package/src/features/session_replay/shared/recorder.js +5 -4
  187. package/src/features/session_replay/shared/stylesheet-evaluator.js +8 -7
  188. package/src/features/session_replay/shared/utils.js +19 -0
  189. package/src/features/soft_navigations/aggregate/ajax-node.js +57 -0
  190. package/src/features/soft_navigations/aggregate/bel-node.js +26 -0
  191. package/src/features/soft_navigations/aggregate/index.js +254 -0
  192. package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +53 -0
  193. package/src/features/soft_navigations/aggregate/interaction.js +159 -0
  194. package/src/features/soft_navigations/constants.js +29 -0
  195. package/src/features/soft_navigations/index.js +1 -0
  196. package/src/features/soft_navigations/instrument/index.js +67 -0
  197. package/src/features/spa/aggregate/index.js +5 -4
  198. package/src/features/utils/agent-session.js +2 -1
  199. package/src/features/utils/instrument-base.js +7 -10
  200. package/src/features/utils/lazy-feature-loader.js +2 -0
  201. package/src/loaders/agent-base.js +18 -3
  202. package/src/loaders/agent.js +18 -17
  203. package/src/loaders/api/api-methods.js +12 -0
  204. package/src/loaders/api/api.js +17 -28
  205. package/src/loaders/configure/configure.js +4 -1
  206. package/src/loaders/features/enabled-features.js +1 -1
  207. package/src/loaders/features/features.js +3 -1
  208. package/dist/cjs/common/wrap/wrap-raf.js +0 -55
  209. package/dist/esm/common/wrap/wrap-raf.js +0 -48
  210. package/dist/types/common/event-emitter/event-context.d.ts.map +0 -1
  211. package/dist/types/common/wrap/wrap-raf.d.ts +0 -16
  212. package/dist/types/common/wrap/wrap-raf.d.ts.map +0 -1
  213. package/src/common/wrap/wrap-raf.js +0 -52
  214. /package/dist/cjs/common/{event-emitter → context}/event-context.js +0 -0
  215. /package/dist/esm/common/{event-emitter → context}/event-context.js +0 -0
  216. /package/dist/types/common/{event-emitter → context}/event-context.d.ts +0 -0
  217. /package/src/common/{event-emitter → context}/event-context.js +0 -0
@@ -32,6 +32,8 @@ export function lazyFeatureLoader(featureName, featurePart) {
32
32
  return import( /* webpackChunkName: "session_trace-aggregate" */'../session_trace/aggregate');
33
33
  case FEATURE_NAMES.spa:
34
34
  return import( /* webpackChunkName: "spa-aggregate" */'../spa/aggregate');
35
+ case FEATURE_NAMES.softNav:
36
+ return import( /* webpackChunkName: "basic-spa-aggregate" */'../soft_navigations/aggregate');
35
37
  default:
36
38
  throw new Error("Attempted to load unsupported agent feature: ".concat(featureName, " ").concat(featurePart));
37
39
  }
@@ -1,12 +1,27 @@
1
1
  /* eslint-disable n/handle-callback-err */
2
2
 
3
3
  import { warn } from '../common/util/console';
4
+ import { SR_EVENT_EMITTER_TYPES } from '../features/session_replay/constants';
5
+ import { ObservationContextManager } from '../common/context/observation-context-manager';
6
+ import { generateRandomHexString } from '../common/ids/unique-id';
7
+ import { ee } from '../common/event-emitter/contextual-ee';
4
8
 
5
9
  /**
6
10
  * @typedef {import('./api/interaction-types').InteractionInstance} InteractionInstance
7
11
  */
8
12
 
9
13
  export class AgentBase {
14
+ agentIdentifier;
15
+ observationContext = new ObservationContextManager();
16
+ constructor() {
17
+ let agentIdentifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : generateRandomHexString(16);
18
+ this.agentIdentifier = agentIdentifier;
19
+
20
+ // Assign the observation context to the event emitter, so it knows how to create observation contexts
21
+ const eventEmitter = ee.get(agentIdentifier);
22
+ eventEmitter.observationContext = this.observationContext;
23
+ }
24
+
10
25
  /**
11
26
  * Tries to execute the api and generates a generic warning message with the api name injected if unsuccessful
12
27
  * @param {string} methodName
@@ -124,17 +139,17 @@ export class AgentBase {
124
139
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordReplay/}
125
140
  */
126
141
  recordReplay() {
127
- return this.#callMethod('recordReplay');
142
+ return this.#callMethod(SR_EVENT_EMITTER_TYPES.RECORD);
128
143
  }
129
144
 
130
145
  /**
131
146
  * Forces an active replay to pause recording. If a replay is already actively recording, this call will cause the recording to pause.
132
147
  * If a recording is not currently recording, this call will be ignored. This API will pause both manual and automatic replays that are in progress.
133
148
  * The only way to resume recording after manually pausing a replay is to manually record again using the recordReplay() API.
134
- * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordReplay/}
149
+ * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/pauseReplay/}
135
150
  */
136
151
  pauseReplay() {
137
- return this.#callMethod('pauseReplay');
152
+ return this.#callMethod(SR_EVENT_EMITTER_TYPES.PAUSE);
138
153
  }
139
154
 
140
155
  /**
@@ -12,8 +12,6 @@ import { Instrument as PageViewEvent } from '../features/page_view_event/instrum
12
12
  // common files
13
13
  import { Aggregator } from '../common/aggregate/aggregator';
14
14
  import { gosNREUM, setNREUMInitializedAgent } from '../common/window/nreum';
15
- import { generateRandomHexString } from '../common/ids/unique-id';
16
- import { getConfiguration, getInfo, getLoaderConfig, getRuntime } from '../common/config/config';
17
15
  import { warn } from '../common/util/console';
18
16
  import { stringify } from '../common/util/stringify';
19
17
  import { globalScope } from '../common/constants/runtime';
@@ -23,37 +21,36 @@ import { globalScope } from '../common/constants/runtime';
23
21
  * sensitive to network load, this may result in smaller builds with slightly lower performance impact.
24
22
  */
25
23
  export class Agent extends AgentBase {
26
- constructor(options) {
27
- let agentIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : generateRandomHexString(16);
28
- super();
24
+ constructor(options, agentIdentifier) {
25
+ super(agentIdentifier);
29
26
  if (!globalScope) {
30
27
  // We could not determine the runtime environment. Short-circuite the agent here
31
28
  // to avoid possible exceptions later that may cause issues with customer's application.
32
29
  warn('Failed to initial the agent. Could not determine the runtime environment.');
33
30
  return;
34
31
  }
35
- this.agentIdentifier = agentIdentifier;
36
32
  this.sharedAggregator = new Aggregator({
37
33
  agentIdentifier: this.agentIdentifier
38
34
  });
39
35
  this.features = {};
40
- setNREUMInitializedAgent(agentIdentifier, this); // append this agent onto the global NREUM.initializedAgents
36
+ setNREUMInitializedAgent(this.agentIdentifier, this); // append this agent onto the global NREUM.initializedAgents
41
37
 
42
38
  this.desiredFeatures = new Set(options.features || []); // expected to be a list of static Instrument/InstrumentBase classes, see "spa.js" for example
43
39
  // For Now... ALL agents must make the rum call whether the page_view_event feature was enabled or not.
44
40
  // NR1 creates an index on the rum call, and if not seen for a few days, will remove the browser app!
45
41
  // Future work is being planned to evaluate removing this behavior from the backend, but for now we must ensure this call is made
46
42
  this.desiredFeatures.add(PageViewEvent);
43
+ this.runSoftNavOverSpa = [...this.desiredFeatures].some(instr => instr.featureName === FEATURE_NAMES.softNav);
47
44
  configure(this, options, options.loaderType || 'agent'); // add api, exposed, and other config properties
48
45
 
49
46
  this.run();
50
47
  }
51
48
  get config() {
52
49
  return {
53
- info: getInfo(this.agentIdentifier),
54
- init: getConfiguration(this.agentIdentifier),
55
- loader_config: getLoaderConfig(this.agentIdentifier),
56
- runtime: getRuntime(this.agentIdentifier)
50
+ info: this.info,
51
+ init: this.init,
52
+ loader_config: this.loader_config,
53
+ runtime: this.runtime
57
54
  };
58
55
  }
59
56
  run() {
@@ -63,13 +60,13 @@ export class Agent extends AgentBase {
63
60
  const featuresToStart = [...this.desiredFeatures];
64
61
  featuresToStart.sort((a, b) => featurePriority[a.featureName] - featurePriority[b.featureName]);
65
62
  featuresToStart.forEach(InstrumentCtor => {
66
- // pageViewEvent must be enabled because RUM calls are not optional. See comment in constructor and PR 428.
67
- if (enabledFeatures[InstrumentCtor.featureName] || InstrumentCtor.featureName === FEATURE_NAMES.pageViewEvent) {
68
- const dependencies = getFeatureDependencyNames(InstrumentCtor.featureName);
69
- const hasAllDeps = dependencies.every(x => enabledFeatures[x]);
70
- if (!hasAllDeps) warn("".concat(InstrumentCtor.featureName, " is enabled but one or more dependent features has been disabled (").concat(stringify(dependencies), "). This may cause unintended consequences or missing data..."));
71
- this.features[InstrumentCtor.featureName] = new InstrumentCtor(this.agentIdentifier, this.sharedAggregator);
72
- }
63
+ if (!enabledFeatures[InstrumentCtor.featureName] && InstrumentCtor.featureName !== FEATURE_NAMES.pageViewEvent) return; // PVE is required to run even if it's marked disabled
64
+ if (this.runSoftNavOverSpa && InstrumentCtor.featureName === FEATURE_NAMES.spa) return;
65
+ if (!this.runSoftNavOverSpa && InstrumentCtor.featureName === FEATURE_NAMES.softNav) return;
66
+ const dependencies = getFeatureDependencyNames(InstrumentCtor.featureName);
67
+ const hasAllDeps = dependencies.every(featName => featName in this.features); // any other feature(s) this depends on should've been initialized on prior iterations by priority order
68
+ if (!hasAllDeps) warn("".concat(InstrumentCtor.featureName, " is enabled but one or more dependent features has not been initialized (").concat(stringify(dependencies), "). This may cause unintended consequences or missing data..."));
69
+ this.features[InstrumentCtor.featureName] = new InstrumentCtor(this.agentIdentifier, this.sharedAggregator);
73
70
  });
74
71
  } catch (err) {
75
72
  warn('Failed to initialize all enabled instrument classes (agent aborted) -', err);
@@ -0,0 +1,3 @@
1
+ import { SR_EVENT_EMITTER_TYPES } from '../../features/session_replay/constants';
2
+ export const apiMethods = ['setErrorHandler', 'finished', 'addToTrace', 'addRelease', 'addPageAction', 'setCurrentRouteName', 'setPageViewName', 'setCustomAttribute', 'interaction', 'noticeError', 'setUserId', 'setApplicationVersion', 'start', 'recordReplay', 'pauseReplay', SR_EVENT_EMITTER_TYPES.RECORD, SR_EVENT_EMITTER_TYPES.PAUSE];
3
+ export const asyncApiMethods = ['setErrorHandler', 'finished', 'addToTrace', 'addRelease'];
@@ -13,12 +13,11 @@ import { isBrowserScope } from '../../common/constants/runtime';
13
13
  import { warn } from '../../common/util/console';
14
14
  import { SUPPORTABILITY_METRIC_CHANNEL } from '../../features/metrics/constants';
15
15
  import { gosCDN } from '../../common/window/nreum';
16
- export const CUSTOM_ATTR_GROUP = 'CUSTOM/'; // the subgroup items should be stored under in storage API
17
-
16
+ import { apiMethods, asyncApiMethods } from './api-methods';
17
+ import { SR_EVENT_EMITTER_TYPES } from '../../features/session_replay/constants';
18
18
  export function setTopLevelCallers() {
19
19
  const nr = gosCDN();
20
- const funcs = ['setErrorHandler', 'finished', 'addToTrace', 'addRelease', 'addPageAction', 'setCurrentRouteName', 'setPageViewName', 'setCustomAttribute', 'interaction', 'noticeError', 'setUserId', 'setApplicationVersion', 'start', 'recordReplay', 'pauseReplay'];
21
- funcs.forEach(f => {
20
+ apiMethods.forEach(f => {
22
21
  nr[f] = function () {
23
22
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
23
  args[_key] = arguments[_key];
@@ -40,20 +39,19 @@ export function setTopLevelCallers() {
40
39
  }
41
40
  }
42
41
  export function setAPI(agentIdentifier, forceDrain) {
42
+ let runSoftNavOverSpa = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
43
43
  if (!forceDrain) registerDrain(agentIdentifier, 'api');
44
44
  const apiInterface = {};
45
45
  var instanceEE = ee.get(agentIdentifier);
46
46
  var tracerEE = instanceEE.get('tracer');
47
- var asyncApiFns = ['setErrorHandler', 'finished', 'addToTrace', 'addRelease'];
48
47
  var prefix = 'api-';
49
48
  var spaPrefix = prefix + 'ixn-';
50
49
 
51
50
  // Setup stub functions that queue calls for later processing.
52
- asyncApiFns.forEach(fnName => {
51
+ asyncApiMethods.forEach(fnName => {
53
52
  apiInterface[fnName] = apiCall(prefix, fnName, true, 'api');
54
53
  });
55
54
  apiInterface.addPageAction = apiCall(prefix, 'addPageAction', true, FEATURE_NAMES.pageAction);
56
- apiInterface.setCurrentRouteName = apiCall(prefix, 'routeName', true, FEATURE_NAMES.spa);
57
55
  apiInterface.setPageViewName = function (name, host) {
58
56
  if (typeof name !== 'string') return;
59
57
  if (name.charAt(0) !== '/') name = '/' + name;
@@ -138,25 +136,26 @@ export function setAPI(agentIdentifier, forceDrain) {
138
136
  warn('An unexpected issue occurred', err);
139
137
  }
140
138
  };
141
- apiInterface.recordReplay = function () {
139
+ apiInterface[SR_EVENT_EMITTER_TYPES.RECORD] = function () {
142
140
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/recordReplay/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
143
- handle('recordReplay', [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
141
+ handle(SR_EVENT_EMITTER_TYPES.RECORD, [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
144
142
  };
145
- apiInterface.pauseReplay = function () {
143
+ apiInterface[SR_EVENT_EMITTER_TYPES.PAUSE] = function () {
146
144
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/pauseReplay/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
147
- handle('pauseReplay', [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
145
+ handle(SR_EVENT_EMITTER_TYPES.PAUSE, [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
148
146
  };
149
- apiInterface.interaction = function () {
150
- return new InteractionHandle().get();
147
+ apiInterface.interaction = function (options) {
148
+ return new InteractionHandle().get(typeof options === 'object' ? options : {});
151
149
  };
152
150
  function InteractionHandle() {}
153
- var InteractionApiProto = InteractionHandle.prototype = {
151
+ const InteractionApiProto = InteractionHandle.prototype = {
154
152
  createTracer: function (name, cb) {
155
153
  var contextStore = {};
156
154
  var ixn = this;
157
155
  var hasCb = typeof cb === 'function';
158
156
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/createTracer/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
159
- handle(spaPrefix + 'tracer', [now(), name, contextStore], ixn, FEATURE_NAMES.spa, instanceEE);
157
+ // Soft navigations won't support Tracer nodes, but this fn should still work the same otherwise (e.g., run the orig cb).
158
+ if (!runSoftNavOverSpa) handle(spaPrefix + 'tracer', [now(), name, contextStore], ixn, FEATURE_NAMES.spa, instanceEE);
160
159
  return function () {
161
160
  tracerEE.emit((hasCb ? '' : 'no-') + 'fn-start', [now(), ixn, hasCb], contextStore);
162
161
  if (hasCb) {
@@ -174,13 +173,14 @@ export function setAPI(agentIdentifier, forceDrain) {
174
173
  }
175
174
  };
176
175
  ['actionText', 'setName', 'setAttribute', 'save', 'ignore', 'onEnd', 'getContext', 'end', 'get'].forEach(name => {
177
- InteractionApiProto[name] = apiCall(spaPrefix, name, undefined, FEATURE_NAMES.spa);
176
+ InteractionApiProto[name] = apiCall(spaPrefix, name, undefined, runSoftNavOverSpa ? FEATURE_NAMES.softNav : FEATURE_NAMES.spa);
178
177
  });
178
+ apiInterface.setCurrentRouteName = runSoftNavOverSpa ? apiCall(spaPrefix, 'routeName', undefined, FEATURE_NAMES.softNav) : apiCall(prefix, 'routeName', true, FEATURE_NAMES.spa);
179
179
  function apiCall(prefix, name, notSpa, bufferGroup) {
180
180
  return function () {
181
181
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/' + name + '/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
182
182
  if (bufferGroup) handle(prefix + name, [now(), ...arguments], notSpa ? null : this, bufferGroup, instanceEE); // no bufferGroup means only the SM is emitted
183
- return notSpa ? undefined : this;
183
+ return notSpa ? undefined : this; // returns the InteractionHandle which allows these methods to be chained
184
184
  };
185
185
  }
186
186
  apiInterface.noticeError = function (err, customAttributes) {
@@ -3,7 +3,7 @@ import { addToNREUM, gosCDN } from '../../common/window/nreum';
3
3
  import { getConfiguration, setConfiguration, setInfo, setLoaderConfig, setRuntime } from '../../common/config/config';
4
4
  import { activatedFeatures } from '../../common/util/feature-flags';
5
5
  import { isWorkerScope } from '../../common/constants/runtime';
6
- import { redefinePublicPath } from './public-path';
6
+ import { redefinePublicPath } from "./public-path.npm";
7
7
  let alreadySetOnce = false; // the configure() function can run multiple times in agent lifecycle
8
8
 
9
9
  /**
@@ -49,10 +49,13 @@ export function configure(agent) {
49
49
  if (updatedInit.proxy.beacon) internalTrafficList.push(updatedInit.proxy.beacon);
50
50
  setTopLevelCallers(); // no need to set global APIs on newrelic obj more than once
51
51
  addToNREUM('activatedFeatures', activatedFeatures);
52
+
53
+ // Update if soft_navigations is allowed to run AND part of this agent build, used to override old spa functions.
54
+ agent.runSoftNavOverSpa &&= updatedInit.soft_navigations.enabled === true && updatedInit.feature_flags.includes('soft_nav');
52
55
  }
53
56
  runtime.denyList = [...(updatedInit.ajax.deny_list || []), ...(updatedInit.ajax.block_internal ? internalTrafficList : [])];
54
57
  setRuntime(agent.agentIdentifier, runtime);
55
- if (agent.api === undefined) agent.api = setAPI(agent.agentIdentifier, forceDrain);
58
+ if (agent.api === undefined) agent.api = setAPI(agent.agentIdentifier, forceDrain, agent.runSoftNavOverSpa);
56
59
  if (agent.exposed === undefined) agent.exposed = exposed;
57
60
  alreadySetOnce = true;
58
61
  }
@@ -2,7 +2,7 @@ import { FEATURE_NAMES } from './features';
2
2
  import { getConfigurationValue } from '../../common/config/config';
3
3
  const featureNames = Object.values(FEATURE_NAMES);
4
4
  function isEnabled(name, agentIdentifier) {
5
- return getConfigurationValue(agentIdentifier, "".concat(name, ".enabled")) !== false;
5
+ return getConfigurationValue(agentIdentifier, "".concat(name, ".enabled")) === true;
6
6
  }
7
7
  export function getEnabledFeatures(agentIdentifier) {
8
8
  const enabledFeatures = {};
@@ -7,6 +7,7 @@ export const FEATURE_NAMES = {
7
7
  pageViewTiming: 'page_view_timing',
8
8
  sessionReplay: 'session_replay',
9
9
  sessionTrace: 'session_trace',
10
+ softNav: 'soft_navigations',
10
11
  spa: 'spa'
11
12
  };
12
13
 
@@ -23,5 +24,6 @@ export const featurePriority = {
23
24
  [FEATURE_NAMES.sessionTrace]: 6,
24
25
  [FEATURE_NAMES.pageAction]: 7,
25
26
  [FEATURE_NAMES.spa]: 8,
26
- [FEATURE_NAMES.sessionReplay]: 9
27
+ [FEATURE_NAMES.softNav]: 9,
28
+ [FEATURE_NAMES.sessionReplay]: 10
27
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregate/aggregator.js"],"names":[],"mappings":"AAQA;IAGI,mBAAwB;IAO1B,kFAIC;IAED,gFA0BC;IAED,gEAIC;IAED,qEAUC;IAED,+BAKC;IAGD,4BAWC;CACF;8BArF6B,2BAA2B"}
1
+ {"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregate/aggregator.js"],"names":[],"mappings":"AAQA;IAGI,mBAAwB;IAO1B,kFAIC;IAED,gFA0BC;IAED,gEAIC;IAED,qEAUC;IAED,+BAKC;IAGD,4BAYC;CACF;8BAtF6B,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/init.js"],"names":[],"mappings":"AA6GA,+CAIC;AAED,0DAKC;AAED,+DAYC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/init.js"],"names":[],"mappings":"AA+GA,+CAIC;AAED,0DAKC;AAED,+DAYC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-context.d.ts","sourceRoot":"","sources":["../../../../src/common/context/event-context.js"],"names":[],"mappings":"AAAA;IACE,4BAEC;IADC,eAA0B;CAE7B"}
@@ -0,0 +1,28 @@
1
+ export class ObservationContextManager {
2
+ static contextId: string;
3
+ static contextOriginalId: string;
4
+ static contextWrappedId: string;
5
+ static getObservationContextByAgentIdentifier(agentIdentifier: any): any;
6
+ /**
7
+ * Returns the observation context tied to the supplied construct. If there has been
8
+ * no observation construct created, an empty object is created and stored as the current
9
+ * context.
10
+ * @param key {unknown} The construct being observed such as an XHR instance
11
+ * @return {EventContext} An object of key:value pairs to track as
12
+ * part of the observation
13
+ */
14
+ getCreateContext(key: unknown): EventContext;
15
+ /**
16
+ * Set the observation context for an observed construct. If values of the context
17
+ * need to be updated, they should be done so directly on the context. This function
18
+ * is only for the setting of a whole context.
19
+ * @param key {unknown} The construct being observed such as an XHR instance
20
+ * @param value {EventContext} An object of key:value pairs to track as
21
+ * part of the observation
22
+ * @return {EventContext} The updated observation context
23
+ */
24
+ setContext(key: unknown, value: EventContext): EventContext;
25
+ #private;
26
+ }
27
+ import { EventContext } from './event-context';
28
+ //# sourceMappingURL=observation-context-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observation-context-manager.d.ts","sourceRoot":"","sources":["../../../../src/common/context/observation-context-manager.js"],"names":[],"mappings":"AAIA;IAIE,yBAA2C;IAC3C,iCAAoD;IACpD,gCAA6E;IAE7E,yEAKC;IAOD;;;;;;;OAOG;IACH,sBAJe,OAAO,GACV,YAAY,CASvB;IAED;;;;;;;;OAQG;IACH,gBALe,OAAO,SACL,YAAY,GAEjB,YAAY,CAMvB;;CACF;6BApD4B,iBAAiB"}
@@ -1,3 +1,4 @@
1
+ export { globalInstance as ee };
1
2
  declare namespace globalInstance {
2
3
  export { addEventListener as on };
3
4
  export { addEventListener };
@@ -12,13 +13,12 @@ declare namespace globalInstance {
12
13
  export { isBuffering };
13
14
  export { debugId };
14
15
  export let backlog: any;
16
+ export let observationContextManager: null;
15
17
  }
16
- export const contextId: string;
17
18
  declare function emit(type: any, args: any, contextOrStore: any, force: any, bubble: any): any;
18
19
  declare function getOrCreate(name: any): any;
19
20
  declare function listeners(type: any): any;
20
21
  declare function bufferEventsByGroup(types: any, group: any): void;
21
22
  declare function abort(): void;
22
23
  declare function isBuffering(type: any): boolean;
23
- export { globalInstance as ee };
24
24
  //# sourceMappingURL=contextual-ee.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextual-ee.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/contextual-ee.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,+BAA0C;AA0DxC,+FAsBC;AAqBD,6CAEC;AAND,2CAEC;AAMD,mEAaC;AAcH,+BASC;AArBC,iDAGC"}
1
+ {"version":3,"file":"contextual-ee.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/contextual-ee.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA0EE,+FAsBC;AAqBD,6CAQC;AAZD,2CAEC;AAYD,mEAaC;AAcH,+BASC;AArBC,iDAGC"}
@@ -1,4 +1,5 @@
1
1
  export const PREFIX: "NRBA";
2
+ export const DEFAULT_KEY: "SESSION";
2
3
  export const DEFAULT_EXPIRES_MS: 14400000;
3
4
  export const DEFAULT_INACTIVE_MS: 1800000;
4
5
  export namespace SESSION_EVENTS {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/common/session/constants.js"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,0CAA0C;AAC1C,0CAA0C"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/common/session/constants.js"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,oCAAoC;AACpC,0CAA0C;AAC1C,0CAA0C"}
@@ -20,7 +20,6 @@ export class SessionEntity {
20
20
  inactiveMs: number | undefined;
21
21
  expiresTimer: Timer | undefined;
22
22
  inactiveTimer: InteractionTimer | undefined;
23
- isNew: boolean | undefined;
24
23
  initialized: boolean | undefined;
25
24
  get lookupKey(): string;
26
25
  sync(data: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"session-entity.d.ts","sourceRoot":"","sources":["../../../../src/common/session/session-entity.js"],"names":[],"mappings":"AA6BA;IACE;;;;;OAKG;IACH,uBA0BC;IApBC,qBAAsC;IACtC,aAAsB;IACtB,UAAe;IAGf,SAAc;IAEd,QAAiC;IAenC;;;;aAsEC;IA/DC,8BAA0B;IAC1B,+BAA4B;IAc1B,gCAOqC;IAUrC,4CAiBsC;IAOxC,2BAA6C;IAM7C,iCAAuB;IAIzB,wBAEC;IAED,sBAEC;IAED;;;OAGG;IACH,QAFa,MAAM,CA6BlB;IAED;;;;;;OAMG;IACH,YAHW,MAAM,GACJ,MAAM,CAkBlB;IAED,gBAuBC;IAED;;OAEG;IACH,gBAIC;IAED;;;OAGG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,gBAHW,MAAM,GACJ,OAAO,CAKnB;IAED,yDAUC;IAED,6DAIC;IAED;;;OAGG;IACH,6BAHW,MAAM,GACJ,MAAM,CAIlB;IAED,gDAaC;IAHG,YAAuD;CAI5D;sBAlSqB,gBAAgB;iCAGL,4BAA4B"}
1
+ {"version":3,"file":"session-entity.d.ts","sourceRoot":"","sources":["../../../../src/common/session/session-entity.js"],"names":[],"mappings":"AA6BA;IACE;;;;;OAKG;IACH,uBA0BC;IApBC,qBAAsC;IACtC,aAAsB;IACtB,UAAe;IAGf,SAAc;IAEd,QAAiC;IAenC;;;;aAwEC;IAjEC,8BAA0B;IAC1B,+BAA4B;IAc1B,gCAOqC;IAUrC,4CAiBsC;IAexC,iCAAuB;IAIzB,wBAEC;IAED,sBAEC;IAED;;;OAGG;IACH,QAFa,MAAM,CA6BlB;IAED;;;;;;OAMG;IACH,YAHW,MAAM,GACJ,MAAM,CAkBlB;IAED,gBAuBC;IAED;;OAEG;IACH,gBAIC;IAED;;;OAGG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,gBAHW,MAAM,GACJ,OAAO,CAKnB;IAED,yDAUC;IAED,6DAIC;IAED;;;OAGG;IACH,6BAHW,MAAM,GACJ,MAAM,CAIlB;IAED,gDAaC;IAHG,YAAuD;CAI5D;sBApSqB,gBAAgB;iCAGL,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"nav-timing.d.ts","sourceRoot":"","sources":["../../../../src/common/timing/nav-timing.js"],"names":[],"mappings":"AAwCA,uFAyBC;AAGD,4CAIC;AA7CD,oCAA+B"}
1
+ {"version":3,"file":"nav-timing.d.ts","sourceRoot":"","sources":["../../../../src/common/timing/nav-timing.js"],"names":[],"mappings":"AAwCA,uFAyBC;AAGD,4CAIC;AA7CD,oCAAiC"}
@@ -4,8 +4,7 @@ import { wrapHistory } from './wrap-history';
4
4
  import { wrapJsonP } from './wrap-jsonp';
5
5
  import { wrapMutation } from './wrap-mutation';
6
6
  import { wrapPromise } from './wrap-promise';
7
- import { wrapRaf } from './wrap-raf';
8
7
  import { wrapTimer } from './wrap-timer';
9
8
  import { wrapXhr } from './wrap-xhr';
10
- export { wrapEvents, wrapFetch, wrapHistory, wrapJsonP, wrapMutation, wrapPromise, wrapRaf, wrapTimer, wrapXhr };
9
+ export { wrapEvents, wrapFetch, wrapHistory, wrapJsonP, wrapMutation, wrapPromise, wrapTimer, wrapXhr };
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/index.js"],"names":[],"mappings":"2BAI2B,eAAe;0BAChB,cAAc;4BACZ,gBAAgB;0BAClB,cAAc;6BACX,iBAAiB;4BAClB,gBAAgB;wBACpB,YAAY;0BACV,cAAc;wBAChB,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/index.js"],"names":[],"mappings":"2BAI2B,eAAe;0BAChB,cAAc;4BACZ,gBAAgB;0BAClB,cAAc;6BACX,iBAAiB;4BAClB,gBAAgB;0BAClB,cAAc;wBAChB,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-fetch.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-fetch.js"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AACH,oCAJW,MAAM,GAEJ,MAAM,CAqElB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-fetch.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-fetch.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,oCAJW,MAAM,GAEJ,MAAM,CAqElB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -5,6 +5,5 @@
5
5
  * @returns {function} The wrapped function.
6
6
  */
7
7
  export function createWrapperWithEmitter(emitter?: Object | undefined, always: boolean): Function;
8
- export const flag: string;
9
8
  export default createWrapperWithEmitter;
10
9
  //# sourceMappingURL=wrap-function.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,+EAHW,OAAO,YAgIjB;AApJD,0BAA6C"}
1
+ {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,+EAHW,OAAO,YAgIjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-promise.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-promise.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,MAAM,CAqIlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-promise.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-promise.js"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,MAAM,CAqIlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,mDAyOC;IAlNC,qGAAwB;IACxB;;;;4BAAoC;IACpC;;;mBAA2E;CAiN9E;8BA/O6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mDA0PC;IAnOC,qGAAwB;IACxB;;;;4BAAoC;IACpC;;;mBAA2E;CAkO9E;8BAjQ6B,4BAA4B"}
@@ -7,7 +7,7 @@ export class Aggregate extends AggregateBase {
7
7
  stackReported: {};
8
8
  observedAt: {};
9
9
  pageviewReported: {};
10
- errorCache: {};
10
+ bufferedErrorsUnderSpa: {};
11
11
  currentBody: {} | null | undefined;
12
12
  errorOnPage: boolean;
13
13
  onHarvestStarted(options: any): {
@@ -26,8 +26,9 @@ export class Aggregate extends AggregateBase {
26
26
  */
27
27
  buildCanonicalStackString(stackInfo: StackInfo): string;
28
28
  storeError(err: any, time: any, internal: any, customAttributes: any): void;
29
- onInteractionSaved(interaction: any): void;
30
- onInteractionDiscarded(interaction: any): void;
29
+ onInteractionDone(interaction: any, wasSaved: any): void;
30
+ onSoftNavNotification(interactionId: any, wasFinished: any, softNavAttrs: any): void;
31
+ #private;
31
32
  }
32
33
  export type StackInfo = import('./compute-stack-trace.js').StackInfo;
33
34
  import { AggregateBase } from '../../utils/aggregate-base';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAuBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,mDAoCC;IAjCC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,eAAoB;IACpB,mCAA4B;IAC5B,qBAAwB;IA8B1B;;;MAoBC;IAED,qCAWC;IAED,8BAEC;IAED,oEAMC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED,4EA4FC;IAED,2CAgCC;IAED,+CA2BC;CACF;wBA7QY,OAAO,0BAA0B,EAAE,SAAS;8BAH3B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAwBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,mDAmCC;IAhCC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,2BAAgC;IAChC,mCAA4B;IAC5B,qBAAwB;IA6B1B;;;MAoBC;IAED,qCAWC;IAED,8BAEC;IAED,oEAMC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED,4EAsFC;IA4BD,yDA6BC;IAED,qFAOC;;CACF;wBAzQY,OAAO,0BAA0B,EAAE,SAAS;8BAJ3B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"initialized-features.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/initialized-features.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,4DAFa,QAAQ,CAwBpB"}
1
+ {"version":3,"file":"initialized-features.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/initialized-features.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,4DAFa,QAAQ,CAyBpB"}
@@ -13,7 +13,7 @@ export class Aggregate extends AggregateBase {
13
13
  /** set by BCS response */
14
14
  entitled: boolean;
15
15
  recorder: any;
16
- scheduler: HarvestScheduler | undefined;
16
+ scheduler: HarvestScheduler;
17
17
  errorNoticed: boolean;
18
18
  switchToFull(): void;
19
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AA8BA;IACE,2BAAiC;IAEjC,8DAwHC;IAtHC,8GAA8G;IAC9G,wBAAgH;IAChH,iFAAiF;IACjF,qBAAwB;IAGxB,2CAA2C;IAC3C,sDAAwB;IACxB,6CAA6C;IAC7C,gDAAmB;IAGnB,UAAuD;IAEvD,0BAA0B;IAC1B,kBAAqB;IAErB,cAA8B;IAoC5B,wCAKQ;IAyBN,sBAAwB;IAqC9B,qBAWC;IAED;;;;;;;OAOG;IACH,iCALW,OAAO,cACP,OAAO,iBACP,OAAO,GACL,IAAI,CAsDhB;IAED,2BASC;IAED;;;;;;;;;;;oBAiCC;IAED;;;;;;;;;MAmEC;IAED,qCAOC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,yBAUC;IAED,yCAGC;CACF;8BA/W6B,4BAA4B;iCAHzB,2CAA2C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AA8BA;IACE,2BAAiC;IAEjC,8DA+GC;IA7GC,8GAA8G;IAC9G,wBAAgH;IAChH,iFAAiF;IACjF,qBAAwB;IAGxB,2CAA2C;IAC3C,sDAAwB;IACxB,6CAA6C;IAC7C,gDAAmB;IAGnB,UAAuD;IAEvD,0BAA0B;IAC1B,kBAAqB;IAErB,cAA8B;IA8B9B,4BAKQ;IAmBN,sBAAwB;IAwC5B,qBAWC;IAED;;;;;;;OAOG;IACH,iCALW,OAAO,cACP,OAAO,iBACP,OAAO,GACL,IAAI,CA4DhB;IAED,2BASC;IAED;;;;;;;;;;;oBAiCC;IAED;;;;;;;;;MAmEC;IAED,qCAOC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,yBAUC;IAED,yCAGC;CACF;8BA5W6B,4BAA4B;iCAHzB,2CAA2C"}
@@ -1,4 +1,8 @@
1
1
  export const FEATURE_NAME: string;
2
+ export namespace SR_EVENT_EMITTER_TYPES {
3
+ let RECORD: string;
4
+ let PAUSE: string;
5
+ }
2
6
  export const AVG_COMPRESSION: 0.12;
3
7
  export namespace RRWEB_EVENT_TYPES {
4
8
  let DomContentLoaded: number;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAGA,kCAAuD;AAEvD,mCAAmC;;;;;;;;;AASnC,uCAAuC;AACvC,uCAAuC;AACvC,iCAAiC;AACjC,uCAAuC;AACvC,2GAA2G;AAC3G;;EAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BtF,0CAA0C;AAC1C,uCAAuC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAGA,kCAAuD;;;;;AAOvD,mCAAmC;;;;;;;;;AASnC,uCAAuC;AACvC,uCAAuC;AACvC,iCAAiC;AACjC,uCAAuC;AACvC,2GAA2G;AAC3G;;EAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BtF,0CAA0C;AAC1C,uCAAuC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/instrument/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC,mEAYC;IAIC,4DAA6E;;CAIhF;+BAzB8B,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/instrument/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IACjC,mEAYC;IAiBC,4DAA6E;;CAKhF;+BAxC8B,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAWA;IAUE,yBAeC;IAdC,iEAAiE;IACjE,mBAAsB;IACtB,6DAA6D;IAC7D,oCAAuC;IACvC,kIAAkI;IAClI,kBAAqB;IACrB,sDAAsD;IACtD,YAAoB;IACpB,oEAAoE;IACpE,6BAAqH;IACrH,0FAA0F;IAC1F,eAA6C;IAC7C,uIAAuI;IACvI,0BAAyE;IAG3E;;;;;;;;;MAYC;IAED,mFAAmF;IACnF,oBAKC;IAED,qDAAqD;IACrD,uBAwBC;IAED;;;;;OAKG;IACH,yCAyBC;IAED,0HAA0H;IAC1H,yCA2CC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BA9L8B,mBAAmB"}
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAWA;IAUE,yBAeC;IAdC,iEAAiE;IACjE,mBAAsB;IACtB,6DAA6D;IAC7D,oCAAuC;IACvC,kIAAkI;IAClI,kBAAqB;IACrB,sDAAsD;IACtD,YAAoB;IACpB,oEAAoE;IACpE,6BAAqH;IACrH,0FAA0F;IAC1F,eAA6C;IAC7C,uIAAuI;IACvI,0BAAyE;IAG3E;;;;;;;;;MAYC;IAED,mFAAmF;IACnF,oBAKC;IAED,qDAAqD;IACrD,uBAwBC;IAED;;;;;OAKG;IACH,yCA0BC;IAED,0HAA0H;IAC1H,yCA2CC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BA/L8B,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"stylesheet-evaluator.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/stylesheet-evaluator.js"],"names":[],"mappings":"AAwFA,sDAA4D;AArF5D;IAGE;;;QAGI;IACJ,oCAAkC;IAClC,oBAAe;IAEf;;;OAGG;IACH,mBAmBC;IAED;;;OAGG;IACH,oBAMC;;CAsCF"}
1
+ {"version":3,"file":"stylesheet-evaluator.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/stylesheet-evaluator.js"],"names":[],"mappings":"AAyFA,sDAA4D;AAtF5D;IAGE;;;QAGI;IACJ,oCAAkC;IAClC,oBAAe;IAEf;;;OAGG;IACH,mBAmBC;IAED;;;OAGG;IACH,oBAMC;;CAuCF"}
@@ -0,0 +1,4 @@
1
+ export function isPreloadAllowed(agentId: any): any;
2
+ export function canImportReplayAgg(agentId: any, sessionMgr: any): boolean;
3
+ export function enableSessionTracking(agentId: any): boolean;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/utils.js"],"names":[],"mappings":"AAWA,oDAEC;AAED,2EAGC;AAfM,6DAA+H"}
@@ -0,0 +1,19 @@
1
+ export class AjaxNode extends BelNode {
2
+ constructor(agentIdentifier: any, ajaxEvent: any);
3
+ belType: number;
4
+ method: any;
5
+ status: any;
6
+ domain: any;
7
+ path: any;
8
+ txSize: any;
9
+ rxSize: any;
10
+ requestedWith: string | number;
11
+ spanId: any;
12
+ traceId: any;
13
+ spanTimestamp: any;
14
+ gql: any;
15
+ start: any;
16
+ serialize(parentStartTimestamp: any): string;
17
+ }
18
+ import { BelNode } from './bel-node';
19
+ //# sourceMappingURL=ajax-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ajax-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/ajax-node.js"],"names":[],"mappings":"AAIA;IACE,kDAiBC;IAfC,gBAA6B;IAC7B,YAA8B;IAC9B,YAA8B;IAC9B,YAA8B;IAC9B,UAA0B;IAC1B,YAAmC;IACnC,YAAoC;IACpC,+BAAwD;IACxD,YAA8B;IAC9B,aAAgC;IAChC,mBAA4C;IAC5C,SAAwB;IAExB,WAAgC;IAIlC,6CA+BC;CACF;wBAtDuB,YAAY"}
@@ -0,0 +1,16 @@
1
+ export class BelNode {
2
+ constructor(agentIdentifier: any);
3
+ belType: any;
4
+ /** List of other BelNode derivatives. Each children should be of a subclass that implements its own 'serialize' function. */
5
+ children: any[];
6
+ start: number;
7
+ end: any;
8
+ callbackEnd: number;
9
+ callbackDuration: number;
10
+ nodeId: number;
11
+ agentIdentifier: any;
12
+ addChild(child: any): void;
13
+ /** Virtual fn for stringifying an instance. */
14
+ serialize(): void;
15
+ }
16
+ //# sourceMappingURL=bel-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bel-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/bel-node.js"],"names":[],"mappings":"AAIA;IAUE,kCAGC;IAZD,aAAO;IACP,6HAA6H;IAC7H,gBAAa;IACb,cAAa;IACb,SAAG;IACH,oBAAe;IACf,yBAAoB;IACpB,eAAoB;IAIlB,qBAAsC;IAGxC,2BAEC;IAED,+CAA+C;IAC/C,kBAAe;CAChB"}