@capgo/capacitor-updater 5.3.56 → 5.4.1
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/README.md +152 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +52 -1
- package/dist/docs.json +116 -1
- package/dist/esm/definitions.d.ts +42 -1
- package/dist/esm/web.d.ts +9 -0
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +12 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +12 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorUpdaterPlugin.m +3 -0
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +46 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
[](https://console.algora.io/org/Capgo/bounties?status=open)
|
|
16
16
|
[](https://console.algora.io/org/Capgo/bounties?status=completed)
|
|
17
17
|
|
|
18
|
+
<h2><a href="https://capgo.app/consulting/">Hire a Capacitor consultant</a></h2>
|
|
19
|
+
|
|
18
20
|
Update Ionic Capacitor apps without App/Play Store review (Code-push / hot-code updates).
|
|
19
21
|
|
|
20
22
|
You have 3 ways possible :
|
|
@@ -141,11 +143,110 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
|
|
|
141
143
|
- Do not password encrypt the bundle zip file, or it will fail to unpack.
|
|
142
144
|
- Make sure the bundle does not contain any extra hidden files or folders, or it may fail to unpack.
|
|
143
145
|
|
|
146
|
+
## Updater Plugin Config
|
|
147
|
+
|
|
148
|
+
<docgen-config>
|
|
149
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
150
|
+
|
|
151
|
+
CapacitorUpdater can be configured with this options:
|
|
152
|
+
|
|
153
|
+
| Prop | Type | Description | Default | Since |
|
|
154
|
+
| ------------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------- |
|
|
155
|
+
| **`appReadyTimeout`** | <code>number</code> | Configure the number of milliseconds the native plugin should wait before considering an update 'failed'. Only available for Android and iOS. | <code>10000 // (10 seconds)</code> | |
|
|
156
|
+
| **`responseTimeout`** | <code>number</code> | Configure the number of milliseconds the native plugin should wait before considering API timeout. Only available for Android and iOS. | <code>20 // (20 second)</code> | |
|
|
157
|
+
| **`autoDeleteFailed`** | <code>boolean</code> | Configure whether the plugin should use automatically delete failed bundles. Only available for Android and iOS. | <code>true</code> | |
|
|
158
|
+
| **`autoDeletePrevious`** | <code>boolean</code> | Configure whether the plugin should use automatically delete previous bundles after a successful update. Only available for Android and iOS. | <code>true</code> | |
|
|
159
|
+
| **`autoUpdate`** | <code>boolean</code> | Configure whether the plugin should use Auto Update via an update server. Only available for Android and iOS. | <code>true</code> | |
|
|
160
|
+
| **`resetWhenUpdate`** | <code>boolean</code> | Automatically delete previous downloaded bundles when a newer native app bundle is installed to the device. Only available for Android and iOS. | <code>true</code> | |
|
|
161
|
+
| **`updateUrl`** | <code>string</code> | Configure the URL / endpoint to which update checks are sent. Only available for Android and iOS. | <code>https://api.capgo.app/auto_update</code> | |
|
|
162
|
+
| **`statsUrl`** | <code>string</code> | Configure the URL / endpoint to which update statistics are sent. Only available for Android and iOS. Set to "" to disable stats reporting. | <code>https://api.capgo.app/stats</code> | |
|
|
163
|
+
| **`privateKey`** | <code>string</code> | Configure the private key for end to end live update encryption. Only available for Android and iOS. | <code>undefined</code> | |
|
|
164
|
+
| **`version`** | <code>string</code> | Configure the current version of the app. This will be used for the first update request. If not set, the plugin will get the version from the native code. Only available for Android and iOS. | <code>undefined</code> | 4.17.48 |
|
|
165
|
+
| **`directUpdate`** | <code>boolean</code> | Make the plugin direct install the update when the app what just updated/installed. Only for autoUpdate mode. Only available for Android and iOS. | <code>undefined</code> | 5.1.0 |
|
|
166
|
+
| **`periodCheckDelay`** | <code>number</code> | Configure the delay period for period update check. the unit is in seconds. Only available for Android and iOS. Cannot be less than 600 seconds (10 minutes). | <code>600 // (10 minutes)</code> | |
|
|
167
|
+
| **`localS3`** | <code>boolean</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
|
|
168
|
+
| **`localHost`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
|
|
169
|
+
| **`localWebHost`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
|
|
170
|
+
| **`localSupa`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
|
|
171
|
+
| **`localSupaAnon`** | <code>string</code> | Configure the CLI to use a local server for testing. | <code>undefined</code> | 4.17.48 |
|
|
172
|
+
| **`allowModifyUrl`** | <code>boolean</code> | Allow the plugin to modify the updateUrl, statsUrl and channelUrl dynamically from the JavaScript side. | <code>false</code> | 5.4.0 |
|
|
173
|
+
|
|
174
|
+
### Examples
|
|
175
|
+
|
|
176
|
+
In `capacitor.config.json`:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"plugins": {
|
|
181
|
+
"CapacitorUpdater": {
|
|
182
|
+
"appReadyTimeout": 1000 // (1 second),
|
|
183
|
+
"responseTimeout": 10 // (10 second),
|
|
184
|
+
"autoDeleteFailed": false,
|
|
185
|
+
"autoDeletePrevious": false,
|
|
186
|
+
"autoUpdate": false,
|
|
187
|
+
"resetWhenUpdate": false,
|
|
188
|
+
"updateUrl": https://example.com/api/auto_update,
|
|
189
|
+
"statsUrl": https://example.com/api/stats,
|
|
190
|
+
"privateKey": undefined,
|
|
191
|
+
"version": undefined,
|
|
192
|
+
"directUpdate": undefined,
|
|
193
|
+
"periodCheckDelay": undefined,
|
|
194
|
+
"localS3": undefined,
|
|
195
|
+
"localHost": undefined,
|
|
196
|
+
"localWebHost": undefined,
|
|
197
|
+
"localSupa": undefined,
|
|
198
|
+
"localSupaAnon": undefined,
|
|
199
|
+
"allowModifyUrl": undefined
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
In `capacitor.config.ts`:
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
/// <reference types="@capgo/capacitor-updater" />
|
|
209
|
+
|
|
210
|
+
import { CapacitorConfig } from '@capacitor/cli';
|
|
211
|
+
|
|
212
|
+
const config: CapacitorConfig = {
|
|
213
|
+
plugins: {
|
|
214
|
+
CapacitorUpdater: {
|
|
215
|
+
appReadyTimeout: 1000 // (1 second),
|
|
216
|
+
responseTimeout: 10 // (10 second),
|
|
217
|
+
autoDeleteFailed: false,
|
|
218
|
+
autoDeletePrevious: false,
|
|
219
|
+
autoUpdate: false,
|
|
220
|
+
resetWhenUpdate: false,
|
|
221
|
+
updateUrl: https://example.com/api/auto_update,
|
|
222
|
+
statsUrl: https://example.com/api/stats,
|
|
223
|
+
privateKey: undefined,
|
|
224
|
+
version: undefined,
|
|
225
|
+
directUpdate: undefined,
|
|
226
|
+
periodCheckDelay: undefined,
|
|
227
|
+
localS3: undefined,
|
|
228
|
+
localHost: undefined,
|
|
229
|
+
localWebHost: undefined,
|
|
230
|
+
localSupa: undefined,
|
|
231
|
+
localSupaAnon: undefined,
|
|
232
|
+
allowModifyUrl: undefined,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export default config;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
</docgen-config>
|
|
241
|
+
|
|
144
242
|
## API
|
|
145
243
|
|
|
146
244
|
<docgen-index>
|
|
147
245
|
|
|
148
246
|
* [`notifyAppReady()`](#notifyappready)
|
|
247
|
+
* [`setUpdateUrl(...)`](#setupdateurl)
|
|
248
|
+
* [`setStatsUrl(...)`](#setstatsurl)
|
|
249
|
+
* [`setChannelUrl(...)`](#setchannelurl)
|
|
149
250
|
* [`download(...)`](#download)
|
|
150
251
|
* [`next(...)`](#next)
|
|
151
252
|
* [`set(...)`](#set)
|
|
@@ -198,6 +299,57 @@ Change this behaviour with {@link appReadyTimeout}
|
|
|
198
299
|
--------------------
|
|
199
300
|
|
|
200
301
|
|
|
302
|
+
### setUpdateUrl(...)
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
setUpdateUrl(options: { url: string; }) => Promise<void>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Set the updateUrl for the app, this will be used to check for updates.
|
|
309
|
+
|
|
310
|
+
| Param | Type |
|
|
311
|
+
| ------------- | ----------------------------- |
|
|
312
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
313
|
+
|
|
314
|
+
**Since:** 5.4.0
|
|
315
|
+
|
|
316
|
+
--------------------
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
### setStatsUrl(...)
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
setStatsUrl(options: { url: string; }) => Promise<void>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Set the statsUrl for the app, this will be used to send statistics.
|
|
326
|
+
|
|
327
|
+
| Param | Type |
|
|
328
|
+
| ------------- | ----------------------------- |
|
|
329
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
330
|
+
|
|
331
|
+
**Since:** 5.4.0
|
|
332
|
+
|
|
333
|
+
--------------------
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
### setChannelUrl(...)
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
setChannelUrl(options: { url: string; }) => Promise<void>
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Set the channelUrl for the app, this will be used to set the channel.
|
|
343
|
+
|
|
344
|
+
| Param | Type |
|
|
345
|
+
| ------------- | ----------------------------- |
|
|
346
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
347
|
+
|
|
348
|
+
**Since:** 5.4.0
|
|
349
|
+
|
|
350
|
+
--------------------
|
|
351
|
+
|
|
352
|
+
|
|
201
353
|
### download(...)
|
|
202
354
|
|
|
203
355
|
```typescript
|
|
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "5.
|
|
58
|
+
private final String PLUGIN_VERSION = "5.4.1";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -364,6 +364,57 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
+
@PluginMethod
|
|
368
|
+
public void setUpdateUrl(final PluginCall call) {
|
|
369
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
370
|
+
Log.e(CapacitorUpdater.TAG, "setUpdateUrl not allowed");
|
|
371
|
+
call.reject("setUpdateUrl not allowed");
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
final String url = call.getString("url");
|
|
375
|
+
if (url == null) {
|
|
376
|
+
Log.e(CapacitorUpdater.TAG, "setUpdateUrl called without url");
|
|
377
|
+
call.reject("setUpdateUrl called without url");
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
this.updateUrl = url;
|
|
381
|
+
call.resolve();
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
@PluginMethod
|
|
385
|
+
public void setStatsUrl(final PluginCall call) {
|
|
386
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
387
|
+
Log.e(CapacitorUpdater.TAG, "setStatsUrl not allowed");
|
|
388
|
+
call.reject("setStatsUrl not allowed");
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
final String url = call.getString("url");
|
|
392
|
+
if (url == null) {
|
|
393
|
+
Log.e(CapacitorUpdater.TAG, "setStatsUrl called without url");
|
|
394
|
+
call.reject("setStatsUrl called without url");
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
this.implementation.statsUrl = url;
|
|
398
|
+
call.resolve();
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
@PluginMethod
|
|
402
|
+
public void setChannelUrl(final PluginCall call) {
|
|
403
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
404
|
+
Log.e(CapacitorUpdater.TAG, "setChannelUrl not allowed");
|
|
405
|
+
call.reject("setChannelUrl not allowed");
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
final String url = call.getString("url");
|
|
409
|
+
if (url == null) {
|
|
410
|
+
Log.e(CapacitorUpdater.TAG, "setChannelUrl called without url");
|
|
411
|
+
call.reject("setChannelUrl called without url");
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
this.implementation.channelUrl = url;
|
|
415
|
+
call.resolve();
|
|
416
|
+
}
|
|
417
|
+
|
|
367
418
|
@PluginMethod
|
|
368
419
|
public void getBuiltinVersion(final PluginCall call) {
|
|
369
420
|
try {
|
package/dist/docs.json
CHANGED
|
@@ -26,6 +26,105 @@
|
|
|
26
26
|
],
|
|
27
27
|
"slug": "notifyappready"
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"name": "setUpdateUrl",
|
|
31
|
+
"signature": "(options: { url: string; }) => Promise<void>",
|
|
32
|
+
"parameters": [
|
|
33
|
+
{
|
|
34
|
+
"name": "options",
|
|
35
|
+
"docs": "",
|
|
36
|
+
"type": "{ url: string; }"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"returns": "Promise<void>",
|
|
40
|
+
"tags": [
|
|
41
|
+
{
|
|
42
|
+
"name": "returns",
|
|
43
|
+
"text": "an empty Promise"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "param",
|
|
47
|
+
"text": "url The URL to use for checking for updates."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "throws",
|
|
51
|
+
"text": "An error if the something went wrong"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "since",
|
|
55
|
+
"text": "5.4.0"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"docs": "Set the updateUrl for the app, this will be used to check for updates.",
|
|
59
|
+
"complexTypes": [],
|
|
60
|
+
"slug": "setupdateurl"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "setStatsUrl",
|
|
64
|
+
"signature": "(options: { url: string; }) => Promise<void>",
|
|
65
|
+
"parameters": [
|
|
66
|
+
{
|
|
67
|
+
"name": "options",
|
|
68
|
+
"docs": "",
|
|
69
|
+
"type": "{ url: string; }"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"returns": "Promise<void>",
|
|
73
|
+
"tags": [
|
|
74
|
+
{
|
|
75
|
+
"name": "returns",
|
|
76
|
+
"text": "an empty Promise"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "param",
|
|
80
|
+
"text": "url The URL to use for sending statistics."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "throws",
|
|
84
|
+
"text": "An error if the something went wrong"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "since",
|
|
88
|
+
"text": "5.4.0"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"docs": "Set the statsUrl for the app, this will be used to send statistics.",
|
|
92
|
+
"complexTypes": [],
|
|
93
|
+
"slug": "setstatsurl"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "setChannelUrl",
|
|
97
|
+
"signature": "(options: { url: string; }) => Promise<void>",
|
|
98
|
+
"parameters": [
|
|
99
|
+
{
|
|
100
|
+
"name": "options",
|
|
101
|
+
"docs": "",
|
|
102
|
+
"type": "{ url: string; }"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"returns": "Promise<void>",
|
|
106
|
+
"tags": [
|
|
107
|
+
{
|
|
108
|
+
"name": "returns",
|
|
109
|
+
"text": "an empty Promise"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "param",
|
|
113
|
+
"text": "url The URL to use for setting the channel."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "throws",
|
|
117
|
+
"text": "An error if the something went wrong"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "since",
|
|
121
|
+
"text": "5.4.0"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"docs": "Set the channelUrl for the app, this will be used to set the channel.",
|
|
125
|
+
"complexTypes": [],
|
|
126
|
+
"slug": "setchannelurl"
|
|
127
|
+
},
|
|
29
128
|
{
|
|
30
129
|
"name": "download",
|
|
31
130
|
"signature": "(options: { url: string; version: string; sessionKey?: string; checksum?: string; }) => Promise<BundleInfo>",
|
|
@@ -1743,9 +1842,25 @@
|
|
|
1743
1842
|
"docs": "Configure the CLI to use a local server for testing.",
|
|
1744
1843
|
"complexTypes": [],
|
|
1745
1844
|
"type": "string | undefined"
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
"name": "allowModifyUrl",
|
|
1848
|
+
"tags": [
|
|
1849
|
+
{
|
|
1850
|
+
"text": "false",
|
|
1851
|
+
"name": "default"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
"text": "5.4.0",
|
|
1855
|
+
"name": "since"
|
|
1856
|
+
}
|
|
1857
|
+
],
|
|
1858
|
+
"docs": "Allow the plugin to modify the updateUrl, statsUrl and channelUrl dynamically from the JavaScript side.",
|
|
1859
|
+
"complexTypes": [],
|
|
1860
|
+
"type": "boolean | undefined"
|
|
1746
1861
|
}
|
|
1747
1862
|
],
|
|
1748
|
-
"docs": "
|
|
1863
|
+
"docs": "CapacitorUpdater can be configured with this options:"
|
|
1749
1864
|
}
|
|
1750
1865
|
]
|
|
1751
1866
|
}
|
|
@@ -2,7 +2,7 @@ import type { PluginListenerHandle } from "@capacitor/core";
|
|
|
2
2
|
declare module "@capacitor/cli" {
|
|
3
3
|
interface PluginsConfig {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* CapacitorUpdater can be configured with this options:
|
|
6
6
|
*/
|
|
7
7
|
CapacitorUpdater?: {
|
|
8
8
|
/**
|
|
@@ -153,6 +153,14 @@ declare module "@capacitor/cli" {
|
|
|
153
153
|
* @since 4.17.48
|
|
154
154
|
*/
|
|
155
155
|
localSupaAnon?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Allow the plugin to modify the updateUrl, statsUrl and channelUrl dynamically from the JavaScript side.
|
|
158
|
+
*
|
|
159
|
+
*
|
|
160
|
+
* @default false
|
|
161
|
+
* @since 5.4.0
|
|
162
|
+
*/
|
|
163
|
+
allowModifyUrl?: boolean;
|
|
156
164
|
};
|
|
157
165
|
}
|
|
158
166
|
}
|
|
@@ -306,6 +314,39 @@ export interface CapacitorUpdaterPlugin {
|
|
|
306
314
|
notifyAppReady(): Promise<{
|
|
307
315
|
bundle: BundleInfo;
|
|
308
316
|
}>;
|
|
317
|
+
/**
|
|
318
|
+
* Set the updateUrl for the app, this will be used to check for updates.
|
|
319
|
+
*
|
|
320
|
+
* @returns {Promise<void>} an empty Promise
|
|
321
|
+
* @param url The URL to use for checking for updates.
|
|
322
|
+
* @throws An error if the something went wrong
|
|
323
|
+
* @since 5.4.0
|
|
324
|
+
*/
|
|
325
|
+
setUpdateUrl(options: {
|
|
326
|
+
url: string;
|
|
327
|
+
}): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Set the statsUrl for the app, this will be used to send statistics.
|
|
330
|
+
*
|
|
331
|
+
* @returns {Promise<void>} an empty Promise
|
|
332
|
+
* @param url The URL to use for sending statistics.
|
|
333
|
+
* @throws An error if the something went wrong
|
|
334
|
+
* @since 5.4.0
|
|
335
|
+
*/
|
|
336
|
+
setStatsUrl(options: {
|
|
337
|
+
url: string;
|
|
338
|
+
}): Promise<void>;
|
|
339
|
+
/**
|
|
340
|
+
* Set the channelUrl for the app, this will be used to set the channel.
|
|
341
|
+
*
|
|
342
|
+
* @returns {Promise<void>} an empty Promise
|
|
343
|
+
* @param url The URL to use for setting the channel.
|
|
344
|
+
* @throws An error if the something went wrong
|
|
345
|
+
* @since 5.4.0
|
|
346
|
+
*/
|
|
347
|
+
setChannelUrl(options: {
|
|
348
|
+
url: string;
|
|
349
|
+
}): Promise<void>;
|
|
309
350
|
/**
|
|
310
351
|
* Download a new bundle from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files
|
|
311
352
|
*
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { WebPlugin } from "@capacitor/core";
|
|
2
2
|
import type { CapacitorUpdaterPlugin, BundleInfo, latestVersion, DelayCondition, channelRes, SetChannelOptions, getChannelRes, SetCustomIdOptions, UnsetChannelOptions } from "./definitions";
|
|
3
3
|
export declare class CapacitorUpdaterWeb extends WebPlugin implements CapacitorUpdaterPlugin {
|
|
4
|
+
setStatsUrl(options: {
|
|
5
|
+
url: string;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
setUpdateUrl(options: {
|
|
8
|
+
url: string;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
setChannelUrl(options: {
|
|
11
|
+
url: string;
|
|
12
|
+
}): Promise<void>;
|
|
4
13
|
download(options: {
|
|
5
14
|
url: string;
|
|
6
15
|
version?: string;
|
package/dist/esm/web.js
CHANGED
|
@@ -12,6 +12,18 @@ const BUNDLE_BUILTIN = {
|
|
|
12
12
|
checksum: "",
|
|
13
13
|
};
|
|
14
14
|
export class CapacitorUpdaterWeb extends WebPlugin {
|
|
15
|
+
async setStatsUrl(options) {
|
|
16
|
+
console.warn("Cannot setStatsUrl in web", options);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
async setUpdateUrl(options) {
|
|
20
|
+
console.warn("Cannot setUpdateUrl in web", options);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
async setChannelUrl(options) {
|
|
24
|
+
console.warn("Cannot setChannelUrl in web", options);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
15
27
|
async download(options) {
|
|
16
28
|
console.warn("Cannot download version in web", options);
|
|
17
29
|
return BUNDLE_BUILTIN;
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,MAAM,cAAc,GAAe;IACjC,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,0BAA0B;IACtC,EAAE,EAAE,SAAS;IACb,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,OAAO,mBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,QAAQ,CAAC,OAGd;QACC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACtD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAuB;QAC/B,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;QACzD,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW;QACf,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjC,CAAC;IACD,KAAK,CAAC,iBAAiB;QACrB,OAAO,CAAC,IAA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AK,CAAC,UAAU;QACd,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACzC,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,0BAA0B;SAClC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,cAAc;QAClB,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,OAEnB;QACC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC,CAAC;QACtE,OAAO;IACT,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,KAAK,CAAC,WAAW;QACf,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC1C,OAAO;IACT,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -24,6 +24,18 @@ const BUNDLE_BUILTIN = {
|
|
|
24
24
|
checksum: "",
|
|
25
25
|
};
|
|
26
26
|
class CapacitorUpdaterWeb extends core.WebPlugin {
|
|
27
|
+
async setStatsUrl(options) {
|
|
28
|
+
console.warn("Cannot setStatsUrl in web", options);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
async setUpdateUrl(options) {
|
|
32
|
+
console.warn("Cannot setUpdateUrl in web", options);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
async setChannelUrl(options) {
|
|
36
|
+
console.warn("Cannot setChannelUrl in web", options);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
27
39
|
async download(options) {
|
|
28
40
|
console.warn("Cannot download version in web", options);
|
|
29
41
|
return BUNDLE_BUILTIN;
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEK,MAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;AAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACvE,CAAC;;ACRD;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,GAAG;AACvB,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,UAAU,EAAE,0BAA0B;AAC1C,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,QAAQ,EAAE,EAAE;AAChB,CAAC,CAAC;AACK,MAAM,mBAAmB,SAASC,cAAS,CAAC;AACnD,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,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;AACjD,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,OAAO;AAC3B,YAAY,KAAK,EAAE,0BAA0B;AAC7C,SAAS,CAAC;AACV,KAAK;AACL,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AACvD,QAAQ,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAC1C,KAAK;AACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/H,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,QAAQ,CAAC,MAAM,EAAE;AAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AACvD,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAClD,QAAQ,OAAO;AACf,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async setStatsUrl(options) {\n console.warn(\"Cannot setStatsUrl in web\", options);\n return;\n }\n async setUpdateUrl(options) {\n console.warn(\"Cannot setUpdateUrl in web\", options);\n return;\n }\n async setChannelUrl(options) {\n console.warn(\"Cannot setChannelUrl in web\", options);\n return;\n }\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEK,MAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;AAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACvE,CAAC;;ACRD;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,GAAG;AACvB,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,UAAU,EAAE,0BAA0B;AAC1C,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,QAAQ,EAAE,EAAE;AAChB,CAAC,CAAC;AACK,MAAM,mBAAmB,SAASC,cAAS,CAAC;AACnD,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;AAC3D,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QA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
};
|
|
25
25
|
class CapacitorUpdaterWeb extends core.WebPlugin {
|
|
26
|
+
async setStatsUrl(options) {
|
|
27
|
+
console.warn("Cannot setStatsUrl in web", options);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
async setUpdateUrl(options) {
|
|
31
|
+
console.warn("Cannot setUpdateUrl in web", options);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
async setChannelUrl(options) {
|
|
35
|
+
console.warn("Cannot setChannelUrl in web", options);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
26
38
|
async download(options) {
|
|
27
39
|
console.warn("Cannot download version in web", options);
|
|
28
40
|
return BUNDLE_BUILTIN;
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IAC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,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAClD,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async setStatsUrl(options) {\n console.warn(\"Cannot setStatsUrl in web\", options);\n return;\n }\n async setUpdateUrl(options) {\n console.warn(\"Cannot setUpdateUrl in web\", options);\n return;\n }\n async setChannelUrl(options) {\n console.warn(\"Cannot setChannelUrl in web\", options);\n return;\n }\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AAEK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IACvE,CAAC;;IC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G,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/H,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,QAAQ,CAAC,MAAM,EAAE;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IACvD,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAClD,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
6
|
CAP_PLUGIN(CapacitorUpdaterPlugin, "CapacitorUpdater",
|
|
7
7
|
CAP_PLUGIN_METHOD(download, CAPPluginReturnPromise);
|
|
8
|
+
CAP_PLUGIN_METHOD(setUpdateUrl, CAPPluginReturnPromise);
|
|
9
|
+
CAP_PLUGIN_METHOD(setStatsUrl, CAPPluginReturnPromise);
|
|
10
|
+
CAP_PLUGIN_METHOD(setChannelUrl, CAPPluginReturnPromise);
|
|
8
11
|
CAP_PLUGIN_METHOD(set, CAPPluginReturnPromise);
|
|
9
12
|
CAP_PLUGIN_METHOD(list, CAPPluginReturnPromise);
|
|
10
13
|
CAP_PLUGIN_METHOD(delete, CAPPluginReturnPromise);
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
public var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "5.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.4.1"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|
|
@@ -141,6 +141,51 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
@objc func setUpdateUrl(_ call: CAPPluginCall) {
|
|
145
|
+
guard let allowModifyUrl = call.getBool("allowModifyUrl") else {
|
|
146
|
+
print("\(self.implementation.TAG) setUpdateUrl called without allowModifyUrl")
|
|
147
|
+
call.reject("setUpdateUrl called without allowModifyUrl")
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
guard let url = call.getString("url") else {
|
|
151
|
+
print("\(self.implementation.TAG) setUpdateUrl called without url")
|
|
152
|
+
call.reject("setUpdateUrl called without url")
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
self.updateUrl = url
|
|
156
|
+
call.resolve()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@objc func setStatsUrl(_ call: CAPPluginCall) {
|
|
160
|
+
guard let allowModifyUrl = call.getBool("allowModifyUrl") else {
|
|
161
|
+
print("\(self.implementation.TAG) setStatsUrl called without allowModifyUrl")
|
|
162
|
+
call.reject("setStatsUrl called without allowModifyUrl")
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
guard let url = call.getString("url") else {
|
|
166
|
+
print("\(self.implementation.TAG) setStatsUrl called without url")
|
|
167
|
+
call.reject("setStatsUrl called without url")
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
self.statsUrl = url
|
|
171
|
+
call.resolve()
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@objc func setChannelUrl(_ call: CAPPluginCall) {
|
|
175
|
+
guard let allowModifyUrl = call.getBool("allowModifyUrl") else {
|
|
176
|
+
print("\(self.implementation.TAG) setChannelUrl called without allowModifyUrl")
|
|
177
|
+
call.reject("setChannelUrl called without allowModifyUrl")
|
|
178
|
+
return
|
|
179
|
+
}
|
|
180
|
+
guard let url = call.getString("url") else {
|
|
181
|
+
print("\(self.implementation.TAG) setChannelUrl called without url")
|
|
182
|
+
call.reject("setChannelUrl called without url")
|
|
183
|
+
return
|
|
184
|
+
}
|
|
185
|
+
self.implementation.channelUrl = url
|
|
186
|
+
call.resolve()
|
|
187
|
+
}
|
|
188
|
+
|
|
144
189
|
@objc func getBuiltinVersion(_ call: CAPPluginCall) {
|
|
145
190
|
call.resolve(["version": implementation.versionBuild])
|
|
146
191
|
}
|