@scalebun/react-native 1.1.0 → 1.2.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.
Files changed (380) hide show
  1. package/dist/scalebun.full.js +33218 -0
  2. package/dist/scalebun.full.js.map +1 -0
  3. package/dist/scalebun.slim.js +30016 -0
  4. package/dist/scalebun.slim.js.map +1 -0
  5. package/lib/commonjs/bootstrap/FeatureRegistry.js +4 -4
  6. package/lib/commonjs/bootstrap/FeatureRegistry.js.map +1 -1
  7. package/lib/commonjs/bootstrap/SDKBootstrapper.js +8 -8
  8. package/lib/commonjs/bootstrap/SDKBootstrapper.js.map +1 -1
  9. package/lib/commonjs/core/config/schema.js +412 -232
  10. package/lib/commonjs/core/config/schema.js.map +1 -1
  11. package/lib/commonjs/core/constants/protocol.js +31 -0
  12. package/lib/commonjs/core/constants/protocol.js.map +1 -0
  13. package/lib/commonjs/core/constants/timings.js +4 -1
  14. package/lib/commonjs/core/constants/timings.js.map +1 -1
  15. package/lib/commonjs/core/lifecycle/appLifecycle.js +1 -1
  16. package/lib/commonjs/core/lifecycle/appLifecycle.js.map +1 -1
  17. package/lib/commonjs/debug/bootstrap.js +30 -10
  18. package/lib/commonjs/debug/bootstrap.js.map +1 -1
  19. package/lib/commonjs/debug/exportBridge.js +5 -3
  20. package/lib/commonjs/debug/exportBridge.js.map +1 -1
  21. package/lib/commonjs/debug/hostResolver.js +2 -2
  22. package/lib/commonjs/debug/hostResolver.js.map +1 -1
  23. package/lib/commonjs/debug/perfWiring.js +4 -4
  24. package/lib/commonjs/debug/perfWiring.js.map +1 -1
  25. package/lib/commonjs/debug/replayWiring.js +5 -5
  26. package/lib/commonjs/debug/replayWiring.js.map +1 -1
  27. package/lib/commonjs/debug/screenTracking.js +2 -2
  28. package/lib/commonjs/debug/screenTracking.js.map +1 -1
  29. package/lib/commonjs/debug/sessionWiring.js +2 -2
  30. package/lib/commonjs/debug/sessionWiring.js.map +1 -1
  31. package/lib/commonjs/features/crash/NativeCrashFeature.js +1 -1
  32. package/lib/commonjs/features/crash/NativeCrashFeature.js.map +1 -1
  33. package/lib/commonjs/features/crash/globalHandler.js +3 -3
  34. package/lib/commonjs/features/crash/globalHandler.js.map +1 -1
  35. package/lib/commonjs/features/crash/nativeCrashBridge.js +7 -7
  36. package/lib/commonjs/features/crash/nativeCrashBridge.js.map +1 -1
  37. package/lib/commonjs/features/crash/rejectionHandler.js +2 -2
  38. package/lib/commonjs/features/crash/rejectionHandler.js.map +1 -1
  39. package/lib/commonjs/features/engage/EngageArchetypeRenderers.js +0 -9
  40. package/lib/commonjs/features/engage/EngageArchetypeRenderers.js.map +1 -1
  41. package/lib/commonjs/features/engage/EngageInAppView.js +1 -1
  42. package/lib/commonjs/features/engage/EngageInAppView.js.map +1 -1
  43. package/lib/commonjs/features/engage/EngagePromptProvider.js +17 -17
  44. package/lib/commonjs/features/engage/EngagePromptProvider.js.map +1 -1
  45. package/lib/commonjs/features/engage/EngageTransport.js +5 -5
  46. package/lib/commonjs/features/engage/EngageTransport.js.map +1 -1
  47. package/lib/commonjs/features/engage/engagePushTokenBridge.js +4 -4
  48. package/lib/commonjs/features/engage/engagePushTokenBridge.js.map +1 -1
  49. package/lib/commonjs/features/engage/engageShakeBridge.js +2 -2
  50. package/lib/commonjs/features/engage/engageShakeBridge.js.map +1 -1
  51. package/lib/commonjs/features/engage/engageSignals.js +1 -1
  52. package/lib/commonjs/features/engage/engageSignals.js.map +1 -1
  53. package/lib/commonjs/features/engage/engageStoreReviewBridge.js +2 -2
  54. package/lib/commonjs/features/engage/engageStoreReviewBridge.js.map +1 -1
  55. package/lib/commonjs/features/engage/engageTestSeenStore.js +1 -1
  56. package/lib/commonjs/features/engage/engageTestSeenStore.js.map +1 -1
  57. package/lib/commonjs/features/engage/engageThrottle.js +4 -4
  58. package/lib/commonjs/features/engage/engageThrottle.js.map +1 -1
  59. package/lib/commonjs/features/engage/engageTriggerEngine.js +4 -4
  60. package/lib/commonjs/features/engage/engageTriggerEngine.js.map +1 -1
  61. package/lib/commonjs/features/engage/engageWindowInsets.js +1 -1
  62. package/lib/commonjs/features/engage/engageWindowInsets.js.map +1 -1
  63. package/lib/commonjs/features/install-referrer/installReferrer.js +3 -3
  64. package/lib/commonjs/features/install-referrer/installReferrer.js.map +1 -1
  65. package/lib/commonjs/features/journey/calibrationContext.js +0 -9
  66. package/lib/commonjs/features/journey/calibrationContext.js.map +1 -1
  67. package/lib/commonjs/features/journey/journeyManager.js +4 -1
  68. package/lib/commonjs/features/journey/journeyManager.js.map +1 -1
  69. package/lib/commonjs/features/navigation/AutoScreenDetector.js +4 -4
  70. package/lib/commonjs/features/navigation/AutoScreenDetector.js.map +1 -1
  71. package/lib/commonjs/features/ota/OtaOrchestrator.js +18 -18
  72. package/lib/commonjs/features/ota/OtaOrchestrator.js.map +1 -1
  73. package/lib/commonjs/features/ota/geoCountry.js +2 -2
  74. package/lib/commonjs/features/ota/geoCountry.js.map +1 -1
  75. package/lib/commonjs/features/ota/retry.js +2 -2
  76. package/lib/commonjs/features/ota/retry.js.map +1 -1
  77. package/lib/commonjs/features/performance/PerformanceFeature.js +121 -23
  78. package/lib/commonjs/features/performance/PerformanceFeature.js.map +1 -1
  79. package/lib/commonjs/features/replay/core/logger/logger.js +0 -4
  80. package/lib/commonjs/features/replay/core/logger/logger.js.map +1 -1
  81. package/lib/commonjs/features/replay/integrations/network/networkAdapter.js +1 -54
  82. package/lib/commonjs/features/replay/integrations/network/networkAdapter.js.map +1 -1
  83. package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
  84. package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
  85. package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js +1 -1
  86. package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
  87. package/lib/commonjs/features/replay/pipeline/batching/batchManager.js +1 -1
  88. package/lib/commonjs/features/replay/pipeline/batching/batchManager.js.map +1 -1
  89. package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js +1 -1
  90. package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
  91. package/lib/commonjs/features/replay/public/api.js +7 -7
  92. package/lib/commonjs/features/replay/public/api.js.map +1 -1
  93. package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js +9 -9
  94. package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
  95. package/lib/commonjs/features/session/BackendSessionAdapter.js +41 -41
  96. package/lib/commonjs/features/session/BackendSessionAdapter.js.map +1 -1
  97. package/lib/commonjs/features/session/DesktopSessionTransport.js +5 -2
  98. package/lib/commonjs/features/session/DesktopSessionTransport.js.map +1 -1
  99. package/lib/commonjs/features/session/JourneyEventPipeline.js +1 -1
  100. package/lib/commonjs/features/session/JourneyEventPipeline.js.map +1 -1
  101. package/lib/commonjs/features/session/ReplayCaptureManager.js +14 -14
  102. package/lib/commonjs/features/session/ReplayCaptureManager.js.map +1 -1
  103. package/lib/commonjs/features/session/SessionManager.js +9 -9
  104. package/lib/commonjs/features/session/SessionManager.js.map +1 -1
  105. package/lib/commonjs/features/session/SyncDecisionEngine.js +1 -1
  106. package/lib/commonjs/features/session/SyncDecisionEngine.js.map +1 -1
  107. package/lib/commonjs/features/skan/skanBridge.js +6 -15
  108. package/lib/commonjs/features/skan/skanBridge.js.map +1 -1
  109. package/lib/commonjs/features/skan/skanConversionManager.js +5 -5
  110. package/lib/commonjs/features/skan/skanConversionManager.js.map +1 -1
  111. package/lib/commonjs/integrations/fetch/fetchInterceptor.js +1 -1
  112. package/lib/commonjs/integrations/fetch/fetchInterceptor.js.map +1 -1
  113. package/lib/commonjs/integrations/xhr/xhrInterceptor.js +1 -1
  114. package/lib/commonjs/integrations/xhr/xhrInterceptor.js.map +1 -1
  115. package/lib/commonjs/metro/composeSourceMap.js +105 -0
  116. package/lib/commonjs/metro/composeSourceMap.js.map +1 -0
  117. package/lib/commonjs/metro/featureModules.js +131 -0
  118. package/lib/commonjs/metro/featureModules.js.map +1 -0
  119. package/lib/commonjs/metro/index.js +123 -2
  120. package/lib/commonjs/metro/index.js.map +1 -1
  121. package/lib/commonjs/metro/serializerCompose.js +129 -0
  122. package/lib/commonjs/metro/serializerCompose.js.map +1 -0
  123. package/lib/commonjs/pipeline/dispatcher/dispatcher.js +1 -1
  124. package/lib/commonjs/pipeline/dispatcher/dispatcher.js.map +1 -1
  125. package/lib/commonjs/pipeline/queue/flushQueue.js +2 -2
  126. package/lib/commonjs/pipeline/queue/flushQueue.js.map +1 -1
  127. package/lib/commonjs/pipeline/queue/persistentQueue.js +6 -37
  128. package/lib/commonjs/pipeline/queue/persistentQueue.js.map +1 -1
  129. package/lib/commonjs/pipeline/scheduler/flushScheduler.js +1 -1
  130. package/lib/commonjs/pipeline/scheduler/flushScheduler.js.map +1 -1
  131. package/lib/commonjs/public/ScaleBunFacade.js +15 -15
  132. package/lib/commonjs/public/ScaleBunFacade.js.map +1 -1
  133. package/lib/commonjs/push/PushManager.js +3 -3
  134. package/lib/commonjs/push/PushManager.js.map +1 -1
  135. package/lib/commonjs/push/adapters/NativeBridgeAdapter.js +1 -1
  136. package/lib/commonjs/push/adapters/NativeBridgeAdapter.js.map +1 -1
  137. package/lib/commonjs/push/native/nativeNotifications.js +7 -18
  138. package/lib/commonjs/push/native/nativeNotifications.js.map +1 -1
  139. package/lib/commonjs/storage/StorageBackend.js +1 -1
  140. package/lib/commonjs/storage/StorageBackend.js.map +1 -1
  141. package/lib/module/bootstrap/FeatureRegistry.js +4 -4
  142. package/lib/module/bootstrap/FeatureRegistry.js.map +1 -1
  143. package/lib/module/bootstrap/SDKBootstrapper.js +8 -8
  144. package/lib/module/bootstrap/SDKBootstrapper.js.map +1 -1
  145. package/lib/module/core/config/schema.js +411 -231
  146. package/lib/module/core/config/schema.js.map +1 -1
  147. package/lib/module/core/constants/protocol.js +25 -0
  148. package/lib/module/core/constants/protocol.js.map +1 -0
  149. package/lib/module/core/constants/timings.js +3 -1
  150. package/lib/module/core/constants/timings.js.map +1 -1
  151. package/lib/module/core/lifecycle/appLifecycle.js +1 -1
  152. package/lib/module/core/lifecycle/appLifecycle.js.map +1 -1
  153. package/lib/module/debug/bootstrap.js +30 -9
  154. package/lib/module/debug/bootstrap.js.map +1 -1
  155. package/lib/module/debug/exportBridge.js +5 -3
  156. package/lib/module/debug/exportBridge.js.map +1 -1
  157. package/lib/module/debug/hostResolver.js +2 -2
  158. package/lib/module/debug/hostResolver.js.map +1 -1
  159. package/lib/module/debug/perfWiring.js +4 -4
  160. package/lib/module/debug/perfWiring.js.map +1 -1
  161. package/lib/module/debug/replayWiring.js +5 -5
  162. package/lib/module/debug/replayWiring.js.map +1 -1
  163. package/lib/module/debug/screenTracking.js +2 -2
  164. package/lib/module/debug/screenTracking.js.map +1 -1
  165. package/lib/module/debug/sessionWiring.js +2 -2
  166. package/lib/module/debug/sessionWiring.js.map +1 -1
  167. package/lib/module/features/crash/NativeCrashFeature.js +1 -1
  168. package/lib/module/features/crash/NativeCrashFeature.js.map +1 -1
  169. package/lib/module/features/crash/globalHandler.js +3 -3
  170. package/lib/module/features/crash/globalHandler.js.map +1 -1
  171. package/lib/module/features/crash/nativeCrashBridge.js +7 -7
  172. package/lib/module/features/crash/nativeCrashBridge.js.map +1 -1
  173. package/lib/module/features/crash/rejectionHandler.js +2 -2
  174. package/lib/module/features/crash/rejectionHandler.js.map +1 -1
  175. package/lib/module/features/engage/EngageArchetypeRenderers.js +0 -8
  176. package/lib/module/features/engage/EngageArchetypeRenderers.js.map +1 -1
  177. package/lib/module/features/engage/EngageInAppView.js +1 -1
  178. package/lib/module/features/engage/EngageInAppView.js.map +1 -1
  179. package/lib/module/features/engage/EngagePromptProvider.js +17 -17
  180. package/lib/module/features/engage/EngagePromptProvider.js.map +1 -1
  181. package/lib/module/features/engage/EngageTransport.js +5 -5
  182. package/lib/module/features/engage/EngageTransport.js.map +1 -1
  183. package/lib/module/features/engage/engagePushTokenBridge.js +4 -4
  184. package/lib/module/features/engage/engagePushTokenBridge.js.map +1 -1
  185. package/lib/module/features/engage/engageShakeBridge.js +2 -2
  186. package/lib/module/features/engage/engageShakeBridge.js.map +1 -1
  187. package/lib/module/features/engage/engageSignals.js +1 -1
  188. package/lib/module/features/engage/engageSignals.js.map +1 -1
  189. package/lib/module/features/engage/engageStoreReviewBridge.js +2 -2
  190. package/lib/module/features/engage/engageStoreReviewBridge.js.map +1 -1
  191. package/lib/module/features/engage/engageTestSeenStore.js +1 -1
  192. package/lib/module/features/engage/engageTestSeenStore.js.map +1 -1
  193. package/lib/module/features/engage/engageThrottle.js +4 -4
  194. package/lib/module/features/engage/engageThrottle.js.map +1 -1
  195. package/lib/module/features/engage/engageTriggerEngine.js +4 -4
  196. package/lib/module/features/engage/engageTriggerEngine.js.map +1 -1
  197. package/lib/module/features/engage/engageWindowInsets.js +1 -1
  198. package/lib/module/features/engage/engageWindowInsets.js.map +1 -1
  199. package/lib/module/features/install-referrer/installReferrer.js +3 -3
  200. package/lib/module/features/install-referrer/installReferrer.js.map +1 -1
  201. package/lib/module/features/journey/calibrationContext.js +0 -8
  202. package/lib/module/features/journey/calibrationContext.js.map +1 -1
  203. package/lib/module/features/journey/journeyManager.js +3 -1
  204. package/lib/module/features/journey/journeyManager.js.map +1 -1
  205. package/lib/module/features/navigation/AutoScreenDetector.js +4 -4
  206. package/lib/module/features/navigation/AutoScreenDetector.js.map +1 -1
  207. package/lib/module/features/ota/OtaOrchestrator.js +18 -18
  208. package/lib/module/features/ota/OtaOrchestrator.js.map +1 -1
  209. package/lib/module/features/ota/geoCountry.js +2 -2
  210. package/lib/module/features/ota/geoCountry.js.map +1 -1
  211. package/lib/module/features/ota/retry.js +2 -2
  212. package/lib/module/features/ota/retry.js.map +1 -1
  213. package/lib/module/features/performance/PerformanceFeature.js +122 -23
  214. package/lib/module/features/performance/PerformanceFeature.js.map +1 -1
  215. package/lib/module/features/replay/core/logger/logger.js +0 -3
  216. package/lib/module/features/replay/core/logger/logger.js.map +1 -1
  217. package/lib/module/features/replay/integrations/network/networkAdapter.js +1 -52
  218. package/lib/module/features/replay/integrations/network/networkAdapter.js.map +1 -1
  219. package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
  220. package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
  221. package/lib/module/features/replay/integrations/touch/ReplayRoot.js +1 -1
  222. package/lib/module/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
  223. package/lib/module/features/replay/pipeline/batching/batchManager.js +1 -1
  224. package/lib/module/features/replay/pipeline/batching/batchManager.js.map +1 -1
  225. package/lib/module/features/replay/pipeline/retry/retryPolicy.js +1 -1
  226. package/lib/module/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
  227. package/lib/module/features/replay/public/api.js +7 -7
  228. package/lib/module/features/replay/public/api.js.map +1 -1
  229. package/lib/module/features/replay/replay/session/sessionOrchestrator.js +9 -9
  230. package/lib/module/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
  231. package/lib/module/features/session/BackendSessionAdapter.js +41 -41
  232. package/lib/module/features/session/BackendSessionAdapter.js.map +1 -1
  233. package/lib/module/features/session/DesktopSessionTransport.js +4 -2
  234. package/lib/module/features/session/DesktopSessionTransport.js.map +1 -1
  235. package/lib/module/features/session/JourneyEventPipeline.js +1 -1
  236. package/lib/module/features/session/JourneyEventPipeline.js.map +1 -1
  237. package/lib/module/features/session/ReplayCaptureManager.js +14 -14
  238. package/lib/module/features/session/ReplayCaptureManager.js.map +1 -1
  239. package/lib/module/features/session/SessionManager.js +9 -9
  240. package/lib/module/features/session/SessionManager.js.map +1 -1
  241. package/lib/module/features/session/SyncDecisionEngine.js +1 -1
  242. package/lib/module/features/session/SyncDecisionEngine.js.map +1 -1
  243. package/lib/module/features/skan/skanBridge.js +6 -14
  244. package/lib/module/features/skan/skanBridge.js.map +1 -1
  245. package/lib/module/features/skan/skanConversionManager.js +5 -5
  246. package/lib/module/features/skan/skanConversionManager.js.map +1 -1
  247. package/lib/module/integrations/fetch/fetchInterceptor.js +1 -1
  248. package/lib/module/integrations/fetch/fetchInterceptor.js.map +1 -1
  249. package/lib/module/integrations/xhr/xhrInterceptor.js +1 -1
  250. package/lib/module/integrations/xhr/xhrInterceptor.js.map +1 -1
  251. package/lib/module/metro/composeSourceMap.js +97 -0
  252. package/lib/module/metro/composeSourceMap.js.map +1 -0
  253. package/lib/module/metro/featureModules.js +123 -0
  254. package/lib/module/metro/featureModules.js.map +1 -0
  255. package/lib/module/metro/index.js +122 -2
  256. package/lib/module/metro/index.js.map +1 -1
  257. package/lib/module/metro/serializerCompose.js +120 -0
  258. package/lib/module/metro/serializerCompose.js.map +1 -0
  259. package/lib/module/pipeline/dispatcher/dispatcher.js +1 -1
  260. package/lib/module/pipeline/dispatcher/dispatcher.js.map +1 -1
  261. package/lib/module/pipeline/queue/flushQueue.js +2 -2
  262. package/lib/module/pipeline/queue/flushQueue.js.map +1 -1
  263. package/lib/module/pipeline/queue/persistentQueue.js +6 -36
  264. package/lib/module/pipeline/queue/persistentQueue.js.map +1 -1
  265. package/lib/module/pipeline/scheduler/flushScheduler.js +1 -1
  266. package/lib/module/pipeline/scheduler/flushScheduler.js.map +1 -1
  267. package/lib/module/public/ScaleBunFacade.js +15 -15
  268. package/lib/module/public/ScaleBunFacade.js.map +1 -1
  269. package/lib/module/push/PushManager.js +3 -3
  270. package/lib/module/push/PushManager.js.map +1 -1
  271. package/lib/module/push/adapters/NativeBridgeAdapter.js +1 -1
  272. package/lib/module/push/adapters/NativeBridgeAdapter.js.map +1 -1
  273. package/lib/module/push/native/nativeNotifications.js +7 -17
  274. package/lib/module/push/native/nativeNotifications.js.map +1 -1
  275. package/lib/module/storage/StorageBackend.js +1 -1
  276. package/lib/module/storage/StorageBackend.js.map +1 -1
  277. package/lib/typescript/core/config/schema.d.ts +61 -40
  278. package/lib/typescript/core/config/schema.d.ts.map +1 -1
  279. package/lib/typescript/core/constants/protocol.d.ts +23 -0
  280. package/lib/typescript/core/constants/protocol.d.ts.map +1 -0
  281. package/lib/typescript/core/constants/timings.d.ts +1 -1
  282. package/lib/typescript/core/constants/timings.d.ts.map +1 -1
  283. package/lib/typescript/debug/bootstrap.d.ts +0 -1
  284. package/lib/typescript/debug/bootstrap.d.ts.map +1 -1
  285. package/lib/typescript/debug/exportBridge.d.ts.map +1 -1
  286. package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts +0 -2
  287. package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts.map +1 -1
  288. package/lib/typescript/features/journey/calibrationContext.d.ts +0 -1
  289. package/lib/typescript/features/journey/calibrationContext.d.ts.map +1 -1
  290. package/lib/typescript/features/journey/journeyManager.d.ts.map +1 -1
  291. package/lib/typescript/features/performance/PerformanceFeature.d.ts +31 -0
  292. package/lib/typescript/features/performance/PerformanceFeature.d.ts.map +1 -1
  293. package/lib/typescript/features/replay/core/logger/logger.d.ts +0 -1
  294. package/lib/typescript/features/replay/core/logger/logger.d.ts.map +1 -1
  295. package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts +0 -10
  296. package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts.map +1 -1
  297. package/lib/typescript/features/session/DesktopSessionTransport.d.ts.map +1 -1
  298. package/lib/typescript/features/skan/skanBridge.d.ts +0 -2
  299. package/lib/typescript/features/skan/skanBridge.d.ts.map +1 -1
  300. package/lib/typescript/metro/composeSourceMap.d.ts +26 -0
  301. package/lib/typescript/metro/composeSourceMap.d.ts.map +1 -0
  302. package/lib/typescript/metro/featureModules.d.ts +49 -0
  303. package/lib/typescript/metro/featureModules.d.ts.map +1 -0
  304. package/lib/typescript/metro/index.d.ts +22 -0
  305. package/lib/typescript/metro/index.d.ts.map +1 -1
  306. package/lib/typescript/metro/serializerCompose.d.ts +46 -0
  307. package/lib/typescript/metro/serializerCompose.d.ts.map +1 -0
  308. package/lib/typescript/pipeline/queue/persistentQueue.d.ts +0 -10
  309. package/lib/typescript/pipeline/queue/persistentQueue.d.ts.map +1 -1
  310. package/lib/typescript/push/native/nativeNotifications.d.ts +0 -6
  311. package/lib/typescript/push/native/nativeNotifications.d.ts.map +1 -1
  312. package/package.json +15 -11
  313. package/src/bootstrap/FeatureRegistry.ts +4 -4
  314. package/src/bootstrap/SDKBootstrapper.ts +8 -8
  315. package/src/core/config/schema.ts +353 -235
  316. package/src/core/constants/protocol.ts +24 -0
  317. package/src/core/constants/timings.ts +3 -1
  318. package/src/core/lifecycle/appLifecycle.ts +1 -1
  319. package/src/debug/bootstrap.ts +40 -7
  320. package/src/debug/exportBridge.ts +5 -3
  321. package/src/debug/hostResolver.ts +2 -2
  322. package/src/debug/perfWiring.ts +4 -4
  323. package/src/debug/replayWiring.ts +5 -5
  324. package/src/debug/screenTracking.ts +2 -2
  325. package/src/debug/sessionWiring.ts +2 -2
  326. package/src/features/crash/NativeCrashFeature.ts +1 -1
  327. package/src/features/crash/globalHandler.ts +3 -3
  328. package/src/features/crash/nativeCrashBridge.ts +7 -7
  329. package/src/features/crash/rejectionHandler.ts +2 -2
  330. package/src/features/engage/EngageArchetypeRenderers.tsx +0 -11
  331. package/src/features/engage/EngageInAppView.tsx +1 -1
  332. package/src/features/engage/EngagePromptProvider.tsx +17 -17
  333. package/src/features/engage/EngageTransport.ts +5 -5
  334. package/src/features/engage/engagePushTokenBridge.ts +4 -4
  335. package/src/features/engage/engageShakeBridge.ts +2 -2
  336. package/src/features/engage/engageSignals.ts +1 -1
  337. package/src/features/engage/engageStoreReviewBridge.ts +2 -2
  338. package/src/features/engage/engageTestSeenStore.ts +1 -1
  339. package/src/features/engage/engageThrottle.ts +4 -4
  340. package/src/features/engage/engageTriggerEngine.ts +4 -4
  341. package/src/features/engage/engageWindowInsets.ts +1 -1
  342. package/src/features/install-referrer/installReferrer.ts +3 -3
  343. package/src/features/journey/calibrationContext.ts +0 -9
  344. package/src/features/journey/journeyManager.ts +3 -1
  345. package/src/features/navigation/AutoScreenDetector.ts +4 -4
  346. package/src/features/ota/OtaOrchestrator.ts +18 -18
  347. package/src/features/ota/geoCountry.ts +2 -2
  348. package/src/features/ota/retry.ts +2 -2
  349. package/src/features/performance/PerformanceFeature.ts +130 -20
  350. package/src/features/replay/core/logger/logger.ts +0 -4
  351. package/src/features/replay/integrations/network/networkAdapter.ts +1 -56
  352. package/src/features/replay/integrations/react-navigation/navigationIntegration.ts +1 -1
  353. package/src/features/replay/integrations/touch/ReplayRoot.tsx +1 -1
  354. package/src/features/replay/pipeline/batching/batchManager.ts +1 -1
  355. package/src/features/replay/pipeline/retry/retryPolicy.ts +1 -1
  356. package/src/features/replay/public/api.ts +7 -7
  357. package/src/features/replay/replay/session/sessionOrchestrator.ts +9 -9
  358. package/src/features/session/BackendSessionAdapter.ts +41 -41
  359. package/src/features/session/DesktopSessionTransport.ts +4 -2
  360. package/src/features/session/JourneyEventPipeline.ts +1 -1
  361. package/src/features/session/ReplayCaptureManager.ts +14 -14
  362. package/src/features/session/SessionManager.ts +9 -9
  363. package/src/features/session/SyncDecisionEngine.ts +1 -1
  364. package/src/features/skan/skanBridge.ts +6 -14
  365. package/src/features/skan/skanConversionManager.ts +5 -5
  366. package/src/integrations/fetch/fetchInterceptor.ts +1 -1
  367. package/src/integrations/xhr/xhrInterceptor.ts +1 -1
  368. package/src/metro/composeSourceMap.ts +104 -0
  369. package/src/metro/featureModules.ts +143 -0
  370. package/src/metro/index.ts +173 -1
  371. package/src/metro/serializerCompose.ts +157 -0
  372. package/src/pipeline/dispatcher/dispatcher.ts +1 -1
  373. package/src/pipeline/queue/flushQueue.ts +2 -2
  374. package/src/pipeline/queue/persistentQueue.ts +6 -35
  375. package/src/pipeline/scheduler/flushScheduler.ts +1 -1
  376. package/src/public/ScaleBunFacade.ts +15 -15
  377. package/src/push/PushManager.ts +3 -3
  378. package/src/push/adapters/NativeBridgeAdapter.ts +1 -1
  379. package/src/push/native/nativeNotifications.ts +7 -16
  380. 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
- const ConfigSchema = exports.ConfigSchema = _protocol.z.object({
11
- projectId: _protocol.z.string().min(1).optional(),
12
- publishableKey: _protocol.z.string().min(1).optional(),
13
- /**
14
- * Backend API base URL. LOCKED to {@link DEFAULT_API_BASE_URL} the ScaleBun
15
- * cloud endpoint is fixed and cannot be overridden by integrators. Any value
16
- * supplied here is accepted (no validation error, for backward compatibility)
17
- * but ignored: the bootstrapper force-overwrites it with DEFAULT_API_BASE_URL
18
- * immediately after parse. To point the SDK at a different backend, change the
19
- * constant at build time.
20
- */
21
- // NB: `.default()` on the vendored `z` types its arg as `Partial<T> | (() => T)`, so a bare
22
- // string arg fails `tsc` (.d.ts generation via bob) with TS2345. The factory form satisfies the
23
- // `(() => any)` overload. Behaviour is identical — omitted apiBaseUrl resolves to the default,
24
- // which the bootstrapper overwrites anyway (the endpoint is locked).
25
- apiBaseUrl: _protocol.z.any().default(() => _endpoints.DEFAULT_API_BASE_URL),
26
- debug: _protocol.z.boolean().default(false),
27
- /**
28
- * SDK internal log verbosity. Recoverable transport failures are logged at
29
- * 'warn' (never console.error), so they never surface as a RedBox.
30
- * Default: 'warn'. If omitted and debug=true, the bootstrapper uses 'debug'.
31
- */
32
- logLevel: _protocol.z.enum(['silent', 'error', 'warn', 'info', 'debug']).optional(),
33
- flushIntervalMs: _protocol.z.number().min(1000).default(5000),
34
- /**
35
- * When true, end the recording session on APP_BACKGROUND and start a fresh
36
- * one on next foreground (per-foreground sessions). Default false: a single
37
- * session spans app-switches; the server-side reaper closes it if the app is
38
- * killed in the background. Background always flushes pending data regardless.
39
- */
40
- finalizeOnBackground: _protocol.z.boolean().default(false),
41
- /**
42
- * Inactivity gap (ms) at/after which timeline time is treated as "idle" and
43
- * excluded from the active session duration. Sent to the backend on session
44
- * start and echoed back in the session detail so the dashboard draws idle
45
- * bands + computes active duration with the SAME threshold the SDK declared
46
- * (no client-side guess). Default 60000 (60s).
47
- */
48
- idleThresholdMs: _protocol.z.number().min(1000).default(60_000),
49
- /**
50
- * Max time (ms) the app may stay backgrounded before the analytics session is
51
- * finalized on the next foreground and a fresh one is opened ("cap then
52
- * reaper"). Below the cap, a background/foreground round-trip keeps ONE
53
- * session (background span is flagged, not split). The server-side stale
54
- * reaper is the backstop for a true process kill. Default 1800000 (30 min).
55
- */
56
- sessionBackgroundCapMs: _protocol.z.number().min(60_000).default(30 * 60 * 1000),
57
- maxQueueSize: _protocol.z.number().min(1).default(1000),
58
- enableNetworkMonitoring: _protocol.z.boolean().default(true),
59
- /**
60
- * Opt-in: capture request/response headers and bodies.
61
- * Default: false — must be explicitly enabled by the integrator.
62
- * See ScaleBunFeatures.captureNetworkBodies for the full privacy warning.
63
- */
64
- captureNetworkBodies: _protocol.z.boolean().default(false),
65
- /**
66
- * Max bytes captured per body (request or response) before truncation.
67
- * Range: 1 byte 1 MiB. Default: 65536 (64 KiB).
68
- */
69
- networkBodyMaxBytes: _protocol.z.number().min(1).max(1_048_576).default(65_536),
70
- /**
71
- * Persistent queue configuration.
72
- * Controls whether the event queue persists to disk and its bounds.
73
- */
74
- persistence: _protocol.z.object({
75
- /** Enable disk persistence (survives app restarts). Default: true */
76
- enabled: _protocol.z.boolean().default(true),
77
- /** Max total bytes stored on disk. Default: 5 MB (5_242_880) */
78
- maxBytes: _protocol.z.number().min(1024).default(5_242_880),
79
- /** Max total entries stored. Default: 5000 */
80
- maxEntries: _protocol.z.number().min(10).default(5_000),
81
- /** Strip PII from payloads before writing to disk. Default: true */
82
- redactBeforeWrite: _protocol.z.boolean().default(true)
83
- }).default({}),
84
- clientKey: _protocol.z.string().optional(),
85
- /**
86
- * Upload replay frame bytes to object storage via presigned PUT instead of
87
- * inline base64 in the frames JSON body. Default false (legacy inline). Safe
88
- * to enable before the backend is ready: the SDK auto-falls back to inline if
89
- * the presign endpoint reports storage is not configured. SaaS (clientKey) only.
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