@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.
- package/CHANGELOG.md +6800 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/_virtual/_tslib.cjs +36 -0
- package/_virtual/_tslib.js +32 -0
- package/package.cjs +8 -0
- package/package.js +4 -0
- package/package.json +33 -1
- package/src/client/client.cjs +80 -0
- package/src/client/client.d.ts +108 -0
- package/src/client/client.js +75 -0
- package/src/client/core/core.cjs +84 -0
- package/src/client/core/core.d.ts +75 -0
- package/src/client/core/core.js +80 -0
- package/src/client/core/index.d.ts +1 -0
- package/src/client/core/modules/initializationModule/index.d.ts +1 -0
- package/src/client/core/modules/initializationModule/initializationModule.cjs +72 -0
- package/src/client/core/modules/initializationModule/initializationModule.d.ts +6 -0
- package/src/client/core/modules/initializationModule/initializationModule.js +68 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.cjs +28 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.d.ts +3 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.js +24 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/manifestModule.cjs +40 -0
- package/src/client/core/modules/manifestModule/manifestModule.d.ts +12 -0
- package/src/client/core/modules/manifestModule/manifestModule.js +36 -0
- package/src/client/core/modules/manifestModule/validateManifest/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.cjs +31 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.d.ts +14 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.js +26 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/index.d.ts +1 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.cjs +24 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.d.ts +29 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.js +20 -0
- package/src/client/index.d.ts +1 -0
- package/src/index.cjs +26 -0
- package/src/index.d.ts +14 -0
- package/src/index.js +14 -0
- package/src/modules/authModule/authModule.cjs +60 -0
- package/src/modules/authModule/authModule.d.ts +30 -0
- package/src/modules/authModule/authModule.js +56 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.cjs +26 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.d.ts +10 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.js +22 -0
- package/src/modules/authModule/emailAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.cjs +16 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.d.ts +7 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.js +12 -0
- package/src/modules/authModule/externalAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/index.d.ts +1 -0
- package/src/modules/authModule/passkeyAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.cjs +15 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.d.ts +6 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.js +11 -0
- package/src/modules/authModule/smsAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.cjs +23 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.d.ts +11 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.js +19 -0
- package/src/modules/authModule/socialAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.cjs +24 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.d.ts +10 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.js +20 -0
- package/src/modules/bitcoinModule/bitcoinModule.cjs +21 -0
- package/src/modules/bitcoinModule/bitcoinModule.d.ts +19 -0
- package/src/modules/bitcoinModule/bitcoinModule.js +17 -0
- package/src/modules/bitcoinModule/index.d.ts +1 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.cjs +32 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.d.ts +12 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.js +28 -0
- package/src/modules/deviceRegistrationModule/index.d.ts +1 -0
- package/src/modules/instrumentationModule/index.d.ts +1 -0
- package/src/modules/instrumentationModule/instrumentationModule.cjs +40 -0
- package/src/modules/instrumentationModule/instrumentationModule.d.ts +6 -0
- package/src/modules/instrumentationModule/instrumentationModule.js +36 -0
- package/src/modules/localeModule/index.d.ts +1 -0
- package/src/modules/localeModule/localeModule.cjs +15 -0
- package/src/modules/localeModule/localeModule.d.ts +14 -0
- package/src/modules/localeModule/localeModule.js +11 -0
- package/src/modules/mfaModule/index.d.ts +1 -0
- package/src/modules/mfaModule/mfaModule.cjs +35 -0
- package/src/modules/mfaModule/mfaModule.d.ts +23 -0
- package/src/modules/mfaModule/mfaModule.js +31 -0
- package/src/modules/networksModule/index.d.ts +1 -0
- package/src/modules/networksModule/networksModule.cjs +18 -0
- package/src/modules/networksModule/networksModule.d.ts +3 -0
- package/src/modules/networksModule/networksModule.js +14 -0
- package/src/modules/passkeysModule/index.d.ts +1 -0
- package/src/modules/passkeysModule/passkeysModule.cjs +18 -0
- package/src/modules/passkeysModule/passkeysModule.d.ts +10 -0
- package/src/modules/passkeysModule/passkeysModule.js +14 -0
- package/src/modules/sdkModule/index.d.ts +1 -0
- package/src/modules/sdkModule/sdkModule.cjs +64 -0
- package/src/modules/sdkModule/sdkModule.d.ts +25 -0
- package/src/modules/sdkModule/sdkModule.js +60 -0
- package/src/modules/stepUpAuthModule/index.d.ts +1 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.cjs +36 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.d.ts +19 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.js +32 -0
- package/src/modules/tonModule/index.d.ts +1 -0
- package/src/modules/tonModule/tonModule.cjs +19 -0
- package/src/modules/tonModule/tonModule.d.ts +15 -0
- package/src/modules/tonModule/tonModule.js +15 -0
- package/src/modules/userInterfaceModule/index.d.ts +1 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.cjs +66 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.d.ts +155 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.js +62 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.cjs +17 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.d.ts +14 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.js +13 -0
- package/src/modules/walletsModule/accountAbstractionModule/index.d.ts +1 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.cjs +31 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.d.ts +9 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.js +27 -0
- package/src/modules/walletsModule/createWalletListenerMethods/index.d.ts +1 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.cjs +32 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.d.ts +14 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.js +28 -0
- package/src/modules/walletsModule/delegationModule/index.d.ts +1 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.cjs +32 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.d.ts +11 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.js +28 -0
- package/src/modules/walletsModule/embeddedWalletsModule/index.d.ts +1 -0
- package/src/modules/walletsModule/index.d.ts +1 -0
- package/src/modules/walletsModule/phantomModule/index.d.ts +1 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.cjs +18 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.d.ts +27 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.js +14 -0
- package/src/modules/walletsModule/waasModule/index.d.ts +1 -0
- package/src/modules/walletsModule/waasModule/waasModule.cjs +25 -0
- package/src/modules/walletsModule/waasModule/waasModule.d.ts +16 -0
- package/src/modules/walletsModule/waasModule/waasModule.js +21 -0
- package/src/modules/walletsModule/walletsModule.cjs +69 -0
- package/src/modules/walletsModule/walletsModule.d.ts +40 -0
- package/src/modules/walletsModule/walletsModule.js +65 -0
- package/src/types.d.ts +2 -0
- package/src/utils/Extendable/Extendable.cjs +29 -0
- package/src/utils/Extendable/Extendable.d.ts +25 -0
- package/src/utils/Extendable/Extendable.js +25 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.cjs +26 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.d.ts +6 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.js +22 -0
- package/src/utils/Extendable/deepMerge/index.d.ts +1 -0
- package/src/utils/Extendable/hasExtension/hasExtension.cjs +14 -0
- package/src/utils/Extendable/hasExtension/hasExtension.d.ts +9 -0
- package/src/utils/Extendable/hasExtension/hasExtension.js +10 -0
- package/src/utils/Extendable/hasExtension/index.d.ts +1 -0
- package/src/utils/Extendable/index.d.ts +1 -0
- package/src/utils/addProperty/addProperty.cjs +21 -0
- package/src/utils/addProperty/addProperty.d.ts +13 -0
- package/src/utils/addProperty/addProperty.js +17 -0
- package/src/utils/addProperty/index.d.ts +1 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.cjs +63 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.d.ts +13 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.js +59 -0
- package/src/utils/createWaitForAuthSuccess/index.d.ts +1 -0
- package/src/utils/diffMs/diffMs.cjs +12 -0
- package/src/utils/diffMs/diffMs.d.ts +5 -0
- package/src/utils/diffMs/diffMs.js +8 -0
- package/src/utils/diffMs/index.d.ts +1 -0
- package/src/utils/logger/index.d.ts +1 -0
- package/src/utils/logger/logger.cjs +10 -0
- package/src/utils/logger/logger.d.ts +2 -0
- package/src/utils/logger/logger.js +6 -0
- package/src/utils/pickListenerActions/index.d.ts +1 -0
- package/src/utils/pickListenerActions/pickListenerActions.cjs +23 -0
- package/src/utils/pickListenerActions/pickListenerActions.d.ts +7 -0
- package/src/utils/pickListenerActions/pickListenerActions.js +19 -0
- package/src/utils/randomString/index.d.ts +1 -0
- package/src/utils/randomString/randomString.cjs +16 -0
- package/src/utils/randomString/randomString.d.ts +7 -0
- package/src/utils/randomString/randomString.js +12 -0
- package/src/utils/setupFetchHandler/index.d.ts +1 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.cjs +36 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.d.ts +2 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.js +32 -0
- package/src/utils/setupLogHandler/index.d.ts +1 -0
- package/src/utils/setupLogHandler/setupLogHandler.cjs +16 -0
- package/src/utils/setupLogHandler/setupLogHandler.d.ts +2 -0
- package/src/utils/setupLogHandler/setupLogHandler.js +12 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.cjs +13 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.d.ts +110 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.js +9 -0
- package/src/webviewLoad/WebViewFailedToLoadError/index.d.ts +1 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.cjs +14 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.d.ts +1 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.js +10 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/index.d.ts +1 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.cjs +13 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.d.ts +1 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.js +9 -0
- package/src/webviewLoad/assignStartTimeToUrl/index.d.ts +1 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.cjs +45 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.d.ts +26 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.js +41 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.cjs +24 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.d.ts +7 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.js +16 -0
- package/src/webviewLoad/classifyWebViewLoadError/index.d.ts +2 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.cjs +24 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.d.ts +9 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.js +18 -0
- package/src/webviewLoad/computeRetryBackoffMs/index.d.ts +1 -0
- package/src/webviewLoad/constants.cjs +17 -0
- package/src/webviewLoad/constants.d.ts +4 -0
- package/src/webviewLoad/constants.js +10 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.cjs +14 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.d.ts +14 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.js +10 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.cjs +288 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.d.ts +50 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.js +282 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.cjs +45 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.d.ts +29 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.js +37 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.cjs +94 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.d.ts +38 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.js +90 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/index.d.ts +2 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.cjs +20 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.d.ts +13 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.js +16 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/index.d.ts +3 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.cjs +37 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.d.ts +9 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.js +33 -0
- package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/webViewLoadAdapter.d.ts +11 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.cjs +17 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.d.ts +1 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.js +13 -0
- package/src/webviewLoad/incrementRetryInUrl/index.d.ts +1 -0
- package/src/webviewLoad/index.d.ts +14 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/index.d.ts +1 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.cjs +8 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.d.ts +13 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.js +4 -0
- package/src/webviewLoad/isSdkReadyMessage/index.d.ts +1 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.cjs +27 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.d.ts +14 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.js +23 -0
- package/src/webviewLoad/probeOrigin/index.d.ts +1 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.cjs +45 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.d.ts +23 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.js +40 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/index.d.ts +1 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.cjs +54 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.d.ts +14 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.js +47 -0
- package/src/webviewLoad/sdkWebViewLoadState/index.d.ts +1 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.cjs +20 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.d.ts +42 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.js +16 -0
- package/src/webviewLoad/webViewLoadOptions/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadOptions/webViewLoadOptions.d.ts +45 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.cjs +14 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.js +10 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.cjs +64 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.d.ts +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.js +37 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.cjs +19 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.js +15 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.cjs +34 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.js +30 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.cjs +70 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.d.ts +15 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.js +66 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.cjs +26 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.js +22 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.cjs +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.js +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.cjs +33 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.js +29 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.cjs +32 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.js +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.cjs +25 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.js +21 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.cjs +25 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.js +21 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.cjs +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.js +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.cjs +38 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.js +34 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.cjs +39 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.js +35 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.cjs +23 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.d.ts +3 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.js +19 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/index.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.cjs +13 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.js +9 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.cjs +66 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.d.ts +9 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.js +61 -0
- package/src/webviewLoad/webViewLoadTypes/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadTypes/webViewLoadTypes.d.ts +156 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This only serves to limit the methods of an event emitter to
|
|
8
|
+
* only the ones necessary for event listening
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
const pickListenerActions = (emitter) => ({
|
|
12
|
+
off: (eventName, listener) => {
|
|
13
|
+
emitter.off(eventName, listener);
|
|
14
|
+
},
|
|
15
|
+
on: (eventName, listener) => {
|
|
16
|
+
emitter.on(eventName, listener);
|
|
17
|
+
},
|
|
18
|
+
once: (eventName, listener) => {
|
|
19
|
+
emitter.once(eventName, listener);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.pickListenerActions = pickListenerActions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
|
+
import { PickedEventListeners } from '@dynamic-labs/message-transport';
|
|
3
|
+
/**
|
|
4
|
+
* This only serves to limit the methods of an event emitter to
|
|
5
|
+
* only the ones necessary for event listening
|
|
6
|
+
*/
|
|
7
|
+
export declare const pickListenerActions: <T extends Record<string, any>>(emitter: EventEmitter<T>) => PickedEventListeners<T>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* This only serves to limit the methods of an event emitter to
|
|
4
|
+
* only the ones necessary for event listening
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
const pickListenerActions = (emitter) => ({
|
|
8
|
+
off: (eventName, listener) => {
|
|
9
|
+
emitter.off(eventName, listener);
|
|
10
|
+
},
|
|
11
|
+
on: (eventName, listener) => {
|
|
12
|
+
emitter.on(eventName, listener);
|
|
13
|
+
},
|
|
14
|
+
once: (eventName, listener) => {
|
|
15
|
+
emitter.once(eventName, listener);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { pickListenerActions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { randomString } from './randomString';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const DEFAULT_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
7
|
+
/** @not-instrumented */
|
|
8
|
+
const randomString = ({ chars = DEFAULT_CHARS, length, }) => {
|
|
9
|
+
let result = '';
|
|
10
|
+
for (let i = 0; i < length; i++) {
|
|
11
|
+
result += chars[Math.floor(Math.random() * chars.length)];
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.randomString = randomString;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const DEFAULT_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
3
|
+
/** @not-instrumented */
|
|
4
|
+
const randomString = ({ chars = DEFAULT_CHARS, length, }) => {
|
|
5
|
+
let result = '';
|
|
6
|
+
for (let i = 0; i < length; i++) {
|
|
7
|
+
result += chars[Math.floor(Math.random() * chars.length)];
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { randomString };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupFetchHandler } from './setupFetchHandler';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
8
|
+
var logger = require('../logger/logger.cjs');
|
|
9
|
+
|
|
10
|
+
const setupFetchHandler = (core) => {
|
|
11
|
+
const fetchRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
12
|
+
fetchRequestChannel.handle('fetch', (input, init) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
+
try {
|
|
14
|
+
const response = yield fetch(input, init);
|
|
15
|
+
const responseBody = yield response.text();
|
|
16
|
+
return {
|
|
17
|
+
body: responseBody,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
20
|
+
status: response.status,
|
|
21
|
+
statusText: response.statusText,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
logger.logger.error('Fetch request failed in setupFetchHandler', {
|
|
26
|
+
error: error instanceof Error ? error.message : String(error),
|
|
27
|
+
input: typeof input === 'string' ? input : input.url,
|
|
28
|
+
method: (init === null || init === void 0 ? void 0 : init.method) || 'GET',
|
|
29
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
30
|
+
});
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.setupFetchHandler = setupFetchHandler;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
|
+
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
4
|
+
import { logger } from '../logger/logger.js';
|
|
5
|
+
|
|
6
|
+
const setupFetchHandler = (core) => {
|
|
7
|
+
const fetchRequestChannel = createRequestChannel(core.messageTransport);
|
|
8
|
+
fetchRequestChannel.handle('fetch', (input, init) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
+
try {
|
|
10
|
+
const response = yield fetch(input, init);
|
|
11
|
+
const responseBody = yield response.text();
|
|
12
|
+
return {
|
|
13
|
+
body: responseBody,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
16
|
+
status: response.status,
|
|
17
|
+
statusText: response.statusText,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
logger.error('Fetch request failed in setupFetchHandler', {
|
|
22
|
+
error: error instanceof Error ? error.message : String(error),
|
|
23
|
+
input: typeof input === 'string' ? input : input.url,
|
|
24
|
+
method: (init === null || init === void 0 ? void 0 : init.method) || 'GET',
|
|
25
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
26
|
+
});
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { setupFetchHandler };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupLogHandler } from './setupLogHandler';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
7
|
+
|
|
8
|
+
const setupLogHandler = (core) => {
|
|
9
|
+
const consoleRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
10
|
+
consoleRequestChannel.handle('log', (_, message) => {
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.log(message);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.setupLogHandler = setupLogHandler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
3
|
+
|
|
4
|
+
const setupLogHandler = (core) => {
|
|
5
|
+
const consoleRequestChannel = createRequestChannel(core.messageTransport);
|
|
6
|
+
consoleRequestChannel.handle('log', (_, message) => {
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
console.log(message);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { setupLogHandler };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
class WebViewFailedToLoadError extends Error {
|
|
7
|
+
constructor(meta) {
|
|
8
|
+
super('Could not load Dynamic WebView');
|
|
9
|
+
this.meta = meta;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.WebViewFailedToLoadError = WebViewFailedToLoadError;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Categorical phase the WebView was in when the failure was raised.
|
|
3
|
+
*
|
|
4
|
+
* Use this for high-level grouping; the duration fields on
|
|
5
|
+
* {@link WebViewFailedToLoadErrorMeta} give the granular timing data.
|
|
6
|
+
*/
|
|
7
|
+
export type WebViewFailedToLoadErrorPhase = 'html_load' | 'html_finish' | 'sdk_bootstrap' | 'after_clear_state' | 'native_error' | 'embedded_native_error' | 'unknown';
|
|
8
|
+
/**
|
|
9
|
+
* A single failed load attempt recorded by the embedded webview's bounded
|
|
10
|
+
* retry engine. The terminal {@link WebViewFailedToLoadError} carries one
|
|
11
|
+
* record per attempt (including the final one) so the error log shows the
|
|
12
|
+
* full failure history, not just the last symptom.
|
|
13
|
+
*/
|
|
14
|
+
export type WebViewLoadAttemptFailure = {
|
|
15
|
+
/** 1-based attempt number this failure belongs to. */
|
|
16
|
+
attempt: number;
|
|
17
|
+
/** The phase the attempt was in when it failed. */
|
|
18
|
+
phase: WebViewFailedToLoadErrorPhase;
|
|
19
|
+
/** Milliseconds from the start of the attempt to its failure. */
|
|
20
|
+
elapsedMs: number;
|
|
21
|
+
/** Native error code, when the failure came from a native `onLoadError`. */
|
|
22
|
+
nativeErrorCode?: number;
|
|
23
|
+
/** Native error domain, when the failure came from a native `onLoadError`. */
|
|
24
|
+
nativeErrorDomain?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Structured context attached to {@link WebViewFailedToLoadError} so the
|
|
28
|
+
* resulting error log carries enough information to tell *which* step the
|
|
29
|
+
* WebView was stuck in when the failure was raised, and how long each step
|
|
30
|
+
* took.
|
|
31
|
+
*
|
|
32
|
+
* The setter on `InitializationModule.error` forwards this object directly
|
|
33
|
+
* to `logger.error`, so every field below ends up as a structured field on
|
|
34
|
+
* the same Datadog log as the error message.
|
|
35
|
+
*/
|
|
36
|
+
export type WebViewFailedToLoadErrorMeta = {
|
|
37
|
+
phase: WebViewFailedToLoadErrorPhase;
|
|
38
|
+
/**
|
|
39
|
+
* Milliseconds between RN's `onLoadStart` and `onLoad` callbacks (the
|
|
40
|
+
* HTML + asset fetch). `null` if `onLoad` never fired.
|
|
41
|
+
*/
|
|
42
|
+
htmlLoadMs: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Milliseconds between RN's `onLoad` and `onLoadEnd` callbacks. Usually
|
|
45
|
+
* small; mostly there to flag pathological cases. `null` if `onLoadEnd`
|
|
46
|
+
* never fired.
|
|
47
|
+
*/
|
|
48
|
+
onLoadToOnLoadEndMs: number | null;
|
|
49
|
+
/**
|
|
50
|
+
* Milliseconds between `onLoadEnd` and the first `manifest` request
|
|
51
|
+
* received from the webview-side SDK. Proxy for "the JS bundle is alive
|
|
52
|
+
* and the message bridge works". `null` if the manifest request never
|
|
53
|
+
* arrived.
|
|
54
|
+
*/
|
|
55
|
+
manifestReceivedMs: number | null;
|
|
56
|
+
/**
|
|
57
|
+
* Milliseconds between `onLoadEnd` and the webview-side SDK signalling
|
|
58
|
+
* it has finished initialising (via the `sdkHasLoadedEventName` store
|
|
59
|
+
* change). `null` if the SDK never signalled it was ready.
|
|
60
|
+
*/
|
|
61
|
+
sdkReadyMs: number | null;
|
|
62
|
+
/**
|
|
63
|
+
* Number of `retry` increments in the WebView URL at the time of failure
|
|
64
|
+
* (covers OS-kill reloads, load_error reloads, and recovery reloads).
|
|
65
|
+
*/
|
|
66
|
+
retryCount: number;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the `clear-state` query parameter was present in the URL when
|
|
69
|
+
* the failure was raised. `true` indicates we already retried with a
|
|
70
|
+
* clean state and still couldn't finish loading.
|
|
71
|
+
*/
|
|
72
|
+
hadClearState: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Number of times RN's `onError` fired across the lifetime of the
|
|
75
|
+
* WebView component instance.
|
|
76
|
+
*/
|
|
77
|
+
nativeErrorCount: number;
|
|
78
|
+
/**
|
|
79
|
+
* Number of times the OS killed the WebView process (via
|
|
80
|
+
* `onContentProcessDidTerminate` on iOS or `onRenderProcessGone` on
|
|
81
|
+
* Android) across the lifetime of the WebView component instance.
|
|
82
|
+
*/
|
|
83
|
+
osKillCount: number;
|
|
84
|
+
/** The configured value for `loadingTimeout` (ms). */
|
|
85
|
+
loadingTimeoutMs: number;
|
|
86
|
+
/** The configured value for `recoveryTimeout` (ms). */
|
|
87
|
+
recoveryTimeoutMs: number;
|
|
88
|
+
/** The URL the WebView was attempting to load when the failure occurred. */
|
|
89
|
+
webviewUrl?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Native error info, only populated when the failure originated from the
|
|
92
|
+
* embedded native WebView path (iOS WKWebView / Android WebView), where
|
|
93
|
+
* we get a single `onLoadError` event with these fields.
|
|
94
|
+
*/
|
|
95
|
+
nativeErrorCode?: number;
|
|
96
|
+
nativeErrorDescription?: string;
|
|
97
|
+
nativeErrorDomain?: string;
|
|
98
|
+
nativeErrorIsProvisional?: boolean;
|
|
99
|
+
nativeErrorFailedUrl?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Per-attempt failure history recorded by the embedded webview's bounded
|
|
102
|
+
* retry engine — one entry per failed attempt, including the terminal
|
|
103
|
+
* one. Absent on the non-embedded (`react-native-webview`) path.
|
|
104
|
+
*/
|
|
105
|
+
attemptFailures?: WebViewLoadAttemptFailure[];
|
|
106
|
+
};
|
|
107
|
+
export declare class WebViewFailedToLoadError extends Error {
|
|
108
|
+
readonly meta?: WebViewFailedToLoadErrorMeta;
|
|
109
|
+
constructor(meta?: WebViewFailedToLoadErrorMeta);
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WebViewFailedToLoadError, type WebViewFailedToLoadErrorMeta, type WebViewFailedToLoadErrorPhase, type WebViewLoadAttemptFailure, } from './WebViewFailedToLoadError';
|
|
@@ -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
|
+
const assignEnvironmentIdToUrl = (url, environmentId) => {
|
|
9
|
+
const _url = new URL(url);
|
|
10
|
+
_url.searchParams.set(constants.ENVIRONMENT_ID_PARAM, environmentId);
|
|
11
|
+
return _url;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.assignEnvironmentIdToUrl = assignEnvironmentIdToUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const assignEnvironmentIdToUrl: (url: string, environmentId: string) => URL;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ENVIRONMENT_ID_PARAM } from '../constants.js';
|
|
3
|
+
|
|
4
|
+
const assignEnvironmentIdToUrl = (url, environmentId) => {
|
|
5
|
+
const _url = new URL(url);
|
|
6
|
+
_url.searchParams.set(ENVIRONMENT_ID_PARAM, environmentId);
|
|
7
|
+
return _url;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { assignEnvironmentIdToUrl };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assignEnvironmentIdToUrl } from './assignEnvironmentIdToUrl';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var constants = require('../constants.cjs');
|
|
7
|
+
|
|
8
|
+
const assignStartTimeToUrl = (url) => {
|
|
9
|
+
url.searchParams.set(constants.WEBVIEW_START_TIME_PARAM, Date.now().toString());
|
|
10
|
+
return url;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.assignStartTimeToUrl = assignStartTimeToUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const assignStartTimeToUrl: (url: URL) => URL;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assignStartTimeToUrl } from './assignStartTimeToUrl';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var constants = require('./constants.cjs');
|
|
7
|
+
|
|
8
|
+
// HTTP status codes in [400, 500) indicate a client error that a plain
|
|
9
|
+
// reload of the same URL will not fix.
|
|
10
|
+
const HTTP_CLIENT_ERROR_MIN = 400;
|
|
11
|
+
const HTTP_CLIENT_ERROR_MAX_EXCLUSIVE = 500;
|
|
12
|
+
// iOS NSURLErrorAppTransportSecurityRequiresSecureConnection: the URL is
|
|
13
|
+
// blocked by App Transport Security policy, so a reload of the same URL
|
|
14
|
+
// can never succeed — it must not burn the retry budget.
|
|
15
|
+
const IOS_APP_TRANSPORT_SECURITY_ERROR_CODE = -1022;
|
|
16
|
+
/**
|
|
17
|
+
* Classifies a native embedded-webview load error as `transient`
|
|
18
|
+
* (a reload may succeed — flaky DNS, dropped connection, killed content
|
|
19
|
+
* process, navigation-decision stall, server hiccup) or `permanent`
|
|
20
|
+
* (a reload of the same URL cannot succeed — malformed URL, blocked
|
|
21
|
+
* scheme, SSL failure, App Transport Security block, HTTP 4xx).
|
|
22
|
+
*
|
|
23
|
+
* Anything unrecognized is treated as transient so a novel failure mode
|
|
24
|
+
* still gets the bounded retry budget rather than failing hard on the
|
|
25
|
+
* first hit.
|
|
26
|
+
*/
|
|
27
|
+
const classifyWebViewLoadError = ({ code, domain, }) => {
|
|
28
|
+
if (domain === constants.EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN ||
|
|
29
|
+
domain === constants.EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN ||
|
|
30
|
+
domain === constants.EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN) {
|
|
31
|
+
return 'permanent';
|
|
32
|
+
}
|
|
33
|
+
if (domain === constants.EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN &&
|
|
34
|
+
code === IOS_APP_TRANSPORT_SECURITY_ERROR_CODE) {
|
|
35
|
+
return 'permanent';
|
|
36
|
+
}
|
|
37
|
+
if (domain === constants.EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN &&
|
|
38
|
+
code >= HTTP_CLIENT_ERROR_MIN &&
|
|
39
|
+
code < HTTP_CLIENT_ERROR_MAX_EXCLUSIVE) {
|
|
40
|
+
return 'permanent';
|
|
41
|
+
}
|
|
42
|
+
return 'transient';
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.classifyWebViewLoadError = classifyWebViewLoadError;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type WebViewLoadErrorClassification = 'transient' | 'permanent';
|
|
2
|
+
export type ClassifyWebViewLoadErrorArgs = {
|
|
3
|
+
/** The native `onLoadError` domain string. */
|
|
4
|
+
domain: string;
|
|
5
|
+
/**
|
|
6
|
+
* The native error code. For `EmbeddedWebViewLoadError` this is the
|
|
7
|
+
* platform network-stack code (iOS `NSURLError*` such as -1001 timed out,
|
|
8
|
+
* -1003 host not found, -1004 cannot connect, -1005 connection lost,
|
|
9
|
+
* -1009 offline; Android `WebViewClient.ERROR_*` such as -2 HOST_LOOKUP,
|
|
10
|
+
* -6 CONNECT, -8 TIMEOUT). For `EmbeddedWebViewHttpError` it is the HTTP
|
|
11
|
+
* status code.
|
|
12
|
+
*/
|
|
13
|
+
code: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Classifies a native embedded-webview load error as `transient`
|
|
17
|
+
* (a reload may succeed — flaky DNS, dropped connection, killed content
|
|
18
|
+
* process, navigation-decision stall, server hiccup) or `permanent`
|
|
19
|
+
* (a reload of the same URL cannot succeed — malformed URL, blocked
|
|
20
|
+
* scheme, SSL failure, App Transport Security block, HTTP 4xx).
|
|
21
|
+
*
|
|
22
|
+
* Anything unrecognized is treated as transient so a novel failure mode
|
|
23
|
+
* still gets the bounded retry budget rather than failing hard on the
|
|
24
|
+
* first hit.
|
|
25
|
+
*/
|
|
26
|
+
export declare const classifyWebViewLoadError: ({ code, domain, }: ClassifyWebViewLoadErrorArgs) => WebViewLoadErrorClassification;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN, EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN, EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN, EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN, EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN } from './constants.js';
|
|
3
|
+
|
|
4
|
+
// HTTP status codes in [400, 500) indicate a client error that a plain
|
|
5
|
+
// reload of the same URL will not fix.
|
|
6
|
+
const HTTP_CLIENT_ERROR_MIN = 400;
|
|
7
|
+
const HTTP_CLIENT_ERROR_MAX_EXCLUSIVE = 500;
|
|
8
|
+
// iOS NSURLErrorAppTransportSecurityRequiresSecureConnection: the URL is
|
|
9
|
+
// blocked by App Transport Security policy, so a reload of the same URL
|
|
10
|
+
// can never succeed — it must not burn the retry budget.
|
|
11
|
+
const IOS_APP_TRANSPORT_SECURITY_ERROR_CODE = -1022;
|
|
12
|
+
/**
|
|
13
|
+
* Classifies a native embedded-webview load error as `transient`
|
|
14
|
+
* (a reload may succeed — flaky DNS, dropped connection, killed content
|
|
15
|
+
* process, navigation-decision stall, server hiccup) or `permanent`
|
|
16
|
+
* (a reload of the same URL cannot succeed — malformed URL, blocked
|
|
17
|
+
* scheme, SSL failure, App Transport Security block, HTTP 4xx).
|
|
18
|
+
*
|
|
19
|
+
* Anything unrecognized is treated as transient so a novel failure mode
|
|
20
|
+
* still gets the bounded retry budget rather than failing hard on the
|
|
21
|
+
* first hit.
|
|
22
|
+
*/
|
|
23
|
+
const classifyWebViewLoadError = ({ code, domain, }) => {
|
|
24
|
+
if (domain === EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN ||
|
|
25
|
+
domain === EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN ||
|
|
26
|
+
domain === EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN) {
|
|
27
|
+
return 'permanent';
|
|
28
|
+
}
|
|
29
|
+
if (domain === EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN &&
|
|
30
|
+
code === IOS_APP_TRANSPORT_SECURITY_ERROR_CODE) {
|
|
31
|
+
return 'permanent';
|
|
32
|
+
}
|
|
33
|
+
if (domain === EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN &&
|
|
34
|
+
code >= HTTP_CLIENT_ERROR_MIN &&
|
|
35
|
+
code < HTTP_CLIENT_ERROR_MAX_EXCLUSIVE) {
|
|
36
|
+
return 'permanent';
|
|
37
|
+
}
|
|
38
|
+
return 'transient';
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { classifyWebViewLoadError };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
// The `onLoadError` domain strings emitted by the native embedded webview
|
|
7
|
+
// controllers. Keep in sync with `ios/EmbeddedWebViewController.swift` and
|
|
8
|
+
// `android/src/main/java/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt`
|
|
9
|
+
// in `react-native-extension`.
|
|
10
|
+
//
|
|
11
|
+
// `EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN` is re-exported from the package entry
|
|
12
|
+
// (`@dynamic-labs/legacy-client`) and is therefore public API — renaming or removing
|
|
13
|
+
// it is a breaking change. The other domains are package-internal.
|
|
14
|
+
const EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN = 'EmbeddedWebViewLoadError';
|
|
15
|
+
const EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN = 'EmbeddedWebViewHttpError';
|
|
16
|
+
const EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN = 'EmbeddedWebViewSslError';
|
|
17
|
+
const EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN = 'EmbeddedWebViewInvalidUrl';
|
|
18
|
+
const EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN = 'EmbeddedWebViewBlockedScheme';
|
|
19
|
+
|
|
20
|
+
exports.EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN = EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN;
|
|
21
|
+
exports.EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN = EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN;
|
|
22
|
+
exports.EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN = EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN;
|
|
23
|
+
exports.EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN = EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN;
|
|
24
|
+
exports.EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN = EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN = "EmbeddedWebViewLoadError";
|
|
2
|
+
export declare const EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN = "EmbeddedWebViewHttpError";
|
|
3
|
+
export declare const EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN = "EmbeddedWebViewSslError";
|
|
4
|
+
export declare const EMBEDDED_WEBVIEW_PROCESS_TERMINATED_DOMAIN = "EmbeddedWebViewProcessTerminated";
|
|
5
|
+
export declare const EMBEDDED_WEBVIEW_NAVIGATION_TIMEOUT_DOMAIN = "EmbeddedWebViewNavigationTimeout";
|
|
6
|
+
export declare const EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN = "EmbeddedWebViewInvalidUrl";
|
|
7
|
+
export declare const EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN = "EmbeddedWebViewBlockedScheme";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
// The `onLoadError` domain strings emitted by the native embedded webview
|
|
3
|
+
// controllers. Keep in sync with `ios/EmbeddedWebViewController.swift` and
|
|
4
|
+
// `android/src/main/java/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt`
|
|
5
|
+
// in `react-native-extension`.
|
|
6
|
+
//
|
|
7
|
+
// `EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN` is re-exported from the package entry
|
|
8
|
+
// (`@dynamic-labs/legacy-client`) and is therefore public API — renaming or removing
|
|
9
|
+
// it is a breaking change. The other domains are package-internal.
|
|
10
|
+
const EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN = 'EmbeddedWebViewLoadError';
|
|
11
|
+
const EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN = 'EmbeddedWebViewHttpError';
|
|
12
|
+
const EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN = 'EmbeddedWebViewSslError';
|
|
13
|
+
const EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN = 'EmbeddedWebViewInvalidUrl';
|
|
14
|
+
const EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN = 'EmbeddedWebViewBlockedScheme';
|
|
15
|
+
|
|
16
|
+
export { EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN, EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN, EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN, EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN, EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { classifyWebViewLoadError, type ClassifyWebViewLoadErrorArgs, type WebViewLoadErrorClassification, } from './classifyWebViewLoadError';
|
|
2
|
+
export { EMBEDDED_WEBVIEW_BLOCKED_SCHEME_DOMAIN, EMBEDDED_WEBVIEW_HTTP_ERROR_DOMAIN, EMBEDDED_WEBVIEW_INVALID_URL_DOMAIN, EMBEDDED_WEBVIEW_LOAD_ERROR_DOMAIN, EMBEDDED_WEBVIEW_NAVIGATION_TIMEOUT_DOMAIN, EMBEDDED_WEBVIEW_PROCESS_TERMINATED_DOMAIN, EMBEDDED_WEBVIEW_SSL_ERROR_DOMAIN, } from './constants';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
// Base backoff delays before the 2nd and 3rd attempts respectively.
|
|
7
|
+
const RETRY_BACKOFF_BASE_DELAYS_MS = [2000, 5000];
|
|
8
|
+
// Upper bound of the random jitter added to each backoff delay.
|
|
9
|
+
const RETRY_BACKOFF_MAX_JITTER_MS = 1000;
|
|
10
|
+
/**
|
|
11
|
+
* Backoff delay (ms) to wait before the attempt following the given failed
|
|
12
|
+
* 1-based `attempt`. The jitter is non-cryptographic: it only decorrelates
|
|
13
|
+
* simultaneous reloads across devices and is never used for anything
|
|
14
|
+
* security-relevant, so any `random` source (e.g. `Math.random`) is fine.
|
|
15
|
+
*/
|
|
16
|
+
const computeRetryBackoffMs = (attempt, random) => {
|
|
17
|
+
const baseDelayMs = RETRY_BACKOFF_BASE_DELAYS_MS[Math.min(attempt - 1, RETRY_BACKOFF_BASE_DELAYS_MS.length - 1)];
|
|
18
|
+
const jitterMs = Math.floor(random() * RETRY_BACKOFF_MAX_JITTER_MS);
|
|
19
|
+
return baseDelayMs + jitterMs;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.RETRY_BACKOFF_BASE_DELAYS_MS = RETRY_BACKOFF_BASE_DELAYS_MS;
|
|
23
|
+
exports.RETRY_BACKOFF_MAX_JITTER_MS = RETRY_BACKOFF_MAX_JITTER_MS;
|
|
24
|
+
exports.computeRetryBackoffMs = computeRetryBackoffMs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const RETRY_BACKOFF_BASE_DELAYS_MS: number[];
|
|
2
|
+
export declare const RETRY_BACKOFF_MAX_JITTER_MS = 1000;
|
|
3
|
+
/**
|
|
4
|
+
* Backoff delay (ms) to wait before the attempt following the given failed
|
|
5
|
+
* 1-based `attempt`. The jitter is non-cryptographic: it only decorrelates
|
|
6
|
+
* simultaneous reloads across devices and is never used for anything
|
|
7
|
+
* security-relevant, so any `random` source (e.g. `Math.random`) is fine.
|
|
8
|
+
*/
|
|
9
|
+
export declare const computeRetryBackoffMs: (attempt: number, random: () => number) => number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
// Base backoff delays before the 2nd and 3rd attempts respectively.
|
|
3
|
+
const RETRY_BACKOFF_BASE_DELAYS_MS = [2000, 5000];
|
|
4
|
+
// Upper bound of the random jitter added to each backoff delay.
|
|
5
|
+
const RETRY_BACKOFF_MAX_JITTER_MS = 1000;
|
|
6
|
+
/**
|
|
7
|
+
* Backoff delay (ms) to wait before the attempt following the given failed
|
|
8
|
+
* 1-based `attempt`. The jitter is non-cryptographic: it only decorrelates
|
|
9
|
+
* simultaneous reloads across devices and is never used for anything
|
|
10
|
+
* security-relevant, so any `random` source (e.g. `Math.random`) is fine.
|
|
11
|
+
*/
|
|
12
|
+
const computeRetryBackoffMs = (attempt, random) => {
|
|
13
|
+
const baseDelayMs = RETRY_BACKOFF_BASE_DELAYS_MS[Math.min(attempt - 1, RETRY_BACKOFF_BASE_DELAYS_MS.length - 1)];
|
|
14
|
+
const jitterMs = Math.floor(random() * RETRY_BACKOFF_MAX_JITTER_MS);
|
|
15
|
+
return baseDelayMs + jitterMs;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { RETRY_BACKOFF_BASE_DELAYS_MS, RETRY_BACKOFF_MAX_JITTER_MS, computeRetryBackoffMs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RETRY_BACKOFF_BASE_DELAYS_MS, RETRY_BACKOFF_MAX_JITTER_MS, computeRetryBackoffMs, } from './computeRetryBackoffMs';
|