@newrelic/browser-agent 1.252.1 → 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.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/cjs/cdn/experimental.js +6 -2
- package/dist/cjs/cdn/spa.js +5 -3
- package/dist/cjs/common/aggregate/aggregator.js +1 -8
- package/dist/cjs/common/config/state/init.js +7 -0
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/context/observation-context-manager.js +56 -0
- package/dist/cjs/common/event-emitter/contextual-ee.js +12 -9
- package/dist/cjs/common/session/constants.js +2 -1
- package/dist/cjs/common/timing/nav-timing.js +8 -3
- package/dist/cjs/common/timing/now.js +1 -1
- package/dist/cjs/common/util/feature-flags.js +1 -1
- package/dist/cjs/common/wrap/index.js +0 -7
- package/dist/cjs/common/wrap/wrap-events.js +2 -2
- package/dist/cjs/common/wrap/wrap-fetch.js +2 -1
- package/dist/cjs/common/wrap/wrap-function.js +5 -7
- package/dist/cjs/common/wrap/wrap-promise.js +2 -1
- package/dist/cjs/features/ajax/aggregate/index.js +34 -16
- package/dist/cjs/features/jserrors/aggregate/index.js +77 -66
- package/dist/cjs/features/page_view_event/aggregate/index.js +1 -1
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -0
- package/dist/cjs/features/session_replay/aggregate/index.js +96 -94
- package/dist/cjs/features/session_replay/constants.js +5 -1
- package/dist/cjs/features/session_replay/instrument/index.js +24 -8
- package/dist/cjs/features/session_replay/shared/utils.js +26 -0
- package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +50 -0
- package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +29 -0
- package/dist/cjs/features/soft_navigations/aggregate/index.js +263 -0
- package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +62 -0
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +146 -0
- package/dist/cjs/features/soft_navigations/constants.js +31 -0
- package/dist/cjs/features/soft_navigations/index.js +12 -0
- package/dist/cjs/features/soft_navigations/instrument/index.js +79 -0
- package/dist/cjs/features/spa/aggregate/index.js +4 -4
- package/dist/cjs/features/utils/agent-session.js +2 -1
- package/dist/cjs/features/utils/instrument-base.js +6 -9
- package/dist/cjs/features/utils/lazy-feature-loader.js +2 -0
- package/dist/cjs/loaders/agent-base.js +18 -3
- package/dist/cjs/loaders/agent.js +15 -18
- package/dist/cjs/loaders/api/api-methods.js +2 -1
- package/dist/cjs/loaders/api/api.js +14 -11
- package/dist/cjs/loaders/configure/configure.js +4 -1
- package/dist/cjs/loaders/features/enabled-features.js +1 -1
- package/dist/cjs/loaders/features/features.js +3 -1
- package/dist/esm/cdn/experimental.js +5 -2
- package/dist/esm/cdn/spa.js +3 -1
- package/dist/esm/common/aggregate/aggregator.js +1 -8
- package/dist/esm/common/config/state/init.js +7 -0
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/context/observation-context-manager.js +49 -0
- package/dist/esm/common/event-emitter/contextual-ee.js +12 -9
- package/dist/esm/common/session/constants.js +1 -0
- package/dist/esm/common/timing/nav-timing.js +8 -3
- package/dist/esm/common/timing/now.js +1 -1
- package/dist/esm/common/util/feature-flags.js +1 -1
- package/dist/esm/common/wrap/index.js +1 -2
- package/dist/esm/common/wrap/wrap-events.js +3 -3
- package/dist/esm/common/wrap/wrap-fetch.js +3 -2
- package/dist/esm/common/wrap/wrap-function.js +4 -5
- package/dist/esm/common/wrap/wrap-promise.js +3 -2
- package/dist/esm/features/ajax/aggregate/index.js +36 -18
- package/dist/esm/features/jserrors/aggregate/index.js +77 -66
- package/dist/esm/features/page_view_event/aggregate/index.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -0
- package/dist/esm/features/session_replay/aggregate/index.js +97 -95
- package/dist/esm/features/session_replay/constants.js +4 -0
- package/dist/esm/features/session_replay/instrument/index.js +25 -9
- package/dist/esm/features/session_replay/shared/utils.js +17 -0
- package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +43 -0
- package/dist/esm/features/soft_navigations/aggregate/bel-node.js +22 -0
- package/dist/esm/features/soft_navigations/aggregate/index.js +256 -0
- package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +55 -0
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +140 -0
- package/dist/esm/features/soft_navigations/constants.js +25 -0
- package/dist/esm/features/soft_navigations/index.js +1 -0
- package/dist/esm/features/soft_navigations/instrument/index.js +73 -0
- package/dist/esm/features/spa/aggregate/index.js +4 -4
- package/dist/esm/features/utils/agent-session.js +2 -1
- package/dist/esm/features/utils/instrument-base.js +7 -10
- package/dist/esm/features/utils/lazy-feature-loader.js +2 -0
- package/dist/esm/loaders/agent-base.js +18 -3
- package/dist/esm/loaders/agent.js +15 -18
- package/dist/esm/loaders/api/api-methods.js +2 -1
- package/dist/esm/loaders/api/api.js +14 -11
- package/dist/esm/loaders/configure/configure.js +4 -1
- package/dist/esm/loaders/features/enabled-features.js +1 -1
- package/dist/esm/loaders/features/features.js +3 -1
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/context/event-context.d.ts.map +1 -0
- package/dist/types/common/context/observation-context-manager.d.ts +28 -0
- package/dist/types/common/context/observation-context-manager.d.ts.map +1 -0
- package/dist/types/common/event-emitter/contextual-ee.d.ts +2 -2
- package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts +1 -0
- package/dist/types/common/session/constants.d.ts.map +1 -1
- package/dist/types/common/timing/nav-timing.d.ts.map +1 -1
- package/dist/types/common/wrap/index.d.ts +1 -2
- package/dist/types/common/wrap/index.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 +0 -1
- 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.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +4 -3
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/constants.d.ts +4 -0
- package/dist/types/features/session_replay/constants.d.ts.map +1 -1
- package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/utils.d.ts +4 -0
- package/dist/types/features/session_replay/shared/utils.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts +19 -0
- package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/aggregate/bel-node.d.ts +16 -0
- package/dist/types/features/soft_navigations/aggregate/bel-node.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/aggregate/index.d.ts +36 -0
- package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts +12 -0
- package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/aggregate/interaction.d.ts +50 -0
- package/dist/types/features/soft_navigations/aggregate/interaction.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/constants.d.ts +20 -0
- package/dist/types/features/soft_navigations/constants.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/index.d.ts +2 -0
- package/dist/types/features/soft_navigations/index.d.ts.map +1 -0
- package/dist/types/features/soft_navigations/instrument/index.d.ts +7 -0
- package/dist/types/features/soft_navigations/instrument/index.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/utils/agent-session.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts +1 -7
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/features/utils/lazy-feature-loader.d.ts.map +1 -1
- package/dist/types/loaders/agent-base.d.ts +5 -1
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts +2 -2
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/api-methods.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts +3 -5
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +1 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent.d.ts +0 -1
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cdn/experimental.js +4 -2
- package/src/cdn/spa.js +3 -1
- package/src/common/aggregate/aggregator.js +2 -11
- package/src/common/config/state/init.js +3 -1
- package/src/common/context/observation-context-manager.js +55 -0
- package/src/common/event-emitter/contextual-ee.js +20 -10
- package/src/common/session/constants.js +1 -0
- package/src/common/timing/nav-timing.js +7 -3
- package/src/common/timing/now.js +1 -1
- package/src/common/util/feature-flags.js +1 -1
- package/src/common/wrap/index.js +1 -2
- package/src/common/wrap/wrap-events.js +3 -3
- package/src/common/wrap/wrap-fetch.js +3 -2
- package/src/common/wrap/wrap-function.js +4 -6
- package/src/common/wrap/wrap-promise.js +3 -2
- package/src/features/ajax/aggregate/index.js +36 -18
- package/src/features/jserrors/aggregate/index.js +70 -73
- package/src/features/page_view_event/aggregate/index.js +1 -1
- package/src/features/page_view_event/aggregate/initialized-features.js +1 -0
- package/src/features/session_replay/aggregate/index.js +92 -95
- package/src/features/session_replay/constants.js +5 -0
- package/src/features/session_replay/instrument/index.js +24 -9
- package/src/features/session_replay/shared/utils.js +19 -0
- package/src/features/soft_navigations/aggregate/ajax-node.js +57 -0
- package/src/features/soft_navigations/aggregate/bel-node.js +26 -0
- package/src/features/soft_navigations/aggregate/index.js +254 -0
- package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +53 -0
- package/src/features/soft_navigations/aggregate/interaction.js +159 -0
- package/src/features/soft_navigations/constants.js +29 -0
- package/src/features/soft_navigations/index.js +1 -0
- package/src/features/soft_navigations/instrument/index.js +67 -0
- package/src/features/spa/aggregate/index.js +5 -4
- package/src/features/utils/agent-session.js +2 -1
- package/src/features/utils/instrument-base.js +7 -10
- package/src/features/utils/lazy-feature-loader.js +2 -0
- package/src/loaders/agent-base.js +18 -3
- package/src/loaders/agent.js +18 -17
- package/src/loaders/api/api-methods.js +4 -1
- package/src/loaders/api/api.js +14 -12
- package/src/loaders/configure/configure.js +4 -1
- package/src/loaders/features/enabled-features.js +1 -1
- package/src/loaders/features/features.js +3 -1
- package/dist/cjs/common/wrap/wrap-raf.js +0 -55
- package/dist/esm/common/wrap/wrap-raf.js +0 -48
- package/dist/types/common/event-emitter/event-context.d.ts.map +0 -1
- package/dist/types/common/wrap/wrap-raf.d.ts +0 -16
- package/dist/types/common/wrap/wrap-raf.d.ts.map +0 -1
- package/src/common/wrap/wrap-raf.js +0 -52
- /package/dist/cjs/common/{event-emitter → context}/event-context.js +0 -0
- /package/dist/esm/common/{event-emitter → context}/event-context.js +0 -0
- /package/dist/types/common/{event-emitter → context}/event-context.d.ts +0 -0
- /package/src/common/{event-emitter → context}/event-context.js +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { originals } from '../../../common/config/config';
|
|
2
|
+
import { isBrowserScope } from '../../../common/constants/runtime';
|
|
3
|
+
import { handle } from '../../../common/event-emitter/handle';
|
|
4
|
+
import { windowAddEventListener } from '../../../common/event-listener/event-listener-opts';
|
|
5
|
+
import { now } from '../../../common/timing/now';
|
|
6
|
+
import { debounce } from '../../../common/util/invoke';
|
|
7
|
+
import { wrapEvents, wrapHistory } from '../../../common/wrap';
|
|
8
|
+
import { InstrumentBase } from '../../utils/instrument-base';
|
|
9
|
+
import { FEATURE_NAME, INTERACTION_TRIGGERS } from '../constants';
|
|
10
|
+
|
|
11
|
+
/** The minimal time after a UI event for which no further events will be processed - i.e. a throttling rate to reduce spam.
|
|
12
|
+
* This also give some time for the new interaction to complete without being discarded by a subsequent UI event and wrongly attributed.
|
|
13
|
+
* This value is still subject to change and critique, as it is derived from beyond worst case time to next frame of a page.
|
|
14
|
+
*/
|
|
15
|
+
const UI_WAIT_INTERVAL = 1 / 10 * 1000; // assume 10 fps
|
|
16
|
+
|
|
17
|
+
export class Instrument extends InstrumentBase {
|
|
18
|
+
static featureName = FEATURE_NAME;
|
|
19
|
+
constructor(agentIdentifier, aggregator) {
|
|
20
|
+
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
21
|
+
super(agentIdentifier, aggregator, FEATURE_NAME, auto);
|
|
22
|
+
if (!isBrowserScope || !originals.MO) return; // soft navigations is not supported outside web env or browsers without the mutation observer API
|
|
23
|
+
|
|
24
|
+
const historyEE = wrapHistory(this.ee);
|
|
25
|
+
const eventsEE = wrapEvents(this.ee);
|
|
26
|
+
const trackURLChange = () => handle('newURL', [now(), '' + window.location], undefined, this.featureName, this.ee);
|
|
27
|
+
historyEE.on('pushState-end', trackURLChange);
|
|
28
|
+
historyEE.on('replaceState-end', trackURLChange);
|
|
29
|
+
try {
|
|
30
|
+
this.removeOnAbort = new AbortController();
|
|
31
|
+
} catch (e) {}
|
|
32
|
+
const trackURLChangeEvent = evt => handle('newURL', [evt.timeStamp, '' + window.location], undefined, this.featureName, this.ee);
|
|
33
|
+
windowAddEventListener('popstate', trackURLChangeEvent, true, this.removeOnAbort?.signal);
|
|
34
|
+
let oncePerFrame = false; // attempt to reduce dom noice since the observer runs very frequently with below options
|
|
35
|
+
const domObserver = new originals.MO((domChanges, observer) => {
|
|
36
|
+
if (oncePerFrame) return;
|
|
37
|
+
oncePerFrame = true;
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
// waiting for next frame to time when any visuals are supposedly updated
|
|
40
|
+
handle('newDom', [now()], undefined, this.featureName, this.ee);
|
|
41
|
+
oncePerFrame = false;
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const processUserInteraction = debounce(event => {
|
|
45
|
+
handle('newUIEvent', [event], undefined, this.featureName, this.ee);
|
|
46
|
+
domObserver.observe(document.body, {
|
|
47
|
+
attributes: true,
|
|
48
|
+
childList: true,
|
|
49
|
+
subtree: true,
|
|
50
|
+
characterData: true
|
|
51
|
+
});
|
|
52
|
+
}, UI_WAIT_INTERVAL, {
|
|
53
|
+
leading: true
|
|
54
|
+
});
|
|
55
|
+
eventsEE.on('fn-start', _ref => {
|
|
56
|
+
let [evt] = _ref;
|
|
57
|
+
// set up a new user ixn before the callback for the triggering event executes
|
|
58
|
+
if (INTERACTION_TRIGGERS.includes(evt?.type)) {
|
|
59
|
+
processUserInteraction(evt);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
for (let eventType of INTERACTION_TRIGGERS) document.addEventListener(eventType, () => {/* no-op, this ensures the UI events are monitored by our callback above */});
|
|
63
|
+
this.abortHandler = abort;
|
|
64
|
+
this.importAggregator({
|
|
65
|
+
domObserver
|
|
66
|
+
});
|
|
67
|
+
function abort() {
|
|
68
|
+
this.removeOnAbort?.abort();
|
|
69
|
+
domObserver.disconnect();
|
|
70
|
+
this.abortHandler = undefined; // weakly allow this abort op to run only once
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -647,7 +647,7 @@ export class Aggregate extends AggregateBase {
|
|
|
647
647
|
}
|
|
648
648
|
function saveInteraction(interaction) {
|
|
649
649
|
if (interaction.ignored || !interaction.save && !interaction.routeChange) {
|
|
650
|
-
baseEE.emit('
|
|
650
|
+
baseEE.emit('interactionDone', [interaction, false]);
|
|
651
651
|
return;
|
|
652
652
|
}
|
|
653
653
|
if (state.prevInteraction === interaction) {
|
|
@@ -663,10 +663,10 @@ export class Aggregate extends AggregateBase {
|
|
|
663
663
|
interaction.root.attrs.firstPaint = firstPaint.current.value;
|
|
664
664
|
interaction.root.attrs.firstContentfulPaint = firstContentfulPaint.current.value;
|
|
665
665
|
}
|
|
666
|
-
baseEE.emit('
|
|
666
|
+
baseEE.emit('interactionDone', [interaction, true]);
|
|
667
667
|
state.interactionsToHarvest.push(interaction);
|
|
668
|
-
let smCategory
|
|
669
|
-
if (interaction.root?.attrs?.trigger === 'initialPageLoad') smCategory = 'InitialPageLoad';else if (interaction.
|
|
668
|
+
let smCategory;
|
|
669
|
+
if (interaction.root?.attrs?.trigger === 'initialPageLoad') smCategory = 'InitialPageLoad';else if (interaction.routeChange) smCategory = 'RouteChange';else smCategory = 'Custom';
|
|
670
670
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ["Spa/Interaction/".concat(smCategory, "/Duration/Ms"), Math.max((interaction.root?.end || 0) - (interaction.root?.start || 0), 0)], undefined, FEATURE_NAMES.metrics, baseEE);
|
|
671
671
|
scheduler.scheduleHarvest(0);
|
|
672
672
|
}
|
|
@@ -5,6 +5,7 @@ import { registerHandler } from '../../common/event-emitter/register-handler';
|
|
|
5
5
|
import { SessionEntity } from '../../common/session/session-entity';
|
|
6
6
|
import { LocalStorage } from '../../common/storage/local-storage.js';
|
|
7
7
|
import { FirstPartyCookies } from '../../common/storage/first-party-cookies';
|
|
8
|
+
import { DEFAULT_KEY } from '../../common/session/constants';
|
|
8
9
|
let ranOnce = 0;
|
|
9
10
|
export function setupAgentSession(agentIdentifier) {
|
|
10
11
|
const agentRuntime = getRuntime(agentIdentifier);
|
|
@@ -15,7 +16,7 @@ export function setupAgentSession(agentIdentifier) {
|
|
|
15
16
|
const storageTypeInst = sessionInit?.domain ? new FirstPartyCookies(sessionInit.domain) : new LocalStorage();
|
|
16
17
|
agentRuntime.session = new SessionEntity({
|
|
17
18
|
agentIdentifier,
|
|
18
|
-
key:
|
|
19
|
+
key: DEFAULT_KEY,
|
|
19
20
|
storage: storageTypeInst,
|
|
20
21
|
expiresMs: sessionInit?.expiresMs,
|
|
21
22
|
inactiveMs: sessionInit?.inactiveMs
|
|
@@ -10,7 +10,8 @@ import { onWindowLoad } from '../../common/window/load';
|
|
|
10
10
|
import { isBrowserScope } from '../../common/constants/runtime';
|
|
11
11
|
import { warn } from '../../common/util/console';
|
|
12
12
|
import { FEATURE_NAMES } from '../../loaders/features/features';
|
|
13
|
-
import { getConfigurationValue
|
|
13
|
+
import { getConfigurationValue } from '../../common/config/config';
|
|
14
|
+
import { canImportReplayAgg, enableSessionTracking } from '../session_replay/shared/utils';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Base class for instrumenting a feature.
|
|
@@ -73,7 +74,6 @@ export class InstrumentBase extends FeatureBase {
|
|
|
73
74
|
});
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
const enableSessionTracking = isBrowserScope && getConfigurationValue(this.agentIdentifier, 'privacy.cookies_enabled') === true;
|
|
77
77
|
let loadedSuccessfully;
|
|
78
78
|
this.onAggregateImported = new Promise(resolve => {
|
|
79
79
|
loadedSuccessfully = resolve;
|
|
@@ -81,7 +81,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
81
81
|
const importLater = async () => {
|
|
82
82
|
let session;
|
|
83
83
|
try {
|
|
84
|
-
if (enableSessionTracking) {
|
|
84
|
+
if (enableSessionTracking(this.agentIdentifier)) {
|
|
85
85
|
// would require some setup before certain features start
|
|
86
86
|
const {
|
|
87
87
|
setupAgentSession
|
|
@@ -90,6 +90,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
90
90
|
}
|
|
91
91
|
} catch (e) {
|
|
92
92
|
warn('A problem occurred when starting up session manager. This page will not start or extend any session.', e);
|
|
93
|
+
if (this.featureName === FEATURE_NAMES.sessionReplay) this.abortHandler?.(); // SR should stop recording if session DNE
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
/**
|
|
@@ -97,7 +98,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
97
98
|
* it's only responsible for aborting its one specific feature, rather than all.
|
|
98
99
|
*/
|
|
99
100
|
try {
|
|
100
|
-
if (!this
|
|
101
|
+
if (!this.#shouldImportAgg(this.featureName, session)) {
|
|
101
102
|
drain(this.agentIdentifier, this.featureName);
|
|
102
103
|
loadedSuccessfully(false); // aggregate module isn't loaded at all
|
|
103
104
|
return;
|
|
@@ -130,12 +131,8 @@ export class InstrumentBase extends FeatureBase {
|
|
|
130
131
|
* @param {import('../../common/session/session-entity').SessionEntity} session
|
|
131
132
|
* @returns
|
|
132
133
|
*/
|
|
133
|
-
shouldImportAgg(featureName, session) {
|
|
134
|
-
if (featureName === FEATURE_NAMES.sessionReplay)
|
|
135
|
-
if (!originals.MO) return false; // Session Replay cannot work without Mutation Observer
|
|
136
|
-
if (getConfigurationValue(this.agentIdentifier, 'session_trace.enabled') === false) return false; // Session Replay as of now is tightly coupled with Session Trace in the UI
|
|
137
|
-
return !!session?.isNew || !!session?.state.sessionReplayMode; // Session Replay should only try to run if already running from a previous page, or at the beginning of a session
|
|
138
|
-
}
|
|
134
|
+
#shouldImportAgg(featureName, session) {
|
|
135
|
+
if (featureName === FEATURE_NAMES.sessionReplay) return canImportReplayAgg(this.agentIdentifier, session);
|
|
139
136
|
return true;
|
|
140
137
|
}
|
|
141
138
|
}
|
|
@@ -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(
|
|
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/
|
|
149
|
+
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/pauseReplay/}
|
|
135
150
|
*/
|
|
136
151
|
pauseReplay() {
|
|
137
|
-
return this.#callMethod(
|
|
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
|
-
|
|
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:
|
|
54
|
-
init:
|
|
55
|
-
loader_config:
|
|
56
|
-
runtime:
|
|
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
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
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];
|
|
2
3
|
export const asyncApiMethods = ['setErrorHandler', 'finished', 'addToTrace', 'addRelease'];
|
|
@@ -14,6 +14,7 @@ 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
16
|
import { apiMethods, asyncApiMethods } from './api-methods';
|
|
17
|
+
import { SR_EVENT_EMITTER_TYPES } from '../../features/session_replay/constants';
|
|
17
18
|
export function setTopLevelCallers() {
|
|
18
19
|
const nr = gosCDN();
|
|
19
20
|
apiMethods.forEach(f => {
|
|
@@ -38,6 +39,7 @@ export function setTopLevelCallers() {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
export function setAPI(agentIdentifier, forceDrain) {
|
|
42
|
+
let runSoftNavOverSpa = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
41
43
|
if (!forceDrain) registerDrain(agentIdentifier, 'api');
|
|
42
44
|
const apiInterface = {};
|
|
43
45
|
var instanceEE = ee.get(agentIdentifier);
|
|
@@ -50,7 +52,6 @@ export function setAPI(agentIdentifier, forceDrain) {
|
|
|
50
52
|
apiInterface[fnName] = apiCall(prefix, fnName, true, 'api');
|
|
51
53
|
});
|
|
52
54
|
apiInterface.addPageAction = apiCall(prefix, 'addPageAction', true, FEATURE_NAMES.pageAction);
|
|
53
|
-
apiInterface.setCurrentRouteName = apiCall(prefix, 'routeName', true, FEATURE_NAMES.spa);
|
|
54
55
|
apiInterface.setPageViewName = function (name, host) {
|
|
55
56
|
if (typeof name !== 'string') return;
|
|
56
57
|
if (name.charAt(0) !== '/') name = '/' + name;
|
|
@@ -135,25 +136,26 @@ export function setAPI(agentIdentifier, forceDrain) {
|
|
|
135
136
|
warn('An unexpected issue occurred', err);
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
|
-
apiInterface.
|
|
139
|
+
apiInterface[SR_EVENT_EMITTER_TYPES.RECORD] = function () {
|
|
139
140
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/recordReplay/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
|
|
140
|
-
handle(
|
|
141
|
+
handle(SR_EVENT_EMITTER_TYPES.RECORD, [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
|
|
141
142
|
};
|
|
142
|
-
apiInterface.
|
|
143
|
+
apiInterface[SR_EVENT_EMITTER_TYPES.PAUSE] = function () {
|
|
143
144
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/pauseReplay/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
|
|
144
|
-
handle(
|
|
145
|
+
handle(SR_EVENT_EMITTER_TYPES.PAUSE, [], undefined, FEATURE_NAMES.sessionReplay, instanceEE);
|
|
145
146
|
};
|
|
146
|
-
apiInterface.interaction = function () {
|
|
147
|
-
return new InteractionHandle().get();
|
|
147
|
+
apiInterface.interaction = function (options) {
|
|
148
|
+
return new InteractionHandle().get(typeof options === 'object' ? options : {});
|
|
148
149
|
};
|
|
149
150
|
function InteractionHandle() {}
|
|
150
|
-
|
|
151
|
+
const InteractionApiProto = InteractionHandle.prototype = {
|
|
151
152
|
createTracer: function (name, cb) {
|
|
152
153
|
var contextStore = {};
|
|
153
154
|
var ixn = this;
|
|
154
155
|
var hasCb = typeof cb === 'function';
|
|
155
156
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/createTracer/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
|
|
156
|
-
|
|
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);
|
|
157
159
|
return function () {
|
|
158
160
|
tracerEE.emit((hasCb ? '' : 'no-') + 'fn-start', [now(), ixn, hasCb], contextStore);
|
|
159
161
|
if (hasCb) {
|
|
@@ -171,13 +173,14 @@ export function setAPI(agentIdentifier, forceDrain) {
|
|
|
171
173
|
}
|
|
172
174
|
};
|
|
173
175
|
['actionText', 'setName', 'setAttribute', 'save', 'ignore', 'onEnd', 'getContext', 'end', 'get'].forEach(name => {
|
|
174
|
-
InteractionApiProto[name] = apiCall(spaPrefix, name, undefined, FEATURE_NAMES.spa);
|
|
176
|
+
InteractionApiProto[name] = apiCall(spaPrefix, name, undefined, runSoftNavOverSpa ? FEATURE_NAMES.softNav : FEATURE_NAMES.spa);
|
|
175
177
|
});
|
|
178
|
+
apiInterface.setCurrentRouteName = runSoftNavOverSpa ? apiCall(spaPrefix, 'routeName', undefined, FEATURE_NAMES.softNav) : apiCall(prefix, 'routeName', true, FEATURE_NAMES.spa);
|
|
176
179
|
function apiCall(prefix, name, notSpa, bufferGroup) {
|
|
177
180
|
return function () {
|
|
178
181
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/' + name + '/called'], undefined, FEATURE_NAMES.metrics, instanceEE);
|
|
179
182
|
if (bufferGroup) handle(prefix + name, [now(), ...arguments], notSpa ? null : this, bufferGroup, instanceEE); // no bufferGroup means only the SM is emitted
|
|
180
|
-
return notSpa ? undefined : this;
|
|
183
|
+
return notSpa ? undefined : this; // returns the InteractionHandle which allows these methods to be chained
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
186
|
apiInterface.noticeError = function (err, customAttributes) {
|
|
@@ -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"))
|
|
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.
|
|
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,
|
|
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":"
|
|
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":"
|
|
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 +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"}
|
|
@@ -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,
|
|
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,
|
|
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;
|
|
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":"
|
|
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 +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":"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":"
|
|
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":"
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
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":"
|
|
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,
|
|
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"}
|