@grafana/faro-core 1.0.0-beta3 → 1.0.0
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 +14 -12
- package/dist/bundle/faro-core.iife.js +1 -0
- package/dist/cjs/api/events/initialize.js +1 -1
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js +1 -1
- package/dist/cjs/api/exceptions/initialize.js.map +1 -1
- package/dist/cjs/api/initialize.js +3 -3
- package/dist/cjs/api/initialize.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js +1 -1
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js +1 -1
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/meta/initialize.js +14 -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/initialize.js +1 -1
- package/dist/cjs/api/traces/initialize.js.map +1 -1
- package/dist/cjs/config/types.js.map +1 -1
- package/dist/cjs/{utils/extensions.js → extensions/baseExtension.js} +15 -17
- package/dist/cjs/extensions/baseExtension.js.map +1 -0
- package/dist/cjs/extensions/index.js +6 -0
- package/dist/cjs/extensions/index.js.map +1 -0
- package/dist/cjs/extensions/types.js +3 -0
- package/dist/cjs/extensions/types.js.map +1 -0
- package/dist/cjs/index.js +12 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/initialize.js +11 -21
- package/dist/cjs/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/base.js +6 -3
- package/dist/cjs/instrumentations/base.js.map +1 -1
- package/dist/cjs/instrumentations/index.js +3 -1
- package/dist/cjs/instrumentations/index.js.map +1 -1
- package/dist/cjs/instrumentations/initialize.js +8 -2
- package/dist/cjs/instrumentations/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/registerInitial.js +9 -0
- package/dist/cjs/instrumentations/registerInitial.js.map +1 -0
- 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 +2 -1
- package/dist/cjs/internalLogger/index.js.map +1 -1
- package/dist/cjs/internalLogger/initialize.js.map +1 -1
- package/dist/cjs/metas/index.js +3 -1
- package/dist/cjs/metas/index.js.map +1 -1
- package/dist/cjs/metas/initialize.js +4 -30
- package/dist/cjs/metas/initialize.js.map +1 -1
- package/dist/cjs/metas/registerInitial.js +42 -0
- package/dist/cjs/metas/registerInitial.js.map +1 -0
- package/dist/cjs/metas/types.js.map +1 -1
- package/dist/cjs/sdk/faroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/index.js +3 -3
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/{register.js → registerFaro.js} +13 -3
- package/dist/cjs/sdk/registerFaro.js.map +1 -0
- package/dist/cjs/semantic.js +1 -0
- package/dist/cjs/semantic.js.map +1 -1
- package/dist/cjs/testUtils/mockConfig.js.map +1 -1
- package/dist/cjs/transports/base.js +2 -2
- package/dist/cjs/transports/base.js.map +1 -1
- package/dist/cjs/transports/index.js +3 -1
- package/dist/cjs/transports/index.js.map +1 -1
- package/dist/cjs/transports/initialize.js +5 -4
- package/dist/cjs/transports/initialize.js.map +1 -1
- package/dist/cjs/transports/registerInitial.js +11 -0
- package/dist/cjs/transports/registerInitial.js.map +1 -0
- package/dist/cjs/transports/types.js.map +1 -1
- package/dist/cjs/unpatchedConsole/initialize.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/index.js +1 -3
- package/dist/cjs/utils/index.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/initialize.js +1 -1
- package/dist/esm/api/events/initialize.js.map +1 -1
- package/dist/esm/api/exceptions/initialize.js +1 -1
- package/dist/esm/api/exceptions/initialize.js.map +1 -1
- package/dist/esm/api/initialize.js +3 -3
- package/dist/esm/api/initialize.js.map +1 -1
- package/dist/esm/api/logs/initialize.js +1 -1
- package/dist/esm/api/logs/initialize.js.map +1 -1
- package/dist/esm/api/measurements/initialize.js +1 -1
- package/dist/esm/api/measurements/initialize.js.map +1 -1
- package/dist/esm/api/meta/initialize.js +14 -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/initialize.js +1 -1
- package/dist/esm/api/traces/initialize.js.map +1 -1
- package/dist/esm/config/types.js.map +1 -1
- package/dist/esm/extensions/baseExtension.js +23 -0
- package/dist/esm/extensions/baseExtension.js.map +1 -0
- package/dist/esm/extensions/index.js +2 -0
- package/dist/esm/extensions/index.js.map +1 -0
- package/dist/esm/extensions/types.js +2 -0
- package/dist/esm/extensions/types.js.map +1 -0
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/initialize.js +14 -23
- package/dist/esm/initialize.js.map +1 -1
- package/dist/esm/instrumentations/base.js +6 -1
- package/dist/esm/instrumentations/base.js.map +1 -1
- package/dist/esm/instrumentations/index.js +1 -0
- package/dist/esm/instrumentations/index.js.map +1 -1
- package/dist/esm/instrumentations/initialize.js +8 -2
- package/dist/esm/instrumentations/initialize.js.map +1 -1
- package/dist/esm/instrumentations/registerInitial.js +4 -0
- package/dist/esm/instrumentations/registerInitial.js.map +1 -0
- 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 +1 -1
- package/dist/esm/internalLogger/index.js.map +1 -1
- package/dist/esm/internalLogger/initialize.js.map +1 -1
- package/dist/esm/metas/index.js +1 -0
- package/dist/esm/metas/index.js.map +1 -1
- package/dist/esm/metas/initialize.js +4 -18
- package/dist/esm/metas/initialize.js.map +1 -1
- package/dist/esm/metas/registerInitial.js +25 -0
- package/dist/esm/metas/registerInitial.js.map +1 -0
- package/dist/esm/metas/types.js.map +1 -1
- package/dist/esm/sdk/faroGlobalObject.js.map +1 -1
- package/dist/esm/sdk/index.js +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/esm/sdk/registerFaro.js +21 -0
- package/dist/esm/sdk/registerFaro.js.map +1 -0
- package/dist/esm/semantic.js +1 -0
- package/dist/esm/semantic.js.map +1 -1
- package/dist/esm/testUtils/mockConfig.js.map +1 -1
- package/dist/esm/transports/base.js +1 -1
- package/dist/esm/transports/base.js.map +1 -1
- package/dist/esm/transports/index.js +1 -0
- package/dist/esm/transports/index.js.map +1 -1
- package/dist/esm/transports/initialize.js +5 -4
- package/dist/esm/transports/initialize.js.map +1 -1
- package/dist/esm/transports/registerInitial.js +6 -0
- package/dist/esm/transports/registerInitial.js.map +1 -0
- package/dist/esm/transports/types.js.map +1 -1
- package/dist/esm/unpatchedConsole/initialize.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/index.js +0 -1
- package/dist/esm/utils/index.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/{cjs → types}/api/events/index.d.ts +0 -0
- package/dist/{cjs → types}/api/events/initialize.d.ts +2 -1
- package/dist/{cjs → types}/api/events/types.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/const.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/index.d.ts +0 -0
- package/dist/{cjs → types}/api/exceptions/initialize.d.ts +2 -1
- package/dist/{cjs → types}/api/exceptions/types.d.ts +0 -0
- package/dist/{cjs → types}/api/index.d.ts +0 -0
- package/dist/types/api/initialize.d.ts +7 -0
- package/dist/{cjs → types}/api/logs/index.d.ts +0 -0
- package/dist/{esm → types}/api/logs/initialize.d.ts +2 -1
- package/dist/{cjs → types}/api/logs/types.d.ts +0 -0
- package/dist/{cjs → types}/api/measurements/index.d.ts +0 -0
- package/dist/{esm → types}/api/measurements/initialize.d.ts +2 -1
- package/dist/{cjs → types}/api/measurements/types.d.ts +0 -0
- package/dist/{cjs → types}/api/meta/index.d.ts +0 -0
- package/dist/types/api/meta/initialize.d.ts +7 -0
- package/dist/types/api/meta/types.d.ts +10 -0
- package/dist/{cjs → types}/api/traces/index.d.ts +0 -0
- package/dist/types/api/traces/initialize.d.ts +7 -0
- package/dist/{cjs → types}/api/traces/types.d.ts +0 -0
- package/dist/{cjs → types}/api/types.d.ts +0 -0
- package/dist/{cjs → types}/config/const.d.ts +0 -0
- package/dist/{cjs → types}/config/index.d.ts +0 -0
- package/dist/{esm → types}/config/types.d.ts +2 -1
- package/dist/types/extensions/baseExtension.d.ts +15 -0
- package/dist/types/extensions/index.d.ts +2 -0
- package/dist/types/extensions/types.d.ts +16 -0
- package/dist/{cjs → types}/globalObject/globalObject.d.ts +0 -0
- package/dist/{cjs → types}/globalObject/index.d.ts +0 -0
- package/dist/{cjs → types}/index.d.ts +7 -5
- package/dist/{cjs → types}/initialize.d.ts +0 -0
- package/dist/{cjs → types}/instrumentations/base.d.ts +5 -1
- package/dist/{cjs → types}/instrumentations/index.d.ts +1 -0
- package/dist/types/instrumentations/initialize.d.ts +8 -0
- package/dist/types/instrumentations/registerInitial.d.ts +2 -0
- package/dist/{cjs → types}/instrumentations/types.d.ts +5 -1
- 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 +1 -1
- 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 +2 -1
- package/dist/types/metas/initialize.d.ts +5 -0
- package/dist/types/metas/registerInitial.d.ts +2 -0
- package/dist/{cjs → types}/metas/types.d.ts +4 -1
- 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 +1 -1
- package/dist/{cjs → types}/sdk/internalFaroGlobalObject.d.ts +0 -0
- package/dist/{esm/sdk/types.d.ts → types/sdk/registerFaro.d.ts} +3 -11
- package/dist/{cjs → types}/sdk/types.d.ts +0 -0
- package/dist/{cjs → types}/semantic.d.ts +1 -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 +1 -1
- package/dist/{cjs → types}/transports/const.d.ts +0 -0
- package/dist/{cjs → types}/transports/index.d.ts +1 -0
- package/dist/{cjs → types}/transports/initialize.d.ts +3 -1
- package/dist/types/transports/registerInitial.d.ts +2 -0
- package/dist/{esm → types}/transports/types.d.ts +1 -1
- package/dist/{cjs → types}/transports/utils.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/const.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/index.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/initialize.d.ts +0 -0
- package/dist/{cjs → types}/unpatchedConsole/types.d.ts +0 -0
- package/dist/{cjs → types}/utils/baseObject.d.ts +0 -0
- package/dist/types/utils/deepEqual.d.ts +1 -0
- package/dist/{cjs → types}/utils/getCurrentTimestamp.d.ts +0 -0
- package/dist/{cjs → types}/utils/index.d.ts +0 -2
- package/dist/{cjs → types}/utils/is.d.ts +0 -0
- package/dist/{cjs → types}/utils/logLevels.d.ts +0 -0
- package/dist/{cjs → types}/utils/noop.d.ts +0 -0
- package/dist/{cjs → types}/utils/promiseBuffer.d.ts +0 -0
- package/dist/{cjs → types}/utils/shortId.d.ts +0 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +21 -15
- package/dist/cjs/api/events/initialize.test.d.ts +0 -1
- package/dist/cjs/api/events/initialize.test.js +0 -92
- package/dist/cjs/api/events/initialize.test.js.map +0 -1
- package/dist/cjs/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/cjs/api/exceptions/initialize.test.js +0 -138
- package/dist/cjs/api/exceptions/initialize.test.js.map +0 -1
- package/dist/cjs/api/initialize.d.ts +0 -6
- package/dist/cjs/api/logs/initialize.d.ts +0 -7
- 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.d.ts +0 -7
- 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/meta/initialize.d.ts +0 -6
- package/dist/cjs/api/meta/types.d.ts +0 -8
- package/dist/cjs/api/traces/initialize.d.ts +0 -6
- 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/instrumentations/initialize.d.ts +0 -4
- package/dist/cjs/metas/initialize.d.ts +0 -4
- 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/sdk/register.d.ts +0 -4
- package/dist/cjs/sdk/register.js.map +0 -1
- package/dist/cjs/transports/transports.test.d.ts +0 -1
- package/dist/cjs/transports/transports.test.js +0 -141
- package/dist/cjs/transports/transports.test.js.map +0 -1
- package/dist/cjs/transports/types.d.ts +0 -37
- package/dist/cjs/utils/deepEqual.d.ts +0 -2
- package/dist/cjs/utils/extensions.d.ts +0 -19
- package/dist/cjs/utils/extensions.js.map +0 -1
- package/dist/cjs/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/cjs/utils/promiseBuffer.test.js +0 -146
- package/dist/cjs/utils/promiseBuffer.test.js.map +0 -1
- package/dist/cjs/version.d.ts +0 -1
- package/dist/esm/api/events/index.d.ts +0 -2
- package/dist/esm/api/events/initialize.d.ts +0 -7
- package/dist/esm/api/events/initialize.test.d.ts +0 -1
- package/dist/esm/api/events/initialize.test.js +0 -87
- package/dist/esm/api/events/initialize.test.js.map +0 -1
- package/dist/esm/api/events/types.d.ts +0 -15
- package/dist/esm/api/exceptions/const.d.ts +0 -1
- package/dist/esm/api/exceptions/index.d.ts +0 -3
- package/dist/esm/api/exceptions/initialize.d.ts +0 -7
- package/dist/esm/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/esm/api/exceptions/initialize.test.js +0 -133
- package/dist/esm/api/exceptions/initialize.test.js.map +0 -1
- package/dist/esm/api/exceptions/types.d.ts +0 -32
- package/dist/esm/api/index.d.ts +0 -9
- package/dist/esm/api/initialize.d.ts +0 -6
- package/dist/esm/api/logs/index.d.ts +0 -2
- package/dist/esm/api/logs/initialize.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.test.d.ts +0 -1
- package/dist/esm/api/measurements/initialize.test.js +0 -107
- package/dist/esm/api/measurements/initialize.test.js.map +0 -1
- package/dist/esm/api/measurements/types.d.ts +0 -16
- package/dist/esm/api/meta/index.d.ts +0 -2
- package/dist/esm/api/meta/initialize.d.ts +0 -6
- package/dist/esm/api/meta/types.d.ts +0 -8
- package/dist/esm/api/traces/index.d.ts +0 -2
- package/dist/esm/api/traces/initialize.d.ts +0 -6
- package/dist/esm/api/traces/types.d.ts +0 -20
- package/dist/esm/api/types.d.ts +0 -8
- package/dist/esm/config/const.d.ts +0 -1
- package/dist/esm/config/index.d.ts +0 -2
- package/dist/esm/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/register.js +0 -11
- package/dist/esm/sdk/register.js.map +0 -1
- package/dist/esm/semantic.d.ts +0 -7
- package/dist/esm/testUtils/index.d.ts +0 -6
- package/dist/esm/testUtils/mockConfig.d.ts +0 -2
- package/dist/esm/testUtils/mockInternalLogger.d.ts +0 -2
- package/dist/esm/testUtils/mockStacktraceParser.d.ts +0 -2
- package/dist/esm/testUtils/mockTransport.d.ts +0 -12
- package/dist/esm/testUtils/testPromise.d.ts +0 -7
- package/dist/esm/transports/base.d.ts +0 -6
- package/dist/esm/transports/const.d.ts +0 -8
- package/dist/esm/transports/index.d.ts +0 -5
- package/dist/esm/transports/initialize.d.ts +0 -6
- package/dist/esm/transports/transports.test.d.ts +0 -1
- package/dist/esm/transports/transports.test.js +0 -110
- package/dist/esm/transports/transports.test.js.map +0 -1
- package/dist/esm/transports/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/extensions.js +0 -23
- package/dist/esm/utils/extensions.js.map +0 -1
- package/dist/esm/utils/getCurrentTimestamp.d.ts +0 -1
- package/dist/esm/utils/index.d.ts +0 -12
- package/dist/esm/utils/is.d.ts +0 -31
- package/dist/esm/utils/logLevels.d.ts +0 -10
- package/dist/esm/utils/noop.d.ts +0 -1
- package/dist/esm/utils/promiseBuffer.d.ts +0 -14
- package/dist/esm/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/esm/utils/promiseBuffer.test.js +0 -87
- package/dist/esm/utils/promiseBuffer.test.js.map +0 -1
- package/dist/esm/utils/shortId.d.ts +0 -1
- package/dist/esm/version.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @grafana/faro-core
|
|
2
2
|
|
|
3
|
-
Core package of Faro.
|
|
4
|
-
|
|
5
3
|
_Warning_: currently pre-release and subject to frequent breaking changes. Use at your own risk.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Core package of Faro.
|
|
6
|
+
|
|
7
|
+
The entire architecture of the library is contained within this package. Out of the box, it doesn't collect any signals,
|
|
8
|
+
but it provides the API to do it as well as multiple helper methods.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -44,6 +44,7 @@ Besides the mandatory properties, Faro configuration also supports the following
|
|
|
44
44
|
| `ignoreErrors` | Error message patterns for errors that should be ignored | `Patterns` | `[]` |
|
|
45
45
|
| `session` | Session metadata | `Session` | `undefined` |
|
|
46
46
|
| `user` | User metadata | `User` | `undefined` |
|
|
47
|
+
| `view` | View metadata | `View` | `undefined` |
|
|
47
48
|
|
|
48
49
|
## Faro instance
|
|
49
50
|
|
|
@@ -200,7 +201,7 @@ Instrumentations are packages that leverage the Faro Web SDK API to provide auto
|
|
|
200
201
|
They are just simple functions that are executed when the agent is initialized.
|
|
201
202
|
|
|
202
203
|
Please note that the `core` package does not contain any instrumentations out of the box and they should be provided by
|
|
203
|
-
platform specific packages like [@grafana/faro-web-sdk]
|
|
204
|
+
platform specific packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
204
205
|
|
|
205
206
|
You can also write your own instrumentations:
|
|
206
207
|
|
|
@@ -228,7 +229,7 @@ Metas are objects that will be attached to every event that is triggered by the
|
|
|
228
229
|
|
|
229
230
|
Out of the box, only one meta is provided: `sdk` which contains information about the Faro instance and its version.
|
|
230
231
|
|
|
231
|
-
Additional metas may be provided by platform packages like [@grafana/faro-web-sdk]
|
|
232
|
+
Additional metas may be provided by platform packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
232
233
|
|
|
233
234
|
You can also define your own metas:
|
|
234
235
|
|
|
@@ -259,11 +260,11 @@ initializeFaro({
|
|
|
259
260
|
|
|
260
261
|
## Transports
|
|
261
262
|
|
|
262
|
-
Transports are functions that will be called for every event that is triggered by the API. They are used to do
|
|
263
|
-
|
|
263
|
+
Transports are functions that will be called for every event that is triggered by the API. They are used to do something
|
|
264
|
+
with the data after collecting it.
|
|
264
265
|
|
|
265
266
|
Out of the box, no transports are provided in the `core` package and they should be provided by platform specific
|
|
266
|
-
packages like [@grafana/faro-web-sdk]
|
|
267
|
+
packages like [@grafana/faro-web-sdk][faro-web-sdk-package].
|
|
267
268
|
|
|
268
269
|
You can also define your own transports:
|
|
269
270
|
|
|
@@ -293,9 +294,8 @@ faro.unpatchedConsole.warn('This is a warning');
|
|
|
293
294
|
|
|
294
295
|
## Pause / unpause
|
|
295
296
|
|
|
296
|
-
Faro instance can be paused by invoking `faro.pause()`.
|
|
297
|
-
|
|
298
|
-
Call `faro.unpause()` to resume capturing events.
|
|
297
|
+
Faro instance can be paused by invoking `faro.pause()`. This will prevent events from being sent to transports. Call
|
|
298
|
+
`faro.unpause()` to resume capturing events.
|
|
299
299
|
|
|
300
300
|
## Isolated Faro instances
|
|
301
301
|
|
|
@@ -334,3 +334,5 @@ Although an isolated agent may sound like a great idea, there are some limitatio
|
|
|
334
334
|
- an isolated Faro instance will not be available on the global object
|
|
335
335
|
- the Faro reference should be stored by the project as it won't be available via
|
|
336
336
|
`import { faro } from '@grafana/faro-core';`
|
|
337
|
+
|
|
338
|
+
[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";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function r(e,n){try{return e instanceof n}catch(e){return!1}}const o=e=>n(e,"undefined"),a=e=>n(e,"null"),i=e=>n(e,"string"),s=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),u=e=>!a(e)&&n(e,"object"),l=e=>n(e,"function"),g=e=>t(e,"Array"),c=!o(Event),d="undefined"!=typeof Error,p="undefined"!=typeof Element,f="undefined"!=typeof Map;function m(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const r=g(e),o=g(t);if(r!==o)return!1;if(r&&o){const n=e.length;if(n!==t.length)return!1;for(let r=n;0!=r--;)if(!m(e[r],t[r]))return!1;return!0}const a=u(e),i=u(t);if(a!==i)return!1;if(e&&t&&a&&i){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;for(let r of n)if(!m(e[r],t[r]))return!1;return!0}return!1}function b(){return(new Date).toISOString()}var v;e.LogLevel=void 0,(v=e.LogLevel||(e.LogLevel={})).TRACE="trace",v.DEBUG="debug",v.INFO="info",v.LOG="log",v.WARN="warn",v.ERROR="error";const y=e.LogLevel.LOG,E=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function h(){}const I="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";var L;e.TransportItemType=void 0,(L=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",L.LOG="log",L.MEASUREMENT="measurement",L.TRACE="trace",L.EVENT="event";const T={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function O(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,r=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>i(e)?n.includes(e):!!n.match(e)))}(n,r))return null}return t}}var R;e.InternalLoggerLevel=void 0,(R=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[R.OFF=0]="OFF",R[R.ERROR=1]="ERROR",R[R.WARN=2]="WARN",R[R.INFO=3]="INFO",R[R.VERBOSE=4]="VERBOSE";const S={debug:h,error:h,info:h,prefix:"Faro",warn:h},x=e.InternalLoggerLevel.ERROR,A=Object.assign({},console);let j=A;function N(e){var n;return j=null!==(n=e.unpatchedConsole)&&void 0!==n?n:j,j}function k(n=A,t=x){const r=S;return t>e.InternalLoggerLevel.OFF&&(r.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${r.prefix}\n`,...e)}:h,r.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${r.prefix}\n`,...e)}:h,r.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${r.prefix}\n`,...e)}:h,r.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${r.prefix}\n`,...e)}:h),r}let C=S;function P(e,n){return C=k(e,n.internalLoggerLevel),C}class w{constructor(){this.unpatchedConsole=A,this.internalLogger=S,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}const F="Error";let $;function D(n,t,r,o,i){t.debug("Initializing API");const s=function(n,t,r,o,a){let i;return t.debug("Initializing traces API"),{getOTEL:()=>i,getTraceContext:()=>{const e=null==i?void 0:i.trace.getSpanContext(i.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,n)=>{t.debug("Initializing OpenTelemetry"),i={trace:e,context:n}},isOTELInitialized:()=>!!i,pushTraces:n=>{try{const r={type:e.TransportItemType.TRACE,payload:n,meta:o.value};t.debug("Pushing trace\n",r),a.execute(r)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,o,i);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s),function(n,t,r,o,i,s){var u;t.debug("Initializing exceptions API");let l=null;$=null!==(u=r.parseStacktrace)&&void 0!==u?u:$;const g=e=>{t.debug("Changing stacktrace parser"),$=null!=e?e:$};return g(r.parseStacktrace),{changeStacktraceParser:g,getStacktraceParser:()=>$,pushError:(n,{skipDedupe:u,stackFrames:g,type:c}={})=>{c=c||n.name||F;const d={meta:o.value,payload:{type:c,value:n.message,timestamp:b(),trace:s.getTraceContext()},type:e.TransportItemType.EXCEPTION};(null==(g=null!=g?g:n.stack?null==$?void 0:$(n).frames:void 0)?void 0:g.length)&&(d.payload.stacktrace={frames:g});const p={type:d.payload.type,value:d.payload.value,stackTrace:d.payload.stacktrace};u||!r.dedupe||a(l)||!m(p,l)?(l=p,t.debug("Pushing exception\n",d),i.execute(d)):t.debug("Skipping error push because it is the same as the last one\n",d.payload)}}}(0,t,r,o,i,s)),function(e,n,t,r,o){let a,i,s;n.debug("Initializing meta API");const u=e=>{i&&r.remove(i),i={user:e},r.add(i)},l=e=>{a&&r.remove(a),a={session:e},r.add(a)};return{setUser:u,resetUser:u,setSession:l,resetSession:l,getSession:()=>r.value.session,setView:e=>{s&&r.remove(s),s={view:e},r.add(s)},getView:()=>r.value.view}}(0,t,0,o)),function(n,t,r,o,i,s){t.debug("Initializing logs API");let u=null;return{pushLog:(n,{context:l,level:g,skipDedupe:c}={})=>{try{const d={type:e.TransportItemType.LOG,payload:{message:n.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=g?g:y,context:null!=l?l:{},timestamp:b(),trace:s.getTraceContext()},meta:o.value},p={message:d.payload.message,level:d.payload.level,context:d.payload.context};if(!c&&r.dedupe&&!a(u)&&m(p,u))return void t.debug("Skipping log push because it is the same as the last one\n",d.payload);u=p,t.debug("Pushing log\n",d),i.execute(d)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,r,o,i,s)),function(n,t,r,o,i,s){t.debug("Initializing measurements API");let u=null;return{pushMeasurement:(n,{skipDedupe:l}={})=>{try{const g={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:s.getTraceContext()}),meta:o.value},c={type:g.payload.type,values:g.payload.values};if(!l&&r.dedupe&&!a(u)&&m(c,u))return void t.debug("Skipping measurement push because it is the same as the last one\n",g.payload);u=c,t.debug("Pushing measurement\n",g),i.execute(g)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,r,o,i,s)),function(n,t,r,o,i,s){let u=null;return{pushEvent:(n,l,g,{skipDedupe:c}={})=>{try{const d={meta:o.value,payload:{name:n,domain:null!=g?g:r.eventDomain,attributes:l,timestamp:b(),trace:s.getTraceContext()},type:e.TransportItemType.EVENT},p={name:d.payload.name,attributes:d.payload.attributes,domain:d.payload.domain};if(!c&&r.dedupe&&!a(u)&&m(p,u))return void t.debug("Skipping event push because it is the same as the last one\n",d.payload);u=p,t.debug("Pushing event\n",d),i.execute(d)}catch(e){t.error("Error pushing event",e)}}}}(0,t,r,o,i,s))}const G="undefined"==typeof window?global:window;const B="1.0.0";const z="_faroInternal";function M(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(G,z,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function U(){return z in G}function V(n,t,r,o,a,i,s){return t.debug("Initializing Faro"),e.faro={api:i,config:r,instrumentations:s,internalLogger:t,metas:o,pause:a.pause,transports:a,unpatchedConsole:n,unpause:a.unpause},M(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 G)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(G,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}e.faro={};return e.BaseExtension=w,e.BaseInstrumentation=class extends w{constructor(){super(...arguments),this.api={},this.transports={}}},e.BaseTransport=class extends w{getIgnoreUrls(){return[]}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.VERSION=B,e.allLogLevels=E,e.createInternalLogger=k,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=m,e.defaultExceptionType=F,e.defaultGlobalObjectKey="faro",e.defaultInternalLoggerLevel=x,e.defaultLogLevel=y,e.defaultUnpatchedConsole=A,e.genShortID=function(e=10){return Array.from(Array(e)).map((()=>I[Math.floor(Math.random()*I.length)])).join("")},e.getCurrentTimestamp=b,e.getInternalFaroFromGlobalObject=function(){return G[z]},e.getTransportBody=function(n){return{[T[n.type]]:n.type===e.TransportItemType.TRACE?n.payload:[n.payload],meta:n.meta}},e.globalObject=G,e.initializeFaro=function(e){const n=N(e),t=P(n,e);if(U()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const r=function(e,n,t){let r=[],o=[];const a=()=>r.reduce(((e,n)=>Object.assign(e,l(n)?n():n)),{}),i=()=>{if(o.length){const e=a();o.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),r.push(...e),i()},remove:(...e)=>{n.debug("Removing metas\n",e),r=r.filter((n=>!e.includes(n))),i()},addListener:e=>{n.debug("Adding metas listener\n",e),o.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),o=o.filter((n=>n!==e))},get value(){return a()}}}(0,t),o=function(e,n,t,r){n.debug("Initializing transports");const o=[];let a=t.paused,i=[];return{add:(...a)=>{n.debug("Adding transports"),a.forEach((a=>{n.debug(`Adding "${a.name}" transport`),o.some((e=>e===a))?n.warn(`Transport ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=r,o.push(a))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",i),e.forEach((e=>{e&&i.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&i.push(O(e))}))},getBeforeSendHooks:()=>[...i],execute:e=>{if(!a){let t=e;for(const e of i){const n=e(t);if(null===n)return;t=n}for(const e of o)n.debug(`Transporting item using ${e.name}\n`,t),e.send(t)}},isPaused:()=>a,pause:()=>{n.debug("Pausing transports"),a=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=o.indexOf(e);-1!==t?o.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{i.filter((n=>!e.includes(n)))},get transports(){return[...o]},unpause:()=>{n.debug("Unpausing transports"),a=!1}}}(n,t,e,r),a=D(0,t,e,r,o),i=function(e,n,t,r,o,a){n.debug("Initializing instrumentations");const i=[];return{add:(...s)=>{n.debug("Adding instrumentations"),s.forEach((s=>{n.debug(`Adding "${s.name}" instrumentation`),i.some((e=>e.name===s.name))?n.warn(`Instrumentation ${s.name} is already added`):(s.unpatchedConsole=e,s.internalLogger=n,s.config=t,s.metas=r,s.transports=o,s.api=a,i.push(s),s.initialize())}))},get instrumentations(){return[...i]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,r;n.debug(`Removing "${e.name}" instrumentation`);const o=i.reduce(((n,t,r)=>null===n&&t.name===e.name?r:null),null);o?(null===(r=(t=i[o]).destroy)||void 0===r||r.call(t),i.splice(o,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,r,o,a),s=V(n,t,e,r,o,a,i);return function(e){var n;const t={sdk:{name:"@grafana/faro-core",version:B,integrations:e.config.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}};e.config.session&&e.api.setSession(e.config.session),e.config.app&&(t.app=e.config.app),e.config.user&&(t.user=e.config.user),e.config.view&&(t.view=e.config.view),e.metas.add(t,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(s),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(s),function(e){e.instrumentations.add(...e.config.instrumentations)}(s),s},e.internalGlobalObjectKey=z,e.isArray=g,e.isBoolean=e=>n(e,"boolean"),e.isDomError=e=>t(e,"DOMError"),e.isDomException=e=>t(e,"DOMException"),e.isElement=e=>p&&r(e,Element),e.isElementDefined=p,e.isError=e=>d&&r(e,Error),e.isErrorDefined=d,e.isErrorEvent=e=>t(e,"ErrorEvent"),e.isEvent=e=>c&&r(e,Event),e.isEventDefined=c,e.isFunction=l,e.isInstanceOf=r,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=U,e.isMap=e=>f&&r(e,Map),e.isMapDefined=f,e.isNull=a,e.isNumber=s,e.isObject=u,e.isPrimitive=e=>!u(e)&&!l(e),e.isRegExp=e=>t(e,"RegExp"),e.isString=i,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>l(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=o,e.noop=h,e.setInternalFaroOnGlobalObject=M,e.transportItemTypeToBodyKey=T,e}({});
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initializeEventsAPI = void 0;
|
|
4
4
|
var transports_1 = require("../../transports");
|
|
5
5
|
var utils_1 = require("../../utils");
|
|
6
|
-
function initializeEventsAPI(internalLogger, config,
|
|
6
|
+
function initializeEventsAPI(_unpatchedConsole, internalLogger, config, metas, transports, tracesApi) {
|
|
7
7
|
var lastPayload = null;
|
|
8
8
|
var pushEvent = function (name, attributes, domain, _a) {
|
|
9
9
|
var _b = _a === void 0 ? {} : _a, skipDedupe = _b.skipDedupe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/events/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/events/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;AAEhF,qCAAqE;AAKrE,SAAgB,mBAAmB,CACjC,iBAAmC,EACnC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,SAAoB;IAEpB,IAAI,WAAW,GAA8D,IAAI,CAAC;IAElF,IAAM,SAAS,GAA2B,UAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAmB;YAAnB,qBAAiB,EAAE,KAAA,EAAjB,UAAU,gBAAA;QAC/E,IAAI;YACF,IAAM,IAAI,GAA8B;gBACtC,IAAI,EAAE,KAAK,CAAC,KAAK;gBACjB,OAAO,EAAE;oBACP,IAAI,MAAA;oBACJ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,MAAM,CAAC,WAAW;oBACpC,UAAU,YAAA;oBACV,SAAS,EAAE,IAAA,2BAAmB,GAAE;oBAChC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE;iBACnC;gBACD,IAAI,EAAE,8BAAiB,CAAC,KAAK;aAC9B,CAAC;YAEF,IAAM,cAAc,GAAG;gBACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;gBACvB,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;gBACnC,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,8DAA8D,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEnG,OAAO;aACR;YAED,WAAW,GAAG,cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,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;AAjDD,kDAiDC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType, Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\n\nimport type { EventEvent, EventsAPI } from './types';\n\nexport function initializeEventsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\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"]}
|
|
@@ -5,7 +5,7 @@ var transports_1 = require("../../transports");
|
|
|
5
5
|
var utils_1 = require("../../utils");
|
|
6
6
|
var const_1 = require("./const");
|
|
7
7
|
var stacktraceParser;
|
|
8
|
-
function initializeExceptionsAPI(internalLogger, config,
|
|
8
|
+
function initializeExceptionsAPI(_unpatchedConsole, internalLogger, config, metas, transports, tracesApi) {
|
|
9
9
|
var _a;
|
|
10
10
|
internalLogger.debug('Initializing exceptions API');
|
|
11
11
|
var lastPayload = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/exceptions/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAqD;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/exceptions/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAqD;AAGrD,qCAAqE;AAGrE,iCAA+C;AAG/C,IAAI,gBAA8C,CAAC;AAEnD,SAAgB,uBAAuB,CACrC,iBAAmC,EACnC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,SAAoB;;IAEpB,cAAc,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAEpD,IAAI,WAAW,GAAiE,IAAI,CAAC;IAErF,gBAAgB,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,gBAAgB,CAAC;IAE9D,IAAM,sBAAsB,GAA4C,UAAC,mBAAmB;QAC1F,cAAc,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAEnD,gBAAgB,GAAG,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,gBAAgB,CAAC;IAC7D,CAAC,CAAC;IAEF,IAAM,mBAAmB,GAAyC,cAAM,OAAA,gBAAgB,EAAhB,CAAgB,CAAC;IAEzF,IAAM,SAAS,GAA+B,UAAC,KAAK,EAAE,EAAsC;YAAtC,qBAAoC,EAAE,KAAA,EAApC,UAAU,gBAAA,EAAE,WAAW,iBAAA,EAAE,IAAI,UAAA;QACnF,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,4BAAoB,CAAC;QAElD,IAAM,IAAI,GAAkC;YAC1C,IAAI,EAAE,KAAK,CAAC,KAAK;YACjB,OAAO,EAAE;gBACP,IAAI,MAAA;gBACJ,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAA,2BAAmB,GAAE;gBAChC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE;aACnC;YACD,IAAI,EAAE,8BAAiB,CAAC,SAAS;SAClC,CAAC;QAEF,WAAW,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAE1F,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,EAAE;YACvB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG;gBACxB,MAAM,EAAE,WAAW;aACpB,CAAC;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;AAtED,0DAsEC","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 type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\n\nimport { defaultExceptionType } from './const';\nimport type { ExceptionEvent, ExceptionsAPI, StacktraceParser } from './types';\n\nlet stacktraceParser: StacktraceParser | undefined;\n\nexport function initializeExceptionsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\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"]}
|
|
@@ -18,10 +18,10 @@ var logs_1 = require("./logs");
|
|
|
18
18
|
var measurements_1 = require("./measurements");
|
|
19
19
|
var meta_1 = require("./meta");
|
|
20
20
|
var traces_1 = require("./traces");
|
|
21
|
-
function initializeAPI(internalLogger, config,
|
|
21
|
+
function initializeAPI(unpatchedConsole, internalLogger, config, metas, transports) {
|
|
22
22
|
internalLogger.debug('Initializing API');
|
|
23
|
-
var tracesApi = (0, traces_1.initializeTracesAPI)(internalLogger, config,
|
|
24
|
-
return __assign(__assign(__assign(__assign(__assign(__assign({}, tracesApi), (0, exceptions_1.initializeExceptionsAPI)(internalLogger, config,
|
|
23
|
+
var tracesApi = (0, traces_1.initializeTracesAPI)(unpatchedConsole, internalLogger, config, metas, transports);
|
|
24
|
+
return __assign(__assign(__assign(__assign(__assign(__assign({}, tracesApi), (0, exceptions_1.initializeExceptionsAPI)(unpatchedConsole, internalLogger, config, metas, transports, tracesApi)), (0, meta_1.initializeMetaAPI)(unpatchedConsole, internalLogger, config, metas, transports)), (0, logs_1.initializeLogsAPI)(unpatchedConsole, internalLogger, config, metas, transports, tracesApi)), (0, measurements_1.initializeMeasurementsAPI)(unpatchedConsole, internalLogger, config, metas, transports, tracesApi)), (0, events_1.initializeEventsAPI)(unpatchedConsole, internalLogger, config, metas, transports, tracesApi));
|
|
25
25
|
}
|
|
26
26
|
exports.initializeAPI = initializeAPI;
|
|
27
27
|
//# sourceMappingURL=initialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/api/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/api/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAMA,mCAA+C;AAC/C,2CAAuD;AACvD,+BAA2C;AAC3C,+CAA2D;AAC3D,+BAA2C;AAC3C,mCAA+C;AAG/C,SAAgB,aAAa,CAC3B,gBAAkC,EAClC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB;IAEtB,cAAc,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAEzC,IAAM,SAAS,GAAG,IAAA,4BAAmB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAEnG,iEACK,SAAS,GACT,IAAA,oCAAuB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,GAC/F,IAAA,wBAAiB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,GAC9E,IAAA,wBAAiB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,GACzF,IAAA,wCAAyB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,GACjG,IAAA,4BAAmB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAC9F;AACJ,CAAC;AAnBD,sCAmBC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { Transports } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\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 unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports\n): API {\n internalLogger.debug('Initializing API');\n\n const tracesApi = initializeTracesAPI(unpatchedConsole, internalLogger, config, metas, transports);\n\n return {\n ...tracesApi,\n ...initializeExceptionsAPI(unpatchedConsole, internalLogger, config, metas, transports, tracesApi),\n ...initializeMetaAPI(unpatchedConsole, internalLogger, config, metas, transports),\n ...initializeLogsAPI(unpatchedConsole, internalLogger, config, metas, transports, tracesApi),\n ...initializeMeasurementsAPI(unpatchedConsole, internalLogger, config, metas, transports, tracesApi),\n ...initializeEventsAPI(unpatchedConsole, internalLogger, config, metas, transports, tracesApi),\n };\n}\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initializeLogsAPI = void 0;
|
|
4
4
|
var transports_1 = require("../../transports");
|
|
5
5
|
var utils_1 = require("../../utils");
|
|
6
|
-
function initializeLogsAPI(internalLogger, config,
|
|
6
|
+
function initializeLogsAPI(_unpatchedConsole, internalLogger, config, metas, transports, tracesApi) {
|
|
7
7
|
internalLogger.debug('Initializing logs API');
|
|
8
8
|
var lastPayload = null;
|
|
9
9
|
var pushLog = function (args, _a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/logs/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAoE;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/logs/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAoE;AAGpE,qCAAsF;AAKtF,SAAgB,iBAAiB,CAC/B,iBAAmC,EACnC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,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,OAAO;gBAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;aAC9B,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,4DAA4D,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEjG,OAAO;aACR;YAED,WAAW,GAAG,cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YAE5C,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,OAAO,SAAA;KACR,CAAC;AACJ,CAAC;AA3DD,8CA2DC","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 type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, defaultLogLevel, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\n\nimport type { LogEvent, LogsAPI } from './types';\n\nexport function initializeLogsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\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"]}
|
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.initializeMeasurementsAPI = void 0;
|
|
15
15
|
var transports_1 = require("../../transports");
|
|
16
16
|
var utils_1 = require("../../utils");
|
|
17
|
-
function initializeMeasurementsAPI(internalLogger, config,
|
|
17
|
+
function initializeMeasurementsAPI(_unpatchedConsole, internalLogger, config, metas, transports, tracesApi) {
|
|
18
18
|
internalLogger.debug('Initializing measurements API');
|
|
19
19
|
var lastPayload = null;
|
|
20
20
|
var pushMeasurement = function (payload, _a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,+CAAoE;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,+CAAoE;AAGpE,qCAAgD;AAKhD,SAAgB,yBAAyB,CACvC,iBAAmC,EACnC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,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,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;AA/CD,8DA+CC","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 type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\n\nimport type { MeasurementEvent, MeasurementsAPI } from './types';\n\nexport function initializeMeasurementsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\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,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initializeMetaAPI = void 0;
|
|
4
|
-
function initializeMetaAPI(internalLogger, _config,
|
|
4
|
+
function initializeMetaAPI(_unpatchedConsole, internalLogger, _config, metas, _transports) {
|
|
5
5
|
internalLogger.debug('Initializing meta API');
|
|
6
6
|
var metaSession = undefined;
|
|
7
7
|
var metaUser = undefined;
|
|
8
|
+
var metaView = undefined;
|
|
8
9
|
var setUser = function (user) {
|
|
9
10
|
if (metaUser) {
|
|
10
11
|
metas.remove(metaUser);
|
|
@@ -24,12 +25,24 @@ function initializeMetaAPI(internalLogger, _config, _transports, metas) {
|
|
|
24
25
|
metas.add(metaSession);
|
|
25
26
|
};
|
|
26
27
|
var getSession = function () { return metas.value.session; };
|
|
28
|
+
var setView = function (view) {
|
|
29
|
+
if (metaView) {
|
|
30
|
+
metas.remove(metaView);
|
|
31
|
+
}
|
|
32
|
+
metaView = {
|
|
33
|
+
view: view,
|
|
34
|
+
};
|
|
35
|
+
metas.add(metaView);
|
|
36
|
+
};
|
|
37
|
+
var getView = function () { return metas.value.view; };
|
|
27
38
|
return {
|
|
28
39
|
setUser: setUser,
|
|
29
40
|
resetUser: setUser,
|
|
30
41
|
setSession: setSession,
|
|
31
42
|
resetSession: setSession,
|
|
32
43
|
getSession: getSession,
|
|
44
|
+
setView: setView,
|
|
45
|
+
getView: getView,
|
|
33
46
|
};
|
|
34
47
|
}
|
|
35
48
|
exports.initializeMetaAPI = initializeMetaAPI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/meta/initialize.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/meta/initialize.ts"],"names":[],"mappings":";;;AAQA,SAAgB,iBAAiB,CAC/B,iBAAmC,EACnC,cAA8B,EAC9B,OAAe,EACf,KAAY,EACZ,WAAuB;IAEvB,cAAc,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAE9C,IAAI,WAAW,GAA8B,SAAS,CAAC;IACvD,IAAI,QAAQ,GAA8B,SAAS,CAAC;IACpD,IAAI,QAAQ,GAA8B,SAAS,CAAC;IAEpD,IAAM,OAAO,GAAuB,UAAC,IAAI;QACvC,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,GAA0B,UAAC,OAAO;QAChD,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,IAAM,OAAO,GAAuB,UAAC,IAAI;QACvC,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,OAAO,GAAuB,cAAM,OAAA,KAAK,CAAC,KAAK,CAAC,IAAI,EAAhB,CAAgB,CAAC;IAE3D,OAAO;QACL,OAAO,SAAA;QACP,SAAS,EAAE,OAA+B;QAC1C,UAAU,YAAA;QACV,YAAY,EAAE,UAAqC;QACnD,UAAU,YAAA;QACV,OAAO,SAAA;QACP,OAAO,SAAA;KACR,CAAC;AACJ,CAAC;AA9DD,8CA8DC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Meta, Metas } from '../../metas';\nimport type { Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\n\nimport type { MetaAPI } from './types';\n\nexport function initializeMetaAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n _config: Config,\n metas: Metas,\n _transports: Transports\n): MetaAPI {\n internalLogger.debug('Initializing meta API');\n\n let metaSession: Partial<Meta> | undefined = undefined;\n let metaUser: Partial<Meta> | undefined = undefined;\n let metaView: Partial<Meta> | undefined = undefined;\n\n const setUser: MetaAPI['setUser'] = (user) => {\n if (metaUser) {\n metas.remove(metaUser);\n }\n\n metaUser = {\n user,\n };\n\n metas.add(metaUser);\n };\n\n const setSession: MetaAPI['setSession'] = (session) => {\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 const setView: MetaAPI['setView'] = (view) => {\n if (metaView) {\n metas.remove(metaView);\n }\n\n metaView = {\n view,\n };\n\n metas.add(metaView);\n };\n\n const getView: MetaAPI['getView'] = () => metas.value.view;\n\n return {\n setUser,\n resetUser: setUser as MetaAPI['resetUser'],\n setSession,\n resetSession: setSession as MetaAPI['resetSession'],\n getSession,\n setView,\n getView,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/meta/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MetaSession, MetaUser, MetaView } from '../../metas';\n\nexport interface MetaAPI {\n setUser: (user?: MetaUser | undefined) => void;\n resetUser: () => void;\n setSession: (session?: MetaSession | undefined) => void;\n resetSession: () => void;\n getSession: () => MetaSession | undefined;\n setView: (view?: MetaView | undefined) => void;\n getView: () => MetaView | undefined;\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initializeTracesAPI = void 0;
|
|
4
4
|
var transports_1 = require("../../transports");
|
|
5
|
-
function initializeTracesAPI(internalLogger, _config,
|
|
5
|
+
function initializeTracesAPI(_unpatchedConsole, internalLogger, _config, metas, transports) {
|
|
6
6
|
internalLogger.debug('Initializing traces API');
|
|
7
7
|
var otel = undefined;
|
|
8
8
|
var initOTEL = function (trace, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/traces/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/traces/initialize.ts"],"names":[],"mappings":";;;AAGA,+CAAgF;AAKhF,SAAgB,mBAAmB,CACjC,iBAAmC,EACnC,cAA8B,EAC9B,OAAe,EACf,KAAY,EACZ,UAAsB;IAEtB,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,GAAG,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAE9D,OAAO,CAAC,GAAG;YACT,CAAC,CAAC,SAAS;YACX,CAAC,CAAC;gBACE,QAAQ,EAAE,GAAG,CAAC,OAAO;gBACrB,OAAO,EAAE,GAAG,CAAC,MAAM;aACpB,CAAC;IACR,CAAC,CAAC;IAEF,IAAM,UAAU,GAA4B,UAAC,OAAO;QAClD,IAAI;YACF,IAAM,IAAI,GAA8B;gBACtC,IAAI,EAAE,8BAAiB,CAAC,KAAK;gBAC7B,OAAO,SAAA;gBACP,IAAI,EAAE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,cAAc,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAE9C,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;SACpD;IACH,CAAC,CAAC;IAEF,IAAM,OAAO,GAAyB,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;IAEjD,IAAM,iBAAiB,GAAmC,cAAM,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC;IAEvE,OAAO;QACL,OAAO,SAAA;QACP,eAAe,iBAAA;QACf,QAAQ,UAAA;QACR,iBAAiB,mBAAA;QACjB,UAAU,YAAA;KACX,CAAC;AACJ,CAAC;AA1DD,kDA0DC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType, Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\n\nimport type { OTELApi, TraceEvent, TracesAPI } from './types';\n\nexport function initializeTracesAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n _config: Config,\n metas: Metas,\n transports: Transports\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/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
|
+
{"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, MetaView } 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 view?: MetaView;\n eventDomain?: string;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
|
|
@@ -10,50 +10,48 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.BaseExtension = void 0;
|
|
13
|
-
var
|
|
13
|
+
var internalLogger_1 = require("../internalLogger");
|
|
14
|
+
var unpatchedConsole_1 = require("../unpatchedConsole");
|
|
14
15
|
var BaseExtension = /** @class */ (function () {
|
|
15
16
|
function BaseExtension() {
|
|
17
|
+
this.unpatchedConsole = unpatchedConsole_1.defaultUnpatchedConsole;
|
|
18
|
+
this.internalLogger = internalLogger_1.defaultInternalLogger;
|
|
19
|
+
this.config = {};
|
|
20
|
+
this.metas = {};
|
|
16
21
|
}
|
|
17
|
-
Object.defineProperty(BaseExtension.prototype, "faro", {
|
|
18
|
-
get: function () {
|
|
19
|
-
return sdk_1.faro;
|
|
20
|
-
},
|
|
21
|
-
enumerable: false,
|
|
22
|
-
configurable: true
|
|
23
|
-
});
|
|
24
22
|
BaseExtension.prototype.logDebug = function () {
|
|
25
|
-
var _a
|
|
23
|
+
var _a;
|
|
26
24
|
var args = [];
|
|
27
25
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28
26
|
args[_i] = arguments[_i];
|
|
29
27
|
}
|
|
30
|
-
(
|
|
28
|
+
(_a = this.internalLogger).debug.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
31
29
|
};
|
|
32
30
|
BaseExtension.prototype.logInfo = function () {
|
|
33
|
-
var _a
|
|
31
|
+
var _a;
|
|
34
32
|
var args = [];
|
|
35
33
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
36
34
|
args[_i] = arguments[_i];
|
|
37
35
|
}
|
|
38
|
-
(
|
|
36
|
+
(_a = this.internalLogger).info.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
39
37
|
};
|
|
40
38
|
BaseExtension.prototype.logWarn = function () {
|
|
41
|
-
var _a
|
|
39
|
+
var _a;
|
|
42
40
|
var args = [];
|
|
43
41
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44
42
|
args[_i] = arguments[_i];
|
|
45
43
|
}
|
|
46
|
-
(
|
|
44
|
+
(_a = this.internalLogger).warn.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
47
45
|
};
|
|
48
46
|
BaseExtension.prototype.logError = function () {
|
|
49
|
-
var _a
|
|
47
|
+
var _a;
|
|
50
48
|
var args = [];
|
|
51
49
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
52
50
|
args[_i] = arguments[_i];
|
|
53
51
|
}
|
|
54
|
-
(
|
|
52
|
+
(_a = this.internalLogger).error.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
55
53
|
};
|
|
56
54
|
return BaseExtension;
|
|
57
55
|
}());
|
|
58
56
|
exports.BaseExtension = BaseExtension;
|
|
59
|
-
//# sourceMappingURL=
|
|
57
|
+
//# sourceMappingURL=baseExtension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseExtension.js","sourceRoot":"","sources":["../../../src/extensions/baseExtension.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oDAA0D;AAE1D,wDAA8D;AAI9D;IAAA;QAIE,qBAAgB,GAAG,0CAAuB,CAAC;QAC3C,mBAAc,GAAG,sCAAqB,CAAC;QACvC,WAAM,GAAG,EAAY,CAAC;QACtB,UAAK,GAAG,EAAW,CAAC;IAiBtB,CAAC;IAfC,gCAAQ,GAAR;;QAAS,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACzB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,KAAK,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACvD,CAAC;IAED,+BAAO,GAAP;;QAAQ,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACxB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,IAAI,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACtD,CAAC;IAED,+BAAO,GAAP;;QAAQ,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACxB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,IAAI,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACtD,CAAC;IAED,gCAAQ,GAAR;;QAAS,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACzB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,KAAK,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACvD,CAAC;IACH,oBAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBqB,sCAAa","sourcesContent":["import type { Config } from '../config';\nimport { defaultInternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport { defaultUnpatchedConsole } from '../unpatchedConsole';\n\nimport type { Extension } from './types';\n\nexport abstract class BaseExtension implements Extension {\n abstract readonly name: string;\n abstract readonly version: string;\n\n unpatchedConsole = defaultUnpatchedConsole;\n internalLogger = defaultInternalLogger;\n config = {} as Config;\n metas = {} as Metas;\n\n logDebug(...args: unknown[]): void {\n this.internalLogger.debug(`${this.name}\\n`, ...args);\n }\n\n logInfo(...args: unknown[]): void {\n this.internalLogger.info(`${this.name}\\n`, ...args);\n }\n\n logWarn(...args: unknown[]): void {\n this.internalLogger.warn(`${this.name}\\n`, ...args);\n }\n\n logError(...args: unknown[]): void {\n this.internalLogger.error(`${this.name}\\n`, ...args);\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseExtension = void 0;
|
|
4
|
+
var baseExtension_1 = require("./baseExtension");
|
|
5
|
+
Object.defineProperty(exports, "BaseExtension", { enumerable: true, get: function () { return baseExtension_1.BaseExtension; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { BaseExtension } from './baseExtension';\n\nexport type { Extension } from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/extensions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Extension {\n readonly name: string;\n readonly version: string;\n\n internalLogger: InternalLogger;\n unpatchedConsole: UnpatchedConsole;\n config: Config;\n metas: Metas;\n\n logDebug(...args: unknown[]): void;\n logInfo(...args: unknown[]): void;\n logWarn(...args: unknown[]): void;\n logError(...args: unknown[]): void;\n}\n"]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
var sdk_1 = require("./sdk");
|
|
6
|
-
Object.defineProperty(exports, "faro", { enumerable: true, get: function () { return sdk_1.faro; } });
|
|
7
|
-
Object.defineProperty(exports, "getInternalFaroFromGlobalObject", { enumerable: true, get: function () { return sdk_1.getInternalFaroFromGlobalObject; } });
|
|
8
|
-
Object.defineProperty(exports, "internalGlobalObjectKey", { enumerable: true, get: function () { return sdk_1.internalGlobalObjectKey; } });
|
|
9
|
-
Object.defineProperty(exports, "isInternalFaroOnGlobalObject", { enumerable: true, get: function () { return sdk_1.isInternalFaroOnGlobalObject; } });
|
|
10
|
-
Object.defineProperty(exports, "setInternalFaroOnGlobalObject", { enumerable: true, get: function () { return sdk_1.setInternalFaroOnGlobalObject; } });
|
|
3
|
+
exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.deepEqual = exports.createPromiseBuffer = exports.allLogLevels = exports.defaultUnpatchedConsole = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.getTransportBody = exports.BaseTransport = exports.Conventions = exports.setInternalFaroOnGlobalObject = exports.isInternalFaroOnGlobalObject = exports.internalGlobalObjectKey = exports.getInternalFaroFromGlobalObject = exports.faro = exports.InternalLoggerLevel = exports.defaultInternalLoggerLevel = exports.createInternalLogger = exports.BaseInstrumentation = exports.defaultGlobalObjectKey = exports.initializeFaro = exports.globalObject = exports.BaseExtension = exports.defaultExceptionType = void 0;
|
|
4
|
+
exports.VERSION = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = void 0;
|
|
11
5
|
var api_1 = require("./api");
|
|
12
6
|
Object.defineProperty(exports, "defaultExceptionType", { enumerable: true, get: function () { return api_1.defaultExceptionType; } });
|
|
7
|
+
var extensions_1 = require("./extensions");
|
|
8
|
+
Object.defineProperty(exports, "BaseExtension", { enumerable: true, get: function () { return extensions_1.BaseExtension; } });
|
|
13
9
|
var globalObject_1 = require("./globalObject");
|
|
14
10
|
Object.defineProperty(exports, "globalObject", { enumerable: true, get: function () { return globalObject_1.globalObject; } });
|
|
15
11
|
var initialize_1 = require("./initialize");
|
|
@@ -22,6 +18,14 @@ var internalLogger_1 = require("./internalLogger");
|
|
|
22
18
|
Object.defineProperty(exports, "createInternalLogger", { enumerable: true, get: function () { return internalLogger_1.createInternalLogger; } });
|
|
23
19
|
Object.defineProperty(exports, "defaultInternalLoggerLevel", { enumerable: true, get: function () { return internalLogger_1.defaultInternalLoggerLevel; } });
|
|
24
20
|
Object.defineProperty(exports, "InternalLoggerLevel", { enumerable: true, get: function () { return internalLogger_1.InternalLoggerLevel; } });
|
|
21
|
+
var sdk_1 = require("./sdk");
|
|
22
|
+
Object.defineProperty(exports, "faro", { enumerable: true, get: function () { return sdk_1.faro; } });
|
|
23
|
+
Object.defineProperty(exports, "getInternalFaroFromGlobalObject", { enumerable: true, get: function () { return sdk_1.getInternalFaroFromGlobalObject; } });
|
|
24
|
+
Object.defineProperty(exports, "internalGlobalObjectKey", { enumerable: true, get: function () { return sdk_1.internalGlobalObjectKey; } });
|
|
25
|
+
Object.defineProperty(exports, "isInternalFaroOnGlobalObject", { enumerable: true, get: function () { return sdk_1.isInternalFaroOnGlobalObject; } });
|
|
26
|
+
Object.defineProperty(exports, "setInternalFaroOnGlobalObject", { enumerable: true, get: function () { return sdk_1.setInternalFaroOnGlobalObject; } });
|
|
27
|
+
var semantic_1 = require("./semantic");
|
|
28
|
+
Object.defineProperty(exports, "Conventions", { enumerable: true, get: function () { return semantic_1.Conventions; } });
|
|
25
29
|
var transports_1 = require("./transports");
|
|
26
30
|
Object.defineProperty(exports, "BaseTransport", { enumerable: true, get: function () { return transports_1.BaseTransport; } });
|
|
27
31
|
Object.defineProperty(exports, "getTransportBody", { enumerable: true, get: function () { return transports_1.getTransportBody; } });
|
|
@@ -31,7 +35,6 @@ var unpatchedConsole_1 = require("./unpatchedConsole");
|
|
|
31
35
|
Object.defineProperty(exports, "defaultUnpatchedConsole", { enumerable: true, get: function () { return unpatchedConsole_1.defaultUnpatchedConsole; } });
|
|
32
36
|
var utils_1 = require("./utils");
|
|
33
37
|
Object.defineProperty(exports, "allLogLevels", { enumerable: true, get: function () { return utils_1.allLogLevels; } });
|
|
34
|
-
Object.defineProperty(exports, "BaseExtension", { enumerable: true, get: function () { return utils_1.BaseExtension; } });
|
|
35
38
|
Object.defineProperty(exports, "createPromiseBuffer", { enumerable: true, get: function () { return utils_1.createPromiseBuffer; } });
|
|
36
39
|
Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return utils_1.deepEqual; } });
|
|
37
40
|
Object.defineProperty(exports, "defaultLogLevel", { enumerable: true, get: function () { return utils_1.defaultLogLevel; } });
|
|
@@ -69,6 +72,4 @@ Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function ()
|
|
|
69
72
|
Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return utils_1.noop; } });
|
|
70
73
|
var version_1 = require("./version");
|
|
71
74
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
72
|
-
var semantic_1 = require("./semantic");
|
|
73
|
-
Object.defineProperty(exports, "Conventions", { enumerable: true, get: function () { return semantic_1.Conventions; } });
|
|
74
75
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAA6C;AAApC,2GAAA,oBAAoB,OAAA;AA4B7B,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAGtB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,mCAAkD;AAAzC,gHAAA,sBAAsB,OAAA;AAG/B,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAG5B,mDAAyG;AAAhG,sHAAA,oBAAoB,OAAA;AAAE,4HAAA,0BAA0B,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAmB9E,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,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AAEpB,2CAA8G;AAArG,2GAAA,aAAa,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAAE,wHAAA,0BAA0B,OAAA;AAUvF,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAGhC,iCAqCiB;AApCf,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,kGAAA,SAAS,OAAA;AACT,wGAAA,eAAe,OAAA;AACf,mGAAA,UAAU,OAAA;AACV,4GAAA,mBAAmB,OAAA;AACnB,gGAAA,OAAO,OAAA;AACP,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,kGAAA,SAAS,OAAA;AACT,yGAAA,gBAAgB,OAAA;AAChB,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,qGAAA,YAAY,OAAA;AACZ,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,mGAAA,UAAU,OAAA;AACV,qGAAA,YAAY,OAAA;AACZ,8FAAA,KAAK,OAAA;AACL,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,+FAAA,MAAM,OAAA;AACN,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;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","sourcesContent":["export { 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 { BaseExtension } from './extensions';\nexport type { Extension } from './extensions';\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 MetaView,\n} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport { Conventions } from './semantic';\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 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"]}
|