@newrelic/browser-agent 1.318.0-rc.1 → 1.318.0-rc.2

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.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.318.0-rc.1";
20
+ const VERSION = exports.VERSION = "1.318.0-rc.2";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.318.0-rc.1";
20
+ const VERSION = exports.VERSION = "1.318.0-rc.2";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -97,20 +97,20 @@ class Aggregate extends _aggregateBase.AggregateBase {
97
97
  callbackDuration: metrics.cbTime,
98
98
  [_constants.AJAX_ID]: (0, _uniqueId.generateUuid)() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
99
99
  };
100
- event.gql = params.gql = (0, _gql.parseGQL)({
100
+ event.gql = (0, _gql.parseGQL)({
101
101
  body: ctx.requestBody,
102
102
  query: ctx.parsedOrigin?.search
103
103
  });
104
- if (event.gql) event.gql.operationHasErrors = params.gql.operationHasErrors = (0, _gql.hasGQLErrors)(ctx.responseBody);
104
+ if (event.gql) event.gql.operationHasErrors = (0, _gql.hasGQLErrors)(ctx.responseBody);
105
105
  const capturePayloadSetting = this.agentRef.init.ajax.capture_payloads;
106
106
  const shouldCapturePayload = (0, _payloads.canCapturePayload)(capturePayloadSetting, params.status, event.gql?.operationHasErrors);
107
107
  if (shouldCapturePayload) {
108
108
  // Store raw data; obfuscation and truncation will happen in the serializer
109
- params.requestQuery = event.requestQuery = (0, _payloads.parseQueryString)(ctx.parsedOrigin?.search);
110
- params.requestHeaders = event.requestHeaders = ctx.requestHeaders;
111
- params.responseHeaders = event.responseHeaders = ctx.responseHeaders;
112
- if ((0, _payloads.isLikelyHumanReadable)(ctx.requestHeaders, ctx.requestBody)) params.requestBody = event.requestBody = ctx.requestBody;
113
- if ((0, _payloads.isLikelyHumanReadable)(ctx.responseHeaders, ctx.responseBody)) params.responseBody = event.responseBody = ctx.responseBody;
109
+ event.requestQuery = (0, _payloads.parseQueryString)(ctx.parsedOrigin?.search);
110
+ event.requestHeaders = ctx.requestHeaders;
111
+ event.responseHeaders = ctx.responseHeaders;
112
+ if ((0, _payloads.isLikelyHumanReadable)(ctx.requestHeaders, ctx.requestBody)) event.requestBody = ctx.requestBody;
113
+ if ((0, _payloads.isLikelyHumanReadable)(ctx.responseHeaders, ctx.responseBody)) event.responseBody = ctx.responseBody;
114
114
  }
115
115
  if (ctx.dt) {
116
116
  event.spanId = ctx.dt.spanId;
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.318.0-rc.1";
14
+ export const VERSION = "1.318.0-rc.2";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.318.0-rc.1";
14
+ export const VERSION = "1.318.0-rc.2";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -90,20 +90,20 @@ export class Aggregate extends AggregateBase {
90
90
  callbackDuration: metrics.cbTime,
91
91
  [AJAX_ID]: generateUuid() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
92
92
  };
93
- event.gql = params.gql = parseGQL({
93
+ event.gql = parseGQL({
94
94
  body: ctx.requestBody,
95
95
  query: ctx.parsedOrigin?.search
96
96
  });
97
- if (event.gql) event.gql.operationHasErrors = params.gql.operationHasErrors = hasGQLErrors(ctx.responseBody);
97
+ if (event.gql) event.gql.operationHasErrors = hasGQLErrors(ctx.responseBody);
98
98
  const capturePayloadSetting = this.agentRef.init.ajax.capture_payloads;
99
99
  const shouldCapturePayload = canCapturePayload(capturePayloadSetting, params.status, event.gql?.operationHasErrors);
100
100
  if (shouldCapturePayload) {
101
101
  // Store raw data; obfuscation and truncation will happen in the serializer
102
- params.requestQuery = event.requestQuery = parseQueryString(ctx.parsedOrigin?.search);
103
- params.requestHeaders = event.requestHeaders = ctx.requestHeaders;
104
- params.responseHeaders = event.responseHeaders = ctx.responseHeaders;
105
- if (isLikelyHumanReadable(ctx.requestHeaders, ctx.requestBody)) params.requestBody = event.requestBody = ctx.requestBody;
106
- if (isLikelyHumanReadable(ctx.responseHeaders, ctx.responseBody)) params.responseBody = event.responseBody = ctx.responseBody;
102
+ event.requestQuery = parseQueryString(ctx.parsedOrigin?.search);
103
+ event.requestHeaders = ctx.requestHeaders;
104
+ event.responseHeaders = ctx.responseHeaders;
105
+ if (isLikelyHumanReadable(ctx.requestHeaders, ctx.requestBody)) event.requestBody = ctx.requestBody;
106
+ if (isLikelyHumanReadable(ctx.responseHeaders, ctx.responseBody)) event.responseBody = ctx.responseBody;
107
107
  }
108
108
  if (ctx.dt) {
109
109
  event.spanId = ctx.dt.spanId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.318.0-rc.1",
3
+ "version": "1.318.0-rc.2",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -102,22 +102,22 @@ export class Aggregate extends AggregateBase {
102
102
  [AJAX_ID]: generateUuid() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
103
103
  }
104
104
 
105
- event.gql = params.gql = parseGQL({
105
+ event.gql = parseGQL({
106
106
  body: ctx.requestBody,
107
107
  query: ctx.parsedOrigin?.search
108
108
  })
109
- if (event.gql) event.gql.operationHasErrors = params.gql.operationHasErrors = hasGQLErrors(ctx.responseBody)
109
+ if (event.gql) event.gql.operationHasErrors = hasGQLErrors(ctx.responseBody)
110
110
 
111
111
  const capturePayloadSetting = this.agentRef.init.ajax.capture_payloads
112
112
  const shouldCapturePayload = canCapturePayload(capturePayloadSetting, params.status, event.gql?.operationHasErrors)
113
113
 
114
114
  if (shouldCapturePayload) {
115
115
  // Store raw data; obfuscation and truncation will happen in the serializer
116
- params.requestQuery = event.requestQuery = parseQueryString(ctx.parsedOrigin?.search)
117
- params.requestHeaders = event.requestHeaders = ctx.requestHeaders
118
- params.responseHeaders = event.responseHeaders = ctx.responseHeaders
119
- if (isLikelyHumanReadable(ctx.requestHeaders, ctx.requestBody)) params.requestBody = event.requestBody = ctx.requestBody
120
- if (isLikelyHumanReadable(ctx.responseHeaders, ctx.responseBody)) params.responseBody = event.responseBody = ctx.responseBody
116
+ event.requestQuery = parseQueryString(ctx.parsedOrigin?.search)
117
+ event.requestHeaders = ctx.requestHeaders
118
+ event.responseHeaders = ctx.responseHeaders
119
+ if (isLikelyHumanReadable(ctx.requestHeaders, ctx.requestBody)) event.requestBody = ctx.requestBody
120
+ if (isLikelyHumanReadable(ctx.responseHeaders, ctx.responseBody)) event.responseBody = ctx.responseBody
121
121
  }
122
122
 
123
123
  if (ctx.dt) {