@capawesome/capacitor-live-update 6.8.0-dev.2e2696e1.1773643381 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapawesomeCapacitorLiveUpdate.podspec +2 -2
- package/README.md +435 -27
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +851 -262
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +35 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +56 -11
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +273 -38
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +52 -3
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetChannelsResponseItem.java +28 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +7 -7
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +32 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/NextBundleSetEvent.java +26 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/FetchChannelsOptions.java +38 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetConfigOptions.java +19 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SyncOptions.java +4 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ChannelResult.java +28 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchChannelsResult.java +28 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +7 -7
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/IsSyncingResult.java +26 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
- package/dist/docs.json +845 -54
- package/dist/esm/definitions.d.ts +413 -18
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +10 -2
- package/dist/esm/web.js +24 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +24 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +24 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Classes/Events/DownloadBundleProgressEvent.swift +25 -0
- package/ios/Plugin/Classes/Events/NextBundleSetEvent.swift +16 -0
- package/ios/Plugin/Classes/Options/FetchChannelsOptions.swift +26 -0
- package/ios/Plugin/Classes/Options/SetConfigOptions.swift +14 -0
- package/ios/Plugin/Classes/Options/SyncOptions.swift +4 -0
- package/ios/Plugin/Classes/Results/ChannelResult.swift +19 -0
- package/ios/Plugin/Classes/Results/FetchChannelsResult.swift +16 -0
- package/ios/Plugin/Classes/Results/{FetchLatestBundle.swift → FetchLatestBundleResult.swift} +6 -6
- package/ios/Plugin/Classes/Results/GetBlockedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetConfigResult.swift +19 -0
- package/ios/Plugin/Classes/Results/GetDownloadedBundlesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/IsSyncingResult.swift +16 -0
- package/ios/Plugin/Classes/Results/ReadyResult.swift +22 -0
- package/ios/Plugin/LiveUpdate.swift +423 -145
- package/ios/Plugin/LiveUpdateConfig.swift +3 -0
- package/ios/Plugin/LiveUpdateHttpClient.swift +21 -4
- package/ios/Plugin/LiveUpdatePlugin.swift +174 -14
- package/ios/Plugin/LiveUpdatePreferences.swift +54 -12
- package/ios/Plugin/Protocols/Api/GetChannelsResponseItem.swift +4 -0
- package/ios/Plugin/Protocols/Api/GetLatestBundleResponse.swift +1 -1
- package/package.json +5 -5
- package/ios/Plugin/LiveUpdatePlugin.h +0 -10
- package/ios/Plugin/LiveUpdatePlugin.m +0 -27
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
1
2
|
declare module '@capacitor/cli' {
|
|
2
3
|
interface PluginsConfig {
|
|
3
4
|
LiveUpdate?: {
|
|
@@ -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 6.9.0
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
autoBlockRolledBackBundles?: boolean;
|
|
14
30
|
/**
|
|
15
31
|
* Whether or not to automatically delete unused bundles.
|
|
16
32
|
*
|
|
@@ -20,9 +36,29 @@ 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 6.9.0
|
|
50
|
+
* @default 'none'
|
|
51
|
+
* @example 'background'
|
|
52
|
+
*/
|
|
53
|
+
autoUpdateStrategy?: 'none' | 'background';
|
|
23
54
|
/**
|
|
24
55
|
* The default channel of the app.
|
|
25
56
|
*
|
|
57
|
+
* This can be overridden by `setChannel()`, the `channel` parameter of `sync()`,
|
|
58
|
+
* or the native channel configuration
|
|
59
|
+
* (`CapawesomeLiveUpdateDefaultChannel` in `Info.plist` on iOS or `capawesome_live_update_default_channel`
|
|
60
|
+
* in `strings.xml` on Android).
|
|
61
|
+
*
|
|
26
62
|
* @since 6.3.0
|
|
27
63
|
* @example 'production'
|
|
28
64
|
*/
|
|
@@ -73,10 +109,31 @@ declare module '@capacitor/cli' {
|
|
|
73
109
|
* @default true
|
|
74
110
|
*/
|
|
75
111
|
resetOnUpdate?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server **without** scheme or path.
|
|
114
|
+
*
|
|
115
|
+
* This option takes precedence over the `location` configuration option.
|
|
116
|
+
*
|
|
117
|
+
* @since 6.9.0
|
|
118
|
+
* @default 'api.cloud.capawesome.io'
|
|
119
|
+
* @example 'api.cloud.capawesome.eu'
|
|
120
|
+
*/
|
|
121
|
+
serverDomain?: string;
|
|
76
122
|
};
|
|
77
123
|
}
|
|
78
124
|
}
|
|
79
125
|
export interface LiveUpdatePlugin {
|
|
126
|
+
/**
|
|
127
|
+
* Clear all blocked bundles from the blocked list.
|
|
128
|
+
*
|
|
129
|
+
* This removes all bundle identifiers that were automatically blocked
|
|
130
|
+
* due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
131
|
+
*
|
|
132
|
+
* Only available on Android and iOS.
|
|
133
|
+
*
|
|
134
|
+
* @since 6.9.0
|
|
135
|
+
*/
|
|
136
|
+
clearBlockedBundles(): Promise<void>;
|
|
80
137
|
/**
|
|
81
138
|
* Delete a bundle from the app.
|
|
82
139
|
*
|
|
@@ -93,6 +150,22 @@ export interface LiveUpdatePlugin {
|
|
|
93
150
|
* @since 5.0.0
|
|
94
151
|
*/
|
|
95
152
|
downloadBundle(options: DownloadBundleOptions): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Fetch channels from [Capawesome Cloud](https://capawesome.io/cloud/).
|
|
155
|
+
*
|
|
156
|
+
* This is primarily intended for development and QA purposes.
|
|
157
|
+
* It allows you to retrieve a list of available channels so you can
|
|
158
|
+
* dynamically switch between them using `setChannel(...)`.
|
|
159
|
+
*
|
|
160
|
+
* **Attention**: Only works for apps with public channels enabled.
|
|
161
|
+
* If channels are private, they can still be set using `setChannel(...)`
|
|
162
|
+
* but won't be returned by this method.
|
|
163
|
+
*
|
|
164
|
+
* Only available on Android and iOS.
|
|
165
|
+
*
|
|
166
|
+
* @since 6.9.0
|
|
167
|
+
*/
|
|
168
|
+
fetchChannels(options?: FetchChannelsOptions): Promise<FetchChannelsResult>;
|
|
96
169
|
/**
|
|
97
170
|
* Fetch the latest bundle using the [Capawesome Cloud](https://capawesome.io/cloud/).
|
|
98
171
|
*
|
|
@@ -101,6 +174,17 @@ export interface LiveUpdatePlugin {
|
|
|
101
174
|
* @since 6.6.0
|
|
102
175
|
*/
|
|
103
176
|
fetchLatestBundle(options?: FetchLatestBundleOptions): Promise<FetchLatestBundleResult>;
|
|
177
|
+
/**
|
|
178
|
+
* Get all blocked bundle identifiers.
|
|
179
|
+
*
|
|
180
|
+
* Returns the list of bundle identifiers that were automatically blocked
|
|
181
|
+
* due to rollbacks when `autoBlockRolledBackBundles` is enabled.
|
|
182
|
+
*
|
|
183
|
+
* Only available on Android and iOS.
|
|
184
|
+
*
|
|
185
|
+
* @since 6.9.0
|
|
186
|
+
*/
|
|
187
|
+
getBlockedBundles(): Promise<GetBlockedBundlesResult>;
|
|
104
188
|
/**
|
|
105
189
|
* Get the active bundle identifier.
|
|
106
190
|
*
|
|
@@ -116,16 +200,37 @@ export interface LiveUpdatePlugin {
|
|
|
116
200
|
* Only available on Android and iOS.
|
|
117
201
|
*
|
|
118
202
|
* @since 5.0.0
|
|
203
|
+
* @deprecated Use `getDownloadedBundles()` instead.
|
|
119
204
|
*/
|
|
120
205
|
getBundles(): Promise<GetBundlesResult>;
|
|
121
206
|
/**
|
|
122
207
|
* Get the channel that is used for the update.
|
|
123
208
|
*
|
|
209
|
+
* The channel is resolved in the following order (highest priority first):
|
|
210
|
+
* 1. `setChannel()` (SharedPreferences on Android / UserDefaults on iOS)
|
|
211
|
+
* 2. Capacitor config `defaultChannel`
|
|
212
|
+
* 3. Native config (`CapawesomeLiveUpdateDefaultChannel` in `Info.plist` on iOS or
|
|
213
|
+
* `capawesome_live_update_default_channel` in `strings.xml` on Android)
|
|
214
|
+
*
|
|
215
|
+
* **Note**: The `channel` parameter of `sync()` takes the highest priority
|
|
216
|
+
* but is not persisted and therefore not returned by this method.
|
|
217
|
+
*
|
|
124
218
|
* Only available on Android and iOS.
|
|
125
219
|
*
|
|
126
220
|
* @since 5.0.0
|
|
127
221
|
*/
|
|
128
222
|
getChannel(): Promise<GetChannelResult>;
|
|
223
|
+
/**
|
|
224
|
+
* Get the runtime configuration.
|
|
225
|
+
*
|
|
226
|
+
* Returns the current plugin configuration including any runtime
|
|
227
|
+
* overrides set via `setConfig()`.
|
|
228
|
+
*
|
|
229
|
+
* Only available on Android and iOS.
|
|
230
|
+
*
|
|
231
|
+
* @since 6.9.0
|
|
232
|
+
*/
|
|
233
|
+
getConfig(): Promise<GetConfigResult>;
|
|
129
234
|
/**
|
|
130
235
|
* Get the bundle identifier of the current bundle.
|
|
131
236
|
* The current bundle is the bundle that is currently used by the app.
|
|
@@ -151,6 +256,14 @@ export interface LiveUpdatePlugin {
|
|
|
151
256
|
* @since 5.0.0
|
|
152
257
|
*/
|
|
153
258
|
getDeviceId(): Promise<GetDeviceIdResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Get all identifiers of bundles that have been downloaded.
|
|
261
|
+
*
|
|
262
|
+
* Only available on Android and iOS.
|
|
263
|
+
*
|
|
264
|
+
* @since 6.9.0
|
|
265
|
+
*/
|
|
266
|
+
getDownloadedBundles(): Promise<GetDownloadedBundlesResult>;
|
|
154
267
|
/**
|
|
155
268
|
* Get the bundle identifier of the next bundle.
|
|
156
269
|
* The next bundle is the bundle that will be used after calling `reload()`
|
|
@@ -177,6 +290,14 @@ export interface LiveUpdatePlugin {
|
|
|
177
290
|
* @since 5.0.0
|
|
178
291
|
*/
|
|
179
292
|
getVersionName(): Promise<GetVersionNameResult>;
|
|
293
|
+
/**
|
|
294
|
+
* Check whether a sync operation is currently in progress.
|
|
295
|
+
*
|
|
296
|
+
* Only available on Android and iOS.
|
|
297
|
+
*
|
|
298
|
+
* @since 6.9.0
|
|
299
|
+
*/
|
|
300
|
+
isSyncing(): Promise<IsSyncingResult>;
|
|
180
301
|
/**
|
|
181
302
|
* Notify the plugin that the app is ready to use and no rollback is needed.
|
|
182
303
|
*
|
|
@@ -187,7 +308,7 @@ export interface LiveUpdatePlugin {
|
|
|
187
308
|
*
|
|
188
309
|
* @since 5.0.0
|
|
189
310
|
*/
|
|
190
|
-
ready(): Promise<
|
|
311
|
+
ready(): Promise<ReadyResult>;
|
|
191
312
|
/**
|
|
192
313
|
* Reload the app to apply the new bundle.
|
|
193
314
|
*
|
|
@@ -206,6 +327,17 @@ export interface LiveUpdatePlugin {
|
|
|
206
327
|
* @since 5.0.0
|
|
207
328
|
*/
|
|
208
329
|
reset(): Promise<void>;
|
|
330
|
+
/**
|
|
331
|
+
* Reset the runtime configuration to the values from the Capacitor config file.
|
|
332
|
+
*
|
|
333
|
+
* This clears any runtime configuration set via `setConfig()`.
|
|
334
|
+
* The changes take effect immediately.
|
|
335
|
+
*
|
|
336
|
+
* Only available on Android and iOS.
|
|
337
|
+
*
|
|
338
|
+
* @since 6.9.0
|
|
339
|
+
*/
|
|
340
|
+
resetConfig(): Promise<void>;
|
|
209
341
|
/**
|
|
210
342
|
* Set the next bundle to use for the app.
|
|
211
343
|
*
|
|
@@ -225,6 +357,21 @@ export interface LiveUpdatePlugin {
|
|
|
225
357
|
* @since 5.0.0
|
|
226
358
|
*/
|
|
227
359
|
setChannel(options: SetChannelOptions): Promise<void>;
|
|
360
|
+
/**
|
|
361
|
+
* Set the runtime configuration.
|
|
362
|
+
*
|
|
363
|
+
* This allows updating plugin configuration options at runtime.
|
|
364
|
+
* The changes are persisted across app restarts and take effect immediately.
|
|
365
|
+
*
|
|
366
|
+
* **Important:** Runtime configuration is automatically reset to default values
|
|
367
|
+
* whenever the native app is updated to a new version. This ensures that
|
|
368
|
+
* configuration from previous versions doesn't persist after an app update.
|
|
369
|
+
*
|
|
370
|
+
* Only available on Android and iOS.
|
|
371
|
+
*
|
|
372
|
+
* @since 6.9.0
|
|
373
|
+
*/
|
|
374
|
+
setConfig(options: SetConfigOptions): Promise<void>;
|
|
228
375
|
/**
|
|
229
376
|
* Set the custom identifier of the device.
|
|
230
377
|
*
|
|
@@ -253,6 +400,46 @@ export interface LiveUpdatePlugin {
|
|
|
253
400
|
* @since 5.0.0
|
|
254
401
|
*/
|
|
255
402
|
sync(options?: SyncOptions): Promise<SyncResult>;
|
|
403
|
+
/**
|
|
404
|
+
* Listen for the download progress of a bundle.
|
|
405
|
+
*
|
|
406
|
+
* Only available on Android and iOS.
|
|
407
|
+
*
|
|
408
|
+
* @since 6.9.0
|
|
409
|
+
*/
|
|
410
|
+
addListener(eventName: 'downloadBundleProgress', listenerFunc: DownloadBundleProgressListener): Promise<PluginListenerHandle>;
|
|
411
|
+
/**
|
|
412
|
+
* Listen for when a bundle is set as the next bundle.
|
|
413
|
+
*
|
|
414
|
+
* This event is triggered whenever a bundle is set to be used on the next app restart,
|
|
415
|
+
* either through automatic updates or manual calls to `setNextBundle()`.
|
|
416
|
+
*
|
|
417
|
+
* Only available on Android and iOS.
|
|
418
|
+
*
|
|
419
|
+
* @since 6.9.0
|
|
420
|
+
*/
|
|
421
|
+
addListener(eventName: 'nextBundleSet', listenerFunc: NextBundleSetListener): Promise<PluginListenerHandle>;
|
|
422
|
+
/**
|
|
423
|
+
* Listen for when the app is reloaded.
|
|
424
|
+
*
|
|
425
|
+
* This event is triggered after the `reload()` method is called
|
|
426
|
+
* and the app has been reloaded.
|
|
427
|
+
*
|
|
428
|
+
* **Note:** To verify whether an update was successfully applied after a reload,
|
|
429
|
+
* use the `ready()` method instead. The `ready()` method provides detailed information
|
|
430
|
+
* about the current bundle, previous bundle, and whether a rollback occurred.
|
|
431
|
+
*
|
|
432
|
+
* Only available on Android and iOS.
|
|
433
|
+
*
|
|
434
|
+
* @since 6.9.0
|
|
435
|
+
*/
|
|
436
|
+
addListener(eventName: 'reloaded', listenerFunc: ReloadedListener): Promise<PluginListenerHandle>;
|
|
437
|
+
/**
|
|
438
|
+
* Remove all listeners for this plugin.
|
|
439
|
+
*
|
|
440
|
+
* @since 6.9.0
|
|
441
|
+
*/
|
|
442
|
+
removeAllListeners(): Promise<void>;
|
|
256
443
|
}
|
|
257
444
|
/**
|
|
258
445
|
* @since 5.0.0
|
|
@@ -320,15 +507,65 @@ export interface DownloadBundleOptions {
|
|
|
320
507
|
*/
|
|
321
508
|
url: string;
|
|
322
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* @since 6.9.0
|
|
512
|
+
*/
|
|
513
|
+
export interface FetchChannelsOptions {
|
|
514
|
+
/**
|
|
515
|
+
* The maximum number of channels to return.
|
|
516
|
+
*
|
|
517
|
+
* @since 6.9.0
|
|
518
|
+
* @default 50
|
|
519
|
+
*/
|
|
520
|
+
limit?: number;
|
|
521
|
+
/**
|
|
522
|
+
* The number of channels to skip.
|
|
523
|
+
*
|
|
524
|
+
* @since 6.9.0
|
|
525
|
+
* @default 0
|
|
526
|
+
*/
|
|
527
|
+
offset?: number;
|
|
528
|
+
/**
|
|
529
|
+
* The query to filter channels by name.
|
|
530
|
+
*
|
|
531
|
+
* @since 6.9.0
|
|
532
|
+
*/
|
|
533
|
+
query?: string;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* @since 6.9.0
|
|
537
|
+
*/
|
|
538
|
+
export interface FetchChannelsResult {
|
|
539
|
+
/**
|
|
540
|
+
* The list of channels.
|
|
541
|
+
*
|
|
542
|
+
* @since 6.9.0
|
|
543
|
+
*/
|
|
544
|
+
channels: Channel[];
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* @since 6.9.0
|
|
548
|
+
*/
|
|
549
|
+
export interface Channel {
|
|
550
|
+
/**
|
|
551
|
+
* The unique identifier of the channel.
|
|
552
|
+
*
|
|
553
|
+
* @since 6.9.0
|
|
554
|
+
*/
|
|
555
|
+
id: string;
|
|
556
|
+
/**
|
|
557
|
+
* The name of the channel.
|
|
558
|
+
*
|
|
559
|
+
* @since 6.9.0
|
|
560
|
+
*/
|
|
561
|
+
name: string;
|
|
562
|
+
}
|
|
323
563
|
/**
|
|
324
564
|
* @since 6.7.0
|
|
325
565
|
*/
|
|
326
566
|
export interface FetchLatestBundleOptions {
|
|
327
567
|
/**
|
|
328
|
-
* The
|
|
329
|
-
*
|
|
330
|
-
* This is the SDK preference and may be overridden by a forced channel assignment
|
|
331
|
-
* configured in the Capawesome Cloud Console.
|
|
568
|
+
* The name of the channel where the latest bundle is fetched from.
|
|
332
569
|
*
|
|
333
570
|
* @since 6.7.0
|
|
334
571
|
*/
|
|
@@ -352,15 +589,6 @@ export interface FetchLatestBundleResult {
|
|
|
352
589
|
* @since 6.6.0
|
|
353
590
|
*/
|
|
354
591
|
bundleId: string | null;
|
|
355
|
-
/**
|
|
356
|
-
* The name of the channel that the bundle is actually from.
|
|
357
|
-
*
|
|
358
|
-
* This is the resolved channel after applying any forced channel assignment
|
|
359
|
-
* and may differ from the channel set by the Live Update SDK.
|
|
360
|
-
*
|
|
361
|
-
* @since 6.9.0
|
|
362
|
-
*/
|
|
363
|
-
channel?: string;
|
|
364
592
|
/**
|
|
365
593
|
* The checksum of the latest bundle if the bundle is self-hosted.
|
|
366
594
|
*
|
|
@@ -370,6 +598,15 @@ export interface FetchLatestBundleResult {
|
|
|
370
598
|
* @since 6.8.0
|
|
371
599
|
*/
|
|
372
600
|
checksum?: string;
|
|
601
|
+
/**
|
|
602
|
+
* Custom properties that are associated with the latest bundle.
|
|
603
|
+
*
|
|
604
|
+
* @since 6.9.0
|
|
605
|
+
* @example { "key": "value" }
|
|
606
|
+
*/
|
|
607
|
+
customProperties?: {
|
|
608
|
+
[key: string]: string;
|
|
609
|
+
};
|
|
373
610
|
/**
|
|
374
611
|
* The URL of the latest bundle to download.
|
|
375
612
|
* Pass this URL to the `downloadBundle(...)` method to download the bundle.
|
|
@@ -387,6 +624,17 @@ export interface FetchLatestBundleResult {
|
|
|
387
624
|
*/
|
|
388
625
|
signature?: string;
|
|
389
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* @since 6.9.0
|
|
629
|
+
*/
|
|
630
|
+
export interface GetBlockedBundlesResult {
|
|
631
|
+
/**
|
|
632
|
+
* An array of unique identifiers of all blocked bundles.
|
|
633
|
+
*
|
|
634
|
+
* @since 6.9.0
|
|
635
|
+
*/
|
|
636
|
+
bundleIds: string[];
|
|
637
|
+
}
|
|
390
638
|
/**
|
|
391
639
|
* @since 5.0.0
|
|
392
640
|
*/
|
|
@@ -412,6 +660,17 @@ export interface GetBundlesResult {
|
|
|
412
660
|
*/
|
|
413
661
|
bundleIds: string[];
|
|
414
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* @since 6.9.0
|
|
665
|
+
*/
|
|
666
|
+
export interface GetDownloadedBundlesResult {
|
|
667
|
+
/**
|
|
668
|
+
* An array of unique identifiers of all downloaded bundles.
|
|
669
|
+
*
|
|
670
|
+
* @since 6.9.0
|
|
671
|
+
*/
|
|
672
|
+
bundleIds: string[];
|
|
673
|
+
}
|
|
415
674
|
/**
|
|
416
675
|
* @since 5.0.0
|
|
417
676
|
*/
|
|
@@ -426,6 +685,27 @@ export interface GetChannelResult {
|
|
|
426
685
|
*/
|
|
427
686
|
channel: string | null;
|
|
428
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* @since 6.9.0
|
|
690
|
+
*/
|
|
691
|
+
export interface GetConfigResult {
|
|
692
|
+
/**
|
|
693
|
+
* The app ID used to identify the app.
|
|
694
|
+
*
|
|
695
|
+
* If `null`, no app ID is configured.
|
|
696
|
+
*
|
|
697
|
+
* @since 6.9.0
|
|
698
|
+
* @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
|
|
699
|
+
*/
|
|
700
|
+
appId: string | null;
|
|
701
|
+
/**
|
|
702
|
+
* The auto-update strategy for live updates.
|
|
703
|
+
*
|
|
704
|
+
* @since 6.9.0
|
|
705
|
+
* @example 'background'
|
|
706
|
+
*/
|
|
707
|
+
autoUpdateStrategy: 'none' | 'background';
|
|
708
|
+
}
|
|
429
709
|
/**
|
|
430
710
|
* @since 6.7.0
|
|
431
711
|
*/
|
|
@@ -455,6 +735,17 @@ export interface GetDeviceIdResult {
|
|
|
455
735
|
*/
|
|
456
736
|
deviceId: string;
|
|
457
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* @since 6.9.0
|
|
740
|
+
*/
|
|
741
|
+
export interface IsSyncingResult {
|
|
742
|
+
/**
|
|
743
|
+
* Whether a sync operation is currently in progress.
|
|
744
|
+
*
|
|
745
|
+
* @since 6.9.0
|
|
746
|
+
*/
|
|
747
|
+
syncing: boolean;
|
|
748
|
+
}
|
|
458
749
|
/**
|
|
459
750
|
* @since 6.7.0
|
|
460
751
|
*/
|
|
@@ -512,6 +803,33 @@ export interface GetCustomIdResult {
|
|
|
512
803
|
*/
|
|
513
804
|
customId: string | null;
|
|
514
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* @since 6.9.0
|
|
808
|
+
*/
|
|
809
|
+
export interface ReadyResult {
|
|
810
|
+
/**
|
|
811
|
+
* The identifier of the previous bundle used.
|
|
812
|
+
*
|
|
813
|
+
* If `null`, the default bundle was used.
|
|
814
|
+
*
|
|
815
|
+
* @since 6.9.0
|
|
816
|
+
*/
|
|
817
|
+
previousBundleId: string | null;
|
|
818
|
+
/**
|
|
819
|
+
* The identifier of the current bundle used.
|
|
820
|
+
*
|
|
821
|
+
* If `null`, the default bundle is being used.
|
|
822
|
+
*
|
|
823
|
+
* @since 6.9.0
|
|
824
|
+
*/
|
|
825
|
+
currentBundleId: string | null;
|
|
826
|
+
/**
|
|
827
|
+
* Whether or not the app was reset to the default bundle.
|
|
828
|
+
*
|
|
829
|
+
* @since 6.9.0
|
|
830
|
+
*/
|
|
831
|
+
rollback: boolean;
|
|
832
|
+
}
|
|
515
833
|
/**
|
|
516
834
|
* @since 5.0.0
|
|
517
835
|
*/
|
|
@@ -537,6 +855,20 @@ export interface SetChannelOptions {
|
|
|
537
855
|
*/
|
|
538
856
|
channel: string | null;
|
|
539
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* @since 6.9.0
|
|
860
|
+
*/
|
|
861
|
+
export interface SetConfigOptions {
|
|
862
|
+
/**
|
|
863
|
+
* The app ID used to identify the app.
|
|
864
|
+
*
|
|
865
|
+
* Set `null` to reset to the value from the Capacitor config file.
|
|
866
|
+
*
|
|
867
|
+
* @since 6.9.0
|
|
868
|
+
* @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
|
|
869
|
+
*/
|
|
870
|
+
appId?: string | null;
|
|
871
|
+
}
|
|
540
872
|
/**
|
|
541
873
|
* @since 5.0.0
|
|
542
874
|
*/
|
|
@@ -569,10 +901,7 @@ export interface SetNextBundleOptions {
|
|
|
569
901
|
*/
|
|
570
902
|
export interface SyncOptions {
|
|
571
903
|
/**
|
|
572
|
-
* The
|
|
573
|
-
*
|
|
574
|
-
* This is the SDK preference and may be overridden by a forced channel assignment
|
|
575
|
-
* configured in the Capawesome Cloud Console.
|
|
904
|
+
* The name of the channel where the latest bundle is fetched from.
|
|
576
905
|
*
|
|
577
906
|
* @since 6.7.0
|
|
578
907
|
*/
|
|
@@ -591,3 +920,69 @@ export interface SyncResult {
|
|
|
591
920
|
*/
|
|
592
921
|
nextBundleId: string | null;
|
|
593
922
|
}
|
|
923
|
+
/**
|
|
924
|
+
* Listener for the download progress of a bundle.
|
|
925
|
+
*
|
|
926
|
+
* @since 6.9.0
|
|
927
|
+
*/
|
|
928
|
+
export declare type DownloadBundleProgressListener = (event: DownloadBundleProgressEvent) => void;
|
|
929
|
+
/**
|
|
930
|
+
* Event that is triggered when the download progress of a bundle changes.
|
|
931
|
+
*
|
|
932
|
+
* @since 6.9.0
|
|
933
|
+
*/
|
|
934
|
+
export interface DownloadBundleProgressEvent {
|
|
935
|
+
/**
|
|
936
|
+
* The unique identifier of the bundle that is being downloaded.
|
|
937
|
+
*
|
|
938
|
+
* @since 6.9.0
|
|
939
|
+
*/
|
|
940
|
+
bundleId: string;
|
|
941
|
+
/**
|
|
942
|
+
* The number of bytes that have been downloaded.
|
|
943
|
+
*
|
|
944
|
+
* @since 6.9.0
|
|
945
|
+
*/
|
|
946
|
+
downloadedBytes: number;
|
|
947
|
+
/**
|
|
948
|
+
* The progress of the download in percent as a value between `0` and `1`.
|
|
949
|
+
*
|
|
950
|
+
* @since 6.9.0
|
|
951
|
+
* @example 0.5
|
|
952
|
+
*/
|
|
953
|
+
progress: number;
|
|
954
|
+
/**
|
|
955
|
+
* The total number of bytes to download.
|
|
956
|
+
*
|
|
957
|
+
* @since 6.9.0
|
|
958
|
+
*/
|
|
959
|
+
totalBytes: number;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Listener for when a bundle is set as the next bundle.
|
|
963
|
+
*
|
|
964
|
+
* @since 6.9.0
|
|
965
|
+
*/
|
|
966
|
+
export declare type NextBundleSetListener = (event: NextBundleSetEvent) => void;
|
|
967
|
+
/**
|
|
968
|
+
* Event that is triggered when a bundle is set as the next bundle.
|
|
969
|
+
*
|
|
970
|
+
* @since 6.9.0
|
|
971
|
+
*/
|
|
972
|
+
export interface NextBundleSetEvent {
|
|
973
|
+
/**
|
|
974
|
+
* The unique identifier of the bundle that is set as the next bundle.
|
|
975
|
+
*
|
|
976
|
+
* If `null`, the default bundle will be used.
|
|
977
|
+
*
|
|
978
|
+
* @since 6.9.0
|
|
979
|
+
* @example '1.0.0'
|
|
980
|
+
*/
|
|
981
|
+
bundleId: string | null;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Listener for when the app is reloaded.
|
|
985
|
+
*
|
|
986
|
+
* @since 6.9.0
|
|
987
|
+
*/
|
|
988
|
+
export declare type ReloadedListener = () => void;
|