@capgo/capacitor-updater 5.3.57 → 5.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/README.md +153 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +2 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +54 -1
- package/dist/docs.json +132 -1
- package/dist/esm/definitions.d.ts +51 -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/CapacitorUpdater.swift +4 -1
- package/ios/Plugin/CapacitorUpdaterPlugin.m +3 -0
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +47 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,11 +143,113 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
|
|
|
143
143
|
- Do not password encrypt the bundle zip file, or it will fail to unpack.
|
|
144
144
|
- Make sure the bundle does not contain any extra hidden files or folders, or it may fail to unpack.
|
|
145
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
|
+
| **`defaultChannel`** | <code>string</code> | Set the default channel for the app in the config. | <code>undefined</code> | 5.5.0 |
|
|
174
|
+
|
|
175
|
+
### Examples
|
|
176
|
+
|
|
177
|
+
In `capacitor.config.json`:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"plugins": {
|
|
182
|
+
"CapacitorUpdater": {
|
|
183
|
+
"appReadyTimeout": 1000 // (1 second),
|
|
184
|
+
"responseTimeout": 10 // (10 second),
|
|
185
|
+
"autoDeleteFailed": false,
|
|
186
|
+
"autoDeletePrevious": false,
|
|
187
|
+
"autoUpdate": false,
|
|
188
|
+
"resetWhenUpdate": false,
|
|
189
|
+
"updateUrl": https://example.com/api/auto_update,
|
|
190
|
+
"statsUrl": https://example.com/api/stats,
|
|
191
|
+
"privateKey": undefined,
|
|
192
|
+
"version": undefined,
|
|
193
|
+
"directUpdate": undefined,
|
|
194
|
+
"periodCheckDelay": undefined,
|
|
195
|
+
"localS3": undefined,
|
|
196
|
+
"localHost": undefined,
|
|
197
|
+
"localWebHost": undefined,
|
|
198
|
+
"localSupa": undefined,
|
|
199
|
+
"localSupaAnon": undefined,
|
|
200
|
+
"allowModifyUrl": undefined,
|
|
201
|
+
"defaultChannel": undefined
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
In `capacitor.config.ts`:
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
/// <reference types="@capgo/capacitor-updater" />
|
|
211
|
+
|
|
212
|
+
import { CapacitorConfig } from '@capacitor/cli';
|
|
213
|
+
|
|
214
|
+
const config: CapacitorConfig = {
|
|
215
|
+
plugins: {
|
|
216
|
+
CapacitorUpdater: {
|
|
217
|
+
appReadyTimeout: 1000 // (1 second),
|
|
218
|
+
responseTimeout: 10 // (10 second),
|
|
219
|
+
autoDeleteFailed: false,
|
|
220
|
+
autoDeletePrevious: false,
|
|
221
|
+
autoUpdate: false,
|
|
222
|
+
resetWhenUpdate: false,
|
|
223
|
+
updateUrl: https://example.com/api/auto_update,
|
|
224
|
+
statsUrl: https://example.com/api/stats,
|
|
225
|
+
privateKey: undefined,
|
|
226
|
+
version: undefined,
|
|
227
|
+
directUpdate: undefined,
|
|
228
|
+
periodCheckDelay: undefined,
|
|
229
|
+
localS3: undefined,
|
|
230
|
+
localHost: undefined,
|
|
231
|
+
localWebHost: undefined,
|
|
232
|
+
localSupa: undefined,
|
|
233
|
+
localSupaAnon: undefined,
|
|
234
|
+
allowModifyUrl: undefined,
|
|
235
|
+
defaultChannel: undefined,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export default config;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
</docgen-config>
|
|
244
|
+
|
|
146
245
|
## API
|
|
147
246
|
|
|
148
247
|
<docgen-index>
|
|
149
248
|
|
|
150
249
|
* [`notifyAppReady()`](#notifyappready)
|
|
250
|
+
* [`setUpdateUrl(...)`](#setupdateurl)
|
|
251
|
+
* [`setStatsUrl(...)`](#setstatsurl)
|
|
252
|
+
* [`setChannelUrl(...)`](#setchannelurl)
|
|
151
253
|
* [`download(...)`](#download)
|
|
152
254
|
* [`next(...)`](#next)
|
|
153
255
|
* [`set(...)`](#set)
|
|
@@ -200,6 +302,57 @@ Change this behaviour with {@link appReadyTimeout}
|
|
|
200
302
|
--------------------
|
|
201
303
|
|
|
202
304
|
|
|
305
|
+
### setUpdateUrl(...)
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
setUpdateUrl(options: { url: string; }) => Promise<void>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Set the updateUrl for the app, this will be used to check for updates.
|
|
312
|
+
|
|
313
|
+
| Param | Type |
|
|
314
|
+
| ------------- | ----------------------------- |
|
|
315
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
316
|
+
|
|
317
|
+
**Since:** 5.4.0
|
|
318
|
+
|
|
319
|
+
--------------------
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
### setStatsUrl(...)
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
setStatsUrl(options: { url: string; }) => Promise<void>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Set the statsUrl for the app, this will be used to send statistics.
|
|
329
|
+
|
|
330
|
+
| Param | Type |
|
|
331
|
+
| ------------- | ----------------------------- |
|
|
332
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
333
|
+
|
|
334
|
+
**Since:** 5.4.0
|
|
335
|
+
|
|
336
|
+
--------------------
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
### setChannelUrl(...)
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
setChannelUrl(options: { url: string; }) => Promise<void>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Set the channelUrl for the app, this will be used to set the channel.
|
|
346
|
+
|
|
347
|
+
| Param | Type |
|
|
348
|
+
| ------------- | ----------------------------- |
|
|
349
|
+
| **`options`** | <code>{ url: string; }</code> |
|
|
350
|
+
|
|
351
|
+
**Since:** 5.4.0
|
|
352
|
+
|
|
353
|
+
--------------------
|
|
354
|
+
|
|
355
|
+
|
|
203
356
|
### download(...)
|
|
204
357
|
|
|
205
358
|
```typescript
|
|
@@ -88,6 +88,7 @@ public class CapacitorUpdater {
|
|
|
88
88
|
public String customId = "";
|
|
89
89
|
public String statsUrl = "";
|
|
90
90
|
public String channelUrl = "";
|
|
91
|
+
public String defaultChannel = "";
|
|
91
92
|
public String appId = "";
|
|
92
93
|
public String privateKey = "";
|
|
93
94
|
public String deviceID = "";
|
|
@@ -763,6 +764,7 @@ public class CapacitorUpdater {
|
|
|
763
764
|
json.put("plugin_version", this.PLUGIN_VERSION);
|
|
764
765
|
json.put("is_emulator", this.isEmulator());
|
|
765
766
|
json.put("is_prod", this.isProd());
|
|
767
|
+
json.put("defaultChannel", this.defaultChannel);
|
|
766
768
|
return json;
|
|
767
769
|
}
|
|
768
770
|
|
|
@@ -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.5.0";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -182,6 +182,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
182
182
|
this.implementation.channelUrl =
|
|
183
183
|
this.getConfig().getString("channelUrl", channelUrlDefault);
|
|
184
184
|
int userValue = this.getConfig().getInt("periodCheckDelay", 0);
|
|
185
|
+
this.implementation.defaultChannel =
|
|
186
|
+
this.getConfig().getString("defaultChannel", "");
|
|
185
187
|
|
|
186
188
|
if (userValue >= 0 && userValue <= 600) {
|
|
187
189
|
this.periodCheckDelay = 600 * 1000;
|
|
@@ -364,6 +366,57 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
368
|
|
|
369
|
+
@PluginMethod
|
|
370
|
+
public void setUpdateUrl(final PluginCall call) {
|
|
371
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
372
|
+
Log.e(CapacitorUpdater.TAG, "setUpdateUrl not allowed");
|
|
373
|
+
call.reject("setUpdateUrl not allowed");
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
final String url = call.getString("url");
|
|
377
|
+
if (url == null) {
|
|
378
|
+
Log.e(CapacitorUpdater.TAG, "setUpdateUrl called without url");
|
|
379
|
+
call.reject("setUpdateUrl called without url");
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
this.updateUrl = url;
|
|
383
|
+
call.resolve();
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@PluginMethod
|
|
387
|
+
public void setStatsUrl(final PluginCall call) {
|
|
388
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
389
|
+
Log.e(CapacitorUpdater.TAG, "setStatsUrl not allowed");
|
|
390
|
+
call.reject("setStatsUrl not allowed");
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
final String url = call.getString("url");
|
|
394
|
+
if (url == null) {
|
|
395
|
+
Log.e(CapacitorUpdater.TAG, "setStatsUrl called without url");
|
|
396
|
+
call.reject("setStatsUrl called without url");
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
this.implementation.statsUrl = url;
|
|
400
|
+
call.resolve();
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@PluginMethod
|
|
404
|
+
public void setChannelUrl(final PluginCall call) {
|
|
405
|
+
if (!this.getConfig().getBoolean("allowModifyUrl", false)) {
|
|
406
|
+
Log.e(CapacitorUpdater.TAG, "setChannelUrl not allowed");
|
|
407
|
+
call.reject("setChannelUrl not allowed");
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
final String url = call.getString("url");
|
|
411
|
+
if (url == null) {
|
|
412
|
+
Log.e(CapacitorUpdater.TAG, "setChannelUrl called without url");
|
|
413
|
+
call.reject("setChannelUrl called without url");
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
this.implementation.channelUrl = url;
|
|
417
|
+
call.resolve();
|
|
418
|
+
}
|
|
419
|
+
|
|
367
420
|
@PluginMethod
|
|
368
421
|
public void getBuiltinVersion(final PluginCall call) {
|
|
369
422
|
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,41 @@
|
|
|
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"
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
"name": "defaultChannel",
|
|
1864
|
+
"tags": [
|
|
1865
|
+
{
|
|
1866
|
+
"text": "undefined",
|
|
1867
|
+
"name": "default"
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
"text": "5.5.0",
|
|
1871
|
+
"name": "since"
|
|
1872
|
+
}
|
|
1873
|
+
],
|
|
1874
|
+
"docs": "Set the default channel for the app in the config.",
|
|
1875
|
+
"complexTypes": [],
|
|
1876
|
+
"type": "string | undefined"
|
|
1746
1877
|
}
|
|
1747
1878
|
],
|
|
1748
|
-
"docs": "
|
|
1879
|
+
"docs": "CapacitorUpdater can be configured with this options:"
|
|
1749
1880
|
}
|
|
1750
1881
|
]
|
|
1751
1882
|
}
|
|
@@ -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,23 @@ 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;
|
|
164
|
+
/**
|
|
165
|
+
* Set the default channel for the app in the config.
|
|
166
|
+
*
|
|
167
|
+
*
|
|
168
|
+
*
|
|
169
|
+
* @default undefined
|
|
170
|
+
* @since 5.5.0
|
|
171
|
+
*/
|
|
172
|
+
defaultChannel?: string;
|
|
156
173
|
};
|
|
157
174
|
}
|
|
158
175
|
}
|
|
@@ -306,6 +323,39 @@ export interface CapacitorUpdaterPlugin {
|
|
|
306
323
|
notifyAppReady(): Promise<{
|
|
307
324
|
bundle: BundleInfo;
|
|
308
325
|
}>;
|
|
326
|
+
/**
|
|
327
|
+
* Set the updateUrl for the app, this will be used to check for updates.
|
|
328
|
+
*
|
|
329
|
+
* @returns {Promise<void>} an empty Promise
|
|
330
|
+
* @param url The URL to use for checking for updates.
|
|
331
|
+
* @throws An error if the something went wrong
|
|
332
|
+
* @since 5.4.0
|
|
333
|
+
*/
|
|
334
|
+
setUpdateUrl(options: {
|
|
335
|
+
url: string;
|
|
336
|
+
}): Promise<void>;
|
|
337
|
+
/**
|
|
338
|
+
* Set the statsUrl for the app, this will be used to send statistics.
|
|
339
|
+
*
|
|
340
|
+
* @returns {Promise<void>} an empty Promise
|
|
341
|
+
* @param url The URL to use for sending statistics.
|
|
342
|
+
* @throws An error if the something went wrong
|
|
343
|
+
* @since 5.4.0
|
|
344
|
+
*/
|
|
345
|
+
setStatsUrl(options: {
|
|
346
|
+
url: string;
|
|
347
|
+
}): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Set the channelUrl for the app, this will be used to set the channel.
|
|
350
|
+
*
|
|
351
|
+
* @returns {Promise<void>} an empty Promise
|
|
352
|
+
* @param url The URL to use for setting the channel.
|
|
353
|
+
* @throws An error if the something went wrong
|
|
354
|
+
* @since 5.4.0
|
|
355
|
+
*/
|
|
356
|
+
setChannelUrl(options: {
|
|
357
|
+
url: string;
|
|
358
|
+
}): Promise<void>;
|
|
309
359
|
/**
|
|
310
360
|
* 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
361
|
*
|
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,IAAI,CAAC,2BAA2B,CAAC,CAA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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,IAAI,MAAM,QAAQ,CAAC,O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ACL,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,QAAQ,OAAO,CAAC,IAAI,CAA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aterWeb 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;IACA;AAEK,UAAC,gBAAgB,GAA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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;;ICRD;IACA;IACA;IACA;IACA;IAE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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;;;;;;;;;;;;;;;"}
|
|
@@ -79,6 +79,7 @@ struct InfoObject: Codable {
|
|
|
79
79
|
let is_prod: Bool?
|
|
80
80
|
var action: String?
|
|
81
81
|
var channel: String?
|
|
82
|
+
var defaultChannel: String?
|
|
82
83
|
}
|
|
83
84
|
struct AppVersionDec: Decodable {
|
|
84
85
|
let version: String?
|
|
@@ -233,6 +234,7 @@ extension CustomError: LocalizedError {
|
|
|
233
234
|
public var timeout: Double = 20
|
|
234
235
|
public var statsUrl: String = ""
|
|
235
236
|
public var channelUrl: String = ""
|
|
237
|
+
public var defaultChannel: String = ""
|
|
236
238
|
public var appId: String = ""
|
|
237
239
|
public var deviceID = UIDevice.current.identifierForVendor?.uuidString ?? ""
|
|
238
240
|
public var privateKey: String = ""
|
|
@@ -429,7 +431,8 @@ extension CustomError: LocalizedError {
|
|
|
429
431
|
is_emulator: self.isEmulator(),
|
|
430
432
|
is_prod: self.isProd(),
|
|
431
433
|
action: nil,
|
|
432
|
-
channel: nil
|
|
434
|
+
channel: nil,
|
|
435
|
+
defaultChannel: self.defaultChannel
|
|
433
436
|
)
|
|
434
437
|
}
|
|
435
438
|
|
|
@@ -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.5.0"
|
|
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"
|
|
@@ -80,6 +80,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
80
80
|
print("\(self.implementation.TAG) appId \(implementation.appId)")
|
|
81
81
|
implementation.statsUrl = getConfig().getString("statsUrl", CapacitorUpdaterPlugin.statsUrlDefault)!
|
|
82
82
|
implementation.channelUrl = getConfig().getString("channelUrl", CapacitorUpdaterPlugin.channelUrlDefault)!
|
|
83
|
+
implementation.defaultChannel = getConfig().getString("defaultChannel", "")!
|
|
83
84
|
if resetWhenUpdate {
|
|
84
85
|
self.cleanupObsoleteVersions()
|
|
85
86
|
}
|
|
@@ -141,6 +142,51 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
@objc func setUpdateUrl(_ call: CAPPluginCall) {
|
|
146
|
+
if !call.getBool("allowModifyUrl", false) {
|
|
147
|
+
print("\(self.implementation.TAG) setUpdateUrl called without allowModifyUrl")
|
|
148
|
+
call.reject("setUpdateUrl called without allowModifyUrl")
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
guard let url = call.getString("url") else {
|
|
152
|
+
print("\(self.implementation.TAG) setUpdateUrl called without url")
|
|
153
|
+
call.reject("setUpdateUrl called without url")
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
self.updateUrl = url
|
|
157
|
+
call.resolve()
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@objc func setStatsUrl(_ call: CAPPluginCall) {
|
|
161
|
+
if !call.getBool("allowModifyUrl", false) {
|
|
162
|
+
print("\(self.implementation.TAG) setStatsUrl called without allowModifyUrl")
|
|
163
|
+
call.reject("setStatsUrl called without allowModifyUrl")
|
|
164
|
+
return
|
|
165
|
+
}
|
|
166
|
+
guard let url = call.getString("url") else {
|
|
167
|
+
print("\(self.implementation.TAG) setStatsUrl called without url")
|
|
168
|
+
call.reject("setStatsUrl called without url")
|
|
169
|
+
return
|
|
170
|
+
}
|
|
171
|
+
self.statsUrl = url
|
|
172
|
+
call.resolve()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@objc func setChannelUrl(_ call: CAPPluginCall) {
|
|
176
|
+
if !call.getBool("allowModifyUrl", false) {
|
|
177
|
+
print("\(self.implementation.TAG) setChannelUrl called without allowModifyUrl")
|
|
178
|
+
call.reject("setChannelUrl called without allowModifyUrl")
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
guard let url = call.getString("url") else {
|
|
182
|
+
print("\(self.implementation.TAG) setChannelUrl called without url")
|
|
183
|
+
call.reject("setChannelUrl called without url")
|
|
184
|
+
return
|
|
185
|
+
}
|
|
186
|
+
self.implementation.channelUrl = url
|
|
187
|
+
call.resolve()
|
|
188
|
+
}
|
|
189
|
+
|
|
144
190
|
@objc func getBuiltinVersion(_ call: CAPPluginCall) {
|
|
145
191
|
call.resolve(["version": implementation.versionBuild])
|
|
146
192
|
}
|