@newrelic/browser-agent 1.253.0 → 1.254.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 (159) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/cdn/polyfills.js +2 -1
  4. package/dist/cjs/common/config/state/runtime.js +4 -1
  5. package/dist/cjs/common/constants/env.cdn.js +1 -1
  6. package/dist/cjs/common/constants/env.npm.js +1 -1
  7. package/dist/cjs/common/drain/drain.js +41 -27
  8. package/dist/cjs/common/event-emitter/contextual-ee.js +24 -22
  9. package/dist/cjs/common/harvest/harvest.js +5 -1
  10. package/dist/cjs/common/timing/time-keeper.js +94 -0
  11. package/dist/cjs/common/util/feature-flags.js +14 -31
  12. package/dist/cjs/common/wrap/wrap-events.js +2 -2
  13. package/dist/cjs/common/wrap/wrap-fetch.js +1 -2
  14. package/dist/cjs/common/wrap/wrap-function.js +7 -5
  15. package/dist/cjs/common/wrap/wrap-promise.js +1 -2
  16. package/dist/cjs/features/ajax/aggregate/index.js +7 -13
  17. package/dist/cjs/features/jserrors/aggregate/index.js +25 -24
  18. package/dist/cjs/features/metrics/aggregate/index.js +25 -24
  19. package/dist/cjs/features/page_action/aggregate/index.js +6 -4
  20. package/dist/cjs/features/page_view_event/aggregate/index.js +22 -2
  21. package/dist/cjs/features/page_view_timing/aggregate/index.js +15 -16
  22. package/dist/cjs/features/session_replay/aggregate/index.js +12 -4
  23. package/dist/cjs/features/session_trace/aggregate/index.js +11 -8
  24. package/dist/cjs/features/soft_navigations/aggregate/index.js +17 -12
  25. package/dist/cjs/features/spa/aggregate/index.js +19 -14
  26. package/dist/cjs/features/utils/aggregate-base.js +18 -5
  27. package/dist/cjs/features/utils/feature-base.js +2 -0
  28. package/dist/cjs/features/utils/instrument-base.js +1 -0
  29. package/dist/cjs/loaders/agent-base.js +2 -7
  30. package/dist/cjs/loaders/agent.js +4 -4
  31. package/dist/cjs/loaders/api/api.js +1 -1
  32. package/dist/cjs/loaders/configure/configure.js +1 -1
  33. package/dist/cjs/loaders/configure/nonce.cdn.js +13 -0
  34. package/dist/cjs/loaders/configure/nonce.js +2 -13
  35. package/dist/cjs/loaders/configure/public-path.cdn.js +16 -0
  36. package/dist/cjs/loaders/configure/public-path.js +2 -8
  37. package/dist/esm/cdn/polyfills.js +2 -1
  38. package/dist/esm/common/config/state/runtime.js +4 -1
  39. package/dist/esm/common/constants/env.cdn.js +1 -1
  40. package/dist/esm/common/constants/env.npm.js +1 -1
  41. package/dist/esm/common/drain/drain.js +40 -27
  42. package/dist/esm/common/event-emitter/contextual-ee.js +24 -22
  43. package/dist/esm/common/harvest/harvest.js +5 -1
  44. package/dist/esm/common/timing/time-keeper.js +88 -0
  45. package/dist/esm/common/util/feature-flags.js +14 -31
  46. package/dist/esm/common/wrap/wrap-events.js +3 -3
  47. package/dist/esm/common/wrap/wrap-fetch.js +2 -3
  48. package/dist/esm/common/wrap/wrap-function.js +5 -4
  49. package/dist/esm/common/wrap/wrap-promise.js +2 -3
  50. package/dist/esm/features/ajax/aggregate/index.js +7 -13
  51. package/dist/esm/features/jserrors/aggregate/index.js +25 -24
  52. package/dist/esm/features/metrics/aggregate/index.js +25 -24
  53. package/dist/esm/features/page_action/aggregate/index.js +6 -4
  54. package/dist/esm/features/page_view_event/aggregate/index.js +22 -2
  55. package/dist/esm/features/page_view_timing/aggregate/index.js +15 -16
  56. package/dist/esm/features/session_replay/aggregate/index.js +12 -4
  57. package/dist/esm/features/session_trace/aggregate/index.js +11 -8
  58. package/dist/esm/features/soft_navigations/aggregate/index.js +17 -12
  59. package/dist/esm/features/spa/aggregate/index.js +19 -14
  60. package/dist/esm/features/utils/aggregate-base.js +18 -5
  61. package/dist/esm/features/utils/feature-base.js +2 -0
  62. package/dist/esm/features/utils/instrument-base.js +1 -0
  63. package/dist/esm/loaders/agent-base.js +2 -7
  64. package/dist/esm/loaders/agent.js +4 -4
  65. package/dist/esm/loaders/api/api.js +1 -1
  66. package/dist/esm/loaders/configure/configure.js +1 -1
  67. package/dist/esm/loaders/configure/nonce.cdn.js +11 -0
  68. package/dist/esm/loaders/configure/nonce.js +1 -11
  69. package/dist/esm/loaders/configure/public-path.cdn.js +9 -0
  70. package/dist/esm/loaders/configure/public-path.js +2 -8
  71. package/dist/types/common/config/state/runtime.d.ts.map +1 -1
  72. package/dist/types/common/drain/drain.d.ts +6 -0
  73. package/dist/types/common/drain/drain.d.ts.map +1 -1
  74. package/dist/types/common/event-emitter/contextual-ee.d.ts +4 -3
  75. package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -1
  76. package/dist/types/common/event-emitter/event-context.d.ts.map +1 -0
  77. package/dist/types/common/harvest/harvest.d.ts.map +1 -1
  78. package/dist/types/common/timing/time-keeper.d.ts +31 -0
  79. package/dist/types/common/timing/time-keeper.d.ts.map +1 -0
  80. package/dist/types/common/util/feature-flags.d.ts +11 -2
  81. package/dist/types/common/util/feature-flags.d.ts.map +1 -1
  82. package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -1
  83. package/dist/types/common/wrap/wrap-function.d.ts +1 -0
  84. package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
  85. package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -1
  86. package/dist/types/features/ajax/aggregate/index.d.ts +5 -5
  87. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  88. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  89. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  90. package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -1
  91. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  92. package/dist/types/features/page_view_timing/aggregate/index.d.ts +0 -2
  93. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  94. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  95. package/dist/types/features/soft_navigations/aggregate/index.d.ts +0 -2
  96. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  97. package/dist/types/features/spa/aggregate/index.d.ts +2 -0
  98. package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
  99. package/dist/types/features/utils/aggregate-base.d.ts +2 -2
  100. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  101. package/dist/types/features/utils/feature-base.d.ts +1 -0
  102. package/dist/types/features/utils/feature-base.d.ts.map +1 -1
  103. package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
  104. package/dist/types/loaders/agent-base.d.ts +2 -2
  105. package/dist/types/loaders/agent-base.d.ts.map +1 -1
  106. package/dist/types/loaders/configure/public-path.d.ts +1 -1
  107. package/dist/types/loaders/configure/public-path.d.ts.map +1 -1
  108. package/package.json +1 -1
  109. package/src/cdn/polyfills.js +1 -0
  110. package/src/common/config/state/runtime.js +4 -1
  111. package/src/common/drain/drain.js +41 -28
  112. package/src/common/event-emitter/contextual-ee.js +29 -31
  113. package/src/common/harvest/harvest.js +4 -1
  114. package/src/common/timing/time-keeper.js +96 -0
  115. package/src/common/util/feature-flags.js +13 -31
  116. package/src/common/wrap/wrap-events.js +3 -3
  117. package/src/common/wrap/wrap-fetch.js +2 -3
  118. package/src/common/wrap/wrap-function.js +6 -4
  119. package/src/common/wrap/wrap-promise.js +2 -3
  120. package/src/features/ajax/aggregate/index.js +8 -16
  121. package/src/features/jserrors/aggregate/index.js +12 -14
  122. package/src/features/metrics/aggregate/index.js +18 -17
  123. package/src/features/page_action/aggregate/index.js +6 -5
  124. package/src/features/page_view_event/aggregate/index.js +18 -2
  125. package/src/features/page_view_timing/aggregate/index.js +15 -15
  126. package/src/features/session_replay/aggregate/index.js +10 -4
  127. package/src/features/session_trace/aggregate/index.js +2 -2
  128. package/src/features/soft_navigations/aggregate/index.js +14 -12
  129. package/src/features/spa/aggregate/index.js +15 -13
  130. package/src/features/utils/aggregate-base.js +16 -8
  131. package/src/features/utils/feature-base.js +3 -0
  132. package/src/features/utils/instrument-base.js +1 -0
  133. package/src/loaders/agent-base.js +2 -7
  134. package/src/loaders/agent.js +2 -2
  135. package/src/loaders/api/api.js +1 -1
  136. package/src/loaders/configure/nonce.cdn.js +12 -0
  137. package/src/loaders/configure/nonce.js +1 -12
  138. package/src/loaders/configure/public-path.cdn.js +9 -0
  139. package/src/loaders/configure/public-path.js +2 -8
  140. package/dist/cjs/common/context/observation-context-manager.js +0 -56
  141. package/dist/cjs/loaders/configure/nonce.npm.js +0 -2
  142. package/dist/cjs/loaders/configure/public-path.npm.js +0 -10
  143. package/dist/esm/common/context/observation-context-manager.js +0 -49
  144. package/dist/esm/loaders/configure/nonce.npm.js +0 -1
  145. package/dist/esm/loaders/configure/public-path.npm.js +0 -3
  146. package/dist/types/common/context/event-context.d.ts.map +0 -1
  147. package/dist/types/common/context/observation-context-manager.d.ts +0 -28
  148. package/dist/types/common/context/observation-context-manager.d.ts.map +0 -1
  149. package/dist/types/loaders/configure/nonce.npm.d.ts +0 -1
  150. package/dist/types/loaders/configure/nonce.npm.d.ts.map +0 -1
  151. package/dist/types/loaders/configure/public-path.npm.d.ts +0 -2
  152. package/dist/types/loaders/configure/public-path.npm.d.ts.map +0 -1
  153. package/src/common/context/observation-context-manager.js +0 -55
  154. package/src/loaders/configure/nonce.npm.js +0 -1
  155. package/src/loaders/configure/public-path.npm.js +0 -3
  156. /package/dist/cjs/common/{context → event-emitter}/event-context.js +0 -0
  157. /package/dist/esm/common/{context → event-emitter}/event-context.js +0 -0
  158. /package/dist/types/common/{context → event-emitter}/event-context.d.ts +0 -0
  159. /package/src/common/{context → event-emitter}/event-context.js +0 -0
@@ -2,9 +2,8 @@
2
2
 
3
3
  import { warn } from '../common/util/console';
4
4
  import { SR_EVENT_EMITTER_TYPES } from '../features/session_replay/constants';
5
- import { ObservationContextManager } from '../common/context/observation-context-manager';
6
5
  import { generateRandomHexString } from '../common/ids/unique-id';
7
- import { ee } from '../common/event-emitter/contextual-ee';
6
+ import { TimeKeeper } from '../common/timing/time-keeper';
8
7
 
9
8
  /**
10
9
  * @typedef {import('./api/interaction-types').InteractionInstance} InteractionInstance
@@ -12,14 +11,10 @@ import { ee } from '../common/event-emitter/contextual-ee';
12
11
 
13
12
  export class AgentBase {
14
13
  agentIdentifier;
15
- observationContext = new ObservationContextManager();
14
+ timeKeeper = new TimeKeeper(this);
16
15
  constructor() {
17
16
  let agentIdentifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : generateRandomHexString(16);
18
17
  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
18
  }
24
19
 
25
20
  /**
@@ -1,6 +1,6 @@
1
1
  // important side effects
2
- import "./configure/public-path.npm";
3
- import "./configure/nonce.npm";
2
+ import './configure/public-path';
3
+ import './configure/nonce';
4
4
  // loader files
5
5
  import { AgentBase } from './agent-base';
6
6
  import { getEnabledFeatures } from './features/enabled-features';
@@ -79,8 +79,8 @@ export class Agent extends AgentBase {
79
79
  delete newrelic.initializedAgents[this.agentIdentifier]?.features; // GC mem used internally by features
80
80
  delete this.sharedAggregator;
81
81
  // Keep the initialized agent object with its configs for troubleshooting purposes.
82
- newrelic.ee?.abort(); // set flag and clear global backlog
83
- delete newrelic.ee?.get(this.agentIdentifier); // clear this agent's own backlog too
82
+ const thisEE = newrelic.ee.get(this.agentIdentifier);
83
+ thisEE.abort(); // set flag and clear backlog
84
84
  return false;
85
85
  }
86
86
  }
@@ -202,7 +202,7 @@ export function setAPI(agentIdentifier, forceDrain) {
202
202
  drain(agentIdentifier, 'api');
203
203
  }).catch(() => {
204
204
  warn('Downloading runtime APIs failed...');
205
- drain(agentIdentifier, 'api', true);
205
+ instanceEE.abort();
206
206
  });
207
207
  }
208
208
  return apiInterface;
@@ -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.npm";
6
+ import { redefinePublicPath } from './public-path';
7
7
  let alreadySetOnce = false; // the configure() function can run multiple times in agent lifecycle
8
8
 
9
9
  /**
@@ -0,0 +1,11 @@
1
+ /* global __webpack_require__ */
2
+
3
+ __webpack_require__.nc = (() => {
4
+ try {
5
+ return document?.currentScript?.nonce;
6
+ } catch (ex) {
7
+ // Swallow error and proceed like nonce is not defined
8
+ // This will happen when the agent is loaded in a worker scope
9
+ }
10
+ return '';
11
+ })();
@@ -1,11 +1 @@
1
- /* global __webpack_require__ */
2
-
3
- __webpack_require__.nc = (() => {
4
- try {
5
- return document?.currentScript?.nonce;
6
- } catch (ex) {
7
- // Swallow error and proceed like nonce is not defined
8
- // This will happen when the agent is loaded in a worker scope
9
- }
10
- return '';
11
- })();
1
+ // We don't support setting automating the nonce attribute in the npm package
@@ -0,0 +1,9 @@
1
+ // Set the default CDN or remote for fetching the assets; NPM shouldn't change this var.
2
+
3
+ export const redefinePublicPath = urlString => {
4
+ const isOrigin = urlString.startsWith('http');
5
+ // Input is not expected to end in a slash, but webpack concats as-is, so one is inserted.
6
+ urlString += '/';
7
+ // If there's no existing HTTP scheme, the secure protocol is prepended by default.
8
+ __webpack_public_path__ = isOrigin ? urlString : 'https://' + urlString; // eslint-disable-line
9
+ };
@@ -1,9 +1,3 @@
1
- // Set the default CDN or remote for fetching the assets; NPM shouldn't change this var.
2
-
3
- export const redefinePublicPath = urlString => {
4
- const isOrigin = urlString.startsWith('http');
5
- // Input is not expected to end in a slash, but webpack concats as-is, so one is inserted.
6
- urlString += '/';
7
- // If there's no existing HTTP scheme, the secure protocol is prepended by default.
8
- __webpack_public_path__ = isOrigin ? urlString : 'https://' + urlString; // eslint-disable-line
1
+ export const redefinePublicPath = () => {
2
+ // We don't support setting public path in webpack via NPM build.
9
3
  };
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/runtime.js"],"names":[],"mappings":"AA4BA,yCAIC;AAED,oDAKC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/runtime.js"],"names":[],"mappings":"AA+BA,yCAIC;AAED,oDAKC"}
@@ -7,6 +7,12 @@
7
7
  * @param {string} group - The named "bucket" for the events this feature will be bucketing for later collection.
8
8
  */
9
9
  export function registerDrain(agentIdentifier: string, group: string): void;
10
+ /**
11
+ * Removes an item from the registry and immediately re-checks if the registry is ready to "drain all"
12
+ * @param {*} agentIdentifier - A 16 character string uniquely identifying the agent.
13
+ * @param {*} group - The named "bucket" to be removed from the registry
14
+ */
15
+ export function deregisterDrain(agentIdentifier: any, group: any): void;
10
16
  /**
11
17
  * Drain buffered events out of the event emitter. Each feature should have its events bucketed by "group" and drain
12
18
  * its own named group explicitly, when ready.
@@ -1 +1 @@
1
- {"version":3,"file":"drain.d.ts","sourceRoot":"","sources":["../../../../src/common/drain/drain.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,+CAHW,MAAM,SACN,MAAM,QAQhB;AAYD;;;;;;GAMG;AACH,wCAJW,MAAM,gBACN,MAAM,UACN,OAAO,QAuDjB"}
1
+ {"version":3,"file":"drain.d.ts","sourceRoot":"","sources":["../../../../src/common/drain/drain.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,+CAHW,MAAM,SACN,MAAM,QAQhB;AAED;;;;GAIG;AACH,wEAIC;AAYD;;;;;;GAMG;AACH,wCAJW,MAAM,gBACN,MAAM,UACN,OAAO,QAajB"}
@@ -1,4 +1,3 @@
1
- export { globalInstance as ee };
2
1
  declare namespace globalInstance {
3
2
  export { addEventListener as on };
4
3
  export { addEventListener };
@@ -9,16 +8,18 @@ declare namespace globalInstance {
9
8
  export { context };
10
9
  export { bufferEventsByGroup as buffer };
11
10
  export { abort };
12
- export let aborted: boolean;
13
11
  export { isBuffering };
14
12
  export { debugId };
15
13
  export let backlog: any;
16
- export let observationContextManager: null;
14
+ export { isolatedBacklog };
17
15
  }
16
+ export const contextId: string;
18
17
  declare function emit(type: any, args: any, contextOrStore: any, force: any, bubble: any): any;
19
18
  declare function getOrCreate(name: any): any;
20
19
  declare function listeners(type: any): any;
21
20
  declare function bufferEventsByGroup(types: any, group: any): void;
22
21
  declare function abort(): void;
23
22
  declare function isBuffering(type: any): boolean;
23
+ declare var isolatedBacklog: boolean;
24
+ export { globalInstance as ee };
24
25
  //# 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":";;;;;;;;;;;;;;;;;AA0EE,+FAsBC;AAqBD,6CAQC;AAZD,2CAEC;AAYD,mEAaC;AAcH,+BASC;AArBC,iDAGC"}
1
+ {"version":3,"file":"contextual-ee.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/contextual-ee.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,+BAA0C;AA6ExC,+FAsBC;AAqBD,6CAEC;AAND,2CAEC;AAMD,mEAaC;AA5FD,+BAKC;AAyFD,iDAGC;AA3HD,qCAA2B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-context.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/event-context.js"],"names":[],"mappings":"AAAA;IACE,4BAEC;IADC,eAA0B;CAE7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IAEpD,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAWzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAmFnB;IAGD,iCAoBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAuB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BApPY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BAZjC,2BAA2B;2BAF9B,mBAAmB"}
1
+ {"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IAEpD,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAWzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAsFnB;IAGD,iCAoBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAuB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BAvPY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BAZjC,2BAA2B;2BAF9B,mBAAmB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Class used to adjust the timestamp of harvested data to New Relic server time. This
3
+ * is done by tracking the performance timings of the RUM call and applying a calculation
4
+ * to the harvested data event offset time.
5
+ */
6
+ export class TimeKeeper {
7
+ static getTimeKeeperByAgentIdentifier(agentIdentifier: any): any;
8
+ constructor(agent: any);
9
+ get correctedPageOriginTime(): number;
10
+ /**
11
+ * Process a rum request to calculate NR server time.
12
+ * @param rumRequest {XMLHttpRequest} The xhr for the rum request
13
+ * @param rumRequestUrl {string} The full url of the rum request
14
+ */
15
+ processRumRequest(rumRequest: XMLHttpRequest, rumRequestUrl: string): void;
16
+ /**
17
+ * Converts a page origin relative time to an absolute timestamp
18
+ * corrected to NR server time.
19
+ * @param relativeTime {number} The relative time of the event in milliseconds
20
+ * @returns {number} The correct timestamp as a unix/epoch timestamp value
21
+ */
22
+ convertRelativeTimestamp(relativeTime: number): number;
23
+ /**
24
+ * Corrects an event timestamp to NR server time.
25
+ * @param timestamp {number} The unix/epoch timestamp of the event with milliseconds
26
+ * @return {number} Corrected unix/epoch timestamp
27
+ */
28
+ correctAbsoluteTimestamp(timestamp: number): number;
29
+ #private;
30
+ }
31
+ //# sourceMappingURL=time-keeper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-keeper.d.ts","sourceRoot":"","sources":["../../../../src/common/timing/time-keeper.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IAoBE,iEAKC;IATD,wBAEC;IASD,sCAEC;IAED;;;;OAIG;IACH,8BAHsB,cAAc,iBACX,MAAM,QAgC9B;IAED;;;;;OAKG;IACH,uCAHwB,MAAM,GACjB,MAAM,CAIlB;IAED;;;;OAIG;IACH,oCAHqB,MAAM,GACf,MAAM,CAIjB;;CACF"}
@@ -1,4 +1,13 @@
1
- /** Note that this function only processes each unique flag ONCE, with the first occurrence of each flag and numeric value determining its switch on/off setting. */
2
- export function activateFeatures(flags: any, agentIdentifier: any): void;
1
+ /**
2
+ * Sets the activatedFeatures object, dispatches the global loaded event,
3
+ * and emits the rumresp flag to features
4
+ * @param {{[key:string]:number}} flags key-val pair of flag names and numeric
5
+ * @param {string} agentIdentifier agent instance identifier
6
+ * @returns {void}
7
+ */
8
+ export function activateFeatures(flags: {
9
+ [key: string]: number;
10
+ }, agentIdentifier: string): void;
11
+ /** A map of feature flags and their values as provided by the rum call -- scoped by agent ID */
3
12
  export const activatedFeatures: {};
4
13
  //# sourceMappingURL=feature-flags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../../src/common/util/feature-flags.js"],"names":[],"mappings":"AAmBA,oKAAoK;AACpK,yEA4BC;AAED,mCAAmC"}
1
+ {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../../src/common/util/feature-flags.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH;;oBAHW,MAAM,GACJ,IAAI,CAehB;AAvBD,gGAAgG;AAChG,mCAAmC"}
@@ -1 +1 @@
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"}
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"}
@@ -5,5 +5,6 @@
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;
8
9
  export default createWrapperWithEmitter;
9
10
  //# 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":"AA0BA;;;;;GAKG;AACH,+EAHW,OAAO,YAgIjB"}
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 +1 @@
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
+ {"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,16 +1,16 @@
1
1
  export class Aggregate extends AggregateBase {
2
2
  static featureName: string;
3
3
  constructor(agentIdentifier: any, aggregator: any);
4
- storeXhr: ((params: any, metrics: any, startTime: any, endTime: any, type: any) => void) | undefined;
5
- prepareHarvest: ((options: any) => {
4
+ storeXhr: (params: any, metrics: any, startTime: any, endTime: any, type: any) => void;
5
+ prepareHarvest: (options: any) => {
6
6
  body: {
7
7
  e: any;
8
8
  };
9
- }[] | null) | undefined;
10
- getStoredEvents: (() => {
9
+ }[] | null;
10
+ getStoredEvents: () => {
11
11
  ajaxEvents: any[];
12
12
  spaAjaxEvents: {};
13
- }) | undefined;
13
+ };
14
14
  }
15
15
  import { AggregateBase } from '../../utils/aggregate-base';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mDAkPC;IAvNC,uFAAwB;IACxB;;;;eAAoC;IACpC;;;MAA2E;CAsN9E;8BAzP6B,4BAA4B"}
@@ -1 +1 @@
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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAyBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,mDAgCC;IA7BC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,2BAAgC;IAChC,mCAA4B;IAC5B,qBAAwB;IA0B1B;;;MAoBC;IAED,qCAWC;IAED,8BAEC;IAED,oEAMC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED,4EAsFC;IA4BD,yDA6BC;IAED,qFAOC;;CACF;wBAtQY,OAAO,0BAA0B,EAAE,SAAS;8BAL3B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAYA;IACE,2BAAiC;IACjC,mDAwBC;IAED,wDAKC;IAED,iDAKC;IAED,qBA2CC;IAED,0BAOC;IAED,eA0CC;IAvCG,mCAAyB;CAwC9B;8BA7I6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAaA;IACE,2BAAiC;IACjC,mDAsBC;IAED,wDAKC;IAED,iDAKC;IAED,qBA6CC;IAED,0BAOC;IAED,eA0CC;IAvCG,mCAAyB;CAwC9B;8BA9I6B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_action/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC,mDA2BC;IAzBC,wBAA0B;IAC1B,wBAAsL;IACtL,yBAA2E;IAC3E,gCAA4B;IAC5B,wCAA8B;IAE9B,cAAgB;IAEhB,SAAqD;IAmBvD;;;;;;;;MAkBC;IAED,qCAKC;IAGD,wDAoCC;CACF;8BAlG6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_action/aggregate/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IACjC,mDA2BC;IAzBC,wBAA0B;IAC1B,wBAAsL;IACtL,yBAA2E;IAC3E,gCAA4B;IAC5B,wCAA8B;IAE9B,cAAgB;IAEhB,SAAqD;IAmBvD;;;;;;;;MAkBC;IAED,qCAKC;IAGD,wDAoCC;CACF;8BAnG6B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAcA;IACE,2BAA2C;IAC3C,mDAoBC;IAjBC,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IAiBhC,gBAgFC;CACF;8BA9G6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAA2C;IAC3C,mDAoBC;IAjBC,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IAiBhC,gBA4FC;CACF;8BA9H6B,4BAA4B"}
@@ -4,7 +4,6 @@ export class Aggregate extends AggregateBase {
4
4
  timings: any[];
5
5
  timingsSent: any[];
6
6
  curSessEndRecorded: boolean;
7
- scheduler: HarvestScheduler;
8
7
  /**
9
8
  * Add the time of _document visibilitychange to hidden_ to the next PVT harvest == NRDB pageHide attr.
10
9
  * @param {number} timestamp
@@ -26,5 +25,4 @@ export class Aggregate extends AggregateBase {
26
25
  #private;
27
26
  }
28
27
  import { AggregateBase } from '../../utils/aggregate-base';
29
- import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
30
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAuBA;IACE,2BAAiC;IAMjC,mDAoCC;IAjCC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAuB7B,4BAGQ;IAOZ;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAsBC;IAED,qCAKC;IAED,gDAWC;IAGD;;;;kBAWC;IAGD,8BAuBC;;CACF;8BApK6B,4BAA4B;iCANzB,2CAA2C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAuBA;IACE,2BAAiC;IAMjC,mDAoCC;IAjCC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAiCjC;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAsBC;IAED,qCAKC;IAED,gDAWC;IAGD;;;;kBAWC;IAGD,8BAuBC;;CACF;8BApK6B,4BAA4B"}
@@ -1 +1 @@
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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AA+BA;IACE,2BAAiC;IAEjC,8DAkHC;IAhHC,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;IA2C5B,qBAWC;IAED;;;;;;;OAOG;IACH,iCALW,OAAO,cACP,OAAO,iBACP,OAAO,GACL,IAAI,CA4DhB;IAED,2BASC;IAED;;;;;;;;;;;oBAiCC;IAED;;;;;;;;;MAqEC;IAED,qCAOC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,yBAUC;IAED,yCAGC;CACF;8BAlX6B,4BAA4B;iCAHzB,2CAA2C"}
@@ -6,7 +6,6 @@ export class Aggregate extends AggregateBase {
6
6
  interactionsToHarvest: any[];
7
7
  interactionsAwaitingRetry: any[];
8
8
  domObserver: any;
9
- scheduler: HarvestScheduler;
10
9
  initialPageLoadInteraction: InitialPageLoadInteraction;
11
10
  latestRouteSetByApi: any;
12
11
  interactionInProgress: Interaction | null;
@@ -30,7 +29,6 @@ export class Aggregate extends AggregateBase {
30
29
  #private;
31
30
  }
32
31
  import { AggregateBase } from '../../utils/aggregate-base';
33
- import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
34
32
  import { InitialPageLoadInteraction } from './initial-page-load-interaction';
35
33
  import { Interaction } from './interaction';
36
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/index.js"],"names":[],"mappings":"AAcA;IACE,2BAAiC;IACjC;;OAiDC;IA7CC,6BAA+B;IAC/B,iCAAmC;IACnC,iBAA8B;IAE9B,4BAIoC;IAGpC,uDAAiF;IAWjF,yBAA+B;IAC/B,0CAAiC;IAwBnC;;;;kBAiBC;IAED,qCAKC;IAED,0EAeC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAoB7B;;CA2FF;8BA7O6B,4BAA4B;iCALzB,2CAA2C;2CAQjC,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;;OAmDC;IA/CC,6BAA+B;IAC/B,iCAAmC;IACnC,iBAA8B;IAE9B,uDAAiF;IAWjF,yBAA+B;IAC/B,0CAAiC;IAiCnC;;;;kBAgBC;IAED,qCAKC;IAED,0EAeC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAoB7B;;CA2FF;8BA9O6B,4BAA4B;2CAGf,iCAAiC;4BAChD,eAAe"}
@@ -20,7 +20,9 @@ export class Aggregate extends AggregateBase {
20
20
  disableSpaFix: boolean;
21
21
  };
22
22
  serializer: Serializer;
23
+ scheduler: HarvestScheduler;
23
24
  }
24
25
  import { AggregateBase } from '../../utils/aggregate-base';
25
26
  import { Serializer } from './serializer';
27
+ import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
26
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/aggregate/index.js"],"names":[],"mappings":"AA+BA;IACE,2BAAiC;IACjC,mDAusBC;IApsBC;;;;;;;;;;;;;;;;;MAkBC;IAED,uBAAsC;CAirBzC;8BAttB6B,4BAA4B;2BAJ/B,cAAc"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/aggregate/index.js"],"names":[],"mappings":"AAgCA;IACE,2BAAiC;IACjC,mDAwsBC;IArsBC;;;;;;;;;;;;;;;;;MAkBC;IAGD,uBAAsC;IAkDtB,4BAGuB;CA4nB1C;8BAxtB6B,4BAA4B;2BAJ/B,cAAc;iCADR,2CAA2C"}
@@ -3,9 +3,9 @@ export class AggregateBase extends FeatureBase {
3
3
  /**
4
4
  * New handler for waiting for multiple flags. Useful when expecting multiple flags simultaneously (ex. stn vs sr)
5
5
  * @param {string[]} flagNames
6
- * @returns
6
+ * @returns {Promise}
7
7
  */
8
- waitForFlags(flagNames?: string[]): Promise<any[]>;
8
+ waitForFlags(flagNames?: string[]): Promise<any>;
9
9
  drain(): void;
10
10
  /**
11
11
  * Checks for additional `jsAttributes` items to support backward compatibility with implementations of the agent where
@@ -1 +1 @@
1
- {"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAOA;IACE,4BAGC;IAED;;;;OAIG;IACH,yBAHW,MAAM,EAAE,kBAWlB;IAED,cAEC;IAED;;;OAGG;IACH,2BAqBC;CACF;4BAzD2B,gBAAgB"}
1
+ {"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAOA;IACE,4BAGC;IAED;;;;OAIG;IACH,yBAHW,MAAM,EAAE,gBAmBlB;IAED,cAEC;IAED;;;OAGG;IACH,2BAqBC;CACF;4BAlE2B,gBAAgB"}
@@ -14,5 +14,6 @@ export class FeatureBase {
14
14
  * @type {boolean}
15
15
  */
16
16
  blocked: boolean;
17
+ timeKeeper: any;
17
18
  }
18
19
  //# sourceMappingURL=feature-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAEA;IACE,qEAeC;IAdC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,qEAAqE;IACrE,YADW,OAAO,mCAAmC,EAAE,UAAU,CACrC;IAC5B,oEAAoE;IACpE,QAAiC;IACjC,qBAAqB;IACrB,aADW,MAAM,CACa;IAC9B;;;;OAIG;IACH,SAFU,OAAO,CAEG;CAEvB"}
1
+ {"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAGA;IACE,qEAiBC;IAhBC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,qEAAqE;IACrE,YADW,OAAO,mCAAmC,EAAE,UAAU,CACrC;IAC5B,oEAAoE;IACpE,QAAiC;IACjC,qBAAqB;IACrB,aADW,MAAM,CACa;IAC9B;;;;OAIG;IACH,SAFU,OAAO,CAEG;IAEpB,gBAAiF;CAEpF"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IACE;;;;;;;;OAQG;IACH,6BAPW,MAAM,cACN,OAAO,mCAAmC,EAAE,UAAU,eACtD,MAAM,8BA4BhB;IArBC,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAQtC;;;;;OAKG;IACH,mEA4DC;;CAYF;4BA7H2B,gBAAgB"}
1
+ {"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IACE;;;;;;;;OAQG;IACH,6BAPW,MAAM,cACN,OAAO,mCAAmC,EAAE,UAAU,eACtD,MAAM,8BA4BhB;IArBC,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAQtC;;;;;OAKG;IACH,mEA6DC;;CAYF;4BA9H2B,gBAAgB"}
@@ -4,7 +4,7 @@
4
4
  export class AgentBase {
5
5
  constructor(agentIdentifier?: string);
6
6
  agentIdentifier: string;
7
- observationContext: ObservationContextManager;
7
+ timeKeeper: TimeKeeper;
8
8
  /**
9
9
  * Reports a browser PageAction event along with a name and optional attributes.
10
10
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/}
@@ -124,5 +124,5 @@ export class AgentBase {
124
124
  #private;
125
125
  }
126
126
  export type InteractionInstance = import('./api/interaction-types').InteractionInstance;
127
- import { ObservationContextManager } from '../common/context/observation-context-manager';
127
+ import { TimeKeeper } from '../common/timing/time-keeper';
128
128
  //# sourceMappingURL=agent-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAQA;;GAEG;AAEH;IAIE,sCAMC;IATD,wBAAe;IACf,8CAAoD;IAoBpD;;;;;OAKG;IACH,oBAHW,MAAM,wCAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,kCAKhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,IAAI,sCAK5B;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,8CAKtB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,OAIrB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,GAAC,IAAI,OAMrB;IAED;;;;OAIG;IACH,kCAFmB,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,OAI9D;IAED;;;;OAIG;IACH,8CAEC;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,OAIhB;IAED;;;;OAIG;IACH,yDAEC;IAED;;;;OAIG;IACH,oBAEC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;;;;;OAUG;IACH,6BARW;QAAC,MAAM,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,OAUrF;IAED;;;;;OAKG;IACH,0BAHW,MAAM,OAKhB;IAED;;;;;MAKE;IACF,eAHa,mBAAmB,CAK/B;;CACF;kCAjLY,OAAO,yBAAyB,EAAE,mBAAmB;0CALxB,+CAA+C"}
1
+ {"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;IAIE,sCAEC;IALD,wBAAe;IACf,uBAAiC;IAgBjC;;;;;OAKG;IACH,oBAHW,MAAM,wCAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,kCAKhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,IAAI,sCAK5B;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,8CAKtB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,OAIrB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,GAAC,IAAI,OAMrB;IAED;;;;OAIG;IACH,kCAFmB,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,OAI9D;IAED;;;;OAIG;IACH,8CAEC;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,OAIhB;IAED;;;;OAIG;IACH,yDAEC;IAED;;;;OAIG;IACH,oBAEC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;;;;;OAUG;IACH,6BARW;QAAC,MAAM,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,OAUrF;IAED;;;;;OAKG;IACH,0BAHW,MAAM,OAKhB;IAED;;;;;MAKE;IACF,eAHa,mBAAmB,CAK/B;;CACF;kCA7KY,OAAO,yBAAyB,EAAE,mBAAmB;2BAHvC,8BAA8B"}
@@ -1,2 +1,2 @@
1
- export function redefinePublicPath(urlString: any): void;
1
+ export function redefinePublicPath(): void;
2
2
  //# sourceMappingURL=public-path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-path.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/public-path.js"],"names":[],"mappings":"AAEO,yDAMN"}
1
+ {"version":3,"file":"public-path.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/public-path.js"],"names":[],"mappings":"AAAO,2CAEN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.253.0",
3
+ "version": "1.254.0",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -22,3 +22,4 @@ import 'core-js/stable/object/get-own-property-descriptors'
22
22
  import 'core-js/stable/url'
23
23
  import 'core-js/stable/url-search-params'
24
24
  import 'core-js/stable/string/starts-with'
25
+ import 'core-js/stable/number/is-nan'
@@ -18,10 +18,13 @@ const model = {
18
18
  origin: '' + globalScope.location,
19
19
  ptid: undefined,
20
20
  releaseIds: {},
21
+ /** Agent-specific metadata found in the RUM call response. ex. entityGuid */
22
+ appMetadata: {},
21
23
  session: undefined,
22
24
  xhrWrappable: typeof globalScope.XMLHttpRequest?.prototype?.addEventListener === 'function',
23
25
  version: VERSION,
24
- denyList: undefined
26
+ denyList: undefined,
27
+ harvestCount: 0
25
28
  }
26
29
 
27
30
  const _cache = {}
@@ -26,13 +26,24 @@ export function registerDrain (agentIdentifier, group) {
26
26
  if (!registry[agentIdentifier].get(group)) registry[agentIdentifier].set(group, item)
27
27
  }
28
28
 
29
+ /**
30
+ * Removes an item from the registry and immediately re-checks if the registry is ready to "drain all"
31
+ * @param {*} agentIdentifier - A 16 character string uniquely identifying the agent.
32
+ * @param {*} group - The named "bucket" to be removed from the registry
33
+ */
34
+ export function deregisterDrain (agentIdentifier, group) {
35
+ curateRegistry(agentIdentifier)
36
+ if (registry[agentIdentifier].get(group)) registry[agentIdentifier].delete(group)
37
+ if (registry[agentIdentifier].size) checkCanDrainAll(agentIdentifier)
38
+ }
39
+
29
40
  /**
30
41
  * Registers the specified agent with the centralized event buffer registry if it is not already registered.
31
42
  * Agents without an identifier (as in the case of some tests) will be excluded from the registry.
32
43
  * @param {string} agentIdentifier - A 16 character string uniquely identifying an agent.
33
44
  */
34
45
  function curateRegistry (agentIdentifier) {
35
- if (!agentIdentifier) return
46
+ if (!agentIdentifier) throw new Error('agentIdentifier required')
36
47
  if (!registry[agentIdentifier]) registry[agentIdentifier] = new Map()
37
48
  }
38
49
 
@@ -48,54 +59,56 @@ export function drain (agentIdentifier = '', featureName = 'feature', force = fa
48
59
  // If the feature for the specified agent is not in the registry, that means the instrument file was bypassed.
49
60
  // This could happen in tests, or loaders that directly import the aggregator. In these cases it is safe to
50
61
  // drain the feature group immediately rather than waiting to drain all at once.
51
- if (!agentIdentifier || !registry[agentIdentifier].get(featureName) || force) return drainGroup(featureName)
62
+ if (!agentIdentifier || !registry[agentIdentifier].get(featureName) || force) return drainGroup(agentIdentifier, featureName)
52
63
 
53
64
  // When `drain` is called, this feature is ready to drain (staged).
54
65
  registry[agentIdentifier].get(featureName).staged = true
55
66
 
56
- // Only when the event-groups for all features are ready to drain (staged) do we execute the drain. This has the effect
67
+ checkCanDrainAll(agentIdentifier)
68
+ }
69
+
70
+ /** Checks all items in the registry to see if they have been "staged". If ALL items are staged, it will drain all registry items (drainGroup). It not, nothing will happen */
71
+ function checkCanDrainAll (agentIdentifier) {
72
+ // Only when the event-groups for all features are ready to drain (staged) do we execute the drain. This has the effect
57
73
  // that the last feature to call drain triggers drain for all features.
58
74
  const items = [...registry[agentIdentifier]]
59
75
  if (items.every(([key, values]) => values.staged)) {
60
76
  items.sort((a, b) => a[1].priority - b[1].priority)
61
77
  items.forEach(([group]) => {
62
78
  registry[agentIdentifier].delete(group)
63
- drainGroup(group)
79
+ drainGroup(agentIdentifier, group)
64
80
  })
65
81
  }
82
+ }
66
83
 
67
- /**
84
+ /**
68
85
  * Drains all the buffered (backlog) events for a particular feature's event-group by emitting each event to each of
69
86
  * the subscribed handlers for the group.
70
87
  * @param {*} group - The name of a particular feature's event "bucket".
71
88
  */
72
- function drainGroup (group) {
73
- const baseEE = agentIdentifier ? ee.get(agentIdentifier) : ee
74
- const handlers = defaultRegister.handlers
75
- if (!baseEE.backlog || !handlers) return
89
+ function drainGroup (agentIdentifier, group) {
90
+ const baseEE = agentIdentifier ? ee.get(agentIdentifier) : ee
91
+ const handlers = defaultRegister.handlers // other storage in registerHandler
92
+ if (!baseEE.backlog || !handlers) return
76
93
 
77
- var bufferedEventsInGroup = baseEE.backlog[group]
78
- var groupHandlers = handlers[group]
79
- if (groupHandlers) {
80
- // We don't cache the length of the buffer while looping because events might still be added while processing.
81
- for (var i = 0; bufferedEventsInGroup && i < bufferedEventsInGroup.length; ++i) { // eslint-disable-line no-unmodified-loop-condition
82
- emitEvent(bufferedEventsInGroup[i], groupHandlers)
83
- }
84
-
85
- mapOwn(groupHandlers, function (eventType, handlerRegistrationList) {
86
- mapOwn(handlerRegistrationList, function (i, registration) {
87
- // registration is an array of: [targetEE, eventHandler]
88
- registration[0].on(eventType, registration[1])
89
- })
90
- })
94
+ var bufferedEventsInGroup = baseEE.backlog[group]
95
+ var groupHandlers = handlers[group] // each group in the registerHandler storage
96
+ if (groupHandlers) {
97
+ // We don't cache the length of the buffer while looping because events might still be added while processing.
98
+ for (var i = 0; bufferedEventsInGroup && i < bufferedEventsInGroup.length; ++i) { // eslint-disable-line no-unmodified-loop-condition
99
+ emitEvent(bufferedEventsInGroup[i], groupHandlers)
91
100
  }
92
101
 
93
- delete handlers[group]
94
-
95
- // Keep the feature's event-group as a property of the event emitter so we know it was already created and drained.
96
- baseEE.backlog[group] = null
97
- baseEE.emit('drain-' + group, [])
102
+ mapOwn(groupHandlers, function (eventType, handlerRegistrationList) {
103
+ mapOwn(handlerRegistrationList, function (i, registration) {
104
+ // registration is an array of: [targetEE, eventHandler]
105
+ registration[0].on(eventType, registration[1])
106
+ })
107
+ })
98
108
  }
109
+ if (!baseEE.isolatedBacklog) delete handlers[group]
110
+ baseEE.backlog[group] = null
111
+ baseEE.emit('drain-' + group, [])
99
112
  }
100
113
 
101
114
  /**