@capgo/capacitor-updater 8.4.3 → 8.5.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/CapgoCapacitorUpdater.podspec +2 -2
- package/Package.swift +3 -3
- package/README.md +3 -164
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1 -1
- package/dist/docs.json +1 -557
- package/dist/esm/definitions.d.ts +0 -319
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +1 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +2 -2
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +53 -57
- package/package.json +1 -1
|
@@ -1,323 +1,4 @@
|
|
|
1
1
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
-
declare module '@capacitor/cli' {
|
|
3
|
-
interface PluginsConfig {
|
|
4
|
-
/**
|
|
5
|
-
* CapacitorUpdater can be configured with these options:
|
|
6
|
-
*/
|
|
7
|
-
CapacitorUpdater?: {
|
|
8
|
-
/**
|
|
9
|
-
* Configure the number of milliseconds the native plugin should wait before considering an update 'failed'.
|
|
10
|
-
*
|
|
11
|
-
* Only available for Android and iOS.
|
|
12
|
-
*
|
|
13
|
-
* @default 10000 // (10 seconds)
|
|
14
|
-
* @example 1000 // (1 second, minimum 1000)
|
|
15
|
-
*/
|
|
16
|
-
appReadyTimeout?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Configure the number of seconds the native plugin should wait before considering API timeout.
|
|
19
|
-
*
|
|
20
|
-
* Only available for Android and iOS.
|
|
21
|
-
*
|
|
22
|
-
* @default 20 // (20 second)
|
|
23
|
-
* @example 10 // (10 second)
|
|
24
|
-
*/
|
|
25
|
-
responseTimeout?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Configure whether the plugin should use automatically delete failed bundles.
|
|
28
|
-
*
|
|
29
|
-
* Only available for Android and iOS.
|
|
30
|
-
*
|
|
31
|
-
* @default true
|
|
32
|
-
* @example false
|
|
33
|
-
*/
|
|
34
|
-
autoDeleteFailed?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Configure whether the plugin should use automatically delete previous bundles after a successful update.
|
|
37
|
-
*
|
|
38
|
-
* Only available for Android and iOS.
|
|
39
|
-
*
|
|
40
|
-
* @default true
|
|
41
|
-
* @example false
|
|
42
|
-
*/
|
|
43
|
-
autoDeletePrevious?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Configure whether the plugin should use Auto Update via an update server.
|
|
46
|
-
*
|
|
47
|
-
* Only available for Android and iOS.
|
|
48
|
-
*
|
|
49
|
-
* @default true
|
|
50
|
-
* @example false
|
|
51
|
-
*/
|
|
52
|
-
autoUpdate?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Automatically delete previous downloaded bundles when a newer native app bundle is installed to the device.
|
|
55
|
-
* Setting this to false can broke the auto update flow if the user download from the store a native app bundle that is older than the current downloaded bundle. Upload will be prevented by channel setting downgrade_under_native.
|
|
56
|
-
* Only available for Android and iOS.
|
|
57
|
-
*
|
|
58
|
-
* @default true
|
|
59
|
-
* @example false
|
|
60
|
-
*/
|
|
61
|
-
resetWhenUpdate?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Configure the URL / endpoint to which update checks are sent.
|
|
64
|
-
*
|
|
65
|
-
* Only available for Android and iOS.
|
|
66
|
-
*
|
|
67
|
-
* @default https://plugin.capgo.app/updates
|
|
68
|
-
* @example https://example.com/api/auto_update
|
|
69
|
-
*/
|
|
70
|
-
updateUrl?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Configure the URL / endpoint for channel operations.
|
|
73
|
-
*
|
|
74
|
-
* Only available for Android and iOS.
|
|
75
|
-
*
|
|
76
|
-
* @default https://plugin.capgo.app/channel_self
|
|
77
|
-
* @example https://example.com/api/channel
|
|
78
|
-
*/
|
|
79
|
-
channelUrl?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Configure the URL / endpoint to which update statistics are sent.
|
|
82
|
-
*
|
|
83
|
-
* Only available for Android and iOS. Set to "" to disable stats reporting.
|
|
84
|
-
*
|
|
85
|
-
* @default https://plugin.capgo.app/stats
|
|
86
|
-
* @example https://example.com/api/stats
|
|
87
|
-
*/
|
|
88
|
-
statsUrl?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Configure the public key for end to end live update encryption Version 2
|
|
91
|
-
*
|
|
92
|
-
* Only available for Android and iOS.
|
|
93
|
-
*
|
|
94
|
-
* @default undefined
|
|
95
|
-
* @since 6.2.0
|
|
96
|
-
*/
|
|
97
|
-
publicKey?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Configure the current version of the app. This will be used for the first update request.
|
|
100
|
-
* If not set, the plugin will get the version from the native code.
|
|
101
|
-
*
|
|
102
|
-
* Only available for Android and iOS.
|
|
103
|
-
*
|
|
104
|
-
* @default undefined
|
|
105
|
-
* @since 4.17.48
|
|
106
|
-
*/
|
|
107
|
-
version?: string;
|
|
108
|
-
/**
|
|
109
|
-
* Configure when the plugin should direct install updates. Only for autoUpdate mode.
|
|
110
|
-
* Works well for apps less than 10MB and with uploads done using --partial flag.
|
|
111
|
-
* Zip or apps more than 10MB will be relatively slow for users to update.
|
|
112
|
-
* - false: Never do direct updates (use default behavior: download at start, set when backgrounded)
|
|
113
|
-
* - atInstall: Direct update only when app is installed, updated from store, otherwise act as directUpdate = false
|
|
114
|
-
* - onLaunch: Direct update only on app installed, updated from store or after app kill, otherwise act as directUpdate = false
|
|
115
|
-
* - always: Direct update in all previous cases (app installed, updated from store, after app kill or app resume), never act as directUpdate = false
|
|
116
|
-
* - true: (deprecated) Same as "always" for backward compatibility
|
|
117
|
-
*
|
|
118
|
-
* Only available for Android and iOS.
|
|
119
|
-
*
|
|
120
|
-
* @default false
|
|
121
|
-
* @since 5.1.0
|
|
122
|
-
*/
|
|
123
|
-
directUpdate?: boolean | 'atInstall' | 'always' | 'onLaunch';
|
|
124
|
-
/**
|
|
125
|
-
* Automatically handle splashscreen hiding when using directUpdate. When enabled, the plugin will automatically hide the splashscreen after updates are applied or when no update is needed.
|
|
126
|
-
* This removes the need to manually listen for appReady events and call SplashScreen.hide().
|
|
127
|
-
* Only works when directUpdate is set to "atInstall", "always", "onLaunch", or true.
|
|
128
|
-
* Requires the @capacitor/splash-screen plugin to be installed and configured with launchAutoHide: false.
|
|
129
|
-
* Requires autoUpdate and directUpdate to be enabled.
|
|
130
|
-
*
|
|
131
|
-
* Only available for Android and iOS.
|
|
132
|
-
*
|
|
133
|
-
* @default false
|
|
134
|
-
* @since 7.6.0
|
|
135
|
-
*/
|
|
136
|
-
autoSplashscreen?: boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Display a native loading indicator on top of the splashscreen while automatic direct updates are running.
|
|
139
|
-
* Only takes effect when {@link autoSplashscreen} is enabled.
|
|
140
|
-
* Requires the @capacitor/splash-screen plugin to be installed and configured with launchAutoHide: false.
|
|
141
|
-
*
|
|
142
|
-
* Only available for Android and iOS.
|
|
143
|
-
*
|
|
144
|
-
* @default false
|
|
145
|
-
* @since 7.19.0
|
|
146
|
-
*/
|
|
147
|
-
autoSplashscreenLoader?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Automatically hide the splashscreen after the specified number of milliseconds when using automatic direct updates.
|
|
150
|
-
* If the timeout elapses, the update continues to download in the background while the splashscreen is dismissed.
|
|
151
|
-
* Set to `0` (zero) to disable the timeout.
|
|
152
|
-
* When the timeout fires, the direct update flow is skipped and the downloaded bundle is installed on the next background/launch.
|
|
153
|
-
* Requires {@link autoSplashscreen} to be enabled.
|
|
154
|
-
*
|
|
155
|
-
* Only available for Android and iOS.
|
|
156
|
-
*
|
|
157
|
-
* @default 10000 // (10 seconds)
|
|
158
|
-
* @since 7.19.0
|
|
159
|
-
*/
|
|
160
|
-
autoSplashscreenTimeout?: number;
|
|
161
|
-
/**
|
|
162
|
-
* Configure the delay period for period update check. the unit is in seconds.
|
|
163
|
-
*
|
|
164
|
-
* Only available for Android and iOS.
|
|
165
|
-
* Cannot be less than 600 seconds (10 minutes).
|
|
166
|
-
*
|
|
167
|
-
* @default 0 (disabled)
|
|
168
|
-
* @example 3600 (1 hour)
|
|
169
|
-
* @example 86400 (24 hours)
|
|
170
|
-
*/
|
|
171
|
-
periodCheckDelay?: number;
|
|
172
|
-
/**
|
|
173
|
-
* Configure the CLI to use a local server for testing or self-hosted update server.
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @default undefined
|
|
177
|
-
* @since 4.17.48
|
|
178
|
-
*/
|
|
179
|
-
localS3?: boolean;
|
|
180
|
-
/**
|
|
181
|
-
* Configure the CLI to use a local server for testing or self-hosted update server.
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* @default undefined
|
|
185
|
-
* @since 4.17.48
|
|
186
|
-
*/
|
|
187
|
-
localHost?: string;
|
|
188
|
-
/**
|
|
189
|
-
* Configure the CLI to use a local server for testing or self-hosted update server.
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* @default undefined
|
|
193
|
-
* @since 4.17.48
|
|
194
|
-
*/
|
|
195
|
-
localWebHost?: string;
|
|
196
|
-
/**
|
|
197
|
-
* Configure the CLI to use a local server for testing or self-hosted update server.
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @default undefined
|
|
201
|
-
* @since 4.17.48
|
|
202
|
-
*/
|
|
203
|
-
localSupa?: string;
|
|
204
|
-
/**
|
|
205
|
-
* Configure the CLI to use a local server for testing.
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* @default undefined
|
|
209
|
-
* @since 4.17.48
|
|
210
|
-
*/
|
|
211
|
-
localSupaAnon?: string;
|
|
212
|
-
/**
|
|
213
|
-
* Configure the CLI to use a local api for testing.
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* @default undefined
|
|
217
|
-
* @since 6.3.3
|
|
218
|
-
*/
|
|
219
|
-
localApi?: string;
|
|
220
|
-
/**
|
|
221
|
-
* Configure the CLI to use a local file api for testing.
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* @default undefined
|
|
225
|
-
* @since 6.3.3
|
|
226
|
-
*/
|
|
227
|
-
localApiFiles?: string;
|
|
228
|
-
/**
|
|
229
|
-
* Allow the plugin to modify the updateUrl, statsUrl and channelUrl dynamically from the JavaScript side.
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* @default false
|
|
233
|
-
* @since 5.4.0
|
|
234
|
-
*/
|
|
235
|
-
allowModifyUrl?: boolean;
|
|
236
|
-
/**
|
|
237
|
-
* Allow the plugin to modify the appId dynamically from the JavaScript side.
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* @default false
|
|
241
|
-
* @since 7.14.0
|
|
242
|
-
*/
|
|
243
|
-
allowModifyAppId?: boolean;
|
|
244
|
-
/**
|
|
245
|
-
* Allow marking bundles as errored from JavaScript while using manual update flows.
|
|
246
|
-
* When enabled, {@link CapacitorUpdaterPlugin.setBundleError} can change a bundle status to `error`.
|
|
247
|
-
*
|
|
248
|
-
* @default false
|
|
249
|
-
* @since 7.20.0
|
|
250
|
-
*/
|
|
251
|
-
allowManualBundleError?: boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Persist the customId set through {@link CapacitorUpdaterPlugin.setCustomId} across app restarts.
|
|
254
|
-
*
|
|
255
|
-
* Only available for Android and iOS.
|
|
256
|
-
*
|
|
257
|
-
* @default false (will be true by default in a future major release v8.x.x)
|
|
258
|
-
* @since 7.17.3
|
|
259
|
-
*/
|
|
260
|
-
persistCustomId?: boolean;
|
|
261
|
-
/**
|
|
262
|
-
* Persist the updateUrl, statsUrl and channelUrl set through {@link CapacitorUpdaterPlugin.setUpdateUrl},
|
|
263
|
-
* {@link CapacitorUpdaterPlugin.setStatsUrl} and {@link CapacitorUpdaterPlugin.setChannelUrl} across app restarts.
|
|
264
|
-
*
|
|
265
|
-
* Only available for Android and iOS.
|
|
266
|
-
*
|
|
267
|
-
* @default false
|
|
268
|
-
* @since 7.20.0
|
|
269
|
-
*/
|
|
270
|
-
persistModifyUrl?: boolean;
|
|
271
|
-
/**
|
|
272
|
-
* Allow or disallow the {@link CapacitorUpdaterPlugin.setChannel} method to modify the defaultChannel.
|
|
273
|
-
* When set to `false`, calling `setChannel()` will return an error with code `disabled_by_config`.
|
|
274
|
-
*
|
|
275
|
-
* @default true
|
|
276
|
-
* @since 7.34.0
|
|
277
|
-
*/
|
|
278
|
-
allowSetDefaultChannel?: boolean;
|
|
279
|
-
/**
|
|
280
|
-
* Set the default channel for the app in the config. Case sensitive.
|
|
281
|
-
* This will setting will override the default channel set in the cloud, but will still respect overrides made in the cloud.
|
|
282
|
-
* This requires the channel to allow devices to self dissociate/associate in the channel settings. https://capgo.app/docs/public-api/channels/#channel-configuration-options
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* @default undefined
|
|
286
|
-
* @since 5.5.0
|
|
287
|
-
*/
|
|
288
|
-
defaultChannel?: string;
|
|
289
|
-
/**
|
|
290
|
-
* Configure the app id for the app in the config.
|
|
291
|
-
*
|
|
292
|
-
* @default undefined
|
|
293
|
-
* @since 6.0.0
|
|
294
|
-
*/
|
|
295
|
-
appId?: string;
|
|
296
|
-
/**
|
|
297
|
-
* Configure the plugin to keep the URL path after a reload.
|
|
298
|
-
* WARNING: When a reload is triggered, 'window.history' will be cleared.
|
|
299
|
-
*
|
|
300
|
-
* @default false
|
|
301
|
-
* @since 6.8.0
|
|
302
|
-
*/
|
|
303
|
-
keepUrlPathAfterReload?: boolean;
|
|
304
|
-
/**
|
|
305
|
-
* Disable the JavaScript logging of the plugin. if true, the plugin will not log to the JavaScript console. only the native log will be done
|
|
306
|
-
*
|
|
307
|
-
* @default false
|
|
308
|
-
* @since 7.3.0
|
|
309
|
-
*/
|
|
310
|
-
disableJSLogging?: boolean;
|
|
311
|
-
/**
|
|
312
|
-
* Enable shake gesture to show update menu for debugging/testing purposes
|
|
313
|
-
*
|
|
314
|
-
* @default false
|
|
315
|
-
* @since 7.5.0
|
|
316
|
-
*/
|
|
317
|
-
shakeMenu?: boolean;
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
2
|
export interface CapacitorUpdaterPlugin {
|
|
322
3
|
/**
|
|
323
4
|
* Notify the native layer that JavaScript initialized successfully.
|