@newrelic/browser-agent 1.235.0 → 1.236.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/README.md +41 -1
- package/dist/cjs/common/config/state/init.js +3 -0
- package/dist/cjs/common/config/state/runtime.js +4 -4
- package/dist/cjs/common/constants/env.cdn.js +2 -2
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +52 -0
- package/dist/cjs/common/event-listener/event-listener-opts.js +3 -3
- package/dist/cjs/common/harvest/harvest-scheduler.js +22 -19
- package/dist/cjs/common/harvest/harvest.js +163 -144
- package/dist/cjs/common/harvest/types.js +54 -0
- package/dist/cjs/common/ids/id.js +2 -2
- package/dist/cjs/common/ids/unique-id.js +3 -3
- package/dist/cjs/common/session/session-entity.js +2 -2
- package/dist/cjs/common/timer/interaction-timer.js +2 -2
- package/dist/cjs/common/unload/eol.js +10 -11
- package/dist/cjs/common/url/canonicalize-url.js +2 -2
- package/dist/cjs/common/url/parse-url.js +3 -3
- package/dist/cjs/common/url/protocol.js +2 -2
- package/dist/cjs/common/util/submit-data.js +58 -76
- package/dist/cjs/common/window/nreum.js +14 -14
- package/dist/cjs/common/wrap/wrap-events.js +3 -3
- package/dist/cjs/common/wrap/wrap-fetch.js +5 -5
- package/dist/cjs/common/wrap/wrap-history.js +2 -2
- package/dist/cjs/common/wrap/wrap-jsonp.js +2 -2
- package/dist/cjs/common/wrap/wrap-mutation.js +2 -2
- package/dist/cjs/common/wrap/wrap-promise.js +2 -2
- package/dist/cjs/common/wrap/wrap-raf.js +2 -2
- package/dist/cjs/common/wrap/wrap-timer.js +4 -4
- package/dist/cjs/common/wrap/wrap-xhr.js +3 -3
- package/dist/cjs/features/ajax/aggregate/index.js +1 -1
- package/dist/cjs/features/ajax/instrument/distributed-tracing.js +2 -2
- package/dist/cjs/features/ajax/instrument/index.js +6 -7
- package/dist/cjs/features/jserrors/aggregate/index.js +7 -4
- package/dist/cjs/features/jserrors/instrument/index.js +4 -4
- package/dist/cjs/features/metrics/aggregate/framework-detection.js +2 -2
- package/dist/cjs/features/metrics/aggregate/index.js +3 -3
- package/dist/cjs/features/page_action/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_event/aggregate/index.js +10 -11
- package/dist/cjs/features/page_view_event/instrument/index.js +2 -2
- package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -5
- package/dist/cjs/features/page_view_timing/instrument/index.js +2 -2
- package/dist/cjs/features/session_replay/replay-mode.js +2 -2
- package/dist/cjs/features/session_trace/instrument/index.js +2 -2
- package/dist/cjs/features/spa/aggregate/index.js +1 -1
- package/dist/cjs/features/spa/instrument/index.js +2 -2
- package/dist/cjs/features/utils/instrument-base.js +6 -7
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/loaders/agent.js +7 -0
- package/dist/cjs/loaders/api/api.js +2 -2
- package/dist/cjs/loaders/api/apiAsync.js +6 -4
- package/dist/cjs/loaders/configure/configure.js +2 -2
- package/dist/cjs/loaders/micro-agent.js +29 -38
- package/dist/esm/common/config/state/init.js +3 -0
- package/dist/esm/common/config/state/runtime.js +1 -1
- package/dist/esm/common/constants/env.cdn.js +2 -2
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +38 -0
- package/dist/esm/common/event-listener/event-listener-opts.js +1 -1
- package/dist/esm/common/harvest/harvest-scheduler.js +21 -20
- package/dist/esm/common/harvest/harvest.js +160 -142
- package/dist/esm/common/harvest/types.js +47 -0
- package/dist/esm/common/ids/id.js +1 -1
- package/dist/esm/common/ids/unique-id.js +1 -1
- package/dist/esm/common/session/session-entity.js +1 -1
- package/dist/esm/common/timer/interaction-timer.js +1 -1
- package/dist/esm/common/unload/eol.js +1 -2
- package/dist/esm/common/url/canonicalize-url.js +1 -1
- package/dist/esm/common/url/parse-url.js +1 -1
- package/dist/esm/common/url/protocol.js +1 -1
- package/dist/esm/common/util/submit-data.js +55 -73
- package/dist/esm/common/window/nreum.js +1 -1
- package/dist/esm/common/wrap/wrap-events.js +1 -1
- package/dist/esm/common/wrap/wrap-fetch.js +1 -1
- package/dist/esm/common/wrap/wrap-history.js +1 -1
- package/dist/esm/common/wrap/wrap-jsonp.js +1 -1
- package/dist/esm/common/wrap/wrap-mutation.js +1 -1
- package/dist/esm/common/wrap/wrap-promise.js +1 -1
- package/dist/esm/common/wrap/wrap-raf.js +1 -1
- package/dist/esm/common/wrap/wrap-timer.js +1 -1
- package/dist/esm/common/wrap/wrap-xhr.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +1 -1
- package/dist/esm/features/ajax/instrument/distributed-tracing.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +1 -2
- package/dist/esm/features/jserrors/aggregate/index.js +6 -3
- package/dist/esm/features/jserrors/instrument/index.js +1 -1
- package/dist/esm/features/metrics/aggregate/framework-detection.js +1 -1
- package/dist/esm/features/metrics/aggregate/index.js +1 -1
- package/dist/esm/features/page_action/aggregate/index.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/index.js +1 -2
- package/dist/esm/features/page_view_event/instrument/index.js +1 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +2 -4
- package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/replay-mode.js +2 -2
- package/dist/esm/features/session_trace/instrument/index.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +1 -1
- package/dist/esm/features/spa/instrument/index.js +1 -1
- package/dist/esm/features/utils/instrument-base.js +4 -5
- package/dist/esm/index.js +1 -4
- package/dist/esm/loaders/agent.js +7 -0
- package/dist/esm/loaders/api/api.js +1 -1
- package/dist/esm/loaders/api/apiAsync.js +3 -3
- package/dist/esm/loaders/configure/configure.js +1 -1
- package/dist/esm/loaders/micro-agent.js +29 -38
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +29 -0
- package/dist/types/common/constants/runtime.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts +49 -38
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/harvest/types.d.ts +100 -0
- package/dist/types/common/harvest/types.d.ts.map +1 -0
- package/dist/types/common/unload/eol.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts +62 -64
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/index.d.ts +1 -1
- package/dist/types/features/jserrors/instrument/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.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/loaders/agent.d.ts +4 -4
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent.d.ts +3 -4
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/common/config/__mocks__/config.js +11 -0
- package/src/common/config/state/init.js +1 -0
- package/src/common/config/state/runtime.js +1 -1
- package/src/common/constants/__mocks__/env.js +3 -0
- package/src/common/constants/__mocks__/runtime.js +8 -0
- package/src/common/constants/env.cdn.test.js +7 -0
- package/src/common/constants/env.npm.test.js +7 -0
- package/src/common/constants/env.test.js +7 -0
- package/src/common/constants/runtime.js +71 -0
- package/src/common/constants/runtime.test.js +168 -0
- package/src/common/context/__mocks__/shared-context.js +8 -0
- package/src/common/event-listener/__mocks__/event-listener-opts.js +7 -0
- package/src/common/event-listener/event-listener-opts.js +1 -1
- package/src/common/harvest/__mocks__/harvest.js +13 -0
- package/src/common/harvest/harvest-scheduler.js +21 -20
- package/src/common/harvest/harvest-scheduler.test.js +496 -0
- package/src/common/harvest/harvest.js +147 -130
- package/src/common/harvest/harvest.test.js +818 -0
- package/src/common/harvest/types.js +47 -0
- package/src/common/ids/id.js +1 -1
- package/src/common/ids/unique-id.js +1 -1
- package/src/common/session/__mocks__/session-entity.js +25 -0
- package/src/common/session/session-entity.component-test.js +1 -1
- package/src/common/session/session-entity.js +1 -1
- package/src/common/timer/interaction-timer.js +1 -1
- package/src/common/timing/__mocks__/now.js +1 -0
- package/src/common/unload/__mocks__/eol.js +1 -0
- package/src/common/unload/eol.js +1 -2
- package/src/common/url/__mocks__/clean-url.js +1 -0
- package/src/common/url/__mocks__/encode.js +7 -0
- package/src/common/url/__mocks__/location.js +1 -0
- package/src/common/url/canonicalize-url.js +1 -1
- package/src/common/url/canonicalize-url.test.js +2 -2
- package/src/common/url/parse-url.js +1 -1
- package/src/common/url/parse-url.test.js +3 -3
- package/src/common/url/protocol.js +1 -1
- package/src/common/util/__mocks__/obfuscate.js +10 -0
- package/src/common/util/__mocks__/stringify.js +1 -0
- package/src/common/util/__mocks__/submit-data.js +6 -0
- package/src/common/util/__mocks__/traverse.js +1 -0
- package/src/common/util/submit-data.js +39 -53
- package/src/common/util/submit-data.test.js +81 -68
- package/src/common/window/nreum.js +1 -1
- package/src/common/wrap/wrap-events.js +1 -1
- package/src/common/wrap/wrap-fetch.js +1 -1
- package/src/common/wrap/wrap-history.js +1 -1
- package/src/common/wrap/wrap-jsonp.js +1 -1
- package/src/common/wrap/wrap-mutation.js +1 -1
- package/src/common/wrap/wrap-promise.js +1 -1
- package/src/common/wrap/wrap-promise.test.js +2 -2
- package/src/common/wrap/wrap-raf.js +1 -1
- package/src/common/wrap/wrap-timer.js +1 -1
- package/src/common/wrap/wrap-xhr.js +1 -1
- package/src/features/ajax/aggregate/index.js +1 -1
- package/src/features/ajax/instrument/distributed-tracing.js +1 -1
- package/src/features/ajax/instrument/index.js +1 -2
- package/src/features/jserrors/aggregate/compute-stack-trace.test.js +1 -1
- package/src/features/jserrors/aggregate/index.js +7 -3
- package/src/features/jserrors/instrument/index.js +1 -1
- package/src/features/metrics/aggregate/framework-detection.js +1 -1
- package/src/features/metrics/aggregate/framework-detection.test.js +2 -2
- package/src/features/metrics/aggregate/index.js +1 -1
- package/src/features/page_action/aggregate/index.js +1 -1
- package/src/features/page_view_event/aggregate/index.js +1 -2
- package/src/features/page_view_event/instrument/index.js +1 -1
- package/src/features/page_view_timing/aggregate/index.js +2 -4
- package/src/features/page_view_timing/instrument/index.js +1 -1
- package/src/features/session_replay/replay-mode.js +2 -2
- package/src/features/session_trace/instrument/index.js +1 -1
- package/src/features/spa/aggregate/index.js +1 -1
- package/src/features/spa/instrument/index.js +1 -1
- package/src/features/utils/agent-session.test.js +2 -2
- package/src/features/utils/instrument-base.js +5 -5
- package/src/features/utils/instrument-base.test.js +22 -3
- package/src/index.js +1 -3
- package/src/loaders/agent.js +8 -0
- package/src/loaders/api/api.js +1 -1
- package/src/loaders/api/apiAsync.js +3 -3
- package/src/loaders/configure/configure.js +1 -1
- package/src/loaders/micro-agent.js +26 -30
- package/dist/cjs/common/browser-version/firefox-version.js +0 -17
- package/dist/cjs/common/browser-version/ios-version.js +0 -19
- package/dist/cjs/common/event-emitter/contextual-ee.test.js +0 -282
- package/dist/cjs/common/event-emitter/handle.test.js +0 -58
- package/dist/cjs/common/event-emitter/register-handler.test.js +0 -55
- package/dist/cjs/common/harvest/harvest-scheduler.component-test.js +0 -39
- package/dist/cjs/common/harvest/harvest.component-test.js +0 -224
- package/dist/cjs/common/ids/id.test.js +0 -85
- package/dist/cjs/common/ids/unique-id.test.js +0 -49
- package/dist/cjs/common/session/session-entity.component-test.js +0 -497
- package/dist/cjs/common/storage/local-storage.test.js +0 -14
- package/dist/cjs/common/timer/interaction-timer.component-test.js +0 -216
- package/dist/cjs/common/timer/timer.test.js +0 -105
- package/dist/cjs/common/timing/nav-timing.test.js +0 -192
- package/dist/cjs/common/url/canonicalize-url.test.js +0 -38
- package/dist/cjs/common/url/clean-url.test.js +0 -9
- package/dist/cjs/common/url/encode.component-test.js +0 -74
- package/dist/cjs/common/url/location.test.js +0 -13
- package/dist/cjs/common/url/parse-url.test.js +0 -111
- package/dist/cjs/common/url/protocol.component-test.js +0 -15
- package/dist/cjs/common/util/console.test.js +0 -30
- package/dist/cjs/common/util/data-size.test.js +0 -64
- package/dist/cjs/common/util/feature-flags.test.js +0 -84
- package/dist/cjs/common/util/get-or-set.test.js +0 -47
- package/dist/cjs/common/util/global-scope.js +0 -27
- package/dist/cjs/common/util/global-scope.test.js +0 -72
- package/dist/cjs/common/util/invoke.test.js +0 -49
- package/dist/cjs/common/util/map-own.test.js +0 -49
- package/dist/cjs/common/util/obfuscate.component-test.js +0 -129
- package/dist/cjs/common/util/stringify.test.js +0 -48
- package/dist/cjs/common/util/submit-data.test.js +0 -245
- package/dist/cjs/common/util/traverse.test.js +0 -44
- package/dist/cjs/common/wrap/wrap-promise.test.js +0 -119
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.test.js +0 -31
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.test.js +0 -383
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.test.js +0 -40
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.test.js +0 -27
- package/dist/cjs/features/metrics/aggregate/framework-detection.test.js +0 -137
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.es5.test.js +0 -17
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.test.js +0 -165
- package/dist/cjs/features/session_replay/aggregate/index.component-test.js +0 -457
- package/dist/cjs/features/spa/aggregate/interaction-node.test.js +0 -16
- package/dist/cjs/features/utils/agent-session.test.js +0 -211
- package/dist/cjs/features/utils/aggregate-base.test.js +0 -110
- package/dist/cjs/features/utils/feature-base.test.js +0 -42
- package/dist/cjs/features/utils/handler-cache.test.js +0 -53
- package/dist/cjs/features/utils/instrument-base.test.js +0 -179
- package/dist/cjs/features/utils/lazy-feature-loader.test.js +0 -30
- package/dist/esm/common/browser-version/firefox-version.js +0 -10
- package/dist/esm/common/browser-version/ios-version.js +0 -11
- package/dist/esm/common/event-emitter/contextual-ee.test.js +0 -278
- package/dist/esm/common/event-emitter/handle.test.js +0 -54
- package/dist/esm/common/event-emitter/register-handler.test.js +0 -51
- package/dist/esm/common/harvest/harvest-scheduler.component-test.js +0 -37
- package/dist/esm/common/harvest/harvest.component-test.js +0 -222
- package/dist/esm/common/ids/id.test.js +0 -81
- package/dist/esm/common/ids/unique-id.test.js +0 -44
- package/dist/esm/common/session/session-entity.component-test.js +0 -495
- package/dist/esm/common/storage/local-storage.test.js +0 -12
- package/dist/esm/common/timer/interaction-timer.component-test.js +0 -214
- package/dist/esm/common/timer/timer.test.js +0 -103
- package/dist/esm/common/timing/nav-timing.test.js +0 -190
- package/dist/esm/common/url/canonicalize-url.test.js +0 -34
- package/dist/esm/common/url/clean-url.test.js +0 -7
- package/dist/esm/common/url/encode.component-test.js +0 -70
- package/dist/esm/common/url/location.test.js +0 -11
- package/dist/esm/common/url/parse-url.test.js +0 -107
- package/dist/esm/common/url/protocol.component-test.js +0 -13
- package/dist/esm/common/util/console.test.js +0 -28
- package/dist/esm/common/util/data-size.test.js +0 -60
- package/dist/esm/common/util/feature-flags.test.js +0 -80
- package/dist/esm/common/util/get-or-set.test.js +0 -45
- package/dist/esm/common/util/global-scope.js +0 -17
- package/dist/esm/common/util/global-scope.test.js +0 -70
- package/dist/esm/common/util/invoke.test.js +0 -47
- package/dist/esm/common/util/map-own.test.js +0 -47
- package/dist/esm/common/util/obfuscate.component-test.js +0 -125
- package/dist/esm/common/util/stringify.test.js +0 -46
- package/dist/esm/common/util/submit-data.test.js +0 -241
- package/dist/esm/common/util/traverse.test.js +0 -42
- package/dist/esm/common/wrap/wrap-promise.test.js +0 -115
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.test.js +0 -29
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.test.js +0 -379
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.test.js +0 -38
- package/dist/esm/features/jserrors/aggregate/string-hash-code.test.js +0 -25
- package/dist/esm/features/metrics/aggregate/framework-detection.test.js +0 -133
- package/dist/esm/features/metrics/aggregate/polyfill-detection.es5.test.js +0 -15
- package/dist/esm/features/metrics/aggregate/polyfill-detection.test.js +0 -163
- package/dist/esm/features/session_replay/aggregate/index.component-test.js +0 -453
- package/dist/esm/features/spa/aggregate/interaction-node.test.js +0 -14
- package/dist/esm/features/utils/agent-session.test.js +0 -207
- package/dist/esm/features/utils/aggregate-base.test.js +0 -108
- package/dist/esm/features/utils/feature-base.test.js +0 -40
- package/dist/esm/features/utils/handler-cache.test.js +0 -51
- package/dist/esm/features/utils/instrument-base.test.js +0 -175
- package/dist/esm/features/utils/lazy-feature-loader.test.js +0 -29
- package/dist/types/common/browser-version/firefox-version.d.ts +0 -2
- package/dist/types/common/browser-version/firefox-version.d.ts.map +0 -1
- package/dist/types/common/browser-version/ios-version.d.ts +0 -3
- package/dist/types/common/browser-version/ios-version.d.ts.map +0 -1
- package/dist/types/common/harvest/harvest-scheduler.component-test.d.ts +0 -2
- package/dist/types/common/harvest/harvest-scheduler.component-test.d.ts.map +0 -1
- package/dist/types/common/harvest/harvest.component-test.d.ts +0 -2
- package/dist/types/common/harvest/harvest.component-test.d.ts.map +0 -1
- package/dist/types/common/session/session-entity.component-test.d.ts +0 -2
- package/dist/types/common/session/session-entity.component-test.d.ts.map +0 -1
- package/dist/types/common/timer/interaction-timer.component-test.d.ts +0 -2
- package/dist/types/common/timer/interaction-timer.component-test.d.ts.map +0 -1
- package/dist/types/common/url/encode.component-test.d.ts +0 -2
- package/dist/types/common/url/encode.component-test.d.ts.map +0 -1
- package/dist/types/common/url/protocol.component-test.d.ts +0 -2
- package/dist/types/common/url/protocol.component-test.d.ts.map +0 -1
- package/dist/types/common/util/global-scope.d.ts +0 -5
- package/dist/types/common/util/global-scope.d.ts.map +0 -1
- package/dist/types/common/util/obfuscate.component-test.d.ts +0 -2
- package/dist/types/common/util/obfuscate.component-test.d.ts.map +0 -1
- package/dist/types/features/session_replay/aggregate/index.component-test.d.ts +0 -2
- package/dist/types/features/session_replay/aggregate/index.component-test.d.ts.map +0 -1
- package/src/common/browser-version/firefox-version.js +0 -10
- package/src/common/browser-version/ios-version.js +0 -11
- package/src/common/harvest/harvest-scheduler.component-test.js +0 -25
- package/src/common/harvest/harvest.component-test.js +0 -169
- package/src/common/util/global-scope.js +0 -23
- package/src/common/util/global-scope.test.js +0 -87
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// loader files
|
|
2
|
+
import { Instrument as PVE } from '../features/page_view_event/instrument';
|
|
2
3
|
import { getEnabledFeatures } from './features/enabled-features';
|
|
3
4
|
import { configure } from './configure/configure';
|
|
4
5
|
// core files
|
|
@@ -8,14 +9,13 @@ import { generateRandomHexString } from '../common/ids/unique-id';
|
|
|
8
9
|
import { getConfiguration, getInfo, getLoaderConfig, getRuntime } from '../common/config/config';
|
|
9
10
|
import { FEATURE_NAMES } from './features/features';
|
|
10
11
|
import { warn } from '../common/util/console';
|
|
11
|
-
|
|
12
|
-
const
|
|
12
|
+
import { onWindowLoad } from '../common/window/load';
|
|
13
|
+
const nonAutoFeatures = [FEATURE_NAMES.jserrors, FEATURE_NAMES.pageAction, FEATURE_NAMES.metrics];
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* A minimal agent class designed to
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* instrumentations at runtime, and to report desired data, events, and errors programatically.
|
|
16
|
+
* A minimal agent class designed to only respond to manual user input. As such, this class does not
|
|
17
|
+
* automatically instrument. Instead, each MicroAgent instance will lazy load the required features and can support loading multiple instances on one page.
|
|
18
|
+
* Out of the box, it can manually handle and report Page View, Page Action, and Error events.
|
|
19
19
|
*/
|
|
20
20
|
export class MicroAgent {
|
|
21
21
|
/**
|
|
@@ -48,38 +48,29 @@ export class MicroAgent {
|
|
|
48
48
|
start() {
|
|
49
49
|
try {
|
|
50
50
|
const enabledFeatures = getEnabledFeatures(this.agentIdentifier);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} = _ref3;
|
|
75
|
-
return lazyFeatureLoader(f, 'aggregate');
|
|
76
|
-
}).then(_ref4 => {
|
|
77
|
-
let {
|
|
78
|
-
Aggregate
|
|
79
|
-
} = _ref4;
|
|
80
|
-
this.features[f] = new Aggregate(this.agentIdentifier, this.sharedAggregator);
|
|
81
|
-
}).catch(err => warn('Something prevented the agent from being downloaded.'));
|
|
82
|
-
}
|
|
51
|
+
try {
|
|
52
|
+
// a biproduct of doing this is that the "session manager" is automatically handled through importing this feature
|
|
53
|
+
this.features.page_view_event = new PVE(this.agentIdentifier, this.sharedAggregator);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
warn('Something prevented the agent from instrumenting.', err);
|
|
56
|
+
}
|
|
57
|
+
onWindowLoad(() => {
|
|
58
|
+
// these features do not import an "instrument" file, meaning they are only hooked up to the API.
|
|
59
|
+
nonAutoFeatures.forEach(f => {
|
|
60
|
+
if (enabledFeatures[f]) {
|
|
61
|
+
import( /* webpackChunkName: "lazy-feature-loader" */'../features/utils/lazy-feature-loader').then(_ref => {
|
|
62
|
+
let {
|
|
63
|
+
lazyFeatureLoader
|
|
64
|
+
} = _ref;
|
|
65
|
+
return lazyFeatureLoader(f, 'aggregate');
|
|
66
|
+
}).then(_ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
Aggregate
|
|
69
|
+
} = _ref2;
|
|
70
|
+
this.features[f] = new Aggregate(this.agentIdentifier, this.sharedAggregator);
|
|
71
|
+
}).catch(err => warn('Something prevented the agent from being downloaded.', err));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
83
74
|
});
|
|
84
75
|
gosNREUMInitializedAgents(this.agentIdentifier, this.features, 'features');
|
|
85
76
|
return this;
|
|
@@ -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":"AAqEA,+CAIC;AAED,0DAIC;AAED,+DAYC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Contains constants about the environment the agent is running
|
|
3
|
+
* within. These values are derived at the time the agent is first loaded.
|
|
4
|
+
* @copyright 2023 New Relic Corporation. All rights reserved.
|
|
5
|
+
* @license Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Indicates if the agent is running within a normal browser window context.
|
|
9
|
+
*/
|
|
10
|
+
export const isBrowserScope: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Indicates if the agent is running within a worker context.
|
|
13
|
+
*/
|
|
14
|
+
export const isWorkerScope: boolean;
|
|
15
|
+
export const globalScope: false | typeof globalThis;
|
|
16
|
+
export const initialLocation: string;
|
|
17
|
+
export const isiOS: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Shared Web Workers introduced in iOS 16.0+ and n/a in 15.6-
|
|
20
|
+
*
|
|
21
|
+
* It was discovered in Safari 14 (https://bugs.webkit.org/show_bug.cgi?id=225305) that the buffered flag in PerformanceObserver
|
|
22
|
+
* did not work. This affects our onFCP metric in particular since web-vitals uses that flag to retrieve paint timing entries.
|
|
23
|
+
* This was fixed in v16+.
|
|
24
|
+
*/
|
|
25
|
+
export const iOS_below16: boolean;
|
|
26
|
+
export const ffVersion: number;
|
|
27
|
+
export const isIE: boolean;
|
|
28
|
+
export const supportsSendBeacon: true;
|
|
29
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/runtime.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,qCAEqB;AAErB;;GAEG;AACH,oCAeK;AAEL,oDAUI;AAEJ,qCAAyD;AAEzD,4BAAiE;AAEjE;;;;;;GAMG;AACH,kCAAyE;AAEzE,+BAOI;AAEJ,2BAA2E;AAE3E,sCAAwD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harvest-scheduler.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest-scheduler.js"],"names":[],"mappings":"AAYA;;GAEG;AACH;IACE;;;;;;;;;;SAUK;IACL,sBATa,MAAM;QAES,UAAU;QACV,UAAU;QACZ,UAAU,EAAvB,MAAM;QACQ,GAAG,EAAjB,OAAO;QACM,SAAS,EAAtB,MAAM;oBAoBlB;IAfC,iBAAwB;IACxB;;;oBARW,MAAM;aACN,OAAO;mBACP,MAAM;MAMK;IACtB,iBAAoB;IACpB,
|
|
1
|
+
{"version":3,"file":"harvest-scheduler.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest-scheduler.js"],"names":[],"mappings":"AAYA;;GAEG;AACH;IACE;;;;;;;;;;SAUK;IACL,sBATa,MAAM;QAES,UAAU;QACV,UAAU;QACZ,UAAU,EAAvB,MAAM;QACQ,GAAG,EAAjB,OAAO;QACM,SAAS,EAAtB,MAAM;oBAoBlB;IAfC,iBAAwB;IACxB;;;oBARW,MAAM;aACN,OAAO;mBACP,MAAM;MAMK;IACtB,iBAAoB;IACpB,mBAAyB;IACzB,iBAAoB;IAEpB,iBAA8C;IAWhD;;;OAGG;IACH,eAKC;IAED,mDAIC;IAHC,cAAwB;IAK1B,uCAMC;IAED,6CAUC;IAED,yCAgEC;IAED,gDAiBC;CACF;8BAjK6B,2BAA2B;wBACjC,WAAW"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
key: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}[] | undefined;
|
|
11
|
-
}) => XMLHttpRequest) | (({ url }: {
|
|
12
|
-
url: string;
|
|
13
|
-
}) => HTMLImageElement) | (({ url, body }: {
|
|
14
|
-
url: string;
|
|
15
|
-
body?: string | undefined;
|
|
16
|
-
}) => boolean);
|
|
17
|
-
useBody: boolean;
|
|
18
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types.js').NetworkSendSpec} NetworkSendSpec
|
|
3
|
+
* @typedef {import('./types.js').HarvestEndpointIdentifier} HarvestEndpointIdentifier
|
|
4
|
+
* @typedef {import('./types.js').HarvestPayload} HarvestPayload
|
|
5
|
+
* @typedef {import('./types.js').FeatureHarvestCallback} FeatureHarvestCallback
|
|
6
|
+
* @typedef {import('./types.js').FeatureHarvestCallbackOptions} FeatureHarvestCallbackOptions
|
|
7
|
+
*/
|
|
19
8
|
export class Harvest extends SharedContext {
|
|
20
9
|
tooManyRequestsDelay: any;
|
|
21
10
|
obfuscator: Obfuscator;
|
|
@@ -24,38 +13,60 @@ export class Harvest extends SharedContext {
|
|
|
24
13
|
/**
|
|
25
14
|
* Initiate a harvest from multiple sources. An event that corresponds to the endpoint
|
|
26
15
|
* name is emitted, which gives any listeners the opportunity to provide payload data.
|
|
16
|
+
* Note: Used by page_action
|
|
27
17
|
* @param {NetworkSendSpec} spec Specification for sending data
|
|
28
18
|
*/
|
|
29
|
-
sendX(spec
|
|
19
|
+
sendX(spec?: NetworkSendSpec): boolean;
|
|
30
20
|
/**
|
|
31
21
|
* Initiate a harvest call.
|
|
32
22
|
* @param {NetworkSendSpec} spec Specification for sending data
|
|
33
23
|
*/
|
|
34
|
-
send(spec
|
|
24
|
+
send(spec?: NetworkSendSpec): boolean;
|
|
35
25
|
/**
|
|
36
26
|
* Apply obfuscation rules to the payload and then initial the harvest network call.
|
|
37
27
|
* @param {NetworkSendSpec} spec Specification for sending data
|
|
38
28
|
*/
|
|
39
|
-
obfuscateAndSend(spec
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
includeBaseParams?: boolean | undefined;
|
|
49
|
-
}): any;
|
|
29
|
+
obfuscateAndSend(spec?: NetworkSendSpec): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Initiate a harvest call. Typically used by `sendX` and `send` methods or called directly
|
|
32
|
+
* for raw network calls.
|
|
33
|
+
* @param {NetworkSendSpec} param0 Specification for sending data
|
|
34
|
+
* @returns {boolean} True if the network call succeeded. For final harvest calls, the return
|
|
35
|
+
* value should not be relied upon because network calls will be made asynchronously.
|
|
36
|
+
*/
|
|
37
|
+
_send({ endpoint, payload, opts, submitMethod, cbFinished, customUrl, raw, includeBaseParams }: NetworkSendSpec): boolean;
|
|
50
38
|
baseQueryString(): string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Calls and accumulates data from registered harvesting functions based on
|
|
41
|
+
* the endpoint being harvested.
|
|
42
|
+
* @param {HarvestEndpointIdentifier} endpoint BAM endpoint identifier.
|
|
43
|
+
* @param {FeatureHarvestCallbackOptions} options Options to be passed to the
|
|
44
|
+
* feature harvest listener callback.
|
|
45
|
+
* @returns {HarvestPayload} Payload object to transmit to the bam endpoint.
|
|
46
|
+
*/
|
|
47
|
+
createPayload(endpoint: HarvestEndpointIdentifier, options: FeatureHarvestCallbackOptions): HarvestPayload;
|
|
48
|
+
/**
|
|
49
|
+
* Cleans and returns a payload object containing a body and qs
|
|
50
|
+
* object with key/value pairs. KV pairs where the value is null,
|
|
51
|
+
* undefined, or an empty string are removed to save on transmission
|
|
52
|
+
* size.
|
|
53
|
+
* @param {HarvestPayload} payload Payload to be sent to the endpoint.
|
|
54
|
+
* @returns {HarvestPayload} Cleaned payload payload to be sent to the endpoint.
|
|
55
|
+
*/
|
|
56
|
+
cleanPayload(payload?: HarvestPayload): HarvestPayload;
|
|
57
|
+
/**
|
|
58
|
+
* Registers a function to be called when harvesting is triggered for a specific
|
|
59
|
+
* endpoint.
|
|
60
|
+
* @param {HarvestEndpointIdentifier} endpoint
|
|
61
|
+
* @param {FeatureHarvestCallback} listener
|
|
62
|
+
*/
|
|
63
|
+
on(endpoint: HarvestEndpointIdentifier, listener: FeatureHarvestCallback): void;
|
|
57
64
|
}
|
|
58
|
-
export type NetworkSendSpec =
|
|
65
|
+
export type NetworkSendSpec = import('./types.js').NetworkSendSpec;
|
|
66
|
+
export type HarvestEndpointIdentifier = import('./types.js').HarvestEndpointIdentifier;
|
|
67
|
+
export type HarvestPayload = import('./types.js').HarvestPayload;
|
|
68
|
+
export type FeatureHarvestCallback = import('./types.js').FeatureHarvestCallback;
|
|
69
|
+
export type FeatureHarvestCallbackOptions = import('./types.js').FeatureHarvestCallbackOptions;
|
|
59
70
|
import { SharedContext } from '../context/shared-context';
|
|
60
71
|
import { Obfuscator } from '../util/obfuscate';
|
|
61
72
|
//# sourceMappingURL=harvest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAmBA;;;;;;GAMG;AAEH;IAII,0BAA2H;IAC3H,uBAAoD;IACpD,kCAAsH;IAEtH,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAUzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CA8FnB;IAGD,0BAmBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAwB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BAhQY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BATjC,2BAA2B;2BAF9B,mBAAmB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Contains types related to harvesting data.
|
|
3
|
+
* @copyright 2023 New Relic Corporation. All rights reserved.
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {'rum'|'jserrors'|'events'|'ins'|'resources'|'blob'} HarvestEndpointIdentifier
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} HarvestPayload
|
|
11
|
+
* @property {object} qs Map of values that should be sent as part of the request query string.
|
|
12
|
+
* @property {object} body Map of values that should be sent as the body of the request.
|
|
13
|
+
* @property {string} body.e Special case of body used for browser interactions.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {object} FeatureHarvestCallbackOptions Options for aggregating data for harvesting.
|
|
17
|
+
* @property {boolean} options.retry Indicates if the feature should store the aggregated
|
|
18
|
+
* data in anticipation of a possible need to retry the transmission.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* @callback FeatureHarvestCallback
|
|
22
|
+
* @param {FeatureHarvestCallbackOptions} options Options for aggregating data for harvesting.
|
|
23
|
+
* @returns {HarvestPayload} Payload of data to transmit to bam endpoint.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {object} NetworkSendSpec
|
|
27
|
+
* @property {HarvestEndpointIdentifier} endpoint The endpoint to use (jserrors, events, resources etc.)
|
|
28
|
+
* @property {HarvestPayload} payload Object representing payload.
|
|
29
|
+
* @property {object} opts Additional options for sending data
|
|
30
|
+
* @property {boolean} opts.needResponse Specify whether the caller expects a response data.
|
|
31
|
+
* @property {boolean} opts.unload Specify whether the call is a final harvest during page unload.
|
|
32
|
+
* @property {boolean} opts.sendEmptyBody Specify whether the call should be made even if the body is empty. Useful for rum calls.
|
|
33
|
+
* @property {boolean} opts.retry Indicates if the feature should store the aggregated data in anticipation of a possible need to
|
|
34
|
+
* retry the transmission.
|
|
35
|
+
* @property {import('../util/submit-data.js').NetworkMethods} submitMethod The network method to use {@link ../util/submit-data.js}
|
|
36
|
+
* @property {string} customUrl Override the beacon url the data is sent to; must include protocol if defined
|
|
37
|
+
* @property {boolean} raw If true, disables adding the license key to the url
|
|
38
|
+
* @property {boolean} includeBaseParams Enables the use of base query parameters in the beacon url
|
|
39
|
+
*/
|
|
40
|
+
export const unused: {};
|
|
41
|
+
export type HarvestEndpointIdentifier = 'rum' | 'jserrors' | 'events' | 'ins' | 'resources' | 'blob';
|
|
42
|
+
export type HarvestPayload = {
|
|
43
|
+
/**
|
|
44
|
+
* Map of values that should be sent as part of the request query string.
|
|
45
|
+
*/
|
|
46
|
+
qs: object;
|
|
47
|
+
/**
|
|
48
|
+
* Map of values that should be sent as the body of the request.
|
|
49
|
+
*/
|
|
50
|
+
body: {
|
|
51
|
+
e: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Options for aggregating data for harvesting.
|
|
56
|
+
*/
|
|
57
|
+
export type FeatureHarvestCallbackOptions = {
|
|
58
|
+
/**
|
|
59
|
+
* Indicates if the feature should store the aggregated
|
|
60
|
+
* data in anticipation of a possible need to retry the transmission.
|
|
61
|
+
*/
|
|
62
|
+
retry: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type FeatureHarvestCallback = (options: FeatureHarvestCallbackOptions) => HarvestPayload;
|
|
65
|
+
export type NetworkSendSpec = {
|
|
66
|
+
/**
|
|
67
|
+
* The endpoint to use (jserrors, events, resources etc.)
|
|
68
|
+
*/
|
|
69
|
+
endpoint: HarvestEndpointIdentifier;
|
|
70
|
+
/**
|
|
71
|
+
* Object representing payload.
|
|
72
|
+
*/
|
|
73
|
+
payload: HarvestPayload;
|
|
74
|
+
/**
|
|
75
|
+
* Additional options for sending data
|
|
76
|
+
*/
|
|
77
|
+
opts: {
|
|
78
|
+
needResponse: boolean;
|
|
79
|
+
unload: boolean;
|
|
80
|
+
sendEmptyBody: boolean;
|
|
81
|
+
retry: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* The network method to use {@link ../util/submit-data.js}
|
|
85
|
+
*/
|
|
86
|
+
submitMethod: import('../util/submit-data.js').NetworkMethods;
|
|
87
|
+
/**
|
|
88
|
+
* Override the beacon url the data is sent to; must include protocol if defined
|
|
89
|
+
*/
|
|
90
|
+
customUrl: string;
|
|
91
|
+
/**
|
|
92
|
+
* If true, disables adding the license key to the url
|
|
93
|
+
*/
|
|
94
|
+
raw: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Enables the use of base query parameters in the beacon url
|
|
97
|
+
*/
|
|
98
|
+
includeBaseParams: boolean;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/types.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAGH,wBAAwB;wCAvCX,KAAK,GAAC,UAAU,GAAC,QAAQ,GAAC,KAAK,GAAC,WAAW,GAAC,MAAM;;;;;QAKjD,MAAM;;;;;QAEO,CAAC,EAAd,MAAM;;;;;;;;;;;WAKN,OAAO;;+CAMV,6BAA6B,KAC3B,cAAc;;;;;cAKb,yBAAyB;;;;aACzB,cAAc;;;;;QAEA,YAAY,EAA1B,OAAO;QACO,MAAM,EAApB,OAAO;QACO,aAAa,EAA3B,OAAO;QACO,KAAK,EAAnB,OAAO;;;;;kBAEP,OAAO,wBAAwB,EAAE,cAAc;;;;eAC/C,MAAM;;;;SACN,OAAO;;;;uBACP,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eol.d.ts","sourceRoot":"","sources":["../../../../src/common/unload/eol.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eol.d.ts","sourceRoot":"","sources":["../../../../src/common/unload/eol.js"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,2DAFW,OAAO,QAmCjB"}
|
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}): boolean;
|
|
64
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {xhr|fetchKeepAlive|beacon} NetworkMethods
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Determines the submit method to use based on options.
|
|
6
|
+
* @param {object} opts Options used to determine submit method.
|
|
7
|
+
* @param {boolean} opts.isFinalHarvest Indicates if the data submission is due to
|
|
8
|
+
* a final harvest within the agent.
|
|
9
|
+
*/
|
|
10
|
+
export function getSubmitMethod({ isFinalHarvest }?: {
|
|
11
|
+
isFinalHarvest: boolean;
|
|
12
|
+
}): typeof xhr | typeof beacon;
|
|
13
|
+
/**
|
|
14
|
+
* Send via XHR
|
|
15
|
+
* @param {Object} args - The args.
|
|
16
|
+
* @param {string} args.url - The URL to send to.
|
|
17
|
+
* @param {string=} args.body - The Stringified body. Default null to prevent IE11 from breaking.
|
|
18
|
+
* @param {boolean=} args.sync - Run XHR synchronously.
|
|
19
|
+
* @param {string=} [args.method=POST] - The XHR method to use.
|
|
20
|
+
* @param {{key: string, value: string}[]} [args.headers] - The headers to attach.
|
|
21
|
+
* @returns {XMLHttpRequest}
|
|
22
|
+
*/
|
|
23
|
+
export function xhr({ url, body, sync, method, headers }: {
|
|
24
|
+
url: string;
|
|
25
|
+
body?: string | undefined;
|
|
26
|
+
sync?: boolean | undefined;
|
|
27
|
+
method?: string | undefined;
|
|
28
|
+
headers?: {
|
|
29
|
+
key: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
}): XMLHttpRequest;
|
|
33
|
+
/**
|
|
34
|
+
* Send via fetch with keepalive true
|
|
35
|
+
* @param {Object} args - The args.
|
|
36
|
+
* @param {string} args.url - The URL to send to.
|
|
37
|
+
* @param {string=} args.body - The Stringified body.
|
|
38
|
+
* @param {string=} [args.method=POST] - The XHR method to use.
|
|
39
|
+
* @param {{key: string, value: string}[]} [args.headers] - The headers to attach.
|
|
40
|
+
* @returns {XMLHttpRequest}
|
|
41
|
+
*/
|
|
42
|
+
export function fetchKeepAlive({ url, body, method, headers }: {
|
|
43
|
+
url: string;
|
|
44
|
+
body?: string | undefined;
|
|
45
|
+
method?: string | undefined;
|
|
46
|
+
headers?: {
|
|
47
|
+
key: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
}): XMLHttpRequest;
|
|
51
|
+
/**
|
|
52
|
+
* Send via sendBeacon. Do NOT call this function outside of a guaranteed web window environment.
|
|
53
|
+
* @param {Object} args - The args
|
|
54
|
+
* @param {string} args.url - The URL to send to
|
|
55
|
+
* @param {string=} args.body - The Stringified body
|
|
56
|
+
* @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
export function beacon({ url, body }: {
|
|
59
|
+
url: string;
|
|
60
|
+
body?: string | undefined;
|
|
61
|
+
}): boolean;
|
|
62
|
+
export type NetworkMethods = typeof xhr | typeof fetchKeepAlive | typeof beacon;
|
|
65
63
|
//# sourceMappingURL=submit-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-data.d.ts","sourceRoot":"","sources":["../../../../src/common/util/submit-data.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"submit-data.d.ts","sourceRoot":"","sources":["../../../../src/common/util/submit-data.js"],"names":[],"mappings":"AAQA;;GAEG;AAEH;;;;;GAKG;AACH;IAHyB,cAAc,EAA5B,OAAO;+BAUjB;AAED;;;;;;;;;GASG;AACH;IAPwB,GAAG,EAAhB,MAAM;IACQ,IAAI,GAAlB,MAAM;IACS,IAAI,GAAnB,OAAO;IACQ,MAAM,GAArB,MAAM;IACgC,OAAO;aAAvC,MAAM;eAAS,MAAM;;IACzB,cAAc,CAmB1B;AAED;;;;;;;;GAQG;AACH;IANwB,GAAG,EAAhB,MAAM;IACQ,IAAI,GAAlB,MAAM;IACS,MAAM,GAArB,MAAM;IACgC,OAAO;aAAvC,MAAM;eAAS,MAAM;;IACzB,cAAc,CAY1B;AAED;;;;;;GAMG;AACH;IAJwB,GAAG,EAAhB,MAAM;IACQ,IAAI,GAAlB,MAAM;IACJ,OAAO,CAcnB;6BAvFY,kDAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"AAyBA;IACE,2BAAiC;IACjC,mEAcC;IARC,mBAAiC;IAEjC,4EAAkF;CAOrF;+BA3B8B,6BAA6B;mBAFzC,uBAAuB"}
|
|
@@ -16,7 +16,7 @@ export class Aggregate extends AggregateBase {
|
|
|
16
16
|
currentBody: any;
|
|
17
17
|
onHarvestFinished(result: any): void;
|
|
18
18
|
nameHash(params: any): number;
|
|
19
|
-
getBucketName(params: any, customParams: any): string;
|
|
19
|
+
getBucketName(objType: any, params: any, customParams: any): string;
|
|
20
20
|
/**
|
|
21
21
|
* Builds a standardized stack trace string from the frames in the given `stackInfo` object, with each frame separated
|
|
22
22
|
* by a newline character. Lines take the form `<functionName>@<url>:<lineNumber>`.
|
|
@@ -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,mDAoCC;IAjCC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,eAAoB;IAEpB,qBAAwB;IA8B1B;;;MAoBC;IAfG,iBAAuB;IAiB3B,qCAWC;IAED,8BAEC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAwBA;;GAEG;AAEH;IACE,2BAAiC;IACjC,mDAoCC;IAjCC,kBAAuB;IACvB,eAAoB;IACpB,qBAA0B;IAC1B,eAAoB;IAEpB,qBAAwB;IA8B1B;;;MAoBC;IAfG,iBAAuB;IAiB3B,qCAWC;IAED,8BAEC;IAED,oEAMC;IAED;;;;;;OAMG;IACH,qCAHW,SAAS,GACP,MAAM,CAgBlB;IAED,4EA4FC;IAED,2CAgCC;IAED,+CA2BC;CACF;wBA7QY,OAAO,0BAA0B,EAAE,SAAS;8BAH3B,4BAA4B"}
|
|
@@ -3,7 +3,7 @@ export class Instrument extends InstrumentBase {
|
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any, auto?: boolean);
|
|
4
4
|
skipNext: number;
|
|
5
5
|
removeOnAbort: AbortController | undefined;
|
|
6
|
-
origOnerror:
|
|
6
|
+
origOnerror: any;
|
|
7
7
|
abortHandler: () => void;
|
|
8
8
|
/**
|
|
9
9
|
* FF and Android browsers do not provide error info to the 'error' event callback,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/instrument/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mEAgDC;IA5CC,iBAAiB;IAGf,2CAA0C;IAyB5C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/instrument/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mEAgDC;IA5CC,iBAAiB;IAGf,2CAA0C;IAyB5C,iBAAsC;IActC,yBAA+B;IAUjC;;;;;;;;;OASG;IACH,wBAPW,MAAM,YACN,MAAM,UACN,MAAM,UACN,MAAM,YACN,KAAK,MAAI,2BAiBnB;;CACF;+BA3F8B,6BAA6B"}
|
|
@@ -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":"AAgBA;IACE,2BAA2C;IAC3C,mDA2BC;IAvBG,iCAAwB;IAyB5B,8BAEC;IAED,gBAyFC;CACF;8BA/H6B,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAqBA;IACE,2BAAiC;IACjC,mDA4GC;IAzGC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAC/B,mBAAe;IAKf,sBAA4B;IAkF5B,4BAGQ;IAeV,8CAUC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAqBC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAqBA;IACE,2BAAiC;IACjC,mDA4GC;IAzGC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAC/B,mBAAe;IAKf,sBAA4B;IAkF5B,4BAGQ;IAeV,8CAUC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAqBC;IAED,qCAKC;IAED,gDAWC;IAGD;;;;kBAWC;IAGD,8BAuBC;CACF;8BA3O6B,4BAA4B;iCARzB,2CAA2C"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Agent } from "./loaders/agent";
|
|
2
2
|
export { BrowserAgent } from "./loaders/browser-agent";
|
|
3
3
|
export { WorkerAgent } from "./loaders/worker-agent";
|
|
4
|
+
export { MicroAgent } from "./loaders/micro-agent";
|
|
4
5
|
export { Ajax } from "./features/ajax";
|
|
5
6
|
export { JSErrors } from "./features/jserrors";
|
|
6
7
|
export { Metrics } from "./features/metrics";
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export class Agent {
|
|
6
6
|
constructor(options: any, agentIdentifier?: string);
|
|
7
|
-
agentIdentifier: string;
|
|
8
|
-
sharedAggregator: Aggregator;
|
|
9
|
-
features: {};
|
|
10
|
-
desiredFeatures: Set<any
|
|
7
|
+
agentIdentifier: string | undefined;
|
|
8
|
+
sharedAggregator: Aggregator | undefined;
|
|
9
|
+
features: {} | undefined;
|
|
10
|
+
desiredFeatures: Set<any> | undefined;
|
|
11
11
|
get config(): {
|
|
12
12
|
info: any;
|
|
13
13
|
init: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH;IACE,oDAqBC;IAbC,oCAAsC;IACtC,yCAAiF;IACjF,yBAAkB;IAElB,sCAAsD;IAWxD;;;;;MAOC;IAED,2BAgCC;CACF;2BA9E0B,gCAAgC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A minimal agent class designed to
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* instrumentations at runtime, and to report desired data, events, and errors programatically.
|
|
2
|
+
* A minimal agent class designed to only respond to manual user input. As such, this class does not
|
|
3
|
+
* automatically instrument. Instead, each MicroAgent instance will lazy load the required features and can support loading multiple instances on one page.
|
|
4
|
+
* Out of the box, it can manually handle and report Page View, Page Action, and Error events.
|
|
6
5
|
*/
|
|
7
6
|
export class MicroAgent {
|
|
8
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;IACE;;;OAGG;IACH,qBAHW,MAAM,oBACN,MAAM,cAUhB;IAPC,wBAAsC;IACtC,6BAAiF;IACjF,aAAkB;IAOpB;;;;;MAOC;IAED,4BA8BC;CACF;2BA1E0B,gCAAgC"}
|