@openobserve/browser-core 0.2.11 → 0.2.12-beta.1
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/package.json +6 -5
- package/src/boot/displayAlreadyInitializedError.ts +8 -0
- package/src/boot/init.ts +29 -15
- package/src/browser/addEventListener.ts +44 -35
- package/src/browser/{types.ts → browser.types.ts} +42 -0
- package/src/browser/cookie.ts +69 -15
- package/src/browser/fetchObservable.ts +97 -42
- package/src/browser/{pageExitObservable.ts → pageMayExitObservable.ts} +11 -24
- package/src/browser/runOnReadyState.ts +14 -4
- package/src/browser/xhrObservable.ts +45 -38
- package/src/domain/allowedTrackingOrigins.ts +30 -0
- package/src/domain/bufferedData.ts +32 -0
- package/src/domain/configuration/configuration.ts +366 -95
- package/src/domain/configuration/endpointBuilder.ts +48 -64
- package/src/domain/configuration/index.ts +6 -4
- package/src/domain/configuration/transportConfiguration.ts +42 -35
- package/src/domain/connectivity/connectivity.ts +31 -0
- package/src/domain/connectivity/index.ts +1 -0
- package/src/domain/console/consoleObservable.ts +59 -27
- package/src/domain/context/contextConstants.ts +27 -0
- package/src/domain/context/contextManager.ts +85 -0
- package/src/domain/context/contextUtils.ts +14 -0
- package/src/domain/context/defineContextMethod.ts +31 -0
- package/src/domain/context/storeContextManager.ts +55 -0
- package/src/domain/contexts/accountContext.ts +47 -0
- package/src/domain/contexts/globalContext.ts +30 -0
- package/src/domain/contexts/rumInternalContext.type.ts +15 -0
- package/src/domain/contexts/userContext.ts +64 -0
- package/src/domain/deflate/{types.ts → deflate.types.ts} +18 -2
- package/src/domain/deflate/index.ts +1 -1
- package/src/domain/error/error.ts +28 -84
- package/src/domain/error/error.types.ts +21 -4
- package/src/domain/error/trackRuntimeError.ts +37 -8
- package/src/domain/eventRateLimiter/createEventRateLimiter.ts +5 -2
- package/src/domain/extension/extensionUtils.ts +28 -0
- package/src/domain/intakeSites.ts +18 -0
- package/src/domain/report/browser.types.ts +12 -0
- package/src/domain/report/reportObservable.ts +37 -30
- package/src/domain/resourceUtils.ts +20 -16
- package/src/domain/session/README.md +193 -0
- package/src/domain/session/oldCookiesMigration.ts +7 -7
- package/src/domain/session/sessionConstants.ts +16 -1
- package/src/domain/session/sessionManager.ts +179 -15
- package/src/domain/session/sessionState.ts +49 -17
- package/src/domain/session/sessionStateValidation.ts +9 -0
- package/src/domain/session/sessionStore.ts +118 -55
- package/src/domain/session/sessionStoreOperations.ts +51 -32
- package/src/domain/session/storeStrategies/sessionInCookie.ts +113 -23
- package/src/domain/session/storeStrategies/sessionInLocalStorage.ts +11 -8
- package/src/domain/session/storeStrategies/sessionStoreStrategy.ts +6 -2
- package/src/domain/synthetics/syntheticsWorkerValues.ts +15 -4
- package/src/domain/tags.ts +76 -0
- package/src/domain/telemetry/index.ts +12 -4
- package/src/domain/telemetry/rawTelemetryEvent.types.ts +11 -3
- package/src/domain/telemetry/telemetry.ts +242 -98
- package/src/domain/telemetry/telemetryEvent.types.ts +530 -5
- package/src/domain/trackingConsent.ts +34 -0
- package/src/index.ts +92 -55
- package/src/tools/abstractHooks.ts +72 -0
- package/src/tools/abstractLifeCycle.ts +1 -0
- package/src/tools/boundedBuffer.ts +36 -8
- package/src/tools/display.ts +18 -13
- package/src/tools/encoder.ts +103 -0
- package/src/tools/experimentalFeatures.ts +18 -9
- package/src/tools/getZoneJsOriginalValue.ts +1 -1
- package/src/tools/{getGlobalObject.ts → globalObject.ts} +20 -0
- package/src/tools/instrumentMethod.ts +127 -66
- package/src/tools/matchOption.ts +1 -2
- package/src/tools/mergeInto.ts +16 -16
- package/src/tools/monitor.ts +14 -10
- package/src/tools/observable.ts +79 -15
- package/src/tools/queueMicrotask.ts +13 -0
- package/src/tools/readBytesFromStream.ts +24 -64
- package/src/tools/requestIdleCallback.ts +40 -0
- package/src/tools/sendToExtension.ts +3 -1
- package/src/tools/serialisation/context.ts +4 -1
- package/src/tools/serialisation/sanitize.ts +32 -14
- package/src/tools/stackTrace/computeStackTrace.ts +250 -0
- package/src/tools/stackTrace/handlingStack.ts +48 -0
- package/src/tools/taskQueue.ts +63 -0
- package/src/tools/timer.ts +1 -1
- package/src/tools/utils/arrayUtils.ts +11 -3
- package/src/tools/utils/browserDetection.ts +35 -3
- package/src/tools/utils/byteUtils.ts +13 -2
- package/src/tools/utils/functionUtils.ts +0 -2
- package/src/tools/utils/numberUtils.ts +2 -1
- package/src/tools/utils/objectUtils.ts +1 -3
- package/src/tools/utils/polyfills.ts +6 -110
- package/src/tools/utils/responseUtils.ts +1 -1
- package/src/tools/utils/stringUtils.ts +62 -4
- package/src/tools/utils/timeUtils.ts +18 -13
- package/src/tools/utils/timezone.ts +9 -0
- package/src/tools/utils/urlPolyfill.ts +29 -59
- package/src/tools/valueHistory.ts +66 -35
- package/src/transport/batch.ts +113 -61
- package/src/transport/eventBridge.ts +24 -5
- package/src/transport/flushController.ts +44 -23
- package/src/transport/httpRequest.ts +99 -71
- package/src/transport/index.ts +7 -4
- package/src/transport/sendWithRetryStrategy.ts +60 -41
- package/cjs/boot/init.d.ts +0 -5
- package/cjs/boot/init.js +0 -36
- package/cjs/boot/init.js.map +0 -1
- package/cjs/browser/addEventListener.d.ts +0 -76
- package/cjs/browser/addEventListener.js +0 -52
- package/cjs/browser/addEventListener.js.map +0 -1
- package/cjs/browser/cookie.d.ts +0 -10
- package/cjs/browser/cookie.js +0 -69
- package/cjs/browser/cookie.js.map +0 -1
- package/cjs/browser/fetchObservable.d.ts +0 -23
- package/cjs/browser/fetchObservable.js +0 -74
- package/cjs/browser/fetchObservable.js.map +0 -1
- package/cjs/browser/pageExitObservable.d.ts +0 -14
- package/cjs/browser/pageExitObservable.js +0 -58
- package/cjs/browser/pageExitObservable.js.map +0 -1
- package/cjs/browser/runOnReadyState.d.ts +0 -2
- package/cjs/browser/runOnReadyState.js +0 -15
- package/cjs/browser/runOnReadyState.js.map +0 -1
- package/cjs/browser/types.d.ts +0 -19
- package/cjs/browser/types.js +0 -6
- package/cjs/browser/types.js.map +0 -1
- package/cjs/browser/xhrObservable.d.ts +0 -22
- package/cjs/browser/xhrObservable.js +0 -93
- package/cjs/browser/xhrObservable.js.map +0 -1
- package/cjs/domain/configuration/configuration.d.ts +0 -67
- package/cjs/domain/configuration/configuration.js +0 -95
- package/cjs/domain/configuration/configuration.js.map +0 -1
- package/cjs/domain/configuration/endpointBuilder.d.ts +0 -14
- package/cjs/domain/configuration/endpointBuilder.js +0 -94
- package/cjs/domain/configuration/endpointBuilder.js.map +0 -1
- package/cjs/domain/configuration/index.d.ts +0 -3
- package/cjs/domain/configuration/index.js +0 -25
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/intakeSites.d.ts +0 -5
- package/cjs/domain/configuration/intakeSites.js +0 -9
- package/cjs/domain/configuration/intakeSites.js.map +0 -1
- package/cjs/domain/configuration/tags.d.ts +0 -4
- package/cjs/domain/configuration/tags.js +0 -39
- package/cjs/domain/configuration/tags.js.map +0 -1
- package/cjs/domain/configuration/transportConfiguration.d.ts +0 -16
- package/cjs/domain/configuration/transportConfiguration.js +0 -42
- package/cjs/domain/configuration/transportConfiguration.js.map +0 -1
- package/cjs/domain/console/consoleObservable.d.ts +0 -11
- package/cjs/domain/console/consoleObservable.js +0 -75
- package/cjs/domain/console/consoleObservable.js.map +0 -1
- package/cjs/domain/deflate/index.d.ts +0 -1
- package/cjs/domain/deflate/index.js +0 -18
- package/cjs/domain/deflate/index.js.map +0 -1
- package/cjs/domain/deflate/types.d.ts +0 -26
- package/cjs/domain/deflate/types.js +0 -3
- package/cjs/domain/deflate/types.js.map +0 -1
- package/cjs/domain/error/error.d.ts +0 -28
- package/cjs/domain/error/error.js +0 -131
- package/cjs/domain/error/error.js.map +0 -1
- package/cjs/domain/error/error.types.d.ts +0 -40
- package/cjs/domain/error/error.types.js +0 -13
- package/cjs/domain/error/error.types.js.map +0 -1
- package/cjs/domain/error/trackRuntimeError.d.ts +0 -5
- package/cjs/domain/error/trackRuntimeError.js +0 -21
- package/cjs/domain/error/trackRuntimeError.js.map +0 -1
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js +0 -40
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
- package/cjs/domain/report/browser.types.d.ts +0 -24
- package/cjs/domain/report/browser.types.js +0 -3
- package/cjs/domain/report/browser.types.js.map +0 -1
- package/cjs/domain/report/reportObservable.d.ts +0 -15
- package/cjs/domain/report/reportObservable.js +0 -94
- package/cjs/domain/report/reportObservable.js.map +0 -1
- package/cjs/domain/resourceUtils.d.ts +0 -16
- package/cjs/domain/resourceUtils.js +0 -3
- package/cjs/domain/resourceUtils.js.map +0 -1
- package/cjs/domain/session/oldCookiesMigration.d.ts +0 -11
- package/cjs/domain/session/oldCookiesMigration.js +0 -40
- package/cjs/domain/session/oldCookiesMigration.js.map +0 -1
- package/cjs/domain/session/sessionConstants.d.ts +0 -2
- package/cjs/domain/session/sessionConstants.js +0 -7
- package/cjs/domain/session/sessionConstants.js.map +0 -1
- package/cjs/domain/session/sessionManager.d.ts +0 -20
- package/cjs/domain/session/sessionManager.js +0 -65
- package/cjs/domain/session/sessionManager.js.map +0 -1
- package/cjs/domain/session/sessionState.d.ts +0 -11
- package/cjs/domain/session/sessionState.js +0 -45
- package/cjs/domain/session/sessionState.js.map +0 -1
- package/cjs/domain/session/sessionStore.d.ts +0 -34
- package/cjs/domain/session/sessionStore.js +0 -144
- package/cjs/domain/session/sessionStore.js.map +0 -1
- package/cjs/domain/session/sessionStoreOperations.d.ts +0 -15
- package/cjs/domain/session/sessionStoreOperations.js +0 -104
- package/cjs/domain/session/sessionStoreOperations.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
- package/cjs/domain/session/storeStrategies/sessionInCookie.js +0 -48
- package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +0 -40
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -14
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js +0 -5
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
- package/cjs/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
- package/cjs/domain/synthetics/syntheticsWorkerValues.js +0 -22
- package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
- package/cjs/domain/telemetry/index.d.ts +0 -3
- package/cjs/domain/telemetry/index.js +0 -28
- package/cjs/domain/telemetry/index.js.map +0 -1
- package/cjs/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -11
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js +0 -8
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
- package/cjs/domain/telemetry/telemetry.d.ts +0 -112
- package/cjs/domain/telemetry/telemetry.js +0 -146
- package/cjs/domain/telemetry/telemetry.js.map +0 -1
- package/cjs/domain/telemetry/telemetryEvent.types.d.ts +0 -375
- package/cjs/domain/telemetry/telemetryEvent.types.js +0 -7
- package/cjs/domain/telemetry/telemetryEvent.types.js.map +0 -1
- package/cjs/domain/tracekit/computeStackTrace.d.ts +0 -5
- package/cjs/domain/tracekit/computeStackTrace.js +0 -118
- package/cjs/domain/tracekit/computeStackTrace.js.map +0 -1
- package/cjs/domain/tracekit/index.d.ts +0 -3
- package/cjs/domain/tracekit/index.js +0 -8
- package/cjs/domain/tracekit/index.js.map +0 -1
- package/cjs/domain/tracekit/tracekit.d.ts +0 -35
- package/cjs/domain/tracekit/tracekit.js +0 -95
- package/cjs/domain/tracekit/tracekit.js.map +0 -1
- package/cjs/domain/tracekit/types.d.ts +0 -44
- package/cjs/domain/tracekit/types.js +0 -3
- package/cjs/domain/tracekit/types.js.map +0 -1
- package/cjs/domain/user/index.d.ts +0 -2
- package/cjs/domain/user/index.js +0 -19
- package/cjs/domain/user/index.js.map +0 -1
- package/cjs/domain/user/user.d.ts +0 -12
- package/cjs/domain/user/user.js +0 -35
- package/cjs/domain/user/user.js.map +0 -1
- package/cjs/domain/user/user.types.d.ts +0 -6
- package/cjs/domain/user/user.types.js +0 -3
- package/cjs/domain/user/user.types.js.map +0 -1
- package/cjs/index.d.ts +0 -63
- package/cjs/index.js +0 -155
- package/cjs/index.js.map +0 -1
- package/cjs/tools/abstractLifeCycle.d.ts +0 -23
- package/cjs/tools/abstractLifeCycle.js +0 -29
- package/cjs/tools/abstractLifeCycle.js.map +0 -1
- package/cjs/tools/boundedBuffer.d.ts +0 -5
- package/cjs/tools/boundedBuffer.js +0 -22
- package/cjs/tools/boundedBuffer.js.map +0 -1
- package/cjs/tools/catchUserErrors.d.ts +0 -1
- package/cjs/tools/catchUserErrors.js +0 -20
- package/cjs/tools/catchUserErrors.js.map +0 -1
- package/cjs/tools/display.d.ts +0 -35
- package/cjs/tools/display.js +0 -45
- package/cjs/tools/display.js.map +0 -1
- package/cjs/tools/experimentalFeatures.d.ts +0 -24
- package/cjs/tools/experimentalFeatures.js +0 -47
- package/cjs/tools/experimentalFeatures.js.map +0 -1
- package/cjs/tools/getGlobalObject.d.ts +0 -4
- package/cjs/tools/getGlobalObject.js +0 -37
- package/cjs/tools/getGlobalObject.js.map +0 -1
- package/cjs/tools/getZoneJsOriginalValue.d.ts +0 -19
- package/cjs/tools/getZoneJsOriginalValue.js +0 -30
- package/cjs/tools/getZoneJsOriginalValue.js.map +0 -1
- package/cjs/tools/instrumentMethod.d.ts +0 -19
- package/cjs/tools/instrumentMethod.js +0 -83
- package/cjs/tools/instrumentMethod.js.map +0 -1
- package/cjs/tools/matchOption.d.ts +0 -8
- package/cjs/tools/matchOption.js +0 -38
- package/cjs/tools/matchOption.js.map +0 -1
- package/cjs/tools/mergeInto.d.ts +0 -25
- package/cjs/tools/mergeInto.js +0 -105
- package/cjs/tools/mergeInto.js.map +0 -1
- package/cjs/tools/monitor.d.ts +0 -9
- package/cjs/tools/monitor.js +0 -76
- package/cjs/tools/monitor.js.map +0 -1
- package/cjs/tools/observable.d.ts +0 -12
- package/cjs/tools/observable.js +0 -44
- package/cjs/tools/observable.js.map +0 -1
- package/cjs/tools/readBytesFromStream.d.ts +0 -11
- package/cjs/tools/readBytesFromStream.js +0 -64
- package/cjs/tools/readBytesFromStream.js.map +0 -1
- package/cjs/tools/sendToExtension.d.ts +0 -3
- package/cjs/tools/sendToExtension.js +0 -11
- package/cjs/tools/sendToExtension.js.map +0 -1
- package/cjs/tools/serialisation/context.d.ts +0 -6
- package/cjs/tools/serialisation/context.js +0 -3
- package/cjs/tools/serialisation/context.js.map +0 -1
- package/cjs/tools/serialisation/contextManager.d.ts +0 -21
- package/cjs/tools/serialisation/contextManager.js +0 -70
- package/cjs/tools/serialisation/contextManager.js.map +0 -1
- package/cjs/tools/serialisation/heavyCustomerDataWarning.d.ts +0 -8
- package/cjs/tools/serialisation/heavyCustomerDataWarning.js +0 -18
- package/cjs/tools/serialisation/heavyCustomerDataWarning.js.map +0 -1
- package/cjs/tools/serialisation/jsonStringify.d.ts +0 -14
- package/cjs/tools/serialisation/jsonStringify.js +0 -49
- package/cjs/tools/serialisation/jsonStringify.js.map +0 -1
- package/cjs/tools/serialisation/sanitize.d.ts +0 -18
- package/cjs/tools/serialisation/sanitize.js +0 -185
- package/cjs/tools/serialisation/sanitize.js.map +0 -1
- package/cjs/tools/timer.d.ts +0 -5
- package/cjs/tools/timer.js +0 -23
- package/cjs/tools/timer.js.map +0 -1
- package/cjs/tools/utils/arrayUtils.d.ts +0 -1
- package/cjs/tools/utils/arrayUtils.js +0 -11
- package/cjs/tools/utils/arrayUtils.js.map +0 -1
- package/cjs/tools/utils/browserDetection.d.ts +0 -2
- package/cjs/tools/utils/browserDetection.js +0 -12
- package/cjs/tools/utils/browserDetection.js.map +0 -1
- package/cjs/tools/utils/byteUtils.d.ts +0 -4
- package/cjs/tools/utils/byteUtils.js +0 -31
- package/cjs/tools/utils/byteUtils.js.map +0 -1
- package/cjs/tools/utils/functionUtils.d.ts +0 -9
- package/cjs/tools/utils/functionUtils.js +0 -48
- package/cjs/tools/utils/functionUtils.js.map +0 -1
- package/cjs/tools/utils/numberUtils.d.ts +0 -8
- package/cjs/tools/utils/numberUtils.js +0 -24
- package/cjs/tools/utils/numberUtils.js.map +0 -1
- package/cjs/tools/utils/objectUtils.d.ts +0 -10
- package/cjs/tools/utils/objectUtils.js +0 -26
- package/cjs/tools/utils/objectUtils.js.map +0 -1
- package/cjs/tools/utils/polyfills.d.ts +0 -24
- package/cjs/tools/utils/polyfills.js +0 -110
- package/cjs/tools/utils/polyfills.js.map +0 -1
- package/cjs/tools/utils/responseUtils.d.ts +0 -2
- package/cjs/tools/utils/responseUtils.js +0 -18
- package/cjs/tools/utils/responseUtils.js.map +0 -1
- package/cjs/tools/utils/stringUtils.d.ts +0 -7
- package/cjs/tools/utils/stringUtils.js +0 -32
- package/cjs/tools/utils/stringUtils.js.map +0 -1
- package/cjs/tools/utils/timeUtils.d.ts +0 -57
- package/cjs/tools/utils/timeUtils.js +0 -99
- package/cjs/tools/utils/timeUtils.js.map +0 -1
- package/cjs/tools/utils/typeUtils.d.ts +0 -4
- package/cjs/tools/utils/typeUtils.js +0 -17
- package/cjs/tools/utils/typeUtils.js.map +0 -1
- package/cjs/tools/utils/urlPolyfill.d.ts +0 -14
- package/cjs/tools/utils/urlPolyfill.js +0 -92
- package/cjs/tools/utils/urlPolyfill.js.map +0 -1
- package/cjs/tools/valueHistory.d.ts +0 -50
- package/cjs/tools/valueHistory.js +0 -106
- package/cjs/tools/valueHistory.js.map +0 -1
- package/cjs/transport/batch.d.ts +0 -19
- package/cjs/transport/batch.js +0 -79
- package/cjs/transport/batch.js.map +0 -1
- package/cjs/transport/eventBridge.d.ts +0 -12
- package/cjs/transport/eventBridge.js +0 -34
- package/cjs/transport/eventBridge.js.map +0 -1
- package/cjs/transport/flushController.d.ts +0 -48
- package/cjs/transport/flushController.js +0 -97
- package/cjs/transport/flushController.js.map +0 -1
- package/cjs/transport/httpRequest.d.ts +0 -37
- package/cjs/transport/httpRequest.js +0 -91
- package/cjs/transport/httpRequest.js.map +0 -1
- package/cjs/transport/index.d.ts +0 -4
- package/cjs/transport/index.js +0 -13
- package/cjs/transport/index.js.map +0 -1
- package/cjs/transport/sendWithRetryStrategy.d.ts +0 -39
- package/cjs/transport/sendWithRetryStrategy.js +0 -151
- package/cjs/transport/sendWithRetryStrategy.js.map +0 -1
- package/cjs/transport/startBatchWithReplica.d.ts +0 -15
- package/cjs/transport/startBatchWithReplica.js +0 -37
- package/cjs/transport/startBatchWithReplica.js.map +0 -1
- package/esm/boot/init.d.ts +0 -5
- package/esm/boot/init.js +0 -31
- package/esm/boot/init.js.map +0 -1
- package/esm/browser/addEventListener.d.ts +0 -76
- package/esm/browser/addEventListener.js +0 -47
- package/esm/browser/addEventListener.js.map +0 -1
- package/esm/browser/cookie.d.ts +0 -10
- package/esm/browser/cookie.js +0 -61
- package/esm/browser/cookie.js.map +0 -1
- package/esm/browser/fetchObservable.d.ts +0 -23
- package/esm/browser/fetchObservable.js +0 -70
- package/esm/browser/fetchObservable.js.map +0 -1
- package/esm/browser/pageExitObservable.d.ts +0 -14
- package/esm/browser/pageExitObservable.js +0 -53
- package/esm/browser/pageExitObservable.js.map +0 -1
- package/esm/browser/runOnReadyState.d.ts +0 -2
- package/esm/browser/runOnReadyState.js +0 -11
- package/esm/browser/runOnReadyState.js.map +0 -1
- package/esm/browser/types.d.ts +0 -19
- package/esm/browser/types.js +0 -5
- package/esm/browser/types.js.map +0 -1
- package/esm/browser/xhrObservable.d.ts +0 -22
- package/esm/browser/xhrObservable.js +0 -89
- package/esm/browser/xhrObservable.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -67
- package/esm/domain/configuration/configuration.js +0 -90
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/endpointBuilder.d.ts +0 -14
- package/esm/domain/configuration/endpointBuilder.js +0 -90
- package/esm/domain/configuration/endpointBuilder.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -3
- package/esm/domain/configuration/index.js +0 -4
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/intakeSites.d.ts +0 -5
- package/esm/domain/configuration/intakeSites.js +0 -6
- package/esm/domain/configuration/intakeSites.js.map +0 -1
- package/esm/domain/configuration/tags.d.ts +0 -4
- package/esm/domain/configuration/tags.js +0 -34
- package/esm/domain/configuration/tags.js.map +0 -1
- package/esm/domain/configuration/transportConfiguration.d.ts +0 -16
- package/esm/domain/configuration/transportConfiguration.js +0 -38
- package/esm/domain/configuration/transportConfiguration.js.map +0 -1
- package/esm/domain/console/consoleObservable.d.ts +0 -11
- package/esm/domain/console/consoleObservable.js +0 -70
- package/esm/domain/console/consoleObservable.js.map +0 -1
- package/esm/domain/deflate/index.d.ts +0 -1
- package/esm/domain/deflate/index.js +0 -2
- package/esm/domain/deflate/index.js.map +0 -1
- package/esm/domain/deflate/types.d.ts +0 -26
- package/esm/domain/deflate/types.js +0 -2
- package/esm/domain/deflate/types.js.map +0 -1
- package/esm/domain/error/error.d.ts +0 -28
- package/esm/domain/error/error.js +0 -121
- package/esm/domain/error/error.js.map +0 -1
- package/esm/domain/error/error.types.d.ts +0 -40
- package/esm/domain/error/error.types.js +0 -10
- package/esm/domain/error/error.types.js.map +0 -1
- package/esm/domain/error/trackRuntimeError.d.ts +0 -5
- package/esm/domain/error/trackRuntimeError.js +0 -17
- package/esm/domain/error/trackRuntimeError.js.map +0 -1
- package/esm/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js +0 -36
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
- package/esm/domain/report/browser.types.d.ts +0 -24
- package/esm/domain/report/browser.types.js +0 -2
- package/esm/domain/report/browser.types.js.map +0 -1
- package/esm/domain/report/reportObservable.d.ts +0 -15
- package/esm/domain/report/reportObservable.js +0 -90
- package/esm/domain/report/reportObservable.js.map +0 -1
- package/esm/domain/resourceUtils.d.ts +0 -16
- package/esm/domain/resourceUtils.js +0 -2
- package/esm/domain/resourceUtils.js.map +0 -1
- package/esm/domain/session/oldCookiesMigration.d.ts +0 -11
- package/esm/domain/session/oldCookiesMigration.js +0 -36
- package/esm/domain/session/oldCookiesMigration.js.map +0 -1
- package/esm/domain/session/sessionConstants.d.ts +0 -2
- package/esm/domain/session/sessionConstants.js +0 -4
- package/esm/domain/session/sessionConstants.js.map +0 -1
- package/esm/domain/session/sessionManager.d.ts +0 -20
- package/esm/domain/session/sessionManager.js +0 -60
- package/esm/domain/session/sessionManager.js.map +0 -1
- package/esm/domain/session/sessionState.d.ts +0 -11
- package/esm/domain/session/sessionState.js +0 -38
- package/esm/domain/session/sessionState.js.map +0 -1
- package/esm/domain/session/sessionStore.d.ts +0 -34
- package/esm/domain/session/sessionStore.js +0 -139
- package/esm/domain/session/sessionStore.js.map +0 -1
- package/esm/domain/session/sessionStoreOperations.d.ts +0 -15
- package/esm/domain/session/sessionStoreOperations.js +0 -99
- package/esm/domain/session/sessionStoreOperations.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
- package/esm/domain/session/storeStrategies/sessionInCookie.js +0 -42
- package/esm/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +0 -35
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -14
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js +0 -2
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
- package/esm/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
- package/esm/domain/synthetics/syntheticsWorkerValues.js +0 -16
- package/esm/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
- package/esm/domain/telemetry/index.d.ts +0 -3
- package/esm/domain/telemetry/index.js +0 -4
- package/esm/domain/telemetry/index.js.map +0 -1
- package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -11
- package/esm/domain/telemetry/rawTelemetryEvent.types.js +0 -5
- package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
- package/esm/domain/telemetry/telemetry.d.ts +0 -112
- package/esm/domain/telemetry/telemetry.js +0 -134
- package/esm/domain/telemetry/telemetry.js.map +0 -1
- package/esm/domain/telemetry/telemetryEvent.types.d.ts +0 -375
- package/esm/domain/telemetry/telemetryEvent.types.js +0 -6
- package/esm/domain/telemetry/telemetryEvent.types.js.map +0 -1
- package/esm/domain/tracekit/computeStackTrace.d.ts +0 -5
- package/esm/domain/tracekit/computeStackTrace.js +0 -114
- package/esm/domain/tracekit/computeStackTrace.js.map +0 -1
- package/esm/domain/tracekit/index.d.ts +0 -3
- package/esm/domain/tracekit/index.js +0 -3
- package/esm/domain/tracekit/index.js.map +0 -1
- package/esm/domain/tracekit/tracekit.d.ts +0 -35
- package/esm/domain/tracekit/tracekit.js +0 -91
- package/esm/domain/tracekit/tracekit.js.map +0 -1
- package/esm/domain/tracekit/types.d.ts +0 -44
- package/esm/domain/tracekit/types.js +0 -2
- package/esm/domain/tracekit/types.js.map +0 -1
- package/esm/domain/user/index.d.ts +0 -2
- package/esm/domain/user/index.js +0 -3
- package/esm/domain/user/index.js.map +0 -1
- package/esm/domain/user/user.d.ts +0 -12
- package/esm/domain/user/user.js +0 -30
- package/esm/domain/user/user.js.map +0 -1
- package/esm/domain/user/user.types.d.ts +0 -6
- package/esm/domain/user/user.types.js +0 -2
- package/esm/domain/user/user.types.js.map +0 -1
- package/esm/index.d.ts +0 -63
- package/esm/index.js +0 -61
- package/esm/index.js.map +0 -1
- package/esm/tools/abstractLifeCycle.d.ts +0 -23
- package/esm/tools/abstractLifeCycle.js +0 -26
- package/esm/tools/abstractLifeCycle.js.map +0 -1
- package/esm/tools/boundedBuffer.d.ts +0 -5
- package/esm/tools/boundedBuffer.js +0 -19
- package/esm/tools/boundedBuffer.js.map +0 -1
- package/esm/tools/catchUserErrors.d.ts +0 -1
- package/esm/tools/catchUserErrors.js +0 -16
- package/esm/tools/catchUserErrors.js.map +0 -1
- package/esm/tools/display.d.ts +0 -35
- package/esm/tools/display.js +0 -41
- package/esm/tools/display.js.map +0 -1
- package/esm/tools/experimentalFeatures.d.ts +0 -24
- package/esm/tools/experimentalFeatures.js +0 -40
- package/esm/tools/experimentalFeatures.js.map +0 -1
- package/esm/tools/getGlobalObject.d.ts +0 -4
- package/esm/tools/getGlobalObject.js +0 -33
- package/esm/tools/getGlobalObject.js.map +0 -1
- package/esm/tools/getZoneJsOriginalValue.d.ts +0 -19
- package/esm/tools/getZoneJsOriginalValue.js +0 -26
- package/esm/tools/getZoneJsOriginalValue.js.map +0 -1
- package/esm/tools/instrumentMethod.d.ts +0 -19
- package/esm/tools/instrumentMethod.js +0 -77
- package/esm/tools/instrumentMethod.js.map +0 -1
- package/esm/tools/matchOption.d.ts +0 -8
- package/esm/tools/matchOption.js +0 -33
- package/esm/tools/matchOption.js.map +0 -1
- package/esm/tools/mergeInto.d.ts +0 -25
- package/esm/tools/mergeInto.js +0 -99
- package/esm/tools/mergeInto.js.map +0 -1
- package/esm/tools/monitor.d.ts +0 -9
- package/esm/tools/monitor.js +0 -66
- package/esm/tools/monitor.js.map +0 -1
- package/esm/tools/observable.d.ts +0 -12
- package/esm/tools/observable.js +0 -40
- package/esm/tools/observable.js.map +0 -1
- package/esm/tools/readBytesFromStream.d.ts +0 -11
- package/esm/tools/readBytesFromStream.js +0 -60
- package/esm/tools/readBytesFromStream.js.map +0 -1
- package/esm/tools/sendToExtension.d.ts +0 -3
- package/esm/tools/sendToExtension.js +0 -7
- package/esm/tools/sendToExtension.js.map +0 -1
- package/esm/tools/serialisation/context.d.ts +0 -6
- package/esm/tools/serialisation/context.js +0 -2
- package/esm/tools/serialisation/context.js.map +0 -1
- package/esm/tools/serialisation/contextManager.d.ts +0 -21
- package/esm/tools/serialisation/contextManager.js +0 -66
- package/esm/tools/serialisation/contextManager.js.map +0 -1
- package/esm/tools/serialisation/heavyCustomerDataWarning.d.ts +0 -8
- package/esm/tools/serialisation/heavyCustomerDataWarning.js +0 -14
- package/esm/tools/serialisation/heavyCustomerDataWarning.js.map +0 -1
- package/esm/tools/serialisation/jsonStringify.d.ts +0 -14
- package/esm/tools/serialisation/jsonStringify.js +0 -44
- package/esm/tools/serialisation/jsonStringify.js.map +0 -1
- package/esm/tools/serialisation/sanitize.d.ts +0 -18
- package/esm/tools/serialisation/sanitize.js +0 -181
- package/esm/tools/serialisation/sanitize.js.map +0 -1
- package/esm/tools/timer.d.ts +0 -5
- package/esm/tools/timer.js +0 -16
- package/esm/tools/timer.js.map +0 -1
- package/esm/tools/utils/arrayUtils.d.ts +0 -1
- package/esm/tools/utils/arrayUtils.js +0 -7
- package/esm/tools/utils/arrayUtils.js.map +0 -1
- package/esm/tools/utils/browserDetection.d.ts +0 -2
- package/esm/tools/utils/browserDetection.js +0 -7
- package/esm/tools/utils/browserDetection.js.map +0 -1
- package/esm/tools/utils/byteUtils.d.ts +0 -4
- package/esm/tools/utils/byteUtils.js +0 -26
- package/esm/tools/utils/byteUtils.js.map +0 -1
- package/esm/tools/utils/functionUtils.d.ts +0 -9
- package/esm/tools/utils/functionUtils.js +0 -43
- package/esm/tools/utils/functionUtils.js.map +0 -1
- package/esm/tools/utils/numberUtils.d.ts +0 -8
- package/esm/tools/utils/numberUtils.js +0 -17
- package/esm/tools/utils/numberUtils.js.map +0 -1
- package/esm/tools/utils/objectUtils.d.ts +0 -10
- package/esm/tools/utils/objectUtils.js +0 -19
- package/esm/tools/utils/objectUtils.js.map +0 -1
- package/esm/tools/utils/polyfills.d.ts +0 -24
- package/esm/tools/utils/polyfills.js +0 -95
- package/esm/tools/utils/polyfills.js.map +0 -1
- package/esm/tools/utils/responseUtils.d.ts +0 -2
- package/esm/tools/utils/responseUtils.js +0 -13
- package/esm/tools/utils/responseUtils.js.map +0 -1
- package/esm/tools/utils/stringUtils.d.ts +0 -7
- package/esm/tools/utils/stringUtils.js +0 -26
- package/esm/tools/utils/stringUtils.js.map +0 -1
- package/esm/tools/utils/timeUtils.d.ts +0 -57
- package/esm/tools/utils/timeUtils.js +0 -82
- package/esm/tools/utils/timeUtils.js.map +0 -1
- package/esm/tools/utils/typeUtils.d.ts +0 -4
- package/esm/tools/utils/typeUtils.js +0 -13
- package/esm/tools/utils/typeUtils.js.map +0 -1
- package/esm/tools/utils/urlPolyfill.d.ts +0 -14
- package/esm/tools/utils/urlPolyfill.js +0 -80
- package/esm/tools/utils/urlPolyfill.js.map +0 -1
- package/esm/tools/valueHistory.d.ts +0 -50
- package/esm/tools/valueHistory.js +0 -103
- package/esm/tools/valueHistory.js.map +0 -1
- package/esm/transport/batch.d.ts +0 -19
- package/esm/transport/batch.js +0 -76
- package/esm/transport/batch.js.map +0 -1
- package/esm/transport/eventBridge.d.ts +0 -12
- package/esm/transport/eventBridge.js +0 -29
- package/esm/transport/eventBridge.js.map +0 -1
- package/esm/transport/flushController.d.ts +0 -48
- package/esm/transport/flushController.js +0 -93
- package/esm/transport/flushController.js.map +0 -1
- package/esm/transport/httpRequest.d.ts +0 -37
- package/esm/transport/httpRequest.js +0 -85
- package/esm/transport/httpRequest.js.map +0 -1
- package/esm/transport/index.d.ts +0 -4
- package/esm/transport/index.js +0 -5
- package/esm/transport/index.js.map +0 -1
- package/esm/transport/sendWithRetryStrategy.d.ts +0 -39
- package/esm/transport/sendWithRetryStrategy.js +0 -146
- package/esm/transport/sendWithRetryStrategy.js.map +0 -1
- package/esm/transport/startBatchWithReplica.d.ts +0 -15
- package/esm/transport/startBatchWithReplica.js +0 -33
- package/esm/transport/startBatchWithReplica.js.map +0 -1
- package/src/domain/configuration/intakeSites.ts +0 -5
- package/src/domain/configuration/tags.ts +0 -43
- package/src/domain/tracekit/computeStackTrace.ts +0 -141
- package/src/domain/tracekit/index.ts +0 -3
- package/src/domain/tracekit/tracekit.ts +0 -96
- package/src/domain/tracekit/types.ts +0 -47
- package/src/domain/user/index.ts +0 -2
- package/src/domain/user/user.ts +0 -33
- package/src/domain/user/user.types.ts +0 -6
- package/src/tools/serialisation/contextManager.ts +0 -79
- package/src/tools/serialisation/heavyCustomerDataWarning.ts +0 -26
- package/src/transport/startBatchWithReplica.ts +0 -52
package/src/index.ts
CHANGED
|
@@ -1,115 +1,151 @@
|
|
|
1
|
+
export type { Configuration, InitConfiguration, EndpointBuilder, ProxyFn } from './domain/configuration'
|
|
1
2
|
export {
|
|
2
|
-
Configuration,
|
|
3
|
-
InitConfiguration,
|
|
4
3
|
validateAndBuildConfiguration,
|
|
5
4
|
DefaultPrivacyLevel,
|
|
6
|
-
|
|
5
|
+
TraceContextInjection,
|
|
7
6
|
serializeConfiguration,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
INTAKE_SITE_US1_FED,
|
|
12
|
-
INTAKE_SITE_EU1,
|
|
7
|
+
isSampleRate,
|
|
8
|
+
buildEndpointHost,
|
|
9
|
+
isIntakeUrl,
|
|
13
10
|
} from './domain/configuration'
|
|
11
|
+
export * from './domain/intakeSites'
|
|
12
|
+
export type { TrackingConsentState } from './domain/trackingConsent'
|
|
13
|
+
export { TrackingConsent, createTrackingConsentState } from './domain/trackingConsent'
|
|
14
14
|
export {
|
|
15
15
|
isExperimentalFeatureEnabled,
|
|
16
16
|
addExperimentalFeatures,
|
|
17
17
|
resetExperimentalFeatures,
|
|
18
18
|
getExperimentalFeatures,
|
|
19
|
+
initFeatureFlags,
|
|
19
20
|
ExperimentalFeature,
|
|
20
21
|
} from './tools/experimentalFeatures'
|
|
21
22
|
export { trackRuntimeError } from './domain/error/trackRuntimeError'
|
|
22
|
-
export {
|
|
23
|
+
export type { StackTrace } from './tools/stackTrace/computeStackTrace'
|
|
24
|
+
export { computeStackTrace } from './tools/stackTrace/computeStackTrace'
|
|
25
|
+
export type { PublicApi } from './boot/init'
|
|
23
26
|
export { defineGlobal, makePublicApi } from './boot/init'
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
|
|
27
|
+
export { displayAlreadyInitializedError } from './boot/displayAlreadyInitializedError'
|
|
28
|
+
export { initReportObservable, RawReportType } from './domain/report/reportObservable'
|
|
29
|
+
export type {
|
|
27
30
|
Telemetry,
|
|
28
31
|
RawTelemetryEvent,
|
|
29
32
|
RawTelemetryConfiguration,
|
|
30
|
-
addTelemetryDebug,
|
|
31
|
-
addTelemetryError,
|
|
32
|
-
startFakeTelemetry,
|
|
33
|
-
resetTelemetry,
|
|
34
33
|
TelemetryEvent,
|
|
35
34
|
TelemetryErrorEvent,
|
|
36
35
|
TelemetryDebugEvent,
|
|
37
36
|
TelemetryConfigurationEvent,
|
|
37
|
+
TelemetryUsageEvent,
|
|
38
|
+
RawTelemetryUsage,
|
|
39
|
+
RawTelemetryUsageFeature,
|
|
40
|
+
} from './domain/telemetry'
|
|
41
|
+
export {
|
|
42
|
+
startTelemetry,
|
|
43
|
+
addTelemetryDebug,
|
|
44
|
+
addTelemetryError,
|
|
45
|
+
resetTelemetry,
|
|
38
46
|
TelemetryService,
|
|
39
|
-
|
|
47
|
+
TelemetryMetrics,
|
|
40
48
|
addTelemetryConfiguration,
|
|
49
|
+
addTelemetryUsage,
|
|
50
|
+
addTelemetryMetrics,
|
|
41
51
|
} from './domain/telemetry'
|
|
42
|
-
export { monitored, monitor, callMonitored, setDebugMode } from './tools/monitor'
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Exposed for tests
|
|
48
|
-
stopSessionManager,
|
|
49
|
-
} from './domain/session/sessionManager'
|
|
52
|
+
export { monitored, monitor, callMonitored, setDebugMode, monitorError } from './tools/monitor'
|
|
53
|
+
export type { Subscription } from './tools/observable'
|
|
54
|
+
export { Observable, BufferedObservable } from './tools/observable'
|
|
55
|
+
export type { SessionManager } from './domain/session/sessionManager'
|
|
56
|
+
export { startSessionManager, stopSessionManager } from './domain/session/sessionManager'
|
|
50
57
|
export {
|
|
51
58
|
SESSION_TIME_OUT_DELAY, // Exposed for tests
|
|
59
|
+
SESSION_NOT_TRACKED,
|
|
60
|
+
SessionPersistence,
|
|
52
61
|
} from './domain/session/sessionConstants'
|
|
62
|
+
export type { BandwidthStats, HttpRequest, HttpRequestEvent, Payload, FlushEvent, FlushReason } from './transport'
|
|
53
63
|
export {
|
|
54
|
-
HttpRequest,
|
|
55
|
-
Payload,
|
|
56
64
|
createHttpRequest,
|
|
57
65
|
canUseEventBridge,
|
|
58
66
|
getEventBridge,
|
|
59
|
-
|
|
67
|
+
bridgeSupports,
|
|
68
|
+
BridgeCapability,
|
|
69
|
+
createBatch,
|
|
60
70
|
createFlushController,
|
|
61
|
-
|
|
62
|
-
FlushReason,
|
|
71
|
+
FLUSH_DURATION_LIMIT,
|
|
63
72
|
} from './transport'
|
|
64
73
|
export * from './tools/display'
|
|
74
|
+
export type { Encoder, EncoderResult } from './tools/encoder'
|
|
75
|
+
export { createIdentityEncoder } from './tools/encoder'
|
|
65
76
|
export * from './tools/utils/urlPolyfill'
|
|
66
77
|
export * from './tools/utils/timeUtils'
|
|
67
78
|
export * from './tools/utils/arrayUtils'
|
|
68
79
|
export * from './tools/serialisation/sanitize'
|
|
69
|
-
export * from './tools/
|
|
80
|
+
export * from './tools/globalObject'
|
|
70
81
|
export { AbstractLifeCycle } from './tools/abstractLifeCycle'
|
|
71
82
|
export * from './domain/eventRateLimiter/createEventRateLimiter'
|
|
72
83
|
export * from './tools/utils/browserDetection'
|
|
73
84
|
export { sendToExtension } from './tools/sendToExtension'
|
|
74
|
-
export { runOnReadyState } from './browser/runOnReadyState'
|
|
85
|
+
export { runOnReadyState, asyncRunOnReadyState } from './browser/runOnReadyState'
|
|
75
86
|
export { getZoneJsOriginalValue } from './tools/getZoneJsOriginalValue'
|
|
76
|
-
export {
|
|
87
|
+
export type { InstrumentedMethodCall } from './tools/instrumentMethod'
|
|
88
|
+
export { instrumentMethod, instrumentSetter } from './tools/instrumentMethod'
|
|
77
89
|
export {
|
|
78
90
|
computeRawError,
|
|
79
|
-
createHandlingStack,
|
|
80
|
-
toStackTraceString,
|
|
81
91
|
getFileFromStackTraceString,
|
|
92
|
+
isError,
|
|
82
93
|
NO_ERROR_STACK_PRESENT_MESSAGE,
|
|
83
94
|
} from './domain/error/error'
|
|
84
95
|
export { NonErrorPrefix } from './domain/error/error.types'
|
|
85
|
-
export { Context, ContextArray, ContextValue } from './tools/serialisation/context'
|
|
86
|
-
export {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
export type { Context, ContextArray, ContextValue } from './tools/serialisation/context'
|
|
97
|
+
export {
|
|
98
|
+
areCookiesAuthorized,
|
|
99
|
+
getCookie,
|
|
100
|
+
getInitCookie,
|
|
101
|
+
setCookie,
|
|
102
|
+
deleteCookie,
|
|
103
|
+
resetInitCookies,
|
|
104
|
+
} from './browser/cookie'
|
|
105
|
+
export type { CookieStore, WeakRef, WeakRefConstructor } from './browser/browser.types'
|
|
106
|
+
export type { XhrCompleteContext, XhrStartContext } from './browser/xhrObservable'
|
|
107
|
+
export { initXhrObservable } from './browser/xhrObservable'
|
|
108
|
+
export type { FetchResolveContext, FetchStartContext, FetchContext } from './browser/fetchObservable'
|
|
109
|
+
export { initFetchObservable, resetFetchObservable, ResponseBodyAction } from './browser/fetchObservable'
|
|
110
|
+
export type { PageMayExitEvent } from './browser/pageMayExitObservable'
|
|
111
|
+
export { createPageMayExitObservable, PageExitReason, isPageExitReason } from './browser/pageMayExitObservable'
|
|
90
112
|
export * from './browser/addEventListener'
|
|
113
|
+
export { requestIdleCallback } from './tools/requestIdleCallback'
|
|
114
|
+
export * from './tools/taskQueue'
|
|
91
115
|
export * from './tools/timer'
|
|
92
|
-
export {
|
|
93
|
-
export {
|
|
116
|
+
export type { ConsoleLog } from './domain/console/consoleObservable'
|
|
117
|
+
export { initConsoleObservable, resetConsoleObservable } from './domain/console/consoleObservable'
|
|
118
|
+
export type { BoundedBuffer } from './tools/boundedBuffer'
|
|
119
|
+
export { createBoundedBuffer } from './tools/boundedBuffer'
|
|
94
120
|
export { catchUserErrors } from './tools/catchUserErrors'
|
|
95
|
-
export {
|
|
96
|
-
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} from './
|
|
101
|
-
export {
|
|
121
|
+
export type { ContextManager } from './domain/context/contextManager'
|
|
122
|
+
export { createContextManager } from './domain/context/contextManager'
|
|
123
|
+
export { defineContextMethod, bufferContextCalls } from './domain/context/defineContextMethod'
|
|
124
|
+
export { storeContextManager, removeStorageListeners } from './domain/context/storeContextManager'
|
|
125
|
+
export { startAccountContext, buildAccountContextManager } from './domain/contexts/accountContext'
|
|
126
|
+
export { startGlobalContext, buildGlobalContextManager } from './domain/contexts/globalContext'
|
|
127
|
+
export { startUserContext, buildUserContextManager } from './domain/contexts/userContext'
|
|
128
|
+
export type { User } from './domain/contexts/userContext'
|
|
129
|
+
export type { Account } from './domain/contexts/accountContext'
|
|
130
|
+
export type { RumInternalContext } from './domain/contexts/rumInternalContext.type'
|
|
131
|
+
export { CustomerDataType, CustomerContextKey, ContextManagerMethod } from './domain/context/contextConstants'
|
|
132
|
+
export type { ValueHistory, ValueHistoryEntry } from './tools/valueHistory'
|
|
133
|
+
export { createValueHistory, CLEAR_OLD_VALUES_INTERVAL } from './tools/valueHistory'
|
|
102
134
|
export { readBytesFromStream } from './tools/readBytesFromStream'
|
|
135
|
+
export type { SessionState } from './domain/session/sessionState'
|
|
103
136
|
export { STORAGE_POLL_DELAY } from './domain/session/sessionStore'
|
|
104
137
|
export { SESSION_STORE_KEY } from './domain/session/storeStrategies/sessionStoreStrategy'
|
|
105
138
|
export {
|
|
106
139
|
willSyntheticsInjectRum,
|
|
107
140
|
getSyntheticsTestId,
|
|
108
141
|
getSyntheticsResultId,
|
|
142
|
+
isSyntheticsTest,
|
|
109
143
|
} from './domain/synthetics/syntheticsWorkerValues'
|
|
110
|
-
export {
|
|
144
|
+
export { checkContext } from './domain/context/contextUtils'
|
|
111
145
|
export * from './domain/resourceUtils'
|
|
146
|
+
export * from './domain/bufferedData'
|
|
112
147
|
export * from './tools/utils/polyfills'
|
|
148
|
+
export * from './tools/utils/timezone'
|
|
113
149
|
export * from './tools/utils/numberUtils'
|
|
114
150
|
export * from './tools/utils/byteUtils'
|
|
115
151
|
export * from './tools/utils/objectUtils'
|
|
@@ -120,9 +156,10 @@ export * from './tools/utils/stringUtils'
|
|
|
120
156
|
export * from './tools/matchOption'
|
|
121
157
|
export * from './tools/utils/responseUtils'
|
|
122
158
|
export * from './tools/utils/typeUtils'
|
|
123
|
-
export {
|
|
124
|
-
export { ErrorSource } from './domain/error/error.types'
|
|
125
|
-
export { RawError } from './domain/error/error.types'
|
|
126
|
-
export { RawErrorCause } from './domain/error/error.types'
|
|
127
|
-
export { ErrorWithCause } from './domain/error/error.types'
|
|
159
|
+
export type { RawError, RawErrorCause, ErrorWithCause, Csp } from './domain/error/error.types'
|
|
160
|
+
export { ErrorHandling, ErrorSource } from './domain/error/error.types'
|
|
128
161
|
export * from './domain/deflate'
|
|
162
|
+
export * from './domain/connectivity'
|
|
163
|
+
export * from './tools/stackTrace/handlingStack'
|
|
164
|
+
export * from './tools/abstractHooks'
|
|
165
|
+
export * from './domain/tags'
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { combine } from './mergeInto'
|
|
2
|
+
|
|
3
|
+
export const enum HookNames {
|
|
4
|
+
Assemble,
|
|
5
|
+
AssembleTelemetry,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// This is a workaround for an issue occurring when the Browser SDK is included in a TypeScript
|
|
9
|
+
// project configured with `isolatedModules: true`. Even if the const enum is declared in this
|
|
10
|
+
// module, we cannot use it directly to define the EventMap interface keys (TS error: "Cannot access
|
|
11
|
+
// ambient const enums when the '--isolatedModules' flag is provided.").
|
|
12
|
+
export declare const HookNamesAsConst: {
|
|
13
|
+
ASSEMBLE: HookNames.Assemble
|
|
14
|
+
ASSEMBLE_TELEMETRY: HookNames.AssembleTelemetry
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type RecursivePartial<T> = {
|
|
18
|
+
[P in keyof T]?: T[P] extends Array<infer U>
|
|
19
|
+
? Array<RecursivePartial<U>>
|
|
20
|
+
: T[P] extends object | undefined
|
|
21
|
+
? RecursivePartial<T[P]>
|
|
22
|
+
: T[P]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Discards the event from being sent
|
|
26
|
+
export const DISCARDED = 'DISCARDED'
|
|
27
|
+
// Skips from the assembly of the event
|
|
28
|
+
export const SKIPPED = 'SKIPPED'
|
|
29
|
+
|
|
30
|
+
export type DISCARDED = typeof DISCARDED
|
|
31
|
+
export type SKIPPED = typeof SKIPPED
|
|
32
|
+
|
|
33
|
+
export type AbstractHooks = ReturnType<typeof abstractHooks>
|
|
34
|
+
|
|
35
|
+
export function abstractHooks<T extends { [K in HookNames]: (...args: any[]) => unknown }>() {
|
|
36
|
+
const callbacks: { [K in HookNames]?: Array<T[K]> } = {}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
register<K extends HookNames>(hookName: K, callback: T[K]) {
|
|
40
|
+
if (!callbacks[hookName]) {
|
|
41
|
+
callbacks[hookName] = []
|
|
42
|
+
}
|
|
43
|
+
callbacks[hookName]!.push(callback)
|
|
44
|
+
return {
|
|
45
|
+
unregister: () => {
|
|
46
|
+
callbacks[hookName] = callbacks[hookName]!.filter((cb) => cb !== callback)
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
triggerHook<K extends HookNames>(
|
|
51
|
+
hookName: K,
|
|
52
|
+
param: Parameters<T[K]>[0]
|
|
53
|
+
): Exclude<ReturnType<T[K]>, SKIPPED> | DISCARDED | undefined {
|
|
54
|
+
const hookCallbacks = callbacks[hookName] || []
|
|
55
|
+
const results: any[] = []
|
|
56
|
+
|
|
57
|
+
for (const callback of hookCallbacks) {
|
|
58
|
+
const result = callback(param)
|
|
59
|
+
if (result === DISCARDED) {
|
|
60
|
+
return DISCARDED
|
|
61
|
+
}
|
|
62
|
+
if (result === SKIPPED) {
|
|
63
|
+
continue
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
results.push(result)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return combine(...(results as [any, any])) as Exclude<ReturnType<T[K]>, SKIPPED>
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -16,6 +16,7 @@ type EventTypesWithoutData<EventMap> = {
|
|
|
16
16
|
[K in keyof EventMap]: EventMap[K] extends void ? K : never
|
|
17
17
|
}[keyof EventMap]
|
|
18
18
|
|
|
19
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
19
20
|
export class AbstractLifeCycle<EventMap> {
|
|
20
21
|
private callbacks: { [key in keyof EventMap]?: Array<(data: any) => void> } = {}
|
|
21
22
|
|
|
@@ -1,17 +1,45 @@
|
|
|
1
|
+
import { removeItem } from './utils/arrayUtils'
|
|
2
|
+
|
|
1
3
|
const BUFFER_LIMIT = 500
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* BoundedBuffer is a deprecated interface.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Use `BufferedObservable` instead.
|
|
9
|
+
*/
|
|
10
|
+
export interface BoundedBuffer<T = void> {
|
|
11
|
+
add: (callback: (arg: T) => void) => void
|
|
12
|
+
remove: (callback: (arg: T) => void) => void
|
|
13
|
+
drain: (arg: T) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* createBoundedBuffer creates a BoundedBuffer.
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Use `BufferedObservable` instead.
|
|
20
|
+
*/
|
|
21
|
+
export function createBoundedBuffer<T = void>(): BoundedBuffer<T> {
|
|
22
|
+
const buffer: Array<(arg: T) => void> = []
|
|
5
23
|
|
|
6
|
-
add(callback: () => void) {
|
|
7
|
-
const length =
|
|
24
|
+
const add: BoundedBuffer<T>['add'] = (callback: (arg: T) => void) => {
|
|
25
|
+
const length = buffer.push(callback)
|
|
8
26
|
if (length > BUFFER_LIMIT) {
|
|
9
|
-
|
|
27
|
+
buffer.splice(0, 1)
|
|
10
28
|
}
|
|
11
29
|
}
|
|
12
30
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
31
|
+
const remove: BoundedBuffer<T>['remove'] = (callback: (arg: T) => void) => {
|
|
32
|
+
removeItem(buffer, callback)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const drain = (arg: T) => {
|
|
36
|
+
buffer.forEach((callback) => callback(arg))
|
|
37
|
+
buffer.length = 0
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
add,
|
|
42
|
+
remove,
|
|
43
|
+
drain,
|
|
16
44
|
}
|
|
17
45
|
}
|
package/src/tools/display.ts
CHANGED
|
@@ -18,7 +18,6 @@ export const ConsoleApiName = {
|
|
|
18
18
|
export type ConsoleApiName = (typeof ConsoleApiName)[keyof typeof ConsoleApiName]
|
|
19
19
|
|
|
20
20
|
interface Display {
|
|
21
|
-
(api: ConsoleApiName, ...args: any[]): void
|
|
22
21
|
debug: typeof console.debug
|
|
23
22
|
log: typeof console.log
|
|
24
23
|
info: typeof console.info
|
|
@@ -26,13 +25,6 @@ interface Display {
|
|
|
26
25
|
error: typeof console.error
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
export const display: Display = (api, ...args) => {
|
|
30
|
-
if (!Object.prototype.hasOwnProperty.call(ConsoleApiName, api)) {
|
|
31
|
-
api = ConsoleApiName.log
|
|
32
|
-
}
|
|
33
|
-
display[api](...args)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
28
|
/**
|
|
37
29
|
* When building JS bundles, some users might use a plugin[1] or configuration[2] to remove
|
|
38
30
|
* "console.*" references. This causes some issue as we expect `console.*` to be defined.
|
|
@@ -44,8 +36,21 @@ export const display: Display = (api, ...args) => {
|
|
|
44
36
|
*/
|
|
45
37
|
export const globalConsole = console
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
export const originalConsoleMethods = {} as Display
|
|
40
|
+
Object.keys(ConsoleApiName).forEach((name) => {
|
|
41
|
+
originalConsoleMethods[name as ConsoleApiName] = globalConsole[name as ConsoleApiName]
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const PREFIX = 'Datadog Browser SDK:'
|
|
45
|
+
|
|
46
|
+
export const display: Display = {
|
|
47
|
+
debug: originalConsoleMethods.debug.bind(globalConsole, PREFIX),
|
|
48
|
+
log: originalConsoleMethods.log.bind(globalConsole, PREFIX),
|
|
49
|
+
info: originalConsoleMethods.info.bind(globalConsole, PREFIX),
|
|
50
|
+
warn: originalConsoleMethods.warn.bind(globalConsole, PREFIX),
|
|
51
|
+
error: originalConsoleMethods.error.bind(globalConsole, PREFIX),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const DOCS_ORIGIN = 'https://docs.datadoghq.com'
|
|
55
|
+
export const DOCS_TROUBLESHOOTING = `${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting`
|
|
56
|
+
export const MORE_DETAILS = 'More details:'
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Uint8ArrayBuffer } from './utils/byteUtils'
|
|
2
|
+
import { computeBytesCount } from './utils/byteUtils'
|
|
3
|
+
|
|
4
|
+
export interface Encoder<Output extends string | Uint8ArrayBuffer = string | Uint8ArrayBuffer> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether this encoder might call the provided callbacks asynchronously
|
|
7
|
+
*/
|
|
8
|
+
isAsync: boolean
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Whether some data has been written since the last finish() or finishSync() call
|
|
12
|
+
*/
|
|
13
|
+
isEmpty: boolean
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Write a string to be encoded.
|
|
17
|
+
*
|
|
18
|
+
* This operation can be synchronous or asynchronous depending on the encoder implementation.
|
|
19
|
+
*
|
|
20
|
+
* If specified, the callback will be invoked when the operation finishes, unless the operation is
|
|
21
|
+
* asynchronous and finish() or finishSync() is called in the meantime.
|
|
22
|
+
*/
|
|
23
|
+
write(data: string, callback?: (additionalEncodedBytesCount: number) => void): void
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Waits for pending data to be encoded and resets the encoder state.
|
|
27
|
+
*
|
|
28
|
+
* This operation can be synchronous or asynchronous depending on the encoder implementation.
|
|
29
|
+
*
|
|
30
|
+
* The callback will be invoked when the operation finishes, unless the operation is asynchronous
|
|
31
|
+
* and another call to finish() or finishSync() occurs in the meantime.
|
|
32
|
+
*/
|
|
33
|
+
finish(callback: (result: EncoderResult<Output>) => void): void
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Resets the encoder state then returns the encoded data and any potential pending data directly,
|
|
37
|
+
* discarding all pending write operations and finish() callbacks.
|
|
38
|
+
*/
|
|
39
|
+
finishSync(): EncoderResult<Output> & { pendingData: string }
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns a rough estimation of the bytes count if the data was encoded.
|
|
43
|
+
*/
|
|
44
|
+
estimateEncodedBytesCount(data: string): number
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface EncoderResult<Output extends string | Uint8ArrayBuffer = string | Uint8ArrayBuffer> {
|
|
48
|
+
output: Output
|
|
49
|
+
outputBytesCount: number
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An encoding type supported by HTTP Content-Encoding, if applicable.
|
|
53
|
+
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding#directives
|
|
54
|
+
*/
|
|
55
|
+
encoding?: 'deflate'
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Total bytes count of the input strings encoded to UTF-8.
|
|
59
|
+
*/
|
|
60
|
+
rawBytesCount: number
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function createIdentityEncoder(): Encoder<string> {
|
|
64
|
+
let output = ''
|
|
65
|
+
let outputBytesCount = 0
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
isAsync: false,
|
|
69
|
+
|
|
70
|
+
get isEmpty() {
|
|
71
|
+
return !output
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
write(data, callback) {
|
|
75
|
+
const additionalEncodedBytesCount = computeBytesCount(data)
|
|
76
|
+
outputBytesCount += additionalEncodedBytesCount
|
|
77
|
+
output += data
|
|
78
|
+
if (callback) {
|
|
79
|
+
callback(additionalEncodedBytesCount)
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
finish(callback) {
|
|
84
|
+
callback(this.finishSync())
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
finishSync() {
|
|
88
|
+
const result = {
|
|
89
|
+
output,
|
|
90
|
+
outputBytesCount,
|
|
91
|
+
rawBytesCount: outputBytesCount,
|
|
92
|
+
pendingData: '',
|
|
93
|
+
}
|
|
94
|
+
output = ''
|
|
95
|
+
outputBytesCount = 0
|
|
96
|
+
return result
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
estimateEncodedBytesCount(data) {
|
|
100
|
+
return data.length
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -9,21 +9,30 @@
|
|
|
9
9
|
*/
|
|
10
10
|
// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary
|
|
11
11
|
// string is an expected feature flag
|
|
12
|
+
|
|
13
|
+
import { objectHasValue } from './utils/objectUtils'
|
|
14
|
+
|
|
12
15
|
// eslint-disable-next-line no-restricted-syntax
|
|
13
16
|
export enum ExperimentalFeature {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
NO_RESOURCE_DURATION_FROZEN_STATE = 'no_resource_duration_frozen_state',
|
|
20
|
-
SCROLLMAP = 'scrollmap',
|
|
21
|
-
INTERACTION_TO_NEXT_PAINT = 'interaction_to_next_paint',
|
|
22
|
-
DISABLE_REPLAY_INLINE_CSS = 'disable_replay_inline_css',
|
|
17
|
+
TRACK_INTAKE_REQUESTS = 'track_intake_requests',
|
|
18
|
+
USE_TREE_WALKER_FOR_ACTION_NAME = 'use_tree_walker_for_action_name',
|
|
19
|
+
FEATURE_OPERATION_VITAL = 'feature_operation_vital',
|
|
20
|
+
SHORT_SESSION_INVESTIGATION = 'short_session_investigation',
|
|
21
|
+
AVOID_FETCH_KEEPALIVE = 'avoid_fetch_keepalive',
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
const enabledExperimentalFeatures: Set<ExperimentalFeature> = new Set()
|
|
26
25
|
|
|
26
|
+
export function initFeatureFlags(enableExperimentalFeatures: string[] | undefined) {
|
|
27
|
+
if (Array.isArray(enableExperimentalFeatures)) {
|
|
28
|
+
addExperimentalFeatures(
|
|
29
|
+
enableExperimentalFeatures.filter((flag): flag is ExperimentalFeature =>
|
|
30
|
+
objectHasValue(ExperimentalFeature, flag)
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
export function addExperimentalFeatures(enabledFeatures: ExperimentalFeature[]): void {
|
|
28
37
|
enabledFeatures.forEach((flag) => {
|
|
29
38
|
enabledExperimentalFeatures.add(flag)
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
* inspired by https://mathiasbynens.be/notes/globalthis
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
// Extend/Create the WorkerGlobalScope interface to avoid issues when used in a non-browser tsconfig environment
|
|
6
|
+
interface WorkerGlobalScope {
|
|
7
|
+
empty: never
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Utility type to enforce that exactly one of the two types is used
|
|
11
|
+
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
|
|
12
|
+
type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U
|
|
13
|
+
|
|
14
|
+
export type GlobalObject = XOR<Window, WorkerGlobalScope>
|
|
15
|
+
|
|
5
16
|
export function getGlobalObject<T = typeof globalThis>(): T {
|
|
6
17
|
if (typeof globalThis === 'object') {
|
|
7
18
|
return globalThis as unknown as T
|
|
@@ -29,3 +40,12 @@ export function getGlobalObject<T = typeof globalThis>(): T {
|
|
|
29
40
|
}
|
|
30
41
|
return globalObject as T
|
|
31
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Cached reference to the global object so it can be imported and re-used without
|
|
46
|
+
* re-evaluating the heavyweight fallback logic in `getGlobalObject()`.
|
|
47
|
+
*/
|
|
48
|
+
// eslint-disable-next-line local-rules/disallow-side-effects
|
|
49
|
+
export const globalObject = getGlobalObject<GlobalObject>()
|
|
50
|
+
|
|
51
|
+
export const isWorkerEnvironment = 'WorkerGlobalScope' in globalObject
|