@scalebun/react-native 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scalebun.full.js +33132 -0
- package/dist/scalebun.full.js.map +1 -0
- package/dist/scalebun.slim.js +29930 -0
- package/dist/scalebun.slim.js.map +1 -0
- package/lib/commonjs/bootstrap/FeatureRegistry.js +4 -4
- package/lib/commonjs/bootstrap/FeatureRegistry.js.map +1 -1
- package/lib/commonjs/bootstrap/SDKBootstrapper.js +8 -8
- package/lib/commonjs/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/commonjs/core/config/schema.js +412 -232
- package/lib/commonjs/core/config/schema.js.map +1 -1
- package/lib/commonjs/core/constants/protocol.js +31 -0
- package/lib/commonjs/core/constants/protocol.js.map +1 -0
- package/lib/commonjs/core/constants/timings.js +4 -1
- package/lib/commonjs/core/constants/timings.js.map +1 -1
- package/lib/commonjs/core/lifecycle/appLifecycle.js +1 -1
- package/lib/commonjs/core/lifecycle/appLifecycle.js.map +1 -1
- package/lib/commonjs/debug/bootstrap.js +30 -10
- package/lib/commonjs/debug/bootstrap.js.map +1 -1
- package/lib/commonjs/debug/exportBridge.js +5 -3
- package/lib/commonjs/debug/exportBridge.js.map +1 -1
- package/lib/commonjs/debug/hostResolver.js +2 -2
- package/lib/commonjs/debug/hostResolver.js.map +1 -1
- package/lib/commonjs/debug/perfWiring.js +4 -4
- package/lib/commonjs/debug/perfWiring.js.map +1 -1
- package/lib/commonjs/debug/replayWiring.js +5 -5
- package/lib/commonjs/debug/replayWiring.js.map +1 -1
- package/lib/commonjs/debug/screenTracking.js +2 -2
- package/lib/commonjs/debug/screenTracking.js.map +1 -1
- package/lib/commonjs/debug/sessionWiring.js +2 -2
- package/lib/commonjs/debug/sessionWiring.js.map +1 -1
- package/lib/commonjs/features/crash/NativeCrashFeature.js +1 -1
- package/lib/commonjs/features/crash/NativeCrashFeature.js.map +1 -1
- package/lib/commonjs/features/crash/globalHandler.js +3 -3
- package/lib/commonjs/features/crash/globalHandler.js.map +1 -1
- package/lib/commonjs/features/crash/nativeCrashBridge.js +7 -7
- package/lib/commonjs/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/commonjs/features/crash/rejectionHandler.js +2 -2
- package/lib/commonjs/features/crash/rejectionHandler.js.map +1 -1
- package/lib/commonjs/features/engage/EngageArchetypeRenderers.js +0 -9
- package/lib/commonjs/features/engage/EngageArchetypeRenderers.js.map +1 -1
- package/lib/commonjs/features/engage/EngageInAppView.js +1 -1
- package/lib/commonjs/features/engage/EngageInAppView.js.map +1 -1
- package/lib/commonjs/features/engage/EngagePromptProvider.js +17 -17
- package/lib/commonjs/features/engage/EngagePromptProvider.js.map +1 -1
- package/lib/commonjs/features/engage/EngageTransport.js +5 -5
- package/lib/commonjs/features/engage/EngageTransport.js.map +1 -1
- package/lib/commonjs/features/engage/engagePushTokenBridge.js +4 -4
- package/lib/commonjs/features/engage/engagePushTokenBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageShakeBridge.js +2 -2
- package/lib/commonjs/features/engage/engageShakeBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageSignals.js +1 -1
- package/lib/commonjs/features/engage/engageSignals.js.map +1 -1
- package/lib/commonjs/features/engage/engageStoreReviewBridge.js +2 -2
- package/lib/commonjs/features/engage/engageStoreReviewBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageTestSeenStore.js +1 -1
- package/lib/commonjs/features/engage/engageTestSeenStore.js.map +1 -1
- package/lib/commonjs/features/engage/engageThrottle.js +4 -4
- package/lib/commonjs/features/engage/engageThrottle.js.map +1 -1
- package/lib/commonjs/features/engage/engageTriggerEngine.js +4 -4
- package/lib/commonjs/features/engage/engageTriggerEngine.js.map +1 -1
- package/lib/commonjs/features/engage/engageWindowInsets.js +1 -1
- package/lib/commonjs/features/engage/engageWindowInsets.js.map +1 -1
- package/lib/commonjs/features/install-referrer/installReferrer.js +3 -3
- package/lib/commonjs/features/install-referrer/installReferrer.js.map +1 -1
- package/lib/commonjs/features/journey/calibrationContext.js +0 -9
- package/lib/commonjs/features/journey/calibrationContext.js.map +1 -1
- package/lib/commonjs/features/journey/journeyManager.js +4 -1
- package/lib/commonjs/features/journey/journeyManager.js.map +1 -1
- package/lib/commonjs/features/navigation/AutoScreenDetector.js +4 -4
- package/lib/commonjs/features/navigation/AutoScreenDetector.js.map +1 -1
- package/lib/commonjs/features/ota/OtaOrchestrator.js +18 -18
- package/lib/commonjs/features/ota/OtaOrchestrator.js.map +1 -1
- package/lib/commonjs/features/ota/geoCountry.js +2 -2
- package/lib/commonjs/features/ota/geoCountry.js.map +1 -1
- package/lib/commonjs/features/ota/retry.js +2 -2
- package/lib/commonjs/features/ota/retry.js.map +1 -1
- package/lib/commonjs/features/replay/core/logger/logger.js +0 -4
- package/lib/commonjs/features/replay/core/logger/logger.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/network/networkAdapter.js +1 -54
- package/lib/commonjs/features/replay/integrations/network/networkAdapter.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
- package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js +1 -1
- package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
- package/lib/commonjs/features/replay/pipeline/batching/batchManager.js +1 -1
- package/lib/commonjs/features/replay/pipeline/batching/batchManager.js.map +1 -1
- package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js +1 -1
- package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
- package/lib/commonjs/features/replay/public/api.js +7 -7
- package/lib/commonjs/features/replay/public/api.js.map +1 -1
- package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js +9 -9
- package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
- package/lib/commonjs/features/session/BackendSessionAdapter.js +41 -41
- package/lib/commonjs/features/session/BackendSessionAdapter.js.map +1 -1
- package/lib/commonjs/features/session/DesktopSessionTransport.js +5 -2
- package/lib/commonjs/features/session/DesktopSessionTransport.js.map +1 -1
- package/lib/commonjs/features/session/JourneyEventPipeline.js +1 -1
- package/lib/commonjs/features/session/JourneyEventPipeline.js.map +1 -1
- package/lib/commonjs/features/session/ReplayCaptureManager.js +14 -14
- package/lib/commonjs/features/session/ReplayCaptureManager.js.map +1 -1
- package/lib/commonjs/features/session/SessionManager.js +9 -9
- package/lib/commonjs/features/session/SessionManager.js.map +1 -1
- package/lib/commonjs/features/session/SyncDecisionEngine.js +1 -1
- package/lib/commonjs/features/session/SyncDecisionEngine.js.map +1 -1
- package/lib/commonjs/features/skan/skanBridge.js +6 -15
- package/lib/commonjs/features/skan/skanBridge.js.map +1 -1
- package/lib/commonjs/features/skan/skanConversionManager.js +5 -5
- package/lib/commonjs/features/skan/skanConversionManager.js.map +1 -1
- package/lib/commonjs/integrations/fetch/fetchInterceptor.js +1 -1
- package/lib/commonjs/integrations/fetch/fetchInterceptor.js.map +1 -1
- package/lib/commonjs/integrations/xhr/xhrInterceptor.js +1 -1
- package/lib/commonjs/integrations/xhr/xhrInterceptor.js.map +1 -1
- package/lib/commonjs/metro/composeSourceMap.js +105 -0
- package/lib/commonjs/metro/composeSourceMap.js.map +1 -0
- package/lib/commonjs/metro/featureModules.js +131 -0
- package/lib/commonjs/metro/featureModules.js.map +1 -0
- package/lib/commonjs/metro/index.js +123 -2
- package/lib/commonjs/metro/index.js.map +1 -1
- package/lib/commonjs/metro/serializerCompose.js +129 -0
- package/lib/commonjs/metro/serializerCompose.js.map +1 -0
- package/lib/commonjs/pipeline/dispatcher/dispatcher.js +1 -1
- package/lib/commonjs/pipeline/dispatcher/dispatcher.js.map +1 -1
- package/lib/commonjs/pipeline/queue/flushQueue.js +2 -2
- package/lib/commonjs/pipeline/queue/flushQueue.js.map +1 -1
- package/lib/commonjs/pipeline/queue/persistentQueue.js +6 -37
- package/lib/commonjs/pipeline/queue/persistentQueue.js.map +1 -1
- package/lib/commonjs/pipeline/scheduler/flushScheduler.js +1 -1
- package/lib/commonjs/pipeline/scheduler/flushScheduler.js.map +1 -1
- package/lib/commonjs/public/ScaleBunFacade.js +15 -15
- package/lib/commonjs/public/ScaleBunFacade.js.map +1 -1
- package/lib/commonjs/push/PushManager.js +3 -3
- package/lib/commonjs/push/PushManager.js.map +1 -1
- package/lib/commonjs/push/adapters/NativeBridgeAdapter.js +1 -1
- package/lib/commonjs/push/adapters/NativeBridgeAdapter.js.map +1 -1
- package/lib/commonjs/push/native/nativeNotifications.js +7 -18
- package/lib/commonjs/push/native/nativeNotifications.js.map +1 -1
- package/lib/commonjs/storage/StorageBackend.js +1 -1
- package/lib/commonjs/storage/StorageBackend.js.map +1 -1
- package/lib/module/bootstrap/FeatureRegistry.js +4 -4
- package/lib/module/bootstrap/FeatureRegistry.js.map +1 -1
- package/lib/module/bootstrap/SDKBootstrapper.js +8 -8
- package/lib/module/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/module/core/config/schema.js +411 -231
- package/lib/module/core/config/schema.js.map +1 -1
- package/lib/module/core/constants/protocol.js +25 -0
- package/lib/module/core/constants/protocol.js.map +1 -0
- package/lib/module/core/constants/timings.js +3 -1
- package/lib/module/core/constants/timings.js.map +1 -1
- package/lib/module/core/lifecycle/appLifecycle.js +1 -1
- package/lib/module/core/lifecycle/appLifecycle.js.map +1 -1
- package/lib/module/debug/bootstrap.js +30 -9
- package/lib/module/debug/bootstrap.js.map +1 -1
- package/lib/module/debug/exportBridge.js +5 -3
- package/lib/module/debug/exportBridge.js.map +1 -1
- package/lib/module/debug/hostResolver.js +2 -2
- package/lib/module/debug/hostResolver.js.map +1 -1
- package/lib/module/debug/perfWiring.js +4 -4
- package/lib/module/debug/perfWiring.js.map +1 -1
- package/lib/module/debug/replayWiring.js +5 -5
- package/lib/module/debug/replayWiring.js.map +1 -1
- package/lib/module/debug/screenTracking.js +2 -2
- package/lib/module/debug/screenTracking.js.map +1 -1
- package/lib/module/debug/sessionWiring.js +2 -2
- package/lib/module/debug/sessionWiring.js.map +1 -1
- package/lib/module/features/crash/NativeCrashFeature.js +1 -1
- package/lib/module/features/crash/NativeCrashFeature.js.map +1 -1
- package/lib/module/features/crash/globalHandler.js +3 -3
- package/lib/module/features/crash/globalHandler.js.map +1 -1
- package/lib/module/features/crash/nativeCrashBridge.js +7 -7
- package/lib/module/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/module/features/crash/rejectionHandler.js +2 -2
- package/lib/module/features/crash/rejectionHandler.js.map +1 -1
- package/lib/module/features/engage/EngageArchetypeRenderers.js +0 -8
- package/lib/module/features/engage/EngageArchetypeRenderers.js.map +1 -1
- package/lib/module/features/engage/EngageInAppView.js +1 -1
- package/lib/module/features/engage/EngageInAppView.js.map +1 -1
- package/lib/module/features/engage/EngagePromptProvider.js +17 -17
- package/lib/module/features/engage/EngagePromptProvider.js.map +1 -1
- package/lib/module/features/engage/EngageTransport.js +5 -5
- package/lib/module/features/engage/EngageTransport.js.map +1 -1
- package/lib/module/features/engage/engagePushTokenBridge.js +4 -4
- package/lib/module/features/engage/engagePushTokenBridge.js.map +1 -1
- package/lib/module/features/engage/engageShakeBridge.js +2 -2
- package/lib/module/features/engage/engageShakeBridge.js.map +1 -1
- package/lib/module/features/engage/engageSignals.js +1 -1
- package/lib/module/features/engage/engageSignals.js.map +1 -1
- package/lib/module/features/engage/engageStoreReviewBridge.js +2 -2
- package/lib/module/features/engage/engageStoreReviewBridge.js.map +1 -1
- package/lib/module/features/engage/engageTestSeenStore.js +1 -1
- package/lib/module/features/engage/engageTestSeenStore.js.map +1 -1
- package/lib/module/features/engage/engageThrottle.js +4 -4
- package/lib/module/features/engage/engageThrottle.js.map +1 -1
- package/lib/module/features/engage/engageTriggerEngine.js +4 -4
- package/lib/module/features/engage/engageTriggerEngine.js.map +1 -1
- package/lib/module/features/engage/engageWindowInsets.js +1 -1
- package/lib/module/features/engage/engageWindowInsets.js.map +1 -1
- package/lib/module/features/install-referrer/installReferrer.js +3 -3
- package/lib/module/features/install-referrer/installReferrer.js.map +1 -1
- package/lib/module/features/journey/calibrationContext.js +0 -8
- package/lib/module/features/journey/calibrationContext.js.map +1 -1
- package/lib/module/features/journey/journeyManager.js +3 -1
- package/lib/module/features/journey/journeyManager.js.map +1 -1
- package/lib/module/features/navigation/AutoScreenDetector.js +4 -4
- package/lib/module/features/navigation/AutoScreenDetector.js.map +1 -1
- package/lib/module/features/ota/OtaOrchestrator.js +18 -18
- package/lib/module/features/ota/OtaOrchestrator.js.map +1 -1
- package/lib/module/features/ota/geoCountry.js +2 -2
- package/lib/module/features/ota/geoCountry.js.map +1 -1
- package/lib/module/features/ota/retry.js +2 -2
- package/lib/module/features/ota/retry.js.map +1 -1
- package/lib/module/features/replay/core/logger/logger.js +0 -3
- package/lib/module/features/replay/core/logger/logger.js.map +1 -1
- package/lib/module/features/replay/integrations/network/networkAdapter.js +1 -52
- package/lib/module/features/replay/integrations/network/networkAdapter.js.map +1 -1
- package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
- package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
- package/lib/module/features/replay/integrations/touch/ReplayRoot.js +1 -1
- package/lib/module/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
- package/lib/module/features/replay/pipeline/batching/batchManager.js +1 -1
- package/lib/module/features/replay/pipeline/batching/batchManager.js.map +1 -1
- package/lib/module/features/replay/pipeline/retry/retryPolicy.js +1 -1
- package/lib/module/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
- package/lib/module/features/replay/public/api.js +7 -7
- package/lib/module/features/replay/public/api.js.map +1 -1
- package/lib/module/features/replay/replay/session/sessionOrchestrator.js +9 -9
- package/lib/module/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
- package/lib/module/features/session/BackendSessionAdapter.js +41 -41
- package/lib/module/features/session/BackendSessionAdapter.js.map +1 -1
- package/lib/module/features/session/DesktopSessionTransport.js +4 -2
- package/lib/module/features/session/DesktopSessionTransport.js.map +1 -1
- package/lib/module/features/session/JourneyEventPipeline.js +1 -1
- package/lib/module/features/session/JourneyEventPipeline.js.map +1 -1
- package/lib/module/features/session/ReplayCaptureManager.js +14 -14
- package/lib/module/features/session/ReplayCaptureManager.js.map +1 -1
- package/lib/module/features/session/SessionManager.js +9 -9
- package/lib/module/features/session/SessionManager.js.map +1 -1
- package/lib/module/features/session/SyncDecisionEngine.js +1 -1
- package/lib/module/features/session/SyncDecisionEngine.js.map +1 -1
- package/lib/module/features/skan/skanBridge.js +6 -14
- package/lib/module/features/skan/skanBridge.js.map +1 -1
- package/lib/module/features/skan/skanConversionManager.js +5 -5
- package/lib/module/features/skan/skanConversionManager.js.map +1 -1
- package/lib/module/integrations/fetch/fetchInterceptor.js +1 -1
- package/lib/module/integrations/fetch/fetchInterceptor.js.map +1 -1
- package/lib/module/integrations/xhr/xhrInterceptor.js +1 -1
- package/lib/module/integrations/xhr/xhrInterceptor.js.map +1 -1
- package/lib/module/metro/composeSourceMap.js +97 -0
- package/lib/module/metro/composeSourceMap.js.map +1 -0
- package/lib/module/metro/featureModules.js +123 -0
- package/lib/module/metro/featureModules.js.map +1 -0
- package/lib/module/metro/index.js +122 -2
- package/lib/module/metro/index.js.map +1 -1
- package/lib/module/metro/serializerCompose.js +120 -0
- package/lib/module/metro/serializerCompose.js.map +1 -0
- package/lib/module/pipeline/dispatcher/dispatcher.js +1 -1
- package/lib/module/pipeline/dispatcher/dispatcher.js.map +1 -1
- package/lib/module/pipeline/queue/flushQueue.js +2 -2
- package/lib/module/pipeline/queue/flushQueue.js.map +1 -1
- package/lib/module/pipeline/queue/persistentQueue.js +6 -36
- package/lib/module/pipeline/queue/persistentQueue.js.map +1 -1
- package/lib/module/pipeline/scheduler/flushScheduler.js +1 -1
- package/lib/module/pipeline/scheduler/flushScheduler.js.map +1 -1
- package/lib/module/public/ScaleBunFacade.js +15 -15
- package/lib/module/public/ScaleBunFacade.js.map +1 -1
- package/lib/module/push/PushManager.js +3 -3
- package/lib/module/push/PushManager.js.map +1 -1
- package/lib/module/push/adapters/NativeBridgeAdapter.js +1 -1
- package/lib/module/push/adapters/NativeBridgeAdapter.js.map +1 -1
- package/lib/module/push/native/nativeNotifications.js +7 -17
- package/lib/module/push/native/nativeNotifications.js.map +1 -1
- package/lib/module/storage/StorageBackend.js +1 -1
- package/lib/module/storage/StorageBackend.js.map +1 -1
- package/lib/typescript/core/config/schema.d.ts +61 -40
- package/lib/typescript/core/config/schema.d.ts.map +1 -1
- package/lib/typescript/core/constants/protocol.d.ts +23 -0
- package/lib/typescript/core/constants/protocol.d.ts.map +1 -0
- package/lib/typescript/core/constants/timings.d.ts +1 -1
- package/lib/typescript/core/constants/timings.d.ts.map +1 -1
- package/lib/typescript/debug/bootstrap.d.ts +0 -1
- package/lib/typescript/debug/bootstrap.d.ts.map +1 -1
- package/lib/typescript/debug/exportBridge.d.ts.map +1 -1
- package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts +0 -2
- package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts.map +1 -1
- package/lib/typescript/features/journey/calibrationContext.d.ts +0 -1
- package/lib/typescript/features/journey/calibrationContext.d.ts.map +1 -1
- package/lib/typescript/features/journey/journeyManager.d.ts.map +1 -1
- package/lib/typescript/features/replay/core/logger/logger.d.ts +0 -1
- package/lib/typescript/features/replay/core/logger/logger.d.ts.map +1 -1
- package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts +0 -10
- package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts.map +1 -1
- package/lib/typescript/features/session/DesktopSessionTransport.d.ts.map +1 -1
- package/lib/typescript/features/skan/skanBridge.d.ts +0 -2
- package/lib/typescript/features/skan/skanBridge.d.ts.map +1 -1
- package/lib/typescript/metro/composeSourceMap.d.ts +26 -0
- package/lib/typescript/metro/composeSourceMap.d.ts.map +1 -0
- package/lib/typescript/metro/featureModules.d.ts +49 -0
- package/lib/typescript/metro/featureModules.d.ts.map +1 -0
- package/lib/typescript/metro/index.d.ts +22 -0
- package/lib/typescript/metro/index.d.ts.map +1 -1
- package/lib/typescript/metro/serializerCompose.d.ts +46 -0
- package/lib/typescript/metro/serializerCompose.d.ts.map +1 -0
- package/lib/typescript/pipeline/queue/persistentQueue.d.ts +0 -10
- package/lib/typescript/pipeline/queue/persistentQueue.d.ts.map +1 -1
- package/lib/typescript/push/native/nativeNotifications.d.ts +0 -6
- package/lib/typescript/push/native/nativeNotifications.d.ts.map +1 -1
- package/package.json +15 -11
- package/src/bootstrap/FeatureRegistry.ts +4 -4
- package/src/bootstrap/SDKBootstrapper.ts +8 -8
- package/src/core/config/schema.ts +353 -235
- package/src/core/constants/protocol.ts +24 -0
- package/src/core/constants/timings.ts +3 -1
- package/src/core/lifecycle/appLifecycle.ts +1 -1
- package/src/debug/bootstrap.ts +40 -7
- package/src/debug/exportBridge.ts +5 -3
- package/src/debug/hostResolver.ts +2 -2
- package/src/debug/perfWiring.ts +4 -4
- package/src/debug/replayWiring.ts +5 -5
- package/src/debug/screenTracking.ts +2 -2
- package/src/debug/sessionWiring.ts +2 -2
- package/src/features/crash/NativeCrashFeature.ts +1 -1
- package/src/features/crash/globalHandler.ts +3 -3
- package/src/features/crash/nativeCrashBridge.ts +7 -7
- package/src/features/crash/rejectionHandler.ts +2 -2
- package/src/features/engage/EngageArchetypeRenderers.tsx +0 -11
- package/src/features/engage/EngageInAppView.tsx +1 -1
- package/src/features/engage/EngagePromptProvider.tsx +17 -17
- package/src/features/engage/EngageTransport.ts +5 -5
- package/src/features/engage/engagePushTokenBridge.ts +4 -4
- package/src/features/engage/engageShakeBridge.ts +2 -2
- package/src/features/engage/engageSignals.ts +1 -1
- package/src/features/engage/engageStoreReviewBridge.ts +2 -2
- package/src/features/engage/engageTestSeenStore.ts +1 -1
- package/src/features/engage/engageThrottle.ts +4 -4
- package/src/features/engage/engageTriggerEngine.ts +4 -4
- package/src/features/engage/engageWindowInsets.ts +1 -1
- package/src/features/install-referrer/installReferrer.ts +3 -3
- package/src/features/journey/calibrationContext.ts +0 -9
- package/src/features/journey/journeyManager.ts +3 -1
- package/src/features/navigation/AutoScreenDetector.ts +4 -4
- package/src/features/ota/OtaOrchestrator.ts +18 -18
- package/src/features/ota/geoCountry.ts +2 -2
- package/src/features/ota/retry.ts +2 -2
- package/src/features/replay/core/logger/logger.ts +0 -4
- package/src/features/replay/integrations/network/networkAdapter.ts +1 -56
- package/src/features/replay/integrations/react-navigation/navigationIntegration.ts +1 -1
- package/src/features/replay/integrations/touch/ReplayRoot.tsx +1 -1
- package/src/features/replay/pipeline/batching/batchManager.ts +1 -1
- package/src/features/replay/pipeline/retry/retryPolicy.ts +1 -1
- package/src/features/replay/public/api.ts +7 -7
- package/src/features/replay/replay/session/sessionOrchestrator.ts +9 -9
- package/src/features/session/BackendSessionAdapter.ts +41 -41
- package/src/features/session/DesktopSessionTransport.ts +4 -2
- package/src/features/session/JourneyEventPipeline.ts +1 -1
- package/src/features/session/ReplayCaptureManager.ts +14 -14
- package/src/features/session/SessionManager.ts +9 -9
- package/src/features/session/SyncDecisionEngine.ts +1 -1
- package/src/features/skan/skanBridge.ts +6 -14
- package/src/features/skan/skanConversionManager.ts +5 -5
- package/src/integrations/fetch/fetchInterceptor.ts +1 -1
- package/src/integrations/xhr/xhrInterceptor.ts +1 -1
- package/src/metro/composeSourceMap.ts +104 -0
- package/src/metro/featureModules.ts +143 -0
- package/src/metro/index.ts +173 -1
- package/src/metro/serializerCompose.ts +157 -0
- package/src/pipeline/dispatcher/dispatcher.ts +1 -1
- package/src/pipeline/queue/flushQueue.ts +2 -2
- package/src/pipeline/queue/persistentQueue.ts +6 -35
- package/src/pipeline/scheduler/flushScheduler.ts +1 -1
- package/src/public/ScaleBunFacade.ts +15 -15
- package/src/push/PushManager.ts +3 -3
- package/src/push/adapters/NativeBridgeAdapter.ts +1 -1
- package/src/push/native/nativeNotifications.ts +7 -16
- package/src/storage/StorageBackend.ts +1 -1
|
@@ -3,241 +3,421 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ConfigSchema = void 0;
|
|
7
|
-
var _protocol = require("../../vendor/protocol");
|
|
6
|
+
exports.ConfigValidationError = exports.ConfigSchema = void 0;
|
|
8
7
|
var _config = require("../../features/performance/config");
|
|
9
8
|
var _endpoints = require("../constants/endpoints");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
useObjectStorage: _protocol.z.boolean().default(false),
|
|
92
|
-
/**
|
|
93
|
-
* Native file-based replay outbox (durable, survives app restart/process kill).
|
|
94
|
-
* When true, frames are captured natively to disk and metadata is handed to the
|
|
95
|
-
* native outbox instead of buffering base64 in the JS in-memory pendingFrames.
|
|
96
|
-
* Default false: existing in-memory JS upload path stays the only path. If the
|
|
97
|
-
* native module or a native call is unavailable, the SDK falls back to the
|
|
98
|
-
* existing JS path. SaaS (clientKey) only — uploads target /ingestion endpoints.
|
|
99
|
-
*/
|
|
100
|
-
enableNativeFileOutbox: _protocol.z.boolean().default(false),
|
|
101
|
-
/**
|
|
102
|
-
* Allow the NATIVE outbox to perform uploads (presign -> PUT -> commit, plus
|
|
103
|
-
* JSONL telemetry batches) on its own. Default false: even with the outbox on,
|
|
104
|
-
* native only captures+stores; JS still drives flush by calling the native
|
|
105
|
-
* flush bridge method. Set true to let native upload directly. Requires
|
|
106
|
-
* enableNativeFileOutbox.
|
|
107
|
-
*/
|
|
108
|
-
nativeOutboxUploadEnabled: _protocol.z.boolean().default(false),
|
|
109
|
-
/**
|
|
110
|
-
* Within the native outbox, upload frame image bytes to object storage via
|
|
111
|
-
* presigned PUT (key-only metadata commit) instead of inline base64. Default
|
|
112
|
-
* false. If the presign endpoint reports storage disabled, native falls back to
|
|
113
|
-
* the JS path for that frame (it does NOT send base64 over the bridge in the
|
|
114
|
-
* outbox path). Requires enableNativeFileOutbox.
|
|
115
|
-
*/
|
|
116
|
-
useObjectStorageForFrames: _protocol.z.boolean().default(false),
|
|
117
|
-
/**
|
|
118
|
-
* Native outbox tuning (all additive, all optional — native parses both the
|
|
119
|
-
* `nativeOutbox*` keys here and bare `outbox*` aliases). These only take effect
|
|
120
|
-
* when enableNativeFileOutbox is true; defaults mirror the native ReplayConfig
|
|
121
|
-
* defaults so omitting them changes nothing.
|
|
122
|
-
*/
|
|
123
|
-
/** Armed-retry interval for due outbox work, ms. Default 3000. */
|
|
124
|
-
nativeOutboxRetryIntervalMs: _protocol.z.number().min(250).default(3000),
|
|
125
|
-
/** Server-attempt cap before a batch is moved to dead. Default 30. */
|
|
126
|
-
nativeOutboxMaxUploadAttempts: _protocol.z.number().min(1).default(30),
|
|
127
|
-
/** Poison (4xx≠429) attempt cap before dead. Default 2. */
|
|
128
|
-
nativeOutboxPoisonMaxAttempts: _protocol.z.number().min(1).default(2),
|
|
129
|
-
/** Honor server Retry-After on 429/503. Default true. */
|
|
130
|
-
nativeOutboxRespectRetryAfter: _protocol.z.boolean().default(true),
|
|
131
|
-
/** Force fixed 3s retry, ignoring exponential backoff. Default false. */
|
|
132
|
-
nativeOutboxStrictThreeSecondRetry: _protocol.z.boolean().default(false),
|
|
133
|
-
/** Count NETWORK_UNAVAILABLE failures toward the dead threshold. Default false. */
|
|
134
|
-
nativeOutboxNetworkFailuresCountTowardDead: _protocol.z.boolean().default(false),
|
|
135
|
-
/** Outbox on-disk byte cap before GC. Default 100 MiB. */
|
|
136
|
-
nativeOutboxMaxBytes: _protocol.z.number().min(1024).default(100 * 1024 * 1024),
|
|
137
|
-
/** Outbox max age before GC, ms. Default 7 days. */
|
|
138
|
-
nativeOutboxMaxAgeMs: _protocol.z.number().min(1000).default(7 * 24 * 60 * 60 * 1000),
|
|
139
|
-
/**
|
|
140
|
-
* Performance pipeline activation flags (SaaS).
|
|
141
|
-
* Tiered by cost. Defaults are conservative ("default-safe"): cheap
|
|
142
|
-
* event-driven Tier-1 collectors on; heavier UI-hang watchdog and Tier-2
|
|
143
|
-
* sampled collectors OFF until device-measured. All flippable via config
|
|
144
|
-
* with no SDK release.
|
|
145
|
-
*/
|
|
146
|
-
performance: _protocol.z.object({
|
|
147
|
-
/** Master enable; also gates native ScaleBunPerformance.initialize(). Default: true */
|
|
148
|
-
enabled: _protocol.z.boolean().default(true),
|
|
149
|
-
/** Tier-1: cheap, event-driven collectors. */
|
|
150
|
-
tier1: _protocol.z.object({
|
|
151
|
-
/** App launch (one-shot at start). Default: true */
|
|
152
|
-
appLaunch: _protocol.z.boolean().default(true),
|
|
153
|
-
/** Screen load (per navigation). Default: true */
|
|
154
|
-
screenLoad: _protocol.z.boolean().default(true),
|
|
155
|
-
/** Network perf (slow/failed requests). Default: true */
|
|
156
|
-
network: _protocol.z.boolean().default(true),
|
|
157
|
-
/** UI hang / ANR watchdog. Default: true — additive, forward-only (needs native module). */
|
|
158
|
-
uiHang: _protocol.z.boolean().default(true)
|
|
159
|
-
}).default({}),
|
|
160
|
-
/** Tier-2: heavy, continuous collectors (frame_metrics + js_stall), sampled. */
|
|
161
|
-
tier2: _protocol.z.object({
|
|
162
|
-
/** Master enable for Tier-2. Default: true (still gated by sampleRate). */
|
|
163
|
-
enabled: _protocol.z.boolean().default(true),
|
|
164
|
-
/** Per-session sampling fraction 0..1. Default: 10% — conservative, host-overridable (0 disables). */
|
|
165
|
-
sampleRate: _protocol.z.number().min(0).max(1).default(_config.DEFAULT_TIER2_SAMPLE_RATE)
|
|
166
|
-
}).default({})
|
|
167
|
-
}).default({}),
|
|
168
|
-
/**
|
|
169
|
-
* Session-replay capture cadence for the unified SessionManager.
|
|
170
|
-
* 'navigation' (SDK default) captures only on screen change → a session with
|
|
171
|
-
* no navigation produces ~0 frames. 'frequency' captures on a timer
|
|
172
|
-
* (intervalMs, min 500ms) for a continuous replay. 'interactions' on gestures.
|
|
173
|
-
* Plumbed into SessionManager via SDKBootstrapper.
|
|
174
|
-
*/
|
|
175
|
-
replay: _protocol.z.object({
|
|
176
|
-
// Auto-start frame recording in SaaS mode (clientKey set) at cold launch, so replay
|
|
177
|
-
// sessions carry frames out of the box. Default: true (undefined ⇒ record). Set false for
|
|
178
|
-
// events-only sessions — the host can still record on demand via ScaleBun.startSession().
|
|
179
|
-
// Decoupled from finalizeOnBackground (which only governs per-foreground session boundaries).
|
|
180
|
-
record: _protocol.z.boolean().optional(),
|
|
181
|
-
captureMode: _protocol.z.enum(['navigation', 'interactions', 'frequency']).optional(),
|
|
182
|
-
intervalMs: _protocol.z.number().min(500).optional(),
|
|
183
|
-
quality: _protocol.z.enum(['high', 'normal', 'low', 'grayscale']).optional(),
|
|
184
|
-
// P2-5: emit deltas between keyframes (default false in DEFAULT_SESSION_REPLAY_CONFIG).
|
|
185
|
-
deltaEncoding: _protocol.z.boolean().optional(),
|
|
186
|
-
deltaKeyframeInterval: _protocol.z.number().int().min(1).optional()
|
|
187
|
-
}).optional(),
|
|
188
|
-
/**
|
|
189
|
-
* Heatmap interaction capture (Feature #4).
|
|
190
|
-
*
|
|
191
|
-
* When true, tap/gesture coordinates (normalizedX/Y + gesture type + screen)
|
|
192
|
-
* are ALSO emitted to the always-on analytics lane — so heatmaps receive data
|
|
193
|
-
* even when no replay-recording session is active. This is ADDITIVE: it does
|
|
194
|
-
* NOT change replay-recording capture, and reuses the exact same USER_ACTION
|
|
195
|
-
* payload keys (normalizedX, normalizedY, gestureType, screen) the recording
|
|
196
|
-
* lane writes, so the backend aggregate reads them identically.
|
|
197
|
-
*
|
|
198
|
-
* Coordinates are NORMALIZED (0..1) and carry no PII. The analytics lane is
|
|
199
|
-
* SaaS-only (requires clientKey) and finalize-scoped per foreground; while ON
|
|
200
|
-
* a tap on every gesture is enqueued (bounded buffer, drop-oldest).
|
|
201
|
-
*
|
|
202
|
-
* Default: true (ON). Coords are normalized + PII-free, and volume is bounded
|
|
203
|
-
* by a per-foreground sampling cap in SessionManager (HEATMAP_MAX_INTERACTIONS_
|
|
204
|
-
* PER_WINDOW) so the gesture stream can't run away. Integrators who want zero
|
|
205
|
-
* extra analytics events can still set this false. SaaS (clientKey) only.
|
|
206
|
-
*
|
|
207
|
-
* CAVEAT: heatmaps populate going FORWARD only — sessions recorded before this
|
|
208
|
-
* shipped (or with the flag off) carry no analytics-lane interaction data.
|
|
209
|
-
*/
|
|
210
|
-
captureInteractionHeatmap: _protocol.z.boolean().default(true),
|
|
211
|
-
/**
|
|
212
|
-
* OTA (Over-the-Air) update configuration.
|
|
213
|
-
* When enabled, the SDK checks for JS bundle updates on app foreground
|
|
214
|
-
* and applies them atomically. Opt-in: existing integrators are unaffected.
|
|
215
|
-
* SaaS (clientKey) only.
|
|
216
|
-
*/
|
|
217
|
-
ota: _protocol.z.object({
|
|
218
|
-
/** Enable OTA update checking. Default: false (opt-in). */
|
|
219
|
-
enabled: _protocol.z.boolean().default(false),
|
|
220
|
-
/** Check for updates on each app foreground. Default: true. */
|
|
221
|
-
checkOnForeground: _protocol.z.boolean().default(true),
|
|
222
|
-
/** Override the auto-resolved channel (env-based). */
|
|
223
|
-
channelOverride: _protocol.z.string().optional(),
|
|
224
|
-
/** Ed25519 public key for bundle signature verification (base64). */
|
|
225
|
-
publicSigningKey: _protocol.z.string().optional(),
|
|
226
|
-
/**
|
|
227
|
-
* Ed25519 verifier supplied by the host — the SDK ships no crypto
|
|
228
|
-
* implementation. Required whenever `publicSigningKey` is set: pinning a
|
|
229
|
-
* key without a verifier is fail-closed, so updates stop installing.
|
|
230
|
-
* `(message, signature, publicKey) => boolean | Promise<boolean>`.
|
|
231
|
-
*/
|
|
232
|
-
verifySignature: _protocol.z.any().optional(),
|
|
233
|
-
/** Override how long a new bundle has to prove healthy (ms). */
|
|
234
|
-
healthyTimeoutMs: _protocol.z.number().optional(),
|
|
235
|
-
/** Block UI interaction while a mandatory update is pending. Default: false. */
|
|
236
|
-
mandatoryBlocksUi: _protocol.z.boolean().default(false)
|
|
237
|
-
}).optional()
|
|
238
|
-
}).refine(data => !!data.clientKey || !!data.projectId && !!data.publishableKey, {
|
|
239
|
-
message: 'Either clientKey (SaaS mode) or both projectId and publishableKey (legacy mode) are required'
|
|
9
|
+
/**
|
|
10
|
+
* ScaleBun SDK — init-config validation and normalization.
|
|
11
|
+
*
|
|
12
|
+
* Hand-rolled, table-driven replacement for the vendored mini-Zod this schema used to be built
|
|
13
|
+
* on. The generic validator cost ~6.7 KB of minified bundle to serve exactly one consumer —
|
|
14
|
+
* `SDKBootstrapper.safeParse(rawConfig)` — so the machinery is replaced by a field table and a
|
|
15
|
+
* ~1.5 KB engine with BEHAVIOUR PARITY, byte-for-byte on messages:
|
|
16
|
+
*
|
|
17
|
+
* - same accept/reject decisions (strict types, no coercion; min/max reject rather than clamp)
|
|
18
|
+
* - same normalized output (defaults filled, nested defaults via `{}`, unknown keys stripped,
|
|
19
|
+
* optional-and-absent keys omitted)
|
|
20
|
+
* - same error surface (`safeParse` → `{ success, data | error }`, error with `.issues`
|
|
21
|
+
* [{path, message}] and Zod-style `.format()`), with identical message strings
|
|
22
|
+
*
|
|
23
|
+
* The parity suite in __tests__/schemaParity.test.ts runs a generated matrix of configs against
|
|
24
|
+
* BOTH this implementation and a verbatim copy of the old vendored-z construction, and
|
|
25
|
+
* deep-compares every result. Changing behaviour here without failing that suite should be
|
|
26
|
+
* treated as impossible; if you extend the config, extend the parity suite's reference schema in
|
|
27
|
+
* the same commit.
|
|
28
|
+
*
|
|
29
|
+
* `apiBaseUrl` note: any value is accepted (`kind: 'any'`, backward compatibility) but the
|
|
30
|
+
* bootstrapper force-overwrites it with DEFAULT_API_BASE_URL immediately after parse — the
|
|
31
|
+
* endpoint is locked at build time by design.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
// ─── Result surface (drop-in for the vendored validator's) ─────────────────────
|
|
35
|
+
|
|
36
|
+
class ConfigValidationError extends Error {
|
|
37
|
+
constructor(issues) {
|
|
38
|
+
super(issues.map(i => `${i.path.join('.') || '(root)'}: ${i.message}`).join('; '));
|
|
39
|
+
this.name = 'ValidationError';
|
|
40
|
+
this.issues = issues;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Nested error object keyed by path, matching Zod's `error.format()`. */
|
|
44
|
+
format() {
|
|
45
|
+
const root = {
|
|
46
|
+
_errors: []
|
|
47
|
+
};
|
|
48
|
+
for (const issue of this.issues) {
|
|
49
|
+
if (issue.path.length === 0) {
|
|
50
|
+
root._errors.push(issue.message);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
let node = root;
|
|
54
|
+
for (let i = 0; i < issue.path.length; i++) {
|
|
55
|
+
const key = String(issue.path[i]);
|
|
56
|
+
const existing = node[key];
|
|
57
|
+
let child;
|
|
58
|
+
if (existing && !Array.isArray(existing)) {
|
|
59
|
+
child = existing;
|
|
60
|
+
} else {
|
|
61
|
+
child = {
|
|
62
|
+
_errors: []
|
|
63
|
+
};
|
|
64
|
+
node[key] = child;
|
|
65
|
+
}
|
|
66
|
+
if (i === issue.path.length - 1) {
|
|
67
|
+
child._errors.push(issue.message);
|
|
68
|
+
}
|
|
69
|
+
node = child;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return root;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ─── Field table ────────────────────────────────────────────────────────────────
|
|
77
|
+
//
|
|
78
|
+
// One row per config key. `def` present → the field always exists in the output (the default is
|
|
79
|
+
// itself validated, matching DefaultSchema semantics). `opt` → absent input stays absent.
|
|
80
|
+
exports.ConfigValidationError = ConfigValidationError;
|
|
81
|
+
const bool = def => def === undefined ? {
|
|
82
|
+
kind: 'bool'
|
|
83
|
+
} : {
|
|
84
|
+
kind: 'bool',
|
|
85
|
+
def
|
|
86
|
+
};
|
|
87
|
+
const num = o => ({
|
|
88
|
+
kind: 'num',
|
|
89
|
+
...o
|
|
240
90
|
});
|
|
91
|
+
const SHAPE = {
|
|
92
|
+
projectId: {
|
|
93
|
+
kind: 'str',
|
|
94
|
+
min: 1,
|
|
95
|
+
opt: true
|
|
96
|
+
},
|
|
97
|
+
publishableKey: {
|
|
98
|
+
kind: 'str',
|
|
99
|
+
min: 1,
|
|
100
|
+
opt: true
|
|
101
|
+
},
|
|
102
|
+
apiBaseUrl: {
|
|
103
|
+
kind: 'any',
|
|
104
|
+
def: () => _endpoints.DEFAULT_API_BASE_URL
|
|
105
|
+
},
|
|
106
|
+
debug: bool(false),
|
|
107
|
+
logLevel: {
|
|
108
|
+
kind: 'enum',
|
|
109
|
+
values: ['silent', 'error', 'warn', 'info', 'debug'],
|
|
110
|
+
opt: true
|
|
111
|
+
},
|
|
112
|
+
flushIntervalMs: num({
|
|
113
|
+
min: 1000,
|
|
114
|
+
def: 5000
|
|
115
|
+
}),
|
|
116
|
+
finalizeOnBackground: bool(false),
|
|
117
|
+
idleThresholdMs: num({
|
|
118
|
+
min: 1000,
|
|
119
|
+
def: 60_000
|
|
120
|
+
}),
|
|
121
|
+
sessionBackgroundCapMs: num({
|
|
122
|
+
min: 60_000,
|
|
123
|
+
def: 30 * 60 * 1000
|
|
124
|
+
}),
|
|
125
|
+
maxQueueSize: num({
|
|
126
|
+
min: 1,
|
|
127
|
+
def: 1000
|
|
128
|
+
}),
|
|
129
|
+
enableNetworkMonitoring: bool(true),
|
|
130
|
+
captureNetworkBodies: bool(false),
|
|
131
|
+
networkBodyMaxBytes: num({
|
|
132
|
+
min: 1,
|
|
133
|
+
max: 1_048_576,
|
|
134
|
+
def: 65_536
|
|
135
|
+
}),
|
|
136
|
+
persistence: {
|
|
137
|
+
kind: 'obj',
|
|
138
|
+
def: true,
|
|
139
|
+
shape: {
|
|
140
|
+
enabled: bool(true),
|
|
141
|
+
maxBytes: num({
|
|
142
|
+
min: 1024,
|
|
143
|
+
def: 5_242_880
|
|
144
|
+
}),
|
|
145
|
+
maxEntries: num({
|
|
146
|
+
min: 10,
|
|
147
|
+
def: 5_000
|
|
148
|
+
}),
|
|
149
|
+
redactBeforeWrite: bool(true)
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
clientKey: {
|
|
153
|
+
kind: 'str',
|
|
154
|
+
opt: true
|
|
155
|
+
},
|
|
156
|
+
useObjectStorage: bool(false),
|
|
157
|
+
enableNativeFileOutbox: bool(false),
|
|
158
|
+
nativeOutboxUploadEnabled: bool(false),
|
|
159
|
+
useObjectStorageForFrames: bool(false),
|
|
160
|
+
nativeOutboxRetryIntervalMs: num({
|
|
161
|
+
min: 250,
|
|
162
|
+
def: 3000
|
|
163
|
+
}),
|
|
164
|
+
nativeOutboxMaxUploadAttempts: num({
|
|
165
|
+
min: 1,
|
|
166
|
+
def: 30
|
|
167
|
+
}),
|
|
168
|
+
nativeOutboxPoisonMaxAttempts: num({
|
|
169
|
+
min: 1,
|
|
170
|
+
def: 2
|
|
171
|
+
}),
|
|
172
|
+
nativeOutboxRespectRetryAfter: bool(true),
|
|
173
|
+
nativeOutboxStrictThreeSecondRetry: bool(false),
|
|
174
|
+
nativeOutboxNetworkFailuresCountTowardDead: bool(false),
|
|
175
|
+
nativeOutboxMaxBytes: num({
|
|
176
|
+
min: 1024,
|
|
177
|
+
def: 100 * 1024 * 1024
|
|
178
|
+
}),
|
|
179
|
+
nativeOutboxMaxAgeMs: num({
|
|
180
|
+
min: 1000,
|
|
181
|
+
def: 7 * 24 * 60 * 60 * 1000
|
|
182
|
+
}),
|
|
183
|
+
performance: {
|
|
184
|
+
kind: 'obj',
|
|
185
|
+
def: true,
|
|
186
|
+
shape: {
|
|
187
|
+
enabled: bool(true),
|
|
188
|
+
tier1: {
|
|
189
|
+
kind: 'obj',
|
|
190
|
+
def: true,
|
|
191
|
+
shape: {
|
|
192
|
+
appLaunch: bool(true),
|
|
193
|
+
screenLoad: bool(true),
|
|
194
|
+
network: bool(true),
|
|
195
|
+
uiHang: bool(true)
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
tier2: {
|
|
199
|
+
kind: 'obj',
|
|
200
|
+
def: true,
|
|
201
|
+
shape: {
|
|
202
|
+
enabled: bool(true),
|
|
203
|
+
sampleRate: num({
|
|
204
|
+
min: 0,
|
|
205
|
+
max: 1,
|
|
206
|
+
def: _config.DEFAULT_TIER2_SAMPLE_RATE
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
replay: {
|
|
213
|
+
kind: 'obj',
|
|
214
|
+
opt: true,
|
|
215
|
+
shape: {
|
|
216
|
+
// Auto-start frame recording in SaaS mode (clientKey set) at cold launch, so replay
|
|
217
|
+
// sessions carry frames out of the box. Default: true (undefined ⇒ record). Set false
|
|
218
|
+
// for events-only sessions — the host can still record via ScaleBun.startSession().
|
|
219
|
+
record: {
|
|
220
|
+
kind: 'bool',
|
|
221
|
+
opt: true
|
|
222
|
+
},
|
|
223
|
+
captureMode: {
|
|
224
|
+
kind: 'enum',
|
|
225
|
+
values: ['navigation', 'interactions', 'frequency'],
|
|
226
|
+
opt: true
|
|
227
|
+
},
|
|
228
|
+
intervalMs: num({
|
|
229
|
+
min: 500,
|
|
230
|
+
opt: true
|
|
231
|
+
}),
|
|
232
|
+
quality: {
|
|
233
|
+
kind: 'enum',
|
|
234
|
+
values: ['high', 'normal', 'low', 'grayscale'],
|
|
235
|
+
opt: true
|
|
236
|
+
},
|
|
237
|
+
deltaEncoding: {
|
|
238
|
+
kind: 'bool',
|
|
239
|
+
opt: true
|
|
240
|
+
},
|
|
241
|
+
deltaKeyframeInterval: num({
|
|
242
|
+
min: 1,
|
|
243
|
+
int: true,
|
|
244
|
+
opt: true
|
|
245
|
+
})
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
captureInteractionHeatmap: bool(true),
|
|
249
|
+
ota: {
|
|
250
|
+
kind: 'obj',
|
|
251
|
+
opt: true,
|
|
252
|
+
shape: {
|
|
253
|
+
enabled: bool(false),
|
|
254
|
+
checkOnForeground: bool(true),
|
|
255
|
+
channelOverride: {
|
|
256
|
+
kind: 'str',
|
|
257
|
+
opt: true
|
|
258
|
+
},
|
|
259
|
+
publicSigningKey: {
|
|
260
|
+
kind: 'str',
|
|
261
|
+
opt: true
|
|
262
|
+
},
|
|
263
|
+
mandatoryBlocksUi: bool(false)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// ─── Engine ─────────────────────────────────────────────────────────────────────
|
|
269
|
+
|
|
270
|
+
const typeofName = v => v === null ? 'null' : Array.isArray(v) ? 'array' : typeof v;
|
|
271
|
+
function parseField(field, input, path, issues) {
|
|
272
|
+
const fail = message => {
|
|
273
|
+
issues.push({
|
|
274
|
+
path,
|
|
275
|
+
message
|
|
276
|
+
});
|
|
277
|
+
return {
|
|
278
|
+
ok: false,
|
|
279
|
+
present: true
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
if (input === undefined) {
|
|
283
|
+
if ('opt' in field && field.opt) return {
|
|
284
|
+
ok: true,
|
|
285
|
+
present: false
|
|
286
|
+
};
|
|
287
|
+
if (field.kind === 'any') return {
|
|
288
|
+
ok: true,
|
|
289
|
+
value: field.def(),
|
|
290
|
+
present: true
|
|
291
|
+
};
|
|
292
|
+
if (field.kind === 'obj' && field.def) return parseField({
|
|
293
|
+
...field,
|
|
294
|
+
def: undefined
|
|
295
|
+
}, {}, path, issues);
|
|
296
|
+
if ('def' in field && field.def !== undefined) return {
|
|
297
|
+
ok: true,
|
|
298
|
+
value: field.def,
|
|
299
|
+
present: true
|
|
300
|
+
};
|
|
301
|
+
// Required with no default (matches the base schemas' type errors on undefined).
|
|
302
|
+
return fail(field.kind === 'bool' ? 'Expected boolean, received undefined' : field.kind === 'num' ? 'Expected number, received undefined' : field.kind === 'str' ? 'Expected string, received undefined' : field.kind === 'enum' ? "Invalid enum value. Expected " + field.values.map(v => `'${v}'`).join(' | ') : 'Expected object, received undefined');
|
|
303
|
+
}
|
|
304
|
+
switch (field.kind) {
|
|
305
|
+
case 'any':
|
|
306
|
+
return {
|
|
307
|
+
ok: true,
|
|
308
|
+
value: input,
|
|
309
|
+
present: true
|
|
310
|
+
};
|
|
311
|
+
case 'bool':
|
|
312
|
+
if (typeof input !== 'boolean') return fail(`Expected boolean, received ${typeofName(input)}`);
|
|
313
|
+
return {
|
|
314
|
+
ok: true,
|
|
315
|
+
value: input,
|
|
316
|
+
present: true
|
|
317
|
+
};
|
|
318
|
+
case 'str':
|
|
319
|
+
if (typeof input !== 'string') return fail(`Expected string, received ${typeofName(input)}`);
|
|
320
|
+
if (field.min !== undefined && input.length < field.min) {
|
|
321
|
+
return fail(`String must contain at least ${field.min} character(s)`);
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
ok: true,
|
|
325
|
+
value: input,
|
|
326
|
+
present: true
|
|
327
|
+
};
|
|
328
|
+
case 'num':
|
|
329
|
+
if (typeof input !== 'number' || Number.isNaN(input)) {
|
|
330
|
+
return fail(`Expected number, received ${typeofName(input)}`);
|
|
331
|
+
}
|
|
332
|
+
if (field.int && !Number.isInteger(input)) return fail('Expected integer, received float');
|
|
333
|
+
if (field.min !== undefined && input < field.min) {
|
|
334
|
+
return fail(`Number must be greater than or equal to ${field.min}`);
|
|
335
|
+
}
|
|
336
|
+
if (field.max !== undefined && input > field.max) {
|
|
337
|
+
return fail(`Number must be less than or equal to ${field.max}`);
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
ok: true,
|
|
341
|
+
value: input,
|
|
342
|
+
present: true
|
|
343
|
+
};
|
|
344
|
+
case 'enum':
|
|
345
|
+
if (typeof input !== 'string' || !field.values.includes(input)) {
|
|
346
|
+
return fail(`Invalid enum value. Expected ${field.values.map(v => `'${v}'`).join(' | ')}`);
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
ok: true,
|
|
350
|
+
value: input,
|
|
351
|
+
present: true
|
|
352
|
+
};
|
|
353
|
+
case 'obj':
|
|
354
|
+
{
|
|
355
|
+
if (typeofName(input) !== 'object') return fail(`Expected object, received ${typeofName(input)}`);
|
|
356
|
+
const src = input;
|
|
357
|
+
const out = {};
|
|
358
|
+
let ok = true;
|
|
359
|
+
for (const key of Object.keys(field.shape)) {
|
|
360
|
+
const r = parseField(field.shape[key], src[key], [...path, key], issues);
|
|
361
|
+
if (!r.ok) ok = false;
|
|
362
|
+
// Mirrors ObjectSchema: keep defined results, and explicit `key in input`
|
|
363
|
+
// occurrences even when the parsed value is undefined (optional present-but-
|
|
364
|
+
// undefined keys survive as own properties, exactly like the old parser).
|
|
365
|
+
else if (r.value !== undefined || key in src) {
|
|
366
|
+
if (r.present || key in src) out[key] = r.value;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
// Unknown keys are stripped (Zod's default `.strip()` behaviour).
|
|
370
|
+
return ok ? {
|
|
371
|
+
ok: true,
|
|
372
|
+
value: out,
|
|
373
|
+
present: true
|
|
374
|
+
} : {
|
|
375
|
+
ok: false,
|
|
376
|
+
present: true
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** The one root-level cross-field rule (was `.refine(...)` on the old schema). */
|
|
383
|
+
const ROOT_REFINE_MESSAGE = 'Either clientKey (SaaS mode) or both projectId and publishableKey (legacy mode) are required';
|
|
384
|
+
const ConfigSchema = exports.ConfigSchema = {
|
|
385
|
+
safeParse(input) {
|
|
386
|
+
const issues = [];
|
|
387
|
+
const r = parseField({
|
|
388
|
+
kind: 'obj',
|
|
389
|
+
shape: SHAPE
|
|
390
|
+
}, input, [], issues);
|
|
391
|
+
if (r.ok && issues.length === 0) {
|
|
392
|
+
const data = r.value;
|
|
393
|
+
if (!(!!data.clientKey || !!data.projectId && !!data.publishableKey)) {
|
|
394
|
+
issues.push({
|
|
395
|
+
path: [],
|
|
396
|
+
message: ROOT_REFINE_MESSAGE
|
|
397
|
+
});
|
|
398
|
+
return {
|
|
399
|
+
success: false,
|
|
400
|
+
error: new ConfigValidationError(issues)
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
success: true,
|
|
405
|
+
data
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
success: false,
|
|
410
|
+
error: new ConfigValidationError(issues)
|
|
411
|
+
};
|
|
412
|
+
},
|
|
413
|
+
parse(input) {
|
|
414
|
+
const r = this.safeParse(input);
|
|
415
|
+
if (!r.success) throw r.error;
|
|
416
|
+
return r.data;
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
// ─── Output type (was Infer<typeof ConfigSchema>) ──────────────────────────────
|
|
241
421
|
|
|
242
422
|
// Re-export config types from contracts for consumers migrating to new import paths
|
|
243
423
|
//# sourceMappingURL=schema.js.map
|