@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.
- package/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/dist/cjs/cdn/polyfills.js +2 -1
- package/dist/cjs/common/config/state/runtime.js +4 -1
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/drain/drain.js +41 -27
- package/dist/cjs/common/event-emitter/contextual-ee.js +24 -22
- package/dist/cjs/common/harvest/harvest.js +5 -1
- package/dist/cjs/common/timing/time-keeper.js +94 -0
- package/dist/cjs/common/util/feature-flags.js +14 -31
- package/dist/cjs/common/wrap/wrap-events.js +2 -2
- package/dist/cjs/common/wrap/wrap-fetch.js +1 -2
- package/dist/cjs/common/wrap/wrap-function.js +7 -5
- package/dist/cjs/common/wrap/wrap-promise.js +1 -2
- package/dist/cjs/features/ajax/aggregate/index.js +7 -13
- package/dist/cjs/features/jserrors/aggregate/index.js +25 -24
- package/dist/cjs/features/metrics/aggregate/index.js +25 -24
- package/dist/cjs/features/page_action/aggregate/index.js +6 -4
- package/dist/cjs/features/page_view_event/aggregate/index.js +22 -2
- package/dist/cjs/features/page_view_timing/aggregate/index.js +15 -16
- package/dist/cjs/features/session_replay/aggregate/index.js +12 -4
- package/dist/cjs/features/session_trace/aggregate/index.js +11 -8
- package/dist/cjs/features/soft_navigations/aggregate/index.js +17 -12
- package/dist/cjs/features/spa/aggregate/index.js +19 -14
- package/dist/cjs/features/utils/aggregate-base.js +18 -5
- package/dist/cjs/features/utils/feature-base.js +2 -0
- package/dist/cjs/features/utils/instrument-base.js +1 -0
- package/dist/cjs/loaders/agent-base.js +2 -7
- package/dist/cjs/loaders/agent.js +4 -4
- package/dist/cjs/loaders/api/api.js +1 -1
- package/dist/cjs/loaders/configure/configure.js +1 -1
- package/dist/cjs/loaders/configure/nonce.cdn.js +13 -0
- package/dist/cjs/loaders/configure/nonce.js +2 -13
- package/dist/cjs/loaders/configure/public-path.cdn.js +16 -0
- package/dist/cjs/loaders/configure/public-path.js +2 -8
- package/dist/esm/cdn/polyfills.js +2 -1
- package/dist/esm/common/config/state/runtime.js +4 -1
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/drain/drain.js +40 -27
- package/dist/esm/common/event-emitter/contextual-ee.js +24 -22
- package/dist/esm/common/harvest/harvest.js +5 -1
- package/dist/esm/common/timing/time-keeper.js +88 -0
- package/dist/esm/common/util/feature-flags.js +14 -31
- package/dist/esm/common/wrap/wrap-events.js +3 -3
- package/dist/esm/common/wrap/wrap-fetch.js +2 -3
- package/dist/esm/common/wrap/wrap-function.js +5 -4
- package/dist/esm/common/wrap/wrap-promise.js +2 -3
- package/dist/esm/features/ajax/aggregate/index.js +7 -13
- package/dist/esm/features/jserrors/aggregate/index.js +25 -24
- package/dist/esm/features/metrics/aggregate/index.js +25 -24
- package/dist/esm/features/page_action/aggregate/index.js +6 -4
- package/dist/esm/features/page_view_event/aggregate/index.js +22 -2
- package/dist/esm/features/page_view_timing/aggregate/index.js +15 -16
- package/dist/esm/features/session_replay/aggregate/index.js +12 -4
- package/dist/esm/features/session_trace/aggregate/index.js +11 -8
- package/dist/esm/features/soft_navigations/aggregate/index.js +17 -12
- package/dist/esm/features/spa/aggregate/index.js +19 -14
- package/dist/esm/features/utils/aggregate-base.js +18 -5
- package/dist/esm/features/utils/feature-base.js +2 -0
- package/dist/esm/features/utils/instrument-base.js +1 -0
- package/dist/esm/loaders/agent-base.js +2 -7
- package/dist/esm/loaders/agent.js +4 -4
- package/dist/esm/loaders/api/api.js +1 -1
- package/dist/esm/loaders/configure/configure.js +1 -1
- package/dist/esm/loaders/configure/nonce.cdn.js +11 -0
- package/dist/esm/loaders/configure/nonce.js +1 -11
- package/dist/esm/loaders/configure/public-path.cdn.js +9 -0
- package/dist/esm/loaders/configure/public-path.js +2 -8
- package/dist/types/common/config/state/runtime.d.ts.map +1 -1
- package/dist/types/common/drain/drain.d.ts +6 -0
- package/dist/types/common/drain/drain.d.ts.map +1 -1
- package/dist/types/common/event-emitter/contextual-ee.d.ts +4 -3
- package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -1
- package/dist/types/common/event-emitter/event-context.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/timing/time-keeper.d.ts +31 -0
- package/dist/types/common/timing/time-keeper.d.ts.map +1 -0
- package/dist/types/common/util/feature-flags.d.ts +11 -2
- package/dist/types/common/util/feature-flags.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-function.d.ts +1 -0
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +5 -5
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +0 -2
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/aggregate/index.d.ts +0 -2
- package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts +2 -0
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts +2 -2
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/features/utils/feature-base.d.ts +1 -0
- package/dist/types/features/utils/feature-base.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/loaders/agent-base.d.ts +2 -2
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/configure/public-path.d.ts +1 -1
- package/dist/types/loaders/configure/public-path.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cdn/polyfills.js +1 -0
- package/src/common/config/state/runtime.js +4 -1
- package/src/common/drain/drain.js +41 -28
- package/src/common/event-emitter/contextual-ee.js +29 -31
- package/src/common/harvest/harvest.js +4 -1
- package/src/common/timing/time-keeper.js +96 -0
- package/src/common/util/feature-flags.js +13 -31
- package/src/common/wrap/wrap-events.js +3 -3
- package/src/common/wrap/wrap-fetch.js +2 -3
- package/src/common/wrap/wrap-function.js +6 -4
- package/src/common/wrap/wrap-promise.js +2 -3
- package/src/features/ajax/aggregate/index.js +8 -16
- package/src/features/jserrors/aggregate/index.js +12 -14
- package/src/features/metrics/aggregate/index.js +18 -17
- package/src/features/page_action/aggregate/index.js +6 -5
- package/src/features/page_view_event/aggregate/index.js +18 -2
- package/src/features/page_view_timing/aggregate/index.js +15 -15
- package/src/features/session_replay/aggregate/index.js +10 -4
- package/src/features/session_trace/aggregate/index.js +2 -2
- package/src/features/soft_navigations/aggregate/index.js +14 -12
- package/src/features/spa/aggregate/index.js +15 -13
- package/src/features/utils/aggregate-base.js +16 -8
- package/src/features/utils/feature-base.js +3 -0
- package/src/features/utils/instrument-base.js +1 -0
- package/src/loaders/agent-base.js +2 -7
- package/src/loaders/agent.js +2 -2
- package/src/loaders/api/api.js +1 -1
- package/src/loaders/configure/nonce.cdn.js +12 -0
- package/src/loaders/configure/nonce.js +1 -12
- package/src/loaders/configure/public-path.cdn.js +9 -0
- package/src/loaders/configure/public-path.js +2 -8
- package/dist/cjs/common/context/observation-context-manager.js +0 -56
- package/dist/cjs/loaders/configure/nonce.npm.js +0 -2
- package/dist/cjs/loaders/configure/public-path.npm.js +0 -10
- package/dist/esm/common/context/observation-context-manager.js +0 -49
- package/dist/esm/loaders/configure/nonce.npm.js +0 -1
- package/dist/esm/loaders/configure/public-path.npm.js +0 -3
- package/dist/types/common/context/event-context.d.ts.map +0 -1
- package/dist/types/common/context/observation-context-manager.d.ts +0 -28
- package/dist/types/common/context/observation-context-manager.d.ts.map +0 -1
- package/dist/types/loaders/configure/nonce.npm.d.ts +0 -1
- package/dist/types/loaders/configure/nonce.npm.d.ts.map +0 -1
- package/dist/types/loaders/configure/public-path.npm.d.ts +0 -2
- package/dist/types/loaders/configure/public-path.npm.d.ts.map +0 -1
- package/src/common/context/observation-context-manager.js +0 -55
- package/src/loaders/configure/nonce.npm.js +0 -1
- package/src/loaders/configure/public-path.npm.js +0 -3
- /package/dist/cjs/common/{context → event-emitter}/event-context.js +0 -0
- /package/dist/esm/common/{context → event-emitter}/event-context.js +0 -0
- /package/dist/types/common/{context → event-emitter}/event-context.d.ts +0 -0
- /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 {
|
|
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
|
-
|
|
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
|
|
3
|
-
import
|
|
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
|
|
83
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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":"
|
|
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,
|
|
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
|
|
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":"
|
|
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,
|
|
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
|
-
/**
|
|
2
|
-
|
|
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":"
|
|
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":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"
|
|
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":"
|
|
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: (
|
|
5
|
-
prepareHarvest: (
|
|
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
|
|
10
|
-
getStoredEvents: (
|
|
9
|
+
}[] | null;
|
|
10
|
+
getStoredEvents: () => {
|
|
11
11
|
ajaxEvents: any[];
|
|
12
12
|
spaAjaxEvents: {};
|
|
13
|
-
}
|
|
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,
|
|
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":"
|
|
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":"
|
|
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":"
|
|
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":"
|
|
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;
|
|
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":"
|
|
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":"
|
|
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":"
|
|
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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"
|
|
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,
|
|
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
|
-
|
|
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 {
|
|
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":"
|
|
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(
|
|
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":"
|
|
1
|
+
{"version":3,"file":"public-path.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/public-path.js"],"names":[],"mappings":"AAAO,2CAEN"}
|
package/package.json
CHANGED
package/src/cdn/polyfills.js
CHANGED
|
@@ -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)
|
|
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
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
/**
|