@hot-updater/react-native 1.0.0-rc.2 → 1.0.0-rc.22
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/android/proguard-rules.pro +17 -2
- package/android/src/main/java/com/hotupdater/BuiltInAssetResolver.kt +286 -0
- package/android/src/main/java/com/hotupdater/BundleFileStorageService.kt +954 -837
- package/android/src/main/java/com/hotupdater/BundleMetadata.kt +15 -11
- package/android/src/main/java/com/hotupdater/FileManagerService.kt +45 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterException.kt +287 -22
- package/android/src/main/java/com/hotupdater/HotUpdaterImpl.kt +43 -31
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryManager.kt +37 -54
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryState.kt +64 -0
- package/android/src/main/java/com/hotupdater/InstallIdentityService.kt +37 -0
- package/android/src/main/java/com/hotupdater/KeyValueStorageService.kt +86 -0
- package/android/src/main/java/com/hotupdater/NetworkState.kt +31 -0
- package/android/src/main/java/com/hotupdater/NoBackupStorage.kt +17 -0
- package/android/src/main/java/com/hotupdater/OkHttpDownloadService.kt +127 -50
- package/android/src/main/java/com/hotupdater/PreviousProcessExit.kt +89 -0
- package/android/src/main/java/com/hotupdater/ReactNativeValueConverters.kt +34 -0
- package/android/src/main/java/com/hotupdater/TarArchiveInputStream.kt +214 -375
- package/android/src/main/java/com/hotupdater/TarBrArchiveExtractor.kt +119 -0
- package/android/src/newarch/HotUpdater.kt +7 -9
- package/android/src/newarch/HotUpdaterModule.kt +109 -84
- package/android/src/oldarch/HotUpdater.kt +7 -9
- package/android/src/oldarch/HotUpdaterModule.kt +98 -74
- package/android/src/oldarch/HotUpdaterSpec.kt +4 -6
- package/ios/HotUpdater/Internal/BrotliFileDecompressor.swift +167 -0
- package/ios/HotUpdater/Internal/BuiltInAssetResolver.swift +196 -0
- package/ios/HotUpdater/Internal/BundleFileStorageService.swift +950 -1112
- package/ios/HotUpdater/Internal/BundleMetadata.swift +8 -53
- package/ios/HotUpdater/Internal/FileManagerService.swift +48 -0
- package/ios/HotUpdater/Internal/FileUtilities.swift +64 -0
- package/ios/HotUpdater/Internal/HotUpdater-Bridging-Header.h +0 -1
- package/ios/HotUpdater/Internal/HotUpdater.mm +13 -45
- package/ios/HotUpdater/Internal/HotUpdaterImpl.swift +190 -73
- package/ios/HotUpdater/Internal/KeyValueStorageService.swift +71 -0
- package/ios/HotUpdater/Internal/NotificationExtension.swift +0 -2
- package/ios/HotUpdater/Internal/TarArchiveExtractor.swift +182 -311
- package/ios/HotUpdater/Internal/URLSessionDownloadService.swift +119 -71
- package/ios/HotUpdater/Internal/UpdateFailure.swift +390 -0
- package/ios/HotUpdater/Recovery/HotUpdaterRecovery.h +16 -0
- package/ios/HotUpdater/Recovery/HotUpdaterRecovery.mm +83 -0
- package/ios/HotUpdater/Recovery/HotUpdaterRecoveryHooks.mm +49 -0
- package/lib/commonjs/appReady.js +111 -0
- package/lib/commonjs/appReady.js.map +1 -0
- package/lib/commonjs/checkForUpdate.js +125 -70
- package/lib/commonjs/checkForUpdate.js.map +1 -1
- package/lib/commonjs/clientPlugin.js +13 -0
- package/lib/commonjs/clientPlugin.js.map +1 -0
- package/lib/commonjs/error.js +4 -13
- package/lib/commonjs/error.js.map +1 -1
- package/lib/commonjs/fetchJSON.js +5 -2
- package/lib/commonjs/fetchJSON.js.map +1 -1
- package/lib/commonjs/httpClient.js +55 -92
- package/lib/commonjs/httpClient.js.map +1 -1
- package/lib/commonjs/index.js +68 -20
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native.js +82 -62
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/pluginHost.js +44 -0
- package/lib/commonjs/pluginHost.js.map +1 -0
- package/lib/commonjs/releaseCatalogCache.js +20 -61
- package/lib/commonjs/releaseCatalogCache.js.map +1 -1
- package/lib/commonjs/sdkVersion.js +1 -1
- package/lib/commonjs/sdkVersion.js.map +1 -1
- package/lib/commonjs/specs/NativeHotUpdater.js.map +1 -1
- package/lib/commonjs/store.js +3 -10
- package/lib/commonjs/store.js.map +1 -1
- package/lib/commonjs/updateError.js +132 -0
- package/lib/commonjs/updateError.js.map +1 -0
- package/lib/commonjs/wrap.js +44 -27
- package/lib/commonjs/wrap.js.map +1 -1
- package/lib/module/appReady.js +103 -0
- package/lib/module/appReady.js.map +1 -0
- package/lib/module/checkForUpdate.js +118 -65
- package/lib/module/checkForUpdate.js.map +1 -1
- package/lib/module/clientPlugin.js +4 -0
- package/lib/module/clientPlugin.js.map +1 -0
- package/lib/module/error.js +4 -13
- package/lib/module/error.js.map +1 -1
- package/lib/module/fetchJSON.js +3 -1
- package/lib/module/fetchJSON.js.map +1 -1
- package/lib/module/httpClient.js +53 -90
- package/lib/module/httpClient.js.map +1 -1
- package/lib/module/index.js +55 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/native.js +74 -54
- package/lib/module/native.js.map +1 -1
- package/lib/module/pluginHost.js +35 -0
- package/lib/module/pluginHost.js.map +1 -0
- package/lib/module/releaseCatalogCache.js +16 -56
- package/lib/module/releaseCatalogCache.js.map +1 -1
- package/lib/module/sdkVersion.js +1 -1
- package/lib/module/sdkVersion.js.map +1 -1
- package/lib/module/specs/NativeHotUpdater.js.map +1 -1
- package/lib/module/store.js +3 -10
- package/lib/module/store.js.map +1 -1
- package/lib/module/updateError.js +126 -0
- package/lib/module/updateError.js.map +1 -0
- package/lib/module/wrap.js +45 -28
- package/lib/module/wrap.js.map +1 -1
- package/lib/typescript/commonjs/appReady.d.ts +23 -0
- package/lib/typescript/commonjs/appReady.d.ts.map +1 -0
- package/lib/typescript/commonjs/checkForUpdate.d.ts +16 -4
- package/lib/typescript/commonjs/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/commonjs/clientPlugin.d.ts +2 -0
- package/lib/typescript/commonjs/clientPlugin.d.ts.map +1 -0
- package/lib/typescript/commonjs/error.d.ts +4 -13
- package/lib/typescript/commonjs/error.d.ts.map +1 -1
- package/lib/typescript/commonjs/fetchJSON.d.ts +3 -0
- package/lib/typescript/commonjs/fetchJSON.d.ts.map +1 -1
- package/lib/typescript/commonjs/httpClient.d.ts +3 -32
- package/lib/typescript/commonjs/httpClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +7 -12
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +33 -23
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/pluginHost.d.ts +4 -0
- package/lib/typescript/commonjs/pluginHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts +6 -14
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/sdkVersion.d.ts +1 -1
- package/lib/typescript/commonjs/sdkVersion.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts +42 -47
- package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts.map +1 -1
- package/lib/typescript/commonjs/store.d.ts +1 -3
- package/lib/typescript/commonjs/store.d.ts.map +1 -1
- package/lib/typescript/commonjs/types.d.ts +1 -1
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/updateError.d.ts +26 -0
- package/lib/typescript/commonjs/updateError.d.ts.map +1 -0
- package/lib/typescript/commonjs/wrap.d.ts.map +1 -1
- package/lib/typescript/commonjs/wrap.types.d.ts +6 -7
- package/lib/typescript/commonjs/wrap.types.d.ts.map +1 -1
- package/lib/typescript/module/appReady.d.ts +23 -0
- package/lib/typescript/module/appReady.d.ts.map +1 -0
- package/lib/typescript/module/checkForUpdate.d.ts +16 -4
- package/lib/typescript/module/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/module/clientPlugin.d.ts +2 -0
- package/lib/typescript/module/clientPlugin.d.ts.map +1 -0
- package/lib/typescript/module/error.d.ts +4 -13
- package/lib/typescript/module/error.d.ts.map +1 -1
- package/lib/typescript/module/fetchJSON.d.ts +3 -0
- package/lib/typescript/module/fetchJSON.d.ts.map +1 -1
- package/lib/typescript/module/httpClient.d.ts +3 -32
- package/lib/typescript/module/httpClient.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +7 -12
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +33 -23
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/pluginHost.d.ts +4 -0
- package/lib/typescript/module/pluginHost.d.ts.map +1 -0
- package/lib/typescript/module/releaseCatalogCache.d.ts +6 -14
- package/lib/typescript/module/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/module/sdkVersion.d.ts +1 -1
- package/lib/typescript/module/sdkVersion.d.ts.map +1 -1
- package/lib/typescript/module/specs/NativeHotUpdater.d.ts +42 -47
- package/lib/typescript/module/specs/NativeHotUpdater.d.ts.map +1 -1
- package/lib/typescript/module/store.d.ts +1 -3
- package/lib/typescript/module/store.d.ts.map +1 -1
- package/lib/typescript/module/types.d.ts +1 -1
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/updateError.d.ts +26 -0
- package/lib/typescript/module/updateError.d.ts.map +1 -0
- package/lib/typescript/module/wrap.d.ts.map +1 -1
- package/lib/typescript/module/wrap.types.d.ts +6 -7
- package/lib/typescript/module/wrap.types.d.ts.map +1 -1
- package/package.json +7 -4
- package/src/appReady.ts +149 -0
- package/src/checkForUpdate.ts +152 -89
- package/src/clientPlugin.ts +17 -0
- package/src/error.ts +4 -14
- package/src/fetchJSON.ts +5 -1
- package/src/httpClient.ts +78 -157
- package/src/index.ts +87 -29
- package/src/native.ts +109 -104
- package/src/pluginHost.ts +45 -0
- package/src/releaseCatalogCache.ts +26 -140
- package/src/sdkVersion.ts +1 -1
- package/src/specs/NativeHotUpdater.ts +41 -48
- package/src/store.ts +2 -23
- package/src/types.ts +1 -1
- package/src/updateError.ts +153 -0
- package/src/wrap.tsx +59 -28
- package/src/wrap.types.ts +6 -7
- package/android/src/main/java/com/hotupdater/DecompressService.kt +0 -89
- package/android/src/main/java/com/hotupdater/DecompressionStrategy.kt +0 -26
- package/android/src/main/java/com/hotupdater/TarBrDecompressionStrategy.kt +0 -117
- package/android/src/main/java/com/hotupdater/TarGzDecompressionStrategy.kt +0 -117
- package/android/src/main/java/com/hotupdater/ZipDecompressionStrategy.kt +0 -192
- package/android/src/test/java/com/hotupdater/BsdiffPatchTest.kt +0 -46
- package/android/src/test/java/com/hotupdater/BundleFileStorageServiceTest.kt +0 -799
- package/android/src/test/java/com/hotupdater/HotUpdaterImplTest.kt +0 -273
- package/android/src/test/java/com/hotupdater/NativeConfigUtilsTest.kt +0 -20
- package/android/src/test/java/com/hotupdater/OkHttpDownloadServiceTest.kt +0 -111
- package/android/src/test/java/com/hotupdater/RelativePathResolverTest.kt +0 -41
- package/android/src/test/java/com/hotupdater/ReleaseCatalogCacheServiceTest.kt +0 -118
- package/android/src/test/java/com/hotupdater/TarArchiveInputStreamTest.kt +0 -68
- package/ios/HotUpdater/Internal/ArchiveExtractionUtilities.swift +0 -178
- package/ios/HotUpdater/Internal/DecompressService.swift +0 -112
- package/ios/HotUpdater/Internal/DecompressionStrategy.swift +0 -22
- package/ios/HotUpdater/Internal/StreamingTarArchiveExtractor.swift +0 -370
- package/ios/HotUpdater/Internal/TarBrDecompressionStrategy.swift +0 -39
- package/ios/HotUpdater/Internal/TarGzDecompressionStrategy.swift +0 -59
- package/ios/HotUpdater/Internal/ZipArchiveExtractor.swift +0 -482
- package/ios/HotUpdater/Internal/ZipDecompressionStrategy.swift +0 -56
- package/lib/commonjs/catalogCacheNative.spec.js +0 -31
- package/lib/commonjs/catalogCacheNative.spec.js.map +0 -1
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js +0 -604
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/commonjs/httpClient.spec.js +0 -102
- package/lib/commonjs/httpClient.spec.js.map +0 -1
- package/lib/commonjs/index.spec.js +0 -298
- package/lib/commonjs/index.spec.js.map +0 -1
- package/lib/commonjs/iosInterop.spec.js +0 -18
- package/lib/commonjs/iosInterop.spec.js.map +0 -1
- package/lib/commonjs/native.spec.js +0 -795
- package/lib/commonjs/native.spec.js.map +0 -1
- package/lib/commonjs/notifyAppReadyInsights.boundary.spec.js +0 -218
- package/lib/commonjs/notifyAppReadyInsights.boundary.spec.js.map +0 -1
- package/lib/commonjs/notifyAppReadyInsights.js +0 -133
- package/lib/commonjs/notifyAppReadyInsights.js.map +0 -1
- package/lib/commonjs/notifyAppReadyInsights.spec.js +0 -246
- package/lib/commonjs/notifyAppReadyInsights.spec.js.map +0 -1
- package/lib/commonjs/notifyAppReadyInsights.test-utils.js +0 -24
- package/lib/commonjs/notifyAppReadyInsights.test-utils.js.map +0 -1
- package/lib/commonjs/notifyAppReadyInsights.transport.spec.js +0 -117
- package/lib/commonjs/notifyAppReadyInsights.transport.spec.js.map +0 -1
- package/lib/commonjs/releaseCatalogCache.spec.js +0 -195
- package/lib/commonjs/releaseCatalogCache.spec.js.map +0 -1
- package/lib/commonjs/releaseCatalogCacheNativeContract.spec.js +0 -64
- package/lib/commonjs/releaseCatalogCacheNativeContract.spec.js.map +0 -1
- package/lib/commonjs/store.notification.spec.js +0 -76
- package/lib/commonjs/store.notification.spec.js.map +0 -1
- package/lib/commonjs/store.spec.js +0 -316
- package/lib/commonjs/store.spec.js.map +0 -1
- package/lib/commonjs/wrap.spec.js +0 -296
- package/lib/commonjs/wrap.spec.js.map +0 -1
- package/lib/module/catalogCacheNative.spec.js +0 -31
- package/lib/module/catalogCacheNative.spec.js.map +0 -1
- package/lib/module/checkForUpdate.releaseCatalog.spec.js +0 -603
- package/lib/module/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/module/httpClient.spec.js +0 -102
- package/lib/module/httpClient.spec.js.map +0 -1
- package/lib/module/index.spec.js +0 -297
- package/lib/module/index.spec.js.map +0 -1
- package/lib/module/iosInterop.spec.js +0 -18
- package/lib/module/iosInterop.spec.js.map +0 -1
- package/lib/module/native.spec.js +0 -794
- package/lib/module/native.spec.js.map +0 -1
- package/lib/module/notifyAppReadyInsights.boundary.spec.js +0 -217
- package/lib/module/notifyAppReadyInsights.boundary.spec.js.map +0 -1
- package/lib/module/notifyAppReadyInsights.js +0 -128
- package/lib/module/notifyAppReadyInsights.js.map +0 -1
- package/lib/module/notifyAppReadyInsights.spec.js +0 -245
- package/lib/module/notifyAppReadyInsights.spec.js.map +0 -1
- package/lib/module/notifyAppReadyInsights.test-utils.js +0 -18
- package/lib/module/notifyAppReadyInsights.test-utils.js.map +0 -1
- package/lib/module/notifyAppReadyInsights.transport.spec.js +0 -116
- package/lib/module/notifyAppReadyInsights.transport.spec.js.map +0 -1
- package/lib/module/releaseCatalogCache.spec.js +0 -195
- package/lib/module/releaseCatalogCache.spec.js.map +0 -1
- package/lib/module/releaseCatalogCacheNativeContract.spec.js +0 -64
- package/lib/module/releaseCatalogCacheNativeContract.spec.js.map +0 -1
- package/lib/module/store.notification.spec.js +0 -77
- package/lib/module/store.notification.spec.js.map +0 -1
- package/lib/module/store.spec.js +0 -315
- package/lib/module/store.spec.js.map +0 -1
- package/lib/module/wrap.spec.js +0 -295
- package/lib/module/wrap.spec.js.map +0 -1
- package/lib/typescript/commonjs/notifyAppReadyInsights.d.ts +0 -13
- package/lib/typescript/commonjs/notifyAppReadyInsights.d.ts.map +0 -1
- package/lib/typescript/commonjs/notifyAppReadyInsights.test-utils.d.ts +0 -8
- package/lib/typescript/commonjs/notifyAppReadyInsights.test-utils.d.ts.map +0 -1
- package/lib/typescript/module/notifyAppReadyInsights.d.ts +0 -13
- package/lib/typescript/module/notifyAppReadyInsights.d.ts.map +0 -1
- package/lib/typescript/module/notifyAppReadyInsights.test-utils.d.ts +0 -8
- package/lib/typescript/module/notifyAppReadyInsights.test-utils.d.ts.map +0 -1
- package/src/catalogCacheNative.spec.ts +0 -63
- package/src/checkForUpdate.releaseCatalog.spec.ts +0 -596
- package/src/httpClient.spec.ts +0 -132
- package/src/index.spec.ts +0 -331
- package/src/iosInterop.spec.ts +0 -30
- package/src/native.spec.ts +0 -855
- package/src/notifyAppReadyInsights.boundary.spec.ts +0 -234
- package/src/notifyAppReadyInsights.spec.ts +0 -243
- package/src/notifyAppReadyInsights.test-utils.ts +0 -31
- package/src/notifyAppReadyInsights.transport.spec.ts +0 -130
- package/src/notifyAppReadyInsights.ts +0 -194
- package/src/releaseCatalogCache.spec.ts +0 -282
- package/src/releaseCatalogCacheNativeContract.spec.ts +0 -80
- package/src/store.notification.spec.ts +0 -92
- package/src/store.spec.ts +0 -372
- package/src/wrap.spec.ts +0 -367
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Error Classification:
|
|
9
9
|
* - Parameter Validation: Invalid or missing function parameters
|
|
10
|
-
* - Bundle Storage: Errors during download,
|
|
10
|
+
* - Bundle Storage: Errors during download, verification, and storage
|
|
11
11
|
* - Signature Verification: Cryptographic verification failures (collapsed to a single public code)
|
|
12
12
|
* - Internal: Platform-specific or unexpected errors
|
|
13
13
|
*
|
|
@@ -23,8 +23,7 @@ export declare enum HotUpdaterErrorCode {
|
|
|
23
23
|
*/
|
|
24
24
|
MISSING_BUNDLE_ID = "MISSING_BUNDLE_ID",
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Thrown when fileUrl parameter cannot be parsed as a valid URL.
|
|
26
|
+
* Manifest or asset URL is invalid or malformed.
|
|
28
27
|
* @retryable false
|
|
29
28
|
*/
|
|
30
29
|
INVALID_FILE_URL = "INVALID_FILE_URL",
|
|
@@ -48,23 +47,15 @@ export declare enum HotUpdaterErrorCode {
|
|
|
48
47
|
* @retryable true - Download may succeed on retry
|
|
49
48
|
*/
|
|
50
49
|
INCOMPLETE_DOWNLOAD = "INCOMPLETE_DOWNLOAD",
|
|
51
|
-
/**
|
|
52
|
-
* Bundle archive format is invalid or corrupted.
|
|
53
|
-
* Thrown when ZIP file has wrong magic bytes, invalid structure, or unsupported format.
|
|
54
|
-
* Also thrown for path traversal attempts during extraction.
|
|
55
|
-
* @retryable false - Indicates corrupted or malicious bundle
|
|
56
|
-
*/
|
|
57
|
-
EXTRACTION_FORMAT_ERROR = "EXTRACTION_FORMAT_ERROR",
|
|
58
50
|
/**
|
|
59
51
|
* Bundle missing required platform files.
|
|
60
|
-
* Thrown when
|
|
52
|
+
* Thrown when the staged bundle doesn't contain index.android.bundle (Android)
|
|
61
53
|
* or main.jsbundle (iOS).
|
|
62
54
|
* @retryable false - Indicates incorrectly built bundle
|
|
63
55
|
*/
|
|
64
56
|
INVALID_BUNDLE = "INVALID_BUNDLE",
|
|
65
57
|
/**
|
|
66
|
-
* Insufficient disk space for bundle
|
|
67
|
-
* Thrown when available disk space is less than required (file size * 2).
|
|
58
|
+
* Insufficient disk space for bundle staging.
|
|
68
59
|
* Error message includes required and available bytes.
|
|
69
60
|
* @retryable false - User must free up disk space
|
|
70
61
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,oBAAY,mBAAmB;IAG7B;;;;OAIG;IACH,iBAAiB,sBAAsB;IAEvC
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,oBAAY,mBAAmB;IAG7B;;;;OAIG;IACH,iBAAiB,sBAAsB;IAEvC;;;OAGG;IACH,gBAAgB,qBAAqB;IAIrC;;;;OAIG;IACH,yBAAyB,8BAA8B;IAEvD;;;;;OAKG;IACH,eAAe,oBAAoB;IAEnC;;;;;OAKG;IACH,mBAAmB,wBAAwB;IAE3C;;;;;OAKG;IACH,cAAc,mBAAmB;IAEjC;;;;OAIG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;OAKG;IACH,6BAA6B,kCAAkC;IAE/D;;;;;;OAMG;IACH,qBAAqB,0BAA0B;IAE/C;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAOvD;;;;;;;OAOG;IACH,gBAAgB,qBAAqB;IAErC;;;;;OAKG;IACH,aAAa,kBAAkB;CAChC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAUzD;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,qBAAa,wBAAyB,SAAQ,eAAe;IAC3D,cAGC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchJSON.d.ts","sourceRoot":"","sources":["../../../src/fetchJSON.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAU,CAAC,4CAI9B;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,KAAG,OAAO,CAAC,CAAC,CAwBZ,CAAC"}
|
|
1
|
+
{"version":3,"file":"fetchJSON.d.ts","sourceRoot":"","sources":["../../../src/fetchJSON.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,sBAAuB,SAAQ,eAAe;CAAG;AAE9D,eAAO,MAAM,SAAS,GAAU,CAAC,4CAI9B;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,KAAG,OAAO,CAAC,CAAC,CAwBZ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ArtifactInfo, type ReleaseCatalog } from "@hot-updater/
|
|
2
|
-
import type { HotUpdaterBaseURL } from "./types";
|
|
1
|
+
import { type ArtifactInfo, type HotUpdaterBaseURL, type ReleaseCatalog } from "@hot-updater/protocol";
|
|
3
2
|
export interface ReleaseCatalogRequest {
|
|
4
3
|
readonly platform: "ios" | "android";
|
|
5
4
|
readonly channel: string;
|
|
@@ -15,42 +14,14 @@ export interface ArtifactRequest {
|
|
|
15
14
|
readonly requestHeaders?: Record<string, string>;
|
|
16
15
|
readonly requestTimeout?: number;
|
|
17
16
|
}
|
|
18
|
-
interface InsightsEventCommonParams {
|
|
19
|
-
readonly installId: string;
|
|
20
|
-
readonly userId?: string;
|
|
21
|
-
readonly username?: string;
|
|
22
|
-
readonly platform: "ios" | "android";
|
|
23
|
-
readonly appVersion: string;
|
|
24
|
-
readonly channel: string;
|
|
25
|
-
readonly cohort: string;
|
|
26
|
-
readonly fingerprintHash: string | null;
|
|
27
|
-
readonly fromReleaseId?: string | null;
|
|
28
|
-
readonly toReleaseId?: string | null;
|
|
29
|
-
readonly requestHeaders?: Record<string, string>;
|
|
30
|
-
readonly requestTimeout?: number;
|
|
31
|
-
}
|
|
32
|
-
type InsightsTransitionEventParams = InsightsEventCommonParams & {
|
|
33
|
-
readonly type: "UPDATE_APPLIED" | "RECOVERED" | "RELEASE_ADOPTED";
|
|
34
|
-
readonly fromBundleId: string;
|
|
35
|
-
readonly toBundleId: string;
|
|
36
|
-
readonly updateStrategy: "fingerprint" | "appVersion";
|
|
37
|
-
};
|
|
38
|
-
type InsightsUnchangedEventParams = InsightsEventCommonParams & {
|
|
39
|
-
readonly type: "UNCHANGED";
|
|
40
|
-
readonly fromBundleId: null;
|
|
41
|
-
readonly toBundleId: string;
|
|
42
|
-
readonly updateStrategy: null;
|
|
43
|
-
};
|
|
44
|
-
export type InsightsEventParams = InsightsTransitionEventParams | InsightsUnchangedEventParams;
|
|
45
17
|
export interface HotUpdaterHttpSession {
|
|
46
|
-
|
|
18
|
+
/** Resolves to null when the server says the scope has no catalog, so no update. */
|
|
19
|
+
fetchReleaseCatalog: (params: ReleaseCatalogRequest) => Promise<ReleaseCatalog | null>;
|
|
47
20
|
resolveArtifact: (params: ArtifactRequest) => Promise<ArtifactInfo>;
|
|
48
|
-
sendInsightsEvent: (params: InsightsEventParams) => Promise<void>;
|
|
49
21
|
}
|
|
50
22
|
export interface HotUpdaterHttpClient {
|
|
51
23
|
createSession: () => Promise<HotUpdaterHttpSession>;
|
|
52
24
|
}
|
|
53
25
|
/** Creates the private HTTP client used by HotUpdater.init and HotUpdater.wrap. */
|
|
54
26
|
export declare const createHttpClient: (baseURL: HotUpdaterBaseURL) => HotUpdaterHttpClient;
|
|
55
|
-
export {};
|
|
56
27
|
//# sourceMappingURL=httpClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../../src/httpClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../../src/httpClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,aAAa,GAAG,YAAY,CAAC;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,oFAAoF;IACpF,mBAAmB,EAAE,CACnB,MAAM,EAAE,qBAAqB,KAC1B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpC,eAAe,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrD;AAuID,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,YAClB,iBAAiB,KACzB,oBAED,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type CheckForUpdateOptions } from "./checkForUpdate";
|
|
2
|
-
import { addListener, clearCrashHistory, getAppVersion,
|
|
2
|
+
import { addListener, clearCrashHistory, getAppVersion, getUpdateId, getChannel, getCohort, getCrashHistory, getDefaultChannel, getFingerprintHash, getInstallId, getManifest, getMinBundleId, isChannelSwitched, notifyAppReady, reload, setCohort, setReloadBehavior, type UpdateParams } from "./native";
|
|
3
3
|
import { type AutoUpdateOptions, type HotUpdaterInitOptions, type HotUpdaterOptions, wrap } from "./wrap";
|
|
4
|
-
export type
|
|
4
|
+
export { defineClientPlugin, type AppReadyResult, type BundleDownloadedInfo, type HotUpdaterClientContext, type HotUpdaterClientHooks, type HotUpdaterClientPlugin, type HotUpdaterClientStorage, type ReleaseTransitionKind, type UpdateCheckResult, type UpdateError, type UpdateErrorReason, type UpdateErrorStage, type UpdateStrategy, } from "./clientPlugin";
|
|
5
|
+
export { insights, type InsightsOptions, type InsightsPlugin, type InsightsUser, } from "@hot-updater/plugin-insights/client";
|
|
6
|
+
export type { CustomReloadHandler, HotUpdaterEvent, HotUpdaterProgressArtifactType, HotUpdaterProgressEvent, Manifest, ManifestAsset, NotifyAppReadyResult, ActiveUpdateState, ReloadBehavior, ReloadBehaviorSetting, } from "./native";
|
|
5
7
|
export * from "./store";
|
|
6
8
|
export { extractSignatureFailure, type HotUpdaterBaseURL, isSignatureVerificationError, type SignatureVerificationFailure, } from "./types";
|
|
7
9
|
export type { HotUpdaterFallbackComponentProps, HotUpdaterInitOptions, HotUpdaterOptions, RunUpdateProcessResponse, } from "./wrap";
|
|
@@ -94,13 +96,12 @@ declare function createHotUpdaterClient(): {
|
|
|
94
96
|
/** Reads the active and stable Release/Bundle state. */
|
|
95
97
|
getActiveUpdateState: () => Promise<import("./native").ActiveUpdateState>;
|
|
96
98
|
/**
|
|
97
|
-
*
|
|
99
|
+
* Returns the selected update ID, matching the ID shown in the console.
|
|
100
|
+
* A staged update can change this ID before the app reloads.
|
|
98
101
|
*/
|
|
99
|
-
getBundleId: typeof
|
|
102
|
+
getBundleId: typeof getUpdateId;
|
|
100
103
|
/** Returns the minimum bundle ID based on the native app build time. */
|
|
101
104
|
getMinBundleId: typeof getMinBundleId;
|
|
102
|
-
/** Returns the active Release identity, or null for BUILTIN/legacy state. */
|
|
103
|
-
getReleaseId: typeof getReleaseId;
|
|
104
105
|
/**
|
|
105
106
|
* Fetches the current manifest for the active bundle.
|
|
106
107
|
*/
|
|
@@ -200,8 +201,6 @@ declare function createHotUpdaterClient(): {
|
|
|
200
201
|
*
|
|
201
202
|
* @param {UpdateBundleParams} params - Parameters object required for bundle update
|
|
202
203
|
* @param {string} params.bundleId - The bundle ID of the app
|
|
203
|
-
* @param {string|null} params.fileUrl - The URL of the zip file
|
|
204
|
-
*
|
|
205
204
|
* @returns {Promise<boolean>} Whether the update was successful
|
|
206
205
|
*
|
|
207
206
|
* @example
|
|
@@ -248,10 +247,6 @@ declare function createHotUpdaterClient(): {
|
|
|
248
247
|
* Fetches the persisted install id for this app installation.
|
|
249
248
|
*/
|
|
250
249
|
getInstallId: typeof getInstallId;
|
|
251
|
-
/**
|
|
252
|
-
* Persists nullable user identity fields associated with this installation.
|
|
253
|
-
*/
|
|
254
|
-
setUser: typeof setUser;
|
|
255
250
|
/**
|
|
256
251
|
* Reads the native launch report for the current process.
|
|
257
252
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,qBAAqB,EAI3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,WAAW,EAIX,iBAAiB,EACjB,aAAa,EAEb,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,MAAM,EAEN,SAAS,EACT,iBAAiB,EAEjB,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAItB,IAAI,EACL,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,qCAAqC,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AGH;;;;;;;;;;;OAWG;;EAGN;AAED,KAAK,gBAAgB,GAAG,IAAI,CAC1B,UAAU,CAAC,OAAO,sBAAsB,CAAC,EACzC,MAAM,CACP,GAAG;IACF,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAA2C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CatalogHighWater, type UpdateStatus, type PersistedSelectionReceipt } from "@hot-updater/
|
|
1
|
+
import { type CatalogHighWater, type UpdateStatus, type PersistedSelectionReceipt } from "@hot-updater/protocol";
|
|
2
2
|
import { HotUpdaterErrorCode, isHotUpdaterError } from "./error";
|
|
3
3
|
import { type UpdateBundleParams } from "./specs/NativeHotUpdater";
|
|
4
4
|
export { HotUpdaterErrorCode, isHotUpdaterError };
|
|
@@ -33,7 +33,7 @@ export type CustomReloadHandler = () => void | Promise<void>;
|
|
|
33
33
|
* - `custom`: Run a user-provided JS handler on both platforms
|
|
34
34
|
*/
|
|
35
35
|
export type ReloadBehaviorSetting = ReloadBehavior | "custom";
|
|
36
|
-
export type HotUpdaterProgressArtifactType = "
|
|
36
|
+
export type HotUpdaterProgressArtifactType = "diff";
|
|
37
37
|
export type HotUpdaterDiffFileStatus = "pending" | "downloading" | "downloaded" | "failed";
|
|
38
38
|
export interface HotUpdaterDiffFileSnapshot {
|
|
39
39
|
/**
|
|
@@ -78,11 +78,6 @@ export interface HotUpdaterDiffProgressDetails {
|
|
|
78
78
|
files: HotUpdaterDiffFileSnapshot[];
|
|
79
79
|
}
|
|
80
80
|
export type HotUpdaterProgressEvent = {
|
|
81
|
-
progress: number;
|
|
82
|
-
artifactType: "archive";
|
|
83
|
-
downloadedBytes?: number;
|
|
84
|
-
totalBytes?: number;
|
|
85
|
-
} | {
|
|
86
81
|
progress: number;
|
|
87
82
|
artifactType: "diff";
|
|
88
83
|
details: HotUpdaterDiffProgressDetails;
|
|
@@ -130,6 +125,24 @@ export declare const commitReleaseSelection: (input: {
|
|
|
130
125
|
readonly selection: PersistedSelectionReceipt;
|
|
131
126
|
readonly guard: ReleaseSelectionGuard;
|
|
132
127
|
}) => Promise<boolean>;
|
|
128
|
+
/** How native delivered a staged bundle. */
|
|
129
|
+
export type BundleDelivery = {
|
|
130
|
+
/**
|
|
131
|
+
* "patch" when a bsdiff patch produced a file, "manifest" when only the
|
|
132
|
+
* changed files were downloaded, "archive" for the full archive.
|
|
133
|
+
*/
|
|
134
|
+
readonly delivery: "patch" | "manifest" | "archive";
|
|
135
|
+
/** A patch was tried, but the file or the archive was downloaded instead. */
|
|
136
|
+
readonly patchFallback: boolean;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Stages a bundle for the next launch. Resolves with how native delivered
|
|
140
|
+
* it, or with null when this runtime had already staged it and nothing was
|
|
141
|
+
* downloaded; rejects when the download or install fails.
|
|
142
|
+
*
|
|
143
|
+
* @throws {Error} Rejects with error.code from HotUpdaterErrorCode enum and error.message
|
|
144
|
+
*/
|
|
145
|
+
export declare function stageBundle(params: UpdateParams): Promise<BundleDelivery | null>;
|
|
133
146
|
/**
|
|
134
147
|
* Downloads files and applies them to the app.
|
|
135
148
|
*
|
|
@@ -179,7 +192,8 @@ export declare function setReloadBehavior(...args: [behavior: ReloadBehavior] |
|
|
|
179
192
|
* @returns {string} The minimum bundle id.
|
|
180
193
|
*/
|
|
181
194
|
export declare const getMinBundleId: () => string;
|
|
182
|
-
|
|
195
|
+
/** Returns the selected update ID shown in the console, including staged updates. */
|
|
196
|
+
export declare const getUpdateId: () => string;
|
|
183
197
|
/**
|
|
184
198
|
* Fetches the current bundle version id.
|
|
185
199
|
*
|
|
@@ -219,17 +233,10 @@ export declare const isChannelSwitched: () => boolean;
|
|
|
219
233
|
*/
|
|
220
234
|
export declare const getFingerprintHash: () => string | null;
|
|
221
235
|
export declare const getInstallId: () => string;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
export declare const getPersistedUserIdentity: () => PersistedUserIdentity;
|
|
227
|
-
export type SetUserParams = {
|
|
228
|
-
userId?: string | number | null;
|
|
229
|
-
username?: string | null;
|
|
230
|
-
};
|
|
231
|
-
export declare function setUser(params: SetUserParams): void;
|
|
232
|
-
export declare function setUser(params: null): void;
|
|
236
|
+
/** Reads a value from the SDK's native key-value store. */
|
|
237
|
+
export declare const getStorageItem: (key: string) => string | null;
|
|
238
|
+
/** Writes a value to the SDK's native key-value store; null removes it. */
|
|
239
|
+
export declare const setStorageItem: (key: string, value: string | null) => void;
|
|
233
240
|
/**
|
|
234
241
|
* Result returned by notifyAppReady()
|
|
235
242
|
*/
|
|
@@ -248,17 +255,20 @@ export type NotifyAppReadyResult = {
|
|
|
248
255
|
fromReleaseId?: string;
|
|
249
256
|
toReleaseId?: string;
|
|
250
257
|
};
|
|
251
|
-
|
|
258
|
+
/** An update applied or recovered at this launch, as native persisted it. */
|
|
259
|
+
export type LaunchTransition = {
|
|
252
260
|
type: "UPDATE_APPLIED" | "RECOVERED";
|
|
253
261
|
fromBundleId: string;
|
|
254
262
|
toBundleId: string;
|
|
255
|
-
fromReleaseId
|
|
256
|
-
toReleaseId
|
|
263
|
+
fromReleaseId: string | null;
|
|
264
|
+
toReleaseId: string | null;
|
|
257
265
|
updateStrategy: PersistedUpdateStrategy;
|
|
258
266
|
};
|
|
259
267
|
export declare const readNotifyAppReady: () => {
|
|
260
268
|
result: NotifyAppReadyResult;
|
|
261
|
-
|
|
269
|
+
transition: LaunchTransition | null;
|
|
270
|
+
/** Android 11+: why the previous main process exited, when native knows. */
|
|
271
|
+
previousProcessExit: string | null;
|
|
262
272
|
pending: boolean;
|
|
263
273
|
};
|
|
264
274
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EAIrB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,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,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,OAAO,CAMpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM,KAAG,IAI1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,MAS5B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { PluginHostConfig } from "@hot-updater/protocol";
|
|
2
|
+
/** The app's plugin host: plugins read the native module and fetch the configured server. */
|
|
3
|
+
export declare const configurePlugins: (plugins: readonly import("@hot-updater/protocol").HotUpdaterClientPlugin[] | undefined, config: import("@hot-updater/protocol").PluginHostConfig) => void, hasPluginHook: (name: import("@hot-updater/protocol").PluginHookName) => boolean, buildPluginEvent: <K extends import("@hot-updater/protocol").PluginHookName>(name: K, createPayload: () => import("@hot-updater/protocol").PluginHookPayload<K> | null) => import("@hot-updater/protocol").PluginHookPayload<K> | null, dispatchPluginHook: <K extends import("@hot-updater/protocol").PluginHookName>(name: K, payload: import("@hot-updater/protocol").PluginHookPayload<K>) => readonly Promise<void>[], emitPluginHook: <K extends import("@hot-updater/protocol").PluginHookName>(name: K, createPayload: () => import("@hot-updater/protocol").PluginHookPayload<K> | null) => void;
|
|
4
|
+
//# sourceMappingURL=pluginHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginHost.d.ts","sourceRoot":"","sources":["../../../src/pluginHost.ts"],"names":[],"mappings":"AAeA,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,6FAA6F;AAC7F,eAAO,MACL,gBAAgB,8JAChB,aAAa,qEACb,gBAAgB,wNAChB,kBAAkB,kKAClB,cAAc,+JAqBd,CAAC"}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import { type ReleaseCatalog } from "@hot-updater/
|
|
2
|
-
export declare const MAX_RELEASE_CATALOG_WIRE_BYTES: number;
|
|
1
|
+
import { type ExpectedReleaseCatalogScope, type ReleaseCatalog } from "@hot-updater/protocol";
|
|
3
2
|
export declare const MAX_RELEASE_CATALOG_CACHE_ENTRY_BYTES: number;
|
|
4
|
-
export type ExpectedReleaseCatalogScope = {
|
|
5
|
-
readonly channelKey: string;
|
|
6
|
-
readonly platform: "ios" | "android";
|
|
7
|
-
} & ({
|
|
8
|
-
readonly strategy: "APP_VERSION";
|
|
9
|
-
readonly fingerprintHash?: never;
|
|
10
|
-
} | {
|
|
11
|
-
readonly strategy: "FINGERPRINT";
|
|
12
|
-
readonly fingerprintHash: string;
|
|
13
|
-
});
|
|
14
3
|
type FetchReleaseCatalogInput = {
|
|
15
4
|
readonly baseURL: string;
|
|
16
5
|
readonly expectedScope: ExpectedReleaseCatalogScope;
|
|
@@ -18,8 +7,11 @@ type FetchReleaseCatalogInput = {
|
|
|
18
7
|
readonly requestTimeout?: number;
|
|
19
8
|
readonly url: string;
|
|
20
9
|
};
|
|
21
|
-
export declare const hasExpectedReleaseCatalogScope: (catalog: ReleaseCatalog, expected: ExpectedReleaseCatalogScope) => boolean;
|
|
22
10
|
export declare const createReleaseCatalogCachePartition: (input: Pick<FetchReleaseCatalogInput, "baseURL" | "requestHeaders" | "url">) => string;
|
|
23
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Fetches a scope's catalog, or null when the server answers that the scope
|
|
13
|
+
* has none (a 404 with `x-hot-updater-catalog: none`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const fetchReleaseCatalogWithCache: (input: FetchReleaseCatalogInput) => Promise<ReleaseCatalog | null>;
|
|
24
16
|
export {};
|
|
25
17
|
//# sourceMappingURL=releaseCatalogCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releaseCatalogCache.d.ts","sourceRoot":"","sources":["../../../src/releaseCatalogCache.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"releaseCatalogCache.d.ts","sourceRoot":"","sources":["../../../src/releaseCatalogCache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,2BAA2B,EAIhC,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAM/B,eAAO,MAAM,qCAAqC,QACG,CAAC;AAiCtD,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,2BAA2B,CAAC;IACpD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,CAAC;AAqDF,eAAO,MAAM,kCAAkC,UACtC,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,gBAAgB,GAAG,KAAK,CAAC,KAC1E,MAMC,CAAC;AA8FL;;;GAGG;AACH,eAAO,MAAM,4BAA4B,UAChC,wBAAwB,KAC9B,OAAO,CAAC,cAAc,GAAG,IAAI,CAa/B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HOT_UPDATER_SDK_VERSION = "1.0.0-rc.
|
|
1
|
+
export declare const HOT_UPDATER_SDK_VERSION = "1.0.0-rc.22";
|
|
2
2
|
//# sourceMappingURL=sdkVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkVersion.d.ts","sourceRoot":"","sources":["../../../src/sdkVersion.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"sdkVersion.d.ts","sourceRoot":"","sources":["../../../src/sdkVersion.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,gBAAgB,CAAC"}
|
|
@@ -1,46 +1,20 @@
|
|
|
1
1
|
import type { TurboModule } from "react-native";
|
|
2
2
|
import type { UnsafeObject } from "react-native/Libraries/Types/CodegenTypes";
|
|
3
|
-
export interface ChangedAsset {
|
|
4
|
-
file?: {
|
|
5
|
-
compression?: "br" | null;
|
|
6
|
-
url: string;
|
|
7
|
-
} | null;
|
|
8
|
-
fileHash: string;
|
|
9
|
-
patch?: {
|
|
10
|
-
algorithm: "bsdiff";
|
|
11
|
-
baseBundleId: string;
|
|
12
|
-
baseFileHash: string;
|
|
13
|
-
patchFileHash: string;
|
|
14
|
-
patchUrl: string;
|
|
15
|
-
} | null;
|
|
16
|
-
}
|
|
17
3
|
export interface UpdateBundleParams {
|
|
18
4
|
bundleId: string;
|
|
19
5
|
channel?: string;
|
|
20
|
-
fileUrl: string | null;
|
|
21
|
-
/**
|
|
22
|
-
* File hash for integrity/signature verification.
|
|
23
|
-
*
|
|
24
|
-
* Format depends on signing configuration:
|
|
25
|
-
* - Signed: `sig:<base64_signature>` - Native will verify signature (and implicitly hash)
|
|
26
|
-
* - Unsigned: `<hex_hash>` - Native will verify SHA256 hash only
|
|
27
|
-
*
|
|
28
|
-
* Native determines verification mode by checking for "sig:" prefix.
|
|
29
|
-
*/
|
|
30
|
-
fileHash: string | null;
|
|
31
6
|
/**
|
|
32
|
-
*
|
|
7
|
+
* Signed manifest URL for installation.
|
|
33
8
|
*/
|
|
34
|
-
manifestUrl
|
|
9
|
+
manifestUrl: string;
|
|
35
10
|
/**
|
|
36
11
|
* File hash/signature for the manifest file itself.
|
|
37
12
|
*/
|
|
38
|
-
manifestFileHash
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
changedAssets?: UnsafeObject | null;
|
|
13
|
+
manifestFileHash: string;
|
|
14
|
+
/** Optional tar.br URL; integrity and sizes come from the verified manifest. */
|
|
15
|
+
archiveUrl?: string | null;
|
|
16
|
+
/** Full protocol v1 target file descriptor map. */
|
|
17
|
+
assets: UnsafeObject;
|
|
44
18
|
/** Full Release Catalog selection receipt committed with the staged Bundle. */
|
|
45
19
|
selection?: UnsafeObject | null;
|
|
46
20
|
}
|
|
@@ -56,18 +30,21 @@ export interface Spec extends TurboModule {
|
|
|
56
30
|
* Downloads and applies a bundle update.
|
|
57
31
|
*
|
|
58
32
|
* @param params - Update bundle parameters
|
|
59
|
-
* @returns Promise that resolves to
|
|
33
|
+
* @returns Promise that resolves, once the bundle is staged, to how it
|
|
34
|
+
* arrived: `{ delivery, patchFallback }`. `delivery` is "patch" when a
|
|
35
|
+
* bsdiff patch produced a file, "manifest" when only changed files were
|
|
36
|
+
* downloaded, or "archive" for the full archive; `patchFallback` is true
|
|
37
|
+
* when a patch was tried but the file or archive was downloaded instead.
|
|
60
38
|
* @throws {HotUpdaterErrorCode} Rejects with one of the following error codes:
|
|
61
39
|
*
|
|
62
40
|
* Parameter validation:
|
|
63
41
|
* - MISSING_BUNDLE_ID: Missing or empty bundleId
|
|
64
|
-
* - INVALID_FILE_URL: Invalid
|
|
42
|
+
* - INVALID_FILE_URL: Invalid manifest or asset URL provided
|
|
65
43
|
*
|
|
66
44
|
* Bundle storage:
|
|
67
45
|
* - DIRECTORY_CREATION_FAILED: Failed to create bundle directory
|
|
68
46
|
* - DOWNLOAD_FAILED: Failed to download bundle
|
|
69
47
|
* - INCOMPLETE_DOWNLOAD: Download incomplete (size mismatch)
|
|
70
|
-
* - EXTRACTION_FORMAT_ERROR: Invalid or corrupted archive format
|
|
71
48
|
* - INVALID_BUNDLE: Bundle missing required platform files
|
|
72
49
|
* - INSUFFICIENT_DISK_SPACE: Insufficient disk space
|
|
73
50
|
* - MOVE_OPERATION_FAILED: Failed to move bundle files
|
|
@@ -82,8 +59,20 @@ export interface Spec extends TurboModule {
|
|
|
82
59
|
*
|
|
83
60
|
* Note: iOS normalizes rare signature/storage errors to SIGNATURE_VERIFICATION_FAILED
|
|
84
61
|
* or UNKNOWN_ERROR to keep the JS error surface small.
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
*
|
|
63
|
+
* A rejection from the download or install also carries `userInfo`
|
|
64
|
+
* `{ stage, reason, resource?, httpStatus?, transport?, originCode? }`:
|
|
65
|
+
* `stage` is "download" (transfer and verification) or "install" (patch,
|
|
66
|
+
* extract, move into place); `reason` is one of "network", "http",
|
|
67
|
+
* "invalid_response", "hash_mismatch", "signature", "patch", "extract",
|
|
68
|
+
* "storage", or "unknown"; `resource` is what was being fetched or
|
|
69
|
+
* applied: "manifest", "file", "patch", or "archive". `httpStatus` is
|
|
70
|
+
* present when `reason` is "http", with `originCode`, the storage
|
|
71
|
+
* origin's XML error `<Code>` when the body names one. `transport` is
|
|
72
|
+
* present when no response arrived: "timeout", "dns", "tls",
|
|
73
|
+
* "connection", "offline", or "cancelled".
|
|
74
|
+
*/
|
|
75
|
+
updateBundle(params: UpdateBundleParams): Promise<UnsafeObject>;
|
|
87
76
|
/** Accepts and durably advances the catalog high-water for a scope. */
|
|
88
77
|
acceptReleaseCatalog(params: UnsafeObject): boolean;
|
|
89
78
|
/** Reads active/stable selection receipts and catalog high-water state. */
|
|
@@ -113,6 +102,13 @@ export interface Spec extends TurboModule {
|
|
|
113
102
|
toBundleId?: string;
|
|
114
103
|
updateStrategy?: "fingerprint" | "appVersion";
|
|
115
104
|
crashedBundleId?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Android 11+: why the app's previous main process exited, the
|
|
107
|
+
* `ApplicationExitInfo` reason without its `REASON_` prefix (for
|
|
108
|
+
* example "CRASH", "ANR", "LOW_MEMORY", "USER_REQUESTED"), read once
|
|
109
|
+
* when the process starts. Absent on iOS and older Android.
|
|
110
|
+
*/
|
|
111
|
+
previousProcessExit?: string;
|
|
116
112
|
};
|
|
117
113
|
/**
|
|
118
114
|
* Gets the list of bundle IDs that have been marked as crashed.
|
|
@@ -170,21 +166,20 @@ export interface Spec extends TurboModule {
|
|
|
170
166
|
*/
|
|
171
167
|
getCohort: () => string;
|
|
172
168
|
/**
|
|
173
|
-
* Gets the
|
|
169
|
+
* Gets the install id: a random id native creates once per app
|
|
170
|
+
* installation and keeps out of device backups.
|
|
174
171
|
*/
|
|
175
172
|
getInstallId: () => string;
|
|
176
173
|
/**
|
|
177
|
-
*
|
|
178
|
-
|
|
179
|
-
getUserId: () => string | null;
|
|
180
|
-
/**
|
|
181
|
-
* Gets the persisted nullable username associated with this installation.
|
|
174
|
+
* Reads a value from the SDK's persistent key-value store, which native
|
|
175
|
+
* keeps out of device backups. Returns null when the key has no value.
|
|
182
176
|
*/
|
|
183
|
-
|
|
177
|
+
getStorageItem: (key: string) => string | null;
|
|
184
178
|
/**
|
|
185
|
-
*
|
|
179
|
+
* Writes a value to the SDK's persistent key-value store; null removes the
|
|
180
|
+
* key.
|
|
186
181
|
*/
|
|
187
|
-
|
|
182
|
+
setStorageItem: (key: string, value: string | null) => void;
|
|
188
183
|
addListener(eventName: string): void;
|
|
189
184
|
removeListeners(count: number): void;
|
|
190
185
|
readonly getConstants: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeHotUpdater.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeHotUpdater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"NativeHotUpdater.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeHotUpdater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mDAAmD;IACnD,MAAM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@@
|
|
|
1
1
|
import type { HotUpdaterDiffProgressDetails } from "./native";
|
|
2
2
|
export type HotUpdaterState = {
|
|
3
3
|
progress: number;
|
|
4
|
-
downloadedBytes: number | undefined;
|
|
5
|
-
totalBytes: number | undefined;
|
|
6
4
|
isUpdateDownloaded: boolean;
|
|
7
|
-
artifactType: "
|
|
5
|
+
artifactType: "diff" | null;
|
|
8
6
|
details: HotUpdaterDiffProgressDetails | null;
|
|
9
7
|
};
|
|
10
8
|
export declare const hotUpdaterStore: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,6BAA6B,EAE9B,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,6BAA6B,EAE9B,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAAC;CAC/C,CAAC;AA+KF,eAAO,MAAM,eAAe;;yBApDE,OAAO,CAAC,eAAe,CAAC;0BAwCvB,MAAM,IAAI;CAYa,CAAC;AAEvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,GAAG,eAAe,aAC1C,CAAC,QAAQ,EAAE,eAAe,KAAK,CAAC,MAQ3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAgBpE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GACf,4BAA4B,CAS9B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { UpdateError, UpdateErrorResource, UpdateErrorStage } from "./clientPlugin";
|
|
2
|
+
import { HotUpdaterError } from "./error";
|
|
3
|
+
/**
|
|
4
|
+
* A response the SDK cannot use: a malformed or stale catalog, an artifact
|
|
5
|
+
* in another protocol, or an invalid URL.
|
|
6
|
+
*/
|
|
7
|
+
export declare class InvalidUpdateResponseError extends HotUpdaterError {
|
|
8
|
+
constructor(message: string, options?: {
|
|
9
|
+
cause?: unknown;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** A request the server answered with a status the SDK does not accept. */
|
|
13
|
+
export declare class UpdateHttpError extends HotUpdaterError {
|
|
14
|
+
readonly status: number;
|
|
15
|
+
constructor(status: number, statusText: string);
|
|
16
|
+
}
|
|
17
|
+
type Classification = Pick<UpdateError, "stage" | "reason" | "resource" | "httpStatus" | "originCode" | "transport">;
|
|
18
|
+
/**
|
|
19
|
+
* Where and why an update failed, or null when the error is not an update
|
|
20
|
+
* failure. Native rejections carry their own classification; an error the
|
|
21
|
+
* SDK's JavaScript raised happened in `stage`, fetching `resource` when one
|
|
22
|
+
* is given.
|
|
23
|
+
*/
|
|
24
|
+
export declare const classifyUpdateError: (error: unknown, stage: UpdateErrorStage, resource?: UpdateErrorResource) => Classification | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=updateError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateError.d.ts","sourceRoot":"","sources":["../../../src/updateError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAEX,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,eAAe;IAC7D,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAIzD;CACF;AAED,2EAA2E;AAC3E,qBAAa,eAAgB,SAAQ,eAAe;IAEhD,QAAQ,CAAC,MAAM,EAAE,MAAM;IADzB,YACW,MAAM,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAMnB;CACF;AAiCD,KAAK,cAAc,GAAG,IAAI,CACxB,WAAW,EACX,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,CAC5E,CAAC;AAsCF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UACvB,OAAO,SACP,gBAAgB,aACZ,mBAAmB,KAC7B,cAAc,GAAG,IAoCnB,CAAC"}
|