@hot-updater/react-native 1.0.0-rc.17 → 1.0.0-rc.21
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/lib/commonjs/checkForUpdate.js +7 -9
- package/lib/commonjs/checkForUpdate.js.map +1 -1
- package/lib/commonjs/clientPlugin.js +7 -43
- package/lib/commonjs/clientPlugin.js.map +1 -1
- package/lib/commonjs/httpClient.js +7 -9
- package/lib/commonjs/httpClient.js.map +1 -1
- package/lib/commonjs/index.js +10 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native.js +4 -4
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/pluginHost.js +26 -190
- package/lib/commonjs/pluginHost.js.map +1 -1
- package/lib/commonjs/releaseCatalogCache.js +7 -59
- package/lib/commonjs/releaseCatalogCache.js.map +1 -1
- package/lib/commonjs/sdkVersion.js +1 -1
- package/lib/module/checkForUpdate.js +1 -3
- package/lib/module/checkForUpdate.js.map +1 -1
- package/lib/module/clientPlugin.js +1 -41
- package/lib/module/clientPlugin.js.map +1 -1
- package/lib/module/httpClient.js +1 -3
- package/lib/module/httpClient.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native.js +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/pluginHost.js +22 -187
- package/lib/module/pluginHost.js.map +1 -1
- package/lib/module/releaseCatalogCache.js +3 -54
- package/lib/module/releaseCatalogCache.js.map +1 -1
- package/lib/module/sdkVersion.js +1 -1
- package/lib/typescript/commonjs/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/commonjs/clientPlugin.d.ts +1 -184
- package/lib/typescript/commonjs/clientPlugin.d.ts.map +1 -1
- package/lib/typescript/commonjs/httpClient.d.ts +1 -2
- package/lib/typescript/commonjs/httpClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +1 -1
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/pluginHost.d.ts +3 -28
- package/lib/typescript/commonjs/pluginHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts +1 -13
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/sdkVersion.d.ts +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/wrap.types.d.ts +2 -2
- package/lib/typescript/module/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/module/clientPlugin.d.ts +1 -184
- package/lib/typescript/module/clientPlugin.d.ts.map +1 -1
- package/lib/typescript/module/httpClient.d.ts +1 -2
- package/lib/typescript/module/httpClient.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +1 -1
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/pluginHost.d.ts +3 -28
- package/lib/typescript/module/pluginHost.d.ts.map +1 -1
- package/lib/typescript/module/releaseCatalogCache.d.ts +1 -13
- package/lib/typescript/module/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/module/sdkVersion.d.ts +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/wrap.types.d.ts +2 -2
- package/package.json +7 -16
- package/src/checkForUpdate.ts +4 -6
- package/src/clientPlugin.ts +17 -231
- package/src/httpClient.ts +4 -4
- package/src/index.ts +7 -0
- package/src/native.ts +1 -1
- package/src/pluginHost.ts +24 -241
- package/src/releaseCatalogCache.ts +7 -136
- package/src/sdkVersion.ts +1 -1
- package/src/types.ts +1 -1
- package/src/wrap.types.ts +2 -2
- package/android/src/test/java/com/hotupdater/BsdiffPatchTest.kt +0 -46
- package/android/src/test/java/com/hotupdater/BundleFileStorageServiceTest.kt +0 -2236
- package/android/src/test/java/com/hotupdater/HotUpdaterExceptionTest.kt +0 -220
- package/android/src/test/java/com/hotupdater/HotUpdaterImplTest.kt +0 -264
- package/android/src/test/java/com/hotupdater/HotUpdaterRecoveryStateTest.kt +0 -97
- package/android/src/test/java/com/hotupdater/InstallIdentityServiceTest.kt +0 -71
- package/android/src/test/java/com/hotupdater/KeyValueStorageServiceTest.kt +0 -106
- package/android/src/test/java/com/hotupdater/NativeConfigUtilsTest.kt +0 -20
- package/android/src/test/java/com/hotupdater/NoBackupContext.kt +0 -11
- package/android/src/test/java/com/hotupdater/OkHttpDownloadServiceTest.kt +0 -397
- package/android/src/test/java/com/hotupdater/PendingCrashRecoveryTest.kt +0 -44
- package/android/src/test/java/com/hotupdater/PreviousProcessExitTest.kt +0 -57
- 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/TarBrArchiveExtractorTest.kt +0 -206
- package/lib/commonjs/appReady.spec.js +0 -360
- package/lib/commonjs/appReady.spec.js.map +0 -1
- package/lib/commonjs/appReady.test-utils.js +0 -25
- package/lib/commonjs/appReady.test-utils.js.map +0 -1
- package/lib/commonjs/baseURL.js +0 -16
- package/lib/commonjs/baseURL.js.map +0 -1
- 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 -936
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/commonjs/entryImportGraph.spec.js +0 -50
- package/lib/commonjs/entryImportGraph.spec.js.map +0 -1
- package/lib/commonjs/httpClient.spec.js +0 -171
- package/lib/commonjs/httpClient.spec.js.map +0 -1
- package/lib/commonjs/index.spec.js +0 -395
- 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 -910
- package/lib/commonjs/native.spec.js.map +0 -1
- package/lib/commonjs/pluginHost.spec.js +0 -292
- package/lib/commonjs/pluginHost.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/eventId.js +0 -129
- package/lib/commonjs/plugins/insights/eventId.js.map +0 -1
- package/lib/commonjs/plugins/insights/eventId.spec.js +0 -47
- package/lib/commonjs/plugins/insights/eventId.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/index.js +0 -272
- package/lib/commonjs/plugins/insights/index.js.map +0 -1
- package/lib/commonjs/plugins/insights/insights.spec.js +0 -640
- package/lib/commonjs/plugins/insights/insights.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/sender.js +0 -128
- package/lib/commonjs/plugins/insights/sender.js.map +0 -1
- package/lib/commonjs/plugins/insights/sender.spec.js +0 -265
- package/lib/commonjs/plugins/insights/sender.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/state.js +0 -145
- package/lib/commonjs/plugins/insights/state.js.map +0 -1
- package/lib/commonjs/releaseCatalogCache.spec.js +0 -213
- 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 -84
- package/lib/commonjs/store.notification.spec.js.map +0 -1
- package/lib/commonjs/store.spec.js +0 -182
- package/lib/commonjs/store.spec.js.map +0 -1
- package/lib/commonjs/updateError.spec.js +0 -149
- package/lib/commonjs/updateError.spec.js.map +0 -1
- package/lib/commonjs/wrap.progress.spec.js +0 -195
- package/lib/commonjs/wrap.progress.spec.js.map +0 -1
- package/lib/commonjs/wrap.spec.js +0 -232
- package/lib/commonjs/wrap.spec.js.map +0 -1
- package/lib/module/appReady.spec.js +0 -359
- package/lib/module/appReady.spec.js.map +0 -1
- package/lib/module/appReady.test-utils.js +0 -19
- package/lib/module/appReady.test-utils.js.map +0 -1
- package/lib/module/baseURL.js +0 -11
- package/lib/module/baseURL.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 -935
- package/lib/module/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/module/entryImportGraph.spec.js +0 -50
- package/lib/module/entryImportGraph.spec.js.map +0 -1
- package/lib/module/httpClient.spec.js +0 -171
- package/lib/module/httpClient.spec.js.map +0 -1
- package/lib/module/index.spec.js +0 -394
- 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 -909
- package/lib/module/native.spec.js.map +0 -1
- package/lib/module/pluginHost.spec.js +0 -291
- package/lib/module/pluginHost.spec.js.map +0 -1
- package/lib/module/plugins/insights/eventId.js +0 -122
- package/lib/module/plugins/insights/eventId.js.map +0 -1
- package/lib/module/plugins/insights/eventId.spec.js +0 -47
- package/lib/module/plugins/insights/eventId.spec.js.map +0 -1
- package/lib/module/plugins/insights/index.js +0 -268
- package/lib/module/plugins/insights/index.js.map +0 -1
- package/lib/module/plugins/insights/insights.spec.js +0 -639
- package/lib/module/plugins/insights/insights.spec.js.map +0 -1
- package/lib/module/plugins/insights/sender.js +0 -123
- package/lib/module/plugins/insights/sender.js.map +0 -1
- package/lib/module/plugins/insights/sender.spec.js +0 -265
- package/lib/module/plugins/insights/sender.spec.js.map +0 -1
- package/lib/module/plugins/insights/state.js +0 -139
- package/lib/module/plugins/insights/state.js.map +0 -1
- package/lib/module/releaseCatalogCache.spec.js +0 -213
- 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 -85
- package/lib/module/store.notification.spec.js.map +0 -1
- package/lib/module/store.spec.js +0 -181
- package/lib/module/store.spec.js.map +0 -1
- package/lib/module/updateError.spec.js +0 -149
- package/lib/module/updateError.spec.js.map +0 -1
- package/lib/module/wrap.progress.spec.js +0 -196
- package/lib/module/wrap.progress.spec.js.map +0 -1
- package/lib/module/wrap.spec.js +0 -233
- package/lib/module/wrap.spec.js.map +0 -1
- package/lib/typescript/commonjs/appReady.test-utils.d.ts +0 -9
- package/lib/typescript/commonjs/appReady.test-utils.d.ts.map +0 -1
- package/lib/typescript/commonjs/baseURL.d.ts +0 -4
- package/lib/typescript/commonjs/baseURL.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/eventId.d.ts +0 -18
- package/lib/typescript/commonjs/plugins/insights/eventId.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/index.d.ts +0 -40
- package/lib/typescript/commonjs/plugins/insights/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/sender.d.ts +0 -74
- package/lib/typescript/commonjs/plugins/insights/sender.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/state.d.ts +0 -46
- package/lib/typescript/commonjs/plugins/insights/state.d.ts.map +0 -1
- package/lib/typescript/module/appReady.test-utils.d.ts +0 -9
- package/lib/typescript/module/appReady.test-utils.d.ts.map +0 -1
- package/lib/typescript/module/baseURL.d.ts +0 -4
- package/lib/typescript/module/baseURL.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/eventId.d.ts +0 -18
- package/lib/typescript/module/plugins/insights/eventId.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/index.d.ts +0 -40
- package/lib/typescript/module/plugins/insights/index.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/sender.d.ts +0 -74
- package/lib/typescript/module/plugins/insights/sender.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/state.d.ts +0 -46
- package/lib/typescript/module/plugins/insights/state.d.ts.map +0 -1
- package/plugins/insights/package.json +0 -8
- package/src/appReady.spec.ts +0 -393
- package/src/appReady.test-utils.ts +0 -31
- package/src/baseURL.ts +0 -15
- package/src/catalogCacheNative.spec.ts +0 -63
- package/src/checkForUpdate.releaseCatalog.spec.ts +0 -966
- package/src/entryImportGraph.spec.ts +0 -65
- package/src/httpClient.spec.ts +0 -216
- package/src/index.spec.ts +0 -434
- package/src/iosInterop.spec.ts +0 -30
- package/src/native.spec.ts +0 -978
- package/src/pluginHost.spec.ts +0 -297
- package/src/plugins/insights/eventId.spec.ts +0 -60
- package/src/plugins/insights/eventId.ts +0 -171
- package/src/plugins/insights/index.ts +0 -367
- package/src/plugins/insights/insights.spec.ts +0 -732
- package/src/plugins/insights/sender.spec.ts +0 -287
- package/src/plugins/insights/sender.ts +0 -221
- package/src/plugins/insights/state.ts +0 -184
- package/src/releaseCatalogCache.spec.ts +0 -304
- package/src/releaseCatalogCacheNativeContract.spec.ts +0 -80
- package/src/store.notification.spec.ts +0 -102
- package/src/store.spec.ts +0 -215
- package/src/updateError.spec.ts +0 -144
- package/src/wrap.progress.spec.ts +0 -232
- package/src/wrap.spec.ts +0 -262
|
@@ -1,185 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The client plugin contract. Built-in plugins, such as
|
|
3
|
-
* `@hot-updater/react-native/plugins/insights`, and third-party plugins use
|
|
4
|
-
* the same one, as server plugins do.
|
|
5
|
-
*/
|
|
6
|
-
export type UpdateStrategy = "fingerprint" | "appVersion";
|
|
7
|
-
/** How an update moves the app's selection. */
|
|
8
|
-
export type ReleaseTransitionKind = "INSTALL" | "ADOPT_RELEASE" | "USE_EMBEDDED" | "USE_BUILTIN";
|
|
9
|
-
/** The launch outcome native reports once per JavaScript runtime. */
|
|
10
|
-
export type AppReadyResult = ({
|
|
11
|
-
/** No update was applied or recovered at this launch. */
|
|
12
|
-
readonly status: "UNCHANGED";
|
|
13
|
-
readonly channel: string;
|
|
14
|
-
/** The running bundle. */
|
|
15
|
-
readonly bundleId: string;
|
|
16
|
-
/** The Release the running bundle was selected as, when known. */
|
|
17
|
-
readonly releaseId: string | null;
|
|
18
|
-
} | {
|
|
19
|
-
/**
|
|
20
|
-
* `UPDATE_APPLIED`: a staged update became active at this launch.
|
|
21
|
-
* `RECOVERED`: a failed update was rolled back to `toBundleId`.
|
|
22
|
-
*/
|
|
23
|
-
readonly status: "UPDATE_APPLIED" | "RECOVERED";
|
|
24
|
-
readonly channel: string;
|
|
25
|
-
readonly fromBundleId: string;
|
|
26
|
-
readonly fromReleaseId: string | null;
|
|
27
|
-
readonly toBundleId: string;
|
|
28
|
-
readonly toReleaseId: string | null;
|
|
29
|
-
readonly updateStrategy: UpdateStrategy;
|
|
30
|
-
}) & {
|
|
31
|
-
/**
|
|
32
|
-
* Android 11+: why the app's previous main process exited, the
|
|
33
|
-
* `ApplicationExitInfo` reason without its `REASON_` prefix, such as
|
|
34
|
-
* `CRASH`, `ANR`, `LOW_MEMORY`, or `USER_REQUESTED`. Null on iOS and on
|
|
35
|
-
* older Android. It tells a crash from the system or the user closing the
|
|
36
|
-
* app.
|
|
37
|
-
*/
|
|
38
|
-
readonly previousProcessExit: string | null;
|
|
39
|
-
};
|
|
40
|
-
/** What an update check found. */
|
|
41
|
-
export type UpdateCheckResult = {
|
|
42
|
-
/**
|
|
43
|
-
* The app keeps running its bundle: the check found nothing to
|
|
44
|
-
* install, or the app adopted a newer Release of the running bundle.
|
|
45
|
-
*/
|
|
46
|
-
readonly status: "UNCHANGED";
|
|
47
|
-
readonly channel: string;
|
|
48
|
-
readonly bundleId: string;
|
|
49
|
-
/** The Release the running bundle is selected as after the check. */
|
|
50
|
-
readonly releaseId: string | null;
|
|
51
|
-
/** The Release before the check; it differs after an adoption. */
|
|
52
|
-
readonly previousReleaseId: string | null;
|
|
53
|
-
} | {
|
|
54
|
-
/** The check found a Release to install, adopt, or roll back to. */
|
|
55
|
-
readonly status: "UPDATE_AVAILABLE";
|
|
56
|
-
readonly channel: string;
|
|
57
|
-
readonly fromBundleId: string;
|
|
58
|
-
readonly fromReleaseId: string | null;
|
|
59
|
-
readonly toBundleId: string;
|
|
60
|
-
readonly toReleaseId: string | null;
|
|
61
|
-
readonly transitionKind: ReleaseTransitionKind;
|
|
62
|
-
readonly updateStatus: "UPDATE" | "ROLLBACK";
|
|
63
|
-
readonly shouldForceUpdate: boolean;
|
|
64
|
-
readonly updateStrategy: UpdateStrategy;
|
|
65
|
-
};
|
|
66
|
-
/** A bundle the SDK downloaded, verified, and staged for the next launch. */
|
|
67
|
-
export interface BundleDownloadedInfo {
|
|
68
|
-
readonly channel: string;
|
|
69
|
-
readonly fromBundleId: string;
|
|
70
|
-
readonly fromReleaseId: string | null;
|
|
71
|
-
readonly toBundleId: string;
|
|
72
|
-
readonly toReleaseId: string | null;
|
|
73
|
-
readonly updateStrategy: UpdateStrategy;
|
|
74
|
-
/**
|
|
75
|
-
* How the bundle arrived: `patch` when a bsdiff patch produced a file,
|
|
76
|
-
* `manifest` when only the changed files were downloaded, `archive` for
|
|
77
|
-
* the full archive.
|
|
78
|
-
*/
|
|
79
|
-
readonly delivery: "patch" | "manifest" | "archive";
|
|
80
|
-
/** A patch was tried, but the file or the archive was downloaded instead. */
|
|
81
|
-
readonly patchFallback: boolean;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Where an update failed: `check` covers the Release catalog request,
|
|
85
|
-
* `download` the transfer and verification of the update's files, and
|
|
86
|
-
* `install` patching, extracting, and moving them into place.
|
|
87
|
-
*/
|
|
88
|
-
export type UpdateErrorStage = "check" | "download" | "install";
|
|
89
|
-
/** What the SDK was fetching or applying when an update failed. */
|
|
90
|
-
export type UpdateErrorResource = "catalog" | "artifact" | "manifest" | "file" | "patch" | "archive";
|
|
91
|
-
/** Why no response arrived, for a `network` failure. */
|
|
92
|
-
export type UpdateErrorTransport = "timeout" | "dns" | "tls" | "connection" | "offline" | "cancelled";
|
|
93
|
-
export type UpdateErrorReason = "network" | "http" | "invalid_response" | "hash_mismatch" | "signature" | "patch" | "extract" | "storage" | "unknown";
|
|
94
|
-
/** An update check, download, or install that failed. */
|
|
95
|
-
export interface UpdateError {
|
|
96
|
-
readonly stage: UpdateErrorStage;
|
|
97
|
-
readonly reason: UpdateErrorReason;
|
|
98
|
-
/** What was being fetched or applied, when the SDK knows. */
|
|
99
|
-
readonly resource?: UpdateErrorResource;
|
|
100
|
-
/** The response status when `reason` is `"http"`. */
|
|
101
|
-
readonly httpStatus?: number;
|
|
102
|
-
/**
|
|
103
|
-
* The storage origin's XML error `<Code>`, such as `AccessDenied`,
|
|
104
|
-
* `NoSuchKey`, or `ExpiredToken`, when an `http` failure's body names one.
|
|
105
|
-
* It tells an expired signed URL from a missing file.
|
|
106
|
-
*/
|
|
107
|
-
readonly originCode?: string;
|
|
108
|
-
/** Why no response arrived, for a `network` failure, when the SDK knows. */
|
|
109
|
-
readonly transport?: UpdateErrorTransport;
|
|
110
|
-
/** Android 11+: why the previous main process exited (see `AppReadyResult`). */
|
|
111
|
-
readonly previousProcessExit?: string;
|
|
112
|
-
/** The bundle the update targeted; absent for the check stage. */
|
|
113
|
-
readonly targetBundleId?: string;
|
|
114
|
-
/** The Release the update targeted, when it names one. */
|
|
115
|
-
readonly targetReleaseId?: string;
|
|
116
|
-
readonly channel: string;
|
|
117
|
-
/** The running bundle and the Release it was selected as. */
|
|
118
|
-
readonly bundleId: string;
|
|
119
|
-
readonly releaseId: string | null;
|
|
120
|
-
readonly updateStrategy: UpdateStrategy;
|
|
121
|
-
/** The error the SDK caught. */
|
|
122
|
-
readonly cause: unknown;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Lifecycle hooks a plugin returns from `setup`. Hooks observe: the SDK
|
|
126
|
-
* never waits for one and ignores what it returns, and a hook that throws or
|
|
127
|
-
* rejects is reported through `onError`, or a console warning without one,
|
|
128
|
-
* so a plugin can never delay or change an update.
|
|
129
|
-
*/
|
|
130
|
-
export interface HotUpdaterClientHooks {
|
|
131
|
-
/** Called once per JavaScript runtime, after native reports the launch. */
|
|
132
|
-
onAppReady?(result: AppReadyResult): void | Promise<void>;
|
|
133
|
-
/** Called after each update check, and after a Release adoption commits. */
|
|
134
|
-
onUpdateCheck?(result: UpdateCheckResult): void | Promise<void>;
|
|
135
|
-
/** Called after the SDK stages a downloaded bundle. */
|
|
136
|
-
onBundleDownloaded?(info: BundleDownloadedInfo): void | Promise<void>;
|
|
137
|
-
/** Called when an update check, download, or install fails. */
|
|
138
|
-
onUpdateError?(error: UpdateError): void | Promise<void>;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* A plugin's persistent key-value store. Native keeps it on the device,
|
|
142
|
-
* outside device backups, and the SDK scopes its keys to the plugin's id.
|
|
143
|
-
* It is meant for small values, up to 64 KB each.
|
|
144
|
-
*/
|
|
145
|
-
export interface HotUpdaterClientStorage {
|
|
146
|
-
get(key: string): string | null;
|
|
147
|
-
/** Writes the value; `null` removes the key. */
|
|
148
|
-
set(key: string, value: string | null): void;
|
|
149
|
-
}
|
|
150
|
-
export interface HotUpdaterClientContext {
|
|
151
|
-
/**
|
|
152
|
-
* Requests a path relative to the configured `baseURL`, with the SDK's
|
|
153
|
-
* `requestHeaders` and `requestTimeout` applied. Rejects with
|
|
154
|
-
* `Request timed out` when the timeout passes before a response arrives.
|
|
155
|
-
*/
|
|
156
|
-
fetch(path: string, init?: RequestInit): Promise<Response>;
|
|
157
|
-
/** A random id native creates once per installation. */
|
|
158
|
-
readonly installId: string;
|
|
159
|
-
readonly platform: "ios" | "android";
|
|
160
|
-
/** The native app version, or null when the native build has none. */
|
|
161
|
-
readonly appVersion: string | null;
|
|
162
|
-
readonly sdkVersion: string;
|
|
163
|
-
/** Whether this is a debug build (`__DEV__`). */
|
|
164
|
-
readonly isDebugBuild: boolean;
|
|
165
|
-
/** The bundle native reports as current. */
|
|
166
|
-
getBundleId(): string;
|
|
167
|
-
getChannel(): string;
|
|
168
|
-
getCohort(): string;
|
|
169
|
-
getFingerprintHash(): string | null;
|
|
170
|
-
readonly storage: HotUpdaterClientStorage;
|
|
171
|
-
/** The current time in milliseconds since the epoch. */
|
|
172
|
-
now(): number;
|
|
173
|
-
}
|
|
174
|
-
export interface HotUpdaterClientPlugin {
|
|
175
|
-
/** Unique among an app's plugins; two plugins with one id throw at init. */
|
|
176
|
-
readonly id: string;
|
|
177
|
-
/**
|
|
178
|
-
* Called once, when `HotUpdater.init` or `HotUpdater.wrap` first
|
|
179
|
-
* configures the runtime with this plugin.
|
|
180
|
-
*/
|
|
181
|
-
setup(context: HotUpdaterClientContext): HotUpdaterClientHooks | void;
|
|
182
|
-
}
|
|
183
|
-
/** Declares a client plugin; built-in and third-party plugins use the same contract. */
|
|
184
|
-
export declare const defineClientPlugin: <const P extends HotUpdaterClientPlugin>(plugin: P) => P;
|
|
1
|
+
export { defineClientPlugin, type AppReadyResult, type BundleDownloadedInfo, type HotUpdaterClientContext, type HotUpdaterClientHooks, type HotUpdaterClientPlugin, type HotUpdaterClientStorage, type ReleaseTransitionKind, type UpdateCheckResult, type UpdateError, type UpdateErrorReason, type UpdateErrorResource, type UpdateErrorStage, type UpdateErrorTransport, type UpdateStrategy, } from "@hot-updater/protocol";
|
|
185
2
|
//# sourceMappingURL=clientPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPlugin.d.ts","sourceRoot":"","sources":["../../../src/clientPlugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"clientPlugin.d.ts","sourceRoot":"","sources":["../../../src/clientPlugin.ts"],"names":[],"mappings":"AAAA,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,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,uBAAuB,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;
|
|
@@ -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"}
|
|
@@ -2,6 +2,7 @@ import { type CheckForUpdateOptions } from "./checkForUpdate";
|
|
|
2
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
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";
|
|
5
6
|
export type { CustomReloadHandler, HotUpdaterEvent, HotUpdaterProgressArtifactType, HotUpdaterProgressEvent, Manifest, ManifestAsset, NotifyAppReadyResult, ActiveUpdateState, ReloadBehavior, ReloadBehaviorSetting, } from "./native";
|
|
6
7
|
export * from "./store";
|
|
7
8
|
export { extractSignatureFailure, type HotUpdaterBaseURL, isSignatureVerificationError, type SignatureVerificationFailure, } from "./types";
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,M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;OAsBG;oBACa,iBAAiB;IAQjC;;;;;;;;;;;;;;OAcG;oBACa,qBAAqB,KAAG,IAAI;IAS5C;;OAEG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;OAEG;;IAGH,wDAAwD;;IAGxD;;;OAGG;;IAGH,wEAAwE;;IAGxE;;OAEG;;IAGH;;;;;;;;;;;;OAYG;;IAGH;;;;;;;;;;;OAWG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;6BACsB,qBAAqB;IAiB9C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;2BAC0B,YAAY;IAiDzC;;;;OAIG;;IAcH;;;;;;;;;;OAUG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;;;;;;;OAWG;;IAGH;;;;;;;;;;;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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EAIrB,K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O,MAAM,UAAU,QAAO,MAAM,GAAG,IAUtC,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"}
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type HookPayload<K extends HookName> = Parameters<NonNullable<HotUpdaterClientHooks[K]>>[0];
|
|
5
|
-
/** The init or wrap settings plugins see through their context. */
|
|
6
|
-
export interface PluginHostConfig {
|
|
7
|
-
readonly baseURL: HotUpdaterBaseURL;
|
|
8
|
-
readonly requestHeaders?: Record<string, string>;
|
|
9
|
-
readonly requestTimeout?: number;
|
|
10
|
-
readonly onError?: (error: unknown) => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Sets up the plugins of an init or wrap call. A plugin passed to an earlier
|
|
14
|
-
* call keeps its hooks, and a plugin left out stops receiving events.
|
|
15
|
-
*/
|
|
16
|
-
export declare const configurePlugins: (plugins: readonly HotUpdaterClientPlugin[] | undefined, nextConfig: PluginHostConfig) => void;
|
|
17
|
-
/** Whether any plugin listens to this hook, so callers build events only when one does. */
|
|
18
|
-
export declare const hasPluginHook: (name: HookName) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Builds a hook's event when a plugin listens. A failure to build it is
|
|
21
|
-
* reported, not thrown, since reporting never changes an update.
|
|
22
|
-
*/
|
|
23
|
-
export declare const buildPluginEvent: <K extends HookName>(name: K, createPayload: () => HookPayload<K> | null) => HookPayload<K> | null;
|
|
24
|
-
/** Calls a hook on every plugin that listens, without waiting for any. */
|
|
25
|
-
export declare const dispatchPluginHook: <K extends HookName>(name: K, payload: HookPayload<K>) => void;
|
|
26
|
-
/** Builds a hook's event when a plugin listens and calls the hook right away. */
|
|
27
|
-
export declare const emitPluginHook: <K extends HookName>(name: K, createPayload: () => HookPayload<K> | null) => void;
|
|
28
|
-
export {};
|
|
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;
|
|
29
4
|
//# sourceMappingURL=pluginHost.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginHost.d.ts","sourceRoot":"","sources":["../../../src/pluginHost.ts"],"names":[],"mappings":"
|
|
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,7 +7,6 @@ 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
|
/**
|
|
24
12
|
* Fetches a scope's catalog, or null when the server answers that the scope
|
|
@@ -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.21";
|
|
2
2
|
//# sourceMappingURL=sdkVersion.d.ts.map
|
|
@@ -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"}
|
|
@@ -21,8 +21,8 @@ export type HotUpdaterFallbackComponentProps = {
|
|
|
21
21
|
};
|
|
22
22
|
interface CommonHotUpdaterOptions {
|
|
23
23
|
/**
|
|
24
|
-
* Client plugins, such as `insights()` from
|
|
25
|
-
*
|
|
24
|
+
* Client plugins, such as `insights()` from `@hot-updater/react-native`.
|
|
25
|
+
* Each plugin's `setup` runs
|
|
26
26
|
* once, and its hooks observe launches, update checks, downloads, and
|
|
27
27
|
* update failures. Plugin ids must be unique.
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkForUpdate.d.ts","sourceRoot":"","sources":["../../../src/checkForUpdate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkForUpdate.d.ts","sourceRoot":"","sources":["../../../src/checkForUpdate.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAoBzD,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,cAAc,EAAE,YAAY,GAAG,aAAa,CAAC;IAE7C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAChD;;;OAGG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAyCD,wEAAwE;AACxE,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,aAAa,GAAG,YAAY,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,UACrB,OAAO,SACP,gBAAgB,YACb,mBAAmB,GAAG,SAAS,SAClC,gBAAgB,KACtB,IAqBF,CAAC;AAuRF,wBAAsB,cAAc,CAClC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA2EtC"}
|
|
@@ -1,185 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The client plugin contract. Built-in plugins, such as
|
|
3
|
-
* `@hot-updater/react-native/plugins/insights`, and third-party plugins use
|
|
4
|
-
* the same one, as server plugins do.
|
|
5
|
-
*/
|
|
6
|
-
export type UpdateStrategy = "fingerprint" | "appVersion";
|
|
7
|
-
/** How an update moves the app's selection. */
|
|
8
|
-
export type ReleaseTransitionKind = "INSTALL" | "ADOPT_RELEASE" | "USE_EMBEDDED" | "USE_BUILTIN";
|
|
9
|
-
/** The launch outcome native reports once per JavaScript runtime. */
|
|
10
|
-
export type AppReadyResult = ({
|
|
11
|
-
/** No update was applied or recovered at this launch. */
|
|
12
|
-
readonly status: "UNCHANGED";
|
|
13
|
-
readonly channel: string;
|
|
14
|
-
/** The running bundle. */
|
|
15
|
-
readonly bundleId: string;
|
|
16
|
-
/** The Release the running bundle was selected as, when known. */
|
|
17
|
-
readonly releaseId: string | null;
|
|
18
|
-
} | {
|
|
19
|
-
/**
|
|
20
|
-
* `UPDATE_APPLIED`: a staged update became active at this launch.
|
|
21
|
-
* `RECOVERED`: a failed update was rolled back to `toBundleId`.
|
|
22
|
-
*/
|
|
23
|
-
readonly status: "UPDATE_APPLIED" | "RECOVERED";
|
|
24
|
-
readonly channel: string;
|
|
25
|
-
readonly fromBundleId: string;
|
|
26
|
-
readonly fromReleaseId: string | null;
|
|
27
|
-
readonly toBundleId: string;
|
|
28
|
-
readonly toReleaseId: string | null;
|
|
29
|
-
readonly updateStrategy: UpdateStrategy;
|
|
30
|
-
}) & {
|
|
31
|
-
/**
|
|
32
|
-
* Android 11+: why the app's previous main process exited, the
|
|
33
|
-
* `ApplicationExitInfo` reason without its `REASON_` prefix, such as
|
|
34
|
-
* `CRASH`, `ANR`, `LOW_MEMORY`, or `USER_REQUESTED`. Null on iOS and on
|
|
35
|
-
* older Android. It tells a crash from the system or the user closing the
|
|
36
|
-
* app.
|
|
37
|
-
*/
|
|
38
|
-
readonly previousProcessExit: string | null;
|
|
39
|
-
};
|
|
40
|
-
/** What an update check found. */
|
|
41
|
-
export type UpdateCheckResult = {
|
|
42
|
-
/**
|
|
43
|
-
* The app keeps running its bundle: the check found nothing to
|
|
44
|
-
* install, or the app adopted a newer Release of the running bundle.
|
|
45
|
-
*/
|
|
46
|
-
readonly status: "UNCHANGED";
|
|
47
|
-
readonly channel: string;
|
|
48
|
-
readonly bundleId: string;
|
|
49
|
-
/** The Release the running bundle is selected as after the check. */
|
|
50
|
-
readonly releaseId: string | null;
|
|
51
|
-
/** The Release before the check; it differs after an adoption. */
|
|
52
|
-
readonly previousReleaseId: string | null;
|
|
53
|
-
} | {
|
|
54
|
-
/** The check found a Release to install, adopt, or roll back to. */
|
|
55
|
-
readonly status: "UPDATE_AVAILABLE";
|
|
56
|
-
readonly channel: string;
|
|
57
|
-
readonly fromBundleId: string;
|
|
58
|
-
readonly fromReleaseId: string | null;
|
|
59
|
-
readonly toBundleId: string;
|
|
60
|
-
readonly toReleaseId: string | null;
|
|
61
|
-
readonly transitionKind: ReleaseTransitionKind;
|
|
62
|
-
readonly updateStatus: "UPDATE" | "ROLLBACK";
|
|
63
|
-
readonly shouldForceUpdate: boolean;
|
|
64
|
-
readonly updateStrategy: UpdateStrategy;
|
|
65
|
-
};
|
|
66
|
-
/** A bundle the SDK downloaded, verified, and staged for the next launch. */
|
|
67
|
-
export interface BundleDownloadedInfo {
|
|
68
|
-
readonly channel: string;
|
|
69
|
-
readonly fromBundleId: string;
|
|
70
|
-
readonly fromReleaseId: string | null;
|
|
71
|
-
readonly toBundleId: string;
|
|
72
|
-
readonly toReleaseId: string | null;
|
|
73
|
-
readonly updateStrategy: UpdateStrategy;
|
|
74
|
-
/**
|
|
75
|
-
* How the bundle arrived: `patch` when a bsdiff patch produced a file,
|
|
76
|
-
* `manifest` when only the changed files were downloaded, `archive` for
|
|
77
|
-
* the full archive.
|
|
78
|
-
*/
|
|
79
|
-
readonly delivery: "patch" | "manifest" | "archive";
|
|
80
|
-
/** A patch was tried, but the file or the archive was downloaded instead. */
|
|
81
|
-
readonly patchFallback: boolean;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Where an update failed: `check` covers the Release catalog request,
|
|
85
|
-
* `download` the transfer and verification of the update's files, and
|
|
86
|
-
* `install` patching, extracting, and moving them into place.
|
|
87
|
-
*/
|
|
88
|
-
export type UpdateErrorStage = "check" | "download" | "install";
|
|
89
|
-
/** What the SDK was fetching or applying when an update failed. */
|
|
90
|
-
export type UpdateErrorResource = "catalog" | "artifact" | "manifest" | "file" | "patch" | "archive";
|
|
91
|
-
/** Why no response arrived, for a `network` failure. */
|
|
92
|
-
export type UpdateErrorTransport = "timeout" | "dns" | "tls" | "connection" | "offline" | "cancelled";
|
|
93
|
-
export type UpdateErrorReason = "network" | "http" | "invalid_response" | "hash_mismatch" | "signature" | "patch" | "extract" | "storage" | "unknown";
|
|
94
|
-
/** An update check, download, or install that failed. */
|
|
95
|
-
export interface UpdateError {
|
|
96
|
-
readonly stage: UpdateErrorStage;
|
|
97
|
-
readonly reason: UpdateErrorReason;
|
|
98
|
-
/** What was being fetched or applied, when the SDK knows. */
|
|
99
|
-
readonly resource?: UpdateErrorResource;
|
|
100
|
-
/** The response status when `reason` is `"http"`. */
|
|
101
|
-
readonly httpStatus?: number;
|
|
102
|
-
/**
|
|
103
|
-
* The storage origin's XML error `<Code>`, such as `AccessDenied`,
|
|
104
|
-
* `NoSuchKey`, or `ExpiredToken`, when an `http` failure's body names one.
|
|
105
|
-
* It tells an expired signed URL from a missing file.
|
|
106
|
-
*/
|
|
107
|
-
readonly originCode?: string;
|
|
108
|
-
/** Why no response arrived, for a `network` failure, when the SDK knows. */
|
|
109
|
-
readonly transport?: UpdateErrorTransport;
|
|
110
|
-
/** Android 11+: why the previous main process exited (see `AppReadyResult`). */
|
|
111
|
-
readonly previousProcessExit?: string;
|
|
112
|
-
/** The bundle the update targeted; absent for the check stage. */
|
|
113
|
-
readonly targetBundleId?: string;
|
|
114
|
-
/** The Release the update targeted, when it names one. */
|
|
115
|
-
readonly targetReleaseId?: string;
|
|
116
|
-
readonly channel: string;
|
|
117
|
-
/** The running bundle and the Release it was selected as. */
|
|
118
|
-
readonly bundleId: string;
|
|
119
|
-
readonly releaseId: string | null;
|
|
120
|
-
readonly updateStrategy: UpdateStrategy;
|
|
121
|
-
/** The error the SDK caught. */
|
|
122
|
-
readonly cause: unknown;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Lifecycle hooks a plugin returns from `setup`. Hooks observe: the SDK
|
|
126
|
-
* never waits for one and ignores what it returns, and a hook that throws or
|
|
127
|
-
* rejects is reported through `onError`, or a console warning without one,
|
|
128
|
-
* so a plugin can never delay or change an update.
|
|
129
|
-
*/
|
|
130
|
-
export interface HotUpdaterClientHooks {
|
|
131
|
-
/** Called once per JavaScript runtime, after native reports the launch. */
|
|
132
|
-
onAppReady?(result: AppReadyResult): void | Promise<void>;
|
|
133
|
-
/** Called after each update check, and after a Release adoption commits. */
|
|
134
|
-
onUpdateCheck?(result: UpdateCheckResult): void | Promise<void>;
|
|
135
|
-
/** Called after the SDK stages a downloaded bundle. */
|
|
136
|
-
onBundleDownloaded?(info: BundleDownloadedInfo): void | Promise<void>;
|
|
137
|
-
/** Called when an update check, download, or install fails. */
|
|
138
|
-
onUpdateError?(error: UpdateError): void | Promise<void>;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* A plugin's persistent key-value store. Native keeps it on the device,
|
|
142
|
-
* outside device backups, and the SDK scopes its keys to the plugin's id.
|
|
143
|
-
* It is meant for small values, up to 64 KB each.
|
|
144
|
-
*/
|
|
145
|
-
export interface HotUpdaterClientStorage {
|
|
146
|
-
get(key: string): string | null;
|
|
147
|
-
/** Writes the value; `null` removes the key. */
|
|
148
|
-
set(key: string, value: string | null): void;
|
|
149
|
-
}
|
|
150
|
-
export interface HotUpdaterClientContext {
|
|
151
|
-
/**
|
|
152
|
-
* Requests a path relative to the configured `baseURL`, with the SDK's
|
|
153
|
-
* `requestHeaders` and `requestTimeout` applied. Rejects with
|
|
154
|
-
* `Request timed out` when the timeout passes before a response arrives.
|
|
155
|
-
*/
|
|
156
|
-
fetch(path: string, init?: RequestInit): Promise<Response>;
|
|
157
|
-
/** A random id native creates once per installation. */
|
|
158
|
-
readonly installId: string;
|
|
159
|
-
readonly platform: "ios" | "android";
|
|
160
|
-
/** The native app version, or null when the native build has none. */
|
|
161
|
-
readonly appVersion: string | null;
|
|
162
|
-
readonly sdkVersion: string;
|
|
163
|
-
/** Whether this is a debug build (`__DEV__`). */
|
|
164
|
-
readonly isDebugBuild: boolean;
|
|
165
|
-
/** The bundle native reports as current. */
|
|
166
|
-
getBundleId(): string;
|
|
167
|
-
getChannel(): string;
|
|
168
|
-
getCohort(): string;
|
|
169
|
-
getFingerprintHash(): string | null;
|
|
170
|
-
readonly storage: HotUpdaterClientStorage;
|
|
171
|
-
/** The current time in milliseconds since the epoch. */
|
|
172
|
-
now(): number;
|
|
173
|
-
}
|
|
174
|
-
export interface HotUpdaterClientPlugin {
|
|
175
|
-
/** Unique among an app's plugins; two plugins with one id throw at init. */
|
|
176
|
-
readonly id: string;
|
|
177
|
-
/**
|
|
178
|
-
* Called once, when `HotUpdater.init` or `HotUpdater.wrap` first
|
|
179
|
-
* configures the runtime with this plugin.
|
|
180
|
-
*/
|
|
181
|
-
setup(context: HotUpdaterClientContext): HotUpdaterClientHooks | void;
|
|
182
|
-
}
|
|
183
|
-
/** Declares a client plugin; built-in and third-party plugins use the same contract. */
|
|
184
|
-
export declare const defineClientPlugin: <const P extends HotUpdaterClientPlugin>(plugin: P) => P;
|
|
1
|
+
export { defineClientPlugin, type AppReadyResult, type BundleDownloadedInfo, type HotUpdaterClientContext, type HotUpdaterClientHooks, type HotUpdaterClientPlugin, type HotUpdaterClientStorage, type ReleaseTransitionKind, type UpdateCheckResult, type UpdateError, type UpdateErrorReason, type UpdateErrorResource, type UpdateErrorStage, type UpdateErrorTransport, type UpdateStrategy, } from "@hot-updater/protocol";
|
|
185
2
|
//# sourceMappingURL=clientPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPlugin.d.ts","sourceRoot":"","sources":["../../../src/clientPlugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"clientPlugin.d.ts","sourceRoot":"","sources":["../../../src/clientPlugin.ts"],"names":[],"mappings":"AAAA,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,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,uBAAuB,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;
|
|
@@ -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"}
|
|
@@ -2,6 +2,7 @@ import { type CheckForUpdateOptions } from "./checkForUpdate";
|
|
|
2
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
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";
|
|
5
6
|
export type { CustomReloadHandler, HotUpdaterEvent, HotUpdaterProgressArtifactType, HotUpdaterProgressEvent, Manifest, ManifestAsset, NotifyAppReadyResult, ActiveUpdateState, ReloadBehavior, ReloadBehaviorSetting, } from "./native";
|
|
6
7
|
export * from "./store";
|
|
7
8
|
export { extractSignatureFailure, type HotUpdaterBaseURL, isSignatureVerificationError, type SignatureVerificationFailure, } from "./types";
|