@tauri-apps/plugin-updater 2.10.1 → 2.11.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 +1 -0
- package/dist-js/index.cjs +20 -5
- package/dist-js/index.d.ts +26 -5
- package/dist-js/index.js +20 -5
- package/package.json +2 -2
package/README.md
CHANGED
package/dist-js/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@ class Update extends core.Resource {
|
|
|
15
15
|
this.body = metadata.body;
|
|
16
16
|
this.rawJson = metadata.rawJson;
|
|
17
17
|
}
|
|
18
|
-
/** Download the updater package */
|
|
18
|
+
/** Download the updater package. Call {@linkcode install} later to install it */
|
|
19
19
|
async download(onEvent, options) {
|
|
20
20
|
convertToRustHeaders(options);
|
|
21
21
|
const channel = new core.Channel();
|
|
@@ -29,19 +29,34 @@ class Update extends core.Resource {
|
|
|
29
29
|
});
|
|
30
30
|
this.downloadedBytes = new core.Resource(downloadedBytesRid);
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Install downloaded updater package. Must be called after {@linkcode download}.
|
|
34
|
+
*
|
|
35
|
+
* ## Platform-specific:
|
|
36
|
+
*
|
|
37
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
38
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
39
|
+
*/
|
|
40
|
+
async install(options) {
|
|
34
41
|
if (!this.downloadedBytes) {
|
|
35
42
|
throw new Error('Update.install called before Update.download');
|
|
36
43
|
}
|
|
37
44
|
await core.invoke('plugin:updater|install', {
|
|
38
45
|
updateRid: this.rid,
|
|
39
|
-
bytesRid: this.downloadedBytes.rid
|
|
46
|
+
bytesRid: this.downloadedBytes.rid,
|
|
47
|
+
...options
|
|
40
48
|
});
|
|
41
49
|
// Don't need to call close, we did it in rust side already
|
|
42
50
|
this.downloadedBytes = undefined;
|
|
43
51
|
}
|
|
44
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Downloads the updater package and installs it
|
|
54
|
+
*
|
|
55
|
+
* ## Platform-specific:
|
|
56
|
+
*
|
|
57
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
58
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
59
|
+
*/
|
|
45
60
|
async downloadAndInstall(onEvent, options) {
|
|
46
61
|
convertToRustHeaders(options);
|
|
47
62
|
const channel = new core.Channel();
|
package/dist-js/index.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ interface DownloadOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
timeout?: number;
|
|
35
35
|
}
|
|
36
|
+
/** Options used when installing an update */
|
|
37
|
+
interface InstallOptions {
|
|
38
|
+
/**
|
|
39
|
+
* If the Windows installer should restart the app after installed, default is `true`
|
|
40
|
+
*/
|
|
41
|
+
restartAfterInstall?: boolean;
|
|
42
|
+
}
|
|
36
43
|
interface UpdateMetadata {
|
|
37
44
|
rid: number;
|
|
38
45
|
currentVersion: string;
|
|
@@ -65,12 +72,26 @@ declare class Update extends Resource {
|
|
|
65
72
|
rawJson: Record<string, unknown>;
|
|
66
73
|
private downloadedBytes?;
|
|
67
74
|
constructor(metadata: UpdateMetadata);
|
|
68
|
-
/** Download the updater package */
|
|
75
|
+
/** Download the updater package. Call {@linkcode install} later to install it */
|
|
69
76
|
download(onEvent?: (progress: DownloadEvent) => void, options?: DownloadOptions): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Install downloaded updater package. Must be called after {@linkcode download}.
|
|
79
|
+
*
|
|
80
|
+
* ## Platform-specific:
|
|
81
|
+
*
|
|
82
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
83
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
84
|
+
*/
|
|
85
|
+
install(options?: InstallOptions): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Downloads the updater package and installs it
|
|
88
|
+
*
|
|
89
|
+
* ## Platform-specific:
|
|
90
|
+
*
|
|
91
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
92
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
93
|
+
*/
|
|
94
|
+
downloadAndInstall(onEvent?: (progress: DownloadEvent) => void, options?: DownloadOptions & InstallOptions): Promise<void>;
|
|
74
95
|
close(): Promise<void>;
|
|
75
96
|
}
|
|
76
97
|
/** Check for updates, resolves to `null` if no updates are available */
|
package/dist-js/index.js
CHANGED
|
@@ -13,7 +13,7 @@ class Update extends Resource {
|
|
|
13
13
|
this.body = metadata.body;
|
|
14
14
|
this.rawJson = metadata.rawJson;
|
|
15
15
|
}
|
|
16
|
-
/** Download the updater package */
|
|
16
|
+
/** Download the updater package. Call {@linkcode install} later to install it */
|
|
17
17
|
async download(onEvent, options) {
|
|
18
18
|
convertToRustHeaders(options);
|
|
19
19
|
const channel = new Channel();
|
|
@@ -27,19 +27,34 @@ class Update extends Resource {
|
|
|
27
27
|
});
|
|
28
28
|
this.downloadedBytes = new Resource(downloadedBytesRid);
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Install downloaded updater package. Must be called after {@linkcode download}.
|
|
32
|
+
*
|
|
33
|
+
* ## Platform-specific:
|
|
34
|
+
*
|
|
35
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
36
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
37
|
+
*/
|
|
38
|
+
async install(options) {
|
|
32
39
|
if (!this.downloadedBytes) {
|
|
33
40
|
throw new Error('Update.install called before Update.download');
|
|
34
41
|
}
|
|
35
42
|
await invoke('plugin:updater|install', {
|
|
36
43
|
updateRid: this.rid,
|
|
37
|
-
bytesRid: this.downloadedBytes.rid
|
|
44
|
+
bytesRid: this.downloadedBytes.rid,
|
|
45
|
+
...options
|
|
38
46
|
});
|
|
39
47
|
// Don't need to call close, we did it in rust side already
|
|
40
48
|
this.downloadedBytes = undefined;
|
|
41
49
|
}
|
|
42
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Downloads the updater package and installs it
|
|
52
|
+
*
|
|
53
|
+
* ## Platform-specific:
|
|
54
|
+
*
|
|
55
|
+
* - **Windows:** This function exits the app after launching the updater installer successfully
|
|
56
|
+
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
|
57
|
+
*/
|
|
43
58
|
async downloadAndInstall(onEvent, options) {
|
|
44
59
|
convertToRustHeaders(options);
|
|
45
60
|
const channel = new Channel();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tauri-apps/plugin-updater",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"license": "MIT OR Apache-2.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Tauri Programme within The Commons Conservancy"
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tauri-apps/api": "^2.
|
|
27
|
+
"@tauri-apps/api": "^2.11.0"
|
|
28
28
|
}
|
|
29
29
|
}
|