@grafana/faro-core 2.3.1 → 2.5.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 +13 -1
- package/dist/bundle/faro-core.iife.js +1 -1
- package/dist/bundle/types/api/exceptions/types.d.ts +2 -0
- package/dist/bundle/types/api/index.d.ts +1 -0
- package/dist/bundle/types/api/noop.d.ts +2 -0
- package/dist/bundle/types/api/userActions/userAction.d.ts +1 -0
- package/dist/bundle/types/extensions/baseExtension.d.ts +1 -1
- package/dist/bundle/types/index.d.ts +2 -2
- package/dist/bundle/types/metas/index.d.ts +1 -1
- package/dist/bundle/types/metas/types.d.ts +19 -2
- package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/bundle/types/utils/date.d.ts +18 -0
- package/dist/bundle/types/utils/index.d.ts +1 -1
- package/dist/bundle/types/version.d.ts +1 -1
- package/dist/cjs/api/ItemBuffer.js +11 -13
- package/dist/cjs/api/ItemBuffer.js.map +1 -1
- package/dist/cjs/api/events/initialize.js +12 -14
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/const.js +3 -3
- package/dist/cjs/api/exceptions/const.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js +29 -40
- 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 +3 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/initialize.js +25 -36
- package/dist/cjs/api/initialize.js.map +1 -1
- package/dist/cjs/api/logs/const.js +10 -12
- package/dist/cjs/api/logs/const.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js +14 -16
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js +12 -25
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/meta/initialize.js +29 -41
- package/dist/cjs/api/meta/initialize.js.map +1 -1
- package/dist/cjs/api/noop.js +30 -0
- package/dist/cjs/api/noop.js.map +1 -0
- package/dist/cjs/api/traces/initialize.js +17 -17
- package/dist/cjs/api/traces/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/initialize.js +23 -24
- package/dist/cjs/api/userActions/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/userAction.js +57 -80
- package/dist/cjs/api/userActions/userAction.js.map +1 -1
- package/dist/cjs/api/utils.js +2 -2
- package/dist/cjs/api/utils.js.map +1 -1
- package/dist/cjs/extensions/baseExtension.js +17 -47
- package/dist/cjs/extensions/baseExtension.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/initialize.js +14 -14
- package/dist/cjs/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/base.js +7 -25
- package/dist/cjs/instrumentations/base.js.map +1 -1
- package/dist/cjs/instrumentations/initialize.js +14 -31
- package/dist/cjs/instrumentations/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/registerInitial.js +1 -2
- package/dist/cjs/instrumentations/registerInitial.js.map +1 -1
- package/dist/cjs/internalLogger/const.js +1 -1
- package/dist/cjs/internalLogger/const.js.map +1 -1
- package/dist/cjs/internalLogger/createInternalLogger.js +13 -40
- package/dist/cjs/internalLogger/createInternalLogger.js.map +1 -1
- package/dist/cjs/internalLogger/initialize.js +2 -2
- package/dist/cjs/internalLogger/initialize.js.map +1 -1
- package/dist/cjs/metas/index.js.map +1 -1
- package/dist/cjs/metas/initialize.js +18 -26
- package/dist/cjs/metas/initialize.js.map +1 -1
- package/dist/cjs/metas/registerInitial.js +7 -28
- package/dist/cjs/metas/registerInitial.js.map +1 -1
- package/dist/cjs/metas/types.js.map +1 -1
- package/dist/cjs/sdk/faroGlobalObject.js +3 -3
- package/dist/cjs/sdk/faroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/internalFaroGlobalObject.js +2 -2
- package/dist/cjs/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/registerFaro.js +11 -10
- package/dist/cjs/sdk/registerFaro.js.map +1 -1
- package/dist/cjs/testUtils/mockConfig.js +6 -18
- package/dist/cjs/testUtils/mockConfig.js.map +1 -1
- package/dist/cjs/testUtils/mockInternalLogger.js +1 -1
- package/dist/cjs/testUtils/mockInternalLogger.js.map +1 -1
- package/dist/cjs/testUtils/mockStacktraceParser.js +5 -5
- package/dist/cjs/testUtils/mockStacktraceParser.js.map +1 -1
- package/dist/cjs/testUtils/mockTransport.js +17 -37
- package/dist/cjs/testUtils/mockTransport.js.map +1 -1
- package/dist/cjs/testUtils/testPromise.js +3 -3
- package/dist/cjs/testUtils/testPromise.js.map +1 -1
- package/dist/cjs/transports/base.js +7 -27
- package/dist/cjs/transports/base.js.map +1 -1
- package/dist/cjs/transports/batchExecutor.js +24 -36
- package/dist/cjs/transports/batchExecutor.js.map +1 -1
- package/dist/cjs/transports/const.js +7 -8
- package/dist/cjs/transports/const.js.map +1 -1
- package/dist/cjs/transports/initialize.js +50 -79
- package/dist/cjs/transports/initialize.js.map +1 -1
- package/dist/cjs/transports/registerInitial.js +1 -2
- package/dist/cjs/transports/registerInitial.js.map +1 -1
- package/dist/cjs/transports/utils.js +13 -34
- package/dist/cjs/transports/utils.js.map +1 -1
- package/dist/cjs/unpatchedConsole/const.js +1 -12
- package/dist/cjs/unpatchedConsole/const.js.map +1 -1
- package/dist/cjs/unpatchedConsole/initialize.js +1 -1
- package/dist/cjs/unpatchedConsole/initialize.js.map +1 -1
- package/dist/cjs/utils/date.js +24 -0
- package/dist/cjs/utils/date.js.map +1 -1
- package/dist/cjs/utils/deepEqual.js +14 -16
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/index.js +2 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/is.js +25 -29
- package/dist/cjs/utils/is.js.map +1 -1
- package/dist/cjs/utils/json.js +6 -9
- package/dist/cjs/utils/json.js.map +1 -1
- package/dist/cjs/utils/promiseBuffer.js +14 -14
- package/dist/cjs/utils/promiseBuffer.js.map +1 -1
- package/dist/cjs/utils/reactive.js +43 -50
- package/dist/cjs/utils/reactive.js.map +1 -1
- package/dist/cjs/utils/shortId.js +3 -4
- package/dist/cjs/utils/shortId.js.map +1 -1
- package/dist/cjs/utils/sourceMaps.js +2 -2
- package/dist/cjs/utils/sourceMaps.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/api/exceptions/initialize.js +6 -4
- 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 +1 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/noop.js +27 -0
- package/dist/esm/api/noop.js.map +1 -0
- package/dist/esm/api/userActions/userAction.js +11 -2
- package/dist/esm/api/userActions/userAction.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/metas/index.js.map +1 -1
- package/dist/esm/metas/types.js.map +1 -1
- package/dist/esm/sdk/registerFaro.js +2 -1
- package/dist/esm/sdk/registerFaro.js.map +1 -1
- package/dist/esm/utils/date.js +23 -0
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/api/exceptions/types.d.ts +2 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/noop.d.ts +2 -0
- package/dist/types/api/userActions/userAction.d.ts +1 -0
- package/dist/types/extensions/baseExtension.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/metas/index.d.ts +1 -1
- package/dist/types/metas/types.d.ts +19 -2
- package/dist/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/utils/date.d.ts +18 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -4
- package/dist/spec/core/src/api/ItemBuffer.js +0 -27
- package/dist/spec/core/src/api/ItemBuffer.js.map +0 -1
- package/dist/spec/core/src/api/apiTestHelpers.js +0 -40
- package/dist/spec/core/src/api/apiTestHelpers.js.map +0 -1
- package/dist/spec/core/src/api/events/index.js +0 -6
- package/dist/spec/core/src/api/events/index.js.map +0 -1
- package/dist/spec/core/src/api/events/initialize.js +0 -54
- package/dist/spec/core/src/api/events/initialize.js.map +0 -1
- package/dist/spec/core/src/api/events/initialize.test.js +0 -171
- package/dist/spec/core/src/api/events/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/events/types.js +0 -3
- package/dist/spec/core/src/api/events/types.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/const.js +0 -17
- package/dist/spec/core/src/api/exceptions/const.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/index.js +0 -9
- package/dist/spec/core/src/api/exceptions/index.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/initialize.js +0 -104
- package/dist/spec/core/src/api/exceptions/initialize.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/initialize.test.js +0 -317
- package/dist/spec/core/src/api/exceptions/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/types.js +0 -3
- package/dist/spec/core/src/api/exceptions/types.js.map +0 -1
- package/dist/spec/core/src/api/index.js +0 -15
- package/dist/spec/core/src/api/index.js.map +0 -1
- package/dist/spec/core/src/api/initialize.js +0 -56
- package/dist/spec/core/src/api/initialize.js.map +0 -1
- package/dist/spec/core/src/api/initialize.test.js +0 -33
- package/dist/spec/core/src/api/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/itemBuffer.test.js +0 -36
- package/dist/spec/core/src/api/itemBuffer.test.js.map +0 -1
- package/dist/spec/core/src/api/logs/const.js +0 -17
- package/dist/spec/core/src/api/logs/const.js.map +0 -1
- package/dist/spec/core/src/api/logs/index.js +0 -8
- package/dist/spec/core/src/api/logs/index.js.map +0 -1
- package/dist/spec/core/src/api/logs/initialize.js +0 -58
- package/dist/spec/core/src/api/logs/initialize.js.map +0 -1
- package/dist/spec/core/src/api/logs/initialize.test.js +0 -185
- package/dist/spec/core/src/api/logs/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/logs/types.js +0 -3
- package/dist/spec/core/src/api/logs/types.js.map +0 -1
- package/dist/spec/core/src/api/measurements/index.js +0 -6
- package/dist/spec/core/src/api/measurements/index.js.map +0 -1
- package/dist/spec/core/src/api/measurements/initialize.js +0 -60
- package/dist/spec/core/src/api/measurements/initialize.js.map +0 -1
- package/dist/spec/core/src/api/measurements/initialize.test.js +0 -244
- package/dist/spec/core/src/api/measurements/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/measurements/types.js +0 -3
- package/dist/spec/core/src/api/measurements/types.js.map +0 -1
- package/dist/spec/core/src/api/meta/index.js +0 -6
- package/dist/spec/core/src/api/meta/index.js.map +0 -1
- package/dist/spec/core/src/api/meta/initialize.js +0 -92
- package/dist/spec/core/src/api/meta/initialize.js.map +0 -1
- package/dist/spec/core/src/api/meta/initilialize.test.js +0 -135
- package/dist/spec/core/src/api/meta/initilialize.test.js.map +0 -1
- package/dist/spec/core/src/api/meta/types.js +0 -3
- package/dist/spec/core/src/api/meta/types.js.map +0 -1
- package/dist/spec/core/src/api/traces/index.js +0 -6
- package/dist/spec/core/src/api/traces/index.js.map +0 -1
- package/dist/spec/core/src/api/traces/initialize.js +0 -48
- package/dist/spec/core/src/api/traces/initialize.js.map +0 -1
- package/dist/spec/core/src/api/traces/types.js +0 -3
- package/dist/spec/core/src/api/traces/types.js.map +0 -1
- package/dist/spec/core/src/api/types.js +0 -3
- package/dist/spec/core/src/api/types.js.map +0 -1
- package/dist/spec/core/src/api/userActions/const.js +0 -11
- package/dist/spec/core/src/api/userActions/const.js.map +0 -1
- package/dist/spec/core/src/api/userActions/index.js +0 -11
- package/dist/spec/core/src/api/userActions/index.js.map +0 -1
- package/dist/spec/core/src/api/userActions/initialize.js +0 -80
- package/dist/spec/core/src/api/userActions/initialize.js.map +0 -1
- package/dist/spec/core/src/api/userActions/initialize.test.js +0 -82
- package/dist/spec/core/src/api/userActions/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/userActions/types.js +0 -11
- package/dist/spec/core/src/api/userActions/types.js.map +0 -1
- package/dist/spec/core/src/api/userActions/userAction.js +0 -126
- package/dist/spec/core/src/api/userActions/userAction.js.map +0 -1
- package/dist/spec/core/src/api/userActions/userAction.test.js +0 -85
- package/dist/spec/core/src/api/userActions/userAction.test.js.map +0 -1
- package/dist/spec/core/src/api/utils.js +0 -10
- package/dist/spec/core/src/api/utils.js.map +0 -1
- package/dist/spec/core/src/api/utils.test.js +0 -20
- package/dist/spec/core/src/api/utils.test.js.map +0 -1
- package/dist/spec/core/src/config/const.js +0 -10
- package/dist/spec/core/src/config/const.js.map +0 -1
- package/dist/spec/core/src/config/index.js +0 -7
- package/dist/spec/core/src/config/index.js.map +0 -1
- package/dist/spec/core/src/config/types.js +0 -3
- package/dist/spec/core/src/config/types.js.map +0 -1
- package/dist/spec/core/src/consts.js +0 -5
- package/dist/spec/core/src/consts.js.map +0 -1
- package/dist/spec/core/src/extensions/baseExtension.js +0 -57
- package/dist/spec/core/src/extensions/baseExtension.js.map +0 -1
- package/dist/spec/core/src/extensions/index.js +0 -6
- package/dist/spec/core/src/extensions/index.js.map +0 -1
- package/dist/spec/core/src/extensions/types.js +0 -3
- package/dist/spec/core/src/extensions/types.js.map +0 -1
- package/dist/spec/core/src/faro.test.js +0 -40
- package/dist/spec/core/src/faro.test.js.map +0 -1
- package/dist/spec/core/src/globalObject/globalObject.js +0 -12
- package/dist/spec/core/src/globalObject/globalObject.js.map +0 -1
- package/dist/spec/core/src/globalObject/index.js +0 -6
- package/dist/spec/core/src/globalObject/index.js.map +0 -1
- package/dist/spec/core/src/index.js +0 -103
- package/dist/spec/core/src/index.js.map +0 -1
- package/dist/spec/core/src/initialize.js +0 -31
- package/dist/spec/core/src/initialize.js.map +0 -1
- package/dist/spec/core/src/instrumentations/base.js +0 -31
- package/dist/spec/core/src/instrumentations/base.js.map +0 -1
- package/dist/spec/core/src/instrumentations/index.js +0 -10
- package/dist/spec/core/src/instrumentations/index.js.map +0 -1
- package/dist/spec/core/src/instrumentations/initialize.js +0 -70
- package/dist/spec/core/src/instrumentations/initialize.js.map +0 -1
- package/dist/spec/core/src/instrumentations/registerInitial.js +0 -8
- package/dist/spec/core/src/instrumentations/registerInitial.js.map +0 -1
- package/dist/spec/core/src/instrumentations/types.js +0 -3
- package/dist/spec/core/src/instrumentations/types.js.map +0 -1
- package/dist/spec/core/src/internalLogger/const.js +0 -22
- package/dist/spec/core/src/internalLogger/const.js.map +0 -1
- package/dist/spec/core/src/internalLogger/createInternalLogger.js +0 -64
- package/dist/spec/core/src/internalLogger/createInternalLogger.js.map +0 -1
- package/dist/spec/core/src/internalLogger/index.js +0 -13
- package/dist/spec/core/src/internalLogger/index.js.map +0 -1
- package/dist/spec/core/src/internalLogger/initialize.js +0 -12
- package/dist/spec/core/src/internalLogger/initialize.js.map +0 -1
- package/dist/spec/core/src/internalLogger/types.js +0 -3
- package/dist/spec/core/src/internalLogger/types.js.map +0 -1
- package/dist/spec/core/src/metas/index.js +0 -8
- package/dist/spec/core/src/metas/index.js.map +0 -1
- package/dist/spec/core/src/metas/initialize.js +0 -51
- package/dist/spec/core/src/metas/initialize.js.map +0 -1
- package/dist/spec/core/src/metas/initialize.test.js +0 -20
- package/dist/spec/core/src/metas/initialize.test.js.map +0 -1
- package/dist/spec/core/src/metas/registerInitial.js +0 -53
- package/dist/spec/core/src/metas/registerInitial.js.map +0 -1
- package/dist/spec/core/src/metas/types.js +0 -3
- package/dist/spec/core/src/metas/types.js.map +0 -1
- package/dist/spec/core/src/sdk/const.js +0 -5
- package/dist/spec/core/src/sdk/const.js.map +0 -1
- package/dist/spec/core/src/sdk/faroGlobalObject.js +0 -22
- package/dist/spec/core/src/sdk/faroGlobalObject.js.map +0 -1
- package/dist/spec/core/src/sdk/index.js +0 -13
- package/dist/spec/core/src/sdk/index.js.map +0 -1
- package/dist/spec/core/src/sdk/internalFaroGlobalObject.js +0 -28
- package/dist/spec/core/src/sdk/internalFaroGlobalObject.js.map +0 -1
- package/dist/spec/core/src/sdk/registerFaro.js +0 -25
- package/dist/spec/core/src/sdk/registerFaro.js.map +0 -1
- package/dist/spec/core/src/sdk/types.js +0 -3
- package/dist/spec/core/src/sdk/types.js.map +0 -1
- package/dist/spec/core/src/semantic.js +0 -12
- package/dist/spec/core/src/semantic.js.map +0 -1
- package/dist/spec/core/src/testUtils/index.js +0 -14
- package/dist/spec/core/src/testUtils/index.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockConfig.js +0 -27
- package/dist/spec/core/src/testUtils/mockConfig.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockInternalLogger.js +0 -12
- package/dist/spec/core/src/testUtils/mockInternalLogger.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockStacktraceParser.js +0 -21
- package/dist/spec/core/src/testUtils/mockStacktraceParser.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockTransport.js +0 -45
- package/dist/spec/core/src/testUtils/mockTransport.js.map +0 -1
- package/dist/spec/core/src/testUtils/testPromise.js +0 -14
- package/dist/spec/core/src/testUtils/testPromise.js.map +0 -1
- package/dist/spec/core/src/transports/base.js +0 -34
- package/dist/spec/core/src/transports/base.js.map +0 -1
- package/dist/spec/core/src/transports/batchExecutor.js +0 -82
- package/dist/spec/core/src/transports/batchExecutor.js.map +0 -1
- package/dist/spec/core/src/transports/batchExecutor.test.js +0 -179
- package/dist/spec/core/src/transports/batchExecutor.test.js.map +0 -1
- package/dist/spec/core/src/transports/const.js +0 -20
- package/dist/spec/core/src/transports/const.js.map +0 -1
- package/dist/spec/core/src/transports/index.js +0 -15
- package/dist/spec/core/src/transports/index.js.map +0 -1
- package/dist/spec/core/src/transports/initialize.js +0 -188
- package/dist/spec/core/src/transports/initialize.js.map +0 -1
- package/dist/spec/core/src/transports/registerInitial.js +0 -9
- package/dist/spec/core/src/transports/registerInitial.js.map +0 -1
- package/dist/spec/core/src/transports/transports.test.js +0 -258
- package/dist/spec/core/src/transports/transports.test.js.map +0 -1
- package/dist/spec/core/src/transports/types.js +0 -3
- package/dist/spec/core/src/transports/types.js.map +0 -1
- package/dist/spec/core/src/transports/utils.js +0 -73
- package/dist/spec/core/src/transports/utils.js.map +0 -1
- package/dist/spec/core/src/transports/utils.test.js +0 -216
- package/dist/spec/core/src/transports/utils.test.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/const.js +0 -16
- package/dist/spec/core/src/unpatchedConsole/const.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/index.js +0 -9
- package/dist/spec/core/src/unpatchedConsole/index.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/initialize.js +0 -12
- package/dist/spec/core/src/unpatchedConsole/initialize.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/types.js +0 -3
- package/dist/spec/core/src/unpatchedConsole/types.js.map +0 -1
- package/dist/spec/core/src/utils/baseObject.js +0 -3
- package/dist/spec/core/src/utils/baseObject.js.map +0 -1
- package/dist/spec/core/src/utils/date.js +0 -15
- package/dist/spec/core/src/utils/date.js.map +0 -1
- package/dist/spec/core/src/utils/deepEqual.js +0 -61
- package/dist/spec/core/src/utils/deepEqual.js.map +0 -1
- package/dist/spec/core/src/utils/deepEqual.test.js +0 -103
- package/dist/spec/core/src/utils/deepEqual.test.js.map +0 -1
- package/dist/spec/core/src/utils/index.js +0 -60
- package/dist/spec/core/src/utils/index.js.map +0 -1
- package/dist/spec/core/src/utils/is.js +0 -66
- package/dist/spec/core/src/utils/is.js.map +0 -1
- package/dist/spec/core/src/utils/is.test.js +0 -21
- package/dist/spec/core/src/utils/is.test.js.map +0 -1
- package/dist/spec/core/src/utils/json.js +0 -32
- package/dist/spec/core/src/utils/json.js.map +0 -1
- package/dist/spec/core/src/utils/json.test.js +0 -35
- package/dist/spec/core/src/utils/json.test.js.map +0 -1
- package/dist/spec/core/src/utils/logLevels.js +0 -22
- package/dist/spec/core/src/utils/logLevels.js.map +0 -1
- package/dist/spec/core/src/utils/noop.js +0 -5
- package/dist/spec/core/src/utils/noop.js.map +0 -1
- package/dist/spec/core/src/utils/promiseBuffer.js +0 -42
- package/dist/spec/core/src/utils/promiseBuffer.js.map +0 -1
- package/dist/spec/core/src/utils/promiseBuffer.test.js +0 -146
- package/dist/spec/core/src/utils/promiseBuffer.test.js.map +0 -1
- package/dist/spec/core/src/utils/reactive.js +0 -90
- package/dist/spec/core/src/utils/reactive.js.map +0 -1
- package/dist/spec/core/src/utils/reactive.test.js +0 -117
- package/dist/spec/core/src/utils/reactive.test.js.map +0 -1
- package/dist/spec/core/src/utils/sampling.js +0 -7
- package/dist/spec/core/src/utils/sampling.js.map +0 -1
- package/dist/spec/core/src/utils/sampling.test.js +0 -17
- package/dist/spec/core/src/utils/sampling.test.js.map +0 -1
- package/dist/spec/core/src/utils/shortId.js +0 -11
- package/dist/spec/core/src/utils/shortId.js.map +0 -1
- package/dist/spec/core/src/utils/sourceMaps.js +0 -8
- package/dist/spec/core/src/utils/sourceMaps.js.map +0 -1
- package/dist/spec/core/src/utils/sourceMaps.test.js +0 -17
- package/dist/spec/core/src/utils/sourceMaps.test.js.map +0 -1
- package/dist/spec/core/src/version.js +0 -6
- package/dist/spec/core/src/version.js.map +0 -1
- package/dist/types/core/src/api/ItemBuffer.d.ts +0 -7
- package/dist/types/core/src/api/apiTestHelpers.d.ts +0 -13
- package/dist/types/core/src/api/events/index.d.ts +0 -2
- package/dist/types/core/src/api/events/initialize.d.ts +0 -17
- package/dist/types/core/src/api/events/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/events/types.d.ts +0 -29
- package/dist/types/core/src/api/exceptions/const.d.ts +0 -2
- package/dist/types/core/src/api/exceptions/index.d.ts +0 -3
- package/dist/types/core/src/api/exceptions/initialize.d.ts +0 -17
- package/dist/types/core/src/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/exceptions/types.d.ts +0 -61
- package/dist/types/core/src/api/index.d.ts +0 -11
- package/dist/types/core/src/api/initialize.d.ts +0 -7
- package/dist/types/core/src/api/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/itemBuffer.test.d.ts +0 -1
- package/dist/types/core/src/api/logs/const.d.ts +0 -2
- package/dist/types/core/src/api/logs/index.d.ts +0 -3
- package/dist/types/core/src/api/logs/initialize.d.ts +0 -17
- package/dist/types/core/src/api/logs/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/logs/types.d.ts +0 -24
- package/dist/types/core/src/api/measurements/index.d.ts +0 -2
- package/dist/types/core/src/api/measurements/initialize.d.ts +0 -17
- package/dist/types/core/src/api/measurements/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/measurements/types.d.ts +0 -25
- package/dist/types/core/src/api/meta/index.d.ts +0 -2
- package/dist/types/core/src/api/meta/initialize.d.ts +0 -15
- package/dist/types/core/src/api/meta/initilialize.test.d.ts +0 -1
- package/dist/types/core/src/api/meta/types.d.ts +0 -21
- package/dist/types/core/src/api/traces/index.d.ts +0 -2
- package/dist/types/core/src/api/traces/initialize.d.ts +0 -7
- package/dist/types/core/src/api/traces/types.d.ts +0 -20
- package/dist/types/core/src/api/types.d.ts +0 -14
- package/dist/types/core/src/api/userActions/const.d.ts +0 -8
- package/dist/types/core/src/api/userActions/index.d.ts +0 -4
- package/dist/types/core/src/api/userActions/initialize.d.ts +0 -21
- package/dist/types/core/src/api/userActions/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/userActions/types.d.ts +0 -55
- package/dist/types/core/src/api/userActions/userAction.d.ts +0 -36
- package/dist/types/core/src/api/userActions/userAction.test.d.ts +0 -1
- package/dist/types/core/src/api/utils.d.ts +0 -2
- package/dist/types/core/src/api/utils.test.d.ts +0 -1
- package/dist/types/core/src/config/const.d.ts +0 -6
- package/dist/types/core/src/config/index.d.ts +0 -2
- package/dist/types/core/src/config/types.d.ts +0 -237
- package/dist/types/core/src/consts.d.ts +0 -1
- package/dist/types/core/src/extensions/baseExtension.d.ts +0 -15
- package/dist/types/core/src/extensions/index.d.ts +0 -2
- package/dist/types/core/src/extensions/types.d.ts +0 -16
- package/dist/types/core/src/faro.test.d.ts +0 -1
- package/dist/types/core/src/globalObject/globalObject.d.ts +0 -6
- package/dist/types/core/src/globalObject/index.d.ts +0 -2
- package/dist/types/core/src/index.d.ts +0 -25
- package/dist/types/core/src/initialize.d.ts +0 -3
- package/dist/types/core/src/instrumentations/base.d.ts +0 -9
- package/dist/types/core/src/instrumentations/index.d.ts +0 -4
- package/dist/types/core/src/instrumentations/initialize.d.ts +0 -8
- package/dist/types/core/src/instrumentations/registerInitial.d.ts +0 -2
- package/dist/types/core/src/instrumentations/types.d.ts +0 -14
- package/dist/types/core/src/internalLogger/const.d.ts +0 -11
- package/dist/types/core/src/internalLogger/createInternalLogger.d.ts +0 -4
- package/dist/types/core/src/internalLogger/index.d.ts +0 -4
- package/dist/types/core/src/internalLogger/initialize.d.ts +0 -5
- package/dist/types/core/src/internalLogger/types.d.ts +0 -7
- package/dist/types/core/src/metas/index.d.ts +0 -3
- package/dist/types/core/src/metas/initialize.d.ts +0 -5
- package/dist/types/core/src/metas/initialize.test.d.ts +0 -1
- package/dist/types/core/src/metas/registerInitial.d.ts +0 -2
- package/dist/types/core/src/metas/types.d.ts +0 -118
- package/dist/types/core/src/sdk/const.d.ts +0 -1
- package/dist/types/core/src/sdk/faroGlobalObject.d.ts +0 -2
- package/dist/types/core/src/sdk/index.d.ts +0 -4
- package/dist/types/core/src/sdk/internalFaroGlobalObject.d.ts +0 -4
- package/dist/types/core/src/sdk/registerFaro.d.ts +0 -10
- package/dist/types/core/src/sdk/types.d.ts +0 -18
- package/dist/types/core/src/semantic.d.ts +0 -8
- package/dist/types/core/src/testUtils/index.d.ts +0 -6
- package/dist/types/core/src/testUtils/mockConfig.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockInternalLogger.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockStacktraceParser.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockTransport.d.ts +0 -13
- package/dist/types/core/src/testUtils/testPromise.d.ts +0 -7
- package/dist/types/core/src/transports/base.d.ts +0 -8
- package/dist/types/core/src/transports/batchExecutor.d.ts +0 -16
- package/dist/types/core/src/transports/batchExecutor.test.d.ts +0 -1
- package/dist/types/core/src/transports/const.d.ts +0 -9
- package/dist/types/core/src/transports/index.d.ts +0 -6
- package/dist/types/core/src/transports/initialize.d.ts +0 -6
- package/dist/types/core/src/transports/registerInitial.d.ts +0 -2
- package/dist/types/core/src/transports/transports.test.d.ts +0 -1
- package/dist/types/core/src/transports/types.d.ts +0 -45
- package/dist/types/core/src/transports/utils.d.ts +0 -5
- package/dist/types/core/src/transports/utils.test.d.ts +0 -1
- package/dist/types/core/src/unpatchedConsole/const.d.ts +0 -2
- package/dist/types/core/src/unpatchedConsole/index.d.ts +0 -3
- package/dist/types/core/src/unpatchedConsole/initialize.d.ts +0 -4
- package/dist/types/core/src/unpatchedConsole/types.d.ts +0 -1
- package/dist/types/core/src/utils/baseObject.d.ts +0 -6
- package/dist/types/core/src/utils/date.d.ts +0 -3
- package/dist/types/core/src/utils/deepEqual.d.ts +0 -1
- package/dist/types/core/src/utils/deepEqual.test.d.ts +0 -1
- package/dist/types/core/src/utils/index.d.ts +0 -16
- package/dist/types/core/src/utils/is.d.ts +0 -32
- package/dist/types/core/src/utils/is.test.d.ts +0 -1
- package/dist/types/core/src/utils/json.d.ts +0 -3
- package/dist/types/core/src/utils/json.test.d.ts +0 -1
- package/dist/types/core/src/utils/logLevels.d.ts +0 -10
- package/dist/types/core/src/utils/noop.d.ts +0 -1
- package/dist/types/core/src/utils/promiseBuffer.d.ts +0 -14
- package/dist/types/core/src/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/types/core/src/utils/reactive.d.ts +0 -17
- package/dist/types/core/src/utils/reactive.test.d.ts +0 -1
- package/dist/types/core/src/utils/sampling.d.ts +0 -1
- package/dist/types/core/src/utils/sampling.test.d.ts +0 -1
- package/dist/types/core/src/utils/shortId.d.ts +0 -1
- package/dist/types/core/src/utils/sourceMaps.d.ts +0 -1
- package/dist/types/core/src/utils/sourceMaps.test.d.ts +0 -1
- package/dist/types/core/src/version.d.ts +0 -1
package/dist/cjs/initialize.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initializeFaro = initializeFaro;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const api_1 = require("./api");
|
|
5
|
+
const instrumentations_1 = require("./instrumentations");
|
|
6
|
+
const internalLogger_1 = require("./internalLogger");
|
|
7
|
+
const metas_1 = require("./metas");
|
|
8
|
+
const sdk_1 = require("./sdk");
|
|
9
|
+
const transports_1 = require("./transports");
|
|
10
|
+
const unpatchedConsole_1 = require("./unpatchedConsole");
|
|
11
11
|
function initializeFaro(config) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const unpatchedConsole = (0, unpatchedConsole_1.initializeUnpatchedConsole)(config);
|
|
13
|
+
const internalLogger = (0, internalLogger_1.initializeInternalLogger)(unpatchedConsole, config);
|
|
14
14
|
if ((0, sdk_1.isInternalFaroOnGlobalObject)() && !config.isolate) {
|
|
15
15
|
internalLogger.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
|
18
18
|
internalLogger.debug('Initializing');
|
|
19
19
|
// Initializing the APIs
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const metas = (0, metas_1.initializeMetas)(unpatchedConsole, internalLogger, config);
|
|
21
|
+
const transports = (0, transports_1.initializeTransports)(unpatchedConsole, internalLogger, config, metas);
|
|
22
|
+
const api = (0, api_1.initializeAPI)(unpatchedConsole, internalLogger, config, metas, transports);
|
|
23
|
+
const instrumentations = (0, instrumentations_1.initializeInstrumentations)(unpatchedConsole, internalLogger, config, metas, transports, api);
|
|
24
|
+
const faro = (0, sdk_1.registerFaro)(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);
|
|
25
25
|
// make sure Faro is initialized before registering default metas, instrumentations, transports etc.
|
|
26
26
|
(0, metas_1.registerInitialMetas)(faro);
|
|
27
27
|
(0, transports_1.registerInitialTransports)(faro);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":";;AAUA,wCA2BC;AArCD
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":";;AAUA,wCA2BC;AArCD,+BAAsC;AAEtC,yDAAiG;AACjG,qDAA4D;AAC5D,mCAAgE;AAChE,+BAAmE;AAEnE,6CAA+E;AAC/E,yDAAgE;AAEhE,SAAgB,cAAc,CAAC,MAAc;IAC3C,MAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,MAAM,CAAC,CAAC;IAC5D,MAAM,cAAc,GAAG,IAAA,yCAAwB,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAE1E,IAAI,IAAA,kCAA4B,GAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtD,cAAc,CAAC,KAAK,CAClB,oIAAoI,CACrI,CAAC;QAEF,OAAO,SAAU,CAAC;IACpB,CAAC;IAED,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,wBAAwB;IACxB,MAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IACxE,MAAM,UAAU,GAAG,IAAA,iCAAoB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzF,MAAM,GAAG,GAAG,IAAA,mBAAa,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACvF,MAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtH,MAAM,IAAI,GAAG,IAAA,kBAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAE9G,oGAAoG;IACpG,IAAA,4BAAoB,EAAC,IAAI,CAAC,CAAC;IAC3B,IAAA,sCAAyB,EAAC,IAAI,CAAC,CAAC;IAChC,IAAA,kDAA+B,EAAC,IAAI,CAAC,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { initializeAPI } from './api';\nimport type { Config } from './config';\nimport { initializeInstrumentations, registerInitialInstrumentations } from './instrumentations';\nimport { initializeInternalLogger } from './internalLogger';\nimport { initializeMetas, registerInitialMetas } from './metas';\nimport { isInternalFaroOnGlobalObject, registerFaro } from './sdk';\nimport type { Faro } from './sdk';\nimport { initializeTransports, registerInitialTransports } 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 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 internalLogger.debug('Initializing');\n\n // Initializing the APIs\n const metas = initializeMetas(unpatchedConsole, internalLogger, config);\n const transports = initializeTransports(unpatchedConsole, internalLogger, config, metas);\n const api = initializeAPI(unpatchedConsole, internalLogger, config, metas, transports);\n const instrumentations = initializeInstrumentations(unpatchedConsole, internalLogger, config, metas, transports, api);\n const faro = registerFaro(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);\n\n // make sure Faro is initialized before registering default metas, instrumentations, transports etc.\n registerInitialMetas(faro);\n registerInitialTransports(faro);\n registerInitialInstrumentations(faro);\n\n return faro;\n}\n"]}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.BaseInstrumentation = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_this.transports = {};
|
|
26
|
-
return _this;
|
|
4
|
+
const extensions_1 = require("../extensions");
|
|
5
|
+
class BaseInstrumentation extends extensions_1.BaseExtension {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.api = {};
|
|
9
|
+
this.transports = {};
|
|
27
10
|
}
|
|
28
|
-
|
|
29
|
-
}(extensions_1.BaseExtension));
|
|
11
|
+
}
|
|
30
12
|
exports.BaseInstrumentation = BaseInstrumentation;
|
|
31
13
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":";;;AACA,8CAA8C;AAK9C,MAAsB,mBAAoB,SAAQ,0BAAa;IAA/D;;QACE,QAAG,GAAQ,EAAS,CAAC;QACrB,eAAU,GAAe,EAAgB,CAAC;IAG5C,CAAC;CAAA;AALD,kDAKC","sourcesContent":["import type { API } from '../api';\nimport { BaseExtension } from '../extensions';\nimport type { Transports } from '../transports';\n\nimport type { Instrumentation } from './types';\n\nexport abstract class BaseInstrumentation extends BaseExtension implements Instrumentation {\n api: API = {} as API;\n transports: Transports = {} as Transports;\n\n abstract initialize(): void;\n}\n"]}
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.initializeInstrumentations = initializeInstrumentations;
|
|
13
4
|
function initializeInstrumentations(unpatchedConsole, internalLogger, config, metas, transports, api) {
|
|
14
5
|
internalLogger.debug('Initializing instrumentations');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var newInstrumentations = [];
|
|
18
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
19
|
-
newInstrumentations[_i] = arguments[_i];
|
|
20
|
-
}
|
|
6
|
+
const instrumentations = [];
|
|
7
|
+
const add = (...newInstrumentations) => {
|
|
21
8
|
internalLogger.debug('Adding instrumentations');
|
|
22
|
-
newInstrumentations.forEach(
|
|
23
|
-
internalLogger.debug(
|
|
24
|
-
|
|
9
|
+
newInstrumentations.forEach((newInstrumentation) => {
|
|
10
|
+
internalLogger.debug(`Adding "${newInstrumentation.name}" instrumentation`);
|
|
11
|
+
const exists = instrumentations.some((existingInstrumentation) => existingInstrumentation.name === newInstrumentation.name);
|
|
25
12
|
if (exists) {
|
|
26
|
-
internalLogger.warn(
|
|
13
|
+
internalLogger.warn(`Instrumentation ${newInstrumentation.name} is already added`);
|
|
27
14
|
return;
|
|
28
15
|
}
|
|
29
16
|
newInstrumentation.unpatchedConsole = unpatchedConsole;
|
|
@@ -36,23 +23,19 @@ function initializeInstrumentations(unpatchedConsole, internalLogger, config, me
|
|
|
36
23
|
newInstrumentation.initialize();
|
|
37
24
|
});
|
|
38
25
|
};
|
|
39
|
-
|
|
40
|
-
var instrumentationsToRemove = [];
|
|
41
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
42
|
-
instrumentationsToRemove[_i] = arguments[_i];
|
|
43
|
-
}
|
|
26
|
+
const remove = (...instrumentationsToRemove) => {
|
|
44
27
|
internalLogger.debug('Removing instrumentations');
|
|
45
|
-
instrumentationsToRemove.forEach(
|
|
28
|
+
instrumentationsToRemove.forEach((instrumentationToRemove) => {
|
|
46
29
|
var _a, _b;
|
|
47
|
-
internalLogger.debug(
|
|
48
|
-
|
|
30
|
+
internalLogger.debug(`Removing "${instrumentationToRemove.name}" instrumentation`);
|
|
31
|
+
const existingInstrumentationIndex = instrumentations.reduce((acc, existingInstrumentation, existingTransportIndex) => {
|
|
49
32
|
if (acc === null && existingInstrumentation.name === instrumentationToRemove.name) {
|
|
50
33
|
return existingTransportIndex;
|
|
51
34
|
}
|
|
52
35
|
return null;
|
|
53
36
|
}, null);
|
|
54
37
|
if (existingInstrumentationIndex === null) {
|
|
55
|
-
internalLogger.warn(
|
|
38
|
+
internalLogger.warn(`Instrumentation "${instrumentationToRemove.name}" is not added`);
|
|
56
39
|
return;
|
|
57
40
|
}
|
|
58
41
|
(_b = (_a = instrumentations[existingInstrumentationIndex]).destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
@@ -60,11 +43,11 @@ function initializeInstrumentations(unpatchedConsole, internalLogger, config, me
|
|
|
60
43
|
});
|
|
61
44
|
};
|
|
62
45
|
return {
|
|
63
|
-
add
|
|
46
|
+
add,
|
|
64
47
|
get instrumentations() {
|
|
65
|
-
return
|
|
48
|
+
return [...instrumentations];
|
|
66
49
|
},
|
|
67
|
-
remove
|
|
50
|
+
remove,
|
|
68
51
|
};
|
|
69
52
|
}
|
|
70
53
|
//# sourceMappingURL=initialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/instrumentations/initialize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/instrumentations/initialize.ts"],"names":[],"mappings":";;AASA,gEA6EC;AA7ED,SAAgB,0BAA0B,CACxC,gBAAkC,EAClC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,GAAQ;IAER,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,MAAM,GAAG,GAA4B,CAAC,GAAG,mBAAmB,EAAE,EAAE;QAC9D,cAAc,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEhD,mBAAmB,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE;YACjD,cAAc,CAAC,KAAK,CAAC,WAAW,kBAAkB,CAAC,IAAI,mBAAmB,CAAC,CAAC;YAE5E,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAClC,CAAC,uBAAuB,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,CACtF,CAAC;YAEF,IAAI,MAAM,EAAE,CAAC;gBACX,cAAc,CAAC,IAAI,CAAC,mBAAmB,kBAAkB,CAAC,IAAI,mBAAmB,CAAC,CAAC;gBAEnF,OAAO;YACT,CAAC;YAED,kBAAkB,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;YACvD,kBAAkB,CAAC,cAAc,GAAG,cAAc,CAAC;YACnD,kBAAkB,CAAC,MAAM,GAAG,MAAM,CAAC;YACnC,kBAAkB,CAAC,KAAK,GAAG,KAAK,CAAC;YACjC,kBAAkB,CAAC,UAAU,GAAG,UAAU,CAAC;YAC3C,kBAAkB,CAAC,GAAG,GAAG,GAAG,CAAC;YAE7B,gBAAgB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAE1C,kBAAkB,CAAC,UAAU,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,MAAM,GAA+B,CAAC,GAAG,wBAAwB,EAAE,EAAE;QACzE,cAAc,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAElD,wBAAwB,CAAC,OAAO,CAAC,CAAC,uBAAuB,EAAE,EAAE;;YAC3D,cAAc,CAAC,KAAK,CAAC,aAAa,uBAAuB,CAAC,IAAI,mBAAmB,CAAC,CAAC;YAEnF,MAAM,4BAA4B,GAAG,gBAAgB,CAAC,MAAM,CAC1D,CAAC,GAAG,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,EAAE;gBACvD,IAAI,GAAG,KAAK,IAAI,IAAI,uBAAuB,CAAC,IAAI,KAAK,uBAAuB,CAAC,IAAI,EAAE,CAAC;oBAClF,OAAO,sBAAsB,CAAC;gBAChC,CAAC;gBAED,OAAO,IAAI,CAAC;YACd,CAAC,EACD,IAAI,CACL,CAAC;YAEF,IAAI,4BAA4B,KAAK,IAAI,EAAE,CAAC;gBAC1C,cAAc,CAAC,IAAI,CAAC,oBAAoB,uBAAuB,CAAC,IAAI,gBAAgB,CAAC,CAAC;gBAEtF,OAAO;YACT,CAAC;YAED,MAAA,MAAA,gBAAgB,CAAC,4BAA4B,CAAE,EAAC,OAAO,kDAAI,CAAC;YAE5D,gBAAgB,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG;QACH,IAAI,gBAAgB;YAClB,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { API } from '../api';\nimport 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 type { Instrumentation, Instrumentations } from './types';\n\nexport function initializeInstrumentations(\n unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\n api: API\n): 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(`Instrumentation ${newInstrumentation.name} is already added`);\n\n return;\n }\n\n newInstrumentation.unpatchedConsole = unpatchedConsole;\n newInstrumentation.internalLogger = internalLogger;\n newInstrumentation.config = config;\n newInstrumentation.metas = metas;\n newInstrumentation.transports = transports;\n newInstrumentation.api = api;\n\n instrumentations.push(newInstrumentation);\n\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 === null) {\n internalLogger.warn(`Instrumentation \"${instrumentationToRemove.name}\" is not added`);\n\n return;\n }\n\n instrumentations[existingInstrumentationIndex]!.destroy?.();\n\n instrumentations.splice(existingInstrumentationIndex, 1);\n });\n };\n\n return {\n add,\n get instrumentations() {\n return [...instrumentations];\n },\n remove,\n };\n}\n"]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerInitialInstrumentations = registerInitialInstrumentations;
|
|
4
4
|
function registerInitialInstrumentations(faro) {
|
|
5
|
-
|
|
6
|
-
(_a = faro.instrumentations).add.apply(_a, faro.config.instrumentations);
|
|
5
|
+
faro.instrumentations.add(...faro.config.instrumentations);
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=registerInitial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/instrumentations/registerInitial.ts"],"names":[],"mappings":";;AAEA,0EAEC;AAFD,SAAgB,+BAA+B,CAAC,IAAU
|
|
1
|
+
{"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/instrumentations/registerInitial.ts"],"names":[],"mappings":";;AAEA,0EAEC;AAFD,SAAgB,+BAA+B,CAAC,IAAU;IACxD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import type { Faro } from '../sdk';\n\nexport function registerInitialInstrumentations(faro: Faro): void {\n faro.instrumentations.add(...faro.config.instrumentations);\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultInternalLoggerLevel = exports.defaultInternalLogger = exports.defaultInternalLoggerPrefix = exports.InternalLoggerLevel = void 0;
|
|
4
|
-
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
5
|
var InternalLoggerLevel;
|
|
6
6
|
(function (InternalLoggerLevel) {
|
|
7
7
|
InternalLoggerLevel[InternalLoggerLevel["OFF"] = 0] = "OFF";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAIhC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,2DAAO,CAAA;IACP,+DAAS,CAAA;IACT,6DAAQ,CAAA;IACR,6DAAQ,CAAA;IACR,mEAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,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';\n\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,61 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.createInternalLogger = createInternalLogger;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function createInternalLogger(unpatchedConsole, internalLoggerLevel) {
|
|
17
|
-
|
|
18
|
-
if (internalLoggerLevel === void 0) { internalLoggerLevel = const_1.defaultInternalLoggerLevel; }
|
|
19
|
-
var internalLogger = const_1.defaultInternalLogger;
|
|
4
|
+
const unpatchedConsole_1 = require("../unpatchedConsole");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const const_1 = require("./const");
|
|
7
|
+
function createInternalLogger(unpatchedConsole = unpatchedConsole_1.defaultUnpatchedConsole, internalLoggerLevel = const_1.defaultInternalLoggerLevel) {
|
|
8
|
+
const internalLogger = const_1.defaultInternalLogger;
|
|
20
9
|
if (internalLoggerLevel > const_1.InternalLoggerLevel.OFF) {
|
|
21
10
|
internalLogger.error =
|
|
22
11
|
internalLoggerLevel >= const_1.InternalLoggerLevel.ERROR
|
|
23
|
-
? function () {
|
|
24
|
-
|
|
25
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26
|
-
args[_i] = arguments[_i];
|
|
27
|
-
}
|
|
28
|
-
unpatchedConsole.error.apply(unpatchedConsole, __spreadArray(["".concat(internalLogger.prefix, "\n")], args, false));
|
|
12
|
+
? function (...args) {
|
|
13
|
+
unpatchedConsole.error(`${internalLogger.prefix}\n`, ...args);
|
|
29
14
|
}
|
|
30
15
|
: utils_1.noop;
|
|
31
16
|
internalLogger.warn =
|
|
32
17
|
internalLoggerLevel >= const_1.InternalLoggerLevel.WARN
|
|
33
|
-
? function () {
|
|
34
|
-
|
|
35
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
36
|
-
args[_i] = arguments[_i];
|
|
37
|
-
}
|
|
38
|
-
unpatchedConsole.warn.apply(unpatchedConsole, __spreadArray(["".concat(internalLogger.prefix, "\n")], args, false));
|
|
18
|
+
? function (...args) {
|
|
19
|
+
unpatchedConsole.warn(`${internalLogger.prefix}\n`, ...args);
|
|
39
20
|
}
|
|
40
21
|
: utils_1.noop;
|
|
41
22
|
internalLogger.info =
|
|
42
23
|
internalLoggerLevel >= const_1.InternalLoggerLevel.INFO
|
|
43
|
-
? function () {
|
|
44
|
-
|
|
45
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
46
|
-
args[_i] = arguments[_i];
|
|
47
|
-
}
|
|
48
|
-
unpatchedConsole.info.apply(unpatchedConsole, __spreadArray(["".concat(internalLogger.prefix, "\n")], args, false));
|
|
24
|
+
? function (...args) {
|
|
25
|
+
unpatchedConsole.info(`${internalLogger.prefix}\n`, ...args);
|
|
49
26
|
}
|
|
50
27
|
: utils_1.noop;
|
|
51
28
|
internalLogger.debug =
|
|
52
29
|
internalLoggerLevel >= const_1.InternalLoggerLevel.VERBOSE
|
|
53
|
-
? function () {
|
|
54
|
-
|
|
55
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
56
|
-
args[_i] = arguments[_i];
|
|
57
|
-
}
|
|
58
|
-
unpatchedConsole.debug.apply(unpatchedConsole, __spreadArray(["".concat(internalLogger.prefix, "\n")], args, false));
|
|
30
|
+
? function (...args) {
|
|
31
|
+
unpatchedConsole.debug(`${internalLogger.prefix}\n`, ...args);
|
|
59
32
|
}
|
|
60
33
|
: utils_1.noop;
|
|
61
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createInternalLogger.js","sourceRoot":"","sources":["../../../src/internalLogger/createInternalLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createInternalLogger.js","sourceRoot":"","sources":["../../../src/internalLogger/createInternalLogger.ts"],"names":[],"mappings":";;AAOA,oDAqCC;AA5CD,0DAA8D;AAE9D,oCAAgC;AAEhC,mCAAiG;AAGjG,SAAgB,oBAAoB,CAClC,mBAAqC,0CAAuB,EAC5D,mBAAmB,GAAG,kCAA0B;IAEhD,MAAM,cAAc,GAAG,6BAAqB,CAAC;IAE7C,IAAI,mBAAmB,GAAG,2BAAmB,CAAC,GAAG,EAAE,CAAC;QAClD,cAAc,CAAC,KAAK;YAClB,mBAAmB,IAAI,2BAAmB,CAAC,KAAK;gBAC9C,CAAC,CAAC,UAAU,GAAG,IAAI;oBACf,gBAAgB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,MAAM,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;gBAChE,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,IAAI;YACjB,mBAAmB,IAAI,2BAAmB,CAAC,IAAI;gBAC7C,CAAC,CAAC,UAAU,GAAG,IAAI;oBACf,gBAAgB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;gBAC/D,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,IAAI;YACjB,mBAAmB,IAAI,2BAAmB,CAAC,IAAI;gBAC7C,CAAC,CAAC,UAAU,GAAG,IAAI;oBACf,gBAAgB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;gBAC/D,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;QAEX,cAAc,CAAC,KAAK;YAClB,mBAAmB,IAAI,2BAAmB,CAAC,OAAO;gBAChD,CAAC,CAAC,UAAU,GAAG,IAAI;oBACf,gBAAgB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,MAAM,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;gBAChE,CAAC;gBACH,CAAC,CAAC,YAAI,CAAC;IACb,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { defaultUnpatchedConsole } from '../unpatchedConsole';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport { noop } from '../utils';\n\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"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.internalLogger = void 0;
|
|
4
4
|
exports.initializeInternalLogger = initializeInternalLogger;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const const_1 = require("./const");
|
|
6
|
+
const createInternalLogger_1 = require("./createInternalLogger");
|
|
7
7
|
exports.internalLogger = const_1.defaultInternalLogger;
|
|
8
8
|
function initializeInternalLogger(unpatchedConsole, config) {
|
|
9
9
|
exports.internalLogger = (0, createInternalLogger_1.createInternalLogger)(unpatchedConsole, config.internalLoggerLevel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/internalLogger/initialize.ts"],"names":[],"mappings":";;;AASA,4DAIC;AAVD,
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/internalLogger/initialize.ts"],"names":[],"mappings":";;;AASA,4DAIC;AAVD,mCAAgD;AAChD,iEAA8D;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","sourcesContent":["import type { Config } from '../config';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\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":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA","sourcesContent":["export { initializeMetas } from './initialize';\n\nexport { registerInitialMetas } from './registerInitial';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaK6,\n MetaPage,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n Metas,\n MetaOverrides,\n} from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA","sourcesContent":["export { initializeMetas } from './initialize';\n\nexport { registerInitialMetas } from './registerInitial';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaDevice,\n MetaGetter,\n MetaItem,\n MetaK6,\n MetaOS,\n MetaPage,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n Metas,\n MetaOverrides,\n} from './types';\n"]}
|
|
@@ -1,48 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initializeMetas = initializeMetas;
|
|
4
|
-
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
5
|
function initializeMetas(_unpatchedConsole, internalLogger, _config) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
let items = [];
|
|
7
|
+
let listeners = [];
|
|
8
|
+
const getValue = () => items.reduce((acc, item) => Object.assign(acc, (0, utils_1.isFunction)(item) ? item() : item), {});
|
|
9
|
+
const notifyListeners = () => {
|
|
10
10
|
if (listeners.length) {
|
|
11
|
-
|
|
12
|
-
listeners.forEach(
|
|
11
|
+
const value = getValue();
|
|
12
|
+
listeners.forEach((listener) => listener(value));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
var newItems = [];
|
|
17
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
18
|
-
newItems[_i] = arguments[_i];
|
|
19
|
-
}
|
|
15
|
+
const add = (...newItems) => {
|
|
20
16
|
internalLogger.debug('Adding metas\n', newItems);
|
|
21
|
-
items.push
|
|
17
|
+
items.push(...newItems);
|
|
22
18
|
notifyListeners();
|
|
23
19
|
};
|
|
24
|
-
|
|
25
|
-
var itemsToRemove = [];
|
|
26
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27
|
-
itemsToRemove[_i] = arguments[_i];
|
|
28
|
-
}
|
|
20
|
+
const remove = (...itemsToRemove) => {
|
|
29
21
|
internalLogger.debug('Removing metas\n', itemsToRemove);
|
|
30
|
-
items = items.filter(
|
|
22
|
+
items = items.filter((currentItem) => !itemsToRemove.includes(currentItem));
|
|
31
23
|
notifyListeners();
|
|
32
24
|
};
|
|
33
|
-
|
|
25
|
+
const addListener = (listener) => {
|
|
34
26
|
internalLogger.debug('Adding metas listener\n', listener);
|
|
35
27
|
listeners.push(listener);
|
|
36
28
|
};
|
|
37
|
-
|
|
29
|
+
const removeListener = (listener) => {
|
|
38
30
|
internalLogger.debug('Removing metas listener\n', listener);
|
|
39
|
-
listeners = listeners.filter(
|
|
31
|
+
listeners = listeners.filter((currentListener) => currentListener !== listener);
|
|
40
32
|
};
|
|
41
33
|
return {
|
|
42
|
-
add
|
|
43
|
-
remove
|
|
44
|
-
addListener
|
|
45
|
-
removeListener
|
|
34
|
+
add,
|
|
35
|
+
remove,
|
|
36
|
+
addListener,
|
|
37
|
+
removeListener,
|
|
46
38
|
get value() {
|
|
47
39
|
return getValue();
|
|
48
40
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/metas/initialize.ts"],"names":[],"mappings":";;AAOA,0CAuDC;AA3DD,
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/metas/initialize.ts"],"names":[],"mappings":";;AAOA,0CAuDC;AA3DD,oCAAsC;AAItC,SAAgB,eAAe,CAC7B,iBAAmC,EACnC,cAA8B,EAC9B,OAAe;IAEf,IAAI,KAAK,GAAe,EAAE,CAAC;IAC3B,IAAI,SAAS,GAAoB,EAAE,CAAC;IAEpC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAO,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnH,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;YAEzB,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,GAAG,GAAiB,CAAC,GAAG,QAAQ,EAAE,EAAE;QACxC,cAAc,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAEjD,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAExB,eAAe,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,MAAM,MAAM,GAAoB,CAAC,GAAG,aAAa,EAAE,EAAE;QACnD,cAAc,CAAC,KAAK,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;QAExD,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QAE5E,eAAe,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAyB,CAAC,QAAQ,EAAE,EAAE;QACrD,cAAc,CAAC,KAAK,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;QAE1D,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,MAAM,cAAc,GAA4B,CAAC,QAAQ,EAAE,EAAE;QAC3D,cAAc,CAAC,KAAK,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAE5D,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC;IAClF,CAAC,CAAC;IAEF,OAAO;QACL,GAAG;QACH,MAAM;QACN,WAAW;QACX,cAAc;QACd,IAAI,KAAK;YACP,OAAO,QAAQ,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport { isFunction } from '../utils';\n\nimport type { Meta, MetaItem, Metas, MetasListener } from './types';\n\nexport function initializeMetas(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n _config: Config\n): 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\n listeners.forEach((listener) => listener(value));\n }\n };\n\n const add: Metas['add'] = (...newItems) => {\n internalLogger.debug('Adding metas\\n', newItems);\n\n items.push(...newItems);\n\n notifyListeners();\n };\n\n const remove: Metas['remove'] = (...itemsToRemove) => {\n internalLogger.debug('Removing metas\\n', itemsToRemove);\n\n items = items.filter((currentItem) => !itemsToRemove.includes(currentItem));\n\n notifyListeners();\n };\n\n const addListener: Metas['addListener'] = (listener) => {\n internalLogger.debug('Adding metas listener\\n', listener);\n\n listeners.push(listener);\n };\n\n const removeListener: Metas['removeListener'] = (listener) => {\n internalLogger.debug('Removing metas listener\\n', listener);\n\n listeners = listeners.filter((currentListener) => currentListener !== listener);\n };\n\n return {\n add,\n remove,\n addListener,\n removeListener,\n get value() {\n return getValue();\n },\n };\n}\n"]}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
3
|
exports.registerInitialMetas = registerInitialMetas;
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
const sourceMaps_1 = require("../utils/sourceMaps");
|
|
5
|
+
const version_1 = require("../version");
|
|
26
6
|
function registerInitialMetas(faro) {
|
|
27
|
-
var _a;
|
|
28
|
-
|
|
29
|
-
var initial = {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const initial = {
|
|
30
9
|
sdk: {
|
|
31
10
|
version: version_1.VERSION,
|
|
32
11
|
name: 'faro',
|
|
@@ -35,12 +14,12 @@ function registerInitialMetas(faro) {
|
|
|
35
14
|
bundleId: faro.config.app.name && (0, sourceMaps_1.getBundleId)(faro.config.app.name),
|
|
36
15
|
},
|
|
37
16
|
};
|
|
38
|
-
|
|
17
|
+
const session = (_a = faro.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.session;
|
|
39
18
|
if (session) {
|
|
40
19
|
faro.api.setSession(session);
|
|
41
20
|
}
|
|
42
21
|
if (faro.config.app) {
|
|
43
|
-
initial.app =
|
|
22
|
+
initial.app = Object.assign(Object.assign({}, faro.config.app), initial.app);
|
|
44
23
|
}
|
|
45
24
|
if (faro.config.user) {
|
|
46
25
|
initial.user = faro.config.user;
|
|
@@ -48,6 +27,6 @@ function registerInitialMetas(faro) {
|
|
|
48
27
|
if (faro.config.view) {
|
|
49
28
|
initial.view = faro.config.view;
|
|
50
29
|
}
|
|
51
|
-
|
|
30
|
+
faro.metas.add(initial, ...((_b = faro.config.metas) !== null && _b !== void 0 ? _b : []));
|
|
52
31
|
}
|
|
53
32
|
//# sourceMappingURL=registerInitial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;AAMA,oDA6BC;AAlCD,oDAAkD;AAClD,wCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;IAC7C,MAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,iBAAO;YAChB,IAAI,EAAE,MAAM;SACb;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,IAAA,wBAAW,EAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACpE;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,eAAe,0CAAE,OAAO,CAAC;IACrD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,mCAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,GAAK,OAAO,CAAC,GAAG,CAAE,CAAC;IACvD,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import type { Faro } from '../sdk';\nimport { getBundleId } from '../utils/sourceMaps';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n version: VERSION,\n name: 'faro',\n },\n app: {\n bundleId: faro.config.app.name && getBundleId(faro.config.app.name),\n },\n };\n\n const session = faro.config.sessionTracking?.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = { ...faro.config.app, ...initial.app };\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n
|
|
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 bundleId?: string;\n environment?: string;\n installationId?: string;\n name?: string;\n namespace?: string;\n release?: string;\n version?: string;\n}\n\nexport interface MetaUser {\n /**\n * User email address.\n */\n email?: string;\n /**\n * Unique identifier\n */\n id?: string;\n /**\n * Short name or login/username of the user.\n */\n username?: string;\n /**\n * User’s full name\n */\n fullName?: string;\n /**\n * comma separated list of user roles. \"admin\",editor\" etc.\n */\n roles?: string;\n /**\n * Unique user hash to correlate information for a user in anonymized form.\n */\n hash?: string;\n /**\n * arbitrary user attributes, must be of type string.\n */\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n overrides?: MetaOverrides;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n viewportWidth?: string;\n viewportHeight?: string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n testRunId?: string;\n}\n\n// Fields on MetaOS and MetaDevice use snake_case to mirror the Faro spec wire\n// format, which in turn mirrors OTel `os.*` and `device.*` semantic convention\n// attribute keys (e.g. os.build_id, device.model.identifier). Intentionally\n// inconsistent with the camelCase used elsewhere in Meta.\nexport interface MetaOS {\n name?: string;\n version?: string;\n build_id?: string;\n detail?: string;\n}\n\nexport interface MetaDevice {\n manufacturer?: string;\n model_identifier?: string;\n model_name?: string;\n brand?: string;\n is_physical?: boolean;\n type?: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n os?: MetaOS;\n device?: MetaDevice;\n}\n\n/**\n * MetaOverrides are instructions that allow the receiver to override certain properties (Grafana Cloud only).\n */\nexport type MetaOverrides = {\n /**\n * New service name (Grafana Cloud only)\n */\n serviceName?: string;\n\n /**\n * Enable or disable geolocation tracking (Grafana Cloud only).\n * Geolocation tracking must be enabled in the Grafana Cloud settings first.\n * It cannot be enabled solely on the client side.\n * This option allows control over tracking on the client side to comply with user\n * privacy requirements.\n */\n geoLocationTrackingEnabled?: boolean;\n};\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setFaroOnGlobalObject = setFaroOnGlobalObject;
|
|
4
|
-
|
|
4
|
+
const globalObject_1 = require("../globalObject");
|
|
5
5
|
function setFaroOnGlobalObject(faro) {
|
|
6
6
|
if (!faro.config.preventGlobalExposure) {
|
|
7
|
-
faro.internalLogger.debug(
|
|
7
|
+
faro.internalLogger.debug(`Registering public faro reference in the global scope using "${faro.config.globalObjectKey}" key`);
|
|
8
8
|
if (faro.config.globalObjectKey in globalObject_1.globalObject) {
|
|
9
|
-
faro.internalLogger.warn(
|
|
9
|
+
faro.internalLogger.warn(`Skipping global registration due to key "${faro.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
Object.defineProperty(globalObject_1.globalObject, faro.config.globalObjectKey, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faroGlobalObject.js","sourceRoot":"","sources":["../../../src/sdk/faroGlobalObject.ts"],"names":[],"mappings":";;AAIA,sDAsBC;AA1BD,
|
|
1
|
+
{"version":3,"file":"faroGlobalObject.js","sourceRoot":"","sources":["../../../src/sdk/faroGlobalObject.ts"],"names":[],"mappings":";;AAIA,sDAsBC;AA1BD,kDAA+C;AAI/C,SAAgB,qBAAqB,CAAC,IAAU;IAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC;QACvC,IAAI,CAAC,cAAc,CAAC,KAAK,CACvB,gEAAgE,IAAI,CAAC,MAAM,CAAC,eAAe,OAAO,CACnG,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,2BAAY,EAAE,CAAC;YAChD,IAAI,CAAC,cAAc,CAAC,IAAI,CACtB,4CAA4C,IAAI,CAAC,MAAM,CAAC,eAAe,+GAA+G,CACvL,CAAC;YAEF,OAAO;QACT,CAAC;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;IACL,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC","sourcesContent":["import { globalObject } from '../globalObject';\n\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"]}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInternalFromGlobalObject = getInternalFromGlobalObject;
|
|
4
4
|
exports.setInternalFaroOnGlobalObject = setInternalFaroOnGlobalObject;
|
|
5
5
|
exports.isInternalFaroOnGlobalObject = isInternalFaroOnGlobalObject;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const globalObject_1 = require("../globalObject");
|
|
7
|
+
const const_1 = require("./const");
|
|
8
8
|
function getInternalFromGlobalObject() {
|
|
9
9
|
return globalObject_1.globalObject[const_1.internalGlobalObjectKey];
|
|
10
10
|
}
|