@dynamic-labs/legacy-client 0.0.0 → 5.0.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.
Files changed (327) hide show
  1. package/CHANGELOG.md +6800 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/_virtual/_tslib.cjs +36 -0
  5. package/_virtual/_tslib.js +32 -0
  6. package/package.cjs +8 -0
  7. package/package.js +4 -0
  8. package/package.json +33 -1
  9. package/src/client/client.cjs +80 -0
  10. package/src/client/client.d.ts +108 -0
  11. package/src/client/client.js +75 -0
  12. package/src/client/core/core.cjs +84 -0
  13. package/src/client/core/core.d.ts +75 -0
  14. package/src/client/core/core.js +80 -0
  15. package/src/client/core/index.d.ts +1 -0
  16. package/src/client/core/modules/initializationModule/index.d.ts +1 -0
  17. package/src/client/core/modules/initializationModule/initializationModule.cjs +72 -0
  18. package/src/client/core/modules/initializationModule/initializationModule.d.ts +6 -0
  19. package/src/client/core/modules/initializationModule/initializationModule.js +68 -0
  20. package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.cjs +28 -0
  21. package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.d.ts +3 -0
  22. package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.js +24 -0
  23. package/src/client/core/modules/manifestModule/createPartialManifest/index.d.ts +1 -0
  24. package/src/client/core/modules/manifestModule/index.d.ts +1 -0
  25. package/src/client/core/modules/manifestModule/manifestModule.cjs +40 -0
  26. package/src/client/core/modules/manifestModule/manifestModule.d.ts +12 -0
  27. package/src/client/core/modules/manifestModule/manifestModule.js +36 -0
  28. package/src/client/core/modules/manifestModule/validateManifest/index.d.ts +1 -0
  29. package/src/client/core/modules/manifestModule/validateManifest/validateManifest.cjs +31 -0
  30. package/src/client/core/modules/manifestModule/validateManifest/validateManifest.d.ts +14 -0
  31. package/src/client/core/modules/manifestModule/validateManifest/validateManifest.js +26 -0
  32. package/src/client/core/modules/webViewLoadControllerRegistry/index.d.ts +1 -0
  33. package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.cjs +24 -0
  34. package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.d.ts +29 -0
  35. package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.js +20 -0
  36. package/src/client/index.d.ts +1 -0
  37. package/src/index.cjs +26 -0
  38. package/src/index.d.ts +14 -0
  39. package/src/index.js +14 -0
  40. package/src/modules/authModule/authModule.cjs +60 -0
  41. package/src/modules/authModule/authModule.d.ts +30 -0
  42. package/src/modules/authModule/authModule.js +56 -0
  43. package/src/modules/authModule/emailAuthModule/emailAuthModule.cjs +26 -0
  44. package/src/modules/authModule/emailAuthModule/emailAuthModule.d.ts +10 -0
  45. package/src/modules/authModule/emailAuthModule/emailAuthModule.js +22 -0
  46. package/src/modules/authModule/emailAuthModule/index.d.ts +1 -0
  47. package/src/modules/authModule/externalAuthModule/externalAuthModule.cjs +16 -0
  48. package/src/modules/authModule/externalAuthModule/externalAuthModule.d.ts +7 -0
  49. package/src/modules/authModule/externalAuthModule/externalAuthModule.js +12 -0
  50. package/src/modules/authModule/externalAuthModule/index.d.ts +1 -0
  51. package/src/modules/authModule/index.d.ts +1 -0
  52. package/src/modules/authModule/passkeyAuthModule/index.d.ts +1 -0
  53. package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.cjs +15 -0
  54. package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.d.ts +6 -0
  55. package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.js +11 -0
  56. package/src/modules/authModule/smsAuthModule/index.d.ts +1 -0
  57. package/src/modules/authModule/smsAuthModule/smsAuthModule.cjs +23 -0
  58. package/src/modules/authModule/smsAuthModule/smsAuthModule.d.ts +11 -0
  59. package/src/modules/authModule/smsAuthModule/smsAuthModule.js +19 -0
  60. package/src/modules/authModule/socialAuthModule/index.d.ts +1 -0
  61. package/src/modules/authModule/socialAuthModule/socialAuthModule.cjs +24 -0
  62. package/src/modules/authModule/socialAuthModule/socialAuthModule.d.ts +10 -0
  63. package/src/modules/authModule/socialAuthModule/socialAuthModule.js +20 -0
  64. package/src/modules/bitcoinModule/bitcoinModule.cjs +21 -0
  65. package/src/modules/bitcoinModule/bitcoinModule.d.ts +19 -0
  66. package/src/modules/bitcoinModule/bitcoinModule.js +17 -0
  67. package/src/modules/bitcoinModule/index.d.ts +1 -0
  68. package/src/modules/deviceRegistrationModule/deviceRegistrationModule.cjs +32 -0
  69. package/src/modules/deviceRegistrationModule/deviceRegistrationModule.d.ts +12 -0
  70. package/src/modules/deviceRegistrationModule/deviceRegistrationModule.js +28 -0
  71. package/src/modules/deviceRegistrationModule/index.d.ts +1 -0
  72. package/src/modules/instrumentationModule/index.d.ts +1 -0
  73. package/src/modules/instrumentationModule/instrumentationModule.cjs +40 -0
  74. package/src/modules/instrumentationModule/instrumentationModule.d.ts +6 -0
  75. package/src/modules/instrumentationModule/instrumentationModule.js +36 -0
  76. package/src/modules/localeModule/index.d.ts +1 -0
  77. package/src/modules/localeModule/localeModule.cjs +15 -0
  78. package/src/modules/localeModule/localeModule.d.ts +14 -0
  79. package/src/modules/localeModule/localeModule.js +11 -0
  80. package/src/modules/mfaModule/index.d.ts +1 -0
  81. package/src/modules/mfaModule/mfaModule.cjs +35 -0
  82. package/src/modules/mfaModule/mfaModule.d.ts +23 -0
  83. package/src/modules/mfaModule/mfaModule.js +31 -0
  84. package/src/modules/networksModule/index.d.ts +1 -0
  85. package/src/modules/networksModule/networksModule.cjs +18 -0
  86. package/src/modules/networksModule/networksModule.d.ts +3 -0
  87. package/src/modules/networksModule/networksModule.js +14 -0
  88. package/src/modules/passkeysModule/index.d.ts +1 -0
  89. package/src/modules/passkeysModule/passkeysModule.cjs +18 -0
  90. package/src/modules/passkeysModule/passkeysModule.d.ts +10 -0
  91. package/src/modules/passkeysModule/passkeysModule.js +14 -0
  92. package/src/modules/sdkModule/index.d.ts +1 -0
  93. package/src/modules/sdkModule/sdkModule.cjs +64 -0
  94. package/src/modules/sdkModule/sdkModule.d.ts +25 -0
  95. package/src/modules/sdkModule/sdkModule.js +60 -0
  96. package/src/modules/stepUpAuthModule/index.d.ts +1 -0
  97. package/src/modules/stepUpAuthModule/stepUpAuthModule.cjs +36 -0
  98. package/src/modules/stepUpAuthModule/stepUpAuthModule.d.ts +19 -0
  99. package/src/modules/stepUpAuthModule/stepUpAuthModule.js +32 -0
  100. package/src/modules/tonModule/index.d.ts +1 -0
  101. package/src/modules/tonModule/tonModule.cjs +19 -0
  102. package/src/modules/tonModule/tonModule.d.ts +15 -0
  103. package/src/modules/tonModule/tonModule.js +15 -0
  104. package/src/modules/userInterfaceModule/index.d.ts +1 -0
  105. package/src/modules/userInterfaceModule/userInterfaceModule.cjs +66 -0
  106. package/src/modules/userInterfaceModule/userInterfaceModule.d.ts +155 -0
  107. package/src/modules/userInterfaceModule/userInterfaceModule.js +62 -0
  108. package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.cjs +17 -0
  109. package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.d.ts +14 -0
  110. package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.js +13 -0
  111. package/src/modules/walletsModule/accountAbstractionModule/index.d.ts +1 -0
  112. package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.cjs +31 -0
  113. package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.d.ts +9 -0
  114. package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.js +27 -0
  115. package/src/modules/walletsModule/createWalletListenerMethods/index.d.ts +1 -0
  116. package/src/modules/walletsModule/delegationModule/delegationModule.cjs +32 -0
  117. package/src/modules/walletsModule/delegationModule/delegationModule.d.ts +14 -0
  118. package/src/modules/walletsModule/delegationModule/delegationModule.js +28 -0
  119. package/src/modules/walletsModule/delegationModule/index.d.ts +1 -0
  120. package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.cjs +32 -0
  121. package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.d.ts +11 -0
  122. package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.js +28 -0
  123. package/src/modules/walletsModule/embeddedWalletsModule/index.d.ts +1 -0
  124. package/src/modules/walletsModule/index.d.ts +1 -0
  125. package/src/modules/walletsModule/phantomModule/index.d.ts +1 -0
  126. package/src/modules/walletsModule/phantomModule/phantomModule.cjs +18 -0
  127. package/src/modules/walletsModule/phantomModule/phantomModule.d.ts +27 -0
  128. package/src/modules/walletsModule/phantomModule/phantomModule.js +14 -0
  129. package/src/modules/walletsModule/waasModule/index.d.ts +1 -0
  130. package/src/modules/walletsModule/waasModule/waasModule.cjs +25 -0
  131. package/src/modules/walletsModule/waasModule/waasModule.d.ts +16 -0
  132. package/src/modules/walletsModule/waasModule/waasModule.js +21 -0
  133. package/src/modules/walletsModule/walletsModule.cjs +69 -0
  134. package/src/modules/walletsModule/walletsModule.d.ts +40 -0
  135. package/src/modules/walletsModule/walletsModule.js +65 -0
  136. package/src/types.d.ts +2 -0
  137. package/src/utils/Extendable/Extendable.cjs +29 -0
  138. package/src/utils/Extendable/Extendable.d.ts +25 -0
  139. package/src/utils/Extendable/Extendable.js +25 -0
  140. package/src/utils/Extendable/deepMerge/deepMergeInto.cjs +26 -0
  141. package/src/utils/Extendable/deepMerge/deepMergeInto.d.ts +6 -0
  142. package/src/utils/Extendable/deepMerge/deepMergeInto.js +22 -0
  143. package/src/utils/Extendable/deepMerge/index.d.ts +1 -0
  144. package/src/utils/Extendable/hasExtension/hasExtension.cjs +14 -0
  145. package/src/utils/Extendable/hasExtension/hasExtension.d.ts +9 -0
  146. package/src/utils/Extendable/hasExtension/hasExtension.js +10 -0
  147. package/src/utils/Extendable/hasExtension/index.d.ts +1 -0
  148. package/src/utils/Extendable/index.d.ts +1 -0
  149. package/src/utils/addProperty/addProperty.cjs +21 -0
  150. package/src/utils/addProperty/addProperty.d.ts +13 -0
  151. package/src/utils/addProperty/addProperty.js +17 -0
  152. package/src/utils/addProperty/index.d.ts +1 -0
  153. package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.cjs +63 -0
  154. package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.d.ts +13 -0
  155. package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.js +59 -0
  156. package/src/utils/createWaitForAuthSuccess/index.d.ts +1 -0
  157. package/src/utils/diffMs/diffMs.cjs +12 -0
  158. package/src/utils/diffMs/diffMs.d.ts +5 -0
  159. package/src/utils/diffMs/diffMs.js +8 -0
  160. package/src/utils/diffMs/index.d.ts +1 -0
  161. package/src/utils/logger/index.d.ts +1 -0
  162. package/src/utils/logger/logger.cjs +10 -0
  163. package/src/utils/logger/logger.d.ts +2 -0
  164. package/src/utils/logger/logger.js +6 -0
  165. package/src/utils/pickListenerActions/index.d.ts +1 -0
  166. package/src/utils/pickListenerActions/pickListenerActions.cjs +23 -0
  167. package/src/utils/pickListenerActions/pickListenerActions.d.ts +7 -0
  168. package/src/utils/pickListenerActions/pickListenerActions.js +19 -0
  169. package/src/utils/randomString/index.d.ts +1 -0
  170. package/src/utils/randomString/randomString.cjs +16 -0
  171. package/src/utils/randomString/randomString.d.ts +7 -0
  172. package/src/utils/randomString/randomString.js +12 -0
  173. package/src/utils/setupFetchHandler/index.d.ts +1 -0
  174. package/src/utils/setupFetchHandler/setupFetchHandler.cjs +36 -0
  175. package/src/utils/setupFetchHandler/setupFetchHandler.d.ts +2 -0
  176. package/src/utils/setupFetchHandler/setupFetchHandler.js +32 -0
  177. package/src/utils/setupLogHandler/index.d.ts +1 -0
  178. package/src/utils/setupLogHandler/setupLogHandler.cjs +16 -0
  179. package/src/utils/setupLogHandler/setupLogHandler.d.ts +2 -0
  180. package/src/utils/setupLogHandler/setupLogHandler.js +12 -0
  181. package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.cjs +13 -0
  182. package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.d.ts +110 -0
  183. package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.js +9 -0
  184. package/src/webviewLoad/WebViewFailedToLoadError/index.d.ts +1 -0
  185. package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.cjs +14 -0
  186. package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.d.ts +1 -0
  187. package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.js +10 -0
  188. package/src/webviewLoad/assignEnvironmentIdToUrl/index.d.ts +1 -0
  189. package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.cjs +13 -0
  190. package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.d.ts +1 -0
  191. package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.js +9 -0
  192. package/src/webviewLoad/assignStartTimeToUrl/index.d.ts +1 -0
  193. package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.cjs +45 -0
  194. package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.d.ts +26 -0
  195. package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.js +41 -0
  196. package/src/webviewLoad/classifyWebViewLoadError/constants.cjs +24 -0
  197. package/src/webviewLoad/classifyWebViewLoadError/constants.d.ts +7 -0
  198. package/src/webviewLoad/classifyWebViewLoadError/constants.js +16 -0
  199. package/src/webviewLoad/classifyWebViewLoadError/index.d.ts +2 -0
  200. package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.cjs +24 -0
  201. package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.d.ts +9 -0
  202. package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.js +18 -0
  203. package/src/webviewLoad/computeRetryBackoffMs/index.d.ts +1 -0
  204. package/src/webviewLoad/constants.cjs +17 -0
  205. package/src/webviewLoad/constants.d.ts +4 -0
  206. package/src/webviewLoad/constants.js +10 -0
  207. package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.cjs +14 -0
  208. package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.d.ts +14 -0
  209. package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.js +10 -0
  210. package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/index.d.ts +1 -0
  211. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.cjs +288 -0
  212. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.d.ts +50 -0
  213. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.js +282 -0
  214. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.cjs +45 -0
  215. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.d.ts +29 -0
  216. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.js +37 -0
  217. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.cjs +94 -0
  218. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.d.ts +38 -0
  219. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.js +90 -0
  220. package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/index.d.ts +2 -0
  221. package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.cjs +20 -0
  222. package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.d.ts +13 -0
  223. package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.js +16 -0
  224. package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/index.d.ts +1 -0
  225. package/src/webviewLoad/createWebViewLoadController/index.d.ts +3 -0
  226. package/src/webviewLoad/createWebViewLoadController/recordEventTiming/index.d.ts +1 -0
  227. package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.cjs +37 -0
  228. package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.d.ts +9 -0
  229. package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.js +33 -0
  230. package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/index.d.ts +1 -0
  231. package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/webViewLoadAdapter.d.ts +11 -0
  232. package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.cjs +17 -0
  233. package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.d.ts +1 -0
  234. package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.js +13 -0
  235. package/src/webviewLoad/incrementRetryInUrl/index.d.ts +1 -0
  236. package/src/webviewLoad/index.d.ts +14 -0
  237. package/src/webviewLoad/isRaiseTerminalErrorEffect/index.d.ts +1 -0
  238. package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.cjs +8 -0
  239. package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.d.ts +13 -0
  240. package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.js +4 -0
  241. package/src/webviewLoad/isSdkReadyMessage/index.d.ts +1 -0
  242. package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.cjs +27 -0
  243. package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.d.ts +14 -0
  244. package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.js +23 -0
  245. package/src/webviewLoad/probeOrigin/index.d.ts +1 -0
  246. package/src/webviewLoad/probeOrigin/probeOrigin.cjs +45 -0
  247. package/src/webviewLoad/probeOrigin/probeOrigin.d.ts +23 -0
  248. package/src/webviewLoad/probeOrigin/probeOrigin.js +40 -0
  249. package/src/webviewLoad/sanitizeWebViewLoadOptions/index.d.ts +1 -0
  250. package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.cjs +54 -0
  251. package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.d.ts +14 -0
  252. package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.js +47 -0
  253. package/src/webviewLoad/sdkWebViewLoadState/index.d.ts +1 -0
  254. package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.cjs +20 -0
  255. package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.d.ts +42 -0
  256. package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.js +16 -0
  257. package/src/webviewLoad/webViewLoadOptions/index.d.ts +1 -0
  258. package/src/webviewLoad/webViewLoadOptions/webViewLoadOptions.d.ts +45 -0
  259. package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.cjs +14 -0
  260. package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.d.ts +2 -0
  261. package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.js +10 -0
  262. package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/index.d.ts +1 -0
  263. package/src/webviewLoad/webViewLoadStateMachine/constants.cjs +64 -0
  264. package/src/webviewLoad/webViewLoadStateMachine/constants.d.ts +24 -0
  265. package/src/webviewLoad/webViewLoadStateMachine/constants.js +37 -0
  266. package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.cjs +19 -0
  267. package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.d.ts +2 -0
  268. package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.js +15 -0
  269. package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/index.d.ts +1 -0
  270. package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.cjs +34 -0
  271. package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.d.ts +2 -0
  272. package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.js +30 -0
  273. package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/index.d.ts +1 -0
  274. package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.cjs +70 -0
  275. package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.d.ts +15 -0
  276. package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.js +66 -0
  277. package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/index.d.ts +1 -0
  278. package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.cjs +26 -0
  279. package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.d.ts +2 -0
  280. package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.js +22 -0
  281. package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/index.d.ts +1 -0
  282. package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.cjs +28 -0
  283. package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.d.ts +2 -0
  284. package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.js +24 -0
  285. package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/index.d.ts +1 -0
  286. package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.cjs +33 -0
  287. package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.d.ts +2 -0
  288. package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.js +29 -0
  289. package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/index.d.ts +1 -0
  290. package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.cjs +32 -0
  291. package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.d.ts +2 -0
  292. package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.js +28 -0
  293. package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/index.d.ts +1 -0
  294. package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.cjs +25 -0
  295. package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.d.ts +2 -0
  296. package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.js +21 -0
  297. package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/index.d.ts +1 -0
  298. package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.cjs +25 -0
  299. package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.d.ts +2 -0
  300. package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.js +21 -0
  301. package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/index.d.ts +1 -0
  302. package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.cjs +28 -0
  303. package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.d.ts +2 -0
  304. package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.js +24 -0
  305. package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/index.d.ts +1 -0
  306. package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.cjs +38 -0
  307. package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.d.ts +2 -0
  308. package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.js +34 -0
  309. package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/index.d.ts +1 -0
  310. package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.cjs +39 -0
  311. package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.d.ts +2 -0
  312. package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.js +35 -0
  313. package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/index.d.ts +1 -0
  314. package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.cjs +23 -0
  315. package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.d.ts +3 -0
  316. package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.js +19 -0
  317. package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/index.d.ts +1 -0
  318. package/src/webviewLoad/webViewLoadStateMachine/index.d.ts +2 -0
  319. package/src/webviewLoad/webViewLoadStateMachine/noTransition/index.d.ts +1 -0
  320. package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.cjs +13 -0
  321. package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.d.ts +2 -0
  322. package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.js +9 -0
  323. package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.cjs +66 -0
  324. package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.d.ts +9 -0
  325. package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.js +61 -0
  326. package/src/webviewLoad/webViewLoadTypes/index.d.ts +1 -0
  327. package/src/webviewLoad/webViewLoadTypes/webViewLoadTypes.d.ts +156 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Customer-tunable budgets of the webview load engine. Platform extensions
3
+ * expose this group to integrators (e.g. `ReactNativeExtension({ webviewLoad })`)
4
+ * and forward it verbatim to `createWebViewLoadController`.
5
+ */
6
+ export type WebViewLoadOptions = {
7
+ /**
8
+ * Total load attempts per load cycle: the initial attempt plus the
9
+ * automatic retries (each transient failure waits out a short backoff
10
+ * before the next attempt). `1` disables automatic retries entirely —
11
+ * the first failure is terminal and the app owns recovery via
12
+ * `client.sdk.retry()`, which starts a fresh full cycle. Values are
13
+ * clamped into [1, 10] with a console warning. Defaults to 3.
14
+ */
15
+ maxAttempts?: number;
16
+ /**
17
+ * Max time (ms) each load attempt may spend loading the page. It bounds
18
+ * both the wait for the server's response (navigation start → response
19
+ * committed) and the page finishing to load (response committed → page
20
+ * finished). Attempt 1's wait-for-response window is additionally capped
21
+ * by `firstAttemptPageLoadTimeoutMs` so a dead first load fails fast
22
+ * into a retry; retries always get this full budget. Defaults to 20s.
23
+ * Only tune this for pathological networks.
24
+ */
25
+ pageLoadTimeoutMs?: number;
26
+ /**
27
+ * Fail-fast cap (ms) on attempt 1's wait-for-response window ONLY: a
28
+ * first load with no response after this long is almost always wedged
29
+ * (hung TLS handshake, dead CDN edge), and retrying beats waiting out
30
+ * the full `pageLoadTimeoutMs`. It is a cap, never an extension — the
31
+ * effective attempt-1 window is
32
+ * `min(firstAttemptPageLoadTimeoutMs, pageLoadTimeoutMs)`, so setting it
33
+ * at or above `pageLoadTimeoutMs` deliberately disables fail-fast.
34
+ * Values below 1s are clamped to 1s with a console warning. Defaults
35
+ * to 10s.
36
+ */
37
+ firstAttemptPageLoadTimeoutMs?: number;
38
+ /**
39
+ * Max time (ms) between the page finishing its load and the Dynamic SDK
40
+ * inside the webview signalling it is ready. If it elapses, the attempt
41
+ * fails into the retry engine. The window is extendable once per attempt
42
+ * by the manifest signal on slow-but-alive links. Defaults to 20s.
43
+ */
44
+ sdkReadyTimeoutMs?: number;
45
+ };
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+
8
+ // Failure inputs are meaningful while an attempt is in flight AND while
9
+ // ready: a failure of a previously-good session (e.g. the OS killed the
10
+ // webview process) starts a fresh load cycle with the fresh budget that
11
+ // reaching ready granted.
12
+ const canAcceptFailureInput = (state) => state.status === constants.LOADING_STATUS || state.status === constants.READY_STATUS;
13
+
14
+ exports.canAcceptFailureInput = canAcceptFailureInput;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadState } from '../../webViewLoadTypes';
2
+ export declare const canAcceptFailureInput: (state: WebViewLoadState) => boolean;
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { LOADING_STATUS, READY_STATUS } from '../constants.js';
3
+
4
+ // Failure inputs are meaningful while an attempt is in flight AND while
5
+ // ready: a failure of a previously-good session (e.g. the OS killed the
6
+ // webview process) starts a fresh load cycle with the fresh budget that
7
+ // reaching ready granted.
8
+ const canAcceptFailureInput = (state) => state.status === LOADING_STATUS || state.status === READY_STATUS;
9
+
10
+ export { canAcceptFailureInput };
@@ -0,0 +1 @@
1
+ export { canAcceptFailureInput } from './canAcceptFailureInput';
@@ -0,0 +1,64 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ // Total load-attempt budget per load cycle: the initial attempt plus up to
7
+ // two retries. The budget resets whenever the webview reaches `ready`.
8
+ const MAX_LOAD_ATTEMPTS = 3;
9
+ // Cap on the html_load window of the FIRST load attempt only. A stalled
10
+ // first load fails fast into the retry engine instead of burning the full
11
+ // configured budget; retries keep the full `pageLoadTimeoutMs` so the final
12
+ // attempt is never cut short.
13
+ const FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS = 10000;
14
+ const FIRST_ATTEMPT = 1;
15
+ const HTML_LOAD_PHASE = 'html_load';
16
+ const HTML_FINISH_PHASE = 'html_finish';
17
+ const SDK_BOOTSTRAP_PHASE = 'sdk_bootstrap';
18
+ const ARM_TIMER_EFFECT = 'arm_timer';
19
+ const BLOCK_TRANSPORT_EFFECT = 'block_transport';
20
+ const CLEAR_ERROR_EFFECT = 'clear_error';
21
+ const CLEAR_TIMERS_EFFECT = 'clear_timers';
22
+ const EMIT_TELEMETRY_EFFECT = 'emit_telemetry';
23
+ const LOAD_URL_EFFECT = 'load_url';
24
+ const PROBE_ORIGIN_EFFECT = 'probe_origin';
25
+ const RAISE_TERMINAL_ERROR_EFFECT = 'raise_terminal_error';
26
+ const SCHEDULE_BACKOFF_EFFECT = 'schedule_backoff';
27
+ const IDLE_STATUS = 'idle';
28
+ const LOADING_STATUS = 'loading';
29
+ const WAITING_TO_RETRY_STATUS = 'waiting_to_retry';
30
+ const READY_STATUS = 'ready';
31
+ const FAILED_STATUS = 'failed';
32
+ const TRANSIENT_CLASSIFICATION = 'transient';
33
+ const PERMANENT_CLASSIFICATION = 'permanent';
34
+ // Failure phase recorded when a failure input arrives with no in-flight
35
+ // phase (e.g. a recovery request after the webview was already ready).
36
+ const UNKNOWN_PHASE = 'unknown';
37
+ // The categorical failure phase recorded when the failure came from a
38
+ // native `onLoadError` (rather than a phase timer expiring).
39
+ const EMBEDDED_NATIVE_ERROR_PHASE = 'embedded_native_error';
40
+
41
+ exports.ARM_TIMER_EFFECT = ARM_TIMER_EFFECT;
42
+ exports.BLOCK_TRANSPORT_EFFECT = BLOCK_TRANSPORT_EFFECT;
43
+ exports.CLEAR_ERROR_EFFECT = CLEAR_ERROR_EFFECT;
44
+ exports.CLEAR_TIMERS_EFFECT = CLEAR_TIMERS_EFFECT;
45
+ exports.EMBEDDED_NATIVE_ERROR_PHASE = EMBEDDED_NATIVE_ERROR_PHASE;
46
+ exports.EMIT_TELEMETRY_EFFECT = EMIT_TELEMETRY_EFFECT;
47
+ exports.FAILED_STATUS = FAILED_STATUS;
48
+ exports.FIRST_ATTEMPT = FIRST_ATTEMPT;
49
+ exports.FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS = FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS;
50
+ exports.HTML_FINISH_PHASE = HTML_FINISH_PHASE;
51
+ exports.HTML_LOAD_PHASE = HTML_LOAD_PHASE;
52
+ exports.IDLE_STATUS = IDLE_STATUS;
53
+ exports.LOADING_STATUS = LOADING_STATUS;
54
+ exports.LOAD_URL_EFFECT = LOAD_URL_EFFECT;
55
+ exports.MAX_LOAD_ATTEMPTS = MAX_LOAD_ATTEMPTS;
56
+ exports.PERMANENT_CLASSIFICATION = PERMANENT_CLASSIFICATION;
57
+ exports.PROBE_ORIGIN_EFFECT = PROBE_ORIGIN_EFFECT;
58
+ exports.RAISE_TERMINAL_ERROR_EFFECT = RAISE_TERMINAL_ERROR_EFFECT;
59
+ exports.READY_STATUS = READY_STATUS;
60
+ exports.SCHEDULE_BACKOFF_EFFECT = SCHEDULE_BACKOFF_EFFECT;
61
+ exports.SDK_BOOTSTRAP_PHASE = SDK_BOOTSTRAP_PHASE;
62
+ exports.TRANSIENT_CLASSIFICATION = TRANSIENT_CLASSIFICATION;
63
+ exports.UNKNOWN_PHASE = UNKNOWN_PHASE;
64
+ exports.WAITING_TO_RETRY_STATUS = WAITING_TO_RETRY_STATUS;
@@ -0,0 +1,24 @@
1
+ export declare const MAX_LOAD_ATTEMPTS = 3;
2
+ export declare const FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS = 10000;
3
+ export declare const FIRST_ATTEMPT = 1;
4
+ export declare const HTML_LOAD_PHASE = "html_load";
5
+ export declare const HTML_FINISH_PHASE = "html_finish";
6
+ export declare const SDK_BOOTSTRAP_PHASE = "sdk_bootstrap";
7
+ export declare const ARM_TIMER_EFFECT = "arm_timer";
8
+ export declare const BLOCK_TRANSPORT_EFFECT = "block_transport";
9
+ export declare const CLEAR_ERROR_EFFECT = "clear_error";
10
+ export declare const CLEAR_TIMERS_EFFECT = "clear_timers";
11
+ export declare const EMIT_TELEMETRY_EFFECT = "emit_telemetry";
12
+ export declare const LOAD_URL_EFFECT = "load_url";
13
+ export declare const PROBE_ORIGIN_EFFECT = "probe_origin";
14
+ export declare const RAISE_TERMINAL_ERROR_EFFECT = "raise_terminal_error";
15
+ export declare const SCHEDULE_BACKOFF_EFFECT = "schedule_backoff";
16
+ export declare const IDLE_STATUS = "idle";
17
+ export declare const LOADING_STATUS = "loading";
18
+ export declare const WAITING_TO_RETRY_STATUS = "waiting_to_retry";
19
+ export declare const READY_STATUS = "ready";
20
+ export declare const FAILED_STATUS = "failed";
21
+ export declare const TRANSIENT_CLASSIFICATION = "transient";
22
+ export declare const PERMANENT_CLASSIFICATION = "permanent";
23
+ export declare const UNKNOWN_PHASE = "unknown";
24
+ export declare const EMBEDDED_NATIVE_ERROR_PHASE = "embedded_native_error";
@@ -0,0 +1,37 @@
1
+ 'use client'
2
+ // Total load-attempt budget per load cycle: the initial attempt plus up to
3
+ // two retries. The budget resets whenever the webview reaches `ready`.
4
+ const MAX_LOAD_ATTEMPTS = 3;
5
+ // Cap on the html_load window of the FIRST load attempt only. A stalled
6
+ // first load fails fast into the retry engine instead of burning the full
7
+ // configured budget; retries keep the full `pageLoadTimeoutMs` so the final
8
+ // attempt is never cut short.
9
+ const FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS = 10000;
10
+ const FIRST_ATTEMPT = 1;
11
+ const HTML_LOAD_PHASE = 'html_load';
12
+ const HTML_FINISH_PHASE = 'html_finish';
13
+ const SDK_BOOTSTRAP_PHASE = 'sdk_bootstrap';
14
+ const ARM_TIMER_EFFECT = 'arm_timer';
15
+ const BLOCK_TRANSPORT_EFFECT = 'block_transport';
16
+ const CLEAR_ERROR_EFFECT = 'clear_error';
17
+ const CLEAR_TIMERS_EFFECT = 'clear_timers';
18
+ const EMIT_TELEMETRY_EFFECT = 'emit_telemetry';
19
+ const LOAD_URL_EFFECT = 'load_url';
20
+ const PROBE_ORIGIN_EFFECT = 'probe_origin';
21
+ const RAISE_TERMINAL_ERROR_EFFECT = 'raise_terminal_error';
22
+ const SCHEDULE_BACKOFF_EFFECT = 'schedule_backoff';
23
+ const IDLE_STATUS = 'idle';
24
+ const LOADING_STATUS = 'loading';
25
+ const WAITING_TO_RETRY_STATUS = 'waiting_to_retry';
26
+ const READY_STATUS = 'ready';
27
+ const FAILED_STATUS = 'failed';
28
+ const TRANSIENT_CLASSIFICATION = 'transient';
29
+ const PERMANENT_CLASSIFICATION = 'permanent';
30
+ // Failure phase recorded when a failure input arrives with no in-flight
31
+ // phase (e.g. a recovery request after the webview was already ready).
32
+ const UNKNOWN_PHASE = 'unknown';
33
+ // The categorical failure phase recorded when the failure came from a
34
+ // native `onLoadError` (rather than a phase timer expiring).
35
+ const EMBEDDED_NATIVE_ERROR_PHASE = 'embedded_native_error';
36
+
37
+ export { ARM_TIMER_EFFECT, BLOCK_TRANSPORT_EFFECT, CLEAR_ERROR_EFFECT, CLEAR_TIMERS_EFFECT, EMBEDDED_NATIVE_ERROR_PHASE, EMIT_TELEMETRY_EFFECT, FAILED_STATUS, FIRST_ATTEMPT, FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS, HTML_FINISH_PHASE, HTML_LOAD_PHASE, IDLE_STATUS, LOADING_STATUS, LOAD_URL_EFFECT, MAX_LOAD_ATTEMPTS, PERMANENT_CLASSIFICATION, PROBE_ORIGIN_EFFECT, RAISE_TERMINAL_ERROR_EFFECT, READY_STATUS, SCHEDULE_BACKOFF_EFFECT, SDK_BOOTSTRAP_PHASE, TRANSIENT_CLASSIFICATION, UNKNOWN_PHASE, WAITING_TO_RETRY_STATUS };
@@ -0,0 +1,19 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+
8
+ // Effective html_load window for the given attempt. Attempt 1 is capped at
9
+ // the configured first-attempt cap (default FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS;
10
+ // a full budget below the cap still wins via the min-clamp); every retry
11
+ // gets the full budget.
12
+ const getHtmlLoadTimeoutMs = (attempt, config) => {
13
+ var _a;
14
+ return attempt === constants.FIRST_ATTEMPT
15
+ ? Math.min((_a = config.firstAttemptPageLoadTimeoutMs) !== null && _a !== void 0 ? _a : constants.FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS, config.pageLoadTimeoutMs)
16
+ : config.pageLoadTimeoutMs;
17
+ };
18
+
19
+ exports.getHtmlLoadTimeoutMs = getHtmlLoadTimeoutMs;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadConfig } from '../../webViewLoadTypes';
2
+ export declare const getHtmlLoadTimeoutMs: (attempt: number, config: WebViewLoadConfig) => number;
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ import { FIRST_ATTEMPT, FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS } from '../constants.js';
3
+
4
+ // Effective html_load window for the given attempt. Attempt 1 is capped at
5
+ // the configured first-attempt cap (default FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS;
6
+ // a full budget below the cap still wins via the min-clamp); every retry
7
+ // gets the full budget.
8
+ const getHtmlLoadTimeoutMs = (attempt, config) => {
9
+ var _a;
10
+ return attempt === FIRST_ATTEMPT
11
+ ? Math.min((_a = config.firstAttemptPageLoadTimeoutMs) !== null && _a !== void 0 ? _a : FIRST_ATTEMPT_PAGE_LOAD_TIMEOUT_MS, config.pageLoadTimeoutMs)
12
+ : config.pageLoadTimeoutMs;
13
+ };
14
+
15
+ export { getHtmlLoadTimeoutMs };
@@ -0,0 +1 @@
1
+ export { getHtmlLoadTimeoutMs } from './getHtmlLoadTimeoutMs';
@@ -0,0 +1,34 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+ var noTransition = require('../noTransition/noTransition.cjs');
8
+
9
+ // Start the next attempt of the current load cycle: used both when a
10
+ // backoff elapses and when a customer-facing retry() skips a pending
11
+ // backoff (which keeps the attempt counter progressing).
12
+ const handleBackoffElapsed = (state, config) => {
13
+ if (state.status !== constants.WAITING_TO_RETRY_STATUS)
14
+ return noTransition.noTransition(state);
15
+ const attempt = state.attempt + 1;
16
+ return {
17
+ effects: [
18
+ // Block the transport while the webview reloads so in-flight host
19
+ // messages queue instead of hitting a dead page.
20
+ { type: constants.BLOCK_TRANSPORT_EFFECT },
21
+ {
22
+ // Retries always get the FULL configured budget; only the first
23
+ // attempt of a cycle is capped.
24
+ ms: config.pageLoadTimeoutMs,
25
+ phase: constants.HTML_LOAD_PHASE,
26
+ type: constants.ARM_TIMER_EFFECT,
27
+ },
28
+ { retryCount: attempt - 1, type: constants.LOAD_URL_EFFECT },
29
+ ],
30
+ state: Object.assign(Object.assign({}, state), { attempt, attemptStartedAt: config.now(), hasExtendedRecoveryThisAttempt: false, nextRetryAt: null, phase: constants.HTML_LOAD_PHASE, status: constants.LOADING_STATUS }),
31
+ };
32
+ };
33
+
34
+ exports.handleBackoffElapsed = handleBackoffElapsed;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadConfig, WebViewLoadState, WebViewLoadTransitionResult } from '../../webViewLoadTypes';
2
+ export declare const handleBackoffElapsed: (state: WebViewLoadState, config: WebViewLoadConfig) => WebViewLoadTransitionResult;
@@ -0,0 +1,30 @@
1
+ 'use client'
2
+ import { WAITING_TO_RETRY_STATUS, BLOCK_TRANSPORT_EFFECT, HTML_LOAD_PHASE, ARM_TIMER_EFFECT, LOAD_URL_EFFECT, LOADING_STATUS } from '../constants.js';
3
+ import { noTransition } from '../noTransition/noTransition.js';
4
+
5
+ // Start the next attempt of the current load cycle: used both when a
6
+ // backoff elapses and when a customer-facing retry() skips a pending
7
+ // backoff (which keeps the attempt counter progressing).
8
+ const handleBackoffElapsed = (state, config) => {
9
+ if (state.status !== WAITING_TO_RETRY_STATUS)
10
+ return noTransition(state);
11
+ const attempt = state.attempt + 1;
12
+ return {
13
+ effects: [
14
+ // Block the transport while the webview reloads so in-flight host
15
+ // messages queue instead of hitting a dead page.
16
+ { type: BLOCK_TRANSPORT_EFFECT },
17
+ {
18
+ // Retries always get the FULL configured budget; only the first
19
+ // attempt of a cycle is capped.
20
+ ms: config.pageLoadTimeoutMs,
21
+ phase: HTML_LOAD_PHASE,
22
+ type: ARM_TIMER_EFFECT,
23
+ },
24
+ { retryCount: attempt - 1, type: LOAD_URL_EFFECT },
25
+ ],
26
+ state: Object.assign(Object.assign({}, state), { attempt, attemptStartedAt: config.now(), hasExtendedRecoveryThisAttempt: false, nextRetryAt: null, phase: HTML_LOAD_PHASE, status: LOADING_STATUS }),
27
+ };
28
+ };
29
+
30
+ export { handleBackoffElapsed };
@@ -0,0 +1 @@
1
+ export { handleBackoffElapsed } from './handleBackoffElapsed';
@@ -0,0 +1,70 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var computeRetryBackoffMs = require('../../computeRetryBackoffMs/computeRetryBackoffMs.cjs');
7
+ var constants = require('../constants.cjs');
8
+
9
+ // Route a failure input through the bounded retry budget: record the failed
10
+ // attempt, probe the origin for diagnostics, then either schedule a
11
+ // backed-off retry or raise the terminal error.
12
+ const handleFailureInput = (state, config, { classification, extraMeta, failurePhase }) => {
13
+ var _a;
14
+ const now = config.now();
15
+ const failure = Object.assign(Object.assign({ attempt: state.attempt, elapsedMs: now - ((_a = state.attemptStartedAt) !== null && _a !== void 0 ? _a : now), phase: failurePhase }, (extraMeta.nativeErrorCode !== undefined && {
16
+ nativeErrorCode: extraMeta.nativeErrorCode,
17
+ })), (extraMeta.nativeErrorDomain !== undefined && {
18
+ nativeErrorDomain: extraMeta.nativeErrorDomain,
19
+ }));
20
+ const failures = [...state.failures, failure];
21
+ if (classification === constants.PERMANENT_CLASSIFICATION ||
22
+ state.attempt >= state.maxAttempts) {
23
+ return {
24
+ effects: [
25
+ {
26
+ attempt: state.attempt,
27
+ phase: failurePhase,
28
+ type: constants.PROBE_ORIGIN_EFFECT,
29
+ },
30
+ { type: constants.CLEAR_TIMERS_EFFECT },
31
+ {
32
+ attempt: state.attempt,
33
+ event: 'load_error',
34
+ phase: failurePhase,
35
+ type: constants.EMIT_TELEMETRY_EFFECT,
36
+ },
37
+ {
38
+ extraMeta,
39
+ failures,
40
+ phase: failurePhase,
41
+ type: constants.RAISE_TERMINAL_ERROR_EFFECT,
42
+ },
43
+ ],
44
+ state: Object.assign(Object.assign({}, state), { failures, nextRetryAt: null, status: constants.FAILED_STATUS }),
45
+ };
46
+ }
47
+ const delayMs = computeRetryBackoffMs.computeRetryBackoffMs(state.attempt, config.random);
48
+ return {
49
+ effects: [
50
+ {
51
+ attempt: state.attempt,
52
+ phase: failurePhase,
53
+ type: constants.PROBE_ORIGIN_EFFECT,
54
+ },
55
+ { type: constants.CLEAR_TIMERS_EFFECT },
56
+ {
57
+ attempt: state.attempt,
58
+ delayMs,
59
+ event: 'load_retry',
60
+ maxAttempts: state.maxAttempts,
61
+ phase: failurePhase,
62
+ type: constants.EMIT_TELEMETRY_EFFECT,
63
+ },
64
+ { delayMs, type: constants.SCHEDULE_BACKOFF_EFFECT },
65
+ ],
66
+ state: Object.assign(Object.assign({}, state), { failures, nextRetryAt: now + delayMs, status: constants.WAITING_TO_RETRY_STATUS }),
67
+ };
68
+ };
69
+
70
+ exports.handleFailureInput = handleFailureInput;
@@ -0,0 +1,15 @@
1
+ import { WebViewFailedToLoadErrorPhase } from '../../WebViewFailedToLoadError';
2
+ import { WebViewLoadErrorClassification } from '../../classifyWebViewLoadError';
3
+ import { WebViewLoadConfig, WebViewLoadNativeErrorMeta, WebViewLoadState, WebViewLoadTransitionResult } from '../../webViewLoadTypes';
4
+ export type FailureInput = {
5
+ /** The phase the attempt was in when it failed, for failure records. */
6
+ failurePhase: WebViewFailedToLoadErrorPhase;
7
+ /** Native error diagnostics, when the failure came from `native_error`. */
8
+ extraMeta: WebViewLoadNativeErrorMeta;
9
+ /**
10
+ * Whether a reload may succeed (`transient`) or is pointless
11
+ * (`permanent`). Permanent failures skip the remaining retry budget.
12
+ */
13
+ classification: WebViewLoadErrorClassification;
14
+ };
15
+ export declare const handleFailureInput: (state: WebViewLoadState, config: WebViewLoadConfig, { classification, extraMeta, failurePhase }: FailureInput) => WebViewLoadTransitionResult;
@@ -0,0 +1,66 @@
1
+ 'use client'
2
+ import { computeRetryBackoffMs } from '../../computeRetryBackoffMs/computeRetryBackoffMs.js';
3
+ import { PERMANENT_CLASSIFICATION, PROBE_ORIGIN_EFFECT, CLEAR_TIMERS_EFFECT, EMIT_TELEMETRY_EFFECT, RAISE_TERMINAL_ERROR_EFFECT, FAILED_STATUS, SCHEDULE_BACKOFF_EFFECT, WAITING_TO_RETRY_STATUS } from '../constants.js';
4
+
5
+ // Route a failure input through the bounded retry budget: record the failed
6
+ // attempt, probe the origin for diagnostics, then either schedule a
7
+ // backed-off retry or raise the terminal error.
8
+ const handleFailureInput = (state, config, { classification, extraMeta, failurePhase }) => {
9
+ var _a;
10
+ const now = config.now();
11
+ const failure = Object.assign(Object.assign({ attempt: state.attempt, elapsedMs: now - ((_a = state.attemptStartedAt) !== null && _a !== void 0 ? _a : now), phase: failurePhase }, (extraMeta.nativeErrorCode !== undefined && {
12
+ nativeErrorCode: extraMeta.nativeErrorCode,
13
+ })), (extraMeta.nativeErrorDomain !== undefined && {
14
+ nativeErrorDomain: extraMeta.nativeErrorDomain,
15
+ }));
16
+ const failures = [...state.failures, failure];
17
+ if (classification === PERMANENT_CLASSIFICATION ||
18
+ state.attempt >= state.maxAttempts) {
19
+ return {
20
+ effects: [
21
+ {
22
+ attempt: state.attempt,
23
+ phase: failurePhase,
24
+ type: PROBE_ORIGIN_EFFECT,
25
+ },
26
+ { type: CLEAR_TIMERS_EFFECT },
27
+ {
28
+ attempt: state.attempt,
29
+ event: 'load_error',
30
+ phase: failurePhase,
31
+ type: EMIT_TELEMETRY_EFFECT,
32
+ },
33
+ {
34
+ extraMeta,
35
+ failures,
36
+ phase: failurePhase,
37
+ type: RAISE_TERMINAL_ERROR_EFFECT,
38
+ },
39
+ ],
40
+ state: Object.assign(Object.assign({}, state), { failures, nextRetryAt: null, status: FAILED_STATUS }),
41
+ };
42
+ }
43
+ const delayMs = computeRetryBackoffMs(state.attempt, config.random);
44
+ return {
45
+ effects: [
46
+ {
47
+ attempt: state.attempt,
48
+ phase: failurePhase,
49
+ type: PROBE_ORIGIN_EFFECT,
50
+ },
51
+ { type: CLEAR_TIMERS_EFFECT },
52
+ {
53
+ attempt: state.attempt,
54
+ delayMs,
55
+ event: 'load_retry',
56
+ maxAttempts: state.maxAttempts,
57
+ phase: failurePhase,
58
+ type: EMIT_TELEMETRY_EFFECT,
59
+ },
60
+ { delayMs, type: SCHEDULE_BACKOFF_EFFECT },
61
+ ],
62
+ state: Object.assign(Object.assign({}, state), { failures, nextRetryAt: now + delayMs, status: WAITING_TO_RETRY_STATUS }),
63
+ };
64
+ };
65
+
66
+ export { handleFailureInput };
@@ -0,0 +1 @@
1
+ export { type FailureInput, handleFailureInput } from './handleFailureInput';
@@ -0,0 +1,26 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+ var getHtmlLoadTimeoutMs = require('../getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.cjs');
8
+ var noTransition = require('../noTransition/noTransition.cjs');
9
+
10
+ const handleLoadRequested = (state, config) => {
11
+ if (state.status !== constants.IDLE_STATUS)
12
+ return noTransition.noTransition(state);
13
+ return {
14
+ effects: [
15
+ {
16
+ ms: getHtmlLoadTimeoutMs.getHtmlLoadTimeoutMs(constants.FIRST_ATTEMPT, config),
17
+ phase: constants.HTML_LOAD_PHASE,
18
+ type: constants.ARM_TIMER_EFFECT,
19
+ },
20
+ { retryCount: 0, type: constants.LOAD_URL_EFFECT },
21
+ ],
22
+ state: Object.assign(Object.assign({}, state), { attempt: constants.FIRST_ATTEMPT, attemptStartedAt: config.now(), failures: [], hasExtendedRecoveryThisAttempt: false, nextRetryAt: null, phase: constants.HTML_LOAD_PHASE, status: constants.LOADING_STATUS }),
23
+ };
24
+ };
25
+
26
+ exports.handleLoadRequested = handleLoadRequested;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadConfig, WebViewLoadState, WebViewLoadTransitionResult } from '../../webViewLoadTypes';
2
+ export declare const handleLoadRequested: (state: WebViewLoadState, config: WebViewLoadConfig) => WebViewLoadTransitionResult;
@@ -0,0 +1,22 @@
1
+ 'use client'
2
+ import { IDLE_STATUS, HTML_LOAD_PHASE, ARM_TIMER_EFFECT, LOAD_URL_EFFECT, FIRST_ATTEMPT, LOADING_STATUS } from '../constants.js';
3
+ import { getHtmlLoadTimeoutMs } from '../getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.js';
4
+ import { noTransition } from '../noTransition/noTransition.js';
5
+
6
+ const handleLoadRequested = (state, config) => {
7
+ if (state.status !== IDLE_STATUS)
8
+ return noTransition(state);
9
+ return {
10
+ effects: [
11
+ {
12
+ ms: getHtmlLoadTimeoutMs(FIRST_ATTEMPT, config),
13
+ phase: HTML_LOAD_PHASE,
14
+ type: ARM_TIMER_EFFECT,
15
+ },
16
+ { retryCount: 0, type: LOAD_URL_EFFECT },
17
+ ],
18
+ state: Object.assign(Object.assign({}, state), { attempt: FIRST_ATTEMPT, attemptStartedAt: config.now(), failures: [], hasExtendedRecoveryThisAttempt: false, nextRetryAt: null, phase: HTML_LOAD_PHASE, status: LOADING_STATUS }),
19
+ };
20
+ };
21
+
22
+ export { handleLoadRequested };
@@ -0,0 +1 @@
1
+ export { handleLoadRequested } from './handleLoadRequested';
@@ -0,0 +1,28 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+ var getHtmlLoadTimeoutMs = require('../getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.cjs');
8
+ var noTransition = require('../noTransition/noTransition.cjs');
9
+
10
+ const handleLoadStarted = (state, config) => {
11
+ if (state.status !== constants.LOADING_STATUS)
12
+ return noTransition.noTransition(state);
13
+ return {
14
+ effects: [
15
+ { type: constants.CLEAR_TIMERS_EFFECT },
16
+ {
17
+ ms: getHtmlLoadTimeoutMs.getHtmlLoadTimeoutMs(state.attempt, config),
18
+ phase: constants.HTML_LOAD_PHASE,
19
+ type: constants.ARM_TIMER_EFFECT,
20
+ },
21
+ ],
22
+ state: Object.assign(Object.assign({}, state), {
23
+ // A fresh load grants a fresh one-shot manifest extension.
24
+ hasExtendedRecoveryThisAttempt: false, phase: constants.HTML_LOAD_PHASE }),
25
+ };
26
+ };
27
+
28
+ exports.handleLoadStarted = handleLoadStarted;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadConfig, WebViewLoadState, WebViewLoadTransitionResult } from '../../webViewLoadTypes';
2
+ export declare const handleLoadStarted: (state: WebViewLoadState, config: WebViewLoadConfig) => WebViewLoadTransitionResult;
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+ import { LOADING_STATUS, CLEAR_TIMERS_EFFECT, HTML_LOAD_PHASE, ARM_TIMER_EFFECT } from '../constants.js';
3
+ import { getHtmlLoadTimeoutMs } from '../getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.js';
4
+ import { noTransition } from '../noTransition/noTransition.js';
5
+
6
+ const handleLoadStarted = (state, config) => {
7
+ if (state.status !== LOADING_STATUS)
8
+ return noTransition(state);
9
+ return {
10
+ effects: [
11
+ { type: CLEAR_TIMERS_EFFECT },
12
+ {
13
+ ms: getHtmlLoadTimeoutMs(state.attempt, config),
14
+ phase: HTML_LOAD_PHASE,
15
+ type: ARM_TIMER_EFFECT,
16
+ },
17
+ ],
18
+ state: Object.assign(Object.assign({}, state), {
19
+ // A fresh load grants a fresh one-shot manifest extension.
20
+ hasExtendedRecoveryThisAttempt: false, phase: HTML_LOAD_PHASE }),
21
+ };
22
+ };
23
+
24
+ export { handleLoadStarted };
@@ -0,0 +1 @@
1
+ export { handleLoadStarted } from './handleLoadStarted';
@@ -0,0 +1,33 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var constants = require('../constants.cjs');
7
+ var noTransition = require('../noTransition/noTransition.cjs');
8
+
9
+ // The webview-side SDK sends a `manifest` request as its first act once
10
+ // the JS bundle is alive. If that signal arrives while the sdk_bootstrap
11
+ // recovery window is armed, the bundle has proven it is genuinely booting
12
+ // on a slow-but-alive link — grant it ONE fresh full recovery budget.
13
+ // The once-per-attempt flag bounds the extension so message spam can't
14
+ // push the deadline forever.
15
+ const handleManifestReceived = (state, config) => {
16
+ if (state.status !== constants.LOADING_STATUS ||
17
+ state.phase !== constants.SDK_BOOTSTRAP_PHASE ||
18
+ state.hasExtendedRecoveryThisAttempt) {
19
+ return noTransition.noTransition(state);
20
+ }
21
+ return {
22
+ effects: [
23
+ {
24
+ ms: config.sdkReadyTimeoutMs,
25
+ phase: constants.SDK_BOOTSTRAP_PHASE,
26
+ type: constants.ARM_TIMER_EFFECT,
27
+ },
28
+ ],
29
+ state: Object.assign(Object.assign({}, state), { hasExtendedRecoveryThisAttempt: true }),
30
+ };
31
+ };
32
+
33
+ exports.handleManifestReceived = handleManifestReceived;
@@ -0,0 +1,2 @@
1
+ import { WebViewLoadConfig, WebViewLoadState, WebViewLoadTransitionResult } from '../../webViewLoadTypes';
2
+ export declare const handleManifestReceived: (state: WebViewLoadState, config: WebViewLoadConfig) => WebViewLoadTransitionResult;