electron-incremental-update 2.1.0 → 2.1.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 CHANGED
@@ -222,7 +222,7 @@ export default startupWithUpdater((updater) => {
222
222
  }
223
223
  await updater.downloadUpdate()
224
224
  })
225
- updater.on('update-not-available', (reason, info) => console.log(reason, info))
225
+ updater.on('update-not-available', (code, reason, info) => console.log(code, reason, info))
226
226
  updater.on('download-progress', (data) => {
227
227
  console.log(data)
228
228
  main.send(BrowserWindow.getAllWindows()[0], 'msg', data)
package/dist/index.cjs CHANGED
@@ -44,9 +44,9 @@ function restartApp() {
44
44
  // src/entry/types.ts
45
45
  var UpdaterError = class extends Error {
46
46
  code;
47
- constructor(msg, info) {
48
- super(`[${msg}] ${info}`);
49
- this.code = msg;
47
+ constructor(code, info) {
48
+ super(`[${code}] ${info}`);
49
+ this.code = code;
50
50
  }
51
51
  };
52
52
 
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { U as UpdateJSON, a as UpdateInfo } from './version-DcFMG3pT.cjs';
3
- import { U as UpdateInfoWithExtraVersion, a as UnavailableInfo, b as UpdaterError, D as DownloadingInfo, I as IProvider, L as Logger, c as UpdaterOption, d as UpdateJSONWithURL } from './types-jAPZkKmv.cjs';
4
- export { E as ErrorInfo, e as UpdateInfoWithURL } from './types-jAPZkKmv.cjs';
3
+ import { U as UpdateInfoWithExtraVersion, a as UnavailableCode, b as UpdaterError, D as DownloadingInfo, I as IProvider, L as Logger, c as UpdaterOption, d as UpdateJSONWithURL } from './types-DADYYy6C.cjs';
4
+ export { E as ErrorCode, e as UpdateInfoWithURL } from './types-DADYYy6C.cjs';
5
5
  import { Promisable } from '@subframe7536/type-utils';
6
6
 
7
7
  declare class Updater extends EventEmitter<{
8
8
  'checking': any;
9
9
  'update-available': [data: UpdateInfoWithExtraVersion];
10
- 'update-not-available': [code: UnavailableInfo, msg: string, info?: UpdateInfoWithExtraVersion];
10
+ 'update-not-available': [code: UnavailableCode, msg: string, info?: UpdateInfoWithExtraVersion];
11
11
  'error': [error: UpdaterError];
12
12
  'download-progress': [info: DownloadingInfo];
13
13
  'update-downloaded': any;
@@ -143,4 +143,4 @@ declare function createElectronApp(appOptions?: AppOption): Promise<void>;
143
143
  */
144
144
  declare const initApp: typeof createElectronApp;
145
145
 
146
- export { type AppOption, Logger, UnavailableInfo, UpdateInfoWithExtraVersion, Updater, UpdaterError, UpdaterOption, autoUpdate, createElectronApp, initApp, startupWithUpdater };
146
+ export { type AppOption, Logger, UnavailableCode, UpdateInfoWithExtraVersion, Updater, UpdaterError, UpdaterOption, autoUpdate, createElectronApp, initApp, startupWithUpdater };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { U as UpdateJSON, a as UpdateInfo } from './version-DcFMG3pT.js';
3
- import { U as UpdateInfoWithExtraVersion, a as UnavailableInfo, b as UpdaterError, D as DownloadingInfo, I as IProvider, L as Logger, c as UpdaterOption, d as UpdateJSONWithURL } from './types-1Hc4F8aC.js';
4
- export { E as ErrorInfo, e as UpdateInfoWithURL } from './types-1Hc4F8aC.js';
3
+ import { U as UpdateInfoWithExtraVersion, a as UnavailableCode, b as UpdaterError, D as DownloadingInfo, I as IProvider, L as Logger, c as UpdaterOption, d as UpdateJSONWithURL } from './types-BVcfNRXE.js';
4
+ export { E as ErrorCode, e as UpdateInfoWithURL } from './types-BVcfNRXE.js';
5
5
  import { Promisable } from '@subframe7536/type-utils';
6
6
 
7
7
  declare class Updater extends EventEmitter<{
8
8
  'checking': any;
9
9
  'update-available': [data: UpdateInfoWithExtraVersion];
10
- 'update-not-available': [code: UnavailableInfo, msg: string, info?: UpdateInfoWithExtraVersion];
10
+ 'update-not-available': [code: UnavailableCode, msg: string, info?: UpdateInfoWithExtraVersion];
11
11
  'error': [error: UpdaterError];
12
12
  'download-progress': [info: DownloadingInfo];
13
13
  'update-downloaded': any;
@@ -143,4 +143,4 @@ declare function createElectronApp(appOptions?: AppOption): Promise<void>;
143
143
  */
144
144
  declare const initApp: typeof createElectronApp;
145
145
 
146
- export { type AppOption, Logger, UnavailableInfo, UpdateInfoWithExtraVersion, Updater, UpdaterError, UpdaterOption, autoUpdate, createElectronApp, initApp, startupWithUpdater };
146
+ export { type AppOption, Logger, UnavailableCode, UpdateInfoWithExtraVersion, Updater, UpdaterError, UpdaterOption, autoUpdate, createElectronApp, initApp, startupWithUpdater };
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@ import path from 'node:path';
8
8
  // src/entry/types.ts
9
9
  var UpdaterError = class extends Error {
10
10
  code;
11
- constructor(msg, info) {
12
- super(`[${msg}] ${info}`);
13
- this.code = msg;
11
+ constructor(code, info) {
12
+ super(`[${code}] ${info}`);
13
+ this.code = code;
14
14
  }
15
15
  };
16
16
 
@@ -1,4 +1,4 @@
1
- import { I as IProvider, d as UpdateJSONWithURL, e as UpdateInfoWithURL, D as DownloadingInfo, f as URLHandler, O as OnDownloading } from './types-jAPZkKmv.cjs';
1
+ import { I as IProvider, d as UpdateJSONWithURL, e as UpdateInfoWithURL, D as DownloadingInfo, f as URLHandler, O as OnDownloading } from './types-DADYYy6C.cjs';
2
2
  import { f as defaultVerifySignature, a as defaultUnzipFile } from './zip-rm9ED9nU.cjs';
3
3
  import { d as defaultIsLowerVersion, U as UpdateJSON } from './version-DcFMG3pT.cjs';
4
4
  import { Arrayable } from '@subframe7536/type-utils';
@@ -1,4 +1,4 @@
1
- import { I as IProvider, d as UpdateJSONWithURL, e as UpdateInfoWithURL, D as DownloadingInfo, f as URLHandler, O as OnDownloading } from './types-1Hc4F8aC.js';
1
+ import { I as IProvider, d as UpdateJSONWithURL, e as UpdateInfoWithURL, D as DownloadingInfo, f as URLHandler, O as OnDownloading } from './types-BVcfNRXE.js';
2
2
  import { f as defaultVerifySignature, a as defaultUnzipFile } from './zip-rm9ED9nU.js';
3
3
  import { d as defaultIsLowerVersion, U as UpdateJSON } from './version-DcFMG3pT.js';
4
4
  import { Arrayable } from '@subframe7536/type-utils';
@@ -1,11 +1,11 @@
1
1
  import { Promisable } from '@subframe7536/type-utils';
2
2
  import { a as UpdateInfo } from './version-DcFMG3pT.js';
3
3
 
4
- type ErrorInfo = 'ERR_DOWNLOAD' | 'ERR_VALIDATE' | 'ERR_PARAM' | 'ERR_NETWORK';
5
- type UnavailableInfo = 'UNAVAILABLE_ERROR' | 'UNAVAILABLE_DEV' | 'UNAVAILABLE_VERSION';
4
+ type ErrorCode = 'ERR_DOWNLOAD' | 'ERR_VALIDATE' | 'ERR_PARAM' | 'ERR_NETWORK';
5
+ type UnavailableCode = 'UNAVAILABLE_ERROR' | 'UNAVAILABLE_DEV' | 'UNAVAILABLE_VERSION';
6
6
  declare class UpdaterError extends Error {
7
- code: ErrorInfo;
8
- constructor(msg: ErrorInfo, info: string);
7
+ code: ErrorCode;
8
+ constructor(code: ErrorCode, info: string);
9
9
  }
10
10
  interface Logger {
11
11
  info: (msg: string) => void;
@@ -114,4 +114,4 @@ interface IProvider {
114
114
  }
115
115
  type URLHandler = (url: URL) => Promisable<URL | string | undefined | null>;
116
116
 
117
- export { type DownloadingInfo as D, type ErrorInfo as E, type IProvider as I, type Logger as L, type OnDownloading as O, type UpdateInfoWithExtraVersion as U, type UnavailableInfo as a, UpdaterError as b, type UpdaterOption as c, type UpdateJSONWithURL as d, type UpdateInfoWithURL as e, type URLHandler as f };
117
+ export { type DownloadingInfo as D, type ErrorCode as E, type IProvider as I, type Logger as L, type OnDownloading as O, type UpdateInfoWithExtraVersion as U, type UnavailableCode as a, UpdaterError as b, type UpdaterOption as c, type UpdateJSONWithURL as d, type UpdateInfoWithURL as e, type URLHandler as f };
@@ -1,11 +1,11 @@
1
1
  import { Promisable } from '@subframe7536/type-utils';
2
2
  import { a as UpdateInfo } from './version-DcFMG3pT.cjs';
3
3
 
4
- type ErrorInfo = 'ERR_DOWNLOAD' | 'ERR_VALIDATE' | 'ERR_PARAM' | 'ERR_NETWORK';
5
- type UnavailableInfo = 'UNAVAILABLE_ERROR' | 'UNAVAILABLE_DEV' | 'UNAVAILABLE_VERSION';
4
+ type ErrorCode = 'ERR_DOWNLOAD' | 'ERR_VALIDATE' | 'ERR_PARAM' | 'ERR_NETWORK';
5
+ type UnavailableCode = 'UNAVAILABLE_ERROR' | 'UNAVAILABLE_DEV' | 'UNAVAILABLE_VERSION';
6
6
  declare class UpdaterError extends Error {
7
- code: ErrorInfo;
8
- constructor(msg: ErrorInfo, info: string);
7
+ code: ErrorCode;
8
+ constructor(code: ErrorCode, info: string);
9
9
  }
10
10
  interface Logger {
11
11
  info: (msg: string) => void;
@@ -114,4 +114,4 @@ interface IProvider {
114
114
  }
115
115
  type URLHandler = (url: URL) => Promisable<URL | string | undefined | null>;
116
116
 
117
- export { type DownloadingInfo as D, type ErrorInfo as E, type IProvider as I, type Logger as L, type OnDownloading as O, type UpdateInfoWithExtraVersion as U, type UnavailableInfo as a, UpdaterError as b, type UpdaterOption as c, type UpdateJSONWithURL as d, type UpdateInfoWithURL as e, type URLHandler as f };
117
+ export { type DownloadingInfo as D, type ErrorCode as E, type IProvider as I, type Logger as L, type OnDownloading as O, type UpdateInfoWithExtraVersion as U, type UnavailableCode as a, UpdaterError as b, type UpdaterOption as c, type UpdateJSONWithURL as d, type UpdateInfoWithURL as e, type URLHandler as f };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "electron-incremental-update",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "description": "Electron incremental update tools with Vite plugin, support bytecode protection",
6
6
  "author": "subframe7536",
7
7
  "license": "MIT",