@newrelic/browser-agent 1.244.0 → 1.246.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 (104) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/cdn/polyfills.js +5 -1
  3. package/dist/cjs/common/config/state/configurable.js +1 -1
  4. package/dist/cjs/common/config/state/init.js +1 -0
  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/session/session-entity.js +3 -2
  8. package/dist/cjs/common/url/parse-url.js +21 -44
  9. package/dist/cjs/common/util/type-check.js +14 -0
  10. package/dist/cjs/common/vitals/first-input-delay.js +1 -2
  11. package/dist/cjs/common/vitals/largest-contentful-paint.js +1 -2
  12. package/dist/cjs/common/vitals/vital-metric.js +2 -12
  13. package/dist/cjs/features/ajax/aggregate/gql.js +94 -0
  14. package/dist/cjs/features/ajax/aggregate/index.js +13 -1
  15. package/dist/cjs/features/ajax/instrument/index.js +2 -0
  16. package/dist/cjs/features/jserrors/aggregate/index.js +1 -1
  17. package/dist/cjs/features/page_view_event/aggregate/index.js +2 -0
  18. package/dist/cjs/features/page_view_timing/aggregate/index.js +10 -1
  19. package/dist/cjs/features/session_replay/aggregate/index.js +6 -6
  20. package/dist/cjs/features/session_trace/aggregate/index.js +14 -3
  21. package/dist/cjs/features/spa/aggregate/index.js +5 -3
  22. package/dist/cjs/features/spa/aggregate/serializer.js +7 -0
  23. package/dist/cjs/features/utils/instrument-base.js +1 -1
  24. package/dist/cjs/index.js +0 -7
  25. package/dist/cjs/loaders/api/api.js +2 -2
  26. package/dist/esm/cdn/polyfills.js +5 -1
  27. package/dist/esm/common/config/state/configurable.js +1 -1
  28. package/dist/esm/common/config/state/init.js +1 -0
  29. package/dist/esm/common/constants/env.cdn.js +1 -1
  30. package/dist/esm/common/constants/env.npm.js +1 -1
  31. package/dist/esm/common/session/session-entity.js +3 -2
  32. package/dist/esm/common/url/parse-url.js +22 -45
  33. package/dist/esm/common/util/type-check.js +8 -0
  34. package/dist/esm/common/vitals/first-input-delay.js +1 -2
  35. package/dist/esm/common/vitals/largest-contentful-paint.js +1 -2
  36. package/dist/esm/common/vitals/vital-metric.js +1 -11
  37. package/dist/esm/features/ajax/aggregate/gql.js +89 -0
  38. package/dist/esm/features/ajax/aggregate/index.js +13 -1
  39. package/dist/esm/features/ajax/instrument/index.js +2 -0
  40. package/dist/esm/features/jserrors/aggregate/index.js +1 -1
  41. package/dist/esm/features/page_view_event/aggregate/index.js +2 -0
  42. package/dist/esm/features/page_view_timing/aggregate/index.js +9 -0
  43. package/dist/esm/features/session_replay/aggregate/index.js +6 -6
  44. package/dist/esm/features/session_trace/aggregate/index.js +14 -3
  45. package/dist/esm/features/spa/aggregate/index.js +5 -3
  46. package/dist/esm/features/spa/aggregate/serializer.js +7 -0
  47. package/dist/esm/features/utils/instrument-base.js +1 -1
  48. package/dist/esm/index.js +0 -1
  49. package/dist/esm/loaders/api/api.js +2 -2
  50. package/dist/types/common/config/state/configurable.d.ts.map +1 -1
  51. package/dist/types/common/config/state/init.d.ts.map +1 -1
  52. package/dist/types/common/session/session-entity.d.ts.map +1 -1
  53. package/dist/types/common/url/parse-url.d.ts +12 -1
  54. package/dist/types/common/url/parse-url.d.ts.map +1 -1
  55. package/dist/types/common/util/type-check.d.ts +7 -0
  56. package/dist/types/common/util/type-check.d.ts.map +1 -0
  57. package/dist/types/common/vitals/vital-metric.d.ts +1 -2
  58. package/dist/types/common/vitals/vital-metric.d.ts.map +1 -1
  59. package/dist/types/features/ajax/aggregate/gql.d.ts +29 -0
  60. package/dist/types/features/ajax/aggregate/gql.d.ts.map +1 -0
  61. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  62. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  63. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  64. package/dist/types/features/session_trace/aggregate/index.d.ts +1 -0
  65. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  66. package/dist/types/features/spa/aggregate/index.d.ts +1 -0
  67. package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
  68. package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
  69. package/dist/types/index.d.ts +0 -1
  70. package/dist/types/loaders/configure/public-path.npm.d.ts.map +1 -1
  71. package/package.json +1 -9
  72. package/src/cdn/polyfills.js +4 -0
  73. package/src/common/config/state/configurable.js +2 -1
  74. package/src/common/config/state/init.js +1 -0
  75. package/src/common/session/session-entity.js +3 -2
  76. package/src/common/url/parse-url.js +22 -50
  77. package/src/common/util/type-check.js +8 -0
  78. package/src/common/vitals/first-input-delay.js +1 -2
  79. package/src/common/vitals/largest-contentful-paint.js +1 -2
  80. package/src/common/vitals/vital-metric.js +2 -12
  81. package/src/features/ajax/aggregate/gql.js +95 -0
  82. package/src/features/ajax/aggregate/index.js +11 -1
  83. package/src/features/ajax/instrument/index.js +3 -0
  84. package/src/features/jserrors/aggregate/index.js +1 -1
  85. package/src/features/page_view_event/aggregate/index.js +2 -0
  86. package/src/features/page_view_timing/aggregate/index.js +11 -0
  87. package/src/features/session_replay/aggregate/index.js +6 -6
  88. package/src/features/session_trace/aggregate/index.js +10 -2
  89. package/src/features/spa/aggregate/index.js +5 -3
  90. package/src/features/spa/aggregate/serializer.js +7 -1
  91. package/src/features/utils/instrument-base.js +1 -1
  92. package/src/index.js +0 -1
  93. package/src/loaders/api/api.js +2 -2
  94. package/src/loaders/configure/public-path.npm.js +0 -1
  95. package/dist/cjs/cdn/worker.js +0 -16
  96. package/dist/cjs/loaders/worker-agent.js +0 -24
  97. package/dist/esm/cdn/worker.js +0 -14
  98. package/dist/esm/loaders/worker-agent.js +0 -18
  99. package/dist/types/cdn/worker.d.ts +0 -2
  100. package/dist/types/cdn/worker.d.ts.map +0 -1
  101. package/dist/types/loaders/worker-agent.d.ts +0 -8
  102. package/dist/types/loaders/worker-agent.d.ts.map +0 -1
  103. package/src/cdn/worker.js +0 -21
  104. package/src/loaders/worker-agent.js +0 -24
package/src/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export { Agent } from './loaders/agent'
2
2
  export { BrowserAgent } from './loaders/browser-agent'
3
- export { WorkerAgent } from './loaders/worker-agent'
4
3
  export { MicroAgent } from './loaders/micro-agent'
5
4
 
6
5
  export { Ajax } from './features/ajax'
@@ -89,8 +89,8 @@ export function setAPI (agentIdentifier, forceDrain) {
89
89
  warn(`Failed to execute setCustomAttribute.\nName must be a string type, but a type of <${typeof name}> was provided.`)
90
90
  return
91
91
  }
92
- if (!(['string', 'number'].includes(typeof value) || value === null)) {
93
- warn(`Failed to execute setCustomAttribute.\nNon-null value must be a string or number type, but a type of <${typeof value}> was provided.`)
92
+ if (!(['string', 'number', 'boolean'].includes(typeof value) || value === null)) {
93
+ warn(`Failed to execute setCustomAttribute.\nNon-null value must be a string, number or boolean type, but a type of <${typeof value}> was provided.`)
94
94
  return
95
95
  }
96
96
  return appendJsAttribute(name, value, 'setCustomAttribute', persistAttribute)
@@ -1,4 +1,3 @@
1
-
2
1
  export const redefinePublicPath = () => {
3
2
  // We don't support setting public path in webpack via NPM build.
4
3
  }
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- var _agent = require("../loaders/agent");
4
- var _instrument = require("../features/metrics/instrument");
5
- var _instrument2 = require("../features/jserrors/instrument");
6
- var _instrument3 = require("../features/ajax/instrument");
7
- var _instrument4 = require("../features/page_action/instrument");
8
- /**
9
- * @file Creates a "Worker" agent loader bundle composed of the core Agent and the subset of feature modules applicable
10
- * in a service worker context.
11
- */
12
-
13
- new _agent.Agent({
14
- features: [_instrument.Instrument, _instrument2.Instrument, _instrument3.Instrument, _instrument4.Instrument],
15
- loaderType: 'worker'
16
- });
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WorkerAgent = void 0;
7
- var _agent = require("./agent");
8
- var _instrument = require("../features/metrics/instrument");
9
- var _instrument2 = require("../features/jserrors/instrument");
10
- var _instrument3 = require("../features/ajax/instrument");
11
- var _instrument4 = require("../features/page_action/instrument");
12
- /**
13
- * A streamlined agent class designed for the service worker context, limited to features relevant in that scope.
14
- */
15
- class WorkerAgent extends _agent.Agent {
16
- constructor(args) {
17
- super({
18
- ...args,
19
- features: [_instrument.Instrument, _instrument2.Instrument, _instrument3.Instrument, _instrument4.Instrument],
20
- loaderType: 'worker-agent'
21
- });
22
- }
23
- }
24
- exports.WorkerAgent = WorkerAgent;
@@ -1,14 +0,0 @@
1
- /**
2
- * @file Creates a "Worker" agent loader bundle composed of the core Agent and the subset of feature modules applicable
3
- * in a service worker context.
4
- */
5
-
6
- import { Agent } from '../loaders/agent';
7
- import { Instrument as InstrumentMetrics } from '../features/metrics/instrument';
8
- import { Instrument as InstrumentErrors } from '../features/jserrors/instrument';
9
- import { Instrument as InstrumentXhr } from '../features/ajax/instrument';
10
- import { Instrument as InstrumentPageAction } from '../features/page_action/instrument';
11
- new Agent({
12
- features: [InstrumentMetrics, InstrumentErrors, InstrumentXhr, InstrumentPageAction],
13
- loaderType: 'worker'
14
- });
@@ -1,18 +0,0 @@
1
- import { Agent } from './agent';
2
- import { Instrument as InstrumentMetrics } from '../features/metrics/instrument';
3
- import { Instrument as InstrumentErrors } from '../features/jserrors/instrument';
4
- import { Instrument as InstrumentXhr } from '../features/ajax/instrument';
5
- import { Instrument as InstrumentPageAction } from '../features/page_action/instrument';
6
-
7
- /**
8
- * A streamlined agent class designed for the service worker context, limited to features relevant in that scope.
9
- */
10
- export class WorkerAgent extends Agent {
11
- constructor(args) {
12
- super({
13
- ...args,
14
- features: [InstrumentMetrics, InstrumentErrors, InstrumentXhr, InstrumentPageAction],
15
- loaderType: 'worker-agent'
16
- });
17
- }
18
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/cdn/worker.js"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- /**
2
- * A streamlined agent class designed for the service worker context, limited to features relevant in that scope.
3
- */
4
- export class WorkerAgent extends Agent {
5
- constructor(args: any);
6
- }
7
- import { Agent } from './agent';
8
- //# sourceMappingURL=worker-agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/worker-agent.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;IACE,uBAWC;CACF;sBAvBqB,SAAS"}
package/src/cdn/worker.js DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * @file Creates a "Worker" agent loader bundle composed of the core Agent and the subset of feature modules applicable
3
- * in a service worker context.
4
- */
5
-
6
- import { Agent } from '../loaders/agent'
7
-
8
- import { Instrument as InstrumentMetrics } from '../features/metrics/instrument'
9
- import { Instrument as InstrumentErrors } from '../features/jserrors/instrument'
10
- import { Instrument as InstrumentXhr } from '../features/ajax/instrument'
11
- import { Instrument as InstrumentPageAction } from '../features/page_action/instrument'
12
-
13
- new Agent({
14
- features: [
15
- InstrumentMetrics,
16
- InstrumentErrors,
17
- InstrumentXhr,
18
- InstrumentPageAction
19
- ],
20
- loaderType: 'worker'
21
- })
@@ -1,24 +0,0 @@
1
- import { Agent } from './agent'
2
-
3
- import { Instrument as InstrumentMetrics } from '../features/metrics/instrument'
4
- import { Instrument as InstrumentErrors } from '../features/jserrors/instrument'
5
- import { Instrument as InstrumentXhr } from '../features/ajax/instrument'
6
- import { Instrument as InstrumentPageAction } from '../features/page_action/instrument'
7
-
8
- /**
9
- * A streamlined agent class designed for the service worker context, limited to features relevant in that scope.
10
- */
11
- export class WorkerAgent extends Agent {
12
- constructor (args) {
13
- super({
14
- ...args,
15
- features: [
16
- InstrumentMetrics,
17
- InstrumentErrors,
18
- InstrumentXhr,
19
- InstrumentPageAction
20
- ],
21
- loaderType: 'worker-agent'
22
- })
23
- }
24
- }