@capawesome/capacitor-live-update 6.8.0 → 7.0.0-dev.2633ff2.1765953041

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 (54) hide show
  1. package/CapawesomeCapacitorLiveUpdate.podspec +3 -3
  2. package/Package.swift +32 -0
  3. package/README.md +438 -86
  4. package/android/build.gradle +12 -12
  5. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +754 -279
  6. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +29 -27
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +40 -7
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +210 -67
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +52 -3
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +11 -2
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +32 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/{results/GetBundleResult.java → events/NextBundleSetEvent.java} +9 -7
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetConfigOptions.java +19 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SyncOptions.java +4 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +8 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +27 -0
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
  18. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +27 -0
  19. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/IsSyncingResult.java +26 -0
  20. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
  21. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
  22. package/dist/docs.json +597 -102
  23. package/dist/esm/definitions.d.ts +338 -39
  24. package/dist/esm/definitions.js.map +1 -1
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/web.d.ts +9 -2
  28. package/dist/esm/web.js +21 -0
  29. package/dist/esm/web.js.map +1 -1
  30. package/dist/plugin.cjs.js +22 -3
  31. package/dist/plugin.cjs.js.map +1 -1
  32. package/dist/plugin.js +22 -3
  33. package/dist/plugin.js.map +1 -1
  34. package/ios/Plugin/Classes/Events/DownloadBundleProgressEvent.swift +25 -0
  35. package/ios/Plugin/Classes/{Results/GetBundleResult.swift → Events/NextBundleSetEvent.swift} +3 -3
  36. package/ios/Plugin/Classes/Options/SetConfigOptions.swift +14 -0
  37. package/ios/Plugin/Classes/Options/SyncOptions.swift +4 -0
  38. package/ios/Plugin/Classes/Results/{FetchLatestBundle.swift → FetchLatestBundleResult.swift} +6 -1
  39. package/ios/Plugin/Classes/Results/GetBlockedBundlesResult.swift +16 -0
  40. package/ios/Plugin/Classes/Results/GetConfigResult.swift +19 -0
  41. package/ios/Plugin/Classes/Results/GetDownloadedBundlesResult.swift +16 -0
  42. package/ios/Plugin/Classes/Results/IsSyncingResult.swift +16 -0
  43. package/ios/Plugin/Classes/Results/ReadyResult.swift +22 -0
  44. package/ios/Plugin/LiveUpdate.swift +365 -149
  45. package/ios/Plugin/LiveUpdateConfig.swift +4 -4
  46. package/ios/Plugin/LiveUpdateHttpClient.swift +10 -4
  47. package/ios/Plugin/LiveUpdatePlugin.swift +136 -34
  48. package/ios/Plugin/LiveUpdatePreferences.swift +54 -12
  49. package/ios/Plugin/Protocols/Api/GetLatestBundleResponse.swift +1 -0
  50. package/package.json +19 -20
  51. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetBundleOptions.java +0 -18
  52. package/ios/Plugin/Classes/Options/SetBundleOptions.swift +0 -14
  53. package/ios/Plugin/LiveUpdatePlugin.h +0 -10
  54. package/ios/Plugin/LiveUpdatePlugin.m +0 -27
@@ -1,8 +1,9 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
1
2
  declare module '@capacitor/cli' {
2
3
  interface PluginsConfig {
3
4
  LiveUpdate?: {
4
5
  /**
5
- * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud).
6
+ * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud/).
6
7
  *
7
8
  * This is **NOT** the same as the app identifier (e.g. `com.example.app`).
8
9
  * This is a unique identifier generated by Capawesome Cloud (e.g. `6e351b4f-69a7-415e-a057-4567df7ffe94`).
@@ -11,6 +12,21 @@ declare module '@capacitor/cli' {
11
12
  * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
12
13
  */
13
14
  appId?: string;
15
+ /**
16
+ * Whether or not to automatically block bundles that have been rolled back.
17
+ *
18
+ * When enabled, the plugin will automatically block bundles that caused a rollback
19
+ * (up to 100 bundles). When the limit is reached, the oldest blocked bundle is unblocked.
20
+ * Blocked bundles will be skipped in future sync operations.
21
+ *
22
+ * **Attention**: This option has no effect if `readyTimeout` is set to `0`.
23
+ *
24
+ * Only available on Android and iOS.
25
+ *
26
+ * @since 7.3.0
27
+ * @default false
28
+ */
29
+ autoBlockRolledBackBundles?: boolean;
14
30
  /**
15
31
  * Whether or not to automatically delete unused bundles.
16
32
  *
@@ -20,6 +36,21 @@ declare module '@capacitor/cli' {
20
36
  * @default false
21
37
  */
22
38
  autoDeleteBundles?: boolean;
39
+ /**
40
+ * The auto-update strategy for live updates.
41
+ *
42
+ * - `none`: Live updates will not be applied automatically.
43
+ * - `background`: Live updates will be automatically downloaded
44
+ * and applied in the background at app startup and when the app resumes
45
+ * (if the last check was more than 15 minutes ago).
46
+ *
47
+ * Only available on Android and iOS.
48
+ *
49
+ * @since 7.3.0
50
+ * @default 'none'
51
+ * @example 'background'
52
+ */
53
+ autoUpdateStrategy?: 'none' | 'background';
23
54
  /**
24
55
  * The default channel of the app.
25
56
  *
@@ -27,13 +58,6 @@ declare module '@capacitor/cli' {
27
58
  * @example 'production'
28
59
  */
29
60
  defaultChannel?: string;
30
- /**
31
- * Whether or not the plugin is enabled.
32
- *
33
- * @since 5.0.0
34
- * @default true
35
- */
36
- enabled?: boolean;
37
61
  /**
38
62
  * The timeout in milliseconds for HTTP requests.
39
63
  *
@@ -41,15 +65,6 @@ declare module '@capacitor/cli' {
41
65
  * @default 60000
42
66
  */
43
67
  httpTimeout?: number;
44
- /**
45
- * The location of the server to use when using [Capawesome Cloud](https://capawesome.io/cloud).
46
- *
47
- * @since 6.2.0
48
- * @default 'us'
49
- * @example 'eu'
50
- * @deprecated This option will be removed in the future.
51
- */
52
- location?: 'us' | 'eu';
53
68
  /**
54
69
  * The public key to verify the integrity of the bundle.
55
70
  *
@@ -60,23 +75,44 @@ declare module '@capacitor/cli' {
60
75
  */
61
76
  publicKey?: string;
62
77
  /**
63
- * The timeout in milliseconds to wait for the app to be ready before resetting to the default bundle.
78
+ * The timeout in milliseconds to wait for the app to be ready
79
+ * before resetting to the default bundle.
80
+ *
81
+ * It is strongly **recommended** to configure this option (e.g. `10000` ms)
82
+ * so that the plugin can roll back to the default bundle in case of problems.
83
+ * If configured, the plugin will wait for the app to call the `ready()`
84
+ * method before resetting to the default bundle.
85
+ *
86
+ * Set to `0` to disable the timeout.
64
87
  *
65
88
  * @since 5.0.0
66
- * @default 10000
89
+ * @default 0
90
+ * @example 10000
67
91
  */
68
92
  readyTimeout?: number;
69
93
  /**
70
- * Whether or not the app should be reset to the default bundle during an update.
94
+ * The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server **without** scheme or path.
71
95
  *
72
- * @since 5.0.0
73
- * @default true
96
+ * @since 7.0.0
97
+ * @default 'api.cloud.capawesome.io'
98
+ * @example 'api.cloud.capawesome.eu'
74
99
  */
75
- resetOnUpdate?: boolean;
100
+ serverDomain?: string;
76
101
  };
77
102
  }
78
103
  }
79
104
  export interface LiveUpdatePlugin {
105
+ /**
106
+ * Clear all blocked bundles from the blocked list.
107
+ *
108
+ * This removes all bundle identifiers that were automatically blocked
109
+ * due to rollbacks when `autoBlockRolledBackBundles` is enabled.
110
+ *
111
+ * Only available on Android and iOS.
112
+ *
113
+ * @since 7.4.0
114
+ */
115
+ clearBlockedBundles(): Promise<void>;
80
116
  /**
81
117
  * Delete a bundle from the app.
82
118
  *
@@ -102,20 +138,23 @@ export interface LiveUpdatePlugin {
102
138
  */
103
139
  fetchLatestBundle(options?: FetchLatestBundleOptions): Promise<FetchLatestBundleResult>;
104
140
  /**
105
- * Get the active bundle identifier.
141
+ * Get all blocked bundle identifiers.
142
+ *
143
+ * Returns the list of bundle identifiers that were automatically blocked
144
+ * due to rollbacks when `autoBlockRolledBackBundles` is enabled.
106
145
  *
107
146
  * Only available on Android and iOS.
108
147
  *
109
- * @since 5.0.0
110
- * @deprecated Use `getCurrentBundle()` instead.
148
+ * @since 7.4.0
111
149
  */
112
- getBundle(): Promise<GetBundleResult>;
150
+ getBlockedBundles(): Promise<GetBlockedBundlesResult>;
113
151
  /**
114
152
  * Get all identifiers of bundles that have been downloaded.
115
153
  *
116
154
  * Only available on Android and iOS.
117
155
  *
118
156
  * @since 5.0.0
157
+ * @deprecated Use `getDownloadedBundles()` instead.
119
158
  */
120
159
  getBundles(): Promise<GetBundlesResult>;
121
160
  /**
@@ -126,6 +165,25 @@ export interface LiveUpdatePlugin {
126
165
  * @since 5.0.0
127
166
  */
128
167
  getChannel(): Promise<GetChannelResult>;
168
+ /**
169
+ * Get the runtime configuration.
170
+ *
171
+ * Returns the current plugin configuration including any runtime
172
+ * overrides set via `setConfig()`.
173
+ *
174
+ * Only available on Android and iOS.
175
+ *
176
+ * @since 7.4.0
177
+ */
178
+ getConfig(): Promise<GetConfigResult>;
179
+ /**
180
+ * Get all identifiers of bundles that have been downloaded.
181
+ *
182
+ * Only available on Android and iOS.
183
+ *
184
+ * @since 7.4.0
185
+ */
186
+ getDownloadedBundles(): Promise<GetDownloadedBundlesResult>;
129
187
  /**
130
188
  * Get the bundle identifier of the current bundle.
131
189
  * The current bundle is the bundle that is currently used by the app.
@@ -151,6 +209,14 @@ export interface LiveUpdatePlugin {
151
209
  * @since 5.0.0
152
210
  */
153
211
  getDeviceId(): Promise<GetDeviceIdResult>;
212
+ /**
213
+ * Check whether a sync operation is currently in progress.
214
+ *
215
+ * Only available on Android and iOS.
216
+ *
217
+ * @since 7.4.0
218
+ */
219
+ isSyncing(): Promise<IsSyncingResult>;
154
220
  /**
155
221
  * Get the bundle identifier of the next bundle.
156
222
  * The next bundle is the bundle that will be used after calling `reload()`
@@ -164,6 +230,9 @@ export interface LiveUpdatePlugin {
164
230
  /**
165
231
  * Get the version code of the app.
166
232
  *
233
+ * On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.
234
+ * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.
235
+ *
167
236
  * Only available on Android and iOS.
168
237
  *
169
238
  * @since 5.0.0
@@ -172,6 +241,9 @@ export interface LiveUpdatePlugin {
172
241
  /**
173
242
  * Get the version name of the app.
174
243
  *
244
+ * On **Android**, this is the `versionName` from the `android/app/build.gradle` file.
245
+ * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.
246
+ *
175
247
  * Only available on Android and iOS.
176
248
  *
177
249
  * @since 5.0.0
@@ -187,7 +259,7 @@ export interface LiveUpdatePlugin {
187
259
  *
188
260
  * @since 5.0.0
189
261
  */
190
- ready(): Promise<void>;
262
+ ready(): Promise<ReadyResult>;
191
263
  /**
192
264
  * Reload the app to apply the new bundle.
193
265
  *
@@ -207,16 +279,16 @@ export interface LiveUpdatePlugin {
207
279
  */
208
280
  reset(): Promise<void>;
209
281
  /**
210
- * Set the next bundle to use for the app.
282
+ * Reset the runtime configuration to the values from the Capacitor config file.
211
283
  *
212
- * Call `reload()` or restart the app to apply the changes.
284
+ * This clears any runtime configuration set via `setConfig()`.
285
+ * The changes take effect immediately.
213
286
  *
214
287
  * Only available on Android and iOS.
215
288
  *
216
- * @since 5.0.0
217
- * @deprecated Use `setNextBundle()` instead.
289
+ * @since 7.4.0
218
290
  */
219
- setBundle(options: SetBundleOptions): Promise<void>;
291
+ resetConfig(): Promise<void>;
220
292
  /**
221
293
  * Set the channel to use for the update.
222
294
  *
@@ -225,6 +297,21 @@ export interface LiveUpdatePlugin {
225
297
  * @since 5.0.0
226
298
  */
227
299
  setChannel(options: SetChannelOptions): Promise<void>;
300
+ /**
301
+ * Set the runtime configuration.
302
+ *
303
+ * This allows updating plugin configuration options at runtime.
304
+ * The changes are persisted across app restarts and take effect immediately.
305
+ *
306
+ * **Important:** Runtime configuration is automatically reset to default values
307
+ * whenever the native app is updated to a new version. This ensures that
308
+ * configuration from previous versions doesn't persist after an app update.
309
+ *
310
+ * Only available on Android and iOS.
311
+ *
312
+ * @since 7.4.0
313
+ */
314
+ setConfig(options: SetConfigOptions): Promise<void>;
228
315
  /**
229
316
  * Set the custom identifier of the device.
230
317
  *
@@ -253,6 +340,46 @@ export interface LiveUpdatePlugin {
253
340
  * @since 5.0.0
254
341
  */
255
342
  sync(options?: SyncOptions): Promise<SyncResult>;
343
+ /**
344
+ * Listen for the download progress of a bundle.
345
+ *
346
+ * Only available on Android and iOS.
347
+ *
348
+ * @since 7.0.0
349
+ */
350
+ addListener(eventName: 'downloadBundleProgress', listenerFunc: DownloadBundleProgressListener): Promise<PluginListenerHandle>;
351
+ /**
352
+ * Listen for when a bundle is set as the next bundle.
353
+ *
354
+ * This event is triggered whenever a bundle is set to be used on the next app restart,
355
+ * either through automatic updates or manual calls to `setNextBundle()`.
356
+ *
357
+ * Only available on Android and iOS.
358
+ *
359
+ * @since 7.3.0
360
+ */
361
+ addListener(eventName: 'nextBundleSet', listenerFunc: NextBundleSetListener): Promise<PluginListenerHandle>;
362
+ /**
363
+ * Listen for when the app is reloaded.
364
+ *
365
+ * This event is triggered after the `reload()` method is called
366
+ * and the app has been reloaded.
367
+ *
368
+ * **Note:** To verify whether an update was successfully applied after a reload,
369
+ * use the `ready()` method instead. The `ready()` method provides detailed information
370
+ * about the current bundle, previous bundle, and whether a rollback occurred.
371
+ *
372
+ * Only available on Android and iOS.
373
+ *
374
+ * @since 7.4.0
375
+ */
376
+ addListener(eventName: 'reloaded', listenerFunc: ReloadedListener): Promise<PluginListenerHandle>;
377
+ /**
378
+ * Remove all listeners for this plugin.
379
+ *
380
+ * @since 7.2.0
381
+ */
382
+ removeAllListeners(): Promise<void>;
256
383
  }
257
384
  /**
258
385
  * @since 5.0.0
@@ -278,6 +405,8 @@ export interface DownloadBundleOptions {
278
405
  /**
279
406
  * The unique identifier of the bundle.
280
407
  *
408
+ * **Attention**: The value `public` is reserved and cannot be used as a bundle identifier.
409
+ *
281
410
  * @since 5.0.0
282
411
  * @example '1.0.0'
283
412
  */
@@ -288,7 +417,7 @@ export interface DownloadBundleOptions {
288
417
  *
289
418
  * **Attention**: Only supported for the `zip` artifact type.
290
419
  *
291
- * @since 6.1.0
420
+ * @since 7.1.0
292
421
  */
293
422
  checksum?: string;
294
423
  /**
@@ -297,7 +426,7 @@ export interface DownloadBundleOptions {
297
426
  *
298
427
  * **Attention**: Only supported for the `zip` artifact type.
299
428
  *
300
- * @since 6.8.0
429
+ * @since 7.1.0
301
430
  */
302
431
  signature?: string;
303
432
  /**
@@ -309,10 +438,10 @@ export interface DownloadBundleOptions {
309
438
  * `https://example.com/download`, the plugin will download the file
310
439
  * with the href `index.html` from `https://example.com/download?href=index.html`.
311
440
  *
312
- * To **verify the integrity** of the file, the server must return
441
+ * To **verify the integrity** of the file, the server should return
313
442
  * a `X-Checksum` header with the SHA-256 hash in base64 format.
314
443
  *
315
- * To **verify the signature** of the file, the server must return
444
+ * To **verify the signature** of the file, the server should return
316
445
  * a `X-Signature` header with the signed SHA-256 hash in base64 format.
317
446
  *
318
447
  * @since 5.0.0
@@ -355,9 +484,18 @@ export interface FetchLatestBundleResult {
355
484
  * If the bundle is hosted on Capawesome Cloud, the checksum will be
356
485
  * returned as response header when downloading the bundle.
357
486
  *
358
- * @since 6.8.0
487
+ * @since 7.1.0
359
488
  */
360
489
  checksum?: string;
490
+ /**
491
+ * Custom properties that are associated with the latest bundle.
492
+ *
493
+ * @since 7.0.0
494
+ * @example { "key": "value" }
495
+ */
496
+ customProperties?: {
497
+ [key: string]: string;
498
+ };
361
499
  /**
362
500
  * The URL of the latest bundle to download.
363
501
  * Pass this URL to the `downloadBundle(...)` method to download the bundle.
@@ -371,7 +509,7 @@ export interface FetchLatestBundleResult {
371
509
  * If the bundle is hosted on Capawesome Cloud, the signature will be
372
510
  * returned as response header when downloading the bundle.
373
511
  *
374
- * @since 6.8.0
512
+ * @since 7.1.0
375
513
  */
376
514
  signature?: string;
377
515
  }
@@ -389,6 +527,17 @@ export interface GetBundleResult {
389
527
  */
390
528
  bundleId: string | null;
391
529
  }
530
+ /**
531
+ * @since 7.4.0
532
+ */
533
+ export interface GetBlockedBundlesResult {
534
+ /**
535
+ * An array of unique identifiers of all blocked bundles.
536
+ *
537
+ * @since 7.4.0
538
+ */
539
+ bundleIds: string[];
540
+ }
392
541
  /**
393
542
  * @since 5.0.0
394
543
  */
@@ -400,6 +549,17 @@ export interface GetBundlesResult {
400
549
  */
401
550
  bundleIds: string[];
402
551
  }
552
+ /**
553
+ * @since 7.4.0
554
+ */
555
+ export interface GetDownloadedBundlesResult {
556
+ /**
557
+ * An array of unique identifiers of all downloaded bundles.
558
+ *
559
+ * @since 7.4.0
560
+ */
561
+ bundleIds: string[];
562
+ }
403
563
  /**
404
564
  * @since 5.0.0
405
565
  */
@@ -414,6 +574,27 @@ export interface GetChannelResult {
414
574
  */
415
575
  channel: string | null;
416
576
  }
577
+ /**
578
+ * @since 7.4.0
579
+ */
580
+ export interface GetConfigResult {
581
+ /**
582
+ * The app ID used to identify the app.
583
+ *
584
+ * If `null`, no app ID is configured.
585
+ *
586
+ * @since 7.4.0
587
+ * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
588
+ */
589
+ appId: string | null;
590
+ /**
591
+ * The auto-update strategy for live updates.
592
+ *
593
+ * @since 7.4.0
594
+ * @example 'background'
595
+ */
596
+ autoUpdateStrategy: 'none' | 'background';
597
+ }
417
598
  /**
418
599
  * @since 6.7.0
419
600
  */
@@ -443,6 +624,17 @@ export interface GetDeviceIdResult {
443
624
  */
444
625
  deviceId: string;
445
626
  }
627
+ /**
628
+ * @since 7.4.0
629
+ */
630
+ export interface IsSyncingResult {
631
+ /**
632
+ * Whether a sync operation is currently in progress.
633
+ *
634
+ * @since 7.4.0
635
+ */
636
+ syncing: boolean;
637
+ }
446
638
  /**
447
639
  * @since 6.7.0
448
640
  */
@@ -500,6 +692,33 @@ export interface GetCustomIdResult {
500
692
  */
501
693
  customId: string | null;
502
694
  }
695
+ /**
696
+ * @since 7.0.0
697
+ */
698
+ export interface ReadyResult {
699
+ /**
700
+ * The identifier of the previous bundle used.
701
+ *
702
+ * If `null`, the default bundle was used.
703
+ *
704
+ * @since 7.0.0
705
+ */
706
+ previousBundleId: string | null;
707
+ /**
708
+ * The identifier of the current bundle used.
709
+ *
710
+ * If `null`, the default bundle is being used.
711
+ *
712
+ * @since 7.0.0
713
+ */
714
+ currentBundleId: string | null;
715
+ /**
716
+ * Whether or not the app was reset to the default bundle.
717
+ *
718
+ * @since 7.0.0
719
+ */
720
+ rollback: boolean;
721
+ }
503
722
  /**
504
723
  * @since 5.0.0
505
724
  */
@@ -525,6 +744,20 @@ export interface SetChannelOptions {
525
744
  */
526
745
  channel: string | null;
527
746
  }
747
+ /**
748
+ * @since 7.4.0
749
+ */
750
+ export interface SetConfigOptions {
751
+ /**
752
+ * The app ID used to identify the app.
753
+ *
754
+ * Set `null` to reset to the value from the Capacitor config file.
755
+ *
756
+ * @since 7.4.0
757
+ * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
758
+ */
759
+ appId?: string | null;
760
+ }
528
761
  /**
529
762
  * @since 5.0.0
530
763
  */
@@ -576,3 +809,69 @@ export interface SyncResult {
576
809
  */
577
810
  nextBundleId: string | null;
578
811
  }
812
+ /**
813
+ * Listener for the download progress of a bundle.
814
+ *
815
+ * @since 7.0.0
816
+ */
817
+ export type DownloadBundleProgressListener = (event: DownloadBundleProgressEvent) => void;
818
+ /**
819
+ * Event that is triggered when the download progress of a bundle changes.
820
+ *
821
+ * @since 7.0.0
822
+ */
823
+ export interface DownloadBundleProgressEvent {
824
+ /**
825
+ * The unique identifier of the bundle that is being downloaded.
826
+ *
827
+ * @since 7.0.0
828
+ */
829
+ bundleId: string;
830
+ /**
831
+ * The number of bytes that have been downloaded.
832
+ *
833
+ * @since 7.0.0
834
+ */
835
+ downloadedBytes: number;
836
+ /**
837
+ * The progress of the download in percent as a value between `0` and `1`.
838
+ *
839
+ * @since 7.0.0
840
+ * @example 0.5
841
+ */
842
+ progress: number;
843
+ /**
844
+ * The total number of bytes to download.
845
+ *
846
+ * @since 7.0.0
847
+ */
848
+ totalBytes: number;
849
+ }
850
+ /**
851
+ * Listener for when a bundle is set as the next bundle.
852
+ *
853
+ * @since 7.3.0
854
+ */
855
+ export type NextBundleSetListener = (event: NextBundleSetEvent) => void;
856
+ /**
857
+ * Event that is triggered when a bundle is set as the next bundle.
858
+ *
859
+ * @since 7.3.0
860
+ */
861
+ export interface NextBundleSetEvent {
862
+ /**
863
+ * The unique identifier of the bundle that is set as the next bundle.
864
+ *
865
+ * If `null`, the default bundle will be used.
866
+ *
867
+ * @since 7.3.0
868
+ * @example '1.0.0'
869
+ */
870
+ bundleId: string | null;
871
+ }
872
+ /**
873
+ * Listener for when the app is reloaded.
874
+ *
875
+ * @since 7.4.0
876
+ */
877
+ export type ReloadedListener = () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n LiveUpdate?: {\n /**\n * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud).\n *\n * This is **NOT** the same as the app identifier (e.g. `com.example.app`).\n * This is a unique identifier generated by Capawesome Cloud (e.g. `6e351b4f-69a7-415e-a057-4567df7ffe94`).\n *\n * @since 5.0.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId?: string;\n /**\n * Whether or not to automatically delete unused bundles.\n *\n * When enabled, the plugin will automatically delete unused bundles after calling `ready()`.\n *\n * @since 5.0.0\n * @default false\n */\n autoDeleteBundles?: boolean;\n /**\n * The default channel of the app.\n *\n * @since 6.3.0\n * @example 'production'\n */\n defaultChannel?: string;\n /**\n * Whether or not the plugin is enabled.\n *\n * @since 5.0.0\n * @default true\n */\n enabled?: boolean;\n /**\n * The timeout in milliseconds for HTTP requests.\n *\n * @since 6.4.0\n * @default 60000\n */\n httpTimeout?: number;\n /**\n * The location of the server to use when using [Capawesome Cloud](https://capawesome.io/cloud).\n *\n * @since 6.2.0\n * @default 'us'\n * @example 'eu'\n * @deprecated This option will be removed in the future.\n */\n location?: 'us' | 'eu';\n /**\n * The public key to verify the integrity of the bundle.\n *\n * The public key must be a PEM-encoded RSA public key.\n *\n * @since 6.1.0\n * @example '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----'\n */\n publicKey?: string;\n /**\n * The timeout in milliseconds to wait for the app to be ready before resetting to the default bundle.\n *\n * @since 5.0.0\n * @default 10000\n */\n readyTimeout?: number;\n /**\n * Whether or not the app should be reset to the default bundle during an update.\n *\n * @since 5.0.0\n * @default true\n */\n resetOnUpdate?: boolean;\n };\n }\n}\n\nexport interface LiveUpdatePlugin {\n /**\n * Delete a bundle from the app.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n deleteBundle(options: DeleteBundleOptions): Promise<void>;\n /**\n * Download a bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n downloadBundle(options: DownloadBundleOptions): Promise<void>;\n /**\n * Fetch the latest bundle using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * Only available on Android and iOS.\n *\n * @since 6.6.0\n */\n fetchLatestBundle(options?: FetchLatestBundleOptions): Promise<FetchLatestBundleResult>;\n /**\n * Get the active bundle identifier.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n * @deprecated Use `getCurrentBundle()` instead.\n */\n getBundle(): Promise<GetBundleResult>;\n /**\n * Get all identifiers of bundles that have been downloaded.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getBundles(): Promise<GetBundlesResult>;\n /**\n * Get the channel that is used for the update.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getChannel(): Promise<GetChannelResult>;\n /**\n * Get the bundle identifier of the current bundle.\n * The current bundle is the bundle that is currently used by the app.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n getCurrentBundle(): Promise<GetCurrentBundleResult>;\n /**\n * Get the custom identifier of the device.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getCustomId(): Promise<GetCustomIdResult>;\n /**\n * Get the unique device identifier.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getDeviceId(): Promise<GetDeviceIdResult>;\n /**\n * Get the bundle identifier of the next bundle.\n * The next bundle is the bundle that will be used after calling `reload()`\n * or restarting the app.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n getNextBundle(): Promise<GetNextBundleResult>;\n /**\n * Get the version code of the app.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getVersionCode(): Promise<GetVersionCodeResult>;\n /**\n * Get the version name of the app.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getVersionName(): Promise<GetVersionNameResult>;\n /**\n * Notify the plugin that the app is ready to use and no rollback is needed.\n *\n * **Attention**: This method should be called as soon as the app is ready to use\n * to prevent the app from being reset to the default bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n ready(): Promise<void>;\n /**\n * Reload the app to apply the new bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n reload(): Promise<void>;\n /**\n * Reset the app to the default bundle.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n reset(): Promise<void>;\n /**\n * Set the next bundle to use for the app.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n * @deprecated Use `setNextBundle()` instead.\n */\n setBundle(options: SetBundleOptions): Promise<void>;\n /**\n * Set the channel to use for the update.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n setChannel(options: SetChannelOptions): Promise<void>;\n /**\n * Set the custom identifier of the device.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n setCustomId(options: SetCustomIdOptions): Promise<void>;\n /**\n * Set the next bundle to use for the app.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n setNextBundle(options: SetNextBundleOptions): Promise<void>;\n /**\n * Automatically download and set the latest bundle for the app using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n sync(options?: SyncOptions): Promise<SyncResult>;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface DeleteBundleOptions {\n /**\n * The unique identifier of the bundle to delete.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\nexport interface DownloadBundleOptions {\n /**\n * The artifact type of the bundle.\n *\n * @since 6.6.0\n * @default 'zip'\n * @example 'manifest'\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the bundle.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n /**\n * The checksum of the self-hosted bundle as a SHA-256 hash\n * in base64 format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 6.1.0\n */\n checksum?: string;\n /**\n * The signature of the self-hosted bundle as a signed SHA-256 hash\n * in base64 format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 6.8.0\n */\n signature?: string;\n /**\n * The URL of the bundle to download.\n *\n * For the `zip` artifact type, the URL must point to a ZIP file.\n * For the `manifest` artifact type, the URL serves as the base URL\n * to download the individual files. For example, if the URL is\n * `https://example.com/download`, the plugin will download the file\n * with the href `index.html` from `https://example.com/download?href=index.html`.\n *\n * To **verify the integrity** of the file, the server must return\n * a `X-Checksum` header with the SHA-256 hash in base64 format.\n *\n * To **verify the signature** of the file, the server must return\n * a `X-Signature` header with the signed SHA-256 hash in base64 format.\n *\n * @since 5.0.0\n * @example 'https://example.com/bundle.zip'\n */\n url: string;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface FetchLatestBundleOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 6.7.0\n */\n channel?: string;\n}\n\n/**\n * @since 6.6.0\n */\nexport interface FetchLatestBundleResult {\n /**\n * The artifact type of the bundle.\n *\n * @since 6.7.0\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the latest bundle.\n *\n * If `null`, no bundle is available.\n *\n * @since 6.6.0\n */\n bundleId: string | null;\n /**\n * The checksum of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the checksum will be\n * returned as response header when downloading the bundle.\n *\n * @since 6.8.0\n */\n checksum?: string;\n /**\n * The URL of the latest bundle to download.\n * Pass this URL to the `downloadBundle(...)` method to download the bundle.\n *\n * @since 6.7.0\n */\n downloadUrl?: string;\n /**\n * The signature of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the signature will be\n * returned as response header when downloading the bundle.\n *\n * @since 6.8.0\n */\n signature?: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetBundleResult {\n /**\n * The unique identifier of the active bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetBundlesResult {\n /**\n * An array of unique identifiers of all available bundles.\n *\n * @since 5.0.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetChannelResult {\n /**\n * The channel name.\n *\n * If `null`, the app is using the default channel.\n *\n * @since 5.0.0\n * @example 'production'\n */\n channel: string | null;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface GetCurrentBundleResult {\n /**\n * The unique identifier of the current bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 6.7.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetDeviceIdResult {\n /**\n * The unique identifier of the device.\n *\n * On iOS, [`identifierForVendor`](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) is used.\n * The value of this property is the same for apps that come from the same vendor running on the same device.\n *\n * @since 5.0.0\n *\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n deviceId: string;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface GetNextBundleResult {\n /**\n * The unique identifier of the next bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 6.7.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetVersionCodeResult {\n /**\n * The version code of the app.\n *\n * On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.\n *\n * @since 5.0.0\n * @example \"1\"\n */\n versionCode: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetVersionNameResult {\n /**\n * The version name of the app.\n *\n * On **Android**, this is the `versionName` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.\n *\n * @since 5.0.0\n * @example \"1.0.0\"\n */\n versionName: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetCustomIdResult {\n /**\n * The custom identifier of the device.\n *\n * If `null`, no custom identifier is set.\n *\n * @since 5.0.0\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n customId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetChannelOptions {\n /**\n * The channel name.\n *\n * Set `null` to remove the channel.\n *\n * @since 5.0.0\n */\n channel: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetCustomIdOptions {\n /**\n * The custom identifier of the device.\n *\n * Set `null` to remove the custom identifier.\n *\n * @since 5.0.0\n */\n customId: string | null;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface SetNextBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * Set `null` to use the default bundle (same as calling `reset()`).\n *\n * @since 6.7.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface SyncOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 6.7.0\n */\n channel?: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SyncResult {\n /**\n * The identifier of the next bundle to use.\n *\n * If `null`, the app is up-to-date and no new bundle is available.\n *\n * @since 5.0.0\n */\n nextBundleId: string | null;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\nimport type { PluginListenerHandle } from '@capacitor/core';\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n LiveUpdate?: {\n /**\n * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * This is **NOT** the same as the app identifier (e.g. `com.example.app`).\n * This is a unique identifier generated by Capawesome Cloud (e.g. `6e351b4f-69a7-415e-a057-4567df7ffe94`).\n *\n * @since 5.0.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId?: string;\n /**\n * Whether or not to automatically block bundles that have been rolled back.\n *\n * When enabled, the plugin will automatically block bundles that caused a rollback\n * (up to 100 bundles). When the limit is reached, the oldest blocked bundle is unblocked.\n * Blocked bundles will be skipped in future sync operations.\n *\n * **Attention**: This option has no effect if `readyTimeout` is set to `0`.\n *\n * Only available on Android and iOS.\n *\n * @since 7.3.0\n * @default false\n */\n autoBlockRolledBackBundles?: boolean;\n /**\n * Whether or not to automatically delete unused bundles.\n *\n * When enabled, the plugin will automatically delete unused bundles after calling `ready()`.\n *\n * @since 5.0.0\n * @default false\n */\n autoDeleteBundles?: boolean;\n /**\n * The auto-update strategy for live updates.\n *\n * - `none`: Live updates will not be applied automatically.\n * - `background`: Live updates will be automatically downloaded\n * and applied in the background at app startup and when the app resumes\n * (if the last check was more than 15 minutes ago).\n *\n * Only available on Android and iOS.\n *\n * @since 7.3.0\n * @default 'none'\n * @example 'background'\n */\n autoUpdateStrategy?: 'none' | 'background';\n /**\n * The default channel of the app.\n *\n * @since 6.3.0\n * @example 'production'\n */\n defaultChannel?: string;\n /**\n * The timeout in milliseconds for HTTP requests.\n *\n * @since 6.4.0\n * @default 60000\n */\n httpTimeout?: number;\n /**\n * The public key to verify the integrity of the bundle.\n *\n * The public key must be a PEM-encoded RSA public key.\n *\n * @since 6.1.0\n * @example '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDodf1SD0OOn6hIlDuKBza0Ed0OqtwyVJwiyjmE9BJaZ7y8ZUfcF+SKmd0l2cDPM45XIg2tAFux5n29uoKyHwSt+6tCi5CJA5Z1/1eZruRRqABLonV77KS3HUtvOgqRLDnKSV89dYZkM++NwmzOPgIF422mvc+VukcVOBfc8/AHQIDAQAB-----END PUBLIC KEY-----'\n */\n publicKey?: string;\n /**\n * The timeout in milliseconds to wait for the app to be ready\n * before resetting to the default bundle.\n *\n * It is strongly **recommended** to configure this option (e.g. `10000` ms)\n * so that the plugin can roll back to the default bundle in case of problems.\n * If configured, the plugin will wait for the app to call the `ready()`\n * method before resetting to the default bundle.\n *\n * Set to `0` to disable the timeout.\n *\n * @since 5.0.0\n * @default 0\n * @example 10000\n */\n readyTimeout?: number;\n /**\n * The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server **without** scheme or path.\n *\n * @since 7.0.0\n * @default 'api.cloud.capawesome.io'\n * @example 'api.cloud.capawesome.eu'\n */\n serverDomain?: string;\n };\n }\n}\n\nexport interface LiveUpdatePlugin {\n /**\n * Clear all blocked bundles from the blocked list.\n *\n * This removes all bundle identifiers that were automatically blocked\n * due to rollbacks when `autoBlockRolledBackBundles` is enabled.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n clearBlockedBundles(): Promise<void>;\n /**\n * Delete a bundle from the app.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n deleteBundle(options: DeleteBundleOptions): Promise<void>;\n /**\n * Download a bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n downloadBundle(options: DownloadBundleOptions): Promise<void>;\n /**\n * Fetch the latest bundle using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * Only available on Android and iOS.\n *\n * @since 6.6.0\n */\n fetchLatestBundle(\n options?: FetchLatestBundleOptions,\n ): Promise<FetchLatestBundleResult>;\n /**\n * Get all blocked bundle identifiers.\n *\n * Returns the list of bundle identifiers that were automatically blocked\n * due to rollbacks when `autoBlockRolledBackBundles` is enabled.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n getBlockedBundles(): Promise<GetBlockedBundlesResult>;\n /**\n * Get all identifiers of bundles that have been downloaded.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n * @deprecated Use `getDownloadedBundles()` instead.\n */\n getBundles(): Promise<GetBundlesResult>;\n /**\n * Get the channel that is used for the update.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getChannel(): Promise<GetChannelResult>;\n /**\n * Get the runtime configuration.\n *\n * Returns the current plugin configuration including any runtime\n * overrides set via `setConfig()`.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n getConfig(): Promise<GetConfigResult>;\n /**\n * Get all identifiers of bundles that have been downloaded.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n getDownloadedBundles(): Promise<GetDownloadedBundlesResult>;\n /**\n * Get the bundle identifier of the current bundle.\n * The current bundle is the bundle that is currently used by the app.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n getCurrentBundle(): Promise<GetCurrentBundleResult>;\n /**\n * Get the custom identifier of the device.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getCustomId(): Promise<GetCustomIdResult>;\n /**\n * Get the unique device identifier.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getDeviceId(): Promise<GetDeviceIdResult>;\n /**\n * Check whether a sync operation is currently in progress.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n isSyncing(): Promise<IsSyncingResult>;\n /**\n * Get the bundle identifier of the next bundle.\n * The next bundle is the bundle that will be used after calling `reload()`\n * or restarting the app.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n getNextBundle(): Promise<GetNextBundleResult>;\n /**\n * Get the version code of the app.\n *\n * On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getVersionCode(): Promise<GetVersionCodeResult>;\n /**\n * Get the version name of the app.\n *\n * On **Android**, this is the `versionName` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n getVersionName(): Promise<GetVersionNameResult>;\n /**\n * Notify the plugin that the app is ready to use and no rollback is needed.\n *\n * **Attention**: This method should be called as soon as the app is ready to use\n * to prevent the app from being reset to the default bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n ready(): Promise<ReadyResult>;\n /**\n * Reload the app to apply the new bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n reload(): Promise<void>;\n /**\n * Reset the app to the default bundle.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n reset(): Promise<void>;\n /**\n * Reset the runtime configuration to the values from the Capacitor config file.\n *\n * This clears any runtime configuration set via `setConfig()`.\n * The changes take effect immediately.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n resetConfig(): Promise<void>;\n /**\n * Set the channel to use for the update.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n setChannel(options: SetChannelOptions): Promise<void>;\n /**\n * Set the runtime configuration.\n *\n * This allows updating plugin configuration options at runtime.\n * The changes are persisted across app restarts and take effect immediately.\n *\n * **Important:** Runtime configuration is automatically reset to default values\n * whenever the native app is updated to a new version. This ensures that\n * configuration from previous versions doesn't persist after an app update.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n setConfig(options: SetConfigOptions): Promise<void>;\n /**\n * Set the custom identifier of the device.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n setCustomId(options: SetCustomIdOptions): Promise<void>;\n /**\n * Set the next bundle to use for the app.\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 6.7.0\n */\n setNextBundle(options: SetNextBundleOptions): Promise<void>;\n /**\n * Automatically download and set the latest bundle for the app using the [Capawesome Cloud](https://capawesome.io/cloud/).\n *\n * Call `reload()` or restart the app to apply the changes.\n *\n * Only available on Android and iOS.\n *\n * @since 5.0.0\n */\n sync(options?: SyncOptions): Promise<SyncResult>;\n /**\n * Listen for the download progress of a bundle.\n *\n * Only available on Android and iOS.\n *\n * @since 7.0.0\n */\n addListener(\n eventName: 'downloadBundleProgress',\n listenerFunc: DownloadBundleProgressListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for when a bundle is set as the next bundle.\n *\n * This event is triggered whenever a bundle is set to be used on the next app restart,\n * either through automatic updates or manual calls to `setNextBundle()`.\n *\n * Only available on Android and iOS.\n *\n * @since 7.3.0\n */\n addListener(\n eventName: 'nextBundleSet',\n listenerFunc: NextBundleSetListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for when the app is reloaded.\n *\n * This event is triggered after the `reload()` method is called\n * and the app has been reloaded.\n *\n * **Note:** To verify whether an update was successfully applied after a reload,\n * use the `ready()` method instead. The `ready()` method provides detailed information\n * about the current bundle, previous bundle, and whether a rollback occurred.\n *\n * Only available on Android and iOS.\n *\n * @since 7.4.0\n */\n addListener(\n eventName: 'reloaded',\n listenerFunc: ReloadedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 7.2.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface DeleteBundleOptions {\n /**\n * The unique identifier of the bundle to delete.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\nexport interface DownloadBundleOptions {\n /**\n * The artifact type of the bundle.\n *\n * @since 6.6.0\n * @default 'zip'\n * @example 'manifest'\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the bundle.\n *\n * **Attention**: The value `public` is reserved and cannot be used as a bundle identifier.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n /**\n * The checksum of the self-hosted bundle as a SHA-256 hash\n * in base64 format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 7.1.0\n */\n checksum?: string;\n /**\n * The signature of the self-hosted bundle as a signed SHA-256 hash\n * in base64 format to verify the integrity of the bundle.\n *\n * **Attention**: Only supported for the `zip` artifact type.\n *\n * @since 7.1.0\n */\n signature?: string;\n /**\n * The URL of the bundle to download.\n *\n * For the `zip` artifact type, the URL must point to a ZIP file.\n * For the `manifest` artifact type, the URL serves as the base URL\n * to download the individual files. For example, if the URL is\n * `https://example.com/download`, the plugin will download the file\n * with the href `index.html` from `https://example.com/download?href=index.html`.\n *\n * To **verify the integrity** of the file, the server should return\n * a `X-Checksum` header with the SHA-256 hash in base64 format.\n *\n * To **verify the signature** of the file, the server should return\n * a `X-Signature` header with the signed SHA-256 hash in base64 format.\n *\n * @since 5.0.0\n * @example 'https://example.com/bundle.zip'\n */\n url: string;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface FetchLatestBundleOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 6.7.0\n */\n channel?: string;\n}\n\n/**\n * @since 6.6.0\n */\nexport interface FetchLatestBundleResult {\n /**\n * The artifact type of the bundle.\n *\n * @since 6.7.0\n */\n artifactType?: 'manifest' | 'zip';\n /**\n * The unique identifier of the latest bundle.\n *\n * If `null`, no bundle is available.\n *\n * @since 6.6.0\n */\n bundleId: string | null;\n /**\n * The checksum of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the checksum will be\n * returned as response header when downloading the bundle.\n *\n * @since 7.1.0\n */\n checksum?: string;\n /**\n * Custom properties that are associated with the latest bundle.\n *\n * @since 7.0.0\n * @example { \"key\": \"value\" }\n */\n customProperties?: { [key: string]: string };\n /**\n * The URL of the latest bundle to download.\n * Pass this URL to the `downloadBundle(...)` method to download the bundle.\n *\n * @since 6.7.0\n */\n downloadUrl?: string;\n /**\n * The signature of the latest bundle if the bundle is self-hosted.\n *\n * If the bundle is hosted on Capawesome Cloud, the signature will be\n * returned as response header when downloading the bundle.\n *\n * @since 7.1.0\n */\n signature?: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetBundleResult {\n /**\n * The unique identifier of the active bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 7.4.0\n */\nexport interface GetBlockedBundlesResult {\n /**\n * An array of unique identifiers of all blocked bundles.\n *\n * @since 7.4.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetBundlesResult {\n /**\n * An array of unique identifiers of all available bundles.\n *\n * @since 5.0.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 7.4.0\n */\nexport interface GetDownloadedBundlesResult {\n /**\n * An array of unique identifiers of all downloaded bundles.\n *\n * @since 7.4.0\n */\n bundleIds: string[];\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetChannelResult {\n /**\n * The channel name.\n *\n * If `null`, the app is using the default channel.\n *\n * @since 5.0.0\n * @example 'production'\n */\n channel: string | null;\n}\n\n/**\n * @since 7.4.0\n */\nexport interface GetConfigResult {\n /**\n * The app ID used to identify the app.\n *\n * If `null`, no app ID is configured.\n *\n * @since 7.4.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId: string | null;\n /**\n * The auto-update strategy for live updates.\n *\n * @since 7.4.0\n * @example 'background'\n */\n autoUpdateStrategy: 'none' | 'background';\n}\n\n/**\n * @since 6.7.0\n */\nexport interface GetCurrentBundleResult {\n /**\n * The unique identifier of the current bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 6.7.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetDeviceIdResult {\n /**\n * The unique identifier of the device.\n *\n * On iOS, [`identifierForVendor`](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) is used.\n * The value of this property is the same for apps that come from the same vendor running on the same device.\n *\n * @since 5.0.0\n *\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n deviceId: string;\n}\n\n/**\n * @since 7.4.0\n */\nexport interface IsSyncingResult {\n /**\n * Whether a sync operation is currently in progress.\n *\n * @since 7.4.0\n */\n syncing: boolean;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface GetNextBundleResult {\n /**\n * The unique identifier of the next bundle.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 6.7.0\n */\n bundleId: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetVersionCodeResult {\n /**\n * The version code of the app.\n *\n * On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.\n *\n * @since 5.0.0\n * @example \"1\"\n */\n versionCode: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetVersionNameResult {\n /**\n * The version name of the app.\n *\n * On **Android**, this is the `versionName` from the `android/app/build.gradle` file.\n * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.\n *\n * @since 5.0.0\n * @example \"1.0.0\"\n */\n versionName: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface GetCustomIdResult {\n /**\n * The custom identifier of the device.\n *\n * If `null`, no custom identifier is set.\n *\n * @since 5.0.0\n * @example '50d2a548-80b7-4dad-adc7-97c0e79d8a89'\n */\n customId: string | null;\n}\n\n/**\n * @since 7.0.0\n */\nexport interface ReadyResult {\n /**\n * The identifier of the previous bundle used.\n *\n * If `null`, the default bundle was used.\n *\n * @since 7.0.0\n */\n previousBundleId: string | null;\n /**\n * The identifier of the current bundle used.\n *\n * If `null`, the default bundle is being used.\n *\n * @since 7.0.0\n */\n currentBundleId: string | null;\n /**\n * Whether or not the app was reset to the default bundle.\n *\n * @since 7.0.0\n */\n rollback: boolean;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * @since 5.0.0\n * @example '1.0.0'\n */\n bundleId: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetChannelOptions {\n /**\n * The channel name.\n *\n * Set `null` to remove the channel.\n *\n * @since 5.0.0\n */\n channel: string | null;\n}\n\n/**\n * @since 7.4.0\n */\nexport interface SetConfigOptions {\n /**\n * The app ID used to identify the app.\n *\n * Set `null` to reset to the value from the Capacitor config file.\n *\n * @since 7.4.0\n * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'\n */\n appId?: string | null;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SetCustomIdOptions {\n /**\n * The custom identifier of the device.\n *\n * Set `null` to remove the custom identifier.\n *\n * @since 5.0.0\n */\n customId: string | null;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface SetNextBundleOptions {\n /**\n * The unique identifier of the bundle to use.\n *\n * Set `null` to use the default bundle (same as calling `reset()`).\n *\n * @since 6.7.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * @since 6.7.0\n */\nexport interface SyncOptions {\n /**\n * The name of the channel where the latest bundle is fetched from.\n *\n * @since 6.7.0\n */\n channel?: string;\n}\n\n/**\n * @since 5.0.0\n */\nexport interface SyncResult {\n /**\n * The identifier of the next bundle to use.\n *\n * If `null`, the app is up-to-date and no new bundle is available.\n *\n * @since 5.0.0\n */\n nextBundleId: string | null;\n}\n\n/**\n * Listener for the download progress of a bundle.\n *\n * @since 7.0.0\n */\nexport type DownloadBundleProgressListener = (\n event: DownloadBundleProgressEvent,\n) => void;\n\n/**\n * Event that is triggered when the download progress of a bundle changes.\n *\n * @since 7.0.0\n */\nexport interface DownloadBundleProgressEvent {\n /**\n * The unique identifier of the bundle that is being downloaded.\n *\n * @since 7.0.0\n */\n bundleId: string;\n /**\n * The number of bytes that have been downloaded.\n *\n * @since 7.0.0\n */\n downloadedBytes: number;\n /**\n * The progress of the download in percent as a value between `0` and `1`.\n *\n * @since 7.0.0\n * @example 0.5\n */\n progress: number;\n /**\n * The total number of bytes to download.\n *\n * @since 7.0.0\n */\n totalBytes: number;\n}\n\n/**\n * Listener for when a bundle is set as the next bundle.\n *\n * @since 7.3.0\n */\nexport type NextBundleSetListener = (event: NextBundleSetEvent) => void;\n\n/**\n * Event that is triggered when a bundle is set as the next bundle.\n *\n * @since 7.3.0\n */\nexport interface NextBundleSetEvent {\n /**\n * The unique identifier of the bundle that is set as the next bundle.\n *\n * If `null`, the default bundle will be used.\n *\n * @since 7.3.0\n * @example '1.0.0'\n */\n bundleId: string | null;\n}\n\n/**\n * Listener for when the app is reloaded.\n *\n * @since 7.4.0\n */\nexport type ReloadedListener = () => void;\n"]}