@grafana/faro-core 1.7.2 → 1.7.3

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 (53) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/api/exceptions/types.d.ts +1 -0
  3. package/dist/bundle/types/metas/types.d.ts +3 -0
  4. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  5. package/dist/bundle/types/utils/index.d.ts +1 -0
  6. package/dist/bundle/types/utils/sourceMaps.d.ts +1 -0
  7. package/dist/bundle/types/version.d.ts +1 -1
  8. package/dist/cjs/api/exceptions/types.js.map +1 -1
  9. package/dist/cjs/metas/registerInitial.js +16 -1
  10. package/dist/cjs/metas/registerInitial.js.map +1 -1
  11. package/dist/cjs/metas/types.js.map +1 -1
  12. package/dist/cjs/utils/index.js +3 -1
  13. package/dist/cjs/utils/index.js.map +1 -1
  14. package/dist/cjs/utils/sourceMaps.js +9 -0
  15. package/dist/cjs/utils/sourceMaps.js.map +1 -0
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/cjs/version.js.map +1 -1
  18. package/dist/esm/api/exceptions/types.js.map +1 -1
  19. package/dist/esm/metas/registerInitial.js +5 -1
  20. package/dist/esm/metas/registerInitial.js.map +1 -1
  21. package/dist/esm/metas/types.js.map +1 -1
  22. package/dist/esm/utils/index.js +1 -0
  23. package/dist/esm/utils/index.js.map +1 -1
  24. package/dist/esm/utils/sourceMaps.js +5 -0
  25. package/dist/esm/utils/sourceMaps.js.map +1 -0
  26. package/dist/esm/version.js +1 -1
  27. package/dist/esm/version.js.map +1 -1
  28. package/dist/spec/core/src/api/exceptions/types.js.map +1 -1
  29. package/dist/spec/core/src/metas/registerInitial.js +16 -1
  30. package/dist/spec/core/src/metas/registerInitial.js.map +1 -1
  31. package/dist/spec/core/src/metas/types.js.map +1 -1
  32. package/dist/spec/core/src/utils/index.js +3 -1
  33. package/dist/spec/core/src/utils/index.js.map +1 -1
  34. package/dist/spec/core/src/utils/sourceMaps.js +9 -0
  35. package/dist/spec/core/src/utils/sourceMaps.js.map +1 -0
  36. package/dist/spec/core/src/utils/sourceMaps.test.js +17 -0
  37. package/dist/spec/core/src/utils/sourceMaps.test.js.map +1 -0
  38. package/dist/spec/core/src/version.js +1 -1
  39. package/dist/spec/core/src/version.js.map +1 -1
  40. package/dist/types/api/exceptions/types.d.ts +1 -0
  41. package/dist/types/core/src/api/exceptions/types.d.ts +1 -0
  42. package/dist/types/core/src/metas/types.d.ts +3 -0
  43. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  44. package/dist/types/core/src/utils/index.d.ts +1 -0
  45. package/dist/types/core/src/utils/sourceMaps.d.ts +1 -0
  46. package/dist/types/core/src/utils/sourceMaps.test.d.ts +1 -0
  47. package/dist/types/core/src/version.d.ts +1 -1
  48. package/dist/types/metas/types.d.ts +3 -0
  49. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  50. package/dist/types/utils/index.d.ts +1 -0
  51. package/dist/types/utils/sourceMaps.d.ts +1 -0
  52. package/dist/types/version.d.ts +1 -1
  53. package/package.json +2 -2
@@ -1 +1 @@
1
- var GrafanaFaroCore=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function r(e,n){try{return e instanceof n}catch(e){return!1}}const a=e=>n(e,"null"),i=e=>n(e,"string"),o=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),s=e=>!a(e)&&n(e,"object"),l=e=>n(e,"function"),u=e=>t(e,"Array"),c="undefined"!=typeof Event,d="undefined"!=typeof Error,g="undefined"!=typeof Element,p="undefined"!=typeof Map;function f(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const r=u(e),a=u(t);if(r!==a)return!1;if(r&&a){const n=e.length;if(n!==t.length)return!1;for(let r=n;0!=r--;)if(!f(e[r],t[r]))return!1;return!0}const i=s(e),o=s(t);if(i!==o)return!1;if(e&&t&&i&&o){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;for(let r of n)if(!f(e[r],t[r]))return!1;return!0}return!1}function m(){return(new Date).toISOString()}var v;e.LogLevel=void 0,(v=e.LogLevel||(e.LogLevel={})).TRACE="trace",v.DEBUG="debug",v.INFO="info",v.LOG="log",v.WARN="warn",v.ERROR="error";const h=e.LogLevel.LOG,b=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function E(){}const y="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";class T{constructor(e,n){var t,r;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(r=null==n?void 0:n.sendTimeout)&&void 0!==r?r:250,this.paused=(null==n?void 0:n.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const n=new Map;return e.forEach((e=>{const t=JSON.stringify(e.meta);let r=n.get(t);r=void 0===r?[e]:[...r,e],n.set(t,r)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var I;e.TransportItemType=void 0,(I=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",I.LOG="log",I.MEASUREMENT="measurement",I.TRACE="trace",I.EVENT="event";const O={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function L(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,r=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>i(e)?n.includes(e):!!n.match(e)))}(n,r))return null}return t}}function S(e,n,t,r){var a;n.debug("Initializing transports");const i=[];let o=t.paused,s=[];const l=e=>{let n=e;for(const e of s){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of i)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)};let c;(null===(a=t.batching)||void 0===a?void 0:a.enabled)&&(c=new T(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:o}));return{add:(...a)=>{n.debug("Adding transports"),a.forEach((a=>{n.debug(`Adding "${a.name}" transport`);i.some((e=>e===a))?n.warn(`Transport ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=r,i.push(a))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",s),e.forEach((e=>{e&&s.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&s.push(L(e))}))},getBeforeSendHooks:()=>[...s],execute:e=>{var r;o||((null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(null==c||c.addItem(e)),(e=>{var r,a;if((null===(r=t.batching)||void 0===r?void 0:r.enabled)&&i.every((e=>e.isBatched())))return;const[o]=l([e]);if(void 0!==o)for(const e of i)n.debug(`Transporting item using ${e.name}\n`,o),e.isBatched()?(null===(a=t.batching)||void 0===a?void 0:a.enabled)||e.send([o]):e.send(o)})(e))},isPaused:()=>o,pause:()=>{n.debug("Pausing transports"),null==c||c.pause(),o=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=i.indexOf(e);-1!==t?i.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{s.filter((n=>!e.includes(n)))},get transports(){return[...i]},unpause:()=>{n.debug("Unpausing transports"),null==c||c.start(),o=!1}}}var N;e.InternalLoggerLevel=void 0,(N=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[N.OFF=0]="OFF",N[N.ERROR=1]="ERROR",N[N.WARN=2]="WARN",N[N.INFO=3]="INFO",N[N.VERBOSE=4]="VERBOSE";const x={debug:E,error:E,info:E,prefix:"Faro",warn:E},R=e.InternalLoggerLevel.ERROR,A=Object.assign({},console);let j=A;function C(e){var n;return j=null!==(n=e.unpatchedConsole)&&void 0!==n?n:j,j}function k(n=A,t=R){const r=x;return t>e.InternalLoggerLevel.OFF&&(r.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${r.prefix}\n`,...e)}:E,r.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${r.prefix}\n`,...e)}:E,r.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${r.prefix}\n`,...e)}:E,r.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${r.prefix}\n`,...e)}:E),r}let w=x;function _(e,n){return w=k(e,n.internalLoggerLevel),w}class P{constructor(){this.unpatchedConsole=A,this.internalLogger=x,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}function B(e,n){var t,r;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const a=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===a)return e;const i=(null==a?void 0:a.scopeSpans)||[],o=(null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},a),{scopeSpans:[...i,...o]})]})}const F="Error";let D;function G(n,t,r,i,o){t.debug("Initializing API");const s=function(n,t,r,a,i){let o;return t.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,n)=>{t.debug("Initializing OpenTelemetry"),o={trace:e,context:n}},isOTELInitialized:()=>!!o,pushTraces:n=>{try{const r={type:e.TransportItemType.TRACE,payload:n,meta:a.value};t.debug("Pushing trace\n",r),i.execute(r)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,i,o);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s),function(n,t,r,i,o,s){var l;t.debug("Initializing exceptions API");let u=null;D=null!==(l=r.parseStacktrace)&&void 0!==l?l:D;const c=e=>{t.debug("Changing stacktrace parser"),D=null!=e?e:D};return c(r.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>D,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:g,spanContext:p}={})=>{d=d||n.name||F;const v={meta:i.value,payload:{type:d,value:n.message,timestamp:m(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext(),context:null!=g?g:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==D?void 0:D(n).frames:void 0)?void 0:c.length)&&(v.payload.stacktrace={frames:c});const h={type:v.payload.type,value:v.payload.value,stackTrace:v.payload.stacktrace,context:v.payload.context};l||!r.dedupe||a(u)||!f(h,u)?(u=h,t.debug("Pushing exception\n",v),o.execute(v)):t.debug("Skipping error push because it is the same as the last one\n",v.payload)}}}(0,t,r,i,o,s)),function(e,n,t,r,a){let i,o,s;n.debug("Initializing meta API");const l=e=>{o&&r.remove(o),o={user:e},r.add(o)},u=e=>{i&&r.remove(i),i={session:e},r.add(i)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>r.value.session,setView:e=>{var n;if((null===(n=null==s?void 0:s.view)||void 0===n?void 0:n.name)===(null==e?void 0:e.name))return;const t=s;s={view:e},r.add(s),t&&r.remove(t)},getView:()=>r.value.view}}(0,t,0,i)),function(n,t,r,i,o,s){var l;t.debug("Initializing logs API");let u=null;const c=null!==(l=r.logArgsSerializer)&&void 0!==l?l:e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");return{pushLog:(n,{context:l,level:d,skipDedupe:g,spanContext:p}={})=>{try{const v={type:e.TransportItemType.LOG,payload:{message:c(n),level:null!=d?d:h,context:null!=l?l:{},timestamp:m(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext()},meta:i.value},b={message:v.payload.message,level:v.payload.level,context:v.payload.context};if(!g&&r.dedupe&&!a(u)&&f(b,u))return void t.debug("Skipping log push because it is the same as the last one\n",v.payload);u=b,t.debug("Pushing log\n",v),o.execute(v)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,r,i,o,s)),function(n,t,r,i,o,s){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c,spanContext:d}={})=>{var g;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:s.getTraceContext(),timestamp:null!==(g=n.timestamp)&&void 0!==g?g:m(),context:null!=c?c:{}}),meta:i.value},v={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&r.dedupe&&!a(l)&&f(v,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=v,t.debug("Pushing measurement\n",p),o.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,r,i,o,s)),function(n,t,r,i,o,s){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d,spanContext:g}={})=>{try{const p={meta:i.value,payload:{name:n,domain:null!=c?c:r.eventDomain,attributes:u,timestamp:m(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:s.getTraceContext()},type:e.TransportItemType.EVENT},v={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&r.dedupe&&!a(l)&&f(v,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=v,t.debug("Pushing event\n",p),o.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,r,i,o,s))}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;const V="1.7.2";const M="_faroInternal";function z(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty($,M,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function U(){return M in $}function K(n,t,r,a,i,o,s){return t.debug("Initializing Faro"),e.faro={api:o,config:r,instrumentations:s,internalLogger:t,metas:a,pause:i.pause,transports:i,unpatchedConsole:n,unpause:i.unpause},z(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in $)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty($,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};return e.BaseExtension=P,e.BaseInstrumentation=class extends P{constructor(){super(...arguments),this.api={},this.transports={}}},e.BaseTransport=class extends P{isBatched(){return!1}getIgnoreUrls(){return[]}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND="session_extend",e.EVENT_SESSION_RESUME="session_resume",e.EVENT_SESSION_START="session_start",e.EVENT_VIEW_CHANGED="view_changed",e.VERSION=V,e.allLogLevels=b,e.createInternalLogger=k,e.createPromiseBuffer=function(e){const{size:n,concurrency:t}=e,r=[];let a=0;const i=()=>{if(a<t&&r.length){const{producer:e,resolve:n,reject:t}=r.shift();a++,e().then((e=>{a--,i(),n(e)}),(e=>{a--,i(),t(e)}))}};return{add:e=>{if(r.length+a>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{r.push({producer:e,resolve:n,reject:t}),i()}))}}},e.dateNow=function(){return Date.now()},e.deepEqual=f,e.defaultBatchingConfig={enabled:!0,sendTimeout:250,itemLimit:50},e.defaultExceptionType=F,e.defaultGlobalObjectKey="faro",e.defaultInternalLoggerLevel=R,e.defaultLogLevel=h,e.defaultUnpatchedConsole=A,e.genShortID=function(e=10){return Array.from(Array(e)).map((()=>y[Math.floor(Math.random()*y.length)])).join("")},e.getCurrentTimestamp=m,e.getInternalFaroFromGlobalObject=function(){return $[M]},e.getTransportBody=function(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const r=O[n.type],a=t[r];t=Object.assign(Object.assign({},t),{[r]:void 0===a?[n.payload]:[...a,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:B(t.traces,n.payload.resourceSpans)})}})),t},e.globalObject=$,e.initializeFaro=function(e){const n=C(e),t=_(n,e);if(U()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const r=function(e,n,t){let r=[],a=[];const i=()=>r.reduce(((e,n)=>Object.assign(e,l(n)?n():n)),{}),o=()=>{if(a.length){const e=i();a.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),r.push(...e),o()},remove:(...e)=>{n.debug("Removing metas\n",e),r=r.filter((n=>!e.includes(n))),o()},addListener:e=>{n.debug("Adding metas listener\n",e),a.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),a=a.filter((n=>n!==e))},get value(){return i()}}}(0,t),a=S(n,t,e,r),i=G(0,t,e,r,a),o=function(e,n,t,r,a,i){n.debug("Initializing instrumentations");const o=[];return{add:(...s)=>{n.debug("Adding instrumentations"),s.forEach((s=>{n.debug(`Adding "${s.name}" instrumentation`),o.some((e=>e.name===s.name))?n.warn(`Instrumentation ${s.name} is already added`):(s.unpatchedConsole=e,s.internalLogger=n,s.config=t,s.metas=r,s.transports=a,s.api=i,o.push(s),s.initialize())}))},get instrumentations(){return[...o]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,r;n.debug(`Removing "${e.name}" instrumentation`);const a=o.reduce(((n,t,r)=>null===n&&t.name===e.name?r:null),null);a?(null===(r=(t=o[a]).destroy)||void 0===r||r.call(t),o.splice(a,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,r,a,i),s=K(n,t,e,r,a,i,o);return function(e){var n,t;const r={sdk:{version:V}},a=null===(n=e.config.sessionTracking)||void 0===n?void 0:n.session;a&&e.api.setSession(a),e.config.app&&(r.app=e.config.app),e.config.user&&(r.user=e.config.user),e.config.view&&(r.view=e.config.view),e.metas.add(r,...null!==(t=e.config.metas)&&void 0!==t?t:[])}(s),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(s),function(e){e.instrumentations.add(...e.config.instrumentations)}(s),s},e.internalGlobalObjectKey=M,e.isArray=u,e.isBoolean=e=>n(e,"boolean"),e.isDomError=e=>t(e,"DOMError"),e.isDomException=e=>t(e,"DOMException"),e.isElement=e=>g&&r(e,Element),e.isElementDefined=g,e.isError=e=>d&&r(e,Error),e.isErrorDefined=d,e.isErrorEvent=e=>t(e,"ErrorEvent"),e.isEvent=e=>c&&r(e,Event),e.isEventDefined=c,e.isFunction=l,e.isInstanceOf=r,e.isInt=e=>o(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=U,e.isMap=e=>p&&r(e,Map),e.isMapDefined=p,e.isNull=a,e.isNumber=o,e.isObject=s,e.isPrimitive=e=>!s(e)&&!l(e),e.isRegExp=e=>t(e,"RegExp"),e.isString=i,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>s(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>l(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=e=>n(e,"undefined"),e.noop=E,e.setInternalFaroOnGlobalObject=z,e.transportItemTypeToBodyKey=O,e}({});
1
+ var GrafanaFaroCore=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function r(e,n){try{return e instanceof n}catch(e){return!1}}const a=e=>n(e,"null"),i=e=>n(e,"string"),o=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),s=e=>!a(e)&&n(e,"object"),l=e=>n(e,"function"),u=e=>t(e,"Array"),c="undefined"!=typeof Event,d="undefined"!=typeof Error,g="undefined"!=typeof Element,p="undefined"!=typeof Map;function f(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const r=u(e),a=u(t);if(r!==a)return!1;if(r&&a){const n=e.length;if(n!==t.length)return!1;for(let r=n;0!=r--;)if(!f(e[r],t[r]))return!1;return!0}const i=s(e),o=s(t);if(i!==o)return!1;if(e&&t&&i&&o){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;for(let r of n)if(!f(e[r],t[r]))return!1;return!0}return!1}function m(){return(new Date).toISOString()}var v;e.LogLevel=void 0,(v=e.LogLevel||(e.LogLevel={})).TRACE="trace",v.DEBUG="debug",v.INFO="info",v.LOG="log",v.WARN="warn",v.ERROR="error";const b=e.LogLevel.LOG,h=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function E(){}const y="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class T{constructor(e,n){var t,r;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(r=null==n?void 0:n.sendTimeout)&&void 0!==r?r:250,this.paused=(null==n?void 0:n.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const n=new Map;return e.forEach((e=>{const t=JSON.stringify(e.meta);let r=n.get(t);r=void 0===r?[e]:[...r,e],n.set(t,r)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var O;e.TransportItemType=void 0,(O=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",O.LOG="log",O.MEASUREMENT="measurement",O.TRACE="trace",O.EVENT="event";const L={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function S(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,r=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>i(e)?n.includes(e):!!n.match(e)))}(n,r))return null}return t}}function N(e,n,t,r){var a;n.debug("Initializing transports");const i=[];let o=t.paused,s=[];const l=e=>{let n=e;for(const e of s){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of i)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)};let c;(null===(a=t.batching)||void 0===a?void 0:a.enabled)&&(c=new T(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:o}));return{add:(...a)=>{n.debug("Adding transports"),a.forEach((a=>{n.debug(`Adding "${a.name}" transport`);i.some((e=>e===a))?n.warn(`Transport ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=r,i.push(a))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",s),e.forEach((e=>{e&&s.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&s.push(S(e))}))},getBeforeSendHooks:()=>[...s],execute:e=>{var r;o||((null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(null==c||c.addItem(e)),(e=>{var r,a;if((null===(r=t.batching)||void 0===r?void 0:r.enabled)&&i.every((e=>e.isBatched())))return;const[o]=l([e]);if(void 0!==o)for(const e of i)n.debug(`Transporting item using ${e.name}\n`,o),e.isBatched()?(null===(a=t.batching)||void 0===a?void 0:a.enabled)||e.send([o]):e.send(o)})(e))},isPaused:()=>o,pause:()=>{n.debug("Pausing transports"),null==c||c.pause(),o=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=i.indexOf(e);-1!==t?i.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{s.filter((n=>!e.includes(n)))},get transports(){return[...i]},unpause:()=>{n.debug("Unpausing transports"),null==c||c.start(),o=!1}}}var x;e.InternalLoggerLevel=void 0,(x=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[x.OFF=0]="OFF",x[x.ERROR=1]="ERROR",x[x.WARN=2]="WARN",x[x.INFO=3]="INFO",x[x.VERBOSE=4]="VERBOSE";const R={debug:E,error:E,info:E,prefix:"Faro",warn:E},j=e.InternalLoggerLevel.ERROR,A=Object.assign({},console);let C=A;function k(e){var n;return C=null!==(n=e.unpatchedConsole)&&void 0!==n?n:C,C}function _(n=A,t=j){const r=R;return t>e.InternalLoggerLevel.OFF&&(r.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${r.prefix}\n`,...e)}:E,r.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${r.prefix}\n`,...e)}:E,r.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${r.prefix}\n`,...e)}:E,r.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${r.prefix}\n`,...e)}:E),r}let w=R;function P(e,n){return w=_(e,n.internalLoggerLevel),w}class B{constructor(){this.unpatchedConsole=A,this.internalLogger=R,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}function F(e,n){var t,r;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const a=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===a)return e;const i=(null==a?void 0:a.scopeSpans)||[],o=(null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},a),{scopeSpans:[...i,...o]})]})}const D="Error";let $;function G(n,t,r,i,o){t.debug("Initializing API");const s=function(n,t,r,a,i){let o;return t.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,n)=>{t.debug("Initializing OpenTelemetry"),o={trace:e,context:n}},isOTELInitialized:()=>!!o,pushTraces:n=>{try{const r={type:e.TransportItemType.TRACE,payload:n,meta:a.value};t.debug("Pushing trace\n",r),i.execute(r)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,i,o);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s),function(n,t,r,i,o,s){var l;t.debug("Initializing exceptions API");let u=null;$=null!==(l=r.parseStacktrace)&&void 0!==l?l:$;const c=e=>{t.debug("Changing stacktrace parser"),$=null!=e?e:$};return c(r.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>$,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:g,spanContext:p}={})=>{d=d||n.name||D;const v={meta:i.value,payload:{type:d,value:n.message,timestamp:m(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext(),context:null!=g?g:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==$?void 0:$(n).frames:void 0)?void 0:c.length)&&(v.payload.stacktrace={frames:c});const b={type:v.payload.type,value:v.payload.value,stackTrace:v.payload.stacktrace,context:v.payload.context};l||!r.dedupe||a(u)||!f(b,u)?(u=b,t.debug("Pushing exception\n",v),o.execute(v)):t.debug("Skipping error push because it is the same as the last one\n",v.payload)}}}(0,t,r,i,o,s)),function(e,n,t,r,a){let i,o,s;n.debug("Initializing meta API");const l=e=>{o&&r.remove(o),o={user:e},r.add(o)},u=e=>{i&&r.remove(i),i={session:e},r.add(i)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>r.value.session,setView:e=>{var n;if((null===(n=null==s?void 0:s.view)||void 0===n?void 0:n.name)===(null==e?void 0:e.name))return;const t=s;s={view:e},r.add(s),t&&r.remove(t)},getView:()=>r.value.view}}(0,t,0,i)),function(n,t,r,i,o,s){var l;t.debug("Initializing logs API");let u=null;const c=null!==(l=r.logArgsSerializer)&&void 0!==l?l:e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");return{pushLog:(n,{context:l,level:d,skipDedupe:g,spanContext:p}={})=>{try{const v={type:e.TransportItemType.LOG,payload:{message:c(n),level:null!=d?d:b,context:null!=l?l:{},timestamp:m(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext()},meta:i.value},h={message:v.payload.message,level:v.payload.level,context:v.payload.context};if(!g&&r.dedupe&&!a(u)&&f(h,u))return void t.debug("Skipping log push because it is the same as the last one\n",v.payload);u=h,t.debug("Pushing log\n",v),o.execute(v)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,r,i,o,s)),function(n,t,r,i,o,s){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c,spanContext:d}={})=>{var g;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:s.getTraceContext(),timestamp:null!==(g=n.timestamp)&&void 0!==g?g:m(),context:null!=c?c:{}}),meta:i.value},v={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&r.dedupe&&!a(l)&&f(v,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=v,t.debug("Pushing measurement\n",p),o.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,r,i,o,s)),function(n,t,r,i,o,s){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d,spanContext:g}={})=>{try{const p={meta:i.value,payload:{name:n,domain:null!=c?c:r.eventDomain,attributes:u,timestamp:m(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:s.getTraceContext()},type:e.TransportItemType.EVENT},v={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&r.dedupe&&!a(l)&&f(v,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=v,t.debug("Pushing event\n",p),o.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,r,i,o,s))}const V="1.7.3";const M="_faroInternal";function z(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(I,M,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function U(){return M in I}function K(n,t,r,a,i,o,s){return t.debug("Initializing Faro"),e.faro={api:o,config:r,instrumentations:s,internalLogger:t,metas:a,pause:i.pause,transports:i,unpatchedConsole:n,unpause:i.unpause},z(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in I)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(I,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};return e.BaseExtension=B,e.BaseInstrumentation=class extends B{constructor(){super(...arguments),this.api={},this.transports={}}},e.BaseTransport=class extends B{isBatched(){return!1}getIgnoreUrls(){return[]}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND="session_extend",e.EVENT_SESSION_RESUME="session_resume",e.EVENT_SESSION_START="session_start",e.EVENT_VIEW_CHANGED="view_changed",e.VERSION=V,e.allLogLevels=h,e.createInternalLogger=_,e.createPromiseBuffer=function(e){const{size:n,concurrency:t}=e,r=[];let a=0;const i=()=>{if(a<t&&r.length){const{producer:e,resolve:n,reject:t}=r.shift();a++,e().then((e=>{a--,i(),n(e)}),(e=>{a--,i(),t(e)}))}};return{add:e=>{if(r.length+a>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{r.push({producer:e,resolve:n,reject:t}),i()}))}}},e.dateNow=function(){return Date.now()},e.deepEqual=f,e.defaultBatchingConfig={enabled:!0,sendTimeout:250,itemLimit:50},e.defaultExceptionType=D,e.defaultGlobalObjectKey="faro",e.defaultInternalLoggerLevel=j,e.defaultLogLevel=b,e.defaultUnpatchedConsole=A,e.genShortID=function(e=10){return Array.from(Array(e)).map((()=>y[Math.floor(Math.random()*y.length)])).join("")},e.getCurrentTimestamp=m,e.getInternalFaroFromGlobalObject=function(){return I[M]},e.getTransportBody=function(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const r=L[n.type],a=t[r];t=Object.assign(Object.assign({},t),{[r]:void 0===a?[n.payload]:[...a,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:F(t.traces,n.payload.resourceSpans)})}})),t},e.globalObject=I,e.initializeFaro=function(e){const n=k(e),t=P(n,e);if(U()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const r=function(e,n,t){let r=[],a=[];const i=()=>r.reduce(((e,n)=>Object.assign(e,l(n)?n():n)),{}),o=()=>{if(a.length){const e=i();a.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),r.push(...e),o()},remove:(...e)=>{n.debug("Removing metas\n",e),r=r.filter((n=>!e.includes(n))),o()},addListener:e=>{n.debug("Adding metas listener\n",e),a.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),a=a.filter((n=>n!==e))},get value(){return i()}}}(0,t),a=N(n,t,e,r),i=G(0,t,e,r,a),o=function(e,n,t,r,a,i){n.debug("Initializing instrumentations");const o=[];return{add:(...s)=>{n.debug("Adding instrumentations"),s.forEach((s=>{n.debug(`Adding "${s.name}" instrumentation`),o.some((e=>e.name===s.name))?n.warn(`Instrumentation ${s.name} is already added`):(s.unpatchedConsole=e,s.internalLogger=n,s.config=t,s.metas=r,s.transports=a,s.api=i,o.push(s),s.initialize())}))},get instrumentations(){return[...o]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,r;n.debug(`Removing "${e.name}" instrumentation`);const a=o.reduce(((n,t,r)=>null===n&&t.name===e.name?r:null),null);a?(null===(r=(t=o[a]).destroy)||void 0===r||r.call(t),o.splice(a,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,r,a,i),s=K(n,t,e,r,a,i,o);return function(e){var n,t;const r={sdk:{version:V},app:{bundleId:e.config.app.name&&(a=e.config.app.name,null==I?void 0:I[`__faroBundleId_${a}`])}};var a;const i=null===(n=e.config.sessionTracking)||void 0===n?void 0:n.session;i&&e.api.setSession(i),e.config.app&&(r.app=Object.assign(Object.assign({},e.config.app),r.app)),e.config.user&&(r.user=e.config.user),e.config.view&&(r.view=e.config.view),e.metas.add(r,...null!==(t=e.config.metas)&&void 0!==t?t:[])}(s),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(s),function(e){e.instrumentations.add(...e.config.instrumentations)}(s),s},e.internalGlobalObjectKey=M,e.isArray=u,e.isBoolean=e=>n(e,"boolean"),e.isDomError=e=>t(e,"DOMError"),e.isDomException=e=>t(e,"DOMException"),e.isElement=e=>g&&r(e,Element),e.isElementDefined=g,e.isError=e=>d&&r(e,Error),e.isErrorDefined=d,e.isErrorEvent=e=>t(e,"ErrorEvent"),e.isEvent=e=>c&&r(e,Event),e.isEventDefined=c,e.isFunction=l,e.isInstanceOf=r,e.isInt=e=>o(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=U,e.isMap=e=>p&&r(e,Map),e.isMapDefined=p,e.isNull=a,e.isNumber=o,e.isObject=s,e.isPrimitive=e=>!s(e)&&!l(e),e.isRegExp=e=>t(e,"RegExp"),e.isString=i,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>s(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>l(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=e=>n(e,"undefined"),e.noop=E,e.setInternalFaroOnGlobalObject=z,e.transportItemTypeToBodyKey=L,e}({});
@@ -6,6 +6,7 @@ export interface ExceptionStackFrame {
6
6
  function: string;
7
7
  colno?: number;
8
8
  lineno?: number;
9
+ bundleid?: string;
9
10
  }
10
11
  export interface ExtendedError extends Error {
11
12
  columnNumber?: number;
@@ -23,6 +23,7 @@ export interface MetaApp {
23
23
  release?: string;
24
24
  version?: string;
25
25
  environment?: string;
26
+ bundleId?: string;
26
27
  }
27
28
  export interface MetaUser {
28
29
  email?: string;
@@ -51,6 +52,8 @@ export interface MetaBrowser {
51
52
  userAgent?: string;
52
53
  language?: string;
53
54
  brands?: NavigatorUABrandVersion[] | string;
55
+ viewportWidth?: string;
56
+ viewportHeight?: string;
54
57
  }
55
58
  export interface MetaView {
56
59
  name: string;
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.7.2";
7
+ readonly version = "1.7.3";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -8,4 +8,5 @@ export { noop } from './noop';
8
8
  export { createPromiseBuffer } from './promiseBuffer';
9
9
  export type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';
10
10
  export { genShortID } from './shortId';
11
+ export { getBundleId } from './sourceMaps';
11
12
  export { dateNow } from './date';
@@ -0,0 +1 @@
1
+ export declare function getBundleId(appName: string): string | undefined;
@@ -1 +1 @@
1
- export declare const VERSION = "1.7.2";
1
+ export declare const VERSION = "1.7.3";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n\n bundleid?: string;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
14
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
15
  if (ar || !(i in from)) {
@@ -10,6 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
10
21
  };
11
22
  Object.defineProperty(exports, "__esModule", { value: true });
12
23
  exports.registerInitialMetas = void 0;
24
+ var sourceMaps_1 = require("../utils/sourceMaps");
13
25
  var version_1 = require("../version");
14
26
  function registerInitialMetas(faro) {
15
27
  var _a;
@@ -18,13 +30,16 @@ function registerInitialMetas(faro) {
18
30
  sdk: {
19
31
  version: version_1.VERSION,
20
32
  },
33
+ app: {
34
+ bundleId: faro.config.app.name && (0, sourceMaps_1.getBundleId)(faro.config.app.name),
35
+ },
21
36
  };
22
37
  var session = (_b = faro.config.sessionTracking) === null || _b === void 0 ? void 0 : _b.session;
23
38
  if (session) {
24
39
  faro.api.setSession(session);
25
40
  }
26
41
  if (faro.config.app) {
27
- initial.app = faro.config.app;
42
+ initial.app = __assign(__assign({}, faro.config.app), initial.app);
28
43
  }
29
44
  if (faro.config.user) {
30
45
  initial.user = faro.config.user;
@@ -1 +1 @@
1
- {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,iBAAO;SACjB;KACF,CAAC;IAEF,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;KAC/B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AAzBD,oDAyBC","sourcesContent":["import type { Faro } from '../sdk';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = faro.config.app;\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
1
+ {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAkD;AAClD,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,iBAAO;SACjB;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,IAAA,wBAAW,EAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACpE;KACF,CAAC;IAEF,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,yBAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,GAAK,OAAO,CAAC,GAAG,CAAE,CAAC;KACtD;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AA5BD,oDA4BC","sourcesContent":["import type { Faro } from '../sdk';\nimport { getBundleId } from '../utils/sourceMaps';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n app: {\n bundleId: faro.config.app.name && getBundleId(faro.config.app.name),\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = { ...faro.config.app, ...initial.app };\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n bundleId?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n viewportWidth?: string;\n viewportHeight?: string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateNow = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
3
+ exports.dateNow = exports.getBundleId = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
4
4
  var deepEqual_1 = require("./deepEqual");
5
5
  Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return deepEqual_1.deepEqual; } });
6
6
  var getCurrentTimestamp_1 = require("./getCurrentTimestamp");
@@ -44,6 +44,8 @@ var promiseBuffer_1 = require("./promiseBuffer");
44
44
  Object.defineProperty(exports, "createPromiseBuffer", { enumerable: true, get: function () { return promiseBuffer_1.createPromiseBuffer; } });
45
45
  var shortId_1 = require("./shortId");
46
46
  Object.defineProperty(exports, "genShortID", { enumerable: true, get: function () { return shortId_1.genShortID; } });
47
+ var sourceMaps_1 = require("./sourceMaps");
48
+ Object.defineProperty(exports, "getBundleId", { enumerable: true, get: function () { return sourceMaps_1.getBundleId; } });
47
49
  var date_1 = require("./date");
48
50
  Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return date_1.dateNow; } });
49
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { dateNow } from './date';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBundleId = void 0;
4
+ var globalObject_1 = require("../globalObject");
5
+ function getBundleId(appName) {
6
+ return globalObject_1.globalObject === null || globalObject_1.globalObject === void 0 ? void 0 : globalObject_1.globalObject["__faroBundleId_".concat(appName)];
7
+ }
8
+ exports.getBundleId = getBundleId;
9
+ //# sourceMappingURL=sourceMaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../src/utils/sourceMaps.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAE/C,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAQ,2BAAoB,aAApB,2BAAY,uBAAZ,2BAAY,CAAW,yBAAkB,OAAO,CAAE,CAAC,CAAC;AAC9D,CAAC;AAFD,kCAEC","sourcesContent":["import { globalObject } from '../globalObject';\n\nexport function getBundleId(appName: string): string | undefined {\n return (globalObject as any)?.[`__faroBundleId_${appName}`];\n}\n"]}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // auto-generated by bin/genVersion.ts
5
- exports.VERSION = '1.7.2';
5
+ exports.VERSION = '1.7.3';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.2';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.3';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n\n bundleid?: string;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { getBundleId } from '../utils/sourceMaps';
1
2
  import { VERSION } from '../version';
2
3
  export function registerInitialMetas(faro) {
3
4
  var _a, _b;
@@ -5,13 +6,16 @@ export function registerInitialMetas(faro) {
5
6
  sdk: {
6
7
  version: VERSION,
7
8
  },
9
+ app: {
10
+ bundleId: faro.config.app.name && getBundleId(faro.config.app.name),
11
+ },
8
12
  };
9
13
  const session = (_a = faro.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.session;
10
14
  if (session) {
11
15
  faro.api.setSession(session);
12
16
  }
13
17
  if (faro.config.app) {
14
- initial.app = faro.config.app;
18
+ initial.app = Object.assign(Object.assign({}, faro.config.app), initial.app);
15
19
  }
16
20
  if (faro.config.user) {
17
21
  initial.user = faro.config.user;
@@ -1 +1 @@
1
- {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,MAAM,UAAU,oBAAoB,CAAC,IAAU;;IAC7C,MAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,OAAO;SACjB;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;KAC/B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import type { Faro } from '../sdk';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = faro.config.app;\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
1
+ {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,MAAM,UAAU,oBAAoB,CAAC,IAAU;;IAC7C,MAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,OAAO;SACjB;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACpE;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,mCAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,GAAK,OAAO,CAAC,GAAG,CAAE,CAAC;KACtD;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import type { Faro } from '../sdk';\nimport { getBundleId } from '../utils/sourceMaps';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n app: {\n bundleId: faro.config.app.name && getBundleId(faro.config.app.name),\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = { ...faro.config.app, ...initial.app };\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n bundleId?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n viewportWidth?: string;\n viewportHeight?: string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
@@ -5,5 +5,6 @@ export { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';
5
5
  export { noop } from './noop';
6
6
  export { createPromiseBuffer } from './promiseBuffer';
7
7
  export { genShortID } from './shortId';
8
+ export { getBundleId } from './sourceMaps';
8
9
  export { dateNow } from './date';
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { dateNow } from './date';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n"]}
@@ -0,0 +1,5 @@
1
+ import { globalObject } from '../globalObject';
2
+ export function getBundleId(appName) {
3
+ return globalObject === null || globalObject === void 0 ? void 0 : globalObject[`__faroBundleId_${appName}`];
4
+ }
5
+ //# sourceMappingURL=sourceMaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../src/utils/sourceMaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAQ,YAAoB,aAApB,YAAY,uBAAZ,YAAY,CAAW,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { globalObject } from '../globalObject';\n\nexport function getBundleId(appName: string): string | undefined {\n return (globalObject as any)?.[`__faroBundleId_${appName}`];\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  // auto-generated by bin/genVersion.ts
2
- export const VERSION = '1.7.2';
2
+ export const VERSION = '1.7.3';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.2';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.3';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n\n bundleid?: string;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
14
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
15
  if (ar || !(i in from)) {
@@ -10,6 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
10
21
  };
11
22
  Object.defineProperty(exports, "__esModule", { value: true });
12
23
  exports.registerInitialMetas = void 0;
24
+ var sourceMaps_1 = require("../utils/sourceMaps");
13
25
  var version_1 = require("../version");
14
26
  function registerInitialMetas(faro) {
15
27
  var _a;
@@ -18,13 +30,16 @@ function registerInitialMetas(faro) {
18
30
  sdk: {
19
31
  version: version_1.VERSION,
20
32
  },
33
+ app: {
34
+ bundleId: faro.config.app.name && (0, sourceMaps_1.getBundleId)(faro.config.app.name),
35
+ },
21
36
  };
22
37
  var session = (_b = faro.config.sessionTracking) === null || _b === void 0 ? void 0 : _b.session;
23
38
  if (session) {
24
39
  faro.api.setSession(session);
25
40
  }
26
41
  if (faro.config.app) {
27
- initial.app = faro.config.app;
42
+ initial.app = __assign(__assign({}, faro.config.app), initial.app);
28
43
  }
29
44
  if (faro.config.user) {
30
45
  initial.user = faro.config.user;
@@ -1 +1 @@
1
- {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,iBAAO;SACjB;KACF,CAAC;IAEF,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;KAC/B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AAzBD,oDAyBC","sourcesContent":["import type { Faro } from '../sdk';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = faro.config.app;\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
1
+ {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAkD;AAClD,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,iBAAO;SACjB;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,IAAA,wBAAW,EAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACpE;KACF,CAAC;IAEF,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,yBAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,GAAK,OAAO,CAAC,GAAG,CAAE,CAAC;KACtD;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AA5BD,oDA4BC","sourcesContent":["import type { Faro } from '../sdk';\nimport { getBundleId } from '../utils/sourceMaps';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n },\n app: {\n bundleId: faro.config.app.name && getBundleId(faro.config.app.name),\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = { ...faro.config.app, ...initial.app };\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n bundleId?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n viewportWidth?: string;\n viewportHeight?: string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateNow = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
3
+ exports.dateNow = exports.getBundleId = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
4
4
  var deepEqual_1 = require("./deepEqual");
5
5
  Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return deepEqual_1.deepEqual; } });
6
6
  var getCurrentTimestamp_1 = require("./getCurrentTimestamp");
@@ -44,6 +44,8 @@ var promiseBuffer_1 = require("./promiseBuffer");
44
44
  Object.defineProperty(exports, "createPromiseBuffer", { enumerable: true, get: function () { return promiseBuffer_1.createPromiseBuffer; } });
45
45
  var shortId_1 = require("./shortId");
46
46
  Object.defineProperty(exports, "genShortID", { enumerable: true, get: function () { return shortId_1.genShortID; } });
47
+ var sourceMaps_1 = require("./sourceMaps");
48
+ Object.defineProperty(exports, "getBundleId", { enumerable: true, get: function () { return sourceMaps_1.getBundleId; } });
47
49
  var date_1 = require("./date");
48
50
  Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return date_1.dateNow; } });
49
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { dateNow } from './date';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBundleId = void 0;
4
+ var globalObject_1 = require("../globalObject");
5
+ function getBundleId(appName) {
6
+ return globalObject_1.globalObject === null || globalObject_1.globalObject === void 0 ? void 0 : globalObject_1.globalObject["__faroBundleId_".concat(appName)];
7
+ }
8
+ exports.getBundleId = getBundleId;
9
+ //# sourceMappingURL=sourceMaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../../../src/utils/sourceMaps.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAE/C,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAQ,2BAAoB,aAApB,2BAAY,uBAAZ,2BAAY,CAAW,yBAAkB,OAAO,CAAE,CAAC,CAAC;AAC9D,CAAC;AAFD,kCAEC","sourcesContent":["import { globalObject } from '../globalObject';\n\nexport function getBundleId(appName: string): string | undefined {\n return (globalObject as any)?.[`__faroBundleId_${appName}`];\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var sourceMaps_1 = require("./sourceMaps");
4
+ describe('sourceMapUpload utils', function () {
5
+ beforeAll(function () {
6
+ delete global.__faroBundleId_foo;
7
+ });
8
+ afterAll(function () {
9
+ delete global.__faroBundleId_foo;
10
+ });
11
+ it('can get the bundle ID from the global object', function () {
12
+ expect((0, sourceMaps_1.getBundleId)('foo')).toBeUndefined();
13
+ global.__faroBundleId_foo = 'bar';
14
+ expect((0, sourceMaps_1.getBundleId)('foo')).toEqual('bar');
15
+ });
16
+ });
17
+ //# sourceMappingURL=sourceMaps.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.test.js","sourceRoot":"","sources":["../../../../../src/utils/sourceMaps.test.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAE3C,QAAQ,CAAC,uBAAuB,EAAE;IAChC,SAAS,CAAC;QACR,OAAQ,MAAc,CAAC,kBAAkB,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,OAAQ,MAAc,CAAC,kBAAkB,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE;QACjD,MAAM,CAAC,IAAA,wBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAE1C,MAAc,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAC3C,MAAM,CAAC,IAAA,wBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { getBundleId } from './sourceMaps';\n\ndescribe('sourceMapUpload utils', () => {\n beforeAll(() => {\n delete (global as any).__faroBundleId_foo;\n });\n\n afterAll(() => {\n delete (global as any).__faroBundleId_foo;\n });\n\n it('can get the bundle ID from the global object', () => {\n expect(getBundleId('foo')).toBeUndefined();\n\n (global as any).__faroBundleId_foo = 'bar';\n expect(getBundleId('foo')).toEqual('bar');\n });\n});\n"]}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // auto-generated by bin/genVersion.ts
5
- exports.VERSION = '1.7.2';
5
+ exports.VERSION = '1.7.3';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.2';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.7.3';\n"]}
@@ -6,6 +6,7 @@ export interface ExceptionStackFrame {
6
6
  function: string;
7
7
  colno?: number;
8
8
  lineno?: number;
9
+ bundleid?: string;
9
10
  }
10
11
  export interface ExtendedError extends Error {
11
12
  columnNumber?: number;
@@ -6,6 +6,7 @@ export interface ExceptionStackFrame {
6
6
  function: string;
7
7
  colno?: number;
8
8
  lineno?: number;
9
+ bundleid?: string;
9
10
  }
10
11
  export interface ExtendedError extends Error {
11
12
  columnNumber?: number;
@@ -23,6 +23,7 @@ export interface MetaApp {
23
23
  release?: string;
24
24
  version?: string;
25
25
  environment?: string;
26
+ bundleId?: string;
26
27
  }
27
28
  export interface MetaUser {
28
29
  email?: string;
@@ -51,6 +52,8 @@ export interface MetaBrowser {
51
52
  userAgent?: string;
52
53
  language?: string;
53
54
  brands?: NavigatorUABrandVersion[] | string;
55
+ viewportWidth?: string;
56
+ viewportHeight?: string;
54
57
  }
55
58
  export interface MetaView {
56
59
  name: string;
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.7.2";
7
+ readonly version = "1.7.3";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -8,4 +8,5 @@ export { noop } from './noop';
8
8
  export { createPromiseBuffer } from './promiseBuffer';
9
9
  export type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';
10
10
  export { genShortID } from './shortId';
11
+ export { getBundleId } from './sourceMaps';
11
12
  export { dateNow } from './date';
@@ -0,0 +1 @@
1
+ export declare function getBundleId(appName: string): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export declare const VERSION = "1.7.2";
1
+ export declare const VERSION = "1.7.3";
@@ -23,6 +23,7 @@ export interface MetaApp {
23
23
  release?: string;
24
24
  version?: string;
25
25
  environment?: string;
26
+ bundleId?: string;
26
27
  }
27
28
  export interface MetaUser {
28
29
  email?: string;
@@ -51,6 +52,8 @@ export interface MetaBrowser {
51
52
  userAgent?: string;
52
53
  language?: string;
53
54
  brands?: NavigatorUABrandVersion[] | string;
55
+ viewportWidth?: string;
56
+ viewportHeight?: string;
54
57
  }
55
58
  export interface MetaView {
56
59
  name: string;
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.7.2";
7
+ readonly version = "1.7.3";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -8,4 +8,5 @@ export { noop } from './noop';
8
8
  export { createPromiseBuffer } from './promiseBuffer';
9
9
  export type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';
10
10
  export { genShortID } from './shortId';
11
+ export { getBundleId } from './sourceMaps';
11
12
  export { dateNow } from './date';
@@ -0,0 +1 @@
1
+ export declare function getBundleId(appName: string): string | undefined;
@@ -1 +1 @@
1
- export declare const VERSION = "1.7.2";
1
+ export declare const VERSION = "1.7.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-core",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Core package of Faro.",
5
5
  "keywords": [
6
6
  "observability",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "1561e10c2a8e46fd765589d7aaf38e68731edd23"
60
+ "gitHead": "d2c5a7293a9bfc4ae9bb70292f14115ee3a923a4"
61
61
  }