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.
Files changed (47) hide show
  1. package/README.md +72 -43
  2. package/dist/download-BN4uMS4_.d.mts +39 -0
  3. package/dist/download-DO7iuxEJ.d.cts +39 -0
  4. package/dist/electron-BFoZUBhU.cjs +320 -0
  5. package/dist/electron-CJIoO4ny.mjs +180 -0
  6. package/dist/index.cjs +259 -331
  7. package/dist/index.d.cts +179 -169
  8. package/dist/index.d.mts +204 -0
  9. package/dist/index.mjs +271 -0
  10. package/dist/provider.cjs +142 -356
  11. package/dist/provider.d.cts +116 -117
  12. package/dist/provider.d.mts +133 -0
  13. package/dist/provider.mjs +152 -0
  14. package/dist/types-BM9Jfu7q.d.cts +154 -0
  15. package/dist/types-DASqEPXE.d.mts +154 -0
  16. package/dist/utils.cjs +43 -381
  17. package/dist/utils.d.cts +117 -85
  18. package/dist/utils.d.mts +161 -0
  19. package/dist/utils.mjs +5 -0
  20. package/dist/version--eVB2A7n.mjs +72 -0
  21. package/dist/version-aPrLuz_-.cjs +129 -0
  22. package/dist/vite.d.mts +565 -0
  23. package/dist/vite.mjs +1222 -0
  24. package/dist/zip-BCC7FAQ_.cjs +264 -0
  25. package/dist/zip-Dwm7s1C9.mjs +185 -0
  26. package/package.json +65 -65
  27. package/dist/chunk-AAAM44NW.js +0 -70
  28. package/dist/chunk-IVHNGRZY.js +0 -122
  29. package/dist/chunk-PD4EV4MM.js +0 -147
  30. package/dist/index.d.ts +0 -194
  31. package/dist/index.js +0 -309
  32. package/dist/provider.d.ts +0 -134
  33. package/dist/provider.js +0 -178
  34. package/dist/types-CU7GyVez.d.cts +0 -151
  35. package/dist/types-CU7GyVez.d.ts +0 -151
  36. package/dist/utils.d.ts +0 -129
  37. package/dist/utils.js +0 -3
  38. package/dist/vite.d.ts +0 -533
  39. package/dist/vite.js +0 -945
  40. package/dist/zip-Blmn2vzE.d.cts +0 -71
  41. package/dist/zip-CnSv_Njj.d.ts +0 -71
  42. package/provider.d.ts +0 -1
  43. package/provider.js +0 -1
  44. package/utils.d.ts +0 -1
  45. package/utils.js +0 -1
  46. package/vite.d.ts +0 -1
  47. 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 };