@capgo/capacitor-updater 3.0.3
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/CHANGELOG.md +326 -0
- package/CapacitorUpdater.podspec +20 -0
- package/LICENCE +661 -0
- package/README.md +456 -0
- package/android/build.gradle +60 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +402 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +404 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +523 -0
- package/dist/esm/definitions.d.ts +132 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +36 -0
- package/dist/esm/web.js +49 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +65 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +68 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/CapacitorUpdater.swift +266 -0
- package/ios/Plugin/CapacitorUpdaterPlugin.h +10 -0
- package/ios/Plugin/CapacitorUpdaterPlugin.m +18 -0
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +307 -0
- package/ios/Plugin/Info.plist +28 -0
- package/package.json +85 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "CapacitorUpdaterPlugin",
|
|
4
|
+
"slug": "capacitorupdaterplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "download",
|
|
10
|
+
"signature": "(options: { url: string; }) => Promise<{ version: string; }>",
|
|
11
|
+
"parameters": [
|
|
12
|
+
{
|
|
13
|
+
"name": "options",
|
|
14
|
+
"docs": "",
|
|
15
|
+
"type": "{ url: string; }"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"returns": "Promise<{ version: string; }>",
|
|
19
|
+
"tags": [
|
|
20
|
+
{
|
|
21
|
+
"name": "returns",
|
|
22
|
+
"text": "an Promise with version name of the downloaded version, version is generated by the plugin, it's a random string of 10 char length"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "param",
|
|
26
|
+
"text": "url The URL where download the version, it can be S3 github tag or whatever, it should be a zip file"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"docs": "Download a new version from the provided URL, it should be a zip file, with files inside or with a unique folder inside with all your files",
|
|
30
|
+
"complexTypes": [],
|
|
31
|
+
"slug": "download"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "set",
|
|
35
|
+
"signature": "(options: { version: string; versionName?: string; }) => Promise<void>",
|
|
36
|
+
"parameters": [
|
|
37
|
+
{
|
|
38
|
+
"name": "options",
|
|
39
|
+
"docs": "",
|
|
40
|
+
"type": "{ version: string; versionName?: string | undefined; }"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"returns": "Promise<void>",
|
|
44
|
+
"tags": [
|
|
45
|
+
{
|
|
46
|
+
"name": "returns",
|
|
47
|
+
"text": "an empty Promise when the version is set, if there are no index.html or no version folder throw an error"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "param",
|
|
51
|
+
"text": "version The version name to set as current version"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"docs": "Set version as current version, set will return an error if there are is no index.html file inside the version folder. `versionName` is optional and it's a custom value that will be saved for you",
|
|
55
|
+
"complexTypes": [],
|
|
56
|
+
"slug": "set"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "getId",
|
|
60
|
+
"signature": "() => Promise<{ id: string; }>",
|
|
61
|
+
"parameters": [],
|
|
62
|
+
"returns": "Promise<{ id: string; }>",
|
|
63
|
+
"tags": [
|
|
64
|
+
{
|
|
65
|
+
"name": "returns",
|
|
66
|
+
"text": "an Promise with id for this device"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"docs": "Get unique ID used to identify device into auto update server",
|
|
70
|
+
"complexTypes": [],
|
|
71
|
+
"slug": "getid"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "delete",
|
|
75
|
+
"signature": "(options: { version: string; }) => Promise<void>",
|
|
76
|
+
"parameters": [
|
|
77
|
+
{
|
|
78
|
+
"name": "options",
|
|
79
|
+
"docs": "",
|
|
80
|
+
"type": "{ version: string; }"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"returns": "Promise<void>",
|
|
84
|
+
"tags": [
|
|
85
|
+
{
|
|
86
|
+
"name": "returns",
|
|
87
|
+
"text": "an empty Promise when the version is delete, otherwise throw an error"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "param",
|
|
91
|
+
"text": "version The version name to delete"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"docs": "Delete version in storage",
|
|
95
|
+
"complexTypes": [],
|
|
96
|
+
"slug": "delete"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "list",
|
|
100
|
+
"signature": "() => Promise<{ versions: string[]; }>",
|
|
101
|
+
"parameters": [],
|
|
102
|
+
"returns": "Promise<{ versions: string[]; }>",
|
|
103
|
+
"tags": [
|
|
104
|
+
{
|
|
105
|
+
"name": "returns",
|
|
106
|
+
"text": "an Promise witht the version list"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"docs": "Get all available versions",
|
|
110
|
+
"complexTypes": [],
|
|
111
|
+
"slug": "list"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "reset",
|
|
115
|
+
"signature": "(options?: { toAutoUpdate?: boolean | undefined; } | undefined) => Promise<void>",
|
|
116
|
+
"parameters": [
|
|
117
|
+
{
|
|
118
|
+
"name": "options",
|
|
119
|
+
"docs": "",
|
|
120
|
+
"type": "{ toAutoUpdate?: boolean | undefined; } | undefined"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"returns": "Promise<void>",
|
|
124
|
+
"tags": [
|
|
125
|
+
{
|
|
126
|
+
"name": "returns",
|
|
127
|
+
"text": "an empty Promise"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "param",
|
|
131
|
+
"text": "toAutoUpdate [false] if yes it reset to to the last AutoUpdate version instead of `builtin`"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"docs": "Set the `builtin` version (the one sent to Apple store / Google play store ) as current version",
|
|
135
|
+
"complexTypes": [],
|
|
136
|
+
"slug": "reset"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "current",
|
|
140
|
+
"signature": "() => Promise<{ current: string; currentNative: string; }>",
|
|
141
|
+
"parameters": [],
|
|
142
|
+
"returns": "Promise<{ current: string; currentNative: string; }>",
|
|
143
|
+
"tags": [
|
|
144
|
+
{
|
|
145
|
+
"name": "returns",
|
|
146
|
+
"text": "an Promise with the current version name"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"docs": "Get the current version, if none are set it returns `builtin`, currentNative is the original version install on the device",
|
|
150
|
+
"complexTypes": [],
|
|
151
|
+
"slug": "current"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "reload",
|
|
155
|
+
"signature": "() => Promise<void>",
|
|
156
|
+
"parameters": [],
|
|
157
|
+
"returns": "Promise<void>",
|
|
158
|
+
"tags": [
|
|
159
|
+
{
|
|
160
|
+
"name": "returns",
|
|
161
|
+
"text": "an Promise resolved when the view is reloaded"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"docs": "Reload the view",
|
|
165
|
+
"complexTypes": [],
|
|
166
|
+
"slug": "reload"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "versionName",
|
|
170
|
+
"signature": "() => Promise<{ versionName: string; }>",
|
|
171
|
+
"parameters": [],
|
|
172
|
+
"returns": "Promise<{ versionName: string; }>",
|
|
173
|
+
"tags": [
|
|
174
|
+
{
|
|
175
|
+
"name": "returns",
|
|
176
|
+
"text": "an Promise witht the current versionName"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"docs": "Get the version name, if it was set during the set phase",
|
|
180
|
+
"complexTypes": [],
|
|
181
|
+
"slug": "versionname"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "notifyAppReady",
|
|
185
|
+
"signature": "() => Promise<void>",
|
|
186
|
+
"parameters": [],
|
|
187
|
+
"returns": "Promise<void>",
|
|
188
|
+
"tags": [
|
|
189
|
+
{
|
|
190
|
+
"name": "returns",
|
|
191
|
+
"text": "an Promise resolved directly"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"docs": "Notify native plugin that the update is working, only in auto-update",
|
|
195
|
+
"complexTypes": [],
|
|
196
|
+
"slug": "notifyappready"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "delayUpdate",
|
|
200
|
+
"signature": "() => Promise<void>",
|
|
201
|
+
"parameters": [],
|
|
202
|
+
"returns": "Promise<void>",
|
|
203
|
+
"tags": [
|
|
204
|
+
{
|
|
205
|
+
"name": "returns",
|
|
206
|
+
"text": "an Promise resolved directly"
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"docs": "Skip updates in the next time the app goes into the background, only in auto-update",
|
|
210
|
+
"complexTypes": [],
|
|
211
|
+
"slug": "delayupdate"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "cancelDelay",
|
|
215
|
+
"signature": "() => Promise<void>",
|
|
216
|
+
"parameters": [],
|
|
217
|
+
"returns": "Promise<void>",
|
|
218
|
+
"tags": [
|
|
219
|
+
{
|
|
220
|
+
"name": "returns",
|
|
221
|
+
"text": "an Promise resolved directly"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"docs": "allow update in the next time the app goes into the background, only in auto-update",
|
|
225
|
+
"complexTypes": [],
|
|
226
|
+
"slug": "canceldelay"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "addListener",
|
|
230
|
+
"signature": "(eventName: 'download', listenerFunc: DownloadChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
231
|
+
"parameters": [
|
|
232
|
+
{
|
|
233
|
+
"name": "eventName",
|
|
234
|
+
"docs": "",
|
|
235
|
+
"type": "'download'"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "listenerFunc",
|
|
239
|
+
"docs": "",
|
|
240
|
+
"type": "DownloadChangeListener"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
244
|
+
"tags": [
|
|
245
|
+
{
|
|
246
|
+
"name": "since",
|
|
247
|
+
"text": "2.0.11"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"docs": "Listen for download event in the App, let you know when the download is started, loading and finished",
|
|
251
|
+
"complexTypes": [
|
|
252
|
+
"PluginListenerHandle",
|
|
253
|
+
"DownloadChangeListener"
|
|
254
|
+
],
|
|
255
|
+
"slug": "addlistenerdownload"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "addListener",
|
|
259
|
+
"signature": "(eventName: 'majorAvailable', listenerFunc: MajorAvailableListener) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
260
|
+
"parameters": [
|
|
261
|
+
{
|
|
262
|
+
"name": "eventName",
|
|
263
|
+
"docs": "",
|
|
264
|
+
"type": "'majorAvailable'"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "listenerFunc",
|
|
268
|
+
"docs": "",
|
|
269
|
+
"type": "MajorAvailableListener"
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
273
|
+
"tags": [
|
|
274
|
+
{
|
|
275
|
+
"name": "since",
|
|
276
|
+
"text": "2.3.0"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"docs": "Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking",
|
|
280
|
+
"complexTypes": [
|
|
281
|
+
"PluginListenerHandle",
|
|
282
|
+
"MajorAvailableListener"
|
|
283
|
+
],
|
|
284
|
+
"slug": "addlistenermajoravailable"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "addListener",
|
|
288
|
+
"signature": "(eventName: 'updateAvailable', listenerFunc: UpdateAvailableListener) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
289
|
+
"parameters": [
|
|
290
|
+
{
|
|
291
|
+
"name": "eventName",
|
|
292
|
+
"docs": "",
|
|
293
|
+
"type": "'updateAvailable'"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "listenerFunc",
|
|
297
|
+
"docs": "",
|
|
298
|
+
"type": "UpdateAvailableListener"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
302
|
+
"tags": [
|
|
303
|
+
{
|
|
304
|
+
"name": "since",
|
|
305
|
+
"text": "2.3.0"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"docs": "Listen for update event in the App, let you know when update is ready to install at next app start",
|
|
309
|
+
"complexTypes": [
|
|
310
|
+
"PluginListenerHandle",
|
|
311
|
+
"UpdateAvailableListener"
|
|
312
|
+
],
|
|
313
|
+
"slug": "addlistenerupdateavailable"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "addListener",
|
|
317
|
+
"signature": "(eventName: string, listenerFunc: (...args: any[]) => any) => Promise<PluginListenerHandle>",
|
|
318
|
+
"parameters": [
|
|
319
|
+
{
|
|
320
|
+
"name": "eventName",
|
|
321
|
+
"docs": "",
|
|
322
|
+
"type": "string"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "listenerFunc",
|
|
326
|
+
"docs": "",
|
|
327
|
+
"type": "(...args: any[]) => any"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
331
|
+
"tags": [],
|
|
332
|
+
"docs": "",
|
|
333
|
+
"complexTypes": [
|
|
334
|
+
"PluginListenerHandle"
|
|
335
|
+
],
|
|
336
|
+
"slug": "addlistenerstring"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "removeAllListeners",
|
|
340
|
+
"signature": "() => Promise<void>",
|
|
341
|
+
"parameters": [],
|
|
342
|
+
"returns": "Promise<void>",
|
|
343
|
+
"tags": [],
|
|
344
|
+
"docs": "",
|
|
345
|
+
"complexTypes": [],
|
|
346
|
+
"slug": "removealllisteners"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"properties": [],
|
|
350
|
+
"importObject": [
|
|
351
|
+
"PluginListenerHandle",
|
|
352
|
+
"DownloadEvent",
|
|
353
|
+
"MajorAvailableEvent",
|
|
354
|
+
"UpdateAvailableEvent",
|
|
355
|
+
"DownloadChangeListener",
|
|
356
|
+
"MajorAvailableListener",
|
|
357
|
+
"UpdateAvailableListener"
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
"interfaces": [
|
|
361
|
+
{
|
|
362
|
+
"name": "PluginListenerHandle",
|
|
363
|
+
"slug": "pluginlistenerhandle",
|
|
364
|
+
"docs": "",
|
|
365
|
+
"tags": [],
|
|
366
|
+
"methods": [],
|
|
367
|
+
"properties": [
|
|
368
|
+
{
|
|
369
|
+
"name": "remove",
|
|
370
|
+
"tags": [],
|
|
371
|
+
"docs": "",
|
|
372
|
+
"complexTypes": [],
|
|
373
|
+
"type": "() => Promise<void>"
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"importObject": [
|
|
377
|
+
"PluginRegistry",
|
|
378
|
+
"CapacitorException",
|
|
379
|
+
"CapacitorGlobal",
|
|
380
|
+
"RegisterPlugin",
|
|
381
|
+
"PluginImplementations",
|
|
382
|
+
"Plugin",
|
|
383
|
+
"PermissionState",
|
|
384
|
+
"PluginResultData",
|
|
385
|
+
"PluginResultError",
|
|
386
|
+
"PluginCallback"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "DownloadEvent",
|
|
391
|
+
"slug": "downloadevent",
|
|
392
|
+
"docs": "",
|
|
393
|
+
"tags": [],
|
|
394
|
+
"methods": [],
|
|
395
|
+
"properties": [
|
|
396
|
+
{
|
|
397
|
+
"name": "percent",
|
|
398
|
+
"tags": [
|
|
399
|
+
{
|
|
400
|
+
"text": "2.0.11",
|
|
401
|
+
"name": "since"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"docs": "Current status of download, between 0 and 100.",
|
|
405
|
+
"complexTypes": [],
|
|
406
|
+
"type": "number"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"importObject": [
|
|
410
|
+
"PluginListenerHandle",
|
|
411
|
+
"MajorAvailableEvent",
|
|
412
|
+
"UpdateAvailableEvent",
|
|
413
|
+
"DownloadChangeListener",
|
|
414
|
+
"MajorAvailableListener",
|
|
415
|
+
"UpdateAvailableListener",
|
|
416
|
+
"CapacitorUpdaterPlugin"
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "MajorAvailableEvent",
|
|
421
|
+
"slug": "majoravailableevent",
|
|
422
|
+
"docs": "",
|
|
423
|
+
"tags": [],
|
|
424
|
+
"methods": [],
|
|
425
|
+
"properties": [
|
|
426
|
+
{
|
|
427
|
+
"name": "version",
|
|
428
|
+
"tags": [
|
|
429
|
+
{
|
|
430
|
+
"text": "2.3.0",
|
|
431
|
+
"name": "since"
|
|
432
|
+
}
|
|
433
|
+
],
|
|
434
|
+
"docs": "Emit when a new major version is available.",
|
|
435
|
+
"complexTypes": [],
|
|
436
|
+
"type": "string"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"importObject": [
|
|
440
|
+
"PluginListenerHandle",
|
|
441
|
+
"DownloadEvent",
|
|
442
|
+
"UpdateAvailableEvent",
|
|
443
|
+
"DownloadChangeListener",
|
|
444
|
+
"MajorAvailableListener",
|
|
445
|
+
"UpdateAvailableListener",
|
|
446
|
+
"CapacitorUpdaterPlugin"
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "UpdateAvailableEvent",
|
|
451
|
+
"slug": "updateavailableevent",
|
|
452
|
+
"docs": "",
|
|
453
|
+
"tags": [],
|
|
454
|
+
"methods": [],
|
|
455
|
+
"properties": [
|
|
456
|
+
{
|
|
457
|
+
"name": "version",
|
|
458
|
+
"tags": [
|
|
459
|
+
{
|
|
460
|
+
"text": "3.0.0",
|
|
461
|
+
"name": "since"
|
|
462
|
+
}
|
|
463
|
+
],
|
|
464
|
+
"docs": "Emit when a new update is available.",
|
|
465
|
+
"complexTypes": [],
|
|
466
|
+
"type": "string"
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"importObject": [
|
|
470
|
+
"PluginListenerHandle",
|
|
471
|
+
"DownloadEvent",
|
|
472
|
+
"MajorAvailableEvent",
|
|
473
|
+
"DownloadChangeListener",
|
|
474
|
+
"MajorAvailableListener",
|
|
475
|
+
"UpdateAvailableListener",
|
|
476
|
+
"CapacitorUpdaterPlugin"
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"enums": [],
|
|
481
|
+
"typeAliases": [
|
|
482
|
+
{
|
|
483
|
+
"name": "DownloadChangeListener",
|
|
484
|
+
"slug": "downloadchangelistener",
|
|
485
|
+
"docs": "",
|
|
486
|
+
"types": [
|
|
487
|
+
{
|
|
488
|
+
"text": "(state: DownloadEvent): void",
|
|
489
|
+
"complexTypes": [
|
|
490
|
+
"DownloadEvent"
|
|
491
|
+
]
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "MajorAvailableListener",
|
|
497
|
+
"slug": "majoravailablelistener",
|
|
498
|
+
"docs": "",
|
|
499
|
+
"types": [
|
|
500
|
+
{
|
|
501
|
+
"text": "(state: MajorAvailableEvent): void",
|
|
502
|
+
"complexTypes": [
|
|
503
|
+
"MajorAvailableEvent"
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "UpdateAvailableListener",
|
|
510
|
+
"slug": "updateavailablelistener",
|
|
511
|
+
"docs": "",
|
|
512
|
+
"types": [
|
|
513
|
+
{
|
|
514
|
+
"text": "(state: UpdateAvailableEvent): void",
|
|
515
|
+
"complexTypes": [
|
|
516
|
+
"UpdateAvailableEvent"
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
"pluginConfigs": []
|
|
523
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
export interface DownloadEvent {
|
|
3
|
+
/**
|
|
4
|
+
* Current status of download, between 0 and 100.
|
|
5
|
+
*
|
|
6
|
+
* @since 2.0.11
|
|
7
|
+
*/
|
|
8
|
+
percent: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MajorAvailableEvent {
|
|
11
|
+
/**
|
|
12
|
+
* Emit when a new major version is available.
|
|
13
|
+
*
|
|
14
|
+
* @since 2.3.0
|
|
15
|
+
*/
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UpdateAvailableEvent {
|
|
19
|
+
/**
|
|
20
|
+
* Emit when a new update is available.
|
|
21
|
+
*
|
|
22
|
+
* @since 3.0.0
|
|
23
|
+
*/
|
|
24
|
+
version: string;
|
|
25
|
+
}
|
|
26
|
+
export declare type DownloadChangeListener = (state: DownloadEvent) => void;
|
|
27
|
+
export declare type MajorAvailableListener = (state: MajorAvailableEvent) => void;
|
|
28
|
+
export declare type UpdateAvailableListener = (state: UpdateAvailableEvent) => void;
|
|
29
|
+
export interface CapacitorUpdaterPlugin {
|
|
30
|
+
/**
|
|
31
|
+
* Download a new version from the provided URL, it should be a zip file, with files inside or with a unique folder inside with all your files
|
|
32
|
+
* @returns {Promise<{version: string}>} an Promise with version name of the downloaded version, version is generated by the plugin, it's a random string of 10 char length
|
|
33
|
+
* @param url The URL where download the version, it can be S3 github tag or whatever, it should be a zip file
|
|
34
|
+
*/
|
|
35
|
+
download(options: {
|
|
36
|
+
url: string;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
version: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Set version as current version, set will return an error if there are is no index.html file inside the version folder. `versionName` is optional and it's a custom value that will be saved for you
|
|
42
|
+
* @returns {Promise<void>} an empty Promise when the version is set, if there are no index.html or no version folder throw an error
|
|
43
|
+
* @param version The version name to set as current version
|
|
44
|
+
*/
|
|
45
|
+
set(options: {
|
|
46
|
+
version: string;
|
|
47
|
+
versionName?: string;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Get unique ID used to identify device into auto update server
|
|
51
|
+
* @returns {Promise<{ id: string }>} an Promise with id for this device
|
|
52
|
+
*/
|
|
53
|
+
getId(): Promise<{
|
|
54
|
+
id: string;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete version in storage
|
|
58
|
+
* @returns {Promise<void>} an empty Promise when the version is delete, otherwise throw an error
|
|
59
|
+
* @param version The version name to delete
|
|
60
|
+
*/
|
|
61
|
+
delete(options: {
|
|
62
|
+
version: string;
|
|
63
|
+
}): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Get all available versions
|
|
66
|
+
* @returns {Promise<{version: string[]}>} an Promise witht the version list
|
|
67
|
+
*/
|
|
68
|
+
list(): Promise<{
|
|
69
|
+
versions: string[];
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Set the `builtin` version (the one sent to Apple store / Google play store ) as current version
|
|
73
|
+
* @returns {Promise<void>} an empty Promise
|
|
74
|
+
* @param toAutoUpdate [false] if yes it reset to to the last AutoUpdate version instead of `builtin`
|
|
75
|
+
*/
|
|
76
|
+
reset(options?: {
|
|
77
|
+
toAutoUpdate?: boolean;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the current version, if none are set it returns `builtin`, currentNative is the original version install on the device
|
|
81
|
+
* @returns {Promise<{ current: string, currentNative: string }>} an Promise with the current version name
|
|
82
|
+
*/
|
|
83
|
+
current(): Promise<{
|
|
84
|
+
current: string;
|
|
85
|
+
currentNative: string;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Reload the view
|
|
89
|
+
* @returns {Promise<void>} an Promise resolved when the view is reloaded
|
|
90
|
+
*/
|
|
91
|
+
reload(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Get the version name, if it was set during the set phase
|
|
94
|
+
* @returns {Promise<{ versionName: string }>} an Promise witht the current versionName
|
|
95
|
+
*/
|
|
96
|
+
versionName(): Promise<{
|
|
97
|
+
versionName: string;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Notify native plugin that the update is working, only in auto-update
|
|
101
|
+
* @returns {Promise<void>} an Promise resolved directly
|
|
102
|
+
*/
|
|
103
|
+
notifyAppReady(): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Skip updates in the next time the app goes into the background, only in auto-update
|
|
106
|
+
* @returns {Promise<void>} an Promise resolved directly
|
|
107
|
+
*/
|
|
108
|
+
delayUpdate(): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* allow update in the next time the app goes into the background, only in auto-update
|
|
111
|
+
* @returns {Promise<void>} an Promise resolved directly
|
|
112
|
+
*/
|
|
113
|
+
cancelDelay(): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Listen for download event in the App, let you know when the download is started, loading and finished
|
|
116
|
+
*
|
|
117
|
+
* @since 2.0.11
|
|
118
|
+
*/
|
|
119
|
+
addListener(eventName: 'download', listenerFunc: DownloadChangeListener): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
120
|
+
/**
|
|
121
|
+
* Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking
|
|
122
|
+
*
|
|
123
|
+
* @since 2.3.0
|
|
124
|
+
*/
|
|
125
|
+
addListener(eventName: 'majorAvailable', listenerFunc: MajorAvailableListener): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
126
|
+
/**
|
|
127
|
+
* Listen for update event in the App, let you know when update is ready to install at next app start
|
|
128
|
+
*
|
|
129
|
+
* @since 2.3.0
|
|
130
|
+
*/
|
|
131
|
+
addListener(eventName: 'updateAvailable', listenerFunc: UpdateAvailableListener): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
132
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const CapacitorUpdater = registerPlugin('CapacitorUpdater', {
|
|
3
|
+
web: () => import('./web').then(m => new m.CapacitorUpdaterWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { CapacitorUpdater };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,gBAAgB,GAAG,cAAc,CACrC,kBAAkB,EAClB;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;CAClE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|