@hot-updater/react-native 0.23.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/android/src/main/java/com/hotupdater/BundleFileStorageService.kt +393 -49
  2. package/android/src/main/java/com/hotupdater/BundleMetadata.kt +204 -0
  3. package/android/src/main/java/com/hotupdater/HotUpdater.kt +48 -36
  4. package/android/src/main/java/com/hotupdater/HotUpdaterException.kt +134 -0
  5. package/android/src/main/java/com/hotupdater/HotUpdaterImpl.kt +168 -95
  6. package/android/src/main/java/com/hotupdater/OkHttpDownloadService.kt +15 -3
  7. package/android/src/main/java/com/hotupdater/SignatureVerifier.kt +17 -12
  8. package/android/src/newarch/HotUpdaterModule.kt +88 -23
  9. package/android/src/oldarch/HotUpdaterModule.kt +89 -22
  10. package/android/src/oldarch/HotUpdaterSpec.kt +6 -0
  11. package/ios/HotUpdater/Internal/BundleFileStorageService.swift +401 -77
  12. package/ios/HotUpdater/Internal/BundleMetadata.swift +177 -0
  13. package/ios/HotUpdater/Internal/HotUpdater.mm +213 -47
  14. package/ios/HotUpdater/Internal/HotUpdaterImpl.swift +96 -25
  15. package/ios/HotUpdater/Internal/SignatureVerifier.swift +35 -29
  16. package/ios/HotUpdater/Internal/URLSessionDownloadService.swift +2 -2
  17. package/ios/HotUpdater/Public/HotUpdater.h +8 -2
  18. package/lib/commonjs/checkForUpdate.js +31 -28
  19. package/lib/commonjs/checkForUpdate.js.map +1 -1
  20. package/lib/commonjs/error.js +45 -1
  21. package/lib/commonjs/error.js.map +1 -1
  22. package/lib/commonjs/fetchUpdateInfo.js +7 -45
  23. package/lib/commonjs/fetchUpdateInfo.js.map +1 -1
  24. package/lib/commonjs/index.js +237 -208
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/native.js +103 -3
  27. package/lib/commonjs/native.js.map +1 -1
  28. package/lib/commonjs/specs/NativeHotUpdater.js.map +1 -1
  29. package/lib/commonjs/wrap.js +39 -1
  30. package/lib/commonjs/wrap.js.map +1 -1
  31. package/lib/module/checkForUpdate.js +32 -26
  32. package/lib/module/checkForUpdate.js.map +1 -1
  33. package/lib/module/error.js +45 -0
  34. package/lib/module/error.js.map +1 -1
  35. package/lib/module/fetchUpdateInfo.js +7 -45
  36. package/lib/module/fetchUpdateInfo.js.map +1 -1
  37. package/lib/module/index.js +238 -203
  38. package/lib/module/index.js.map +1 -1
  39. package/lib/module/native.js +87 -2
  40. package/lib/module/native.js.map +1 -1
  41. package/lib/module/specs/NativeHotUpdater.js.map +1 -1
  42. package/lib/module/wrap.js +40 -2
  43. package/lib/module/wrap.js.map +1 -1
  44. package/lib/typescript/commonjs/checkForUpdate.d.ts +11 -13
  45. package/lib/typescript/commonjs/checkForUpdate.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/error.d.ts +120 -0
  47. package/lib/typescript/commonjs/error.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/fetchUpdateInfo.d.ts +3 -5
  49. package/lib/typescript/commonjs/fetchUpdateInfo.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/index.d.ts +35 -41
  51. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/native.d.ts +58 -2
  53. package/lib/typescript/commonjs/native.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts +62 -0
  55. package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/wrap.d.ts +76 -5
  57. package/lib/typescript/commonjs/wrap.d.ts.map +1 -1
  58. package/lib/typescript/module/checkForUpdate.d.ts +11 -13
  59. package/lib/typescript/module/checkForUpdate.d.ts.map +1 -1
  60. package/lib/typescript/module/error.d.ts +120 -0
  61. package/lib/typescript/module/error.d.ts.map +1 -1
  62. package/lib/typescript/module/fetchUpdateInfo.d.ts +3 -5
  63. package/lib/typescript/module/fetchUpdateInfo.d.ts.map +1 -1
  64. package/lib/typescript/module/index.d.ts +35 -41
  65. package/lib/typescript/module/index.d.ts.map +1 -1
  66. package/lib/typescript/module/native.d.ts +58 -2
  67. package/lib/typescript/module/native.d.ts.map +1 -1
  68. package/lib/typescript/module/specs/NativeHotUpdater.d.ts +62 -0
  69. package/lib/typescript/module/specs/NativeHotUpdater.d.ts.map +1 -1
  70. package/lib/typescript/module/wrap.d.ts +76 -5
  71. package/lib/typescript/module/wrap.d.ts.map +1 -1
  72. package/package.json +7 -7
  73. package/plugin/build/withHotUpdater.js +3 -3
  74. package/src/checkForUpdate.ts +51 -40
  75. package/src/error.ts +153 -0
  76. package/src/fetchUpdateInfo.ts +10 -58
  77. package/src/index.ts +283 -206
  78. package/src/native.ts +88 -2
  79. package/src/specs/NativeHotUpdater.ts +63 -0
  80. package/src/wrap.tsx +131 -9
  81. package/android/src/main/java/com/hotupdater/HotUpdaterFactory.kt +0 -52
  82. package/ios/HotUpdater/Internal/HotUpdaterFactory.swift +0 -24
  83. package/lib/commonjs/runUpdateProcess.js +0 -69
  84. package/lib/commonjs/runUpdateProcess.js.map +0 -1
  85. package/lib/module/runUpdateProcess.js +0 -64
  86. package/lib/module/runUpdateProcess.js.map +0 -1
  87. package/lib/typescript/commonjs/runUpdateProcess.d.ts +0 -49
  88. package/lib/typescript/commonjs/runUpdateProcess.d.ts.map +0 -1
  89. package/lib/typescript/module/runUpdateProcess.d.ts +0 -49
  90. package/lib/typescript/module/runUpdateProcess.d.ts.map +0 -1
  91. package/src/runUpdateProcess.ts +0 -80
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  HotUpdater: true,
8
- getUpdateSource: true,
9
8
  extractSignatureFailure: true,
10
9
  isSignatureVerificationError: true
11
10
  };
@@ -16,12 +15,6 @@ Object.defineProperty(exports, "extractSignatureFailure", {
16
15
  return _types.extractSignatureFailure;
17
16
  }
18
17
  });
19
- Object.defineProperty(exports, "getUpdateSource", {
20
- enumerable: true,
21
- get: function () {
22
- return _checkForUpdate.getUpdateSource;
23
- }
24
- });
25
18
  Object.defineProperty(exports, "isSignatureVerificationError", {
26
19
  enumerable: true,
27
20
  get: function () {
@@ -30,7 +23,6 @@ Object.defineProperty(exports, "isSignatureVerificationError", {
30
23
  });
31
24
  var _checkForUpdate = require("./checkForUpdate.js");
32
25
  var _native = require("./native.js");
33
- var _runUpdateProcess = require("./runUpdateProcess.js");
34
26
  var _store = require("./store.js");
35
27
  Object.keys(_store).forEach(function (key) {
36
28
  if (key === "default" || key === "__esModule") return;
@@ -52,204 +44,241 @@ var _types = require("./types.js");
52
44
  progress
53
45
  });
54
46
  });
55
- const HotUpdater = exports.HotUpdater = {
56
- /**
57
- * `HotUpdater.wrap` checks for updates at the entry point, and if there is a bundle to update, it downloads the bundle and applies the update strategy.
58
- *
59
- * @param {object} options - Configuration options
60
- * @param {string} options.source - Update server URL
61
- * @param {object} [options.requestHeaders] - Request headers
62
- * @param {React.ComponentType} [options.fallbackComponent] - Component to display during updates
63
- * @param {boolean} [options.reloadOnForceUpdate=true] - Whether to automatically reload the app on force updates
64
- * @param {Function} [options.onUpdateProcessCompleted] - Callback after update process completes
65
- * @param {Function} [options.onProgress] - Callback to track bundle download progress
66
- * @returns {Function} Higher-order component that wraps the app component
67
- *
68
- * @example
69
- * ```tsx
70
- * export default HotUpdater.wrap({
71
- * source: "<your-update-server-url>",
72
- * requestHeaders: {
73
- * "Authorization": "Bearer <your-access-token>",
74
- * },
75
- * })(App);
76
- * ```
77
- */
78
- wrap: _wrap.wrap,
79
- /**
80
- * Reloads the app.
81
- */
82
- reload: _native.reload,
83
- /**
84
- * Returns whether an update has finished downloading in this app session.
85
- *
86
- * When it returns true, calling `HotUpdater.reload()` (or restarting the app)
87
- * will apply the downloaded update bundle.
88
- *
89
- * - Derived from `progress` reaching 1.0
90
- * - Resets to false when a new download starts (progress < 1)
91
- *
92
- * @returns {boolean} True if a downloaded update is ready to apply
93
- * @example
94
- * ```ts
95
- * if (HotUpdater.isUpdateDownloaded()) {
96
- * await HotUpdater.reload();
97
- * }
98
- * ```
99
- */
100
- isUpdateDownloaded: () => _store.hotUpdaterStore.getSnapshot().isUpdateDownloaded,
101
- /**
102
- * Fetches the current app version.
103
- */
104
- getAppVersion: _native.getAppVersion,
105
- /**
106
- * Fetches the current bundle ID of the app.
107
- */
108
- getBundleId: _native.getBundleId,
109
- /**
110
- * Retrieves the initial bundle ID based on the build time of the native app.
111
- */
112
- getMinBundleId: _native.getMinBundleId,
113
- /**
114
- * Fetches the current channel of the app.
115
- *
116
- * If no channel is specified, the app is assigned to the 'production' channel.
117
- *
118
- * @returns {string} The current release channel of the app
119
- * @default "production"
120
- * @example
121
- * ```ts
122
- * const channel = HotUpdater.getChannel();
123
- * console.log(`Current channel: ${channel}`);
124
- * ```
125
- */
126
- getChannel: _native.getChannel,
127
- /**
128
- * Adds a listener to HotUpdater events.
129
- *
130
- * @param {keyof HotUpdaterEvent} eventName - The name of the event to listen for
131
- * @param {(event: HotUpdaterEvent[T]) => void} listener - The callback function to handle the event
132
- * @returns {() => void} A cleanup function that removes the event listener
133
- *
134
- * @example
135
- * ```ts
136
- * const unsubscribe = HotUpdater.addListener("onProgress", ({ progress }) => {
137
- * console.log(`Update progress: ${progress * 100}%`);
138
- * });
139
- *
140
- * // Unsubscribe when no longer needed
141
- * unsubscribe();
142
- * ```
143
- */
144
- addListener: _native.addListener,
145
- /**
146
- * Manually checks for updates.
147
- *
148
- * @param {Object} config - Update check configuration
149
- * @param {string} config.source - Update server URL
150
- * @param {Record<string, string>} [config.requestHeaders] - Request headers
151
- *
152
- * @returns {Promise<UpdateInfo | null>} Update information or null if up to date
153
- *
154
- * @example
155
- * ```ts
156
- * const updateInfo = await HotUpdater.checkForUpdate({
157
- * source: "<your-update-server-url>",
158
- * requestHeaders: {
159
- * Authorization: "Bearer <your-access-token>",
160
- * },
161
- * });
162
- *
163
- * if (!updateInfo) {
164
- * console.log("App is up to date");
165
- * return;
166
- * }
167
- *
168
- * await HotUpdater.updateBundle(updateInfo.id, updateInfo.fileUrl);
169
- * if (updateInfo.shouldForceUpdate) {
170
- * await HotUpdater.reload();
171
- * }
172
- * ```
173
- */
174
- checkForUpdate: _checkForUpdate.checkForUpdate,
175
- /**
176
- * Manually checks and applies updates for the application.
177
- *
178
- * @param {RunUpdateProcessConfig} config - Update process configuration
179
- * @param {string} config.source - Update server URL
180
- * @param {Record<string, string>} [config.requestHeaders] - Request headers
181
- * @param {boolean} [config.reloadOnForceUpdate=false] - Whether to automatically reload on force update
182
- *
183
- * @example
184
- * ```ts
185
- * // Auto reload on force update
186
- * const result = await HotUpdater.runUpdateProcess({
187
- * source: "<your-update-server-url>",
188
- * requestHeaders: {
189
- * // Add necessary headers
190
- * },
191
- * reloadOnForceUpdate: true
192
- * });
193
- *
194
- * // Manually handle reload on force update
195
- * const result = await HotUpdater.runUpdateProcess({
196
- * source: "<your-update-server-url>",
197
- * reloadOnForceUpdate: false
198
- * });
199
- *
200
- * if(result.status !== "UP_TO_DATE" && result.shouldForceUpdate) {
201
- * await HotUpdater.reload();
202
- * }
203
- * ```
204
- *
205
- * @returns {Promise<RunUpdateProcessResponse>} The result of the update process
206
- */
207
- runUpdateProcess: _runUpdateProcess.runUpdateProcess,
208
- /**
209
- * Updates the bundle of the app.
210
- *
211
- * @param {UpdateBundleParams} params - Parameters object required for bundle update
212
- * @param {string} params.bundleId - The bundle ID of the app
213
- * @param {string|null} params.fileUrl - The URL of the zip file
214
- *
215
- * @returns {Promise<boolean>} Whether the update was successful
216
- *
217
- * @example
218
- * ```ts
219
- * const updateInfo = await HotUpdater.checkForUpdate({
220
- * source: "<your-update-server-url>",
221
- * requestHeaders: {
222
- * Authorization: "Bearer <your-access-token>",
223
- * },
224
- * });
225
- *
226
- * if (!updateInfo) {
227
- * return {
228
- * status: "UP_TO_DATE",
229
- * };
230
- * }
231
- *
232
- * await HotUpdater.updateBundle({
233
- * bundleId: updateInfo.id,
234
- * fileUrl: updateInfo.fileUrl
235
- * });
236
- * if (updateInfo.shouldForceUpdate) {
237
- * await HotUpdater.reload();
238
- * }
239
- * ```
240
- */
241
- updateBundle: _native.updateBundle,
242
- /**
243
- * Fetches the fingerprint of the app.
244
- *
245
- * @returns {string} The fingerprint of the app
246
- *
247
- * @example
248
- * ```ts
249
- * const fingerprint = HotUpdater.getFingerprintHash();
250
- * console.log(`Fingerprint: ${fingerprint}`);
251
- * ```
252
- */
253
- getFingerprintHash: _native.getFingerprintHash
254
- };
47
+
48
+ /**
49
+ * Creates a HotUpdater client instance with all update management methods.
50
+ * This function is called once on module initialization to create a singleton instance.
51
+ */
52
+ function createHotUpdaterClient() {
53
+ // Global configuration stored from wrap
54
+ const globalConfig = {
55
+ baseURL: null
56
+ };
57
+ function ensureGlobalBaseURL(methodName) {
58
+ if (globalConfig.baseURL === null) {
59
+ throw new Error(`[HotUpdater] ${methodName} requires HotUpdater.wrap() to be used.\n\n` + `To fix this issue, wrap your root component with HotUpdater.wrap():\n\n` + `Option 1: With automatic updates\n` + ` export default HotUpdater.wrap({\n` + ` baseURL: "<your-update-server-url>",\n` + ` updateStrategy: "appVersion",\n` + ` updateMode: "auto"\n` + ` })(App);\n\n` + `Option 2: Manual updates only (custom flow)\n` + ` export default HotUpdater.wrap({\n` + ` baseURL: "<your-update-server-url>",\n` + ` updateMode: "manual"\n` + ` })(App);\n\n` + `For more information, visit: https://hot-updater.dev/docs/react-native-api/wrap`);
60
+ }
61
+ return globalConfig.baseURL;
62
+ }
63
+ return {
64
+ /**
65
+ * `HotUpdater.wrap` checks for updates at the entry point, and if there is a bundle to update, it downloads the bundle and applies the update strategy.
66
+ *
67
+ * @param {object} options - Configuration options
68
+ * @param {string} options.source - Update server URL
69
+ * @param {object} [options.requestHeaders] - Request headers
70
+ * @param {React.ComponentType} [options.fallbackComponent] - Component to display during updates
71
+ * @param {boolean} [options.reloadOnForceUpdate=true] - Whether to automatically reload the app on force updates
72
+ * @param {Function} [options.onUpdateProcessCompleted] - Callback after update process completes
73
+ * @param {Function} [options.onProgress] - Callback to track bundle download progress
74
+ * @returns {Function} Higher-order component that wraps the app component
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * export default HotUpdater.wrap({
79
+ * baseURL: "<your-update-server-url>",
80
+ * updateStrategy: "appVersion",
81
+ * updateMode: "auto",
82
+ * requestHeaders: {
83
+ * "Authorization": "Bearer <your-access-token>",
84
+ * },
85
+ * })(App);
86
+ * ```
87
+ */
88
+ wrap: options => {
89
+ globalConfig.baseURL = options.baseURL;
90
+ globalConfig.requestHeaders = options.requestHeaders;
91
+ globalConfig.requestTimeout = options.requestTimeout;
92
+ return (0, _wrap.wrap)(options);
93
+ },
94
+ /**
95
+ * Reloads the app.
96
+ */
97
+ reload: _native.reload,
98
+ /**
99
+ * Returns whether an update has finished downloading in this app session.
100
+ *
101
+ * When it returns true, calling `HotUpdater.reload()` (or restarting the app)
102
+ * will apply the downloaded update bundle.
103
+ *
104
+ * - Derived from `progress` reaching 1.0
105
+ * - Resets to false when a new download starts (progress < 1)
106
+ *
107
+ * @returns {boolean} True if a downloaded update is ready to apply
108
+ * @example
109
+ * ```ts
110
+ * if (HotUpdater.isUpdateDownloaded()) {
111
+ * await HotUpdater.reload();
112
+ * }
113
+ * ```
114
+ */
115
+ isUpdateDownloaded: () => _store.hotUpdaterStore.getSnapshot().isUpdateDownloaded,
116
+ /**
117
+ * Fetches the current app version.
118
+ */
119
+ getAppVersion: _native.getAppVersion,
120
+ /**
121
+ * Fetches the current bundle ID of the app.
122
+ */
123
+ getBundleId: _native.getBundleId,
124
+ /**
125
+ * Retrieves the initial bundle ID based on the build time of the native app.
126
+ */
127
+ getMinBundleId: _native.getMinBundleId,
128
+ /**
129
+ * Fetches the current channel of the app.
130
+ *
131
+ * If no channel is specified, the app is assigned to the 'production' channel.
132
+ *
133
+ * @returns {string} The current release channel of the app
134
+ * @default "production"
135
+ * @example
136
+ * ```ts
137
+ * const channel = HotUpdater.getChannel();
138
+ * console.log(`Current channel: ${channel}`);
139
+ * ```
140
+ */
141
+ getChannel: _native.getChannel,
142
+ /**
143
+ * Adds a listener to HotUpdater events.
144
+ *
145
+ * @param {keyof HotUpdaterEvent} eventName - The name of the event to listen for
146
+ * @param {(event: HotUpdaterEvent[T]) => void} listener - The callback function to handle the event
147
+ * @returns {() => void} A cleanup function that removes the event listener
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * const unsubscribe = HotUpdater.addListener("onProgress", ({ progress }) => {
152
+ * console.log(`Update progress: ${progress * 100}%`);
153
+ * });
154
+ *
155
+ * // Unsubscribe when no longer needed
156
+ * unsubscribe();
157
+ * ```
158
+ */
159
+ addListener: _native.addListener,
160
+ /**
161
+ * Manually checks for updates.
162
+ *
163
+ * @param {Object} config - Update check configuration
164
+ * @param {string} config.source - Update server URL
165
+ * @param {Record<string, string>} [config.requestHeaders] - Request headers
166
+ *
167
+ * @returns {Promise<UpdateInfo | null>} Update information or null if up to date
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * const updateInfo = await HotUpdater.checkForUpdate({
172
+ * source: "<your-update-server-url>",
173
+ * requestHeaders: {
174
+ * Authorization: "Bearer <your-access-token>",
175
+ * },
176
+ * });
177
+ *
178
+ * if (!updateInfo) {
179
+ * console.log("App is up to date");
180
+ * return;
181
+ * }
182
+ *
183
+ * await HotUpdater.updateBundle(updateInfo.id, updateInfo.fileUrl);
184
+ * if (updateInfo.shouldForceUpdate) {
185
+ * await HotUpdater.reload();
186
+ * }
187
+ * ```
188
+ */
189
+ checkForUpdate: config => {
190
+ const baseURL = ensureGlobalBaseURL("checkForUpdate");
191
+
192
+ // Merge globalConfig with provided config
193
+ // baseURL is always from wrap (globalConfig)
194
+ // requestHeaders/requestTimeout from wrap are used as defaults, but can be overridden
195
+ const mergedConfig = {
196
+ ...config,
197
+ baseURL,
198
+ requestHeaders: {
199
+ ...globalConfig.requestHeaders,
200
+ ...config.requestHeaders
201
+ },
202
+ requestTimeout: config.requestTimeout ?? globalConfig.requestTimeout
203
+ };
204
+ return (0, _checkForUpdate.checkForUpdate)(mergedConfig);
205
+ },
206
+ /**
207
+ * Updates the bundle of the app.
208
+ *
209
+ * @param {UpdateBundleParams} params - Parameters object required for bundle update
210
+ * @param {string} params.bundleId - The bundle ID of the app
211
+ * @param {string|null} params.fileUrl - The URL of the zip file
212
+ *
213
+ * @returns {Promise<boolean>} Whether the update was successful
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * const updateInfo = await HotUpdater.checkForUpdate({
218
+ * source: "<your-update-server-url>",
219
+ * requestHeaders: {
220
+ * Authorization: "Bearer <your-access-token>",
221
+ * },
222
+ * });
223
+ *
224
+ * if (!updateInfo) {
225
+ * return {
226
+ * status: "UP_TO_DATE",
227
+ * };
228
+ * }
229
+ *
230
+ * await HotUpdater.updateBundle({
231
+ * bundleId: updateInfo.id,
232
+ * fileUrl: updateInfo.fileUrl
233
+ * });
234
+ * if (updateInfo.shouldForceUpdate) {
235
+ * await HotUpdater.reload();
236
+ * }
237
+ * ```
238
+ */
239
+ updateBundle: params => {
240
+ ensureGlobalBaseURL("updateBundle");
241
+ return (0, _native.updateBundle)(params);
242
+ },
243
+ /**
244
+ * Fetches the fingerprint of the app.
245
+ *
246
+ * @returns {string} The fingerprint of the app
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * const fingerprint = HotUpdater.getFingerprintHash();
251
+ * console.log(`Fingerprint: ${fingerprint}`);
252
+ * ```
253
+ */
254
+ getFingerprintHash: _native.getFingerprintHash,
255
+ /**
256
+ * Gets the list of bundle IDs that have been marked as crashed.
257
+ * These bundles will be rejected if attempted to install again.
258
+ *
259
+ * @returns {string[]} Array of crashed bundle IDs
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const crashedBundles = HotUpdater.getCrashHistory();
264
+ * console.log("Crashed bundles:", crashedBundles);
265
+ * ```
266
+ */
267
+ getCrashHistory: _native.getCrashHistory,
268
+ /**
269
+ * Clears the crashed bundle history, allowing previously crashed bundles
270
+ * to be installed again.
271
+ *
272
+ * @returns {boolean} true if clearing was successful
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * // Clear crash history to allow retrying a previously failed bundle
277
+ * HotUpdater.clearCrashHistory();
278
+ * ```
279
+ */
280
+ clearCrashHistory: _native.clearCrashHistory
281
+ };
282
+ }
283
+ const HotUpdater = exports.HotUpdater = createHotUpdaterClient();
255
284
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_checkForUpdate","require","_native","_runUpdateProcess","_store","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_wrap","_types","addListener","progress","hotUpdaterStore","setState","HotUpdater","wrap","reload","isUpdateDownloaded","getSnapshot","getAppVersion","getBundleId","getMinBundleId","getChannel","checkForUpdate","runUpdateProcess","updateBundle","getFingerprintHash"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAUA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAIAI,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAHA,IAAAS,KAAA,GAAAhB,OAAA;AAIA,IAAAiB,MAAA,GAAAjB,OAAA;AAOA,IAAAkB,mBAAW,EAAC,YAAY,EAAE,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC1CC,sBAAe,CAACC,QAAQ,CAAC;IACvBF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEK,MAAMG,UAAU,GAAAV,OAAA,CAAAU,UAAA,GAAG;EACxB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,IAAI,EAAJA,UAAI;EACJ;AACF;AACA;EACEC,MAAM,EAANA,cAAM;EACN;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,kBAAkB,EAAEA,CAAA,KAAML,sBAAe,CAACM,WAAW,CAAC,CAAC,CAACD,kBAAkB;EAC1E;AACF;AACA;EACEE,aAAa,EAAbA,qBAAa;EACb;AACF;AACA;EACEC,WAAW,EAAXA,mBAAW;EACX;AACF;AACA;EACEC,cAAc,EAAdA,sBAAc;EACd;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAVA,kBAAU;EACV;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEZ,WAAW,EAAXA,mBAAW;EACX;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEa,cAAc,EAAdA,8BAAc;EACd;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,gBAAgB,EAAhBA,kCAAgB;EAChB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,YAAY,EAAZA,oBAAY;EACZ;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,kBAAkB,EAAlBA;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_checkForUpdate","require","_native","_store","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_wrap","_types","addListener","progress","hotUpdaterStore","setState","createHotUpdaterClient","globalConfig","baseURL","ensureGlobalBaseURL","methodName","Error","wrap","options","requestHeaders","requestTimeout","reload","isUpdateDownloaded","getSnapshot","getAppVersion","getBundleId","getMinBundleId","getChannel","checkForUpdate","config","mergedConfig","updateBundle","params","getFingerprintHash","getCrashHistory","clearCrashHistory","HotUpdater"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAaA,IAAAE,MAAA,GAAAF,OAAA;AAIAG,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAHA,IAAAS,KAAA,GAAAf,OAAA;AAIA,IAAAgB,MAAA,GAAAhB,OAAA;AAOA,IAAAiB,mBAAW,EAAC,YAAY,EAAE,CAAC;EAAEC;AA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IC,WAAW,EAAXA,mBAAW;IAEX;AACJ;AACA;IACIC,cAAc,EAAdA,sBAAc;IAEd;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAVA,kBAAU;IAEV;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIpB,WAAW,EAAXA,mBAAW;IAEX;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIqB,cAAc,EAAGC,MAA6B,IAAK;MACjD,MAAMhB,OAAO,GAAGC,mBAAmB,CAAC,gBAAgB,CAAC;;MAErD;MACA;MACA;MACA,MAAMgB,YAA2C,GAAG;QAClD,GAAGD,MAAM;QACThB,OAAO;QACPM,cAAc,EAAE;UACd,GAAGP,YAAY,CAACO,cAAc;UAC9B,GAAGU,MAAM,CAACV;QACZ,CAAC;QACDC,cAAc,EAAES,MAAM,CAACT,cAAc,IAAIR,YAAY,CAACQ;MACxD,CAAC;MAED,OAAO,IAAAQ,8BAAc,EAACE,YAAY,CAAC;IACrC,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAGC,MAAoB,IAAK;MACtClB,mBAAmB,CAAC,cAAc,CAAC;MAEnC,OAAO,IAAAiB,oBAAY,EAACC,MAAM,CAAC;IAC7B,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAlBA,0BAAkB;IAElB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAfA,uBAAe;IAEf;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,iBAAiB,EAAjBA;EACF,CAAC;AACH;AAEO,MAAMC,UAAU,GAAAnC,OAAA,CAAAmC,UAAA,GAAGzB,sBAAsB,CAAC,CAAC","ignoreList":[]}
@@ -3,9 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.reload = exports.getMinBundleId = exports.getFingerprintHash = exports.getChannel = exports.getBundleId = exports.getAppVersion = exports.addListener = exports.HotUpdaterConstants = void 0;
6
+ exports.HotUpdaterConstants = void 0;
7
+ Object.defineProperty(exports, "HotUpdaterErrorCode", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _error.HotUpdaterErrorCode;
11
+ }
12
+ });
13
+ exports.getMinBundleId = exports.getFingerprintHash = exports.getCrashHistory = exports.getChannel = exports.getBundleId = exports.getAppVersion = exports.clearCrashHistory = exports.addListener = void 0;
14
+ Object.defineProperty(exports, "isHotUpdaterError", {
15
+ enumerable: true,
16
+ get: function () {
17
+ return _error.isHotUpdaterError;
18
+ }
19
+ });
20
+ exports.reload = exports.notifyAppReady = void 0;
7
21
  exports.updateBundle = updateBundle;
8
22
  var _reactNative = require("react-native");
23
+ var _error = require("./error.js");
9
24
  var _NativeHotUpdater = _interopRequireDefault(require("./specs/NativeHotUpdater.js"));
10
25
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
26
  const NIL_UUID = "00000000-0000-0000-0000-000000000000";
@@ -29,7 +44,8 @@ let lastInstalledBundleId = null;
29
44
  * Downloads files and applies them to the app.
30
45
  *
31
46
  * @param {UpdateParams} params - Parameters object required for bundle update
32
- * @returns {Promise<boolean>} Resolves with true if download was successful, otherwise rejects with an error.
47
+ * @returns {Promise<boolean>} Resolves with true if download was successful
48
+ * @throws {Error} Rejects with error.code from HotUpdaterErrorCode enum and error.message
33
49
  */
34
50
 
35
51
  /**
@@ -107,7 +123,7 @@ const getMinBundleId = () => {
107
123
  * Fetches the current bundle version id.
108
124
  *
109
125
  * @async
110
- * @returns {Promise<string>} Resolves with the current version id or null if not available.
126
+ * @returns {string} Resolves with the current version id or null if not available.
111
127
  */
112
128
  exports.getMinBundleId = getMinBundleId;
113
129
  const getBundleId = () => {
@@ -135,5 +151,89 @@ const getFingerprintHash = () => {
135
151
  const constants = _NativeHotUpdater.default.getConstants();
136
152
  return constants.FINGERPRINT_HASH;
137
153
  };
154
+
155
+ /**
156
+ * Result returned by notifyAppReady()
157
+ */
138
158
  exports.getFingerprintHash = getFingerprintHash;
159
+ /**
160
+ * Notifies the native side that the app has successfully started with the current bundle.
161
+ * If the bundle matches the staging bundle, it promotes to stable.
162
+ *
163
+ * This function is called automatically when the module loads.
164
+ *
165
+ * @returns {NotifyAppReadyResult} Bundle state information
166
+ * - `status: "PROMOTED"` - Staging bundle was promoted to stable (ACTIVE event)
167
+ * - `status: "RECOVERED"` - App recovered from crash, rollback occurred (ROLLBACK event)
168
+ * - `status: "STABLE"` - No changes, already stable
169
+ * - `crashedBundleId` - Present only when status is "RECOVERED"
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * const result = HotUpdater.notifyAppReady();
174
+ *
175
+ * switch (result.status) {
176
+ * case "PROMOTED":
177
+ * // Send ACTIVE analytics event
178
+ * analytics.track('bundle_active', { bundleId: HotUpdater.getBundleId() });
179
+ * break;
180
+ * case "RECOVERED":
181
+ * // Send ROLLBACK analytics event
182
+ * analytics.track('bundle_rollback', { crashedBundleId: result.crashedBundleId });
183
+ * break;
184
+ * case "STABLE":
185
+ * // No special action needed
186
+ * break;
187
+ * }
188
+ * ```
189
+ */
190
+ const notifyAppReady = () => {
191
+ const bundleId = getBundleId();
192
+ const result = _NativeHotUpdater.default.notifyAppReady({
193
+ bundleId
194
+ });
195
+ // Oldarch returns JSON string, newarch returns array
196
+ if (typeof result === "string") {
197
+ try {
198
+ return JSON.parse(result);
199
+ } catch {
200
+ return {
201
+ status: "STABLE"
202
+ };
203
+ }
204
+ }
205
+ return result;
206
+ };
207
+
208
+ /**
209
+ * Gets the list of bundle IDs that have been marked as crashed.
210
+ * These bundles will be rejected if attempted to install again.
211
+ *
212
+ * @returns {string[]} Array of crashed bundle IDs
213
+ */
214
+ exports.notifyAppReady = notifyAppReady;
215
+ const getCrashHistory = () => {
216
+ const result = _NativeHotUpdater.default.getCrashHistory();
217
+ // Oldarch returns JSON string, newarch returns array
218
+ if (typeof result === "string") {
219
+ try {
220
+ return JSON.parse(result);
221
+ } catch {
222
+ return [];
223
+ }
224
+ }
225
+ return result;
226
+ };
227
+
228
+ /**
229
+ * Clears the crashed bundle history, allowing previously crashed bundles
230
+ * to be installed again.
231
+ *
232
+ * @returns {boolean} true if clearing was successful
233
+ */
234
+ exports.getCrashHistory = getCrashHistory;
235
+ const clearCrashHistory = () => {
236
+ return _NativeHotUpdater.default.clearCrashHistory();
237
+ };
238
+ exports.clearCrashHistory = clearCrashHistory;
139
239
  //# sourceMappingURL=native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_NativeHotUpdater","_interopRequireDefault","e","__esModule","default","NIL_UUID","HotUpdaterConstants","exports","HOT_UPDATER_BUNDLE_ID","__HOT_UPDATER_BUNDLE_ID","addListener","eventName","listener","eventEmitter","NativeEventEmitter","HotUpdaterNative","subscription","remove","inflightUpdates","Map","lastInstalledBundleId","updateBundle","paramsOrBundleId","fileUrl","updateBundleId","bundleId","status","currentBundleId","getBundleId","localeCompare","Error","existing","get","targetFileUrl","targetFileHash","undefined","fileHash","promise","ok","delete","set","getAppVersion","constants","getConstants","APP_VERSION","reload","getMinBundleId","MIN_BUNDLE_ID","getChannel","CHANNEL","getFingerprintHash","FINGERPRINT_HASH"],"sourceRoot":"../../src","sources":["native.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEkC,SAAAE,uBAAAC,CAAA,WAA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,SAAS,GAAG3B,yBAAgB,CAAC4B,YAAY,CAAC,CAAC;EACjD,OAAOD,SAAS,CAACK,aAAa;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALAxC,OAAA,CAAAuC,cAAA,GAAAA,cAAA;AAMO,MAAMlB,WAAW,GAAGA,CAAA,KAAc;EACvC,OAAOtB,mBAAmB,CAACE,qBAAqB,KAAKH,QAAQ,GACzDyC,cAAc,CAAC,CAAC,GAChBxC,mBAAmB,CAACE,qBAAqB;AAC/C,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAD,OAAA,CAAAqB,WAAA,GAAAA,WAAA;AAKO,MAAMoB,UAAU,GAAGA,CAAA,KAAc;EACtC,MAAMN,SAAS,GAAG3B,yBAAgB,CAAC4B,YAAY,CAAC,CAAC;EACjD,OAAOD,SAAS,CAACO,OAAO;AAC1B,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA1C,OAAA,CAAAyC,UAAA,GAAAA,UAAA;AAKO,MAAME,kBAAkB,GAAGA,CAAA,KAAqB;EACrD,MAAMR,SAAS,GAAG3B,yBAAgB,CAAC4B,YAAY,CAAC,CAAC;EACjD,OAAOD,SAAS,CAACS,gBAAgB;AACnC,CAAC;AAAC5C,OAAA,CAAA2C,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_error","_NativeHotUpdater","_interopRequireDefault","e","__esModule","default","NIL_UUID","HotUpdaterConstants","exports","HOT_UPDATER_BUNDLE_ID","__HOT_UPDATER_BUNDLE_ID","addListener","eventName","listener","eventEmitter","NativeEventEmitter","HotUpdaterNative","subscription","remove","inflightUpdates","Map","lastInstalledBundleId","updateBundle","paramsOrBundleId","fileUrl","updateBundleId","bundleId","status","currentBundleId","getBundleId","localeCompare","Error","existing","get","targetFileUrl","targetFileHash","undefined","fileHash","promise","ok","delete","set","getAppVersion","constants","getConstants","APP_VERSION","reload","getMinBundleId","MIN_BUNDLE_ID","getChannel","CHANNEL","getFingerprintHash","FINGERPRINT_HASH","notifyAppReady","result","JSON","parse","getCrashHistory","clearCrashHistory"],"sourceRoot":"../../src","sources":["native.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEkC,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIlC,MAAMG,QAAQ,GAAG,sCAAsC;AAIhD,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EACjCE,qBAAqB,EAAEC,uBAAuB,IAAIJ;AACpD,CAAC;AAQM,MAAMK,WAAW,GAAGA,CACzBC,SAAY,EACZC,QAA6C,KAC1C;EACH,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACC,yBAAgB,CAAC;EAC7D,MAAMC,YAAY,GAAGH,YAAY,CAACH,WAAW,CAACC,SAAS,EAAEC,QAAQ,CAAC;EAElE,OAAO,MAAM;IACXI,YAAY,CAACC,MAAM,CAAC,CAAC;EACvB,CAAC;AACH,CAAC;AAACV,OAAA,CAAAG,WAAA,GAAAA,WAAA;AAMF;AACA,MAAMQ,eAAe,GAAG,IAAIC,GAAG,CAA2B,CAAC;AAC3D;AACA,IAAIC,qBAAoC,GAAG,IAAI;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAKO,eAAeC,YAAYA,CAChCC,gBAAuC,EACvCC,OAAuB,EACL;EAClB,MAAMC,cAAc,GAClB,OAAOF,gBAAgB,KAAK,QAAQ,GAChCA,gBAAgB,GAChBA,gBAAgB,CAACG,QAAQ;EAE/B,MAAMC,MAAM,GACV,OAAOJ,gBAAgB,KAAK,QAAQ,GAAG,QAAQ,GAAGA,gBAAgB,CAACI,MAAM;;EAE3E;EACA,IAAIA,MAAM,KAAK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