@newrelic/browser-agent 1.286.0 → 1.287.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.
Files changed (154) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/common/config/init-types.js +96 -0
  3. package/dist/cjs/common/config/init.js +9 -79
  4. package/dist/cjs/common/config/runtime.js +7 -6
  5. package/dist/cjs/common/constants/env.cdn.js +1 -1
  6. package/dist/cjs/common/constants/env.npm.js +1 -1
  7. package/dist/cjs/common/harvest/harvester.js +2 -2
  8. package/dist/cjs/common/util/feature-flags.js +4 -5
  9. package/dist/cjs/common/util/target.js +34 -0
  10. package/dist/cjs/features/ajax/aggregate/index.js +2 -1
  11. package/dist/cjs/features/generic_events/aggregate/index.js +10 -6
  12. package/dist/cjs/features/jserrors/aggregate/index.js +44 -22
  13. package/dist/cjs/features/logging/aggregate/index.js +17 -11
  14. package/dist/cjs/features/logging/shared/utils.js +3 -2
  15. package/dist/cjs/features/metrics/aggregate/index.js +6 -4
  16. package/dist/cjs/features/page_view_event/aggregate/index.js +60 -11
  17. package/dist/cjs/features/page_view_event/instrument/index.js +4 -0
  18. package/dist/cjs/features/session_replay/aggregate/index.js +8 -6
  19. package/dist/cjs/features/session_replay/instrument/index.js +1 -1
  20. package/dist/cjs/features/session_replay/shared/recorder-events.js +4 -2
  21. package/dist/cjs/features/session_replay/shared/recorder.js +12 -11
  22. package/dist/cjs/features/session_trace/aggregate/trace/storage.js +1 -1
  23. package/dist/cjs/features/soft_navigations/aggregate/index.js +12 -2
  24. package/dist/cjs/features/spa/aggregate/index.js +3 -3
  25. package/dist/cjs/features/spa/aggregate/interaction.js +6 -9
  26. package/dist/cjs/features/utils/aggregate-base.js +49 -20
  27. package/dist/cjs/features/utils/entity-manager.js +47 -0
  28. package/dist/cjs/features/utils/event-store-manager.js +79 -54
  29. package/dist/cjs/interfaces/registered-entity.js +114 -0
  30. package/dist/cjs/loaders/api/api-methods.js +1 -1
  31. package/dist/cjs/loaders/api/api.js +50 -18
  32. package/dist/cjs/loaders/api/register-api-types.js +35 -0
  33. package/dist/cjs/loaders/api/register-api.js +165 -0
  34. package/dist/cjs/loaders/micro-agent-base.js +16 -0
  35. package/dist/cjs/loaders/micro-agent.js +1 -0
  36. package/dist/esm/common/config/init-types.js +92 -0
  37. package/dist/esm/common/config/init.js +9 -79
  38. package/dist/esm/common/config/runtime.js +7 -6
  39. package/dist/esm/common/constants/env.cdn.js +1 -1
  40. package/dist/esm/common/constants/env.npm.js +1 -1
  41. package/dist/esm/common/harvest/harvester.js +2 -2
  42. package/dist/esm/common/util/feature-flags.js +4 -5
  43. package/dist/esm/common/util/target.js +27 -0
  44. package/dist/esm/features/ajax/aggregate/index.js +2 -1
  45. package/dist/esm/features/generic_events/aggregate/index.js +10 -6
  46. package/dist/esm/features/jserrors/aggregate/index.js +44 -22
  47. package/dist/esm/features/logging/aggregate/index.js +17 -11
  48. package/dist/esm/features/logging/shared/utils.js +3 -2
  49. package/dist/esm/features/metrics/aggregate/index.js +6 -4
  50. package/dist/esm/features/page_view_event/aggregate/index.js +60 -11
  51. package/dist/esm/features/page_view_event/instrument/index.js +4 -0
  52. package/dist/esm/features/session_replay/aggregate/index.js +8 -6
  53. package/dist/esm/features/session_replay/instrument/index.js +1 -1
  54. package/dist/esm/features/session_replay/shared/recorder-events.js +4 -2
  55. package/dist/esm/features/session_replay/shared/recorder.js +12 -11
  56. package/dist/esm/features/session_trace/aggregate/trace/storage.js +1 -1
  57. package/dist/esm/features/soft_navigations/aggregate/index.js +12 -2
  58. package/dist/esm/features/spa/aggregate/index.js +3 -3
  59. package/dist/esm/features/spa/aggregate/interaction.js +6 -9
  60. package/dist/esm/features/utils/aggregate-base.js +49 -20
  61. package/dist/esm/features/utils/entity-manager.js +40 -0
  62. package/dist/esm/features/utils/event-store-manager.js +79 -54
  63. package/dist/esm/interfaces/registered-entity.js +107 -0
  64. package/dist/esm/loaders/api/api-methods.js +1 -1
  65. package/dist/esm/loaders/api/api.js +50 -18
  66. package/dist/esm/loaders/api/register-api-types.js +33 -0
  67. package/dist/esm/loaders/api/register-api.js +159 -0
  68. package/dist/esm/loaders/micro-agent-base.js +16 -0
  69. package/dist/esm/loaders/micro-agent.js +1 -0
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/dist/types/common/config/init-types.d.ts +275 -0
  72. package/dist/types/common/config/init-types.d.ts.map +1 -0
  73. package/dist/types/common/config/init.d.ts +1 -262
  74. package/dist/types/common/config/init.d.ts.map +1 -1
  75. package/dist/types/common/config/runtime.d.ts.map +1 -1
  76. package/dist/types/common/util/feature-flags.d.ts +1 -1
  77. package/dist/types/common/util/feature-flags.d.ts.map +1 -1
  78. package/dist/types/common/util/target.d.ts +18 -0
  79. package/dist/types/common/util/target.d.ts.map +1 -0
  80. package/dist/types/features/ajax/aggregate/index.d.ts +1 -1
  81. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  82. package/dist/types/features/generic_events/aggregate/index.d.ts +2 -1
  83. package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -1
  84. package/dist/types/features/jserrors/aggregate/index.d.ts +9 -1
  85. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  86. package/dist/types/features/logging/aggregate/index.d.ts +3 -3
  87. package/dist/types/features/logging/aggregate/index.d.ts.map +1 -1
  88. package/dist/types/features/logging/shared/utils.d.ts +2 -1
  89. package/dist/types/features/logging/shared/utils.d.ts.map +1 -1
  90. package/dist/types/features/metrics/aggregate/index.d.ts +1 -0
  91. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  92. package/dist/types/features/page_view_event/aggregate/index.d.ts +10 -2
  93. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  94. package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -1
  95. package/dist/types/features/session_replay/aggregate/index.d.ts +2 -11
  96. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  97. package/dist/types/features/session_replay/shared/recorder-events.d.ts +1 -0
  98. package/dist/types/features/session_replay/shared/recorder-events.d.ts.map +1 -1
  99. package/dist/types/features/session_replay/shared/recorder.d.ts +4 -4
  100. package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
  101. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  102. package/dist/types/features/spa/aggregate/interaction.d.ts +3 -4
  103. package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
  104. package/dist/types/features/utils/aggregate-base.d.ts +22 -5
  105. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  106. package/dist/types/features/utils/entity-manager.d.ts +15 -0
  107. package/dist/types/features/utils/entity-manager.d.ts.map +1 -0
  108. package/dist/types/features/utils/event-store-manager.d.ts +48 -24
  109. package/dist/types/features/utils/event-store-manager.d.ts.map +1 -1
  110. package/dist/types/interfaces/registered-entity.d.ts +72 -0
  111. package/dist/types/interfaces/registered-entity.d.ts.map +1 -0
  112. package/dist/types/loaders/agent.d.ts +1 -1
  113. package/dist/types/loaders/api/api.d.ts.map +1 -1
  114. package/dist/types/loaders/api/register-api-types.d.ts +56 -0
  115. package/dist/types/loaders/api/register-api-types.d.ts.map +1 -0
  116. package/dist/types/loaders/api/register-api.d.ts +14 -0
  117. package/dist/types/loaders/api/register-api.d.ts.map +1 -0
  118. package/dist/types/loaders/micro-agent-base.d.ts +17 -0
  119. package/dist/types/loaders/micro-agent-base.d.ts.map +1 -1
  120. package/dist/types/loaders/micro-agent.d.ts +1 -0
  121. package/dist/types/loaders/micro-agent.d.ts.map +1 -1
  122. package/package.json +10 -1
  123. package/src/common/config/init-types.js +92 -0
  124. package/src/common/config/init.js +9 -79
  125. package/src/common/config/runtime.js +7 -6
  126. package/src/common/harvest/harvester.js +2 -2
  127. package/src/common/util/feature-flags.js +4 -5
  128. package/src/common/util/target.js +27 -0
  129. package/src/features/ajax/aggregate/index.js +2 -1
  130. package/src/features/generic_events/aggregate/index.js +8 -6
  131. package/src/features/jserrors/aggregate/index.js +42 -20
  132. package/src/features/logging/aggregate/index.js +14 -10
  133. package/src/features/logging/shared/utils.js +3 -2
  134. package/src/features/metrics/aggregate/index.js +7 -5
  135. package/src/features/page_view_event/aggregate/index.js +50 -8
  136. package/src/features/page_view_event/instrument/index.js +4 -0
  137. package/src/features/session_replay/aggregate/index.js +6 -3
  138. package/src/features/session_replay/instrument/index.js +1 -1
  139. package/src/features/session_replay/shared/recorder-events.js +5 -2
  140. package/src/features/session_replay/shared/recorder.js +12 -11
  141. package/src/features/session_trace/aggregate/trace/storage.js +1 -1
  142. package/src/features/soft_navigations/aggregate/index.js +11 -2
  143. package/src/features/spa/aggregate/index.js +3 -3
  144. package/src/features/spa/aggregate/interaction.js +6 -9
  145. package/src/features/utils/aggregate-base.js +54 -22
  146. package/src/features/utils/entity-manager.js +45 -0
  147. package/src/features/utils/event-store-manager.js +72 -49
  148. package/src/interfaces/registered-entity.js +107 -0
  149. package/src/loaders/api/api-methods.js +1 -1
  150. package/src/loaders/api/api.js +49 -13
  151. package/src/loaders/api/register-api-types.js +33 -0
  152. package/src/loaders/api/register-api.js +152 -0
  153. package/src/loaders/micro-agent-base.js +16 -0
  154. package/src/loaders/micro-agent.js +1 -0
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Copyright 2020-2025 New Relic, Inc. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { handle } from '../../common/event-emitter/handle';
6
+ import { warn } from '../../common/util/console';
7
+ import { isContainerAgentTarget, isValidTarget } from '../../common/util/target';
8
+ import { FEATURE_NAMES } from '../features/features';
9
+ import { now } from '../../common/timing/now';
10
+ import { SUPPORTABILITY_METRIC_CHANNEL } from '../../features/metrics/constants';
11
+
12
+ /**
13
+ * @typedef {import('./register-api-types').RegisterAPI} RegisterAPI
14
+ */
15
+
16
+ /**
17
+ * Builds the api object that will be returned from the register api method.
18
+ * Also conducts certain side-effects, such as harvesting a PageView event when triggered and gathering metadata for the registered entity.
19
+ * @param {Object} agentRef the reference to the base agent instance
20
+ * @param {Object} handlers the shared handlers to be used by both the base agent's API and the external target's API
21
+ * @param {Object} target the target information to be used by the external target's API to send data to the correct location
22
+ * @returns {RegisterAPI} the api object to be returned from the register api method
23
+ */
24
+ export function buildRegisterApi(agentRef, handlers, target) {
25
+ const attrs = {};
26
+ warn(54, 'newrelic.register');
27
+
28
+ /** @type {Function|undefined} a function that is set and reports when APIs are triggered -- warns the customer of the invalid state */
29
+ let invalidApiResponse;
30
+
31
+ /**
32
+ * A promise that indicates when all needed connections for the registered child to be ready to report data
33
+ * 1. The main agent to be ready (made a RUM call and got its entity guid)
34
+ * 2. The child to be registered with the main agent (made its own RUM call and got its entity guid)
35
+ * @type {Promise<RegisterAPI>}
36
+ */
37
+ let _connected;
38
+ if (!agentRef.init.api.allow_registered_children) invalidApiResponse = () => warn(55);
39
+ if (!target || !isValidTarget(target)) invalidApiResponse = () => warn(48, target);
40
+
41
+ /** @type {RegisterAPI} */
42
+ const api = {
43
+ addPageAction: (name, attributes = {}) => {
44
+ report(handlers.addPageAction, [name, {
45
+ ...attrs,
46
+ ...attributes
47
+ }], target);
48
+ },
49
+ log: (message, options = {}) => {
50
+ report(handlers.log, [message, {
51
+ ...options,
52
+ customAttributes: {
53
+ ...attrs,
54
+ ...(options.customAttributes || {})
55
+ }
56
+ }], target);
57
+ },
58
+ noticeError: (error, attributes = {}) => {
59
+ report(handlers.noticeError, [error, {
60
+ ...attrs,
61
+ ...attributes
62
+ }], target);
63
+ },
64
+ setApplicationVersion: value => {
65
+ attrs['application.version'] = value;
66
+ },
67
+ setCustomAttribute: (key, value) => {
68
+ attrs[key] = value;
69
+ },
70
+ setUserId: value => {
71
+ attrs['enduser.id'] = value;
72
+ },
73
+ /** metadata */
74
+ metadata: {
75
+ customAttributes: attrs,
76
+ target,
77
+ /** set in a getter so that later access of the Promise is not polluted before customer is allowed to set a catch block */
78
+ get connected() {
79
+ return _connected || Promise.reject(new Error('Failed to connect'));
80
+ }
81
+ }
82
+ };
83
+ if (invalidApiResponse) {
84
+ invalidApiResponse();
85
+ } else {
86
+ _connected = new Promise((resolve, reject) => {
87
+ try {
88
+ const entityManager = agentRef.runtime?.entityManager;
89
+ /** check if main agent already has main agent entity guid */
90
+ let mainAgentReady = !!entityManager?.get().entityGuid;
91
+ /** check if registered target already has entity guid */
92
+ let registeredEntityGuid = entityManager?.getEntityGuidFor(target.licenseKey, target.applicationID);
93
+ let registrationReady = !!registeredEntityGuid;
94
+
95
+ /** check if we can just resolve immediately without making another connect call */
96
+ if (mainAgentReady && registrationReady) {
97
+ target.entityGuid = registeredEntityGuid;
98
+ resolve(api);
99
+ } else {
100
+ /** we need to make a new connection call since we dont already have a registered entity for this call */
101
+
102
+ /** if the connect callback doesnt resolve in 15 seconds... reject */
103
+ const timeout = setTimeout(() => reject(new Error('Failed to connect - Timeout')), 15000);
104
+
105
+ // tell the main agent to send a rum call for this target
106
+ // when the rum call resolves, it will emit an "entity-added" event, see below
107
+ agentRef.ee.emit('api-send-rum', [attrs, target]);
108
+
109
+ // wait for entity events to emit to see when main agent and/or API registration is ready
110
+ agentRef.ee.on('entity-added', entityEventHandler);
111
+ function entityEventHandler(entity) {
112
+ if (isContainerAgentTarget(entity, agentRef)) mainAgentReady ||= true;else {
113
+ if (target.licenseKey === entity.licenseKey && target.applicationID === entity.applicationID) {
114
+ registrationReady = true;
115
+ target.entityGuid = entity.entityGuid;
116
+ }
117
+ }
118
+ if (mainAgentReady && registrationReady) {
119
+ clearTimeout(timeout);
120
+ // unsubscribe from the event emitter
121
+ agentRef.ee.removeEventListener('entity-added', entityEventHandler);
122
+ resolve(api);
123
+ }
124
+ }
125
+ }
126
+ } catch (err) {
127
+ reject(err);
128
+ }
129
+ });
130
+ }
131
+
132
+ /**
133
+ * The reporter method that will be used to report the data to the container agent's API method. If invalid, will log a warning and not execute.
134
+ * If the api.duplicate_registered_data configuration value is set to true, the data will be reported to BOTH the container and the external target
135
+ * @param {*} methodToCall the container agent's API method to call
136
+ * @param {*} args the arguments to supply to the container agent's API method
137
+ * @param {string} targetEntityGuid the target entity guid, which looks up the target to report the data to from the entity manager. If undefined, will report to the container agent's target.
138
+ * @returns
139
+ */
140
+ const report = async (methodToCall, args, target) => {
141
+ if (invalidApiResponse) return invalidApiResponse();
142
+ /** set the timestamp before the async part of waiting for the rum response for better accuracy */
143
+ const timestamp = now();
144
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ["API/register/".concat(methodToCall.name, "/called")], undefined, FEATURE_NAMES.metrics, agentRef.ee);
145
+ try {
146
+ await _connected;
147
+ // target should be decorated with entityGuid by the rum resp at this point
148
+ const shouldDuplicate = agentRef.init.api.duplicate_registered_data;
149
+ if (shouldDuplicate === true || Array.isArray(shouldDuplicate) && shouldDuplicate.includes(target.entityGuid)) {
150
+ // also report to container by providing undefined target
151
+ methodToCall(...args, undefined, timestamp);
152
+ }
153
+ methodToCall(...args, target.entityGuid, timestamp); // always report to target
154
+ } catch (err) {
155
+ warn(50, err);
156
+ }
157
+ };
158
+ return api;
159
+ }
@@ -31,6 +31,22 @@ export class MicroAgentBase {
31
31
  return this.#callMethod('addPageAction', name, attributes);
32
32
  }
33
33
 
34
+ /**
35
+ * @experimental
36
+ * IMPORTANT: This feature is being developed for use internally and is not in a public-facing production-ready state.
37
+ * It is not recommended for use in production environments and will not receive support for issues.
38
+ *
39
+ * Registers an external caller to report through the base agent to a different target than the base agent.
40
+ * @param {object} target the target object to report data to
41
+ * @param {string} target.licenseKey The licenseKey to report data to
42
+ * @param {string} target.applicationID The applicationID to report data to
43
+ * @param {string=} target.entityGuid The entityGuid to report data to
44
+ * @returns {object} Returns an object that contains the available API methods and configurations to use with the external caller. See loaders/api/api.js for more information.
45
+ */
46
+ register(target) {
47
+ return this.#callMethod('register', target);
48
+ }
49
+
34
50
  /**
35
51
  * Records a custom event with a specified eventType and attributes.
36
52
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordCustomEvent/}
@@ -15,6 +15,7 @@ import { MicroAgentBase } from './micro-agent-base';
15
15
  const nonAutoFeatures = [FEATURE_NAMES.jserrors, FEATURE_NAMES.genericEvents, FEATURE_NAMES.metrics, FEATURE_NAMES.logging];
16
16
 
17
17
  /**
18
+ * @deprecated This feature has been deprecated and will be removed in a future release. A future product centralizing around a single agent instance will be released as a replacement, at which time this loader will be removed.
18
19
  * A minimal agent class designed to only respond to manual user input. As such, this class does not
19
20
  * automatically instrument. Instead, each MicroAgent instance will lazy load the required features and can support loading multiple instances on one page.
20
21
  * Out of the box, it can manually handle and report Page View, Page Action, and Error events.
@@ -1 +1 @@
1
- {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/context/shared-context.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-jsonp.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-mutation.js","../src/common/wrap/wrap-promise.js","../src/common/wrap/wrap-timer.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/aggregate/websocket-detection.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/spa/constants.js","../src/features/spa/index.js","../src/features/spa/aggregate/index.js","../src/features/spa/aggregate/interaction-node.js","../src/features/spa/aggregate/interaction.js","../src/features/spa/aggregate/serializer.js","../src/features/spa/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/event-store-manager.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/features/utils/lazy-feature-loader.js","../src/features/utils/nr1-debugger.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/api-methods.js","../src/loaders/api/api.js","../src/loaders/api/apiAsync.js","../src/loaders/api/interaction-types.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.7.3"}
1
+ {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init-types.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/context/shared-context.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/target.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-jsonp.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-mutation.js","../src/common/wrap/wrap-promise.js","../src/common/wrap/wrap-timer.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/aggregate/websocket-detection.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/spa/constants.js","../src/features/spa/index.js","../src/features/spa/aggregate/index.js","../src/features/spa/aggregate/interaction-node.js","../src/features/spa/aggregate/interaction.js","../src/features/spa/aggregate/serializer.js","../src/features/spa/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/entity-manager.js","../src/features/utils/event-buffer.js","../src/features/utils/event-store-manager.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/features/utils/lazy-feature-loader.js","../src/features/utils/nr1-debugger.js","../src/interfaces/registered-entity.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/api-methods.js","../src/loaders/api/api.js","../src/loaders/api/apiAsync.js","../src/loaders/api/interaction-types.js","../src/loaders/api/register-api-types.js","../src/loaders/api/register-api.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.7.3"}
@@ -0,0 +1,275 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ export type Init = {
4
+ ajax?: {
5
+ /**
6
+ * - List of domain URLs to be excluded from AjaxRequest collection.
7
+ */
8
+ deny_list?: string[] | undefined;
9
+ /**
10
+ * - If true, agent requests going to harvest endpoint are treated as on deny list. In other words, agent will not self-report AJAX.
11
+ */
12
+ block_internal?: boolean | undefined;
13
+ /**
14
+ * - Turn on/off the ajax feature (on by default).
15
+ */
16
+ enabled?: boolean | undefined;
17
+ /**
18
+ * - If true, the agent will automatically start the ajax feature. Otherwise, it will be in a deferred state until the `start` API method is called.
19
+ */
20
+ autoStart?: boolean | undefined;
21
+ } | undefined;
22
+ api?: {
23
+ /**
24
+ * - If true, the agent will allow registered children to be sent to the server.
25
+ */
26
+ allow_registered_children?: boolean | undefined;
27
+ /**
28
+ * - If true, the agent will capture registered child data to the main agent as well as the registered child.
29
+ */
30
+ duplicate_registered_data?: boolean | undefined;
31
+ } | undefined;
32
+ distributed_tracing?: {
33
+ /**
34
+ * - If true, distributed tracing headers will be added to outgoing requests. Requires ajax feature to be running.
35
+ */
36
+ enabled?: boolean | undefined;
37
+ exclude_newrelic_header?: boolean | undefined;
38
+ cors_use_newrelic_header?: boolean | undefined;
39
+ cors_use_tracecontext_headers?: boolean | undefined;
40
+ allowed_origins?: string[] | undefined;
41
+ } | undefined;
42
+ /**
43
+ * - An array of feature flags to enable experimental features.
44
+ */
45
+ feature_flags?: string[] | undefined;
46
+ generic_events?: {
47
+ /**
48
+ * - Turn on/off the generic events feature (on by default). This is required for `PageAction`, `UserAction`, and `BrowserPerformance` events.
49
+ */
50
+ enabled?: boolean | undefined;
51
+ /**
52
+ * - If true, the agent will automatically start the generic events feature. Otherwise, it will be in a deferred state until the `start` API method is called.
53
+ */
54
+ autoStart?: boolean | undefined;
55
+ } | undefined;
56
+ harvest?: {
57
+ /**
58
+ * - The interval in seconds at which the agent will send out data. It's not recommended to change this value.
59
+ */
60
+ interval?: number | undefined;
61
+ } | undefined;
62
+ jserrors?: {
63
+ /**
64
+ * - Turn on/off the jserrors feature (on by default).
65
+ */
66
+ enabled?: boolean | undefined;
67
+ /**
68
+ * - If true, the agent will automatically start the jserrors feature. Otherwise, it will be in a deferred state until the `start` API method is called.
69
+ */
70
+ autoStart?: boolean | undefined;
71
+ } | undefined;
72
+ logging?: {
73
+ /**
74
+ * - Turn on/off the logging feature (on by default).
75
+ */
76
+ enabled?: boolean | undefined;
77
+ /**
78
+ * - If true, the agent will automatically start the logging feature. Otherwise, it will be in a deferred state until the `start` API method is called.
79
+ */
80
+ autoStart?: boolean | undefined;
81
+ } | undefined;
82
+ metrics?: {
83
+ /**
84
+ * - Turn on/off the metrics feature (on by default).
85
+ */
86
+ enabled?: boolean | undefined;
87
+ /**
88
+ * - If true, the agent will automatically start the metrics feature. Otherwise, it will be in a deferred state until the `start` API method is called.
89
+ */
90
+ autoStart?: boolean | undefined;
91
+ } | undefined;
92
+ /**
93
+ * - Array of regexp and corresponding replacement patterns for obfuscating data.
94
+ */
95
+ obfuscate?: Object[] | undefined;
96
+ page_action?: {
97
+ /**
98
+ * - Must be true to allow PageAction events to be captured.
99
+ */
100
+ enabled?: boolean | undefined;
101
+ } | undefined;
102
+ page_view_event?: {
103
+ /**
104
+ * - This setting is ignored! PageViewEvent is always enabled by force.
105
+ */
106
+ enabled?: boolean | undefined;
107
+ /**
108
+ * - If true, the agent will automatically send the RUM request. Otherwise, it will be in a deferred state until the `start` API method is called.
109
+ */
110
+ autoStart?: boolean | undefined;
111
+ } | undefined;
112
+ page_view_timing?: {
113
+ /**
114
+ * - Turn on/off the page view timing feature (on by default).
115
+ */
116
+ enabled?: boolean | undefined;
117
+ /**
118
+ * - If true, the agent will automatically start the page view timing feature. Otherwise, it will be in a deferred state until the `start` API method is called.
119
+ */
120
+ autoStart?: boolean | undefined;
121
+ } | undefined;
122
+ performance?: {
123
+ /**
124
+ * - If true, the agent will capture PerformanceMark events.
125
+ */
126
+ capture_marks?: boolean | undefined;
127
+ /**
128
+ * - If true, the agent will capture PerformanceMeasure events.
129
+ */
130
+ capture_measures?: boolean | undefined;
131
+ /**
132
+ * - If true, `BrowserPerformance` events from marks and measures will include, as attribute(s), the `detail` metadata provided to `markOptions` and `measureOptions`.
133
+ */
134
+ capture_detail?: boolean | undefined;
135
+ resources?: {
136
+ /**
137
+ * - If true, the agent will capture PerformanceResourceTiming entries.
138
+ */
139
+ enabled?: boolean | undefined;
140
+ /**
141
+ * - Array of `initiatorType` strings to filter the desired ResourceTiming entries. By default, all resource types are captured.
142
+ */
143
+ asset_types?: string[] | undefined;
144
+ /**
145
+ * - Each resource URL will be checked against this list to determine if it should be labeled "first party" in the resulting `BrowserPerformance` event.
146
+ */
147
+ first_party_domains?: string[] | undefined;
148
+ /**
149
+ * - When true (default), resource entries associated with New Relic domains will be ignored.
150
+ */
151
+ ignore_newrelic?: boolean | undefined;
152
+ } | undefined;
153
+ } | undefined;
154
+ privacy?: {
155
+ /**
156
+ * - If true (default), session tracking of users across page loads is enabled in the agent. This is required for session trace, replay, and session-related features.
157
+ */
158
+ cookies_enabled?: boolean | undefined;
159
+ } | undefined;
160
+ proxy?: {
161
+ /**
162
+ * - Set value will be used to overwrite the webpack asset path used to fetch agent assets.
163
+ */
164
+ assets?: string | undefined;
165
+ /**
166
+ * - Set value will be used to overwrite the endpoint URL to which we send analytics.
167
+ */
168
+ beacon?: string | undefined;
169
+ } | undefined;
170
+ session?: {
171
+ /**
172
+ * - When session tracking is on, this determines how long a session will last before expiring. Modifying this value is not recommended.
173
+ */
174
+ expiresMs?: number | undefined;
175
+ /**
176
+ * - When session tracking is on, this determines how long a session will last without user activity before expiring. Modifying this value is not recommended.
177
+ */
178
+ inactiveMs?: number | undefined;
179
+ } | undefined;
180
+ session_replay?: {
181
+ /**
182
+ * - If true, the agent will automatically start the session replay feature. Otherwise, it will be in a deferred state until the `start` API method is called.
183
+ */
184
+ autoStart?: boolean | undefined;
185
+ /**
186
+ * - Turn on/off the session replay feature (off by default).
187
+ */
188
+ enabled?: boolean | undefined;
189
+ /**
190
+ * - If true, allow the agent to run rrweb recorder immediately instead of waiting until after the window.load event, for new sessions. Existing sessions ignore this setting.
191
+ */
192
+ preload?: boolean | undefined;
193
+ /**
194
+ * - This setting is deprecated and ineffective. Sampling is controlled in New Relic by server-side configuration.
195
+ */
196
+ sampling_rate?: number | undefined;
197
+ /**
198
+ * - This setting is deprecated and ineffective.
199
+ */
200
+ error_sampling_rate?: number | undefined;
201
+ /**
202
+ * - When true, serialize fonts for collection without public asset url. This is currently broken -- https://github.com/rrweb-io/rrweb/issues/1304.
203
+ */
204
+ collect_fonts?: boolean | undefined;
205
+ /**
206
+ * - When true, serialize images for collection without public asset url. Not recommended for use. This is currently for TESTING as it easily generates payloads too large to be harvested.
207
+ */
208
+ inline_images?: boolean | undefined;
209
+ /**
210
+ * - When true, tries to fetch any missing stylesheets again to inline in replayer.
211
+ */
212
+ fix_stylesheets?: boolean | undefined;
213
+ /**
214
+ * - If true, all input content will be masked with asterisks.
215
+ */
216
+ mask_all_inputs?: boolean | undefined;
217
+ /**
218
+ * - Set value should be in CSS selector syntax and is used to identify matching elements to mask.
219
+ */
220
+ mask_text_selector?: string | undefined;
221
+ /**
222
+ * - Set value should be in CSS selector syntax and is used to identify matching elements to block.
223
+ */
224
+ block_selector?: string | undefined;
225
+ /**
226
+ * - If mask_all_inputs is not true, this object will be used to select what input to mask. Passwords are forcibly always masked.
227
+ */
228
+ mask_input_options?: Object | undefined;
229
+ } | undefined;
230
+ session_trace?: {
231
+ /**
232
+ * - Turn on/off the session trace feature (on by default).
233
+ */
234
+ enabled?: boolean | undefined;
235
+ /**
236
+ * - If true, the agent will automatically start the session trace feature. Otherwise, it will be in a deferred state until the `start` API method is called.
237
+ */
238
+ autoStart?: boolean | undefined;
239
+ } | undefined;
240
+ soft_navigations?: {
241
+ /**
242
+ * - Turn on/off the soft navigations feature (on by default).
243
+ */
244
+ enabled?: boolean | undefined;
245
+ /**
246
+ * - If true, the agent will automatically start the soft navigations feature. Otherwise, it will be in a deferred state until the `start` API method is called.
247
+ */
248
+ autoStart?: boolean | undefined;
249
+ } | undefined;
250
+ spa?: {
251
+ /**
252
+ * - Turn on/off the single page application feature (on by default). NOTE: the SPA feature is deprecated and under removal procedure.
253
+ */
254
+ enabled?: boolean | undefined;
255
+ /**
256
+ * - If true, the agent will automatically start the single page application feature. Otherwise, it will be in a deferred state until the `start` API method is called.
257
+ */
258
+ autoStart?: boolean | undefined;
259
+ } | undefined;
260
+ /**
261
+ * - If explicitly false, the agent will use HTTP instead of HTTPS. This setting should NOT be used.
262
+ */
263
+ ssl?: boolean | undefined;
264
+ user_actions?: {
265
+ /**
266
+ * - Must be true to allow UserAction events to be captured.
267
+ */
268
+ enabled?: boolean | undefined;
269
+ /**
270
+ * - List of HTML Element properties to be captured with UserAction events' target elements. This may help to identify the source element being interacted with in the UI.
271
+ */
272
+ elementAttributes?: string[] | undefined;
273
+ } | undefined;
274
+ };
275
+ //# sourceMappingURL=init-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-types.d.ts","sourceRoot":"","sources":["../../../../src/common/config/init-types.js"],"names":[],"mappings":""}