@newrelic/browser-agent 1.237.1 → 1.238.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 (106) hide show
  1. package/dist/cjs/common/constants/env.cdn.js +1 -1
  2. package/dist/cjs/common/constants/env.npm.js +1 -1
  3. package/dist/cjs/common/deny-list/deny-list.js +1 -1
  4. package/dist/cjs/common/event-emitter/contextual-ee.js +18 -26
  5. package/dist/cjs/common/event-emitter/event-context.js +12 -0
  6. package/dist/cjs/common/harvest/harvest.js +2 -1
  7. package/dist/cjs/common/ids/bundle-id.js +19 -0
  8. package/dist/cjs/common/wrap/wrap-events.js +3 -2
  9. package/dist/cjs/common/wrap/wrap-fetch.js +1 -3
  10. package/dist/cjs/common/wrap/wrap-function.js +15 -46
  11. package/dist/cjs/common/wrap/wrap-mutation.js +1 -2
  12. package/dist/cjs/common/wrap/wrap-promise.js +2 -3
  13. package/dist/cjs/common/wrap/wrap-xhr.js +23 -27
  14. package/dist/cjs/features/ajax/instrument/distributed-tracing.js +0 -4
  15. package/dist/cjs/features/ajax/instrument/index.js +19 -9
  16. package/dist/cjs/features/session_replay/aggregate/index.js +2 -0
  17. package/dist/cjs/features/session_trace/aggregate/index.js +14 -8
  18. package/dist/cjs/loaders/agent-base.js +12 -0
  19. package/dist/cjs/loaders/api/api.js +14 -1
  20. package/dist/cjs/loaders/api/interaction-types.js +11 -4
  21. package/dist/esm/common/constants/env.cdn.js +1 -1
  22. package/dist/esm/common/constants/env.npm.js +1 -1
  23. package/dist/esm/common/deny-list/deny-list.js +1 -1
  24. package/dist/esm/common/event-emitter/contextual-ee.js +16 -23
  25. package/dist/esm/common/event-emitter/event-context.js +5 -0
  26. package/dist/esm/common/harvest/harvest.js +2 -1
  27. package/dist/esm/common/ids/bundle-id.js +13 -0
  28. package/dist/esm/common/wrap/wrap-events.js +4 -3
  29. package/dist/esm/common/wrap/wrap-fetch.js +2 -4
  30. package/dist/esm/common/wrap/wrap-function.js +15 -44
  31. package/dist/esm/common/wrap/wrap-mutation.js +2 -3
  32. package/dist/esm/common/wrap/wrap-promise.js +3 -4
  33. package/dist/esm/common/wrap/wrap-xhr.js +23 -27
  34. package/dist/esm/features/ajax/instrument/distributed-tracing.js +0 -4
  35. package/dist/esm/features/ajax/instrument/index.js +20 -10
  36. package/dist/esm/features/session_replay/aggregate/index.js +2 -0
  37. package/dist/esm/features/session_trace/aggregate/index.js +14 -8
  38. package/dist/esm/loaders/agent-base.js +12 -0
  39. package/dist/esm/loaders/api/api.js +14 -1
  40. package/dist/esm/loaders/api/interaction-types.js +11 -4
  41. package/dist/types/common/event-emitter/contextual-ee.d.ts +22 -2
  42. package/dist/types/common/event-emitter/contextual-ee.d.ts.map +1 -1
  43. package/dist/types/common/event-emitter/event-context.d.ts +5 -0
  44. package/dist/types/common/event-emitter/event-context.d.ts.map +1 -0
  45. package/dist/types/common/event-emitter/register-handler.d.ts +1 -1
  46. package/dist/types/common/harvest/harvest.d.ts.map +1 -1
  47. package/dist/types/common/ids/bundle-id.d.ts +5 -0
  48. package/dist/types/common/ids/bundle-id.d.ts.map +1 -0
  49. package/dist/types/common/session/session-entity.d.ts +6 -6
  50. package/dist/types/common/window/nreum.d.ts +2 -2
  51. package/dist/types/common/wrap/wrap-events.d.ts.map +1 -1
  52. package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -1
  53. package/dist/types/common/wrap/wrap-function.d.ts +1 -19
  54. package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
  55. package/dist/types/common/wrap/wrap-mutation.d.ts.map +1 -1
  56. package/dist/types/common/wrap/wrap-promise.d.ts.map +1 -1
  57. package/dist/types/common/wrap/wrap-xhr.d.ts.map +1 -1
  58. package/dist/types/features/ajax/instrument/distributed-tracing.d.ts +1 -1
  59. package/dist/types/features/ajax/instrument/distributed-tracing.d.ts.map +1 -1
  60. package/dist/types/features/metrics/aggregate/endpoint-map.d.ts +5 -5
  61. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  62. package/dist/types/features/session_trace/aggregate/index.d.ts +5 -0
  63. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  64. package/dist/types/loaders/agent-base.d.ts +9 -0
  65. package/dist/types/loaders/agent-base.d.ts.map +1 -1
  66. package/dist/types/loaders/api/api.d.ts +6 -0
  67. package/dist/types/loaders/api/api.d.ts.map +1 -1
  68. package/dist/types/loaders/api/interaction-types.d.ts +18 -7
  69. package/dist/types/loaders/api/interaction-types.d.ts.map +1 -1
  70. package/dist/types/loaders/configure/configure.d.ts +1 -0
  71. package/dist/types/loaders/configure/configure.d.ts.map +1 -1
  72. package/dist/types/loaders/features/features.d.ts +9 -9
  73. package/dist/types/loaders/micro-agent.d.ts +1 -1
  74. package/dist/types/loaders/micro-agent.d.ts.map +1 -1
  75. package/package.json +22 -27
  76. package/src/common/deny-list/deny-list.js +1 -1
  77. package/src/common/deny-list/deny-list.test.js +103 -30
  78. package/src/common/event-emitter/{contextual-ee.test.js → contextual-ee.component-test.js} +15 -32
  79. package/src/common/event-emitter/contextual-ee.js +20 -31
  80. package/src/common/event-emitter/event-context.js +5 -0
  81. package/src/common/harvest/harvest.js +2 -1
  82. package/src/common/harvest/harvest.test.js +1 -1
  83. package/src/common/ids/__mocks__/bundle-id.js +2 -0
  84. package/src/common/ids/__mocks__/unique-id.js +17 -0
  85. package/src/common/ids/bundle-id.js +13 -0
  86. package/src/common/url/__mocks__/parse-url.js +15 -0
  87. package/src/common/util/__mocks__/get-or-set.js +5 -0
  88. package/src/common/window/__mocks__/nreum.js +10 -0
  89. package/src/common/wrap/wrap-events.js +4 -3
  90. package/src/common/wrap/wrap-fetch.js +2 -4
  91. package/src/common/wrap/wrap-function.js +16 -44
  92. package/src/common/wrap/wrap-mutation.js +2 -3
  93. package/src/common/wrap/{wrap-promise.test.js → wrap-promise.component-test.js} +2 -32
  94. package/src/common/wrap/wrap-promise.js +3 -4
  95. package/src/common/wrap/wrap-xhr.js +24 -28
  96. package/src/features/ajax/instrument/distributed-tracing.js +0 -4
  97. package/src/features/ajax/instrument/distributed-tracing.test.js +375 -0
  98. package/src/features/ajax/instrument/index.js +22 -10
  99. package/src/features/session_replay/aggregate/index.js +2 -0
  100. package/src/features/session_trace/aggregate/index.js +16 -7
  101. package/src/loaders/agent-base.js +12 -0
  102. package/src/loaders/api/api.component-test.js +45 -0
  103. package/src/loaders/api/api.js +14 -1
  104. package/src/loaders/api/interaction-types.js +11 -4
  105. /package/src/common/url/{encode.component-test.js → encode.test.js} +0 -0
  106. /package/src/common/url/{protocol.component-test.js → protocol.test.js} +0 -0
@@ -1,4 +1,24 @@
1
- export function getOrSetContext(obj: any): any;
1
+ declare namespace globalInstance {
2
+ export { addEventListener as on };
3
+ export { addEventListener };
4
+ export { removeEventListener };
5
+ export { emit };
6
+ export { getOrCreate as get };
7
+ export { listeners };
8
+ export { context };
9
+ export { bufferEventsByGroup as buffer };
10
+ export { abort };
11
+ export const aborted: boolean;
12
+ export { isBuffering };
13
+ export { debugId };
14
+ export const backlog: any;
15
+ }
16
+ export const contextId: string;
17
+ declare function emit(type: any, args: any, contextOrStore: any, force: any, bubble: any): any;
18
+ declare function getOrCreate(name: any): any;
19
+ declare function listeners(type: any): any;
20
+ declare function bufferEventsByGroup(types: any, group: any): void;
21
+ declare function abort(): void;
22
+ declare function isBuffering(type: any): boolean;
2
23
  export { globalInstance as ee };
3
- declare var globalInstance: any;
4
24
  //# sourceMappingURL=contextual-ee.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextual-ee.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/contextual-ee.js"],"names":[],"mappings":"AAmJA,+CAEC;;AAvID,gCAAkB"}
1
+ {"version":3,"file":"contextual-ee.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/contextual-ee.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,+BAA0C;AA0DxC,+FAsBC;AAqBD,6CAEC;AAND,2CAEC;AAMD,mEAaC;AAcH,+BAGC;AAfC,iDAGC"}
@@ -0,0 +1,5 @@
1
+ export class EventContext {
2
+ constructor(contextId: any);
3
+ contextId: any;
4
+ }
5
+ //# sourceMappingURL=event-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-context.d.ts","sourceRoot":"","sources":["../../../../src/common/event-emitter/event-context.js"],"names":[],"mappings":"AAAA;IACE,4BAEC;IADC,eAA0B;CAE7B"}
@@ -1,7 +1,7 @@
1
1
  export function defaultRegister(type: any, handler: any, group: any, ee: any): void;
2
2
  export namespace defaultRegister {
3
3
  export { registerWithSpecificEmitter as on };
4
- export let handlers: {};
4
+ export const handlers: {};
5
5
  }
6
6
  export { defaultRegister as registerHandler };
7
7
  declare function registerWithSpecificEmitter(ee: any, handlers: any, type: any, handler: any, group: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IACpD,kCAAsH;IAEtH,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAUzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAmFnB;IAGD,0BAmBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAuB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BAnPY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BAZjC,2BAA2B;2BAF9B,mBAAmB"}
1
+ {"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IACpD,kCAAsH;IAEtH,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAWzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAmFnB;IAGD,0BAmBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAuB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BApPY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BAZjC,2BAA2B;2BAF9B,mBAAmB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Provides a unique id for the current agent bundle
3
+ */
4
+ export const bundleId: string;
5
+ //# sourceMappingURL=bundle-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle-id.d.ts","sourceRoot":"","sources":["../../../../src/common/ids/bundle-id.js"],"names":[],"mappings":"AASA;;GAEG;AACH,8BAAsC"}
@@ -1,12 +1,12 @@
1
1
  export namespace MODE {
2
- let OFF: number;
3
- let FULL: number;
4
- let ERROR: number;
2
+ const OFF: number;
3
+ const FULL: number;
4
+ const ERROR: number;
5
5
  }
6
6
  export namespace SESSION_EVENTS {
7
- let PAUSE: string;
8
- let RESET: string;
9
- let RESUME: string;
7
+ const PAUSE: string;
8
+ const RESET: string;
9
+ const RESUME: string;
10
10
  }
11
11
  export class SessionEntity {
12
12
  /**
@@ -8,7 +8,7 @@ export function addToNREUM(fnName: any, fn: any): void;
8
8
  export function NREUMinitialized(): void;
9
9
  export function gosCDN(): any;
10
10
  export namespace defaults {
11
- let beacon: string;
12
- let errorBeacon: string;
11
+ const beacon: string;
12
+ const errorBeacon: string;
13
13
  }
14
14
  //# sourceMappingURL=nreum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-events.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-events.js"],"names":[],"mappings":"AAmBA;;;;;;GAMG;AACH,qCAJW,MAAM,GAEJ,MAAM,CAyDlB;AAeD;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-events.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-events.js"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,qCAJW,MAAM,GAEJ,MAAM,CAyDlB;AAeD;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-fetch.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-fetch.js"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH,oCAJW,MAAM,GAEJ,MAAM,CAqElB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-fetch.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-fetch.js"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AACH,oCAJW,MAAM,GAEJ,MAAM,CAqElB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -5,24 +5,6 @@
5
5
  * @returns {function} The wrapped function.
6
6
  */
7
7
  export function createWrapperWithEmitter(emitter?: Object | undefined, always: boolean): Function;
8
- /**
9
- * Creates a wrapped version of a function using a specified wrapper function. The new wrapped function references the
10
- * original function. Also copies the properties of the original function to the wrapped function.
11
- * @param {function} fn - A function to be wrapped.
12
- * @param {function} wrapper - A higher order function that returns a new function, which executes the function passed
13
- * to the higher order function as an argument.
14
- * @returns {function} A wrapped function with an internal reference to the original function.
15
- */
16
- export function wrapFunction(fn: Function, wrapper: Function): Function;
17
- /**
18
- * Replaces a function with a wrapped version of itself. To preserve object references, rather than taking the function
19
- * itself as an argument, takes the object on which the particular named function is a property.
20
- * @param {Object} obj - The object on which the named function is a property.
21
- * @param {string} fnName - The name of the function to be wrapped.
22
- * @param {function} wrapper - A higher order function that returns a new function, which executes the function passed
23
- * to the higher order function as an argument.
24
- */
25
- export function wrapInPlace(obj: Object, fnName: string, wrapper: Function): void;
26
- export const flag: "nr@original";
8
+ export const flag: string;
27
9
  export default createWrapperWithEmitter;
28
10
  //# sourceMappingURL=wrap-function.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,+EAHW,OAAO,YAkIjB;AA6DD;;;;;;;GAOG;AACH,wEAKC;AAED;;;;;;;GAOG;AACH,iCALW,MAAM,UACN,MAAM,2BAOhB;AA7OD,iCAAiC"}
1
+ {"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,+EAHW,OAAO,YAgIjB;AApJD,0BAA6C"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-mutation.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-mutation.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,uCAHW,MAAM,GACJ,MAAM,CA0BlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-mutation.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-mutation.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,uCAHW,MAAM,GACJ,MAAM,CA0BlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-promise.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-promise.js"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,MAAM,CAqIlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-promise.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-promise.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,MAAM,CAqIlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-xhr.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-xhr.js"],"names":[],"mappings":"AAoBA;;;;;GAKG;AAEH,kCAJW,MAAM,GACJ,MAAM,CAkLlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
1
+ {"version":3,"file":"wrap-xhr.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-xhr.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AAEH,kCAJW,MAAM,GACJ,MAAM,CA+KlB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,GAEJ,MAAM,CAIlB"}
@@ -6,10 +6,10 @@ export class DT {
6
6
  traceId: string;
7
7
  timestamp: number;
8
8
  } | null;
9
- shouldGenerateTrace(parsedOrigin: any): boolean;
10
9
  generateTraceContextParentHeader(spanId: any, traceId: any): string;
11
10
  generateTraceContextStateHeader(spanId: any, timestamp: any, accountId: any, appId: any, trustKey: any): string;
12
11
  generateTraceHeader(spanId: any, traceId: any, timestamp: any, accountId: any, appId: any, trustKey: any): string | null;
12
+ shouldGenerateTrace(parsedOrigin: any): boolean;
13
13
  isAllowedOrigin(parsedOrigin: any): boolean;
14
14
  isDtEnabled(): boolean;
15
15
  excludeNewrelicHeader(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"distributed-tracing.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/distributed-tracing.js"],"names":[],"mappings":"AAUA;IACE,kCAMC;IALC,qBAAsC;IAOxC;;;;aA0CC;IA2CD,gDAEC;IA3CD,oEAEC;IAED,gHASC;IAED,yHAsBC;IAQD,4CAuBC;IAED,uBAMC;IAGD,iCAMC;IAED,oCAMC;IAED,yCAMC;CACF"}
1
+ {"version":3,"file":"distributed-tracing.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/distributed-tracing.js"],"names":[],"mappings":"AAUA;IACE,kCAEC;IADC,qBAAsC;IAGxC;;;;aA0CC;IAED,oEAEC;IAED,gHASC;IAED,yHAsBC;IAID,gDAEC;IAED,4CAuBC;IAED,uBAMC;IAGD,iCAMC;IAED,oCAMC;IAED,yCAMC;CACF"}
@@ -1,8 +1,8 @@
1
1
  export namespace endpointMap {
2
- let rum: string;
3
- let events: string;
4
- let ins: string;
5
- let jserrors: string;
6
- let resources: string;
2
+ const rum: string;
3
+ const events: string;
4
+ const ins: string;
5
+ const jserrors: string;
6
+ const resources: string;
7
7
  }
8
8
  //# sourceMappingURL=endpoint-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AAwBA,4CAA4C;AAE5C,mCAAmC;AAInC,uCAAuC;AACvC,uCAAuC;AACvC,iCAAiC;AACjC,uCAAuC;AAIvC;IACE,2BAAiC;IACjC,mDA4FC;IA1FC,iHAAiH;IACjH,cAAgB;IAChB,8GAA8G;IAC9G,wBAAgH;IAChH,iFAAiF;IACjF,qBAAwB;IACxB,mEAAmE;IACnE,sBAAyB;IACzB,6GAA6G;IAC7G,aAAoB;IAGpB,iEAAiE;IACjE,mBAAsB;IACtB,gDAAgD;IAChD,wBAA0B;IAE1B,gGAAgG;IAChG,sBAAyB;IACzB;;;MAGE;IACF,qBAAwB;IACxB,+HAA+H;IAC/H,kBAAqB;IAErB,oHAAoH;IACpH;;;MAAsD;IAEtD,qGAAqG;IACrG,+BAA+B;IAO/B,uIAAuI;IACvI,0BAAyE;IAiBvE,wCAKQ;IA+BZ;;;;;;OAMG;IACH,kCALW,OAAO,eACP,OAAO,cACP,OAAO,GACL,IAAI,CAuDhB;IAED;;;;;;;;;oBAaC;IAED;;;;;;;;;MAyBC;IAED,qCAOC;IAED,kFAAkF;IAClF,oBAOC;IAED,qDAAqD;IACrD,uBAyBC;IAED,yHAAyH;IACzH,yCA8BC;IAED,0HAA0H;IAC1H,yBAGC;IAED,qCAIC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED,yDAAyD;IACzD,cAOC;IAED;;;SAGK;IACL,oCAGC;IAED,yCAGC;CACF;8BAvV6B,4BAA4B;iCALzB,2CAA2C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AAwBA,4CAA4C;AAE5C,mCAAmC;AAInC,uCAAuC;AACvC,uCAAuC;AACvC,iCAAiC;AACjC,uCAAuC;AAIvC;IACE,2BAAiC;IACjC,mDA4FC;IA1FC,iHAAiH;IACjH,cAAgB;IAChB,8GAA8G;IAC9G,wBAAgH;IAChH,iFAAiF;IACjF,qBAAwB;IACxB,mEAAmE;IACnE,sBAAyB;IACzB,6GAA6G;IAC7G,aAAoB;IAGpB,iEAAiE;IACjE,mBAAsB;IACtB,gDAAgD;IAChD,wBAA0B;IAE1B,gGAAgG;IAChG,sBAAyB;IACzB;;;MAGE;IACF,qBAAwB;IACxB,+HAA+H;IAC/H,kBAAqB;IAErB,oHAAoH;IACpH;;;MAAsD;IAEtD,qGAAqG;IACrG,+BAA+B;IAO/B,uIAAuI;IACvI,0BAAyE;IAiBvE,wCAKQ;IA+BZ;;;;;;OAMG;IACH,kCALW,OAAO,eACP,OAAO,cACP,OAAO,GACL,IAAI,CAyDhB;IAED;;;;;;;;;oBAaC;IAED;;;;;;;;;MAyBC;IAED,qCAOC;IAED,kFAAkF;IAClF,oBAOC;IAED,qDAAqD;IACrD,uBAyBC;IAED,yHAAyH;IACzH,yCA8BC;IAED,0HAA0H;IAC1H,yBAGC;IAED,qCAIC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED,yDAAyD;IACzD,cAOC;IAED;;;SAGK;IACL,oCAGC;IAED,yCAGC;CACF;8BAzV6B,4BAA4B;iCALzB,2CAA2C"}
@@ -9,7 +9,11 @@ export class Aggregate extends AggregateBase {
9
9
  sentTrace: {} | null | undefined;
10
10
  harvestTimeSeconds: any;
11
11
  maxNodesPerHarvest: any;
12
+ /**
13
+ * Standalone (mode) refers to the legacy version of ST before the idea of 'session' or the Replay feature existed.
14
+ * It has some different behavior vs when used in tandem with replay. */
12
15
  isStandalone: boolean | undefined;
16
+ operationalGate: HandlerCache | undefined;
13
17
  startTracing(startupBuffer: any, dontStartHarvestYet?: boolean): void;
14
18
  processPVT(name: any, value: any, attrs: any): void;
15
19
  storeTiming(timingEntry: any): void;
@@ -43,4 +47,5 @@ export class Aggregate extends AggregateBase {
43
47
  #private;
44
48
  }
45
49
  import { AggregateBase } from '../../utils/aggregate-base';
50
+ import { HandlerCache } from '../../utils/handler-cache';
46
51
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_trace/aggregate/index.js"],"names":[],"mappings":"AAkCA;IACE,2BAAiC;IAGjC,iEAqHC;IAnHC,kBAA+C;IAK/C,sBAAiD;IACjD,yBAAc;IACd,sBAAe;IACf,8BAAkB;IAClB,iCAAqB;IACrB,wBAA0G;IAC1G,wBAA4G;IAC5G,kCAAyB;IAyG3B,sEAcC;IA4CD,oDAOC;IAGD,oCAwBC;IAGD,uEAkBC;IAED,oDAMC;IAED,wBAwBC;IAED,uCAuBC;IAGD,gDASC;IAID,qCAkBC;IAGD,qEAUC;IAGD,mEAUC;IAGD,yBAWC;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACJ,MAAM,CAsBlB;IAGD;;;;;;;;;;MAwBC;IAED,mEA8BC;;CACF;8BA5d6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_trace/aggregate/index.js"],"names":[],"mappings":"AAkCA;IACE,2BAAiC;IAGjC,iEAyHC;IAvHC,kBAA+C;IAK/C,sBAAiD;IACjD,yBAAc;IACd,sBAAe;IACf,8BAAkB;IAClB,iCAAqB;IACrB,wBAA0G;IAC1G,wBAA4G;IAC5G;;4EAEwE;IACxE,kCAAyB;IAGzB,0CAAsC;IAuGxC,sEAcC;IA6CD,oDAOC;IAGD,oCAwBC;IAGD,uEAkBC;IAED,oDAMC;IAED,wBAwBC;IAED,uCAuBC;IAGD,gDASC;IAID,qCAkBC;IAGD,qEAUC;IAGD,mEAUC;IAGD,yBAeC;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACJ,MAAM,CAsBlB;IAGD;;;;;;;;;;MAwBC;IAED,mEA8BC;;CACF;8BAre6B,4BAA4B;6BAH7B,2BAA2B"}
@@ -34,6 +34,15 @@ export class AgentBase {
34
34
  * @param {string|null} value A string identifier for the end-user, useful for tying all browser events to specific users. The value parameter does not have to be unique. If IDs should be unique, the caller is responsible for that validation. Passing a null value unsets any existing user ID.
35
35
  */
36
36
  setUserId(value: string | null): void;
37
+ /**
38
+ * Adds a user-defined application version string to subsequent events on the page.
39
+ * This decorates all payloads with an attribute of `application.version` which is queryable in NR1.
40
+ * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setapplicationversion/}
41
+ * @param {string|null} value A string identifier for the application version, useful for
42
+ * tying all browser events to a specific release tag. The value parameter does not
43
+ * have to be unique. Passing a null value unsets any existing value.
44
+ */
45
+ setApplicationVersion(value: string | null): void;
37
46
  /**
38
47
  * Allows selective ignoring and grouping of known errors that the browser agent captures.
39
48
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/seterrorhandler/}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAEA;IACE;;;;;OAKG;IACH,oBAHW,MAAM,yCAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,mCAKhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,IAAI,uCAK5B;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,+CAKtB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,QAIrB;IAED;;;;OAIG;IACH,kCAFmB,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,QAI9D;IAED;;;;OAIG;IACH,+CAEC;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,QAIhB;CACF"}
1
+ {"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAEA;IACE;;;;;OAKG;IACH,oBAHW,MAAM,yCAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,mCAKhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,IAAI,uCAK5B;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,+CAKtB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,QAIrB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,GAAC,IAAI,QAMrB;IAED;;;;OAIG;IACH,kCAFmB,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,QAI9D;IAED;;;;OAIG;IACH,+CAEC;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,QAIhB;CACF"}
@@ -10,6 +10,12 @@ export function setAPI(agentIdentifier: any, forceDrain: any): {
10
10
  * @returns @see apiCall
11
11
  */
12
12
  setUserId(value: string): any;
13
+ /**
14
+ * Attach the 'applcation.version' attribute onto agent payloads. This may be used in NR queries to group all browser events by a specific customer-defined release.
15
+ * @param {string|null} value - Application version -- if null, will "unset" the value
16
+ * @returns @see apiCall
17
+ */
18
+ setApplicationVersion(value: string | null): any;
13
19
  interaction(): any;
14
20
  noticeError(err: any, customAttributes: any): void;
15
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAkBA,2CAoBC;AAED;;;;;IA0DE;;;;OAIG;qBAFQ,MAAM;;;EAuElB;AA3JD,0CAA0C"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAkBA,2CAoBC;AAED;;;;;IA0DE;;;;OAIG;qBAFQ,MAAM;IAWjB;;;;OAIG;iCAFQ,MAAM,GAAC,IAAI;;;EAuEvB;AAxKD,0CAA0C"}
@@ -6,7 +6,7 @@
6
6
  * @property {getContext} getContext
7
7
  * @property {ignore} ignore
8
8
  * @property {onEnd} onEnd
9
- * @property {onEnd} save
9
+ * @property {save} save
10
10
  * @property {setAttribute} setAttribute
11
11
  * @property {setName} setName
12
12
  */
@@ -22,8 +22,8 @@
22
22
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/createtracer/}
23
23
  * @callback createTracer
24
24
  * @param {string} name This will be used as the name of the tracer.
25
- * @param {string} [callback] A callback that contains the synchronous work to run at the end of the async work. To execute this callback, call the wrapper function returned using createTracer().
26
- * @returns {Function} Returns a method that wraps the original callback. When this method is invoked, it calls the original callback and ends the async timing.
25
+ * @param {(...args: any[]) => any} [callback] A callback that contains the synchronous work to run at the end of the async work. To execute this callback, call the wrapper function returned using createTracer().
26
+ * @returns {(...args: any[]) => any} Returns a method that wraps the original callback. When this method is invoked, it calls the original callback and ends the async timing.
27
27
  */
28
28
  /**
29
29
  * Ends the SPA interaction at the current time.
@@ -38,6 +38,12 @@
38
38
  * @param {(ctx: object) => void} callback This function is called when the interaction ends. It is called with one parameter, which is the interaction context.
39
39
  * @returns {InteractionInstance} Returns the same interaction object allowing method chaining.
40
40
  */
41
+ /**
42
+ * Overrides other SPA save() calls; ignores an interaction so it is not saved or sent to New Relic.
43
+ * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/ignore/}
44
+ * @callback ignore
45
+ * @returns {InteractionInstance} Returns the same interaction object allowing method chaining.
46
+ */
41
47
  /**
42
48
  * Change the values associated with a SPA interaction before the interaction is saved.
43
49
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/onend/}
@@ -56,7 +62,7 @@
56
62
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setattribute/}
57
63
  * @callback setAttribute
58
64
  * @param {string} key Used as the attribute name on the BrowserInteraction event.
59
- * @param {any} key Used as the attribute value on the BrowserInteraction event. This can be a string, number, boolean, or object. If it is an object, New Relic serializes it to a JSON string.
65
+ * @param {any} value Used as the attribute value on the BrowserInteraction event. This can be a string, number, boolean, or object. If it is an object, New Relic serializes it to a JSON string.
60
66
  * @returns {InteractionInstance} Returns the same interaction object allowing method chaining.
61
67
  */
62
68
  /**
@@ -75,7 +81,7 @@ export type InteractionInstance = {
75
81
  getContext: getContext;
76
82
  ignore: ignore;
77
83
  onEnd: onEnd;
78
- save: onEnd;
84
+ save: save;
79
85
  setAttribute: setAttribute;
80
86
  setName: setName;
81
87
  };
@@ -88,7 +94,7 @@ export type actionText = (value: string) => InteractionInstance;
88
94
  * Times sub-components of a SPA interaction separately, including wait time and JS execution time.
89
95
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/createtracer/}
90
96
  */
91
- export type createTracer = (name: string, callback?: string | undefined) => Function;
97
+ export type createTracer = (name: string, callback?: ((...args: any[]) => any) | undefined) => (...args: any[]) => any;
92
98
  /**
93
99
  * Ends the SPA interaction at the current time.
94
100
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/end/}
@@ -99,6 +105,11 @@ export type end = () => InteractionInstance;
99
105
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/getcontext/}
100
106
  */
101
107
  export type getContext = (callback: (ctx: object) => void) => InteractionInstance;
108
+ /**
109
+ * Overrides other SPA save() calls; ignores an interaction so it is not saved or sent to New Relic.
110
+ * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/ignore/}
111
+ */
112
+ export type ignore = () => InteractionInstance;
102
113
  /**
103
114
  * Change the values associated with a SPA interaction before the interaction is saved.
104
115
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/onend/}
@@ -113,7 +124,7 @@ export type save = () => InteractionInstance;
113
124
  * Adds a custom SPA attribute only to the current interaction in browser.
114
125
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setattribute/}
115
126
  */
116
- export type setAttribute = (key: string, key: any) => InteractionInstance;
127
+ export type setAttribute = (key: string, value: any) => InteractionInstance;
117
128
  /**
118
129
  * Sets the name and trigger of a SPA's browser interaction that is not a route change or URL change.
119
130
  * {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setname/}
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-types.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/interaction-types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAGH,wBAAwB;;gBA7EV,UAAU;kBACV,YAAY;SACZ,GAAG;gBACH,UAAU;;WAEV,KAAK;UACL,KAAK;kBACL,YAAY;aACZ,OAAO;;;;;;iCAOV,MAAM,KACJ,mBAAmB;;;;;kCAOrB,MAAM;;;;;wBASJ,mBAAmB;;;;;0CAOf,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;qCAOf,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;yBAOnB,mBAAmB;;;;;iCAOrB,MAAM,OACN,GAAG,KACD,mBAAmB;;;;;6BAOrB,MAAM,mCAEJ,mBAAmB"}
1
+ {"version":3,"file":"interaction-types.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/interaction-types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAGH,wBAAwB;;gBApFV,UAAU;kBACV,YAAY;SACZ,GAAG;gBACH,UAAU;YACV,MAAM;WACN,KAAK;UACL,IAAI;kBACJ,YAAY;aACZ,OAAO;;;;;;iCAOV,MAAM,KACJ,mBAAmB;;;;;kCAOrB,MAAM,wBACI,GAAG,EAAE,KAAK,GAAG,4BACX,GAAG,EAAE,KAAK,GAAG;;;;;wBAOvB,mBAAmB;;;;;0CAOf,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;2BAOnB,mBAAmB;;;;;qCAOf,MAAM,KAAK,IAAI,KACnB,mBAAmB;;;;;yBAOnB,mBAAmB;;;;;iCAOrB,MAAM,SACN,GAAG,KACD,mBAAmB;;;;;6BAOrB,MAAM,mCAEJ,mBAAmB"}
@@ -4,6 +4,7 @@ export function configure(agentIdentifier: any, opts: {} | undefined, loaderType
4
4
  setPageViewName(name: any, host: any): any;
5
5
  setCustomAttribute(name: any, value: any, persistAttribute?: boolean): any;
6
6
  setUserId(value: string): any;
7
+ setApplicationVersion(value: string | null): any;
7
8
  interaction(): any;
8
9
  noticeError(err: any, customAttributes: any): void;
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAMA;;;;;;;;EAqCC"}
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAMA;;;;;;;;;EAqCC"}
@@ -1,13 +1,13 @@
1
1
  export namespace FEATURE_NAMES {
2
- let ajax: string;
3
- let jserrors: string;
4
- let metrics: string;
5
- let pageAction: string;
6
- let pageViewEvent: string;
7
- let pageViewTiming: string;
8
- let sessionReplay: string;
9
- let sessionTrace: string;
10
- let spa: string;
2
+ const ajax: string;
3
+ const jserrors: string;
4
+ const metrics: string;
5
+ const pageAction: string;
6
+ const pageViewEvent: string;
7
+ const pageViewTiming: string;
8
+ const sessionReplay: string;
9
+ const sessionTrace: string;
10
+ const spa: string;
11
11
  }
12
12
  /**
13
13
  * The order in which features will be instrumented. This is the traditional order. It's unclear if the order of
@@ -18,7 +18,7 @@ export class MicroAgent extends AgentBase {
18
18
  loader_config: any;
19
19
  runtime: any;
20
20
  };
21
- start(): false | this;
21
+ start(): false | MicroAgent;
22
22
  }
23
23
  import { AgentBase } from './agent-base';
24
24
  import { Aggregator } from '../common/aggregate/aggregator';
@@ -1 +1 @@
1
- {"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;IACE;;;OAGG;IACH,qBAHW,MAAM,oBACN,MAAM,cAYhB;IAPC,wBAAsC;IACtC,6BAAiF;IACjF,aAAkB;IAOpB;;;;;MAOC;IAED,sBA8BC;CACF;0BAtEyB,cAAc;2BAPb,gCAAgC"}
1
+ {"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;IACE;;;OAGG;IACH,qBAHW,MAAM,oBACN,MAAM,cAYhB;IAPC,wBAAsC;IACtC,6BAAiF;IACjF,aAAkB;IAOpB;;;;;MAOC;IAED,4BA8BC;CACF;0BAtEyB,cAAc;2BAPb,gCAAgC"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.237.1",
3
+ "version": "1.238.0",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
- "description": "Tests for the New Relic JavaScript agent",
6
+ "description": "New Relic Browser Agent",
7
7
  "license": "Apache-2.0",
8
8
  "homepage": "https://docs.newrelic.com/docs/browser/browser-monitoring",
9
9
  "main": "./dist/cjs/index.js",
@@ -92,35 +92,30 @@
92
92
  "node": ">=12.17.0 < 13.0.0 || >=13.7.0"
93
93
  },
94
94
  "scripts": {
95
- "wdio": "node --max-old-space-size=8192 tools/wdio/bin/cli.js",
96
95
  "start": "npm-run-all --parallel cdn:watch test-server",
97
- "test:unit": "jest",
98
- "test:component": "jest --config jest.component-config.js",
96
+ "lint": "eslint -c .eslintrc.js --ext .js,.cjs,.mjs .",
97
+ "lint:fix": "npm run lint -- --fix",
98
+ "test": "jest",
99
+ "test:unit": "jest --selectProjects unit",
100
+ "test:component": "jest --selectProjects component",
101
+ "test:types": "tsd -f ./tests/dts/**/*.ts",
102
+ "wdio": "node --max-old-space-size=8192 tools/wdio/bin/cli.js",
103
+ "jil": "tools/jil/bin/cli.js",
99
104
  "build:all": "npm run cdn:build:local && npm run build:npm && npm run tools:test-builds",
100
105
  "build:npm": "npm run npm:build:esm && npm run npm:build:cjs && npm run npm:build:types && npm run npm:pack",
101
106
  "build:browser-tests": "npm --prefix ./tools/test-builds/browser-tests run build",
102
- "lint": "eslint -c .eslintrc.js --ext .js,.cjs,.mjs .",
103
- "lint:fix": "npm run lint -- --fix",
104
- "test-jil": "tools/jil/bin/cli.js",
105
- "ci-build": "npm ci --cache ./.npm",
106
- "build-tar": "npm run ci-build && tar czf ./build/browser-agent.tar.gz --exclude=.git --exclude=.npm --exclude=build/browser-agent.tar.gz .",
107
- "watch": "jung -D '\\.npm|.git|node_modules|build|tools|tests' --run -- npm run build:all",
107
+ "watch:browser-tests": "jung -r ./src -F '.*\\.test\\.js' --run -- npm run build:browser-tests",
108
108
  "cdn:build": "npm run cdn:build:prod",
109
- "cdn:build:extension": "PUBLISH=EXTENSION rm -rf ./build && npm run cdn:webpack && npm run cdn:cleanup",
110
- "cdn:build:local": "npm run cdn:webpack && npm run cdn:cleanup",
111
- "cdn:build:prod": "npm run cdn:fresh-build && PUBLISH=PROD npm run cdn:webpack && npm run cdn:cleanup && npm run cdn:clone",
112
- "cdn:build:dev": "npm run cdn:fresh-build && PUBLISH=DEV npm run cdn:webpack && npm run cdn:cleanup",
113
- "cdn:build:current": "npm run cdn:fresh-build && PUBLISH=CURRENT npm run cdn:webpack && npm run cdn:cleanup",
114
- "cdn:build:nr": "npm run cdn:fresh-build && PUBLISH=PROD SOURCEMAPS=false npm run cdn:webpack && npm run cdn:cleanup",
115
- "cdn:build:pr": "npm run cdn:fresh-build && PUBLISH=PR npm run cdn:webpack && npm run cdn:cleanup",
116
- "cdn:build:experiment": "npm run cdn:fresh-build && PUBLISH=EXPERIMENT npm run cdn:webpack && npm run cdn:cleanup",
117
- "cdn:cleanup": "node ./tools/scripts/post-build-cleanup",
118
- "cdn:clone": "node ./tools/scripts/clone",
119
- "cdn:fresh-build": "rm -rf ./build",
109
+ "cdn:build:local": "npm run cdn:webpack",
110
+ "cdn:build:prod": "npm run cdn:webpack -- --env mode=prod",
111
+ "postcdn:build:prod": "npm run cdn:clone",
112
+ "cdn:build:dev": "npm run cdn:webpack -- --env mode=dev",
113
+ "cdn:build:experiment": "npm run cdn:webpack -- --env mode=experiment",
114
+ "cdn:webpack": "npx webpack --progress --config ./tools/webpack/index.mjs",
115
+ "postcdn:webpack": "npm run cdn:cleanup",
120
116
  "cdn:watch": "jung -r ./src -F '.*\\.test\\.js' --run -- npm run cdn:build:local",
121
- "cdn:watch:extension": "jung -r ./src -F '.*\\.test\\.js' --run -- npm run cdn:build:extension",
122
- "cdn:webpack": "npx webpack --progress --config ./webpack.config.js",
123
- "packages:bundle": "webpack -c tools/jil/webpack.modular.js",
117
+ "cdn:cleanup": "node ./tools/webpack/scripts/cleanup.mjs",
118
+ "cdn:clone": "node ./tools/webpack/scripts/clone.mjs",
124
119
  "test-server": "node ./tools/wdio/bin/server",
125
120
  "sauce:connect": "node ./tools/saucelabs/bin.mjs",
126
121
  "sauce:get-browsers": "node ./tools/browsers-lists/sauce-browsers.mjs",
@@ -130,8 +125,7 @@
130
125
  "npm:build:esm": "npx babel --env-name npm-esm --out-dir dist/esm --out-file-extension .js ./src",
131
126
  "npm:build:cjs": "npx babel --env-name npm-cjs --out-dir dist/cjs --out-file-extension .js ./src",
132
127
  "npm:build:types": "npx tsc -b",
133
- "npm:pack": "mkdir -p temp && export PKG_NAME=$(npm pack --pack-destination temp) && echo ./temp/$PKG_NAME",
134
- "watch:browser-tests": "jung -r ./src -F '.*\\.test\\.js' --run -- npm run build:browser-tests"
128
+ "npm:pack": "mkdir -p temp && export PKG_NAME=$(npm pack --pack-destination temp) && echo ./temp/$PKG_NAME"
135
129
  },
136
130
  "config": {
137
131
  "unsafe-perm": true
@@ -228,6 +222,7 @@
228
222
  "tape": "^4.8.0",
229
223
  "through": "^2.3.8",
230
224
  "through2": "^2.0.1",
225
+ "tsd": "^0.28.1",
231
226
  "typescript": "^5.0.3",
232
227
  "uuid": "^9.0.0",
233
228
  "wait-on": "^7.0.1",
@@ -65,7 +65,7 @@ export function setDenyList (denyListConfig) {
65
65
  host = url
66
66
  pathname = ''
67
67
  }
68
- let [hostname, port] = host.split(':')
68
+ let [hostname] = host.split(':')
69
69
 
70
70
  denyList.push({ hostname, pathname })
71
71
  }