@newrelic/browser-agent 0.1.230 → 1.232.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 +27 -3
- package/dist/cjs/common/browser-version/ios-version.js +4 -3
- package/dist/cjs/common/config/state/configurable.js +27 -21
- package/dist/cjs/common/config/state/info.js +1 -1
- package/dist/cjs/common/config/state/init.js +9 -1
- package/dist/cjs/common/config/state/loader-config.js +1 -1
- package/dist/cjs/common/config/state/runtime.js +26 -28
- package/dist/cjs/common/constants/env.cdn.js +29 -0
- package/dist/cjs/common/constants/env.js +32 -0
- package/dist/cjs/common/constants/env.npm.js +30 -0
- package/dist/cjs/common/context/shared-context.js +2 -1
- package/dist/cjs/common/event-emitter/contextual-ee.test.js +282 -0
- package/dist/cjs/common/event-emitter/handle.test.js +58 -0
- package/dist/cjs/common/event-emitter/register-handler.test.js +55 -0
- package/dist/cjs/common/event-listener/event-listener-opts.js +4 -2
- package/dist/cjs/common/harvest/harvest-scheduler.js +14 -11
- package/dist/cjs/common/harvest/harvest.js +5 -3
- package/dist/cjs/common/ids/id.js +14 -6
- package/dist/cjs/common/ids/id.test.js +85 -0
- package/dist/cjs/common/ids/unique-id.js +75 -51
- package/dist/cjs/common/ids/unique-id.test.js +49 -0
- package/dist/cjs/common/session/constants.js +12 -0
- package/dist/cjs/common/session/session-entity.js +278 -0
- package/dist/cjs/common/session/session-entity.test.js +436 -0
- package/dist/cjs/common/storage/first-party-cookies.js +35 -0
- package/dist/cjs/common/storage/local-memory.js +35 -0
- package/dist/cjs/common/storage/local-memory.test.js +20 -0
- package/dist/cjs/common/storage/local-storage.js +33 -0
- package/dist/cjs/common/storage/local-storage.test.js +14 -0
- package/dist/cjs/common/timer/interaction-timer.js +78 -0
- package/dist/cjs/common/timer/interaction-timer.test.js +216 -0
- package/dist/cjs/common/timer/timer.js +32 -0
- package/dist/cjs/common/timer/timer.test.js +105 -0
- package/dist/cjs/common/timing/nav-timing.js +51 -30
- package/dist/cjs/common/timing/nav-timing.test.js +192 -0
- package/dist/cjs/common/unload/eol.js +2 -2
- package/dist/cjs/common/url/clean-url.test.js +9 -0
- package/dist/cjs/common/url/encode.test.js +74 -0
- package/dist/cjs/common/url/location.js +4 -0
- package/dist/cjs/common/url/location.test.js +13 -0
- package/dist/cjs/common/url/parse-url.test.js +111 -0
- package/dist/cjs/common/url/protocol.js +2 -12
- package/dist/cjs/common/url/protocol.test.js +16 -0
- package/dist/cjs/common/util/console.js +1 -1
- package/dist/cjs/common/util/data-size.js +6 -0
- package/dist/cjs/common/util/data-size.test.js +47 -0
- package/dist/cjs/common/util/invoke.js +73 -0
- package/dist/cjs/common/util/invoke.test.js +49 -0
- package/dist/cjs/common/util/map-own.test.js +3 -3
- package/dist/cjs/common/util/obfuscate.js +1 -5
- package/dist/cjs/common/window/page-visibility.js +5 -2
- package/dist/cjs/common/wrap/index.js +0 -7
- package/dist/cjs/common/wrap/wrap-events.js +6 -9
- package/dist/cjs/common/wrap/wrap-fetch.js +6 -6
- package/dist/cjs/common/wrap/wrap-history.js +7 -6
- package/dist/cjs/common/wrap/wrap-jsonp.js +7 -6
- package/dist/cjs/common/wrap/wrap-mutation.js +7 -6
- package/dist/cjs/common/wrap/wrap-promise.js +7 -6
- package/dist/cjs/common/wrap/wrap-promise.test.js +119 -0
- package/dist/cjs/common/wrap/wrap-raf.js +6 -6
- package/dist/cjs/common/wrap/wrap-timer.js +7 -7
- package/dist/cjs/common/wrap/wrap-xhr.js +5 -6
- package/dist/cjs/features/ajax/aggregate/index.js +3 -3
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.test.js +5 -5
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.test.js +1 -1
- package/dist/cjs/features/jserrors/aggregate/index.js +6 -6
- package/dist/cjs/features/jserrors/instrument/index.js +2 -2
- package/dist/cjs/features/metrics/aggregate/index.js +19 -9
- package/dist/cjs/features/metrics/instrument/index.js +0 -25
- package/dist/cjs/features/metrics/instrument/workers-helper.js +5 -5
- package/dist/cjs/features/page_action/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_event/aggregate/index.js +23 -9
- package/dist/cjs/features/page_view_timing/aggregate/index.js +40 -30
- package/dist/cjs/features/session_trace/aggregate/index.js +18 -15
- package/dist/cjs/features/spa/aggregate/index.js +6 -5
- package/dist/cjs/features/utils/agent-session.js +73 -0
- package/dist/cjs/features/utils/feature-base.js +1 -1
- package/dist/cjs/features/utils/instrument-base.js +12 -3
- package/dist/cjs/features/utils/lazy-loader.js +2 -2
- package/dist/cjs/loaders/agent.js +2 -2
- package/dist/cjs/loaders/api/api.js +9 -9
- package/dist/cjs/loaders/api/apiAsync.js +3 -2
- package/dist/cjs/loaders/configure/configure.js +0 -6
- package/dist/cjs/loaders/features/enabled-features.js +1 -1
- package/dist/cjs/loaders/micro-agent.js +2 -1
- package/dist/esm/common/browser-version/ios-version.js +4 -3
- package/dist/esm/common/config/state/configurable.js +26 -20
- package/dist/esm/common/config/state/info.js +1 -1
- package/dist/esm/common/config/state/init.js +9 -1
- package/dist/esm/common/config/state/loader-config.js +1 -1
- package/dist/esm/common/config/state/runtime.js +26 -28
- package/dist/esm/common/constants/env.cdn.js +20 -0
- package/dist/esm/common/constants/env.js +23 -0
- package/dist/esm/common/constants/env.npm.js +21 -0
- package/dist/esm/common/context/shared-context.js +2 -1
- package/dist/esm/common/event-emitter/contextual-ee.test.js +278 -0
- package/dist/esm/common/event-emitter/handle.test.js +54 -0
- package/dist/esm/common/event-emitter/register-handler.test.js +51 -0
- package/dist/esm/common/event-listener/event-listener-opts.js +4 -2
- package/dist/esm/common/harvest/harvest-scheduler.js +14 -11
- package/dist/esm/common/harvest/harvest.js +4 -2
- package/dist/esm/common/ids/id.js +16 -6
- package/dist/esm/common/ids/id.test.js +81 -0
- package/dist/esm/common/ids/unique-id.js +75 -51
- package/dist/esm/common/ids/unique-id.test.js +44 -0
- package/dist/esm/common/session/constants.js +3 -0
- package/dist/esm/common/session/session-entity.js +271 -0
- package/dist/esm/common/session/session-entity.test.js +434 -0
- package/dist/esm/common/storage/first-party-cookies.js +28 -0
- package/dist/esm/common/storage/local-memory.js +28 -0
- package/dist/esm/common/storage/local-memory.test.js +18 -0
- package/dist/esm/common/storage/local-storage.js +26 -0
- package/dist/esm/common/storage/local-storage.test.js +12 -0
- package/dist/esm/common/timer/interaction-timer.js +71 -0
- package/dist/esm/common/timer/interaction-timer.test.js +214 -0
- package/dist/esm/common/timer/timer.js +25 -0
- package/dist/esm/common/timer/timer.test.js +103 -0
- package/dist/esm/common/timing/nav-timing.js +51 -29
- package/dist/esm/common/timing/nav-timing.test.js +190 -0
- package/dist/esm/common/unload/eol.js +1 -1
- package/dist/esm/common/url/clean-url.test.js +7 -0
- package/dist/esm/common/url/encode.test.js +70 -0
- package/dist/esm/common/url/location.js +4 -0
- package/dist/esm/common/url/location.test.js +11 -0
- package/dist/esm/common/url/parse-url.test.js +107 -0
- package/dist/esm/common/url/protocol.js +3 -12
- package/dist/esm/common/url/protocol.test.js +14 -0
- package/dist/esm/common/util/console.js +1 -1
- package/dist/esm/common/util/data-size.js +7 -0
- package/dist/esm/common/util/data-size.test.js +45 -0
- package/dist/esm/common/util/invoke.js +66 -0
- package/dist/esm/common/util/invoke.test.js +47 -0
- package/dist/esm/common/util/map-own.test.js +3 -3
- package/dist/esm/common/util/obfuscate.js +2 -6
- package/dist/esm/common/window/page-visibility.js +5 -2
- package/dist/esm/common/wrap/index.js +1 -2
- package/dist/esm/common/wrap/wrap-events.js +6 -9
- package/dist/esm/common/wrap/wrap-fetch.js +6 -6
- package/dist/esm/common/wrap/wrap-history.js +7 -6
- package/dist/esm/common/wrap/wrap-jsonp.js +7 -6
- package/dist/esm/common/wrap/wrap-mutation.js +7 -6
- package/dist/esm/common/wrap/wrap-promise.js +7 -6
- package/dist/esm/common/wrap/wrap-promise.test.js +115 -0
- package/dist/esm/common/wrap/wrap-raf.js +6 -6
- package/dist/esm/common/wrap/wrap-timer.js +7 -7
- package/dist/esm/common/wrap/wrap-xhr.js +5 -6
- package/dist/esm/features/ajax/aggregate/index.js +3 -3
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.test.js +5 -5
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.test.js +1 -1
- package/dist/esm/features/jserrors/aggregate/index.js +6 -6
- package/dist/esm/features/jserrors/instrument/index.js +2 -2
- package/dist/esm/features/metrics/aggregate/index.js +21 -11
- package/dist/esm/features/metrics/instrument/index.js +0 -25
- package/dist/esm/features/metrics/instrument/workers-helper.js +5 -5
- package/dist/esm/features/page_action/aggregate/index.js +3 -3
- package/dist/esm/features/page_view_event/aggregate/index.js +23 -9
- package/dist/esm/features/page_view_timing/aggregate/index.js +40 -30
- package/dist/esm/features/session_trace/aggregate/index.js +18 -15
- package/dist/esm/features/spa/aggregate/index.js +6 -5
- package/dist/esm/features/utils/agent-session.js +67 -0
- package/dist/esm/features/utils/feature-base.js +1 -1
- package/dist/esm/features/utils/instrument-base.js +7 -2
- package/dist/esm/features/utils/lazy-loader.js +2 -2
- package/dist/esm/loaders/agent.js +2 -2
- package/dist/esm/loaders/api/api.js +6 -9
- package/dist/esm/loaders/api/apiAsync.js +2 -1
- package/dist/esm/loaders/configure/configure.js +2 -8
- package/dist/esm/loaders/features/enabled-features.js +1 -1
- package/dist/types/common/config/state/configurable.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/config/state/runtime.d.ts.map +1 -1
- package/dist/types/common/constants/env.cdn.d.ts +18 -0
- package/dist/types/common/constants/env.cdn.d.ts.map +1 -0
- package/dist/types/common/constants/env.d.ts +13 -0
- package/dist/types/common/constants/env.d.ts.map +1 -0
- package/dist/types/common/constants/env.npm.d.ts +19 -0
- package/dist/types/common/constants/env.npm.d.ts.map +1 -0
- package/dist/types/common/context/shared-context.d.ts.map +1 -1
- package/dist/types/common/event-listener/event-listener-opts.d.ts +2 -2
- package/dist/types/common/event-listener/event-listener-opts.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts +1 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/ids/id.d.ts +11 -1
- package/dist/types/common/ids/id.d.ts.map +1 -1
- package/dist/types/common/ids/unique-id.d.ts +24 -1
- package/dist/types/common/ids/unique-id.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts +4 -0
- package/dist/types/common/session/constants.d.ts.map +1 -0
- package/dist/types/common/session/session-entity.d.ts +72 -0
- package/dist/types/common/session/session-entity.d.ts.map +1 -0
- package/dist/types/common/storage/first-party-cookies.d.ts +8 -0
- package/dist/types/common/storage/first-party-cookies.d.ts.map +1 -0
- package/dist/types/common/storage/local-memory.d.ts +8 -0
- package/dist/types/common/storage/local-memory.d.ts.map +1 -0
- package/dist/types/common/storage/local-storage.d.ts +6 -0
- package/dist/types/common/storage/local-storage.d.ts.map +1 -0
- package/dist/types/common/timer/interaction-timer.d.ts +11 -0
- package/dist/types/common/timer/interaction-timer.d.ts.map +1 -0
- package/dist/types/common/timer/timer.d.ts +12 -0
- package/dist/types/common/timer/timer.d.ts.map +1 -0
- package/dist/types/common/timing/nav-timing.d.ts +1 -2
- package/dist/types/common/timing/nav-timing.d.ts.map +1 -1
- package/dist/types/common/unload/eol.d.ts.map +1 -1
- package/dist/types/common/url/location.d.ts +4 -0
- package/dist/types/common/url/location.d.ts.map +1 -1
- package/dist/types/common/url/parse-url.d.ts.map +1 -1
- package/dist/types/common/url/protocol.d.ts +1 -6
- package/dist/types/common/url/protocol.d.ts.map +1 -1
- package/dist/types/common/util/data-size.d.ts +7 -1
- package/dist/types/common/util/data-size.d.ts.map +1 -1
- package/dist/types/common/util/global-scope.d.ts.map +1 -1
- package/dist/types/common/util/invoke.d.ts +35 -0
- package/dist/types/common/util/invoke.d.ts.map +1 -0
- package/dist/types/common/util/obfuscate.d.ts.map +1 -1
- package/dist/types/common/window/page-visibility.d.ts +1 -1
- package/dist/types/common/window/page-visibility.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-history.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-jsonp.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-mutation.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-raf.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-timer.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-xhr.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +2 -2
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +2 -2
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts +2 -2
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/instrument/index.d.ts +0 -1
- package/dist/types/features/metrics/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/instrument/workers-helper.d.ts.map +1 -1
- package/dist/types/features/page_action/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts +2 -2
- 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 +3 -4
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/index.d.ts +3 -3
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts +2 -2
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/instrument/index.d.ts.map +1 -1
- package/dist/types/features/utils/agent-session.d.ts +2 -0
- package/dist/types/features/utils/agent-session.d.ts.map +1 -0
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/features/utils/lazy-loader.d.ts +2 -2
- package/dist/types/features/utils/lazy-loader.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/api/apiAsync.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/package.json +12 -32
- package/src/common/browser-version/ios-version.js +4 -3
- package/src/common/config/state/configurable.js +26 -19
- package/src/common/config/state/init.js +7 -0
- package/src/common/config/state/runtime.js +7 -10
- package/src/common/constants/env.cdn.js +20 -0
- package/src/common/constants/env.js +23 -0
- package/src/common/constants/env.npm.js +21 -0
- package/src/common/context/shared-context.js +2 -1
- package/src/common/event-emitter/contextual-ee.test.js +310 -0
- package/src/common/event-emitter/handle.test.js +56 -0
- package/src/common/event-emitter/register-handler.test.js +61 -0
- package/src/common/event-listener/event-listener-opts.js +4 -4
- package/src/common/harvest/harvest-scheduler.js +12 -8
- package/src/common/harvest/harvest.js +5 -3
- package/src/common/ids/id.js +15 -6
- package/src/common/ids/id.test.js +92 -0
- package/src/common/ids/unique-id.js +77 -54
- package/src/common/ids/unique-id.test.js +58 -0
- package/src/common/session/constants.js +3 -0
- package/src/common/session/session-entity.js +271 -0
- package/src/common/session/session-entity.test.js +317 -0
- package/src/common/storage/first-party-cookies.js +31 -0
- package/src/common/storage/local-memory.js +30 -0
- package/src/common/storage/local-memory.test.js +19 -0
- package/src/common/storage/local-storage.js +28 -0
- package/src/common/storage/local-storage.test.js +17 -0
- package/src/common/timer/interaction-timer.js +75 -0
- package/src/common/timer/interaction-timer.test.js +167 -0
- package/src/common/timer/timer.js +31 -0
- package/src/common/timer/timer.test.js +100 -0
- package/src/common/timing/nav-timing.js +50 -30
- package/src/common/timing/nav-timing.test.js +161 -0
- package/src/common/unload/eol.js +2 -3
- package/src/common/url/clean-url.test.js +25 -0
- package/src/common/url/encode.test.js +80 -0
- package/src/common/url/location.js +4 -0
- package/src/common/url/location.test.js +15 -0
- package/src/common/url/parse-url.js +1 -2
- package/src/common/url/parse-url.test.js +110 -0
- package/src/common/url/protocol.js +3 -13
- package/src/common/url/protocol.test.js +18 -0
- package/src/common/util/data-size.js +6 -0
- package/src/common/util/data-size.test.js +50 -0
- package/src/common/util/global-scope.js +1 -2
- package/src/common/util/invoke.js +55 -0
- package/src/common/util/invoke.test.js +65 -0
- package/src/common/util/obfuscate.js +2 -6
- package/src/common/window/page-visibility.js +3 -3
- package/src/common/wrap/index.js +1 -2
- package/src/common/wrap/wrap-events.js +5 -5
- package/src/common/wrap/wrap-fetch.js +4 -3
- package/src/common/wrap/wrap-history.js +6 -3
- package/src/common/wrap/wrap-jsonp.js +5 -3
- package/src/common/wrap/wrap-mutation.js +6 -3
- package/src/common/wrap/wrap-promise.js +7 -6
- package/src/common/wrap/wrap-promise.test.js +140 -0
- package/src/common/wrap/wrap-raf.js +5 -3
- package/src/common/wrap/wrap-timer.js +6 -4
- package/src/common/wrap/wrap-xhr.js +4 -3
- package/src/features/ajax/aggregate/index.js +2 -2
- package/src/features/ajax/instrument/index.js +1 -1
- package/src/features/jserrors/aggregate/index.js +3 -3
- package/src/features/jserrors/instrument/index.js +4 -2
- package/src/features/metrics/aggregate/index.js +21 -7
- package/src/features/metrics/instrument/index.js +0 -30
- package/src/features/metrics/instrument/workers-helper.js +9 -6
- package/src/features/page_action/aggregate/index.js +2 -2
- package/src/features/page_view_event/aggregate/index.js +21 -9
- package/src/features/page_view_timing/aggregate/index.js +40 -29
- package/src/features/page_view_timing/long-tasks.js +10 -10
- package/src/features/session_trace/aggregate/index.js +17 -14
- package/src/features/session_trace/instrument/index.js +3 -2
- package/src/features/spa/aggregate/index.js +5 -5
- package/src/features/spa/instrument/index.js +4 -2
- package/src/features/utils/agent-session.js +68 -0
- package/src/features/utils/feature-base.js +1 -1
- package/src/features/utils/instrument-base.js +5 -2
- package/src/features/utils/lazy-loader.js +1 -1
- package/src/loaders/agent.js +1 -1
- package/src/loaders/api/api.js +3 -6
- package/src/loaders/api/apiAsync.js +2 -1
- package/src/loaders/configure/configure.js +2 -7
- package/dist/cjs/common/constants/environment-variables.js +0 -20
- package/dist/cjs/common/util/single.js +0 -23
- package/dist/cjs/common/window/session-storage.js +0 -87
- package/dist/cjs/common/wrap/wrap-console.js +0 -54
- package/dist/cjs/features/utils/aggregate-base.js +0 -13
- package/dist/esm/common/constants/environment-variables.js +0 -11
- package/dist/esm/common/util/single.js +0 -16
- package/dist/esm/common/window/session-storage.js +0 -77
- package/dist/esm/common/wrap/wrap-console.js +0 -46
- package/dist/esm/features/utils/aggregate-base.js +0 -6
- package/dist/types/common/constants/environment-variables.d.ts +0 -4
- package/dist/types/common/constants/environment-variables.d.ts.map +0 -1
- package/dist/types/common/util/single.d.ts +0 -2
- package/dist/types/common/util/single.d.ts.map +0 -1
- package/dist/types/common/window/session-storage.d.ts +0 -18
- package/dist/types/common/window/session-storage.d.ts.map +0 -1
- package/dist/types/common/wrap/wrap-console.d.ts +0 -16
- package/dist/types/common/wrap/wrap-console.d.ts.map +0 -1
- package/dist/types/features/utils/aggregate-base.d.ts +0 -4
- package/dist/types/features/utils/aggregate-base.d.ts.map +0 -1
- package/src/common/constants/environment-variables.js +0 -11
- package/src/common/util/single.js +0 -18
- package/src/common/window/session-storage.js +0 -75
- package/src/common/wrap/wrap-console.js +0 -47
- package/src/features/utils/aggregate-base.js +0 -7
|
@@ -16,7 +16,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
* should be.
|
|
17
17
|
* @param featureName Name of the feature to import such as ajax or session_trace
|
|
18
18
|
* @param featurePart Name of the feature part to load; should be either instrument or aggregate
|
|
19
|
-
* @returns {Promise<InstrumentBase|
|
|
19
|
+
* @returns {Promise<InstrumentBase|FeatureBase|null>}
|
|
20
20
|
*/
|
|
21
21
|
function lazyLoader(featureName, featurePart) {
|
|
22
22
|
if (featurePart === 'aggregate') {
|
|
@@ -38,7 +38,7 @@ function lazyLoader(featureName, featurePart) {
|
|
|
38
38
|
case _features.FEATURE_NAMES.spa:
|
|
39
39
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "spa-aggregate" */'../spa/aggregate')));
|
|
40
40
|
default:
|
|
41
|
-
throw new Error(
|
|
41
|
+
throw new Error("Attempted to load unsupported agent feature: ".concat(featureName, " ").concat(featurePart));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -62,7 +62,7 @@ class Agent {
|
|
|
62
62
|
if (enabledFeatures[f.featureName] || f.featureName === _features.FEATURE_NAMES.pageViewEvent) {
|
|
63
63
|
const dependencies = (0, _featureDependencies.getFeatureDependencyNames)(f.featureName);
|
|
64
64
|
const hasAllDeps = dependencies.every(x => enabledFeatures[x]);
|
|
65
|
-
if (!hasAllDeps) (0, _console.warn)(
|
|
65
|
+
if (!hasAllDeps) (0, _console.warn)("".concat(f.featureName, " is enabled but one or more dependent features has been disabled (").concat((0, _stringify.stringify)(dependencies), "). This may cause unintended consequences or missing data..."));
|
|
66
66
|
this.features[f.featureName] = new f(this.agentIdentifier, this.sharedAggregator);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -74,7 +74,7 @@ class Agent {
|
|
|
74
74
|
this.features[featName].abortHandler?.();
|
|
75
75
|
}
|
|
76
76
|
const newrelic = (0, _nreum.gosNREUM)();
|
|
77
|
-
delete newrelic.initializedAgents[this.agentIdentifier]?.
|
|
77
|
+
delete newrelic.initializedAgents[this.agentIdentifier]?.api; // prevent further calls to agent-specific APIs (see "configure.js")
|
|
78
78
|
delete newrelic.initializedAgents[this.agentIdentifier]?.[NR_FEATURES_REF_NAME]; // GC mem used internally by features
|
|
79
79
|
delete this.sharedAggregator;
|
|
80
80
|
// Keep the initialized agent object with its configs for troubleshooting purposes.
|
|
@@ -17,9 +17,11 @@ var _globalScope = require("../../common/util/global-scope");
|
|
|
17
17
|
var _console = require("../../common/util/console");
|
|
18
18
|
var _constants = require("../../features/metrics/constants");
|
|
19
19
|
var _nreum = require("../../common/window/nreum");
|
|
20
|
-
var _sessionStorage = require("../../common/window/session-storage");
|
|
21
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /*
|
|
22
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
23
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
24
|
+
*/
|
|
23
25
|
const CUSTOM_ATTR_GROUP = 'CUSTOM/'; // the subgroup items should be stored under in storage API
|
|
24
26
|
exports.CUSTOM_ATTR_GROUP = CUSTOM_ATTR_GROUP;
|
|
25
27
|
function setTopLevelCallers() {
|
|
@@ -43,7 +45,7 @@ function setTopLevelCallers() {
|
|
|
43
45
|
returnVals.push(val.api[fnName](...args));
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
|
-
return returnVals.length > 1 ?
|
|
48
|
+
return returnVals.length > 1 ? returnVals : returnVals[0];
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
function setAPI(agentIdentifier, forceDrain) {
|
|
@@ -78,7 +80,6 @@ function setAPI(agentIdentifier, forceDrain) {
|
|
|
78
80
|
const currentInfo = (0, _config.getInfo)(agentIdentifier);
|
|
79
81
|
if (value === null) {
|
|
80
82
|
delete currentInfo.jsAttributes[key];
|
|
81
|
-
if (_globalScope.isBrowserScope) (0, _sessionStorage.removeFromBrowserStorage)(key, CUSTOM_ATTR_GROUP); // addToBrowserStorage flag isn't needed to unset keys from storage
|
|
82
83
|
} else {
|
|
83
84
|
(0, _config.setInfo)(agentIdentifier, {
|
|
84
85
|
...currentInfo,
|
|
@@ -87,18 +88,17 @@ function setAPI(agentIdentifier, forceDrain) {
|
|
|
87
88
|
[key]: value
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
|
-
if (_globalScope.isBrowserScope && addToBrowserStorage) (0, _sessionStorage.putInBrowserStorage)(key, value, CUSTOM_ATTR_GROUP);
|
|
91
91
|
}
|
|
92
|
-
return apiCall(prefix, apiName, true)();
|
|
92
|
+
return apiCall(prefix, apiName, true, !!addToBrowserStorage || value === null ? 'session' : undefined)(key, value);
|
|
93
93
|
}
|
|
94
94
|
apiInterface.setCustomAttribute = function (name, value) {
|
|
95
95
|
let persistAttribute = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
96
96
|
if (typeof name !== 'string') {
|
|
97
|
-
(0, _console.warn)(
|
|
97
|
+
(0, _console.warn)("Failed to execute setCustomAttribute.\nName must be a string type, but a type of <".concat(typeof name, "> was provided."));
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
if (!(['string', 'number'].includes(typeof value) || value === null)) {
|
|
101
|
-
(0, _console.warn)(
|
|
101
|
+
(0, _console.warn)("Failed to execute setCustomAttribute.\nNon-null value must be a string or number type, but a type of <".concat(typeof value, "> was provided."));
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
return appendJsAttribute(name, value, 'setCustomAttribute', persistAttribute);
|
|
@@ -110,7 +110,7 @@ function setAPI(agentIdentifier, forceDrain) {
|
|
|
110
110
|
*/
|
|
111
111
|
apiInterface.setUserId = function (value) {
|
|
112
112
|
if (!(typeof value === 'string' || value === null)) {
|
|
113
|
-
(0, _console.warn)(
|
|
113
|
+
(0, _console.warn)("Failed to execute setUserId.\nNon-null value must be a string type, but a type of <".concat(typeof value, "> was provided."));
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
return appendJsAttribute('enduser.id', value, 'setUserId', true);
|
|
@@ -9,7 +9,7 @@ var _config = require("../../common/config/config");
|
|
|
9
9
|
var _contextualEe = require("../../common/event-emitter/contextual-ee");
|
|
10
10
|
var _handle = require("../../common/event-emitter/handle");
|
|
11
11
|
var _registerHandler = require("../../common/event-emitter/register-handler");
|
|
12
|
-
var
|
|
12
|
+
var _invoke = require("../../common/util/invoke");
|
|
13
13
|
var _submitData = require("../../common/util/submit-data");
|
|
14
14
|
var _globalScope = require("../../common/util/global-scope");
|
|
15
15
|
var _constants = require("../../features/metrics/constants");
|
|
@@ -18,7 +18,7 @@ function setAPI(agentIdentifier) {
|
|
|
18
18
|
var cycle = 0;
|
|
19
19
|
var scheme = (0, _config.getConfigurationValue)(agentIdentifier, 'ssl') === false ? 'http' : 'https';
|
|
20
20
|
var api = {
|
|
21
|
-
finished: (0,
|
|
21
|
+
finished: (0, _invoke.single)(finished),
|
|
22
22
|
setErrorHandler: setErrorHandler,
|
|
23
23
|
addToTrace: addToTrace,
|
|
24
24
|
inlineHit: inlineHit,
|
|
@@ -71,6 +71,7 @@ function setAPI(agentIdentifier) {
|
|
|
71
71
|
request_name = window.encodeURIComponent(request_name);
|
|
72
72
|
cycle += 1;
|
|
73
73
|
const agentInfo = (0, _config.getInfo)(agentIdentifier);
|
|
74
|
+
const agentRuntime = (0, _config.getRuntime)(agentIdentifier);
|
|
74
75
|
if (!agentInfo.beacon) return;
|
|
75
76
|
var url = scheme + '://' + agentInfo.beacon + '/1/' + agentInfo.licenseKey;
|
|
76
77
|
url += '?a=' + agentInfo.applicationID + '&';
|
|
@@ -9,7 +9,6 @@ var _nreum = require("../../common/window/nreum");
|
|
|
9
9
|
var _config = require("../../common/config/config");
|
|
10
10
|
var _featureFlags = require("../../common/util/feature-flags");
|
|
11
11
|
var _globalScope = require("../../common/util/global-scope");
|
|
12
|
-
var _sessionStorage = require("../../common/window/session-storage");
|
|
13
12
|
function configure(agentIdentifier) {
|
|
14
13
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15
14
|
let loaderType = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -34,11 +33,6 @@ function configure(agentIdentifier) {
|
|
|
34
33
|
// add a default attr to all worker payloads
|
|
35
34
|
info.jsAttributes.isWorker = true;
|
|
36
35
|
}
|
|
37
|
-
if (_globalScope.isBrowserScope) {
|
|
38
|
-
// retrieve & re-add all of the persisted setCustomAttribute|setUserId k-v from previous page load(s)
|
|
39
|
-
let prevPageSessionJsAttrs = (0, _sessionStorage.getAllStorageItemsOfGroup)(_api.CUSTOM_ATTR_GROUP);
|
|
40
|
-
Object.assign(info.jsAttributes, prevPageSessionJsAttrs);
|
|
41
|
-
}
|
|
42
36
|
(0, _config.setInfo)(agentIdentifier, info);
|
|
43
37
|
(0, _config.setConfiguration)(agentIdentifier, init || {});
|
|
44
38
|
(0, _config.setLoaderConfig)(agentIdentifier, loader_config || {});
|
|
@@ -8,7 +8,7 @@ var _features = require("./features");
|
|
|
8
8
|
var _config = require("../../common/config/config");
|
|
9
9
|
const featureNames = Object.values(_features.FEATURE_NAMES);
|
|
10
10
|
function isEnabled(name, agentIdentifier) {
|
|
11
|
-
return (0, _config.getConfigurationValue)(agentIdentifier,
|
|
11
|
+
return (0, _config.getConfigurationValue)(agentIdentifier, "".concat(name, ".enabled")) !== false;
|
|
12
12
|
}
|
|
13
13
|
function getEnabledFeatures(agentIdentifier) {
|
|
14
14
|
const enabledFeatures = {};
|
|
@@ -13,7 +13,8 @@ var _config = require("../common/config/config");
|
|
|
13
13
|
var _features = require("./features/features");
|
|
14
14
|
var _console = require("../common/util/console");
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } // loader files
|
|
17
|
+
// core files
|
|
17
18
|
const nonAutoFeatures = [_features.FEATURE_NAMES.jserrors, _features.FEATURE_NAMES.pageAction];
|
|
18
19
|
const autoFeatures = [_features.FEATURE_NAMES.metrics];
|
|
19
20
|
|
|
@@ -4,7 +4,8 @@ export const isiOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent);
|
|
|
4
4
|
|
|
5
5
|
// Shared Web Workers introduced in iOS 16.0+ and n/a in 15.6-
|
|
6
6
|
export const iOS_below16 = isiOS && Boolean(typeof SharedWorker === 'undefined');
|
|
7
|
-
/*
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/*
|
|
8
|
+
^ It was discovered in Safari 14 (https://bugs.webkit.org/show_bug.cgi?id=225305) that the buffered flag in PerformanceObserver
|
|
9
|
+
did not work. This affects our onFCP metric in particular since web-vitals uses that flag to retrieve paint timing entries.
|
|
10
|
+
This was fixed in v16+.
|
|
10
11
|
*/
|
|
@@ -2,25 +2,31 @@ import { getFrozenAttributes } from '../../../loaders/features/featureDependenci
|
|
|
2
2
|
import { warn } from '../../util/console';
|
|
3
3
|
export class Configurable {
|
|
4
4
|
constructor(obj, model) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
Object.assign(this, setValues(obj, model));
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function setValues(obj, model) {
|
|
9
|
+
const state = {};
|
|
10
|
+
try {
|
|
11
|
+
if (!obj || typeof obj !== 'object') return warn('New setting a Configurable requires an object as input');
|
|
12
|
+
if (!model || typeof model !== 'object') return warn('Setting a Configurable requires a model to set its initial properties');
|
|
13
|
+
Object.assign(state, model);
|
|
14
|
+
Object.entries(obj).forEach(_ref => {
|
|
15
|
+
let [key, value] = _ref;
|
|
16
|
+
if (!Object.keys(model).includes(key)) return;
|
|
17
|
+
const frozenAttrs = getFrozenAttributes(key);
|
|
18
|
+
if (frozenAttrs.length && value && typeof value === 'object') {
|
|
19
|
+
frozenAttrs.forEach(attr => {
|
|
20
|
+
if (attr in value) {
|
|
21
|
+
warn("\"".concat(attr, "\" is a protected attribute and can not be changed in feature ").concat(key, ". It will have no effect."));
|
|
22
|
+
delete value[attr];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
state[key] = value;
|
|
27
|
+
});
|
|
28
|
+
return state;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
warn('An error occured while setting a Configurable', err);
|
|
25
31
|
}
|
|
26
32
|
}
|
|
@@ -32,7 +32,7 @@ export function isValid(id) {
|
|
|
32
32
|
}
|
|
33
33
|
export function getInfo(id) {
|
|
34
34
|
if (!id) throw new Error('All info objects require an agent identifier!');
|
|
35
|
-
if (!_cache[id]) throw new Error(
|
|
35
|
+
if (!_cache[id]) throw new Error("Info for ".concat(id, " was never set"));
|
|
36
36
|
return _cache[id];
|
|
37
37
|
}
|
|
38
38
|
export function setInfo(id, obj) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DEFAULT_EXPIRES_MS, DEFAULT_INACTIVE_MS } from '../../session/constants';
|
|
2
|
+
import { globalScope } from '../../util/global-scope';
|
|
1
3
|
import { gosNREUMInitializedAgents } from '../../window/nreum';
|
|
2
4
|
import { Configurable } from './configurable';
|
|
3
5
|
const model = {
|
|
@@ -19,6 +21,12 @@ const model = {
|
|
|
19
21
|
cors_use_tracecontext_headers: undefined,
|
|
20
22
|
allowed_origins: undefined
|
|
21
23
|
},
|
|
24
|
+
session: {
|
|
25
|
+
domain: undefined,
|
|
26
|
+
// used by first party cookies to set the top-level domain
|
|
27
|
+
expiresMs: DEFAULT_EXPIRES_MS,
|
|
28
|
+
inactiveMs: DEFAULT_INACTIVE_MS
|
|
29
|
+
},
|
|
22
30
|
ssl: undefined,
|
|
23
31
|
obfuscate: undefined,
|
|
24
32
|
jserrors: {
|
|
@@ -52,7 +60,7 @@ const model = {
|
|
|
52
60
|
const _cache = {};
|
|
53
61
|
export function getConfiguration(id) {
|
|
54
62
|
if (!id) throw new Error('All configuration objects require an agent identifier!');
|
|
55
|
-
if (!_cache[id]) throw new Error(
|
|
63
|
+
if (!_cache[id]) throw new Error("Configuration for ".concat(id, " was never set"));
|
|
56
64
|
return _cache[id];
|
|
57
65
|
}
|
|
58
66
|
export function setConfiguration(id, obj) {
|
|
@@ -11,7 +11,7 @@ const model = {
|
|
|
11
11
|
const _cache = {};
|
|
12
12
|
export function getLoaderConfig(id) {
|
|
13
13
|
if (!id) throw new Error('All loader-config objects require an agent identifier!');
|
|
14
|
-
if (!_cache[id]) throw new Error(
|
|
14
|
+
if (!_cache[id]) throw new Error("LoaderConfig for ".concat(id, " was never set"));
|
|
15
15
|
return _cache[id];
|
|
16
16
|
}
|
|
17
17
|
export function setLoaderConfig(id, obj) {
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import * as userAgent from '../../util/user-agent';
|
|
2
2
|
import { Configurable } from './configurable';
|
|
3
3
|
import { gosNREUMInitializedAgents } from '../../window/nreum';
|
|
4
|
-
import { getCurrentSessionIdOrMakeNew } from '../../window/session-storage';
|
|
5
|
-
import { getConfigurationValue } from '../config';
|
|
6
4
|
import { globalScope } from '../../util/global-scope';
|
|
7
|
-
import { BUILD_ENV, DIST_METHOD, VERSION } from
|
|
8
|
-
const model =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
import { BUILD_ENV, DIST_METHOD, VERSION } from "../../constants/env.npm";
|
|
6
|
+
const model = {
|
|
7
|
+
buildEnv: BUILD_ENV,
|
|
8
|
+
bytesSent: {},
|
|
9
|
+
// Used for SM to capture body bytes sent per endpoint
|
|
10
|
+
queryBytesSent: {},
|
|
11
|
+
// Used for SM to capture query parameter bytes sent per endpoint
|
|
12
|
+
customTransaction: undefined,
|
|
13
|
+
disabled: false,
|
|
14
|
+
distMethod: DIST_METHOD,
|
|
15
|
+
isolatedBacklog: false,
|
|
16
|
+
loaderType: undefined,
|
|
17
|
+
maxBytes: 30000,
|
|
18
|
+
// The "timeOrigin" property is the new standard timestamp property shared across main frame and workers, but is not supported in some early Safari browsers (safari<15) + IE
|
|
19
|
+
// ingest expects an integer value, and timeOrigin can return a float.
|
|
20
|
+
offset: Math.floor(globalScope?.performance?.timeOrigin || globalScope?.performance?.timing?.navigationStart || Date.now()),
|
|
21
|
+
onerror: undefined,
|
|
22
|
+
origin: '' + globalScope.location,
|
|
23
|
+
ptid: undefined,
|
|
24
|
+
releaseIds: {},
|
|
25
|
+
session: undefined,
|
|
26
|
+
xhrWrappable: typeof globalScope.XMLHttpRequest?.prototype?.addEventListener === 'function',
|
|
27
|
+
userAgent,
|
|
28
|
+
version: VERSION
|
|
31
29
|
};
|
|
32
30
|
const _cache = {};
|
|
33
31
|
export function getRuntime(id) {
|
|
34
32
|
if (!id) throw new Error('All runtime objects require an agent identifier!');
|
|
35
|
-
if (!_cache[id]) throw new Error(
|
|
33
|
+
if (!_cache[id]) throw new Error("Runtime for ".concat(id, " was never set"));
|
|
36
34
|
return _cache[id];
|
|
37
35
|
}
|
|
38
36
|
export function setRuntime(id, obj) {
|
|
39
37
|
if (!id) throw new Error('All runtime objects require an agent identifier!');
|
|
40
|
-
_cache[id] = new Configurable(obj, model
|
|
38
|
+
_cache[id] = new Configurable(obj, model);
|
|
41
39
|
gosNREUMInitializedAgents(id, _cache[id], 'runtime');
|
|
42
40
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This file exposes CDN build environment variables. These variables will
|
|
3
|
+
* be overridden with babel.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Exposes the version of the agent
|
|
8
|
+
*/
|
|
9
|
+
export const VERSION = "1.232.0";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Exposes the build type of the agent
|
|
13
|
+
* Valid values are LOCAL, PROD, DEV
|
|
14
|
+
*/
|
|
15
|
+
export const BUILD_ENV = undefined;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Exposes the distribution method of the agent
|
|
19
|
+
*/
|
|
20
|
+
export const DIST_METHOD = 'CDN';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This file exposes build time environment variables that will be included in the
|
|
3
|
+
* build output of the agent. This file specifically contains the normal environment variables
|
|
4
|
+
* for the NPM agent build and will be overridden by webpack/babel during the build based on the
|
|
5
|
+
* type of build being performed.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import pkgJSON from '../../../package.json';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Exposes the version of the agent
|
|
12
|
+
*/
|
|
13
|
+
export const VERSION = pkgJSON.version;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Exposes the build type of the agent
|
|
17
|
+
*/
|
|
18
|
+
export const BUILD_ENV = 'NPM';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Exposes the distribution method of the agent
|
|
22
|
+
*/
|
|
23
|
+
export const DIST_METHOD = 'NPM';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This file exposes NPM build environment variables. These variables will
|
|
3
|
+
* be overridden with babel.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Exposes the version of the agent
|
|
8
|
+
*/
|
|
9
|
+
export const VERSION = "1.232.0";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Exposes the build type of the agent
|
|
13
|
+
* Valid values are LOCAL, PROD, DEV
|
|
14
|
+
*/
|
|
15
|
+
export const BUILD_ENV = 'NPM';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Exposes the distribution method of the agent
|
|
19
|
+
* Valid valuse are CDN, NPM
|
|
20
|
+
*/
|
|
21
|
+
export const DIST_METHOD = 'NPM';
|