@openobserve/browser-core 0.2.8
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/LICENSE +201 -0
- package/README.md +3 -0
- package/cjs/boot/init.d.ts +5 -0
- package/cjs/boot/init.js +36 -0
- package/cjs/boot/init.js.map +1 -0
- package/cjs/browser/addEventListener.d.ts +76 -0
- package/cjs/browser/addEventListener.js +52 -0
- package/cjs/browser/addEventListener.js.map +1 -0
- package/cjs/browser/cookie.d.ts +10 -0
- package/cjs/browser/cookie.js +69 -0
- package/cjs/browser/cookie.js.map +1 -0
- package/cjs/browser/fetchObservable.d.ts +23 -0
- package/cjs/browser/fetchObservable.js +74 -0
- package/cjs/browser/fetchObservable.js.map +1 -0
- package/cjs/browser/pageExitObservable.d.ts +14 -0
- package/cjs/browser/pageExitObservable.js +58 -0
- package/cjs/browser/pageExitObservable.js.map +1 -0
- package/cjs/browser/runOnReadyState.d.ts +2 -0
- package/cjs/browser/runOnReadyState.js +15 -0
- package/cjs/browser/runOnReadyState.js.map +1 -0
- package/cjs/browser/types.d.ts +19 -0
- package/cjs/browser/types.js +6 -0
- package/cjs/browser/types.js.map +1 -0
- package/cjs/browser/xhrObservable.d.ts +22 -0
- package/cjs/browser/xhrObservable.js +93 -0
- package/cjs/browser/xhrObservable.js.map +1 -0
- package/cjs/domain/configuration/configuration.d.ts +67 -0
- package/cjs/domain/configuration/configuration.js +95 -0
- package/cjs/domain/configuration/configuration.js.map +1 -0
- package/cjs/domain/configuration/endpointBuilder.d.ts +14 -0
- package/cjs/domain/configuration/endpointBuilder.js +94 -0
- package/cjs/domain/configuration/endpointBuilder.js.map +1 -0
- package/cjs/domain/configuration/index.d.ts +3 -0
- package/cjs/domain/configuration/index.js +25 -0
- package/cjs/domain/configuration/index.js.map +1 -0
- package/cjs/domain/configuration/intakeSites.d.ts +5 -0
- package/cjs/domain/configuration/intakeSites.js +9 -0
- package/cjs/domain/configuration/intakeSites.js.map +1 -0
- package/cjs/domain/configuration/tags.d.ts +4 -0
- package/cjs/domain/configuration/tags.js +39 -0
- package/cjs/domain/configuration/tags.js.map +1 -0
- package/cjs/domain/configuration/transportConfiguration.d.ts +16 -0
- package/cjs/domain/configuration/transportConfiguration.js +42 -0
- package/cjs/domain/configuration/transportConfiguration.js.map +1 -0
- package/cjs/domain/console/consoleObservable.d.ts +11 -0
- package/cjs/domain/console/consoleObservable.js +75 -0
- package/cjs/domain/console/consoleObservable.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/deflate/types.d.ts +26 -0
- package/cjs/domain/deflate/types.js +3 -0
- package/cjs/domain/deflate/types.js.map +1 -0
- package/cjs/domain/error/error.d.ts +28 -0
- package/cjs/domain/error/error.js +131 -0
- package/cjs/domain/error/error.js.map +1 -0
- package/cjs/domain/error/error.types.d.ts +40 -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 +5 -0
- package/cjs/domain/error/trackRuntimeError.js +21 -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 +40 -0
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
- package/cjs/domain/report/browser.types.d.ts +24 -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 +15 -0
- package/cjs/domain/report/reportObservable.js +94 -0
- package/cjs/domain/report/reportObservable.js.map +1 -0
- package/cjs/domain/resourceUtils.d.ts +16 -0
- package/cjs/domain/resourceUtils.js +3 -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 +2 -0
- package/cjs/domain/session/sessionConstants.js +7 -0
- package/cjs/domain/session/sessionConstants.js.map +1 -0
- package/cjs/domain/session/sessionManager.d.ts +20 -0
- package/cjs/domain/session/sessionManager.js +65 -0
- package/cjs/domain/session/sessionManager.js.map +1 -0
- package/cjs/domain/session/sessionState.d.ts +11 -0
- package/cjs/domain/session/sessionState.js +45 -0
- package/cjs/domain/session/sessionState.js.map +1 -0
- package/cjs/domain/session/sessionStore.d.ts +34 -0
- package/cjs/domain/session/sessionStore.js +144 -0
- package/cjs/domain/session/sessionStore.js.map +1 -0
- package/cjs/domain/session/sessionStoreOperations.d.ts +15 -0
- package/cjs/domain/session/sessionStoreOperations.js +104 -0
- package/cjs/domain/session/sessionStoreOperations.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +6 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.js +48 -0
- package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +3 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +40 -0
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +14 -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 +11 -0
- package/cjs/domain/synthetics/syntheticsWorkerValues.js +22 -0
- package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
- package/cjs/domain/telemetry/index.d.ts +3 -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 +11 -0
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js +8 -0
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
- package/cjs/domain/telemetry/telemetry.d.ts +112 -0
- package/cjs/domain/telemetry/telemetry.js +146 -0
- package/cjs/domain/telemetry/telemetry.js.map +1 -0
- package/cjs/domain/telemetry/telemetryEvent.types.d.ts +375 -0
- package/cjs/domain/telemetry/telemetryEvent.types.js +7 -0
- package/cjs/domain/telemetry/telemetryEvent.types.js.map +1 -0
- package/cjs/domain/tracekit/computeStackTrace.d.ts +5 -0
- package/cjs/domain/tracekit/computeStackTrace.js +118 -0
- package/cjs/domain/tracekit/computeStackTrace.js.map +1 -0
- package/cjs/domain/tracekit/index.d.ts +3 -0
- package/cjs/domain/tracekit/index.js +8 -0
- package/cjs/domain/tracekit/index.js.map +1 -0
- package/cjs/domain/tracekit/tracekit.d.ts +35 -0
- package/cjs/domain/tracekit/tracekit.js +95 -0
- package/cjs/domain/tracekit/tracekit.js.map +1 -0
- package/cjs/domain/tracekit/types.d.ts +44 -0
- package/cjs/domain/tracekit/types.js +3 -0
- package/cjs/domain/tracekit/types.js.map +1 -0
- package/cjs/domain/user/index.d.ts +2 -0
- package/cjs/domain/user/index.js +19 -0
- package/cjs/domain/user/index.js.map +1 -0
- package/cjs/domain/user/user.d.ts +12 -0
- package/cjs/domain/user/user.js +35 -0
- package/cjs/domain/user/user.js.map +1 -0
- package/cjs/domain/user/user.types.d.ts +6 -0
- package/cjs/domain/user/user.types.js +3 -0
- package/cjs/domain/user/user.types.js.map +1 -0
- package/cjs/index.d.ts +63 -0
- package/cjs/index.js +155 -0
- package/cjs/index.js.map +1 -0
- package/cjs/tools/abstractLifeCycle.d.ts +23 -0
- package/cjs/tools/abstractLifeCycle.js +29 -0
- package/cjs/tools/abstractLifeCycle.js.map +1 -0
- package/cjs/tools/boundedBuffer.d.ts +5 -0
- package/cjs/tools/boundedBuffer.js +22 -0
- package/cjs/tools/boundedBuffer.js.map +1 -0
- package/cjs/tools/catchUserErrors.d.ts +1 -0
- package/cjs/tools/catchUserErrors.js +20 -0
- package/cjs/tools/catchUserErrors.js.map +1 -0
- package/cjs/tools/display.d.ts +35 -0
- package/cjs/tools/display.js +45 -0
- package/cjs/tools/display.js.map +1 -0
- package/cjs/tools/experimentalFeatures.d.ts +24 -0
- package/cjs/tools/experimentalFeatures.js +47 -0
- package/cjs/tools/experimentalFeatures.js.map +1 -0
- package/cjs/tools/getGlobalObject.d.ts +4 -0
- package/cjs/tools/getGlobalObject.js +37 -0
- package/cjs/tools/getGlobalObject.js.map +1 -0
- package/cjs/tools/getZoneJsOriginalValue.d.ts +19 -0
- package/cjs/tools/getZoneJsOriginalValue.js +30 -0
- package/cjs/tools/getZoneJsOriginalValue.js.map +1 -0
- package/cjs/tools/instrumentMethod.d.ts +19 -0
- package/cjs/tools/instrumentMethod.js +83 -0
- package/cjs/tools/instrumentMethod.js.map +1 -0
- package/cjs/tools/matchOption.d.ts +8 -0
- package/cjs/tools/matchOption.js +38 -0
- package/cjs/tools/matchOption.js.map +1 -0
- package/cjs/tools/mergeInto.d.ts +25 -0
- package/cjs/tools/mergeInto.js +105 -0
- package/cjs/tools/mergeInto.js.map +1 -0
- package/cjs/tools/monitor.d.ts +9 -0
- package/cjs/tools/monitor.js +76 -0
- package/cjs/tools/monitor.js.map +1 -0
- package/cjs/tools/observable.d.ts +12 -0
- package/cjs/tools/observable.js +44 -0
- package/cjs/tools/observable.js.map +1 -0
- package/cjs/tools/readBytesFromStream.d.ts +11 -0
- package/cjs/tools/readBytesFromStream.js +64 -0
- package/cjs/tools/readBytesFromStream.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 +6 -0
- package/cjs/tools/serialisation/context.js +3 -0
- package/cjs/tools/serialisation/context.js.map +1 -0
- package/cjs/tools/serialisation/contextManager.d.ts +21 -0
- package/cjs/tools/serialisation/contextManager.js +70 -0
- package/cjs/tools/serialisation/contextManager.js.map +1 -0
- package/cjs/tools/serialisation/heavyCustomerDataWarning.d.ts +8 -0
- package/cjs/tools/serialisation/heavyCustomerDataWarning.js +18 -0
- package/cjs/tools/serialisation/heavyCustomerDataWarning.js.map +1 -0
- package/cjs/tools/serialisation/jsonStringify.d.ts +14 -0
- package/cjs/tools/serialisation/jsonStringify.js +49 -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 +185 -0
- package/cjs/tools/serialisation/sanitize.js.map +1 -0
- package/cjs/tools/timer.d.ts +5 -0
- package/cjs/tools/timer.js +23 -0
- package/cjs/tools/timer.js.map +1 -0
- package/cjs/tools/utils/arrayUtils.d.ts +1 -0
- package/cjs/tools/utils/arrayUtils.js +11 -0
- package/cjs/tools/utils/arrayUtils.js.map +1 -0
- package/cjs/tools/utils/browserDetection.d.ts +2 -0
- package/cjs/tools/utils/browserDetection.js +12 -0
- package/cjs/tools/utils/browserDetection.js.map +1 -0
- package/cjs/tools/utils/byteUtils.d.ts +4 -0
- package/cjs/tools/utils/byteUtils.js +31 -0
- package/cjs/tools/utils/byteUtils.js.map +1 -0
- package/cjs/tools/utils/functionUtils.d.ts +9 -0
- package/cjs/tools/utils/functionUtils.js +48 -0
- package/cjs/tools/utils/functionUtils.js.map +1 -0
- package/cjs/tools/utils/numberUtils.d.ts +8 -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 +26 -0
- package/cjs/tools/utils/objectUtils.js.map +1 -0
- package/cjs/tools/utils/polyfills.d.ts +24 -0
- package/cjs/tools/utils/polyfills.js +110 -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 +18 -0
- package/cjs/tools/utils/responseUtils.js.map +1 -0
- package/cjs/tools/utils/stringUtils.d.ts +7 -0
- package/cjs/tools/utils/stringUtils.js +32 -0
- package/cjs/tools/utils/stringUtils.js.map +1 -0
- package/cjs/tools/utils/timeUtils.d.ts +57 -0
- package/cjs/tools/utils/timeUtils.js +99 -0
- package/cjs/tools/utils/timeUtils.js.map +1 -0
- package/cjs/tools/utils/typeUtils.d.ts +4 -0
- package/cjs/tools/utils/typeUtils.js +17 -0
- package/cjs/tools/utils/typeUtils.js.map +1 -0
- package/cjs/tools/utils/urlPolyfill.d.ts +14 -0
- package/cjs/tools/utils/urlPolyfill.js +92 -0
- package/cjs/tools/utils/urlPolyfill.js.map +1 -0
- package/cjs/tools/valueHistory.d.ts +50 -0
- package/cjs/tools/valueHistory.js +106 -0
- package/cjs/tools/valueHistory.js.map +1 -0
- package/cjs/transport/batch.d.ts +19 -0
- package/cjs/transport/batch.js +79 -0
- package/cjs/transport/batch.js.map +1 -0
- package/cjs/transport/eventBridge.d.ts +12 -0
- package/cjs/transport/eventBridge.js +34 -0
- package/cjs/transport/eventBridge.js.map +1 -0
- package/cjs/transport/flushController.d.ts +48 -0
- package/cjs/transport/flushController.js +97 -0
- package/cjs/transport/flushController.js.map +1 -0
- package/cjs/transport/httpRequest.d.ts +37 -0
- package/cjs/transport/httpRequest.js +91 -0
- package/cjs/transport/httpRequest.js.map +1 -0
- package/cjs/transport/index.d.ts +4 -0
- package/cjs/transport/index.js +13 -0
- package/cjs/transport/index.js.map +1 -0
- package/cjs/transport/sendWithRetryStrategy.d.ts +39 -0
- package/cjs/transport/sendWithRetryStrategy.js +151 -0
- package/cjs/transport/sendWithRetryStrategy.js.map +1 -0
- package/cjs/transport/startBatchWithReplica.d.ts +15 -0
- package/cjs/transport/startBatchWithReplica.js +37 -0
- package/cjs/transport/startBatchWithReplica.js.map +1 -0
- package/esm/boot/init.d.ts +5 -0
- package/esm/boot/init.js +31 -0
- package/esm/boot/init.js.map +1 -0
- package/esm/browser/addEventListener.d.ts +76 -0
- package/esm/browser/addEventListener.js +47 -0
- package/esm/browser/addEventListener.js.map +1 -0
- package/esm/browser/cookie.d.ts +10 -0
- package/esm/browser/cookie.js +61 -0
- package/esm/browser/cookie.js.map +1 -0
- package/esm/browser/fetchObservable.d.ts +23 -0
- package/esm/browser/fetchObservable.js +70 -0
- package/esm/browser/fetchObservable.js.map +1 -0
- package/esm/browser/pageExitObservable.d.ts +14 -0
- package/esm/browser/pageExitObservable.js +53 -0
- package/esm/browser/pageExitObservable.js.map +1 -0
- package/esm/browser/runOnReadyState.d.ts +2 -0
- package/esm/browser/runOnReadyState.js +11 -0
- package/esm/browser/runOnReadyState.js.map +1 -0
- package/esm/browser/types.d.ts +19 -0
- package/esm/browser/types.js +5 -0
- package/esm/browser/types.js.map +1 -0
- package/esm/browser/xhrObservable.d.ts +22 -0
- package/esm/browser/xhrObservable.js +89 -0
- package/esm/browser/xhrObservable.js.map +1 -0
- package/esm/domain/configuration/configuration.d.ts +67 -0
- package/esm/domain/configuration/configuration.js +90 -0
- package/esm/domain/configuration/configuration.js.map +1 -0
- package/esm/domain/configuration/endpointBuilder.d.ts +14 -0
- package/esm/domain/configuration/endpointBuilder.js +90 -0
- package/esm/domain/configuration/endpointBuilder.js.map +1 -0
- package/esm/domain/configuration/index.d.ts +3 -0
- package/esm/domain/configuration/index.js +4 -0
- package/esm/domain/configuration/index.js.map +1 -0
- package/esm/domain/configuration/intakeSites.d.ts +5 -0
- package/esm/domain/configuration/intakeSites.js +6 -0
- package/esm/domain/configuration/intakeSites.js.map +1 -0
- package/esm/domain/configuration/tags.d.ts +4 -0
- package/esm/domain/configuration/tags.js +34 -0
- package/esm/domain/configuration/tags.js.map +1 -0
- package/esm/domain/configuration/transportConfiguration.d.ts +16 -0
- package/esm/domain/configuration/transportConfiguration.js +38 -0
- package/esm/domain/configuration/transportConfiguration.js.map +1 -0
- package/esm/domain/console/consoleObservable.d.ts +11 -0
- package/esm/domain/console/consoleObservable.js +70 -0
- package/esm/domain/console/consoleObservable.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/deflate/types.d.ts +26 -0
- package/esm/domain/deflate/types.js +2 -0
- package/esm/domain/deflate/types.js.map +1 -0
- package/esm/domain/error/error.d.ts +28 -0
- package/esm/domain/error/error.js +121 -0
- package/esm/domain/error/error.js.map +1 -0
- package/esm/domain/error/error.types.d.ts +40 -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 +5 -0
- package/esm/domain/error/trackRuntimeError.js +17 -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 +36 -0
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
- package/esm/domain/report/browser.types.d.ts +24 -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 +15 -0
- package/esm/domain/report/reportObservable.js +90 -0
- package/esm/domain/report/reportObservable.js.map +1 -0
- package/esm/domain/resourceUtils.d.ts +16 -0
- package/esm/domain/resourceUtils.js +2 -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 +2 -0
- package/esm/domain/session/sessionConstants.js +4 -0
- package/esm/domain/session/sessionConstants.js.map +1 -0
- package/esm/domain/session/sessionManager.d.ts +20 -0
- package/esm/domain/session/sessionManager.js +60 -0
- package/esm/domain/session/sessionManager.js.map +1 -0
- package/esm/domain/session/sessionState.d.ts +11 -0
- package/esm/domain/session/sessionState.js +38 -0
- package/esm/domain/session/sessionState.js.map +1 -0
- package/esm/domain/session/sessionStore.d.ts +34 -0
- package/esm/domain/session/sessionStore.js +139 -0
- package/esm/domain/session/sessionStore.js.map +1 -0
- package/esm/domain/session/sessionStoreOperations.d.ts +15 -0
- package/esm/domain/session/sessionStoreOperations.js +99 -0
- package/esm/domain/session/sessionStoreOperations.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +6 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.js +42 -0
- package/esm/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +3 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +35 -0
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +14 -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 +11 -0
- package/esm/domain/synthetics/syntheticsWorkerValues.js +16 -0
- package/esm/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
- package/esm/domain/telemetry/index.d.ts +3 -0
- package/esm/domain/telemetry/index.js +4 -0
- package/esm/domain/telemetry/index.js.map +1 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +11 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.js +5 -0
- package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
- package/esm/domain/telemetry/telemetry.d.ts +112 -0
- package/esm/domain/telemetry/telemetry.js +134 -0
- package/esm/domain/telemetry/telemetry.js.map +1 -0
- package/esm/domain/telemetry/telemetryEvent.types.d.ts +375 -0
- package/esm/domain/telemetry/telemetryEvent.types.js +6 -0
- package/esm/domain/telemetry/telemetryEvent.types.js.map +1 -0
- package/esm/domain/tracekit/computeStackTrace.d.ts +5 -0
- package/esm/domain/tracekit/computeStackTrace.js +114 -0
- package/esm/domain/tracekit/computeStackTrace.js.map +1 -0
- package/esm/domain/tracekit/index.d.ts +3 -0
- package/esm/domain/tracekit/index.js +3 -0
- package/esm/domain/tracekit/index.js.map +1 -0
- package/esm/domain/tracekit/tracekit.d.ts +35 -0
- package/esm/domain/tracekit/tracekit.js +91 -0
- package/esm/domain/tracekit/tracekit.js.map +1 -0
- package/esm/domain/tracekit/types.d.ts +44 -0
- package/esm/domain/tracekit/types.js +2 -0
- package/esm/domain/tracekit/types.js.map +1 -0
- package/esm/domain/user/index.d.ts +2 -0
- package/esm/domain/user/index.js +3 -0
- package/esm/domain/user/index.js.map +1 -0
- package/esm/domain/user/user.d.ts +12 -0
- package/esm/domain/user/user.js +30 -0
- package/esm/domain/user/user.js.map +1 -0
- package/esm/domain/user/user.types.d.ts +6 -0
- package/esm/domain/user/user.types.js +2 -0
- package/esm/domain/user/user.types.js.map +1 -0
- package/esm/index.d.ts +63 -0
- package/esm/index.js +61 -0
- package/esm/index.js.map +1 -0
- package/esm/tools/abstractLifeCycle.d.ts +23 -0
- package/esm/tools/abstractLifeCycle.js +26 -0
- package/esm/tools/abstractLifeCycle.js.map +1 -0
- package/esm/tools/boundedBuffer.d.ts +5 -0
- package/esm/tools/boundedBuffer.js +19 -0
- package/esm/tools/boundedBuffer.js.map +1 -0
- package/esm/tools/catchUserErrors.d.ts +1 -0
- package/esm/tools/catchUserErrors.js +16 -0
- package/esm/tools/catchUserErrors.js.map +1 -0
- package/esm/tools/display.d.ts +35 -0
- package/esm/tools/display.js +41 -0
- package/esm/tools/display.js.map +1 -0
- package/esm/tools/experimentalFeatures.d.ts +24 -0
- package/esm/tools/experimentalFeatures.js +40 -0
- package/esm/tools/experimentalFeatures.js.map +1 -0
- package/esm/tools/getGlobalObject.d.ts +4 -0
- package/esm/tools/getGlobalObject.js +33 -0
- package/esm/tools/getGlobalObject.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/instrumentMethod.d.ts +19 -0
- package/esm/tools/instrumentMethod.js +77 -0
- package/esm/tools/instrumentMethod.js.map +1 -0
- package/esm/tools/matchOption.d.ts +8 -0
- package/esm/tools/matchOption.js +33 -0
- package/esm/tools/matchOption.js.map +1 -0
- package/esm/tools/mergeInto.d.ts +25 -0
- package/esm/tools/mergeInto.js +99 -0
- package/esm/tools/mergeInto.js.map +1 -0
- package/esm/tools/monitor.d.ts +9 -0
- package/esm/tools/monitor.js +66 -0
- package/esm/tools/monitor.js.map +1 -0
- package/esm/tools/observable.d.ts +12 -0
- package/esm/tools/observable.js +40 -0
- package/esm/tools/observable.js.map +1 -0
- package/esm/tools/readBytesFromStream.d.ts +11 -0
- package/esm/tools/readBytesFromStream.js +60 -0
- package/esm/tools/readBytesFromStream.js.map +1 -0
- package/esm/tools/sendToExtension.d.ts +3 -0
- package/esm/tools/sendToExtension.js +7 -0
- package/esm/tools/sendToExtension.js.map +1 -0
- package/esm/tools/serialisation/context.d.ts +6 -0
- package/esm/tools/serialisation/context.js +2 -0
- package/esm/tools/serialisation/context.js.map +1 -0
- package/esm/tools/serialisation/contextManager.d.ts +21 -0
- package/esm/tools/serialisation/contextManager.js +66 -0
- package/esm/tools/serialisation/contextManager.js.map +1 -0
- package/esm/tools/serialisation/heavyCustomerDataWarning.d.ts +8 -0
- package/esm/tools/serialisation/heavyCustomerDataWarning.js +14 -0
- package/esm/tools/serialisation/heavyCustomerDataWarning.js.map +1 -0
- package/esm/tools/serialisation/jsonStringify.d.ts +14 -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 +181 -0
- package/esm/tools/serialisation/sanitize.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 +1 -0
- package/esm/tools/utils/arrayUtils.js +7 -0
- package/esm/tools/utils/arrayUtils.js.map +1 -0
- package/esm/tools/utils/browserDetection.d.ts +2 -0
- package/esm/tools/utils/browserDetection.js +7 -0
- package/esm/tools/utils/browserDetection.js.map +1 -0
- package/esm/tools/utils/byteUtils.d.ts +4 -0
- package/esm/tools/utils/byteUtils.js +26 -0
- package/esm/tools/utils/byteUtils.js.map +1 -0
- package/esm/tools/utils/functionUtils.d.ts +9 -0
- package/esm/tools/utils/functionUtils.js +43 -0
- package/esm/tools/utils/functionUtils.js.map +1 -0
- package/esm/tools/utils/numberUtils.d.ts +8 -0
- package/esm/tools/utils/numberUtils.js +17 -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 +19 -0
- package/esm/tools/utils/objectUtils.js.map +1 -0
- package/esm/tools/utils/polyfills.d.ts +24 -0
- package/esm/tools/utils/polyfills.js +95 -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 +7 -0
- package/esm/tools/utils/stringUtils.js +26 -0
- package/esm/tools/utils/stringUtils.js.map +1 -0
- package/esm/tools/utils/timeUtils.d.ts +57 -0
- package/esm/tools/utils/timeUtils.js +82 -0
- package/esm/tools/utils/timeUtils.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 +14 -0
- package/esm/tools/utils/urlPolyfill.js +80 -0
- package/esm/tools/utils/urlPolyfill.js.map +1 -0
- package/esm/tools/valueHistory.d.ts +50 -0
- package/esm/tools/valueHistory.js +103 -0
- package/esm/tools/valueHistory.js.map +1 -0
- package/esm/transport/batch.d.ts +19 -0
- package/esm/transport/batch.js +76 -0
- package/esm/transport/batch.js.map +1 -0
- package/esm/transport/eventBridge.d.ts +12 -0
- package/esm/transport/eventBridge.js +29 -0
- package/esm/transport/eventBridge.js.map +1 -0
- package/esm/transport/flushController.d.ts +48 -0
- package/esm/transport/flushController.js +93 -0
- package/esm/transport/flushController.js.map +1 -0
- package/esm/transport/httpRequest.d.ts +37 -0
- package/esm/transport/httpRequest.js +85 -0
- package/esm/transport/httpRequest.js.map +1 -0
- package/esm/transport/index.d.ts +4 -0
- package/esm/transport/index.js +5 -0
- package/esm/transport/index.js.map +1 -0
- package/esm/transport/sendWithRetryStrategy.d.ts +39 -0
- package/esm/transport/sendWithRetryStrategy.js +146 -0
- package/esm/transport/sendWithRetryStrategy.js.map +1 -0
- package/esm/transport/startBatchWithReplica.d.ts +15 -0
- package/esm/transport/startBatchWithReplica.js +33 -0
- package/esm/transport/startBatchWithReplica.js.map +1 -0
- package/package.json +26 -0
- package/src/boot/init.ts +41 -0
- package/src/browser/addEventListener.ts +136 -0
- package/src/browser/cookie.ts +71 -0
- package/src/browser/fetchObservable.ts +112 -0
- package/src/browser/pageExitObservable.ts +69 -0
- package/src/browser/runOnReadyState.ts +15 -0
- package/src/browser/types.ts +40 -0
- package/src/browser/xhrObservable.ts +127 -0
- package/src/domain/configuration/configuration.ts +191 -0
- package/src/domain/configuration/endpointBuilder.ts +134 -0
- package/src/domain/configuration/index.ts +9 -0
- package/src/domain/configuration/intakeSites.ts +5 -0
- package/src/domain/configuration/tags.ts +43 -0
- package/src/domain/configuration/transportConfiguration.ts +71 -0
- package/src/domain/console/consoleObservable.ts +86 -0
- package/src/domain/deflate/index.ts +1 -0
- package/src/domain/deflate/types.ts +41 -0
- package/src/domain/error/error.ts +159 -0
- package/src/domain/error/error.types.ts +47 -0
- package/src/domain/error/trackRuntimeError.ts +21 -0
- package/src/domain/eventRateLimiter/createEventRateLimiter.ts +46 -0
- package/src/domain/report/browser.types.ts +26 -0
- package/src/domain/report/reportObservable.ts +126 -0
- package/src/domain/resourceUtils.ts +17 -0
- package/src/domain/session/oldCookiesMigration.ts +42 -0
- package/src/domain/session/sessionConstants.ts +4 -0
- package/src/domain/session/sessionManager.ts +98 -0
- package/src/domain/session/sessionState.ts +51 -0
- package/src/domain/session/sessionStore.ts +185 -0
- package/src/domain/session/sessionStoreOperations.ts +112 -0
- package/src/domain/session/storeStrategies/sessionInCookie.ts +56 -0
- package/src/domain/session/storeStrategies/sessionInLocalStorage.ts +41 -0
- package/src/domain/session/storeStrategies/sessionStoreStrategy.ts +12 -0
- package/src/domain/synthetics/syntheticsWorkerValues.ts +27 -0
- package/src/domain/telemetry/index.ts +14 -0
- package/src/domain/telemetry/rawTelemetryEvent.types.ts +14 -0
- package/src/domain/telemetry/telemetry.ts +195 -0
- package/src/domain/telemetry/telemetryEvent.types.ts +382 -0
- package/src/domain/tracekit/computeStackTrace.ts +141 -0
- package/src/domain/tracekit/index.ts +3 -0
- package/src/domain/tracekit/tracekit.ts +96 -0
- package/src/domain/tracekit/types.ts +47 -0
- package/src/domain/user/index.ts +2 -0
- package/src/domain/user/user.ts +33 -0
- package/src/domain/user/user.types.ts +6 -0
- package/src/index.ts +128 -0
- package/src/tools/abstractLifeCycle.ts +45 -0
- package/src/tools/boundedBuffer.ts +17 -0
- package/src/tools/catchUserErrors.ts +11 -0
- package/src/tools/display.ts +51 -0
- package/src/tools/experimentalFeatures.ts +43 -0
- package/src/tools/getGlobalObject.ts +31 -0
- package/src/tools/getZoneJsOriginalValue.ts +38 -0
- package/src/tools/instrumentMethod.ts +109 -0
- package/src/tools/matchOption.ts +32 -0
- package/src/tools/mergeInto.ts +177 -0
- package/src/tools/monitor.ts +68 -0
- package/src/tools/observable.ts +40 -0
- package/src/tools/readBytesFromStream.ts +77 -0
- package/src/tools/sendToExtension.ts +12 -0
- package/src/tools/serialisation/context.ts +8 -0
- package/src/tools/serialisation/contextManager.ts +79 -0
- package/src/tools/serialisation/heavyCustomerDataWarning.ts +26 -0
- package/src/tools/serialisation/jsonStringify.ts +53 -0
- package/src/tools/serialisation/sanitize.ts +255 -0
- package/src/tools/timer.ts +21 -0
- package/src/tools/utils/arrayUtils.ts +7 -0
- package/src/tools/utils/browserDetection.ts +7 -0
- package/src/tools/utils/byteUtils.ts +29 -0
- package/src/tools/utils/functionUtils.ts +47 -0
- package/src/tools/utils/numberUtils.ts +19 -0
- package/src/tools/utils/objectUtils.ts +21 -0
- package/src/tools/utils/polyfills.ts +127 -0
- package/src/tools/utils/responseUtils.ts +12 -0
- package/src/tools/utils/stringUtils.ts +28 -0
- package/src/tools/utils/timeUtils.ts +112 -0
- package/src/tools/utils/typeUtils.ts +12 -0
- package/src/tools/utils/urlPolyfill.ts +86 -0
- package/src/tools/valueHistory.ts +120 -0
- package/src/transport/batch.ts +92 -0
- package/src/transport/eventBridge.ts +42 -0
- package/src/transport/flushController.ts +129 -0
- package/src/transport/httpRequest.ts +150 -0
- package/src/transport/index.ts +4 -0
- package/src/transport/sendWithRetryStrategy.ts +203 -0
- package/src/transport/startBatchWithReplica.ts +52 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Configuration,
|
|
3
|
+
InitConfiguration,
|
|
4
|
+
validateAndBuildConfiguration,
|
|
5
|
+
DefaultPrivacyLevel,
|
|
6
|
+
EndpointBuilder,
|
|
7
|
+
serializeConfiguration,
|
|
8
|
+
INTAKE_SITE_AP1,
|
|
9
|
+
INTAKE_SITE_STAGING,
|
|
10
|
+
INTAKE_SITE_US1,
|
|
11
|
+
INTAKE_SITE_US1_FED,
|
|
12
|
+
INTAKE_SITE_EU1,
|
|
13
|
+
} from './domain/configuration'
|
|
14
|
+
export {
|
|
15
|
+
isExperimentalFeatureEnabled,
|
|
16
|
+
addExperimentalFeatures,
|
|
17
|
+
resetExperimentalFeatures,
|
|
18
|
+
getExperimentalFeatures,
|
|
19
|
+
ExperimentalFeature,
|
|
20
|
+
} from './tools/experimentalFeatures'
|
|
21
|
+
export { trackRuntimeError } from './domain/error/trackRuntimeError'
|
|
22
|
+
export { computeStackTrace, StackTrace } from './domain/tracekit'
|
|
23
|
+
export { defineGlobal, makePublicApi } from './boot/init'
|
|
24
|
+
export { initReportObservable, RawReport, RawReportType } from './domain/report/reportObservable'
|
|
25
|
+
export {
|
|
26
|
+
startTelemetry,
|
|
27
|
+
Telemetry,
|
|
28
|
+
RawTelemetryEvent,
|
|
29
|
+
RawTelemetryConfiguration,
|
|
30
|
+
addTelemetryDebug,
|
|
31
|
+
addTelemetryError,
|
|
32
|
+
startFakeTelemetry,
|
|
33
|
+
resetTelemetry,
|
|
34
|
+
TelemetryEvent,
|
|
35
|
+
TelemetryErrorEvent,
|
|
36
|
+
TelemetryDebugEvent,
|
|
37
|
+
TelemetryConfigurationEvent,
|
|
38
|
+
TelemetryService,
|
|
39
|
+
isTelemetryReplicationAllowed,
|
|
40
|
+
addTelemetryConfiguration,
|
|
41
|
+
} from './domain/telemetry'
|
|
42
|
+
export { monitored, monitor, callMonitored, setDebugMode } from './tools/monitor'
|
|
43
|
+
export { Observable, Subscription } from './tools/observable'
|
|
44
|
+
export {
|
|
45
|
+
startSessionManager,
|
|
46
|
+
SessionManager,
|
|
47
|
+
// Exposed for tests
|
|
48
|
+
stopSessionManager,
|
|
49
|
+
} from './domain/session/sessionManager'
|
|
50
|
+
export {
|
|
51
|
+
SESSION_TIME_OUT_DELAY, // Exposed for tests
|
|
52
|
+
} from './domain/session/sessionConstants'
|
|
53
|
+
export {
|
|
54
|
+
HttpRequest,
|
|
55
|
+
Payload,
|
|
56
|
+
createHttpRequest,
|
|
57
|
+
canUseEventBridge,
|
|
58
|
+
getEventBridge,
|
|
59
|
+
startBatchWithReplica,
|
|
60
|
+
createFlushController,
|
|
61
|
+
FlushEvent,
|
|
62
|
+
FlushReason,
|
|
63
|
+
} from './transport'
|
|
64
|
+
export * from './tools/display'
|
|
65
|
+
export * from './tools/utils/urlPolyfill'
|
|
66
|
+
export * from './tools/utils/timeUtils'
|
|
67
|
+
export * from './tools/utils/arrayUtils'
|
|
68
|
+
export * from './tools/serialisation/sanitize'
|
|
69
|
+
export * from './tools/getGlobalObject'
|
|
70
|
+
export { AbstractLifeCycle } from './tools/abstractLifeCycle'
|
|
71
|
+
export * from './domain/eventRateLimiter/createEventRateLimiter'
|
|
72
|
+
export * from './tools/utils/browserDetection'
|
|
73
|
+
export { sendToExtension } from './tools/sendToExtension'
|
|
74
|
+
export { runOnReadyState } from './browser/runOnReadyState'
|
|
75
|
+
export { getZoneJsOriginalValue } from './tools/getZoneJsOriginalValue'
|
|
76
|
+
export { instrumentMethod, instrumentMethodAndCallOriginal, instrumentSetter } from './tools/instrumentMethod'
|
|
77
|
+
export {
|
|
78
|
+
computeRawError,
|
|
79
|
+
createHandlingStack,
|
|
80
|
+
toStackTraceString,
|
|
81
|
+
getFileFromStackTraceString,
|
|
82
|
+
NO_ERROR_STACK_PRESENT_MESSAGE,
|
|
83
|
+
} from './domain/error/error'
|
|
84
|
+
export { NonErrorPrefix } from './domain/error/error.types'
|
|
85
|
+
export { Context, ContextArray, ContextValue } from './tools/serialisation/context'
|
|
86
|
+
export { areCookiesAuthorized, getCookie, setCookie, deleteCookie } from './browser/cookie'
|
|
87
|
+
export { initXhrObservable, XhrCompleteContext, XhrStartContext } from './browser/xhrObservable'
|
|
88
|
+
export { initFetchObservable, FetchResolveContext, FetchStartContext, FetchContext } from './browser/fetchObservable'
|
|
89
|
+
export { createPageExitObservable, PageExitEvent, PageExitReason, isPageExitReason } from './browser/pageExitObservable'
|
|
90
|
+
export * from './browser/addEventListener'
|
|
91
|
+
export * from './tools/timer'
|
|
92
|
+
export { initConsoleObservable, resetConsoleObservable, ConsoleLog } from './domain/console/consoleObservable'
|
|
93
|
+
export { BoundedBuffer } from './tools/boundedBuffer'
|
|
94
|
+
export { catchUserErrors } from './tools/catchUserErrors'
|
|
95
|
+
export { createContextManager, ContextManager } from './tools/serialisation/contextManager'
|
|
96
|
+
export {
|
|
97
|
+
warnIfCustomerDataLimitReached,
|
|
98
|
+
CustomerDataType,
|
|
99
|
+
CUSTOMER_DATA_BYTES_LIMIT,
|
|
100
|
+
} from './tools/serialisation/heavyCustomerDataWarning'
|
|
101
|
+
export { ValueHistory, ValueHistoryEntry, CLEAR_OLD_VALUES_INTERVAL } from './tools/valueHistory'
|
|
102
|
+
export { readBytesFromStream } from './tools/readBytesFromStream'
|
|
103
|
+
export { STORAGE_POLL_DELAY } from './domain/session/sessionStore'
|
|
104
|
+
export { SESSION_STORE_KEY } from './domain/session/storeStrategies/sessionStoreStrategy'
|
|
105
|
+
export {
|
|
106
|
+
willSyntheticsInjectRum,
|
|
107
|
+
getSyntheticsTestId,
|
|
108
|
+
getSyntheticsResultId,
|
|
109
|
+
} from './domain/synthetics/syntheticsWorkerValues'
|
|
110
|
+
export { User, checkUser, sanitizeUser } from './domain/user'
|
|
111
|
+
export * from './domain/resourceUtils'
|
|
112
|
+
export * from './tools/utils/polyfills'
|
|
113
|
+
export * from './tools/utils/numberUtils'
|
|
114
|
+
export * from './tools/utils/byteUtils'
|
|
115
|
+
export * from './tools/utils/objectUtils'
|
|
116
|
+
export * from './tools/utils/functionUtils'
|
|
117
|
+
export * from './tools/serialisation/jsonStringify'
|
|
118
|
+
export * from './tools/mergeInto'
|
|
119
|
+
export * from './tools/utils/stringUtils'
|
|
120
|
+
export * from './tools/matchOption'
|
|
121
|
+
export * from './tools/utils/responseUtils'
|
|
122
|
+
export * from './tools/utils/typeUtils'
|
|
123
|
+
export { ErrorHandling } from './domain/error/error.types'
|
|
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'
|
|
128
|
+
export * from './domain/deflate'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Subscription } from './observable'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type helper to extract event types that have "void" data. This allows to call `notify` without a
|
|
5
|
+
* second argument. Ex:
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* interface EventMap {
|
|
9
|
+
* foo: void
|
|
10
|
+
* }
|
|
11
|
+
* const LifeCycle = AbstractLifeCycle<EventMap>
|
|
12
|
+
* new LifeCycle().notify('foo')
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
type EventTypesWithoutData<EventMap> = {
|
|
16
|
+
[K in keyof EventMap]: EventMap[K] extends void ? K : never
|
|
17
|
+
}[keyof EventMap]
|
|
18
|
+
|
|
19
|
+
export class AbstractLifeCycle<EventMap> {
|
|
20
|
+
private callbacks: { [key in keyof EventMap]?: Array<(data: any) => void> } = {}
|
|
21
|
+
|
|
22
|
+
notify<EventType extends EventTypesWithoutData<EventMap>>(eventType: EventType): void
|
|
23
|
+
notify<EventType extends keyof EventMap>(eventType: EventType, data: EventMap[EventType]): void
|
|
24
|
+
notify(eventType: keyof EventMap, data?: unknown) {
|
|
25
|
+
const eventCallbacks = this.callbacks[eventType]
|
|
26
|
+
if (eventCallbacks) {
|
|
27
|
+
eventCallbacks.forEach((callback) => callback(data))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
subscribe<EventType extends keyof EventMap>(
|
|
32
|
+
eventType: EventType,
|
|
33
|
+
callback: (data: EventMap[EventType]) => void
|
|
34
|
+
): Subscription {
|
|
35
|
+
if (!this.callbacks[eventType]) {
|
|
36
|
+
this.callbacks[eventType] = []
|
|
37
|
+
}
|
|
38
|
+
this.callbacks[eventType]!.push(callback)
|
|
39
|
+
return {
|
|
40
|
+
unsubscribe: () => {
|
|
41
|
+
this.callbacks[eventType] = this.callbacks[eventType]!.filter((other) => callback !== other)
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const BUFFER_LIMIT = 500
|
|
2
|
+
|
|
3
|
+
export class BoundedBuffer {
|
|
4
|
+
private buffer: Array<() => void> = []
|
|
5
|
+
|
|
6
|
+
add(callback: () => void) {
|
|
7
|
+
const length = this.buffer.push(callback)
|
|
8
|
+
if (length > BUFFER_LIMIT) {
|
|
9
|
+
this.buffer.splice(0, 1)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
drain() {
|
|
14
|
+
this.buffer.forEach((callback) => callback())
|
|
15
|
+
this.buffer.length = 0
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { display } from './display'
|
|
2
|
+
|
|
3
|
+
export function catchUserErrors<Args extends any[], R>(fn: (...args: Args) => R, errorMsg: string) {
|
|
4
|
+
return (...args: Args) => {
|
|
5
|
+
try {
|
|
6
|
+
return fn(...args)
|
|
7
|
+
} catch (err) {
|
|
8
|
+
display.error(errorMsg, err)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* eslint-disable local-rules/disallow-side-effects */
|
|
2
|
+
/**
|
|
3
|
+
* Keep references on console methods to avoid triggering patched behaviors
|
|
4
|
+
*
|
|
5
|
+
* NB: in some setup, console could already be patched by another SDK.
|
|
6
|
+
* In this case, some display messages can be sent by the other SDK
|
|
7
|
+
* but we should be safe from infinite loop nonetheless.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const ConsoleApiName = {
|
|
11
|
+
log: 'log',
|
|
12
|
+
debug: 'debug',
|
|
13
|
+
info: 'info',
|
|
14
|
+
warn: 'warn',
|
|
15
|
+
error: 'error',
|
|
16
|
+
} as const
|
|
17
|
+
|
|
18
|
+
export type ConsoleApiName = (typeof ConsoleApiName)[keyof typeof ConsoleApiName]
|
|
19
|
+
|
|
20
|
+
interface Display {
|
|
21
|
+
(api: ConsoleApiName, ...args: any[]): void
|
|
22
|
+
debug: typeof console.debug
|
|
23
|
+
log: typeof console.log
|
|
24
|
+
info: typeof console.info
|
|
25
|
+
warn: typeof console.warn
|
|
26
|
+
error: typeof console.error
|
|
27
|
+
}
|
|
28
|
+
|
|
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
|
+
/**
|
|
37
|
+
* When building JS bundles, some users might use a plugin[1] or configuration[2] to remove
|
|
38
|
+
* "console.*" references. This causes some issue as we expect `console.*` to be defined.
|
|
39
|
+
* As a workaround, let's use a variable alias, so those expressions won't be taken into account by
|
|
40
|
+
* simple static analysis.
|
|
41
|
+
*
|
|
42
|
+
* [1]: https://babeljs.io/docs/babel-plugin-transform-remove-console/
|
|
43
|
+
* [2]: https://github.com/terser/terser#compress-options (look for drop_console)
|
|
44
|
+
*/
|
|
45
|
+
export const globalConsole = console
|
|
46
|
+
|
|
47
|
+
display.debug = globalConsole.debug.bind(globalConsole)
|
|
48
|
+
display.log = globalConsole.log.bind(globalConsole)
|
|
49
|
+
display.info = globalConsole.info.bind(globalConsole)
|
|
50
|
+
display.warn = globalConsole.warn.bind(globalConsole)
|
|
51
|
+
display.error = globalConsole.error.bind(globalConsole)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LIMITATION:
|
|
3
|
+
* For NPM setup, this feature flag singleton is shared between RUM and Logs product.
|
|
4
|
+
* This means that an experimental flag set on the RUM product will be set on the Logs product.
|
|
5
|
+
* So keep in mind that in certain configurations, your experimental feature flag may affect other products.
|
|
6
|
+
*
|
|
7
|
+
* FORMAT:
|
|
8
|
+
* All feature flags should be snake_cased
|
|
9
|
+
*/
|
|
10
|
+
// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary
|
|
11
|
+
// string is an expected feature flag
|
|
12
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
+
export enum ExperimentalFeature {
|
|
14
|
+
PAGEHIDE = 'pagehide',
|
|
15
|
+
FEATURE_FLAGS = 'feature_flags',
|
|
16
|
+
RESOURCE_PAGE_STATES = 'resource_page_states',
|
|
17
|
+
PAGE_STATES = 'page_states',
|
|
18
|
+
COLLECT_FLUSH_REASON = 'collect_flush_reason',
|
|
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',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const enabledExperimentalFeatures: Set<ExperimentalFeature> = new Set()
|
|
26
|
+
|
|
27
|
+
export function addExperimentalFeatures(enabledFeatures: ExperimentalFeature[]): void {
|
|
28
|
+
enabledFeatures.forEach((flag) => {
|
|
29
|
+
enabledExperimentalFeatures.add(flag)
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isExperimentalFeatureEnabled(featureName: ExperimentalFeature): boolean {
|
|
34
|
+
return enabledExperimentalFeatures.has(featureName)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function resetExperimentalFeatures(): void {
|
|
38
|
+
enabledExperimentalFeatures.clear()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getExperimentalFeatures(): Set<ExperimentalFeature> {
|
|
42
|
+
return enabledExperimentalFeatures
|
|
43
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* inspired by https://mathiasbynens.be/notes/globalthis
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function getGlobalObject<T = typeof globalThis>(): T {
|
|
6
|
+
if (typeof globalThis === 'object') {
|
|
7
|
+
return globalThis as unknown as T
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(Object.prototype, '_oo_temp_', {
|
|
10
|
+
get() {
|
|
11
|
+
return this as object
|
|
12
|
+
},
|
|
13
|
+
configurable: true,
|
|
14
|
+
})
|
|
15
|
+
// @ts-ignore _oo_temp is defined using defineProperty
|
|
16
|
+
let globalObject: unknown = _oo_temp_
|
|
17
|
+
// @ts-ignore _oo_temp is defined using defineProperty
|
|
18
|
+
delete Object.prototype._oo_temp_
|
|
19
|
+
if (typeof globalObject !== 'object') {
|
|
20
|
+
// on safari _oo_temp_ is available on window but not globally
|
|
21
|
+
// fallback on other browser globals check
|
|
22
|
+
if (typeof self === 'object') {
|
|
23
|
+
globalObject = self
|
|
24
|
+
} else if (typeof window === 'object') {
|
|
25
|
+
globalObject = window
|
|
26
|
+
} else {
|
|
27
|
+
globalObject = {}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return globalObject as T
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getGlobalObject } from './getGlobalObject'
|
|
2
|
+
|
|
3
|
+
export interface BrowserWindowWithZoneJs extends Window {
|
|
4
|
+
Zone?: {
|
|
5
|
+
// All Zone.js versions expose the __symbol__ method, but we observed that some website have a
|
|
6
|
+
// 'Zone' global variable unrelated to Zone.js, so let's consider this method optional
|
|
7
|
+
// nonetheless.
|
|
8
|
+
__symbol__?: (name: string) => string
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Gets the original value for a DOM API that was potentially patched by Zone.js.
|
|
14
|
+
*
|
|
15
|
+
* Zone.js[1] is a library that patches a bunch of JS and DOM APIs. It usually stores the original
|
|
16
|
+
* value of the patched functions/constructors/methods in a hidden property prefixed by
|
|
17
|
+
* __zone_symbol__.
|
|
18
|
+
*
|
|
19
|
+
* In multiple occasions, we observed that Zone.js is the culprit of important issues leading to
|
|
20
|
+
* browser resource exhaustion (memory leak, high CPU usage). This method is used as a workaround to
|
|
21
|
+
* use the original DOM API instead of the one patched by Zone.js.
|
|
22
|
+
*
|
|
23
|
+
* [1]: https://github.com/angular/angular/tree/main/packages/zone.js
|
|
24
|
+
*/
|
|
25
|
+
export function getZoneJsOriginalValue<Target, Name extends keyof Target & string>(
|
|
26
|
+
target: Target,
|
|
27
|
+
name: Name
|
|
28
|
+
): Target[Name] {
|
|
29
|
+
const browserWindow = getGlobalObject<BrowserWindowWithZoneJs>()
|
|
30
|
+
let original: Target[Name] | undefined
|
|
31
|
+
if (browserWindow.Zone && typeof browserWindow.Zone.__symbol__ === 'function') {
|
|
32
|
+
original = (target as any)[browserWindow.Zone.__symbol__(name)]
|
|
33
|
+
}
|
|
34
|
+
if (!original) {
|
|
35
|
+
original = target[name]
|
|
36
|
+
}
|
|
37
|
+
return original
|
|
38
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { setTimeout } from './timer'
|
|
2
|
+
import { callMonitored } from './monitor'
|
|
3
|
+
import { noop } from './utils/functionUtils'
|
|
4
|
+
|
|
5
|
+
export function instrumentMethod<OBJECT extends { [key: string]: any }, METHOD extends keyof OBJECT>(
|
|
6
|
+
object: OBJECT,
|
|
7
|
+
method: METHOD,
|
|
8
|
+
instrumentationFactory: (
|
|
9
|
+
original: OBJECT[METHOD]
|
|
10
|
+
) => (this: OBJECT, ...args: Parameters<OBJECT[METHOD]>) => ReturnType<OBJECT[METHOD]>
|
|
11
|
+
) {
|
|
12
|
+
const original = object[method]
|
|
13
|
+
|
|
14
|
+
let instrumentation = instrumentationFactory(original)
|
|
15
|
+
|
|
16
|
+
const instrumentationWrapper = function (this: OBJECT): ReturnType<OBJECT[METHOD]> | undefined {
|
|
17
|
+
if (typeof instrumentation !== 'function') {
|
|
18
|
+
return undefined
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
21
|
+
return instrumentation.apply(this, arguments as unknown as Parameters<OBJECT[METHOD]>)
|
|
22
|
+
}
|
|
23
|
+
object[method] = instrumentationWrapper as OBJECT[METHOD]
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
stop: () => {
|
|
27
|
+
if (object[method] === instrumentationWrapper) {
|
|
28
|
+
object[method] = original
|
|
29
|
+
} else {
|
|
30
|
+
instrumentation = original
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function instrumentMethodAndCallOriginal<OBJECT extends { [key: string]: any }, METHOD extends keyof OBJECT>(
|
|
37
|
+
object: OBJECT,
|
|
38
|
+
method: METHOD,
|
|
39
|
+
{
|
|
40
|
+
before,
|
|
41
|
+
after,
|
|
42
|
+
}: {
|
|
43
|
+
before?: (this: OBJECT, ...args: Parameters<OBJECT[METHOD]>) => void
|
|
44
|
+
after?: (this: OBJECT, ...args: Parameters<OBJECT[METHOD]>) => void
|
|
45
|
+
}
|
|
46
|
+
) {
|
|
47
|
+
return instrumentMethod(
|
|
48
|
+
object,
|
|
49
|
+
method,
|
|
50
|
+
(original) =>
|
|
51
|
+
function () {
|
|
52
|
+
const args = arguments as unknown as Parameters<OBJECT[METHOD]>
|
|
53
|
+
let result
|
|
54
|
+
|
|
55
|
+
if (before) {
|
|
56
|
+
callMonitored(before, this, args)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (typeof original === 'function') {
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
61
|
+
result = original.apply(this, args)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (after) {
|
|
65
|
+
callMonitored(after, this, args)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
69
|
+
return result
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function instrumentSetter<OBJECT extends { [key: string]: any }, PROPERTY extends keyof OBJECT>(
|
|
75
|
+
object: OBJECT,
|
|
76
|
+
property: PROPERTY,
|
|
77
|
+
after: (thisObject: OBJECT, value: OBJECT[PROPERTY]) => void
|
|
78
|
+
) {
|
|
79
|
+
const originalDescriptor = Object.getOwnPropertyDescriptor(object, property)
|
|
80
|
+
if (!originalDescriptor || !originalDescriptor.set || !originalDescriptor.configurable) {
|
|
81
|
+
return { stop: noop }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let instrumentation = (thisObject: OBJECT, value: OBJECT[PROPERTY]) => {
|
|
85
|
+
// put hooked setter into event loop to avoid of set latency
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
after(thisObject, value)
|
|
88
|
+
}, 0)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const instrumentationWrapper = function (this: OBJECT, value: OBJECT[PROPERTY]) {
|
|
92
|
+
originalDescriptor.set!.call(this, value)
|
|
93
|
+
instrumentation(this, value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Object.defineProperty(object, property, {
|
|
97
|
+
set: instrumentationWrapper,
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
stop: () => {
|
|
102
|
+
if (Object.getOwnPropertyDescriptor(object, property)?.set === instrumentationWrapper) {
|
|
103
|
+
Object.defineProperty(object, property, originalDescriptor)
|
|
104
|
+
} else {
|
|
105
|
+
instrumentation = noop
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { startsWith } from './utils/polyfills'
|
|
2
|
+
import { display } from './display'
|
|
3
|
+
import { getType } from './utils/typeUtils'
|
|
4
|
+
|
|
5
|
+
export type MatchOption = string | RegExp | ((value: string) => boolean)
|
|
6
|
+
|
|
7
|
+
export function isMatchOption(item: unknown): item is MatchOption {
|
|
8
|
+
const itemType = getType(item)
|
|
9
|
+
return itemType === 'string' || itemType === 'function' || item instanceof RegExp
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if value can be matched by at least one of the provided MatchOptions.
|
|
14
|
+
* When comparing strings, setting useStartsWith to true will compare the value with the start of
|
|
15
|
+
* the option, instead of requiring an exact match.
|
|
16
|
+
*/
|
|
17
|
+
export function matchList(list: MatchOption[], value: string, useStartsWith = false): boolean {
|
|
18
|
+
return list.some((item) => {
|
|
19
|
+
try {
|
|
20
|
+
if (typeof item === 'function') {
|
|
21
|
+
return item(value)
|
|
22
|
+
} else if (item instanceof RegExp) {
|
|
23
|
+
return item.test(value)
|
|
24
|
+
} else if (typeof item === 'string') {
|
|
25
|
+
return useStartsWith ? startsWith(value, item) : item === value
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
display.error(e)
|
|
29
|
+
}
|
|
30
|
+
return false
|
|
31
|
+
})
|
|
32
|
+
}
|