@openobserve/browser-core 0.2.12-beta.7 → 0.3.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/cjs/boot/displayAlreadyInitializedError.d.ts +2 -0
- package/cjs/boot/displayAlreadyInitializedError.js +10 -0
- package/cjs/boot/displayAlreadyInitializedError.js.map +1 -0
- package/cjs/boot/init.d.ts +14 -0
- package/cjs/boot/init.js +39 -0
- package/cjs/boot/init.js.map +1 -0
- package/cjs/browser/addEventListener.d.ts +87 -0
- package/cjs/browser/addEventListener.js +55 -0
- package/cjs/browser/addEventListener.js.map +1 -0
- package/cjs/browser/browser.types.d.ts +51 -0
- package/cjs/browser/browser.types.js +6 -0
- package/cjs/browser/browser.types.js.map +1 -0
- package/cjs/browser/cookie.d.ts +28 -0
- package/cjs/browser/cookie.js +114 -0
- package/cjs/browser/cookie.js.map +1 -0
- package/cjs/browser/fetchObservable.d.ts +38 -0
- package/cjs/browser/fetchObservable.js +103 -0
- package/cjs/browser/fetchObservable.js.map +1 -0
- package/cjs/browser/pageMayExitObservable.d.ts +14 -0
- package/cjs/browser/pageMayExitObservable.js +45 -0
- package/cjs/browser/pageMayExitObservable.js.map +1 -0
- package/cjs/browser/runOnReadyState.d.ts +5 -0
- package/cjs/browser/runOnReadyState.js +20 -0
- package/cjs/browser/runOnReadyState.js.map +1 -0
- package/cjs/browser/xhrObservable.d.ts +24 -0
- package/cjs/browser/xhrObservable.js +86 -0
- package/cjs/browser/xhrObservable.js.map +1 -0
- package/cjs/domain/allowedTrackingOrigins.d.ts +4 -0
- package/cjs/domain/allowedTrackingOrigins.js +25 -0
- package/cjs/domain/allowedTrackingOrigins.js.map +1 -0
- package/cjs/domain/bufferedData.d.ts +14 -0
- package/cjs/domain/bufferedData.js +22 -0
- package/cjs/domain/bufferedData.js.map +1 -0
- package/cjs/domain/configuration/configuration.d.ts +312 -0
- package/cjs/domain/configuration/configuration.js +138 -0
- package/cjs/domain/configuration/configuration.js.map +1 -0
- package/cjs/domain/configuration/endpointBuilder.d.ts +12 -0
- package/cjs/domain/configuration/endpointBuilder.js +81 -0
- package/cjs/domain/configuration/endpointBuilder.js.map +1 -0
- package/cjs/domain/configuration/index.d.ts +5 -0
- package/cjs/domain/configuration/index.js +16 -0
- package/cjs/domain/configuration/index.js.map +1 -0
- package/cjs/domain/configuration/transportConfiguration.d.ts +20 -0
- package/cjs/domain/configuration/transportConfiguration.js +54 -0
- package/cjs/domain/configuration/transportConfiguration.js.map +1 -0
- package/cjs/domain/connectivity/connectivity.d.ts +14 -0
- package/cjs/domain/connectivity/connectivity.js +14 -0
- package/cjs/domain/connectivity/connectivity.js.map +1 -0
- package/cjs/domain/connectivity/index.d.ts +1 -0
- package/cjs/domain/connectivity/index.js +18 -0
- package/cjs/domain/connectivity/index.js.map +1 -0
- package/cjs/domain/console/consoleObservable.d.ts +21 -0
- package/cjs/domain/console/consoleObservable.js +84 -0
- package/cjs/domain/console/consoleObservable.js.map +1 -0
- package/cjs/domain/context/contextConstants.d.ts +21 -0
- package/cjs/domain/context/contextConstants.js +18 -0
- package/cjs/domain/context/contextConstants.js.map +1 -0
- package/cjs/domain/context/contextManager.d.ts +19 -0
- package/cjs/domain/context/contextManager.js +60 -0
- package/cjs/domain/context/contextManager.js.map +1 -0
- package/cjs/domain/context/contextUtils.d.ts +5 -0
- package/cjs/domain/context/contextUtils.js +16 -0
- package/cjs/domain/context/contextUtils.js.map +1 -0
- package/cjs/domain/context/defineContextMethod.d.ts +6 -0
- package/cjs/domain/context/defineContextMethod.js +21 -0
- package/cjs/domain/context/defineContextMethod.js.map +1 -0
- package/cjs/domain/context/storeContextManager.d.ts +6 -0
- package/cjs/domain/context/storeContextManager.js +40 -0
- package/cjs/domain/context/storeContextManager.js.map +1 -0
- package/cjs/domain/contexts/accountContext.d.ts +26 -0
- package/cjs/domain/contexts/accountContext.js +33 -0
- package/cjs/domain/contexts/accountContext.js.map +1 -0
- package/cjs/domain/contexts/globalContext.d.ts +18 -0
- package/cjs/domain/contexts/globalContext.js +21 -0
- package/cjs/domain/contexts/globalContext.js.map +1 -0
- package/cjs/domain/contexts/rumInternalContext.type.d.ts +14 -0
- package/cjs/domain/contexts/rumInternalContext.type.js +3 -0
- package/cjs/domain/contexts/rumInternalContext.type.js.map +1 -0
- package/cjs/domain/contexts/userContext.d.ts +29 -0
- package/cjs/domain/contexts/userContext.js +45 -0
- package/cjs/domain/contexts/userContext.js.map +1 -0
- package/cjs/domain/deflate/deflate.types.d.ts +40 -0
- package/cjs/domain/deflate/deflate.types.js +3 -0
- package/cjs/domain/deflate/deflate.types.js.map +1 -0
- package/cjs/domain/deflate/index.d.ts +1 -0
- package/cjs/domain/deflate/index.js +18 -0
- package/cjs/domain/deflate/index.js.map +1 -0
- package/cjs/domain/error/error.d.ts +23 -0
- package/cjs/domain/error/error.js +74 -0
- package/cjs/domain/error/error.js.map +1 -0
- package/cjs/domain/error/error.types.d.ts +47 -0
- package/cjs/domain/error/error.types.js +13 -0
- package/cjs/domain/error/error.types.js.map +1 -0
- package/cjs/domain/error/trackRuntimeError.d.ts +11 -0
- package/cjs/domain/error/trackRuntimeError.js +48 -0
- package/cjs/domain/error/trackRuntimeError.js.map +1 -0
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.d.ts +5 -0
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js +41 -0
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
- package/cjs/domain/extension/extensionUtils.d.ts +10 -0
- package/cjs/domain/extension/extensionUtils.js +30 -0
- package/cjs/domain/extension/extensionUtils.js.map +1 -0
- package/cjs/domain/intakeSites.d.ts +8 -0
- package/cjs/domain/intakeSites.js +11 -0
- package/cjs/domain/intakeSites.js.map +1 -0
- package/cjs/domain/report/browser.types.d.ts +34 -0
- package/cjs/domain/report/browser.types.js +3 -0
- package/cjs/domain/report/browser.types.js.map +1 -0
- package/cjs/domain/report/reportObservable.d.ts +14 -0
- package/cjs/domain/report/reportObservable.js +99 -0
- package/cjs/domain/report/reportObservable.js.map +1 -0
- package/cjs/domain/resourceUtils.d.ts +18 -0
- package/cjs/domain/resourceUtils.js +20 -0
- package/cjs/domain/resourceUtils.js.map +1 -0
- package/cjs/domain/session/oldCookiesMigration.d.ts +11 -0
- package/cjs/domain/session/oldCookiesMigration.js +40 -0
- package/cjs/domain/session/oldCookiesMigration.js.map +1 -0
- package/cjs/domain/session/sessionConstants.d.ts +15 -0
- package/cjs/domain/session/sessionConstants.js +16 -0
- package/cjs/domain/session/sessionConstants.js.map +1 -0
- package/cjs/domain/session/sessionManager.d.ts +28 -0
- package/cjs/domain/session/sessionManager.js +201 -0
- package/cjs/domain/session/sessionManager.js.map +1 -0
- package/cjs/domain/session/sessionState.d.ts +16 -0
- package/cjs/domain/session/sessionState.js +70 -0
- package/cjs/domain/session/sessionState.js.map +1 -0
- package/cjs/domain/session/sessionStateValidation.d.ts +3 -0
- package/cjs/domain/session/sessionStateValidation.js +11 -0
- package/cjs/domain/session/sessionStateValidation.js.map +1 -0
- package/cjs/domain/session/sessionStore.d.ts +38 -0
- package/cjs/domain/session/sessionStore.js +185 -0
- package/cjs/domain/session/sessionStore.js.map +1 -0
- package/cjs/domain/session/sessionStoreOperations.d.ts +12 -0
- package/cjs/domain/session/sessionStoreOperations.js +119 -0
- package/cjs/domain/session/sessionStoreOperations.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +12 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.js +104 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +6 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +42 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +16 -0
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js +5 -0
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js.map +1 -0
- package/cjs/domain/synthetics/syntheticsWorkerValues.d.ts +12 -0
- package/cjs/domain/synthetics/syntheticsWorkerValues.js +31 -0
- package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
- package/cjs/domain/tags.d.ts +6 -0
- package/cjs/domain/tags.js +67 -0
- package/cjs/domain/tags.js.map +1 -0
- package/cjs/domain/telemetry/index.d.ts +4 -0
- package/cjs/domain/telemetry/index.js +28 -0
- package/cjs/domain/telemetry/index.js.map +1 -0
- package/cjs/domain/telemetry/rawTelemetryEvent.types.d.ts +18 -0
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js +9 -0
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
- package/cjs/domain/telemetry/telemetry.d.ts +56 -0
- package/cjs/domain/telemetry/telemetry.js +241 -0
- package/cjs/domain/telemetry/telemetry.js.map +1 -0
- package/cjs/domain/telemetry/telemetryEvent.types.d.ts +866 -0
- package/cjs/domain/telemetry/telemetryEvent.types.js +7 -0
- package/cjs/domain/telemetry/telemetryEvent.types.js.map +1 -0
- package/cjs/domain/trackingConsent.d.ts +13 -0
- package/cjs/domain/trackingConsent.js +28 -0
- package/cjs/domain/trackingConsent.js.map +1 -0
- package/cjs/index.d.ts +100 -0
- package/cjs/index.js +194 -0
- package/cjs/index.js.map +1 -0
- package/cjs/tools/abstractHooks.d.ts +24 -0
- package/cjs/tools/abstractHooks.js +41 -0
- package/cjs/tools/abstractHooks.js.map +1 -0
- package/cjs/tools/abstractLifeCycle.d.ts +23 -0
- package/cjs/tools/abstractLifeCycle.js +28 -0
- package/cjs/tools/abstractLifeCycle.js.map +1 -0
- package/cjs/tools/boundedBuffer.d.ts +16 -0
- package/cjs/tools/boundedBuffer.js +32 -0
- package/cjs/tools/boundedBuffer.js.map +1 -0
- package/cjs/tools/catchUserErrors.d.ts +1 -0
- package/cjs/tools/catchUserErrors.js +15 -0
- package/cjs/tools/catchUserErrors.js.map +1 -0
- package/cjs/tools/display.d.ts +38 -0
- package/cjs/tools/display.js +44 -0
- package/cjs/tools/display.js.map +1 -0
- package/cjs/tools/encoder.d.ts +54 -0
- package/cjs/tools/encoder.js +40 -0
- package/cjs/tools/encoder.js.map +1 -0
- package/cjs/tools/experimentalFeatures.d.ts +21 -0
- package/cjs/tools/experimentalFeatures.js +50 -0
- package/cjs/tools/experimentalFeatures.js.map +1 -0
- package/cjs/tools/getZoneJsOriginalValue.d.ts +19 -0
- package/cjs/tools/getZoneJsOriginalValue.js +29 -0
- package/cjs/tools/getZoneJsOriginalValue.js.map +1 -0
- package/cjs/tools/globalObject.d.ts +19 -0
- package/cjs/tools/globalObject.js +44 -0
- package/cjs/tools/globalObject.js.map +1 -0
- package/cjs/tools/instrumentMethod.d.ts +75 -0
- package/cjs/tools/instrumentMethod.js +118 -0
- package/cjs/tools/instrumentMethod.js.map +1 -0
- package/cjs/tools/matchOption.d.ts +8 -0
- package/cjs/tools/matchOption.js +35 -0
- package/cjs/tools/matchOption.js.map +1 -0
- package/cjs/tools/mergeInto.d.ts +25 -0
- package/cjs/tools/mergeInto.js +98 -0
- package/cjs/tools/mergeInto.js.map +1 -0
- package/cjs/tools/monitor.d.ts +9 -0
- package/cjs/tools/monitor.js +62 -0
- package/cjs/tools/monitor.js.map +1 -0
- package/cjs/tools/observable.d.ts +30 -0
- package/cjs/tools/observable.js +89 -0
- package/cjs/tools/observable.js.map +1 -0
- package/cjs/tools/queueMicrotask.d.ts +1 -0
- package/cjs/tools/queueMicrotask.js +17 -0
- package/cjs/tools/queueMicrotask.js.map +1 -0
- package/cjs/tools/readBytesFromStream.d.ts +10 -0
- package/cjs/tools/readBytesFromStream.js +28 -0
- package/cjs/tools/readBytesFromStream.js.map +1 -0
- package/cjs/tools/requestIdleCallback.d.ts +12 -0
- package/cjs/tools/requestIdleCallback.js +35 -0
- package/cjs/tools/requestIdleCallback.js.map +1 -0
- package/cjs/tools/sendToExtension.d.ts +3 -0
- package/cjs/tools/sendToExtension.js +11 -0
- package/cjs/tools/sendToExtension.js.map +1 -0
- package/cjs/tools/serialisation/context.d.ts +9 -0
- package/cjs/tools/serialisation/context.js +3 -0
- package/cjs/tools/serialisation/context.js.map +1 -0
- package/cjs/tools/serialisation/jsonStringify.d.ts +13 -0
- package/cjs/tools/serialisation/jsonStringify.js +48 -0
- package/cjs/tools/serialisation/jsonStringify.js.map +1 -0
- package/cjs/tools/serialisation/sanitize.d.ts +18 -0
- package/cjs/tools/serialisation/sanitize.js +188 -0
- package/cjs/tools/serialisation/sanitize.js.map +1 -0
- package/cjs/tools/stackTrace/computeStackTrace.d.ts +25 -0
- package/cjs/tools/stackTrace/computeStackTrace.js +187 -0
- package/cjs/tools/stackTrace/computeStackTrace.js.map +1 -0
- package/cjs/tools/stackTrace/handlingStack.d.ts +10 -0
- package/cjs/tools/stackTrace/handlingStack.js +46 -0
- package/cjs/tools/stackTrace/handlingStack.js.map +1 -0
- package/cjs/tools/taskQueue.d.ts +15 -0
- package/cjs/tools/taskQueue.js +54 -0
- package/cjs/tools/taskQueue.js.map +1 -0
- package/cjs/tools/timer.d.ts +5 -0
- package/cjs/tools/timer.js +22 -0
- package/cjs/tools/timer.js.map +1 -0
- package/cjs/tools/utils/arrayUtils.d.ts +3 -0
- package/cjs/tools/utils/arrayUtils.js +20 -0
- package/cjs/tools/utils/arrayUtils.js.map +1 -0
- package/cjs/tools/utils/browserDetection.d.ts +8 -0
- package/cjs/tools/utils/browserDetection.js +33 -0
- package/cjs/tools/utils/browserDetection.js.map +1 -0
- package/cjs/tools/utils/byteUtils.d.ts +8 -0
- package/cjs/tools/utils/byteUtils.js +34 -0
- package/cjs/tools/utils/byteUtils.js.map +1 -0
- package/cjs/tools/utils/functionUtils.d.ts +8 -0
- package/cjs/tools/utils/functionUtils.js +43 -0
- package/cjs/tools/utils/functionUtils.js.map +1 -0
- package/cjs/tools/utils/numberUtils.d.ts +9 -0
- package/cjs/tools/utils/numberUtils.js +24 -0
- package/cjs/tools/utils/numberUtils.js.map +1 -0
- package/cjs/tools/utils/objectUtils.d.ts +10 -0
- package/cjs/tools/utils/objectUtils.js +23 -0
- package/cjs/tools/utils/objectUtils.js.map +1 -0
- package/cjs/tools/utils/polyfills.d.ts +7 -0
- package/cjs/tools/utils/polyfills.js +23 -0
- package/cjs/tools/utils/polyfills.js.map +1 -0
- package/cjs/tools/utils/responseUtils.d.ts +2 -0
- package/cjs/tools/utils/responseUtils.js +17 -0
- package/cjs/tools/utils/responseUtils.js.map +1 -0
- package/cjs/tools/utils/stringUtils.d.ts +23 -0
- package/cjs/tools/utils/stringUtils.js +91 -0
- package/cjs/tools/utils/stringUtils.js.map +1 -0
- package/cjs/tools/utils/timeUtils.d.ts +53 -0
- package/cjs/tools/utils/timeUtils.js +101 -0
- package/cjs/tools/utils/timeUtils.js.map +1 -0
- package/cjs/tools/utils/timezone.d.ts +1 -0
- package/cjs/tools/utils/timezone.js +13 -0
- package/cjs/tools/utils/timezone.js.map +1 -0
- package/cjs/tools/utils/typeUtils.d.ts +4 -0
- package/cjs/tools/utils/typeUtils.js +16 -0
- package/cjs/tools/utils/typeUtils.js.map +1 -0
- package/cjs/tools/utils/urlPolyfill.d.ts +5 -0
- package/cjs/tools/utils/urlPolyfill.js +59 -0
- package/cjs/tools/utils/urlPolyfill.js.map +1 -0
- package/cjs/tools/valueHistory.d.ts +27 -0
- package/cjs/tools/valueHistory.js +104 -0
- package/cjs/tools/valueHistory.js.map +1 -0
- package/cjs/transport/batch.d.ts +16 -0
- package/cjs/transport/batch.js +110 -0
- package/cjs/transport/batch.js.map +1 -0
- package/cjs/transport/eventBridge.d.ts +21 -0
- package/cjs/transport/eventBridge.js +46 -0
- package/cjs/transport/eventBridge.js.map +1 -0
- package/cjs/transport/flushController.d.ts +65 -0
- package/cjs/transport/flushController.js +123 -0
- package/cjs/transport/flushController.js.map +1 -0
- package/cjs/transport/httpRequest.d.ts +56 -0
- package/cjs/transport/httpRequest.js +95 -0
- package/cjs/transport/httpRequest.js.map +1 -0
- package/cjs/transport/index.d.ts +7 -0
- package/cjs/transport/index.js +15 -0
- package/cjs/transport/index.js.map +1 -0
- package/cjs/transport/sendWithRetryStrategy.d.ts +41 -0
- package/cjs/transport/sendWithRetryStrategy.js +163 -0
- package/cjs/transport/sendWithRetryStrategy.js.map +1 -0
- package/esm/boot/displayAlreadyInitializedError.d.ts +2 -0
- package/esm/boot/displayAlreadyInitializedError.js +7 -0
- package/esm/boot/displayAlreadyInitializedError.js.map +1 -0
- package/esm/boot/init.d.ts +14 -0
- package/esm/boot/init.js +35 -0
- package/esm/boot/init.js.map +1 -0
- package/esm/browser/addEventListener.d.ts +87 -0
- package/esm/browser/addEventListener.js +51 -0
- package/esm/browser/addEventListener.js.map +1 -0
- package/esm/browser/browser.types.d.ts +51 -0
- package/esm/browser/browser.types.js +5 -0
- package/esm/browser/browser.types.js.map +1 -0
- package/esm/browser/cookie.d.ts +28 -0
- package/esm/browser/cookie.js +103 -0
- package/esm/browser/cookie.js.map +1 -0
- package/esm/browser/fetchObservable.d.ts +38 -0
- package/esm/browser/fetchObservable.js +99 -0
- package/esm/browser/fetchObservable.js.map +1 -0
- package/esm/browser/pageMayExitObservable.d.ts +14 -0
- package/esm/browser/pageMayExitObservable.js +40 -0
- package/esm/browser/pageMayExitObservable.js.map +1 -0
- package/esm/browser/runOnReadyState.d.ts +5 -0
- package/esm/browser/runOnReadyState.js +16 -0
- package/esm/browser/runOnReadyState.js.map +1 -0
- package/esm/browser/xhrObservable.d.ts +24 -0
- package/esm/browser/xhrObservable.js +83 -0
- package/esm/browser/xhrObservable.js.map +1 -0
- package/esm/domain/allowedTrackingOrigins.d.ts +4 -0
- package/esm/domain/allowedTrackingOrigins.js +21 -0
- package/esm/domain/allowedTrackingOrigins.js.map +1 -0
- package/esm/domain/bufferedData.d.ts +14 -0
- package/esm/domain/bufferedData.js +19 -0
- package/esm/domain/bufferedData.js.map +1 -0
- package/esm/domain/configuration/configuration.d.ts +312 -0
- package/esm/domain/configuration/configuration.js +132 -0
- package/esm/domain/configuration/configuration.js.map +1 -0
- package/esm/domain/configuration/endpointBuilder.d.ts +12 -0
- package/esm/domain/configuration/endpointBuilder.js +77 -0
- package/esm/domain/configuration/endpointBuilder.js.map +1 -0
- package/esm/domain/configuration/index.d.ts +5 -0
- package/esm/domain/configuration/index.js +4 -0
- package/esm/domain/configuration/index.js.map +1 -0
- package/esm/domain/configuration/transportConfiguration.d.ts +20 -0
- package/esm/domain/configuration/transportConfiguration.js +50 -0
- package/esm/domain/configuration/transportConfiguration.js.map +1 -0
- package/esm/domain/connectivity/connectivity.d.ts +14 -0
- package/esm/domain/connectivity/connectivity.js +11 -0
- package/esm/domain/connectivity/connectivity.js.map +1 -0
- package/esm/domain/connectivity/index.d.ts +1 -0
- package/esm/domain/connectivity/index.js +2 -0
- package/esm/domain/connectivity/index.js.map +1 -0
- package/esm/domain/console/consoleObservable.d.ts +21 -0
- package/esm/domain/console/consoleObservable.js +80 -0
- package/esm/domain/console/consoleObservable.js.map +1 -0
- package/esm/domain/context/contextConstants.d.ts +21 -0
- package/esm/domain/context/contextConstants.js +15 -0
- package/esm/domain/context/contextConstants.js.map +1 -0
- package/esm/domain/context/contextManager.d.ts +19 -0
- package/esm/domain/context/contextManager.js +57 -0
- package/esm/domain/context/contextManager.js.map +1 -0
- package/esm/domain/context/contextUtils.d.ts +5 -0
- package/esm/domain/context/contextUtils.js +13 -0
- package/esm/domain/context/contextUtils.js.map +1 -0
- package/esm/domain/context/defineContextMethod.d.ts +6 -0
- package/esm/domain/context/defineContextMethod.js +17 -0
- package/esm/domain/context/defineContextMethod.js.map +1 -0
- package/esm/domain/context/storeContextManager.d.ts +6 -0
- package/esm/domain/context/storeContextManager.js +35 -0
- package/esm/domain/context/storeContextManager.js.map +1 -0
- package/esm/domain/contexts/accountContext.d.ts +26 -0
- package/esm/domain/contexts/accountContext.js +29 -0
- package/esm/domain/contexts/accountContext.js.map +1 -0
- package/esm/domain/contexts/globalContext.d.ts +18 -0
- package/esm/domain/contexts/globalContext.js +17 -0
- package/esm/domain/contexts/globalContext.js.map +1 -0
- package/esm/domain/contexts/rumInternalContext.type.d.ts +14 -0
- package/esm/domain/contexts/rumInternalContext.type.js +2 -0
- package/esm/domain/contexts/rumInternalContext.type.js.map +1 -0
- package/esm/domain/contexts/userContext.d.ts +29 -0
- package/esm/domain/contexts/userContext.js +41 -0
- package/esm/domain/contexts/userContext.js.map +1 -0
- package/esm/domain/deflate/deflate.types.d.ts +40 -0
- package/esm/domain/deflate/deflate.types.js +2 -0
- package/esm/domain/deflate/deflate.types.js.map +1 -0
- package/esm/domain/deflate/index.d.ts +1 -0
- package/esm/domain/deflate/index.js +2 -0
- package/esm/domain/deflate/index.js.map +1 -0
- package/esm/domain/error/error.d.ts +23 -0
- package/esm/domain/error/error.js +65 -0
- package/esm/domain/error/error.js.map +1 -0
- package/esm/domain/error/error.types.d.ts +47 -0
- package/esm/domain/error/error.types.js +10 -0
- package/esm/domain/error/error.types.js.map +1 -0
- package/esm/domain/error/trackRuntimeError.d.ts +11 -0
- package/esm/domain/error/trackRuntimeError.js +43 -0
- package/esm/domain/error/trackRuntimeError.js.map +1 -0
- package/esm/domain/eventRateLimiter/createEventRateLimiter.d.ts +5 -0
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js +38 -0
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
- package/esm/domain/extension/extensionUtils.d.ts +10 -0
- package/esm/domain/extension/extensionUtils.js +25 -0
- package/esm/domain/extension/extensionUtils.js.map +1 -0
- package/esm/domain/intakeSites.d.ts +8 -0
- package/esm/domain/intakeSites.js +8 -0
- package/esm/domain/intakeSites.js.map +1 -0
- package/esm/domain/report/browser.types.d.ts +34 -0
- package/esm/domain/report/browser.types.js +2 -0
- package/esm/domain/report/browser.types.js.map +1 -0
- package/esm/domain/report/reportObservable.d.ts +14 -0
- package/esm/domain/report/reportObservable.js +95 -0
- package/esm/domain/report/reportObservable.js.map +1 -0
- package/esm/domain/resourceUtils.d.ts +18 -0
- package/esm/domain/resourceUtils.js +17 -0
- package/esm/domain/resourceUtils.js.map +1 -0
- package/esm/domain/session/oldCookiesMigration.d.ts +11 -0
- package/esm/domain/session/oldCookiesMigration.js +36 -0
- package/esm/domain/session/oldCookiesMigration.js.map +1 -0
- package/esm/domain/session/sessionConstants.d.ts +15 -0
- package/esm/domain/session/sessionConstants.js +13 -0
- package/esm/domain/session/sessionConstants.js.map +1 -0
- package/esm/domain/session/sessionManager.d.ts +28 -0
- package/esm/domain/session/sessionManager.js +196 -0
- package/esm/domain/session/sessionManager.js.map +1 -0
- package/esm/domain/session/sessionState.d.ts +16 -0
- package/esm/domain/session/sessionState.js +60 -0
- package/esm/domain/session/sessionState.js.map +1 -0
- package/esm/domain/session/sessionStateValidation.d.ts +3 -0
- package/esm/domain/session/sessionStateValidation.js +7 -0
- package/esm/domain/session/sessionStateValidation.js.map +1 -0
- package/esm/domain/session/sessionStore.d.ts +38 -0
- package/esm/domain/session/sessionStore.js +179 -0
- package/esm/domain/session/sessionStore.js.map +1 -0
- package/esm/domain/session/sessionStoreOperations.d.ts +12 -0
- package/esm/domain/session/sessionStoreOperations.js +114 -0
- package/esm/domain/session/sessionStoreOperations.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +12 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.js +98 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +6 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +37 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +16 -0
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js +2 -0
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js.map +1 -0
- package/esm/domain/synthetics/syntheticsWorkerValues.d.ts +12 -0
- package/esm/domain/synthetics/syntheticsWorkerValues.js +24 -0
- package/esm/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
- package/esm/domain/tags.d.ts +6 -0
- package/esm/domain/tags.js +60 -0
- package/esm/domain/tags.js.map +1 -0
- package/esm/domain/telemetry/index.d.ts +4 -0
- package/esm/domain/telemetry/index.js +3 -0
- package/esm/domain/telemetry/index.js.map +1 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +18 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.js +6 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
- package/esm/domain/telemetry/telemetry.d.ts +56 -0
- package/esm/domain/telemetry/telemetry.js +228 -0
- package/esm/domain/telemetry/telemetry.js.map +1 -0
- package/esm/domain/telemetry/telemetryEvent.types.d.ts +866 -0
- package/esm/domain/telemetry/telemetryEvent.types.js +6 -0
- package/esm/domain/telemetry/telemetryEvent.types.js.map +1 -0
- package/esm/domain/trackingConsent.d.ts +13 -0
- package/esm/domain/trackingConsent.js +24 -0
- package/esm/domain/trackingConsent.js.map +1 -0
- package/esm/index.d.ts +100 -0
- package/esm/index.js +76 -0
- package/esm/index.js.map +1 -0
- package/esm/tools/abstractHooks.d.ts +24 -0
- package/esm/tools/abstractHooks.js +37 -0
- package/esm/tools/abstractHooks.js.map +1 -0
- package/esm/tools/abstractLifeCycle.d.ts +23 -0
- package/esm/tools/abstractLifeCycle.js +24 -0
- package/esm/tools/abstractLifeCycle.js.map +1 -0
- package/esm/tools/boundedBuffer.d.ts +16 -0
- package/esm/tools/boundedBuffer.js +29 -0
- package/esm/tools/boundedBuffer.js.map +1 -0
- package/esm/tools/catchUserErrors.d.ts +1 -0
- package/esm/tools/catchUserErrors.js +12 -0
- package/esm/tools/catchUserErrors.js.map +1 -0
- package/esm/tools/display.d.ts +38 -0
- package/esm/tools/display.js +41 -0
- package/esm/tools/display.js.map +1 -0
- package/esm/tools/encoder.d.ts +54 -0
- package/esm/tools/encoder.js +37 -0
- package/esm/tools/encoder.js.map +1 -0
- package/esm/tools/experimentalFeatures.d.ts +21 -0
- package/esm/tools/experimentalFeatures.js +42 -0
- package/esm/tools/experimentalFeatures.js.map +1 -0
- package/esm/tools/getZoneJsOriginalValue.d.ts +19 -0
- package/esm/tools/getZoneJsOriginalValue.js +26 -0
- package/esm/tools/getZoneJsOriginalValue.js.map +1 -0
- package/esm/tools/globalObject.d.ts +19 -0
- package/esm/tools/globalObject.js +40 -0
- package/esm/tools/globalObject.js.map +1 -0
- package/esm/tools/instrumentMethod.d.ts +75 -0
- package/esm/tools/instrumentMethod.js +114 -0
- package/esm/tools/instrumentMethod.js.map +1 -0
- package/esm/tools/matchOption.d.ts +8 -0
- package/esm/tools/matchOption.js +31 -0
- package/esm/tools/matchOption.js.map +1 -0
- package/esm/tools/mergeInto.d.ts +25 -0
- package/esm/tools/mergeInto.js +93 -0
- package/esm/tools/mergeInto.js.map +1 -0
- package/esm/tools/monitor.d.ts +9 -0
- package/esm/tools/monitor.js +52 -0
- package/esm/tools/monitor.js.map +1 -0
- package/esm/tools/observable.d.ts +30 -0
- package/esm/tools/observable.js +83 -0
- package/esm/tools/observable.js.map +1 -0
- package/esm/tools/queueMicrotask.d.ts +1 -0
- package/esm/tools/queueMicrotask.js +14 -0
- package/esm/tools/queueMicrotask.js.map +1 -0
- package/esm/tools/readBytesFromStream.d.ts +10 -0
- package/esm/tools/readBytesFromStream.js +25 -0
- package/esm/tools/readBytesFromStream.js.map +1 -0
- package/esm/tools/requestIdleCallback.d.ts +12 -0
- package/esm/tools/requestIdleCallback.js +30 -0
- package/esm/tools/requestIdleCallback.js.map +1 -0
- package/esm/tools/sendToExtension.d.ts +3 -0
- package/esm/tools/sendToExtension.js +8 -0
- package/esm/tools/sendToExtension.js.map +1 -0
- package/esm/tools/serialisation/context.d.ts +9 -0
- package/esm/tools/serialisation/context.js +2 -0
- package/esm/tools/serialisation/context.js.map +1 -0
- package/esm/tools/serialisation/jsonStringify.d.ts +13 -0
- package/esm/tools/serialisation/jsonStringify.js +44 -0
- package/esm/tools/serialisation/jsonStringify.js.map +1 -0
- package/esm/tools/serialisation/sanitize.d.ts +18 -0
- package/esm/tools/serialisation/sanitize.js +185 -0
- package/esm/tools/serialisation/sanitize.js.map +1 -0
- package/esm/tools/stackTrace/computeStackTrace.d.ts +25 -0
- package/esm/tools/stackTrace/computeStackTrace.js +183 -0
- package/esm/tools/stackTrace/computeStackTrace.js.map +1 -0
- package/esm/tools/stackTrace/handlingStack.d.ts +10 -0
- package/esm/tools/stackTrace/handlingStack.js +41 -0
- package/esm/tools/stackTrace/handlingStack.js.map +1 -0
- package/esm/tools/taskQueue.d.ts +15 -0
- package/esm/tools/taskQueue.js +50 -0
- package/esm/tools/taskQueue.js.map +1 -0
- package/esm/tools/timer.d.ts +5 -0
- package/esm/tools/timer.js +16 -0
- package/esm/tools/timer.js.map +1 -0
- package/esm/tools/utils/arrayUtils.d.ts +3 -0
- package/esm/tools/utils/arrayUtils.js +15 -0
- package/esm/tools/utils/arrayUtils.js.map +1 -0
- package/esm/tools/utils/browserDetection.d.ts +8 -0
- package/esm/tools/utils/browserDetection.js +28 -0
- package/esm/tools/utils/browserDetection.js.map +1 -0
- package/esm/tools/utils/byteUtils.d.ts +8 -0
- package/esm/tools/utils/byteUtils.js +29 -0
- package/esm/tools/utils/byteUtils.js.map +1 -0
- package/esm/tools/utils/functionUtils.d.ts +8 -0
- package/esm/tools/utils/functionUtils.js +39 -0
- package/esm/tools/utils/functionUtils.js.map +1 -0
- package/esm/tools/utils/numberUtils.d.ts +9 -0
- package/esm/tools/utils/numberUtils.js +18 -0
- package/esm/tools/utils/numberUtils.js.map +1 -0
- package/esm/tools/utils/objectUtils.d.ts +10 -0
- package/esm/tools/utils/objectUtils.js +17 -0
- package/esm/tools/utils/objectUtils.js.map +1 -0
- package/esm/tools/utils/polyfills.d.ts +7 -0
- package/esm/tools/utils/polyfills.js +18 -0
- package/esm/tools/utils/polyfills.js.map +1 -0
- package/esm/tools/utils/responseUtils.d.ts +2 -0
- package/esm/tools/utils/responseUtils.js +13 -0
- package/esm/tools/utils/responseUtils.js.map +1 -0
- package/esm/tools/utils/stringUtils.d.ts +23 -0
- package/esm/tools/utils/stringUtils.js +84 -0
- package/esm/tools/utils/stringUtils.js.map +1 -0
- package/esm/tools/utils/timeUtils.d.ts +53 -0
- package/esm/tools/utils/timeUtils.js +84 -0
- package/esm/tools/utils/timeUtils.js.map +1 -0
- package/esm/tools/utils/timezone.d.ts +1 -0
- package/esm/tools/utils/timezone.js +10 -0
- package/esm/tools/utils/timezone.js.map +1 -0
- package/esm/tools/utils/typeUtils.d.ts +4 -0
- package/esm/tools/utils/typeUtils.js +13 -0
- package/esm/tools/utils/typeUtils.js.map +1 -0
- package/esm/tools/utils/urlPolyfill.d.ts +5 -0
- package/esm/tools/utils/urlPolyfill.js +52 -0
- package/esm/tools/utils/urlPolyfill.js.map +1 -0
- package/esm/tools/valueHistory.d.ts +27 -0
- package/esm/tools/valueHistory.js +100 -0
- package/esm/tools/valueHistory.js.map +1 -0
- package/esm/transport/batch.d.ts +16 -0
- package/esm/transport/batch.js +106 -0
- package/esm/transport/batch.js.map +1 -0
- package/esm/transport/eventBridge.d.ts +21 -0
- package/esm/transport/eventBridge.js +41 -0
- package/esm/transport/eventBridge.js.map +1 -0
- package/esm/transport/flushController.d.ts +65 -0
- package/esm/transport/flushController.js +119 -0
- package/esm/transport/flushController.js.map +1 -0
- package/esm/transport/httpRequest.d.ts +56 -0
- package/esm/transport/httpRequest.js +89 -0
- package/esm/transport/httpRequest.js.map +1 -0
- package/esm/transport/index.d.ts +7 -0
- package/esm/transport/index.js +5 -0
- package/esm/transport/index.js.map +1 -0
- package/esm/transport/sendWithRetryStrategy.d.ts +41 -0
- package/esm/transport/sendWithRetryStrategy.js +158 -0
- package/esm/transport/sendWithRetryStrategy.js.map +1 -0
- package/package.json +2 -2
- package/src/boot/displayAlreadyInitializedError.spec.ts +18 -0
- package/src/boot/displayAlreadyInitializedError.ts +1 -1
- package/src/boot/init.spec.ts +50 -0
- package/src/boot/init.ts +1 -1
- package/src/browser/addEventListener.spec.ts +141 -0
- package/src/browser/addEventListener.ts +2 -2
- package/src/browser/cookie.spec.ts +53 -0
- package/src/browser/fetchObservable.spec.ts +334 -0
- package/src/browser/pageMayExitObservable.spec.ts +56 -0
- package/src/browser/xhrObservable.spec.ts +405 -0
- package/src/domain/allowedTrackingOrigins.spec.ts +210 -0
- package/src/domain/bufferedData.spec.ts +34 -0
- package/src/domain/configuration/configuration.spec.ts +236 -0
- package/src/domain/configuration/configuration.ts +6 -5
- package/src/domain/configuration/endpointBuilder.spec.ts +173 -0
- package/src/domain/configuration/endpointBuilder.ts +18 -12
- package/src/domain/configuration/transportConfiguration.spec.ts +130 -0
- package/src/domain/connectivity/connectivity.spec.ts +50 -0
- package/src/domain/console/consoleObservable.spec.ts +151 -0
- package/src/domain/context/contextManager.spec.ts +152 -0
- package/src/domain/context/contextUtils.spec.ts +26 -0
- package/src/domain/context/storeContextManager.spec.ts +103 -0
- package/src/domain/context/storeContextManager.ts +1 -1
- package/src/domain/contexts/accountContext.spec.ts +99 -0
- package/src/domain/contexts/globalContext.spec.ts +88 -0
- package/src/domain/contexts/userContext.spec.ts +156 -0
- package/src/domain/error/error.spec.ts +294 -0
- package/src/domain/error/trackRuntimeError.spec.ts +343 -0
- package/src/domain/eventRateLimiter/createEventRateLimiter.spec.ts +119 -0
- package/src/domain/extension/extensionUtils.spec.ts +47 -0
- package/src/domain/report/reportObservable.spec.ts +71 -0
- package/src/domain/session/oldCookiesMigration.spec.ts +76 -0
- package/src/domain/session/sessionManager.spec.ts +684 -0
- package/src/domain/session/sessionState.spec.ts +88 -0
- package/src/domain/session/sessionStore.spec.ts +647 -0
- package/src/domain/session/sessionStoreOperations.spec.ts +234 -0
- package/src/domain/session/storeStrategies/sessionInCookie.spec.ts +228 -0
- package/src/domain/session/storeStrategies/sessionInLocalStorage.spec.ts +75 -0
- package/src/domain/synthetics/syntheticsWorkerValues.spec.ts +82 -0
- package/src/domain/tags.spec.ts +74 -0
- package/src/domain/telemetry/telemetry.spec.ts +494 -0
- package/src/domain/trackingConsent.spec.ts +44 -0
- package/src/tools/abstractHooks.spec.ts +76 -0
- package/src/tools/abstractLifeCycle.spec.ts +46 -0
- package/src/tools/boundedBuffer.spec.ts +40 -0
- package/src/tools/catchUserErrors.spec.ts +20 -0
- package/src/tools/encoder.spec.ts +112 -0
- package/src/tools/experimentalFeatures.spec.ts +60 -0
- package/src/tools/getZoneJsOriginalValue.spec.ts +36 -0
- package/src/tools/instrumentMethod.spec.ts +381 -0
- package/src/tools/matchOption.spec.ts +41 -0
- package/src/tools/mergeInto.spec.ts +198 -0
- package/src/tools/monitor.spec.ts +172 -0
- package/src/tools/observable.spec.ts +259 -0
- package/src/tools/queueMicrotask.spec.ts +24 -0
- package/src/tools/readBytesFromStream.spec.ts +62 -0
- package/src/tools/requestIdleCallback.spec.ts +65 -0
- package/src/tools/serialisation/jsonStringify.spec.ts +76 -0
- package/src/tools/serialisation/sanitize.spec.ts +284 -0
- package/src/tools/stackTrace/capturedExceptions.specHelper.ts +316 -0
- package/src/tools/stackTrace/computeStackTrace.spec.ts +1007 -0
- package/src/tools/stackTrace/handlingStack.spec.ts +20 -0
- package/src/tools/taskQueue.spec.ts +60 -0
- package/src/tools/timer.spec.ts +76 -0
- package/src/tools/utils/browserDetection.spec.ts +120 -0
- package/src/tools/utils/byteUtils.spec.ts +29 -0
- package/src/tools/utils/functionUtils.spec.ts +229 -0
- package/src/tools/utils/numberUtils.spec.ts +27 -0
- package/src/tools/utils/stringUtils.spec.ts +74 -0
- package/src/tools/utils/typeUtils.spec.ts +25 -0
- package/src/tools/utils/urlPolyfill.spec.ts +55 -0
- package/src/tools/valueHistory.spec.ts +180 -0
- package/src/transport/batch.spec.ts +261 -0
- package/src/transport/eventBridge.spec.ts +90 -0
- package/src/transport/flushController.spec.ts +267 -0
- package/src/transport/httpRequest.spec.ts +400 -0
- package/src/transport/httpRequest.ts +3 -3
- package/src/transport/sendWithRetryStrategy.spec.ts +393 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createContextManager = createContextManager;
|
|
4
|
+
const mergeInto_1 = require("../../tools/mergeInto");
|
|
5
|
+
const sanitize_1 = require("../../tools/serialisation/sanitize");
|
|
6
|
+
const observable_1 = require("../../tools/observable");
|
|
7
|
+
const display_1 = require("../../tools/display");
|
|
8
|
+
const contextUtils_1 = require("./contextUtils");
|
|
9
|
+
function ensureProperties(context, propertiesConfig, name) {
|
|
10
|
+
const newContext = { ...context };
|
|
11
|
+
for (const [key, { required, type }] of Object.entries(propertiesConfig)) {
|
|
12
|
+
/**
|
|
13
|
+
* Ensure specified properties are strings as defined here:
|
|
14
|
+
* https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#user-related-attributes
|
|
15
|
+
*/
|
|
16
|
+
if (type === 'string' && !isDefined(newContext[key])) {
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-base-to-string */
|
|
18
|
+
newContext[key] = String(newContext[key]);
|
|
19
|
+
}
|
|
20
|
+
if (required && isDefined(newContext[key])) {
|
|
21
|
+
display_1.display.warn(`The property ${key} of ${name} is required; context will not be sent to the intake.`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return newContext;
|
|
25
|
+
}
|
|
26
|
+
function isDefined(value) {
|
|
27
|
+
return value === undefined || value === null || value === '';
|
|
28
|
+
}
|
|
29
|
+
function createContextManager(name = '', { propertiesConfig = {}, } = {}) {
|
|
30
|
+
let context = {};
|
|
31
|
+
const changeObservable = new observable_1.Observable();
|
|
32
|
+
const contextManager = {
|
|
33
|
+
getContext: () => (0, mergeInto_1.deepClone)(context),
|
|
34
|
+
setContext: (newContext) => {
|
|
35
|
+
if ((0, contextUtils_1.checkContext)(newContext)) {
|
|
36
|
+
context = (0, sanitize_1.sanitize)(ensureProperties(newContext, propertiesConfig, name));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
contextManager.clearContext();
|
|
40
|
+
}
|
|
41
|
+
changeObservable.notify();
|
|
42
|
+
},
|
|
43
|
+
setContextProperty: (key, property) => {
|
|
44
|
+
context = (0, sanitize_1.sanitize)(ensureProperties({ ...context, [key]: property }, propertiesConfig, name));
|
|
45
|
+
changeObservable.notify();
|
|
46
|
+
},
|
|
47
|
+
removeContextProperty: (key) => {
|
|
48
|
+
delete context[key];
|
|
49
|
+
ensureProperties(context, propertiesConfig, name);
|
|
50
|
+
changeObservable.notify();
|
|
51
|
+
},
|
|
52
|
+
clearContext: () => {
|
|
53
|
+
context = {};
|
|
54
|
+
changeObservable.notify();
|
|
55
|
+
},
|
|
56
|
+
changeObservable,
|
|
57
|
+
};
|
|
58
|
+
return contextManager;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=contextManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextManager.js","sourceRoot":"","sources":["../../../src/domain/context/contextManager.ts"],"names":[],"mappings":";;AA0CA,oDA0CC;AApFD,qDAAiD;AACjD,iEAA6D;AAE7D,uDAAmD;AACnD,iDAA6C;AAC7C,iDAA6C;AAW7C,SAAS,gBAAgB,CAAC,OAAgB,EAAE,gBAAkC,EAAE,IAAY;IAC1F,MAAM,UAAU,GAAG,EAAE,GAAG,OAAO,EAAE,CAAA;IAEjC,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzE;;;WAGG;QAEH,IAAI,IAAI,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACrD,yDAAyD;YACzD,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3C,CAAC;QAED,IAAI,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC3C,iBAAO,CAAC,IAAI,CAAC,gBAAgB,GAAG,OAAO,IAAI,uDAAuD,CAAC,CAAA;QACrG,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAA;AAC9D,CAAC;AAED,SAAgB,oBAAoB,CAClC,OAAe,EAAE,EACjB,EACE,gBAAgB,GAAG,EAAE,MAGnB,EAAE;IAEN,IAAI,OAAO,GAAY,EAAE,CAAA;IACzB,MAAM,gBAAgB,GAAG,IAAI,uBAAU,EAAQ,CAAA;IAE/C,MAAM,cAAc,GAAG;QACrB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC;QAEpC,UAAU,EAAE,CAAC,UAAmB,EAAE,EAAE;YAClC,IAAI,IAAA,2BAAY,EAAC,UAAU,CAAC,EAAE,CAAC;gBAC7B,OAAO,GAAG,IAAA,mBAAQ,EAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAA;YAC1E,CAAC;iBAAM,CAAC;gBACN,cAAc,CAAC,YAAY,EAAE,CAAA;YAC/B,CAAC;YACD,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,kBAAkB,EAAE,CAAC,GAAW,EAAE,QAAa,EAAE,EAAE;YACjD,OAAO,GAAG,IAAA,mBAAQ,EAAC,gBAAgB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAA;YAC7F,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,qBAAqB,EAAE,CAAC,GAAW,EAAE,EAAE;YACrC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;YACnB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAA;YACjD,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO,GAAG,EAAE,CAAA;YACZ,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,gBAAgB;KACjB,CAAA;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkContext = checkContext;
|
|
4
|
+
const display_1 = require("../../tools/display");
|
|
5
|
+
const typeUtils_1 = require("../../tools/utils/typeUtils");
|
|
6
|
+
/**
|
|
7
|
+
* Simple check to ensure an object is a valid context
|
|
8
|
+
*/
|
|
9
|
+
function checkContext(maybeContext) {
|
|
10
|
+
const isValid = (0, typeUtils_1.getType)(maybeContext) === 'object';
|
|
11
|
+
if (!isValid) {
|
|
12
|
+
display_1.display.error('Unsupported context:', maybeContext);
|
|
13
|
+
}
|
|
14
|
+
return isValid;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=contextUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextUtils.js","sourceRoot":"","sources":["../../../src/domain/context/contextUtils.ts"],"names":[],"mappings":";;AAOA,oCAMC;AAZD,iDAA6C;AAC7C,2DAAqD;AAErD;;GAEG;AACH,SAAgB,YAAY,CAAC,YAAqB;IAChD,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,YAAY,CAAC,KAAK,QAAQ,CAAA;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,iBAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RawTelemetryUsageFeature } from '../telemetry';
|
|
2
|
+
import type { BoundedBuffer } from '../../tools/boundedBuffer';
|
|
3
|
+
import type { ContextManager } from './contextManager';
|
|
4
|
+
import type { ContextManagerMethod, CustomerContextKey } from './contextConstants';
|
|
5
|
+
export declare function defineContextMethod<MethodName extends ContextManagerMethod, Key extends CustomerContextKey>(getStrategy: () => Record<Key, ContextManager>, contextName: Key, methodName: MethodName, usage?: RawTelemetryUsageFeature): ContextManager[MethodName];
|
|
6
|
+
export declare function bufferContextCalls<Key extends string, StartResult extends Record<Key, ContextManager>>(preStartContextManager: ContextManager, name: Key, bufferApiCalls: BoundedBuffer<StartResult>): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineContextMethod = defineContextMethod;
|
|
4
|
+
exports.bufferContextCalls = bufferContextCalls;
|
|
5
|
+
const telemetry_1 = require("../telemetry");
|
|
6
|
+
const monitor_1 = require("../../tools/monitor");
|
|
7
|
+
function defineContextMethod(getStrategy, contextName, methodName, usage) {
|
|
8
|
+
return (0, monitor_1.monitor)((...args) => {
|
|
9
|
+
if (usage) {
|
|
10
|
+
(0, telemetry_1.addTelemetryUsage)({ feature: usage });
|
|
11
|
+
}
|
|
12
|
+
return getStrategy()[contextName][methodName](...args);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function bufferContextCalls(preStartContextManager, name, bufferApiCalls) {
|
|
16
|
+
preStartContextManager.changeObservable.subscribe(() => {
|
|
17
|
+
const context = preStartContextManager.getContext();
|
|
18
|
+
bufferApiCalls.add((startResult) => startResult[name].setContext(context));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=defineContextMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineContextMethod.js","sourceRoot":"","sources":["../../../src/domain/context/defineContextMethod.ts"],"names":[],"mappings":";;AAOA,kDAYC;AAED,gDASC;AA7BD,4CAAgD;AAChD,iDAA6C;AAK7C,SAAgB,mBAAmB,CACjC,WAA8C,EAC9C,WAAgB,EAChB,UAAsB,EACtB,KAAgC;IAEhC,OAAO,IAAA,iBAAO,EAAC,CAAC,GAAG,IAAW,EAAE,EAAE;QAChC,IAAI,KAAK,EAAE,CAAC;YACV,IAAA,6BAAiB,EAAC,EAAE,OAAO,EAAE,KAAK,EAAuB,CAAC,CAAA;QAC5D,CAAC;QACD,OAAQ,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,UAAU,CAAqC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC7F,CAAC,CAA+B,CAAA;AAClC,CAAC;AAED,SAAgB,kBAAkB,CAChC,sBAAsC,EACtC,IAAS,EACT,cAA0C;IAE1C,sBAAsB,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,EAAE;QACrD,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,EAAE,CAAA;QACnD,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Configuration } from '../configuration';
|
|
2
|
+
import type { ContextManager } from './contextManager';
|
|
3
|
+
import type { CustomerDataType } from './contextConstants';
|
|
4
|
+
export declare function storeContextManager(configuration: Configuration, contextManager: ContextManager, productKey: string, customerDataType: CustomerDataType): void;
|
|
5
|
+
export declare function buildStorageKey(productKey: string, customerDataType: CustomerDataType): string;
|
|
6
|
+
export declare function removeStorageListeners(): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storeContextManager = storeContextManager;
|
|
4
|
+
exports.buildStorageKey = buildStorageKey;
|
|
5
|
+
exports.removeStorageListeners = removeStorageListeners;
|
|
6
|
+
const addEventListener_1 = require("../../browser/addEventListener");
|
|
7
|
+
const mergeInto_1 = require("../../tools/mergeInto");
|
|
8
|
+
const objectUtils_1 = require("../../tools/utils/objectUtils");
|
|
9
|
+
const CONTEXT_STORE_KEY_PREFIX = '_oo_c';
|
|
10
|
+
const storageListeners = [];
|
|
11
|
+
function storeContextManager(configuration, contextManager, productKey, customerDataType) {
|
|
12
|
+
const storageKey = buildStorageKey(productKey, customerDataType);
|
|
13
|
+
storageListeners.push((0, addEventListener_1.addEventListener)(configuration, window, "storage" /* DOM_EVENT.STORAGE */, ({ key }) => {
|
|
14
|
+
if (storageKey === key) {
|
|
15
|
+
synchronizeWithStorage();
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
contextManager.changeObservable.subscribe(dumpToStorage);
|
|
19
|
+
const contextFromStorage = (0, mergeInto_1.combine)(getFromStorage(), contextManager.getContext());
|
|
20
|
+
if (!(0, objectUtils_1.isEmptyObject)(contextFromStorage)) {
|
|
21
|
+
contextManager.setContext(contextFromStorage);
|
|
22
|
+
}
|
|
23
|
+
function synchronizeWithStorage() {
|
|
24
|
+
contextManager.setContext(getFromStorage());
|
|
25
|
+
}
|
|
26
|
+
function dumpToStorage() {
|
|
27
|
+
localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));
|
|
28
|
+
}
|
|
29
|
+
function getFromStorage() {
|
|
30
|
+
const rawContext = localStorage.getItem(storageKey);
|
|
31
|
+
return rawContext ? JSON.parse(rawContext) : {};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function buildStorageKey(productKey, customerDataType) {
|
|
35
|
+
return `${CONTEXT_STORE_KEY_PREFIX}_${productKey}_${customerDataType}`;
|
|
36
|
+
}
|
|
37
|
+
function removeStorageListeners() {
|
|
38
|
+
storageListeners.map((listener) => listener.stop());
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=storeContextManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeContextManager.js","sourceRoot":"","sources":["../../../src/domain/context/storeContextManager.ts"],"names":[],"mappings":";;AAYA,kDAkCC;AAED,0CAEC;AAED,wDAEC;AAtDD,qEAA4E;AAG5E,qDAA+C;AAC/C,+DAA6D;AAI7D,MAAM,wBAAwB,GAAG,OAAO,CAAA;AAExC,MAAM,gBAAgB,GAAgC,EAAE,CAAA;AAExD,SAAgB,mBAAmB,CACjC,aAA4B,EAC5B,cAA8B,EAC9B,UAAkB,EAClB,gBAAkC;IAElC,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;IAEhE,gBAAgB,CAAC,IAAI,CACnB,IAAA,mCAAgB,EAAC,aAAa,EAAE,MAAM,qCAAqB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;QACrE,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,sBAAsB,EAAE,CAAA;QAC1B,CAAC;IACH,CAAC,CAAC,CACH,CAAA;IACD,cAAc,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAExD,MAAM,kBAAkB,GAAG,IAAA,mBAAO,EAAC,cAAc,EAAE,EAAE,cAAc,CAAC,UAAU,EAAE,CAAC,CAAA;IACjF,IAAI,CAAC,IAAA,2BAAa,EAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,cAAc,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAA;IAC/C,CAAC;IAED,SAAS,sBAAsB;QAC7B,cAAc,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,SAAS,aAAa;QACpB,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;IAC/E,CAAC;IAED,SAAS,cAAc;QACrB,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACnD,OAAO,UAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAa,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9D,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,UAAkB,EAAE,gBAAkC;IACpF,OAAO,GAAG,wBAAwB,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAAA;AACxE,CAAC;AAED,SAAgB,sBAAsB;IACpC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;AACrD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Configuration } from '../configuration';
|
|
2
|
+
import type { AbstractHooks } from '../../tools/abstractHooks';
|
|
3
|
+
/**
|
|
4
|
+
* Account information for the browser SDK.
|
|
5
|
+
*/
|
|
6
|
+
export interface Account {
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare function startAccountContext(hooks: AbstractHooks, configuration: Configuration, productKey: string): {
|
|
12
|
+
getContext: () => import("../..").Context;
|
|
13
|
+
setContext: (newContext: unknown) => void;
|
|
14
|
+
setContextProperty: (key: string, property: any) => void;
|
|
15
|
+
removeContextProperty: (key: string) => void;
|
|
16
|
+
clearContext: () => void;
|
|
17
|
+
changeObservable: import("../..").Observable<void>;
|
|
18
|
+
};
|
|
19
|
+
export declare function buildAccountContextManager(): {
|
|
20
|
+
getContext: () => import("../..").Context;
|
|
21
|
+
setContext: (newContext: unknown) => void;
|
|
22
|
+
setContextProperty: (key: string, property: any) => void;
|
|
23
|
+
removeContextProperty: (key: string) => void;
|
|
24
|
+
clearContext: () => void;
|
|
25
|
+
changeObservable: import("../..").Observable<void>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startAccountContext = startAccountContext;
|
|
4
|
+
exports.buildAccountContextManager = buildAccountContextManager;
|
|
5
|
+
const storeContextManager_1 = require("../context/storeContextManager");
|
|
6
|
+
const abstractHooks_1 = require("../../tools/abstractHooks");
|
|
7
|
+
const objectUtils_1 = require("../../tools/utils/objectUtils");
|
|
8
|
+
const contextManager_1 = require("../context/contextManager");
|
|
9
|
+
function startAccountContext(hooks, configuration, productKey) {
|
|
10
|
+
const accountContextManager = buildAccountContextManager();
|
|
11
|
+
if (configuration.storeContextsAcrossPages) {
|
|
12
|
+
(0, storeContextManager_1.storeContextManager)(configuration, accountContextManager, productKey, 4 /* CustomerDataType.Account */);
|
|
13
|
+
}
|
|
14
|
+
hooks.register(0 /* HookNames.Assemble */, () => {
|
|
15
|
+
const account = accountContextManager.getContext();
|
|
16
|
+
if ((0, objectUtils_1.isEmptyObject)(account) || !account.id) {
|
|
17
|
+
return abstractHooks_1.SKIPPED;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
account,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return accountContextManager;
|
|
24
|
+
}
|
|
25
|
+
function buildAccountContextManager() {
|
|
26
|
+
return (0, contextManager_1.createContextManager)('account', {
|
|
27
|
+
propertiesConfig: {
|
|
28
|
+
id: { type: 'string', required: true },
|
|
29
|
+
name: { type: 'string' },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=accountContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/accountContext.ts"],"names":[],"mappings":";;AAiBA,kDAoBC;AAED,gEAOC;AA5CD,wEAAoE;AACpE,6DAA8D;AAE9D,+DAA6D;AAC7D,8DAAgE;AAWhE,SAAgB,mBAAmB,CAAC,KAAoB,EAAE,aAA4B,EAAE,UAAkB;IACxG,MAAM,qBAAqB,GAAG,0BAA0B,EAAE,CAAA;IAE1D,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,mCAA2B,CAAA;IACjG,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,qBAAqB,CAAC,UAAU,EAAa,CAAA;QAE7D,IAAI,IAAA,2BAAa,EAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAC1C,OAAO,uBAAO,CAAA;QAChB,CAAC;QAED,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,qBAAqB,CAAA;AAC9B,CAAC;AAED,SAAgB,0BAA0B;IACxC,OAAO,IAAA,qCAAoB,EAAC,SAAS,EAAE;QACrC,gBAAgB,EAAE;YAChB,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACtC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACzB;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AbstractHooks } from '../../tools/abstractHooks';
|
|
2
|
+
import type { Configuration } from '../configuration';
|
|
3
|
+
export declare function startGlobalContext(hooks: AbstractHooks, configuration: Configuration, productKey: string, useContextNamespace: boolean): {
|
|
4
|
+
getContext: () => import("../..").Context;
|
|
5
|
+
setContext: (newContext: unknown) => void;
|
|
6
|
+
setContextProperty: (key: string, property: any) => void;
|
|
7
|
+
removeContextProperty: (key: string) => void;
|
|
8
|
+
clearContext: () => void;
|
|
9
|
+
changeObservable: import("../..").Observable<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare function buildGlobalContextManager(): {
|
|
12
|
+
getContext: () => import("../..").Context;
|
|
13
|
+
setContext: (newContext: unknown) => void;
|
|
14
|
+
setContextProperty: (key: string, property: any) => void;
|
|
15
|
+
removeContextProperty: (key: string) => void;
|
|
16
|
+
clearContext: () => void;
|
|
17
|
+
changeObservable: import("../..").Observable<void>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startGlobalContext = startGlobalContext;
|
|
4
|
+
exports.buildGlobalContextManager = buildGlobalContextManager;
|
|
5
|
+
const storeContextManager_1 = require("../context/storeContextManager");
|
|
6
|
+
const contextManager_1 = require("../context/contextManager");
|
|
7
|
+
function startGlobalContext(hooks, configuration, productKey, useContextNamespace) {
|
|
8
|
+
const globalContextManager = buildGlobalContextManager();
|
|
9
|
+
if (configuration.storeContextsAcrossPages) {
|
|
10
|
+
(0, storeContextManager_1.storeContextManager)(configuration, globalContextManager, productKey, 2 /* CustomerDataType.GlobalContext */);
|
|
11
|
+
}
|
|
12
|
+
hooks.register(0 /* HookNames.Assemble */, () => {
|
|
13
|
+
const context = globalContextManager.getContext();
|
|
14
|
+
return useContextNamespace ? { context } : context;
|
|
15
|
+
});
|
|
16
|
+
return globalContextManager;
|
|
17
|
+
}
|
|
18
|
+
function buildGlobalContextManager() {
|
|
19
|
+
return (0, contextManager_1.createContextManager)('global context');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=globalContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/globalContext.ts"],"names":[],"mappings":";;AAOA,gDAkBC;AAED,8DAEC;AA3BD,wEAAoE;AAEpE,8DAAgE;AAGhE,SAAgB,kBAAkB,CAChC,KAAoB,EACpB,aAA4B,EAC5B,UAAkB,EAClB,mBAA4B;IAE5B,MAAM,oBAAoB,GAAG,yBAAyB,EAAE,CAAA;IAExD,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,oBAAoB,EAAE,UAAU,yCAAiC,CAAA;IACtG,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,CAAA;QACjD,OAAO,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAA;IACpD,CAAC,CAAC,CAAA;IAEF,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,SAAgB,yBAAyB;IACvC,OAAO,IAAA,qCAAoB,EAAC,gBAAgB,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Context } from '../../tools/serialisation/context';
|
|
2
|
+
export interface RumInternalContext extends Context {
|
|
3
|
+
application_id: string;
|
|
4
|
+
session_id: string | undefined;
|
|
5
|
+
view?: {
|
|
6
|
+
id: string;
|
|
7
|
+
url: string;
|
|
8
|
+
referrer: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
};
|
|
11
|
+
user_action?: {
|
|
12
|
+
id: string | string[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rumInternalContext.type.js","sourceRoot":"","sources":["../../../src/domain/contexts/rumInternalContext.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AbstractHooks } from '../../tools/abstractHooks';
|
|
2
|
+
import type { Configuration } from '../configuration';
|
|
3
|
+
import type { RelativeTime } from '../../tools/utils/timeUtils';
|
|
4
|
+
export interface User {
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
email?: string | undefined;
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export declare function startUserContext(hooks: AbstractHooks, configuration: Configuration, sessionManager: {
|
|
11
|
+
findTrackedSession: (startTime?: RelativeTime) => {
|
|
12
|
+
anonymousId?: string;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}, productKey: string): {
|
|
15
|
+
getContext: () => import("../..").Context;
|
|
16
|
+
setContext: (newContext: unknown) => void;
|
|
17
|
+
setContextProperty: (key: string, property: any) => void;
|
|
18
|
+
removeContextProperty: (key: string) => void;
|
|
19
|
+
clearContext: () => void;
|
|
20
|
+
changeObservable: import("../..").Observable<void>;
|
|
21
|
+
};
|
|
22
|
+
export declare function buildUserContextManager(): {
|
|
23
|
+
getContext: () => import("../..").Context;
|
|
24
|
+
setContext: (newContext: unknown) => void;
|
|
25
|
+
setContextProperty: (key: string, property: any) => void;
|
|
26
|
+
removeContextProperty: (key: string) => void;
|
|
27
|
+
clearContext: () => void;
|
|
28
|
+
changeObservable: import("../..").Observable<void>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startUserContext = startUserContext;
|
|
4
|
+
exports.buildUserContextManager = buildUserContextManager;
|
|
5
|
+
const storeContextManager_1 = require("../context/storeContextManager");
|
|
6
|
+
const abstractHooks_1 = require("../../tools/abstractHooks");
|
|
7
|
+
const contextManager_1 = require("../context/contextManager");
|
|
8
|
+
const objectUtils_1 = require("../../tools/utils/objectUtils");
|
|
9
|
+
function startUserContext(hooks, configuration, sessionManager, productKey) {
|
|
10
|
+
const userContextManager = buildUserContextManager();
|
|
11
|
+
if (configuration.storeContextsAcrossPages) {
|
|
12
|
+
(0, storeContextManager_1.storeContextManager)(configuration, userContextManager, productKey, 1 /* CustomerDataType.User */);
|
|
13
|
+
}
|
|
14
|
+
hooks.register(0 /* HookNames.Assemble */, ({ eventType, startTime }) => {
|
|
15
|
+
const user = userContextManager.getContext();
|
|
16
|
+
const session = sessionManager.findTrackedSession(startTime);
|
|
17
|
+
if (session && session.anonymousId && !user.anonymous_id && !!configuration.trackAnonymousUser) {
|
|
18
|
+
user.anonymous_id = session.anonymousId;
|
|
19
|
+
}
|
|
20
|
+
if ((0, objectUtils_1.isEmptyObject)(user)) {
|
|
21
|
+
return abstractHooks_1.SKIPPED;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: eventType,
|
|
25
|
+
usr: user,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
hooks.register(1 /* HookNames.AssembleTelemetry */, ({ startTime }) => {
|
|
29
|
+
var _a;
|
|
30
|
+
return ({
|
|
31
|
+
anonymous_id: (_a = sessionManager.findTrackedSession(startTime)) === null || _a === void 0 ? void 0 : _a.anonymousId,
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
return userContextManager;
|
|
35
|
+
}
|
|
36
|
+
function buildUserContextManager() {
|
|
37
|
+
return (0, contextManager_1.createContextManager)('user', {
|
|
38
|
+
propertiesConfig: {
|
|
39
|
+
id: { type: 'string' },
|
|
40
|
+
name: { type: 'string' },
|
|
41
|
+
email: { type: 'string' },
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=userContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/userContext.ts"],"names":[],"mappings":";;AAgBA,4CAqCC;AAED,0DAQC;AA7DD,wEAAoE;AACpE,6DAA8D;AAC9D,8DAAgE;AAEhE,+DAA6D;AAU7D,SAAgB,gBAAgB,CAC9B,KAAoB,EACpB,aAA4B,EAC5B,cAEC,EACD,UAAkB;IAElB,MAAM,kBAAkB,GAAG,uBAAuB,EAAE,CAAA;IAEpD,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,kBAAkB,EAAE,UAAU,gCAAwB,CAAA;IAC3F,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;QAC9D,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,EAAE,CAAA;QAC5C,MAAM,OAAO,GAAG,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAE5D,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;YAC/F,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAA;QACzC,CAAC;QAED,IAAI,IAAA,2BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,uBAAO,CAAA;QAChB,CAAC;QAED,OAAO;YACL,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,IAAI;SACV,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,QAAQ,sCAA8B,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;;QAAC,OAAA,CAAC;YAC9D,YAAY,EAAE,MAAA,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,0CAAE,WAAW;SACxE,CAAC,CAAA;KAAA,CAAC,CAAA;IAEH,OAAO,kBAAkB,CAAA;AAC3B,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO,IAAA,qCAAoB,EAAC,MAAM,EAAE;QAClC,gBAAgB,EAAE;YAChB,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Encoder } from '../../tools/encoder';
|
|
2
|
+
import type { Uint8ArrayBuffer } from '../../tools/utils/byteUtils';
|
|
3
|
+
export type DeflateWorkerAction = {
|
|
4
|
+
action: 'init';
|
|
5
|
+
} | {
|
|
6
|
+
action: 'write';
|
|
7
|
+
id: number;
|
|
8
|
+
streamId: number;
|
|
9
|
+
data: string;
|
|
10
|
+
} | {
|
|
11
|
+
action: 'reset';
|
|
12
|
+
streamId: number;
|
|
13
|
+
};
|
|
14
|
+
export type DeflateWorkerResponse = {
|
|
15
|
+
type: 'initialized';
|
|
16
|
+
version: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'wrote';
|
|
19
|
+
id: number;
|
|
20
|
+
streamId: number;
|
|
21
|
+
result: Uint8ArrayBuffer;
|
|
22
|
+
trailer: Uint8ArrayBuffer;
|
|
23
|
+
additionalBytesCount: number;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'errored';
|
|
26
|
+
streamId?: number;
|
|
27
|
+
error: Error | string;
|
|
28
|
+
};
|
|
29
|
+
export interface DeflateWorker extends Worker {
|
|
30
|
+
postMessage(message: DeflateWorkerAction): void;
|
|
31
|
+
}
|
|
32
|
+
export type DeflateEncoder = Encoder<Uint8ArrayBuffer> & {
|
|
33
|
+
stop: () => void;
|
|
34
|
+
};
|
|
35
|
+
export declare const enum DeflateEncoderStreamId {
|
|
36
|
+
REPLAY = 1,
|
|
37
|
+
RUM = 2,
|
|
38
|
+
TELEMETRY = 4,
|
|
39
|
+
PROFILING = 6
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deflate.types.js","sourceRoot":"","sources":["../../../src/domain/deflate/deflate.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './deflate.types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./deflate.types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/deflate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ClocksState } from '../../tools/utils/timeUtils';
|
|
2
|
+
import type { Context } from '../../tools/serialisation/context';
|
|
3
|
+
import type { StackTrace } from '../../tools/stackTrace/computeStackTrace';
|
|
4
|
+
import type { ErrorSource, ErrorHandling, RawError, RawErrorCause, ErrorWithCause, NonErrorPrefix } from './error.types';
|
|
5
|
+
export declare const NO_ERROR_STACK_PRESENT_MESSAGE = "No stack, consider using an instance of Error";
|
|
6
|
+
interface RawErrorParams {
|
|
7
|
+
stackTrace?: StackTrace;
|
|
8
|
+
originalError: unknown;
|
|
9
|
+
handlingStack?: string;
|
|
10
|
+
componentStack?: string;
|
|
11
|
+
startClocks: ClocksState;
|
|
12
|
+
nonErrorPrefix: NonErrorPrefix;
|
|
13
|
+
useFallbackStack?: boolean;
|
|
14
|
+
source: ErrorSource;
|
|
15
|
+
handling: ErrorHandling;
|
|
16
|
+
}
|
|
17
|
+
export declare function computeRawError({ stackTrace, originalError, handlingStack, componentStack, startClocks, nonErrorPrefix, useFallbackStack, source, handling, }: RawErrorParams): RawError;
|
|
18
|
+
export declare function tryToGetFingerprint(originalError: unknown): string | undefined;
|
|
19
|
+
export declare function tryToGetErrorContext(originalError: unknown): Context | undefined;
|
|
20
|
+
export declare function getFileFromStackTraceString(stack: string): string | undefined;
|
|
21
|
+
export declare function isError(error: unknown): error is Error;
|
|
22
|
+
export declare function flattenErrorCauses(error: ErrorWithCause, parentSource: ErrorSource): RawErrorCause[] | undefined;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NO_ERROR_STACK_PRESENT_MESSAGE = void 0;
|
|
4
|
+
exports.computeRawError = computeRawError;
|
|
5
|
+
exports.tryToGetFingerprint = tryToGetFingerprint;
|
|
6
|
+
exports.tryToGetErrorContext = tryToGetErrorContext;
|
|
7
|
+
exports.getFileFromStackTraceString = getFileFromStackTraceString;
|
|
8
|
+
exports.isError = isError;
|
|
9
|
+
exports.flattenErrorCauses = flattenErrorCauses;
|
|
10
|
+
const sanitize_1 = require("../../tools/serialisation/sanitize");
|
|
11
|
+
const jsonStringify_1 = require("../../tools/serialisation/jsonStringify");
|
|
12
|
+
const computeStackTrace_1 = require("../../tools/stackTrace/computeStackTrace");
|
|
13
|
+
const handlingStack_1 = require("../../tools/stackTrace/handlingStack");
|
|
14
|
+
exports.NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';
|
|
15
|
+
function computeRawError({ stackTrace, originalError, handlingStack, componentStack, startClocks, nonErrorPrefix, useFallbackStack = true, source, handling, }) {
|
|
16
|
+
const isErrorInstance = isError(originalError);
|
|
17
|
+
if (!stackTrace && isErrorInstance) {
|
|
18
|
+
stackTrace = (0, computeStackTrace_1.computeStackTrace)(originalError);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
startClocks,
|
|
22
|
+
source,
|
|
23
|
+
handling,
|
|
24
|
+
handlingStack,
|
|
25
|
+
componentStack,
|
|
26
|
+
originalError,
|
|
27
|
+
type: stackTrace ? stackTrace.name : undefined,
|
|
28
|
+
message: computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError),
|
|
29
|
+
stack: stackTrace ? (0, handlingStack_1.toStackTraceString)(stackTrace) : useFallbackStack ? exports.NO_ERROR_STACK_PRESENT_MESSAGE : undefined,
|
|
30
|
+
causes: isErrorInstance ? flattenErrorCauses(originalError, source) : undefined,
|
|
31
|
+
fingerprint: tryToGetFingerprint(originalError),
|
|
32
|
+
context: tryToGetErrorContext(originalError),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {
|
|
36
|
+
// Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)
|
|
37
|
+
// TODO rework tracekit integration to avoid scattering error building logic
|
|
38
|
+
return (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.message) && (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name)
|
|
39
|
+
? stackTrace.message
|
|
40
|
+
: !isErrorInstance
|
|
41
|
+
? `${nonErrorPrefix} ${(0, jsonStringify_1.jsonStringify)((0, sanitize_1.sanitize)(originalError))}`
|
|
42
|
+
: 'Empty message';
|
|
43
|
+
}
|
|
44
|
+
function tryToGetFingerprint(originalError) {
|
|
45
|
+
return isError(originalError) && 'oo_fingerprint' in originalError ? String(originalError.oo_fingerprint) : undefined;
|
|
46
|
+
}
|
|
47
|
+
function tryToGetErrorContext(originalError) {
|
|
48
|
+
if (originalError !== null && typeof originalError === 'object' && 'dd_context' in originalError) {
|
|
49
|
+
return originalError.dd_context;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function getFileFromStackTraceString(stack) {
|
|
53
|
+
var _a;
|
|
54
|
+
return (_a = /@ (.+)/.exec(stack)) === null || _a === void 0 ? void 0 : _a[1];
|
|
55
|
+
}
|
|
56
|
+
function isError(error) {
|
|
57
|
+
return error instanceof Error || Object.prototype.toString.call(error) === '[object Error]';
|
|
58
|
+
}
|
|
59
|
+
function flattenErrorCauses(error, parentSource) {
|
|
60
|
+
let currentError = error;
|
|
61
|
+
const causes = [];
|
|
62
|
+
while (isError(currentError === null || currentError === void 0 ? void 0 : currentError.cause) && causes.length < 10) {
|
|
63
|
+
const stackTrace = (0, computeStackTrace_1.computeStackTrace)(currentError.cause);
|
|
64
|
+
causes.push({
|
|
65
|
+
message: currentError.cause.message,
|
|
66
|
+
source: parentSource,
|
|
67
|
+
type: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name,
|
|
68
|
+
stack: stackTrace && (0, handlingStack_1.toStackTraceString)(stackTrace),
|
|
69
|
+
});
|
|
70
|
+
currentError = currentError.cause;
|
|
71
|
+
}
|
|
72
|
+
return causes.length ? causes : undefined;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/domain/error/error.ts"],"names":[],"mappings":";;;AAuBA,0CA8BC;AAiBD,kDAEC;AAED,oDAIC;AAED,kEAEC;AAED,0BAEC;AAED,gDAcC;AAtGD,iEAA6D;AAG7D,2EAAuE;AAEvE,gFAA4E;AAC5E,wEAAyE;AAG5D,QAAA,8BAA8B,GAAG,+CAA+C,CAAA;AAc7F,SAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,GAAG,IAAI,EACvB,MAAM,EACN,QAAQ,GACO;IACf,MAAM,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC9C,IAAI,CAAC,UAAU,IAAI,eAAe,EAAE,CAAC;QACnC,UAAU,GAAG,IAAA,qCAAiB,EAAC,aAAa,CAAC,CAAA;IAC/C,CAAC;IAED,OAAO;QACL,WAAW;QACX,MAAM;QACN,QAAQ;QACR,aAAa;QACb,cAAc;QACd,aAAa;QACb,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC9C,OAAO,EAAE,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC;QACnF,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,IAAA,kCAAkB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,sCAA8B,CAAC,CAAC,CAAC,SAAS;QAClH,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC,aAA+B,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QACjG,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC;QAC/C,OAAO,EAAE,oBAAoB,CAAC,aAAa,CAAC;KAC7C,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CACrB,UAAkC,EAClC,eAAwB,EACxB,cAA8B,EAC9B,aAAsB;IAEtB,kHAAkH;IAClH,4EAA4E;IAC5E,OAAO,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,MAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAA;QAC5C,CAAC,CAAC,UAAU,CAAC,OAAO;QACpB,CAAC,CAAC,CAAC,eAAe;YAChB,CAAC,CAAC,GAAG,cAAc,IAAI,IAAA,6BAAa,EAAC,IAAA,mBAAQ,EAAC,aAAa,CAAC,CAAE,EAAE;YAChE,CAAC,CAAC,eAAe,CAAA;AACvB,CAAC;AAED,SAAgB,mBAAmB,CAAC,aAAsB;IACxD,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,gBAAgB,IAAI,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACvH,CAAC;AAED,SAAgB,oBAAoB,CAAC,aAAsB;IACzD,IAAI,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,YAAY,IAAI,aAAa,EAAE,CAAC;QACjG,OAAO,aAAa,CAAC,UAAqB,CAAA;IAC5C,CAAC;AACH,CAAC;AAED,SAAgB,2BAA2B,CAAC,KAAa;;IACvD,OAAO,MAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,0CAAG,CAAC,CAAC,CAAA;AAClC,CAAC;AAED,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,gBAAgB,CAAA;AAC7F,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAqB,EAAE,YAAyB;IACjF,IAAI,YAAY,GAAG,KAAK,CAAA;IACxB,MAAM,MAAM,GAAoB,EAAE,CAAA;IAClC,OAAO,OAAO,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC1D,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QACxD,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,OAAO;YACnC,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI;YACtB,KAAK,EAAE,UAAU,IAAI,IAAA,kCAAkB,EAAC,UAAU,CAAC;SACpD,CAAC,CAAA;QACF,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;IACnC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Context } from '../../tools/serialisation/context';
|
|
2
|
+
import type { ClocksState } from '../../tools/utils/timeUtils';
|
|
3
|
+
export interface ErrorWithCause extends Omit<Error, 'cause'> {
|
|
4
|
+
cause?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface RawErrorCause {
|
|
7
|
+
message: string;
|
|
8
|
+
source: ErrorSource;
|
|
9
|
+
type?: string;
|
|
10
|
+
stack?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Csp {
|
|
13
|
+
disposition: 'enforce' | 'report';
|
|
14
|
+
}
|
|
15
|
+
export interface RawError {
|
|
16
|
+
startClocks: ClocksState;
|
|
17
|
+
message: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
stack?: string;
|
|
20
|
+
source: ErrorSource;
|
|
21
|
+
originalError?: unknown;
|
|
22
|
+
handling?: ErrorHandling;
|
|
23
|
+
handlingStack?: string;
|
|
24
|
+
componentStack?: string;
|
|
25
|
+
causes?: RawErrorCause[];
|
|
26
|
+
fingerprint?: string;
|
|
27
|
+
csp?: Csp;
|
|
28
|
+
context?: Context;
|
|
29
|
+
}
|
|
30
|
+
export declare const ErrorSource: {
|
|
31
|
+
readonly AGENT: "agent";
|
|
32
|
+
readonly CONSOLE: "console";
|
|
33
|
+
readonly CUSTOM: "custom";
|
|
34
|
+
readonly LOGGER: "logger";
|
|
35
|
+
readonly NETWORK: "network";
|
|
36
|
+
readonly SOURCE: "source";
|
|
37
|
+
readonly REPORT: "report";
|
|
38
|
+
};
|
|
39
|
+
export declare const enum NonErrorPrefix {
|
|
40
|
+
UNCAUGHT = "Uncaught",
|
|
41
|
+
PROVIDED = "Provided"
|
|
42
|
+
}
|
|
43
|
+
export declare const enum ErrorHandling {
|
|
44
|
+
HANDLED = "handled",
|
|
45
|
+
UNHANDLED = "unhandled"
|
|
46
|
+
}
|
|
47
|
+
export type ErrorSource = (typeof ErrorSource)[keyof typeof ErrorSource];
|