@coveo/relay 1.1.0 → 1.1.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.
Files changed (58) hide show
  1. package/lib/npm/client-id/client-id.d.ts.map +1 -0
  2. package/lib/npm/config/config.d.ts.map +1 -0
  3. package/lib/npm/emit/emit.d.ts.map +1 -0
  4. package/lib/npm/environment/browser/browser.d.ts.map +1 -0
  5. package/lib/npm/environment/browser/storage/availability.d.ts.map +1 -0
  6. package/lib/npm/environment/browser/storage/cookie.d.ts.map +1 -0
  7. package/lib/npm/environment/browser/storage/storage.d.ts.map +1 -0
  8. package/lib/npm/environment/environment.d.ts.map +1 -0
  9. package/lib/npm/environment/manager/manager.d.ts.map +1 -0
  10. package/lib/npm/environment/null/null.d.ts.map +1 -0
  11. package/lib/npm/environment/storage.d.ts.map +1 -0
  12. package/lib/npm/event/meta/meta.d.ts.map +1 -0
  13. package/lib/npm/event/relay-event.d.ts.map +1 -0
  14. package/lib/npm/listener/listener.d.ts.map +1 -0
  15. package/lib/npm/relay-payload.d.ts.map +1 -0
  16. package/lib/{relay.cjs → npm/relay.cjs} +6 -73
  17. package/lib/npm/relay.d.ts.map +1 -0
  18. package/lib/{relay.mjs → npm/relay.mjs} +3 -70
  19. package/lib/npm/version.d.ts.map +1 -0
  20. package/package.json +11 -19
  21. package/lib/cdn/relay.min.js +0 -2
  22. package/lib/cdn/relay.min.js.map +0 -1
  23. package/lib/client-id/client-id.d.ts.map +0 -1
  24. package/lib/config/config.d.ts.map +0 -1
  25. package/lib/docs/relay-docs.json +0 -1898
  26. package/lib/emit/emit.d.ts.map +0 -1
  27. package/lib/environment/browser/browser.d.ts.map +0 -1
  28. package/lib/environment/browser/storage/availability.d.ts.map +0 -1
  29. package/lib/environment/browser/storage/cookie.d.ts.map +0 -1
  30. package/lib/environment/browser/storage/storage.d.ts.map +0 -1
  31. package/lib/environment/environment.d.ts.map +0 -1
  32. package/lib/environment/manager/manager.d.ts.map +0 -1
  33. package/lib/environment/null/null.d.ts.map +0 -1
  34. package/lib/environment/storage.d.ts.map +0 -1
  35. package/lib/event/meta/meta.d.ts.map +0 -1
  36. package/lib/event/relay-event.d.ts.map +0 -1
  37. package/lib/listener/listener.d.ts.map +0 -1
  38. package/lib/relay-payload.d.ts.map +0 -1
  39. package/lib/relay.d.ts.map +0 -1
  40. package/lib/relay.js +0 -380
  41. package/lib/version.d.ts.map +0 -1
  42. /package/lib/{client-id → npm/client-id}/client-id.d.ts +0 -0
  43. /package/lib/{config → npm/config}/config.d.ts +0 -0
  44. /package/lib/{emit → npm/emit}/emit.d.ts +0 -0
  45. /package/lib/{environment → npm/environment}/browser/browser.d.ts +0 -0
  46. /package/lib/{environment → npm/environment}/browser/storage/availability.d.ts +0 -0
  47. /package/lib/{environment → npm/environment}/browser/storage/cookie.d.ts +0 -0
  48. /package/lib/{environment → npm/environment}/browser/storage/storage.d.ts +0 -0
  49. /package/lib/{environment → npm/environment}/environment.d.ts +0 -0
  50. /package/lib/{environment → npm/environment}/manager/manager.d.ts +0 -0
  51. /package/lib/{environment → npm/environment}/null/null.d.ts +0 -0
  52. /package/lib/{environment → npm/environment}/storage.d.ts +0 -0
  53. /package/lib/{event → npm/event}/meta/meta.d.ts +0 -0
  54. /package/lib/{event → npm/event}/relay-event.d.ts +0 -0
  55. /package/lib/{listener → npm/listener}/listener.d.ts +0 -0
  56. /package/lib/{relay-payload.d.ts → npm/relay-payload.d.ts} +0 -0
  57. /package/lib/{relay.d.ts → npm/relay.d.ts} +0 -0
  58. /package/lib/{version.d.ts → npm/version.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-id.d.ts","sourceRoot":"","sources":["../../../src/client-id/client-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CACnC,kBAAkB,EAAE,kBAAkB,GACrC,eAAe,CAgBjB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACT,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,MAAM,GACN,SAAS,CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,MAAM,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACvD;AAkBD,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,WAAW,GACzB,QAAQ,CAAC,aAAa,CAAC,CASzB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../src/emit/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,IAAI,CAAC,EACnB,MAAM,EACN,WAAW,EACX,KAAK,EACL,eAAe,GAChB,EAAE,UAAU,QAQZ"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../src/environment/browser/browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAW7C,wBAAgB,uBAAuB,IAAI,WAAW,CA0BrD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../../../src/environment/browser/storage/availability.ts"],"names":[],"mappings":"AACA,wBAAgB,qBAAqB,YAepC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../../../src/environment/browser/storage/cookie.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACxC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,aAAa,EAAE,aAAqC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../../src/environment/browser/storage/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,wBAAgB,oBAAoB,IAAI,OAAO,CAiB9C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/environment/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9D,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/environment/manager/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;CAClC;AA0BD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,GAC3B,QAAQ,CAAC,kBAAkB,CAAC,CAI9B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../../src/environment/null/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,wBAAgB,oBAAoB,IAAI,WAAW,CAUlD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/environment/storage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACxC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAY3C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/event/meta/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAWD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAAC,IAAI,CAAC,CAehB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-event.d.ts","sourceRoot":"","sources":["../../../src/event/relay-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAc,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAAC,UAAU,CAAC,CAKtB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../src/listener/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAExD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,IAAI,CAAC;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1D;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAgEvD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-payload.d.ts","sourceRoot":"","sources":["../../src/relay-payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var crypto = require('crypto');
3
+ var uuid = require('uuid');
4
+ var explorerMessenger = require('@coveo/explorer-messenger');
4
5
 
5
6
  function emit({ config, environment, event, listenerManager, }) {
6
7
  const { url, token, mode } = config;
@@ -11,65 +12,6 @@ function emit({ config, environment, event, listenerManager, }) {
11
12
  }
12
13
  }
13
14
 
14
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
15
-
16
- function validate(uuid) {
17
- return typeof uuid === 'string' && REGEX.test(uuid);
18
- }
19
-
20
- const byteToHex = [];
21
- for (let i = 0; i < 256; ++i) {
22
- byteToHex.push((i + 0x100).toString(16).slice(1));
23
- }
24
- function unsafeStringify(arr, offset = 0) {
25
- return (byteToHex[arr[offset + 0]] +
26
- byteToHex[arr[offset + 1]] +
27
- byteToHex[arr[offset + 2]] +
28
- byteToHex[arr[offset + 3]] +
29
- '-' +
30
- byteToHex[arr[offset + 4]] +
31
- byteToHex[arr[offset + 5]] +
32
- '-' +
33
- byteToHex[arr[offset + 6]] +
34
- byteToHex[arr[offset + 7]] +
35
- '-' +
36
- byteToHex[arr[offset + 8]] +
37
- byteToHex[arr[offset + 9]] +
38
- '-' +
39
- byteToHex[arr[offset + 10]] +
40
- byteToHex[arr[offset + 11]] +
41
- byteToHex[arr[offset + 12]] +
42
- byteToHex[arr[offset + 13]] +
43
- byteToHex[arr[offset + 14]] +
44
- byteToHex[arr[offset + 15]]).toLowerCase();
45
- }
46
-
47
- const rnds8Pool = new Uint8Array(256);
48
- let poolPtr = rnds8Pool.length;
49
- function rng() {
50
- if (poolPtr > rnds8Pool.length - 16) {
51
- crypto.randomFillSync(rnds8Pool);
52
- poolPtr = 0;
53
- }
54
- return rnds8Pool.slice(poolPtr, (poolPtr += 16));
55
- }
56
-
57
- var native = { randomUUID: crypto.randomUUID };
58
-
59
- function v4(options, buf, offset) {
60
- if (native.randomUUID && true && !options) {
61
- return native.randomUUID();
62
- }
63
- options = options || {};
64
- const rnds = options.random ?? options.rng?.() ?? rng();
65
- if (rnds.length < 16) {
66
- throw new Error('Random bytes length must be >= 16');
67
- }
68
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
69
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
70
- return unsafeStringify(rnds);
71
- }
72
-
73
15
  function createClientIdManager(environmentManager) {
74
16
  return {
75
17
  getClientId: () => {
@@ -77,7 +19,7 @@ function createClientIdManager(environmentManager) {
77
19
  const environment = environmentManager.get();
78
20
  const storage = environment.storage;
79
21
  const existingClientId = storage.getItem(key);
80
- const clientId = existingClientId && validate(existingClientId)
22
+ const clientId = existingClientId && uuid.validate(existingClientId)
81
23
  ? existingClientId
82
24
  : environment.generateUUID();
83
25
  storage.setItem(key, clientId);
@@ -86,7 +28,7 @@ function createClientIdManager(environmentManager) {
86
28
  };
87
29
  }
88
30
 
89
- const version = "1.1.0";
31
+ const version = "1.1.2";
90
32
 
91
33
  function getEventConfig(config) {
92
34
  const { trackingId } = config;
@@ -198,15 +140,6 @@ function createConfigManager(initialConfig) {
198
140
  };
199
141
  }
200
142
 
201
- function createExplorerMessenger() {
202
- const isBrowser = typeof window !== "undefined";
203
- return {
204
- sendMessage(message) {
205
- isBrowser && window.postMessage(message, "*");
206
- }
207
- };
208
- }
209
-
210
143
  const cookieManager = createCookieManager();
211
144
  function createCookieManager() {
212
145
  const prefix = "coveo_";
@@ -266,7 +199,7 @@ function buildBrowserEnvironment() {
266
199
  const response = navigator.sendBeacon(`${url}?access_token=${token}`, new Blob([JSON.stringify([event])], {
267
200
  type: "application/json",
268
201
  }));
269
- const messenger = createExplorerMessenger();
202
+ const messenger = explorerMessenger.createExplorerMessenger();
270
203
  messenger.sendMessage({ kind: "EVENT_PROTOCOL", event, url, token });
271
204
  if (!response) {
272
205
  throw new Error(`Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.`);
@@ -275,7 +208,7 @@ function buildBrowserEnvironment() {
275
208
  getReferrer: () => getReferrer(),
276
209
  getLocation: () => window.location.href,
277
210
  getUserAgent: () => navigator.userAgent,
278
- generateUUID: () => v4(),
211
+ generateUUID: () => uuid.v4(),
279
212
  storage: createBrowserStorage(),
280
213
  };
281
214
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/relay.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAc,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAyB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAEL,WAAW,EACX,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC;AAE7B;;;GAGG;AACH,UAAU,KAAK;IACb;;;;;OAKG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAE3D;;;;OAIG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC;;;;;;;;;OASG;IACH,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,GAAG,CAAC;IAEnD;;;;;;OAMG;IACH,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAEtD;;;;OAIG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAErD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,WAAW,GAAG,KAAK,CAyC7D;AAED,YAAY,EACV,KAAK,EACL,IAAI,EACJ,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,iBAAiB,GAClB,CAAC"}
@@ -1,4 +1,5 @@
1
- import { randomFillSync, randomUUID } from 'crypto';
1
+ import { validate, v4 } from 'uuid';
2
+ import { createExplorerMessenger } from '@coveo/explorer-messenger';
2
3
 
3
4
  function emit({ config, environment, event, listenerManager, }) {
4
5
  const { url, token, mode } = config;
@@ -9,65 +10,6 @@ function emit({ config, environment, event, listenerManager, }) {
9
10
  }
10
11
  }
11
12
 
12
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
13
-
14
- function validate(uuid) {
15
- return typeof uuid === 'string' && REGEX.test(uuid);
16
- }
17
-
18
- const byteToHex = [];
19
- for (let i = 0; i < 256; ++i) {
20
- byteToHex.push((i + 0x100).toString(16).slice(1));
21
- }
22
- function unsafeStringify(arr, offset = 0) {
23
- return (byteToHex[arr[offset + 0]] +
24
- byteToHex[arr[offset + 1]] +
25
- byteToHex[arr[offset + 2]] +
26
- byteToHex[arr[offset + 3]] +
27
- '-' +
28
- byteToHex[arr[offset + 4]] +
29
- byteToHex[arr[offset + 5]] +
30
- '-' +
31
- byteToHex[arr[offset + 6]] +
32
- byteToHex[arr[offset + 7]] +
33
- '-' +
34
- byteToHex[arr[offset + 8]] +
35
- byteToHex[arr[offset + 9]] +
36
- '-' +
37
- byteToHex[arr[offset + 10]] +
38
- byteToHex[arr[offset + 11]] +
39
- byteToHex[arr[offset + 12]] +
40
- byteToHex[arr[offset + 13]] +
41
- byteToHex[arr[offset + 14]] +
42
- byteToHex[arr[offset + 15]]).toLowerCase();
43
- }
44
-
45
- const rnds8Pool = new Uint8Array(256);
46
- let poolPtr = rnds8Pool.length;
47
- function rng() {
48
- if (poolPtr > rnds8Pool.length - 16) {
49
- randomFillSync(rnds8Pool);
50
- poolPtr = 0;
51
- }
52
- return rnds8Pool.slice(poolPtr, (poolPtr += 16));
53
- }
54
-
55
- var native = { randomUUID };
56
-
57
- function v4(options, buf, offset) {
58
- if (native.randomUUID && true && !options) {
59
- return native.randomUUID();
60
- }
61
- options = options || {};
62
- const rnds = options.random ?? options.rng?.() ?? rng();
63
- if (rnds.length < 16) {
64
- throw new Error('Random bytes length must be >= 16');
65
- }
66
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
67
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
68
- return unsafeStringify(rnds);
69
- }
70
-
71
13
  function createClientIdManager(environmentManager) {
72
14
  return {
73
15
  getClientId: () => {
@@ -84,7 +26,7 @@ function createClientIdManager(environmentManager) {
84
26
  };
85
27
  }
86
28
 
87
- const version = "1.1.0";
29
+ const version = "1.1.2";
88
30
 
89
31
  function getEventConfig(config) {
90
32
  const { trackingId } = config;
@@ -196,15 +138,6 @@ function createConfigManager(initialConfig) {
196
138
  };
197
139
  }
198
140
 
199
- function createExplorerMessenger() {
200
- const isBrowser = typeof window !== "undefined";
201
- return {
202
- sendMessage(message) {
203
- isBrowser && window.postMessage(message, "*");
204
- }
205
- };
206
- }
207
-
208
141
  const cookieManager = createCookieManager();
209
142
  function createCookieManager() {
210
143
  const prefix = "coveo_";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,26 +1,18 @@
1
1
  {
2
2
  "name": "@coveo/relay",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A library for sending analytics events using Coveo's Event protocol.",
5
+ "type": "module",
5
6
  "files": [
6
- "lib/**/*"
7
+ "lib/npm/*"
7
8
  ],
8
- "types": "./lib/relay.d.ts",
9
+ "types": "./lib/npm/relay.d.ts",
9
10
  "exports": {
10
- "node": {
11
- "import": {
12
- "types": "./lib/relay.d.ts",
13
- "default": "./lib/relay.mjs"
14
- },
15
- "require": {
16
- "types": "./lib/relay.d.ts",
17
- "default": "./lib/relay.cjs"
18
- }
19
- },
20
- "default": {
21
- "types": "./lib/relay.d.ts",
22
- "default": "./lib/relay.js"
23
- }
11
+ "types": "./lib/npm/relay.d.ts",
12
+ "import": "./lib/npm/relay.mjs",
13
+ "require": "./lib/npm/relay.cjs",
14
+ "browser": "./lib/npm/relay.mjs",
15
+ "default": "./lib/npm/relay.mjs"
24
16
  },
25
17
  "repository": {
26
18
  "type": "git",
@@ -52,12 +44,12 @@
52
44
  "rimraf": "6.0.1",
53
45
  "rollup": "^4.0.0",
54
46
  "ts-jest": "^29.1.1",
55
- "typedoc": "^0.27.0",
47
+ "typedoc": "^0.28.0",
56
48
  "typescript": "^5.1.6",
57
49
  "tsconfig": "0.0.0"
58
50
  },
59
51
  "dependencies": {
60
- "@coveo/explorer-messenger": "^0.4.0",
52
+ "@coveo/explorer-messenger": "^0.4.1",
61
53
  "uuid": "^11.0.0"
62
54
  },
63
55
  "scripts": {
@@ -1,2 +0,0 @@
1
- var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;const t=[];for(let e=0;e<256;++e)t.push((e+256).toString(16).slice(1));let n;const o=new Uint8Array(16);var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function c(e,c,a){if(r.randomUUID&&!e)return r.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(o)}();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,n=0){return(t[e[n+0]]+t[e[n+1]]+t[e[n+2]]+t[e[n+3]]+"-"+t[e[n+4]]+t[e[n+5]]+"-"+t[e[n+6]]+t[e[n+7]]+"-"+t[e[n+8]]+t[e[n+9]]+"-"+t[e[n+10]]+t[e[n+11]]+t[e[n+12]]+t[e[n+13]]+t[e[n+14]]+t[e[n+15]]).toLowerCase()}(i)}function a(t){return{getClientId:()=>{const n="visitorId",o=t.get(),r=o.storage,c=r.getItem(n),a=c&&("string"==typeof(i=c)&&e.test(i))?c:o.generateUUID();var i;return r.setItem(n,a),a}}}const i="1.1.0";function s(e){return(e.source||[]).concat([`relay@${i}`])}function u(e,t,n,o){const{getReferrer:r,getLocation:c,getUserAgent:a}=n,i=function(e){const{trackingId:t}=e;return{trackingId:t}}(t),u=o.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:s(t),clientId:u,userAgent:a(),referrer:r(),location:c()})}function f(){const e=[];function t({type:t,callback:n}){return e.findIndex((e=>e.type===t&&e.callback===n))}function n(n,o){o?function(n){const o=t(n);o>=0&&e.splice(o,1)}({type:n,callback:o}):function(t){if("*"===t)e.length=0;else for(let n=e.length-1;n>=0;n--)e[n].type===t&&e.splice(n,1)}(n)}return{add:function(o){return t(o)<0&&e.push(o),()=>n(o.type,o.callback)},call:function(t){e.forEach((e=>{if(function(e,t){return"*"===e.type||t===e.type}(e,t.meta.type))try{e.callback(t)}catch(e){console.error(e)}}))},remove:n}}function l({url:e,token:t,trackingId:n,...o}){return Object.freeze({url:e,token:t,trackingId:n,...!!o.mode&&{mode:o.mode},...!!o.source&&{source:o.source},...!!o.environment&&{environment:o.environment}})}const g=function(){const e="coveo_";return{getItem(t){const n=`${e}${t}=`,o=document.cookie.split(";");for(const e of o){const t=e.replace(/^\s+/,"");if(0===t.lastIndexOf(n,0))return t.substring(n.length,t.length)}return null},setItem(t,n,o){const r=(e=>{const t=e.split(".").slice(-2);return 2==t.length?t.join("."):""})(window.location.hostname),c=`;expires=${new Date((new Date).getTime()+o).toUTCString()}`,a=r?`;domain=${r}`:"";document.cookie=`${e}${t}=${n}${c}${a};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}}();function d(){return{runtime:"browser",send:(e,t,n)=>{const o=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([n])],{type:"application/json"})),r=function(){const e="undefined"!=typeof window;return{sendMessage(t){e&&window.postMessage(t,"*")}}}();if(r.sendMessage({kind:"EVENT_PROTOCOL",event:n,url:e,token:t}),!o)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>function(){const e=document.referrer;return""===e?null:e}(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>c(),storage:{getItem:e=>g.getItem(e)||localStorage.getItem(e),removeItem(e){g.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),g.setItem(e,t,31556952e3)}}}}function m(e){const t="disabled"!==e.get().mode,n=e.get().environment;return t&&n?{...n,runtime:"custom"}:t&&function(){try{return"object"==typeof window}catch{return!1}}()&&function(){try{const e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name&&localStorage&&0!==localStorage.length}}()?d():{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:{getItem:()=>null,removeItem(){},setItem(){}}}}function p(e){const t=function(e){let t=l(e);return{get:()=>t,update:e=>{t=l({...t,...e})}}}(e),n=f(),o=function(e){return{get:()=>Object.freeze(m(e))}}(t),r=a(o);return{emit:(e,c)=>{const a=t.get(),i=o.get(),s=function(e,t,n,o,r){return{...t,meta:u(e,n,o,r)}}(e,c,a,i,r);return function({config:e,environment:t,event:n,listenerManager:o}){const{url:r,token:c,mode:a}=e;"disabled"!==a&&(o.call(n),t.send(r,c,n))}({config:a,environment:i,event:s,listenerManager:n})},getMeta:e=>u(e,t.get(),o.get(),r),on:(e,t)=>n.add({type:e,callback:t}),off:(e,t)=>n.remove(e,t),updateConfig:e=>t.update(e),version:i}}export{p as createRelay};
2
- //# sourceMappingURL=relay.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relay.min.js","sources":["../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/regex.js","../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/stringify.js","../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/rng.js","../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/native.js","../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/v4.js","../../../src/client-id/client-id.ts","../../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/validate.js","../../../src/version.ts","../../../src/event/meta/meta.ts","../../../src/listener/listener.ts","../../../src/config/config.ts","../../../src/environment/browser/storage/cookie.ts","../../../src/environment/browser/browser.ts","../../../../node_modules/.pnpm/@coveo+explorer-messenger@0.4.0/node_modules/@coveo/explorer-messenger/dist/messenger.js","../../../src/environment/browser/storage/storage.ts","../../../src/environment/manager/manager.ts","../../../src/environment/browser/storage/availability.ts","../../../src/environment/null/null.ts","../../../src/environment/storage.ts","../../../src/relay.ts","../../../src/event/relay-event.ts","../../../src/emit/emit.ts"],"sourcesContent":["export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { validate } from \"uuid\";\nimport { EnvironmentManager } from \"../environment/manager/manager\";\n\nexport interface ClientIdManager {\n getClientId: () => string;\n}\n\nexport function createClientIdManager(\n environmentManager: EnvironmentManager,\n): ClientIdManager {\n return {\n getClientId: () => {\n const key = \"visitorId\";\n const environment = environmentManager.get();\n const storage = environment.storage;\n\n const existingClientId = storage.getItem(key);\n const clientId =\n existingClientId && validate(existingClientId)\n ? existingClientId\n : environment.generateUUID();\n storage.setItem(key, clientId);\n return clientId;\n },\n };\n}\n","import REGEX from './regex.js';\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\nexport default validate;\n","export const version = \"process.env.VERSION\";\n","import { ClientIdManager } from \"../../client-id/client-id\";\nimport { Environment } from \"../../environment/environment\";\nimport { RelayConfig } from \"../../config/config\";\nimport { version } from \"../../version\";\n\n/**\n * The `EventConfig` object provides additonal information for the configuration associated with the event.\n */\nexport interface EventConfig {\n /**\n * The unique identifier of a web property. See [What's a tracking ID?](https://docs.coveo.com/en/n8tg0567/).\n */\n trackingId: string;\n}\n\n/**\n * The `Meta` object provides a structured representation of metadata associated with an emitted event.\n * This object is auto-populated by Relay.\n */\nexport interface Meta {\n /**\n * Event's type that was emitted.\n */\n type: string;\n\n /**\n * Configuration associated with the event.\n */\n config: EventConfig;\n\n /**\n * Timestamp when the event was emitted.\n */\n ts: number;\n\n /**\n * Names and versions of the client side libraries which built and emitted this event.\n */\n source: string[];\n\n /**\n * Persistent unique identifier of a device.\n */\n clientId: string;\n\n /**\n * Browser Navigator's [user agent](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent) property if set.\n */\n userAgent: string | null;\n\n /**\n * Browser Document's [referrer](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) property if set.\n */\n referrer: string | null;\n\n /**\n * Browser Location's [href](https://developer.mozilla.org/en-US/docs/Web/API/Location/href) property if set.\n */\n location: string | null;\n}\n\nfunction getEventConfig(config: RelayConfig): EventConfig {\n const { trackingId } = config;\n return { trackingId };\n}\n\nfunction getSource(config: RelayConfig): string[] {\n return (config.source || []).concat([`relay@${version}`]);\n}\n\nexport function createMeta(\n type: string,\n config: RelayConfig,\n environment: Environment,\n clientIdManager: ClientIdManager,\n): Readonly<Meta> {\n const { getReferrer, getLocation, getUserAgent } = environment;\n const eventConfig = getEventConfig(config);\n const clientId = clientIdManager.getClientId();\n\n return Object.freeze<Meta>({\n type,\n config: eventConfig,\n ts: Date.now(),\n source: getSource(config),\n clientId,\n userAgent: getUserAgent(),\n referrer: getReferrer(),\n location: getLocation(),\n });\n}\n","import { RelayEvent } from \"../event/relay-event\";\n\nconst ANY_EVENT_TYPE = \"*\";\n\n/**\n * Callback to perform an action when a specified event is emitted.\n * @typedef {function} EventCallback\n * @param {RelayEvent} event - the Relay event payload that triggered the callback.\n * @returns {void}\n */\nexport type EventCallback = (event: RelayEvent) => void;\n\ninterface Listener {\n type: string;\n callback: EventCallback;\n}\n\nexport interface ListenerManager {\n add: (listener: Listener) => () => void;\n call: (event: RelayEvent) => void;\n remove: (type: string, callback?: EventCallback) => void;\n}\n\nexport function createListenerManager(): ListenerManager {\n const listeners: Listener[] = [];\n\n function getListenerIndex({ type, callback }: Listener): number {\n return listeners.findIndex(\n (listener) => listener.type === type && listener.callback === callback,\n );\n }\n\n function isMatchesType(listener: Listener, type: string): boolean {\n return listener.type === \"*\" || type === listener.type;\n }\n\n function add(listener: Listener): () => void {\n if (getListenerIndex(listener) < 0) {\n listeners.push(listener);\n }\n return () => remove(listener.type, listener.callback);\n }\n\n function call(event: RelayEvent) {\n listeners.forEach((listener) => {\n if (isMatchesType(listener, event.meta.type)) {\n try {\n listener.callback(event);\n } catch (e) {\n console.error(e);\n }\n }\n });\n }\n\n function removeMultiple(type: string) {\n if (type === ANY_EVENT_TYPE) {\n listeners.length = 0;\n } else {\n for (let i = listeners.length - 1; i >= 0; i--) {\n if (listeners[i].type === type) {\n listeners.splice(i, 1);\n }\n }\n }\n }\n\n function removeOne(listener: Listener) {\n const index = getListenerIndex(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n\n function remove(type: string, callback?: EventCallback) {\n if (callback) {\n removeOne({ type, callback });\n } else {\n removeMultiple(type);\n }\n }\n\n return {\n add,\n call,\n remove,\n };\n}\n","import { Environment } from \"../environment/environment\";\n\nexport type CustomEnvironment = Pick<\n Environment,\n | \"generateUUID\"\n | \"getLocation\"\n | \"getReferrer\"\n | \"getUserAgent\"\n | \"send\"\n | \"storage\"\n>;\n\n/**\n * The `RelayConfig` object defines the configuration options for initializing a Relay instance.\n */\nexport interface RelayConfig {\n /**\n * Endpoint defined to communicate with the Event API.\n */\n url: string;\n\n /**\n * Token to authorize the access to the Event API endpoint.\n */\n token: string;\n\n /**\n * The unique identifier of a web property. See [What's a tracking ID?](https://docs.coveo.com/en/n8tg0567/).\n */\n trackingId: string;\n\n /**\n * Defines the library mode. The available modes are `emit` and `disabled`.\n * `emit` sends analytics events to Coveo to be stored.\n * `disabled` prevents the emission of events and does not trigger callbacks.\n * @default emit\n */\n mode?: \"emit\" | \"disabled\";\n\n /**\n * Optionally allows a Relay integration to specify the name(s) of software package(s) relay is\n * being called from. These names will be transmitted with each event, along with Relay's own\n * version. The recommendation is to specify them using a 'softwarename@softwareversion' string.\n */\n source?: string[];\n\n /**\n * Specifies a custom environment for Relay, allowing integrations to override the default behavior.\n * This is useful when Relay runs in unsupported or specialized contexts that require custom handling.\n */\n environment?: CustomEnvironment;\n}\n\nexport interface ConfigManager {\n get: () => Readonly<RelayConfig>;\n update: (updatedConfig: Partial<RelayConfig>) => void;\n}\n\nfunction pick({\n url,\n token,\n trackingId,\n ...rest\n}: RelayConfig): Readonly<RelayConfig> {\n return Object.freeze({\n url,\n token,\n trackingId,\n ...(!!rest.mode && { mode: rest.mode }),\n ...(!!rest.source && { source: rest.source }),\n ...(!!rest.environment && { environment: rest.environment }),\n });\n}\n\nexport function createConfigManager(\n initialConfig: RelayConfig,\n): Readonly<ConfigManager> {\n let _config: Readonly<RelayConfig> = pick(initialConfig);\n\n return {\n get: () => _config,\n update: (updatedConfig: Partial<RelayConfig>) => {\n _config = pick({ ..._config, ...updatedConfig });\n },\n };\n}\n","export interface CookieManager {\n getItem: (key: string) => string | null;\n removeItem: (key: string) => void;\n setItem: (key: string, data: string, expire: number) => void;\n}\n\nexport const cookieManager: CookieManager = createCookieManager();\n\nfunction createCookieManager(): CookieManager {\n const prefix = \"coveo_\";\n const getDomain = (host: string) => {\n const parts = host.split(\".\").slice(-2);\n return parts.length == 2 ? parts.join(\".\") : \"\";\n };\n\n return {\n getItem(key: string): string | null {\n const cookiePrefix = `${prefix}${key}=`;\n const cookieArray = document.cookie.split(\";\");\n for (const cookie of cookieArray) {\n const prettifyCookie = cookie.replace(/^\\s+/, \"\");\n if (prettifyCookie.lastIndexOf(cookiePrefix, 0) === 0) {\n return prettifyCookie.substring(\n cookiePrefix.length,\n prettifyCookie.length,\n );\n }\n }\n return null;\n },\n setItem(key: string, data: string, expire: number): void {\n const domain = getDomain(window.location.hostname);\n const expireSection = `;expires=${new Date(\n new Date().getTime() + expire,\n ).toUTCString()}`;\n const domainSection = domain ? `;domain=${domain}` : \"\";\n document.cookie = `${prefix}${key}=${data}${expireSection}${domainSection};path=/;SameSite=Lax`;\n },\n\n removeItem(key: string): void {\n this.setItem(key, \"\", -1);\n },\n };\n}\n","import { createExplorerMessenger } from \"@coveo/explorer-messenger\";\nimport { Environment } from \"../environment\";\nimport { createBrowserStorage } from \"./storage/storage\";\nimport { RelayEvent } from \"../../event/relay-event\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nfunction getReferrer() {\n const referrer = document.referrer;\n\n return referrer === \"\" ? null : referrer;\n}\n\nexport function buildBrowserEnvironment(): Environment {\n return {\n runtime: \"browser\",\n send: (url: string, token: string, event: RelayEvent) => {\n const response = navigator.sendBeacon(\n `${url}?access_token=${token}`,\n new Blob([JSON.stringify([event])], {\n type: \"application/json\",\n }),\n );\n\n const messenger = createExplorerMessenger();\n messenger.sendMessage({ kind: \"EVENT_PROTOCOL\", event, url, token });\n\n if (!response) {\n throw new Error(\n `Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.`,\n );\n }\n },\n getReferrer: () => getReferrer(),\n getLocation: () => window.location.href,\n getUserAgent: () => navigator.userAgent,\n generateUUID: () => uuidv4(),\n storage: createBrowserStorage(),\n };\n}\n","function createExplorerMessenger() {\n const isBrowser = typeof window !== \"undefined\";\n return {\n sendMessage(message) {\n isBrowser && window.postMessage(message, \"*\");\n }\n };\n}\nexport {\n createExplorerMessenger\n};\n","import { Storage } from \"../../storage\";\nimport { cookieManager } from \"./cookie\";\n\nexport function createBrowserStorage(): Storage {\n return {\n getItem(key: string): string | null {\n return cookieManager.getItem(key) || localStorage.getItem(key);\n },\n\n removeItem(key: string): void {\n cookieManager.removeItem(key);\n localStorage.removeItem(key);\n },\n\n setItem(key: string, data: string): void {\n const oneYear = 31556952000;\n localStorage.setItem(key, data);\n cookieManager.setItem(key, data, oneYear);\n },\n };\n}\n","import { ConfigManager } from \"../../config/config\";\nimport { buildBrowserEnvironment } from \"../browser/browser\";\nimport { localStorageAvailable } from \"../browser/storage/availability\";\nimport { Environment } from \"../environment\";\nimport { buildNullEnvironment } from \"../null/null\";\nexport interface EnvironmentManager {\n get: () => Readonly<Environment>;\n}\n\nfunction buildEnvironment(configManager: ConfigManager): Environment {\n const active = configManager.get().mode !== \"disabled\";\n\n const environmentFromConfig = configManager.get().environment;\n\n if (active && environmentFromConfig) {\n return { ...environmentFromConfig, runtime: \"custom\" };\n }\n\n if (active && isBrowser() && localStorageAvailable()) {\n return buildBrowserEnvironment();\n }\n\n return buildNullEnvironment();\n}\n\nfunction isBrowser() {\n try {\n return typeof window === \"object\";\n } catch {\n return false;\n }\n}\n\nexport function createEnvironmentManager(\n configManager: ConfigManager,\n): Readonly<EnvironmentManager> {\n return {\n get: () => Object.freeze(buildEnvironment(configManager)),\n };\n}\n","// From: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage\nexport function localStorageAvailable() {\n try {\n const x = \"__storage_test__\";\n localStorage.setItem(x, x);\n localStorage.removeItem(x);\n return true;\n } catch (e) {\n return (\n e instanceof DOMException &&\n e.name === \"QuotaExceededError\" &&\n // acknowledge QuotaExceededError only if there's something already stored\n localStorage &&\n localStorage.length !== 0\n );\n }\n}\n","import { Environment } from \"../environment\";\nimport { createNullStorage } from \"../storage\";\n\nexport function buildNullEnvironment(): Environment {\n return {\n runtime: \"null\",\n send: () => undefined,\n getReferrer: () => null,\n getLocation: () => null,\n getUserAgent: () => null,\n generateUUID: () => \"\",\n storage: createNullStorage(),\n };\n}\n","export interface Storage {\n getItem: (key: string) => string | null;\n removeItem: (key: string) => void;\n setItem: (key: string, data: string) => void;\n}\n\nexport function createNullStorage(): Storage {\n return {\n getItem(): string | null {\n return null;\n },\n removeItem(): void {\n return;\n },\n setItem(): void {\n return;\n },\n };\n}\n","import { emit } from \"./emit/emit\";\nimport { createClientIdManager } from \"./client-id/client-id\";\nimport { createRelayEvent, RelayEvent } from \"./event/relay-event\";\nimport { version } from \"./version\";\nimport { createMeta, Meta, EventConfig } from \"./event/meta/meta\";\nimport { createListenerManager, EventCallback } from \"./listener/listener\";\nimport {\n createConfigManager,\n RelayConfig,\n CustomEnvironment,\n} from \"./config/config\";\nimport { createEnvironmentManager } from \"./environment/manager/manager\";\nimport { RelayPayload } from \"./relay-payload\";\n\n/**\n * Function that detaches an event callback.\n * @typedef {function} Off\n * @returns {void}\n */\nexport type Off = () => void;\n\n/**\n * Relay instance.\n * This object provides a comprehensive set of variables and methods for interacting with the Event API.\n */\ninterface Relay {\n /**\n * Sends an event to the Event API.\n * @param {string} type - event's type to be emitted.\n * @param {Record<string,any>} payload - payload to include within the event.\n * @returns {void}\n */\n emit: (type: string, payload: Record<string, any>) => void;\n\n /**\n * Gets the client-side generated meta object.\n * @param {string} type - event's type that will be included in the meta object.\n * @returns {Meta}\n */\n getMeta: (type: string) => Meta;\n\n /**\n * Attaches an event callback to either all event types or a specific one.\n * The callback set will be called when an event with the specified type is emitted.\n * It’s not possible to modify the payload of the event sent to Coveo using this listener.\n * Setting type as \"*\" will trigger the callback for all event types.\n * Returns the \"off\" function to detach the event callback.\n * @param {string} type - event's type.\n * @param {EventCallback} callback - callback that should be called when the event is emitted.\n * @returns {Off}\n */\n on: (type: string, callback: EventCallback) => Off;\n\n /**\n * Detach callback(s) from events.\n * If only the \"type\" parameter is set, all callbacks for the specified type will be removed.\n * @param {string} type - event's type.\n * @param {EventCallback} callback - callback that should be removed.\n * @returns {void}\n */\n off: (type: string, callback?: EventCallback) => void;\n\n /**\n * Updates Relay's configuration after its initialization.\n * @param {Partial<RelayConfig>} config - configuration that should be updated.\n * @returns {void}\n */\n updateConfig: (config: Partial<RelayConfig>) => void;\n\n /**\n * Current version of the Relay library.\n */\n version: string;\n}\n\n/**\n * Initializes the Relay library object.\n * @param {RelayConfig} initialConfig\n * @returns {Relay}\n */\nexport function createRelay(initialConfig: RelayConfig): Relay {\n const configManager = createConfigManager(initialConfig);\n const listenerManager = createListenerManager();\n const environmentManager = createEnvironmentManager(configManager);\n const clientIdManager = createClientIdManager(environmentManager);\n\n return {\n emit: (type: string, payload: Record<string, any>) => {\n const config = configManager.get();\n const environment = environmentManager.get();\n\n const event = createRelayEvent(\n type,\n payload,\n config,\n environment,\n clientIdManager,\n );\n\n return emit({\n config,\n environment,\n event,\n listenerManager,\n });\n },\n getMeta: (type: string) =>\n createMeta(\n type,\n configManager.get(),\n environmentManager.get(),\n clientIdManager,\n ),\n on: (type: string, callback: EventCallback) =>\n listenerManager.add({ type, callback }),\n off: (type: string, callback?: EventCallback) =>\n listenerManager.remove(type, callback),\n updateConfig: (config: Partial<RelayConfig>) =>\n configManager.update(config),\n version,\n };\n}\n\nexport type {\n Relay,\n Meta,\n EventConfig,\n EventCallback,\n RelayConfig,\n RelayPayload,\n RelayEvent,\n CustomEnvironment,\n};\n","import { ClientIdManager } from \"../client-id/client-id\";\nimport { Environment } from \"../environment/environment\";\nimport { RelayPayload } from \"../relay-payload\";\nimport { RelayConfig } from \"../relay\";\nimport { createMeta, Meta } from \"./meta/meta\";\n\n/**\n * Defines the structure of a RelayEvent, extending the RelayPayload.\n */\nexport interface RelayEvent extends RelayPayload {\n /**\n * Read-only `meta` property of Meta type.\n */\n meta: Readonly<Meta>;\n}\n\nexport function createRelayEvent(\n type: string,\n payload: RelayPayload,\n config: RelayConfig,\n environment: Environment,\n clientIdManager: ClientIdManager,\n): Readonly<RelayEvent> {\n return {\n ...payload,\n meta: createMeta(type, config, environment, clientIdManager),\n };\n}\n","import { Environment } from \"../environment/environment\";\nimport { ListenerManager } from \"../listener/listener\";\nimport { RelayEvent } from \"../event/relay-event\";\nimport { RelayConfig } from \"../relay\";\n\nexport interface EmitParams {\n config: RelayConfig;\n environment: Environment;\n event: RelayEvent;\n listenerManager: ListenerManager;\n}\n\nexport function emit({\n config,\n environment,\n event,\n listenerManager,\n}: EmitParams) {\n const { url, token, mode } = config;\n const isEnabled = mode !== \"disabled\";\n\n if (isEnabled) {\n listenerManager.call(event);\n environment.send(url, token, event);\n }\n}\n"],"names":["REGEX","byteToHex","i","push","toString","slice","getRandomValues","rnds8","Uint8Array","native","randomUUID","crypto","bind","v4","options","buf","offset","rnds","random","rng","Error","length","arr","toLowerCase","unsafeStringify","createClientIdManager","environmentManager","getClientId","key","environment","get","storage","existingClientId","getItem","clientId","uuid","test","generateUUID","setItem","version","getSource","config","source","concat","createMeta","type","clientIdManager","getReferrer","getLocation","getUserAgent","eventConfig","trackingId","getEventConfig","Object","freeze","ts","Date","now","userAgent","referrer","location","createListenerManager","listeners","getListenerIndex","callback","findIndex","listener","remove","index","splice","removeOne","removeMultiple","add","call","event","forEach","isMatchesType","meta","e","console","error","pick","url","token","rest","mode","cookieManager","prefix","cookiePrefix","cookieArray","document","cookie","split","prettifyCookie","replace","lastIndexOf","substring","data","expire","domain","host","parts","join","getDomain","window","hostname","expireSection","getTime","toUTCString","domainSection","removeItem","this","createCookieManager","buildBrowserEnvironment","runtime","send","response","navigator","sendBeacon","Blob","JSON","stringify","messenger","isBrowser","sendMessage","message","postMessage","createExplorerMessenger","kind","href","uuidv4","localStorage","buildEnvironment","configManager","active","environmentFromConfig","x","DOMException","name","localStorageAvailable","createRelay","initialConfig","_config","update","updatedConfig","createConfigManager","listenerManager","createEnvironmentManager","emit","payload","createRelayEvent","getMeta","on","off","updateConfig"],"mappings":"AAAA,IAAAA,EAAe,2JCCf,MAAMC,EAAY,GAClB,IAAK,IAAIC,EAAI,EAAGA,EAAI,MAAOA,EACvBD,EAAUE,MAAMD,EAAI,KAAOE,SAAS,IAAIC,MAAM,ICHlD,IAAIC,EACJ,MAAMC,EAAQ,IAAIC,WAAW,ICA7B,IAAeC,EAAA,CAAEC,WADoB,oBAAXC,QAA0BA,OAAOD,YAAcC,OAAOD,WAAWE,KAAKD,SCGhG,SAASE,EAAGC,EAASC,EAAKC,GACtB,GAAIP,EAAOC,aAAuBI,EAC9B,OAAOL,EAAOC,aAGlB,MAAMO,GADNH,EAAUA,GAAW,CAAE,GACFI,QAAUJ,EAAQK,SFN5B,WACX,IAAKb,EAAiB,CAClB,GAAsB,oBAAXK,SAA2BA,OAAOL,gBACzC,MAAM,IAAIc,MAAM,4GAEpBd,EAAkBK,OAAOL,gBAAgBM,KAAKD,OACtD,CACI,OAAOL,EAAgBC,EAC3B,CEFsDY,GAClD,GAAIF,EAAKI,OAAS,GAC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GAE1C,MAAO,CACL/G,IAAK,IAAMgH,EACXC,OAASC,IACPF,EAAU7D,EAAK,IAAK6D,KAAYE,GAAgB,EAGtD,CSJwBC,CAAoBJ,GACpCK,EAAkBrF,IAClBnC,EJlDF,SACJ2G,GAEA,MAAO,CACLvG,IAAK,IAAMuB,OAAOC,OAAO8E,EAAiBC,IAE9C,CI4C6Bc,CAAyBd,GAC9CvF,EAAkBrB,EAAsBC,GAE9C,MAAO,CACL0H,KAAM,CAACvG,EAAcwG,KACnB,MAAM5G,EAAS4F,EAAcvG,MACvBD,EAAcH,EAAmBI,MAEjC4C,EC3EN,SACJ7B,EACAwG,EACA5G,EACAZ,EACAiB,GAEA,MAAO,IACFuG,EACHxE,KAAMjC,EAAWC,EAAMJ,EAAQZ,EAAaiB,GAEhD,CDgEoBwG,CACZzG,EACAwG,EACA5G,EACAZ,EACAiB,GAGF,OEvFA,UAAeL,OACnBA,EAAMZ,YACNA,EAAW6C,MACXA,EAAKwE,gBACLA,IAEA,MAAMhE,IAAEA,EAAGC,MAAEA,EAAKE,KAAEA,GAAS5C,EACF,aAAT4C,IAGhB6D,EAAgBzE,KAAKC,GACrB7C,EAAYsF,KAAKjC,EAAKC,EAAOT,GAEjC,CF0Ea0E,CAAK,CACV3G,SACAZ,cACA6C,QACAwE,mBACA,EAEJK,QAAU1G,GACRD,EACEC,EACAwF,EAAcvG,MACdJ,EAAmBI,MACnBgB,GAEJ0G,GAAI,CAAC3G,EAAcmB,IACjBkF,EAAgB1E,IAAI,CAAE3B,OAAMmB,aAC9ByF,IAAK,CAAC5G,EAAcmB,IAClBkF,EAAgB/E,OAAOtB,EAAMmB,GAC/B0F,aAAejH,GACb4F,EAAcU,OAAOtG,GACvBF,UAEJ","x_google_ignoreList":[0,1,2,3,4,6,13]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-id.d.ts","sourceRoot":"","sources":["../../src/client-id/client-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CACnC,kBAAkB,EAAE,kBAAkB,GACrC,eAAe,CAgBjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACT,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,MAAM,GACN,SAAS,CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,MAAM,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACvD;AAkBD,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,WAAW,GACzB,QAAQ,CAAC,aAAa,CAAC,CASzB"}