@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
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initializeTracesAPI = initializeTracesAPI;
|
|
4
|
-
|
|
4
|
+
const transports_1 = require("../../transports");
|
|
5
5
|
function initializeTracesAPI(_unpatchedConsole, internalLogger, _config, metas, transports) {
|
|
6
6
|
internalLogger.debug('Initializing traces API');
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
let otel = undefined;
|
|
8
|
+
const initOTEL = (trace, context) => {
|
|
9
9
|
internalLogger.debug('Initializing OpenTelemetry');
|
|
10
10
|
otel = {
|
|
11
|
-
trace
|
|
12
|
-
context
|
|
11
|
+
trace,
|
|
12
|
+
context,
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const getTraceContext = () => {
|
|
16
|
+
const ctx = otel === null || otel === void 0 ? void 0 : otel.trace.getSpanContext(otel.context.active());
|
|
17
17
|
return !ctx
|
|
18
18
|
? undefined
|
|
19
19
|
: {
|
|
@@ -21,11 +21,11 @@ function initializeTracesAPI(_unpatchedConsole, internalLogger, _config, metas,
|
|
|
21
21
|
span_id: ctx.spanId,
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
const pushTraces = (payload) => {
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
const item = {
|
|
27
27
|
type: transports_1.TransportItemType.TRACE,
|
|
28
|
-
payload
|
|
28
|
+
payload,
|
|
29
29
|
meta: metas.value,
|
|
30
30
|
};
|
|
31
31
|
internalLogger.debug('Pushing trace\n', item);
|
|
@@ -35,14 +35,14 @@ function initializeTracesAPI(_unpatchedConsole, internalLogger, _config, metas,
|
|
|
35
35
|
internalLogger.error('Error pushing trace\n', err);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const getOTEL = () => otel;
|
|
39
|
+
const isOTELInitialized = () => !!otel;
|
|
40
40
|
return {
|
|
41
|
-
getOTEL
|
|
42
|
-
getTraceContext
|
|
43
|
-
initOTEL
|
|
44
|
-
isOTELInitialized
|
|
45
|
-
pushTraces
|
|
41
|
+
getOTEL,
|
|
42
|
+
getTraceContext,
|
|
43
|
+
initOTEL,
|
|
44
|
+
isOTELInitialized,
|
|
45
|
+
pushTraces,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=initialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/traces/initialize.ts"],"names":[],"mappings":";;AASA,kDA0DC;AAhED
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/traces/initialize.ts"],"names":[],"mappings":";;AASA,kDA0DC;AAhED,iDAAqD;AAMrD,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,MAAM,QAAQ,GAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACzD,cAAc,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAEnD,IAAI,GAAG;YACL,KAAK;YACL,OAAO;SACR,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,eAAe,GAAiC,GAAG,EAAE;QACzD,MAAM,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,MAAM,UAAU,GAA4B,CAAC,OAAO,EAAE,EAAE;QACtD,IAAI,CAAC;YACH,MAAM,IAAI,GAA8B;gBACtC,IAAI,EAAE,8BAAiB,CAAC,KAAK;gBAC7B,OAAO;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;QAC3B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,cAAc,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAyB,GAAG,EAAE,CAAC,IAAI,CAAC;IAEjD,MAAM,iBAAiB,GAAmC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvE,OAAO;QACL,OAAO;QACP,eAAe;QACf,QAAQ;QACR,iBAAiB;QACjB,UAAU;KACX,CAAC;AACJ,CAAC","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/types';\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"]}
|
|
@@ -6,36 +6,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.userActionsMessageBus = void 0;
|
|
7
7
|
exports.initializeUserActionsAPI = initializeUserActionsAPI;
|
|
8
8
|
exports.addItemToUserActionBuffer = addItemToUserActionBuffer;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const reactive_1 = require("../../utils/reactive");
|
|
10
|
+
const const_1 = require("./const");
|
|
11
|
+
const types_1 = require("./types");
|
|
12
|
+
const userAction_1 = __importDefault(require("./userAction"));
|
|
13
13
|
exports.userActionsMessageBus = new reactive_1.Observable();
|
|
14
|
-
function initializeUserActionsAPI(
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var trackUserActionsExcludeItem = (_b = config.userActionsInstrumentation) === null || _b === void 0 ? void 0 : _b.excludeItem;
|
|
14
|
+
function initializeUserActionsAPI({ transports, internalLogger, config, pushEvent, }) {
|
|
15
|
+
var _a;
|
|
16
|
+
const trackUserActionsExcludeItem = (_a = config.userActionsInstrumentation) === null || _a === void 0 ? void 0 : _a.excludeItem;
|
|
18
17
|
// Currently running user action. It can be in either started or halted
|
|
19
18
|
// state
|
|
20
|
-
|
|
19
|
+
let activeUserAction;
|
|
21
20
|
// If there is a an action already running, return undefined to indicate
|
|
22
21
|
// we were not able to create one.
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const startUserAction = (name, attributes, options) => {
|
|
23
|
+
const currentRunningUserAction = getActiveUserAction();
|
|
25
24
|
if (currentRunningUserAction === undefined) {
|
|
26
|
-
|
|
27
|
-
name
|
|
28
|
-
transports
|
|
29
|
-
attributes
|
|
25
|
+
const userAction = new userAction_1.default({
|
|
26
|
+
name,
|
|
27
|
+
transports,
|
|
28
|
+
attributes,
|
|
30
29
|
trigger: (options === null || options === void 0 ? void 0 : options.triggerName) || const_1.userActionStartByApiCallEventName,
|
|
31
30
|
importance: (options === null || options === void 0 ? void 0 : options.importance) || const_1.UserActionImportance.Normal,
|
|
32
|
-
trackUserActionsExcludeItem
|
|
33
|
-
pushEvent
|
|
31
|
+
trackUserActionsExcludeItem,
|
|
32
|
+
pushEvent,
|
|
34
33
|
});
|
|
35
34
|
userAction
|
|
36
|
-
.filter(
|
|
35
|
+
.filter((v) => [types_1.UserActionState.Ended, types_1.UserActionState.Cancelled].includes(v))
|
|
37
36
|
.first()
|
|
38
|
-
.subscribe(
|
|
37
|
+
.subscribe(() => {
|
|
39
38
|
activeUserAction = undefined;
|
|
40
39
|
});
|
|
41
40
|
exports.userActionsMessageBus.notify({
|
|
@@ -50,12 +49,12 @@ function initializeUserActionsAPI(_a) {
|
|
|
50
49
|
return undefined;
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
|
-
|
|
52
|
+
const getActiveUserAction = () => {
|
|
54
53
|
return activeUserAction;
|
|
55
54
|
};
|
|
56
|
-
|
|
57
|
-
startUserAction
|
|
58
|
-
getActiveUserAction
|
|
55
|
+
const api = {
|
|
56
|
+
startUserAction,
|
|
57
|
+
getActiveUserAction,
|
|
59
58
|
};
|
|
60
59
|
return api;
|
|
61
60
|
}
|
|
@@ -70,7 +69,7 @@ function addItemToUserActionBuffer(userAction, item) {
|
|
|
70
69
|
if (!userAction) {
|
|
71
70
|
return false;
|
|
72
71
|
}
|
|
73
|
-
|
|
72
|
+
const state = userAction === null || userAction === void 0 ? void 0 : userAction.getState();
|
|
74
73
|
if (state !== types_1.UserActionState.Started) {
|
|
75
74
|
return false;
|
|
76
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/userActions/initialize.ts"],"names":[],"mappings":";;;;;;AAoBA,4DAkEC;AASD,8DAUC;AAtGD,
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/userActions/initialize.ts"],"names":[],"mappings":";;;;;;AAoBA,4DAkEC;AASD,8DAUC;AAtGD,mDAAkD;AAGlD,mCAAmG;AACnG,mCAQiB;AACjB,8DAAsC;AAEzB,QAAA,qBAAqB,GAAG,IAAI,qBAAU,EAAqB,CAAC;AAEzE,SAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,GAMV;;IACC,MAAM,2BAA2B,GAAG,MAAA,MAAM,CAAC,0BAA0B,0CAAE,WAAW,CAAC;IAEnF,uEAAuE;IACvE,QAAQ;IACR,IAAI,gBAAwC,CAAC;IAE7C,wEAAwE;IACxE,kCAAkC;IAClC,MAAM,eAAe,GAAsC,CACzD,IAAY,EACZ,UAAmC,EACnC,OAAgC,EACC,EAAE;QACnC,MAAM,wBAAwB,GAAG,mBAAmB,EAAE,CAAC;QAEvD,IAAI,wBAAwB,KAAK,SAAS,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,IAAI,oBAAU,CAAC;gBAChC,IAAI;gBACJ,UAAU;gBACV,UAAU;gBACV,OAAO,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,yCAAiC;gBAClE,UAAU,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,KAAI,4BAAoB,CAAC,MAAM;gBAC9D,2BAA2B;gBAC3B,SAAS;aACV,CAAC,CAAC;YACH,UAAU;iBACP,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,uBAAe,CAAC,KAAK,EAAE,uBAAe,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBAC7E,KAAK,EAAE;iBACP,SAAS,CAAC,GAAG,EAAE;gBACd,gBAAgB,GAAG,SAAS,CAAC;YAC/B,CAAC,CAAC,CAAC;YAEL,6BAAqB,CAAC,MAAM,CAAC;gBAC3B,IAAI,EAAE,uBAAe;gBACrB,UAAU,EAAE,UAAU;aACvB,CAAC,CAAC;YACH,gBAAgB,GAAG,UAAU,CAAC;YAE9B,OAAO,gBAAgB,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAC;YAClH,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAA0C,GAAoC,EAAE;QACvG,OAAO,gBAAgB,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,GAAG,GAAmB;QAC1B,eAAe;QACf,mBAAmB;KACpB,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,yBAAyB,CAAC,UAA2C,EAAE,IAAmB;IACxG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAI,UAAqD,aAArD,UAAU,uBAAV,UAAU,CAA6C,QAAQ,EAAE,CAAC;IACjF,IAAI,KAAK,KAAK,uBAAe,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACA,UAAuD,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { TransportItem, Transports } from '../../transports';\nimport { Observable } from '../../utils/reactive';\nimport type { EventsAPI } from '../events/types';\n\nimport { UserActionImportance, userActionStart, userActionStartByApiCallEventName } from './const';\nimport {\n type StartUserActionOptions,\n type UserActionInterface,\n type UserActionInternalInterface,\n type UserActionMessage,\n type UserActionsAPI,\n UserActionState,\n type UserActionTransportItemBuffer,\n} from './types';\nimport UserAction from './userAction';\n\nexport const userActionsMessageBus = new Observable<UserActionMessage>();\n\nexport function initializeUserActionsAPI({\n transports,\n internalLogger,\n config,\n pushEvent,\n}: {\n transports: Transports;\n config: Config;\n internalLogger: InternalLogger;\n pushEvent: EventsAPI['pushEvent'];\n}): UserActionsAPI {\n const trackUserActionsExcludeItem = config.userActionsInstrumentation?.excludeItem;\n\n // Currently running user action. It can be in either started or halted\n // state\n let activeUserAction: UserAction | undefined;\n\n // If there is a an action already running, return undefined to indicate\n // we were not able to create one.\n const startUserAction: UserActionsAPI['startUserAction'] = (\n name: string,\n attributes?: Record<string, string>,\n options?: StartUserActionOptions\n ): UserActionInterface | undefined => {\n const currentRunningUserAction = getActiveUserAction();\n\n if (currentRunningUserAction === undefined) {\n const userAction = new UserAction({\n name,\n transports,\n attributes,\n trigger: options?.triggerName || userActionStartByApiCallEventName,\n importance: options?.importance || UserActionImportance.Normal,\n trackUserActionsExcludeItem,\n pushEvent,\n });\n userAction\n .filter((v) => [UserActionState.Ended, UserActionState.Cancelled].includes(v))\n .first()\n .subscribe(() => {\n activeUserAction = undefined;\n });\n\n userActionsMessageBus.notify({\n type: userActionStart,\n userAction: userAction,\n });\n activeUserAction = userAction;\n\n return activeUserAction;\n } else {\n internalLogger.error('Attempted to create a new user action while one is already running. This is not possible.');\n return undefined;\n }\n };\n\n const getActiveUserAction: UserActionsAPI['getActiveUserAction'] = (): UserActionInterface | undefined => {\n return activeUserAction;\n };\n\n const api: UserActionsAPI = {\n startUserAction,\n getActiveUserAction,\n };\n\n return api;\n}\n\n/**\n * Adds an item to the buffer associated with the given UserAction.\n * The item will only be added if the UserAction is in the Started state.\n * @param userAction The UserAction instance\n * @param item The item to add to the buffer\n * @returns {boolean} True if the item was added, false otherwise\n */\nexport function addItemToUserActionBuffer(userAction: UserActionInterface | undefined, item: TransportItem): boolean {\n if (!userAction) {\n return false;\n }\n const state = (userAction as unknown as UserActionInternalInterface)?.getState();\n if (state !== UserActionState.Started) {\n return false;\n }\n (userAction as unknown as UserActionTransportItemBuffer).addItem(item);\n return true;\n}\n"]}
|
|
@@ -1,123 +1,100 @@
|
|
|
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
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_this._state = types_1.UserActionState.Started;
|
|
50
|
-
_this._start();
|
|
51
|
-
return _this;
|
|
3
|
+
const transports_1 = require("../../transports");
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const ItemBuffer_1 = require("../ItemBuffer");
|
|
6
|
+
const const_1 = require("./const");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
class UserAction extends utils_1.Observable {
|
|
9
|
+
constructor({ name, parentId, trigger, transports, attributes, trackUserActionsExcludeItem, importance = const_1.UserActionImportance.Normal, pushEvent, }) {
|
|
10
|
+
super();
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.attributes = attributes;
|
|
13
|
+
this.id = (0, utils_1.genShortID)();
|
|
14
|
+
this.trigger = trigger;
|
|
15
|
+
this.parentId = parentId !== null && parentId !== void 0 ? parentId : this.id;
|
|
16
|
+
this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;
|
|
17
|
+
this.importance = importance;
|
|
18
|
+
this._pushEvent = pushEvent;
|
|
19
|
+
this._itemBuffer = new ItemBuffer_1.ItemBuffer();
|
|
20
|
+
this._transports = transports;
|
|
21
|
+
this._state = types_1.UserActionState.Started;
|
|
22
|
+
this._start();
|
|
52
23
|
}
|
|
53
|
-
|
|
24
|
+
addItem(item) {
|
|
54
25
|
if (this._state === types_1.UserActionState.Started) {
|
|
55
26
|
this._itemBuffer.addItem(item);
|
|
56
27
|
return true;
|
|
57
28
|
}
|
|
58
29
|
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
30
|
+
}
|
|
31
|
+
_start() {
|
|
61
32
|
this._state = types_1.UserActionState.Started;
|
|
62
33
|
if (this._state === types_1.UserActionState.Started) {
|
|
34
|
+
// `startTime` is wall-clock (Unix-epoch ms) so it can be used as the event's
|
|
35
|
+
// `timestampOverwriteMs` and emitted as `userActionStartTime` for consumers that
|
|
36
|
+
// correlate with other systems. `_startTimeMono` is the monotonic anchor used
|
|
37
|
+
// for the duration calculation in `end()`.
|
|
63
38
|
this.startTime = (0, utils_1.dateNow)();
|
|
39
|
+
this._startTimeMono = (0, utils_1.monoNow)();
|
|
64
40
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
41
|
+
}
|
|
42
|
+
halt() {
|
|
67
43
|
if (this._state !== types_1.UserActionState.Started) {
|
|
68
44
|
return;
|
|
69
45
|
}
|
|
70
46
|
this._state = types_1.UserActionState.Halted;
|
|
71
47
|
this.notify(this._state);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var _this = this;
|
|
48
|
+
}
|
|
49
|
+
cancel() {
|
|
75
50
|
if (this._state === types_1.UserActionState.Started) {
|
|
76
51
|
// Empty the buffer
|
|
77
|
-
this._itemBuffer.flushBuffer(
|
|
78
|
-
|
|
52
|
+
this._itemBuffer.flushBuffer((item) => {
|
|
53
|
+
this._transports.execute(item);
|
|
79
54
|
});
|
|
80
55
|
}
|
|
81
56
|
this._state = types_1.UserActionState.Cancelled;
|
|
82
57
|
this.notify(this._state);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
var _this = this;
|
|
58
|
+
}
|
|
59
|
+
end() {
|
|
86
60
|
if (this._state === types_1.UserActionState.Cancelled) {
|
|
87
61
|
return;
|
|
88
62
|
}
|
|
89
|
-
|
|
90
|
-
|
|
63
|
+
const endTime = (0, utils_1.dateNow)();
|
|
64
|
+
// Compute duration from the monotonic clock so it is unaffected by wall-clock
|
|
65
|
+
// adjustments during the action. Note: `endTime - startTime` (both wall-clock) may
|
|
66
|
+
// disagree with `duration` if the system clock was adjusted between start and end;
|
|
67
|
+
// `duration` is authoritative.
|
|
68
|
+
const duration = (0, utils_1.monoNow)() - this._startTimeMono;
|
|
91
69
|
this._state = types_1.UserActionState.Ended;
|
|
92
|
-
this._itemBuffer.flushBuffer(
|
|
93
|
-
if (isExcludeFromUserAction(item,
|
|
94
|
-
|
|
70
|
+
this._itemBuffer.flushBuffer((item) => {
|
|
71
|
+
if (isExcludeFromUserAction(item, this.trackUserActionsExcludeItem)) {
|
|
72
|
+
this._transports.execute(item);
|
|
95
73
|
return;
|
|
96
74
|
}
|
|
97
|
-
|
|
98
|
-
parentId:
|
|
99
|
-
name:
|
|
75
|
+
const userActionItem = Object.assign(Object.assign({}, item), { payload: Object.assign(Object.assign({}, item.payload), { action: {
|
|
76
|
+
parentId: this.id,
|
|
77
|
+
name: this.name,
|
|
100
78
|
} }) });
|
|
101
|
-
|
|
79
|
+
this._transports.execute(userActionItem);
|
|
102
80
|
});
|
|
103
81
|
this._state = types_1.UserActionState.Ended;
|
|
104
82
|
this.notify(this._state);
|
|
105
|
-
this._pushEvent(const_1.userActionEventName,
|
|
83
|
+
this._pushEvent(const_1.userActionEventName, Object.assign({ userActionName: this.name, userActionStartTime: this.startTime.toString(), userActionEndTime: endTime.toString(), userActionDuration: duration.toString(), userActionTrigger: this.trigger, userActionImportance: this.importance }, (0, utils_1.stringifyObjectValues)(this.attributes)), undefined, {
|
|
106
84
|
timestampOverwriteMs: this.startTime,
|
|
107
|
-
customPayloadTransformer:
|
|
85
|
+
customPayloadTransformer: (payload) => {
|
|
108
86
|
payload.action = {
|
|
109
|
-
id:
|
|
110
|
-
name:
|
|
87
|
+
id: this.id,
|
|
88
|
+
name: this.name,
|
|
111
89
|
};
|
|
112
90
|
return payload;
|
|
113
91
|
},
|
|
114
92
|
});
|
|
115
|
-
}
|
|
116
|
-
|
|
93
|
+
}
|
|
94
|
+
getState() {
|
|
117
95
|
return this._state;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
}(utils_1.Observable));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
121
98
|
exports.default = UserAction;
|
|
122
99
|
function isExcludeFromUserAction(item, trackUserActionsExcludeItem) {
|
|
123
100
|
return ((trackUserActionsExcludeItem === null || trackUserActionsExcludeItem === void 0 ? void 0 : trackUserActionsExcludeItem(item)) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAction.js","sourceRoot":"","sources":["../../../../src/api/userActions/userAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"userAction.js","sourceRoot":"","sources":["../../../../src/api/userActions/userAction.ts"],"names":[],"mappings":"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","sourcesContent":["import { type TransportItem, TransportItemType, type Transports } from '../../transports';\nimport { dateNow, genShortID, monoNow, Observable, stringifyObjectValues } from '../../utils';\nimport type { EventsAPI } from '../events/types';\nimport { ItemBuffer } from '../ItemBuffer';\nimport { type MeasurementEvent } from '../measurements/types';\nimport { type APIEvent } from '../types';\n\nimport { userActionEventName, UserActionImportance, type UserActionImportanceType } from './const';\nimport { type UserActionInternalInterface, UserActionState, type UserActionTransportItemBuffer } from './types';\n\nexport default class UserAction\n extends Observable\n implements UserActionInternalInterface, UserActionTransportItemBuffer\n{\n name: string;\n id: string;\n attributes?: Record<string, string>;\n parentId: string;\n trigger: string;\n importance: UserActionImportanceType;\n startTime?: number;\n // Monotonic counterpart to `startTime`, used to compute `duration` immune to wall-clock\n // adjustments (NTP step, manual clock change, DST). Not exposed in telemetry — see `end()`.\n private _startTimeMono?: number;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n\n private _state: UserActionState;\n private _itemBuffer: ItemBuffer<TransportItem>;\n private _transports: Transports;\n private _pushEvent: EventsAPI['pushEvent'];\n\n constructor({\n name,\n parentId,\n trigger,\n transports,\n attributes,\n trackUserActionsExcludeItem,\n importance = UserActionImportance.Normal,\n pushEvent,\n }: {\n name: string;\n transports: Transports;\n parentId?: string;\n trigger: string;\n attributes?: Record<string, string>;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n importance?: UserActionImportanceType;\n pushEvent: EventsAPI['pushEvent'];\n }) {\n super();\n this.name = name;\n this.attributes = attributes;\n this.id = genShortID();\n this.trigger = trigger;\n this.parentId = parentId ?? this.id;\n this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;\n this.importance = importance;\n this._pushEvent = pushEvent;\n\n this._itemBuffer = new ItemBuffer<TransportItem>();\n this._transports = transports;\n this._state = UserActionState.Started;\n this._start();\n }\n\n addItem(item: TransportItem): boolean {\n if (this._state === UserActionState.Started) {\n this._itemBuffer.addItem(item);\n return true;\n }\n return false;\n }\n\n private _start(): void {\n this._state = UserActionState.Started;\n if (this._state === UserActionState.Started) {\n // `startTime` is wall-clock (Unix-epoch ms) so it can be used as the event's\n // `timestampOverwriteMs` and emitted as `userActionStartTime` for consumers that\n // correlate with other systems. `_startTimeMono` is the monotonic anchor used\n // for the duration calculation in `end()`.\n this.startTime = dateNow();\n this._startTimeMono = monoNow();\n }\n }\n\n halt() {\n if (this._state !== UserActionState.Started) {\n return;\n }\n this._state = UserActionState.Halted;\n this.notify(this._state);\n }\n\n cancel() {\n if (this._state === UserActionState.Started) {\n // Empty the buffer\n this._itemBuffer.flushBuffer((item) => {\n this._transports.execute(item);\n });\n }\n\n this._state = UserActionState.Cancelled;\n this.notify(this._state);\n }\n\n end() {\n if (this._state === UserActionState.Cancelled) {\n return;\n }\n\n const endTime = dateNow();\n // Compute duration from the monotonic clock so it is unaffected by wall-clock\n // adjustments during the action. Note: `endTime - startTime` (both wall-clock) may\n // disagree with `duration` if the system clock was adjusted between start and end;\n // `duration` is authoritative.\n const duration = monoNow() - this._startTimeMono!;\n this._state = UserActionState.Ended;\n this._itemBuffer.flushBuffer((item) => {\n if (isExcludeFromUserAction(item, this.trackUserActionsExcludeItem)) {\n this._transports.execute(item);\n return;\n }\n\n const userActionItem = {\n ...item,\n payload: {\n ...item.payload,\n action: {\n parentId: this.id,\n name: this.name,\n },\n },\n } as TransportItem;\n\n this._transports.execute(userActionItem);\n });\n\n this._state = UserActionState.Ended;\n this.notify(this._state);\n\n this._pushEvent(\n userActionEventName,\n {\n userActionName: this.name,\n userActionStartTime: this.startTime!.toString(),\n userActionEndTime: endTime.toString(),\n userActionDuration: duration.toString(),\n userActionTrigger: this.trigger!,\n userActionImportance: this.importance,\n ...stringifyObjectValues(this.attributes),\n },\n undefined,\n {\n timestampOverwriteMs: this.startTime,\n customPayloadTransformer: (payload) => {\n payload.action = {\n id: this.id,\n name: this.name,\n };\n\n return payload;\n },\n }\n );\n }\n\n getState(): UserActionState {\n return this._state;\n }\n}\n\nfunction isExcludeFromUserAction(\n item: TransportItem<APIEvent>,\n trackUserActionsExcludeItem: ((item: TransportItem<APIEvent>) => boolean) | undefined\n) {\n return (\n trackUserActionsExcludeItem?.(item) ||\n (item.type === TransportItemType.MEASUREMENT && (item.payload as MeasurementEvent).type === 'web-vitals')\n );\n}\n"]}
|
package/dist/cjs/api/utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.shouldIgnoreEvent = shouldIgnoreEvent;
|
|
4
|
-
|
|
4
|
+
const is_1 = require("../utils/is");
|
|
5
5
|
function shouldIgnoreEvent(patterns, msg) {
|
|
6
|
-
return patterns.some(
|
|
6
|
+
return patterns.some((pattern) => {
|
|
7
7
|
return (0, is_1.isString)(pattern) ? msg.includes(pattern) : !!msg.match(pattern);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":";;AAGA,8CAIC;AAND,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":";;AAGA,8CAIC;AAND,oCAAuC;AAEvC,SAAgB,iBAAiB,CAAC,QAAkB,EAAE,GAAW;IAC/D,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/B,OAAO,IAAA,aAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Patterns } from '../config/types';\nimport { isString } from '../utils/is';\n\nexport function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean {\n return patterns.some((pattern) => {\n return isString(pattern) ? msg.includes(pattern) : !!msg.match(pattern);\n });\n}\n"]}
|
|
@@ -1,57 +1,27 @@
|
|
|
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.BaseExtension = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const internalLogger_1 = require("../internalLogger");
|
|
5
|
+
const unpatchedConsole_1 = require("../unpatchedConsole");
|
|
6
|
+
class BaseExtension {
|
|
7
|
+
constructor() {
|
|
17
8
|
this.unpatchedConsole = unpatchedConsole_1.defaultUnpatchedConsole;
|
|
18
9
|
this.internalLogger = internalLogger_1.defaultInternalLogger;
|
|
19
10
|
this.config = {};
|
|
20
11
|
this.metas = {};
|
|
21
12
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
(_a = this.internalLogger).info.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
37
|
-
};
|
|
38
|
-
BaseExtension.prototype.logWarn = function () {
|
|
39
|
-
var _a;
|
|
40
|
-
var args = [];
|
|
41
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
42
|
-
args[_i] = arguments[_i];
|
|
43
|
-
}
|
|
44
|
-
(_a = this.internalLogger).warn.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
45
|
-
};
|
|
46
|
-
BaseExtension.prototype.logError = function () {
|
|
47
|
-
var _a;
|
|
48
|
-
var args = [];
|
|
49
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
50
|
-
args[_i] = arguments[_i];
|
|
51
|
-
}
|
|
52
|
-
(_a = this.internalLogger).error.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
|
|
53
|
-
};
|
|
54
|
-
return BaseExtension;
|
|
55
|
-
}());
|
|
13
|
+
logDebug(...args) {
|
|
14
|
+
this.internalLogger.debug(`${this.name}\n`, ...args);
|
|
15
|
+
}
|
|
16
|
+
logInfo(...args) {
|
|
17
|
+
this.internalLogger.info(`${this.name}\n`, ...args);
|
|
18
|
+
}
|
|
19
|
+
logWarn(...args) {
|
|
20
|
+
this.internalLogger.warn(`${this.name}\n`, ...args);
|
|
21
|
+
}
|
|
22
|
+
logError(...args) {
|
|
23
|
+
this.internalLogger.error(`${this.name}\n`, ...args);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
56
26
|
exports.BaseExtension = BaseExtension;
|
|
57
27
|
//# sourceMappingURL=baseExtension.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseExtension.js","sourceRoot":"","sources":["../../../src/extensions/baseExtension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseExtension.js","sourceRoot":"","sources":["../../../src/extensions/baseExtension.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAE1D,0DAA8D;AAI9D,MAAsB,aAAa;IAAnC;QAIE,qBAAgB,GAAG,0CAAuB,CAAC;QAC3C,mBAAc,GAAG,sCAAqB,CAAC;QACvC,WAAM,GAAG,EAAY,CAAC;QACtB,UAAK,GAAG,EAAW,CAAC;IAiBtB,CAAC;IAfC,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACvD,CAAC;CACF;AAxBD,sCAwBC","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"]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
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.clampSamplingRate = exports.allLogLevels = exports.defaultUnpatchedConsole = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.getTransportBody = exports.BaseTransport = exports.setInternalFaroOnGlobalObject = exports.isInternalFaroOnGlobalObject = exports.internalGlobalObjectKey = exports.getInternalFaroFromGlobalObject = exports.faro = exports.InternalLoggerLevel = exports.defaultInternalLoggerLevel = exports.createInternalLogger = exports.BaseInstrumentation = exports.defaultGlobalObjectKey = exports.defaultBatchingConfig = exports.initializeFaro = exports.globalObject = exports.BaseExtension = exports.userActionsMessageBus = exports.UserActionState = exports.UserActionImportance = exports.defaultErrorArgsSerializer = exports.defaultLogArgsSerializer = exports.defaultExceptionType = void 0;
|
|
18
|
-
exports.unknownString = exports.VERSION = exports.Observable = exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.isEmpty = exports.dateNow = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = void 0;
|
|
18
|
+
exports.unknownString = exports.VERSION = exports.Observable = exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.isEmpty = exports.monoNow = exports.dateNow = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = void 0;
|
|
19
19
|
var api_1 = require("./api");
|
|
20
20
|
Object.defineProperty(exports, "defaultExceptionType", { enumerable: true, get: function () { return api_1.defaultExceptionType; } });
|
|
21
21
|
Object.defineProperty(exports, "defaultLogArgsSerializer", { enumerable: true, get: function () { return api_1.defaultLogArgsSerializer; } });
|
|
@@ -91,6 +91,7 @@ Object.defineProperty(exports, "isUndefined", { enumerable: true, get: function
|
|
|
91
91
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return utils_1.LogLevel; } });
|
|
92
92
|
Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return utils_1.noop; } });
|
|
93
93
|
Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return utils_1.dateNow; } });
|
|
94
|
+
Object.defineProperty(exports, "monoNow", { enumerable: true, get: function () { return utils_1.monoNow; } });
|
|
94
95
|
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return utils_1.isEmpty; } });
|
|
95
96
|
Object.defineProperty(exports, "getCircularDependencyReplacer", { enumerable: true, get: function () { return utils_1.getCircularDependencyReplacer; } });
|
|
96
97
|
Object.defineProperty(exports, "stringifyExternalJson", { enumerable: true, get: function () { return utils_1.stringifyExternalJson; } });
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6BAQe;AAPb,2GAAA,oBAAoB,OAAA;AACpB,+GAAA,wBAAwB,OAAA;AACxB,iHAAA,0BAA0B,OAAA;AAC1B,2GAAA,oBAAoB,OAAA;AAEpB,sGAAA,eAAe,OAAA;AACf,4GAAA,qBAAqB,OAAA;AAmCvB,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAGtB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,mCAAyE;AAAhE,+GAAA,qBAAqB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAGtD,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAG5B,mDAAyG;AAAhG,sHAAA,oBAAoB,OAAA;AAAE,4HAAA,0BAA0B,OAAA;AAAE,qHAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6BAQe;AAPb,2GAAA,oBAAoB,OAAA;AACpB,+GAAA,wBAAwB,OAAA;AACxB,iHAAA,0BAA0B,OAAA;AAC1B,2GAAA,oBAAoB,OAAA;AAEpB,sGAAA,eAAe,OAAA;AACf,4GAAA,qBAAqB,OAAA;AAmCvB,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAGtB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,mCAAyE;AAAhE,+GAAA,qBAAqB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAGtD,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAG5B,mDAAyG;AAAhG,sHAAA,oBAAoB,OAAA;AAAE,4HAAA,0BAA0B,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAsB9E,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,6CAA2B;AAE3B,2CAA8G;AAArG,2GAAA,aAAa,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAAE,wHAAA,0BAA0B,OAAA;AAWvF,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAGhC,iCA6CiB;AA5Cf,qGAAA,YAAY,OAAA;AACZ,0GAAA,iBAAiB,OAAA;AACjB,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;AACJ,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,sHAAA,6BAA6B,OAAA;AAC7B,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,mGAAA,UAAU,OAAA;AAcZ,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA","sourcesContent":["export {\n defaultExceptionType,\n defaultLogArgsSerializer,\n defaultErrorArgsSerializer,\n UserActionImportance,\n type UserActionImportanceType,\n UserActionState,\n userActionsMessageBus,\n} from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionEventExtended,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogArgsSerializer,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\n PushEventOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n UserAction,\n UserActionInterface,\n UserActionInternalInterface,\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 { defaultBatchingConfig, 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 MetaDevice,\n MetaGetter,\n MetaItem,\n MetaOS,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n MetaOverrides,\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 * from './semantic';\n\nexport { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';\nexport type {\n BeforeSendHook,\n SendFn,\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 clampSamplingRate,\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 dateNow,\n monoNow,\n isEmpty,\n getCircularDependencyReplacer,\n stringifyExternalJson,\n stringifyObjectValues,\n Observable,\n} from './utils';\nexport type {\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BufferItem,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n Subscription,\n} from './utils';\n\nexport { VERSION } from './version';\n\nexport { unknownString } from './consts';\n"]}
|