electron-incremental-update 2.4.2 → 3.0.0-beta.2
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 +72 -43
- package/dist/download-BN4uMS4_.d.mts +39 -0
- package/dist/download-DO7iuxEJ.d.cts +39 -0
- package/dist/electron-BFoZUBhU.cjs +320 -0
- package/dist/electron-CJIoO4ny.mjs +180 -0
- package/dist/index.cjs +259 -331
- package/dist/index.d.cts +179 -169
- package/dist/index.d.mts +204 -0
- package/dist/index.mjs +271 -0
- package/dist/provider.cjs +142 -356
- package/dist/provider.d.cts +116 -117
- package/dist/provider.d.mts +133 -0
- package/dist/provider.mjs +152 -0
- package/dist/types-BM9Jfu7q.d.cts +154 -0
- package/dist/types-DASqEPXE.d.mts +154 -0
- package/dist/utils.cjs +43 -381
- package/dist/utils.d.cts +117 -85
- package/dist/utils.d.mts +161 -0
- package/dist/utils.mjs +5 -0
- package/dist/version--eVB2A7n.mjs +72 -0
- package/dist/version-aPrLuz_-.cjs +129 -0
- package/dist/vite.d.mts +565 -0
- package/dist/vite.mjs +1222 -0
- package/dist/zip-BCC7FAQ_.cjs +264 -0
- package/dist/zip-Dwm7s1C9.mjs +185 -0
- package/package.json +65 -65
- package/dist/chunk-AAAM44NW.js +0 -70
- package/dist/chunk-IVHNGRZY.js +0 -122
- package/dist/chunk-PD4EV4MM.js +0 -147
- package/dist/index.d.ts +0 -194
- package/dist/index.js +0 -309
- package/dist/provider.d.ts +0 -134
- package/dist/provider.js +0 -178
- package/dist/types-CU7GyVez.d.cts +0 -151
- package/dist/types-CU7GyVez.d.ts +0 -151
- package/dist/utils.d.ts +0 -129
- package/dist/utils.js +0 -3
- package/dist/vite.d.ts +0 -533
- package/dist/vite.js +0 -945
- package/dist/zip-Blmn2vzE.d.cts +0 -71
- package/dist/zip-CnSv_Njj.d.ts +0 -71
- package/provider.d.ts +0 -1
- package/provider.js +0 -1
- package/utils.d.ts +0 -1
- package/utils.js +0 -1
- package/vite.d.ts +0 -1
- package/vite.js +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//#region node_modules/@subframe7536/type-utils/index.d.ts
|
|
2
|
+
type Promisable<T> = T | Promise<T>;
|
|
3
|
+
type Arrayable<T> = T | T[];
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/utils/version.d.ts
|
|
6
|
+
interface Version {
|
|
7
|
+
/**
|
|
8
|
+
* `4` of `4.3.2-beta.1`
|
|
9
|
+
*/
|
|
10
|
+
major: number;
|
|
11
|
+
/**
|
|
12
|
+
* `3` of `4.3.2-beta.1`
|
|
13
|
+
*/
|
|
14
|
+
minor: number;
|
|
15
|
+
/**
|
|
16
|
+
* `2` of `4.3.2-beta.1`
|
|
17
|
+
*/
|
|
18
|
+
patch: number;
|
|
19
|
+
/**
|
|
20
|
+
* `beta` of `4.3.2-beta.1`
|
|
21
|
+
*/
|
|
22
|
+
stage: string;
|
|
23
|
+
/**
|
|
24
|
+
* `1` of `4.3.2-beta.1`
|
|
25
|
+
*/
|
|
26
|
+
stageVersion: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse version string to {@link Version}, like `0.2.0-beta.1`
|
|
30
|
+
* @param version version string
|
|
31
|
+
*/
|
|
32
|
+
declare function parseVersion(version: string): Version;
|
|
33
|
+
/**
|
|
34
|
+
* Default function to check the old version is less than new version
|
|
35
|
+
* @param oldVer old version string
|
|
36
|
+
* @param newVer new version string
|
|
37
|
+
*/
|
|
38
|
+
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Update info json
|
|
41
|
+
*/
|
|
42
|
+
interface UpdateInfo {
|
|
43
|
+
/**
|
|
44
|
+
* Update Asar signature
|
|
45
|
+
*/
|
|
46
|
+
signature: string;
|
|
47
|
+
/**
|
|
48
|
+
* Minimum version
|
|
49
|
+
*/
|
|
50
|
+
minimumVersion: string;
|
|
51
|
+
/**
|
|
52
|
+
* Target version
|
|
53
|
+
*/
|
|
54
|
+
version: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* {@link UpdateInfo} with beta
|
|
58
|
+
*/
|
|
59
|
+
type UpdateJSON = UpdateInfo & {
|
|
60
|
+
/**
|
|
61
|
+
* Beta update info
|
|
62
|
+
*/
|
|
63
|
+
beta: UpdateInfo;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Check is `UpdateJSON`
|
|
67
|
+
* @param json any variable
|
|
68
|
+
*/
|
|
69
|
+
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
70
|
+
/**
|
|
71
|
+
* Default function to generate `UpdateJSON`
|
|
72
|
+
* @param existingJson exising update json
|
|
73
|
+
* @param signature sigature
|
|
74
|
+
* @param version target version
|
|
75
|
+
* @param minimumVersion minimum version
|
|
76
|
+
*/
|
|
77
|
+
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/provider/types.d.ts
|
|
80
|
+
type UpdateInfoWithURL = UpdateInfo & {
|
|
81
|
+
url: string;
|
|
82
|
+
};
|
|
83
|
+
interface DownloadingInfo {
|
|
84
|
+
/**
|
|
85
|
+
* Download buffer delta
|
|
86
|
+
*/
|
|
87
|
+
delta: number;
|
|
88
|
+
/**
|
|
89
|
+
* Downloaded percent, 0 ~ 100
|
|
90
|
+
*
|
|
91
|
+
* If no `Content-Length` header, will be -1
|
|
92
|
+
*/
|
|
93
|
+
percent: number;
|
|
94
|
+
/**
|
|
95
|
+
* Total size
|
|
96
|
+
*
|
|
97
|
+
* If not `Content-Length` header, will be -1
|
|
98
|
+
*/
|
|
99
|
+
total: number;
|
|
100
|
+
/**
|
|
101
|
+
* Downloaded size
|
|
102
|
+
*/
|
|
103
|
+
transferred: number;
|
|
104
|
+
/**
|
|
105
|
+
* Download speed, bytes per second
|
|
106
|
+
*/
|
|
107
|
+
bps: number;
|
|
108
|
+
}
|
|
109
|
+
type UpdateJSONWithURL = UpdateInfoWithURL & {
|
|
110
|
+
beta: UpdateInfoWithURL;
|
|
111
|
+
};
|
|
112
|
+
interface IProvider {
|
|
113
|
+
/**
|
|
114
|
+
* Provider name
|
|
115
|
+
*/
|
|
116
|
+
name: string;
|
|
117
|
+
/**
|
|
118
|
+
* Download update json
|
|
119
|
+
* @param name app name
|
|
120
|
+
* @param versionPath normalized version path in project
|
|
121
|
+
* @param signal abort signal
|
|
122
|
+
*/
|
|
123
|
+
downloadJSON: (name: string, versionPath: string, signal: AbortSignal) => Promise<UpdateJSONWithURL>;
|
|
124
|
+
/**
|
|
125
|
+
* Download update asar buffer
|
|
126
|
+
* @param updateInfo existing update info
|
|
127
|
+
* @param signal abort signal
|
|
128
|
+
* @param onDownloading hook for on downloading
|
|
129
|
+
*/
|
|
130
|
+
downloadAsar: (updateInfo: UpdateInfoWithURL, signal: AbortSignal, onDownloading?: (info: DownloadingInfo) => void) => Promise<Buffer>;
|
|
131
|
+
/**
|
|
132
|
+
* Check the old version is less than new version
|
|
133
|
+
* @param oldVer old version string
|
|
134
|
+
* @param newVer new version string
|
|
135
|
+
*/
|
|
136
|
+
isLowerVersion: (oldVer: string, newVer: string) => boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Function to decompress file using brotli
|
|
139
|
+
* @param buffer compressed file buffer
|
|
140
|
+
*/
|
|
141
|
+
unzipFile: (buffer: Buffer) => Promise<Buffer>;
|
|
142
|
+
/**
|
|
143
|
+
* Verify asar signature,
|
|
144
|
+
* if signature is valid, returns the version, otherwise returns `undefined`
|
|
145
|
+
* @param buffer file buffer
|
|
146
|
+
* @param version target version
|
|
147
|
+
* @param signature signature
|
|
148
|
+
* @param cert certificate
|
|
149
|
+
*/
|
|
150
|
+
verifySignaure: (buffer: Buffer, version: string, signature: string, cert: string) => Promisable<boolean>;
|
|
151
|
+
}
|
|
152
|
+
type URLHandler = (url: URL) => Promisable<URL | string | undefined | null>;
|
|
153
|
+
//#endregion
|
|
154
|
+
export { UpdateJSONWithURL as a, Version as c, isUpdateJSON as d, parseVersion as f, UpdateInfoWithURL as i, defaultIsLowerVersion as l, Promisable as m, IProvider as n, UpdateInfo as o, Arrayable as p, URLHandler as r, UpdateJSON as s, DownloadingInfo as t, defaultVersionJsonGenerator as u };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//#region node_modules/@subframe7536/type-utils/index.d.ts
|
|
2
|
+
type Promisable<T> = T | Promise<T>;
|
|
3
|
+
type Arrayable<T> = T | T[];
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/utils/version.d.ts
|
|
6
|
+
interface Version {
|
|
7
|
+
/**
|
|
8
|
+
* `4` of `4.3.2-beta.1`
|
|
9
|
+
*/
|
|
10
|
+
major: number;
|
|
11
|
+
/**
|
|
12
|
+
* `3` of `4.3.2-beta.1`
|
|
13
|
+
*/
|
|
14
|
+
minor: number;
|
|
15
|
+
/**
|
|
16
|
+
* `2` of `4.3.2-beta.1`
|
|
17
|
+
*/
|
|
18
|
+
patch: number;
|
|
19
|
+
/**
|
|
20
|
+
* `beta` of `4.3.2-beta.1`
|
|
21
|
+
*/
|
|
22
|
+
stage: string;
|
|
23
|
+
/**
|
|
24
|
+
* `1` of `4.3.2-beta.1`
|
|
25
|
+
*/
|
|
26
|
+
stageVersion: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse version string to {@link Version}, like `0.2.0-beta.1`
|
|
30
|
+
* @param version version string
|
|
31
|
+
*/
|
|
32
|
+
declare function parseVersion(version: string): Version;
|
|
33
|
+
/**
|
|
34
|
+
* Default function to check the old version is less than new version
|
|
35
|
+
* @param oldVer old version string
|
|
36
|
+
* @param newVer new version string
|
|
37
|
+
*/
|
|
38
|
+
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Update info json
|
|
41
|
+
*/
|
|
42
|
+
interface UpdateInfo {
|
|
43
|
+
/**
|
|
44
|
+
* Update Asar signature
|
|
45
|
+
*/
|
|
46
|
+
signature: string;
|
|
47
|
+
/**
|
|
48
|
+
* Minimum version
|
|
49
|
+
*/
|
|
50
|
+
minimumVersion: string;
|
|
51
|
+
/**
|
|
52
|
+
* Target version
|
|
53
|
+
*/
|
|
54
|
+
version: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* {@link UpdateInfo} with beta
|
|
58
|
+
*/
|
|
59
|
+
type UpdateJSON = UpdateInfo & {
|
|
60
|
+
/**
|
|
61
|
+
* Beta update info
|
|
62
|
+
*/
|
|
63
|
+
beta: UpdateInfo;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Check is `UpdateJSON`
|
|
67
|
+
* @param json any variable
|
|
68
|
+
*/
|
|
69
|
+
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
70
|
+
/**
|
|
71
|
+
* Default function to generate `UpdateJSON`
|
|
72
|
+
* @param existingJson exising update json
|
|
73
|
+
* @param signature sigature
|
|
74
|
+
* @param version target version
|
|
75
|
+
* @param minimumVersion minimum version
|
|
76
|
+
*/
|
|
77
|
+
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/provider/types.d.ts
|
|
80
|
+
type UpdateInfoWithURL = UpdateInfo & {
|
|
81
|
+
url: string;
|
|
82
|
+
};
|
|
83
|
+
interface DownloadingInfo {
|
|
84
|
+
/**
|
|
85
|
+
* Download buffer delta
|
|
86
|
+
*/
|
|
87
|
+
delta: number;
|
|
88
|
+
/**
|
|
89
|
+
* Downloaded percent, 0 ~ 100
|
|
90
|
+
*
|
|
91
|
+
* If no `Content-Length` header, will be -1
|
|
92
|
+
*/
|
|
93
|
+
percent: number;
|
|
94
|
+
/**
|
|
95
|
+
* Total size
|
|
96
|
+
*
|
|
97
|
+
* If not `Content-Length` header, will be -1
|
|
98
|
+
*/
|
|
99
|
+
total: number;
|
|
100
|
+
/**
|
|
101
|
+
* Downloaded size
|
|
102
|
+
*/
|
|
103
|
+
transferred: number;
|
|
104
|
+
/**
|
|
105
|
+
* Download speed, bytes per second
|
|
106
|
+
*/
|
|
107
|
+
bps: number;
|
|
108
|
+
}
|
|
109
|
+
type UpdateJSONWithURL = UpdateInfoWithURL & {
|
|
110
|
+
beta: UpdateInfoWithURL;
|
|
111
|
+
};
|
|
112
|
+
interface IProvider {
|
|
113
|
+
/**
|
|
114
|
+
* Provider name
|
|
115
|
+
*/
|
|
116
|
+
name: string;
|
|
117
|
+
/**
|
|
118
|
+
* Download update json
|
|
119
|
+
* @param name app name
|
|
120
|
+
* @param versionPath normalized version path in project
|
|
121
|
+
* @param signal abort signal
|
|
122
|
+
*/
|
|
123
|
+
downloadJSON: (name: string, versionPath: string, signal: AbortSignal) => Promise<UpdateJSONWithURL>;
|
|
124
|
+
/**
|
|
125
|
+
* Download update asar buffer
|
|
126
|
+
* @param updateInfo existing update info
|
|
127
|
+
* @param signal abort signal
|
|
128
|
+
* @param onDownloading hook for on downloading
|
|
129
|
+
*/
|
|
130
|
+
downloadAsar: (updateInfo: UpdateInfoWithURL, signal: AbortSignal, onDownloading?: (info: DownloadingInfo) => void) => Promise<Buffer>;
|
|
131
|
+
/**
|
|
132
|
+
* Check the old version is less than new version
|
|
133
|
+
* @param oldVer old version string
|
|
134
|
+
* @param newVer new version string
|
|
135
|
+
*/
|
|
136
|
+
isLowerVersion: (oldVer: string, newVer: string) => boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Function to decompress file using brotli
|
|
139
|
+
* @param buffer compressed file buffer
|
|
140
|
+
*/
|
|
141
|
+
unzipFile: (buffer: Buffer) => Promise<Buffer>;
|
|
142
|
+
/**
|
|
143
|
+
* Verify asar signature,
|
|
144
|
+
* if signature is valid, returns the version, otherwise returns `undefined`
|
|
145
|
+
* @param buffer file buffer
|
|
146
|
+
* @param version target version
|
|
147
|
+
* @param signature signature
|
|
148
|
+
* @param cert certificate
|
|
149
|
+
*/
|
|
150
|
+
verifySignaure: (buffer: Buffer, version: string, signature: string, cert: string) => Promisable<boolean>;
|
|
151
|
+
}
|
|
152
|
+
type URLHandler = (url: URL) => Promisable<URL | string | undefined | null>;
|
|
153
|
+
//#endregion
|
|
154
|
+
export { UpdateJSONWithURL as a, Version as c, isUpdateJSON as d, parseVersion as f, UpdateInfoWithURL as i, defaultIsLowerVersion as l, Promisable as m, IProvider as n, UpdateInfo as o, Arrayable as p, URLHandler as r, UpdateJSON as s, DownloadingInfo as t, defaultVersionJsonGenerator as u };
|