@newrelic/browser-agent 1.249.0 → 1.251.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 +26 -0
- package/dist/cjs/common/config/state/init.js +1 -3
- package/dist/cjs/common/config/state/originals.js +1 -2
- package/dist/cjs/common/constants/env.cdn.js +4 -8
- package/dist/cjs/common/constants/env.js +4 -8
- package/dist/cjs/common/constants/env.npm.js +4 -8
- package/dist/cjs/common/constants/runtime.js +13 -24
- package/dist/cjs/common/constants/shared-channel.js +2 -3
- package/dist/cjs/common/event-emitter/contextual-ee.js +2 -4
- package/dist/cjs/common/event-emitter/handle.js +1 -2
- package/dist/cjs/common/harvest/harvest-scheduler.js +4 -4
- package/dist/cjs/common/harvest/harvest.js +6 -5
- package/dist/cjs/common/harvest/types.js +1 -2
- package/dist/cjs/common/ids/bundle-id.js +1 -2
- package/dist/cjs/common/ids/unique-id.js +1 -1
- package/dist/cjs/common/session/constants.js +19 -7
- package/dist/cjs/common/session/session-entity.js +8 -26
- package/dist/cjs/common/timer/interaction-timer.js +0 -1
- package/dist/cjs/common/timing/nav-timing.js +1 -2
- package/dist/cjs/common/url/encode.js +2 -0
- package/dist/cjs/common/util/feature-flags.js +1 -2
- package/dist/cjs/common/vitals/constants.js +2 -3
- package/dist/cjs/common/vitals/cumulative-layout-shift.js +1 -2
- package/dist/cjs/common/vitals/first-contentful-paint.js +1 -2
- package/dist/cjs/common/vitals/first-input-delay.js +1 -2
- package/dist/cjs/common/vitals/first-paint.js +1 -2
- package/dist/cjs/common/vitals/interaction-to-next-paint.js +1 -2
- package/dist/cjs/common/vitals/largest-contentful-paint.js +1 -2
- package/dist/cjs/common/vitals/long-task.js +1 -3
- package/dist/cjs/common/vitals/time-to-first-byte.js +1 -2
- package/dist/cjs/common/window/nreum.js +1 -2
- package/dist/cjs/common/wrap/wrap-function.js +2 -4
- package/dist/cjs/features/ajax/aggregate/index.js +0 -2
- package/dist/cjs/features/ajax/constants.js +1 -2
- package/dist/cjs/features/jserrors/aggregate/index.js +0 -1
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.js +0 -1
- package/dist/cjs/features/jserrors/constants.js +1 -2
- package/dist/cjs/features/metrics/aggregate/index.js +3 -1
- package/dist/cjs/features/metrics/constants.js +5 -10
- package/dist/cjs/features/page_action/constants.js +1 -2
- package/dist/cjs/features/page_view_event/aggregate/index.js +2 -2
- package/dist/cjs/features/page_view_event/constants.js +1 -2
- package/dist/cjs/features/page_view_event/instrument/index.js +2 -2
- package/dist/cjs/features/page_view_timing/constants.js +1 -2
- package/dist/cjs/features/session_replay/aggregate/index.js +128 -289
- package/dist/cjs/features/session_replay/constants.js +50 -3
- package/dist/cjs/features/session_replay/instrument/index.js +30 -8
- package/dist/cjs/features/session_replay/shared/recorder-events.js +33 -0
- package/dist/cjs/features/session_replay/shared/recorder.js +201 -0
- package/dist/cjs/features/session_replay/{replay-mode.js → shared/replay-mode.js} +5 -5
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +94 -0
- package/dist/cjs/features/session_trace/aggregate/index.js +25 -27
- package/dist/cjs/features/session_trace/constants.js +8 -16
- package/dist/cjs/features/session_trace/instrument/index.js +2 -2
- package/dist/cjs/features/spa/aggregate/index.js +2 -2
- package/dist/cjs/features/spa/aggregate/interaction-node.js +0 -1
- package/dist/cjs/features/spa/constants.js +22 -44
- package/dist/cjs/features/spa/instrument/index.js +2 -2
- package/dist/cjs/features/utils/instrument-base.js +6 -7
- package/dist/cjs/features/utils/lazy-feature-loader.js +2 -2
- package/dist/cjs/loaders/agent-base.js +61 -15
- package/dist/cjs/loaders/agent.js +0 -38
- package/dist/cjs/loaders/api/api.js +7 -7
- package/dist/cjs/loaders/api/interaction-types.js +1 -2
- package/dist/cjs/loaders/features/features.js +3 -5
- package/dist/cjs/loaders/micro-agent.js +2 -2
- package/dist/esm/common/config/state/init.js +1 -3
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/harvest/harvest-scheduler.js +1 -1
- package/dist/esm/common/harvest/harvest.js +4 -3
- package/dist/esm/common/ids/unique-id.js +1 -1
- package/dist/esm/common/session/constants.js +16 -1
- package/dist/esm/common/session/session-entity.js +2 -16
- package/dist/esm/common/timer/interaction-timer.js +0 -1
- package/dist/esm/common/url/encode.js +2 -0
- package/dist/esm/common/vitals/long-task.js +0 -1
- package/dist/esm/features/ajax/aggregate/index.js +0 -2
- package/dist/esm/features/jserrors/aggregate/index.js +0 -1
- package/dist/esm/features/jserrors/aggregate/string-hash-code.js +0 -1
- package/dist/esm/features/metrics/aggregate/index.js +3 -1
- package/dist/esm/features/session_replay/aggregate/index.js +98 -255
- package/dist/esm/features/session_replay/constants.js +49 -1
- package/dist/esm/features/session_replay/instrument/index.js +24 -1
- package/dist/esm/features/session_replay/shared/recorder-events.js +26 -0
- package/dist/esm/features/session_replay/shared/recorder.js +194 -0
- package/dist/esm/features/session_replay/{replay-mode.js → shared/replay-mode.js} +4 -4
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +88 -0
- package/dist/esm/features/session_trace/aggregate/index.js +2 -4
- package/dist/esm/features/spa/aggregate/interaction-node.js +0 -1
- package/dist/esm/features/utils/instrument-base.js +0 -1
- package/dist/esm/loaders/agent-base.js +62 -15
- package/dist/esm/loaders/agent.js +0 -38
- package/dist/types/common/harvest/harvest.d.ts +1 -1
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts +15 -0
- package/dist/types/common/session/session-entity.d.ts +0 -15
- package/dist/types/common/session/session-entity.d.ts.map +1 -1
- package/dist/types/common/url/encode.d.ts +1 -1
- package/dist/types/common/url/encode.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts +7 -63
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/constants.d.ts +55 -0
- package/dist/types/features/session_replay/constants.d.ts.map +1 -1
- package/dist/types/features/session_replay/instrument/index.d.ts +2 -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 +23 -0
- package/dist/types/features/session_replay/shared/recorder-events.d.ts.map +1 -0
- package/dist/types/features/session_replay/shared/recorder.d.ts +53 -0
- package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -0
- package/dist/types/features/session_replay/shared/replay-mode.d.ts.map +1 -0
- package/dist/types/features/session_replay/shared/stylesheet-evaluator.d.ts +22 -0
- package/dist/types/features/session_replay/shared/stylesheet-evaluator.d.ts.map +1 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/loaders/agent-base.d.ts +48 -12
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts +0 -33
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/package.json +49 -49
- package/src/common/config/state/init.js +1 -1
- package/src/common/harvest/harvest-scheduler.js +1 -1
- package/src/common/harvest/harvest.js +4 -3
- package/src/common/ids/__mocks__/bundle-id.js +1 -1
- package/src/common/ids/__mocks__/unique-id.js +2 -2
- package/src/common/ids/unique-id.js +1 -1
- package/src/common/session/__mocks__/session-entity.js +0 -6
- package/src/common/session/constants.js +18 -0
- package/src/common/session/session-entity.js +1 -17
- package/src/common/url/encode.js +2 -1
- package/src/features/metrics/aggregate/index.js +3 -1
- package/src/features/session_replay/aggregate/index.js +91 -246
- package/src/features/session_replay/constants.js +45 -0
- package/src/features/session_replay/instrument/index.js +18 -1
- package/src/features/session_replay/shared/recorder-events.js +27 -0
- package/src/features/session_replay/shared/recorder.js +190 -0
- package/src/features/session_replay/{replay-mode.js → shared/replay-mode.js} +4 -4
- package/src/features/session_replay/shared/stylesheet-evaluator.js +84 -0
- package/src/features/session_trace/aggregate/index.js +2 -2
- package/src/loaders/agent-base.js +59 -15
- package/src/loaders/agent.js +0 -38
- package/dist/types/features/session_replay/replay-mode.d.ts.map +0 -1
- /package/dist/types/features/session_replay/{replay-mode.d.ts → shared/replay-mode.d.ts} +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./api/interaction-types').InteractionInstance} InteractionInstance
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* A flexible class that may be used to compose an agent from a select subset of feature modules. In applications
|
|
6
3
|
* sensitive to network load, this may result in smaller builds with slightly lower performance impact.
|
|
@@ -18,37 +15,7 @@ export class Agent extends AgentBase {
|
|
|
18
15
|
runtime: any;
|
|
19
16
|
};
|
|
20
17
|
run(): false | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Adds a JavaScript object with a custom name, start time, etc. to an in-progress session trace.
|
|
23
|
-
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addtotrace/}
|
|
24
|
-
* @param {{name: string, start: number, end?: number, origin?: string, type?: string}} customAttributes Supply a JavaScript object with these required and optional name/value pairs:
|
|
25
|
-
*
|
|
26
|
-
* - Required name/value pairs: name, start
|
|
27
|
-
* - Optional name/value pairs: end, origin, type
|
|
28
|
-
*
|
|
29
|
-
* If you are sending the same event object to New Relic as a PageAction, omit the TYPE attribute. (type is a string to describe what type of event you are marking inside of a session trace.) If included, it will override the event type and cause the PageAction event to be sent incorrectly. Instead, use the name attribute for event information.
|
|
30
|
-
*/
|
|
31
|
-
addToTrace(customAttributes: {
|
|
32
|
-
name: string;
|
|
33
|
-
start: number;
|
|
34
|
-
end?: number;
|
|
35
|
-
origin?: string;
|
|
36
|
-
type?: string;
|
|
37
|
-
}): void;
|
|
38
|
-
/**
|
|
39
|
-
* Gives SPA routes more accurate names than default names. Monitors specific routes rather than by default grouping.
|
|
40
|
-
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcurrentroutename/}
|
|
41
|
-
* @param {string} name Current route name for the page.
|
|
42
|
-
*/
|
|
43
|
-
setCurrentRouteName(name: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Returns a new API object that is bound to the current SPA interaction.
|
|
46
|
-
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/interaction/}
|
|
47
|
-
* @returns {InteractionInstance} An API object that is bound to a specific BrowserInteraction event. Each time this method is called for the same BrowserInteraction, a new object is created, but it still references the same interaction.
|
|
48
|
-
*/
|
|
49
|
-
interaction(): InteractionInstance;
|
|
50
18
|
}
|
|
51
|
-
export type InteractionInstance = import('./api/interaction-types').InteractionInstance;
|
|
52
19
|
import { AgentBase } from './agent-base';
|
|
53
20
|
import { Aggregator } from '../common/aggregate/aggregator';
|
|
54
21
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"AAoBA
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH;IACE,oDAwBC;IAdC,oCAAsC;IACtC,yCAAiF;IACjF,yBAAkB;IAGlB,sCAAsD;IAWxD;;;;;MAOC;IAED,yBA8BC;CACF;0BAvFyB,cAAc;2BAQb,gCAAgC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newrelic/browser-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.251.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
|
|
6
6
|
"description": "New Relic Browser Agent",
|
|
@@ -169,86 +169,86 @@
|
|
|
169
169
|
"web-vitals": "^3.1.0"
|
|
170
170
|
},
|
|
171
171
|
"devDependencies": {
|
|
172
|
-
"@babel/cli": "^7.
|
|
173
|
-
"@babel/core": "^7.
|
|
174
|
-
"@babel/eslint-parser": "^7.
|
|
172
|
+
"@babel/cli": "^7.23.4",
|
|
173
|
+
"@babel/core": "^7.23.7",
|
|
174
|
+
"@babel/eslint-parser": "^7.23.3",
|
|
175
175
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
176
176
|
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
|
|
177
177
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
178
178
|
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
179
179
|
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
180
|
-
"@babel/plugin-syntax-import-assertions": "^7.
|
|
181
|
-
"@babel/preset-env": "^7.
|
|
182
|
-
"@babel/register": "^7.
|
|
183
|
-
"@faker-js/faker": "^
|
|
184
|
-
"@fastify/compress": "^6.
|
|
185
|
-
"@fastify/cors": "^8.
|
|
186
|
-
"@fastify/multipart": "^
|
|
187
|
-
"@fastify/static": "^6.
|
|
180
|
+
"@babel/plugin-syntax-import-assertions": "^7.23.3",
|
|
181
|
+
"@babel/preset-env": "^7.23.8",
|
|
182
|
+
"@babel/register": "^7.23.7",
|
|
183
|
+
"@faker-js/faker": "^8.3.1",
|
|
184
|
+
"@fastify/compress": "^6.5.0",
|
|
185
|
+
"@fastify/cors": "^8.5.0",
|
|
186
|
+
"@fastify/multipart": "^8.1.0",
|
|
187
|
+
"@fastify/static": "^6.12.0",
|
|
188
188
|
"@newrelic/newrelic-oss-cli": "^0.1.2",
|
|
189
189
|
"@newrelic/nr-querypack": "https://git@github.com/newrelic/nr-querypack",
|
|
190
|
-
"@wdio/cli": "^8.
|
|
191
|
-
"@wdio/local-runner": "^8.
|
|
192
|
-
"@wdio/
|
|
193
|
-
"@wdio/
|
|
194
|
-
"@wdio/
|
|
195
|
-
"@wdio/spec-reporter": "^8.
|
|
196
|
-
"babel-jest": "^29.
|
|
197
|
-
"babel-loader": "^
|
|
190
|
+
"@wdio/cli": "^8.27.0",
|
|
191
|
+
"@wdio/local-runner": "^8.27.0",
|
|
192
|
+
"@wdio/logger": "^8.24.12",
|
|
193
|
+
"@wdio/mocha-framework": "^8.27.0",
|
|
194
|
+
"@wdio/sauce-service": "^8.27.0",
|
|
195
|
+
"@wdio/spec-reporter": "^8.27.0",
|
|
196
|
+
"babel-jest": "^29.7.0",
|
|
197
|
+
"babel-loader": "^9.1.3",
|
|
198
198
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
199
199
|
"babelify": "^10.0.0",
|
|
200
200
|
"browserify": "^13.3.0",
|
|
201
|
-
"charm": "^1.0.
|
|
201
|
+
"charm": "^1.0.2",
|
|
202
202
|
"concat-stream": "^1.5.1",
|
|
203
203
|
"deepmerge-ts": "^5.1.0",
|
|
204
204
|
"defined": "^1.0.0",
|
|
205
205
|
"dotenv-webpack": "^8.0.1",
|
|
206
|
-
"eslint": "^8.
|
|
207
|
-
"eslint-config-standard": "^17.
|
|
208
|
-
"eslint-plugin-import": "^2.
|
|
209
|
-
"eslint-plugin-n": "^
|
|
206
|
+
"eslint": "^8.56.0",
|
|
207
|
+
"eslint-config-standard": "^17.1.0",
|
|
208
|
+
"eslint-plugin-import": "^2.29.1",
|
|
209
|
+
"eslint-plugin-n": "^16.6.2",
|
|
210
210
|
"eslint-plugin-promise": "^6.1.1",
|
|
211
|
-
"eslint-plugin-sonarjs": "^0.
|
|
212
|
-
"fastify": "^4.
|
|
213
|
-
"fastify-plugin": "^4.5.
|
|
214
|
-
"fs-extra": "^11.
|
|
211
|
+
"eslint-plugin-sonarjs": "^0.23.0",
|
|
212
|
+
"fastify": "^4.25.2",
|
|
213
|
+
"fastify-plugin": "^4.5.1",
|
|
214
|
+
"fs-extra": "^11.2.0",
|
|
215
215
|
"function-bind": "^1.1.1",
|
|
216
216
|
"glob": "^10.2.5",
|
|
217
|
-
"html-webpack-plugin": "^5.
|
|
218
|
-
"husky": "^8.0.
|
|
219
|
-
"istanbul-lib-coverage": "^3.2.
|
|
220
|
-
"istanbul-lib-instrument": "^
|
|
221
|
-
"istanbul-lib-report": "^3.0.
|
|
222
|
-
"istanbul-reports": "^3.1.
|
|
223
|
-
"jest": "^29.
|
|
224
|
-
"jest-environment-jsdom": "29.
|
|
225
|
-
"jest-extended": "^
|
|
217
|
+
"html-webpack-plugin": "^5.6.0",
|
|
218
|
+
"husky": "^8.0.3",
|
|
219
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
220
|
+
"istanbul-lib-instrument": "^6.0.1",
|
|
221
|
+
"istanbul-lib-report": "^3.0.1",
|
|
222
|
+
"istanbul-reports": "^3.1.6",
|
|
223
|
+
"jest": "^29.7.0",
|
|
224
|
+
"jest-environment-jsdom": "29.7.0",
|
|
225
|
+
"jest-extended": "^4.0.2",
|
|
226
226
|
"jung": "^2.1.0",
|
|
227
227
|
"just-debounce": "^1.0.0",
|
|
228
|
-
"node-fetch": "^3.3.
|
|
228
|
+
"node-fetch": "^3.3.2",
|
|
229
229
|
"npm-run-all": "^4.1.5",
|
|
230
230
|
"object-inspect": "^1.5.0",
|
|
231
231
|
"path-browserify": "^1.0.1",
|
|
232
232
|
"preprocessify": "0.0.6",
|
|
233
233
|
"process": "^0.11.10",
|
|
234
|
-
"saucelabs": "^7.
|
|
235
|
-
"semver": "^5.
|
|
234
|
+
"saucelabs": "^7.5.0",
|
|
235
|
+
"semver": "^7.5.4",
|
|
236
236
|
"serialize-anything": "^1.2.3",
|
|
237
237
|
"stream-browserify": "^3.0.0",
|
|
238
238
|
"tap-parser": "^1.2.2",
|
|
239
239
|
"tape": "^4.8.0",
|
|
240
240
|
"through": "^2.3.8",
|
|
241
|
-
"tsd": "^0.
|
|
242
|
-
"typescript": "^5.
|
|
241
|
+
"tsd": "^0.30.0",
|
|
242
|
+
"typescript": "^5.3.3",
|
|
243
243
|
"util": "^0.12.5",
|
|
244
|
-
"uuid": "^9.0.
|
|
245
|
-
"wait-on": "^7.0
|
|
244
|
+
"uuid": "^9.0.1",
|
|
245
|
+
"wait-on": "^7.2.0",
|
|
246
246
|
"wd": "^1.11.2",
|
|
247
|
-
"webpack": "^5.
|
|
248
|
-
"webpack-bundle-analyzer": "^4.
|
|
249
|
-
"webpack-cli": "^
|
|
247
|
+
"webpack": "^5.89.0",
|
|
248
|
+
"webpack-bundle-analyzer": "^4.10.1",
|
|
249
|
+
"webpack-cli": "^5.1.4",
|
|
250
250
|
"webpack-stream": "^7.0.0",
|
|
251
|
-
"yargs": "^17.
|
|
251
|
+
"yargs": "^17.7.2"
|
|
252
252
|
},
|
|
253
253
|
"files": [
|
|
254
254
|
"dist",
|
|
@@ -67,7 +67,7 @@ const model = () => {
|
|
|
67
67
|
sampling_rate: 50, // float from 0 - 100
|
|
68
68
|
error_sampling_rate: 50, // float from 0 - 100
|
|
69
69
|
collect_fonts: false, // serialize fonts for collection without public asset url, this is currently broken in RRWeb -- https://github.com/rrweb-io/rrweb/issues/1304. When fixed, revisit with test cases
|
|
70
|
-
inline_images: false, // serialize images for collection without public asset url
|
|
70
|
+
inline_images: false, // serialize images for collection without public asset url -- right now this is only useful for testing as it easily generates payloads too large to be harvested
|
|
71
71
|
inline_stylesheet: true, // serialize css for collection without public asset url
|
|
72
72
|
// recording config settings
|
|
73
73
|
mask_all_inputs: true,
|
|
@@ -7,7 +7,7 @@ import * as submitData from '../util/submit-data'
|
|
|
7
7
|
import { SharedContext } from '../context/shared-context'
|
|
8
8
|
import { Harvest } from './harvest'
|
|
9
9
|
import { subscribeToEOL } from '../unload/eol'
|
|
10
|
-
import { SESSION_EVENTS } from '../session/
|
|
10
|
+
import { SESSION_EVENTS } from '../session/constants'
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Periodically invokes harvest calls and handles retries
|
|
@@ -103,7 +103,7 @@ export class Harvest extends SharedContext {
|
|
|
103
103
|
if (customUrl) url = customUrl
|
|
104
104
|
if (raw) url = `${protocol}://${perceviedBeacon}/${endpoint}`
|
|
105
105
|
|
|
106
|
-
const baseParams = !raw && includeBaseParams ? this.baseQueryString() : ''
|
|
106
|
+
const baseParams = !raw && includeBaseParams ? this.baseQueryString(qs) : ''
|
|
107
107
|
let payloadParams = encodeObj(qs, agentRuntime.maxBytes)
|
|
108
108
|
if (!submitMethod) {
|
|
109
109
|
submitMethod = submitData.getSubmitMethod({ isFinalHarvest: opts.unload })
|
|
@@ -163,7 +163,7 @@ export class Harvest extends SharedContext {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// The stuff that gets sent every time.
|
|
166
|
-
baseQueryString () {
|
|
166
|
+
baseQueryString (qs) {
|
|
167
167
|
const runtime = getRuntime(this.sharedContext.agentIdentifier)
|
|
168
168
|
const info = getInfo(this.sharedContext.agentIdentifier)
|
|
169
169
|
|
|
@@ -180,7 +180,8 @@ export class Harvest extends SharedContext {
|
|
|
180
180
|
'&ck=0', // ck param DEPRECATED - still expected by backend
|
|
181
181
|
'&s=' + (runtime.session?.state.value || '0'), // the 0 id encaps all untrackable and default traffic
|
|
182
182
|
encodeParam('ref', ref),
|
|
183
|
-
encodeParam('ptid', (runtime.ptid ? '' + runtime.ptid : ''))
|
|
183
|
+
encodeParam('ptid', (runtime.ptid ? '' + runtime.ptid : '')),
|
|
184
|
+
encodeParam('hr', (runtime?.session?.state.sessionReplayMode === 1 ? '1' : '0'), qs) // hasReplay
|
|
184
185
|
].join(''))
|
|
185
186
|
}
|
|
186
187
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { faker } from '@faker-js/faker'
|
|
2
|
-
export const bundleId = faker.
|
|
2
|
+
export const bundleId = faker.string.uuid()
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { faker } from '@faker-js/faker'
|
|
2
2
|
|
|
3
3
|
export function generateUuid () {
|
|
4
|
-
return faker.
|
|
4
|
+
return faker.string.uuid()
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function generateRandomHexString (length) {
|
|
8
|
-
return faker.
|
|
8
|
+
return faker.string.hexadecimal({ length, prefix: '' })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function generateSpanId () {
|
|
@@ -79,7 +79,7 @@ export function generateRandomHexString (length) {
|
|
|
79
79
|
|
|
80
80
|
const chars = []
|
|
81
81
|
for (var i = 0; i < length; i++) {
|
|
82
|
-
chars.push(getRandomValue(randomValueTable, ++
|
|
82
|
+
chars.push(getRandomValue(randomValueTable, randomValueIndex++).toString(16))
|
|
83
83
|
}
|
|
84
84
|
return chars.join('')
|
|
85
85
|
}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
export const PREFIX = 'NRBA'
|
|
2
2
|
export const DEFAULT_EXPIRES_MS = 14400000
|
|
3
3
|
export const DEFAULT_INACTIVE_MS = 1800000
|
|
4
|
+
|
|
5
|
+
export const SESSION_EVENTS = {
|
|
6
|
+
PAUSE: 'session-pause',
|
|
7
|
+
RESET: 'session-reset',
|
|
8
|
+
RESUME: 'session-resume',
|
|
9
|
+
UPDATE: 'session-update'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const SESSION_EVENT_TYPES = {
|
|
13
|
+
SAME_TAB: 'same-tab',
|
|
14
|
+
CROSS_TAB: 'cross-tab'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const MODE = {
|
|
18
|
+
OFF: 0,
|
|
19
|
+
FULL: 1,
|
|
20
|
+
ERROR: 2
|
|
21
|
+
}
|
|
@@ -4,7 +4,7 @@ import { stringify } from '../util/stringify'
|
|
|
4
4
|
import { ee } from '../event-emitter/contextual-ee'
|
|
5
5
|
import { Timer } from '../timer/timer'
|
|
6
6
|
import { isBrowserScope } from '../constants/runtime'
|
|
7
|
-
import { DEFAULT_EXPIRES_MS, DEFAULT_INACTIVE_MS, PREFIX } from './constants'
|
|
7
|
+
import { DEFAULT_EXPIRES_MS, DEFAULT_INACTIVE_MS, MODE, PREFIX, SESSION_EVENTS, SESSION_EVENT_TYPES } from './constants'
|
|
8
8
|
import { InteractionTimer } from '../timer/interaction-timer'
|
|
9
9
|
import { wrapEvents } from '../wrap'
|
|
10
10
|
import { getModeledObject } from '../config/state/configurable'
|
|
@@ -13,11 +13,6 @@ import { SUPPORTABILITY_METRIC_CHANNEL } from '../../features/metrics/constants'
|
|
|
13
13
|
import { FEATURE_NAMES } from '../../loaders/features/features'
|
|
14
14
|
import { windowAddEventListener } from '../event-listener/event-listener-opts'
|
|
15
15
|
|
|
16
|
-
export const MODE = {
|
|
17
|
-
OFF: 0,
|
|
18
|
-
FULL: 1,
|
|
19
|
-
ERROR: 2
|
|
20
|
-
}
|
|
21
16
|
// this is what can be stored in local storage (not enforced but probably should be)
|
|
22
17
|
// these values should sync between local storage and the parent class props
|
|
23
18
|
const model = {
|
|
@@ -31,17 +26,6 @@ const model = {
|
|
|
31
26
|
traceHarvestStarted: false,
|
|
32
27
|
custom: {}
|
|
33
28
|
}
|
|
34
|
-
export const SESSION_EVENTS = {
|
|
35
|
-
PAUSE: 'session-pause',
|
|
36
|
-
RESET: 'session-reset',
|
|
37
|
-
RESUME: 'session-resume',
|
|
38
|
-
UPDATE: 'session-update'
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const SESSION_EVENT_TYPES = {
|
|
42
|
-
SAME_TAB: 'same-tab',
|
|
43
|
-
CROSS_TAB: 'cross-tab'
|
|
44
|
-
}
|
|
45
29
|
|
|
46
30
|
export class SessionEntity {
|
|
47
31
|
/**
|
package/src/common/url/encode.js
CHANGED
|
@@ -67,7 +67,8 @@ export function obj (payload, maxBytes) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Constructs an HTTP parameter to add to the BAM router URL
|
|
70
|
-
export function param (name, value) {
|
|
70
|
+
export function param (name, value, base = {}) {
|
|
71
|
+
if (Object.keys(base).includes(name)) return '' // we assume if feature supplied a matching qp to the base, we should honor what the feature sent over the default
|
|
71
72
|
if (value && typeof (value) === 'string') {
|
|
72
73
|
return '&' + name + '=' + qs(value)
|
|
73
74
|
}
|
|
@@ -90,9 +90,11 @@ export class Aggregate extends AggregateBase {
|
|
|
90
90
|
if (rules.length > 0 && !validateRules(rules)) this.storeSupportabilityMetrics('Generic/Obfuscate/Invalid')
|
|
91
91
|
|
|
92
92
|
// Check if proxy for either chunks or beacon is being used
|
|
93
|
-
const { proxy } = getConfiguration(this.agentIdentifier)
|
|
93
|
+
const { proxy, privacy } = getConfiguration(this.agentIdentifier)
|
|
94
94
|
if (proxy.assets) this.storeSupportabilityMetrics('Config/AssetsUrl/Changed')
|
|
95
95
|
if (proxy.beacon) this.storeSupportabilityMetrics('Config/BeaconUrl/Changed')
|
|
96
|
+
|
|
97
|
+
if (!(isBrowserScope && privacy.cookies_enabled)) this.storeSupportabilityMetrics('Config/SessionTracking/Disabled')
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
eachSessionChecks () {
|