@grafana/faro-core 1.0.0-beta3 → 1.0.0-beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/bundle/faro-core.iife.js +1 -0
- package/dist/cjs/utils/deepEqual.js +58 -5
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/version.js +2 -2
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +55 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/version.js +2 -2
- package/dist/esm/version.js.map +1 -1
- package/dist/{cjs → types}/api/events/index.d.ts +0 -0
- package/dist/{cjs → types}/api/events/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/events/types.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/const.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/index.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/types.d.ts +0 -0
- package/dist/{cjs → types}/api/index.d.ts +0 -0
- package/dist/{cjs → types}/api/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/logs/index.d.ts +0 -0
- package/dist/{cjs → types}/api/logs/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/logs/types.d.ts +0 -0
- package/dist/{cjs → types}/api/measurements/index.d.ts +0 -0
- package/dist/{cjs → types}/api/measurements/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/measurements/types.d.ts +0 -0
- package/dist/{cjs → types}/api/meta/index.d.ts +0 -0
- package/dist/{cjs → types}/api/meta/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/meta/types.d.ts +0 -0
- package/dist/{cjs → types}/api/traces/index.d.ts +0 -0
- package/dist/{cjs → types}/api/traces/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/traces/types.d.ts +0 -0
- package/dist/{cjs → types}/api/types.d.ts +0 -0
- package/dist/{cjs → types}/config/const.d.ts +0 -0
- package/dist/{cjs → types}/config/index.d.ts +0 -0
- package/dist/{cjs → types}/config/types.d.ts +0 -0
- package/dist/{cjs → types}/globalObject/globalObject.d.ts +0 -0
- package/dist/{cjs → types}/globalObject/index.d.ts +0 -0
- package/dist/{cjs → types}/index.d.ts +0 -0
- package/dist/{cjs → types}/initialize.d.ts +0 -0
- package/dist/{cjs → types}/instrumentations/base.d.ts +0 -0
- package/dist/{cjs → types}/instrumentations/index.d.ts +0 -0
- package/dist/{cjs → types}/instrumentations/initialize.d.ts +0 -0
- package/dist/{cjs → types}/instrumentations/types.d.ts +0 -0
- package/dist/{cjs → types}/internalLogger/const.d.ts +0 -0
- package/dist/{cjs → types}/internalLogger/createInternalLogger.d.ts +0 -0
- package/dist/{cjs → types}/internalLogger/index.d.ts +0 -0
- package/dist/{cjs → types}/internalLogger/initialize.d.ts +0 -0
- package/dist/{cjs → types}/internalLogger/types.d.ts +0 -0
- package/dist/{cjs → types}/metas/index.d.ts +0 -0
- package/dist/{cjs → types}/metas/initialize.d.ts +0 -0
- package/dist/{cjs → types}/metas/types.d.ts +0 -0
- package/dist/{cjs → types}/sdk/const.d.ts +0 -0
- package/dist/{cjs → types}/sdk/faroGlobalObject.d.ts +0 -0
- package/dist/{cjs → types}/sdk/index.d.ts +0 -0
- package/dist/{cjs → types}/sdk/internalFaroGlobalObject.d.ts +0 -0
- package/dist/{cjs → types}/sdk/register.d.ts +0 -0
- package/dist/{cjs → types}/sdk/types.d.ts +0 -0
- package/dist/{cjs → types}/semantic.d.ts +0 -0
- package/dist/{cjs → types}/testUtils/index.d.ts +0 -0
- package/dist/{cjs → types}/testUtils/mockConfig.d.ts +0 -0
- package/dist/{cjs → types}/testUtils/mockInternalLogger.d.ts +0 -0
- package/dist/{cjs → types}/testUtils/mockStacktraceParser.d.ts +0 -0
- package/dist/{cjs → types}/testUtils/mockTransport.d.ts +1 -1
- package/dist/{cjs → types}/testUtils/testPromise.d.ts +0 -0
- package/dist/{cjs → types}/transports/base.d.ts +0 -0
- package/dist/{cjs → types}/transports/const.d.ts +0 -0
- package/dist/{cjs → types}/transports/index.d.ts +0 -0
- package/dist/{cjs → types}/transports/initialize.d.ts +0 -0
- package/dist/{cjs → types}/transports/types.d.ts +0 -0
- package/dist/{cjs → types}/transports/utils.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/const.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/index.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/initialize.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/types.d.ts +0 -0
- package/dist/{cjs → types}/utils/baseObject.d.ts +0 -0
- package/dist/types/utils/deepEqual.d.ts +1 -0
- package/dist/{cjs → types}/utils/extensions.d.ts +0 -0
- package/dist/{cjs → types}/utils/getCurrentTimestamp.d.ts +0 -0
- package/dist/{cjs → types}/utils/index.d.ts +0 -0
- package/dist/{cjs → types}/utils/is.d.ts +0 -0
- package/dist/{cjs → types}/utils/logLevels.d.ts +0 -0
- package/dist/{cjs → types}/utils/noop.d.ts +0 -0
- package/dist/{cjs → types}/utils/promiseBuffer.d.ts +0 -0
- package/dist/{cjs → types}/utils/shortId.d.ts +0 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +20 -14
- package/dist/cjs/api/events/initialize.test.d.ts +0 -1
- package/dist/cjs/api/events/initialize.test.js +0 -92
- package/dist/cjs/api/events/initialize.test.js.map +0 -1
- package/dist/cjs/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/cjs/api/exceptions/initialize.test.js +0 -138
- package/dist/cjs/api/exceptions/initialize.test.js.map +0 -1
- package/dist/cjs/api/logs/initialize.test.d.ts +0 -1
- package/dist/cjs/api/logs/initialize.test.js +0 -88
- package/dist/cjs/api/logs/initialize.test.js.map +0 -1
- package/dist/cjs/api/measurements/initialize.test.d.ts +0 -1
- package/dist/cjs/api/measurements/initialize.test.js +0 -123
- package/dist/cjs/api/measurements/initialize.test.js.map +0 -1
- package/dist/cjs/faro.test.d.ts +0 -1
- package/dist/cjs/faro.test.js +0 -42
- package/dist/cjs/faro.test.js.map +0 -1
- package/dist/cjs/metas/initialize.test.d.ts +0 -1
- package/dist/cjs/metas/initialize.test.js +0 -21
- package/dist/cjs/metas/initialize.test.js.map +0 -1
- package/dist/cjs/transports/transports.test.d.ts +0 -1
- package/dist/cjs/transports/transports.test.js +0 -141
- package/dist/cjs/transports/transports.test.js.map +0 -1
- package/dist/cjs/utils/deepEqual.d.ts +0 -2
- package/dist/cjs/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/cjs/utils/promiseBuffer.test.js +0 -146
- package/dist/cjs/utils/promiseBuffer.test.js.map +0 -1
- package/dist/cjs/version.d.ts +0 -1
- package/dist/esm/api/events/index.d.ts +0 -2
- package/dist/esm/api/events/initialize.d.ts +0 -7
- package/dist/esm/api/events/initialize.test.d.ts +0 -1
- package/dist/esm/api/events/initialize.test.js +0 -87
- package/dist/esm/api/events/initialize.test.js.map +0 -1
- package/dist/esm/api/events/types.d.ts +0 -15
- package/dist/esm/api/exceptions/const.d.ts +0 -1
- package/dist/esm/api/exceptions/index.d.ts +0 -3
- package/dist/esm/api/exceptions/initialize.d.ts +0 -7
- package/dist/esm/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/esm/api/exceptions/initialize.test.js +0 -133
- package/dist/esm/api/exceptions/initialize.test.js.map +0 -1
- package/dist/esm/api/exceptions/types.d.ts +0 -32
- package/dist/esm/api/index.d.ts +0 -9
- package/dist/esm/api/initialize.d.ts +0 -6
- package/dist/esm/api/logs/index.d.ts +0 -2
- package/dist/esm/api/logs/initialize.d.ts +0 -7
- package/dist/esm/api/logs/initialize.test.d.ts +0 -1
- package/dist/esm/api/logs/initialize.test.js +0 -83
- package/dist/esm/api/logs/initialize.test.js.map +0 -1
- package/dist/esm/api/logs/types.d.ts +0 -18
- package/dist/esm/api/measurements/index.d.ts +0 -2
- package/dist/esm/api/measurements/initialize.d.ts +0 -7
- package/dist/esm/api/measurements/initialize.test.d.ts +0 -1
- package/dist/esm/api/measurements/initialize.test.js +0 -107
- package/dist/esm/api/measurements/initialize.test.js.map +0 -1
- package/dist/esm/api/measurements/types.d.ts +0 -16
- package/dist/esm/api/meta/index.d.ts +0 -2
- package/dist/esm/api/meta/initialize.d.ts +0 -6
- package/dist/esm/api/meta/types.d.ts +0 -8
- package/dist/esm/api/traces/index.d.ts +0 -2
- package/dist/esm/api/traces/initialize.d.ts +0 -6
- package/dist/esm/api/traces/types.d.ts +0 -20
- package/dist/esm/api/types.d.ts +0 -8
- package/dist/esm/config/const.d.ts +0 -1
- package/dist/esm/config/index.d.ts +0 -2
- package/dist/esm/config/types.d.ts +0 -26
- package/dist/esm/faro.test.d.ts +0 -1
- package/dist/esm/faro.test.js +0 -40
- package/dist/esm/faro.test.js.map +0 -1
- package/dist/esm/globalObject/globalObject.d.ts +0 -7
- package/dist/esm/globalObject/index.d.ts +0 -2
- package/dist/esm/index.d.ts +0 -22
- package/dist/esm/initialize.d.ts +0 -3
- package/dist/esm/instrumentations/base.d.ts +0 -5
- package/dist/esm/instrumentations/index.d.ts +0 -3
- package/dist/esm/instrumentations/initialize.d.ts +0 -4
- package/dist/esm/instrumentations/types.d.ts +0 -10
- package/dist/esm/internalLogger/const.d.ts +0 -11
- package/dist/esm/internalLogger/createInternalLogger.d.ts +0 -4
- package/dist/esm/internalLogger/index.d.ts +0 -4
- package/dist/esm/internalLogger/initialize.d.ts +0 -5
- package/dist/esm/internalLogger/types.d.ts +0 -7
- package/dist/esm/metas/index.d.ts +0 -2
- package/dist/esm/metas/initialize.d.ts +0 -4
- package/dist/esm/metas/initialize.test.d.ts +0 -1
- package/dist/esm/metas/initialize.test.js +0 -19
- package/dist/esm/metas/initialize.test.js.map +0 -1
- package/dist/esm/metas/types.d.ts +0 -56
- package/dist/esm/sdk/const.d.ts +0 -1
- package/dist/esm/sdk/faroGlobalObject.d.ts +0 -2
- package/dist/esm/sdk/index.d.ts +0 -4
- package/dist/esm/sdk/internalFaroGlobalObject.d.ts +0 -4
- package/dist/esm/sdk/register.d.ts +0 -4
- package/dist/esm/sdk/types.d.ts +0 -18
- package/dist/esm/semantic.d.ts +0 -7
- package/dist/esm/testUtils/index.d.ts +0 -6
- package/dist/esm/testUtils/mockConfig.d.ts +0 -2
- package/dist/esm/testUtils/mockInternalLogger.d.ts +0 -2
- package/dist/esm/testUtils/mockStacktraceParser.d.ts +0 -2
- package/dist/esm/testUtils/mockTransport.d.ts +0 -12
- package/dist/esm/testUtils/testPromise.d.ts +0 -7
- package/dist/esm/transports/base.d.ts +0 -6
- package/dist/esm/transports/const.d.ts +0 -8
- package/dist/esm/transports/index.d.ts +0 -5
- package/dist/esm/transports/initialize.d.ts +0 -6
- package/dist/esm/transports/transports.test.d.ts +0 -1
- package/dist/esm/transports/transports.test.js +0 -110
- package/dist/esm/transports/transports.test.js.map +0 -1
- package/dist/esm/transports/types.d.ts +0 -37
- package/dist/esm/transports/utils.d.ts +0 -2
- package/dist/esm/unpatchedConsole/const.d.ts +0 -2
- package/dist/esm/unpatchedConsole/index.d.ts +0 -3
- package/dist/esm/unpatchedConsole/initialize.d.ts +0 -4
- package/dist/esm/unpatchedConsole/types.d.ts +0 -1
- package/dist/esm/utils/baseObject.d.ts +0 -6
- package/dist/esm/utils/deepEqual.d.ts +0 -2
- package/dist/esm/utils/extensions.d.ts +0 -19
- package/dist/esm/utils/getCurrentTimestamp.d.ts +0 -1
- package/dist/esm/utils/index.d.ts +0 -12
- package/dist/esm/utils/is.d.ts +0 -31
- package/dist/esm/utils/logLevels.d.ts +0 -10
- package/dist/esm/utils/noop.d.ts +0 -1
- package/dist/esm/utils/promiseBuffer.d.ts +0 -14
- package/dist/esm/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/esm/utils/promiseBuffer.test.js +0 -87
- package/dist/esm/utils/promiseBuffer.test.js.map +0 -1
- package/dist/esm/utils/shortId.d.ts +0 -1
- package/dist/esm/version.d.ts +0 -1
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ Instrumentations are packages that leverage the Faro Web SDK API to provide auto
|
|
|
200
200
|
They are just simple functions that are executed when the agent is initialized.
|
|
201
201
|
|
|
202
202
|
Please note that the `core` package does not contain any instrumentations out of the box and they should be provided by
|
|
203
|
-
platform specific packages like [@grafana/faro-web-sdk]
|
|
203
|
+
platform specific packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
204
204
|
|
|
205
205
|
You can also write your own instrumentations:
|
|
206
206
|
|
|
@@ -228,7 +228,7 @@ Metas are objects that will be attached to every event that is triggered by the
|
|
|
228
228
|
|
|
229
229
|
Out of the box, only one meta is provided: `sdk` which contains information about the Faro instance and its version.
|
|
230
230
|
|
|
231
|
-
Additional metas may be provided by platform packages like [@grafana/faro-web-sdk]
|
|
231
|
+
Additional metas may be provided by platform packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
232
232
|
|
|
233
233
|
You can also define your own metas:
|
|
234
234
|
|
|
@@ -259,11 +259,11 @@ initializeFaro({
|
|
|
259
259
|
|
|
260
260
|
## Transports
|
|
261
261
|
|
|
262
|
-
Transports are functions that will be called for every event that is triggered by the API. They are used to do
|
|
263
|
-
|
|
262
|
+
Transports are functions that will be called for every event that is triggered by the API. They are used to do something
|
|
263
|
+
with the data after collecting it.
|
|
264
264
|
|
|
265
265
|
Out of the box, no transports are provided in the `core` package and they should be provided by platform specific
|
|
266
|
-
packages like [@grafana/faro-web-sdk]
|
|
266
|
+
packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
267
267
|
|
|
268
268
|
You can also define your own transports:
|
|
269
269
|
|
|
@@ -293,9 +293,8 @@ faro.unpatchedConsole.warn('This is a warning');
|
|
|
293
293
|
|
|
294
294
|
## Pause / unpause
|
|
295
295
|
|
|
296
|
-
Faro instance can be paused by invoking `faro.pause()`.
|
|
297
|
-
|
|
298
|
-
Call `faro.unpause()` to resume capturing events.
|
|
296
|
+
Faro instance can be paused by invoking `faro.pause()`. This will prevent events from being sent to transports. Call
|
|
297
|
+
`faro.unpause()` to resume capturing events.
|
|
299
298
|
|
|
300
299
|
## Isolated Faro instances
|
|
301
300
|
|
|
@@ -334,3 +333,5 @@ Although an isolated agent may sound like a great idea, there are some limitatio
|
|
|
334
333
|
- an isolated Faro instance will not be available on the global object
|
|
335
334
|
- the Faro reference should be stored by the project as it won't be available via
|
|
336
335
|
`import { faro } from '@grafana/faro-core';`
|
|
336
|
+
|
|
337
|
+
[faro-web-sdk-package]: https://github.com/grafana/faro-web-sdk/tree/main/packages/web-sdk
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var GrafanaFaroCore=function(e){"use strict";const n="_faroInternal",t="undefined"==typeof window?global:window;function r(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(t,n,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function o(){return n in t}function a(n,o){return n.debug("Initializing Faro"),e.faro=o,r(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 t)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(t,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};class i{get faro(){return e.faro}logDebug(...e){var n,t;null===(t=null===(n=this.faro)||void 0===n?void 0:n.internalLogger)||void 0===t||t.debug(`${this.name}\n`,...e)}logInfo(...e){var n,t;null===(t=null===(n=this.faro)||void 0===n?void 0:n.internalLogger)||void 0===t||t.info(`${this.name}\n`,...e)}logWarn(...e){var n,t;null===(t=null===(n=this.faro)||void 0===n?void 0:n.internalLogger)||void 0===t||t.warn(`${this.name}\n`,...e)}logError(...e){var n,t;null===(t=null===(n=this.faro)||void 0===n?void 0:n.internalLogger)||void 0===t||t.error(`${this.name}\n`,...e)}}function s(e,n){return typeof e===n}function l(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function u(e,n){try{return e instanceof n}catch(e){return!1}}const g=e=>s(e,"undefined"),c=e=>s(e,"null"),d=e=>s(e,"string"),p=e=>s(e,"number")&&!isNaN(e)||s(e,"bigint"),f=e=>!c(e)&&s(e,"object"),m=e=>s(e,"function"),b=e=>l(e,"Array"),v=!g(Event),y="undefined"!=typeof Error,E="undefined"!=typeof Element,h="undefined"!=typeof Map;function I(e,n){if(e===n)return!0;if(s(e,"number")&&isNaN(e))return s(n,"number")&&isNaN(n);const t=b(e),r=b(n);if(t!==r)return!1;if(t&&r){const t=e.length;if(t!==n.length)return!1;for(let r=t;0!=r--;)if(!I(e[r],n[r]))return!1;return!0}const o=f(e),a=f(n);if(o!==a)return!1;if(e&&n&&o&&a){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(let e of t)if(!r.includes(e))return!1;for(let r of t)if(!I(e[r],n[r]))return!1;return!0}return!1}function T(){return(new Date).toISOString()}var L;e.LogLevel=void 0,(L=e.LogLevel||(e.LogLevel={})).TRACE="trace",L.DEBUG="debug",L.INFO="info",L.LOG="log",L.WARN="warn",L.ERROR="error";const O=e.LogLevel.LOG,R=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function S(){}const x="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";var j;e.TransportItemType=void 0,(j=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",j.LOG="log",j.MEASUREMENT="measurement",j.TRACE="trace",j.EVENT="event";const A={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function N(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=>d(e)?n.includes(e):!!n.match(e)))}(n,r))return null}return t}}const k="Error";let P;function C(n,t,r,o){n.debug("Initializing API");const a=function(n,t,r,o){let a;return n.debug("Initializing traces API"),{getOTEL:()=>a,getTraceContext:()=>{const e=null==a?void 0:a.trace.getSpanContext(a.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{n.debug("Initializing OpenTelemetry"),a={trace:e,context:t}},isOTELInitialized:()=>!!a,pushTraces:t=>{try{const a={type:e.TransportItemType.TRACE,payload:t,meta:o.value};n.debug("Pushing trace\n",a),r.execute(a)}catch(e){n.error("Error pushing trace\n",e)}}}}(n,0,r,o);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(n,t,r,o,a){var i;n.debug("Initializing exceptions API");let s=null;P=null!==(i=t.parseStacktrace)&&void 0!==i?i:P;const l=e=>{n.debug("Changing stacktrace parser"),P=null!=e?e:P};return l(t.parseStacktrace),{changeStacktraceParser:l,getStacktraceParser:()=>P,pushError:(i,{skipDedupe:l,stackFrames:u,type:g}={})=>{g=g||i.name||k;const d={meta:o.value,payload:{type:g,value:i.message,timestamp:T(),trace:a.getTraceContext()},type:e.TransportItemType.EXCEPTION};(null==(u=null!=u?u:i.stack?null==P?void 0:P(i).frames:void 0)?void 0:u.length)&&(d.payload.stacktrace={frames:u});const p={type:d.payload.type,value:d.payload.value,stackTrace:d.payload.stacktrace};l||!t.dedupe||c(s)||!I(p,s)?(s=p,n.debug("Pushing exception\n",d),r.execute(d)):n.debug("Skipping error push because it is the same as the last one\n",d.payload)}}}(n,t,r,o,a)),function(e,n,t,r){let o,a;e.debug("Initializing meta API");const i=e=>{a&&r.remove(a),a={user:e},r.add(a)},s=e=>{o&&r.remove(o),o={session:e},r.add(o)};return{setUser:i,resetUser:i,setSession:s,resetSession:s,getSession:()=>r.value.session}}(n,0,0,o)),function(n,t,r,o,a){n.debug("Initializing logs API");let i=null;return{pushLog:(s,{context:l,level:u,skipDedupe:g}={})=>{try{const d={type:e.TransportItemType.LOG,payload:{message:s.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=u?u:O,context:null!=l?l:{},timestamp:T(),trace:a.getTraceContext()},meta:o.value},p={message:d.payload.message,level:d.payload.level,context:d.payload.context};if(!g&&t.dedupe&&!c(i)&&I(p,i))return void n.debug("Skipping log push because it is the same as the last one\n",d.payload);i=p,n.debug("Pushing log\n",d),r.execute(d)}catch(e){n.error("Error pushing log\n",e)}}}}(n,t,r,o,a)),function(n,t,r,o,a){n.debug("Initializing measurements API");let i=null;return{pushMeasurement:(s,{skipDedupe:l}={})=>{try{const u={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},s),{trace:a.getTraceContext()}),meta:o.value},g={type:u.payload.type,values:u.payload.values};if(!l&&t.dedupe&&!c(i)&&I(g,i))return void n.debug("Skipping measurement push because it is the same as the last one\n",u.payload);i=g,n.debug("Pushing measurement\n",u),r.execute(u)}catch(e){n.error("Error pushing measurement\n",e)}}}}(n,t,r,o,a)),function(n,t,r,o,a){let i=null;return{pushEvent:(s,l,u,{skipDedupe:g}={})=>{try{const d={meta:o.value,payload:{name:s,domain:null!=u?u:t.eventDomain,attributes:l,timestamp:T(),trace:a.getTraceContext()},type:e.TransportItemType.EVENT},p={name:d.payload.name,attributes:d.payload.attributes,domain:d.payload.domain};if(!g&&t.dedupe&&!c(i)&&I(p,i))return void n.debug("Skipping event push because it is the same as the last one\n",d.payload);i=p,n.debug("Pushing event\n",d),r.execute(d)}catch(e){n.error("Error pushing event",e)}}}}(n,t,r,o,a))}function F(e,n){e.debug("Initializing instrumentations");const t=[];return{add:(...n)=>{e.debug("Adding instrumentations"),n.forEach((n=>{e.debug(`Adding "${n.name}" instrumentation`);t.some((e=>e.name===n.name))?e.warn(`Transport ${n.name} is already added`):(t.push(n),n.initialize())}))},get instrumentations(){return[...t]},remove:(...n)=>{e.debug("Removing instrumentations"),n.forEach((n=>{var r,o;e.debug(`Removing "${n.name}" instrumentation`);const a=t.reduce(((e,t,r)=>null===e&&t.name===n.name?r:null),null);a?(null===(o=(r=t[a]).destroy)||void 0===o||o.call(r),t.splice(a,1)):e.warn(`Instrumentation "${n.name}" is not added`)}))}}}var $;e.InternalLoggerLevel=void 0,($=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[$.OFF=0]="OFF",$[$.ERROR=1]="ERROR",$[$.WARN=2]="WARN",$[$.INFO=3]="INFO",$[$.VERBOSE=4]="VERBOSE";const w={debug:S,error:S,info:S,prefix:"Faro",warn:S},D=e.InternalLoggerLevel.ERROR,G=Object.assign({},console);let z=G;function B(e){var n;return z=null!==(n=e.unpatchedConsole)&&void 0!==n?n:z,z}function M(n=G,t=D){const r=w;return t>e.InternalLoggerLevel.OFF&&(r.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${r.prefix}\n`,...e)}:S,r.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${r.prefix}\n`,...e)}:S,r.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${r.prefix}\n`,...e)}:S,r.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${r.prefix}\n`,...e)}:S),r}let U=w;function K(e,n){return U=M(e,n.internalLoggerLevel),U}const V="1.0.0-beta4";return e.BaseExtension=i,e.BaseInstrumentation=class extends i{},e.BaseTransport=class extends i{getIgnoreUrls(){return[]}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start"}},e.VERSION=V,e.allLogLevels=R,e.createInternalLogger=M,e.createPromiseBuffer=function(e){const{size:n,concurrency:t}=e,r=[];let o=0;const a=()=>{if(o<t&&r.length){const{producer:e,resolve:n,reject:t}=r.shift();o++,e().then((e=>{o--,a(),n(e)}),(e=>{o--,a(),t(e)}))}};return{add:e=>{if(r.length+o>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{r.push({producer:e,resolve:n,reject:t}),a()}))}}},e.deepEqual=I,e.defaultExceptionType=k,e.defaultGlobalObjectKey="faro",e.defaultInternalLoggerLevel=D,e.defaultLogLevel=O,e.defaultUnpatchedConsole=G,e.genShortID=function(e=10){return Array.from(Array(e)).map((()=>x[Math.floor(Math.random()*x.length)])).join("")},e.getCurrentTimestamp=T,e.getInternalFaroFromGlobalObject=function(){return t[n]},e.getTransportBody=function(n){return{[A[n.type]]:n.type===e.TransportItemType.TRACE?n.payload:[n.payload],meta:n.meta}},e.globalObject=t,e.initializeFaro=function(e){const n=B(e),t=K(n,e);if(t.debug("Initializing"),o()&&!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');const r=function(e,n){var t;let r=[],o=[];const a=()=>r.reduce(((e,n)=>Object.assign(e,m(n)?n():n)),{}),i=()=>{if(o.length){const e=a();o.forEach((n=>n(e)))}},s=(...n)=>{e.debug("Adding metas\n",n),r.push(...n),i()},l={sdk:{name:"@grafana/faro-core",version:V,integrations:n.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}};return n.app&&(l.app=n.app),n.user&&(l.user=n.user),s(l,...null!==(t=n.metas)&&void 0!==t?t:[]),{add:s,remove:(...n)=>{e.debug("Removing metas\n",n),r=r.filter((e=>!n.includes(e))),i()},addListener:e=>{o.push(e)},removeListener:e=>{o=o.filter((n=>n!==e))},get value(){return a()}}}(t,e),i=function(e,n){e.debug("Initializing transports");const t=[];let r=n.paused,o=[];const a=(...n)=>{e.debug("Adding transports"),n.forEach((n=>{e.debug(`Adding "${n.name}" transport`),t.some((e=>e===n))?e.warn(`Transport ${n.name} is already added`):t.push(n)}))},i=(...n)=>{e.debug("Adding beforeSendHooks\n",o),n.forEach((e=>{e&&o.push(e)}))},s=(...n)=>{e.debug("Adding ignoreErrorsPatterns\n",n),n.forEach((e=>{e&&o.push(N(e))}))};return a(...n.transports),i(n.beforeSend),s(n.ignoreErrors),{add:a,addBeforeSendHooks:i,addIgnoreErrorsPatterns:s,getBeforeSendHooks:()=>[...o],execute:n=>{if(!r){let r=n;for(const e of o){const n=e(r);if(null===n)return;r=n}for(const n of t)e.debug(`Transporting item using ${n.name}\n`,r),n.send(r)}},isPaused:()=>r,pause:()=>{e.debug("Pausing transports"),r=!0},remove:(...n)=>{e.debug("Removing transports"),n.forEach((n=>{e.debug(`Removing "${n.name}" transport`);const r=t.indexOf(n);-1!==r?t.splice(r,1):e.warn(`Transport "${n.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{o.filter((n=>!e.includes(n)))},get transports(){return[...t]},unpause:()=>{e.debug("Unpausing transports"),r=!1}}}(t,e),s=C(t,e,i,r);e.session&&s.setSession(e.session);const l=a(t,{api:s,config:e,internalLogger:t,metas:r,pause:i.pause,transports:i,unpatchedConsole:n,unpause:i.unpause,instrumentations:F(t)});return l.instrumentations.add(...e.instrumentations),l},e.internalGlobalObjectKey=n,e.isArray=b,e.isBoolean=e=>s(e,"boolean"),e.isDomError=e=>l(e,"DOMError"),e.isDomException=e=>l(e,"DOMException"),e.isElement=e=>E&&u(e,Element),e.isElementDefined=E,e.isError=e=>y&&u(e,Error),e.isErrorDefined=y,e.isErrorEvent=e=>l(e,"ErrorEvent"),e.isEvent=e=>v&&u(e,Event),e.isEventDefined=v,e.isFunction=m,e.isInstanceOf=u,e.isInt=e=>p(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=o,e.isMap=e=>h&&u(e,Map),e.isMapDefined=h,e.isNull=c,e.isNumber=p,e.isObject=f,e.isPrimitive=e=>!f(e)&&!m(e),e.isRegExp=e=>l(e,"RegExp"),e.isString=d,e.isSymbol=e=>s(e,"symbol"),e.isSyntheticEvent=e=>f(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>m(null==e?void 0:e.then),e.isToString=l,e.isTypeof=s,e.isUndefined=g,e.noop=S,e.setInternalFaroOnGlobalObject=r,e.transportItemTypeToBodyKey=A,e}({});
|
|
@@ -1,9 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.deepEqual = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
4
|
+
var is_1 = require("./is");
|
|
5
|
+
// This function was inspired by fast-deep-equal
|
|
6
|
+
// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need
|
|
7
|
+
function deepEqual(a, b) {
|
|
8
|
+
if (a === b) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
// Using isTypeOf instead of isNumber as isNumber also checks against NaN
|
|
12
|
+
if ((0, is_1.isTypeof)(a, 'number') && isNaN(a)) {
|
|
13
|
+
return (0, is_1.isTypeof)(b, 'number') && isNaN(b);
|
|
14
|
+
}
|
|
15
|
+
var aIsArray = (0, is_1.isArray)(a);
|
|
16
|
+
var bIsArray = (0, is_1.isArray)(b);
|
|
17
|
+
if (aIsArray !== bIsArray) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (aIsArray && bIsArray) {
|
|
21
|
+
var length_1 = a.length;
|
|
22
|
+
if (length_1 !== b.length) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
for (var idx = length_1; idx-- !== 0;) {
|
|
26
|
+
if (!deepEqual(a[idx], b[idx])) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
var aIsObject = (0, is_1.isObject)(a);
|
|
33
|
+
var bIsObject = (0, is_1.isObject)(b);
|
|
34
|
+
if (aIsObject !== bIsObject) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (a && b && aIsObject && bIsObject) {
|
|
38
|
+
var aKeys = Object.keys(a);
|
|
39
|
+
var bKeys = Object.keys(b);
|
|
40
|
+
var aLength = aKeys.length;
|
|
41
|
+
var bLength = bKeys.length;
|
|
42
|
+
if (aLength !== bLength) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
for (var _i = 0, aKeys_1 = aKeys; _i < aKeys_1.length; _i++) {
|
|
46
|
+
var aKey = aKeys_1[_i];
|
|
47
|
+
if (!bKeys.includes(aKey)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
for (var _a = 0, aKeys_2 = aKeys; _a < aKeys_2.length; _a++) {
|
|
52
|
+
var aKey = aKeys_2[_a];
|
|
53
|
+
if (!deepEqual(a[aKey], b[aKey])) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
exports.deepEqual = deepEqual;
|
|
9
62
|
//# sourceMappingURL=deepEqual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":";;;AAAA,2BAAmD;AAEnD,gDAAgD;AAChD,mGAAmG;AAEnG,SAAgB,SAAS,CAAC,CAAM,EAAE,CAAM;IACtC,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,yEAAyE;IACzE,IAAI,IAAA,aAAQ,EAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,EAAE;QAC/C,OAAO,IAAA,aAAQ,EAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,CAAC;KACpD;IAED,IAAM,QAAQ,GAAG,IAAA,YAAO,EAAC,CAAC,CAAC,CAAC;IAC5B,IAAM,QAAQ,GAAG,IAAA,YAAO,EAAC,CAAC,CAAC,CAAC;IAE5B,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,IAAM,QAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QAExB,IAAI,QAAM,KAAK,CAAC,CAAC,MAAM,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,KAAK,IAAI,GAAG,GAAG,QAAM,EAAE,GAAG,EAAE,KAAK,CAAC,GAAI;YACpC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC9B,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;KACb;IAED,IAAM,SAAS,GAAG,IAAA,aAAQ,EAAC,CAAC,CAAC,CAAC;IAC9B,IAAM,SAAS,GAAG,IAAA,aAAQ,EAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,IAAI,SAAS,EAAE;QACpC,IAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAA0B,CAAC;QACtD,IAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7B,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAE7B,IAAI,OAAO,KAAK,OAAO,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,KAAiB,UAAK,EAAL,eAAK,EAAL,mBAAK,EAAL,IAAK,EAAE;YAAnB,IAAI,IAAI,cAAA;YACX,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACzB,OAAO,KAAK,CAAC;aACd;SACF;QAED,KAAiB,UAAK,EAAL,eAAK,EAAL,mBAAK,EAAL,IAAK,EAAE;YAAnB,IAAI,IAAI,cAAA;YACX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;gBAChC,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAlED,8BAkEC","sourcesContent":["import { isArray, isObject, isTypeof } from './is';\n\n// This function was inspired by fast-deep-equal\n// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n\n // Using isTypeOf instead of isNumber as isNumber also checks against NaN\n if (isTypeof(a, 'number') && isNaN(a as number)) {\n return isTypeof(b, 'number') && isNaN(b as number);\n }\n\n const aIsArray = isArray(a);\n const bIsArray = isArray(b);\n\n if (aIsArray !== bIsArray) {\n return false;\n }\n\n if (aIsArray && bIsArray) {\n const length = a.length;\n\n if (length !== b.length) {\n return false;\n }\n\n for (let idx = length; idx-- !== 0; ) {\n if (!deepEqual(a[idx], b[idx])) {\n return false;\n }\n }\n\n return true;\n }\n\n const aIsObject = isObject(a);\n const bIsObject = isObject(b);\n\n if (aIsObject !== bIsObject) {\n return false;\n }\n\n if (a && b && aIsObject && bIsObject) {\n const aKeys = Object.keys(a) as Array<keyof typeof a>;\n const bKeys = Object.keys(b);\n const aLength = aKeys.length;\n const bLength = bKeys.length;\n\n if (aLength !== bLength) {\n return false;\n }\n\n for (let aKey of aKeys) {\n if (!bKeys.includes(aKey)) {\n return false;\n }\n }\n\n for (let aKey of aKeys) {\n if (!deepEqual(a[aKey], b[aKey])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
// auto-generated by bin/
|
|
5
|
-
exports.VERSION = '1.0.0-
|
|
4
|
+
// auto-generated by bin/genVersion.ts
|
|
5
|
+
exports.VERSION = '1.0.0-beta4';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,aAAa,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.0.0-beta4';\n"]}
|
|
@@ -1,3 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { isArray, isObject, isTypeof } from './is';
|
|
2
|
+
// This function was inspired by fast-deep-equal
|
|
3
|
+
// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need
|
|
4
|
+
export function deepEqual(a, b) {
|
|
5
|
+
if (a === b) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
// Using isTypeOf instead of isNumber as isNumber also checks against NaN
|
|
9
|
+
if (isTypeof(a, 'number') && isNaN(a)) {
|
|
10
|
+
return isTypeof(b, 'number') && isNaN(b);
|
|
11
|
+
}
|
|
12
|
+
const aIsArray = isArray(a);
|
|
13
|
+
const bIsArray = isArray(b);
|
|
14
|
+
if (aIsArray !== bIsArray) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (aIsArray && bIsArray) {
|
|
18
|
+
const length = a.length;
|
|
19
|
+
if (length !== b.length) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
for (let idx = length; idx-- !== 0;) {
|
|
23
|
+
if (!deepEqual(a[idx], b[idx])) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
const aIsObject = isObject(a);
|
|
30
|
+
const bIsObject = isObject(b);
|
|
31
|
+
if (aIsObject !== bIsObject) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (a && b && aIsObject && bIsObject) {
|
|
35
|
+
const aKeys = Object.keys(a);
|
|
36
|
+
const bKeys = Object.keys(b);
|
|
37
|
+
const aLength = aKeys.length;
|
|
38
|
+
const bLength = bKeys.length;
|
|
39
|
+
if (aLength !== bLength) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
for (let aKey of aKeys) {
|
|
43
|
+
if (!bKeys.includes(aKey)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (let aKey of aKeys) {
|
|
48
|
+
if (!deepEqual(a[aKey], b[aKey])) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
3
56
|
//# sourceMappingURL=deepEqual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEnD,gDAAgD;AAChD,mGAAmG;AAEnG,MAAM,UAAU,SAAS,CAAC,CAAM,EAAE,CAAM;IACtC,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,yEAAyE;IACzE,IAAI,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,EAAE;QAC/C,OAAO,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,CAAC;KACpD;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE5B,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QAExB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,KAAK,IAAI,GAAG,GAAG,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,GAAI;YACpC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC9B,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;KACb;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,IAAI,SAAS,EAAE;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAA0B,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAE7B,IAAI,OAAO,KAAK,OAAO,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;YACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACzB,OAAO,KAAK,CAAC;aACd;SACF;QAED,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;YACtB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;gBAChC,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { isArray, isObject, isTypeof } from './is';\n\n// This function was inspired by fast-deep-equal\n// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n\n // Using isTypeOf instead of isNumber as isNumber also checks against NaN\n if (isTypeof(a, 'number') && isNaN(a as number)) {\n return isTypeof(b, 'number') && isNaN(b as number);\n }\n\n const aIsArray = isArray(a);\n const bIsArray = isArray(b);\n\n if (aIsArray !== bIsArray) {\n return false;\n }\n\n if (aIsArray && bIsArray) {\n const length = a.length;\n\n if (length !== b.length) {\n return false;\n }\n\n for (let idx = length; idx-- !== 0; ) {\n if (!deepEqual(a[idx], b[idx])) {\n return false;\n }\n }\n\n return true;\n }\n\n const aIsObject = isObject(a);\n const bIsObject = isObject(b);\n\n if (aIsObject !== bIsObject) {\n return false;\n }\n\n if (a && b && aIsObject && bIsObject) {\n const aKeys = Object.keys(a) as Array<keyof typeof a>;\n const bKeys = Object.keys(b);\n const aLength = aKeys.length;\n const bLength = bKeys.length;\n\n if (aLength !== bLength) {\n return false;\n }\n\n for (let aKey of aKeys) {\n if (!bKeys.includes(aKey)) {\n return false;\n }\n }\n\n for (let aKey of aKeys) {\n if (!deepEqual(a[aKey], b[aKey])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
|
package/dist/esm/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// auto-generated by bin/
|
|
2
|
-
export const VERSION = '1.0.0-
|
|
1
|
+
// auto-generated by bin/genVersion.ts
|
|
2
|
+
export const VERSION = '1.0.0-beta4';
|
|
3
3
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.0.0-beta4';\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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.0.0-
|
|
7
|
+
readonly version = "1.0.0-beta4";
|
|
8
8
|
items: TransportItem[];
|
|
9
9
|
constructor(ignoreURLs?: Patterns);
|
|
10
10
|
send(item: TransportItem): void | Promise<void>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepEqual(a: any, b: any): boolean;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "1.0.0-beta4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/faro-core",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta4",
|
|
4
4
|
"description": "Core package of Faro.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -19,37 +19,43 @@
|
|
|
19
19
|
"url": "https://github.com/grafana/faro-web-sdk.git",
|
|
20
20
|
"directory": "packages/core"
|
|
21
21
|
},
|
|
22
|
-
"main": "dist/cjs/index.js",
|
|
23
|
-
"module": "dist/esm/index.js",
|
|
24
|
-
"types": "dist/
|
|
22
|
+
"main": "./dist/cjs/index.js",
|
|
23
|
+
"module": "./dist/esm/index.js",
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
27
|
"README.md",
|
|
28
28
|
"LICENSE"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
|
-
"start": "yarn
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"build": "
|
|
31
|
+
"start": "yarn watch",
|
|
32
|
+
"build": "run-s build:*",
|
|
33
|
+
"build:version": "node bin/genVersion.js",
|
|
34
|
+
"build:compile": "run-p build:compile:*",
|
|
35
|
+
"build:compile:cjs": "tsc --build tsconfig.cjs.json",
|
|
36
|
+
"build:compile:esm": "tsc --build tsconfig.esm.json",
|
|
37
|
+
"build:compile:bundle": "run-s build:compile:bundle:*",
|
|
38
|
+
"build:compile:bundle:create": "rollup -c ./rollup.config.js",
|
|
39
|
+
"build:compile:bundle:remove-extras": "rimraf dist/bundle/dist",
|
|
40
|
+
"watch": "run-s build:version watch:compile",
|
|
41
|
+
"watch:compile": "yarn build:compile:cjs -w",
|
|
35
42
|
"clean": "rimraf dist/ yarn-error.log",
|
|
36
43
|
"quality": "run-s quality:*",
|
|
37
44
|
"quality:test": "jest",
|
|
38
|
-
"quality:format": "prettier --ignore-path ../../.prettierignore -w \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
45
|
+
"quality:format": "prettier --cache --cache-location=../../.cache/prettier/core --ignore-path ../../.prettierignore -w \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
39
46
|
"quality:lint": "run-s quality:lint:*",
|
|
40
|
-
"quality:lint:eslint": "eslint --ignore-path ../../.eslintignore \"./**/*.{js,jsx,ts,tsx}\"",
|
|
41
|
-
"quality:lint:prettier": "prettier --ignore-path ../../.prettierignore -c \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
47
|
+
"quality:lint:eslint": "eslint --cache --cache-location ../../.cache/eslint/core --ignore-path ../../.eslintignore \"./**/*.{js,jsx,ts,tsx}\"",
|
|
48
|
+
"quality:lint:prettier": "prettier --cache --cache-location=../../.cache/prettier/core --ignore-path ../../.prettierignore -c \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
42
49
|
"quality:lint:md": "markdownlint README.md",
|
|
43
50
|
"quality:circular-deps": "madge --circular ."
|
|
44
51
|
},
|
|
45
52
|
"dependencies": {
|
|
46
53
|
"@opentelemetry/api": "^1.3.0",
|
|
47
54
|
"@opentelemetry/api-metrics": "^0.33.0",
|
|
48
|
-
"@opentelemetry/otlp-transformer": "^0.34.0"
|
|
49
|
-
"fast-deep-equal": "^3.1.3"
|
|
55
|
+
"@opentelemetry/otlp-transformer": "^0.34.0"
|
|
50
56
|
},
|
|
51
57
|
"publishConfig": {
|
|
52
58
|
"access": "public"
|
|
53
59
|
},
|
|
54
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "88ab57b93286d22830db932a7dc74bcaf2dd4c3d"
|
|
55
61
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|