@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,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateRandomHexString = generateRandomHexString;
|
|
7
|
+
exports.generateSpanId = generateSpanId;
|
|
8
|
+
exports.generateTraceId = generateTraceId;
|
|
9
|
+
exports.generateUuid = generateUuid;
|
|
10
|
+
var _globalScope = require("../util/global-scope");
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
13
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function generateUuid() {
|
|
17
|
+
var randomVals = null;
|
|
18
|
+
var rvIndex = 0;
|
|
19
|
+
var crypto = _globalScope.globalScope?.crypto || _globalScope.globalScope?.msCrypto;
|
|
20
|
+
if (crypto && crypto.getRandomValues) {
|
|
21
|
+
// eslint-disable-next-line
|
|
22
|
+
randomVals = crypto.getRandomValues(new Uint8Array(31));
|
|
23
|
+
}
|
|
24
|
+
function getRandomValue() {
|
|
25
|
+
if (randomVals) {
|
|
26
|
+
// same as % 16
|
|
27
|
+
return randomVals[rvIndex++] & 15;
|
|
28
|
+
} else {
|
|
29
|
+
return Math.random() * 16 | 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// v4 UUID
|
|
34
|
+
var template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
35
|
+
var id = '';
|
|
36
|
+
var c;
|
|
37
|
+
for (var i = 0; i < template.length; i++) {
|
|
38
|
+
c = template[i];
|
|
39
|
+
if (c === 'x') {
|
|
40
|
+
id += getRandomValue().toString(16);
|
|
41
|
+
} else if (c === 'y') {
|
|
42
|
+
// this is the uuid variant per spec (8, 9, a, b)
|
|
43
|
+
// % 4, then shift to get values 8-11
|
|
44
|
+
c = getRandomValue() & 0x3 | 0x8;
|
|
45
|
+
id += c.toString(16);
|
|
46
|
+
} else {
|
|
47
|
+
id += c;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return id;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 16-character hex string (per DT spec)
|
|
54
|
+
function generateSpanId() {
|
|
55
|
+
return generateRandomHexString(16);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 32-character hex string (per DT spec)
|
|
59
|
+
function generateTraceId() {
|
|
60
|
+
return generateRandomHexString(32);
|
|
61
|
+
}
|
|
62
|
+
function generateRandomHexString(length) {
|
|
63
|
+
var randomVals = null;
|
|
64
|
+
var rvIndex = 0;
|
|
65
|
+
var crypto = self.crypto || self.msCrypto;
|
|
66
|
+
// eslint-disable-next-line
|
|
67
|
+
if (crypto && crypto.getRandomValues && Uint8Array) {
|
|
68
|
+
// eslint-disable-next-line
|
|
69
|
+
randomVals = crypto.getRandomValues(new Uint8Array(31));
|
|
70
|
+
}
|
|
71
|
+
var chars = [];
|
|
72
|
+
for (var i = 0; i < length; i++) {
|
|
73
|
+
chars.push(getRandomValue().toString(16));
|
|
74
|
+
}
|
|
75
|
+
return chars.join('');
|
|
76
|
+
function getRandomValue() {
|
|
77
|
+
if (randomVals) {
|
|
78
|
+
// same as % 16
|
|
79
|
+
return randomVals[rvIndex++] & 15;
|
|
80
|
+
} else {
|
|
81
|
+
return Math.random() * 16 | 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getFrameworks = getFrameworks;
|
|
7
|
+
var _globalScope = require("../util/global-scope");
|
|
8
|
+
var FRAMEWORKS = {
|
|
9
|
+
REACT: 'React',
|
|
10
|
+
ANGULAR: 'Angular',
|
|
11
|
+
ANGULARJS: 'AngularJS',
|
|
12
|
+
BACKBONE: 'Backbone',
|
|
13
|
+
EMBER: 'Ember',
|
|
14
|
+
VUE: 'Vue',
|
|
15
|
+
METEOR: 'Meteor',
|
|
16
|
+
ZEPTO: 'Zepto',
|
|
17
|
+
JQUERY: 'Jquery'
|
|
18
|
+
};
|
|
19
|
+
function getFrameworks() {
|
|
20
|
+
if (!_globalScope.isBrowserScope) return []; // don't bother detecting frameworks if not in the main window context
|
|
21
|
+
|
|
22
|
+
var frameworks = [];
|
|
23
|
+
try {
|
|
24
|
+
if (detectReact()) frameworks.push(FRAMEWORKS.REACT);
|
|
25
|
+
if (detectAngularJs()) frameworks.push(FRAMEWORKS.ANGULARJS);
|
|
26
|
+
if (detectAngular()) frameworks.push(FRAMEWORKS.ANGULAR);
|
|
27
|
+
if (window.Backbone) frameworks.push(FRAMEWORKS.BACKBONE);
|
|
28
|
+
if (window.Ember) frameworks.push(FRAMEWORKS.EMBER);
|
|
29
|
+
if (window.Vue) frameworks.push(FRAMEWORKS.VUE);
|
|
30
|
+
if (window.Meteor) frameworks.push(FRAMEWORKS.METEOR);
|
|
31
|
+
if (window.Zepto) frameworks.push(FRAMEWORKS.ZEPTO);
|
|
32
|
+
if (window.jQuery) frameworks.push(FRAMEWORKS.JQUERY);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
// not supported?
|
|
35
|
+
}
|
|
36
|
+
return frameworks;
|
|
37
|
+
}
|
|
38
|
+
function detectReact() {
|
|
39
|
+
try {
|
|
40
|
+
if (!!window.React || !!window.ReactDOM || !!window.ReactRedux) return true;
|
|
41
|
+
if (document.querySelector('[data-reactroot], [data-reactid]')) return true;
|
|
42
|
+
var divs = document.querySelectorAll('body > div');
|
|
43
|
+
for (var i = 0; i < divs.length; i++) {
|
|
44
|
+
if (Object.keys(divs[i]).indexOf('_reactRootContainer') >= 0) return true;
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
} catch (err) {
|
|
48
|
+
// not supported?
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function detectAngularJs() {
|
|
53
|
+
try {
|
|
54
|
+
if (window.angular) return true;
|
|
55
|
+
if (document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]')) return true;
|
|
56
|
+
if (document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]')) return true;
|
|
57
|
+
return false;
|
|
58
|
+
} catch (err) {
|
|
59
|
+
// not supported?
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function detectAngular() {
|
|
64
|
+
try {
|
|
65
|
+
// eslint-disable-next-line
|
|
66
|
+
if (window.hasOwnProperty('ng') && window.ng.hasOwnProperty('coreTokens') && window.ng.coreTokens.hasOwnProperty('NgZone')) return true;
|
|
67
|
+
return !!document.querySelectorAll('[ng-version]').length;
|
|
68
|
+
} catch (err) {
|
|
69
|
+
// not supported?
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.paintMetrics = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const paintMetrics = {};
|
|
13
|
+
exports.paintMetrics = paintMetrics;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addCustomAttributes = addCustomAttributes;
|
|
7
|
+
exports.getAddStringContext = getAddStringContext;
|
|
8
|
+
exports.nullable = nullable;
|
|
9
|
+
exports.numeric = numeric;
|
|
10
|
+
var _mapOwn = require("../util/map-own");
|
|
11
|
+
var _stringify = require("../util/stringify");
|
|
12
|
+
var _obfuscate = require("../util/obfuscate");
|
|
13
|
+
/*
|
|
14
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var hasOwnProp = Object.prototype.hasOwnProperty;
|
|
19
|
+
var MAX_ATTRIBUTES = 64;
|
|
20
|
+
function nullable(val, fn, comma) {
|
|
21
|
+
return val || val === 0 || val === '' ? fn(val) + (comma ? ',' : '') : '!';
|
|
22
|
+
}
|
|
23
|
+
function numeric(n, noDefault) {
|
|
24
|
+
if (noDefault) {
|
|
25
|
+
return Math.floor(n).toString(36);
|
|
26
|
+
}
|
|
27
|
+
return n === undefined || n === 0 ? '' : Math.floor(n).toString(36);
|
|
28
|
+
}
|
|
29
|
+
function getAddStringContext(agentIdentifier) {
|
|
30
|
+
// eslint-disable-next-line
|
|
31
|
+
var stringTable = Object.hasOwnProperty('create') ? Object.create(null) : {};
|
|
32
|
+
var stringTableIdx = 0;
|
|
33
|
+
return addString;
|
|
34
|
+
function addString(str) {
|
|
35
|
+
if (typeof str === 'undefined' || str === '') return '';
|
|
36
|
+
var obfuscator = new _obfuscate.Obfuscator({
|
|
37
|
+
agentIdentifier: agentIdentifier
|
|
38
|
+
});
|
|
39
|
+
str = String(str);
|
|
40
|
+
if (obfuscator.shouldObfuscate()) str = obfuscator.obfuscateString(str);
|
|
41
|
+
if (hasOwnProp.call(stringTable, str)) {
|
|
42
|
+
return numeric(stringTable[str], true);
|
|
43
|
+
} else {
|
|
44
|
+
stringTable[str] = stringTableIdx++;
|
|
45
|
+
return quoteString(str);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function addCustomAttributes(attrs, addString) {
|
|
50
|
+
var attrParts = [];
|
|
51
|
+
(0, _mapOwn.mapOwn)(attrs, function (key, val) {
|
|
52
|
+
if (attrParts.length >= MAX_ATTRIBUTES) return;
|
|
53
|
+
var type = 5;
|
|
54
|
+
var serializedValue;
|
|
55
|
+
// add key to string table first
|
|
56
|
+
key = addString(key);
|
|
57
|
+
switch (typeof val) {
|
|
58
|
+
case 'object':
|
|
59
|
+
if (val) {
|
|
60
|
+
// serialize objects to strings
|
|
61
|
+
serializedValue = addString((0, _stringify.stringify)(val));
|
|
62
|
+
} else {
|
|
63
|
+
// null attribute type
|
|
64
|
+
type = 9;
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case 'number':
|
|
68
|
+
type = 6;
|
|
69
|
+
// make sure numbers contain a `.` so they are parsed as doubles
|
|
70
|
+
serializedValue = val % 1 ? val : val + '.';
|
|
71
|
+
break;
|
|
72
|
+
case 'boolean':
|
|
73
|
+
type = val ? 7 : 8;
|
|
74
|
+
break;
|
|
75
|
+
case 'undefined':
|
|
76
|
+
// we treat undefined as a null attribute (since dirac does not have a concept of undefined)
|
|
77
|
+
type = 9;
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
serializedValue = addString(val);
|
|
81
|
+
}
|
|
82
|
+
attrParts.push([type, key + (serializedValue ? ',' + serializedValue : '')]);
|
|
83
|
+
});
|
|
84
|
+
return attrParts;
|
|
85
|
+
}
|
|
86
|
+
var escapable = /([,\\;])/g;
|
|
87
|
+
function quoteString(str) {
|
|
88
|
+
return "'" + str.replace(escapable, '\\$1');
|
|
89
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addPN = addPN;
|
|
7
|
+
exports.addPT = addPT;
|
|
8
|
+
exports.addRel = addRel;
|
|
9
|
+
exports.navTimingValues = void 0;
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// We don't use JSON.stringify directly on the performance timing data for these reasons:
|
|
16
|
+
// * Chrome has extra data in the performance object that we don't want to send all the time (wasteful)
|
|
17
|
+
// * Firefox fails to stringify the native object due to - http://code.google.com/p/v8/issues/detail?id=1223
|
|
18
|
+
// * The variable names are long and wasteful to transmit
|
|
19
|
+
|
|
20
|
+
// Add Performance Timing values to the given object.
|
|
21
|
+
// * Values are written relative to an offset to reduce their length (i.e. number of characters).
|
|
22
|
+
// * The offset is sent with the data
|
|
23
|
+
// * 0's are not included unless the value is a 'relative zero'
|
|
24
|
+
//
|
|
25
|
+
|
|
26
|
+
var START = 'Start';
|
|
27
|
+
var END = 'End';
|
|
28
|
+
var UNLOAD_EVENT = 'unloadEvent';
|
|
29
|
+
var REDIRECT = 'redirect';
|
|
30
|
+
var DOMAIN_LOOKUP = 'domainLookup';
|
|
31
|
+
var ONNECT = 'onnect';
|
|
32
|
+
var REQUEST = 'request';
|
|
33
|
+
var RESPONSE = 'response';
|
|
34
|
+
var LOAD_EVENT = 'loadEvent';
|
|
35
|
+
var DOM_CONTENT_LOAD_EVENT = 'domContentLoadedEvent';
|
|
36
|
+
var navTimingValues = [];
|
|
37
|
+
exports.navTimingValues = navTimingValues;
|
|
38
|
+
function addPT(offset, pt, v) {
|
|
39
|
+
v.of = offset;
|
|
40
|
+
addRel(offset, offset, v, 'n');
|
|
41
|
+
addRel(pt[UNLOAD_EVENT + START], offset, v, 'u');
|
|
42
|
+
addRel(pt[REDIRECT + START], offset, v, 'r');
|
|
43
|
+
addRel(pt[UNLOAD_EVENT + END], offset, v, 'ue');
|
|
44
|
+
addRel(pt[REDIRECT + END], offset, v, 're');
|
|
45
|
+
addRel(pt['fetch' + START], offset, v, 'f');
|
|
46
|
+
addRel(pt[DOMAIN_LOOKUP + START], offset, v, 'dn');
|
|
47
|
+
addRel(pt[DOMAIN_LOOKUP + END], offset, v, 'dne');
|
|
48
|
+
addRel(pt['c' + ONNECT + START], offset, v, 'c');
|
|
49
|
+
addRel(pt['secureC' + ONNECT + 'ion' + START], offset, v, 's');
|
|
50
|
+
addRel(pt['c' + ONNECT + END], offset, v, 'ce');
|
|
51
|
+
addRel(pt[REQUEST + START], offset, v, 'rq');
|
|
52
|
+
addRel(pt[RESPONSE + START], offset, v, 'rp');
|
|
53
|
+
addRel(pt[RESPONSE + END], offset, v, 'rpe');
|
|
54
|
+
addRel(pt.domLoading, offset, v, 'dl');
|
|
55
|
+
addRel(pt.domInteractive, offset, v, 'di');
|
|
56
|
+
addRel(pt[DOM_CONTENT_LOAD_EVENT + START], offset, v, 'ds');
|
|
57
|
+
addRel(pt[DOM_CONTENT_LOAD_EVENT + END], offset, v, 'de');
|
|
58
|
+
addRel(pt.domComplete, offset, v, 'dc');
|
|
59
|
+
addRel(pt[LOAD_EVENT + START], offset, v, 'l');
|
|
60
|
+
addRel(pt[LOAD_EVENT + END], offset, v, 'le');
|
|
61
|
+
return v;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Add Performance Navigation values to the given object
|
|
65
|
+
function addPN(pn, v) {
|
|
66
|
+
addRel(pn.type, 0, v, 'ty');
|
|
67
|
+
addRel(pn.redirectCount, 0, v, 'rc');
|
|
68
|
+
return v;
|
|
69
|
+
}
|
|
70
|
+
function addRel(value, offset, obj, prop) {
|
|
71
|
+
var relativeValue;
|
|
72
|
+
if (typeof value === 'number' && value > 0) {
|
|
73
|
+
relativeValue = Math.max(Math.round(value - offset), 0);
|
|
74
|
+
obj[prop] = relativeValue;
|
|
75
|
+
}
|
|
76
|
+
navTimingValues.push(relativeValue);
|
|
77
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.now = now;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// This is our own layer around performance.now. It's not strictly necessary, but we keep it in case of future mod-ing of the value for refactor purpose.
|
|
13
|
+
function now() {
|
|
14
|
+
return Math.round(performance.now());
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.subscribeToEOL = subscribeToEOL;
|
|
7
|
+
var _firefoxVersion = require("../browser-version/firefox-version");
|
|
8
|
+
var _eventListenerOpts = require("../event-listener/event-listener-opts");
|
|
9
|
+
var _single = require("../util/single");
|
|
10
|
+
var _globalScope = require("../util/global-scope");
|
|
11
|
+
var _pageVisibility = require("../window/page-visibility");
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
14
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
if (_globalScope.isWorkerScope) {
|
|
18
|
+
_globalScope.globalScope.cleanupTasks = []; // create new list on WorkerGlobalScope to track funcs to run before exiting thread
|
|
19
|
+
|
|
20
|
+
const origClose = _globalScope.globalScope.close;
|
|
21
|
+
_globalScope.globalScope.close = () => {
|
|
22
|
+
// on worker's EoL signal, execute all "listeners", e.g. final harvests
|
|
23
|
+
for (let task of _globalScope.globalScope.cleanupTasks) {
|
|
24
|
+
task();
|
|
25
|
+
}
|
|
26
|
+
origClose();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Subscribes a provided callback to the time/event when the agent should treat it as end-of-life.
|
|
32
|
+
* This is used, for example, to submit a final harvest and send all remaining data on best-effort.
|
|
33
|
+
* @param {function} cb - func to run before or during the last reliable event or time of an env's life span
|
|
34
|
+
* @param {boolean} allowBFCache - (temp) feature flag to gate new v1222 BFC support
|
|
35
|
+
*/
|
|
36
|
+
function subscribeToEOL(cb, allowBFCache) {
|
|
37
|
+
if (_globalScope.isBrowserScope) {
|
|
38
|
+
if (allowBFCache) {
|
|
39
|
+
(0, _pageVisibility.subscribeToVisibilityChange)(cb, true); // when user switches tab or hides window, esp. mobile scenario
|
|
40
|
+
(0, _eventListenerOpts.windowAddEventListener)('pagehide', cb); // when user navigates away, and because safari iOS v14.4- doesn't fully support vis change
|
|
41
|
+
// --this ought to be removed once support for version below 14.5 phases out
|
|
42
|
+
} else {
|
|
43
|
+
var oneCall = (0, _single.single)(cb);
|
|
44
|
+
|
|
45
|
+
// Firefox has a bug wherein a slow-loading resource loaded from the 'pagehide'
|
|
46
|
+
// or 'unload' event will delay the 'load' event firing on the next page load.
|
|
47
|
+
// In Firefox versions that support sendBeacon, this doesn't matter, because
|
|
48
|
+
// we'll use it instead of an image load for our final harvest.
|
|
49
|
+
//
|
|
50
|
+
// Some Safari versions never fire the 'unload' event for pages that are being
|
|
51
|
+
// put into the WebKit page cache, so we *need* to use the pagehide event for
|
|
52
|
+
// the final submission from Safari.
|
|
53
|
+
//
|
|
54
|
+
// Generally speaking, we will try to submit our final harvest from either
|
|
55
|
+
// pagehide or unload, whichever comes first, but in Firefox, we need to avoid
|
|
56
|
+
// attempting to submit from pagehide to ensure that we don't slow down loading
|
|
57
|
+
// of the next page.
|
|
58
|
+
if (!_firefoxVersion.ffVersion || navigator.sendBeacon) {
|
|
59
|
+
(0, _eventListenerOpts.windowAddEventListener)('pagehide', oneCall);
|
|
60
|
+
} else {
|
|
61
|
+
(0, _eventListenerOpts.windowAddEventListener)('beforeunload', oneCall);
|
|
62
|
+
}
|
|
63
|
+
(0, _eventListenerOpts.windowAddEventListener)('unload', oneCall);
|
|
64
|
+
}
|
|
65
|
+
} else if (_globalScope.isWorkerScope) {
|
|
66
|
+
_globalScope.globalScope.cleanupTasks.push(cb); // close() should run these tasks before quitting thread
|
|
67
|
+
}
|
|
68
|
+
// By default (for other env), this fn has no effect.
|
|
69
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cleanURL = cleanURL;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var withHash = /([^?#]*)[^#]*(#[^?]*|$).*/;
|
|
13
|
+
var withoutHash = /([^?#]*)().*/;
|
|
14
|
+
function cleanURL(url, keepHash) {
|
|
15
|
+
return url.replace(keepHash ? withHash : withoutHash, '$1$2');
|
|
16
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fromArray = fromArray;
|
|
7
|
+
exports.obj = obj;
|
|
8
|
+
exports.param = param;
|
|
9
|
+
exports.qs = qs;
|
|
10
|
+
var _mapOwn = require("../util/map-own");
|
|
11
|
+
var _stringify = require("../util/stringify");
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
14
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Characters that are safe in a qs, but get encoded.
|
|
18
|
+
var charMap = {
|
|
19
|
+
'%2C': ',',
|
|
20
|
+
'%3A': ':',
|
|
21
|
+
'%2F': '/',
|
|
22
|
+
'%40': '@',
|
|
23
|
+
'%24': '$',
|
|
24
|
+
'%3B': ';'
|
|
25
|
+
};
|
|
26
|
+
var charList = (0, _mapOwn.mapOwn)(charMap, function (k) {
|
|
27
|
+
return k;
|
|
28
|
+
});
|
|
29
|
+
var safeEncoded = new RegExp(charList.join('|'), 'g');
|
|
30
|
+
function real(c) {
|
|
31
|
+
return charMap[c];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Encode as URI Component, then unescape anything that is ok in the
|
|
35
|
+
// query string position.
|
|
36
|
+
function qs(value) {
|
|
37
|
+
if (value === null || value === undefined) return 'null';
|
|
38
|
+
return encodeURIComponent(value).replace(safeEncoded, real);
|
|
39
|
+
}
|
|
40
|
+
function fromArray(qs, maxBytes) {
|
|
41
|
+
var bytes = 0;
|
|
42
|
+
for (var i = 0; i < qs.length; i++) {
|
|
43
|
+
bytes += qs[i].length;
|
|
44
|
+
if (bytes > maxBytes) return qs.slice(0, i).join('');
|
|
45
|
+
}
|
|
46
|
+
return qs.join('');
|
|
47
|
+
}
|
|
48
|
+
function obj(payload, maxBytes) {
|
|
49
|
+
var total = 0;
|
|
50
|
+
var result = '';
|
|
51
|
+
(0, _mapOwn.mapOwn)(payload, function (feature, dataArray) {
|
|
52
|
+
var intermediate = [];
|
|
53
|
+
var next;
|
|
54
|
+
var i;
|
|
55
|
+
if (typeof dataArray === 'string') {
|
|
56
|
+
next = '&' + feature + '=' + qs(dataArray);
|
|
57
|
+
total += next.length;
|
|
58
|
+
result += next;
|
|
59
|
+
} else if (dataArray.length) {
|
|
60
|
+
total += 9;
|
|
61
|
+
for (i = 0; i < dataArray.length; i++) {
|
|
62
|
+
next = qs((0, _stringify.stringify)(dataArray[i]));
|
|
63
|
+
total += next.length;
|
|
64
|
+
if (typeof maxBytes !== 'undefined' && total >= maxBytes) break;
|
|
65
|
+
intermediate.push(next);
|
|
66
|
+
}
|
|
67
|
+
result += '&' + feature + '=%5B' + intermediate.join(',') + '%5D';
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Constructs an HTTP parameter to add to the BAM router URL
|
|
74
|
+
function param(name, value) {
|
|
75
|
+
if (value && typeof value === 'string') {
|
|
76
|
+
return '&' + name + '=' + qs(value);
|
|
77
|
+
}
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLocation = getLocation;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function getLocation() {
|
|
13
|
+
return '' + location;
|
|
14
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseUrl = parseUrl;
|
|
7
|
+
var _globalScope = require("../util/global-scope");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
10
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var stringsToParsedUrls = {};
|
|
14
|
+
function parseUrl(url) {
|
|
15
|
+
if (url in stringsToParsedUrls) {
|
|
16
|
+
return stringsToParsedUrls[url];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Return if URL is a data URL, parseUrl assumes urls are http/https
|
|
20
|
+
if ((url || '').indexOf('data:') === 0) {
|
|
21
|
+
return {
|
|
22
|
+
protocol: 'data'
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
let urlEl;
|
|
26
|
+
var location = _globalScope.globalScope?.location;
|
|
27
|
+
var ret = {};
|
|
28
|
+
if (_globalScope.isBrowserScope) {
|
|
29
|
+
// Use an anchor dom element to resolve the url natively.
|
|
30
|
+
urlEl = document.createElement('a');
|
|
31
|
+
urlEl.href = url;
|
|
32
|
+
} else {
|
|
33
|
+
try {
|
|
34
|
+
urlEl = new URL(url, location.href);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
return ret;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
ret.port = urlEl.port;
|
|
40
|
+
var firstSplit = urlEl.href.split('://');
|
|
41
|
+
if (!ret.port && firstSplit[1]) {
|
|
42
|
+
ret.port = firstSplit[1].split('/')[0].split('@').pop().split(':')[1];
|
|
43
|
+
}
|
|
44
|
+
if (!ret.port || ret.port === '0') ret.port = firstSplit[0] === 'https' ? '443' : '80';
|
|
45
|
+
|
|
46
|
+
// Host not provided in IE for relative urls
|
|
47
|
+
ret.hostname = urlEl.hostname || location.hostname;
|
|
48
|
+
ret.pathname = urlEl.pathname;
|
|
49
|
+
ret.protocol = firstSplit[0];
|
|
50
|
+
|
|
51
|
+
// Pathname sometimes doesn't have leading slash (IE 8 and 9)
|
|
52
|
+
if (ret.pathname.charAt(0) !== '/') ret.pathname = '/' + ret.pathname;
|
|
53
|
+
|
|
54
|
+
// urlEl.protocol is ':' in old ie when protocol is not specified
|
|
55
|
+
var sameProtocol = !urlEl.protocol || urlEl.protocol === ':' || urlEl.protocol === location.protocol;
|
|
56
|
+
var sameDomain = urlEl.hostname === location.hostname && urlEl.port === location.port;
|
|
57
|
+
|
|
58
|
+
// urlEl.hostname is not provided by IE for relative urls, but relative urls are also same-origin
|
|
59
|
+
ret.sameOrigin = sameProtocol && (!urlEl.hostname || sameDomain);
|
|
60
|
+
|
|
61
|
+
// Only cache if url doesn't have a path
|
|
62
|
+
if (ret.pathname === '/') {
|
|
63
|
+
stringsToParsedUrls[url] = ret;
|
|
64
|
+
}
|
|
65
|
+
return ret;
|
|
66
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.protocol = void 0;
|
|
7
|
+
var _globalScope = require("../util/global-scope");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
10
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const protocol = {
|
|
14
|
+
isFileProtocol: isFileProtocol,
|
|
15
|
+
supportabilityMetricSent: false
|
|
16
|
+
};
|
|
17
|
+
exports.protocol = protocol;
|
|
18
|
+
function isFileProtocol() {
|
|
19
|
+
let isFile = Boolean((0, _globalScope.getGlobalScope)()?.location?.protocol === 'file:');
|
|
20
|
+
if (isFile) {
|
|
21
|
+
//metrics.recordSupportability('Generic/FileProtocol/Detected') -- may be implemented later? Probably make sure it's once per window
|
|
22
|
+
protocol.supportabilityMetricSent = true;
|
|
23
|
+
}
|
|
24
|
+
return isFile;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.warn = warn;
|
|
7
|
+
/**
|
|
8
|
+
* A helper method to warn to the console with New Relic: decoration
|
|
9
|
+
* @param {string} message - The primary message to warn
|
|
10
|
+
* @param {*} secondary - Secondary data to include, usually an error or object
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
function warn(message, secondary) {
|
|
14
|
+
if (typeof console.warn !== 'function') return;
|
|
15
|
+
console.warn(`New Relic: ${message}`);
|
|
16
|
+
if (secondary) console.warn(secondary);
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dataSize = dataSize;
|
|
7
|
+
var _stringify = require("./stringify");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
10
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function dataSize(data) {
|
|
14
|
+
if (typeof data === 'string' && data.length) return data.length;
|
|
15
|
+
if (typeof data !== 'object') return undefined;
|
|
16
|
+
// eslint-disable-next-line
|
|
17
|
+
if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer && data.byteLength) return data.byteLength;
|
|
18
|
+
if (typeof Blob !== 'undefined' && data instanceof Blob && data.size) return data.size;
|
|
19
|
+
if (typeof FormData !== 'undefined' && data instanceof FormData) return undefined;
|
|
20
|
+
try {
|
|
21
|
+
return (0, _stringify.stringify)(data).length;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|