@newrelic/browser-agent 1.263.0 → 1.265.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +2 -2
- package/dist/cjs/cdn/experimental.js +3 -7
- package/dist/cjs/cdn/pro.js +2 -2
- package/dist/cjs/cdn/spa.js +2 -2
- package/dist/cjs/common/aggregate/aggregator.js +2 -3
- package/dist/cjs/common/config/{state/configurable.js → configurable.js} +1 -1
- package/dist/cjs/common/config/{state/info.js → info.js} +1 -1
- package/dist/cjs/common/config/{state/init.js → init.js} +11 -8
- package/dist/cjs/common/config/{state/loader-config.js → loader-config.js} +1 -1
- package/dist/cjs/common/config/{state/runtime.js → runtime.js} +16 -5
- package/dist/cjs/common/constants/agent-constants.js +8 -0
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +1 -3
- package/dist/cjs/common/context/shared-context.js +1 -2
- package/dist/cjs/common/dispatch/global-event.js +1 -2
- package/dist/cjs/common/drain/drain.js +12 -18
- package/dist/cjs/common/event-emitter/contextual-ee.js +3 -4
- package/dist/cjs/common/event-listener/event-listener-opts.js +2 -6
- package/dist/cjs/common/harvest/harvest-scheduler.js +1 -2
- package/dist/cjs/common/harvest/harvest.js +30 -57
- package/dist/cjs/common/serialize/bel-serializer.js +6 -11
- package/dist/cjs/common/session/session-entity.js +10 -13
- package/dist/cjs/common/timing/nav-timing.js +1 -3
- package/dist/cjs/common/timing/time-keeper.js +16 -6
- package/dist/cjs/common/url/encode.js +3 -7
- package/dist/cjs/common/util/console.js +2 -0
- package/dist/cjs/common/util/invoke.js +6 -16
- package/dist/cjs/common/util/obfuscate.js +97 -53
- package/dist/cjs/common/util/submit-data.js +17 -21
- package/dist/cjs/common/util/text.js +9 -0
- package/dist/cjs/common/util/traverse.js +1 -3
- package/dist/cjs/common/vitals/cumulative-layout-shift.js +5 -6
- package/dist/cjs/common/vitals/first-contentful-paint.js +4 -5
- package/dist/cjs/common/vitals/first-input-delay.js +4 -5
- package/dist/cjs/common/vitals/interaction-to-next-paint.js +5 -6
- package/dist/cjs/common/vitals/largest-contentful-paint.js +4 -5
- package/dist/cjs/common/vitals/time-to-first-byte.js +4 -5
- package/dist/cjs/common/vitals/vital-metric.js +5 -7
- package/dist/cjs/common/window/nreum.js +2 -1
- package/dist/cjs/common/window/page-visibility.js +1 -4
- package/dist/cjs/common/wrap/wrap-events.js +1 -4
- package/dist/cjs/common/wrap/wrap-promise.js +1 -4
- package/dist/cjs/common/wrap/wrap-websocket.js +74 -0
- package/dist/cjs/features/ajax/aggregate/chunk.js +4 -3
- package/dist/cjs/features/ajax/aggregate/gql.js +4 -5
- package/dist/cjs/features/ajax/aggregate/index.js +19 -22
- package/dist/cjs/features/ajax/constants.js +2 -3
- package/dist/cjs/features/ajax/instrument/distributed-tracing.js +9 -8
- package/dist/cjs/features/ajax/instrument/index.js +14 -12
- package/dist/cjs/features/generic_events/aggregate/index.js +128 -0
- package/dist/cjs/features/generic_events/constants.js +10 -0
- package/dist/cjs/features/generic_events/index.js +12 -0
- package/dist/cjs/features/generic_events/instrument/index.js +27 -0
- package/dist/cjs/features/jserrors/aggregate/index.js +25 -44
- package/dist/cjs/features/jserrors/instrument/index.js +4 -4
- package/dist/cjs/features/logging/aggregate/index.js +33 -36
- package/dist/cjs/features/logging/constants.js +2 -3
- package/dist/cjs/features/logging/instrument/index.js +5 -6
- package/dist/cjs/features/logging/shared/log.js +1 -3
- package/dist/cjs/features/logging/shared/utils.js +2 -4
- package/dist/cjs/features/metrics/aggregate/index.js +34 -17
- package/dist/cjs/features/metrics/aggregate/websocket-detection.js +34 -0
- package/dist/cjs/features/metrics/constants.js +4 -2
- package/dist/cjs/features/metrics/instrument/index.js +12 -4
- package/dist/cjs/features/page_action/instrument/index.js +14 -10
- package/dist/cjs/features/page_view_event/aggregate/index.js +19 -39
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/cjs/features/page_view_event/instrument/index.js +4 -4
- package/dist/cjs/features/page_view_timing/aggregate/index.js +23 -39
- package/dist/cjs/features/page_view_timing/instrument/index.js +4 -4
- package/dist/cjs/features/session_replay/aggregate/index.js +35 -42
- package/dist/cjs/features/session_replay/constants.js +1 -5
- package/dist/cjs/features/session_replay/instrument/index.js +5 -9
- package/dist/cjs/features/session_replay/shared/recorder-events.js +25 -20
- package/dist/cjs/features/session_replay/shared/recorder.js +17 -13
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +2 -2
- package/dist/cjs/features/session_replay/shared/utils.js +5 -4
- package/dist/cjs/features/session_trace/aggregate/index.js +25 -42
- package/dist/cjs/features/session_trace/aggregate/trace/storage.js +5 -3
- package/dist/cjs/features/session_trace/instrument/index.js +8 -7
- package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/index.js +22 -30
- package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +2 -2
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +4 -5
- package/dist/cjs/features/soft_navigations/instrument/index.js +14 -13
- package/dist/cjs/features/spa/aggregate/index.js +17 -28
- package/dist/cjs/features/spa/aggregate/interaction.js +7 -6
- package/dist/cjs/features/spa/aggregate/serializer.js +4 -5
- package/dist/cjs/features/spa/constants.js +2 -2
- package/dist/cjs/features/spa/instrument/index.js +20 -19
- package/dist/cjs/features/utils/agent-session.js +6 -4
- package/dist/cjs/features/utils/aggregate-base.js +17 -10
- package/dist/cjs/features/utils/event-buffer.js +132 -0
- package/dist/cjs/features/utils/feature-gates.js +2 -2
- package/dist/cjs/features/utils/instrument-base.js +7 -8
- package/dist/cjs/features/utils/lazy-feature-loader.js +12 -12
- package/dist/cjs/features/utils/nr1-debugger.js +1 -3
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/loaders/agent-base.js +4 -12
- package/dist/cjs/loaders/agent.js +7 -2
- package/dist/cjs/loaders/api/api.js +23 -35
- package/dist/cjs/loaders/api/apiAsync.js +10 -13
- package/dist/cjs/loaders/browser-agent.js +4 -3
- package/dist/cjs/loaders/configure/configure.js +16 -15
- package/dist/cjs/loaders/features/enabled-features.js +2 -2
- package/dist/cjs/loaders/features/features.js +8 -4
- package/dist/cjs/loaders/micro-agent.js +16 -15
- package/dist/esm/cdn/experimental.js +2 -5
- package/dist/esm/cdn/pro.js +2 -2
- package/dist/esm/cdn/spa.js +2 -2
- package/dist/esm/common/aggregate/aggregator.js +2 -3
- package/dist/esm/common/config/{state/configurable.js → configurable.js} +1 -1
- package/dist/esm/common/config/{state/info.js → info.js} +1 -1
- package/dist/esm/common/config/{state/init.js → init.js} +11 -8
- package/dist/esm/common/config/{state/loader-config.js → loader-config.js} +1 -1
- package/dist/esm/common/config/{state/runtime.js → runtime.js} +17 -5
- package/dist/esm/common/constants/agent-constants.js +2 -0
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +0 -2
- package/dist/esm/common/context/shared-context.js +1 -2
- package/dist/esm/common/dispatch/global-event.js +1 -2
- package/dist/esm/common/drain/drain.js +12 -18
- package/dist/esm/common/event-emitter/contextual-ee.js +2 -3
- package/dist/esm/common/event-listener/event-listener-opts.js +2 -6
- package/dist/esm/common/harvest/harvest-scheduler.js +1 -2
- package/dist/esm/common/harvest/harvest.js +24 -51
- package/dist/esm/common/serialize/bel-serializer.js +6 -11
- package/dist/esm/common/session/session-entity.js +10 -13
- package/dist/esm/common/timing/nav-timing.js +1 -3
- package/dist/esm/common/timing/time-keeper.js +15 -5
- package/dist/esm/common/url/encode.js +3 -7
- package/dist/esm/common/util/console.js +2 -0
- package/dist/esm/common/util/invoke.js +6 -16
- package/dist/esm/common/util/obfuscate.js +96 -49
- package/dist/esm/common/util/submit-data.js +17 -21
- package/dist/esm/common/util/text.js +3 -0
- package/dist/esm/common/util/traverse.js +1 -3
- package/dist/esm/common/vitals/cumulative-layout-shift.js +5 -6
- package/dist/esm/common/vitals/first-contentful-paint.js +4 -5
- package/dist/esm/common/vitals/first-input-delay.js +4 -5
- package/dist/esm/common/vitals/interaction-to-next-paint.js +5 -6
- package/dist/esm/common/vitals/largest-contentful-paint.js +4 -5
- package/dist/esm/common/vitals/time-to-first-byte.js +4 -5
- package/dist/esm/common/vitals/vital-metric.js +5 -7
- package/dist/esm/common/window/nreum.js +2 -1
- package/dist/esm/common/window/page-visibility.js +1 -4
- package/dist/esm/common/wrap/wrap-events.js +1 -4
- package/dist/esm/common/wrap/wrap-promise.js +1 -4
- package/dist/esm/common/wrap/wrap-websocket.js +67 -0
- package/dist/esm/features/ajax/aggregate/chunk.js +3 -2
- package/dist/esm/features/ajax/aggregate/gql.js +4 -5
- package/dist/esm/features/ajax/aggregate/index.js +16 -19
- package/dist/esm/features/ajax/constants.js +1 -2
- package/dist/esm/features/ajax/instrument/distributed-tracing.js +2 -1
- package/dist/esm/features/ajax/instrument/index.js +10 -8
- package/dist/esm/features/generic_events/aggregate/index.js +120 -0
- package/dist/esm/features/generic_events/constants.js +4 -0
- package/dist/esm/features/generic_events/index.js +1 -0
- package/dist/esm/features/generic_events/instrument/index.js +20 -0
- package/dist/esm/features/jserrors/aggregate/index.js +20 -39
- package/dist/esm/features/jserrors/instrument/index.js +3 -3
- package/dist/esm/features/logging/aggregate/index.js +31 -34
- package/dist/esm/features/logging/constants.js +1 -2
- package/dist/esm/features/logging/instrument/index.js +4 -5
- package/dist/esm/features/logging/shared/log.js +1 -3
- package/dist/esm/features/logging/shared/utils.js +2 -4
- package/dist/esm/features/metrics/aggregate/index.js +28 -11
- package/dist/esm/features/metrics/aggregate/websocket-detection.js +29 -0
- package/dist/esm/features/metrics/constants.js +3 -1
- package/dist/esm/features/metrics/instrument/index.js +12 -4
- package/dist/esm/features/page_action/instrument/index.js +14 -9
- package/dist/esm/features/page_view_event/aggregate/index.js +17 -37
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/esm/features/page_view_event/instrument/index.js +3 -3
- package/dist/esm/features/page_view_timing/aggregate/index.js +20 -36
- package/dist/esm/features/page_view_timing/instrument/index.js +3 -3
- package/dist/esm/features/session_replay/aggregate/index.js +25 -32
- package/dist/esm/features/session_replay/constants.js +0 -4
- package/dist/esm/features/session_replay/index.js +1 -7
- package/dist/esm/features/session_replay/instrument/index.js +5 -8
- package/dist/esm/features/session_replay/shared/recorder-events.js +25 -20
- package/dist/esm/features/session_replay/shared/recorder.js +14 -10
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +2 -2
- package/dist/esm/features/session_replay/shared/utils.js +3 -2
- package/dist/esm/features/session_trace/aggregate/index.js +20 -37
- package/dist/esm/features/session_trace/aggregate/trace/storage.js +5 -3
- package/dist/esm/features/session_trace/instrument/index.js +5 -4
- package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/index.js +21 -29
- package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +2 -3
- package/dist/esm/features/soft_navigations/instrument/index.js +11 -10
- package/dist/esm/features/spa/aggregate/index.js +11 -22
- package/dist/esm/features/spa/aggregate/interaction.js +6 -5
- package/dist/esm/features/spa/aggregate/serializer.js +2 -3
- package/dist/esm/features/spa/constants.js +2 -2
- package/dist/esm/features/spa/instrument/index.js +12 -11
- package/dist/esm/features/utils/agent-session.js +3 -1
- package/dist/esm/features/utils/aggregate-base.js +16 -9
- package/dist/esm/features/utils/event-buffer.js +126 -0
- package/dist/esm/features/utils/feature-gates.js +1 -1
- package/dist/esm/features/utils/instrument-base.js +6 -7
- package/dist/esm/features/utils/lazy-feature-loader.js +12 -12
- package/dist/esm/features/utils/nr1-debugger.js +1 -3
- package/dist/esm/index.js +3 -0
- package/dist/esm/loaders/agent-base.js +4 -12
- package/dist/esm/loaders/agent.js +7 -2
- package/dist/esm/loaders/api/api.js +18 -30
- package/dist/esm/loaders/api/apiAsync.js +3 -6
- package/dist/esm/loaders/browser-agent.js +3 -2
- package/dist/esm/loaders/configure/configure.js +9 -8
- package/dist/esm/loaders/features/enabled-features.js +1 -1
- package/dist/esm/loaders/features/features.js +8 -4
- package/dist/esm/loaders/micro-agent.js +11 -10
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
- package/dist/types/common/config/configurable.d.ts.map +1 -0
- package/dist/types/common/config/info.d.ts.map +1 -0
- package/dist/types/common/config/init.d.ts.map +1 -0
- package/dist/types/common/config/loader-config.d.ts.map +1 -0
- package/dist/types/common/config/runtime.d.ts.map +1 -0
- package/dist/types/common/constants/agent-constants.d.ts +3 -0
- package/dist/types/common/constants/agent-constants.d.ts.map +1 -0
- package/dist/types/common/constants/runtime.d.ts +0 -1
- package/dist/types/common/constants/runtime.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts +1 -7
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
- package/dist/types/common/timing/time-keeper.d.ts +9 -2
- package/dist/types/common/timing/time-keeper.d.ts.map +1 -1
- package/dist/types/common/url/encode.d.ts.map +1 -1
- package/dist/types/common/util/console.d.ts.map +1 -1
- package/dist/types/common/util/obfuscate.d.ts +78 -6
- package/dist/types/common/util/obfuscate.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/common/util/text.d.ts +2 -0
- package/dist/types/common/util/text.d.ts.map +1 -0
- package/dist/types/common/window/nreum.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-websocket.d.ts +4 -0
- package/dist/types/common/wrap/wrap-websocket.d.ts.map +1 -0
- package/dist/types/features/ajax/aggregate/chunk.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +2 -3
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/ajax/constants.d.ts +0 -1
- package/dist/types/features/ajax/constants.d.ts.map +1 -1
- package/dist/types/features/ajax/instrument/distributed-tracing.d.ts.map +1 -1
- package/dist/types/features/ajax/instrument/index.d.ts +1 -0
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
- package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +10 -10
- package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/constants.d.ts +4 -0
- package/dist/types/features/generic_events/constants.d.ts.map +1 -0
- package/dist/types/features/generic_events/index.d.ts +2 -0
- package/dist/types/features/generic_events/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/instrument/index.d.ts +7 -0
- package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts +2 -2
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/index.d.ts +1 -0
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -1
- package/dist/types/features/logging/aggregate/index.d.ts +4 -7
- package/dist/types/features/logging/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/logging/constants.d.ts +0 -1
- package/dist/types/features/logging/constants.d.ts.map +1 -1
- package/dist/types/features/logging/instrument/index.d.ts +1 -0
- package/dist/types/features/logging/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/websocket-detection.d.ts +12 -0
- package/dist/types/features/metrics/aggregate/websocket-detection.d.ts.map +1 -0
- package/dist/types/features/metrics/constants.d.ts +1 -0
- package/dist/types/features/metrics/constants.d.ts.map +1 -1
- package/dist/types/features/metrics/instrument/index.d.ts +1 -0
- package/dist/types/features/metrics/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_action/instrument/index.d.ts +9 -4
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/instrument/index.d.ts +1 -0
- package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/instrument/index.d.ts +1 -0
- package/dist/types/features/page_view_timing/instrument/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/constants.d.ts +0 -4
- package/dist/types/features/session_replay/constants.d.ts.map +1 -1
- package/dist/types/features/session_replay/instrument/index.d.ts +1 -0
- package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/recorder-events.d.ts +6 -6
- package/dist/types/features/session_replay/shared/recorder-events.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/recorder.d.ts +2 -2
- package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/utils.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/index.d.ts +2 -2
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/trace/storage.d.ts +1 -1
- package/dist/types/features/session_trace/aggregate/trace/storage.d.ts.map +1 -1
- package/dist/types/features/session_trace/instrument/index.d.ts +1 -0
- package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/aggregate/index.d.ts +3 -3
- package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/instrument/index.d.ts +1 -0
- package/dist/types/features/soft_navigations/instrument/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts +2 -2
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
- package/dist/types/features/spa/constants.d.ts.map +1 -1
- package/dist/types/features/spa/instrument/index.d.ts +1 -0
- package/dist/types/features/spa/instrument/index.d.ts.map +1 -1
- package/dist/types/features/utils/agent-session.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts +1 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/features/utils/event-buffer.d.ts +72 -0
- package/dist/types/features/utils/event-buffer.d.ts.map +1 -0
- package/dist/types/features/utils/instrument-base.d.ts +1 -0
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/loaders/agent-base.d.ts +1 -2
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/browser-agent.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +1 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +67 -52
- package/src/cdn/experimental.js +2 -4
- package/src/cdn/pro.js +2 -2
- package/src/cdn/spa.js +2 -2
- package/src/common/aggregate/aggregator.js +2 -3
- package/src/common/config/__mocks__/info.js +3 -0
- package/src/common/config/__mocks__/init.js +3 -0
- package/src/common/config/__mocks__/loader-config.js +2 -0
- package/src/common/config/__mocks__/runtime.js +2 -0
- package/src/common/config/{state/configurable.js → configurable.js} +1 -1
- package/src/common/config/{state/info.js → info.js} +1 -1
- package/src/common/config/{state/init.js → init.js} +7 -6
- package/src/common/config/{state/loader-config.js → loader-config.js} +1 -1
- package/src/common/config/{state/runtime.js → runtime.js} +19 -5
- package/src/common/constants/agent-constants.js +2 -0
- package/src/common/constants/runtime.js +0 -2
- package/src/common/drain/drain.js +8 -6
- package/src/common/event-emitter/contextual-ee.js +1 -1
- package/src/common/harvest/harvest.js +10 -24
- package/src/common/serialize/bel-serializer.js +6 -9
- package/src/common/session/session-entity.js +4 -4
- package/src/common/timing/__mocks__/time-keeper.js +6 -2
- package/src/common/timing/time-keeper.js +15 -5
- package/src/common/url/encode.js +2 -3
- package/src/common/util/__mocks__/console.js +1 -0
- package/src/common/util/__mocks__/obfuscate.js +5 -8
- package/src/common/util/console.js +2 -0
- package/src/common/util/obfuscate.js +94 -50
- package/src/common/util/submit-data.js +0 -1
- package/src/common/util/text.js +6 -0
- package/src/common/window/__mocks__/nreum.js +1 -1
- package/src/common/window/nreum.js +2 -1
- package/src/common/wrap/wrap-websocket.js +73 -0
- package/src/features/ajax/aggregate/chunk.js +3 -2
- package/src/features/ajax/aggregate/index.js +20 -19
- package/src/features/ajax/constants.js +0 -2
- package/src/features/ajax/instrument/distributed-tracing.js +2 -1
- package/src/features/ajax/instrument/index.js +9 -5
- package/src/features/generic_events/aggregate/index.js +139 -0
- package/src/features/generic_events/constants.js +5 -0
- package/src/features/generic_events/index.js +1 -0
- package/src/features/generic_events/instrument/index.js +24 -0
- package/src/features/jserrors/aggregate/index.js +18 -9
- package/src/features/jserrors/instrument/index.js +2 -0
- package/src/features/logging/aggregate/index.js +39 -31
- package/src/features/logging/constants.js +0 -2
- package/src/features/logging/instrument/index.js +2 -0
- package/src/features/logging/shared/utils.js +1 -1
- package/src/features/metrics/aggregate/index.js +24 -9
- package/src/features/metrics/aggregate/websocket-detection.js +31 -0
- package/src/features/metrics/constants.js +3 -0
- package/src/features/metrics/instrument/index.js +13 -1
- package/src/features/page_action/instrument/index.js +11 -6
- package/src/features/page_view_event/aggregate/index.js +8 -23
- package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/src/features/page_view_event/instrument/index.js +2 -0
- package/src/features/page_view_timing/aggregate/index.js +15 -18
- package/src/features/page_view_timing/instrument/index.js +2 -0
- package/src/features/session_replay/aggregate/index.js +13 -9
- package/src/features/session_replay/constants.js +0 -4
- package/src/features/session_replay/index.js +1 -7
- package/src/features/session_replay/instrument/index.js +3 -4
- package/src/features/session_replay/shared/recorder-events.js +27 -20
- package/src/features/session_replay/shared/recorder.js +13 -6
- package/src/features/session_replay/shared/stylesheet-evaluator.js +2 -2
- package/src/features/session_replay/shared/utils.js +3 -2
- package/src/features/session_trace/aggregate/index.js +16 -7
- package/src/features/session_trace/aggregate/trace/storage.js +6 -1
- package/src/features/session_trace/instrument/index.js +4 -1
- package/src/features/soft_navigations/aggregate/ajax-node.js +1 -1
- package/src/features/soft_navigations/aggregate/index.js +13 -15
- package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
- package/src/features/soft_navigations/aggregate/interaction.js +1 -1
- package/src/features/soft_navigations/instrument/index.js +9 -5
- package/src/features/spa/aggregate/index.js +12 -20
- package/src/features/spa/aggregate/interaction.js +6 -5
- package/src/features/spa/aggregate/serializer.js +2 -3
- package/src/features/spa/constants.js +2 -2
- package/src/features/spa/instrument/index.js +9 -3
- package/src/features/utils/agent-session.js +3 -1
- package/src/features/utils/aggregate-base.js +13 -3
- package/src/features/utils/event-buffer.js +126 -0
- package/src/features/utils/feature-gates.js +1 -1
- package/src/features/utils/instrument-base.js +2 -1
- package/src/features/utils/lazy-feature-loader.js +2 -2
- package/src/index.js +3 -0
- package/src/loaders/agent-base.js +2 -6
- package/src/loaders/agent.js +7 -2
- package/src/loaders/api/api.js +3 -2
- package/src/loaders/api/apiAsync.js +2 -2
- package/src/loaders/browser-agent.js +5 -3
- package/src/loaders/configure/configure.js +9 -2
- package/src/loaders/features/enabled-features.js +1 -1
- package/src/loaders/features/features.js +8 -4
- package/src/loaders/micro-agent.js +5 -2
- package/dist/cjs/cdn/polyfills/lite.js +0 -16
- package/dist/cjs/cdn/polyfills/pro.js +0 -21
- package/dist/cjs/cdn/polyfills/spa.js +0 -22
- package/dist/cjs/cdn/polyfills.js +0 -24
- package/dist/cjs/common/config/config.js +0 -76
- package/dist/cjs/common/config/state/originals.js +0 -8
- package/dist/cjs/common/util/map-own.js +0 -31
- package/dist/cjs/common/wrap/index.js +0 -61
- package/dist/cjs/features/page_action/aggregate/index.js +0 -121
- package/dist/esm/cdn/polyfills/lite.js +0 -14
- package/dist/esm/cdn/polyfills/pro.js +0 -19
- package/dist/esm/cdn/polyfills/spa.js +0 -20
- package/dist/esm/cdn/polyfills.js +0 -27
- package/dist/esm/common/config/config.js +0 -11
- package/dist/esm/common/config/state/originals.js +0 -2
- package/dist/esm/common/util/map-own.js +0 -24
- package/dist/esm/common/wrap/index.js +0 -13
- package/dist/esm/features/page_action/aggregate/index.js +0 -114
- package/dist/types/cdn/polyfills/lite.d.ts +0 -2
- package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/pro.d.ts +0 -2
- package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/spa.d.ts +0 -2
- package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
- package/dist/types/cdn/polyfills.d.ts +0 -2
- package/dist/types/cdn/polyfills.d.ts.map +0 -1
- package/dist/types/common/config/config.d.ts +0 -13
- package/dist/types/common/config/config.d.ts.map +0 -1
- package/dist/types/common/config/state/configurable.d.ts.map +0 -1
- package/dist/types/common/config/state/info.d.ts.map +0 -1
- package/dist/types/common/config/state/init.d.ts.map +0 -1
- package/dist/types/common/config/state/loader-config.d.ts.map +0 -1
- package/dist/types/common/config/state/originals.d.ts +0 -2
- package/dist/types/common/config/state/originals.d.ts.map +0 -1
- package/dist/types/common/config/state/runtime.d.ts.map +0 -1
- package/dist/types/common/util/map-own.d.ts +0 -3
- package/dist/types/common/util/map-own.d.ts.map +0 -1
- package/dist/types/common/wrap/index.d.ts +0 -10
- package/dist/types/common/wrap/index.d.ts.map +0 -1
- package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
- package/src/cdn/polyfills/lite.js +0 -20
- package/src/cdn/polyfills/pro.js +0 -30
- package/src/cdn/polyfills/spa.js +0 -32
- package/src/cdn/polyfills.js +0 -27
- package/src/common/config/__mocks__/config.js +0 -11
- package/src/common/config/config.js +0 -12
- package/src/common/config/state/originals.js +0 -3
- package/src/common/util/map-own.js +0 -22
- package/src/common/wrap/index.js +0 -16
- package/src/features/page_action/aggregate/index.js +0 -114
- /package/dist/types/common/config/{state/configurable.d.ts → configurable.d.ts} +0 -0
- /package/dist/types/common/config/{state/info.d.ts → info.d.ts} +0 -0
- /package/dist/types/common/config/{state/init.d.ts → init.d.ts} +0 -0
- /package/dist/types/common/config/{state/loader-config.d.ts → loader-config.d.ts} +0 -0
- /package/dist/types/common/config/{state/runtime.d.ts → runtime.d.ts} +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "wrapEvents", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _wrapEvents.wrapEvents;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "wrapFetch", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _wrapFetch.wrapFetch;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "wrapHistory", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _wrapHistory.wrapHistory;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "wrapJsonP", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _wrapJsonp.wrapJsonP;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "wrapMutation", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _wrapMutation.wrapMutation;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "wrapPromise", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _wrapPromise.wrapPromise;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "wrapTimer", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _wrapTimer.wrapTimer;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "wrapXhr", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _wrapXhr.wrapXhr;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var _wrapEvents = require("./wrap-events");
|
|
55
|
-
var _wrapFetch = require("./wrap-fetch");
|
|
56
|
-
var _wrapHistory = require("./wrap-history");
|
|
57
|
-
var _wrapJsonp = require("./wrap-jsonp");
|
|
58
|
-
var _wrapMutation = require("./wrap-mutation");
|
|
59
|
-
var _wrapPromise = require("./wrap-promise");
|
|
60
|
-
var _wrapTimer = require("./wrap-timer");
|
|
61
|
-
var _wrapXhr = require("./wrap-xhr");
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Aggregate = void 0;
|
|
7
|
-
var _mapOwn = require("../../../common/util/map-own");
|
|
8
|
-
var _stringify = require("../../../common/util/stringify");
|
|
9
|
-
var _registerHandler = require("../../../common/event-emitter/register-handler");
|
|
10
|
-
var _harvestScheduler = require("../../../common/harvest/harvest-scheduler");
|
|
11
|
-
var _cleanUrl = require("../../../common/url/clean-url");
|
|
12
|
-
var _config = require("../../../common/config/config");
|
|
13
|
-
var _constants = require("../constants");
|
|
14
|
-
var _runtime = require("../../../common/constants/runtime");
|
|
15
|
-
var _aggregateBase = require("../../utils/aggregate-base");
|
|
16
|
-
var _drain = require("../../../common/drain/drain");
|
|
17
|
-
/*
|
|
18
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
19
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
class Aggregate extends _aggregateBase.AggregateBase {
|
|
23
|
-
static featureName = _constants.FEATURE_NAME;
|
|
24
|
-
constructor(agentIdentifier, aggregator) {
|
|
25
|
-
var _this;
|
|
26
|
-
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
27
|
-
_this = this;
|
|
28
|
-
this.eventsPerMinute = 240;
|
|
29
|
-
this.harvestTimeSeconds = (0, _config.getConfigurationValue)(this.agentIdentifier, 'page_action.harvestTimeSeconds') || (0, _config.getConfigurationValue)(this.agentIdentifier, 'ins.harvestTimeSeconds') || 30;
|
|
30
|
-
this.eventsPerHarvest = this.eventsPerMinute * this.harvestTimeSeconds / 60;
|
|
31
|
-
this.referrerUrl = undefined;
|
|
32
|
-
this.currentEvents = undefined;
|
|
33
|
-
this.events = [];
|
|
34
|
-
this.att = (0, _config.getInfo)(this.agentIdentifier).jsAttributes; // per-agent, aggregators-shared info context
|
|
35
|
-
|
|
36
|
-
if (_runtime.isBrowserScope && document.referrer) this.referrerUrl = (0, _cleanUrl.cleanURL)(document.referrer);
|
|
37
|
-
(0, _registerHandler.registerHandler)('api-addPageAction', function () {
|
|
38
|
-
return _this.addPageAction(...arguments);
|
|
39
|
-
}, this.featureName, this.ee);
|
|
40
|
-
this.waitForFlags(['ins']).then(_ref => {
|
|
41
|
-
let [insFlag] = _ref;
|
|
42
|
-
if (insFlag) {
|
|
43
|
-
const scheduler = new _harvestScheduler.HarvestScheduler('ins', {
|
|
44
|
-
onFinished: function () {
|
|
45
|
-
return _this.onHarvestFinished(...arguments);
|
|
46
|
-
}
|
|
47
|
-
}, this);
|
|
48
|
-
scheduler.harvest.on('ins', function () {
|
|
49
|
-
return _this.onHarvestStarted(...arguments);
|
|
50
|
-
});
|
|
51
|
-
scheduler.startTimer(this.harvestTimeSeconds, 0);
|
|
52
|
-
this.drain();
|
|
53
|
-
} else {
|
|
54
|
-
this.blocked = true; // if rum response determines that customer lacks entitlements for ins endpoint, this feature shouldn't harvest
|
|
55
|
-
(0, _drain.deregisterDrain)(this.agentIdentifier, this.featureName);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
onHarvestStarted(options) {
|
|
60
|
-
const {
|
|
61
|
-
userAttributes,
|
|
62
|
-
atts
|
|
63
|
-
} = (0, _config.getInfo)(this.agentIdentifier);
|
|
64
|
-
var payload = {
|
|
65
|
-
qs: {
|
|
66
|
-
ua: userAttributes,
|
|
67
|
-
at: atts
|
|
68
|
-
},
|
|
69
|
-
body: {
|
|
70
|
-
ins: this.events
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
if (options.retry) {
|
|
74
|
-
this.currentEvents = this.events;
|
|
75
|
-
}
|
|
76
|
-
this.events = [];
|
|
77
|
-
return payload;
|
|
78
|
-
}
|
|
79
|
-
onHarvestFinished(result) {
|
|
80
|
-
if (result && result.sent && result.retry && this.currentEvents) {
|
|
81
|
-
this.events = this.events.concat(this.currentEvents);
|
|
82
|
-
this.currentEvents = null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// WARNING: Insights times are in seconds. EXCEPT timestamp, which is in ms.
|
|
87
|
-
addPageAction(t, name, attributes) {
|
|
88
|
-
if (this.events.length >= this.eventsPerHarvest || this.blocked) return;
|
|
89
|
-
var width;
|
|
90
|
-
var height;
|
|
91
|
-
var eventAttributes = {};
|
|
92
|
-
if (_runtime.isBrowserScope && window.document.documentElement) {
|
|
93
|
-
// Doesn't include the nav bar when it disappears in mobile safari
|
|
94
|
-
// https://github.com/jquery/jquery/blob/10399ddcf8a239acc27bdec9231b996b178224d3/src/dimensions.js#L23
|
|
95
|
-
width = window.document.documentElement.clientWidth;
|
|
96
|
-
height = window.document.documentElement.clientHeight;
|
|
97
|
-
}
|
|
98
|
-
const agentRuntime = (0, _config.getRuntime)(this.agentIdentifier);
|
|
99
|
-
var defaults = {
|
|
100
|
-
timestamp: agentRuntime.timeKeeper.convertRelativeTimestamp(t),
|
|
101
|
-
timeSinceLoad: t / 1000,
|
|
102
|
-
browserWidth: width,
|
|
103
|
-
browserHeight: height,
|
|
104
|
-
referrerUrl: this.referrerUrl,
|
|
105
|
-
currentUrl: (0, _cleanUrl.cleanURL)('' + location),
|
|
106
|
-
pageUrl: (0, _cleanUrl.cleanURL)(agentRuntime.origin),
|
|
107
|
-
eventType: 'PageAction'
|
|
108
|
-
};
|
|
109
|
-
(0, _mapOwn.mapOwn)(defaults, set);
|
|
110
|
-
(0, _mapOwn.mapOwn)((0, _config.getInfo)(this.agentIdentifier).jsAttributes, set);
|
|
111
|
-
if (attributes && typeof attributes === 'object') {
|
|
112
|
-
(0, _mapOwn.mapOwn)(attributes, set);
|
|
113
|
-
}
|
|
114
|
-
eventAttributes.actionName = name || '';
|
|
115
|
-
this.events.push(eventAttributes);
|
|
116
|
-
function set(key, val) {
|
|
117
|
-
eventAttributes[key] = val && typeof val === 'object' ? (0, _stringify.stringify)(val) : val;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.Aggregate = Aggregate;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "Lite" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js';
|
|
7
|
-
import { Agent } from '../../loaders/agent';
|
|
8
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument';
|
|
9
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument';
|
|
10
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument';
|
|
11
|
-
new Agent({
|
|
12
|
-
features: [InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentMetrics],
|
|
13
|
-
loaderType: 'lite-polyfills'
|
|
14
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "PRO" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js';
|
|
7
|
-
import { Agent } from '../../loaders/agent';
|
|
8
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument';
|
|
9
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument';
|
|
10
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument';
|
|
11
|
-
import { Instrument as InstrumentErrors } from '../../features/jserrors/instrument';
|
|
12
|
-
import { Instrument as InstrumentXhr } from '../../features/ajax/instrument';
|
|
13
|
-
import { Instrument as InstrumentSessionTrace } from '../../features/session_trace/instrument';
|
|
14
|
-
import { Instrument as InstrumentPageAction } from '../../features/page_action/instrument';
|
|
15
|
-
import { Instrument as InstrumentLogs } from '../../features/logging/instrument';
|
|
16
|
-
new Agent({
|
|
17
|
-
features: [InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentXhr, InstrumentMetrics, InstrumentPageAction, InstrumentErrors, InstrumentLogs],
|
|
18
|
-
loaderType: 'pro-polyfills'
|
|
19
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "SPA" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js';
|
|
7
|
-
import { Agent } from '../../loaders/agent';
|
|
8
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument';
|
|
9
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument';
|
|
10
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument';
|
|
11
|
-
import { Instrument as InstrumentErrors } from '../../features/jserrors/instrument';
|
|
12
|
-
import { Instrument as InstrumentXhr } from '../../features/ajax/instrument';
|
|
13
|
-
import { Instrument as InstrumentSessionTrace } from '../../features/session_trace/instrument';
|
|
14
|
-
import { Instrument as InstrumentSpa } from '../../features/spa/instrument';
|
|
15
|
-
import { Instrument as InstrumentPageAction } from '../../features/page_action/instrument';
|
|
16
|
-
import { Instrument as InstrumentLogs } from '../../features/logging/instrument';
|
|
17
|
-
new Agent({
|
|
18
|
-
features: [InstrumentXhr, InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentMetrics, InstrumentPageAction, InstrumentErrors, InstrumentLogs, InstrumentSpa],
|
|
19
|
-
loaderType: 'spa-polyfills'
|
|
20
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Selectively imports {@link https://github.com/zloirock/core-js core-js}
|
|
3
|
-
* polyfills needed for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import 'core-js/stable/promise';
|
|
7
|
-
import 'core-js/stable/array/includes';
|
|
8
|
-
import 'core-js/stable/array/find';
|
|
9
|
-
import 'core-js/stable/array/flat';
|
|
10
|
-
import 'core-js/stable/array/flat-map';
|
|
11
|
-
import 'core-js/stable/array/from';
|
|
12
|
-
import 'core-js/stable/array/some';
|
|
13
|
-
import 'core-js/stable/array/find-index';
|
|
14
|
-
import 'core-js/stable/object/assign';
|
|
15
|
-
import 'core-js/stable/object/entries';
|
|
16
|
-
import 'core-js/stable/object/values';
|
|
17
|
-
import 'core-js/stable/object/from-entries';
|
|
18
|
-
import 'core-js/stable/map';
|
|
19
|
-
import 'core-js/stable/reflect';
|
|
20
|
-
import 'core-js/stable/set';
|
|
21
|
-
import 'core-js/stable/weak-set';
|
|
22
|
-
import 'core-js/stable/object/get-own-property-descriptors';
|
|
23
|
-
import 'core-js/stable/url';
|
|
24
|
-
import 'core-js/stable/url-search-params';
|
|
25
|
-
import 'core-js/stable/string/starts-with';
|
|
26
|
-
import 'core-js/stable/number/is-nan';
|
|
27
|
-
import 'core-js/stable/string/includes';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getInfo, isValid, setInfo } from './state/info';
|
|
2
|
-
import { getConfiguration, getConfigurationValue, setConfiguration } from './state/init';
|
|
3
|
-
import { getLoaderConfig, setLoaderConfig } from './state/loader-config';
|
|
4
|
-
import { originals } from './state/originals';
|
|
5
|
-
import { getRuntime, setRuntime } from './state/runtime';
|
|
6
|
-
function isConfigured(agentIdentifier) {
|
|
7
|
-
return isValid(agentIdentifier);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// This module acts as a hub that bundles the static and dynamic properties used by each agent instance into one single interface
|
|
11
|
-
export { getInfo, setInfo, getConfiguration, getConfigurationValue, setConfiguration, getLoaderConfig, setLoaderConfig, originals, getRuntime, setRuntime, isConfigured };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {function} MapOwnCallback
|
|
8
|
-
* @param {string} key Object key
|
|
9
|
-
* @param {any} value Object value
|
|
10
|
-
* @returns {any}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Iterates the own enumerable properties of an object passing the key and value pair to a given
|
|
15
|
-
* callback function.
|
|
16
|
-
* @param {object} obj Input object to iterate over. If null or undefined, an empty array will be returned.
|
|
17
|
-
* @param {MapOwnCallback} fn A callback function called for each property. The callback should take the key
|
|
18
|
-
* and value from the object iteration and return some value.
|
|
19
|
-
* @returns {any[]} An array of values returned by the callback function.
|
|
20
|
-
*/
|
|
21
|
-
export const mapOwn = (obj, fn) => Object.entries(obj || {}).map(_ref => {
|
|
22
|
-
let [key, value] = _ref;
|
|
23
|
-
return fn(key, value);
|
|
24
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Wraps assorted native objects and functions for instrumentation.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { wrapEvents } from './wrap-events';
|
|
6
|
-
import { wrapFetch } from './wrap-fetch';
|
|
7
|
-
import { wrapHistory } from './wrap-history';
|
|
8
|
-
import { wrapJsonP } from './wrap-jsonp';
|
|
9
|
-
import { wrapMutation } from './wrap-mutation';
|
|
10
|
-
import { wrapPromise } from './wrap-promise';
|
|
11
|
-
import { wrapTimer } from './wrap-timer';
|
|
12
|
-
import { wrapXhr } from './wrap-xhr';
|
|
13
|
-
export { wrapEvents, wrapFetch, wrapHistory, wrapJsonP, wrapMutation, wrapPromise, wrapTimer, wrapXhr };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { mapOwn } from '../../../common/util/map-own';
|
|
7
|
-
import { stringify } from '../../../common/util/stringify';
|
|
8
|
-
import { registerHandler as register } from '../../../common/event-emitter/register-handler';
|
|
9
|
-
import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
|
|
10
|
-
import { cleanURL } from '../../../common/url/clean-url';
|
|
11
|
-
import { getConfigurationValue, getInfo, getRuntime } from '../../../common/config/config';
|
|
12
|
-
import { FEATURE_NAME } from '../constants';
|
|
13
|
-
import { isBrowserScope } from '../../../common/constants/runtime';
|
|
14
|
-
import { AggregateBase } from '../../utils/aggregate-base';
|
|
15
|
-
import { deregisterDrain } from '../../../common/drain/drain';
|
|
16
|
-
export class Aggregate extends AggregateBase {
|
|
17
|
-
static featureName = FEATURE_NAME;
|
|
18
|
-
constructor(agentIdentifier, aggregator) {
|
|
19
|
-
var _this;
|
|
20
|
-
super(agentIdentifier, aggregator, FEATURE_NAME);
|
|
21
|
-
_this = this;
|
|
22
|
-
this.eventsPerMinute = 240;
|
|
23
|
-
this.harvestTimeSeconds = getConfigurationValue(this.agentIdentifier, 'page_action.harvestTimeSeconds') || getConfigurationValue(this.agentIdentifier, 'ins.harvestTimeSeconds') || 30;
|
|
24
|
-
this.eventsPerHarvest = this.eventsPerMinute * this.harvestTimeSeconds / 60;
|
|
25
|
-
this.referrerUrl = undefined;
|
|
26
|
-
this.currentEvents = undefined;
|
|
27
|
-
this.events = [];
|
|
28
|
-
this.att = getInfo(this.agentIdentifier).jsAttributes; // per-agent, aggregators-shared info context
|
|
29
|
-
|
|
30
|
-
if (isBrowserScope && document.referrer) this.referrerUrl = cleanURL(document.referrer);
|
|
31
|
-
register('api-addPageAction', function () {
|
|
32
|
-
return _this.addPageAction(...arguments);
|
|
33
|
-
}, this.featureName, this.ee);
|
|
34
|
-
this.waitForFlags(['ins']).then(_ref => {
|
|
35
|
-
let [insFlag] = _ref;
|
|
36
|
-
if (insFlag) {
|
|
37
|
-
const scheduler = new HarvestScheduler('ins', {
|
|
38
|
-
onFinished: function () {
|
|
39
|
-
return _this.onHarvestFinished(...arguments);
|
|
40
|
-
}
|
|
41
|
-
}, this);
|
|
42
|
-
scheduler.harvest.on('ins', function () {
|
|
43
|
-
return _this.onHarvestStarted(...arguments);
|
|
44
|
-
});
|
|
45
|
-
scheduler.startTimer(this.harvestTimeSeconds, 0);
|
|
46
|
-
this.drain();
|
|
47
|
-
} else {
|
|
48
|
-
this.blocked = true; // if rum response determines that customer lacks entitlements for ins endpoint, this feature shouldn't harvest
|
|
49
|
-
deregisterDrain(this.agentIdentifier, this.featureName);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
onHarvestStarted(options) {
|
|
54
|
-
const {
|
|
55
|
-
userAttributes,
|
|
56
|
-
atts
|
|
57
|
-
} = getInfo(this.agentIdentifier);
|
|
58
|
-
var payload = {
|
|
59
|
-
qs: {
|
|
60
|
-
ua: userAttributes,
|
|
61
|
-
at: atts
|
|
62
|
-
},
|
|
63
|
-
body: {
|
|
64
|
-
ins: this.events
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
if (options.retry) {
|
|
68
|
-
this.currentEvents = this.events;
|
|
69
|
-
}
|
|
70
|
-
this.events = [];
|
|
71
|
-
return payload;
|
|
72
|
-
}
|
|
73
|
-
onHarvestFinished(result) {
|
|
74
|
-
if (result && result.sent && result.retry && this.currentEvents) {
|
|
75
|
-
this.events = this.events.concat(this.currentEvents);
|
|
76
|
-
this.currentEvents = null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// WARNING: Insights times are in seconds. EXCEPT timestamp, which is in ms.
|
|
81
|
-
addPageAction(t, name, attributes) {
|
|
82
|
-
if (this.events.length >= this.eventsPerHarvest || this.blocked) return;
|
|
83
|
-
var width;
|
|
84
|
-
var height;
|
|
85
|
-
var eventAttributes = {};
|
|
86
|
-
if (isBrowserScope && window.document.documentElement) {
|
|
87
|
-
// Doesn't include the nav bar when it disappears in mobile safari
|
|
88
|
-
// https://github.com/jquery/jquery/blob/10399ddcf8a239acc27bdec9231b996b178224d3/src/dimensions.js#L23
|
|
89
|
-
width = window.document.documentElement.clientWidth;
|
|
90
|
-
height = window.document.documentElement.clientHeight;
|
|
91
|
-
}
|
|
92
|
-
const agentRuntime = getRuntime(this.agentIdentifier);
|
|
93
|
-
var defaults = {
|
|
94
|
-
timestamp: agentRuntime.timeKeeper.convertRelativeTimestamp(t),
|
|
95
|
-
timeSinceLoad: t / 1000,
|
|
96
|
-
browserWidth: width,
|
|
97
|
-
browserHeight: height,
|
|
98
|
-
referrerUrl: this.referrerUrl,
|
|
99
|
-
currentUrl: cleanURL('' + location),
|
|
100
|
-
pageUrl: cleanURL(agentRuntime.origin),
|
|
101
|
-
eventType: 'PageAction'
|
|
102
|
-
};
|
|
103
|
-
mapOwn(defaults, set);
|
|
104
|
-
mapOwn(getInfo(this.agentIdentifier).jsAttributes, set);
|
|
105
|
-
if (attributes && typeof attributes === 'object') {
|
|
106
|
-
mapOwn(attributes, set);
|
|
107
|
-
}
|
|
108
|
-
eventAttributes.actionName = name || '';
|
|
109
|
-
this.events.push(eventAttributes);
|
|
110
|
-
function set(key, val) {
|
|
111
|
-
eventAttributes[key] = val && typeof val === 'object' ? stringify(val) : val;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lite.d.ts","sourceRoot":"","sources":["../../../../src/cdn/polyfills/lite.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pro.d.ts","sourceRoot":"","sources":["../../../../src/cdn/polyfills/pro.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa.d.ts","sourceRoot":"","sources":["../../../../src/cdn/polyfills/spa.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../../../src/cdn/polyfills.js"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getInfo } from './state/info';
|
|
2
|
-
import { setInfo } from './state/info';
|
|
3
|
-
import { getConfiguration } from './state/init';
|
|
4
|
-
import { getConfigurationValue } from './state/init';
|
|
5
|
-
import { setConfiguration } from './state/init';
|
|
6
|
-
import { getLoaderConfig } from './state/loader-config';
|
|
7
|
-
import { setLoaderConfig } from './state/loader-config';
|
|
8
|
-
import { originals } from './state/originals';
|
|
9
|
-
import { getRuntime } from './state/runtime';
|
|
10
|
-
import { setRuntime } from './state/runtime';
|
|
11
|
-
export function isConfigured(agentIdentifier: any): boolean;
|
|
12
|
-
export { getInfo, setInfo, getConfiguration, getConfigurationValue, setConfiguration, getLoaderConfig, setLoaderConfig, originals, getRuntime, setRuntime };
|
|
13
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/common/config/config.js"],"names":[],"mappings":"wBAA0C,cAAc;wBAAd,cAAc;iCACkB,cAAc;sCAAd,cAAc;iCAAd,cAAc;gCACvC,uBAAuB;gCAAvB,uBAAuB;0BAC9C,mBAAmB;2BACN,iBAAiB;2BAAjB,iBAAiB;AAExD,4DAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurable.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/configurable.js"],"names":[],"mappings":"AAEA,4DA0BC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/info.js"],"names":[],"mappings":"AA6BA,0CAOC;AAED,sCAIC;AAED,iDAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/init.js"],"names":[],"mappings":"AAiHA,+CAIC;AAED,0DAKC;AAED,+DAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-config.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/loader-config.js"],"names":[],"mappings":"AAcA,8CAIC;AAED,yDAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"originals.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/originals.js"],"names":[],"mappings":"AAEA,4BAA8C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/common/config/state/runtime.js"],"names":[],"mappings":"AAgCA,yCAIC;AAED,oDAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-own.d.ts","sourceRoot":"","sources":["../../../../src/common/util/map-own.js"],"names":[],"mappings":"AAoBO,4BALI,MAAM,MACN,cAAc,GAEZ,GAAG,EAAE,CAGsB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { wrapEvents } from './wrap-events';
|
|
2
|
-
import { wrapFetch } from './wrap-fetch';
|
|
3
|
-
import { wrapHistory } from './wrap-history';
|
|
4
|
-
import { wrapJsonP } from './wrap-jsonp';
|
|
5
|
-
import { wrapMutation } from './wrap-mutation';
|
|
6
|
-
import { wrapPromise } from './wrap-promise';
|
|
7
|
-
import { wrapTimer } from './wrap-timer';
|
|
8
|
-
import { wrapXhr } from './wrap-xhr';
|
|
9
|
-
export { wrapEvents, wrapFetch, wrapHistory, wrapJsonP, wrapMutation, wrapPromise, wrapTimer, wrapXhr };
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/index.js"],"names":[],"mappings":"2BAI2B,eAAe;0BAChB,cAAc;4BACZ,gBAAgB;0BAClB,cAAc;6BACX,iBAAiB;4BAClB,gBAAgB;0BAClB,cAAc;wBAChB,YAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_action/aggregate/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IACjC,mDA2BC;IAzBC,wBAA0B;IAC1B,wBAAsL;IACtL,yBAA2E;IAC3E,gCAA4B;IAC5B,wCAA8B;IAE9B,cAAgB;IAEhB,SAAqD;IAmBvD;;;;;;;;MAkBC;IAED,qCAKC;IAGD,wDAqCC;CACF;8BApG6B,4BAA4B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "Lite" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js'
|
|
7
|
-
import { Agent } from '../../loaders/agent'
|
|
8
|
-
|
|
9
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument'
|
|
10
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument'
|
|
11
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument'
|
|
12
|
-
|
|
13
|
-
new Agent({
|
|
14
|
-
features: [
|
|
15
|
-
InstrumentPageViewEvent,
|
|
16
|
-
InstrumentPageViewTiming,
|
|
17
|
-
InstrumentMetrics
|
|
18
|
-
],
|
|
19
|
-
loaderType: 'lite-polyfills'
|
|
20
|
-
})
|
package/src/cdn/polyfills/pro.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "PRO" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js'
|
|
7
|
-
import { Agent } from '../../loaders/agent'
|
|
8
|
-
|
|
9
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument'
|
|
10
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument'
|
|
11
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument'
|
|
12
|
-
import { Instrument as InstrumentErrors } from '../../features/jserrors/instrument'
|
|
13
|
-
import { Instrument as InstrumentXhr } from '../../features/ajax/instrument'
|
|
14
|
-
import { Instrument as InstrumentSessionTrace } from '../../features/session_trace/instrument'
|
|
15
|
-
import { Instrument as InstrumentPageAction } from '../../features/page_action/instrument'
|
|
16
|
-
import { Instrument as InstrumentLogs } from '../../features/logging/instrument'
|
|
17
|
-
|
|
18
|
-
new Agent({
|
|
19
|
-
features: [
|
|
20
|
-
InstrumentPageViewEvent,
|
|
21
|
-
InstrumentPageViewTiming,
|
|
22
|
-
InstrumentSessionTrace,
|
|
23
|
-
InstrumentXhr,
|
|
24
|
-
InstrumentMetrics,
|
|
25
|
-
InstrumentPageAction,
|
|
26
|
-
InstrumentErrors,
|
|
27
|
-
InstrumentLogs
|
|
28
|
-
],
|
|
29
|
-
loaderType: 'pro-polyfills'
|
|
30
|
-
})
|
package/src/cdn/polyfills/spa.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "SPA" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js'
|
|
7
|
-
import { Agent } from '../../loaders/agent'
|
|
8
|
-
|
|
9
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument'
|
|
10
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument'
|
|
11
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument'
|
|
12
|
-
import { Instrument as InstrumentErrors } from '../../features/jserrors/instrument'
|
|
13
|
-
import { Instrument as InstrumentXhr } from '../../features/ajax/instrument'
|
|
14
|
-
import { Instrument as InstrumentSessionTrace } from '../../features/session_trace/instrument'
|
|
15
|
-
import { Instrument as InstrumentSpa } from '../../features/spa/instrument'
|
|
16
|
-
import { Instrument as InstrumentPageAction } from '../../features/page_action/instrument'
|
|
17
|
-
import { Instrument as InstrumentLogs } from '../../features/logging/instrument'
|
|
18
|
-
|
|
19
|
-
new Agent({
|
|
20
|
-
features: [
|
|
21
|
-
InstrumentXhr,
|
|
22
|
-
InstrumentPageViewEvent,
|
|
23
|
-
InstrumentPageViewTiming,
|
|
24
|
-
InstrumentSessionTrace,
|
|
25
|
-
InstrumentMetrics,
|
|
26
|
-
InstrumentPageAction,
|
|
27
|
-
InstrumentErrors,
|
|
28
|
-
InstrumentLogs,
|
|
29
|
-
InstrumentSpa
|
|
30
|
-
],
|
|
31
|
-
loaderType: 'spa-polyfills'
|
|
32
|
-
})
|