@grafana/faro-core 1.0.0-beta2 → 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 +75 -20
- package/dist/bundle/faro-core.iife.js +1 -0
- package/dist/cjs/api/events/index.js.map +1 -1
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/events/types.js.map +1 -1
- package/dist/cjs/api/exceptions/const.js.map +1 -1
- package/dist/cjs/api/exceptions/index.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/types.js.map +1 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/initialize.js.map +1 -1
- package/dist/cjs/api/logs/index.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/logs/types.js.map +1 -1
- package/dist/cjs/api/measurements/index.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/types.js.map +1 -1
- package/dist/cjs/api/meta/index.js.map +1 -1
- package/dist/cjs/api/meta/initialize.js.map +1 -1
- package/dist/cjs/api/meta/types.js.map +1 -1
- package/dist/cjs/api/traces/index.js.map +1 -1
- package/dist/cjs/api/traces/initialize.js.map +1 -1
- package/dist/cjs/api/traces/types.js.map +1 -1
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/config/const.js.map +1 -1
- package/dist/cjs/config/index.js.map +1 -1
- package/dist/cjs/config/types.js.map +1 -1
- package/dist/cjs/globalObject/globalObject.js.map +1 -1
- package/dist/cjs/globalObject/index.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/base.js.map +1 -1
- package/dist/cjs/instrumentations/index.js.map +1 -1
- package/dist/cjs/instrumentations/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/types.js.map +1 -1
- package/dist/cjs/internalLogger/const.js.map +1 -1
- package/dist/cjs/internalLogger/createInternalLogger.js.map +1 -1
- package/dist/cjs/internalLogger/index.js.map +1 -1
- package/dist/cjs/internalLogger/initialize.js.map +1 -1
- package/dist/cjs/internalLogger/types.js.map +1 -1
- package/dist/cjs/metas/index.js.map +1 -1
- package/dist/cjs/metas/initialize.js.map +1 -1
- package/dist/cjs/metas/types.js.map +1 -1
- package/dist/cjs/sdk/const.js.map +1 -1
- package/dist/cjs/sdk/faroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/register.js.map +1 -1
- package/dist/cjs/sdk/types.js.map +1 -1
- package/dist/cjs/semantic.js.map +1 -1
- package/dist/cjs/testUtils/index.js.map +1 -1
- package/dist/cjs/testUtils/mockConfig.js.map +1 -1
- package/dist/cjs/testUtils/mockInternalLogger.js.map +1 -1
- package/dist/cjs/testUtils/mockStacktraceParser.js.map +1 -1
- package/dist/cjs/testUtils/mockTransport.js.map +1 -1
- package/dist/cjs/testUtils/testPromise.js.map +1 -1
- package/dist/cjs/transports/base.js.map +1 -1
- package/dist/cjs/transports/const.js.map +1 -1
- package/dist/cjs/transports/index.js.map +1 -1
- package/dist/cjs/transports/initialize.js +3 -8
- package/dist/cjs/transports/initialize.js.map +1 -1
- package/dist/cjs/transports/types.js.map +1 -1
- package/dist/cjs/transports/utils.js.map +1 -1
- package/dist/cjs/unpatchedConsole/const.js.map +1 -1
- package/dist/cjs/unpatchedConsole/index.js.map +1 -1
- package/dist/cjs/unpatchedConsole/initialize.js.map +1 -1
- package/dist/cjs/unpatchedConsole/types.js.map +1 -1
- package/dist/cjs/utils/baseObject.js.map +1 -1
- package/dist/cjs/utils/deepEqual.js +58 -5
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/extensions.js.map +1 -1
- package/dist/cjs/utils/getCurrentTimestamp.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/is.js.map +1 -1
- package/dist/cjs/utils/logLevels.js.map +1 -1
- package/dist/cjs/utils/noop.js.map +1 -1
- package/dist/cjs/utils/promiseBuffer.js.map +1 -1
- package/dist/cjs/utils/shortId.js.map +1 -1
- package/dist/cjs/version.js +2 -2
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/api/events/index.js.map +1 -1
- package/dist/esm/api/events/initialize.js.map +1 -1
- package/dist/esm/api/events/types.js.map +1 -1
- package/dist/esm/api/exceptions/const.js.map +1 -1
- package/dist/esm/api/exceptions/index.js.map +1 -1
- package/dist/esm/api/exceptions/initialize.js.map +1 -1
- package/dist/esm/api/exceptions/types.js.map +1 -1
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/initialize.js.map +1 -1
- package/dist/esm/api/logs/index.js.map +1 -1
- package/dist/esm/api/logs/initialize.js.map +1 -1
- package/dist/esm/api/logs/types.js.map +1 -1
- package/dist/esm/api/measurements/index.js.map +1 -1
- package/dist/esm/api/measurements/initialize.js.map +1 -1
- package/dist/esm/api/measurements/types.js.map +1 -1
- package/dist/esm/api/meta/index.js.map +1 -1
- package/dist/esm/api/meta/initialize.js.map +1 -1
- package/dist/esm/api/meta/types.js.map +1 -1
- package/dist/esm/api/traces/index.js.map +1 -1
- package/dist/esm/api/traces/initialize.js.map +1 -1
- package/dist/esm/api/traces/types.js.map +1 -1
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/config/const.js.map +1 -1
- package/dist/esm/config/index.js.map +1 -1
- package/dist/esm/config/types.js.map +1 -1
- package/dist/esm/globalObject/globalObject.js.map +1 -1
- package/dist/esm/globalObject/index.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/initialize.js.map +1 -1
- package/dist/esm/instrumentations/base.js.map +1 -1
- package/dist/esm/instrumentations/index.js.map +1 -1
- package/dist/esm/instrumentations/initialize.js.map +1 -1
- package/dist/esm/instrumentations/types.js.map +1 -1
- package/dist/esm/internalLogger/const.js.map +1 -1
- package/dist/esm/internalLogger/createInternalLogger.js.map +1 -1
- package/dist/esm/internalLogger/index.js.map +1 -1
- package/dist/esm/internalLogger/initialize.js.map +1 -1
- package/dist/esm/internalLogger/types.js.map +1 -1
- package/dist/esm/metas/index.js.map +1 -1
- package/dist/esm/metas/initialize.js.map +1 -1
- package/dist/esm/metas/types.js.map +1 -1
- package/dist/esm/sdk/const.js.map +1 -1
- package/dist/esm/sdk/faroGlobalObject.js.map +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/esm/sdk/register.js.map +1 -1
- package/dist/esm/sdk/types.js.map +1 -1
- package/dist/esm/semantic.js.map +1 -1
- package/dist/esm/testUtils/index.js.map +1 -1
- package/dist/esm/testUtils/mockConfig.js.map +1 -1
- package/dist/esm/testUtils/mockInternalLogger.js.map +1 -1
- package/dist/esm/testUtils/mockStacktraceParser.js.map +1 -1
- package/dist/esm/testUtils/mockTransport.js.map +1 -1
- package/dist/esm/testUtils/testPromise.js.map +1 -1
- package/dist/esm/transports/base.js.map +1 -1
- package/dist/esm/transports/const.js.map +1 -1
- package/dist/esm/transports/index.js.map +1 -1
- package/dist/esm/transports/initialize.js +3 -8
- package/dist/esm/transports/initialize.js.map +1 -1
- package/dist/esm/transports/types.js.map +1 -1
- package/dist/esm/transports/utils.js.map +1 -1
- package/dist/esm/unpatchedConsole/const.js.map +1 -1
- package/dist/esm/unpatchedConsole/index.js.map +1 -1
- package/dist/esm/unpatchedConsole/initialize.js.map +1 -1
- package/dist/esm/unpatchedConsole/types.js.map +1 -1
- package/dist/esm/utils/baseObject.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +55 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/extensions.js.map +1 -1
- package/dist/esm/utils/getCurrentTimestamp.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/is.js.map +1 -1
- package/dist/esm/utils/logLevels.js.map +1 -1
- package/dist/esm/utils/noop.js.map +1 -1
- package/dist/esm/utils/promiseBuffer.js.map +1 -1
- package/dist/esm/utils/shortId.js.map +1 -1
- package/dist/esm/version.js +2 -2
- package/dist/esm/version.js.map +1 -1
- package/dist/types/api/events/index.d.ts +2 -0
- package/dist/{cjs → types}/api/events/initialize.d.ts +0 -0
- package/dist/{esm → types}/api/events/types.d.ts +1 -1
- 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/{esm → types}/api/exceptions/types.d.ts +1 -1
- package/dist/{esm → types}/api/index.d.ts +2 -2
- 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 +1 -1
- 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/types/api/traces/index.d.ts +2 -0
- package/dist/{cjs → types}/api/traces/initialize.d.ts +0 -0
- package/dist/{cjs → types}/api/traces/types.d.ts +2 -8
- package/dist/{cjs → types}/api/types.d.ts +2 -2
- package/dist/{cjs → types}/config/const.d.ts +0 -0
- package/dist/{cjs → types}/config/index.d.ts +0 -0
- package/dist/{esm → types}/config/types.d.ts +1 -1
- package/dist/{cjs → types}/globalObject/globalObject.d.ts +1 -1
- package/dist/{cjs → types}/globalObject/index.d.ts +0 -0
- package/dist/{cjs → types}/index.d.ts +1 -1
- 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 +4 -4
- 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 +2 -2
- 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/types/unpatchedConsole/types.d.ts +1 -0
- package/dist/types/utils/baseObject.d.ts +6 -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 +1 -1
- package/dist/{cjs → types}/utils/logLevels.d.ts +0 -0
- package/dist/{cjs → types}/utils/noop.d.ts +0 -0
- package/dist/{esm → types}/utils/promiseBuffer.d.ts +1 -1
- package/dist/{cjs → types}/utils/shortId.d.ts +0 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +29 -15
- package/dist/cjs/agent/agentGlobalObject.d.ts +0 -2
- package/dist/cjs/agent/agentGlobalObject.js +0 -23
- package/dist/cjs/agent/agentGlobalObject.js.map +0 -1
- package/dist/cjs/agent/const.d.ts +0 -1
- package/dist/cjs/agent/const.js +0 -5
- package/dist/cjs/agent/const.js.map +0 -1
- package/dist/cjs/agent/index.d.ts +0 -4
- package/dist/cjs/agent/index.js +0 -13
- package/dist/cjs/agent/index.js.map +0 -1
- package/dist/cjs/agent/initialize.d.ts +0 -4
- package/dist/cjs/agent/initialize.js +0 -15
- package/dist/cjs/agent/initialize.js.map +0 -1
- package/dist/cjs/agent/internalAgentGlobalObject.d.ts +0 -4
- package/dist/cjs/agent/internalAgentGlobalObject.js +0 -29
- package/dist/cjs/agent/internalAgentGlobalObject.js.map +0 -1
- package/dist/cjs/agent/types.d.ts +0 -18
- package/dist/cjs/agent/types.js +0 -3
- package/dist/cjs/agent/types.js.map +0 -1
- package/dist/cjs/agent.test.d.ts +0 -1
- package/dist/cjs/agent.test.js +0 -42
- package/dist/cjs/agent.test.js.map +0 -1
- package/dist/cjs/api/events/index.d.ts +0 -2
- 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/events/types.d.ts +0 -15
- 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/exceptions/types.d.ts +0 -32
- package/dist/cjs/api/index.d.ts +0 -9
- 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/api/traces/index.d.ts +0 -2
- package/dist/cjs/config/types.d.ts +0 -26
- 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 -122
- package/dist/cjs/transports/transports.test.js.map +0 -1
- package/dist/cjs/unpatchedConsole/types.d.ts +0 -1
- package/dist/cjs/utils/baseObject.d.ts +0 -6
- package/dist/cjs/utils/deepEqual.d.ts +0 -2
- package/dist/cjs/utils/promiseBuffer.d.ts +0 -14
- 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/agent/agentGlobalObject.d.ts +0 -2
- package/dist/esm/agent/agentGlobalObject.js +0 -19
- package/dist/esm/agent/agentGlobalObject.js.map +0 -1
- package/dist/esm/agent/const.d.ts +0 -1
- package/dist/esm/agent/const.js +0 -2
- package/dist/esm/agent/const.js.map +0 -1
- package/dist/esm/agent/index.d.ts +0 -4
- package/dist/esm/agent/index.js +0 -4
- package/dist/esm/agent/index.js.map +0 -1
- package/dist/esm/agent/initialize.d.ts +0 -4
- package/dist/esm/agent/initialize.js +0 -11
- package/dist/esm/agent/initialize.js.map +0 -1
- package/dist/esm/agent/internalAgentGlobalObject.d.ts +0 -4
- package/dist/esm/agent/internalAgentGlobalObject.js +0 -23
- package/dist/esm/agent/internalAgentGlobalObject.js.map +0 -1
- package/dist/esm/agent/types.d.ts +0 -18
- package/dist/esm/agent/types.js +0 -2
- package/dist/esm/agent/types.js.map +0 -1
- package/dist/esm/agent.test.d.ts +0 -1
- package/dist/esm/agent.test.js +0 -40
- package/dist/esm/agent.test.js.map +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/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/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 -26
- 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/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 -91
- 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.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
|
@@ -72,13 +72,15 @@ The `api` property on the Faro instance contains all the necessary methods to pu
|
|
|
72
72
|
- `pushError` - is a method to push an error/exception to the Faro instance. It accepts a mandatory `message` parameter
|
|
73
73
|
and an optional one where you can set:
|
|
74
74
|
|
|
75
|
-
- `skipDedupe` - a flag for enforcing
|
|
75
|
+
- `skipDedupe` - a flag for enforcing error push even if the error is identical to the previous one.
|
|
76
76
|
- `stackFrames` - an array of stack frames. Defaults to parsing `error.stack` if present.
|
|
77
77
|
- `type` - the type of exception. Default value: `error.name` or `"error"`.
|
|
78
78
|
|
|
79
79
|
```ts
|
|
80
80
|
faro.api.pushError(new Error('This is an error'));
|
|
81
81
|
|
|
82
|
+
faro.api.pushError(new Error('This is an unhandled exception'), { skipDedupe: true });
|
|
83
|
+
|
|
82
84
|
faro.api.pushError(new Error('This is an unhandled exception'), { type: 'unhandledException' });
|
|
83
85
|
|
|
84
86
|
faro.api.pushError(new Error('This is an error with stack frames'), {
|
|
@@ -93,16 +95,44 @@ The `api` property on the Faro instance contains all the necessary methods to pu
|
|
|
93
95
|
});
|
|
94
96
|
```
|
|
95
97
|
|
|
98
|
+
## Events
|
|
99
|
+
|
|
100
|
+
- `pushEvent` - is a method to push an event to the Faro instance. It accepts a mandatory `name` parameter and a couple
|
|
101
|
+
of optional parameters.
|
|
102
|
+
|
|
103
|
+
The first optional parameter is called `attributes` and it is a key-value object where you can set additional
|
|
104
|
+
properties for your event.
|
|
105
|
+
|
|
106
|
+
The second optional parameter is called `domain` and it is a string that's used to group events together.
|
|
107
|
+
|
|
108
|
+
The third optional parameter is an optional `options` object where you can set:
|
|
109
|
+
|
|
110
|
+
- `skipDedupe` - a flag for enforcing event push even if the event is identical to the previous one.
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
faro.api.pushEvent('user-logged-in');
|
|
114
|
+
|
|
115
|
+
faro.api.pushEvent('user-logged-in', { username: 'the-user-id' });
|
|
116
|
+
|
|
117
|
+
faro.api.pushEvent('user-logged-in', { username: 'the-user-id' }, 'auth');
|
|
118
|
+
|
|
119
|
+
faro.api.pushEvent('user-logged-in', { username: 'the-user-id' }, 'auth', { skipDedupe: true });
|
|
120
|
+
```
|
|
121
|
+
|
|
96
122
|
## Logs
|
|
97
123
|
|
|
98
124
|
- `pushLog` - is a method to register a log event. The method accepts a mandatory `args` parameter which is an array of
|
|
99
|
-
arguments that will be stringified and
|
|
100
|
-
|
|
101
|
-
|
|
125
|
+
arguments that will be stringified and sent to the transports and an optional one where you can set:
|
|
126
|
+
|
|
127
|
+
- `skipDedupe` - a flag for enforcing log push even if the log is identical to the previous one.
|
|
128
|
+
- `logLevel` - the type of message that we register.
|
|
129
|
+
- `context` - a plain object containing primitive values that will be recorded along with the message.
|
|
102
130
|
|
|
103
131
|
```ts
|
|
104
132
|
faro.api.pushLog(['This is a log', 'With another message']);
|
|
105
133
|
|
|
134
|
+
faro.api.pushLog(['This is a log'], { skipDedupe: true });
|
|
135
|
+
|
|
106
136
|
faro.api.pushLog(['This is a warning'], { level: LogLevel.WARN });
|
|
107
137
|
|
|
108
138
|
faro.api.pushLog(['This is a log with context'], {
|
|
@@ -117,7 +147,7 @@ The `api` property on the Faro instance contains all the necessary methods to pu
|
|
|
117
147
|
- `pushMeasurement` - is a method for registering metrics. The method accepts a mandatory `payload` parameter and an
|
|
118
148
|
optional parameter for passing additional options:
|
|
119
149
|
|
|
120
|
-
- `
|
|
150
|
+
- `skipDedupe` - a flag for enforcing measurement push even if the measurement is identical to the previous one.
|
|
121
151
|
|
|
122
152
|
```ts
|
|
123
153
|
faro.api.pushMeasurement({
|
|
@@ -134,19 +164,43 @@ The `api` property on the Faro instance contains all the necessary methods to pu
|
|
|
134
164
|
my_custom_metric: Math.random(),
|
|
135
165
|
},
|
|
136
166
|
},
|
|
137
|
-
{
|
|
138
|
-
span: mySpan,
|
|
139
|
-
}
|
|
167
|
+
{ skipDedupe: true }
|
|
140
168
|
);
|
|
141
169
|
```
|
|
142
170
|
|
|
171
|
+
## Traces
|
|
172
|
+
|
|
173
|
+
- `pushTraces` - is a method for manually sending traces through the transports. The method only accepts a mandatory
|
|
174
|
+
`payload`.
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
faro.api.pushTraces({
|
|
178
|
+
resourceSpans: [
|
|
179
|
+
/* OTel Traces */
|
|
180
|
+
],
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- `getOTEL` - is a method for getting the OpenTelemetry instance used by Faro.
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
const otel = faro.api.getOTEL();
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- `isOTELInitialized` - is a method for checking if OpenTelemetry package was correctly initialized and there is an
|
|
191
|
+
OpenTelemetry instance used by Faro.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
const isInitialized = faro.api.isOTELInitialized();
|
|
195
|
+
```
|
|
196
|
+
|
|
143
197
|
## Instrumentations
|
|
144
198
|
|
|
145
|
-
Instrumentations are packages that leverage the Faro Web SDK API to provide automatic mechanisms
|
|
146
|
-
|
|
199
|
+
Instrumentations are packages that leverage the Faro Web SDK API to provide automatic mechanisms for collecting data.
|
|
200
|
+
They are just simple functions that are executed when the agent is initialized.
|
|
147
201
|
|
|
148
202
|
Please note that the `core` package does not contain any instrumentations out of the box and they should be provided by
|
|
149
|
-
platform specific packages like [@grafana/faro-web-sdk]
|
|
203
|
+
platform specific packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
150
204
|
|
|
151
205
|
You can also write your own instrumentations:
|
|
152
206
|
|
|
@@ -172,9 +226,9 @@ initializeFaro({
|
|
|
172
226
|
|
|
173
227
|
Metas are objects that will be attached to every event that is triggered by the API.
|
|
174
228
|
|
|
175
|
-
Out of the box, only one meta is provided: `sdk` which contains information about the Faro instance and its version.
|
|
176
|
-
|
|
177
|
-
|
|
229
|
+
Out of the box, only one meta is provided: `sdk` which contains information about the Faro instance and its version.
|
|
230
|
+
|
|
231
|
+
Additional metas may be provided by platform packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
178
232
|
|
|
179
233
|
You can also define your own metas:
|
|
180
234
|
|
|
@@ -205,11 +259,11 @@ initializeFaro({
|
|
|
205
259
|
|
|
206
260
|
## Transports
|
|
207
261
|
|
|
208
|
-
Transports are functions that will be called for every event that is triggered by the API. They are used to do
|
|
209
|
-
|
|
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.
|
|
210
264
|
|
|
211
265
|
Out of the box, no transports are provided in the `core` package and they should be provided by platform specific
|
|
212
|
-
packages like [@grafana/faro-web-sdk]
|
|
266
|
+
packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
213
267
|
|
|
214
268
|
You can also define your own transports:
|
|
215
269
|
|
|
@@ -239,9 +293,8 @@ faro.unpatchedConsole.warn('This is a warning');
|
|
|
239
293
|
|
|
240
294
|
## Pause / unpause
|
|
241
295
|
|
|
242
|
-
Faro instance can be paused by invoking `faro.pause()`.
|
|
243
|
-
|
|
244
|
-
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.
|
|
245
298
|
|
|
246
299
|
## Isolated Faro instances
|
|
247
300
|
|
|
@@ -280,3 +333,5 @@ Although an isolated agent may sound like a great idea, there are some limitatio
|
|
|
280
333
|
- an isolated Faro instance will not be available on the global object
|
|
281
334
|
- the Faro reference should be stored by the project as it won't be available via
|
|
282
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/events/index.ts"],"names":[],"mappings":";;;AACA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/events/index.ts"],"names":[],"mappings":";;;AACA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA","sourcesContent":["export type { EventAttributes, EventEvent, EventsAPI } from './types';\nexport { initializeEventsAPI } from './initialize';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/events/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;AAChF,qCAAqE;AAIrE,SAAgB,mBAAmB,CACjC,cAA8B,EAC9B,MAAc,EACd,UAAsB,EACtB,KAA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AAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAE9C,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;SAClD;IACH,CAAC,CAAC;IAEF,OAAO;QACL,SAAS,WAAA;KACV,CAAC;AACJ,CAAC;AAhDD,kDAgDC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType, Transports } from '../../transports';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\nimport type { EventEvent, EventsAPI } from './types';\n\nexport function initializeEventsAPI(\n internalLogger: InternalLogger,\n config: Config,\n transports: Transports,\n metas: Metas,\n tracesApi: TracesAPI\n): EventsAPI {\n let lastPayload: Pick<EventEvent, 'name' | 'domain' | 'attributes'> | null = null;\n\n const pushEvent: EventsAPI['pushEvent'] = (name, attributes, domain, { skipDedupe } = {}) => {\n try {\n const item: TransportItem<EventEvent> = {\n meta: metas.value,\n payload: {\n name,\n domain: domain ?? config.eventDomain,\n attributes,\n timestamp: getCurrentTimestamp(),\n trace: tracesApi.getTraceContext(),\n },\n type: TransportItemType.EVENT,\n };\n\n const testingPayload = {\n name: item.payload.name,\n attributes: item.payload.attributes,\n domain: item.payload.domain,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping event push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing event\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing event', err);\n }\n };\n\n return {\n pushEvent,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/events/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/events/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TraceContext } from '../traces';\n\nexport type EventAttributes = Record<string, string>;\n\nexport interface EventEvent {\n name: string;\n timestamp: string;\n\n domain?: string;\n attributes?: EventAttributes;\n trace?: TraceContext;\n}\n\nexport interface PushEventOptions {\n skipDedupe?: boolean;\n}\n\nexport interface EventsAPI {\n pushEvent: (name: string, attributes?: EventAttributes, domain?: string, options?: PushEventOptions) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/api/exceptions/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/api/exceptions/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,OAAO,CAAC","sourcesContent":["export const defaultExceptionType = 'Error';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAE7B,2CAAuD;AAA9C,qHAAA,uBAAuB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAE7B,2CAAuD;AAA9C,qHAAA,uBAAuB,OAAA","sourcesContent":["export { defaultExceptionType } from './const';\n\nexport { initializeExceptionsAPI } from './initialize';\n\nexport type {\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n PushErrorOptions,\n Stacktrace,\n StacktraceParser,\n} from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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AC;SACH;QAED,IAAM,cAAc,GAAG;YACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YACzB,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;SACpC,CAAC;QAEF,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAA,cAAM,EAAC,WAAW,CAAC,IAAI,IAAA,iBAAS,EAAC,cAAc,EAAE,WAAW,CAAC,EAAE;YAClG,cAAc,CAAC,KAAK,CAAC,8DAA8D,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAEnG,OAAO;SACR;QAED,WAAW,GAAG,cAAc,CAAC;QAE7B,cAAc,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;QAElD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,sBAAsB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAE/C,OAAO;QACL,sBAAsB,wBAAA;QACtB,mBAAmB,qBAAA;QACnB,SAAS,WAAA;KACV,CAAC;AACJ,CAAC;AArED,0DAqEC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItemType } from '../../transports';\nimport type { TransportItem, Transports } from '../../transports';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\nimport { defaultExceptionType } from './const';\nimport type { ExceptionEvent, ExceptionsAPI, StacktraceParser } from './types';\n\nlet stacktraceParser: StacktraceParser | undefined;\n\nexport function initializeExceptionsAPI(\n internalLogger: InternalLogger,\n config: Config,\n transports: Transports,\n metas: Metas,\n tracesApi: TracesAPI\n): ExceptionsAPI {\n internalLogger.debug('Initializing exceptions API');\n\n let lastPayload: Pick<ExceptionEvent, 'type' | 'value' | 'stacktrace'> | null = null;\n\n stacktraceParser = config.parseStacktrace ?? stacktraceParser;\n\n const changeStacktraceParser: ExceptionsAPI['changeStacktraceParser'] = (newStacktraceParser) => {\n internalLogger.debug('Changing stacktrace parser');\n\n stacktraceParser = newStacktraceParser ?? stacktraceParser;\n };\n\n const getStacktraceParser: ExceptionsAPI['getStacktraceParser'] = () => stacktraceParser;\n\n const pushError: ExceptionsAPI['pushError'] = (error, { skipDedupe, stackFrames, type } = {}) => {\n type = type || error.name || defaultExceptionType;\n\n const item: TransportItem<ExceptionEvent> = {\n meta: metas.value,\n payload: {\n type,\n value: error.message,\n timestamp: getCurrentTimestamp(),\n trace: tracesApi.getTraceContext(),\n },\n type: TransportItemType.EXCEPTION,\n };\n\n stackFrames = stackFrames ?? (error.stack ? stacktraceParser?.(error).frames : undefined);\n\n if (stackFrames?.length) {\n item.payload.stacktrace = {\n frames: stackFrames,\n };\n }\n\n const testingPayload = {\n type: item.payload.type,\n value: item.payload.value,\n stackTrace: item.payload.stacktrace,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping error push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing exception\\n', item);\n\n transports.execute(item);\n };\n\n changeStacktraceParser(config.parseStacktrace);\n\n return {\n changeStacktraceParser,\n getStacktraceParser,\n pushError,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import 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 interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n}\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: Error, options?: PushErrorOptions) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAApC,2GAAA,aAAa,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAKtB,2CAAoD;AAA3C,kHAAA,oBAAoB,OAAA","sourcesContent":["export { initializeAPI } from './initialize';\nexport type { API, APIEvent } from './types';\n\nexport type { EventAttributes, EventEvent, EventsAPI } from './events';\n\nexport { defaultExceptionType } from './exceptions';\nexport type {\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n PushErrorOptions,\n Stacktrace,\n StacktraceParser,\n} from './exceptions';\n\nexport type { LogContext, LogEvent, LogsAPI, PushLogOptions } from './logs';\n\nexport type { MeasurementEvent, MeasurementsAPI, PushMeasurementOptions } from './measurements';\n\nexport type { MetaAPI } from './meta';\n\nexport type { OTELApi, TraceContext, TraceEvent, TracesAPI } from './traces';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/api/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,mCAA+C;AAC/C,2CAAuD;AACvD,+BAA2C;AAC3C,+CAA2D;AAC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,SAAS,CAAC,GAC7E,IAAA,wBAAiB,EAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,GAC5D,IAAA,wBAAiB,EAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,GACvE,IAAA,wCAAyB,EAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,GAC/E,IAAA,4BAAmB,EAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,EAC5E;AACJ,CAAC;AAlBD,sCAkBC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { Transports } from '../transports';\nimport { initializeEventsAPI } from './events';\nimport { initializeExceptionsAPI } from './exceptions';\nimport { initializeLogsAPI } from './logs';\nimport { initializeMeasurementsAPI } from './measurements';\nimport { initializeMetaAPI } from './meta';\nimport { initializeTracesAPI } from './traces';\nimport type { API } from './types';\n\nexport function initializeAPI(\n internalLogger: InternalLogger,\n config: Config,\n transports: Transports,\n metas: Metas\n): API {\n internalLogger.debug('Initializing API');\n\n const tracesApi = initializeTracesAPI(internalLogger, config, transports, metas);\n\n return {\n ...tracesApi,\n ...initializeExceptionsAPI(internalLogger, config, transports, metas, tracesApi),\n ...initializeMetaAPI(internalLogger, config, transports, metas),\n ...initializeLogsAPI(internalLogger, config, transports, metas, tracesApi),\n ...initializeMeasurementsAPI(internalLogger, config, transports, metas, tracesApi),\n ...initializeEventsAPI(internalLogger, config, transports, metas, tracesApi),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/logs/index.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/logs/index.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA","sourcesContent":["export { initializeLogsAPI } from './initialize';\n\nexport type { LogContext, LogEvent, LogsAPI, PushLogOptions } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/logs/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAoE;AAEpE,qCAAsF;AAItF,SAAgB,iBAAiB,CAC/B,cAA8B,EAC9B,MAAc,EACd,UAAsB,EACtB,KAAY,EACZ,SAAoB;IAEpB,cAAc,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAE9C,IAAI,WAAW,GAA2D,IAAI,CAAC;IAE/E,IAAM,OAAO,GAAuB,UAAC,IAAI,EAAE,EAAmC;YAAnC,qBAAiC,EAAE,KAAA,EAAjC,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,UAAU,gBAAA;QACrE,IAAI;YACF,IAAM,IAAI,GAA4B;gBACpC,IAAI,EAAE,8BAAiB,CAAC,GAAG;gBAC3B,OAAO,EAAE;oBACP,OAAO,EAAE,IAAI;yBACV,GAAG,CAAC,UAAC,GAAG;wBACP,IAAI;4BACF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;yBACpB;wBAAC,OAAO,GAAG,EAAE;4BACZ,OAAO,EAAE,CAAC;yBACX;oBACH,CAAC,CAAC;yBACD,IAAI,CAAC,GAAG,CAAC;oBACZ,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,uBAAe;oBAC/B,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;oBACtB,SAAS,EAAE,IAAA,2BAAmB,GAAE;oBAChC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE;iBACnC;gBACD,IAAI,EAAE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,IAAM,cAAc,GAAG;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,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../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType } from '../../transports';\nimport type { Transports } from '../../transports';\nimport { deepEqual, defaultLogLevel, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\nimport type { LogEvent, LogsAPI } from './types';\n\nexport function initializeLogsAPI(\n internalLogger: InternalLogger,\n config: Config,\n transports: Transports,\n metas: Metas,\n tracesApi: TracesAPI\n): LogsAPI {\n internalLogger.debug('Initializing logs API');\n\n let lastPayload: Pick<LogEvent, 'message' | 'level' | 'context'> | null = null;\n\n const pushLog: LogsAPI['pushLog'] = (args, { context, level, skipDedupe } = {}) => {\n try {\n const item: TransportItem<LogEvent> = {\n type: TransportItemType.LOG,\n payload: {\n message: args\n .map((arg) => {\n try {\n return String(arg);\n } catch (err) {\n return '';\n }\n })\n .join(' '),\n level: level ?? defaultLogLevel,\n context: context ?? {},\n timestamp: getCurrentTimestamp(),\n trace: tracesApi.getTraceContext(),\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n message: item.payload.message,\n level: item.payload.level,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping log push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing log\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing log\\n', err);\n }\n };\n\n return {\n pushLog,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/logs/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/logs/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseObject, LogLevel } from '../../utils';\nimport type { TraceContext } from '../traces';\n\nexport type LogContext = BaseObject;\n\nexport interface LogEvent {\n context: LogContext;\n level: LogLevel;\n message: string;\n timestamp: string;\n\n trace?: TraceContext;\n}\n\nexport interface PushLogOptions {\n context?: LogContext;\n level?: LogLevel;\n skipDedupe?: boolean;\n}\n\nexport interface LogsAPI {\n pushLog: (args: unknown[], options?: PushLogOptions) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/measurements/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAAhD,uHAAA,yBAAyB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/measurements/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAAhD,uHAAA,yBAAyB,OAAA","sourcesContent":["export { initializeMeasurementsAPI } from './initialize';\n\nexport type { MeasurementEvent, MeasurementsAPI, PushMeasurementOptions } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,+CAAoE;AAEpE,qCAAgD;AAIhD,SAAgB,yBAAyB,CACvC,cAA8B,EAC9B,MAAc,EACd,UAAsB,EACtB,KAAY,EACZ,SAAoB;IAEpB,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,IAAI,WAAW,GAAqD,IAAI,CAAC;IAEzE,IAAM,eAAe,GAAuC,UAAC,OAAO,EAAE,EAAmB;YAAnB,qBAAiB,EAAE,KAAA,EAAjB,UAAU,gBAAA;QAChF,IAAI;YACF,IAAM,IAAI,GAAoC;gBAC5C,IAAI,EAAE,8BAAiB,CAAC,WAAW;gBACnC,OAAO,wBACF,OAAO,KACV,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,GACnC;gBACD,IAAI,EAAE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,IAAM,cAAc,GAAG;gBACrB,IAAI,EAAE,IAA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AE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,IAAM,cAAc,GAAG;gBACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;gBACvB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;aAC5B,CAAC;YAEF,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAA,cAAM,EAAC,WAAW,CAAC,IAAI,IAAA,iBAAS,EAAC,cAAc,EAAE,WAAW,CAAC,EAAE;gBAClG,cAAc,CAAC,KAAK,CAAC,oEAAoE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEzG,OAAO;aACR;YAED,WAAW,GAAG,cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAEpD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC;IAEF,OAAO;QACL,eAAe,iBAAA;KAChB,CAAC;AACJ,CAAC;AA9CD,8DA8CC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType } from '../../transports';\nimport type { Transports } from '../../transports';\nimport { deepEqual, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\nimport type { MeasurementEvent, MeasurementsAPI } from './types';\n\nexport function initializeMeasurementsAPI(\n internalLogger: InternalLogger,\n config: Config,\n transports: Transports,\n metas: Metas,\n tracesApi: TracesAPI\n): MeasurementsAPI {\n internalLogger.debug('Initializing measurements API');\n\n let lastPayload: Pick<MeasurementEvent, 'type' | 'values'> | null = null;\n\n const pushMeasurement: MeasurementsAPI['pushMeasurement'] = (payload, { skipDedupe } = {}) => {\n try {\n const item: TransportItem<MeasurementEvent> = {\n type: TransportItemType.MEASUREMENT,\n payload: {\n ...payload,\n trace: tracesApi.getTraceContext(),\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n type: item.payload.type,\n values: item.payload.values,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping measurement push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing measurement\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing measurement\\n', err);\n }\n };\n\n return {\n pushMeasurement,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/measurements/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/measurements/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TraceContext } from '../traces';\n\nexport interface MeasurementEvent<V extends { [label: string]: number } = { [label: string]: number }> {\n type: string;\n values: V;\n\n trace?: TraceContext;\n}\n\nexport interface PushMeasurementOptions {\n skipDedupe?: boolean;\n}\n\nexport interface MeasurementsAPI {\n pushMeasurement: (payload: MeasurementEvent, options?: PushMeasurementOptions) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/meta/index.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/meta/index.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA","sourcesContent":["export { initializeMetaAPI } from './initialize';\n\nexport type { MetaAPI } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/meta/initialize.ts"],"names":[],"mappings":";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C9B,IAAI,QAAQ,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACxB;QAED,QAAQ,GAAG;YACT,IAAI,MAAA;SACL,CAAC;QAEF,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,IAAM,UAAU,GAAG,UAAC,OAAqB;QACvC,IAAI,WAAW,EAAE;YACf,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;SAC3B;QAED,WAAW,GAAG;YACZ,OAAO,SAAA;SACR,CAAC;QAEF,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,IAAM,UAAU,GAA0B,cAAM,OAAA,KAAK,CAAC,KAAK,CAAC,OAAO,EAAnB,CAAmB,CAAC;IAEpE,OAAO;QACL,OAAO,SAAA;QACP,SAAS,EAAE,OAAO;QAClB,UAAU,YAAA;QACV,YAAY,EAAE,UAAU;QACxB,UAAU,YAAA;KACX,CAAC;AACJ,CAAC;AA5CD,8CA4CC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Meta, Metas, MetaSession, MetaUser } from '../../metas';\nimport type { Transports } from '../../transports';\nimport type { MetaAPI } from './types';\n\nexport function initializeMetaAPI(\n internalLogger: InternalLogger,\n _config: Config,\n _transports: Transports,\n metas: Metas\n): MetaAPI {\n internalLogger.debug('Initializing meta API');\n\n let metaSession: Partial<Meta> | undefined = undefined;\n let metaUser: Partial<Meta> | undefined = undefined;\n\n const setUser = (user?: MetaUser) => {\n if (metaUser) {\n metas.remove(metaUser);\n }\n\n metaUser = {\n user,\n };\n\n metas.add(metaUser);\n };\n\n const setSession = (session?: MetaSession) => {\n if (metaSession) {\n metas.remove(metaSession);\n }\n\n metaSession = {\n session,\n };\n\n metas.add(metaSession);\n };\n\n const getSession: MetaAPI['getSession'] = () => metas.value.session;\n\n return {\n setUser,\n resetUser: setUser,\n setSession,\n resetSession: setSession,\n getSession,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/meta/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/meta/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MetaSession, MetaUser } from '../../metas';\n\nexport interface MetaAPI {\n setUser: (user: MetaUser) => void;\n resetUser: () => void;\n setSession: (session: MetaSession) => void;\n resetSession: () => void;\n getSession: () => MetaSession | undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/traces/index.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/traces/index.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA","sourcesContent":["export { initializeTracesAPI } from './initialize';\n\nexport type { OTELApi, TraceContext, TraceEvent, TracesAPI } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/traces/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;AAGhF,SAAgB,mBAAmB,CACjC,cAA8B,EAC9B,OAAe,EACf,UAAsB,EACtB,KAAY;IAEZ,cAAc,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAEhD,IAAI,IAAI,GAAwB,SAAS,CAAC;IAE1C,IAAM,QAAQ,GAA0B,UAAC,KAAK,EAAE,OAAO;QACrD,cAAc,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAEnD,IAAI,GAAG;YACL,KAAK,OAAA;YACL,OAAO,SAAA;SACR,CAAC;IACJ,CAAC,CAAC;IAEF,IAAM,eAAe,GAAiC;QACpD,IAAM,GAA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import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType, Transports } from '../../transports';\nimport type { OTELApi, TraceEvent, TracesAPI } from './types';\n\nexport function initializeTracesAPI(\n internalLogger: InternalLogger,\n _config: Config,\n transports: Transports,\n metas: Metas\n): TracesAPI {\n internalLogger.debug('Initializing traces API');\n\n let otel: OTELApi | undefined = undefined;\n\n const initOTEL: TracesAPI['initOTEL'] = (trace, context) => {\n internalLogger.debug('Initializing OpenTelemetry');\n\n otel = {\n trace,\n context,\n };\n };\n\n const getTraceContext: TracesAPI['getTraceContext'] = () => {\n const ctx = otel?.trace.getSpanContext(otel.context.active());\n\n return !ctx\n ? undefined\n : {\n trace_id: ctx.traceId,\n span_id: ctx.spanId,\n };\n };\n\n const pushTraces: TracesAPI['pushTraces'] = (payload) => {\n try {\n const item: TransportItem<TraceEvent> = {\n type: TransportItemType.TRACE,\n payload,\n meta: metas.value,\n };\n\n internalLogger.debug('Pushing trace\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing trace\\n', err);\n }\n };\n\n const getOTEL: TracesAPI['getOTEL'] = () => otel;\n\n const isOTELInitialized: TracesAPI['isOTELInitialized'] = () => !!otel;\n\n return {\n getOTEL,\n getTraceContext,\n initOTEL,\n isOTELInitialized,\n pushTraces,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/traces/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/traces/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextAPI as OTELContextAPI, TraceAPI as OTELTraceAPI } from '@opentelemetry/api';\nimport type { IResourceSpans } from '@opentelemetry/otlp-transformer';\n\n// TODO: Revert temporary patching\n// in latest OpenTelemetry packages protobuf type \"instrumentationLibrary\" has been renamed to \"scope\"\n// however on the Grafana Agent we use older OTel collector that doesn't have this change\n// temporarily patching types to the old shape until Grafana Agent catches up to otel-collector >= 0.52\nexport interface TraceEvent {\n resourceSpans?: IResourceSpans[];\n}\n\nexport interface OTELApi {\n trace: OTELTraceAPI;\n context: OTELContextAPI;\n}\n\nexport interface TracesAPI {\n getOTEL: () => OTELApi | undefined;\n getTraceContext: () => TraceContext | undefined;\n initOTEL: (trace: OTELTraceAPI, context: OTELContextAPI) => void;\n isOTELInitialized: () => boolean;\n pushTraces: (traces: TraceEvent) => void;\n}\n\n// trace context for logs, exceptions, measurements\nexport interface TraceContext {\n trace_id: string;\n span_id: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventEvent, EventsAPI } from './events';\nimport type { ExceptionEvent, ExceptionsAPI } from './exceptions';\nimport type { LogEvent, LogsAPI } from './logs';\nimport type { MeasurementEvent, MeasurementsAPI } from './measurements';\nimport type { MetaAPI } from './meta';\nimport type { TraceEvent, TracesAPI } from './traces';\n\nexport type APIEvent = LogEvent | ExceptionEvent | MeasurementEvent | TraceEvent | EventEvent;\n\nexport type API = LogsAPI & ExceptionsAPI & MeasurementsAPI & TracesAPI & MetaAPI & EventsAPI;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/config/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/config/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,MAAM,CAAC","sourcesContent":["export const defaultGlobalObjectKey = 'faro';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA","sourcesContent":["export { defaultGlobalObjectKey } from './const';\n\nexport type { Config, Patterns } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { MetaApp, MetaItem, MetaSession, MetaUser } from '../metas';\nimport type { BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Config<P = APIEvent> {\n app: MetaApp;\n dedupe: boolean;\n globalObjectKey: string;\n isolate: boolean;\n instrumentations: Instrumentation[];\n internalLoggerLevel: InternalLoggerLevel;\n metas: MetaItem[];\n parseStacktrace: StacktraceParser;\n paused: boolean;\n preventGlobalExposure: boolean;\n transports: Transport[];\n unpatchedConsole: UnpatchedConsole;\n\n beforeSend?: BeforeSendHook<P>;\n ignoreErrors?: Patterns;\n session?: MetaSession;\n user?: MetaUser;\n eventDomain?: string;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalObject.js","sourceRoot":"","sources":["../../../src/globalObject/globalObject.ts"],"names":[],"mappings":";;;AAQA,mGAAmG;AACtF,QAAA,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"globalObject.js","sourceRoot":"","sources":["../../../src/globalObject/globalObject.ts"],"names":[],"mappings":";;;AAQA,mGAAmG;AACtF,QAAA,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAiB,CAAC","sourcesContent":["import type { Faro, internalGlobalObjectKey } from '../sdk';\n\nexport type GlobalObject<T = typeof window | typeof global> = T & {\n [label: string]: Faro;\n\n [internalGlobalObjectKey]: Faro;\n};\n\n// This does not uses isUndefined method because it will throw an error in non-browser environments\nexport const globalObject = (typeof window === 'undefined' ? global : window) as GlobalObject;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/globalObject/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/globalObject/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export { globalObject } from './globalObject';\nexport type { GlobalObject } from './globalObject';\n"]}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAMe;AALb,2FAAA,IAAI,OAAA;AACJ,sHAAA,+BAA+B,OAAA;AAC/B,8GAAA,uBAAuB,OAAA;AACvB,mHAAA,4BAA4B,OAAA;AAC5B,oHAAA,6BAA6B,OAAA;AAI/B,6BAA6C;AAApC,2GAAA,oBAAoB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAMe;AALb,2FAAA,IAAI,OAAA;AACJ,sHAAA,+BAA+B,OAAA;AAC/B,8GAAA,uBAAu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A;AACX,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,yGAAA,gBAAgB,OAAA;AAChB,mGAAA,UAAU,OAAA;AACV,mGAAA,UAAU,OAAA;AACV,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,6FAAA,IAAI,OAAA;AAaN,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB,uCAAyC;AAAhC,uGAAA,WAAW,OAAA","sourcesContent":["export {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport { defaultExceptionType } from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n} from './api';\n\nexport { globalObject } from './globalObject';\nexport type { GlobalObject } from './globalObject';\n\nexport { initializeFaro } from './initialize';\n\nexport { defaultGlobalObjectKey } from './config';\nexport type { Config, Patterns } from './config';\n\nexport { BaseInstrumentation } from './instrumentations';\nexport type { Instrumentation, Instrumentations } from './instrumentations';\n\nexport { createInternalLogger, defaultInternalLoggerLevel, InternalLoggerLevel } from './internalLogger';\nexport type { InternalLogger } from './internalLogger';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n} from './metas';\n\nexport { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';\nexport type {\n BeforeSendHook,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n} from './transports';\n\nexport { defaultUnpatchedConsole } from './unpatchedConsole';\nexport type { UnpatchedConsole } from './unpatchedConsole';\n\nexport {\n allLogLevels,\n BaseExtension,\n createPromiseBuffer,\n deepEqual,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\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 LogLevel,\n noop,\n} from './utils';\nexport type {\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BufferItem,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n} from './utils';\n\nexport { VERSION } from './version';\n\nexport { Conventions } from './semantic';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":";;;AAAA,6BAAsC;AAEtC,uDAAgE;AAChE,mDAA4D;AAC5D,iCAA0C;AAE1C,6BAAmE;AACnE,2CAAoD;AACpD,uDAAgE;AAEhE,SAAgB,cAAc,CAAC,MAAc;;IAC3C,IAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,MAAM,CAAC,CAAC;IAC5D,IAAM,cAAc,GAAG,IAAA,yCAAwB,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAE1E,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,IAAI,IAAA,kCAA4B,GAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACrD,cAAc,CAAC,KAAK,CAClB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;IAE1E,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,IAAI,IAAA,kCAA4B,GAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACrD,cAAc,CAAC,KAAK,CAClB,oIAAoI,CACrI,CAAC;QAEF,OAAO,SAAU,CAAC;KACnB;IAED,IAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACtD,IAAM,UAAU,GAAG,IAAA,iCAAoB,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAChE,IAAM,GAAG,GAAG,IAAA,mBAAa,EAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAErE,IAAI,MAAM,CAAC,OAAO,EAAE;QAClB,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;KAChC;IAED,IAAM,IAAI,GAAG,IAAA,kBAAY,EAAC,cAAc,EAAE;QACxC,GAAG,KAAA;QACH,MAAM,QAAA;QACN,cAAc,gBAAA;QACd,KAAK,OAAA;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,UAAU,YAAA;QACV,gBAAgB,kBAAA;QAChB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,gBAAgB,EAAE,IAAA,6CAA0B,EAAC,cAAc,EAAE,MAAM,CAAC;KACrE,CAAC,CAAC;IAEH,qEAAqE;IACrE,CAAA,KAAA,IAAI,CAAC,gBAAgB,CAAA,CAAC,GAAG,WAAI,MAAM,CAAC,gBAAgB,EAAE;IAEtD,OAAO,IAAI,CAAC;AACd,CAAC;AAtCD,wCAsCC","sourcesContent":["import { initializeAPI } from './api';\nimport type { Config } from './config';\nimport { initializeInstrumentations } from './instrumentations';\nimport { initializeInternalLogger } from './internalLogger';\nimport { initializeMetas } from './metas';\nimport type { Faro } from './sdk';\nimport { isInternalFaroOnGlobalObject, registerFaro } from './sdk';\nimport { initializeTransports } from './transports';\nimport { initializeUnpatchedConsole } from './unpatchedConsole';\n\nexport function initializeFaro(config: Config): Faro {\n const unpatchedConsole = initializeUnpatchedConsole(config);\n const internalLogger = initializeInternalLogger(unpatchedConsole, config);\n\n internalLogger.debug('Initializing');\n\n if (isInternalFaroOnGlobalObject() && !config.isolate) {\n internalLogger.error(\n 'Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the \"isolate\" property'\n );\n\n return undefined!;\n }\n\n const metas = initializeMetas(internalLogger, config);\n const transports = initializeTransports(internalLogger, config);\n const api = initializeAPI(internalLogger, config, transports, metas);\n\n if (config.session) {\n api.setSession(config.session);\n }\n\n const faro = registerFaro(internalLogger, {\n api,\n config,\n internalLogger,\n metas,\n pause: transports.pause,\n transports,\n unpatchedConsole,\n unpause: transports.unpause,\n instrumentations: initializeInstrumentations(internalLogger, config),\n });\n\n // make sure Faro is initialized before initializing instrumentations\n faro.instrumentations.add(...config.instrumentations);\n\n return faro;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAAyC;AAGzC;IAAkD,uCAAa;IAA/D;;IAEA,CAAC;IAAD,0BAAC;AAAD,CAAC,AAFD,CAAkD,qBAAa,GAE9D;AAFqB,kDAAmB"}
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAAyC;AAGzC;IAAkD,uCAAa;IAA/D;;IAEA,CAAC;IAAD,0BAAC;AAAD,CAAC,AAFD,CAAkD,qBAAa,GAE9D;AAFqB,kDAAmB","sourcesContent":["import { BaseExtension } from '../utils';\nimport type { Instrumentation } from './types';\n\nexport abstract class BaseInstrumentation extends BaseExtension implements Instrumentation {\n abstract initialize(): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instrumentations/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAE5B,2CAA0D;AAAjD,wHAAA,0BAA0B,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instrumentations/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAE5B,2CAA0D;AAAjD,wHAAA,0BAA0B,OAAA","sourcesContent":["export { BaseInstrumentation } from './base';\n\nexport { initializeInstrumentations } from './initialize';\n\nexport type { Instrumentation, Instrumentations } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/instrumentations/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,SAAgB,0BAA0B,CAAC,cAA8B,EAAE,OAAe;IACxF,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,IAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,IAAM,GAAG,GAA4B;QAAC,6BAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,wCAAsB;;QAC1D,cAAc,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEhD,mBAAmB,CAAC,OAAO,CAAC,UAAC,kBAAkB;YAC7C,cAAc,CAAC,KAAK,CAAC,mBAAW,kBAAkB,CAAC,IAAI,uBAAmB,CAAC,CAAC;YAE5E,IAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAClC,UAAC,uBAAuB,IAAK,OAAA,uBAAuB,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,EAAxD,CAAwD,CACtF,CAAC;YAEF,IAAI,MAAM,EAAE;gBACV,cAAc,CAAC,IAAI,CAAC,oBAAa,kBAAkB,CAAC,IAAI,sBAAmB,CAAC,CAAC;gBAE7E,OAAO;aACR;YAED,gBAAgB,CAAC,IAAI,CA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AC,IAAI,KAAK,uBAAuB,CAAC,IAAI,EAAE;oBACjF,OAAO,sBAAsB,CAAC;iBAC/B;gBAED,OAAO,IAAI,CAAC;YACd,CAAC,EACD,IAAI,CACL,CAAC;YAEF,IAAI,CAAC,4BAA4B,EAAE;gBACjC,cAAc,CAAC,IAAI,CAAC,4BAAoB,uBAAuB,CAAC,IAAI,oBAAgB,CAAC,CAAC;gBAEtF,OAAO;aACR;YAED,MAAA,MAAA,gBAAgB,CAAC,4BAA4B,CAAE,EAAC,OAAO,kDAAI,CAAC;YAC5D,gBAAgB,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,KAAA;QACH,IAAI,gBAAgB;YAClB,yBAAW,gBAAgB,QAAE;QAC/B,CAAC;QACD,MAAM,QAAA;KACP,CAAC;AACJ,CAAC;AA7DD,gEA6DC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Instrumentation, Instrumentations } from './types';\n\nexport function initializeInstrumentations(internalLogger: InternalLogger, _config: Config): Instrumentations {\n internalLogger.debug('Initializing instrumentations');\n\n const instrumentations: Instrumentation[] = [];\n\n const add: Instrumentations['add'] = (...newInstrumentations) => {\n internalLogger.debug('Adding instrumentations');\n\n newInstrumentations.forEach((newInstrumentation) => {\n internalLogger.debug(`Adding \"${newInstrumentation.name}\" instrumentation`);\n\n const exists = instrumentations.some(\n (existingInstrumentation) => existingInstrumentation.name === newInstrumentation.name\n );\n\n if (exists) {\n internalLogger.warn(`Transport ${newInstrumentation.name} is already added`);\n\n return;\n }\n\n instrumentations.push(newInstrumentation);\n newInstrumentation.initialize();\n });\n };\n\n const remove: Instrumentations['remove'] = (...instrumentationsToRemove) => {\n internalLogger.debug('Removing instrumentations');\n\n instrumentationsToRemove.forEach((instrumentationToRemove) => {\n internalLogger.debug(`Removing \"${instrumentationToRemove.name}\" instrumentation`);\n\n const existingInstrumentationIndex = instrumentations.reduce<number | null>(\n (acc, existingInstrumentation, existingTransportIndex) => {\n if (acc === null && existingInstrumentation.name === instrumentationToRemove.name) {\n return existingTransportIndex;\n }\n\n return null;\n },\n null\n );\n\n if (!existingInstrumentationIndex) {\n internalLogger.warn(`Instrumentation \"${instrumentationToRemove.name}\" is not added`);\n\n return;\n }\n\n instrumentations[existingInstrumentationIndex]!.destroy?.();\n instrumentations.splice(existingInstrumentationIndex, 1);\n });\n };\n\n return {\n add,\n get instrumentations() {\n return [...instrumentations];\n },\n remove,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/instrumentations/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/instrumentations/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extension } from '../utils';\n\nexport interface Instrumentation extends Extension {\n initialize: VoidFunction;\n\n destroy?: VoidFunction;\n}\n\nexport interface Instrumentations {\n add: (...instrumentations: Instrumentation[]) => void;\n instrumentations: Instrumentation[];\n remove: (...instrumentations: Instrumentation[]) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,kCAAgC;AAGhC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,2DAAO,CAAA;IACP,+DAAS,CAAA;IACT,6DAAQ,CAAA;IACR,6DAAQ,CAAA;IACR,mEAAW,CAAA;AACb,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B;AAEY,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAErC,QAAA,qBAAqB,GAAmB;IACnD,KAAK,EAAE,YAAI;IACX,KAAK,EAAE,YAAI;IACX,IAAI,EAAE,YAAI;IACV,MAAM,EAAE,mCAA2B;IACnC,IAAI,EAAE,YAAI;CACF,CAAC;AAEE,QAAA,0BAA0B,GAAG,mBAAmB,CAAC,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,kCAAgC;AAGhC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,2DAAO,CAAA;IACP,+DAAS,CAAA;IACT,6DAAQ,CAAA;IACR,6DAAQ,CAAA;IACR,mEAAW,CAAA;AACb,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B;AAEY,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAErC,QAAA,qBAAqB,GAAmB;IACnD,KAAK,EAAE,YAAI;IACX,KAAK,EAAE,YAAI;IACX,IAAI,EAAE,YAAI;IACV,MAAM,EAAE,mCAA2B;IACnC,IAAI,EAAE,YAAI;CACF,CAAC;AAEE,QAAA,0BAA0B,GAAG,mBAAmB,CAAC,KAAK,CAAC","sourcesContent":["import { noop } from '../utils';\nimport type { InternalLogger } from './types';\n\nexport enum InternalLoggerLevel {\n OFF = 0,\n ERROR = 1,\n WARN = 2,\n INFO = 3,\n VERBOSE = 4,\n}\n\nexport const defaultInternalLoggerPrefix = 'Faro';\n\nexport const defaultInternalLogger: InternalLogger = {\n debug: noop,\n error: noop,\n info: noop,\n prefix: defaultInternalLoggerPrefix,\n warn: noop,\n} as const;\n\nexport const defaultInternalLoggerLevel = InternalLoggerLevel.ERROR;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createInternalLogger.js","sourceRoot":"","sources":["../../../src/internalLogger/createInternalLogger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA8D;AAE9D,kCAAgC;AAChC,iCAAiG;AAGjG,SAAgB,oBAAoB,CAClC,gBAA4D,EAC5D,mBAAgD;IADhD,iCAAA,EAAA,mBAAqC,0CAAuB;IAC5D,oCAAA,EAAA,sBAAsB,kCAA0B;IAEh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gBACH,CAAC,CAAC,YAAI,CAAC;KACZ;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AArCD,oDAqCC"}
|
|
1
|
+
{"version":3,"file":"createInternalLogger.js","sourceRoot":"","sources":["../../../src/internalLogger/createInternalLogger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA8D;AAE9D,kCAAgC;AAChC,iCAAiG;AAGjG,SAAgB,oBAAoB,CAClC,gBAA4D,EAC5D,mBAAgD;IADhD,iCAAA,EAAA,mBAAqC,0CAAuB;IAC5D,oCAAA,EAAA,sBAAsB,kCAA0B;IAEhD,IAAM,cAAc,GAAG,6BAAqB,CAAC;IAE7C,IAAI,mBAAmB,GAAG,2BAAmB,CAAC,GAAG,EAAE;QACjD,cAAc,CAAC,KAAK;YAClB,mBAAmB,IAAI,2BAAmB,CAAC,KAAK;gBAC9C,CAAC,CAAC;oBAAU,cAAO;yBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;wBAAP,yBAAO;;oBACf,gBAAgB,CAAC,KAAK,OAAtB,gBAAgB,iBAAO,UAAG,cAAc,CAAC,MAAM,OAAI,GAAK,IAAI,UAAE;gBAChE,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,IAAI;YACjB,mBAAmB,IAAI,2BAAmB,CAAC,IAAI;gBAC7C,CAAC,CAAC;oBAAU,cAAO;yBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;wBAAP,yBAAO;;oBACf,gBAAgB,CAAC,IAAI,OAArB,gBAAgB,iBAAM,UAAG,cAAc,CAAC,MAAM,OAAI,GAAK,IAAI,UAAE;gBAC/D,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,IAAI;YACjB,mBAAmB,IAAI,2BAAmB,CAAC,IAAI;gBAC7C,CAAC,CAAC;oBAAU,cAAO;yBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;wBAAP,yBAAO;;oBACf,gBAAgB,CAAC,IAAI,OAArB,gBAAgB,iBAAM,UAAG,cAAc,CAAC,MAAM,OAAI,GAAK,IAAI,UAAE;gBAC/D,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,KAAK;YAClB,mBAAmB,IAAI,2BAAmB,CAAC,OAAO;gBAChD,CAAC,CAAC;oBAAU,cAAO;yBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;wBAAP,yBAAO;;oBACf,gBAAgB,CAAC,KAAK,OAAtB,gBAAgB,iBAAO,UAAG,cAAc,CAAC,MAAM,OAAI,GAAK,IAAI,UAAE;gBAChE,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;KACZ;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AArCD,oDAqCC","sourcesContent":["import { defaultUnpatchedConsole } from '../unpatchedConsole';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport { noop } from '../utils';\nimport { defaultInternalLogger, defaultInternalLoggerLevel, InternalLoggerLevel } from './const';\nimport type { InternalLogger } from './types';\n\nexport function createInternalLogger(\n unpatchedConsole: UnpatchedConsole = defaultUnpatchedConsole,\n internalLoggerLevel = defaultInternalLoggerLevel\n): InternalLogger {\n const internalLogger = defaultInternalLogger;\n\n if (internalLoggerLevel > InternalLoggerLevel.OFF) {\n internalLogger.error =\n internalLoggerLevel >= InternalLoggerLevel.ERROR\n ? function (...args) {\n unpatchedConsole.error(`${internalLogger.prefix}\\n`, ...args);\n }\n : noop;\n\n internalLogger.warn =\n internalLoggerLevel >= InternalLoggerLevel.WARN\n ? function (...args) {\n unpatchedConsole.warn(`${internalLogger.prefix}\\n`, ...args);\n }\n : noop;\n\n internalLogger.info =\n internalLoggerLevel >= InternalLoggerLevel.INFO\n ? function (...args) {\n unpatchedConsole.info(`${internalLogger.prefix}\\n`, ...args);\n }\n : noop;\n\n internalLogger.debug =\n internalLoggerLevel >= InternalLoggerLevel.VERBOSE\n ? function (...args) {\n unpatchedConsole.debug(`${internalLogger.prefix}\\n`, ...args);\n }\n : noop;\n }\n\n return internalLogger;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internalLogger/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,mHAAA,0BAA0B,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAExD,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAE7B,2CAAwE;AAA/D,sHAAA,wBAAwB,OAAA;AAAE,4GAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internalLogger/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,mHAAA,0BAA0B,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAExD,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAE7B,2CAAwE;AAA/D,sHAAA,wBAAwB,OAAA;AAAE,4GAAA,cAAc,OAAA","sourcesContent":["export { defaultInternalLoggerLevel, InternalLoggerLevel } from './const';\n\nexport { createInternalLogger } from './createInternalLogger';\n\nexport { initializeInternalLogger, internalLogger } from './initialize';\n\nexport type { InternalLogger } from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/internalLogger/initialize.ts"],"names":[],"mappings":";;;AAEA,iCAAgD;AAChD,+DAA8D;AAGnD,QAAA,cAAc,GAAmB,6BAAqB,CAAC;AAElE,SAAgB,wBAAwB,CAAC,gBAAkC,EAAE,MAAc;IACzF,sBAAc,GAAG,IAAA,2CAAoB,EAAC,gBAAgB,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAEpF,OAAO,sBAAc,CAAC;AACxB,CAAC;AAJD,4DAIC"}
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/internalLogger/initialize.ts"],"names":[],"mappings":";;;AAEA,iCAAgD;AAChD,+DAA8D;AAGnD,QAAA,cAAc,GAAmB,6BAAqB,CAAC;AAElE,SAAgB,wBAAwB,CAAC,gBAAkC,EAAE,MAAc;IACzF,sBAAc,GAAG,IAAA,2CAAoB,EAAC,gBAAgB,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAEpF,OAAO,sBAAc,CAAC;AACxB,CAAC;AAJD,4DAIC","sourcesContent":["import type { Config } from '../config';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport { defaultInternalLogger } from './const';\nimport { createInternalLogger } from './createInternalLogger';\nimport type { InternalLogger } from './types';\n\nexport let internalLogger: InternalLogger = defaultInternalLogger;\n\nexport function initializeInternalLogger(unpatchedConsole: UnpatchedConsole, config: Config): InternalLogger {\n internalLogger = createInternalLogger(unpatchedConsole, config.internalLoggerLevel);\n\n return internalLogger;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internalLogger/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internalLogger/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface InternalLogger {\n debug: Console['debug'];\n error: Console['error'];\n info: Console['info'];\n readonly prefix: string;\n warn: Console['warn'];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA","sourcesContent":["export { initializeMetas } from './initialize';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n} from './types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1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e,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,iBAAO;YAChB,YAAY,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAC,EAAiB;oBAAf,IAAI,UAAA,EAAE,OAAO,aAAA;gBAAO,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,CAAC;YAAnB,CAAmB,CAAC;SACtF;KACF,CAAC;IAEF,IAAI,MAAM,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;KAC1B;IAED,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;KAC5B;IAED,GAAG,8BAAC,OAAO,GAAK,CAAC,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;IAEtC,IAAM,WAAW,GAAyB,UAAC,QAAQ;QACjD,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,IAAM,cAAc,GAA4B,UAAC,QAAQ;QACvD,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,KAAK,QAAQ,EAAd,CAAc,CAAC,CAAC;IACtD,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,KAAA;QACH,MAAM,QAAA;QACN,WAAW,aAAA;QACX,cAAc,gBAAA;QACd,IAAI,KAAK;YACP,OAAO,QAAQ,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC;AA5DD,0CA4DC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport { isFunction } from '../utils';\nimport { VERSION } from '../version';\nimport type { Meta, MetaItem, Metas, MetasListener } from './types';\n\nexport function initializeMetas(internalLogger: InternalLogger, config: Config): Metas {\n let items: MetaItem[] = [];\n let listeners: MetasListener[] = [];\n\n const getValue = () => items.reduce<Meta>((acc, item) => Object.assign(acc, isFunction(item) ? item() : item), {});\n\n const notifyListeners = () => {\n if (listeners.length) {\n const value = getValue();\n listeners.forEach((listener) => listener(value));\n }\n };\n\n const add: Metas['add'] = (...newItems) => {\n internalLogger.debug('Adding metas\\n', newItems);\n items.push(...newItems);\n notifyListeners();\n };\n\n const remove: Metas['remove'] = (...itemsToRemove) => {\n internalLogger.debug('Removing metas\\n', itemsToRemove);\n items = items.filter((currentItem) => !itemsToRemove.includes(currentItem));\n notifyListeners();\n };\n\n const initial: Meta = {\n sdk: {\n name: '@grafana/faro-core',\n version: VERSION,\n integrations: config.instrumentations.map(({ name, version }) => ({ name, version })),\n },\n };\n\n if (config.app) {\n initial.app = config.app;\n }\n\n if (config.user) {\n initial.user = config.user;\n }\n\n add(initial, ...(config.metas ?? []));\n\n const addListener: Metas['addListener'] = (listener) => {\n listeners.push(listener);\n };\n\n const removeListener: Metas['removeListener'] = (listener) => {\n listeners = listeners.filter((l) => l !== listener);\n };\n\n return {\n add,\n remove,\n addListener,\n removeListener,\n get value() {\n return getValue();\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":""}
|
|
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 started?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/sdk/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/sdk/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,eAAe,CAAC","sourcesContent":["export const internalGlobalObjectKey = '_faroInternal';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faroGlobalObject.js","sourceRoot":"","sources":["../../../src/sdk/faroGlobalObject.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAG/C,SAAgB,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;QACtC,IAAI,CAAC,cAAc,CAAC,KAAK,CACvB,wEAAgE,IAAI,CAAC,MAAM,CAAC,eAAe,WAAO,CACnG,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,2BAAY,EAAE;YAC/C,IAAI,CAAC,cAAc,CAAC,IAAI,CACtB,oDAA4C,IAAI,CAAC,MAAM,CAAC,eAAe,yHAA+G,CACvL,CAAC;YAEF,OAAO;SACR;QAED,MAAM,CAAC,cAAc,CAAC,2BAAY,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC/D,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;KACJ;SAAM;QACL,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;KAC5F;AACH,CAAC;AAtBD,sDAsBC"}
|
|
1
|
+
{"version":3,"file":"faroGlobalObject.js","sourceRoot":"","sources":["../../../src/sdk/faroGlobalObject.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAG/C,SAAgB,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;QACtC,IAAI,CAAC,cAAc,CAAC,KAAK,CACvB,wEAAgE,IAAI,CAAC,MAAM,CAAC,eAAe,WAAO,CACnG,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,2BAAY,EAAE;YAC/C,IAAI,CAAC,cAAc,CAAC,IAAI,CACtB,oDAA4C,IAAI,CAAC,MAAM,CAAC,eAAe,yHAA+G,CACvL,CAAC;YAEF,OAAO;SACR;QAED,MAAM,CAAC,cAAc,CAAC,2BAAY,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC/D,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;KACJ;SAAM;QACL,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;KAC5F;AACH,CAAC;AAtBD,sDAsBC","sourcesContent":["import { globalObject } from '../globalObject';\nimport type { Faro } from './types';\n\nexport function setFaroOnGlobalObject(faro: Faro): void {\n if (!faro.config.preventGlobalExposure) {\n faro.internalLogger.debug(\n `Registering public faro reference in the global scope using \"${faro.config.globalObjectKey}\" key`\n );\n\n if (faro.config.globalObjectKey in globalObject) {\n faro.internalLogger.warn(\n `Skipping global registration due to key \"${faro.config.globalObjectKey}\" being used already. Please set \"globalObjectKey\" to something else or set \"preventGlobalExposure\" to \"true\"`\n );\n\n return;\n }\n\n Object.defineProperty(globalObject, faro.config.globalObjectKey, {\n configurable: false,\n writable: false,\n value: faro,\n });\n } else {\n faro.internalLogger.debug('Skipping registering public Faro instance in the global scope');\n }\n}\n"]}
|