@openobserve/browser-core 0.2.11-rc1 → 0.2.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/src/boot/displayAlreadyInitializedError.ts +8 -0
- package/src/boot/init.ts +29 -15
- package/src/browser/addEventListener.ts +13 -10
- package/src/browser/{types.ts → browser.types.ts} +42 -0
- package/src/browser/cookie.ts +49 -14
- package/src/browser/fetchObservable.ts +80 -21
- package/src/browser/{pageExitObservable.ts → pageMayExitObservable.ts} +11 -22
- package/src/browser/runOnReadyState.ts +14 -4
- package/src/browser/xhrObservable.ts +17 -4
- package/src/domain/allowedTrackingOrigins.ts +30 -0
- package/src/domain/bufferedData.ts +32 -0
- package/src/domain/configuration/configuration.ts +352 -83
- package/src/domain/configuration/endpointBuilder.ts +29 -32
- package/src/domain/configuration/index.ts +6 -5
- package/src/domain/configuration/transportConfiguration.ts +42 -35
- package/src/domain/connectivity/connectivity.ts +5 -1
- package/src/domain/console/consoleObservable.ts +57 -21
- package/src/domain/context/contextConstants.ts +22 -0
- package/src/domain/context/contextManager.ts +48 -11
- package/src/domain/context/contextUtils.ts +14 -0
- package/src/domain/context/defineContextMethod.ts +31 -0
- package/src/domain/context/storeContextManager.ts +7 -3
- package/src/domain/contexts/accountContext.ts +47 -0
- package/src/domain/contexts/globalContext.ts +30 -0
- package/src/domain/contexts/rumInternalContext.type.ts +15 -0
- package/src/domain/contexts/userContext.ts +64 -0
- package/src/domain/deflate/{types.ts → deflate.types.ts} +6 -4
- package/src/domain/deflate/index.ts +1 -1
- package/src/domain/error/error.ts +28 -84
- package/src/domain/error/error.types.ts +10 -2
- package/src/domain/error/trackRuntimeError.ts +29 -32
- package/src/domain/eventRateLimiter/createEventRateLimiter.ts +5 -2
- package/src/domain/extension/extensionUtils.ts +28 -0
- package/src/domain/intakeSites.ts +18 -0
- package/src/domain/report/reportObservable.ts +35 -30
- package/src/domain/resourceUtils.ts +20 -16
- package/src/domain/session/README.md +193 -0
- package/src/domain/session/oldCookiesMigration.ts +2 -2
- package/src/domain/session/sessionConstants.ts +16 -1
- package/src/domain/session/sessionManager.ts +179 -15
- package/src/domain/session/sessionState.ts +49 -17
- package/src/domain/session/sessionStateValidation.ts +9 -0
- package/src/domain/session/sessionStore.ts +118 -55
- package/src/domain/session/sessionStoreOperations.ts +47 -20
- package/src/domain/session/storeStrategies/sessionInCookie.ts +105 -26
- package/src/domain/session/storeStrategies/sessionInLocalStorage.ts +10 -8
- package/src/domain/session/storeStrategies/sessionStoreStrategy.ts +5 -2
- package/src/domain/synthetics/syntheticsWorkerValues.ts +13 -2
- package/src/domain/tags.ts +76 -0
- package/src/domain/telemetry/index.ts +12 -4
- package/src/domain/telemetry/rawTelemetryEvent.types.ts +6 -3
- package/src/domain/telemetry/telemetry.ts +235 -106
- package/src/domain/telemetry/telemetryEvent.types.ts +514 -5
- package/src/domain/trackingConsent.ts +34 -0
- package/src/index.ts +90 -59
- package/src/tools/abstractHooks.ts +72 -0
- package/src/tools/abstractLifeCycle.ts +1 -0
- package/src/tools/boundedBuffer.ts +36 -8
- package/src/tools/display.ts +4 -0
- package/src/tools/encoder.ts +3 -2
- package/src/tools/experimentalFeatures.ts +18 -7
- package/src/tools/getZoneJsOriginalValue.ts +1 -1
- package/src/tools/{getGlobalObject.ts → globalObject.ts} +20 -0
- package/src/tools/instrumentMethod.ts +58 -41
- package/src/tools/matchOption.ts +1 -2
- package/src/tools/monitor.ts +11 -7
- package/src/tools/observable.ts +78 -12
- package/src/tools/queueMicrotask.ts +13 -0
- package/src/tools/readBytesFromStream.ts +24 -64
- package/src/tools/requestIdleCallback.ts +40 -0
- package/src/tools/sendToExtension.ts +3 -1
- package/src/tools/serialisation/context.ts +4 -1
- package/src/tools/serialisation/sanitize.ts +32 -14
- package/src/{domain/error → tools/stackTrace}/computeStackTrace.ts +72 -8
- package/src/tools/stackTrace/handlingStack.ts +48 -0
- package/src/tools/taskQueue.ts +63 -0
- package/src/tools/timer.ts +1 -1
- package/src/tools/utils/arrayUtils.ts +11 -3
- package/src/tools/utils/browserDetection.ts +0 -9
- package/src/tools/utils/byteUtils.ts +13 -2
- package/src/tools/utils/functionUtils.ts +0 -2
- package/src/tools/utils/numberUtils.ts +2 -1
- package/src/tools/utils/objectUtils.ts +1 -3
- package/src/tools/utils/polyfills.ts +6 -107
- package/src/tools/utils/responseUtils.ts +1 -1
- package/src/tools/utils/stringUtils.ts +34 -2
- package/src/tools/utils/timeUtils.ts +18 -13
- package/src/tools/utils/timezone.ts +9 -0
- package/src/tools/utils/urlPolyfill.ts +29 -59
- package/src/tools/valueHistory.ts +66 -35
- package/src/transport/batch.ts +77 -80
- package/src/transport/eventBridge.ts +24 -5
- package/src/transport/flushController.ts +27 -21
- package/src/transport/httpRequest.ts +92 -71
- package/src/transport/index.ts +7 -4
- package/src/transport/sendWithRetryStrategy.ts +55 -36
- package/cjs/boot/init.d.ts +0 -5
- package/cjs/boot/init.js +0 -36
- package/cjs/boot/init.js.map +0 -1
- package/cjs/browser/addEventListener.d.ts +0 -84
- package/cjs/browser/addEventListener.js +0 -94
- package/cjs/browser/addEventListener.js.map +0 -1
- package/cjs/browser/cookie.d.ts +0 -17
- package/cjs/browser/cookie.js +0 -86
- package/cjs/browser/cookie.js.map +0 -1
- package/cjs/browser/fetchObservable.d.ts +0 -23
- package/cjs/browser/fetchObservable.js +0 -69
- package/cjs/browser/fetchObservable.js.map +0 -1
- package/cjs/browser/pageExitObservable.d.ts +0 -14
- package/cjs/browser/pageExitObservable.js +0 -57
- package/cjs/browser/pageExitObservable.js.map +0 -1
- package/cjs/browser/runOnReadyState.d.ts +0 -2
- package/cjs/browser/runOnReadyState.js +0 -15
- package/cjs/browser/runOnReadyState.js.map +0 -1
- package/cjs/browser/types.d.ts +0 -19
- package/cjs/browser/types.js +0 -6
- package/cjs/browser/types.js.map +0 -1
- package/cjs/browser/xhrObservable.d.ts +0 -21
- package/cjs/browser/xhrObservable.js +0 -85
- package/cjs/browser/xhrObservable.js.map +0 -1
- package/cjs/domain/configuration/configuration.d.ts +0 -72
- package/cjs/domain/configuration/configuration.js +0 -94
- package/cjs/domain/configuration/configuration.js.map +0 -1
- package/cjs/domain/configuration/endpointBuilder.d.ts +0 -10
- package/cjs/domain/configuration/endpointBuilder.js +0 -84
- package/cjs/domain/configuration/endpointBuilder.js.map +0 -1
- package/cjs/domain/configuration/index.d.ts +0 -4
- package/cjs/domain/configuration/index.js +0 -27
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/intakeSites.d.ts +0 -5
- package/cjs/domain/configuration/intakeSites.js +0 -9
- package/cjs/domain/configuration/intakeSites.js.map +0 -1
- package/cjs/domain/configuration/tags.d.ts +0 -4
- package/cjs/domain/configuration/tags.js +0 -39
- package/cjs/domain/configuration/tags.js.map +0 -1
- package/cjs/domain/configuration/transportConfiguration.d.ts +0 -16
- package/cjs/domain/configuration/transportConfiguration.js +0 -42
- package/cjs/domain/configuration/transportConfiguration.js.map +0 -1
- package/cjs/domain/connectivity/connectivity.d.ts +0 -13
- package/cjs/domain/connectivity/connectivity.js +0 -14
- package/cjs/domain/connectivity/connectivity.js.map +0 -1
- package/cjs/domain/connectivity/index.d.ts +0 -1
- package/cjs/domain/connectivity/index.js +0 -18
- package/cjs/domain/connectivity/index.js.map +0 -1
- package/cjs/domain/console/consoleObservable.d.ts +0 -11
- package/cjs/domain/console/consoleObservable.js +0 -72
- package/cjs/domain/console/consoleObservable.js.map +0 -1
- package/cjs/domain/context/contextConstants.d.ts +0 -5
- package/cjs/domain/context/contextConstants.js +0 -3
- package/cjs/domain/context/contextConstants.js.map +0 -1
- package/cjs/domain/context/contextManager.d.ts +0 -12
- package/cjs/domain/context/contextManager.js +0 -43
- package/cjs/domain/context/contextManager.js.map +0 -1
- package/cjs/domain/context/customerDataTracker.d.ts +0 -45
- package/cjs/domain/context/customerDataTracker.js +0 -107
- package/cjs/domain/context/customerDataTracker.js.map +0 -1
- package/cjs/domain/context/storeContextManager.d.ts +0 -6
- package/cjs/domain/context/storeContextManager.js +0 -38
- package/cjs/domain/context/storeContextManager.js.map +0 -1
- package/cjs/domain/deflate/types.d.ts +0 -0
- package/cjs/domain/deflate/types.js +0 -3
- package/cjs/domain/deflate/types.js.map +0 -1
- package/cjs/domain/error/computeStackTrace.d.ts +0 -33
- package/cjs/domain/error/computeStackTrace.js +0 -142
- package/cjs/domain/error/computeStackTrace.js.map +0 -1
- package/cjs/domain/error/error.d.ts +0 -28
- package/cjs/domain/error/error.js +0 -131
- package/cjs/domain/error/error.js.map +0 -1
- package/cjs/domain/error/error.types.d.ts +0 -40
- package/cjs/domain/error/error.types.js +0 -13
- package/cjs/domain/error/error.types.js.map +0 -1
- package/cjs/domain/error/trackRuntimeError.d.ts +0 -13
- package/cjs/domain/error/trackRuntimeError.js +0 -54
- package/cjs/domain/error/trackRuntimeError.js.map +0 -1
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js +0 -40
- package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
- package/cjs/domain/report/browser.types.d.ts +0 -34
- package/cjs/domain/report/browser.types.js +0 -3
- package/cjs/domain/report/browser.types.js.map +0 -1
- package/cjs/domain/report/reportObservable.d.ts +0 -17
- package/cjs/domain/report/reportObservable.js +0 -94
- package/cjs/domain/report/reportObservable.js.map +0 -1
- package/cjs/domain/resourceUtils.d.ts +0 -16
- package/cjs/domain/resourceUtils.js +0 -3
- package/cjs/domain/resourceUtils.js.map +0 -1
- package/cjs/domain/session/oldCookiesMigration.d.ts +0 -11
- package/cjs/domain/session/oldCookiesMigration.js +0 -40
- package/cjs/domain/session/oldCookiesMigration.js.map +0 -1
- package/cjs/domain/session/sessionConstants.d.ts +0 -2
- package/cjs/domain/session/sessionConstants.js +0 -7
- package/cjs/domain/session/sessionConstants.js.map +0 -1
- package/cjs/domain/session/sessionManager.d.ts +0 -20
- package/cjs/domain/session/sessionManager.js +0 -65
- package/cjs/domain/session/sessionManager.js.map +0 -1
- package/cjs/domain/session/sessionState.d.ts +0 -11
- package/cjs/domain/session/sessionState.js +0 -45
- package/cjs/domain/session/sessionState.js.map +0 -1
- package/cjs/domain/session/sessionStore.d.ts +0 -34
- package/cjs/domain/session/sessionStore.js +0 -144
- package/cjs/domain/session/sessionStore.js.map +0 -1
- package/cjs/domain/session/sessionStoreOperations.d.ts +0 -10
- package/cjs/domain/session/sessionStoreOperations.js +0 -96
- package/cjs/domain/session/sessionStoreOperations.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
- package/cjs/domain/session/storeStrategies/sessionInCookie.js +0 -59
- package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +0 -41
- package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -15
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js +0 -5
- package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
- package/cjs/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
- package/cjs/domain/synthetics/syntheticsWorkerValues.js +0 -22
- package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
- package/cjs/domain/telemetry/index.d.ts +0 -3
- package/cjs/domain/telemetry/index.js +0 -28
- package/cjs/domain/telemetry/index.js.map +0 -1
- package/cjs/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -15
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js +0 -8
- package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
- package/cjs/domain/telemetry/telemetry.d.ts +0 -116
- package/cjs/domain/telemetry/telemetry.js +0 -157
- package/cjs/domain/telemetry/telemetry.js.map +0 -1
- package/cjs/domain/telemetry/telemetryEvent.types.d.ts +0 -391
- package/cjs/domain/telemetry/telemetryEvent.types.js +0 -7
- package/cjs/domain/telemetry/telemetryEvent.types.js.map +0 -1
- package/cjs/domain/user/index.d.ts +0 -2
- package/cjs/domain/user/index.js +0 -19
- package/cjs/domain/user/index.js.map +0 -1
- package/cjs/domain/user/user.d.ts +0 -12
- package/cjs/domain/user/user.js +0 -35
- package/cjs/domain/user/user.js.map +0 -1
- package/cjs/domain/user/user.types.d.ts +0 -6
- package/cjs/domain/user/user.types.js +0 -3
- package/cjs/domain/user/user.types.js.map +0 -1
- package/cjs/tools/abstractLifeCycle.d.ts +0 -23
- package/cjs/tools/abstractLifeCycle.js +0 -29
- package/cjs/tools/abstractLifeCycle.js.map +0 -1
- package/cjs/tools/boundedBuffer.d.ts +0 -5
- package/cjs/tools/boundedBuffer.js +0 -22
- package/cjs/tools/boundedBuffer.js.map +0 -1
- package/cjs/tools/catchUserErrors.d.ts +0 -1
- package/cjs/tools/catchUserErrors.js +0 -20
- package/cjs/tools/catchUserErrors.js.map +0 -1
- package/cjs/tools/display.d.ts +0 -35
- package/cjs/tools/display.js +0 -41
- package/cjs/tools/display.js.map +0 -1
- package/cjs/tools/encoder.d.ts +0 -53
- package/cjs/tools/encoder.js +0 -41
- package/cjs/tools/encoder.js.map +0 -1
- package/cjs/tools/experimentalFeatures.d.ts +0 -22
- package/cjs/tools/experimentalFeatures.js +0 -45
- package/cjs/tools/experimentalFeatures.js.map +0 -1
- package/cjs/tools/getGlobalObject.d.ts +0 -4
- package/cjs/tools/getGlobalObject.js +0 -37
- package/cjs/tools/getGlobalObject.js.map +0 -1
- package/cjs/tools/getZoneJsOriginalValue.d.ts +0 -19
- package/cjs/tools/getZoneJsOriginalValue.js +0 -30
- package/cjs/tools/getZoneJsOriginalValue.js.map +0 -1
- package/cjs/tools/instrumentMethod.d.ts +0 -59
- package/cjs/tools/instrumentMethod.js +0 -106
- package/cjs/tools/instrumentMethod.js.map +0 -1
- package/cjs/tools/matchOption.d.ts +0 -8
- package/cjs/tools/matchOption.js +0 -38
- package/cjs/tools/matchOption.js.map +0 -1
- package/cjs/tools/mergeInto.d.ts +0 -25
- package/cjs/tools/mergeInto.js +0 -105
- package/cjs/tools/mergeInto.js.map +0 -1
- package/cjs/tools/monitor.d.ts +0 -8
- package/cjs/tools/monitor.js +0 -76
- package/cjs/tools/monitor.js.map +0 -1
- package/cjs/tools/observable.d.ts +0 -12
- package/cjs/tools/observable.js +0 -43
- package/cjs/tools/observable.js.map +0 -1
- package/cjs/tools/readBytesFromStream.d.ts +0 -11
- package/cjs/tools/readBytesFromStream.js +0 -64
- package/cjs/tools/readBytesFromStream.js.map +0 -1
- package/cjs/tools/sendToExtension.d.ts +0 -3
- package/cjs/tools/sendToExtension.js +0 -11
- package/cjs/tools/sendToExtension.js.map +0 -1
- package/cjs/tools/serialisation/context.d.ts +0 -6
- package/cjs/tools/serialisation/context.js +0 -3
- package/cjs/tools/serialisation/context.js.map +0 -1
- package/cjs/tools/serialisation/jsonStringify.d.ts +0 -13
- package/cjs/tools/serialisation/jsonStringify.js +0 -49
- package/cjs/tools/serialisation/jsonStringify.js.map +0 -1
- package/cjs/tools/serialisation/sanitize.d.ts +0 -18
- package/cjs/tools/serialisation/sanitize.js +0 -185
- package/cjs/tools/serialisation/sanitize.js.map +0 -1
- package/cjs/tools/timer.d.ts +0 -5
- package/cjs/tools/timer.js +0 -23
- package/cjs/tools/timer.js.map +0 -1
- package/cjs/tools/utils/arrayUtils.d.ts +0 -1
- package/cjs/tools/utils/arrayUtils.js +0 -11
- package/cjs/tools/utils/arrayUtils.js.map +0 -1
- package/cjs/tools/utils/browserDetection.d.ts +0 -10
- package/cjs/tools/utils/browserDetection.js +0 -42
- package/cjs/tools/utils/browserDetection.js.map +0 -1
- package/cjs/tools/utils/byteUtils.d.ts +0 -4
- package/cjs/tools/utils/byteUtils.js +0 -31
- package/cjs/tools/utils/byteUtils.js.map +0 -1
- package/cjs/tools/utils/functionUtils.d.ts +0 -9
- package/cjs/tools/utils/functionUtils.js +0 -48
- package/cjs/tools/utils/functionUtils.js.map +0 -1
- package/cjs/tools/utils/numberUtils.d.ts +0 -8
- package/cjs/tools/utils/numberUtils.js +0 -24
- package/cjs/tools/utils/numberUtils.js.map +0 -1
- package/cjs/tools/utils/objectUtils.d.ts +0 -10
- package/cjs/tools/utils/objectUtils.js +0 -26
- package/cjs/tools/utils/objectUtils.js.map +0 -1
- package/cjs/tools/utils/polyfills.d.ts +0 -24
- package/cjs/tools/utils/polyfills.js +0 -110
- package/cjs/tools/utils/polyfills.js.map +0 -1
- package/cjs/tools/utils/responseUtils.d.ts +0 -2
- package/cjs/tools/utils/responseUtils.js +0 -18
- package/cjs/tools/utils/responseUtils.js.map +0 -1
- package/cjs/tools/utils/stringUtils.d.ts +0 -8
- package/cjs/tools/utils/stringUtils.js +0 -59
- package/cjs/tools/utils/stringUtils.js.map +0 -1
- package/cjs/tools/utils/timeUtils.d.ts +0 -57
- package/cjs/tools/utils/timeUtils.js +0 -99
- package/cjs/tools/utils/timeUtils.js.map +0 -1
- package/cjs/tools/utils/typeUtils.d.ts +0 -4
- package/cjs/tools/utils/typeUtils.js +0 -17
- package/cjs/tools/utils/typeUtils.js.map +0 -1
- package/cjs/tools/utils/urlPolyfill.d.ts +0 -14
- package/cjs/tools/utils/urlPolyfill.js +0 -92
- package/cjs/tools/utils/urlPolyfill.js.map +0 -1
- package/cjs/tools/valueHistory.d.ts +0 -50
- package/cjs/tools/valueHistory.js +0 -106
- package/cjs/tools/valueHistory.js.map +0 -1
- package/cjs/transport/batch.d.ts +0 -21
- package/cjs/transport/batch.js +0 -123
- package/cjs/transport/batch.js.map +0 -1
- package/cjs/transport/eventBridge.d.ts +0 -12
- package/cjs/transport/eventBridge.js +0 -34
- package/cjs/transport/eventBridge.js.map +0 -1
- package/cjs/transport/flushController.d.ts +0 -58
- package/cjs/transport/flushController.js +0 -112
- package/cjs/transport/flushController.js.map +0 -1
- package/cjs/transport/httpRequest.d.ts +0 -38
- package/cjs/transport/httpRequest.js +0 -95
- package/cjs/transport/httpRequest.js.map +0 -1
- package/cjs/transport/index.d.ts +0 -4
- package/cjs/transport/index.js +0 -13
- package/cjs/transport/index.js.map +0 -1
- package/cjs/transport/sendWithRetryStrategy.d.ts +0 -39
- package/cjs/transport/sendWithRetryStrategy.js +0 -151
- package/cjs/transport/sendWithRetryStrategy.js.map +0 -1
- package/cjs/transport/startBatchWithReplica.d.ts +0 -20
- package/cjs/transport/startBatchWithReplica.js +0 -42
- package/cjs/transport/startBatchWithReplica.js.map +0 -1
- package/esm/boot/init.d.ts +0 -5
- package/esm/boot/init.js +0 -31
- package/esm/boot/init.js.map +0 -1
- package/esm/browser/addEventListener.d.ts +0 -84
- package/esm/browser/addEventListener.js +0 -89
- package/esm/browser/addEventListener.js.map +0 -1
- package/esm/browser/cookie.d.ts +0 -17
- package/esm/browser/cookie.js +0 -76
- package/esm/browser/cookie.js.map +0 -1
- package/esm/browser/fetchObservable.d.ts +0 -23
- package/esm/browser/fetchObservable.js +0 -65
- package/esm/browser/fetchObservable.js.map +0 -1
- package/esm/browser/pageExitObservable.d.ts +0 -14
- package/esm/browser/pageExitObservable.js +0 -52
- package/esm/browser/pageExitObservable.js.map +0 -1
- package/esm/browser/runOnReadyState.d.ts +0 -2
- package/esm/browser/runOnReadyState.js +0 -11
- package/esm/browser/runOnReadyState.js.map +0 -1
- package/esm/browser/types.d.ts +0 -19
- package/esm/browser/types.js +0 -5
- package/esm/browser/types.js.map +0 -1
- package/esm/browser/xhrObservable.d.ts +0 -21
- package/esm/browser/xhrObservable.js +0 -81
- package/esm/browser/xhrObservable.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -72
- package/esm/domain/configuration/configuration.js +0 -89
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/endpointBuilder.d.ts +0 -10
- package/esm/domain/configuration/endpointBuilder.js +0 -80
- package/esm/domain/configuration/endpointBuilder.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/intakeSites.d.ts +0 -5
- package/esm/domain/configuration/intakeSites.js +0 -6
- package/esm/domain/configuration/intakeSites.js.map +0 -1
- package/esm/domain/configuration/tags.d.ts +0 -4
- package/esm/domain/configuration/tags.js +0 -34
- package/esm/domain/configuration/tags.js.map +0 -1
- package/esm/domain/configuration/transportConfiguration.d.ts +0 -16
- package/esm/domain/configuration/transportConfiguration.js +0 -38
- package/esm/domain/configuration/transportConfiguration.js.map +0 -1
- package/esm/domain/connectivity/connectivity.d.ts +0 -13
- package/esm/domain/connectivity/connectivity.js +0 -10
- package/esm/domain/connectivity/connectivity.js.map +0 -1
- package/esm/domain/connectivity/index.d.ts +0 -1
- package/esm/domain/connectivity/index.js +0 -2
- package/esm/domain/connectivity/index.js.map +0 -1
- package/esm/domain/console/consoleObservable.d.ts +0 -11
- package/esm/domain/console/consoleObservable.js +0 -67
- package/esm/domain/console/consoleObservable.js.map +0 -1
- package/esm/domain/context/contextConstants.d.ts +0 -5
- package/esm/domain/context/contextConstants.js +0 -2
- package/esm/domain/context/contextConstants.js.map +0 -1
- package/esm/domain/context/contextManager.d.ts +0 -12
- package/esm/domain/context/contextManager.js +0 -39
- package/esm/domain/context/contextManager.js.map +0 -1
- package/esm/domain/context/customerDataTracker.d.ts +0 -45
- package/esm/domain/context/customerDataTracker.js +0 -102
- package/esm/domain/context/customerDataTracker.js.map +0 -1
- package/esm/domain/context/storeContextManager.d.ts +0 -6
- package/esm/domain/context/storeContextManager.js +0 -32
- package/esm/domain/context/storeContextManager.js.map +0 -1
- package/esm/domain/deflate/index.d.ts +0 -1
- package/esm/domain/deflate/index.js +0 -2
- package/esm/domain/deflate/index.js.map +0 -1
- package/esm/domain/deflate/types.d.ts +0 -38
- package/esm/domain/deflate/types.js +0 -2
- package/esm/domain/deflate/types.js.map +0 -1
- package/esm/domain/error/computeStackTrace.d.ts +0 -33
- package/esm/domain/error/computeStackTrace.js +0 -137
- package/esm/domain/error/computeStackTrace.js.map +0 -1
- package/esm/domain/error/error.d.ts +0 -28
- package/esm/domain/error/error.js +0 -121
- package/esm/domain/error/error.js.map +0 -1
- package/esm/domain/error/error.types.d.ts +0 -40
- package/esm/domain/error/error.types.js +0 -10
- package/esm/domain/error/error.types.js.map +0 -1
- package/esm/domain/error/trackRuntimeError.d.ts +0 -13
- package/esm/domain/error/trackRuntimeError.js +0 -48
- package/esm/domain/error/trackRuntimeError.js.map +0 -1
- package/esm/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js +0 -36
- package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
- package/esm/domain/report/browser.types.d.ts +0 -34
- package/esm/domain/report/browser.types.js +0 -2
- package/esm/domain/report/browser.types.js.map +0 -1
- package/esm/domain/report/reportObservable.d.ts +0 -17
- package/esm/domain/report/reportObservable.js +0 -90
- package/esm/domain/report/reportObservable.js.map +0 -1
- package/esm/domain/resourceUtils.d.ts +0 -16
- package/esm/domain/resourceUtils.js +0 -2
- package/esm/domain/resourceUtils.js.map +0 -1
- package/esm/domain/session/oldCookiesMigration.d.ts +0 -11
- package/esm/domain/session/oldCookiesMigration.js +0 -36
- package/esm/domain/session/oldCookiesMigration.js.map +0 -1
- package/esm/domain/session/sessionConstants.d.ts +0 -2
- package/esm/domain/session/sessionConstants.js +0 -4
- package/esm/domain/session/sessionConstants.js.map +0 -1
- package/esm/domain/session/sessionManager.d.ts +0 -20
- package/esm/domain/session/sessionManager.js +0 -60
- package/esm/domain/session/sessionManager.js.map +0 -1
- package/esm/domain/session/sessionState.d.ts +0 -11
- package/esm/domain/session/sessionState.js +0 -38
- package/esm/domain/session/sessionState.js.map +0 -1
- package/esm/domain/session/sessionStore.d.ts +0 -34
- package/esm/domain/session/sessionStore.js +0 -139
- package/esm/domain/session/sessionStore.js.map +0 -1
- package/esm/domain/session/sessionStoreOperations.d.ts +0 -10
- package/esm/domain/session/sessionStoreOperations.js +0 -92
- package/esm/domain/session/sessionStoreOperations.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
- package/esm/domain/session/storeStrategies/sessionInCookie.js +0 -53
- package/esm/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +0 -36
- package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -15
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js +0 -2
- package/esm/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
- package/esm/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
- package/esm/domain/synthetics/syntheticsWorkerValues.js +0 -16
- package/esm/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
- package/esm/domain/telemetry/index.d.ts +0 -3
- package/esm/domain/telemetry/index.js +0 -4
- package/esm/domain/telemetry/index.js.map +0 -1
- package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -15
- package/esm/domain/telemetry/rawTelemetryEvent.types.js +0 -5
- package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
- package/esm/domain/telemetry/telemetry.d.ts +0 -116
- package/esm/domain/telemetry/telemetry.js +0 -145
- package/esm/domain/telemetry/telemetry.js.map +0 -1
- package/esm/domain/telemetry/telemetryEvent.types.d.ts +0 -391
- package/esm/domain/telemetry/telemetryEvent.types.js +0 -6
- package/esm/domain/telemetry/telemetryEvent.types.js.map +0 -1
- package/esm/domain/user/index.d.ts +0 -2
- package/esm/domain/user/index.js +0 -3
- package/esm/domain/user/index.js.map +0 -1
- package/esm/domain/user/user.d.ts +0 -12
- package/esm/domain/user/user.js +0 -30
- package/esm/domain/user/user.js.map +0 -1
- package/esm/domain/user/user.types.d.ts +0 -6
- package/esm/domain/user/user.types.js +0 -2
- package/esm/domain/user/user.types.js.map +0 -1
- package/esm/index.d.ts +0 -67
- package/esm/index.js +0 -64
- package/esm/index.js.map +0 -1
- package/esm/tools/abstractLifeCycle.d.ts +0 -23
- package/esm/tools/abstractLifeCycle.js +0 -26
- package/esm/tools/abstractLifeCycle.js.map +0 -1
- package/esm/tools/boundedBuffer.d.ts +0 -5
- package/esm/tools/boundedBuffer.js +0 -19
- package/esm/tools/boundedBuffer.js.map +0 -1
- package/esm/tools/catchUserErrors.d.ts +0 -1
- package/esm/tools/catchUserErrors.js +0 -16
- package/esm/tools/catchUserErrors.js.map +0 -1
- package/esm/tools/display.d.ts +0 -35
- package/esm/tools/display.js +0 -38
- package/esm/tools/display.js.map +0 -1
- package/esm/tools/encoder.d.ts +0 -53
- package/esm/tools/encoder.js +0 -37
- package/esm/tools/encoder.js.map +0 -1
- package/esm/tools/experimentalFeatures.d.ts +0 -22
- package/esm/tools/experimentalFeatures.js +0 -38
- package/esm/tools/experimentalFeatures.js.map +0 -1
- package/esm/tools/getGlobalObject.d.ts +0 -4
- package/esm/tools/getGlobalObject.js +0 -33
- package/esm/tools/getGlobalObject.js.map +0 -1
- package/esm/tools/getZoneJsOriginalValue.d.ts +0 -19
- package/esm/tools/getZoneJsOriginalValue.js +0 -26
- package/esm/tools/getZoneJsOriginalValue.js.map +0 -1
- package/esm/tools/instrumentMethod.d.ts +0 -59
- package/esm/tools/instrumentMethod.js +0 -101
- package/esm/tools/instrumentMethod.js.map +0 -1
- package/esm/tools/matchOption.d.ts +0 -8
- package/esm/tools/matchOption.js +0 -33
- package/esm/tools/matchOption.js.map +0 -1
- package/esm/tools/mergeInto.d.ts +0 -25
- package/esm/tools/mergeInto.js +0 -99
- package/esm/tools/mergeInto.js.map +0 -1
- package/esm/tools/monitor.d.ts +0 -8
- package/esm/tools/monitor.js +0 -66
- package/esm/tools/monitor.js.map +0 -1
- package/esm/tools/observable.d.ts +0 -12
- package/esm/tools/observable.js +0 -39
- package/esm/tools/observable.js.map +0 -1
- package/esm/tools/readBytesFromStream.d.ts +0 -11
- package/esm/tools/readBytesFromStream.js +0 -60
- package/esm/tools/readBytesFromStream.js.map +0 -1
- package/esm/tools/sendToExtension.d.ts +0 -3
- package/esm/tools/sendToExtension.js +0 -7
- package/esm/tools/sendToExtension.js.map +0 -1
- package/esm/tools/serialisation/context.d.ts +0 -6
- package/esm/tools/serialisation/context.js +0 -2
- package/esm/tools/serialisation/context.js.map +0 -1
- package/esm/tools/serialisation/jsonStringify.d.ts +0 -13
- package/esm/tools/serialisation/jsonStringify.js +0 -44
- package/esm/tools/serialisation/jsonStringify.js.map +0 -1
- package/esm/tools/serialisation/sanitize.d.ts +0 -18
- package/esm/tools/serialisation/sanitize.js +0 -181
- package/esm/tools/serialisation/sanitize.js.map +0 -1
- package/esm/tools/timer.d.ts +0 -5
- package/esm/tools/timer.js +0 -16
- package/esm/tools/timer.js.map +0 -1
- package/esm/tools/utils/arrayUtils.d.ts +0 -1
- package/esm/tools/utils/arrayUtils.js +0 -7
- package/esm/tools/utils/arrayUtils.js.map +0 -1
- package/esm/tools/utils/browserDetection.d.ts +0 -10
- package/esm/tools/utils/browserDetection.js +0 -35
- package/esm/tools/utils/browserDetection.js.map +0 -1
- package/esm/tools/utils/byteUtils.d.ts +0 -4
- package/esm/tools/utils/byteUtils.js +0 -26
- package/esm/tools/utils/byteUtils.js.map +0 -1
- package/esm/tools/utils/functionUtils.d.ts +0 -9
- package/esm/tools/utils/functionUtils.js +0 -43
- package/esm/tools/utils/functionUtils.js.map +0 -1
- package/esm/tools/utils/numberUtils.d.ts +0 -8
- package/esm/tools/utils/numberUtils.js +0 -17
- package/esm/tools/utils/numberUtils.js.map +0 -1
- package/esm/tools/utils/objectUtils.d.ts +0 -10
- package/esm/tools/utils/objectUtils.js +0 -19
- package/esm/tools/utils/objectUtils.js.map +0 -1
- package/esm/tools/utils/polyfills.d.ts +0 -24
- package/esm/tools/utils/polyfills.js +0 -95
- package/esm/tools/utils/polyfills.js.map +0 -1
- package/esm/tools/utils/responseUtils.d.ts +0 -2
- package/esm/tools/utils/responseUtils.js +0 -13
- package/esm/tools/utils/responseUtils.js.map +0 -1
- package/esm/tools/utils/stringUtils.d.ts +0 -8
- package/esm/tools/utils/stringUtils.js +0 -52
- package/esm/tools/utils/stringUtils.js.map +0 -1
- package/esm/tools/utils/timeUtils.d.ts +0 -57
- package/esm/tools/utils/timeUtils.js +0 -82
- package/esm/tools/utils/timeUtils.js.map +0 -1
- package/esm/tools/utils/typeUtils.d.ts +0 -4
- package/esm/tools/utils/typeUtils.js +0 -13
- package/esm/tools/utils/typeUtils.js.map +0 -1
- package/esm/tools/utils/urlPolyfill.d.ts +0 -14
- package/esm/tools/utils/urlPolyfill.js +0 -80
- package/esm/tools/utils/urlPolyfill.js.map +0 -1
- package/esm/tools/valueHistory.d.ts +0 -50
- package/esm/tools/valueHistory.js +0 -103
- package/esm/tools/valueHistory.js.map +0 -1
- package/esm/transport/batch.d.ts +0 -21
- package/esm/transport/batch.js +0 -120
- package/esm/transport/batch.js.map +0 -1
- package/esm/transport/eventBridge.d.ts +0 -12
- package/esm/transport/eventBridge.js +0 -29
- package/esm/transport/eventBridge.js.map +0 -1
- package/esm/transport/flushController.d.ts +0 -58
- package/esm/transport/flushController.js +0 -108
- package/esm/transport/flushController.js.map +0 -1
- package/esm/transport/httpRequest.d.ts +0 -38
- package/esm/transport/httpRequest.js +0 -89
- package/esm/transport/httpRequest.js.map +0 -1
- package/esm/transport/index.d.ts +0 -4
- package/esm/transport/index.js +0 -5
- package/esm/transport/index.js.map +0 -1
- package/esm/transport/sendWithRetryStrategy.d.ts +0 -39
- package/esm/transport/sendWithRetryStrategy.js +0 -146
- package/esm/transport/sendWithRetryStrategy.js.map +0 -1
- package/esm/transport/startBatchWithReplica.d.ts +0 -20
- package/esm/transport/startBatchWithReplica.js +0 -38
- package/esm/transport/startBatchWithReplica.js.map +0 -1
- package/src/domain/configuration/intakeSites.ts +0 -5
- package/src/domain/configuration/tags.ts +0 -43
- package/src/domain/context/customerDataTracker.ts +0 -134
- package/src/domain/user/index.ts +0 -2
- package/src/domain/user/user.ts +0 -33
- package/src/domain/user/user.types.ts +0 -6
- package/src/transport/startBatchWithReplica.ts +0 -68
package/esm/tools/mergeInto.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type Merged<TDestination, TSource> = TSource extends undefined ? TDestination : TDestination extends undefined ? TSource : TSource extends any[] ? TDestination extends any[] ? TDestination & TSource : TSource : TSource extends object ? TDestination extends object ? TDestination extends any[] ? TSource : TDestination & TSource : TSource : TSource;
|
|
2
|
-
/**
|
|
3
|
-
* Iterate over source and affect its sub values into destination, recursively.
|
|
4
|
-
* If the source and destination can't be merged, return source.
|
|
5
|
-
*/
|
|
6
|
-
export declare function mergeInto<D, S>(destination: D, source: S, circularReferenceChecker?: CircularReferenceChecker): Merged<D, S>;
|
|
7
|
-
/**
|
|
8
|
-
* A simplistic implementation of a deep clone algorithm.
|
|
9
|
-
* Caveats:
|
|
10
|
-
* - It doesn't maintain prototype chains - don't use with instances of custom classes.
|
|
11
|
-
* - It doesn't handle Map and Set
|
|
12
|
-
*/
|
|
13
|
-
export declare function deepClone<T>(value: T): T;
|
|
14
|
-
type Combined<A, B> = A extends null ? B : B extends null ? A : Merged<A, B>;
|
|
15
|
-
export declare function combine<A, B>(a: A, b: B): Combined<A, B>;
|
|
16
|
-
export declare function combine<A, B, C>(a: A, b: B, c: C): Combined<Combined<A, B>, C>;
|
|
17
|
-
export declare function combine<A, B, C, D>(a: A, b: B, c: C, d: D): Combined<Combined<Combined<A, B>, C>, D>;
|
|
18
|
-
export declare function combine<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): Combined<Combined<Combined<Combined<A, B>, C>, D>, E>;
|
|
19
|
-
export declare function combine<A, B, C, D, E, F>(a: A, b: B, c: C, d: D, e: E, f: F): Combined<Combined<Combined<Combined<Combined<A, B>, C>, D>, E>, F>;
|
|
20
|
-
export declare function combine<A, B, C, D, E, F, G>(a: A, b: B, c: C, d: D, e: E, f: F, g: G): Combined<Combined<Combined<Combined<Combined<Combined<A, B>, C>, D>, E>, F>, G>;
|
|
21
|
-
export declare function combine<A, B, C, D, E, F, G, H>(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): Combined<Combined<Combined<Combined<Combined<Combined<Combined<A, B>, C>, D>, E>, F>, G>, H>;
|
|
22
|
-
interface CircularReferenceChecker {
|
|
23
|
-
hasAlreadyBeenSeen(value: any): boolean;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/esm/tools/mergeInto.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { getType } from './utils/typeUtils';
|
|
2
|
-
/**
|
|
3
|
-
* Iterate over source and affect its sub values into destination, recursively.
|
|
4
|
-
* If the source and destination can't be merged, return source.
|
|
5
|
-
*/
|
|
6
|
-
export function mergeInto(destination, source, circularReferenceChecker) {
|
|
7
|
-
if (circularReferenceChecker === void 0) { circularReferenceChecker = createCircularReferenceChecker(); }
|
|
8
|
-
// ignore the source if it is undefined
|
|
9
|
-
if (source === undefined) {
|
|
10
|
-
return destination;
|
|
11
|
-
}
|
|
12
|
-
if (typeof source !== 'object' || source === null) {
|
|
13
|
-
// primitive values - just return source
|
|
14
|
-
return source;
|
|
15
|
-
}
|
|
16
|
-
else if (source instanceof Date) {
|
|
17
|
-
return new Date(source.getTime());
|
|
18
|
-
}
|
|
19
|
-
else if (source instanceof RegExp) {
|
|
20
|
-
var flags = source.flags ||
|
|
21
|
-
// old browsers compatibility
|
|
22
|
-
[
|
|
23
|
-
source.global ? 'g' : '',
|
|
24
|
-
source.ignoreCase ? 'i' : '',
|
|
25
|
-
source.multiline ? 'm' : '',
|
|
26
|
-
source.sticky ? 'y' : '',
|
|
27
|
-
source.unicode ? 'u' : '',
|
|
28
|
-
].join('');
|
|
29
|
-
return new RegExp(source.source, flags);
|
|
30
|
-
}
|
|
31
|
-
if (circularReferenceChecker.hasAlreadyBeenSeen(source)) {
|
|
32
|
-
// remove circular references
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
else if (Array.isArray(source)) {
|
|
36
|
-
var merged_1 = Array.isArray(destination) ? destination : [];
|
|
37
|
-
for (var i = 0; i < source.length; ++i) {
|
|
38
|
-
merged_1[i] = mergeInto(merged_1[i], source[i], circularReferenceChecker);
|
|
39
|
-
}
|
|
40
|
-
return merged_1;
|
|
41
|
-
}
|
|
42
|
-
var merged = getType(destination) === 'object' ? destination : {};
|
|
43
|
-
for (var key in source) {
|
|
44
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
45
|
-
merged[key] = mergeInto(merged[key], source[key], circularReferenceChecker);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return merged;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* A simplistic implementation of a deep clone algorithm.
|
|
52
|
-
* Caveats:
|
|
53
|
-
* - It doesn't maintain prototype chains - don't use with instances of custom classes.
|
|
54
|
-
* - It doesn't handle Map and Set
|
|
55
|
-
*/
|
|
56
|
-
export function deepClone(value) {
|
|
57
|
-
return mergeInto(undefined, value);
|
|
58
|
-
}
|
|
59
|
-
export function combine() {
|
|
60
|
-
var sources = [];
|
|
61
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
62
|
-
sources[_i] = arguments[_i];
|
|
63
|
-
}
|
|
64
|
-
var destination;
|
|
65
|
-
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
|
|
66
|
-
var source = sources_1[_a];
|
|
67
|
-
// Ignore any undefined or null sources.
|
|
68
|
-
if (source === undefined || source === null) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
destination = mergeInto(destination, source);
|
|
72
|
-
}
|
|
73
|
-
return destination;
|
|
74
|
-
}
|
|
75
|
-
function createCircularReferenceChecker() {
|
|
76
|
-
if (typeof WeakSet !== 'undefined') {
|
|
77
|
-
var set_1 = new WeakSet();
|
|
78
|
-
return {
|
|
79
|
-
hasAlreadyBeenSeen: function (value) {
|
|
80
|
-
var has = set_1.has(value);
|
|
81
|
-
if (!has) {
|
|
82
|
-
set_1.add(value);
|
|
83
|
-
}
|
|
84
|
-
return has;
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
var array = [];
|
|
89
|
-
return {
|
|
90
|
-
hasAlreadyBeenSeen: function (value) {
|
|
91
|
-
var has = array.indexOf(value) >= 0;
|
|
92
|
-
if (!has) {
|
|
93
|
-
array.push(value);
|
|
94
|
-
}
|
|
95
|
-
return has;
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=mergeInto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeInto.js","sourceRoot":"","sources":["../../src/tools/mergeInto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAwB3C;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,WAAc,EACd,MAAS,EACT,wBAA2D;IAA3D,yCAAA,EAAA,2BAA2B,8BAA8B,EAAE;IAE3D,uCAAuC;IACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,WAA2B,CAAA;IACpC,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClD,wCAAwC;QACxC,OAAO,MAAsB,CAAA;IAC/B,CAAC;SAAM,IAAI,MAAM,YAAY,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAA4B,CAAA;IAC9D,CAAC;SAAM,IAAI,MAAM,YAAY,MAAM,EAAE,CAAC;QACpC,IAAM,KAAK,GACT,MAAM,CAAC,KAAK;YACZ,6BAA6B;YAC7B;gBACE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,C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B,YAAC,KAAK;YACtB,IAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACrC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACnB,CAAC;YACD,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/esm/tools/monitor.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function startMonitorErrorCollection(newOnMonitorErrorCollected: (error: unknown) => void): void;
|
|
2
|
-
export declare function setDebugMode(newDebugMode: boolean): void;
|
|
3
|
-
export declare function resetMonitor(): void;
|
|
4
|
-
export declare function monitored<T extends (...params: any[]) => unknown>(_: any, __: string, descriptor: TypedPropertyDescriptor<T>): void;
|
|
5
|
-
export declare function monitor<T extends (...args: any[]) => any>(fn: T): T;
|
|
6
|
-
export declare function callMonitored<T extends (...args: any[]) => any>(fn: T, context: ThisParameterType<T>, args: Parameters<T>): ReturnType<T> | undefined;
|
|
7
|
-
export declare function callMonitored<T extends (this: void) => any>(fn: T): ReturnType<T> | undefined;
|
|
8
|
-
export declare function displayIfDebugEnabled(...args: any[]): void;
|
package/esm/tools/monitor.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import { display } from './display';
|
|
11
|
-
var onMonitorErrorCollected;
|
|
12
|
-
var debugMode = false;
|
|
13
|
-
export function startMonitorErrorCollection(newOnMonitorErrorCollected) {
|
|
14
|
-
onMonitorErrorCollected = newOnMonitorErrorCollected;
|
|
15
|
-
}
|
|
16
|
-
export function setDebugMode(newDebugMode) {
|
|
17
|
-
debugMode = newDebugMode;
|
|
18
|
-
}
|
|
19
|
-
export function resetMonitor() {
|
|
20
|
-
onMonitorErrorCollected = undefined;
|
|
21
|
-
debugMode = false;
|
|
22
|
-
}
|
|
23
|
-
export function monitored(_, __, descriptor) {
|
|
24
|
-
var originalMethod = descriptor.value;
|
|
25
|
-
descriptor.value = function () {
|
|
26
|
-
var args = [];
|
|
27
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28
|
-
args[_i] = arguments[_i];
|
|
29
|
-
}
|
|
30
|
-
var decorated = onMonitorErrorCollected ? monitor(originalMethod) : originalMethod;
|
|
31
|
-
return decorated.apply(this, args);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function monitor(fn) {
|
|
35
|
-
return function () {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
37
|
-
return callMonitored(fn, this, arguments);
|
|
38
|
-
}; // consider output type has input type
|
|
39
|
-
}
|
|
40
|
-
export function callMonitored(fn, context, args) {
|
|
41
|
-
try {
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
43
|
-
return fn.apply(context, args);
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
displayIfDebugEnabled(e);
|
|
47
|
-
if (onMonitorErrorCollected) {
|
|
48
|
-
try {
|
|
49
|
-
onMonitorErrorCollected(e);
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
displayIfDebugEnabled(e);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export function displayIfDebugEnabled() {
|
|
58
|
-
var args = [];
|
|
59
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
60
|
-
args[_i] = arguments[_i];
|
|
61
|
-
}
|
|
62
|
-
if (debugMode) {
|
|
63
|
-
display.error.apply(display, __spreadArray(['[MONITOR]'], args, false));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=monitor.js.map
|
package/esm/tools/monitor.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monitor.js","sourceRoot":"","sources":["../../src/tools/monitor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,IAAI,uBAA+D,CAAA;AACnE,IAAI,SAAS,GAAG,KAAK,CAAA;AAErB,MAAM,UAAU,2BAA2B,CAAC,0BAAoD;IAC9F,uBAAuB,GAAG,0BAA0B,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,YAAqB;IAChD,SAAS,GAAG,YAAY,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,uBAAuB,GAAG,SAAS,CAAA;IACnC,SAAS,GAAG,KAAK,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,CAAM,EACN,EAAU,EACV,UAAsC;IAEtC,IAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAA;IACxC,UAAU,CAAC,KAAK,GAAG;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAC5D,IAAM,SAAS,GAAG,uBAAuB,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;QACpF,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAkB,CAAA;IACrD,CAAM,CAAA;AACR,CAAC;AAED,MAAM,UAAU,OAAO,CAAoC,EAAK;IAC9D,OAAO;QACL,+DAA+D;QAC/D,OAAO,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,SAAqC,CAAC,CAAA;IACvE,CAAiB,CAAA,CAAC,sCAAsC;AAC1D,CAAC;AAQD,MAAM,UAAU,aAAa,CAC3B,EAAK,EACL,OAAa,EACb,IAAU;IAEV,IAAI,CAAC;QACH,+DAA+D;QAC/D,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,uBAAuB,EAAE,CAAC;YAC5B,IAAI,CAAC;gBACH,uBAAuB,CAAC,CAAC,CAAC,CAAA;YAC5B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,qBAAqB,CAAC,CAAC,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB;IAAC,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,yBAAc;;IAClD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,OAAb,OAAO,iBAAO,WAAW,GAAK,IAAI,UAAC;IACrC,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface Subscription {
|
|
2
|
-
unsubscribe: () => void;
|
|
3
|
-
}
|
|
4
|
-
export declare class Observable<T> {
|
|
5
|
-
private onFirstSubscribe?;
|
|
6
|
-
private observers;
|
|
7
|
-
private onLastUnsubscribe?;
|
|
8
|
-
constructor(onFirstSubscribe?: ((observable: Observable<T>) => (() => void) | void) | undefined);
|
|
9
|
-
subscribe(f: (data: T) => void): Subscription;
|
|
10
|
-
notify(data: T): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function mergeObservables<T>(...observables: Array<Observable<T>>): Observable<T>;
|
package/esm/tools/observable.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var Observable = /** @class */ (function () {
|
|
2
|
-
function Observable(onFirstSubscribe) {
|
|
3
|
-
this.onFirstSubscribe = onFirstSubscribe;
|
|
4
|
-
this.observers = [];
|
|
5
|
-
}
|
|
6
|
-
Observable.prototype.subscribe = function (f) {
|
|
7
|
-
var _this = this;
|
|
8
|
-
if (!this.observers.length && this.onFirstSubscribe) {
|
|
9
|
-
this.onLastUnsubscribe = this.onFirstSubscribe(this) || undefined;
|
|
10
|
-
}
|
|
11
|
-
this.observers.push(f);
|
|
12
|
-
return {
|
|
13
|
-
unsubscribe: function () {
|
|
14
|
-
_this.observers = _this.observers.filter(function (other) { return f !== other; });
|
|
15
|
-
if (!_this.observers.length && _this.onLastUnsubscribe) {
|
|
16
|
-
_this.onLastUnsubscribe();
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
Observable.prototype.notify = function (data) {
|
|
22
|
-
this.observers.forEach(function (observer) { return observer(data); });
|
|
23
|
-
};
|
|
24
|
-
return Observable;
|
|
25
|
-
}());
|
|
26
|
-
export { Observable };
|
|
27
|
-
export function mergeObservables() {
|
|
28
|
-
var observables = [];
|
|
29
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
30
|
-
observables[_i] = arguments[_i];
|
|
31
|
-
}
|
|
32
|
-
return new Observable(function (globalObservable) {
|
|
33
|
-
var subscriptions = observables.map(function (observable) {
|
|
34
|
-
return observable.subscribe(function (data) { return globalObservable.notify(data); });
|
|
35
|
-
});
|
|
36
|
-
return function () { return subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); }); };
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=observable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/tools/observable.ts"],"names":[],"mappings":"AAIA;IAIE,oBAAoB,gBAAqE;QAArE,qBAAgB,GAAhB,gBAAgB,CAAqD;QAHjF,cAAS,GAA6B,EAAE,CAAA;IAG4C,CAAC;IAE7F,8BAAS,GAAT,UAAU,CAAoB;QAA9B,iBAaC;QAZC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,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CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type Options = {
|
|
2
|
-
bytesLimit: number;
|
|
3
|
-
collectStreamBody?: boolean;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Read bytes from a ReadableStream until at least `limit` bytes have been read (or until the end of
|
|
7
|
-
* the stream). The callback is invoked with the at most `limit` bytes, and indicates that the limit
|
|
8
|
-
* has been exceeded if more bytes were available.
|
|
9
|
-
*/
|
|
10
|
-
export declare function readBytesFromStream(stream: ReadableStream<Uint8Array>, callback: (error?: Error, bytes?: Uint8Array, limitExceeded?: boolean) => void, options: Options): void;
|
|
11
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { monitor } from './monitor';
|
|
2
|
-
import { noop } from './utils/functionUtils';
|
|
3
|
-
/**
|
|
4
|
-
* Read bytes from a ReadableStream until at least `limit` bytes have been read (or until the end of
|
|
5
|
-
* the stream). The callback is invoked with the at most `limit` bytes, and indicates that the limit
|
|
6
|
-
* has been exceeded if more bytes were available.
|
|
7
|
-
*/
|
|
8
|
-
export function readBytesFromStream(stream, callback, options) {
|
|
9
|
-
var reader = stream.getReader();
|
|
10
|
-
var chunks = [];
|
|
11
|
-
var readBytesCount = 0;
|
|
12
|
-
readMore();
|
|
13
|
-
function readMore() {
|
|
14
|
-
reader.read().then(monitor(function (result) {
|
|
15
|
-
if (result.done) {
|
|
16
|
-
onDone();
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (options.collectStreamBody) {
|
|
20
|
-
chunks.push(result.value);
|
|
21
|
-
}
|
|
22
|
-
readBytesCount += result.value.length;
|
|
23
|
-
if (readBytesCount > options.bytesLimit) {
|
|
24
|
-
onDone();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
readMore();
|
|
28
|
-
}
|
|
29
|
-
}), monitor(function (error) { return callback(error); }));
|
|
30
|
-
}
|
|
31
|
-
function onDone() {
|
|
32
|
-
reader.cancel().catch(
|
|
33
|
-
// we don't care if cancel fails, but we still need to catch the error to avoid reporting it
|
|
34
|
-
// as an unhandled rejection
|
|
35
|
-
noop);
|
|
36
|
-
var bytes;
|
|
37
|
-
var limitExceeded;
|
|
38
|
-
if (options.collectStreamBody) {
|
|
39
|
-
var completeBuffer_1;
|
|
40
|
-
if (chunks.length === 1) {
|
|
41
|
-
// optimization: if the response is small enough to fit in a single buffer (provided by the browser), just
|
|
42
|
-
// use it directly.
|
|
43
|
-
completeBuffer_1 = chunks[0];
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
// else, we need to copy buffers into a larger buffer to concatenate them.
|
|
47
|
-
completeBuffer_1 = new Uint8Array(readBytesCount);
|
|
48
|
-
var offset_1 = 0;
|
|
49
|
-
chunks.forEach(function (chunk) {
|
|
50
|
-
completeBuffer_1.set(chunk, offset_1);
|
|
51
|
-
offset_1 += chunk.length;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
bytes = completeBuffer_1.slice(0, options.bytesLimit);
|
|
55
|
-
limitExceeded = completeBuffer_1.length > options.bytesLimit;
|
|
56
|
-
}
|
|
57
|
-
callback(undefined, bytes, limitExceeded);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=readBytesFromStream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readBytesFromStream.js","sourceRoot":"","sources":["../../src/tools/readBytesFromStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAM5C;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAkC,EAClC,QAA8E,EAC9E,OAAgB;IAEhB,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;IACjC,IAAM,MAAM,GAAiB,EAAE,CAAA;IAC/B,IAAI,cAAc,GAAG,CAAC,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C,KAAK,EAAE,QAAM,CAAC,CAAA;oBACjC,QAAM,IAAI,KAAK,CAAC,MAAM,CAAA;gBACxB,CAAC,CAAC,CAAA;YACJ,CAAC;YACD,KAAK,GAAG,gBAAc,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;YACnD,aAAa,GAAG,gBAAc,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,CAAA;QAC5D,CAAC;QAED,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendToExtension.js","sourceRoot":"","sources":["../../src/tools/sendToExtension.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,eAAe,CAAC,IAA0B,EAAE,OAAgB;IAC1E,IAAM,QAAQ,GAAI,MAAwB,CAAC,+BAA+B,CAAA;IAC1E,IAAI,QAAQ,EAAE,CAAC;QACb,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/tools/serialisation/context.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that
|
|
3
|
-
* because some sites badly override toJSON on certain objects. Removing all toJSON methods from
|
|
4
|
-
* nested values would be too costly, so we just detach them from the root value, and native classes
|
|
5
|
-
* used to build JSON values (Array and Object).
|
|
6
|
-
*
|
|
7
|
-
* Note: this still assumes that JSON.stringify is correct.
|
|
8
|
-
*/
|
|
9
|
-
export declare function jsonStringify(value: unknown, replacer?: Array<string | number>, space?: string | number): string | undefined;
|
|
10
|
-
export interface ObjectWithToJsonMethod {
|
|
11
|
-
toJSON?: () => unknown;
|
|
12
|
-
}
|
|
13
|
-
export declare function detachToJsonMethod(value: object): () => void;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { noop } from '../utils/functionUtils';
|
|
2
|
-
/**
|
|
3
|
-
* Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that
|
|
4
|
-
* because some sites badly override toJSON on certain objects. Removing all toJSON methods from
|
|
5
|
-
* nested values would be too costly, so we just detach them from the root value, and native classes
|
|
6
|
-
* used to build JSON values (Array and Object).
|
|
7
|
-
*
|
|
8
|
-
* Note: this still assumes that JSON.stringify is correct.
|
|
9
|
-
*/
|
|
10
|
-
export function jsonStringify(value, replacer, space) {
|
|
11
|
-
if (typeof value !== 'object' || value === null) {
|
|
12
|
-
return JSON.stringify(value);
|
|
13
|
-
}
|
|
14
|
-
// Note: The order matter here. We need to detach toJSON methods on parent classes before their
|
|
15
|
-
// subclasses.
|
|
16
|
-
var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);
|
|
17
|
-
var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);
|
|
18
|
-
var restoreValuePrototypeToJson = detachToJsonMethod(Object.getPrototypeOf(value));
|
|
19
|
-
var restoreValueToJson = detachToJsonMethod(value);
|
|
20
|
-
try {
|
|
21
|
-
return JSON.stringify(value, replacer, space);
|
|
22
|
-
}
|
|
23
|
-
catch (_a) {
|
|
24
|
-
return '<error: unable to serialize object>';
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
restoreObjectPrototypeToJson();
|
|
28
|
-
restoreArrayPrototypeToJson();
|
|
29
|
-
restoreValuePrototypeToJson();
|
|
30
|
-
restoreValueToJson();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function detachToJsonMethod(value) {
|
|
34
|
-
var object = value;
|
|
35
|
-
var objectToJson = object.toJSON;
|
|
36
|
-
if (objectToJson) {
|
|
37
|
-
delete object.toJSON;
|
|
38
|
-
return function () {
|
|
39
|
-
object.toJSON = objectToJson;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return noop;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=jsonStringify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonStringify.js","sourceRoot":"","sources":["../../../src/tools/serialisation/jsonStringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAc,EACd,QAAiC,EACjC,KAAuB;IAEvB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,+FAA+F;IAC/F,cAAc;IACd,IAAM,4BAA4B,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACzE,IAAM,2BAA2B,GAAG,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IACvE,IAAM,2BAA2B,GAAG,kBAAkB,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;IACpF,IAAM,kBAAkB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAEpD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC/C,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,qCAAqC,CAAA;IAC9C,CAAC;YAAS,CAAC;QACT,4BAA4B,EAAE,CAAA;QAC9B,2BAA2B,EAAE,CAAA;QAC7B,2BAA2B,EAAE,CAAA;QAC7B,kBAAkB,EAAE,CAAA;IACtB,CAAC;AACH,CAAC;AAMD,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAM,MAAM,GAAG,KAA+B,CAAA;IAC9C,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;IAClC,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,MAAM,CAAA;QACpB,OAAO;YACL,MAAM,CAAC,MAAM,GAAG,YAAY,CAAA;QAC9B,CAAC,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Context, ContextValue } from './context';
|
|
2
|
-
/**
|
|
3
|
-
* Ensures user-provided data is 'safe' for the SDK
|
|
4
|
-
* - Deep clones data
|
|
5
|
-
* - Removes cyclic references
|
|
6
|
-
* - Transforms unserializable types to a string representation
|
|
7
|
-
*
|
|
8
|
-
* LIMITATIONS:
|
|
9
|
-
* - Size is in characters, not byte count (may differ according to character encoding)
|
|
10
|
-
* - Size does not take into account indentation that can be applied to JSON.stringify
|
|
11
|
-
* - Non-numerical properties of Arrays are ignored. Same behavior as JSON.stringify
|
|
12
|
-
*
|
|
13
|
-
* @param source User-provided data meant to be serialized using JSON.stringify
|
|
14
|
-
* @param maxCharacterCount Maximum number of characters allowed in serialized form
|
|
15
|
-
*/
|
|
16
|
-
export declare function sanitize(source: string, maxCharacterCount?: number): string | undefined;
|
|
17
|
-
export declare function sanitize(source: Context, maxCharacterCount?: number): Context;
|
|
18
|
-
export declare function sanitize(source: unknown, maxCharacterCount?: number): ContextValue;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { display } from '../display';
|
|
2
|
-
import { ONE_KIBI_BYTE } from '../utils/byteUtils';
|
|
3
|
-
import { detachToJsonMethod } from './jsonStringify';
|
|
4
|
-
// The maximum size of a single event is 256KiB. By default, we ensure that user-provided data
|
|
5
|
-
// going through sanitize fits inside our events, while leaving room for other contexts, metadata, ...
|
|
6
|
-
var SANITIZE_DEFAULT_MAX_CHARACTER_COUNT = 220 * ONE_KIBI_BYTE;
|
|
7
|
-
// Symbol for the root element of the JSONPath used for visited objects
|
|
8
|
-
var JSON_PATH_ROOT_ELEMENT = '$';
|
|
9
|
-
// When serializing (using JSON.stringify) a key of an object, { key: 42 } gets wrapped in quotes as "key".
|
|
10
|
-
// With the separator (:), we need to add 3 characters to the count.
|
|
11
|
-
var KEY_DECORATION_LENGTH = 3;
|
|
12
|
-
export function sanitize(source, maxCharacterCount) {
|
|
13
|
-
var _a;
|
|
14
|
-
if (maxCharacterCount === void 0) { maxCharacterCount = SANITIZE_DEFAULT_MAX_CHARACTER_COUNT; }
|
|
15
|
-
// Unbind any toJSON function we may have on [] or {} prototypes
|
|
16
|
-
var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);
|
|
17
|
-
var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);
|
|
18
|
-
// Initial call to sanitizeProcessor - will populate containerQueue if source is an Array or a plain Object
|
|
19
|
-
var containerQueue = [];
|
|
20
|
-
var visitedObjectsWithPath = new WeakMap();
|
|
21
|
-
var sanitizedData = sanitizeProcessor(source, JSON_PATH_ROOT_ELEMENT, undefined, containerQueue, visitedObjectsWithPath);
|
|
22
|
-
var accumulatedCharacterCount = ((_a = JSON.stringify(sanitizedData)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
23
|
-
if (accumulatedCharacterCount > maxCharacterCount) {
|
|
24
|
-
warnOverCharacterLimit(maxCharacterCount, 'discarded', source);
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
while (containerQueue.length > 0 && accumulatedCharacterCount < maxCharacterCount) {
|
|
28
|
-
var containerToProcess = containerQueue.shift();
|
|
29
|
-
var separatorLength = 0; // 0 for the first element, 1 for subsequent elements
|
|
30
|
-
// Arrays and Objects have to be handled distinctly to ensure
|
|
31
|
-
// we do not pick up non-numerical properties from Arrays
|
|
32
|
-
if (Array.isArray(containerToProcess.source)) {
|
|
33
|
-
for (var key = 0; key < containerToProcess.source.length; key++) {
|
|
34
|
-
var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);
|
|
35
|
-
if (targetData !== undefined) {
|
|
36
|
-
accumulatedCharacterCount += JSON.stringify(targetData).length;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// When an element of an Array (targetData) is undefined, it is serialized as null:
|
|
40
|
-
// JSON.stringify([undefined]) => '[null]' - This accounts for 4 characters
|
|
41
|
-
accumulatedCharacterCount += 4;
|
|
42
|
-
}
|
|
43
|
-
accumulatedCharacterCount += separatorLength;
|
|
44
|
-
separatorLength = 1;
|
|
45
|
-
if (accumulatedCharacterCount > maxCharacterCount) {
|
|
46
|
-
warnOverCharacterLimit(maxCharacterCount, 'truncated', source);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
;
|
|
50
|
-
containerToProcess.target[key] = targetData;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
for (var key in containerToProcess.source) {
|
|
55
|
-
if (Object.prototype.hasOwnProperty.call(containerToProcess.source, key)) {
|
|
56
|
-
var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);
|
|
57
|
-
// When a property of an object has an undefined value, it will be dropped during serialization:
|
|
58
|
-
// JSON.stringify({a:undefined}) => '{}'
|
|
59
|
-
if (targetData !== undefined) {
|
|
60
|
-
accumulatedCharacterCount +=
|
|
61
|
-
JSON.stringify(targetData).length + separatorLength + key.length + KEY_DECORATION_LENGTH;
|
|
62
|
-
separatorLength = 1;
|
|
63
|
-
}
|
|
64
|
-
if (accumulatedCharacterCount > maxCharacterCount) {
|
|
65
|
-
warnOverCharacterLimit(maxCharacterCount, 'truncated', source);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
;
|
|
69
|
-
containerToProcess.target[key] = targetData;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Rebind detached toJSON functions
|
|
75
|
-
restoreObjectPrototypeToJson();
|
|
76
|
-
restoreArrayPrototypeToJson();
|
|
77
|
-
return sanitizedData;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Internal function to factorize the process common to the
|
|
81
|
-
* initial call to sanitize, and iterations for Arrays and Objects
|
|
82
|
-
*
|
|
83
|
-
*/
|
|
84
|
-
function sanitizeProcessor(source, parentPath, key, queue, visitedObjectsWithPath) {
|
|
85
|
-
// Start by handling toJSON, as we want to sanitize its output
|
|
86
|
-
var sourceToSanitize = tryToApplyToJSON(source);
|
|
87
|
-
if (!sourceToSanitize || typeof sourceToSanitize !== 'object') {
|
|
88
|
-
return sanitizePrimitivesAndFunctions(sourceToSanitize);
|
|
89
|
-
}
|
|
90
|
-
var sanitizedSource = sanitizeObjects(sourceToSanitize);
|
|
91
|
-
if (sanitizedSource !== '[Object]' && sanitizedSource !== '[Array]' && sanitizedSource !== '[Error]') {
|
|
92
|
-
return sanitizedSource;
|
|
93
|
-
}
|
|
94
|
-
// Handle potential cyclic references
|
|
95
|
-
// We need to use source as sourceToSanitize could be a reference to a new object
|
|
96
|
-
// At this stage, we know the source is an object type
|
|
97
|
-
var sourceAsObject = source;
|
|
98
|
-
if (visitedObjectsWithPath.has(sourceAsObject)) {
|
|
99
|
-
return "[Reference seen at ".concat(visitedObjectsWithPath.get(sourceAsObject), "]");
|
|
100
|
-
}
|
|
101
|
-
// Add processed source to queue
|
|
102
|
-
var currentPath = key !== undefined ? "".concat(parentPath, ".").concat(key) : parentPath;
|
|
103
|
-
var target = Array.isArray(sourceToSanitize) ? [] : {};
|
|
104
|
-
visitedObjectsWithPath.set(sourceAsObject, currentPath);
|
|
105
|
-
queue.push({ source: sourceToSanitize, target: target, path: currentPath });
|
|
106
|
-
return target;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Handles sanitization of simple, non-object types
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
112
|
-
function sanitizePrimitivesAndFunctions(value) {
|
|
113
|
-
// BigInt cannot be serialized by JSON.stringify(), convert it to a string representation
|
|
114
|
-
if (typeof value === 'bigint') {
|
|
115
|
-
return "[BigInt] ".concat(value.toString());
|
|
116
|
-
}
|
|
117
|
-
// Functions cannot be serialized by JSON.stringify(). Moreover, if a faulty toJSON is present, it needs to be converted
|
|
118
|
-
// so it won't prevent stringify from serializing later
|
|
119
|
-
if (typeof value === 'function') {
|
|
120
|
-
return "[Function] ".concat(value.name || 'unknown');
|
|
121
|
-
}
|
|
122
|
-
// JSON.stringify() does not serialize symbols.
|
|
123
|
-
if (typeof value === 'symbol') {
|
|
124
|
-
return "[Symbol] ".concat(value.description || value.toString());
|
|
125
|
-
}
|
|
126
|
-
return value;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Handles sanitization of object types
|
|
130
|
-
*
|
|
131
|
-
* LIMITATIONS
|
|
132
|
-
* - If a class defines a toStringTag Symbol, it will fall in the catch-all method and prevent enumeration of properties.
|
|
133
|
-
* To avoid this, a toJSON method can be defined.
|
|
134
|
-
* - IE11 does not return a distinct type for objects such as Map, WeakMap, ... These objects will pass through and their
|
|
135
|
-
* properties enumerated if any.
|
|
136
|
-
*
|
|
137
|
-
*/
|
|
138
|
-
function sanitizeObjects(value) {
|
|
139
|
-
try {
|
|
140
|
-
// Handle events - Keep a simple implementation to avoid breaking changes
|
|
141
|
-
if (value instanceof Event) {
|
|
142
|
-
return {
|
|
143
|
-
isTrusted: value.isTrusted,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
// Handle all remaining object types in a generic way
|
|
147
|
-
var result = Object.prototype.toString.call(value);
|
|
148
|
-
var match = result.match(/\[object (.*)\]/);
|
|
149
|
-
if (match && match[1]) {
|
|
150
|
-
return "[".concat(match[1], "]");
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (_a) {
|
|
154
|
-
// If the previous serialization attempts failed, and we cannot convert using
|
|
155
|
-
// Object.prototype.toString, declare the value unserializable
|
|
156
|
-
}
|
|
157
|
-
return '[Unserializable]';
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Checks if a toJSON function exists and tries to execute it
|
|
161
|
-
*
|
|
162
|
-
*/
|
|
163
|
-
function tryToApplyToJSON(value) {
|
|
164
|
-
var object = value;
|
|
165
|
-
if (object && typeof object.toJSON === 'function') {
|
|
166
|
-
try {
|
|
167
|
-
return object.toJSON();
|
|
168
|
-
}
|
|
169
|
-
catch (_a) {
|
|
170
|
-
// If toJSON fails, we continue by trying to serialize the value manually
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return value;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Helper function to display the warning when the accumulated character count is over the limit
|
|
177
|
-
*/
|
|
178
|
-
function warnOverCharacterLimit(maxCharacterCount, changeType, source) {
|
|
179
|
-
display.warn("The data provided has been ".concat(changeType, " as it is over the limit of ").concat(maxCharacterCount, " characters:"), source);
|
|
180
|
-
}
|
|
181
|
-
//# sourceMappingURL=sanitize.js.map
|