@coveo/relay 0.7.7 → 0.7.8

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.
@@ -1,2 +1,2 @@
1
- var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function t(t){const n="visitorId";return{getClientId:()=>{const r=t.get(),o=r.storage,c=o.getItem(n),a=c&&("string"==typeof(i=c)&&e.test(i))?c:r.generateUUID();var i;return o.setItem(n,a),a},clear:()=>{t.get().storage.removeItem(n)}}}const n="0.7.7";function r(e){return(e.source||[]).concat([`relay@${n}`])}function o(e,t,n,o){const{getReferrer:c,getLocation:a,getUserAgent:i}=n,s=function(e){const{trackingId:t}=e;return{trackingId:t}}(t),u=o.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:r(t),clientId:u,userAgent:i(),referrer:c(),location:a()})}const c="*";function a(){const e=[];function t({type:t,callback:n}){return e.findIndex((e=>e.type===t&&e.callback===n))}function n(n,r){r?function(n){const r=t(n);r>=0&&e.splice(r,1)}({type:n,callback:r}):function(t){if(t===c)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(r){return t(r)<0&&e.push(r),()=>n(r.type,r.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 i({url:e,token:t,trackingId:n,...r}){return Object.freeze({url:e,token:t,trackingId:n,...!!r.mode&&{mode:r.mode},...!!r.source&&{source:r.source}})}const s=function(){const e="coveo_";return{getItem(t){const n=`${e}${t}=`,r=document.cookie.split(";");for(const e of r){const t=e.replace(/^\s+/,"");if(0===t.lastIndexOf(n,0))return t.substring(n.length,t.length)}return null},setItem(t,n,r){const o=(e=>{const t=e.split(".").slice(-2);return 2==t.length?t.join("."):""})(window.location.hostname),c=`;expires=${new Date((new Date).getTime()+r).toUTCString()}`,a=o?`;domain=${o}`:"";document.cookie=`${e}${t}=${n}${c}${a};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}}();function u(){return{runtime:"browser",send:(e,t,n)=>{const r=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([n])],{type:"application/json"})),o=function(){const e="undefined"!=typeof window;return{sendMessage(t){e&&window.postMessage(t,"*")}}}();if(o.sendMessage({kind:"EVENT_PROTOCOL",event:n,url:e,token:t}),!r)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:()=>crypto.randomUUID(),storage:{getItem:e=>s.getItem(e)||localStorage.getItem(e),removeItem(e){s.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),s.setItem(e,t,31556952e3)}}}}function l(e){return"disabled"!==e.get().mode&&function(){try{return"object"==typeof window}catch(e){return!1}}()?u():{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:{getItem:()=>null,removeItem(){},setItem(){}}}}function g(e){const r=function(e){let t=i(e);return{get:()=>t,update:e=>{t=i({...t,...e})}}}(e),c=a(),s=function(e){return{get:()=>Object.freeze(l(e))}}(r),u=t(s);return{emit:(e,t)=>{const n=r.get(),a=s.get(),i=function(e,t,n,r,c){return{...t,meta:o(e,n,r,c)}}(e,t,n,a,u);return function({config:e,environment:t,event:n,listenerManager:r}){const{url:o,token:c,mode:a}=e;"disabled"!==a&&(r.call(n),t.send(o,c,n))}({config:n,environment:a,event:i,listenerManager:c})},getMeta:e=>o(e,r.get(),s.get(),u),on:(e,t)=>c.add({type:e,callback:t}),off:(e,t)=>c.remove(e,t),updateConfig:e=>r.update(e),version:n,clearStorage:()=>{u.clear()}}}export{g as createRelay};
1
+ var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function t(t){return{getClientId:()=>{const n="visitorId",o=t.get(),r=o.storage,c=r.getItem(n),i=c&&("string"==typeof(a=c)&&e.test(a))?c:o.generateUUID();var a;return r.setItem(n,i),i}}}const n="0.7.8";function o(e){return(e.source||[]).concat([`relay@${n}`])}function r(e,t,n,r){const{getReferrer:c,getLocation:i,getUserAgent:a}=n,s=function(e){const{trackingId:t}=e;return{trackingId:t}}(t),u=r.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:o(t),clientId:u,userAgent:a(),referrer:c(),location:i()})}const c="*";function i(){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===c)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 a({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}})}const s=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()}`,i=r?`;domain=${r}`:"";document.cookie=`${e}${t}=${n}${c}${i};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}}();function u(){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:()=>crypto.randomUUID(),storage:{getItem:e=>s.getItem(e)||localStorage.getItem(e),removeItem(e){s.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),s.setItem(e,t,31556952e3)}}}}function l(e){return"disabled"!==e.get().mode&&function(){try{return"object"==typeof window}catch(e){return!1}}()?u():{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:{getItem:()=>null,removeItem(){},setItem(){}}}}function g(e){const o=function(e){let t=a(e);return{get:()=>t,update:e=>{t=a({...t,...e})}}}(e),c=i(),s=function(e){return{get:()=>Object.freeze(l(e))}}(o),u=t(s);return{emit:(e,t)=>{const n=o.get(),i=s.get(),a=function(e,t,n,o,c){return{...t,meta:r(e,n,o,c)}}(e,t,n,i,u);return function({config:e,environment:t,event:n,listenerManager:o}){const{url:r,token:c,mode:i}=e;"disabled"!==i&&(o.call(n),t.send(r,c,n))}({config:n,environment:i,event:a,listenerManager:c})},getMeta:e=>r(e,o.get(),s.get(),u),on:(e,t)=>c.add({type:e,callback:t}),off:(e,t)=>c.remove(e,t),updateConfig:e=>o.update(e),version:n}}export{g as createRelay};
2
2
  //# sourceMappingURL=relay.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"relay.min.js","sources":["../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js","../../src/client-id/client-id.ts","../../../../node_modules/.pnpm/uuid@9.0.1/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.1.1/node_modules/@coveo/explorer-messenger/dist/messenger.js","../../src/environment/browser/storage/storage.ts","../../src/environment/manager/manager.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-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import { validate } from \"uuid\";\nimport { EnvironmentManager } from \"../environment/manager/manager\";\n\nexport interface ClientIdManager {\n getClientId: () => string;\n clear: () => void;\n}\n\nexport function createClientIdManager(\n environmentManager: EnvironmentManager\n): ClientIdManager {\n const key = \"visitorId\";\n\n return {\n getClientId: () => {\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 clear: () => {\n environmentManager.get().storage.removeItem(key);\n },\n };\n}\n","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","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 [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 callback ? removeOne({ type, callback }) : removeMultiple(type);\n }\n\n return {\n add,\n call,\n remove,\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 [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\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 });\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\";\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: () => crypto.randomUUID(),\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 { Environment } from \"../environment\";\nimport { buildNullEnvironment } from \"../null/null\";\n\nexport interface EnvironmentManager {\n get: () => Readonly<Environment>;\n}\n\nfunction buildEnvironment(configManager: ConfigManager) {\n const active = configManager.get().mode !== \"disabled\";\n\n if (active && isBrowser()) {\n return buildBrowserEnvironment();\n }\n\n return buildNullEnvironment();\n}\n\nfunction isBrowser() {\n try {\n return typeof window === \"object\";\n } catch (e) {\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","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 { createConfigManager, RelayConfig } 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 * Removes the visitorId cookie and localStorage key.\n * @returns {void}\n */\n clearStorage: () => void;\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 clearStorage: () => {\n clientIdManager.clear();\n },\n };\n}\n\nexport type {\n Relay,\n Meta,\n EventConfig,\n EventCallback,\n RelayConfig,\n RelayPayload,\n RelayEvent,\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","createClientIdManager","environmentManager","key","getClientId","environment","get","storage","existingClientId","getItem","clientId","uuid","test","generateUUID","setItem","clear","removeItem","version","getSource","config","source","concat","createMeta","type","clientIdManager","getReferrer","getLocation","getUserAgent","eventConfig","trackingId","getEventConfig","Object","freeze","ts","Date","now","userAgent","referrer","location","ANY_EVENT_TYPE","createListenerManager","listeners","getListenerIndex","callback","findIndex","listener","remove","index","splice","removeOne","length","i","removeMultiple","add","push","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","slice","join","getDomain","window","hostname","expireSection","getTime","toUTCString","domainSection","this","createCookieManager","buildBrowserEnvironment","runtime","send","response","navigator","sendBeacon","Blob","JSON","stringify","messenger","isBrowser","sendMessage","message","postMessage","createExplorerMessenger","kind","Error","href","crypto","randomUUID","localStorage","buildEnvironment","configManager","createRelay","initialConfig","_config","update","updatedConfig","createConfigManager","listenerManager","createEnvironmentManager","em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ACA,EAEJK,QAAU1G,GACRD,EACEC,EACA8F,EAAc/G,MACdJ,EAAmBI,MACnBkB,GAEJ0G,GAAI,CAAC3G,EAAcoB,IACjBiF,EAAgBvE,IAAI,CAAE9B,OAAMoB,aAC9BwF,IAAK,CAAC5G,EAAcoB,IAClBiF,EAAgB9E,OAAOvB,EAAMoB,GAC/ByF,aAAejH,GACbkG,EAAcI,OAAOtG,GACvBF,UACAoH,aAAc,KACZ7G,EAAgBT,OAAO,EAG7B","x_google_ignoreList":[0,2,9]}
1
+ {"version":3,"file":"relay.min.js","sources":["../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js","../../src/client-id/client-id.ts","../../../../node_modules/.pnpm/uuid@9.0.1/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.1.1/node_modules/@coveo/explorer-messenger/dist/messenger.js","../../src/environment/browser/storage/storage.ts","../../src/environment/manager/manager.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-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","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';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","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 [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 callback ? removeOne({ type, callback }) : removeMultiple(type);\n }\n\n return {\n add,\n call,\n remove,\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 [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\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 });\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\";\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: () => crypto.randomUUID(),\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 { Environment } from \"../environment\";\nimport { buildNullEnvironment } from \"../null/null\";\n\nexport interface EnvironmentManager {\n get: () => Readonly<Environment>;\n}\n\nfunction buildEnvironment(configManager: ConfigManager) {\n const active = configManager.get().mode !== \"disabled\";\n\n if (active && isBrowser()) {\n return buildBrowserEnvironment();\n }\n\n return buildNullEnvironment();\n}\n\nfunction isBrowser() {\n try {\n return typeof window === \"object\";\n } catch (e) {\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","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 { createConfigManager, RelayConfig } 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};\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","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","ANY_EVENT_TYPE","createListenerManager","listeners","getListenerIndex","callback","findIndex","listener","remove","index","splice","removeOne","length","i","removeMultiple","add","push","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","slice","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","Error","href","crypto","randomUUID","localStorage","buildEnvironment","configManager","createRelay","initialConfig","_config","update","updatedConfig","createConfigManager","listenerManager","createEnvironmentManager","emit","payload","createRelayEvent","getMeta","on","off","updateConfig"],"mappings":"AAAA,IAAAA,EAAe,sHCOT,SAAUC,EACdC,GAEA,MAAO,CACLC,YAAa,KACX,MAAMC,EAAM,YACNC,EAAcH,EAAmBI,MACjCC,EAAUF,EAAYE,QAEtBC,EAAmBD,EAAQE,QAAQL,GACnCM,EACJF,ICfiB,iBADPG,EDgBmBH,ICfAR,EAAMY,KAAKD,IDgBpCH,EACAH,EAAYQ,eClBxB,IAAkBF,EDoBZ,OADAJ,EAAQO,QAAQV,EAAKM,GACdA,CAAQ,EAGrB,CEzBO,MAAMK,EAAU,QCkEvB,SAASC,EAAUC,GACjB,OAAQA,EAAOC,QAAU,IAAIC,OAAO,CAAC,SAASJ,KAChD,CAEM,SAAUK,EACdC,EACAJ,EACAZ,EACAiB,GAEA,MAAMC,YAAEA,EAAWC,YAAEA,EAAWC,aAAEA,GAAiBpB,EAC7CqB,EAhBR,SAAwBT,GACtB,MAAMU,WAAEA,GAAeV,EACvB,MAAO,CAAEU,aACX,CAasBC,CAAeX,GAC7BP,EAAWY,EAAgBnB,cAEjC,OAAO0B,OAAOC,OAAa,CACzBT,OACAJ,OAAQS,EACRK,GAAIC,KAAKC,MACTf,OAAQF,EAAUC,GAClBP,WACAwB,UAAWT,IACXU,SAAUZ,IACVa,SAAUZ,KAEd,CCxFA,MAAMa,EAAiB,aAqBPC,IACd,MAAMC,EAAwB,GAE9B,SAASC,GAAiBnB,KAAEA,EAAIoB,SAAEA,IAChC,OAAOF,EAAUG,WAC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A,EAAMZ,YACNA,EAAWiD,MACXA,EAAKqE,gBACLA,IAEA,MAAM7D,IAAEA,EAAGC,MAAEA,EAAKE,KAAEA,GAAShD,EACF,aAATgD,IAGhB0D,EAAgBtE,KAAKC,GACrBjD,EAAY2F,KAAKlC,EAAKC,EAAOT,GAEjC,CFsEauE,CAAK,CACV5G,SACAZ,cACAiD,QACAqE,mBACA,EAEJK,QAAU3G,GACRD,EACEC,EACA+F,EAAc9G,MACdJ,EAAmBI,MACnBgB,GAEJ2G,GAAI,CAAC5G,EAAcoB,IACjBkF,EAAgBxE,IAAI,CAAE9B,OAAMoB,aAC9ByF,IAAK,CAAC7G,EAAcoB,IAClBkF,EAAgB/E,OAAOvB,EAAMoB,GAC/B0F,aAAelH,GACbmG,EAAcI,OAAOvG,GACvBF,UAEJ","x_google_ignoreList":[0,2,9]}
@@ -1,7 +1,6 @@
1
1
  import { EnvironmentManager } from "../environment/manager/manager";
2
2
  export interface ClientIdManager {
3
3
  getClientId: () => string;
4
- clear: () => void;
5
4
  }
6
5
  export declare function createClientIdManager(environmentManager: EnvironmentManager): ClientIdManager;
7
6
  //# sourceMappingURL=client-id.d.ts.map
@@ -1 +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;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,kBAAkB,EAAE,kBAAkB,GACrC,eAAe,CAoBjB"}
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"}
@@ -56,11 +56,6 @@ interface Relay {
56
56
  * Current version of the Relay library.
57
57
  */
58
58
  version: string;
59
- /**
60
- * Removes the visitorId cookie and localStorage key.
61
- * @returns {void}
62
- */
63
- clearStorage: () => void;
64
59
  }
65
60
  /**
66
61
  * Initializes the Relay library object.
@@ -1 +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,EAAuB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnE,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;;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AEG;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,GACX,CAAC"}
@@ -6,7 +6,7 @@
6
6
  "flags": {},
7
7
  "children": [
8
8
  {
9
- "id": 44,
9
+ "id": 41,
10
10
  "name": "EventConfig",
11
11
  "variant": "declaration",
12
12
  "kind": 256,
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "children": [
31
31
  {
32
- "id": 45,
32
+ "id": 42,
33
33
  "name": "trackingId",
34
34
  "variant": "declaration",
35
35
  "kind": 1024,
@@ -47,7 +47,7 @@
47
47
  "fileName": "event/meta/meta.ts",
48
48
  "line": 13,
49
49
  "character": 2,
50
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L13"
50
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L13"
51
51
  }
52
52
  ],
53
53
  "type": {
@@ -60,7 +60,7 @@
60
60
  {
61
61
  "title": "Properties",
62
62
  "children": [
63
- 45
63
+ 42
64
64
  ]
65
65
  }
66
66
  ],
@@ -69,12 +69,12 @@
69
69
  "fileName": "event/meta/meta.ts",
70
70
  "line": 9,
71
71
  "character": 17,
72
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L9"
72
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L9"
73
73
  }
74
74
  ]
75
75
  },
76
76
  {
77
- "id": 35,
77
+ "id": 32,
78
78
  "name": "Meta",
79
79
  "variant": "declaration",
80
80
  "kind": 256,
@@ -97,7 +97,7 @@
97
97
  },
98
98
  "children": [
99
99
  {
100
- "id": 40,
100
+ "id": 37,
101
101
  "name": "clientId",
102
102
  "variant": "declaration",
103
103
  "kind": 1024,
@@ -115,7 +115,7 @@
115
115
  "fileName": "event/meta/meta.ts",
116
116
  "line": 44,
117
117
  "character": 2,
118
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L44"
118
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L44"
119
119
  }
120
120
  ],
121
121
  "type": {
@@ -124,7 +124,7 @@
124
124
  }
125
125
  },
126
126
  {
127
- "id": 37,
127
+ "id": 34,
128
128
  "name": "config",
129
129
  "variant": "declaration",
130
130
  "kind": 1024,
@@ -142,18 +142,18 @@
142
142
  "fileName": "event/meta/meta.ts",
143
143
  "line": 29,
144
144
  "character": 2,
145
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L29"
145
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L29"
146
146
  }
147
147
  ],
148
148
  "type": {
149
149
  "type": "reference",
150
- "target": 44,
150
+ "target": 41,
151
151
  "name": "EventConfig",
152
152
  "package": "@coveo/relay"
153
153
  }
154
154
  },
155
155
  {
156
- "id": 43,
156
+ "id": 40,
157
157
  "name": "location",
158
158
  "variant": "declaration",
159
159
  "kind": 1024,
@@ -171,7 +171,7 @@
171
171
  "fileName": "event/meta/meta.ts",
172
172
  "line": 59,
173
173
  "character": 2,
174
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L59"
174
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L59"
175
175
  }
176
176
  ],
177
177
  "type": {
@@ -189,7 +189,7 @@
189
189
  }
190
190
  },
191
191
  {
192
- "id": 42,
192
+ "id": 39,
193
193
  "name": "referrer",
194
194
  "variant": "declaration",
195
195
  "kind": 1024,
@@ -207,7 +207,7 @@
207
207
  "fileName": "event/meta/meta.ts",
208
208
  "line": 54,
209
209
  "character": 2,
210
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L54"
210
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L54"
211
211
  }
212
212
  ],
213
213
  "type": {
@@ -225,7 +225,7 @@
225
225
  }
226
226
  },
227
227
  {
228
- "id": 39,
228
+ "id": 36,
229
229
  "name": "source",
230
230
  "variant": "declaration",
231
231
  "kind": 1024,
@@ -243,7 +243,7 @@
243
243
  "fileName": "event/meta/meta.ts",
244
244
  "line": 39,
245
245
  "character": 2,
246
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L39"
246
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L39"
247
247
  }
248
248
  ],
249
249
  "type": {
@@ -255,7 +255,7 @@
255
255
  }
256
256
  },
257
257
  {
258
- "id": 38,
258
+ "id": 35,
259
259
  "name": "ts",
260
260
  "variant": "declaration",
261
261
  "kind": 1024,
@@ -273,7 +273,7 @@
273
273
  "fileName": "event/meta/meta.ts",
274
274
  "line": 34,
275
275
  "character": 2,
276
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L34"
276
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L34"
277
277
  }
278
278
  ],
279
279
  "type": {
@@ -282,7 +282,7 @@
282
282
  }
283
283
  },
284
284
  {
285
- "id": 36,
285
+ "id": 33,
286
286
  "name": "type",
287
287
  "variant": "declaration",
288
288
  "kind": 1024,
@@ -300,7 +300,7 @@
300
300
  "fileName": "event/meta/meta.ts",
301
301
  "line": 24,
302
302
  "character": 2,
303
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L24"
303
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L24"
304
304
  }
305
305
  ],
306
306
  "type": {
@@ -309,7 +309,7 @@
309
309
  }
310
310
  },
311
311
  {
312
- "id": 41,
312
+ "id": 38,
313
313
  "name": "userAgent",
314
314
  "variant": "declaration",
315
315
  "kind": 1024,
@@ -327,7 +327,7 @@
327
327
  "fileName": "event/meta/meta.ts",
328
328
  "line": 49,
329
329
  "character": 2,
330
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L49"
330
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L49"
331
331
  }
332
332
  ],
333
333
  "type": {
@@ -349,14 +349,14 @@
349
349
  {
350
350
  "title": "Properties",
351
351
  "children": [
352
- 40,
353
352
  37,
354
- 43,
355
- 42,
353
+ 34,
354
+ 40,
356
355
  39,
357
- 38,
358
356
  36,
359
- 41
357
+ 35,
358
+ 33,
359
+ 38
360
360
  ]
361
361
  }
362
362
  ],
@@ -365,7 +365,7 @@
365
365
  "fileName": "event/meta/meta.ts",
366
366
  "line": 20,
367
367
  "character": 17,
368
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/meta/meta.ts#L20"
368
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/meta/meta.ts#L20"
369
369
  }
370
370
  ]
371
371
  },
@@ -384,74 +384,6 @@
384
384
  ]
385
385
  },
386
386
  "children": [
387
- {
388
- "id": 32,
389
- "name": "clearStorage",
390
- "variant": "declaration",
391
- "kind": 1024,
392
- "flags": {},
393
- "sources": [
394
- {
395
- "fileName": "relay.ts",
396
- "line": 75,
397
- "character": 2,
398
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L75"
399
- }
400
- ],
401
- "type": {
402
- "type": "reflection",
403
- "declaration": {
404
- "id": 33,
405
- "name": "__type",
406
- "variant": "declaration",
407
- "kind": 65536,
408
- "flags": {},
409
- "sources": [
410
- {
411
- "fileName": "relay.ts",
412
- "line": 75,
413
- "character": 16,
414
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L75"
415
- }
416
- ],
417
- "signatures": [
418
- {
419
- "id": 34,
420
- "name": "__type",
421
- "variant": "signature",
422
- "kind": 4096,
423
- "flags": {},
424
- "comment": {
425
- "summary": [
426
- {
427
- "kind": "text",
428
- "text": "Removes the visitorId cookie and localStorage key."
429
- }
430
- ],
431
- "blockTags": [
432
- {
433
- "tag": "@returns",
434
- "content": []
435
- }
436
- ]
437
- },
438
- "sources": [
439
- {
440
- "fileName": "relay.ts",
441
- "line": 75,
442
- "character": 16,
443
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L75"
444
- }
445
- ],
446
- "type": {
447
- "type": "intrinsic",
448
- "name": "void"
449
- }
450
- }
451
- ]
452
- }
453
- }
454
- },
455
387
  {
456
388
  "id": 8,
457
389
  "name": "emit",
@@ -463,7 +395,7 @@
463
395
  "fileName": "relay.ts",
464
396
  "line": 29,
465
397
  "character": 2,
466
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L29"
398
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L29"
467
399
  }
468
400
  ],
469
401
  "type": {
@@ -479,7 +411,7 @@
479
411
  "fileName": "relay.ts",
480
412
  "line": 29,
481
413
  "character": 8,
482
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L29"
414
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L29"
483
415
  }
484
416
  ],
485
417
  "signatures": [
@@ -508,7 +440,7 @@
508
440
  "fileName": "relay.ts",
509
441
  "line": 29,
510
442
  "character": 8,
511
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L29"
443
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L29"
512
444
  }
513
445
  ],
514
446
  "parameters": [
@@ -586,7 +518,7 @@
586
518
  "fileName": "relay.ts",
587
519
  "line": 36,
588
520
  "character": 2,
589
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L36"
521
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L36"
590
522
  }
591
523
  ],
592
524
  "type": {
@@ -602,7 +534,7 @@
602
534
  "fileName": "relay.ts",
603
535
  "line": 36,
604
536
  "character": 11,
605
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L36"
537
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L36"
606
538
  }
607
539
  ],
608
540
  "signatures": [
@@ -631,7 +563,7 @@
631
563
  "fileName": "relay.ts",
632
564
  "line": 36,
633
565
  "character": 11,
634
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L36"
566
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L36"
635
567
  }
636
568
  ],
637
569
  "parameters": [
@@ -657,7 +589,7 @@
657
589
  ],
658
590
  "type": {
659
591
  "type": "reference",
660
- "target": 35,
592
+ "target": 32,
661
593
  "name": "Meta",
662
594
  "package": "@coveo/relay"
663
595
  }
@@ -677,7 +609,7 @@
677
609
  "fileName": "relay.ts",
678
610
  "line": 57,
679
611
  "character": 2,
680
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L57"
612
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L57"
681
613
  }
682
614
  ],
683
615
  "type": {
@@ -693,7 +625,7 @@
693
625
  "fileName": "relay.ts",
694
626
  "line": 57,
695
627
  "character": 7,
696
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L57"
628
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L57"
697
629
  }
698
630
  ],
699
631
  "signatures": [
@@ -722,7 +654,7 @@
722
654
  "fileName": "relay.ts",
723
655
  "line": 57,
724
656
  "character": 7,
725
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L57"
657
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L57"
726
658
  }
727
659
  ],
728
660
  "parameters": [
@@ -763,7 +695,7 @@
763
695
  },
764
696
  "type": {
765
697
  "type": "reference",
766
- "target": 46,
698
+ "target": 43,
767
699
  "name": "EventCallback",
768
700
  "package": "@coveo/relay"
769
701
  }
@@ -789,7 +721,7 @@
789
721
  "fileName": "relay.ts",
790
722
  "line": 48,
791
723
  "character": 2,
792
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L48"
724
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L48"
793
725
  }
794
726
  ],
795
727
  "type": {
@@ -805,7 +737,7 @@
805
737
  "fileName": "relay.ts",
806
738
  "line": 48,
807
739
  "character": 6,
808
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L48"
740
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L48"
809
741
  }
810
742
  ],
811
743
  "signatures": [
@@ -834,7 +766,7 @@
834
766
  "fileName": "relay.ts",
835
767
  "line": 48,
836
768
  "character": 6,
837
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L48"
769
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L48"
838
770
  }
839
771
  ],
840
772
  "parameters": [
@@ -873,7 +805,7 @@
873
805
  },
874
806
  "type": {
875
807
  "type": "reference",
876
- "target": 46,
808
+ "target": 43,
877
809
  "name": "EventCallback",
878
810
  "package": "@coveo/relay"
879
811
  }
@@ -901,7 +833,7 @@
901
833
  "fileName": "relay.ts",
902
834
  "line": 64,
903
835
  "character": 2,
904
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L64"
836
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L64"
905
837
  }
906
838
  ],
907
839
  "type": {
@@ -917,7 +849,7 @@
917
849
  "fileName": "relay.ts",
918
850
  "line": 64,
919
851
  "character": 16,
920
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L64"
852
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L64"
921
853
  }
922
854
  ],
923
855
  "signatures": [
@@ -946,7 +878,7 @@
946
878
  "fileName": "relay.ts",
947
879
  "line": 64,
948
880
  "character": 16,
949
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L64"
881
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L64"
950
882
  }
951
883
  ],
952
884
  "parameters": [
@@ -973,7 +905,7 @@
973
905
  "typeArguments": [
974
906
  {
975
907
  "type": "reference",
976
- "target": 50,
908
+ "target": 47,
977
909
  "name": "RelayConfig",
978
910
  "package": "@coveo/relay"
979
911
  }
@@ -1011,7 +943,7 @@
1011
943
  "fileName": "relay.ts",
1012
944
  "line": 69,
1013
945
  "character": 2,
1014
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L69"
946
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L69"
1015
947
  }
1016
948
  ],
1017
949
  "type": {
@@ -1024,7 +956,6 @@
1024
956
  {
1025
957
  "title": "Properties",
1026
958
  "children": [
1027
- 32,
1028
959
  8,
1029
960
  13,
1030
961
  22,
@@ -1039,12 +970,12 @@
1039
970
  "fileName": "relay.ts",
1040
971
  "line": 22,
1041
972
  "character": 10,
1042
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L22"
973
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L22"
1043
974
  }
1044
975
  ]
1045
976
  },
1046
977
  {
1047
- "id": 50,
978
+ "id": 47,
1048
979
  "name": "RelayConfig",
1049
980
  "variant": "declaration",
1050
981
  "kind": 256,
@@ -1067,7 +998,7 @@
1067
998
  },
1068
999
  "children": [
1069
1000
  {
1070
- "id": 54,
1001
+ "id": 51,
1071
1002
  "name": "mode",
1072
1003
  "variant": "declaration",
1073
1004
  "kind": 1024,
@@ -1130,7 +1061,7 @@
1130
1061
  "fileName": "config/config.ts",
1131
1062
  "line": 26,
1132
1063
  "character": 2,
1133
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L26"
1064
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L26"
1134
1065
  }
1135
1066
  ],
1136
1067
  "type": {
@@ -1148,7 +1079,7 @@
1148
1079
  }
1149
1080
  },
1150
1081
  {
1151
- "id": 55,
1082
+ "id": 52,
1152
1083
  "name": "source",
1153
1084
  "variant": "declaration",
1154
1085
  "kind": 1024,
@@ -1168,7 +1099,7 @@
1168
1099
  "fileName": "config/config.ts",
1169
1100
  "line": 33,
1170
1101
  "character": 2,
1171
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L33"
1102
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L33"
1172
1103
  }
1173
1104
  ],
1174
1105
  "type": {
@@ -1180,7 +1111,7 @@
1180
1111
  }
1181
1112
  },
1182
1113
  {
1183
- "id": 52,
1114
+ "id": 49,
1184
1115
  "name": "token",
1185
1116
  "variant": "declaration",
1186
1117
  "kind": 1024,
@@ -1198,7 +1129,7 @@
1198
1129
  "fileName": "config/config.ts",
1199
1130
  "line": 13,
1200
1131
  "character": 2,
1201
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L13"
1132
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L13"
1202
1133
  }
1203
1134
  ],
1204
1135
  "type": {
@@ -1207,7 +1138,7 @@
1207
1138
  }
1208
1139
  },
1209
1140
  {
1210
- "id": 53,
1141
+ "id": 50,
1211
1142
  "name": "trackingId",
1212
1143
  "variant": "declaration",
1213
1144
  "kind": 1024,
@@ -1225,7 +1156,7 @@
1225
1156
  "fileName": "config/config.ts",
1226
1157
  "line": 18,
1227
1158
  "character": 2,
1228
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L18"
1159
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L18"
1229
1160
  }
1230
1161
  ],
1231
1162
  "type": {
@@ -1234,7 +1165,7 @@
1234
1165
  }
1235
1166
  },
1236
1167
  {
1237
- "id": 51,
1168
+ "id": 48,
1238
1169
  "name": "url",
1239
1170
  "variant": "declaration",
1240
1171
  "kind": 1024,
@@ -1252,7 +1183,7 @@
1252
1183
  "fileName": "config/config.ts",
1253
1184
  "line": 8,
1254
1185
  "character": 2,
1255
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L8"
1186
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L8"
1256
1187
  }
1257
1188
  ],
1258
1189
  "type": {
@@ -1265,11 +1196,11 @@
1265
1196
  {
1266
1197
  "title": "Properties",
1267
1198
  "children": [
1268
- 54,
1269
- 55,
1199
+ 51,
1270
1200
  52,
1271
- 53,
1272
- 51
1201
+ 49,
1202
+ 50,
1203
+ 48
1273
1204
  ]
1274
1205
  }
1275
1206
  ],
@@ -1278,12 +1209,12 @@
1278
1209
  "fileName": "config/config.ts",
1279
1210
  "line": 4,
1280
1211
  "character": 17,
1281
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/config/config.ts#L4"
1212
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/config/config.ts#L4"
1282
1213
  }
1283
1214
  ]
1284
1215
  },
1285
1216
  {
1286
- "id": 57,
1217
+ "id": 54,
1287
1218
  "name": "RelayEvent",
1288
1219
  "variant": "declaration",
1289
1220
  "kind": 256,
@@ -1298,7 +1229,7 @@
1298
1229
  },
1299
1230
  "children": [
1300
1231
  {
1301
- "id": 58,
1232
+ "id": 55,
1302
1233
  "name": "meta",
1303
1234
  "variant": "declaration",
1304
1235
  "kind": 1024,
@@ -1324,7 +1255,7 @@
1324
1255
  "fileName": "event/relay-event.ts",
1325
1256
  "line": 14,
1326
1257
  "character": 2,
1327
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/relay-event.ts#L14"
1258
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/relay-event.ts#L14"
1328
1259
  }
1329
1260
  ],
1330
1261
  "type": {
@@ -1336,7 +1267,7 @@
1336
1267
  "typeArguments": [
1337
1268
  {
1338
1269
  "type": "reference",
1339
- "target": 35,
1270
+ "target": 32,
1340
1271
  "name": "Meta",
1341
1272
  "package": "@coveo/relay"
1342
1273
  }
@@ -1350,7 +1281,7 @@
1350
1281
  {
1351
1282
  "title": "Properties",
1352
1283
  "children": [
1353
- 58
1284
+ 55
1354
1285
  ]
1355
1286
  }
1356
1287
  ],
@@ -1359,20 +1290,20 @@
1359
1290
  "fileName": "event/relay-event.ts",
1360
1291
  "line": 10,
1361
1292
  "character": 17,
1362
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/event/relay-event.ts#L10"
1293
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/event/relay-event.ts#L10"
1363
1294
  }
1364
1295
  ],
1365
1296
  "extendedTypes": [
1366
1297
  {
1367
1298
  "type": "reference",
1368
- "target": 56,
1299
+ "target": 53,
1369
1300
  "name": "RelayPayload",
1370
1301
  "package": "@coveo/relay"
1371
1302
  }
1372
1303
  ]
1373
1304
  },
1374
1305
  {
1375
- "id": 46,
1306
+ "id": 43,
1376
1307
  "name": "EventCallback",
1377
1308
  "variant": "declaration",
1378
1309
  "kind": 2097152,
@@ -1382,13 +1313,13 @@
1382
1313
  "fileName": "listener/listener.ts",
1383
1314
  "line": 11,
1384
1315
  "character": 12,
1385
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/listener/listener.ts#L11"
1316
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/listener/listener.ts#L11"
1386
1317
  }
1387
1318
  ],
1388
1319
  "type": {
1389
1320
  "type": "reflection",
1390
1321
  "declaration": {
1391
- "id": 47,
1322
+ "id": 44,
1392
1323
  "name": "__type",
1393
1324
  "variant": "declaration",
1394
1325
  "kind": 65536,
@@ -1398,12 +1329,12 @@
1398
1329
  "fileName": "listener/listener.ts",
1399
1330
  "line": 11,
1400
1331
  "character": 28,
1401
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/listener/listener.ts#L11"
1332
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/listener/listener.ts#L11"
1402
1333
  }
1403
1334
  ],
1404
1335
  "signatures": [
1405
1336
  {
1406
- "id": 48,
1337
+ "id": 45,
1407
1338
  "name": "__type",
1408
1339
  "variant": "signature",
1409
1340
  "kind": 4096,
@@ -1424,7 +1355,7 @@
1424
1355
  },
1425
1356
  "parameters": [
1426
1357
  {
1427
- "id": 49,
1358
+ "id": 46,
1428
1359
  "name": "event",
1429
1360
  "variant": "param",
1430
1361
  "kind": 32768,
@@ -1439,7 +1370,7 @@
1439
1370
  },
1440
1371
  "type": {
1441
1372
  "type": "reference",
1442
- "target": 57,
1373
+ "target": 54,
1443
1374
  "name": "RelayEvent",
1444
1375
  "package": "@coveo/relay"
1445
1376
  }
@@ -1465,7 +1396,7 @@
1465
1396
  "fileName": "relay.ts",
1466
1397
  "line": 16,
1467
1398
  "character": 12,
1468
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L16"
1399
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L16"
1469
1400
  }
1470
1401
  ],
1471
1402
  "type": {
@@ -1481,7 +1412,7 @@
1481
1412
  "fileName": "relay.ts",
1482
1413
  "line": 16,
1483
1414
  "character": 18,
1484
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L16"
1415
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L16"
1485
1416
  }
1486
1417
  ],
1487
1418
  "signatures": [
@@ -1515,7 +1446,7 @@
1515
1446
  }
1516
1447
  },
1517
1448
  {
1518
- "id": 56,
1449
+ "id": 53,
1519
1450
  "name": "RelayPayload",
1520
1451
  "variant": "declaration",
1521
1452
  "kind": 2097152,
@@ -1533,7 +1464,7 @@
1533
1464
  "fileName": "relay-payload.ts",
1534
1465
  "line": 5,
1535
1466
  "character": 12,
1536
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay-payload.ts#L5"
1467
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay-payload.ts#L5"
1537
1468
  }
1538
1469
  ],
1539
1470
  "type": {
@@ -1558,7 +1489,7 @@
1558
1489
  "extendedBy": [
1559
1490
  {
1560
1491
  "type": "reference",
1561
- "target": 57,
1492
+ "target": 54,
1562
1493
  "name": "RelayEvent"
1563
1494
  }
1564
1495
  ]
@@ -1572,9 +1503,9 @@
1572
1503
  "sources": [
1573
1504
  {
1574
1505
  "fileName": "relay.ts",
1575
- "line": 83,
1506
+ "line": 77,
1576
1507
  "character": 16,
1577
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L83"
1508
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L77"
1578
1509
  }
1579
1510
  ],
1580
1511
  "signatures": [
@@ -1601,9 +1532,9 @@
1601
1532
  "sources": [
1602
1533
  {
1603
1534
  "fileName": "relay.ts",
1604
- "line": 83,
1535
+ "line": 77,
1605
1536
  "character": 16,
1606
- "url": "https://github.com/coveo-platform/relay/blob/20f3547/packages/relay/src/relay.ts#L83"
1537
+ "url": "https://github.com/coveo-platform/relay/blob/8a10908/packages/relay/src/relay.ts#L77"
1607
1538
  }
1608
1539
  ],
1609
1540
  "parameters": [
@@ -1615,7 +1546,7 @@
1615
1546
  "flags": {},
1616
1547
  "type": {
1617
1548
  "type": "reference",
1618
- "target": 50,
1549
+ "target": 47,
1619
1550
  "name": "RelayConfig",
1620
1551
  "package": "@coveo/relay"
1621
1552
  }
@@ -1635,19 +1566,19 @@
1635
1566
  {
1636
1567
  "title": "Interfaces",
1637
1568
  "children": [
1638
- 44,
1639
- 35,
1569
+ 41,
1570
+ 32,
1640
1571
  7,
1641
- 50,
1642
- 57
1572
+ 47,
1573
+ 54
1643
1574
  ]
1644
1575
  },
1645
1576
  {
1646
1577
  "title": "Type Aliases",
1647
1578
  "children": [
1648
- 46,
1579
+ 43,
1649
1580
  4,
1650
- 56
1581
+ 53
1651
1582
  ]
1652
1583
  },
1653
1584
  {
@@ -1658,7 +1589,7 @@
1658
1589
  }
1659
1590
  ],
1660
1591
  "packageName": "@coveo/relay",
1661
- "packageVersion": "0.7.7",
1592
+ "packageVersion": "0.7.8",
1662
1593
  "readme": [
1663
1594
  {
1664
1595
  "kind": "text",
@@ -1803,110 +1734,98 @@
1803
1734
  "qualifiedName": "Relay.version"
1804
1735
  },
1805
1736
  "32": {
1806
- "sourceFileName": "src/relay.ts",
1807
- "qualifiedName": "Relay.clearStorage"
1808
- },
1809
- "33": {
1810
- "sourceFileName": "src/relay.ts",
1811
- "qualifiedName": "__type"
1812
- },
1813
- "34": {
1814
- "sourceFileName": "src/relay.ts",
1815
- "qualifiedName": "__type"
1816
- },
1817
- "35": {
1818
1737
  "sourceFileName": "src/event/meta/meta.ts",
1819
1738
  "qualifiedName": "Meta"
1820
1739
  },
1821
- "36": {
1740
+ "33": {
1822
1741
  "sourceFileName": "src/event/meta/meta.ts",
1823
1742
  "qualifiedName": "Meta.type"
1824
1743
  },
1825
- "37": {
1744
+ "34": {
1826
1745
  "sourceFileName": "src/event/meta/meta.ts",
1827
1746
  "qualifiedName": "Meta.config"
1828
1747
  },
1829
- "38": {
1748
+ "35": {
1830
1749
  "sourceFileName": "src/event/meta/meta.ts",
1831
1750
  "qualifiedName": "Meta.ts"
1832
1751
  },
1833
- "39": {
1752
+ "36": {
1834
1753
  "sourceFileName": "src/event/meta/meta.ts",
1835
1754
  "qualifiedName": "Meta.source"
1836
1755
  },
1837
- "40": {
1756
+ "37": {
1838
1757
  "sourceFileName": "src/event/meta/meta.ts",
1839
1758
  "qualifiedName": "Meta.clientId"
1840
1759
  },
1841
- "41": {
1760
+ "38": {
1842
1761
  "sourceFileName": "src/event/meta/meta.ts",
1843
1762
  "qualifiedName": "Meta.userAgent"
1844
1763
  },
1845
- "42": {
1764
+ "39": {
1846
1765
  "sourceFileName": "src/event/meta/meta.ts",
1847
1766
  "qualifiedName": "Meta.referrer"
1848
1767
  },
1849
- "43": {
1768
+ "40": {
1850
1769
  "sourceFileName": "src/event/meta/meta.ts",
1851
1770
  "qualifiedName": "Meta.location"
1852
1771
  },
1853
- "44": {
1772
+ "41": {
1854
1773
  "sourceFileName": "src/event/meta/meta.ts",
1855
1774
  "qualifiedName": "EventConfig"
1856
1775
  },
1857
- "45": {
1776
+ "42": {
1858
1777
  "sourceFileName": "src/event/meta/meta.ts",
1859
1778
  "qualifiedName": "EventConfig.trackingId"
1860
1779
  },
1861
- "46": {
1780
+ "43": {
1862
1781
  "sourceFileName": "src/listener/listener.ts",
1863
1782
  "qualifiedName": "EventCallback"
1864
1783
  },
1865
- "47": {
1784
+ "44": {
1866
1785
  "sourceFileName": "src/listener/listener.ts",
1867
1786
  "qualifiedName": "__type"
1868
1787
  },
1869
- "48": {
1788
+ "45": {
1870
1789
  "sourceFileName": "src/listener/listener.ts",
1871
1790
  "qualifiedName": "__type"
1872
1791
  },
1873
- "49": {
1792
+ "46": {
1874
1793
  "sourceFileName": "src/listener/listener.ts",
1875
1794
  "qualifiedName": "event"
1876
1795
  },
1877
- "50": {
1796
+ "47": {
1878
1797
  "sourceFileName": "src/config/config.ts",
1879
1798
  "qualifiedName": "RelayConfig"
1880
1799
  },
1881
- "51": {
1800
+ "48": {
1882
1801
  "sourceFileName": "src/config/config.ts",
1883
1802
  "qualifiedName": "RelayConfig.url"
1884
1803
  },
1885
- "52": {
1804
+ "49": {
1886
1805
  "sourceFileName": "src/config/config.ts",
1887
1806
  "qualifiedName": "RelayConfig.token"
1888
1807
  },
1889
- "53": {
1808
+ "50": {
1890
1809
  "sourceFileName": "src/config/config.ts",
1891
1810
  "qualifiedName": "RelayConfig.trackingId"
1892
1811
  },
1893
- "54": {
1812
+ "51": {
1894
1813
  "sourceFileName": "src/config/config.ts",
1895
1814
  "qualifiedName": "RelayConfig.mode"
1896
1815
  },
1897
- "55": {
1816
+ "52": {
1898
1817
  "sourceFileName": "src/config/config.ts",
1899
1818
  "qualifiedName": "RelayConfig.source"
1900
1819
  },
1901
- "56": {
1820
+ "53": {
1902
1821
  "sourceFileName": "src/relay-payload.ts",
1903
1822
  "qualifiedName": "RelayPayload"
1904
1823
  },
1905
- "57": {
1824
+ "54": {
1906
1825
  "sourceFileName": "src/event/relay-event.ts",
1907
1826
  "qualifiedName": "RelayEvent"
1908
1827
  },
1909
- "58": {
1828
+ "55": {
1910
1829
  "sourceFileName": "src/event/relay-event.ts",
1911
1830
  "qualifiedName": "RelayEvent.meta"
1912
1831
  }
package/lib/relay.cjs CHANGED
@@ -16,9 +16,9 @@ function validate(uuid) {
16
16
  }
17
17
 
18
18
  function createClientIdManager(environmentManager) {
19
- const key = "visitorId";
20
19
  return {
21
20
  getClientId: () => {
21
+ const key = "visitorId";
22
22
  const environment = environmentManager.get();
23
23
  const storage = environment.storage;
24
24
  const existingClientId = storage.getItem(key);
@@ -28,13 +28,10 @@ function createClientIdManager(environmentManager) {
28
28
  storage.setItem(key, clientId);
29
29
  return clientId;
30
30
  },
31
- clear: () => {
32
- environmentManager.get().storage.removeItem(key);
33
- },
34
31
  };
35
32
  }
36
33
 
37
- const version = "0.7.7";
34
+ const version = "0.7.8";
38
35
 
39
36
  function getEventConfig(config) {
40
37
  const { trackingId } = config;
@@ -296,9 +293,6 @@ function createRelay(initialConfig) {
296
293
  off: (type, callback) => listenerManager.remove(type, callback),
297
294
  updateConfig: (config) => configManager.update(config),
298
295
  version,
299
- clearStorage: () => {
300
- clientIdManager.clear();
301
- },
302
296
  };
303
297
  }
304
298
 
package/lib/relay.js CHANGED
@@ -14,9 +14,9 @@ function validate(uuid) {
14
14
  }
15
15
 
16
16
  function createClientIdManager(environmentManager) {
17
- const key = "visitorId";
18
17
  return {
19
18
  getClientId: () => {
19
+ const key = "visitorId";
20
20
  const environment = environmentManager.get();
21
21
  const storage = environment.storage;
22
22
  const existingClientId = storage.getItem(key);
@@ -26,13 +26,10 @@ function createClientIdManager(environmentManager) {
26
26
  storage.setItem(key, clientId);
27
27
  return clientId;
28
28
  },
29
- clear: () => {
30
- environmentManager.get().storage.removeItem(key);
31
- },
32
29
  };
33
30
  }
34
31
 
35
- const version = "0.7.7";
32
+ const version = "0.7.8";
36
33
 
37
34
  function getEventConfig(config) {
38
35
  const { trackingId } = config;
@@ -294,9 +291,6 @@ function createRelay(initialConfig) {
294
291
  off: (type, callback) => listenerManager.remove(type, callback),
295
292
  updateConfig: (config) => configManager.update(config),
296
293
  version,
297
- clearStorage: () => {
298
- clientIdManager.clear();
299
- },
300
294
  };
301
295
  }
302
296
 
package/lib/relay.mjs CHANGED
@@ -14,9 +14,9 @@ function validate(uuid) {
14
14
  }
15
15
 
16
16
  function createClientIdManager(environmentManager) {
17
- const key = "visitorId";
18
17
  return {
19
18
  getClientId: () => {
19
+ const key = "visitorId";
20
20
  const environment = environmentManager.get();
21
21
  const storage = environment.storage;
22
22
  const existingClientId = storage.getItem(key);
@@ -26,13 +26,10 @@ function createClientIdManager(environmentManager) {
26
26
  storage.setItem(key, clientId);
27
27
  return clientId;
28
28
  },
29
- clear: () => {
30
- environmentManager.get().storage.removeItem(key);
31
- },
32
29
  };
33
30
  }
34
31
 
35
- const version = "0.7.7";
32
+ const version = "0.7.8";
36
33
 
37
34
  function getEventConfig(config) {
38
35
  const { trackingId } = config;
@@ -294,9 +291,6 @@ function createRelay(initialConfig) {
294
291
  off: (type, callback) => listenerManager.remove(type, callback),
295
292
  updateConfig: (config) => configManager.update(config),
296
293
  version,
297
- clearStorage: () => {
298
- clientIdManager.clear();
299
- },
300
294
  };
301
295
  }
302
296
 
@@ -1,7 +1,6 @@
1
1
  import { EnvironmentManager } from "../environment/manager/manager";
2
2
  export interface ClientIdManager {
3
3
  getClientId: () => string;
4
- clear: () => void;
5
4
  }
6
5
  export declare function createClientIdManager(environmentManager: EnvironmentManager): ClientIdManager;
7
6
  //# sourceMappingURL=client-id.d.ts.map
@@ -1 +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;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,kBAAkB,EAAE,kBAAkB,GACrC,eAAe,CAoBjB"}
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"}
@@ -56,11 +56,6 @@ interface Relay {
56
56
  * Current version of the Relay library.
57
57
  */
58
58
  version: string;
59
- /**
60
- * Removes the visitorId cookie and localStorage key.
61
- * @returns {void}
62
- */
63
- clearStorage: () => void;
64
59
  }
65
60
  /**
66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6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/relay",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "A library for sending analytics events using Coveo's Event protocol.",
5
5
  "files": [
6
6
  "lib/**/*"