@newrelic/browser-agent 0.0.9 → 0.1.230
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 +113 -197
- package/dist/cjs/cdn/lite.js +14 -0
- package/dist/cjs/cdn/polyfills/lite.js +4 -0
- package/dist/cjs/cdn/polyfills/pro.js +4 -0
- package/dist/cjs/cdn/polyfills/spa.js +4 -0
- package/dist/cjs/cdn/polyfills.js +14 -0
- package/dist/cjs/cdn/pro.js +19 -0
- package/dist/cjs/cdn/spa.js +19 -0
- package/dist/cjs/cdn/worker.js +16 -0
- package/dist/cjs/common/aggregate/aggregator.js +168 -0
- package/dist/cjs/common/browser-version/firefox-version.js +17 -0
- package/dist/cjs/common/browser-version/ios-version.js +18 -0
- package/dist/cjs/common/config/config.js +76 -0
- package/dist/cjs/common/config/state/configurable.js +33 -0
- package/dist/cjs/common/config/state/info.js +50 -0
- package/dist/cjs/common/config/state/init.js +86 -0
- package/dist/cjs/common/config/state/loader-config.js +28 -0
- package/dist/cjs/common/config/state/originals.js +9 -0
- package/dist/cjs/common/config/state/runtime.js +51 -0
- package/dist/cjs/common/constants/environment-variables.js +20 -0
- package/dist/cjs/common/context/shared-context.js +26 -0
- package/dist/cjs/common/deny-list/deny-list.js +108 -0
- package/dist/cjs/common/drain/drain.js +132 -0
- package/dist/cjs/common/event-emitter/contextual-ee.js +149 -0
- package/dist/cjs/common/event-emitter/handle.js +24 -0
- package/dist/cjs/common/event-emitter/register-handler.js +24 -0
- package/dist/cjs/common/event-listener/event-listener-opts.js +48 -0
- package/dist/cjs/common/harvest/harvest-scheduler.js +112 -0
- package/dist/cjs/common/harvest/harvest.js +247 -0
- package/dist/cjs/common/ids/id.js +30 -0
- package/dist/cjs/common/ids/unique-id.js +84 -0
- package/dist/cjs/common/metrics/framework-detection.js +72 -0
- package/dist/cjs/common/metrics/paint-metrics.js +13 -0
- package/dist/cjs/common/serialize/bel-serializer.js +89 -0
- package/dist/cjs/common/timing/nav-timing.js +77 -0
- package/dist/cjs/common/timing/now.js +15 -0
- package/dist/cjs/common/unload/eol.js +69 -0
- package/dist/cjs/common/url/clean-url.js +16 -0
- package/dist/cjs/common/url/encode.js +79 -0
- package/dist/cjs/common/url/location.js +14 -0
- package/dist/cjs/common/url/parse-url.js +66 -0
- package/dist/cjs/common/url/protocol.js +25 -0
- package/dist/cjs/common/util/console.js +17 -0
- package/dist/cjs/common/util/data-size.js +25 -0
- package/dist/cjs/common/util/feature-flags.js +42 -0
- package/dist/cjs/common/util/get-or-set.js +39 -0
- package/dist/cjs/common/util/global-scope.js +56 -0
- package/dist/cjs/common/util/map-own.js +31 -0
- package/dist/cjs/common/util/map-own.test.js +49 -0
- package/dist/cjs/common/util/obfuscate.js +76 -0
- package/dist/cjs/common/util/s-hash.js +19 -0
- package/dist/cjs/common/util/single.js +23 -0
- package/dist/cjs/common/util/stringify.js +47 -0
- package/dist/cjs/common/util/submit-data.js +107 -0
- package/dist/cjs/common/util/traverse.js +41 -0
- package/dist/cjs/common/util/user-agent.js +57 -0
- package/dist/cjs/common/window/load.js +19 -0
- package/dist/cjs/common/window/nreum.js +107 -0
- package/dist/cjs/common/window/page-visibility.js +29 -0
- package/dist/cjs/common/window/session-storage.js +87 -0
- package/dist/cjs/common/window/supports-performance-observer.js +15 -0
- package/dist/cjs/common/wrap/index.js +75 -0
- package/dist/cjs/common/wrap/wrap-console.js +54 -0
- package/dist/cjs/common/wrap/wrap-events.js +108 -0
- package/dist/cjs/common/wrap/wrap-fetch.js +112 -0
- package/dist/cjs/common/wrap/wrap-function.js +255 -0
- package/dist/cjs/common/wrap/wrap-history.js +56 -0
- package/dist/cjs/common/wrap/wrap-jsonp.js +129 -0
- package/dist/cjs/common/wrap/wrap-mutation.js +61 -0
- package/dist/cjs/common/wrap/wrap-promise.js +163 -0
- package/dist/cjs/common/wrap/wrap-raf.js +55 -0
- package/dist/cjs/common/wrap/wrap-timer.js +70 -0
- package/dist/cjs/common/wrap/wrap-xhr.js +206 -0
- package/dist/cjs/features/ajax/aggregate/index.js +226 -0
- package/dist/cjs/features/ajax/constants.js +9 -0
- package/dist/cjs/features/ajax/index.js +12 -0
- package/dist/cjs/features/ajax/instrument/distributed-tracing.js +145 -0
- package/dist/cjs/features/ajax/instrument/index.js +339 -0
- package/dist/cjs/features/ajax/instrument/response-size.js +26 -0
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.js +18 -0
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.test.js +31 -0
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.js +215 -0
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.test.js +257 -0
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.js +36 -0
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.test.js +40 -0
- package/dist/cjs/features/jserrors/aggregate/index.js +288 -0
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.js +23 -0
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.test.js +27 -0
- package/dist/cjs/features/jserrors/constants.js +11 -0
- package/dist/cjs/features/jserrors/index.js +12 -0
- package/dist/cjs/features/jserrors/instrument/debug.js +40 -0
- package/dist/cjs/features/jserrors/instrument/index.js +155 -0
- package/dist/cjs/features/metrics/aggregate/index.js +147 -0
- package/dist/cjs/features/metrics/constants.js +17 -0
- package/dist/cjs/features/metrics/index.js +12 -0
- package/dist/cjs/features/metrics/instrument/index.js +46 -0
- package/dist/cjs/features/metrics/instrument/workers-helper.js +124 -0
- package/dist/cjs/features/page_action/aggregate/index.js +120 -0
- package/dist/cjs/features/page_action/constants.js +9 -0
- package/dist/cjs/features/page_action/index.js +12 -0
- package/dist/cjs/features/page_action/instrument/index.js +22 -0
- package/dist/cjs/features/page_view_event/aggregate/index.js +137 -0
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +39 -0
- package/dist/cjs/features/page_view_event/constants.js +15 -0
- package/dist/cjs/features/page_view_event/index.js +12 -0
- package/dist/cjs/features/page_view_event/instrument/index.js +39 -0
- package/dist/cjs/features/page_view_timing/aggregate/index.js +284 -0
- package/dist/cjs/features/page_view_timing/constants.js +9 -0
- package/dist/cjs/features/page_view_timing/first-paint.js +50 -0
- package/dist/cjs/features/page_view_timing/index.js +12 -0
- package/dist/cjs/features/page_view_timing/instrument/index.js +37 -0
- package/dist/cjs/features/page_view_timing/long-tasks.js +75 -0
- package/dist/cjs/features/session_trace/aggregate/index.js +415 -0
- package/dist/cjs/features/session_trace/constants.js +32 -0
- package/dist/cjs/features/session_trace/index.js +12 -0
- package/dist/cjs/features/session_trace/instrument/index.js +134 -0
- package/dist/cjs/features/spa/aggregate/index.js +684 -0
- package/dist/cjs/features/spa/aggregate/interaction-node.js +84 -0
- package/dist/cjs/features/spa/aggregate/interaction-node.test.js +16 -0
- package/dist/cjs/features/spa/aggregate/interaction.js +98 -0
- package/dist/cjs/features/spa/aggregate/serializer.js +147 -0
- package/dist/cjs/features/spa/constants.js +53 -0
- package/dist/cjs/features/spa/index.js +12 -0
- package/dist/cjs/features/spa/instrument/index.js +115 -0
- package/dist/cjs/features/utils/aggregate-base.js +13 -0
- package/dist/cjs/features/utils/feature-base.js +58 -0
- package/dist/cjs/features/utils/handler-cache.js +64 -0
- package/dist/cjs/features/utils/instrument-base.js +72 -0
- package/dist/cjs/features/utils/lazy-loader.js +44 -0
- package/dist/cjs/index.js +81 -58
- package/dist/cjs/loaders/agent.js +87 -0
- package/dist/cjs/loaders/api/api.js +174 -0
- package/dist/cjs/loaders/api/apiAsync.js +94 -0
- package/dist/cjs/loaders/browser-agent.js +29 -0
- package/dist/cjs/loaders/configure/configure.js +53 -0
- package/dist/cjs/loaders/features/enabled-features.js +19 -0
- package/dist/cjs/loaders/features/featureDependencies.js +32 -0
- package/dist/cjs/loaders/features/features.js +33 -0
- package/dist/cjs/loaders/micro-agent.js +98 -0
- package/dist/cjs/loaders/worker-agent.js +24 -0
- package/dist/esm/cdn/lite.js +12 -0
- package/dist/esm/cdn/polyfills/lite.js +7 -0
- package/dist/esm/cdn/polyfills/pro.js +7 -0
- package/dist/esm/cdn/polyfills/spa.js +7 -0
- package/dist/esm/cdn/polyfills.js +17 -0
- package/dist/esm/cdn/pro.js +17 -0
- package/dist/esm/cdn/spa.js +17 -0
- package/dist/esm/cdn/worker.js +14 -0
- package/dist/esm/common/aggregate/aggregator.js +161 -0
- package/dist/esm/common/browser-version/firefox-version.js +10 -0
- package/dist/esm/common/browser-version/ios-version.js +10 -0
- package/dist/esm/common/config/config.js +11 -0
- package/dist/esm/common/config/state/configurable.js +26 -0
- package/dist/esm/common/config/state/info.js +42 -0
- package/dist/esm/common/config/state/init.js +78 -0
- package/dist/esm/common/config/state/loader-config.js +21 -0
- package/dist/esm/common/config/state/originals.js +2 -0
- package/dist/esm/common/config/state/runtime.js +42 -0
- package/dist/esm/common/constants/environment-variables.js +11 -0
- package/dist/esm/common/context/shared-context.js +19 -0
- package/dist/esm/common/deny-list/deny-list.js +101 -0
- package/dist/esm/common/drain/drain.js +125 -0
- package/dist/esm/common/event-emitter/contextual-ee.js +142 -0
- package/dist/esm/common/event-emitter/handle.js +16 -0
- package/dist/esm/common/event-emitter/register-handler.js +19 -0
- package/dist/esm/common/event-listener/event-listener-opts.js +41 -0
- package/dist/esm/common/harvest/harvest-scheduler.js +106 -0
- package/dist/esm/common/harvest/harvest.js +239 -0
- package/dist/esm/common/ids/id.js +23 -0
- package/dist/esm/common/ids/unique-id.js +75 -0
- package/dist/esm/common/metrics/framework-detection.js +66 -0
- package/dist/esm/common/metrics/paint-metrics.js +6 -0
- package/dist/esm/common/serialize/bel-serializer.js +80 -0
- package/dist/esm/common/timing/nav-timing.js +67 -0
- package/dist/esm/common/timing/now.js +9 -0
- package/dist/esm/common/unload/eol.js +62 -0
- package/dist/esm/common/url/clean-url.js +10 -0
- package/dist/esm/common/url/encode.js +71 -0
- package/dist/esm/common/url/location.js +8 -0
- package/dist/esm/common/url/parse-url.js +60 -0
- package/dist/esm/common/url/protocol.js +17 -0
- package/dist/esm/common/util/console.js +11 -0
- package/dist/esm/common/util/data-size.js +19 -0
- package/dist/esm/common/util/feature-flags.js +33 -0
- package/dist/esm/common/util/get-or-set.js +33 -0
- package/dist/esm/common/util/global-scope.js +44 -0
- package/dist/esm/common/util/map-own.js +24 -0
- package/dist/esm/common/util/map-own.test.js +47 -0
- package/dist/esm/common/util/obfuscate.js +67 -0
- package/dist/esm/common/util/s-hash.js +13 -0
- package/dist/esm/common/util/single.js +16 -0
- package/dist/esm/common/util/stringify.js +42 -0
- package/dist/esm/common/util/submit-data.js +99 -0
- package/dist/esm/common/util/traverse.js +35 -0
- package/dist/esm/common/util/user-agent.js +48 -0
- package/dist/esm/common/window/load.js +12 -0
- package/dist/esm/common/window/nreum.js +91 -0
- package/dist/esm/common/window/page-visibility.js +24 -0
- package/dist/esm/common/window/session-storage.js +77 -0
- package/dist/esm/common/window/supports-performance-observer.js +9 -0
- package/dist/esm/common/wrap/index.js +15 -0
- package/dist/esm/common/wrap/wrap-console.js +46 -0
- package/dist/esm/common/wrap/wrap-events.js +100 -0
- package/dist/esm/common/wrap/wrap-fetch.js +103 -0
- package/dist/esm/common/wrap/wrap-function.js +244 -0
- package/dist/esm/common/wrap/wrap-history.js +48 -0
- package/dist/esm/common/wrap/wrap-jsonp.js +122 -0
- package/dist/esm/common/wrap/wrap-mutation.js +54 -0
- package/dist/esm/common/wrap/wrap-promise.js +156 -0
- package/dist/esm/common/wrap/wrap-raf.js +48 -0
- package/dist/esm/common/wrap/wrap-timer.js +63 -0
- package/dist/esm/common/wrap/wrap-xhr.js +199 -0
- package/dist/esm/features/ajax/aggregate/index.js +218 -0
- package/dist/esm/features/ajax/constants.js +2 -0
- package/dist/esm/features/ajax/index.js +1 -0
- package/dist/esm/features/ajax/instrument/distributed-tracing.js +137 -0
- package/dist/esm/features/ajax/instrument/index.js +331 -0
- package/dist/esm/features/ajax/instrument/response-size.js +19 -0
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.js +12 -0
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.test.js +29 -0
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.js +208 -0
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.test.js +255 -0
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.js +29 -0
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.test.js +38 -0
- package/dist/esm/features/jserrors/aggregate/index.js +281 -0
- package/dist/esm/features/jserrors/aggregate/string-hash-code.js +17 -0
- package/dist/esm/features/jserrors/aggregate/string-hash-code.test.js +25 -0
- package/dist/esm/features/jserrors/constants.js +3 -0
- package/dist/esm/features/jserrors/index.js +1 -0
- package/dist/esm/features/jserrors/instrument/debug.js +38 -0
- package/dist/esm/features/jserrors/instrument/index.js +147 -0
- package/dist/esm/features/metrics/aggregate/index.js +140 -0
- package/dist/esm/features/metrics/constants.js +6 -0
- package/dist/esm/features/metrics/index.js +1 -0
- package/dist/esm/features/metrics/instrument/index.js +39 -0
- package/dist/esm/features/metrics/instrument/workers-helper.js +119 -0
- package/dist/esm/features/page_action/aggregate/index.js +113 -0
- package/dist/esm/features/page_action/constants.js +2 -0
- package/dist/esm/features/page_action/index.js +1 -0
- package/dist/esm/features/page_action/instrument/index.js +15 -0
- package/dist/esm/features/page_view_event/aggregate/index.js +128 -0
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +34 -0
- package/dist/esm/features/page_view_event/constants.js +5 -0
- package/dist/esm/features/page_view_event/index.js +1 -0
- package/dist/esm/features/page_view_event/instrument/index.js +30 -0
- package/dist/esm/features/page_view_timing/aggregate/index.js +277 -0
- package/dist/esm/features/page_view_timing/constants.js +2 -0
- package/dist/esm/features/page_view_timing/first-paint.js +43 -0
- package/dist/esm/features/page_view_timing/index.js +1 -0
- package/dist/esm/features/page_view_timing/instrument/index.js +29 -0
- package/dist/esm/features/page_view_timing/long-tasks.js +69 -0
- package/dist/esm/features/session_trace/aggregate/index.js +406 -0
- package/dist/esm/features/session_trace/constants.js +14 -0
- package/dist/esm/features/session_trace/index.js +1 -0
- package/dist/esm/features/session_trace/instrument/index.js +124 -0
- package/dist/esm/features/spa/aggregate/index.js +674 -0
- package/dist/esm/features/spa/aggregate/interaction-node.js +78 -0
- package/dist/esm/features/spa/aggregate/interaction-node.test.js +14 -0
- package/dist/esm/features/spa/aggregate/interaction.js +92 -0
- package/dist/esm/features/spa/aggregate/serializer.js +139 -0
- package/dist/esm/features/spa/constants.js +25 -0
- package/dist/esm/features/spa/index.js +1 -0
- package/dist/esm/features/spa/instrument/index.js +105 -0
- package/dist/esm/features/utils/aggregate-base.js +6 -0
- package/dist/esm/features/utils/feature-base.js +51 -0
- package/dist/esm/features/utils/handler-cache.js +57 -0
- package/dist/esm/features/utils/instrument-base.js +70 -0
- package/dist/esm/features/utils/lazy-loader.js +37 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/loaders/agent.js +78 -0
- package/dist/esm/loaders/api/api.js +168 -0
- package/dist/esm/loaders/api/apiAsync.js +88 -0
- package/dist/esm/loaders/browser-agent.js +23 -0
- package/dist/esm/loaders/configure/configure.js +47 -0
- package/dist/esm/loaders/features/enabled-features.js +13 -0
- package/dist/esm/loaders/features/featureDependencies.js +25 -0
- package/dist/esm/loaders/features/features.js +25 -0
- package/dist/esm/loaders/micro-agent.js +91 -0
- package/dist/esm/loaders/worker-agent.js +18 -0
- package/dist/types/cdn/lite.d.ts +2 -0
- package/dist/types/cdn/lite.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/lite.d.ts +2 -0
- package/dist/types/cdn/polyfills/lite.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/pro.d.ts +2 -0
- package/dist/types/cdn/polyfills/pro.d.ts.map +1 -0
- package/dist/types/cdn/polyfills/spa.d.ts +2 -0
- package/dist/types/cdn/polyfills/spa.d.ts.map +1 -0
- package/dist/types/cdn/polyfills.d.ts +2 -0
- package/dist/types/cdn/polyfills.d.ts.map +1 -0
- package/dist/types/cdn/pro.d.ts +2 -0
- package/dist/types/cdn/pro.d.ts.map +1 -0
- package/dist/types/cdn/spa.d.ts +2 -0
- package/dist/types/cdn/spa.d.ts.map +1 -0
- package/dist/types/cdn/worker.d.ts +2 -0
- package/dist/types/cdn/worker.d.ts.map +1 -0
- package/dist/types/common/aggregate/aggregator.d.ts +11 -0
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -0
- package/dist/types/common/browser-version/firefox-version.d.ts +2 -0
- package/dist/types/common/browser-version/firefox-version.d.ts.map +1 -0
- package/dist/types/common/browser-version/ios-version.d.ts +3 -0
- package/dist/types/common/browser-version/ios-version.d.ts.map +1 -0
- package/dist/types/common/config/config.d.ts +13 -0
- package/dist/types/common/config/config.d.ts.map +1 -0
- package/dist/types/common/config/state/configurable.d.ts +4 -0
- package/dist/types/common/config/state/configurable.d.ts.map +1 -0
- package/dist/types/common/config/state/info.d.ts +4 -0
- package/dist/types/common/config/state/info.d.ts.map +1 -0
- package/dist/types/common/config/state/init.d.ts +4 -0
- package/dist/types/common/config/state/init.d.ts.map +1 -0
- package/dist/types/common/config/state/loader-config.d.ts +3 -0
- package/dist/types/common/config/state/loader-config.d.ts.map +1 -0
- package/dist/types/common/config/state/originals.d.ts +2 -0
- package/dist/types/common/config/state/originals.d.ts.map +1 -0
- package/dist/types/common/config/state/runtime.d.ts +3 -0
- package/dist/types/common/config/state/runtime.d.ts.map +1 -0
- package/dist/types/common/constants/environment-variables.d.ts +4 -0
- package/dist/types/common/constants/environment-variables.d.ts.map +1 -0
- package/dist/types/common/context/shared-context.d.ts +5 -0
- package/dist/types/common/context/shared-context.d.ts.map +1 -0
- package/dist/types/common/deny-list/deny-list.d.ts +12 -0
- package/dist/types/common/deny-list/deny-list.d.ts.map +1 -0
- package/dist/types/common/drain/drain.d.ts +17 -0
- package/dist/types/common/drain/drain.d.ts.map +1 -0
- package/dist/types/common/event-emitter/contextual-ee.d.ts +4 -0
- package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -0
- package/dist/types/common/event-emitter/handle.d.ts +3 -0
- package/dist/types/common/event-emitter/handle.d.ts.map +1 -0
- package/dist/types/common/event-emitter/register-handler.d.ts +8 -0
- package/dist/types/common/event-emitter/register-handler.d.ts.map +1 -0
- package/dist/types/common/event-listener/event-listener-opts.d.ts +10 -0
- package/dist/types/common/event-listener/event-listener-opts.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts +21 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -0
- package/dist/types/common/harvest/harvest.d.ts +58 -0
- package/dist/types/common/harvest/harvest.d.ts.map +1 -0
- package/dist/types/common/ids/id.d.ts +2 -0
- package/dist/types/common/ids/id.d.ts.map +1 -0
- package/dist/types/common/ids/unique-id.d.ts +5 -0
- package/dist/types/common/ids/unique-id.d.ts.map +1 -0
- package/dist/types/common/metrics/framework-detection.d.ts +2 -0
- package/dist/types/common/metrics/framework-detection.d.ts.map +1 -0
- package/dist/types/common/metrics/paint-metrics.d.ts +2 -0
- package/dist/types/common/metrics/paint-metrics.d.ts.map +1 -0
- package/dist/types/common/serialize/bel-serializer.d.ts +5 -0
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -0
- package/dist/types/common/timing/nav-timing.d.ts +5 -0
- package/dist/types/common/timing/nav-timing.d.ts.map +1 -0
- package/dist/types/common/timing/now.d.ts +2 -0
- package/dist/types/common/timing/now.d.ts.map +1 -0
- package/dist/types/common/unload/eol.d.ts +8 -0
- package/dist/types/common/unload/eol.d.ts.map +1 -0
- package/dist/types/common/url/clean-url.d.ts +2 -0
- package/dist/types/common/url/clean-url.d.ts.map +1 -0
- package/dist/types/common/url/encode.d.ts +5 -0
- package/dist/types/common/url/encode.d.ts.map +1 -0
- package/dist/types/common/url/location.d.ts +2 -0
- package/dist/types/common/url/location.d.ts.map +1 -0
- package/dist/types/common/url/parse-url.d.ts +2 -0
- package/dist/types/common/url/parse-url.d.ts.map +1 -0
- package/dist/types/common/url/protocol.d.ts +7 -0
- package/dist/types/common/url/protocol.d.ts.map +1 -0
- package/dist/types/common/util/console.d.ts +8 -0
- package/dist/types/common/util/console.d.ts.map +1 -0
- package/dist/types/common/util/data-size.d.ts +2 -0
- package/dist/types/common/util/data-size.d.ts.map +1 -0
- package/dist/types/common/util/feature-flags.d.ts +3 -0
- package/dist/types/common/util/feature-flags.d.ts.map +1 -0
- package/dist/types/common/util/get-or-set.d.ts +2 -0
- package/dist/types/common/util/get-or-set.d.ts.map +1 -0
- package/dist/types/common/util/global-scope.d.ts +13 -0
- package/dist/types/common/util/global-scope.d.ts.map +1 -0
- package/dist/types/common/util/map-own.d.ts +3 -0
- package/dist/types/common/util/map-own.d.ts.map +1 -0
- package/dist/types/common/util/obfuscate.d.ts +8 -0
- package/dist/types/common/util/obfuscate.d.ts.map +1 -0
- package/dist/types/common/util/s-hash.d.ts +2 -0
- package/dist/types/common/util/s-hash.d.ts.map +1 -0
- package/dist/types/common/util/single.d.ts +2 -0
- package/dist/types/common/util/single.d.ts.map +1 -0
- package/dist/types/common/util/stringify.d.ts +8 -0
- package/dist/types/common/util/stringify.d.ts.map +1 -0
- package/dist/types/common/util/submit-data.d.ts +35 -0
- package/dist/types/common/util/submit-data.d.ts.map +1 -0
- package/dist/types/common/util/traverse.d.ts +2 -0
- package/dist/types/common/util/traverse.d.ts.map +1 -0
- package/dist/types/common/util/user-agent.d.ts +5 -0
- package/dist/types/common/util/user-agent.d.ts.map +1 -0
- package/dist/types/common/window/load.d.ts +3 -0
- package/dist/types/common/window/load.d.ts.map +1 -0
- package/dist/types/common/window/nreum.d.ts +14 -0
- package/dist/types/common/window/nreum.d.ts.map +1 -0
- package/dist/types/common/window/page-visibility.d.ts +7 -0
- package/dist/types/common/window/page-visibility.d.ts.map +1 -0
- package/dist/types/common/window/session-storage.d.ts +18 -0
- package/dist/types/common/window/session-storage.d.ts.map +1 -0
- package/dist/types/common/window/supports-performance-observer.d.ts +2 -0
- package/dist/types/common/window/supports-performance-observer.d.ts.map +1 -0
- package/dist/types/common/wrap/index.d.ts +12 -0
- package/dist/types/common/wrap/index.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-console.d.ts +16 -0
- package/dist/types/common/wrap/wrap-console.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-events.d.ts +17 -0
- package/dist/types/common/wrap/wrap-events.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-fetch.d.ts +18 -0
- package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-function.d.ts +28 -0
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-history.d.ts +16 -0
- package/dist/types/common/wrap/wrap-history.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-jsonp.d.ts +16 -0
- package/dist/types/common/wrap/wrap-jsonp.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-mutation.d.ts +16 -0
- package/dist/types/common/wrap/wrap-mutation.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-promise.d.ts +17 -0
- package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-raf.d.ts +16 -0
- package/dist/types/common/wrap/wrap-raf.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-timer.d.ts +17 -0
- package/dist/types/common/wrap/wrap-timer.d.ts.map +1 -0
- package/dist/types/common/wrap/wrap-xhr.d.ts +16 -0
- package/dist/types/common/wrap/wrap-xhr.d.ts.map +1 -0
- package/dist/types/features/ajax/aggregate/index.d.ts +16 -0
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/ajax/constants.d.ts +2 -0
- package/dist/types/features/ajax/constants.d.ts.map +1 -0
- package/dist/types/features/ajax/index.d.ts +2 -0
- package/dist/types/features/ajax/index.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/distributed-tracing.d.ts +19 -0
- package/dist/types/features/ajax/instrument/distributed-tracing.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/index.d.ts +9 -0
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/response-size.d.ts +2 -0
- package/dist/types/features/ajax/instrument/response-size.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts +2 -0
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts +22 -0
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/format-stack-trace.d.ts +3 -0
- package/dist/types/features/jserrors/aggregate/format-stack-trace.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts +24 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/string-hash-code.d.ts +2 -0
- package/dist/types/features/jserrors/aggregate/string-hash-code.d.ts.map +1 -0
- package/dist/types/features/jserrors/constants.d.ts +3 -0
- package/dist/types/features/jserrors/constants.d.ts.map +1 -0
- package/dist/types/features/jserrors/index.d.ts +2 -0
- package/dist/types/features/jserrors/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/instrument/debug.d.ts +2 -0
- package/dist/types/features/jserrors/instrument/debug.d.ts.map +1 -0
- package/dist/types/features/jserrors/instrument/index.d.ts +22 -0
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/index.d.ts +12 -0
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/metrics/constants.d.ts +6 -0
- package/dist/types/features/metrics/constants.d.ts.map +1 -0
- package/dist/types/features/metrics/index.d.ts +2 -0
- package/dist/types/features/metrics/index.d.ts.map +1 -0
- package/dist/types/features/metrics/instrument/index.d.ts +7 -0
- package/dist/types/features/metrics/instrument/index.d.ts.map +1 -0
- package/dist/types/features/metrics/instrument/workers-helper.d.ts +7 -0
- package/dist/types/features/metrics/instrument/workers-helper.d.ts.map +1 -0
- package/dist/types/features/page_action/aggregate/index.d.ts +24 -0
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_action/constants.d.ts +2 -0
- package/dist/types/features/page_action/constants.d.ts.map +1 -0
- package/dist/types/features/page_action/index.d.ts +2 -0
- package/dist/types/features/page_action/index.d.ts.map +1 -0
- package/dist/types/features/page_action/instrument/index.d.ts +6 -0
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/aggregate/index.d.ts +9 -0
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts +8 -0
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -0
- package/dist/types/features/page_view_event/constants.d.ts +5 -0
- package/dist/types/features/page_view_event/constants.d.ts.map +1 -0
- package/dist/types/features/page_view_event/index.d.ts +2 -0
- package/dist/types/features/page_view_event/index.d.ts.map +1 -0
- package/dist/types/features/page_view_event/instrument/index.d.ts +6 -0
- package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +33 -0
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/constants.d.ts +2 -0
- package/dist/types/features/page_view_timing/constants.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/first-paint.d.ts +2 -0
- package/dist/types/features/page_view_timing/first-paint.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/index.d.ts +2 -0
- package/dist/types/features/page_view_timing/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/instrument/index.d.ts +6 -0
- package/dist/types/features/page_view_timing/instrument/index.d.ts.map +1 -0
- package/dist/types/features/page_view_timing/long-tasks.d.ts +2 -0
- package/dist/types/features/page_view_timing/long-tasks.d.ts.map +1 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts +77 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/session_trace/constants.d.ts +13 -0
- package/dist/types/features/session_trace/constants.d.ts.map +1 -0
- package/dist/types/features/session_trace/index.d.ts +2 -0
- package/dist/types/features/session_trace/index.d.ts.map +1 -0
- package/dist/types/features/session_trace/instrument/index.d.ts +11 -0
- package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/index.d.ts +25 -0
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/interaction-node.d.ts +15 -0
- package/dist/types/features/spa/aggregate/interaction-node.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/interaction.d.ts +20 -0
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -0
- package/dist/types/features/spa/aggregate/serializer.d.ts +15 -0
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -0
- package/dist/types/features/spa/constants.d.ts +23 -0
- package/dist/types/features/spa/constants.d.ts.map +1 -0
- package/dist/types/features/spa/index.d.ts +2 -0
- package/dist/types/features/spa/index.d.ts.map +1 -0
- package/dist/types/features/spa/instrument/index.d.ts +8 -0
- package/dist/types/features/spa/instrument/index.d.ts.map +1 -0
- package/dist/types/features/utils/aggregate-base.d.ts +4 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -0
- package/dist/types/features/utils/feature-base.d.ts +23 -0
- package/dist/types/features/utils/feature-base.d.ts.map +1 -0
- package/dist/types/features/utils/handler-cache.d.ts +22 -0
- package/dist/types/features/utils/handler-cache.d.ts.map +1 -0
- package/dist/types/features/utils/instrument-base.d.ts +27 -0
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -0
- package/dist/types/features/utils/lazy-loader.d.ts +13 -0
- package/dist/types/features/utils/lazy-loader.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/loaders/agent.d.ts +20 -0
- package/dist/types/loaders/agent.d.ts.map +1 -0
- package/dist/types/loaders/api/api.d.ts +17 -0
- package/dist/types/loaders/api/api.d.ts.map +1 -0
- package/dist/types/loaders/api/apiAsync.d.ts +2 -0
- package/dist/types/loaders/api/apiAsync.d.ts.map +1 -0
- package/dist/types/loaders/browser-agent.d.ts +9 -0
- package/dist/types/loaders/browser-agent.d.ts.map +1 -0
- package/dist/types/loaders/configure/configure.d.ts +10 -0
- package/dist/types/loaders/configure/configure.d.ts.map +1 -0
- package/dist/types/loaders/features/enabled-features.d.ts +2 -0
- package/dist/types/loaders/features/enabled-features.d.ts.map +1 -0
- package/dist/types/loaders/features/featureDependencies.d.ts +3 -0
- package/dist/types/loaders/features/featureDependencies.d.ts.map +1 -0
- package/dist/types/loaders/features/features.d.ts +18 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -0
- package/dist/types/loaders/micro-agent.d.ts +25 -0
- package/dist/types/loaders/micro-agent.d.ts.map +1 -0
- package/dist/types/loaders/worker-agent.d.ts +8 -0
- package/dist/types/loaders/worker-agent.d.ts.map +1 -0
- package/package.json +231 -69
- package/src/cdn/lite.js +18 -0
- package/src/cdn/polyfills/lite.js +7 -0
- package/src/cdn/polyfills/pro.js +7 -0
- package/src/cdn/polyfills/spa.js +7 -0
- package/src/cdn/polyfills.js +17 -0
- package/src/cdn/pro.js +27 -0
- package/src/cdn/spa.js +28 -0
- package/src/cdn/worker.js +21 -0
- package/src/common/aggregate/aggregator.js +171 -0
- package/src/common/browser-version/firefox-version.js +10 -0
- package/src/common/browser-version/ios-version.js +10 -0
- package/src/common/config/config.js +12 -0
- package/src/common/config/state/configurable.js +26 -0
- package/src/common/config/state/info.js +49 -0
- package/src/common/config/state/init.js +56 -0
- package/src/common/config/state/loader-config.js +25 -0
- package/src/common/config/state/originals.js +3 -0
- package/src/common/config/state/runtime.js +45 -0
- package/src/common/constants/environment-variables.js +11 -0
- package/src/common/context/shared-context.js +21 -0
- package/src/common/deny-list/deny-list.js +116 -0
- package/src/common/drain/drain.js +119 -0
- package/src/common/event-emitter/contextual-ee.js +159 -0
- package/src/common/event-emitter/handle.js +17 -0
- package/src/common/event-emitter/register-handler.js +25 -0
- package/src/common/event-listener/event-listener-opts.js +41 -0
- package/src/common/harvest/harvest-scheduler.js +112 -0
- package/src/common/harvest/harvest.js +248 -0
- package/src/common/ids/id.js +23 -0
- package/src/common/ids/unique-id.js +81 -0
- package/src/common/metrics/framework-detection.js +71 -0
- package/src/common/metrics/paint-metrics.js +6 -0
- package/src/common/serialize/bel-serializer.js +93 -0
- package/src/common/timing/nav-timing.js +70 -0
- package/src/common/timing/now.js +9 -0
- package/src/common/unload/eol.js +63 -0
- package/src/common/url/clean-url.js +10 -0
- package/src/common/url/encode.js +75 -0
- package/src/common/url/location.js +8 -0
- package/src/common/url/parse-url.js +71 -0
- package/src/common/url/protocol.js +19 -0
- package/src/common/util/console.js +11 -0
- package/src/common/util/data-size.js +21 -0
- package/src/common/util/feature-flags.js +38 -0
- package/src/common/util/get-or-set.js +34 -0
- package/src/common/util/global-scope.js +48 -0
- package/src/common/util/map-own.js +22 -0
- package/src/common/util/map-own.test.js +52 -0
- package/src/common/util/obfuscate.js +73 -0
- package/src/common/util/s-hash.js +14 -0
- package/src/common/util/single.js +18 -0
- package/src/common/util/stringify.js +42 -0
- package/src/common/util/submit-data.js +101 -0
- package/src/common/util/traverse.js +36 -0
- package/src/common/util/user-agent.js +56 -0
- package/src/common/window/load.js +15 -0
- package/src/common/window/nreum.js +110 -0
- package/src/common/window/page-visibility.js +24 -0
- package/src/common/window/session-storage.js +75 -0
- package/src/common/window/supports-performance-observer.js +10 -0
- package/src/common/wrap/index.js +18 -0
- package/src/common/wrap/wrap-console.js +47 -0
- package/src/common/wrap/wrap-events.js +106 -0
- package/src/common/wrap/wrap-fetch.js +109 -0
- package/src/common/wrap/wrap-function.js +248 -0
- package/src/common/wrap/wrap-history.js +48 -0
- package/src/common/wrap/wrap-jsonp.js +134 -0
- package/src/common/wrap/wrap-mutation.js +55 -0
- package/src/common/wrap/wrap-promise.js +165 -0
- package/src/common/wrap/wrap-raf.js +50 -0
- package/src/common/wrap/wrap-timer.js +67 -0
- package/src/common/wrap/wrap-xhr.js +213 -0
- package/src/features/ajax/aggregate/index.js +248 -0
- package/src/features/ajax/constants.js +3 -0
- package/src/features/ajax/index.js +1 -0
- package/src/features/ajax/instrument/distributed-tracing.js +166 -0
- package/src/features/ajax/instrument/index.js +380 -0
- package/src/features/ajax/instrument/response-size.js +18 -0
- package/src/features/jserrors/aggregate/canonical-function-name.js +14 -0
- package/src/features/jserrors/aggregate/canonical-function-name.test.js +13 -0
- package/src/features/jserrors/aggregate/compute-stack-trace.js +231 -0
- package/src/features/jserrors/aggregate/compute-stack-trace.test.js +297 -0
- package/src/features/jserrors/aggregate/format-stack-trace.js +30 -0
- package/src/features/jserrors/aggregate/format-stack-trace.test.js +39 -0
- package/src/features/jserrors/aggregate/index.js +310 -0
- package/src/features/jserrors/aggregate/string-hash-code.js +17 -0
- package/src/features/jserrors/aggregate/string-hash-code.test.js +12 -0
- package/src/features/jserrors/constants.js +4 -0
- package/src/features/jserrors/index.js +1 -0
- package/src/features/jserrors/instrument/debug.js +36 -0
- package/src/features/jserrors/instrument/index.js +149 -0
- package/src/features/metrics/aggregate/index.js +134 -0
- package/src/features/metrics/constants.js +7 -0
- package/src/features/metrics/index.js +1 -0
- package/src/features/metrics/instrument/index.js +44 -0
- package/src/features/metrics/instrument/workers-helper.js +110 -0
- package/src/features/page_action/aggregate/index.js +113 -0
- package/src/features/page_action/constants.js +3 -0
- package/src/features/page_action/index.js +1 -0
- package/src/features/page_action/instrument/index.js +15 -0
- package/src/features/page_view_event/aggregate/index.js +134 -0
- package/src/features/page_view_event/aggregate/initialized-features.js +31 -0
- package/src/features/page_view_event/constants.js +6 -0
- package/src/features/page_view_event/index.js +1 -0
- package/src/features/page_view_event/instrument/index.js +33 -0
- package/src/features/page_view_timing/aggregate/index.js +246 -0
- package/src/features/page_view_timing/constants.js +3 -0
- package/src/features/page_view_timing/first-paint.js +41 -0
- package/src/features/page_view_timing/index.js +1 -0
- package/src/features/page_view_timing/instrument/index.js +30 -0
- package/src/features/page_view_timing/long-tasks.js +60 -0
- package/src/features/session_trace/aggregate/index.js +410 -0
- package/src/features/session_trace/constants.js +15 -0
- package/src/features/session_trace/index.js +1 -0
- package/src/features/session_trace/instrument/index.js +126 -0
- package/src/features/spa/aggregate/index.js +738 -0
- package/src/features/spa/aggregate/interaction-node.js +85 -0
- package/src/features/spa/aggregate/interaction-node.test.js +17 -0
- package/src/features/spa/aggregate/interaction.js +112 -0
- package/src/features/spa/aggregate/serializer.js +198 -0
- package/src/features/spa/constants.js +36 -0
- package/src/features/spa/index.js +1 -0
- package/src/features/spa/instrument/index.js +112 -0
- package/src/features/utils/aggregate-base.js +7 -0
- package/src/features/utils/feature-base.js +51 -0
- package/src/features/utils/handler-cache.js +60 -0
- package/src/features/utils/instrument-base.js +68 -0
- package/src/features/utils/lazy-loader.js +37 -0
- package/src/index.js +15 -0
- package/src/loaders/agent.js +80 -0
- package/src/loaders/api/api.js +175 -0
- package/src/loaders/api/apiAsync.js +92 -0
- package/src/loaders/browser-agent.js +33 -0
- package/src/loaders/configure/configure.js +39 -0
- package/src/loaders/features/enabled-features.js +16 -0
- package/src/loaders/features/featureDependencies.js +26 -0
- package/src/loaders/features/features.js +25 -0
- package/src/loaders/micro-agent.js +84 -0
- package/src/loaders/worker-agent.js +24 -0
- package/dist/bundled/es5/index.js +0 -2
- package/dist/bundled/es5/index.js.map +0 -1
- package/dist/bundled/es6/index.js +0 -2
- package/dist/bundled/es6/index.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -19
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types.d.ts +0 -94
- package/dist/cjs/types.js +0 -28
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/api/api.d.ts +0 -10
- package/dist/cjs/utils/api/api.js +0 -40
- package/dist/cjs/utils/api/api.js.map +0 -1
- package/dist/cjs/utils/config/build-configs.d.ts +0 -6
- package/dist/cjs/utils/config/build-configs.js +0 -68
- package/dist/cjs/utils/config/build-configs.js.map +0 -1
- package/dist/cjs/utils/features/features.d.ts +0 -5
- package/dist/cjs/utils/features/features.js +0 -14
- package/dist/cjs/utils/features/features.js.map +0 -1
- package/dist/cjs/utils/features/initialize.d.ts +0 -5
- package/dist/cjs/utils/features/initialize.js +0 -51
- package/dist/cjs/utils/features/initialize.js.map +0 -1
- package/dist/es/index.d.ts +0 -19
- package/dist/es/index.js +0 -55
- package/dist/es/index.js.map +0 -1
- package/dist/es/types.d.ts +0 -94
- package/dist/es/types.js +0 -24
- package/dist/es/types.js.map +0 -1
- package/dist/es/utils/api/api.d.ts +0 -10
- package/dist/es/utils/api/api.js +0 -36
- package/dist/es/utils/api/api.js.map +0 -1
- package/dist/es/utils/config/build-configs.d.ts +0 -6
- package/dist/es/utils/config/build-configs.js +0 -64
- package/dist/es/utils/config/build-configs.js.map +0 -1
- package/dist/es/utils/features/features.d.ts +0 -5
- package/dist/es/utils/features/features.js +0 -10
- package/dist/es/utils/features/features.js.map +0 -1
- package/dist/es/utils/features/initialize.d.ts +0 -5
- package/dist/es/utils/features/initialize.js +0 -24
- package/dist/es/utils/features/initialize.js.map +0 -1
- package/dist/umd/index.d.ts +0 -19
- package/dist/umd/index.js +0 -69
- package/dist/umd/index.js.map +0 -1
- package/dist/umd/types.d.ts +0 -94
- package/dist/umd/types.js +0 -38
- package/dist/umd/types.js.map +0 -1
- package/dist/umd/utils/api/api.d.ts +0 -10
- package/dist/umd/utils/api/api.js +0 -50
- package/dist/umd/utils/api/api.js.map +0 -1
- package/dist/umd/utils/config/build-configs.d.ts +0 -6
- package/dist/umd/utils/config/build-configs.js +0 -78
- package/dist/umd/utils/config/build-configs.js.map +0 -1
- package/dist/umd/utils/features/features.d.ts +0 -5
- package/dist/umd/utils/features/features.js +0 -24
- package/dist/umd/utils/features/features.js.map +0 -1
- package/dist/umd/utils/features/initialize.d.ts +0 -5
- package/dist/umd/utils/features/initialize.js +0 -63
- package/dist/umd/utils/features/initialize.js.map +0 -1
- package/dist/webpack-analysis.html +0 -38
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ffVersion = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* eslint-disable no-useless-escape */
|
|
13
|
+
|
|
14
|
+
var ffVersion = 0;
|
|
15
|
+
exports.ffVersion = ffVersion;
|
|
16
|
+
var match = navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);
|
|
17
|
+
if (match) exports.ffVersion = ffVersion = +match[1];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isiOS = exports.iOS_below16 = void 0;
|
|
7
|
+
const isiOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent);
|
|
8
|
+
|
|
9
|
+
/* Feature detection to get our version(s). */
|
|
10
|
+
|
|
11
|
+
// Shared Web Workers introduced in iOS 16.0+ and n/a in 15.6-
|
|
12
|
+
exports.isiOS = isiOS;
|
|
13
|
+
const iOS_below16 = isiOS && Boolean(typeof SharedWorker === 'undefined');
|
|
14
|
+
/* ^ It was discovered in Safari 14 (https://bugs.webkit.org/show_bug.cgi?id=225305) that the buffered flag in PerformanceObserver
|
|
15
|
+
did not work. This affects our onFCP metric in particular since web-vitals uses that flag to retrieve paint timing entries.
|
|
16
|
+
This was fixed in v16+.
|
|
17
|
+
*/
|
|
18
|
+
exports.iOS_below16 = iOS_below16;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "getConfiguration", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _init.getConfiguration;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getConfigurationValue", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _init.getConfigurationValue;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getInfo", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _info.getInfo;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "getLoaderConfig", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _loaderConfig.getLoaderConfig;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getRuntime", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _runtime.getRuntime;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.isConfigured = isConfigured;
|
|
37
|
+
Object.defineProperty(exports, "originals", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _originals.originals;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "setConfiguration", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _init.setConfiguration;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "setInfo", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return _info.setInfo;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "setLoaderConfig", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _loaderConfig.setLoaderConfig;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "setRuntime", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () {
|
|
64
|
+
return _runtime.setRuntime;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
var _info = require("./state/info");
|
|
68
|
+
var _init = require("./state/init");
|
|
69
|
+
var _loaderConfig = require("./state/loader-config");
|
|
70
|
+
var _originals = require("./state/originals");
|
|
71
|
+
var _runtime = require("./state/runtime");
|
|
72
|
+
function isConfigured(agentIdentifier) {
|
|
73
|
+
return (0, _info.isValid)(agentIdentifier);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// This module acts as a hub that bundles the static and dynamic properties used by each agent instance into one single interface
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Configurable = void 0;
|
|
7
|
+
var _featureDependencies = require("../../../loaders/features/featureDependencies");
|
|
8
|
+
var _console = require("../../util/console");
|
|
9
|
+
class Configurable {
|
|
10
|
+
constructor(obj, model) {
|
|
11
|
+
try {
|
|
12
|
+
if (!obj || typeof obj !== 'object') return (0, _console.warn)('New setting a Configurable requires an object as input');
|
|
13
|
+
if (!model || typeof model !== 'object') return (0, _console.warn)('Setting a Configurable requires a model to set its initial properties');
|
|
14
|
+
Object.assign(this, model);
|
|
15
|
+
Object.entries(obj).forEach(_ref => {
|
|
16
|
+
let [key, value] = _ref;
|
|
17
|
+
const frozenAttrs = (0, _featureDependencies.getFrozenAttributes)(key);
|
|
18
|
+
if (frozenAttrs.length && value && typeof value === 'object') {
|
|
19
|
+
frozenAttrs.forEach(attr => {
|
|
20
|
+
if (attr in value) {
|
|
21
|
+
(0, _console.warn)(`"${attr}" is a protected attribute and can not be changed in feature ${key}. It will have no effect.`);
|
|
22
|
+
delete value[attr];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
this[key] = value;
|
|
27
|
+
});
|
|
28
|
+
} catch (err) {
|
|
29
|
+
(0, _console.warn)('An error occured while setting a Configurable', err);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Configurable = Configurable;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getInfo = getInfo;
|
|
7
|
+
exports.isValid = isValid;
|
|
8
|
+
exports.setInfo = setInfo;
|
|
9
|
+
var _nreum = require("../../window/nreum");
|
|
10
|
+
var _configurable = require("./configurable");
|
|
11
|
+
const model = {
|
|
12
|
+
// preset defaults
|
|
13
|
+
beacon: _nreum.defaults.beacon,
|
|
14
|
+
errorBeacon: _nreum.defaults.errorBeacon,
|
|
15
|
+
// others must be populated by user
|
|
16
|
+
licenseKey: undefined,
|
|
17
|
+
applicationID: undefined,
|
|
18
|
+
sa: undefined,
|
|
19
|
+
queueTime: undefined,
|
|
20
|
+
applicationTime: undefined,
|
|
21
|
+
ttGuid: undefined,
|
|
22
|
+
user: undefined,
|
|
23
|
+
account: undefined,
|
|
24
|
+
product: undefined,
|
|
25
|
+
extra: undefined,
|
|
26
|
+
jsAttributes: {},
|
|
27
|
+
userAttributes: undefined,
|
|
28
|
+
atts: undefined,
|
|
29
|
+
transactionName: undefined,
|
|
30
|
+
tNamePlain: undefined
|
|
31
|
+
};
|
|
32
|
+
const _cache = {};
|
|
33
|
+
function isValid(id) {
|
|
34
|
+
try {
|
|
35
|
+
const info = getInfo(id);
|
|
36
|
+
return !!info.licenseKey && !!info.errorBeacon && !!info.applicationID;
|
|
37
|
+
} catch (err) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function getInfo(id) {
|
|
42
|
+
if (!id) throw new Error('All info objects require an agent identifier!');
|
|
43
|
+
if (!_cache[id]) throw new Error(`Info for ${id} was never set`);
|
|
44
|
+
return _cache[id];
|
|
45
|
+
}
|
|
46
|
+
function setInfo(id, obj) {
|
|
47
|
+
if (!id) throw new Error('All info objects require an agent identifier!');
|
|
48
|
+
_cache[id] = new _configurable.Configurable(obj, model);
|
|
49
|
+
(0, _nreum.gosNREUMInitializedAgents)(id, _cache[id], 'info');
|
|
50
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getConfiguration = getConfiguration;
|
|
7
|
+
exports.getConfigurationValue = getConfigurationValue;
|
|
8
|
+
exports.setConfiguration = setConfiguration;
|
|
9
|
+
var _nreum = require("../../window/nreum");
|
|
10
|
+
var _configurable = require("./configurable");
|
|
11
|
+
const model = {
|
|
12
|
+
allow_bfcache: true,
|
|
13
|
+
// *cli - temporary feature flag for BFCache work
|
|
14
|
+
privacy: {
|
|
15
|
+
cookies_enabled: true
|
|
16
|
+
},
|
|
17
|
+
// *cli - per discussion, default should be true
|
|
18
|
+
ajax: {
|
|
19
|
+
deny_list: undefined,
|
|
20
|
+
enabled: true,
|
|
21
|
+
harvestTimeSeconds: 10
|
|
22
|
+
},
|
|
23
|
+
distributed_tracing: {
|
|
24
|
+
enabled: undefined,
|
|
25
|
+
exclude_newrelic_header: undefined,
|
|
26
|
+
cors_use_newrelic_header: undefined,
|
|
27
|
+
cors_use_tracecontext_headers: undefined,
|
|
28
|
+
allowed_origins: undefined
|
|
29
|
+
},
|
|
30
|
+
ssl: undefined,
|
|
31
|
+
obfuscate: undefined,
|
|
32
|
+
jserrors: {
|
|
33
|
+
enabled: true,
|
|
34
|
+
harvestTimeSeconds: 10
|
|
35
|
+
},
|
|
36
|
+
metrics: {
|
|
37
|
+
enabled: true
|
|
38
|
+
},
|
|
39
|
+
page_action: {
|
|
40
|
+
enabled: true,
|
|
41
|
+
harvestTimeSeconds: 30
|
|
42
|
+
},
|
|
43
|
+
page_view_event: {
|
|
44
|
+
enabled: true
|
|
45
|
+
},
|
|
46
|
+
page_view_timing: {
|
|
47
|
+
enabled: true,
|
|
48
|
+
harvestTimeSeconds: 30,
|
|
49
|
+
long_task: false
|
|
50
|
+
},
|
|
51
|
+
session_trace: {
|
|
52
|
+
enabled: true,
|
|
53
|
+
harvestTimeSeconds: 10
|
|
54
|
+
},
|
|
55
|
+
spa: {
|
|
56
|
+
enabled: true,
|
|
57
|
+
harvestTimeSeconds: 10
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const _cache = {};
|
|
61
|
+
function getConfiguration(id) {
|
|
62
|
+
if (!id) throw new Error('All configuration objects require an agent identifier!');
|
|
63
|
+
if (!_cache[id]) throw new Error(`Configuration for ${id} was never set`);
|
|
64
|
+
return _cache[id];
|
|
65
|
+
}
|
|
66
|
+
function setConfiguration(id, obj) {
|
|
67
|
+
if (!id) throw new Error('All configuration objects require an agent identifier!');
|
|
68
|
+
_cache[id] = new _configurable.Configurable(obj, model);
|
|
69
|
+
(0, _nreum.gosNREUMInitializedAgents)(id, _cache[id], 'config');
|
|
70
|
+
}
|
|
71
|
+
function getConfigurationValue(id, path) {
|
|
72
|
+
if (!id) throw new Error('All configuration objects require an agent identifier!');
|
|
73
|
+
var val = getConfiguration(id);
|
|
74
|
+
if (val) {
|
|
75
|
+
var parts = path.split('.');
|
|
76
|
+
for (var i = 0; i < parts.length - 1; i++) {
|
|
77
|
+
val = val[parts[i]];
|
|
78
|
+
if (typeof val !== 'object') return;
|
|
79
|
+
}
|
|
80
|
+
val = val[parts[parts.length - 1]];
|
|
81
|
+
}
|
|
82
|
+
return val;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// TO DO: a setConfigurationValue equivalent may be nice so individual
|
|
86
|
+
// properties can be tuned instead of reseting the whole model per call to `setConfiguration(agentIdentifier, {})`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLoaderConfig = getLoaderConfig;
|
|
7
|
+
exports.setLoaderConfig = setLoaderConfig;
|
|
8
|
+
var _nreum = require("../../window/nreum");
|
|
9
|
+
var _configurable = require("./configurable");
|
|
10
|
+
const model = {
|
|
11
|
+
accountID: undefined,
|
|
12
|
+
trustKey: undefined,
|
|
13
|
+
agentID: undefined,
|
|
14
|
+
licenseKey: undefined,
|
|
15
|
+
applicationID: undefined,
|
|
16
|
+
xpid: undefined
|
|
17
|
+
};
|
|
18
|
+
const _cache = {};
|
|
19
|
+
function getLoaderConfig(id) {
|
|
20
|
+
if (!id) throw new Error('All loader-config objects require an agent identifier!');
|
|
21
|
+
if (!_cache[id]) throw new Error(`LoaderConfig for ${id} was never set`);
|
|
22
|
+
return _cache[id];
|
|
23
|
+
}
|
|
24
|
+
function setLoaderConfig(id, obj) {
|
|
25
|
+
if (!id) throw new Error('All loader-config objects require an agent identifier!');
|
|
26
|
+
_cache[id] = new _configurable.Configurable(obj, model);
|
|
27
|
+
(0, _nreum.gosNREUMInitializedAgents)(id, _cache[id], 'loader_config');
|
|
28
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRuntime = getRuntime;
|
|
7
|
+
exports.setRuntime = setRuntime;
|
|
8
|
+
var userAgent = _interopRequireWildcard(require("../../util/user-agent"));
|
|
9
|
+
var _configurable = require("./configurable");
|
|
10
|
+
var _nreum = require("../../window/nreum");
|
|
11
|
+
var _sessionStorage = require("../../window/session-storage");
|
|
12
|
+
var _config = require("../config");
|
|
13
|
+
var _globalScope = require("../../util/global-scope");
|
|
14
|
+
var _environmentVariables = require("../../constants/environment-variables");
|
|
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; }
|
|
17
|
+
const model = agentId => {
|
|
18
|
+
return {
|
|
19
|
+
buildEnv: _environmentVariables.BUILD_ENV,
|
|
20
|
+
bytesSent: {},
|
|
21
|
+
customTransaction: undefined,
|
|
22
|
+
disabled: false,
|
|
23
|
+
distMethod: _environmentVariables.DIST_METHOD,
|
|
24
|
+
isolatedBacklog: false,
|
|
25
|
+
loaderType: undefined,
|
|
26
|
+
maxBytes: 30000,
|
|
27
|
+
// 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
|
|
28
|
+
// ingest expects an integer value, and timeOrigin can return a float.
|
|
29
|
+
offset: Math.floor(_globalScope.globalScope?.performance?.timeOrigin || _globalScope.globalScope?.performance?.timing?.navigationStart || Date.now()),
|
|
30
|
+
onerror: undefined,
|
|
31
|
+
origin: '' + _globalScope.globalScope.location,
|
|
32
|
+
ptid: undefined,
|
|
33
|
+
releaseIds: {},
|
|
34
|
+
sessionId: (0, _config.getConfigurationValue)(agentId, 'privacy.cookies_enabled') == true ? (0, _sessionStorage.getCurrentSessionIdOrMakeNew)() : null,
|
|
35
|
+
// if cookies (now session tracking) is turned off or can't get session ID, this is null
|
|
36
|
+
xhrWrappable: typeof _globalScope.globalScope.XMLHttpRequest?.prototype?.addEventListener === 'function',
|
|
37
|
+
userAgent,
|
|
38
|
+
version: _environmentVariables.VERSION
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const _cache = {};
|
|
42
|
+
function getRuntime(id) {
|
|
43
|
+
if (!id) throw new Error('All runtime objects require an agent identifier!');
|
|
44
|
+
if (!_cache[id]) throw new Error(`Runtime for ${id} was never set`);
|
|
45
|
+
return _cache[id];
|
|
46
|
+
}
|
|
47
|
+
function setRuntime(id, obj) {
|
|
48
|
+
if (!id) throw new Error('All runtime objects require an agent identifier!');
|
|
49
|
+
_cache[id] = new _configurable.Configurable(obj, model(id));
|
|
50
|
+
(0, _nreum.gosNREUMInitializedAgents)(id, _cache[id], 'runtime');
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VERSION = exports.DIST_METHOD = exports.BUILD_ENV = void 0;
|
|
7
|
+
// Webpack and NPM builds define `process.env.BUILD_VERSION` at build time based on variables supplied at build time.
|
|
8
|
+
// VERSION as defined here ends up decorating: agent runtime configuration, harvest, and supportability metrics.
|
|
9
|
+
const VERSION = typeof "0.1.230" !== 'undefined' && "0.1.230" || '';
|
|
10
|
+
|
|
11
|
+
// process.env.BUILD_ENV is replaced during webpack -or- npm build with environment vars supplied at build time
|
|
12
|
+
// LOCAL, PROD, DEV, etc
|
|
13
|
+
exports.VERSION = VERSION;
|
|
14
|
+
const BUILD_ENV = typeof "NPM" !== 'undefined' && "NPM" || '';
|
|
15
|
+
|
|
16
|
+
// process.env.DIST_METHOD is replaced during webpack -or- npm build with environment vars supplied at build time
|
|
17
|
+
// CDN, NPM etc
|
|
18
|
+
exports.BUILD_ENV = BUILD_ENV;
|
|
19
|
+
const DIST_METHOD = typeof "NPM" !== 'undefined' && "NPM" || '';
|
|
20
|
+
exports.DIST_METHOD = DIST_METHOD;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SharedContext = void 0;
|
|
7
|
+
var _console = require("../util/console");
|
|
8
|
+
const model = {
|
|
9
|
+
agentIdentifier: ''
|
|
10
|
+
};
|
|
11
|
+
class SharedContext {
|
|
12
|
+
constructor(context) {
|
|
13
|
+
try {
|
|
14
|
+
if (typeof context !== 'object') return (0, _console.warn)('shared context requires an object as input');
|
|
15
|
+
this.sharedContext = {};
|
|
16
|
+
Object.assign(this.sharedContext, model);
|
|
17
|
+
Object.entries(context).forEach(_ref => {
|
|
18
|
+
let [key, value] = _ref;
|
|
19
|
+
if (Object.keys(model).includes(key)) this.sharedContext[key] = value;
|
|
20
|
+
});
|
|
21
|
+
} catch (err) {
|
|
22
|
+
(0, _console.warn)('An error occured while setting SharedContext', err);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.SharedContext = SharedContext;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setDenyList = setDenyList;
|
|
7
|
+
exports.shouldCollectEvent = shouldCollectEvent;
|
|
8
|
+
/** An array of filter objects {hostname, pathname} for identifying XHR events to be excluded from collection.
|
|
9
|
+
* @see {@link https://docs.newrelic.com/docs/browser/new-relic-browser/configuration/filter-ajax-request-events/ Filter AjaxRequest events}
|
|
10
|
+
* @type {Array.<{hostname: string, pathname: string}>}
|
|
11
|
+
*/
|
|
12
|
+
var denyList = [];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Evaluates whether an XHR event should be included for collection based on the {@link denyList|AjaxRequest deny list}.
|
|
16
|
+
* @param {Object} params - object with properties of the XHR event
|
|
17
|
+
* @returns {boolean} `true` if request does not match any entries of {@link denyList|deny list}; else `false`
|
|
18
|
+
*/
|
|
19
|
+
function shouldCollectEvent(params) {
|
|
20
|
+
if (denyList.length === 0) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// XHR requests with an undefined hostname (e.g., data URLs) should not be collected.
|
|
25
|
+
if (params.hostname === undefined) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
for (var i = 0; i < denyList.length; i++) {
|
|
29
|
+
var parsed = denyList[i];
|
|
30
|
+
if (parsed.hostname === '*') {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (domainMatchesPattern(parsed.hostname, params.hostname) && comparePath(parsed.pathname, params.pathname)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the {@link denyList|XHR deny list} by extracting hostname and pathname from an array of filter strings.
|
|
42
|
+
* @param {string[]} denyListConfig - array of URL filters to identify XHR requests to be excluded from collection
|
|
43
|
+
*/
|
|
44
|
+
function setDenyList(denyListConfig) {
|
|
45
|
+
denyList = [];
|
|
46
|
+
if (!denyListConfig || !denyListConfig.length) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
for (var i = 0; i < denyListConfig.length; i++) {
|
|
50
|
+
var url = denyListConfig[i];
|
|
51
|
+
if (url.indexOf('http://') === 0) {
|
|
52
|
+
url = url.substring(7);
|
|
53
|
+
} else if (url.indexOf('https://') === 0) {
|
|
54
|
+
url = url.substring(8);
|
|
55
|
+
}
|
|
56
|
+
var firstSlash = url.indexOf('/');
|
|
57
|
+
if (firstSlash > 0) {
|
|
58
|
+
denyList.push({
|
|
59
|
+
hostname: url.substring(0, firstSlash),
|
|
60
|
+
pathname: url.substring(firstSlash)
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
denyList.push({
|
|
64
|
+
hostname: url,
|
|
65
|
+
pathname: ''
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns true if the right side of `domain` (end of string) matches `pattern`.
|
|
72
|
+
* @param {string} pattern - a string to be matched against the end of `domain` string
|
|
73
|
+
* @param {string} domain - a domain string with no protocol or path (e.g., app1.example.com)
|
|
74
|
+
* @returns {boolean} `true` if domain matches pattern; else `false`
|
|
75
|
+
*/
|
|
76
|
+
function domainMatchesPattern(pattern, domain) {
|
|
77
|
+
if (pattern.length > domain.length) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (domain.indexOf(pattern) === domain.length - pattern.length) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns true if a URL path matches a pattern string, disregarding leading slashes.
|
|
88
|
+
* @param {string} pattern - a string to compare with path (e.g., api/v1)
|
|
89
|
+
* @param {string} path - a string representing a URL path (e.g., /api/v1)
|
|
90
|
+
* @returns {boolean} `true` if path and pattern are an exact string match (except for leading slashes); else `false`
|
|
91
|
+
*/
|
|
92
|
+
function comparePath(pattern, path) {
|
|
93
|
+
if (pattern.indexOf('/') === 0) {
|
|
94
|
+
pattern = pattern.substring(1);
|
|
95
|
+
}
|
|
96
|
+
if (path.indexOf('/') === 0) {
|
|
97
|
+
path = path.substring(1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// No path in pattern means match all paths.
|
|
101
|
+
if (pattern === '') {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (pattern === path) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.drain = drain;
|
|
7
|
+
exports.registerDrain = registerDrain;
|
|
8
|
+
var _contextualEe = require("../event-emitter/contextual-ee");
|
|
9
|
+
var _mapOwn = require("../util/map-own");
|
|
10
|
+
var _registerHandler = require("../event-emitter/register-handler");
|
|
11
|
+
var _features = require("../../loaders/features/features");
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
14
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const registry = {};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Adds an entry to the centralized drain registry specifying that a particular agent has events of a particular named
|
|
21
|
+
* event-group "bucket" that should be drained at the time the agent drains all its buffered events. Buffered events
|
|
22
|
+
* accumulate because instrumentation begins as soon as possible, before the agent has finished lazy-loading the code
|
|
23
|
+
* responsible for aggregating and reporting captured data.
|
|
24
|
+
* @param {string} agentIdentifier - A 16 character string uniquely identifying the agent.
|
|
25
|
+
* @param {string} group - The named "bucket" for the events this feature will be bucketing for later collection.
|
|
26
|
+
*/
|
|
27
|
+
function registerDrain(agentIdentifier, group) {
|
|
28
|
+
// Here `item` captures the registered properties of a feature-group: whether it is ready for its buffered events
|
|
29
|
+
// to be drained (`staged`) and the `priority` order in which it should be drained relative to other feature groups.
|
|
30
|
+
const item = {
|
|
31
|
+
staged: false,
|
|
32
|
+
priority: _features.featurePriority[group] || 0
|
|
33
|
+
};
|
|
34
|
+
curateRegistry(agentIdentifier);
|
|
35
|
+
if (!registry[agentIdentifier].get(group)) registry[agentIdentifier].set(group, item);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Registers the specified agent with the centralized event buffer registry if it is not already registered.
|
|
40
|
+
* Agents without an identifier (as in the case of some tests) will be excluded from the registry.
|
|
41
|
+
* @param {string} agentIdentifier - A 16 character string uniquely identifying an agent.
|
|
42
|
+
*/
|
|
43
|
+
function curateRegistry(agentIdentifier) {
|
|
44
|
+
if (!agentIdentifier) return;
|
|
45
|
+
if (!registry[agentIdentifier]) registry[agentIdentifier] = new Map();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Drain buffered events out of the event emitter. Each feature should have its events bucketed by "group" and drain
|
|
50
|
+
* its own named group explicitly, when ready.
|
|
51
|
+
* @param {string} agentIdentifier - A unique 16 character ID corresponding to an instantiated agent.
|
|
52
|
+
* @param {string} featureName - A named group into which the feature's buffered events are bucketed.
|
|
53
|
+
*/
|
|
54
|
+
function drain() {
|
|
55
|
+
let agentIdentifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
56
|
+
let featureName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'feature';
|
|
57
|
+
curateRegistry(agentIdentifier);
|
|
58
|
+
|
|
59
|
+
// If the feature for the specified agent is not in the registry, that means the instrument file was bypassed.
|
|
60
|
+
// This could happen in tests, or loaders that directly import the aggregator. In these cases it is safe to
|
|
61
|
+
// drain the feature group immediately rather than waiting to drain all at once.
|
|
62
|
+
if (!agentIdentifier || !registry[agentIdentifier].get(featureName)) return drainGroup(featureName);
|
|
63
|
+
|
|
64
|
+
// When `drain` is called, this feature is ready to drain (staged).
|
|
65
|
+
registry[agentIdentifier].get(featureName).staged = true;
|
|
66
|
+
|
|
67
|
+
// Only when the event-groups for all features are ready to drain (staged) do we execute the drain. This has the effect
|
|
68
|
+
// that the last feature to call drain triggers drain for all features.
|
|
69
|
+
const items = Array.from(registry[agentIdentifier]);
|
|
70
|
+
if (items.every(_ref => {
|
|
71
|
+
let [key, values] = _ref;
|
|
72
|
+
return values.staged;
|
|
73
|
+
})) {
|
|
74
|
+
items.sort((a, b) => a[1].priority - b[1].priority);
|
|
75
|
+
items.forEach(_ref2 => {
|
|
76
|
+
let [group] = _ref2;
|
|
77
|
+
drainGroup(group);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Drains all the buffered (backlog) events for a particular feature's event-group by emitting each event to each of
|
|
83
|
+
* the subscribed handlers for the group.
|
|
84
|
+
* @param {*} group - The name of a particular feature's event "bucket".
|
|
85
|
+
*/
|
|
86
|
+
function drainGroup(group) {
|
|
87
|
+
const baseEE = agentIdentifier ? _contextualEe.ee.get(agentIdentifier) : _contextualEe.ee;
|
|
88
|
+
const handlers = _registerHandler.registerHandler.handlers;
|
|
89
|
+
if (!baseEE.backlog || !handlers) return;
|
|
90
|
+
var bufferedEventsInGroup = baseEE.backlog[group];
|
|
91
|
+
var groupHandlers = handlers[group];
|
|
92
|
+
if (groupHandlers) {
|
|
93
|
+
// We don't cache the length of the buffer while looping because events might still be added while processing.
|
|
94
|
+
for (var i = 0; bufferedEventsInGroup && i < bufferedEventsInGroup.length; ++i) {
|
|
95
|
+
// eslint-disable-line no-unmodified-loop-condition
|
|
96
|
+
emitEvent(bufferedEventsInGroup[i], groupHandlers);
|
|
97
|
+
}
|
|
98
|
+
(0, _mapOwn.mapOwn)(groupHandlers, function (eventType, handlerRegistrationList) {
|
|
99
|
+
(0, _mapOwn.mapOwn)(handlerRegistrationList, function (i, registration) {
|
|
100
|
+
// registration is an array of: [targetEE, eventHandler]
|
|
101
|
+
registration[0].on(eventType, registration[1]);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
delete handlers[group];
|
|
106
|
+
|
|
107
|
+
// Keep the feature's event-group as a property of the event emitter so we know it was already created and drained.
|
|
108
|
+
baseEE.backlog[group] = null;
|
|
109
|
+
baseEE.emit('drain-' + group, []);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Processes the specified event using all relevant handler functions associated with a particular feature, based on
|
|
115
|
+
* whether the the handler is meant to apply to events of this type. (Event type is a descriptive string set at the
|
|
116
|
+
* time an event is originally created by instrumentation, as with calls to the `handle` method.)
|
|
117
|
+
* @param {*} evt - A single event to be emitted to (processed by) eligible handler functions.
|
|
118
|
+
* @param {*} groupHandlers - A set of handler functions associated with a particular feature's event-group.
|
|
119
|
+
*/
|
|
120
|
+
function emitEvent(evt, groupHandlers) {
|
|
121
|
+
var type = evt[1];
|
|
122
|
+
(0, _mapOwn.mapOwn)(groupHandlers[type], function (i, registration) {
|
|
123
|
+
var sourceEE = evt[0];
|
|
124
|
+
var ee = registration[0];
|
|
125
|
+
if (ee === sourceEE) {
|
|
126
|
+
var handler = registration[1];
|
|
127
|
+
var ctx = evt[3];
|
|
128
|
+
var args = evt[2];
|
|
129
|
+
handler.apply(ctx, args);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|