diff --git a/Changelog.md b/Changelog.md index 3a2349f8..54951ccf 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,29 @@ # Not released +# 18.6.1 + +ElectronNET.CLI: + +* New Feature: Support for additional dotnet publish flags (thanks [danatcofo](https://github.com/danatcofo)) [\#655](https://github.com/ElectronNET/Electron.NET/pull/655) +* New Feature: Support Apple Silicon Natively (thanks [bman46](https://github.com/bman46)) [\#624](https://github.com/ElectronNET/Electron.NET/pull/624) + +ElectronNET.API: + +* New Feature: Support for .NET 6 (thanks [danatcofo](https://github.com/danatcofo)) [\#636](https://github.com/ElectronNET/Electron.NET/pull/636) +* New Feature: Switch to async socket lib (thanks [theolivenbaum](https://github.com/theolivenbaum)) [\#595](https://github.com/ElectronNET/Electron.NET/pull/595) +* New Feature: Conversion to use ImageSharp rather than System.Drawing.Common (thanks [danatcofo](https://github.com/danatcofo)) [\#658](https://github.com/ElectronNET/Electron.NET/pull/658) +* New Feature: Support DI and Mocking better + Support launching app with file for win and linux (thanks [danatcofo](https://github.com/danatcofo)) [\#656](https://github.com/ElectronNET/Electron.NET/pull/656) +* New Feature: Support launching app with file for win and linux (thanks [schaveyt](https://github.com/schaveyt)) [\#648](https://github.com/ElectronNET/Electron.NET/pull/648) +* New Feature: Add ability to set a window's parent using BrowserWindowOptions (thanks [MutatedGamer](https://github.com/MutatedGamer)) [\#673](https://github.com/ElectronNET/Electron.NET/pull/673) +* New Feature: changed the processing of loadUrl at CreateWindowAsync (thanks [yannikHoeflich](https://github.com/yannikHoeflich)) [\#631](https://github.com/ElectronNET/Electron.NET/pull/631) +* New Feature: Recent Document Support for MacOS (thanks [danatcofo](https://github.com/danatcofo)) [\#634](https://github.com/ElectronNET/Electron.NET/pull/634) +* New Feature: Support DI and Mocking better (thanks [danatcofo](https://github.com/danatcofo)) [\#633](https://github.com/ElectronNET/Electron.NET/pull/633) +* New Feature: Allow ignoring certificate errors (thanks [javierlarota](https://github.com/javierlarota)) [\#626](https://github.com/ElectronNET/Electron.NET/pull/626) +* New Feature: Log errors in the dotnet process (thanks [Meberem](https://github.com/Meberem)) [\#592](https://github.com/ElectronNET/Electron.NET/pull/592) +* Fixed bug: Error on reloading a window after a second window is closed #664 (thanks [danatcofo](https://github.com/danatcofo)) [\#668](https://github.com/ElectronNET/Electron.NET/pull/668) + +# Released + # 13.5.1 ElectronNET.CLI: @@ -25,9 +49,6 @@ ElectronNET.API: * Fixed bug: Fix splash screen interaction causing crashes, ghost dragging, and resizable behavior #540 (thanks [MiniguyBrendan](https://github.com/MiniguyBrendan)) [\#540](https://github.com/ElectronNET/Electron.NET/pull/540) * Fixed bug: Vibrancy serialization fix (thanks [tantumalice](https://github.com/tantumalice)) [\#573](https://github.com/ElectronNET/Electron.NET/pull/573) - -# Released - # 11.5.1 ElectronNET.CLI: diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs old mode 100644 new mode 100755 index 69d8722c..0a41610b --- a/ElectronNET.API/App.cs +++ b/ElectronNET.API/App.cs @@ -7,14 +7,20 @@ using System.Threading; using System.Threading.Tasks; using ElectronNET.API.Extensions; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Control your application's event lifecycle. /// - public sealed class App + public sealed class App : IApp { + /// + /// Print every message sent to the socket + /// + public static bool SocketDebug { get; set; } + /// /// Emitted when all windows have been closed. /// @@ -30,7 +36,7 @@ public event Action WindowAllClosed { if (_windowAllClosed == null) { - BridgeConnector.Socket.On("app-window-all-closed" + GetHashCode(), () => + BridgeConnector.On("app-window-all-closed" + GetHashCode(), () => { if (!Electron.WindowManager.IsQuitOnWindowAllClosed || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { @@ -38,7 +44,7 @@ public event Action WindowAllClosed } }); - BridgeConnector.Socket.Emit("register-app-window-all-closed-event", GetHashCode()); + BridgeConnector.Emit("register-app-window-all-closed-event", GetHashCode()); } _windowAllClosed += value; } @@ -47,7 +53,7 @@ public event Action WindowAllClosed _windowAllClosed -= value; if(_windowAllClosed == null) - BridgeConnector.Socket.Off("app-window-all-closed" + GetHashCode()); + BridgeConnector.Off("app-window-all-closed" + GetHashCode()); } } @@ -67,7 +73,7 @@ public event Func BeforeQuit { if (_beforeQuit == null) { - BridgeConnector.Socket.On("app-before-quit" + GetHashCode(), async () => + BridgeConnector.On("app-before-quit" + GetHashCode(), async () => { await _beforeQuit(new QuitEventArgs()); @@ -110,7 +116,7 @@ public event Func BeforeQuit } }); - BridgeConnector.Socket.Emit("register-app-before-quit-event", GetHashCode()); + BridgeConnector.Emit("register-app-before-quit-event", GetHashCode()); } _beforeQuit += value; } @@ -119,7 +125,7 @@ public event Func BeforeQuit _beforeQuit -= value; if (_beforeQuit == null) - BridgeConnector.Socket.Off("app-before-quit" + GetHashCode()); + BridgeConnector.Off("app-before-quit" + GetHashCode()); } } @@ -139,7 +145,7 @@ public event Func WillQuit { if (_willQuit == null) { - BridgeConnector.Socket.On("app-will-quit" + GetHashCode(), async () => + BridgeConnector.On("app-will-quit" + GetHashCode(), async () => { await _willQuit(new QuitEventArgs()); @@ -161,7 +167,7 @@ public event Func WillQuit } }); - BridgeConnector.Socket.Emit("register-app-will-quit-event", GetHashCode()); + BridgeConnector.Emit("register-app-will-quit-event", GetHashCode()); } _willQuit += value; } @@ -170,7 +176,7 @@ public event Func WillQuit _willQuit -= value; if (_willQuit == null) - BridgeConnector.Socket.Off("app-will-quit" + GetHashCode()); + BridgeConnector.Off("app-will-quit" + GetHashCode()); } } @@ -187,7 +193,7 @@ public event Func Quitting { if (_quitting == null) { - BridgeConnector.Socket.On("app-will-quit" + GetHashCode() + "quitting", async () => + BridgeConnector.On("app-will-quit" + GetHashCode() + "quitting", async () => { if(_willQuit == null) { @@ -196,7 +202,7 @@ public event Func Quitting } }); - BridgeConnector.Socket.Emit("register-app-will-quit-event", GetHashCode() + "quitting"); + BridgeConnector.Emit("register-app-will-quit-event", GetHashCode() + "quitting"); } _quitting += value; } @@ -205,7 +211,7 @@ public event Func Quitting _quitting -= value; if (_quitting == null) - BridgeConnector.Socket.Off("app-will-quit" + GetHashCode() + "quitting"); + BridgeConnector.Off("app-will-quit" + GetHashCode() + "quitting"); } } @@ -220,12 +226,12 @@ public event Action BrowserWindowBlur { if (_browserWindowBlur == null) { - BridgeConnector.Socket.On("app-browser-window-blur" + GetHashCode(), () => + BridgeConnector.On("app-browser-window-blur" + GetHashCode(), () => { _browserWindowBlur(); }); - BridgeConnector.Socket.Emit("register-app-browser-window-blur-event", GetHashCode()); + BridgeConnector.Emit("register-app-browser-window-blur-event", GetHashCode()); } _browserWindowBlur += value; } @@ -234,7 +240,7 @@ public event Action BrowserWindowBlur _browserWindowBlur -= value; if (_browserWindowBlur == null) - BridgeConnector.Socket.Off("app-browser-window-blur" + GetHashCode()); + BridgeConnector.Off("app-browser-window-blur" + GetHashCode()); } } @@ -249,12 +255,12 @@ public event Action BrowserWindowFocus { if (_browserWindowFocus == null) { - BridgeConnector.Socket.On("app-browser-window-focus" + GetHashCode(), () => + BridgeConnector.On("app-browser-window-focus" + GetHashCode(), () => { _browserWindowFocus(); }); - BridgeConnector.Socket.Emit("register-app-browser-window-focus-event", GetHashCode()); + BridgeConnector.Emit("register-app-browser-window-focus-event", GetHashCode()); } _browserWindowFocus += value; } @@ -263,7 +269,7 @@ public event Action BrowserWindowFocus _browserWindowFocus -= value; if (_browserWindowFocus == null) - BridgeConnector.Socket.Off("app-browser-window-focus" + GetHashCode()); + BridgeConnector.Off("app-browser-window-focus" + GetHashCode()); } } @@ -278,12 +284,12 @@ public event Action BrowserWindowCreated { if (_browserWindowCreated == null) { - BridgeConnector.Socket.On("app-browser-window-created" + GetHashCode(), () => + BridgeConnector.On("app-browser-window-created" + GetHashCode(), () => { _browserWindowCreated(); }); - BridgeConnector.Socket.Emit("register-app-browser-window-created-event", GetHashCode()); + BridgeConnector.Emit("register-app-browser-window-created-event", GetHashCode()); } _browserWindowCreated += value; } @@ -292,7 +298,7 @@ public event Action BrowserWindowCreated _browserWindowCreated -= value; if (_browserWindowCreated == null) - BridgeConnector.Socket.Off("app-browser-window-created" + GetHashCode()); + BridgeConnector.Off("app-browser-window-created" + GetHashCode()); } } @@ -307,12 +313,12 @@ public event Action WebContentsCreated { if (_webContentsCreated == null) { - BridgeConnector.Socket.On("app-web-contents-created" + GetHashCode(), () => + BridgeConnector.On("app-web-contents-created" + GetHashCode(), () => { _webContentsCreated(); }); - BridgeConnector.Socket.Emit("register-app-web-contents-created-event", GetHashCode()); + BridgeConnector.Emit("register-app-web-contents-created-event", GetHashCode()); } _webContentsCreated += value; } @@ -321,7 +327,7 @@ public event Action WebContentsCreated _webContentsCreated -= value; if (_webContentsCreated == null) - BridgeConnector.Socket.Off("app-web-contents-created" + GetHashCode()); + BridgeConnector.Off("app-web-contents-created" + GetHashCode()); } } @@ -338,12 +344,12 @@ public event Action AccessibilitySupportChanged { if (_accessibilitySupportChanged == null) { - BridgeConnector.Socket.On("app-accessibility-support-changed" + GetHashCode(), (state) => + BridgeConnector.On("app-accessibility-support-changed" + GetHashCode(), (state) => { - _accessibilitySupportChanged((bool)state); + _accessibilitySupportChanged(state); }); - BridgeConnector.Socket.Emit("register-app-accessibility-support-changed-event", GetHashCode()); + BridgeConnector.Emit("register-app-accessibility-support-changed-event", GetHashCode()); } _accessibilitySupportChanged += value; } @@ -352,7 +358,7 @@ public event Action AccessibilitySupportChanged _accessibilitySupportChanged -= value; if (_accessibilitySupportChanged == null) - BridgeConnector.Socket.Off("app-accessibility-support-changed" + GetHashCode()); + BridgeConnector.Off("app-accessibility-support-changed" + GetHashCode()); } } @@ -396,6 +402,7 @@ internal set } } } + private bool _isReady = false; /// @@ -411,12 +418,12 @@ public event Action OpenFile { if (_openFile == null) { - BridgeConnector.Socket.On("app-open-file" + GetHashCode(), (file) => + BridgeConnector.On("app-open-file" + GetHashCode(), (file) => { - _openFile(file.ToString()); + _openFile(file); }); - BridgeConnector.Socket.Emit("register-app-open-file-event", GetHashCode()); + BridgeConnector.Emit("register-app-open-file-event", GetHashCode()); } _openFile += value; } @@ -425,7 +432,7 @@ public event Action OpenFile _openFile -= value; if (_openFile == null) - BridgeConnector.Socket.Off("app-open-file" + GetHashCode()); + BridgeConnector.Off("app-open-file" + GetHashCode()); } } @@ -442,12 +449,12 @@ public event Action OpenUrl { if (_openUrl == null) { - BridgeConnector.Socket.On("app-open-url" + GetHashCode(), (url) => + BridgeConnector.On("app-open-url" + GetHashCode(), (url) => { - _openUrl(url.ToString()); + _openUrl(url); }); - BridgeConnector.Socket.Emit("register-app-open-url-event", GetHashCode()); + BridgeConnector.Emit("register-app-open-url-event", GetHashCode()); } _openUrl += value; } @@ -456,7 +463,7 @@ public event Action OpenUrl _openUrl -= value; if (_openUrl == null) - BridgeConnector.Socket.Off("app-open-url" + GetHashCode()); + BridgeConnector.Off("app-open-url" + GetHashCode()); } } @@ -472,14 +479,9 @@ public event Action OpenUrl /// public string Name { - [Obsolete("Use the asynchronous version NameAsync instead")] - get - { - return NameAsync.Result; - } set { - BridgeConnector.Socket.Emit("appSetName", value); + BridgeConnector.Emit("appSetName", value); } } @@ -491,26 +493,7 @@ public string Name /// should usually also specify a productName field, which is your application's full capitalized name, and /// which will be preferred over name by Electron. /// - public Task NameAsync - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("appGetNameCompleted", (result) => - { - BridgeConnector.Socket.Off("appGetNameCompleted"); - taskCompletionSource.SetResult((string)result); - }); - - BridgeConnector.Socket.Emit("appGetName"); - - return taskCompletionSource.Task; - }); - } - } + public Task GetNameAsync() => BridgeConnector.OnResult("appGetName", "appGetNameCompleted"); internal App() @@ -537,14 +520,17 @@ internal static App Instance } } + /// + /// Manually set that the app is ready instead of using the UseElectron extension method + /// + public static void ManuallySetIsReady() + { + Instance.IsReady = true; + } + private static App _app; private static object _syncRoot = new object(); - private readonly JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver() - }; - /// /// Try to close all windows. The event will be emitted first. If all windows are successfully /// closed, the event will be emitted and by default the application will terminate. This method @@ -553,7 +539,7 @@ internal static App Instance /// public void Quit() { - BridgeConnector.Socket.Emit("appQuit"); + BridgeConnector.EmitSync("appQuit"); } /// @@ -563,7 +549,7 @@ public void Quit() /// Exits immediately with exitCode. exitCode defaults to 0. public void Exit(int exitCode = 0) { - BridgeConnector.Socket.Emit("appExit", exitCode); + BridgeConnector.EmitSync("appExit", exitCode); } /// @@ -578,7 +564,7 @@ public void Exit(int exitCode = 0) /// public void Relaunch() { - BridgeConnector.Socket.Emit("appRelaunch"); + BridgeConnector.EmitSync("appRelaunch"); } /// @@ -596,7 +582,7 @@ public void Relaunch() /// Options for the relaunch. public void Relaunch(RelaunchOptions relaunchOptions) { - BridgeConnector.Socket.Emit("appRelaunch", JObject.FromObject(relaunchOptions, _jsonSerializer)); + BridgeConnector.EmitSync("appRelaunch", JObject.FromObject(relaunchOptions, _jsonSerializer)); } /// @@ -605,7 +591,7 @@ public void Relaunch(RelaunchOptions relaunchOptions) /// public void Focus() { - BridgeConnector.Socket.Emit("appFocus"); + BridgeConnector.Emit("appFocus"); } /// @@ -616,7 +602,7 @@ public void Focus() /// public void Focus(FocusOptions focusOptions) { - BridgeConnector.Socket.Emit("appFocus", JObject.FromObject(focusOptions, _jsonSerializer)); + BridgeConnector.Emit("appFocus", JObject.FromObject(focusOptions, _jsonSerializer)); } /// @@ -624,7 +610,7 @@ public void Focus(FocusOptions focusOptions) /// public void Hide() { - BridgeConnector.Socket.Emit("appHide"); + BridgeConnector.Emit("appHide"); } /// @@ -632,31 +618,13 @@ public void Hide() /// public void Show() { - BridgeConnector.Socket.Emit("appShow"); + BridgeConnector.Emit("appShow"); } /// /// The current application directory. /// - public async Task GetAppPathAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using(cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetAppPathCompleted", (path) => - { - BridgeConnector.Socket.Off("appGetAppPathCompleted"); - taskCompletionSource.SetResult(path.ToString()); - }); - - BridgeConnector.Socket.Emit("appGetAppPath"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetAppPathAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetAppPath", "appGetAppPathCompleted", cancellationToken); /// /// Sets or creates a directory your app's logs which can then be manipulated with @@ -668,7 +636,7 @@ public async Task GetAppPathAsync(CancellationToken cancellationToken = /// A custom path for your logs. Must be absolute. public void SetAppLogsPath(string path) { - BridgeConnector.Socket.Emit("appSetAppLogsPath", path); + BridgeConnector.Emit("appSetAppLogsPath", path); } /// @@ -679,26 +647,8 @@ public void SetAppLogsPath(string path) /// Special directory. /// The cancellation token. /// A path to a special directory or file associated with name. - public async Task GetPathAsync(PathName pathName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using(cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetPathCompleted", (path) => - { - BridgeConnector.Socket.Off("appGetPathCompleted"); - - taskCompletionSource.SetResult(path.ToString()); - }); + public Task GetPathAsync(PathName pathName, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetPath", "appGetPathCompleted", cancellationToken, pathName.GetDescription()); - BridgeConnector.Socket.Emit("appGetPath", pathName.GetDescription()); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } /// /// Overrides the path to a special directory or file associated with name. If the path specifies a directory @@ -714,7 +664,7 @@ public async Task GetPathAsync(PathName pathName, CancellationToken canc /// public void SetPath(PathName name, string path) { - BridgeConnector.Socket.Emit("appSetPath", name.GetDescription(), path); + BridgeConnector.Emit("appSetPath", name.GetDescription(), path); } /// @@ -722,25 +672,7 @@ public void SetPath(PathName name, string path) /// the version of the current bundle or executable is returned. /// /// The version of the loaded application. - public async Task GetVersionAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using(cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetVersionCompleted", (version) => - { - BridgeConnector.Socket.Off("appGetVersionCompleted"); - taskCompletionSource.SetResult(version.ToString()); - }); - - BridgeConnector.Socket.Emit("appGetVersion"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetVersionAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetVersion", "appGetVersionCompleted", cancellationToken); /// /// The current application locale. Possible return values are documented here. @@ -750,25 +682,7 @@ public async Task GetVersionAsync(CancellationToken cancellationToken = /// Note: On Windows, you have to call it after the events gets emitted. /// /// The current application locale. - public async Task GetLocaleAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetLocaleCompleted", (local) => - { - BridgeConnector.Socket.Off("appGetLocaleCompleted"); - taskCompletionSource.SetResult(local.ToString()); - }); - - BridgeConnector.Socket.Emit("appGetLocale"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetLocaleAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetLocale", "appGetLocaleCompleted", cancellationToken); /// /// Adds path to the recent documents list. This list is managed by the OS. On Windows you can visit the @@ -777,7 +691,7 @@ public async Task GetLocaleAsync(CancellationToken cancellationToken = d /// Path to add. public void AddRecentDocument(string path) { - BridgeConnector.Socket.Emit("appAddRecentDocument", path); + BridgeConnector.Emit("appAddRecentDocument", path); } /// @@ -785,7 +699,7 @@ public void AddRecentDocument(string path) /// public void ClearRecentDocuments() { - BridgeConnector.Socket.Emit("appClearRecentDocuments"); + BridgeConnector.Emit("appClearRecentDocuments"); } /// @@ -876,25 +790,7 @@ public async Task SetAsDefaultProtocolClientAsync(string protocol, string /// Arguments passed to the executable. Defaults to an empty array. /// The cancellation token. /// Whether the call succeeded. - public async Task SetAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appSetAsDefaultProtocolClientCompleted", (success) => - { - BridgeConnector.Socket.Off("appSetAsDefaultProtocolClientCompleted"); - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("appSetAsDefaultProtocolClient", protocol, path, args); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task SetAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appSetAsDefaultProtocolClient", "appSetAsDefaultProtocolClientCompleted", cancellationToken, protocol, path, args); /// /// This method checks if the current executable as the default handler for a protocol (aka URI scheme). @@ -930,25 +826,8 @@ public async Task RemoveAsDefaultProtocolClientAsync(string protocol, stri /// Defaults to an empty array. /// The cancellation token. /// Whether the call succeeded. - public async Task RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); + public Task RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appRemoveAsDefaultProtocolClient", "appRemoveAsDefaultProtocolClientCompleted", cancellationToken, protocol, path, args); - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appRemoveAsDefaultProtocolClientCompleted", (success) => - { - BridgeConnector.Socket.Off("appRemoveAsDefaultProtocolClientCompleted"); - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("appRemoveAsDefaultProtocolClient", protocol, path, args); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } /// /// This method checks if the current executable is the default handler for a protocol (aka URI scheme). @@ -1002,25 +881,8 @@ public async Task IsDefaultProtocolClientAsync(string protocol, string pat /// Defaults to an empty array. /// The cancellation token. /// Whether the current executable is the default handler for a protocol (aka URI scheme). - public async Task IsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); + public Task IsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appIsDefaultProtocolClient", "appIsDefaultProtocolClientCompleted", cancellationToken, protocol, path, args); - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appIsDefaultProtocolClientCompleted", (success) => - { - BridgeConnector.Socket.Off("appIsDefaultProtocolClientCompleted"); - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("appIsDefaultProtocolClient", protocol, path, args); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } /// /// Adds tasks to the category of the JumpList on Windows. @@ -1030,50 +892,14 @@ public async Task IsDefaultProtocolClientAsync(string protocol, string pat /// Array of objects. /// The cancellation token. /// Whether the call succeeded. - public async Task SetUserTasksAsync(UserTask[] userTasks, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appSetUserTasksCompleted", (success) => - { - BridgeConnector.Socket.Off("appSetUserTasksCompleted"); - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("appSetUserTasks", JArray.FromObject(userTasks, _jsonSerializer)); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task SetUserTasksAsync(UserTask[] userTasks, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appSetUserTasks", "appSetUserTasksCompleted", cancellationToken, JArray.FromObject(userTasks, _jsonSerializer)); /// /// Jump List settings for the application. /// /// The cancellation token. /// Jump List settings. - public async Task GetJumpListSettingsAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetJumpListSettingsCompleted", (jumpListSettings) => - { - BridgeConnector.Socket.Off("appGetJumpListSettingsCompleted"); - taskCompletionSource.SetResult(JObject.Parse(jumpListSettings.ToString()).ToObject()); - }); - - BridgeConnector.Socket.Emit("appGetJumpListSettings"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetJumpListSettingsAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetJumpListSettings", "appGetJumpListSettingsCompleted", cancellationToken); /// /// Sets or removes a custom Jump List for the application. If categories is null the previously set custom @@ -1093,7 +919,7 @@ public async Task GetJumpListSettingsAsync(CancellationToken c /// Array of objects. public void SetJumpList(JumpListCategory[] categories) { - BridgeConnector.Socket.Emit("appSetJumpList", JArray.FromObject(categories, _jsonSerializer)); + BridgeConnector.Emit("appSetJumpList", JArray.FromObject(categories, _jsonSerializer)); } /// @@ -1117,33 +943,28 @@ public void SetJumpList(JumpListCategory[] categories) /// should continue loading. And returns true if your process has sent its parameters to another instance, and /// you should immediately quit. /// - public async Task RequestSingleInstanceLockAsync(Action newInstanceOpened, CancellationToken cancellationToken = default) + public async Task RequestSingleInstanceLockAsync(Action newInstanceOpened, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) { - BridgeConnector.Socket.On("appRequestSingleInstanceLockCompleted", (success) => + BridgeConnector.On("appRequestSingleInstanceLockCompleted", (success) => { - BridgeConnector.Socket.Off("appRequestSingleInstanceLockCompleted"); - taskCompletionSource.SetResult((bool)success); + BridgeConnector.Off("appRequestSingleInstanceLockCompleted"); + taskCompletionSource.SetResult(success); }); - BridgeConnector.Socket.Off("secondInstance"); - BridgeConnector.Socket.On("secondInstance", (result) => + BridgeConnector.Off("secondInstance"); + BridgeConnector.On("secondInstance", (result) => { - JArray results = (JArray)result; - string[] args = results.First.ToObject(); - string workingDirectory = results.Last.ToObject(); - - newInstanceOpened(args, workingDirectory); + newInstanceOpened(result.args, result.workingDirectory); }); - BridgeConnector.Socket.Emit("appRequestSingleInstanceLock"); + BridgeConnector.Emit("appRequestSingleInstanceLock"); - return await taskCompletionSource.Task - .ConfigureAwait(false); + return await taskCompletionSource.Task.ConfigureAwait(false); } } @@ -1153,7 +974,7 @@ public async Task RequestSingleInstanceLockAsync(Action /// public void ReleaseSingleInstanceLock() { - BridgeConnector.Socket.Emit("appReleaseSingleInstanceLock"); + BridgeConnector.Emit("appReleaseSingleInstanceLock"); } /// @@ -1162,25 +983,7 @@ public void ReleaseSingleInstanceLock() /// . /// /// The cancellation token. - public async Task HasSingleInstanceLockAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appHasSingleInstanceLockCompleted", (hasLock) => - { - BridgeConnector.Socket.Off("appHasSingleInstanceLockCompleted"); - taskCompletionSource.SetResult((bool) hasLock); - }); - - BridgeConnector.Socket.Emit("appHasSingleInstanceLock"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task HasSingleInstanceLockAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appHasSingleInstanceLock", "appHasSingleInstanceLockCompleted", cancellationToken); /// /// Creates an NSUserActivity and sets it as the current activity. The activity is @@ -1208,39 +1011,22 @@ public void SetUserActivity(string type, object userInfo) /// public void SetUserActivity(string type, object userInfo, string webpageUrl) { - BridgeConnector.Socket.Emit("appSetUserActivity", type, userInfo, webpageUrl); + BridgeConnector.Emit("appSetUserActivity", type, userInfo, webpageUrl); } /// /// The type of the currently running activity. /// /// The cancellation token. - public async Task GetCurrentActivityTypeAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetCurrentActivityTypeCompleted", (activityType) => - { - BridgeConnector.Socket.Off("appGetCurrentActivityTypeCompleted"); - taskCompletionSource.SetResult(activityType.ToString()); - }); + public Task GetCurrentActivityTypeAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetCurrentActivityType", "appGetCurrentActivityTypeCompleted", cancellationToken); - BridgeConnector.Socket.Emit("appGetCurrentActivityType"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } /// /// Invalidates the current Handoff user activity. /// public void InvalidateCurrentActivity() { - BridgeConnector.Socket.Emit("appInvalidateCurrentActivity"); + BridgeConnector.Emit("appInvalidateCurrentActivity"); } /// @@ -1248,7 +1034,7 @@ public void InvalidateCurrentActivity() /// public void ResignCurrentActivity() { - BridgeConnector.Socket.Emit("appResignCurrentActivity"); + BridgeConnector.Emit("appResignCurrentActivity"); } /// @@ -1257,7 +1043,7 @@ public void ResignCurrentActivity() /// Model Id. public void SetAppUserModelId(string id) { - BridgeConnector.Socket.Emit("appSetAppUserModelId", id); + BridgeConnector.Emit("appSetAppUserModelId", id); } /// TODO: Check new parameter which is a function [App.ImportCertificate] @@ -1269,25 +1055,7 @@ public void SetAppUserModelId(string id) /// /// The cancellation token. /// Result of import. Value of 0 indicates success. - public async Task ImportCertificateAsync(ImportCertificateOptions options, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appImportCertificateCompleted", (result) => - { - BridgeConnector.Socket.Off("appImportCertificateCompleted"); - taskCompletionSource.SetResult((int) result); - }); - - BridgeConnector.Socket.Emit("appImportCertificate", JObject.FromObject(options, _jsonSerializer)); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task ImportCertificateAsync(ImportCertificateOptions options, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appImportCertificate", "appImportCertificateCompleted", cancellationToken, JObject.FromObject(options, _jsonSerializer)); /// /// Memory and cpu usage statistics of all the processes associated with the app. @@ -1297,27 +1065,7 @@ public async Task ImportCertificateAsync(ImportCertificateOptions options, /// statistics of all the processes associated with the app. /// The cancellation token. /// - public async Task GetAppMetricsAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetAppMetricsCompleted", (result) => - { - BridgeConnector.Socket.Off("appGetAppMetricsCompleted"); - var processMetrics = ((JArray)result).ToObject(); - - taskCompletionSource.SetResult(processMetrics); - }); - - BridgeConnector.Socket.Emit("appGetAppMetrics"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetAppMetricsAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetAppMetrics", "appGetAppMetricsCompleted", cancellationToken); /// /// The Graphics Feature Status from chrome://gpu/. @@ -1325,27 +1073,7 @@ public async Task GetAppMetricsAsync(CancellationToken cancella /// Note: This information is only usable after the gpu-info-update event is emitted. /// The cancellation token. /// - public async Task GetGpuFeatureStatusAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetGpuFeatureStatusCompleted", (result) => - { - BridgeConnector.Socket.Off("appGetGpuFeatureStatusCompleted"); - var gpuFeatureStatus = ((JObject)result).ToObject(); - - taskCompletionSource.SetResult(gpuFeatureStatus); - }); - - BridgeConnector.Socket.Emit("appGetGpuFeatureStatus"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetGpuFeatureStatusAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetGpuFeatureStatus", "appGetGpuFeatureStatusCompleted", cancellationToken); /// /// Sets the counter badge for current app. Setting the count to 0 will hide the badge. @@ -1357,49 +1085,13 @@ public async Task GetGpuFeatureStatusAsync(CancellationToken c /// Counter badge. /// The cancellation token. /// Whether the call succeeded. - public async Task SetBadgeCountAsync(int count, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appSetBadgeCountCompleted", (success) => - { - BridgeConnector.Socket.Off("appSetBadgeCountCompleted"); - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("appSetBadgeCount", count); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task SetBadgeCountAsync(int count, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appSetBadgeCount", "appSetBadgeCountCompleted", cancellationToken, count); /// /// The current value displayed in the counter badge. /// /// The cancellation token. - public async Task GetBadgeCountAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetBadgeCountCompleted", (count) => - { - BridgeConnector.Socket.Off("appGetBadgeCountCompleted"); - taskCompletionSource.SetResult((int)count); - }); - - BridgeConnector.Socket.Emit("appGetBadgeCount"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetBadgeCountAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appGetBadgeCount", "appGetBadgeCountCompleted", cancellationToken); /// /// A object that allows you to read and manipulate the command line arguments that Chromium uses. @@ -1410,25 +1102,7 @@ public async Task GetBadgeCountAsync(CancellationToken cancellationToken = /// Whether the current desktop environment is Unity launcher. /// /// The cancellation token. - public async Task IsUnityRunningAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appIsUnityRunningCompleted", (isUnityRunning) => - { - BridgeConnector.Socket.Off("appIsUnityRunningCompleted"); - taskCompletionSource.SetResult((bool)isUnityRunning); - }); - - BridgeConnector.Socket.Emit("appIsUnityRunning"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task IsUnityRunningAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appIsUnityRunning", "appIsUnityRunningCompleted", cancellationToken); /// /// If you provided path and args options to then you need to pass the same @@ -1445,35 +1119,9 @@ public async Task GetLoginItemSettingsAsync(CancellationToken /// /// /// The cancellation token. - public async Task GetLoginItemSettingsAsync(LoginItemSettingsOptions options, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appGetLoginItemSettingsCompleted", (loginItemSettings) => - { - BridgeConnector.Socket.Off("appGetLoginItemSettingsCompleted"); - - var result = ((JObject) loginItemSettings).ToObject(); - - taskCompletionSource.SetResult(result); - }); - - if (options == null) - { - BridgeConnector.Socket.Emit("appGetLoginItemSettings"); - } - else - { - BridgeConnector.Socket.Emit("appGetLoginItemSettings", JObject.FromObject(options, _jsonSerializer)); - } - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetLoginItemSettingsAsync(LoginItemSettingsOptions options, CancellationToken cancellationToken = default) => + options is null ? BridgeConnector.OnResult("appGetLoginItemSettings", "appGetLoginItemSettingsCompleted", cancellationToken) + : BridgeConnector.OnResult("appGetLoginItemSettings", "appGetLoginItemSettingsCompleted", cancellationToken, JObject.FromObject(options, _jsonSerializer)); /// /// Set the app's login item settings. @@ -1483,7 +1131,7 @@ public async Task GetLoginItemSettingsAsync(LoginItemSettings /// public void SetLoginItemSettings(LoginSettings loginSettings) { - BridgeConnector.Socket.Emit("appSetLoginItemSettings", JObject.FromObject(loginSettings, _jsonSerializer)); + BridgeConnector.Emit("appSetLoginItemSettings", JObject.FromObject(loginSettings, _jsonSerializer)); } /// @@ -1492,25 +1140,8 @@ public void SetLoginItemSettings(LoginSettings loginSettings) /// See Chromium's accessibility docs for more details. /// /// if Chrome’s accessibility support is enabled, otherwise. - public async Task IsAccessibilitySupportEnabledAsync(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appIsAccessibilitySupportEnabledCompleted", (isAccessibilitySupportEnabled) => - { - BridgeConnector.Socket.Off("appIsAccessibilitySupportEnabledCompleted"); - taskCompletionSource.SetResult((bool)isAccessibilitySupportEnabled); - }); + public Task IsAccessibilitySupportEnabledAsync(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appIsAccessibilitySupportEnabled", "appIsAccessibilitySupportEnabledCompleted", cancellationToken); - BridgeConnector.Socket.Emit("appIsAccessibilitySupportEnabled"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } /// /// Manually enables Chrome's accessibility support, allowing to expose accessibility switch to users in application settings. @@ -1524,7 +1155,7 @@ public async Task IsAccessibilitySupportEnabledAsync(CancellationToken can /// Enable or disable accessibility tree rendering. public void SetAccessibilitySupportEnabled(bool enabled) { - BridgeConnector.Socket.Emit("appSetAboutPanelOptions", enabled); + BridgeConnector.Emit("appSetAboutPanelOptions", enabled); } /// @@ -1533,7 +1164,7 @@ public void SetAccessibilitySupportEnabled(bool enabled) /// public void ShowAboutPanel() { - BridgeConnector.Socket.Emit("appShowAboutPanel"); + BridgeConnector.Emit("appShowAboutPanel"); } /// @@ -1549,7 +1180,7 @@ public void ShowAboutPanel() /// About panel options. public void SetAboutPanelOptions(AboutPanelOptions options) { - BridgeConnector.Socket.Emit("appSetAboutPanelOptions", JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("appSetAboutPanelOptions", JObject.FromObject(options, _jsonSerializer)); } /// @@ -1562,14 +1193,9 @@ public void SetAboutPanelOptions(AboutPanelOptions options) /// public string UserAgentFallback { - [Obsolete("Use the asynchronous version UserAgentFallbackAsync instead")] - get - { - return UserAgentFallbackAsync.Result; - } set { - BridgeConnector.Socket.Emit("appSetUserAgentFallback", value); + BridgeConnector.Emit("appSetUserAgentFallback", value); } } @@ -1581,26 +1207,7 @@ public string UserAgentFallback /// custom value as early as possible in your app's initialization to ensure that your overridden value /// is used. /// - public Task UserAgentFallbackAsync - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("appGetUserAgentFallbackCompleted", (result) => - { - BridgeConnector.Socket.Off("appGetUserAgentFallbackCompleted"); - taskCompletionSource.SetResult((string)result); - }); - - BridgeConnector.Socket.Emit("appGetUserAgentFallback"); - - return taskCompletionSource.Task; - }); - } - } + public Task GetUserAgentFallbackAsync() => BridgeConnector.OnResult("appGetUserAgentFallback", "appGetUserAgentFallbackCompleted"); internal void PreventQuit() { @@ -1615,28 +1222,32 @@ internal void PreventQuit() /// /// The event name /// The handler - public void On(string eventName, Action fn) - => Events.Instance.On(ModuleName, eventName, fn); + public void On(string eventName, Action fn) => Events.Instance.On(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module. /// /// The event name /// The handler - public void On(string eventName, Action fn) - => Events.Instance.On(ModuleName, eventName, fn); + public void On(string eventName, Action fn) => Events.Instance.On(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler - public void Once(string eventName, Action fn) - => Events.Instance.Once(ModuleName, eventName, fn); + public void Once(string eventName, Action fn) => Events.Instance.Once(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler - public void Once(string eventName, Action fn) - => Events.Instance.Once(ModuleName, eventName, fn); + public void Once(string eventName, Action fn) => Events.Instance.Once(ModuleName, eventName, fn); + + private readonly JsonSerializer _jsonSerializer = new JsonSerializer() + { + ContractResolver = new CamelCasePropertyNamesContractResolver() + }; } } \ No newline at end of file diff --git a/ElectronNET.API/ApplicationSocket.cs b/ElectronNET.API/ApplicationSocket.cs new file mode 100755 index 00000000..7480b802 --- /dev/null +++ b/ElectronNET.API/ApplicationSocket.cs @@ -0,0 +1,16 @@ +using ElectronNET.API.Interfaces; +using Quobject.SocketIoClientDotNet.Client; + +namespace ElectronNET.API +{ + /// + /// Wrapper for the underlying Socket connection + /// + public class ApplicationSocket : IApplicationSocket + { + /// + /// Socket used to communicate with main.js + /// + public Socket Socket { get; internal set; } + } +} diff --git a/ElectronNET.API/AutoUpdater.cs b/ElectronNET.API/AutoUpdater.cs old mode 100644 new mode 100755 index da1001fa..c4df3d05 --- a/ElectronNET.API/AutoUpdater.cs +++ b/ElectronNET.API/AutoUpdater.cs @@ -5,39 +5,52 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Enable apps to automatically update themselves. Based on electron-updater. /// - public sealed class AutoUpdater + public sealed class AutoUpdater : IAutoUpdater { /// /// Whether to automatically download an update when it is found. (Default is true) /// - public bool AutoDownload - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); + public Task IsAutoDownloadEnabledAsync() => BridgeConnector.OnResult("autoUpdater-autoDownload-get", "autoUpdater-autoDownload-get-reply"); - BridgeConnector.Socket.On("autoUpdater-autoDownload-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-autoDownload-get-reply"); - taskCompletionSource.SetResult((bool)result); - }); + /// + /// Whether to automatically install a downloaded update on app quit (if `QuitAndInstall` was not called before). + /// + /// Applicable only on Windows and Linux. + /// + public Task IsAutoInstallOnAppQuitEnabledAsync() => BridgeConnector.OnResult("autoUpdater-autoInstallOnAppQuit-get", "autoUpdater-autoInstallOnAppQuit-get-reply"); + + /// + /// *GitHub provider only.* Whether to allow update to pre-release versions. + /// Defaults to "true" if application version contains prerelease components (e.g. "0.12.1-alpha.1", here "alpha" is a prerelease component), otherwise "false". + /// + /// If "true", downgrade will be allowed("allowDowngrade" will be set to "true"). + /// + public Task IsAllowPrereleaseEnabledAsync() => BridgeConnector.OnResult("autoUpdater-allowPrerelease-get", "autoUpdater-allowPrerelease-get-reply"); - BridgeConnector.Socket.Emit("autoUpdater-autoDownload-get"); + /// + /// *GitHub provider only.* + /// Get all release notes (from current version to latest), not just the latest (Default is false). + /// + public Task IsFullChangeLogEnabledAsync() => BridgeConnector.OnResult("autoUpdater-fullChangelog-get", "autoUpdater-fullChangelog-get-reply"); - return taskCompletionSource.Task; - }).Result; - } + public Task IsAllowDowngradeEnabledAsync() => BridgeConnector.OnResult("autoUpdater-allowDowngrade-get", "autoUpdater-allowDowngrade-get-reply"); + + + /// + /// Whether to automatically download an update when it is found. (Default is true) + /// + public bool AutoDownload + { set { - BridgeConnector.Socket.Emit("autoUpdater-autoDownload-set", value); + BridgeConnector.Emit("autoUpdater-autoDownload-set", value); } } @@ -48,26 +61,9 @@ public bool AutoDownload /// public bool AutoInstallOnAppQuit { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-autoInstallOnAppQuit-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-autoInstallOnAppQuit-get-reply"); - taskCompletionSource.SetResult((bool)result); - }); - - BridgeConnector.Socket.Emit("autoUpdater-autoInstallOnAppQuit-get"); - - return taskCompletionSource.Task; - }).Result; - } set { - BridgeConnector.Socket.Emit("autoUpdater-autoInstallOnAppQuit-set", value); + BridgeConnector.Emit("autoUpdater-autoInstallOnAppQuit-set", value); } } @@ -79,26 +75,9 @@ public bool AutoInstallOnAppQuit /// public bool AllowPrerelease { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-allowPrerelease-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-allowPrerelease-get-reply"); - taskCompletionSource.SetResult((bool)result); - }); - - BridgeConnector.Socket.Emit("autoUpdater-allowPrerelease-get"); - - return taskCompletionSource.Task; - }).Result; - } set { - BridgeConnector.Socket.Emit("autoUpdater-allowPrerelease-set", value); + BridgeConnector.Emit("autoUpdater-allowPrerelease-set", value); } } @@ -108,26 +87,9 @@ public bool AllowPrerelease /// public bool FullChangelog { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-fullChangelog-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-fullChangelog-get-reply"); - taskCompletionSource.SetResult((bool)result); - }); - - BridgeConnector.Socket.Emit("autoUpdater-fullChangelog-get"); - - return taskCompletionSource.Task; - }).Result; - } set { - BridgeConnector.Socket.Emit("autoUpdater-fullChangelog-set", value); + BridgeConnector.Emit("autoUpdater-fullChangelog-set", value); } } @@ -138,137 +100,32 @@ public bool FullChangelog /// public bool AllowDowngrade { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-allowDowngrade-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-allowDowngrade-get-reply"); - taskCompletionSource.SetResult((bool)result); - }); - - BridgeConnector.Socket.Emit("autoUpdater-allowDowngrade-get"); - - return taskCompletionSource.Task; - }).Result; - } set { - BridgeConnector.Socket.Emit("autoUpdater-allowDowngrade-set", value); + BridgeConnector.Emit("autoUpdater-allowDowngrade-set", value); } } /// /// For test only. /// - public string UpdateConfigPath - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-updateConfigPath-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-updateConfigPath-get-reply"); - taskCompletionSource.SetResult(result.ToString()); - }); - - BridgeConnector.Socket.Emit("autoUpdater-updateConfigPath-get"); - - return taskCompletionSource.Task; - }).Result; - } - } + public Task GetUpdateConfigPathAsync() => BridgeConnector.OnResult("autoUpdater-updateConfigPath-get", "autoUpdater-updateConfigPath-get-reply"); /// /// The current application version /// - public Task CurrentVersionAsync - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-currentVersion-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-currentVersion-get-reply"); - SemVer version = ((JObject)result).ToObject(); - taskCompletionSource.SetResult(version); - }); - BridgeConnector.Socket.Emit("autoUpdater-currentVersion-get"); - - return taskCompletionSource.Task; - }); - } - } + public Task GetCurrentVersionAsync() => BridgeConnector.OnResult("autoUpdater-updateConcurrentVersionfigPath-get", "autoUpdater-currentVersion-get-reply"); /// /// Get the update channel. Not applicable for GitHub. /// Doesn’t return channel from the update configuration, only if was previously set. /// - [Obsolete("Use the asynchronous version ChannelAsync instead")] - public string Channel - { - get - { - return ChannelAsync.Result; - } - } - - /// - /// Get the update channel. Not applicable for GitHub. - /// Doesn’t return channel from the update configuration, only if was previously set. - /// - public Task ChannelAsync - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("autoUpdater-channel-get-reply", (result) => - { - BridgeConnector.Socket.Off("autoUpdater-channel-get-reply"); - taskCompletionSource.SetResult(result.ToString()); - }); - BridgeConnector.Socket.Emit("autoUpdater-channel-get"); - - return taskCompletionSource.Task; - }); - } - } - - + public Task GetChannelAsync() => BridgeConnector.OnResult("autoUpdater-channel-get", "autoUpdater-channel-get-reply"); /// /// The request headers. /// - public Task> RequestHeadersAsync - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource>(); - BridgeConnector.Socket.On("autoUpdater-requestHeaders-get-reply", (headers) => - { - BridgeConnector.Socket.Off("autoUpdater-requestHeaders-get-reply"); - Dictionary result = ((JObject)headers).ToObject>(); - taskCompletionSource.SetResult(result); - }); - BridgeConnector.Socket.Emit("autoUpdater-requestHeaders-get"); - return taskCompletionSource.Task; - }); - } - } + public Task> GetRequestHeadersAsync() => BridgeConnector.OnResult>("autoUpdater-requestHeaders-get", "autoUpdater-requestHeaders-get-reply"); /// /// The request headers. @@ -277,7 +134,7 @@ public Dictionary RequestHeaders { set { - BridgeConnector.Socket.Emit("autoUpdater-requestHeaders-set", JObject.FromObject(value, _jsonSerializer)); + BridgeConnector.Emit("autoUpdater-requestHeaders-set", value); } } @@ -290,12 +147,12 @@ public event Action OnError { if (_error == null) { - BridgeConnector.Socket.On("autoUpdater-error" + GetHashCode(), (message) => + BridgeConnector.On("autoUpdater-error" + GetHashCode(), (message) => { _error(message.ToString()); }); - BridgeConnector.Socket.Emit("register-autoUpdater-error-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-error-event", GetHashCode()); } _error += value; } @@ -304,7 +161,7 @@ public event Action OnError _error -= value; if (_error == null) - BridgeConnector.Socket.Off("autoUpdater-error" + GetHashCode()); + BridgeConnector.Off("autoUpdater-error" + GetHashCode()); } } @@ -319,12 +176,12 @@ public event Action OnCheckingForUpdate { if (_checkingForUpdate == null) { - BridgeConnector.Socket.On("autoUpdater-checking-for-update" + GetHashCode(), () => + BridgeConnector.On("autoUpdater-checking-for-update" + GetHashCode(), () => { _checkingForUpdate(); }); - BridgeConnector.Socket.Emit("register-autoUpdater-checking-for-update-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-checking-for-update-event", GetHashCode()); } _checkingForUpdate += value; } @@ -333,7 +190,7 @@ public event Action OnCheckingForUpdate _checkingForUpdate -= value; if (_checkingForUpdate == null) - BridgeConnector.Socket.Off("autoUpdater-checking-for-update" + GetHashCode()); + BridgeConnector.Off("autoUpdater-checking-for-update" + GetHashCode()); } } @@ -349,12 +206,12 @@ public event Action OnUpdateAvailable { if (_updateAvailable == null) { - BridgeConnector.Socket.On("autoUpdater-update-available" + GetHashCode(), (updateInfo) => + BridgeConnector.On("autoUpdater-update-available" + GetHashCode(), (updateInfo) => { - _updateAvailable(JObject.Parse(updateInfo.ToString()).ToObject()); + _updateAvailable(updateInfo); }); - BridgeConnector.Socket.Emit("register-autoUpdater-update-available-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-update-available-event", GetHashCode()); } _updateAvailable += value; } @@ -363,7 +220,7 @@ public event Action OnUpdateAvailable _updateAvailable -= value; if (_updateAvailable == null) - BridgeConnector.Socket.Off("autoUpdater-update-available" + GetHashCode()); + BridgeConnector.Off("autoUpdater-update-available" + GetHashCode()); } } @@ -378,12 +235,12 @@ public event Action OnUpdateNotAvailable { if (_updateNotAvailable == null) { - BridgeConnector.Socket.On("autoUpdater-update-not-available" + GetHashCode(), (updateInfo) => + BridgeConnector.On("autoUpdater-update-not-available" + GetHashCode(), (updateInfo) => { - _updateNotAvailable(JObject.Parse(updateInfo.ToString()).ToObject()); + _updateNotAvailable(updateInfo); }); - BridgeConnector.Socket.Emit("register-autoUpdater-update-not-available-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-update-not-available-event", GetHashCode()); } _updateNotAvailable += value; } @@ -392,7 +249,7 @@ public event Action OnUpdateNotAvailable _updateNotAvailable -= value; if (_updateNotAvailable == null) - BridgeConnector.Socket.Off("autoUpdater-update-not-available" + GetHashCode()); + BridgeConnector.Off("autoUpdater-update-not-available" + GetHashCode()); } } @@ -407,12 +264,12 @@ public event Action OnDownloadProgress { if (_downloadProgress == null) { - BridgeConnector.Socket.On("autoUpdater-download-progress" + GetHashCode(), (progressInfo) => + BridgeConnector.On("autoUpdater-download-progress" + GetHashCode(), (progressInfo) => { - _downloadProgress(JObject.Parse(progressInfo.ToString()).ToObject()); + _downloadProgress(progressInfo); }); - BridgeConnector.Socket.Emit("register-autoUpdater-download-progress-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-download-progress-event", GetHashCode()); } _downloadProgress += value; } @@ -421,7 +278,7 @@ public event Action OnDownloadProgress _downloadProgress -= value; if (_downloadProgress == null) - BridgeConnector.Socket.Off("autoUpdater-download-progress" + GetHashCode()); + BridgeConnector.Off("autoUpdater-download-progress" + GetHashCode()); } } @@ -436,12 +293,12 @@ public event Action OnUpdateDownloaded { if (_updateDownloaded == null) { - BridgeConnector.Socket.On("autoUpdater-update-downloaded" + GetHashCode(), (updateInfo) => + BridgeConnector.On("autoUpdater-update-downloaded" + GetHashCode(), (updateInfo) => { - _updateDownloaded(JObject.Parse(updateInfo.ToString()).ToObject()); + _updateDownloaded(updateInfo); }); - BridgeConnector.Socket.Emit("register-autoUpdater-update-downloaded-event", GetHashCode()); + BridgeConnector.Emit("register-autoUpdater-update-downloaded-event", GetHashCode()); } _updateDownloaded += value; } @@ -450,7 +307,7 @@ public event Action OnUpdateDownloaded _updateDownloaded -= value; if (_updateDownloaded == null) - BridgeConnector.Socket.Off("autoUpdater-update-downloaded" + GetHashCode()); + BridgeConnector.Off("autoUpdater-update-downloaded" + GetHashCode()); } } @@ -486,33 +343,33 @@ internal static AutoUpdater Instance /// public Task CheckForUpdatesAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("autoUpdaterCheckForUpdatesComplete" + guid, (updateCheckResult) => + BridgeConnector.On("autoUpdaterCheckForUpdatesComplete" + guid, (updateCheckResult) => { try { - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesComplete" + guid); - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesError" + guid); - taskCompletionSource.SetResult(JObject.Parse(updateCheckResult.ToString()).ToObject()); + BridgeConnector.Off("autoUpdaterCheckForUpdatesComplete" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesError" + guid); + taskCompletionSource.SetResult(updateCheckResult); } catch (Exception ex) { taskCompletionSource.SetException(ex); } }); - BridgeConnector.Socket.On("autoUpdaterCheckForUpdatesError" + guid, (error) => + BridgeConnector.On("autoUpdaterCheckForUpdatesError" + guid, (error) => { - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesComplete" + guid); - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesError" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesComplete" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesError" + guid); string message = "An error occurred in CheckForUpdatesAsync"; if (error != null && !string.IsNullOrEmpty(error.ToString())) message = JsonConvert.SerializeObject(error); taskCompletionSource.SetException(new Exception(message)); }); - BridgeConnector.Socket.Emit("autoUpdaterCheckForUpdates", guid); + BridgeConnector.Emit("autoUpdaterCheckForUpdates", guid); return taskCompletionSource.Task; } @@ -525,36 +382,36 @@ public Task CheckForUpdatesAsync() /// public Task CheckForUpdatesAndNotifyAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid, (updateCheckResult) => + BridgeConnector.On("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid, (updateCheckResult) => { try { - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid); - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesAndNotifyError" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesAndNotifyError" + guid); if (updateCheckResult == null) taskCompletionSource.SetResult(null); else - taskCompletionSource.SetResult(JObject.Parse(updateCheckResult.ToString()).ToObject()); + taskCompletionSource.SetResult(updateCheckResult); } catch (Exception ex) { taskCompletionSource.SetException(ex); } }); - BridgeConnector.Socket.On("autoUpdaterCheckForUpdatesAndNotifyError" + guid, (error) => + BridgeConnector.On("autoUpdaterCheckForUpdatesAndNotifyError" + guid, (error) => { - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid); - BridgeConnector.Socket.Off("autoUpdaterCheckForUpdatesAndNotifyError" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesAndNotifyComplete" + guid); + BridgeConnector.Off("autoUpdaterCheckForUpdatesAndNotifyError" + guid); string message = "An error occurred in autoUpdaterCheckForUpdatesAndNotify"; if (error != null) message = JsonConvert.SerializeObject(error); taskCompletionSource.SetException(new Exception(message)); }); - BridgeConnector.Socket.Emit("autoUpdaterCheckForUpdatesAndNotify", guid); + BridgeConnector.Emit("autoUpdaterCheckForUpdatesAndNotify", guid); return taskCompletionSource.Task; } @@ -570,7 +427,7 @@ public Task CheckForUpdatesAndNotifyAsync() /// Run the app after finish even on silent install. Not applicable for macOS. Ignored if `isSilent` is set to `false`. public void QuitAndInstall(bool isSilent = false, bool isForceRunAfter = false) { - BridgeConnector.Socket.Emit("autoUpdaterQuitAndInstall", isSilent, isForceRunAfter); + BridgeConnector.EmitSync("autoUpdaterQuitAndInstall", isSilent, isForceRunAfter); } /// @@ -579,16 +436,16 @@ public void QuitAndInstall(bool isSilent = false, bool isForceRunAfter = false) /// Path to downloaded file. public Task DownloadUpdateAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("autoUpdaterDownloadUpdateComplete" + guid, (downloadedPath) => + BridgeConnector.On("autoUpdaterDownloadUpdateComplete" + guid, (downloadedPath) => { - BridgeConnector.Socket.Off("autoUpdaterDownloadUpdateComplete" + guid); + BridgeConnector.Off("autoUpdaterDownloadUpdateComplete" + guid); taskCompletionSource.SetResult(downloadedPath.ToString()); }); - BridgeConnector.Socket.Emit("autoUpdaterDownloadUpdate", guid); + BridgeConnector.Emit("autoUpdaterDownloadUpdate", guid); return taskCompletionSource.Task; } @@ -599,23 +456,18 @@ public Task DownloadUpdateAsync() /// Feed URL. public Task GetFeedURLAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("autoUpdaterGetFeedURLComplete" + guid, (downloadedPath) => + BridgeConnector.On("autoUpdaterGetFeedURLComplete" + guid, (downloadedPath) => { - BridgeConnector.Socket.Off("autoUpdaterGetFeedURLComplete" + guid); + BridgeConnector.Off("autoUpdaterGetFeedURLComplete" + guid); taskCompletionSource.SetResult(downloadedPath.ToString()); }); - BridgeConnector.Socket.Emit("autoUpdaterGetFeedURL", guid); + BridgeConnector.Emit("autoUpdaterGetFeedURL", guid); return taskCompletionSource.Task; } - - private readonly JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver() - }; } } diff --git a/ElectronNET.API/BridgeConnector.cs b/ElectronNET.API/BridgeConnector.cs index 08a84745..95c9e0db 100644 --- a/ElectronNET.API/BridgeConnector.cs +++ b/ElectronNET.API/BridgeConnector.cs @@ -1,44 +1,422 @@ -using Quobject.SocketIoClientDotNet.Client; using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; +using SocketIOClient; +using SocketIOClient.JsonSerializer; +using SocketIOClient.Newtonsoft.Json; namespace ElectronNET.API { internal static class BridgeConnector { - private static Socket _socket; + internal static class EventTasks + { + //Although SocketIO already manage event handlers, we need to manage this here as well for the OnResult calls, + //because SocketIO will simply replace the existing event handler on every call to On(key, ...) , which means there is + //a race condition between On / Off calls that can lead to tasks deadlocking forever without ever triggering their On handler + + private static readonly Dictionary> _taskCompletionSources = new(); + private static readonly Dictionary _eventKeys = new(); + private static readonly object _lock = new(); + + /// + /// Get or add a new TaskCompletionSource for a given event key + /// + /// + /// + /// + /// + /// Returns true if a new TaskCompletionSource was added to the dictionary + internal static bool TryGetOrAdd(string key, string eventKey, out TaskCompletionSource taskCompletionSource, out Task waitThisFirstAndThenTryAgain) + { + lock (_lock) + { + if (!_taskCompletionSources.TryGetValue(key, out taskCompletionSource)) + { + taskCompletionSource = new(TaskCreationOptions.RunContinuationsAsynchronously); + _taskCompletionSources[key] = taskCompletionSource; + _eventKeys[key] = eventKey; + waitThisFirstAndThenTryAgain = null; + return true; //Was added, so we need to also register the socket events + } + + if(_eventKeys.TryGetValue(key, out var existingEventKey) && existingEventKey == eventKey) + { + waitThisFirstAndThenTryAgain = null; + return false; //No need to register the socket events twice + } + + waitThisFirstAndThenTryAgain = taskCompletionSource.Task; //Will need to try again after the previous existing one is done + + taskCompletionSource = null; + + return true; //Need to register the socket events, but must first await the previous task to complete + } + } + + /// + /// Clean up the TaskCompletionSource from the dictionary if and only if it is the same as the passed argument + /// + /// + /// + /// + internal static void DoneWith(string key, string eventKey, TaskCompletionSource taskCompletionSource) + { + lock (_lock) + { + if (_taskCompletionSources.TryGetValue(key, out var existingTaskCompletionSource) + && ReferenceEquals(existingTaskCompletionSource, taskCompletionSource)) + { + _taskCompletionSources.Remove(key); + } + + if (_eventKeys.TryGetValue(key, out var existingEventKey) && existingEventKey == eventKey) + { + _eventKeys.Remove(key); + } + } + } + } + + private static SocketIO _socket; + private static object _syncRoot = new object(); - public static Socket Socket + public static void Emit(string eventString, params object[] args) { - get + //We don't care about waiting for the event to be emitted, so this doesn't need to be async + + Task.Run(async () => { - if(_socket == null && HybridSupport.IsElectronActive) + if (App.SocketDebug) + { + Console.WriteLine($"Sending event {eventString}"); + } + + await Socket.EmitAsync(eventString, args); + + if (App.SocketDebug) { - lock (_syncRoot) + Console.WriteLine($"Sent event {eventString}"); + } + }); + } + + /// + /// This method is only used on places where we need to be sure the event was sent on the socket, such as Quit, Exit, Relaunch and QuitAndInstall methods + /// + /// + /// + internal static void EmitSync(string eventString, params object[] args) + { + if (App.SocketDebug) + { + Console.WriteLine($"Sending event {eventString}"); + } + + Socket.EmitAsync(eventString, args).Wait(); + + if (App.SocketDebug) + { + Console.WriteLine($"Sent event {eventString}"); + } + } + + public static void Off(string eventString) + { + Socket.Off(eventString); + } + + public static void On(string eventString, Action fn) + { + Socket.On(eventString, _ => fn()); + } + + public static void On(string eventString, Action fn) + { + Socket.On(eventString, (o) => fn(o.GetValue(0))); + } + + public static void Once(string eventString, Action fn) + { + On(eventString, (o) => + { + Off(eventString); + fn(o); + }); + } + + public static async Task OnResult(string triggerEvent, string completedEvent, params object[] args) + { + string eventKey = completedEvent; + + if (args is object && args.Length > 0) // If there are arguments passed, we generate a unique event key with the arguments + // this allow us to wait for previous events first before registering new ones + { + var hash = new HashCode(); + foreach(var obj in args) + { + hash.Add(obj); + } + eventKey = $"{eventKey}-{(uint)hash.ToHashCode()}"; + } + + if (EventTasks.TryGetOrAdd(completedEvent, eventKey, out var taskCompletionSource, out var waitThisFirstAndThenTryAgain)) + { + if (waitThisFirstAndThenTryAgain is object) + { + //There was a pending call with different parameters, so we need to wait that first and then call here again + try + { + await waitThisFirstAndThenTryAgain; + } + catch { - if (_socket == null && HybridSupport.IsElectronActive) + //Ignore any exceptions here so we can set a new event below + //The exception will also be visible to the original first caller due to taskCompletionSource.Task + } + + //Try again to set the event + return await OnResult(triggerEvent, completedEvent, args); + } + else + { + //A new TaskCompletionSource was added, so we need to register the completed event here + + On(completedEvent, (result) => + { + Off(completedEvent); + taskCompletionSource.SetResult(result); + EventTasks.DoneWith(completedEvent, eventKey, taskCompletionSource); + }); + + Emit(triggerEvent, args); + } + } + + return await taskCompletionSource.Task; + } + + + public static async Task OnResult(string triggerEvent, string completedEvent, CancellationToken cancellationToken, params object[] args) + { + string eventKey = completedEvent; + + if (args is object && args.Length > 0) // If there are arguments passed, we generate a unique event key with the arguments + // this allow us to wait for previous events first before registering new ones + { + var hash = new HashCode(); + foreach (var obj in args) + { + hash.Add(obj); + } + eventKey = $"{eventKey}-{(uint)hash.ToHashCode()}"; + } + + if (EventTasks.TryGetOrAdd(completedEvent, eventKey, out var taskCompletionSource, out var waitThisFirstAndThenTryAgain)) + { + if (waitThisFirstAndThenTryAgain is object) + { + //There was a pending call with different parameters, so we need to wait that first and then call here again + try + { + await Task.Run(() => waitThisFirstAndThenTryAgain, cancellationToken); + } + catch + { + //Ignore any exceptions here so we can set a new event below + //The exception will also be visible to the original first caller due to taskCompletionSource.Task + } + + //Try again to set the event + return await OnResult(triggerEvent, completedEvent, cancellationToken, args); + } + else + { + using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) + { + //A new TaskCompletionSource was added, so we need to register the completed event here + + On(completedEvent, (result) => { - _socket = IO.Socket("http://localhost:" + BridgeSettings.SocketPort); - _socket.On(Socket.EVENT_CONNECT, () => - { - Console.WriteLine("BridgeConnector connected!"); - }); - } + Off(completedEvent); + taskCompletionSource.SetResult(result); + EventTasks.DoneWith(completedEvent, eventKey, taskCompletionSource); + }); + + Emit(triggerEvent, args); } } - else if(_socket == null && !HybridSupport.IsElectronActive) + } + + return await taskCompletionSource.Task; + } + private static SocketIO Socket + { + get + { + if (_socket is null) { - lock (_syncRoot) + if (HybridSupport.IsElectronActive) { - if (_socket == null && !HybridSupport.IsElectronActive) + + lock (_syncRoot) { - _socket = IO.Socket(new Uri("http://localhost"), new IO.Options { AutoConnect = false }); + if (_socket is null && HybridSupport.IsElectronActive) + { + var socket = new SocketIO($"http://localhost:{BridgeSettings.SocketPort}", new SocketIOOptions() + { + EIO = 3 + }); + + socket.JsonSerializer = new CamelCaseNewtonsoftJsonSerializer(socket.Options.EIO); + + + socket.OnConnected += (_, __) => + { + Console.WriteLine("BridgeConnector connected!"); + }; + + socket.ConnectAsync().Wait(); + + _socket = socket; + } } } + else + { + throw new Exception("Missing Socket Port"); + } } return _socket; } } + + private class CamelCaseNewtonsoftJsonSerializer : NewtonsoftJsonSerializer + { + public CamelCaseNewtonsoftJsonSerializer(int eio) : base(eio) + { + } + + public override JsonSerializerSettings CreateOptions() + { + return new JsonSerializerSettings() + { + ContractResolver = new CamelCasePropertyNamesContractResolver(), + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + }; + } + } + public static async Task GetValueOverSocketAsync(string eventString, string eventCompletedString) + { + CancellationToken cancellationToken = new(); + cancellationToken.ThrowIfCancellationRequested(); + + var taskCompletionSource = new TaskCompletionSource(); + using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) + { + BridgeConnector.Socket.On(eventCompletedString, (value) => + { + BridgeConnector.Socket.Off(eventCompletedString); + + if (value == null) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') returned null. Socket loop hang."); + taskCompletionSource.SetCanceled(); + return; + } + + try + { + taskCompletionSource.SetResult( new JValue(value).ToObject() ); + } + catch (Exception e) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') exception: {e.Message}. Socket loop hung."); + } + }); + + await BridgeConnector.Socket.EmitAsync(eventString); + + return await taskCompletionSource.Task.ConfigureAwait(false); + } + } + + public static async Task GetObjectOverSocketAsync(string eventString, string eventCompletedString) + { + CancellationToken cancellationToken = new(); + cancellationToken.ThrowIfCancellationRequested(); + + var taskCompletionSource = new TaskCompletionSource(); + using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) + { + BridgeConnector.Socket.On(eventCompletedString, (value) => + { + BridgeConnector.Socket.Off(eventCompletedString); + + if (value == null) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') returned null. Socket loop hang."); + taskCompletionSource.SetCanceled(); + return; + } + + try + { + taskCompletionSource.SetResult( ((JObject)value).ToObject() ); + } + catch (Exception e) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') exception: {e.Message}. Socket loop hung."); + } + }); + + await BridgeConnector.Socket.EmitAsync(eventString); + + return await taskCompletionSource.Task.ConfigureAwait(false); + } + } + + public static async Task GetArrayOverSocketAsync(string eventString, string eventCompletedString) + { + CancellationToken cancellationToken = new(); + cancellationToken.ThrowIfCancellationRequested(); + + var taskCompletionSource = new TaskCompletionSource(); + using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) + { + BridgeConnector.Socket.On(eventCompletedString, (value) => + { + BridgeConnector.Socket.Off(eventCompletedString); + if (value == null) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') returned null. Socket loop hang."); + taskCompletionSource.SetCanceled(); + return; + } + + try + { + taskCompletionSource.SetResult(((JArray)value).ToObject() ); + } + catch (Exception e) + { + Console.WriteLine($"ERROR: BridgeConnector (event: '{eventString}') exception: {e.Message}. Socket loop hung."); + } + }); + + await BridgeConnector.Socket.EmitAsync(eventString); + + return await taskCompletionSource.Task.ConfigureAwait(false); + } + } } } diff --git a/ElectronNET.API/BridgeSettings.cs b/ElectronNET.API/BridgeSettings.cs index 96a2653a..daa230a1 100644 --- a/ElectronNET.API/BridgeSettings.cs +++ b/ElectronNET.API/BridgeSettings.cs @@ -20,5 +20,16 @@ public static class BridgeSettings /// The web port. /// public static string WebPort { get; internal set; } + + /// + /// Manually set the port values instead of using the UseElectron extension method + /// + /// + /// + public static void InitializePorts(int socketPort, int webPort) + { + SocketPort = socketPort.ToString(); + WebPort = webPort.ToString(); + } } } diff --git a/ElectronNET.API/BrowserView.cs b/ElectronNET.API/BrowserView.cs index 96bddd7f..09a44cbd 100644 --- a/ElectronNET.API/BrowserView.cs +++ b/ElectronNET.API/BrowserView.cs @@ -31,29 +31,11 @@ public class BrowserView /// /// (experimental) /// - public Rectangle Bounds - { - get - { - return Task.Run(() => - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserView-getBounds-reply", (result) => - { - BridgeConnector.Socket.Off("browserView-getBounds-reply"); - taskCompletionSource.SetResult((Rectangle)result); - }); - - BridgeConnector.Socket.Emit("browserView-getBounds", Id); + public Task GetBoundsAsync() => BridgeConnector.OnResult("browserView-getBounds", "browserView-getBounds-reply" + Id, Id); - return taskCompletionSource.Task; - }).Result; - } - set - { - BridgeConnector.Socket.Emit("browserView-setBounds", Id, JObject.FromObject(value, _jsonSerializer)); - } + public void SetBounds(Rectangle value) + { + BridgeConnector.Emit("browserView-setBounds", Id, value); } /// @@ -74,7 +56,7 @@ internal BrowserView(int id) /// public void SetAutoResize(AutoResizeOptions options) { - BridgeConnector.Socket.Emit("browserView-setAutoResize", Id, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("browserView-setAutoResize", Id, options); } /// @@ -85,13 +67,7 @@ public void SetAutoResize(AutoResizeOptions options) /// Color in #aarrggbb or #argb form. The alpha channel is optional. public void SetBackgroundColor(string color) { - BridgeConnector.Socket.Emit("browserView-setBackgroundColor", Id, color); + BridgeConnector.Emit("browserView-setBackgroundColor", Id, color); } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/BrowserWindow.cs b/ElectronNET.API/BrowserWindow.cs index 2c4590ac..0b8222c5 100644 --- a/ElectronNET.API/BrowserWindow.cs +++ b/ElectronNET.API/BrowserWindow.cs @@ -34,12 +34,12 @@ public event Action OnReadyToShow { if (_readyToShow == null) { - BridgeConnector.Socket.On("browserWindow-ready-to-show" + Id, () => + BridgeConnector.On("browserWindow-ready-to-show" + Id, () => { _readyToShow(); }); - BridgeConnector.Socket.Emit("register-browserWindow-ready-to-show", Id); + BridgeConnector.Emit("register-browserWindow-ready-to-show", Id); } _readyToShow += value; } @@ -48,7 +48,7 @@ public event Action OnReadyToShow _readyToShow -= value; if (_readyToShow == null) - BridgeConnector.Socket.Off("browserWindow-ready-to-show" + Id); + BridgeConnector.Off("browserWindow-ready-to-show" + Id); } } @@ -63,12 +63,12 @@ public event Action OnPageTitleUpdated { if (_pageTitleUpdated == null) { - BridgeConnector.Socket.On("browserWindow-page-title-updated" + Id, (title) => + BridgeConnector.On("browserWindow-page-title-updated" + Id, (title) => { - _pageTitleUpdated(title.ToString()); + _pageTitleUpdated(title); }); - BridgeConnector.Socket.Emit("register-browserWindow-page-title-updated", Id); + BridgeConnector.Emit("register-browserWindow-page-title-updated", Id); } _pageTitleUpdated += value; } @@ -77,7 +77,7 @@ public event Action OnPageTitleUpdated _pageTitleUpdated -= value; if (_pageTitleUpdated == null) - BridgeConnector.Socket.Off("browserWindow-page-title-updated" + Id); + BridgeConnector.Off("browserWindow-page-title-updated" + Id); } } @@ -92,12 +92,12 @@ public event Action OnClose { if (_close == null) { - BridgeConnector.Socket.On("browserWindow-close" + Id, () => + BridgeConnector.On("browserWindow-close" + Id, () => { _close(); }); - BridgeConnector.Socket.Emit("register-browserWindow-close", Id); + BridgeConnector.Emit("register-browserWindow-close", Id); } _close += value; } @@ -106,7 +106,7 @@ public event Action OnClose _close -= value; if (_close == null) - BridgeConnector.Socket.Off("browserWindow-close" + Id); + BridgeConnector.Off("browserWindow-close" + Id); } } @@ -123,12 +123,12 @@ public event Action OnClosed { if (_closed == null) { - BridgeConnector.Socket.On("browserWindow-closed" + Id, () => + BridgeConnector.On("browserWindow-closed" + Id, () => { _closed(); }); - BridgeConnector.Socket.Emit("register-browserWindow-closed", Id); + BridgeConnector.Emit("register-browserWindow-closed", Id); } _closed += value; } @@ -137,7 +137,7 @@ public event Action OnClosed _closed -= value; if (_closed == null) - BridgeConnector.Socket.Off("browserWindow-closed" + Id); + BridgeConnector.Off("browserWindow-closed" + Id); } } @@ -152,12 +152,12 @@ public event Action OnSessionEnd { if (_sessionEnd == null) { - BridgeConnector.Socket.On("browserWindow-session-end" + Id, () => + BridgeConnector.On("browserWindow-session-end" + Id, () => { _sessionEnd(); }); - BridgeConnector.Socket.Emit("register-browserWindow-session-end", Id); + BridgeConnector.Emit("register-browserWindow-session-end", Id); } _sessionEnd += value; } @@ -166,7 +166,7 @@ public event Action OnSessionEnd _sessionEnd -= value; if (_sessionEnd == null) - BridgeConnector.Socket.Off("browserWindow-session-end" + Id); + BridgeConnector.Off("browserWindow-session-end" + Id); } } @@ -181,12 +181,12 @@ public event Action OnUnresponsive { if (_unresponsive == null) { - BridgeConnector.Socket.On("browserWindow-unresponsive" + Id, () => + BridgeConnector.On("browserWindow-unresponsive" + Id, () => { _unresponsive(); }); - BridgeConnector.Socket.Emit("register-browserWindow-unresponsive", Id); + BridgeConnector.Emit("register-browserWindow-unresponsive", Id); } _unresponsive += value; } @@ -195,7 +195,7 @@ public event Action OnUnresponsive _unresponsive -= value; if (_unresponsive == null) - BridgeConnector.Socket.Off("browserWindow-unresponsive" + Id); + BridgeConnector.Off("browserWindow-unresponsive" + Id); } } @@ -210,12 +210,12 @@ public event Action OnResponsive { if (_responsive == null) { - BridgeConnector.Socket.On("browserWindow-responsive" + Id, () => + BridgeConnector.On("browserWindow-responsive" + Id, () => { _responsive(); }); - BridgeConnector.Socket.Emit("register-browserWindow-responsive", Id); + BridgeConnector.Emit("register-browserWindow-responsive", Id); } _responsive += value; } @@ -224,7 +224,7 @@ public event Action OnResponsive _responsive -= value; if (_responsive == null) - BridgeConnector.Socket.Off("browserWindow-responsive" + Id); + BridgeConnector.Off("browserWindow-responsive" + Id); } } @@ -239,12 +239,12 @@ public event Action OnBlur { if (_blur == null) { - BridgeConnector.Socket.On("browserWindow-blur" + Id, () => + BridgeConnector.On("browserWindow-blur" + Id, () => { _blur(); }); - BridgeConnector.Socket.Emit("register-browserWindow-blur", Id); + BridgeConnector.Emit("register-browserWindow-blur", Id); } _blur += value; } @@ -253,7 +253,7 @@ public event Action OnBlur _blur -= value; if (_blur == null) - BridgeConnector.Socket.Off("browserWindow-blur" + Id); + BridgeConnector.Off("browserWindow-blur" + Id); } } @@ -268,12 +268,12 @@ public event Action OnFocus { if (_focus == null) { - BridgeConnector.Socket.On("browserWindow-focus" + Id, () => + BridgeConnector.On("browserWindow-focus" + Id, () => { _focus(); }); - BridgeConnector.Socket.Emit("register-browserWindow-focus", Id); + BridgeConnector.Emit("register-browserWindow-focus", Id); } _focus += value; } @@ -282,7 +282,7 @@ public event Action OnFocus _focus -= value; if (_focus == null) - BridgeConnector.Socket.Off("browserWindow-focus" + Id); + BridgeConnector.Off("browserWindow-focus" + Id); } } @@ -297,12 +297,12 @@ public event Action OnShow { if (_show == null) { - BridgeConnector.Socket.On("browserWindow-show" + Id, () => + BridgeConnector.On("browserWindow-show" + Id, () => { _show(); }); - BridgeConnector.Socket.Emit("register-browserWindow-show", Id); + BridgeConnector.Emit("register-browserWindow-show", Id); } _show += value; } @@ -311,7 +311,7 @@ public event Action OnShow _show -= value; if (_show == null) - BridgeConnector.Socket.Off("browserWindow-show" + Id); + BridgeConnector.Off("browserWindow-show" + Id); } } @@ -326,12 +326,12 @@ public event Action OnHide { if (_hide == null) { - BridgeConnector.Socket.On("browserWindow-hide" + Id, () => + BridgeConnector.On("browserWindow-hide" + Id, () => { _hide(); }); - BridgeConnector.Socket.Emit("register-browserWindow-hide", Id); + BridgeConnector.Emit("register-browserWindow-hide", Id); } _hide += value; } @@ -340,7 +340,7 @@ public event Action OnHide _hide -= value; if (_hide == null) - BridgeConnector.Socket.Off("browserWindow-hide" + Id); + BridgeConnector.Off("browserWindow-hide" + Id); } } @@ -355,12 +355,12 @@ public event Action OnMaximize { if (_maximize == null) { - BridgeConnector.Socket.On("browserWindow-maximize" + Id, () => + BridgeConnector.On("browserWindow-maximize" + Id, () => { _maximize(); }); - BridgeConnector.Socket.Emit("register-browserWindow-maximize", Id); + BridgeConnector.Emit("register-browserWindow-maximize", Id); } _maximize += value; } @@ -369,7 +369,7 @@ public event Action OnMaximize _maximize -= value; if (_maximize == null) - BridgeConnector.Socket.Off("browserWindow-maximize" + Id); + BridgeConnector.Off("browserWindow-maximize" + Id); } } @@ -384,12 +384,12 @@ public event Action OnUnmaximize { if (_unmaximize == null) { - BridgeConnector.Socket.On("browserWindow-unmaximize" + Id, () => + BridgeConnector.On("browserWindow-unmaximize" + Id, () => { _unmaximize(); }); - BridgeConnector.Socket.Emit("register-browserWindow-unmaximize", Id); + BridgeConnector.Emit("register-browserWindow-unmaximize", Id); } _unmaximize += value; } @@ -398,7 +398,7 @@ public event Action OnUnmaximize _unmaximize -= value; if (_unmaximize == null) - BridgeConnector.Socket.Off("browserWindow-unmaximize" + Id); + BridgeConnector.Off("browserWindow-unmaximize" + Id); } } @@ -413,12 +413,12 @@ public event Action OnMinimize { if (_minimize == null) { - BridgeConnector.Socket.On("browserWindow-minimize" + Id, () => + BridgeConnector.On("browserWindow-minimize" + Id, () => { _minimize(); }); - BridgeConnector.Socket.Emit("register-browserWindow-minimize", Id); + BridgeConnector.Emit("register-browserWindow-minimize", Id); } _minimize += value; } @@ -427,7 +427,7 @@ public event Action OnMinimize _minimize -= value; if (_minimize == null) - BridgeConnector.Socket.Off("browserWindow-minimize" + Id); + BridgeConnector.Off("browserWindow-minimize" + Id); } } @@ -442,12 +442,12 @@ public event Action OnRestore { if (_restore == null) { - BridgeConnector.Socket.On("browserWindow-restore" + Id, () => + BridgeConnector.On("browserWindow-restore" + Id, () => { _restore(); }); - BridgeConnector.Socket.Emit("register-browserWindow-restore", Id); + BridgeConnector.Emit("register-browserWindow-restore", Id); } _restore += value; } @@ -456,7 +456,7 @@ public event Action OnRestore _restore -= value; if (_restore == null) - BridgeConnector.Socket.Off("browserWindow-restore" + Id); + BridgeConnector.Off("browserWindow-restore" + Id); } } @@ -471,12 +471,12 @@ public event Action OnResize { if (_resize == null) { - BridgeConnector.Socket.On("browserWindow-resize" + Id, () => + BridgeConnector.On("browserWindow-resize" + Id, () => { _resize(); }); - BridgeConnector.Socket.Emit("register-browserWindow-resize", Id); + BridgeConnector.Emit("register-browserWindow-resize", Id); } _resize += value; } @@ -485,7 +485,7 @@ public event Action OnResize _resize -= value; if (_resize == null) - BridgeConnector.Socket.Off("browserWindow-resize" + Id); + BridgeConnector.Off("browserWindow-resize" + Id); } } @@ -502,12 +502,12 @@ public event Action OnMove { if (_move == null) { - BridgeConnector.Socket.On("browserWindow-move" + Id, () => + BridgeConnector.On("browserWindow-move" + Id, () => { _move(); }); - BridgeConnector.Socket.Emit("register-browserWindow-move", Id); + BridgeConnector.Emit("register-browserWindow-move", Id); } _move += value; } @@ -516,7 +516,7 @@ public event Action OnMove _move -= value; if (_move == null) - BridgeConnector.Socket.Off("browserWindow-move" + Id); + BridgeConnector.Off("browserWindow-move" + Id); } } @@ -531,12 +531,12 @@ public event Action OnMoved { if (_moved == null) { - BridgeConnector.Socket.On("browserWindow-moved" + Id, () => + BridgeConnector.On("browserWindow-moved" + Id, () => { _moved(); }); - BridgeConnector.Socket.Emit("register-browserWindow-moved", Id); + BridgeConnector.Emit("register-browserWindow-moved", Id); } _moved += value; } @@ -545,7 +545,7 @@ public event Action OnMoved _moved -= value; if (_moved == null) - BridgeConnector.Socket.Off("browserWindow-moved" + Id); + BridgeConnector.Off("browserWindow-moved" + Id); } } @@ -560,12 +560,12 @@ public event Action OnEnterFullScreen { if (_enterFullScreen == null) { - BridgeConnector.Socket.On("browserWindow-enter-full-screen" + Id, () => + BridgeConnector.On("browserWindow-enter-full-screen" + Id, () => { _enterFullScreen(); }); - BridgeConnector.Socket.Emit("register-browserWindow-enter-full-screen", Id); + BridgeConnector.Emit("register-browserWindow-enter-full-screen", Id); } _enterFullScreen += value; } @@ -574,7 +574,7 @@ public event Action OnEnterFullScreen _enterFullScreen -= value; if (_enterFullScreen == null) - BridgeConnector.Socket.Off("browserWindow-enter-full-screen" + Id); + BridgeConnector.Off("browserWindow-enter-full-screen" + Id); } } @@ -589,12 +589,12 @@ public event Action OnLeaveFullScreen { if (_leaveFullScreen == null) { - BridgeConnector.Socket.On("browserWindow-leave-full-screen" + Id, () => + BridgeConnector.On("browserWindow-leave-full-screen" + Id, () => { _leaveFullScreen(); }); - BridgeConnector.Socket.Emit("register-browserWindow-leave-full-screen", Id); + BridgeConnector.Emit("register-browserWindow-leave-full-screen", Id); } _leaveFullScreen += value; } @@ -603,7 +603,7 @@ public event Action OnLeaveFullScreen _leaveFullScreen -= value; if (_leaveFullScreen == null) - BridgeConnector.Socket.Off("browserWindow-leave-full-screen" + Id); + BridgeConnector.Off("browserWindow-leave-full-screen" + Id); } } @@ -618,12 +618,12 @@ public event Action OnEnterHtmlFullScreen { if (_enterHtmlFullScreen == null) { - BridgeConnector.Socket.On("browserWindow-enter-html-full-screen" + Id, () => + BridgeConnector.On("browserWindow-enter-html-full-screen" + Id, () => { _enterHtmlFullScreen(); }); - BridgeConnector.Socket.Emit("register-browserWindow-enter-html-full-screen", Id); + BridgeConnector.Emit("register-browserWindow-enter-html-full-screen", Id); } _enterHtmlFullScreen += value; } @@ -632,7 +632,7 @@ public event Action OnEnterHtmlFullScreen _enterHtmlFullScreen -= value; if (_enterHtmlFullScreen == null) - BridgeConnector.Socket.Off("browserWindow-enter-html-full-screen" + Id); + BridgeConnector.Off("browserWindow-enter-html-full-screen" + Id); } } @@ -647,12 +647,12 @@ public event Action OnLeaveHtmlFullScreen { if (_leaveHtmlFullScreen == null) { - BridgeConnector.Socket.On("browserWindow-leave-html-full-screen" + Id, () => + BridgeConnector.On("browserWindow-leave-html-full-screen" + Id, () => { _leaveHtmlFullScreen(); }); - BridgeConnector.Socket.Emit("register-browserWindow-leave-html-full-screen", Id); + BridgeConnector.Emit("register-browserWindow-leave-html-full-screen", Id); } _leaveHtmlFullScreen += value; } @@ -661,7 +661,7 @@ public event Action OnLeaveHtmlFullScreen _leaveHtmlFullScreen -= value; if (_leaveHtmlFullScreen == null) - BridgeConnector.Socket.Off("browserWindow-leave-html-full-screen" + Id); + BridgeConnector.Off("browserWindow-leave-html-full-screen" + Id); } } @@ -682,12 +682,12 @@ public event Action OnAppCommand { if (_appCommand == null) { - BridgeConnector.Socket.On("browserWindow-app-command" + Id, (command) => + BridgeConnector.On("browserWindow-app-command" + Id, (command) => { - _appCommand(command.ToString()); + _appCommand(command); }); - BridgeConnector.Socket.Emit("register-browserWindow-app-command", Id); + BridgeConnector.Emit("register-browserWindow-app-command", Id); } _appCommand += value; } @@ -696,7 +696,7 @@ public event Action OnAppCommand _appCommand -= value; if (_appCommand == null) - BridgeConnector.Socket.Off("browserWindow-app-command" + Id); + BridgeConnector.Off("browserWindow-app-command" + Id); } } @@ -711,12 +711,12 @@ public event Action OnScrollTouchBegin { if (_scrollTouchBegin == null) { - BridgeConnector.Socket.On("browserWindow-scroll-touch-begin" + Id, () => + BridgeConnector.On("browserWindow-scroll-touch-begin" + Id, () => { _scrollTouchBegin(); }); - BridgeConnector.Socket.Emit("register-browserWindow-scroll-touch-begin", Id); + BridgeConnector.Emit("register-browserWindow-scroll-touch-begin", Id); } _scrollTouchBegin += value; } @@ -725,7 +725,7 @@ public event Action OnScrollTouchBegin _scrollTouchBegin -= value; if (_scrollTouchBegin == null) - BridgeConnector.Socket.Off("browserWindow-scroll-touch-begin" + Id); + BridgeConnector.Off("browserWindow-scroll-touch-begin" + Id); } } @@ -740,12 +740,12 @@ public event Action OnScrollTouchEnd { if (_scrollTouchEnd == null) { - BridgeConnector.Socket.On("browserWindow-scroll-touch-end" + Id, () => + BridgeConnector.On("browserWindow-scroll-touch-end" + Id, () => { _scrollTouchEnd(); }); - BridgeConnector.Socket.Emit("register-browserWindow-scroll-touch-end", Id); + BridgeConnector.Emit("register-browserWindow-scroll-touch-end", Id); } _scrollTouchEnd += value; } @@ -754,7 +754,7 @@ public event Action OnScrollTouchEnd _scrollTouchEnd -= value; if (_scrollTouchEnd == null) - BridgeConnector.Socket.Off("browserWindow-scroll-touch-end" + Id); + BridgeConnector.Off("browserWindow-scroll-touch-end" + Id); } } @@ -769,12 +769,12 @@ public event Action OnScrollTouchEdge { if (_scrollTouchEdge == null) { - BridgeConnector.Socket.On("browserWindow-scroll-touch-edge" + Id, () => + BridgeConnector.On("browserWindow-scroll-touch-edge" + Id, () => { _scrollTouchEdge(); }); - BridgeConnector.Socket.Emit("register-browserWindow-scroll-touch-edge", Id); + BridgeConnector.Emit("register-browserWindow-scroll-touch-edge", Id); } _scrollTouchEdge += value; } @@ -783,7 +783,7 @@ public event Action OnScrollTouchEdge _scrollTouchEdge -= value; if (_scrollTouchEdge == null) - BridgeConnector.Socket.Off("browserWindow-scroll-touch-edge" + Id); + BridgeConnector.Off("browserWindow-scroll-touch-edge" + Id); } } @@ -798,12 +798,12 @@ public event Action OnSwipe { if (_swipe == null) { - BridgeConnector.Socket.On("browserWindow-swipe" + Id, (direction) => + BridgeConnector.On("browserWindow-swipe" + Id, (direction) => { - _swipe(direction.ToString()); + _swipe(direction); }); - BridgeConnector.Socket.Emit("register-browserWindow-swipe", Id); + BridgeConnector.Emit("register-browserWindow-swipe", Id); } _swipe += value; } @@ -812,7 +812,7 @@ public event Action OnSwipe _swipe -= value; if (_swipe == null) - BridgeConnector.Socket.Off("browserWindow-swipe" + Id); + BridgeConnector.Off("browserWindow-swipe" + Id); } } @@ -827,12 +827,12 @@ public event Action OnSheetBegin { if (_sheetBegin == null) { - BridgeConnector.Socket.On("browserWindow-sheet-begin" + Id, () => + BridgeConnector.On("browserWindow-sheet-begin" + Id, () => { _sheetBegin(); }); - BridgeConnector.Socket.Emit("register-browserWindow-sheet-begin", Id); + BridgeConnector.Emit("register-browserWindow-sheet-begin", Id); } _sheetBegin += value; } @@ -841,7 +841,7 @@ public event Action OnSheetBegin _sheetBegin -= value; if (_sheetBegin == null) - BridgeConnector.Socket.Off("browserWindow-sheet-begin" + Id); + BridgeConnector.Off("browserWindow-sheet-begin" + Id); } } @@ -856,12 +856,12 @@ public event Action OnSheetEnd { if (_sheetEnd == null) { - BridgeConnector.Socket.On("browserWindow-sheet-end" + Id, () => + BridgeConnector.On("browserWindow-sheet-end" + Id, () => { _sheetEnd(); }); - BridgeConnector.Socket.Emit("register-browserWindow-sheet-end", Id); + BridgeConnector.Emit("register-browserWindow-sheet-end", Id); } _sheetEnd += value; } @@ -870,7 +870,7 @@ public event Action OnSheetEnd _sheetEnd -= value; if (_sheetEnd == null) - BridgeConnector.Socket.Off("browserWindow-sheet-end" + Id); + BridgeConnector.Off("browserWindow-sheet-end" + Id); } } @@ -885,12 +885,12 @@ public event Action OnNewWindowForTab { if (_newWindowForTab == null) { - BridgeConnector.Socket.On("browserWindow-new-window-for-tab" + Id, () => + BridgeConnector.On("browserWindow-new-window-for-tab" + Id, () => { _newWindowForTab(); }); - BridgeConnector.Socket.Emit("register-browserWindow-new-window-for-tab", Id); + BridgeConnector.Emit("register-browserWindow-new-window-for-tab", Id); } _newWindowForTab += value; } @@ -899,7 +899,7 @@ public event Action OnNewWindowForTab _newWindowForTab -= value; if (_newWindowForTab == null) - BridgeConnector.Socket.Off("browserWindow-new-window-for-tab" + Id); + BridgeConnector.Off("browserWindow-new-window-for-tab" + Id); } } @@ -917,7 +917,7 @@ internal BrowserWindow(int id) { /// public void Destroy() { - BridgeConnector.Socket.Emit("browserWindowDestroy", Id); + BridgeConnector.Emit("browserWindowDestroy", Id); } /// @@ -926,7 +926,7 @@ public void Destroy() /// public void Close() { - BridgeConnector.Socket.Emit("browserWindowClose", Id); + BridgeConnector.Emit("browserWindowClose", Id); } /// @@ -934,7 +934,7 @@ public void Close() /// public void Focus() { - BridgeConnector.Socket.Emit("browserWindowFocus", Id); + BridgeConnector.Emit("browserWindowFocus", Id); } /// @@ -942,53 +942,27 @@ public void Focus() /// public void Blur() { - BridgeConnector.Socket.Emit("browserWindowBlur", Id); + BridgeConnector.Emit("browserWindowBlur", Id); } /// /// Whether the window is focused. /// /// - public Task IsFocusedAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isFocused-completed", (isFocused) => { - BridgeConnector.Socket.Off("browserWindow-isFocused-completed"); - - taskCompletionSource.SetResult((bool)isFocused); - }); - - BridgeConnector.Socket.Emit("browserWindowIsFocused", Id); - - return taskCompletionSource.Task; - } + public Task IsFocusedAsync() => BridgeConnector.OnResult("browserWindowIsFocused", "browserWindow-isFocused-completed" + Id, Id); /// /// Whether the window is destroyed. /// /// - public Task IsDestroyedAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isDestroyed-completed", (isDestroyed) => { - BridgeConnector.Socket.Off("browserWindow-isDestroyed-completed"); - - taskCompletionSource.SetResult((bool)isDestroyed); - }); - - BridgeConnector.Socket.Emit("browserWindowIsDestroyed", Id); - - return taskCompletionSource.Task; - } + public Task IsDestroyedAsync() => BridgeConnector.OnResult("browserWindowIsDestroyed", "browserWindow-isDestroyed-completed" + Id, Id); /// /// Shows and gives focus to the window. /// public void Show() { - BridgeConnector.Socket.Emit("browserWindowShow", Id); + BridgeConnector.Emit("browserWindowShow", Id); } /// @@ -996,7 +970,7 @@ public void Show() /// public void ShowInactive() { - BridgeConnector.Socket.Emit("browserWindowShowInactive", Id); + BridgeConnector.Emit("browserWindowShowInactive", Id); } /// @@ -1004,7 +978,7 @@ public void ShowInactive() /// public void Hide() { - BridgeConnector.Socket.Emit("browserWindowHide", Id); + BridgeConnector.Emit("browserWindowHide", Id); } /// @@ -1013,17 +987,7 @@ public void Hide() /// public Task IsVisibleAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isVisible-completed", (isVisible) => { - BridgeConnector.Socket.Off("browserWindow-isVisible-completed"); - - taskCompletionSource.SetResult((bool)isVisible); - }); - - BridgeConnector.Socket.Emit("browserWindowIsVisible", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsVisible", "browserWindow-isVisible-completed" + Id, Id); } /// @@ -1032,17 +996,7 @@ public Task IsVisibleAsync() /// public Task IsModalAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isModal-completed", (isModal) => { - BridgeConnector.Socket.Off("browserWindow-isModal-completed"); - - taskCompletionSource.SetResult((bool)isModal); - }); - - BridgeConnector.Socket.Emit("browserWindowIsModal", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsModal", "browserWindow-isModal-completed" + Id, Id); } /// @@ -1050,7 +1004,7 @@ public Task IsModalAsync() /// public void Maximize() { - BridgeConnector.Socket.Emit("browserWindowMaximize", Id); + BridgeConnector.Emit("browserWindowMaximize", Id); } /// @@ -1058,7 +1012,7 @@ public void Maximize() /// public void Unmaximize() { - BridgeConnector.Socket.Emit("browserWindowUnmaximize", Id); + BridgeConnector.Emit("browserWindowUnmaximize", Id); } /// @@ -1067,17 +1021,7 @@ public void Unmaximize() /// public Task IsMaximizedAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMaximized-completed", (isMaximized) => { - BridgeConnector.Socket.Off("browserWindow-isMaximized-completed"); - - taskCompletionSource.SetResult((bool)isMaximized); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMaximized", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMaximized", "browserWindow-isMaximized-completed" + Id, Id); } /// @@ -1085,7 +1029,7 @@ public Task IsMaximizedAsync() /// public void Minimize() { - BridgeConnector.Socket.Emit("browserWindowMinimize", Id); + BridgeConnector.Emit("browserWindowMinimize", Id); } /// @@ -1093,7 +1037,7 @@ public void Minimize() /// public void Restore() { - BridgeConnector.Socket.Emit("browserWindowRestore", Id); + BridgeConnector.Emit("browserWindowRestore", Id); } /// @@ -1102,17 +1046,7 @@ public void Restore() /// public Task IsMinimizedAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMinimized-completed", (isMinimized) => { - BridgeConnector.Socket.Off("browserWindow-isMinimized-completed"); - - taskCompletionSource.SetResult((bool)isMinimized); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMinimized", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMinimized", "browserWindow-isMinimized-completed" + Id, Id); } /// @@ -1120,7 +1054,7 @@ public Task IsMinimizedAsync() /// public void SetFullScreen(bool flag) { - BridgeConnector.Socket.Emit("browserWindowSetFullScreen", Id, flag); + BridgeConnector.Emit("browserWindowSetFullScreen", Id, flag); } /// @@ -1129,17 +1063,7 @@ public void SetFullScreen(bool flag) /// public Task IsFullScreenAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isFullScreen-completed", (isFullScreen) => { - BridgeConnector.Socket.Off("browserWindow-isFullScreen-completed"); - - taskCompletionSource.SetResult((bool)isFullScreen); - }); - - BridgeConnector.Socket.Emit("browserWindowIsFullScreen", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsFullScreen", "browserWindow-isFullScreen-completed" + Id, Id); } /// @@ -1158,7 +1082,7 @@ public Task IsFullScreenAsync() /// The extra size not to be included while maintaining the aspect ratio. public void SetAspectRatio(int aspectRatio, Size extraSize) { - BridgeConnector.Socket.Emit("browserWindowSetAspectRatio", Id, aspectRatio, JObject.FromObject(extraSize, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetAspectRatio", Id, aspectRatio, extraSize); } /// @@ -1169,7 +1093,7 @@ public void SetAspectRatio(int aspectRatio, Size extraSize) /// file to open. public void PreviewFile(string path) { - BridgeConnector.Socket.Emit("browserWindowPreviewFile", Id, path); + BridgeConnector.Emit("browserWindowPreviewFile", Id, path); } /// @@ -1182,7 +1106,7 @@ public void PreviewFile(string path) /// purely visual and does not affect the content type of the file. Defaults to path. public void PreviewFile(string path, string displayname) { - BridgeConnector.Socket.Emit("browserWindowPreviewFile", Id, path, displayname); + BridgeConnector.Emit("browserWindowPreviewFile", Id, path, displayname); } /// @@ -1190,7 +1114,7 @@ public void PreviewFile(string path, string displayname) /// public void CloseFilePreview() { - BridgeConnector.Socket.Emit("browserWindowCloseFilePreview", Id); + BridgeConnector.Emit("browserWindowCloseFilePreview", Id); } /// @@ -1199,7 +1123,7 @@ public void CloseFilePreview() /// public void SetBounds(Rectangle bounds) { - BridgeConnector.Socket.Emit("browserWindowSetBounds", Id, JObject.FromObject(bounds, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetBounds", Id, bounds); } /// @@ -1209,7 +1133,7 @@ public void SetBounds(Rectangle bounds) /// public void SetBounds(Rectangle bounds, bool animate) { - BridgeConnector.Socket.Emit("browserWindowSetBounds", Id, JObject.FromObject(bounds, _jsonSerializer), animate); + BridgeConnector.Emit("browserWindowSetBounds", Id, bounds, animate); } /// @@ -1218,17 +1142,7 @@ public void SetBounds(Rectangle bounds, bool animate) /// public Task GetBoundsAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getBounds-completed", (getBounds) => { - BridgeConnector.Socket.Off("browserWindow-getBounds-completed"); - - taskCompletionSource.SetResult(((JObject)getBounds).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetBounds", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetBounds", "browserWindow-getBounds-completed" + Id, Id); } /// @@ -1237,7 +1151,7 @@ public Task GetBoundsAsync() /// public void SetContentBounds(Rectangle bounds) { - BridgeConnector.Socket.Emit("browserWindowSetContentBounds", Id, JObject.FromObject(bounds, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetContentBounds", Id, bounds); } /// @@ -1247,7 +1161,7 @@ public void SetContentBounds(Rectangle bounds) /// public void SetContentBounds(Rectangle bounds, bool animate) { - BridgeConnector.Socket.Emit("browserWindowSetContentBounds", Id, JObject.FromObject(bounds, _jsonSerializer), animate); + BridgeConnector.Emit("browserWindowSetContentBounds", Id, bounds, animate); } /// @@ -1256,17 +1170,7 @@ public void SetContentBounds(Rectangle bounds, bool animate) /// public Task GetContentBoundsAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getContentBounds-completed", (getContentBounds) => { - BridgeConnector.Socket.Off("browserWindow-getContentBounds-completed"); - - taskCompletionSource.SetResult(((JObject)getContentBounds).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetContentBounds", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetContentBounds", "browserWindow-getContentBounds-completed" + Id, Id); } /// @@ -1276,7 +1180,7 @@ public Task GetContentBoundsAsync() /// public void SetSize(int width, int height) { - BridgeConnector.Socket.Emit("browserWindowSetSize", Id, width, height); + BridgeConnector.Emit("browserWindowSetSize", Id, width, height); } /// @@ -1287,7 +1191,7 @@ public void SetSize(int width, int height) /// public void SetSize(int width, int height, bool animate) { - BridgeConnector.Socket.Emit("browserWindowSetSize", Id, width, height, animate); + BridgeConnector.Emit("browserWindowSetSize", Id, width, height, animate); } /// @@ -1296,17 +1200,7 @@ public void SetSize(int width, int height, bool animate) /// public Task GetSizeAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getSize-completed", (size) => { - BridgeConnector.Socket.Off("browserWindow-getSize-completed"); - - taskCompletionSource.SetResult(((JArray)size).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetSize", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetSize", "browserWindow-getSize-completed" + Id, Id); } /// @@ -1316,7 +1210,7 @@ public Task GetSizeAsync() /// public void SetContentSize(int width, int height) { - BridgeConnector.Socket.Emit("browserWindowSetContentSize", Id, width, height); + BridgeConnector.Emit("browserWindowSetContentSize", Id, width, height); } /// @@ -1327,7 +1221,7 @@ public void SetContentSize(int width, int height) /// public void SetContentSize(int width, int height, bool animate) { - BridgeConnector.Socket.Emit("browserWindowSetContentSize", Id, width, height, animate); + BridgeConnector.Emit("browserWindowSetContentSize", Id, width, height, animate); } /// @@ -1336,17 +1230,7 @@ public void SetContentSize(int width, int height, bool animate) /// public Task GetContentSizeAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getContentSize-completed", (size) => { - BridgeConnector.Socket.Off("browserWindow-getContentSize-completed"); - - taskCompletionSource.SetResult(((JArray)size).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetContentSize", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetContentSize", "browserWindow-getContentSize-completed" + Id, Id); } /// @@ -1356,7 +1240,7 @@ public Task GetContentSizeAsync() /// public void SetMinimumSize(int width, int height) { - BridgeConnector.Socket.Emit("browserWindowSetMinimumSize", Id, width, height); + BridgeConnector.Emit("browserWindowSetMinimumSize", Id, width, height); } /// @@ -1365,17 +1249,7 @@ public void SetMinimumSize(int width, int height) /// public Task GetMinimumSizeAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getMinimumSize-completed", (size) => { - BridgeConnector.Socket.Off("browserWindow-getMinimumSize-completed"); - - taskCompletionSource.SetResult(((JArray)size).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetMinimumSize", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetMinimumSize", "browserWindow-getMinimumSize-completed" + Id, Id); } /// @@ -1385,7 +1259,7 @@ public Task GetMinimumSizeAsync() /// public void SetMaximumSize(int width, int height) { - BridgeConnector.Socket.Emit("browserWindowSetMaximumSize", Id, width, height); + BridgeConnector.Emit("browserWindowSetMaximumSize", Id, width, height); } /// @@ -1394,17 +1268,7 @@ public void SetMaximumSize(int width, int height) /// public Task GetMaximumSizeAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getMaximumSize-completed", (size) => { - BridgeConnector.Socket.Off("browserWindow-getMaximumSize-completed"); - - taskCompletionSource.SetResult(((JArray)size).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetMaximumSize", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetMaximumSize", "browserWindow-getMaximumSize-completed" + Id, Id); } /// @@ -1413,7 +1277,7 @@ public Task GetMaximumSizeAsync() /// public void SetResizable(bool resizable) { - BridgeConnector.Socket.Emit("browserWindowSetResizable", Id, resizable); + BridgeConnector.Emit("browserWindowSetResizable", Id, resizable); } /// @@ -1422,17 +1286,7 @@ public void SetResizable(bool resizable) /// public Task IsResizableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isResizable-completed", (resizable) => { - BridgeConnector.Socket.Off("browserWindow-isResizable-completed"); - - taskCompletionSource.SetResult((bool)resizable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsResizable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsResizable", "browserWindow-isResizable-completed" + Id, Id); } /// @@ -1441,7 +1295,7 @@ public Task IsResizableAsync() /// public void SetMovable(bool movable) { - BridgeConnector.Socket.Emit("browserWindowSetMovable", Id, movable); + BridgeConnector.Emit("browserWindowSetMovable", Id, movable); } /// @@ -1452,17 +1306,7 @@ public void SetMovable(bool movable) /// On Linux always returns true. public Task IsMovableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMovable-completed", (movable) => { - BridgeConnector.Socket.Off("browserWindow-isMovable-completed"); - - taskCompletionSource.SetResult((bool)movable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMovable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMovable", "browserWindow-isMovable-completed" + Id, Id); } /// @@ -1471,7 +1315,7 @@ public Task IsMovableAsync() /// public void SetMinimizable(bool minimizable) { - BridgeConnector.Socket.Emit("browserWindowSetMinimizable", Id, minimizable); + BridgeConnector.Emit("browserWindowSetMinimizable", Id, minimizable); } /// @@ -1482,17 +1326,7 @@ public void SetMinimizable(bool minimizable) /// On Linux always returns true. public Task IsMinimizableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMinimizable-completed", (minimizable) => { - BridgeConnector.Socket.Off("browserWindow-isMinimizable-completed"); - - taskCompletionSource.SetResult((bool)minimizable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMinimizable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMinimizable", "browserWindow-isMinimizable-completed" + Id, Id); } /// @@ -1501,7 +1335,7 @@ public Task IsMinimizableAsync() /// public void SetMaximizable(bool maximizable) { - BridgeConnector.Socket.Emit("browserWindowSetMaximizable", Id, maximizable); + BridgeConnector.Emit("browserWindowSetMaximizable", Id, maximizable); } /// @@ -1512,17 +1346,7 @@ public void SetMaximizable(bool maximizable) /// On Linux always returns true. public Task IsMaximizableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMaximizable-completed", (maximizable) => { - BridgeConnector.Socket.Off("browserWindow-isMaximizable-completed"); - - taskCompletionSource.SetResult((bool)maximizable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMaximizable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMaximizable", "browserWindow-isMaximizable-completed" + Id, Id); } /// @@ -1531,7 +1355,7 @@ public Task IsMaximizableAsync() /// public void SetFullScreenable(bool fullscreenable) { - BridgeConnector.Socket.Emit("browserWindowSetFullScreenable", Id, fullscreenable); + BridgeConnector.Emit("browserWindowSetFullScreenable", Id, fullscreenable); } /// @@ -1540,17 +1364,7 @@ public void SetFullScreenable(bool fullscreenable) /// public Task IsFullScreenableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isFullScreenable-completed", (fullscreenable) => { - BridgeConnector.Socket.Off("browserWindow-isFullScreenable-completed"); - - taskCompletionSource.SetResult((bool)fullscreenable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsFullScreenable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsFullScreenable", "browserWindow-isFullScreenable-completed" + Id, Id); } /// @@ -1559,7 +1373,7 @@ public Task IsFullScreenableAsync() /// public void SetClosable(bool closable) { - BridgeConnector.Socket.Emit("browserWindowSetClosable", Id, closable); + BridgeConnector.Emit("browserWindowSetClosable", Id, closable); } /// @@ -1570,17 +1384,7 @@ public void SetClosable(bool closable) /// On Linux always returns true. public Task IsClosableAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isClosable-completed", (closable) => { - BridgeConnector.Socket.Off("browserWindow-isClosable-completed"); - - taskCompletionSource.SetResult((bool)closable); - }); - - BridgeConnector.Socket.Emit("browserWindowIsClosable", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsClosable", "browserWindow-isClosable-completed" + Id, Id); } /// @@ -1591,7 +1395,7 @@ public Task IsClosableAsync() /// public void SetAlwaysOnTop(bool flag) { - BridgeConnector.Socket.Emit("browserWindowSetAlwaysOnTop", Id, flag); + BridgeConnector.Emit("browserWindowSetAlwaysOnTop", Id, flag); } /// @@ -1605,7 +1409,7 @@ public void SetAlwaysOnTop(bool flag) /// See the macOS docs public void SetAlwaysOnTop(bool flag, OnTopLevel level) { - BridgeConnector.Socket.Emit("browserWindowSetAlwaysOnTop", Id, flag, level.GetDescription()); + BridgeConnector.Emit("browserWindowSetAlwaysOnTop", Id, flag, level.GetDescription()); } /// @@ -1621,7 +1425,7 @@ public void SetAlwaysOnTop(bool flag, OnTopLevel level) /// The default is 0. Note that Apple discourages setting levels higher than 1 above screen-saver. public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) { - BridgeConnector.Socket.Emit("browserWindowSetAlwaysOnTop", Id, flag, level.GetDescription(), relativeLevel); + BridgeConnector.Emit("browserWindowSetAlwaysOnTop", Id, flag, level.GetDescription(), relativeLevel); } /// @@ -1630,17 +1434,7 @@ public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) /// public Task IsAlwaysOnTopAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isAlwaysOnTop-completed", (isAlwaysOnTop) => { - BridgeConnector.Socket.Off("browserWindow-isAlwaysOnTop-completed"); - - taskCompletionSource.SetResult((bool)isAlwaysOnTop); - }); - - BridgeConnector.Socket.Emit("browserWindowIsAlwaysOnTop", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsAlwaysOnTop", "browserWindow-isAlwaysOnTop-completed" + Id, Id); } /// @@ -1648,7 +1442,7 @@ public Task IsAlwaysOnTopAsync() /// public void Center() { - BridgeConnector.Socket.Emit("browserWindowCenter", Id); + BridgeConnector.Emit("browserWindowCenter", Id); } /// @@ -1665,7 +1459,7 @@ public void SetPosition(int x, int y) x = x - 7; } - BridgeConnector.Socket.Emit("browserWindowSetPosition", Id, x, y); + BridgeConnector.Emit("browserWindowSetPosition", Id, x, y); } /// @@ -1683,7 +1477,7 @@ public void SetPosition(int x, int y, bool animate) x = x - 7; } - BridgeConnector.Socket.Emit("browserWindowSetPosition", Id, x, y, animate); + BridgeConnector.Emit("browserWindowSetPosition", Id, x, y, animate); } private bool isWindows10() @@ -1697,17 +1491,7 @@ private bool isWindows10() /// public Task GetPositionAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getPosition-completed", (position) => { - BridgeConnector.Socket.Off("browserWindow-getPosition-completed"); - - taskCompletionSource.SetResult(((JArray)position).ToObject()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetPosition", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetPosition", "browserWindow-getPosition-completed" + Id, Id); } /// @@ -1716,7 +1500,7 @@ public Task GetPositionAsync() /// public void SetTitle(string title) { - BridgeConnector.Socket.Emit("browserWindowSetTitle", Id, title); + BridgeConnector.Emit("browserWindowSetTitle", Id, title); } /// @@ -1727,17 +1511,7 @@ public void SetTitle(string title) /// public Task GetTitleAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getTitle-completed", (title) => { - BridgeConnector.Socket.Off("browserWindow-getTitle-completed"); - - taskCompletionSource.SetResult(title.ToString()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetTitle", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetTitle", "browserWindow-getTitle-completed" + Id, Id); } /// @@ -1748,7 +1522,7 @@ public Task GetTitleAsync() /// public void SetSheetOffset(float offsetY) { - BridgeConnector.Socket.Emit("browserWindowSetSheetOffset", Id, offsetY); + BridgeConnector.Emit("browserWindowSetSheetOffset", Id, offsetY); } /// @@ -1760,7 +1534,7 @@ public void SetSheetOffset(float offsetY) /// public void SetSheetOffset(float offsetY, float offsetX) { - BridgeConnector.Socket.Emit("browserWindowSetSheetOffset", Id, offsetY, offsetX); + BridgeConnector.Emit("browserWindowSetSheetOffset", Id, offsetY, offsetX); } /// @@ -1769,7 +1543,7 @@ public void SetSheetOffset(float offsetY, float offsetX) /// public void FlashFrame(bool flag) { - BridgeConnector.Socket.Emit("browserWindowFlashFrame", Id, flag); + BridgeConnector.Emit("browserWindowFlashFrame", Id, flag); } /// @@ -1778,7 +1552,7 @@ public void FlashFrame(bool flag) /// public void SetSkipTaskbar(bool skip) { - BridgeConnector.Socket.Emit("browserWindowSetSkipTaskbar", Id, skip); + BridgeConnector.Emit("browserWindowSetSkipTaskbar", Id, skip); } /// @@ -1787,7 +1561,7 @@ public void SetSkipTaskbar(bool skip) /// public void SetKiosk(bool flag) { - BridgeConnector.Socket.Emit("browserWindowSetKiosk", Id, flag); + BridgeConnector.Emit("browserWindowSetKiosk", Id, flag); } /// @@ -1796,17 +1570,7 @@ public void SetKiosk(bool flag) /// public Task IsKioskAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isKiosk-completed", (isKiosk) => { - BridgeConnector.Socket.Off("browserWindow-isKiosk-completed"); - - taskCompletionSource.SetResult((bool)isKiosk); - }); - - BridgeConnector.Socket.Emit("browserWindowIsKiosk", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsKiosk", "browserWindow-isKiosk-completed" + Id, Id); } /// @@ -1815,17 +1579,7 @@ public Task IsKioskAsync() /// string of the native handle obtained, HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux. public Task GetNativeWindowHandle() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getNativeWindowHandle-completed", (nativeWindowHandle) => - { - BridgeConnector.Socket.Off("browserWindow-getNativeWindowHandle-completed"); - taskCompletionSource.SetResult(nativeWindowHandle.ToString()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetNativeWindowHandle", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetNativeWindowHandle", "browserWindow-getNativeWindowHandle-completed" + Id, Id); } /// @@ -1835,7 +1589,7 @@ public Task GetNativeWindowHandle() /// public void SetRepresentedFilename(string filename) { - BridgeConnector.Socket.Emit("browserWindowSetRepresentedFilename", Id, filename); + BridgeConnector.Emit("browserWindowSetRepresentedFilename", Id, filename); } /// @@ -1844,17 +1598,7 @@ public void SetRepresentedFilename(string filename) /// public Task GetRepresentedFilenameAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getRepresentedFilename-completed", (pathname) => { - BridgeConnector.Socket.Off("browserWindow-getRepresentedFilename-completed"); - - taskCompletionSource.SetResult(pathname.ToString()); - }); - - BridgeConnector.Socket.Emit("browserWindowGetRepresentedFilename", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowGetRepresentedFilename", "browserWindow-getRepresentedFilename-completed" + Id, Id); } /// @@ -1864,7 +1608,7 @@ public Task GetRepresentedFilenameAsync() /// public void SetDocumentEdited(bool edited) { - BridgeConnector.Socket.Emit("browserWindowSetDocumentEdited", Id, edited); + BridgeConnector.Emit("browserWindowSetDocumentEdited", Id, edited); } /// @@ -1873,17 +1617,7 @@ public void SetDocumentEdited(bool edited) /// public Task IsDocumentEditedAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isDocumentEdited-completed", (edited) => { - BridgeConnector.Socket.Off("browserWindow-isDocumentEdited-completed"); - - taskCompletionSource.SetResult((bool)edited); - }); - - BridgeConnector.Socket.Emit("browserWindowIsDocumentEdited", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsDocumentEdited", "browserWindow-isDocumentEdited-completed" + Id, Id); } /// @@ -1891,7 +1625,7 @@ public Task IsDocumentEditedAsync() /// public void FocusOnWebView() { - BridgeConnector.Socket.Emit("browserWindowFocusOnWebView", Id); + BridgeConnector.Emit("browserWindowFocusOnWebView", Id); } /// @@ -1899,7 +1633,7 @@ public void FocusOnWebView() /// public void BlurWebView() { - BridgeConnector.Socket.Emit("browserWindowBlurWebView", Id); + BridgeConnector.Emit("browserWindowBlurWebView", Id); } /// @@ -1909,7 +1643,7 @@ public void BlurWebView() /// public void LoadURL(string url) { - BridgeConnector.Socket.Emit("browserWindowLoadURL", Id, url); + BridgeConnector.Emit("browserWindowLoadURL", Id, url); } /// @@ -1920,7 +1654,7 @@ public void LoadURL(string url) /// public void LoadURL(string url, LoadURLOptions options) { - BridgeConnector.Socket.Emit("browserWindowLoadURL", Id, url, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("browserWindowLoadURL", Id, url, options); } /// @@ -1928,7 +1662,7 @@ public void LoadURL(string url, LoadURLOptions options) /// public void Reload() { - BridgeConnector.Socket.Emit("browserWindowReload", Id); + BridgeConnector.Emit("browserWindowReload", Id); } /// @@ -1948,12 +1682,13 @@ public void Reload() public void SetMenu(MenuItem[] menuItems) { menuItems.AddMenuItemsId(); - BridgeConnector.Socket.Emit("browserWindowSetMenu", Id, JArray.FromObject(menuItems, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetMenu", Id, JArray.FromObject(menuItems, _jsonSerializer)); _items.AddRange(menuItems); - BridgeConnector.Socket.Off("windowMenuItemClicked"); - BridgeConnector.Socket.On("windowMenuItemClicked", (id) => { - MenuItem menuItem = _items.GetMenuItem(id.ToString()); + BridgeConnector.Off("windowMenuItemClicked"); + BridgeConnector.On("windowMenuItemClicked", (id) => + { + MenuItem menuItem = _items.GetMenuItem(id); menuItem?.Click(); }); } @@ -1963,7 +1698,7 @@ public void SetMenu(MenuItem[] menuItems) /// public void RemoveMenu() { - BridgeConnector.Socket.Emit("browserWindowRemoveMenu", Id); + BridgeConnector.Emit("browserWindowRemoveMenu", Id); } /// @@ -1979,7 +1714,7 @@ public void RemoveMenu() /// public void SetProgressBar(double progress) { - BridgeConnector.Socket.Emit("browserWindowSetProgressBar", Id, progress); + BridgeConnector.Emit("browserWindowSetProgressBar", Id, progress); } /// @@ -1996,7 +1731,7 @@ public void SetProgressBar(double progress) /// public void SetProgressBar(double progress, ProgressBarOptions progressBarOptions) { - BridgeConnector.Socket.Emit("browserWindowSetProgressBar", Id, progress, JObject.FromObject(progressBarOptions, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetProgressBar", Id, progress, progressBarOptions); } /// @@ -2005,7 +1740,7 @@ public void SetProgressBar(double progress, ProgressBarOptions progressBarOption /// public void SetHasShadow(bool hasShadow) { - BridgeConnector.Socket.Emit("browserWindowSetHasShadow", Id, hasShadow); + BridgeConnector.Emit("browserWindowSetHasShadow", Id, hasShadow); } /// @@ -2016,17 +1751,7 @@ public void SetHasShadow(bool hasShadow) /// public Task HasShadowAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-hasShadow-completed", (hasShadow) => { - BridgeConnector.Socket.Off("browserWindow-hasShadow-completed"); - - taskCompletionSource.SetResult((bool)hasShadow); - }); - - BridgeConnector.Socket.Emit("browserWindowHasShadow", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowHasShadow", "browserWindow-hasShadow-completed" + Id, Id); } /// @@ -2036,6 +1761,7 @@ public Task HasShadowAsync() /// The thumbar buttons. /// public IReadOnlyCollection ThumbarButtons { get { return _thumbarButtons.AsReadOnly(); } } + private List _thumbarButtons = new List(); /// @@ -2052,22 +1778,24 @@ public Task HasShadowAsync() /// Whether the buttons were added successfully. public Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("browserWindowSetThumbarButtons-completed", (success) => { - BridgeConnector.Socket.Off("browserWindowSetThumbarButtons-completed"); + BridgeConnector.On("browserWindowSetThumbarButtons-completed" + Id, (success) => + { + BridgeConnector.Off("browserWindowSetThumbarButtons-completed" + Id); - taskCompletionSource.SetResult((bool)success); + taskCompletionSource.SetResult(success); }); thumbarButtons.AddThumbarButtonsId(); - BridgeConnector.Socket.Emit("browserWindowSetThumbarButtons", Id, JArray.FromObject(thumbarButtons, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetThumbarButtons", Id, JArray.FromObject(thumbarButtons, _jsonSerializer)); _thumbarButtons.Clear(); _thumbarButtons.AddRange(thumbarButtons); - BridgeConnector.Socket.Off("thumbarButtonClicked"); - BridgeConnector.Socket.On("thumbarButtonClicked", (id) => { - ThumbarButton thumbarButton = _thumbarButtons.GetThumbarButton(id.ToString()); + BridgeConnector.Off("thumbarButtonClicked"); + BridgeConnector.On("thumbarButtonClicked", (id) => + { + ThumbarButton thumbarButton = _thumbarButtons.GetThumbarButton(id); thumbarButton?.Click(); }); @@ -2082,7 +1810,7 @@ public Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) /// public void SetThumbnailClip(Rectangle rectangle) { - BridgeConnector.Socket.Emit("browserWindowSetThumbnailClip", Id, rectangle); + BridgeConnector.Emit("browserWindowSetThumbnailClip", Id, rectangle); } /// @@ -2091,7 +1819,7 @@ public void SetThumbnailClip(Rectangle rectangle) /// public void SetThumbnailToolTip(string tooltip) { - BridgeConnector.Socket.Emit("browserWindowSetThumbnailToolTip", Id, tooltip); + BridgeConnector.Emit("browserWindowSetThumbnailToolTip", Id, tooltip); } /// @@ -2103,7 +1831,7 @@ public void SetThumbnailToolTip(string tooltip) /// public void SetAppDetails(AppDetailsOptions options) { - BridgeConnector.Socket.Emit("browserWindowSetAppDetails", Id, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetAppDetails", Id, options); } /// @@ -2111,7 +1839,7 @@ public void SetAppDetails(AppDetailsOptions options) /// public void ShowDefinitionForSelection() { - BridgeConnector.Socket.Emit("browserWindowShowDefinitionForSelection", Id); + BridgeConnector.Emit("browserWindowShowDefinitionForSelection", Id); } /// @@ -2123,7 +1851,7 @@ public void ShowDefinitionForSelection() /// public void SetAutoHideMenuBar(bool hide) { - BridgeConnector.Socket.Emit("browserWindowSetAutoHideMenuBar", Id, hide); + BridgeConnector.Emit("browserWindowSetAutoHideMenuBar", Id, hide); } /// @@ -2132,17 +1860,7 @@ public void SetAutoHideMenuBar(bool hide) /// public Task IsMenuBarAutoHideAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMenuBarAutoHide-completed", (isMenuBarAutoHide) => { - BridgeConnector.Socket.Off("browserWindow-isMenuBarAutoHide-completed"); - - taskCompletionSource.SetResult((bool)isMenuBarAutoHide); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMenuBarAutoHide", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMenuBarAutoHide", "browserWindow-isMenuBarAutoHide-completed" + Id, Id); } /// @@ -2152,7 +1870,7 @@ public Task IsMenuBarAutoHideAsync() /// public void SetMenuBarVisibility(bool visible) { - BridgeConnector.Socket.Emit("browserWindowSetMenuBarVisibility", Id, visible); + BridgeConnector.Emit("browserWindowSetMenuBarVisibility", Id, visible); } /// @@ -2161,17 +1879,7 @@ public void SetMenuBarVisibility(bool visible) /// public Task IsMenuBarVisibleAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isMenuBarVisible-completed", (isMenuBarVisible) => { - BridgeConnector.Socket.Off("browserWindow-isMenuBarVisible-completed"); - - taskCompletionSource.SetResult((bool)isMenuBarVisible); - }); - - BridgeConnector.Socket.Emit("browserWindowIsMenuBarVisible", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsMenuBarVisible", "browserWindow-isMenuBarVisible-completed" + Id, Id); } /// @@ -2182,7 +1890,7 @@ public Task IsMenuBarVisibleAsync() /// public void SetVisibleOnAllWorkspaces(bool visible) { - BridgeConnector.Socket.Emit("browserWindowSetVisibleOnAllWorkspaces", Id, visible); + BridgeConnector.Emit("browserWindowSetVisibleOnAllWorkspaces", Id, visible); } /// @@ -2193,17 +1901,7 @@ public void SetVisibleOnAllWorkspaces(bool visible) /// public Task IsVisibleOnAllWorkspacesAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-isVisibleOnAllWorkspaces-completed", (isVisibleOnAllWorkspaces) => { - BridgeConnector.Socket.Off("browserWindow-isVisibleOnAllWorkspaces-completed"); - - taskCompletionSource.SetResult((bool)isVisibleOnAllWorkspaces); - }); - - BridgeConnector.Socket.Emit("browserWindowIsVisibleOnAllWorkspaces", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("browserWindowIsVisibleOnAllWorkspaces", "browserWindow-isVisibleOnAllWorkspaces-completed" + Id, Id); } /// @@ -2215,7 +1913,7 @@ public Task IsVisibleOnAllWorkspacesAsync() /// public void SetIgnoreMouseEvents(bool ignore) { - BridgeConnector.Socket.Emit("browserWindowSetIgnoreMouseEvents", Id, ignore); + BridgeConnector.Emit("browserWindowSetIgnoreMouseEvents", Id, ignore); } /// @@ -2227,7 +1925,7 @@ public void SetIgnoreMouseEvents(bool ignore) /// public void SetContentProtection(bool enable) { - BridgeConnector.Socket.Emit("browserWindowSetContentProtection", Id, enable); + BridgeConnector.Emit("browserWindowSetContentProtection", Id, enable); } /// @@ -2236,7 +1934,7 @@ public void SetContentProtection(bool enable) /// public void SetFocusable(bool focusable) { - BridgeConnector.Socket.Emit("browserWindowSetFocusable", Id, focusable); + BridgeConnector.Emit("browserWindowSetFocusable", Id, focusable); } /// @@ -2246,56 +1944,27 @@ public void SetFocusable(bool focusable) /// public void SetParentWindow(BrowserWindow parent) { - BridgeConnector.Socket.Emit("browserWindowSetParentWindow", Id, JObject.FromObject(parent, _jsonSerializer)); + BridgeConnector.Emit("browserWindowSetParentWindow", Id, parent); } /// /// The parent window. /// /// - public Task GetParentWindowAsync() + public async Task GetParentWindowAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("browserWindow-getParentWindow-completed", (id) => { - BridgeConnector.Socket.Off("browserWindow-getParentWindow-completed"); - var browserWindowId = int.Parse(id.ToString()); - var browserWindow = Electron.WindowManager.BrowserWindows.ToList().Single(x => x.Id == browserWindowId); - - taskCompletionSource.SetResult(browserWindow); - }); - - BridgeConnector.Socket.Emit("browserWindowGetParentWindow", Id); - - return taskCompletionSource.Task; + var windowID = await BridgeConnector.OnResult("browserWindowGetParentWindow", "browserWindow-getParentWindow-completed" + Id, Id); + return Electron.WindowManager.BrowserWindows.Where(w => w.Id == windowID).Single(); } /// /// All child windows. /// /// - public Task> GetChildWindowsAsync() + public async Task> GetChildWindowsAsync() { - var taskCompletionSource = new TaskCompletionSource>(); - - BridgeConnector.Socket.On("browserWindow-getChildWindows-completed", (ids) => { - BridgeConnector.Socket.Off("browserWindow-getChildWindows-completed"); - var browserWindowIds = ((JArray)ids).ToObject(); - var browserWindows = new List(); - - browserWindowIds.ToList().ForEach(id => - { - var browserWindow = Electron.WindowManager.BrowserWindows.ToList().Single(x => x.Id == id); - browserWindows.Add(browserWindow); - }); - - - taskCompletionSource.SetResult(browserWindows); - }); - - BridgeConnector.Socket.Emit("browserWindowGetChildWindows", Id); - - return taskCompletionSource.Task; + var windowIDs = new HashSet(await BridgeConnector.OnResult("browserWindowGetChildWindows", "browserWindow-getChildWindows-completed" + Id, Id)); + return Electron.WindowManager.BrowserWindows.Where(w => windowIDs.Contains(w.Id)).ToList(); } /// @@ -2304,7 +1973,7 @@ public Task> GetChildWindowsAsync() /// public void SetAutoHideCursor(bool autoHide) { - BridgeConnector.Socket.Emit("browserWindowSetAutoHideCursor", Id, autoHide); + BridgeConnector.Emit("browserWindowSetAutoHideCursor", Id, autoHide); } /// @@ -2316,7 +1985,7 @@ public void SetAutoHideCursor(bool autoHide) /// See the macOS documentation for more details. public void SetVibrancy(Vibrancy type) { - BridgeConnector.Socket.Emit("browserWindowSetVibrancy", Id, type.GetDescription()); + BridgeConnector.Emit("browserWindowSetVibrancy", Id, type.GetDescription()); } /// @@ -2332,10 +2001,10 @@ public void SetVibrancy(Vibrancy type) /// public void SetBrowserView(BrowserView browserView) { - BridgeConnector.Socket.Emit("browserWindow-setBrowserView", Id, browserView.Id); + BridgeConnector.Emit("browserWindow-setBrowserView", Id, browserView.Id); } - private JsonSerializer _jsonSerializer = new JsonSerializer() + private static readonly JsonSerializer _jsonSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver(), NullValueHandling = NullValueHandling.Ignore diff --git a/ElectronNET.API/Clipboard.cs b/ElectronNET.API/Clipboard.cs old mode 100644 new mode 100755 index e7535378..a3c6d758 --- a/ElectronNET.API/Clipboard.cs +++ b/ElectronNET.API/Clipboard.cs @@ -3,13 +3,14 @@ using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Perform copy and paste operations on the system clipboard. /// - public sealed class Clipboard + public sealed class Clipboard : IClipboard { private static Clipboard _clipboard; private static object _syncRoot = new object(); @@ -40,21 +41,7 @@ internal static Clipboard Instance /// /// /// The content in the clipboard as plain text. - public Task ReadTextAsync(string type = "") - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readText-Completed", (text) => - { - BridgeConnector.Socket.Off("clipboard-readText-Completed"); - - taskCompletionSource.SetResult(text.ToString()); - }); - - BridgeConnector.Socket.Emit("clipboard-readText", type); - - return taskCompletionSource.Task; - } + public Task ReadTextAsync(string type = "") => BridgeConnector.OnResult("clipboard-readText", "clipboard-readText-Completed", type); /// /// Writes the text into the clipboard as plain text. @@ -63,7 +50,7 @@ public Task ReadTextAsync(string type = "") /// public void WriteText(string text, string type = "") { - BridgeConnector.Socket.Emit("clipboard-writeText", text, type); + BridgeConnector.Emit("clipboard-writeText", text, type); } /// @@ -71,21 +58,7 @@ public void WriteText(string text, string type = "") /// /// /// - public Task ReadHTMLAsync(string type = "") - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readHTML-Completed", (text) => - { - BridgeConnector.Socket.Off("clipboard-readHTML-Completed"); - - taskCompletionSource.SetResult(text.ToString()); - }); - - BridgeConnector.Socket.Emit("clipboard-readHTML", type); - - return taskCompletionSource.Task; - } + public Task ReadHTMLAsync(string type = "") => BridgeConnector.OnResult("clipboard-readHTML", "clipboard-readHTML-Completed", type); /// /// Writes markup to the clipboard. @@ -94,7 +67,7 @@ public Task ReadHTMLAsync(string type = "") /// public void WriteHTML(string markup, string type = "") { - BridgeConnector.Socket.Emit("clipboard-writeHTML", markup, type); + BridgeConnector.Emit("clipboard-writeHTML", markup, type); } /// @@ -102,21 +75,8 @@ public void WriteHTML(string markup, string type = "") /// /// /// - public Task ReadRTFAsync(string type = "") - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readRTF-Completed", (text) => - { - BridgeConnector.Socket.Off("clipboard-readRTF-Completed"); - - taskCompletionSource.SetResult(text.ToString()); - }); - - BridgeConnector.Socket.Emit("clipboard-readRTF", type); + public Task ReadRTFAsync(string type = "") => BridgeConnector.OnResult("clipboard-readRTF", "clipboard-readRTF-Completed", type); - return taskCompletionSource.Task; - } /// /// Writes the text into the clipboard in RTF. @@ -125,7 +85,7 @@ public Task ReadRTFAsync(string type = "") /// public void WriteRTF(string text, string type = "") { - BridgeConnector.Socket.Emit("clipboard-writeHTML", text, type); + BridgeConnector.Emit("clipboard-writeHTML", text, type); } /// @@ -134,21 +94,7 @@ public void WriteRTF(string text, string type = "") /// be empty strings when the bookmark is unavailable. /// /// - public Task ReadBookmarkAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readBookmark-Completed", (bookmark) => - { - BridgeConnector.Socket.Off("clipboard-readBookmark-Completed"); - - taskCompletionSource.SetResult(((JObject)bookmark).ToObject()); - }); - - BridgeConnector.Socket.Emit("clipboard-readBookmark"); - - return taskCompletionSource.Task; - } + public Task ReadBookmarkAsync() => BridgeConnector.OnResult("clipboard-readBookmark", "clipboard-readBookmark-Completed"); /// /// Writes the title and url into the clipboard as a bookmark. @@ -162,7 +108,7 @@ public Task ReadBookmarkAsync() /// public void WriteBookmark(string title, string url, string type = "") { - BridgeConnector.Socket.Emit("clipboard-writeBookmark", title, url, type); + BridgeConnector.Emit("clipboard-writeBookmark", title, url, type); } /// @@ -171,21 +117,7 @@ public void WriteBookmark(string title, string url, string type = "") /// find pasteboard whenever the application is activated. /// /// - public Task ReadFindTextAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readFindText-Completed", (text) => - { - BridgeConnector.Socket.Off("clipboard-readFindText-Completed"); - - taskCompletionSource.SetResult(text.ToString()); - }); - - BridgeConnector.Socket.Emit("clipboard-readFindText"); - - return taskCompletionSource.Task; - } + public Task ReadFindTextAsync() => BridgeConnector.OnResult("clipboard-readFindText", "clipboard-readFindText-Completed"); /// /// macOS: Writes the text into the find pasteboard as plain text. This method uses @@ -194,7 +126,7 @@ public Task ReadFindTextAsync() /// public void WriteFindText(string text) { - BridgeConnector.Socket.Emit("clipboard-writeFindText", text); + BridgeConnector.Emit("clipboard-writeFindText", text); } /// @@ -203,7 +135,7 @@ public void WriteFindText(string text) /// public void Clear(string type = "") { - BridgeConnector.Socket.Emit("clipboard-clear", type); + BridgeConnector.Emit("clipboard-clear", type); } /// @@ -211,21 +143,7 @@ public void Clear(string type = "") /// /// /// - public Task AvailableFormatsAsync(string type = "") - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-availableFormats-Completed", (formats) => - { - BridgeConnector.Socket.Off("clipboard-availableFormats-Completed"); - - taskCompletionSource.SetResult(((JArray)formats).ToObject()); - }); - - BridgeConnector.Socket.Emit("clipboard-availableFormats", type); - - return taskCompletionSource.Task; - } + public Task AvailableFormatsAsync(string type = "") => BridgeConnector.OnResult("clipboard-availableFormats", "clipboard-availableFormats-Completed", type); /// /// Writes data to the clipboard. @@ -234,7 +152,7 @@ public Task AvailableFormatsAsync(string type = "") /// public void Write(Data data, string type = "") { - BridgeConnector.Socket.Emit("clipboard-write", JObject.FromObject(data, _jsonSerializer), type); + BridgeConnector.Emit("clipboard-write", data, type); } /// @@ -242,24 +160,7 @@ public void Write(Data data, string type = "") /// /// /// - public Task ReadImageAsync(string type = "") - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("clipboard-readImage-Completed", (image) => - { - BridgeConnector.Socket.Off("clipboard-readImage-Completed"); - - var nativeImage = ((JObject)image).ToObject(); - - taskCompletionSource.SetResult(nativeImage); - - }); - - BridgeConnector.Socket.Emit("clipboard-readImage", type); - - return taskCompletionSource.Task; - } + public Task ReadImageAsync(string type = "") => BridgeConnector.OnResult("clipboard-readImage", "clipboard-readImage-Completed", type); /// /// Writes an image to the clipboard. @@ -268,14 +169,7 @@ public Task ReadImageAsync(string type = "") /// public void WriteImage(NativeImage image, string type = "") { - BridgeConnector.Socket.Emit("clipboard-writeImage", JsonConvert.SerializeObject(image), type); + BridgeConnector.Emit("clipboard-writeImage", JsonConvert.SerializeObject(image), type); } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } \ No newline at end of file diff --git a/ElectronNET.API/CommandLine.cs b/ElectronNET.API/CommandLine.cs index 63466b4b..26a116cd 100644 --- a/ElectronNET.API/CommandLine.cs +++ b/ElectronNET.API/CommandLine.cs @@ -43,7 +43,7 @@ internal static CommandLine Instance /// public void AppendSwitch(string the_switch, string value = "") { - BridgeConnector.Socket.Emit("appCommandLineAppendSwitch", the_switch, value); + BridgeConnector.Emit("appCommandLineAppendSwitch", the_switch, value); } /// @@ -57,7 +57,7 @@ public void AppendSwitch(string the_switch, string value = "") /// public void AppendArgument(string value) { - BridgeConnector.Socket.Emit("appCommandLineAppendArgument", value); + BridgeConnector.Emit("appCommandLineAppendArgument", value); } /// @@ -66,24 +66,7 @@ public void AppendArgument(string value) /// A command-line switch /// /// Whether the command-line switch is present. - public async Task HasSwitchAsync(string switchName, CancellationToken cancellationToken = default(CancellationToken)) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appCommandLineHasSwitchCompleted", (result) => - { - BridgeConnector.Socket.Off("appCommandLineHasSwitchCompleted"); - taskCompletionSource.SetResult((bool)result); - }); - - BridgeConnector.Socket.Emit("appCommandLineHasSwitch", switchName); - - return await taskCompletionSource.Task.ConfigureAwait(false); - } - } + public Task HasSwitchAsync(string switchName, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appCommandLineHasSwitch", "appCommandLineHasSwitchCompleted", cancellationToken, switchName); /// /// The command-line switch value. @@ -94,23 +77,6 @@ public void AppendArgument(string value) /// /// Note: When the switch is not present or has no value, it returns empty string. /// - public async Task GetSwitchValueAsync(string switchName, CancellationToken cancellationToken = default(CancellationToken)) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("appCommandLineGetSwitchValueCompleted", (result) => - { - BridgeConnector.Socket.Off("appCommandLineGetSwitchValueCompleted"); - taskCompletionSource.SetResult((string)result); - }); - - BridgeConnector.Socket.Emit("appCommandLineGetSwitchValue", switchName); - - return await taskCompletionSource.Task.ConfigureAwait(false); - } - } + public Task GetSwitchValueAsync(string switchName, CancellationToken cancellationToken = default) => BridgeConnector.OnResult("appCommandLineGetSwitchValue", "appCommandLineGetSwitchValueCompleted", cancellationToken, switchName); } } diff --git a/ElectronNET.API/Cookies.cs b/ElectronNET.API/Cookies.cs index 98be3d42..67f16b0c 100644 --- a/ElectronNET.API/Cookies.cs +++ b/ElectronNET.API/Cookies.cs @@ -34,15 +34,12 @@ public event Action OnChanged { if (_changed == null) { - BridgeConnector.Socket.On("webContents-session-cookies-changed" + Id, (args) => + BridgeConnector.On("webContents-session-cookies-changed" + Id, (args) => { - Cookie cookie = ((JArray)args)[0].ToObject(); - CookieChangedCause cause = ((JArray)args)[1].ToObject(); - bool removed = ((JArray)args)[2].ToObject(); - _changed(cookie, cause, removed); + _changed(args.cookie, args.cause, args.removed); }); - BridgeConnector.Socket.Emit("register-webContents-session-cookies-changed", Id); + BridgeConnector.Emit("register-webContents-session-cookies-changed", Id); } _changed += value; } @@ -51,7 +48,7 @@ public event Action OnChanged _changed -= value; if (_changed == null) - BridgeConnector.Socket.Off("webContents-session-cookies-changed" + Id); + BridgeConnector.Off("webContents-session-cookies-changed" + Id); } } @@ -65,18 +62,16 @@ public event Action OnChanged /// A task which resolves an array of cookie objects. public Task GetAsync(CookieFilter filter) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-cookies-get-completed" + guid, (cookies) => + BridgeConnector.On("webContents-session-cookies-get-completed" + guid, (cookies) => { - Cookie[] result = ((JArray)cookies).ToObject(); - - BridgeConnector.Socket.Off("webContents-session-cookies-get-completed" + guid); - taskCompletionSource.SetResult(result); + BridgeConnector.Off("webContents-session-cookies-get-completed" + guid); + taskCompletionSource.SetResult(cookies); }); - BridgeConnector.Socket.Emit("webContents-session-cookies-get", Id, JObject.FromObject(filter, _jsonSerializer), guid); + BridgeConnector.Emit("webContents-session-cookies-get", Id, filter, guid); return taskCompletionSource.Task; } @@ -88,16 +83,16 @@ public Task GetAsync(CookieFilter filter) /// public Task SetAsync(CookieDetails details) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-cookies-set-completed" + guid, () => + BridgeConnector.On("webContents-session-cookies-set-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-cookies-set-completed" + guid); + BridgeConnector.Off("webContents-session-cookies-set-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-cookies-set", Id, JObject.FromObject(details, _jsonSerializer), guid); + BridgeConnector.Emit("webContents-session-cookies-set", Id, details, guid); return taskCompletionSource.Task; } @@ -110,16 +105,16 @@ public Task SetAsync(CookieDetails details) /// A task which resolves when the cookie has been removed public Task RemoveAsync(string url, string name) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-cookies-remove-completed" + guid, () => + BridgeConnector.On("webContents-session-cookies-remove-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-cookies-remove-completed" + guid); + BridgeConnector.Off("webContents-session-cookies-remove-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-cookies-remove", Id, url, name, guid); + BridgeConnector.Emit("webContents-session-cookies-remove", Id, url, name, guid); return taskCompletionSource.Task; } @@ -130,25 +125,18 @@ public Task RemoveAsync(string url, string name) /// A task which resolves when the cookie store has been flushed public Task FlushStoreAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-cookies-flushStore-completed" + guid, () => + BridgeConnector.On("webContents-session-cookies-flushStore-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-cookies-flushStore-completed" + guid); + BridgeConnector.Off("webContents-session-cookies-flushStore-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-cookies-flushStore", Id, guid); + BridgeConnector.Emit("webContents-session-cookies-flushStore", Id, guid); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } \ No newline at end of file diff --git a/ElectronNET.API/Dialog.cs b/ElectronNET.API/Dialog.cs old mode 100644 new mode 100755 index 7b626b4e..fce2db0f --- a/ElectronNET.API/Dialog.cs +++ b/ElectronNET.API/Dialog.cs @@ -6,13 +6,14 @@ using System.Collections.Generic; using System.Threading.Tasks; using System.Web; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Display native system dialogs for opening and saving files, alerting, etc. /// - public sealed class Dialog + public sealed class Dialog : IDialog { private static Dialog _dialog; private static object _syncRoot = new object(); @@ -48,26 +49,23 @@ internal static Dialog Instance /// An array of file paths chosen by the user public Task ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialogOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("showOpenDialogComplete" + guid, (filePaths) => + BridgeConnector.On("showOpenDialogComplete" + guid, (filePaths) => { - BridgeConnector.Socket.Off("showOpenDialogComplete" + guid); + BridgeConnector.Off("showOpenDialogComplete" + guid); - var result = ((JArray)filePaths).ToObject(); var list = new List(); - foreach (var item in result) + + foreach (var item in filePaths) { list.Add(HttpUtility.UrlDecode(item)); } taskCompletionSource.SetResult(list.ToArray()); }); - - BridgeConnector.Socket.Emit("showOpenDialog", - JObject.FromObject(browserWindow, _jsonSerializer), - JObject.FromObject(options, _jsonSerializer), guid); + BridgeConnector.Emit("showOpenDialog", browserWindow, options, guid); return taskCompletionSource.Task; } @@ -80,20 +78,17 @@ public Task ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialo /// Returns String, the path of the file chosen by the user, if a callback is provided it returns an empty string. public Task ShowSaveDialogAsync(BrowserWindow browserWindow, SaveDialogOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("showSaveDialogComplete" + guid, (filename) => + BridgeConnector.On("showSaveDialogComplete" + guid, (filename) => { - BridgeConnector.Socket.Off("showSaveDialogComplete" + guid); + BridgeConnector.Off("showSaveDialogComplete" + guid); - taskCompletionSource.SetResult(filename.ToString()); + taskCompletionSource.SetResult(filename); }); - BridgeConnector.Socket.Emit("showSaveDialog", - JObject.FromObject(browserWindow, _jsonSerializer), - JObject.FromObject(options, _jsonSerializer), - guid); + BridgeConnector.Emit("showSaveDialog", browserWindow, options, guid); return taskCompletionSource.Task; } @@ -149,32 +144,27 @@ public async Task ShowMessageBoxAsync(BrowserWindow browserWin /// The API call will be asynchronous and the result will be passed via MessageBoxResult. public Task ShowMessageBoxAsync(BrowserWindow browserWindow, MessageBoxOptions messageBoxOptions) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("showMessageBoxComplete" + guid, (args) => + BridgeConnector.On("showMessageBoxComplete" + guid, (args) => { - BridgeConnector.Socket.Off("showMessageBoxComplete" + guid); - - var result = ((JArray)args); + BridgeConnector.Off("showMessageBoxComplete" + guid); taskCompletionSource.SetResult(new MessageBoxResult { - Response = (int)result.First, - CheckboxChecked = (bool)result.Last + Response = args.response, + CheckboxChecked = args.@checked }); }); if (browserWindow == null) { - BridgeConnector.Socket.Emit("showMessageBox", JObject.FromObject(messageBoxOptions, _jsonSerializer), guid); + BridgeConnector.Emit("showMessageBox", messageBoxOptions, guid); } else { - BridgeConnector.Socket.Emit("showMessageBox", - JObject.FromObject(browserWindow, _jsonSerializer), - JObject.FromObject(messageBoxOptions, _jsonSerializer), - guid); + BridgeConnector.Emit("showMessageBox", browserWindow , messageBoxOptions, guid); } return taskCompletionSource.Task; @@ -192,7 +182,7 @@ public Task ShowMessageBoxAsync(BrowserWindow browserWindow, M /// The text content to display in the error box. public void ShowErrorBox(string title, string content) { - BridgeConnector.Socket.Emit("showErrorBox", title, content); + BridgeConnector.Emit("showErrorBox", title, content); } /// @@ -217,28 +207,18 @@ public Task ShowCertificateTrustDialogAsync(CertificateTrustDialogOptions option /// public Task ShowCertificateTrustDialogAsync(BrowserWindow browserWindow, CertificateTrustDialogOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("showCertificateTrustDialogComplete" + guid, () => + BridgeConnector.On("showCertificateTrustDialogComplete" + guid, () => { - BridgeConnector.Socket.Off("showCertificateTrustDialogComplete" + guid); + BridgeConnector.Off("showCertificateTrustDialogComplete" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("showCertificateTrustDialog", - JObject.FromObject(browserWindow, _jsonSerializer), - JObject.FromObject(options, _jsonSerializer), - guid); + BridgeConnector.Emit("showCertificateTrustDialog", browserWindow, options, guid); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/Dock.cs b/ElectronNET.API/Dock.cs old mode 100644 new mode 100755 index 03276842..9133829b --- a/ElectronNET.API/Dock.cs +++ b/ElectronNET.API/Dock.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using ElectronNET.API.Entities; using ElectronNET.API.Extensions; +using ElectronNET.API.Interfaces; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; @@ -12,7 +13,7 @@ namespace ElectronNET.API /// /// Control your app in the macOS dock. /// - public sealed class Dock + public sealed class Dock : IDock { private static Dock _dock; private static object _syncRoot = new object(); @@ -50,24 +51,11 @@ internal static Dock Instance /// Can be critical or informational. The default is informational. /// The cancellation token. /// Return an ID representing the request. - public async Task BounceAsync(DockBounceType type, CancellationToken cancellationToken = default) + public Task BounceAsync(DockBounceType type, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("dock-bounce-completed", (id) => - { - BridgeConnector.Socket.Off("dock-bounce-completed"); - taskCompletionSource.SetResult((int) id); - }); - - BridgeConnector.Socket.Emit("dock-bounce", type.GetDescription()); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } + return BridgeConnector.OnResult("dock-bounce", "dock-bounce-completed", cancellationToken, type.GetDescription()); } /// @@ -76,7 +64,7 @@ public async Task BounceAsync(DockBounceType type, CancellationToken cancel /// Id of the request. public void CancelBounce(int id) { - BridgeConnector.Socket.Emit("dock-cancelBounce", id); + BridgeConnector.Emit("dock-cancelBounce", id); } /// @@ -85,7 +73,7 @@ public void CancelBounce(int id) /// public void DownloadFinished(string filePath) { - BridgeConnector.Socket.Emit("dock-downloadFinished", filePath); + BridgeConnector.Emit("dock-downloadFinished", filePath); } /// @@ -94,7 +82,7 @@ public void DownloadFinished(string filePath) /// public void SetBadge(string text) { - BridgeConnector.Socket.Emit("dock-setBadge", text); + BridgeConnector.Emit("dock-setBadge", text); } /// @@ -102,24 +90,10 @@ public void SetBadge(string text) /// /// The cancellation token. /// The badge string of the dock. - public async Task GetBadgeAsync(CancellationToken cancellationToken = default) + public Task GetBadgeAsync(CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("dock-getBadge-completed", (text) => - { - BridgeConnector.Socket.Off("dock-getBadge-completed"); - taskCompletionSource.SetResult((string) text); - }); - - BridgeConnector.Socket.Emit("dock-getBadge"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } + return BridgeConnector.OnResult("dock-getBadge", "dock-getBadge-completed", cancellationToken); } /// @@ -127,7 +101,7 @@ public async Task GetBadgeAsync(CancellationToken cancellationToken = de /// public void Hide() { - BridgeConnector.Socket.Emit("dock-hide"); + BridgeConnector.Emit("dock-hide"); } /// @@ -135,7 +109,7 @@ public void Hide() /// public void Show() { - BridgeConnector.Socket.Emit("dock-show"); + BridgeConnector.Emit("dock-show"); } /// @@ -144,24 +118,10 @@ public void Show() /// /// The cancellation token. /// Whether the dock icon is visible. - public async Task IsVisibleAsync(CancellationToken cancellationToken = default) + public Task IsVisibleAsync(CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("dock-isVisible-completed", (isVisible) => - { - BridgeConnector.Socket.Off("dock-isVisible-completed"); - taskCompletionSource.SetResult((bool) isVisible); - }); - - BridgeConnector.Socket.Emit("dock-isVisible"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } + return BridgeConnector.OnResult("dock-isVisible", "dock-isVisible-completed", cancellationToken); } /// @@ -179,40 +139,21 @@ public async Task IsVisibleAsync(CancellationToken cancellationToken = def public void SetMenu(MenuItem[] menuItems) { menuItems.AddMenuItemsId(); - BridgeConnector.Socket.Emit("dock-setMenu", JArray.FromObject(menuItems, _jsonSerializer)); + BridgeConnector.Emit("dock-setMenu", JArray.FromObject(menuItems, _jsonSerializer)); _items.AddRange(menuItems); - BridgeConnector.Socket.Off("dockMenuItemClicked"); - BridgeConnector.Socket.On("dockMenuItemClicked", (id) => { - MenuItem menuItem = _items.GetMenuItem(id.ToString()); + BridgeConnector.Off("dockMenuItemClicked"); + BridgeConnector.On("dockMenuItemClicked", (id) => { + MenuItem menuItem = _items.GetMenuItem(id); menuItem?.Click(); }); - } /// /// TODO: Menu (macOS) still to be implemented /// Gets the application's dock menu. /// - public async Task GetMenu(CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - var taskCompletionSource = new TaskCompletionSource(); - using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled())) - { - BridgeConnector.Socket.On("dock-getMenu-completed", (menu) => - { - BridgeConnector.Socket.Off("dock-getMenu-completed"); - taskCompletionSource.SetResult(((JObject)menu).ToObject()); - }); - - BridgeConnector.Socket.Emit("dock-getMenu"); - - return await taskCompletionSource.Task - .ConfigureAwait(false); - } - } + public Task GetMenu(CancellationToken cancellationToken = default) => BridgeConnector.OnResult("dock-getMenu", "dock-getMenu-completed", cancellationToken); /// /// Sets the image associated with this dock icon. @@ -220,10 +161,10 @@ public async Task GetMenu(CancellationToken cancellationToken = default) /// public void SetIcon(string image) { - BridgeConnector.Socket.Emit("dock-setIcon", image); + BridgeConnector.Emit("dock-setIcon", image); } - private JsonSerializer _jsonSerializer = new JsonSerializer() + private static readonly JsonSerializer _jsonSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver(), NullValueHandling = NullValueHandling.Ignore diff --git a/ElectronNET.API/Electron.cs b/ElectronNET.API/Electron.cs index 23f9902d..5c636164 100644 --- a/ElectronNET.API/Electron.cs +++ b/ElectronNET.API/Electron.cs @@ -88,5 +88,10 @@ public static class Electron /// Control your app in the macOS dock. /// public static Dock Dock { get { return Dock.Instance; } } + + /// + /// Electeon extensions to the Nodejs process object. + /// + public static Process Process { get { return Process.Instance; } } } } \ No newline at end of file diff --git a/ElectronNET.API/ElectronNET.API.csproj b/ElectronNET.API/ElectronNET.API.csproj old mode 100644 new mode 100755 index 7e948cff..e3a6b03e --- a/ElectronNET.API/ElectronNET.API.csproj +++ b/ElectronNET.API/ElectronNET.API.csproj @@ -1,7 +1,6 @@  - net5.0 true ..\artifacts ElectronNET.API @@ -10,8 +9,10 @@ Electron.NET MIT https://github.com/ElectronNET/Electron.NET/ - Building cross platform electron based desktop apps with .NET Core and ASP.NET Core. -This package contains the API to access the "native" electron API. + + Building cross platform electron based desktop apps with .NET Core and ASP.NET Core. + This package contains the API to access the "native" electron API. + https://github.com/ElectronNET/Electron.NET/ git true @@ -20,6 +21,7 @@ This package contains the API to access the "native" electron API. PackageIcon.png 99.0.0.0 true + net6.0 @@ -33,15 +35,17 @@ This package contains the API to access the "native" electron API. - - + + - + all runtime; build; native; contentfiles; analyzers - - + + + + diff --git a/ElectronNET.API/Entities/AddRepresentationOptions.cs b/ElectronNET.API/Entities/AddRepresentationOptions.cs index 476fcbba..3bb28e0c 100644 --- a/ElectronNET.API/Entities/AddRepresentationOptions.cs +++ b/ElectronNET.API/Entities/AddRepresentationOptions.cs @@ -18,7 +18,7 @@ public class AddRepresentationOptions /// /// Gets or sets the scalefactor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; /// /// Gets or sets the buffer diff --git a/ElectronNET.API/Entities/BitmapOptions.cs b/ElectronNET.API/Entities/BitmapOptions.cs index d3aaebba..2cfaa8d1 100644 --- a/ElectronNET.API/Entities/BitmapOptions.cs +++ b/ElectronNET.API/Entities/BitmapOptions.cs @@ -1,13 +1,20 @@ -namespace ElectronNET.API.Entities +using System; + +namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use ImageOptions instead.")] public class BitmapOptions { /// /// Gets or sets the scale factor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + /// + /// Utility conversion for obsolete class + /// + public static implicit operator ImageOptions(BitmapOptions o) => new() {ScaleFactor = o.ScaleFactor}; } } diff --git a/ElectronNET.API/Entities/BrowserWindowOptions.cs b/ElectronNET.API/Entities/BrowserWindowOptions.cs index ba920e10..61021bb5 100644 --- a/ElectronNET.API/Entities/BrowserWindowOptions.cs +++ b/ElectronNET.API/Entities/BrowserWindowOptions.cs @@ -154,14 +154,14 @@ public class BrowserWindowOptions public bool Frame { get; set; } = true; /// - /// Whether this is a modal window. This only works when the window is a child - /// window.Default is false. + /// Whether this is a modal window. This only works when is + /// also specified. Default is false. /// public bool Modal { get; set; } /// /// Whether the web view accepts a single mouse-down event that simultaneously - /// activates the window.Default is false. + /// activates the window. Default is false. /// public bool AcceptFirstMouse { get; set; } @@ -270,5 +270,11 @@ public class BrowserWindowOptions /// These will only be used if the Proxy field is also set. /// public string ProxyCredentials { get; set; } + + /// + /// The window to use as the created window's parent. + /// + [DefaultValue(null)] + public BrowserWindow Parent { get; set; } } } diff --git a/ElectronNET.API/Entities/CookieChangedCause.cs b/ElectronNET.API/Entities/CookieChangedCause.cs index d42430da..f48c8f91 100644 --- a/ElectronNET.API/Entities/CookieChangedCause.cs +++ b/ElectronNET.API/Entities/CookieChangedCause.cs @@ -1,7 +1,9 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace ElectronNET.API.Entities { +namespace ElectronNET.API.Entities +{ + /// /// The cause of the change /// diff --git a/ElectronNET.API/Entities/CookieRemovedResponse.cs b/ElectronNET.API/Entities/CookieRemovedResponse.cs new file mode 100644 index 00000000..88dece6f --- /dev/null +++ b/ElectronNET.API/Entities/CookieRemovedResponse.cs @@ -0,0 +1,10 @@ +namespace ElectronNET.API.Entities +{ + public class CookieRemovedResponse + { + public Cookie cookie {get;set;} + + public CookieChangedCause cause { get; set; } + public bool removed { get; set; } + } +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/CreateFromBitmapOptions.cs b/ElectronNET.API/Entities/CreateFromBitmapOptions.cs index 6b80c219..8760992c 100644 --- a/ElectronNET.API/Entities/CreateFromBitmapOptions.cs +++ b/ElectronNET.API/Entities/CreateFromBitmapOptions.cs @@ -1,8 +1,11 @@ -namespace ElectronNET.API.Entities +using System; + +namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use CreateOptions instead")] public class CreateFromBitmapOptions { /// @@ -18,6 +21,12 @@ public class CreateFromBitmapOptions /// /// Gets or sets the scalefactor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + + /// + /// Utility conversion for obsolete class + /// + public static implicit operator CreateOptions(CreateFromBitmapOptions o) => new() + {Width = o.Width, Height = o.Height, ScaleFactor = o.ScaleFactor}; } } diff --git a/ElectronNET.API/Entities/CreateFromBufferOptions.cs b/ElectronNET.API/Entities/CreateFromBufferOptions.cs index 206f5acd..8eed1caa 100644 --- a/ElectronNET.API/Entities/CreateFromBufferOptions.cs +++ b/ElectronNET.API/Entities/CreateFromBufferOptions.cs @@ -1,8 +1,11 @@ +using System; + namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use CreateOptions instead")] public class CreateFromBufferOptions { /// @@ -18,6 +21,11 @@ public class CreateFromBufferOptions /// /// Gets or sets the scalefactor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + /// + /// Utility conversion for obsolete class + /// + public static implicit operator CreateOptions(CreateFromBufferOptions o) => new() + {Width = o.Width, Height = o.Height, ScaleFactor = o.ScaleFactor}; } } \ No newline at end of file diff --git a/ElectronNET.API/Entities/CreateOptions.cs b/ElectronNET.API/Entities/CreateOptions.cs new file mode 100644 index 00000000..fa161331 --- /dev/null +++ b/ElectronNET.API/Entities/CreateOptions.cs @@ -0,0 +1,24 @@ +namespace ElectronNET.API.Entities +{ + /// + /// Options for creating a new + /// + public class CreateOptions + { + /// + /// Gets or sets the width + /// + public int? Width { get; set; } + + /// + /// Gets or sets the height + /// + public int? Height { get; set; } + + /// + /// Gets or sets the scalefactor + /// + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + + } +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/Display.cs b/ElectronNET.API/Entities/Display.cs index cdf9ac87..4d44f32e 100644 --- a/ElectronNET.API/Entities/Display.cs +++ b/ElectronNET.API/Entities/Display.cs @@ -1,5 +1,10 @@ namespace ElectronNET.API.Entities { + public class DisplayChanged + { + public Display display { get; set; } + public string[] metrics { get; set; } + } /// /// /// diff --git a/ElectronNET.API/Entities/ImageOptions.cs b/ElectronNET.API/Entities/ImageOptions.cs new file mode 100644 index 00000000..b6306ce5 --- /dev/null +++ b/ElectronNET.API/Entities/ImageOptions.cs @@ -0,0 +1,13 @@ +namespace ElectronNET.API.Entities +{ + /// + /// + /// + public class ImageOptions + { + /// + /// Gets or sets the scale factor + /// + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + } +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/JumpListSettings.cs b/ElectronNET.API/Entities/JumpListSettings.cs index 82184ed1..150d0b78 100644 --- a/ElectronNET.API/Entities/JumpListSettings.cs +++ b/ElectronNET.API/Entities/JumpListSettings.cs @@ -1,8 +1,5 @@ namespace ElectronNET.API.Entities { - /// - /// - /// public class JumpListSettings { /// diff --git a/ElectronNET.API/Entities/MenuRole.cs b/ElectronNET.API/Entities/MenuRole.cs index 37f10090..3d49568c 100644 --- a/ElectronNET.API/Entities/MenuRole.cs +++ b/ElectronNET.API/Entities/MenuRole.cs @@ -158,6 +158,17 @@ public enum MenuRole /// /// Only macOS: The submenu is a “Services” menu /// - services + services, + + /// + /// Only macOS: the submenue for "Recent Documents" + /// + recentdocuments, + + /// + /// Only macOS: the menu to clear the recent document list + /// + clearrecentdocuments, + } } \ No newline at end of file diff --git a/ElectronNET.API/Entities/MessageBoxResult.cs b/ElectronNET.API/Entities/MessageBoxResult.cs index 835c292c..8910dff1 100644 --- a/ElectronNET.API/Entities/MessageBoxResult.cs +++ b/ElectronNET.API/Entities/MessageBoxResult.cs @@ -1,5 +1,11 @@ namespace ElectronNET.API.Entities { + internal class MessageBoxResponse + { + public int response { get; set; } + public bool @checked { get; set; } + } + /// /// /// diff --git a/ElectronNET.API/Entities/NativeImage.cs b/ElectronNET.API/Entities/NativeImage.cs index e1066bed..e4095b77 100644 --- a/ElectronNET.API/Entities/NativeImage.cs +++ b/ElectronNET.API/Entities/NativeImage.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Text.RegularExpressions; using Newtonsoft.Json; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Formats.Png; +using SixLabors.ImageSharp.Processing; namespace ElectronNET.API.Entities { @@ -16,6 +16,11 @@ namespace ElectronNET.API.Entities [JsonConverter(typeof(NativeImageJsonConverter))] public class NativeImage { + /// + /// + /// + public const float DefaultScaleFactor = 1.0f; + private readonly Dictionary _images = new Dictionary(); private bool _isTemplateImage; @@ -37,7 +42,7 @@ public class NativeImage private static Image BytesToImage(byte[] bytes) { var ms = new MemoryStream(bytes); - return Image.FromStream(ms); + return Image.Load(ms); } /// @@ -51,30 +56,28 @@ public static NativeImage CreateEmpty() /// /// /// - public static NativeImage CreateFromBitmap(Bitmap bitmap, CreateFromBitmapOptions options = null) + [Obsolete("System.Drawing.Common is no longer supported. Use NativeImage.CreateFromImage(image, options);", true)] + public static NativeImage CreateFromBitmap(object bitmap, CreateOptions options = null) { - if (options is null) - { - options = new CreateFromBitmapOptions(); - } - - return new NativeImage(bitmap, options.ScaleFactor); + throw new NotImplementedException( + "System.Drawing.Common is no longer supported. Use NativeImage.CreateFromImage(image, options);"); } + /// + /// + /// + public static NativeImage CreateFromImage(Image image, CreateOptions options = null) + => new (image, options?.ScaleFactor ?? DefaultScaleFactor); + /// /// Creates a NativeImage from a byte array. /// - public static NativeImage CreateFromBuffer(byte[] buffer, CreateFromBufferOptions options = null) + public static NativeImage CreateFromBuffer(byte[] buffer, CreateOptions options = null) { - if (options is null) - { - options = new CreateFromBufferOptions(); - } - var ms = new MemoryStream(buffer); - var image = Image.FromStream(ms); + var image = Image.Load(ms); - return new NativeImage(image, options.ScaleFactor); + return new NativeImage(image, options?.ScaleFactor ?? DefaultScaleFactor); } /// @@ -110,14 +113,14 @@ public static NativeImage CreateFromPath(string path) throw new Exception($"Invalid scaling factor for '{path}'."); } - images[dpi.Value] = Image.FromFile(path); + images[dpi.Value] = Image.Load(path); } else { var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(path); var extension = Path.GetExtension(path); // Load as 1x dpi - images[1.0f] = Image.FromFile(path); + images[1.0f] = Image.Load(path); foreach (var scale in ScaleFactorPairs) { @@ -127,7 +130,7 @@ public static NativeImage CreateFromPath(string path) var dpi = ExtractDpiFromFilePath(fileName); if (dpi != null) { - images[dpi.Value] = Image.FromFile(fileName); + images[dpi.Value] = Image.Load(fileName); } } } @@ -146,9 +149,9 @@ public NativeImage() /// /// Creates a NativeImage from a bitmap and scale factor /// - public NativeImage(Image bitmap, float scaleFactor = 1.0f) + public NativeImage(Image image, float scaleFactor = DefaultScaleFactor) { - _images.Add(scaleFactor, bitmap); + _images.Add(scaleFactor, image); } /// @@ -196,7 +199,7 @@ public void AddRepresentation(AddRepresentationOptions options) if (options.Buffer.Length > 0) { _images[options.ScaleFactor] = - CreateFromBuffer(options.Buffer, new CreateFromBufferOptions {ScaleFactor = options.ScaleFactor}) + CreateFromBuffer(options.Buffer, new CreateOptions {ScaleFactor = options.ScaleFactor}) .GetScale(options.ScaleFactor); } else if (!string.IsNullOrEmpty(options.DataUrl)) @@ -214,7 +217,7 @@ public float GetAspectRatio(float scaleFactor = 1.0f) var image = GetScale(scaleFactor); if (image != null) { - return image.Width / image.Height; + return Convert.ToSingle(image.Width) / image.Height; } return 0f; @@ -223,9 +226,9 @@ public float GetAspectRatio(float scaleFactor = 1.0f) /// /// Returns a byte array that contains the image's raw bitmap pixel data. /// - public byte[] GetBitmap(BitmapOptions options) + public byte[] GetBitmap(ImageOptions options) { - return ToBitmap(new ToBitmapOptions{ ScaleFactor = options.ScaleFactor }); + return ToBitmap(options); } /// @@ -233,26 +236,14 @@ public byte[] GetBitmap(BitmapOptions options) /// public byte[] GetNativeHandle() { - return ToBitmap(new ToBitmapOptions()); + return ToBitmap(new ImageOptions()); } /// /// Gets the size of the specified image based on scale factor /// public Size GetSize(float scaleFactor = 1.0f) - { - if (_images.ContainsKey(scaleFactor)) - { - var image = _images[scaleFactor]; - return new Size - { - Width = image.Width, - Height = image.Height - }; - } - - return null; - } + => _images.TryGetValue(scaleFactor, out var image) ? image.Size() : null; /// /// Checks to see if the NativeImage instance is empty. @@ -278,104 +269,64 @@ public void SetTemplateImage(bool option) /// /// Outputs a bitmap based on the scale factor /// - public byte[] ToBitmap(ToBitmapOptions options) + public byte[] ToBitmap(ImageOptions options) { - return ImageToBytes(ImageFormat.Bmp, options.ScaleFactor); + var ms = new MemoryStream(); + _images[options.ScaleFactor].SaveAsBmp(ms); + return ms.ToArray(); } /// /// Outputs a data URL based on the scale factor /// - public string ToDataURL(ToDataUrlOptions options) - { - if (!_images.ContainsKey(options.ScaleFactor)) - { - return null; - } - - var image = _images[options.ScaleFactor]; - var mimeType = ImageCodecInfo.GetImageEncoders().FirstOrDefault(x => x.FormatID == image.RawFormat.Guid)?.MimeType; - if (mimeType is null) - { - mimeType = "image/png"; - } - - var bytes = ImageToBytes(image.RawFormat, options.ScaleFactor); - var base64 = Convert.ToBase64String(bytes); - - return $"data:{mimeType};base64,{base64}"; - } + public string ToDataURL(ImageOptions options) + => _images.TryGetValue(options.ScaleFactor, out var image) + ? $"data:image/png;base64,{image.ToBase64String(PngFormat.Instance)}" + : null; /// /// Outputs a JPEG for the default scale factor /// public byte[] ToJPEG(int quality) { - return ImageToBytes(ImageFormat.Jpeg, 1.0f, quality); + var ms = new MemoryStream(); + _images[1.0f].SaveAsJpeg(ms); + return ms.ToArray(); } /// /// Outputs a PNG for the specified scale factor /// - public byte[] ToPNG(ToPNGOptions options) - { - return ImageToBytes(ImageFormat.Png, options.ScaleFactor); - } - - private byte[] ImageToBytes(ImageFormat imageFormat = null, float scaleFactor = 1.0f, int quality = 100) + public byte[] ToPNG(ImageOptions options) { - using var ms = new MemoryStream(); - - if (_images.ContainsKey(scaleFactor)) + if (_images.TryGetValue(options.ScaleFactor, out var image)) { - var image = _images[scaleFactor]; - var encoderCodecInfo = GetEncoder(imageFormat ?? image.RawFormat); - var encoder = Encoder.Quality; - - var encoderParameters = new EncoderParameters(1) - { - Param = new[] - { - new EncoderParameter(encoder, quality) - } - }; - - image.Save(ms, encoderCodecInfo, encoderParameters); - + var ms = new MemoryStream(); + image.SaveAsPng(ms); return ms.ToArray(); } - return null; } private Image Resize(int? width, int? height, float scaleFactor = 1.0f) { - if (!_images.ContainsKey(scaleFactor) || (width is null && height is null)) + if (!_images.TryGetValue(scaleFactor, out var image) || (width is null && height is null)) { return null; } + var aspect = GetAspectRatio(scaleFactor); - var image = _images[scaleFactor]; - using (var g = Graphics.FromImage(image)) - { - g.CompositingQuality = CompositingQuality.HighQuality; - - var aspect = GetAspectRatio(scaleFactor); - - width ??= Convert.ToInt32(image.Width * aspect); - height ??= Convert.ToInt32(image.Height * aspect); + width ??= Convert.ToInt32(image.Width * aspect); + height ??= Convert.ToInt32(image.Height * aspect); - width = Convert.ToInt32(width * scaleFactor); - height = Convert.ToInt32(height * scaleFactor); + width = Convert.ToInt32(width * scaleFactor); + height = Convert.ToInt32(height * scaleFactor); - var bmp = new Bitmap(width.Value, height.Value); - g.DrawImage(bmp, - new System.Drawing.Rectangle(0, 0, image.Width, image.Height), - new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height), - GraphicsUnit.Pixel); - - return bmp; - } + return image.Clone(c => c.Resize(new SixLabors.ImageSharp.Processing.ResizeOptions + { + Size = new (width.Value, height.Value), + Sampler = KnownResamplers.Triangle, + })); } private Image Crop(int? x, int? y, int? width, int? height, float scaleFactor = 1.0f) @@ -384,42 +335,23 @@ private Image Crop(int? x, int? y, int? width, int? height, float scaleFactor = { return null; } - + var image = _images[scaleFactor]; - using (var g = Graphics.FromImage(image)) - { - g.CompositingQuality = CompositingQuality.HighQuality; - - x ??= 0; - y ??= 0; - - x = Convert.ToInt32(x * scaleFactor); - y = Convert.ToInt32(y * scaleFactor); - - width ??= image.Width; - height ??= image.Height; + + x ??= 0; + y ??= 0; - width = Convert.ToInt32(width * scaleFactor); - height = Convert.ToInt32(height * scaleFactor); + x = Convert.ToInt32(x * scaleFactor); + y = Convert.ToInt32(y * scaleFactor); - var bmp = new Bitmap(width.Value, height.Value); - g.DrawImage(bmp, new System.Drawing.Rectangle(0, 0, image.Width, image.Height), new System.Drawing.Rectangle(x.Value, y.Value, width.Value, height.Value), GraphicsUnit.Pixel); + width ??= image.Width; + height ??= image.Height; - return bmp; - } - } + width = Convert.ToInt32(width * scaleFactor); + height = Convert.ToInt32(height * scaleFactor); - private ImageCodecInfo GetEncoder(ImageFormat format) - { - var codecs = ImageCodecInfo.GetImageDecoders(); - foreach (ImageCodecInfo codec in codecs) - { - if (codec.FormatID == format.Guid) - { - return codec; - } - } - return null; + return image.Clone(c => + c.Crop(new SixLabors.ImageSharp.Rectangle(x.Value, y.Value, width.Value, height.Value))); } internal Dictionary GetAllScaledImages() @@ -429,7 +361,7 @@ internal Dictionary GetAllScaledImages() { foreach (var (scale, image) in _images) { - dict.Add(scale, Convert.ToBase64String(ImageToBytes(null, scale))); + dict.Add(scale, image.ToBase64String(PngFormat.Instance)); } } catch (Exception ex) @@ -449,5 +381,10 @@ internal Image GetScale(float scaleFactor) return null; } + + /// + /// Utility conversion operator + /// + public static implicit operator NativeImage(Image src) => CreateFromImage(src); } } diff --git a/ElectronNET.API/Entities/NativeImageJsonConverter.cs b/ElectronNET.API/Entities/NativeImageJsonConverter.cs index a82c38ec..1915a5d8 100644 --- a/ElectronNET.API/Entities/NativeImageJsonConverter.cs +++ b/ElectronNET.API/Entities/NativeImageJsonConverter.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.IO; using Newtonsoft.Json; +using SixLabors.ImageSharp; namespace ElectronNET.API.Entities { @@ -24,7 +24,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist foreach (var item in dict) { var bytes = Convert.FromBase64String(item.Value); - newDictionary.Add(item.Key, Image.FromStream(new MemoryStream(bytes))); + newDictionary.Add(item.Key, Image.Load(new MemoryStream(bytes))); } return new NativeImage(newDictionary); } diff --git a/ElectronNET.API/Entities/ProcessVersions.cs b/ElectronNET.API/Entities/ProcessVersions.cs new file mode 100644 index 00000000..df41db65 --- /dev/null +++ b/ElectronNET.API/Entities/ProcessVersions.cs @@ -0,0 +1,10 @@ +namespace ElectronNET.API +{ + /// + /// An object listing the version strings specific to Electron + /// + /// Value representing Chrome's version string + /// Value representing Electron's version string + /// + public record ProcessVersions(string Chrome, string Electron); +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/ReleaseNoteInfo.cs b/ElectronNET.API/Entities/ReleaseNoteInfo.cs deleted file mode 100644 index c9ebf2aa..00000000 --- a/ElectronNET.API/Entities/ReleaseNoteInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace ElectronNET.API.Entities -{ - /// - /// - /// - public class ReleaseNoteInfo - { - /// - /// The version. - /// - public string Version { get; set; } - - /// - /// The note. - /// - public string Note { get; set; } - } -} diff --git a/ElectronNET.API/Entities/SecondInstanceResponse.cs b/ElectronNET.API/Entities/SecondInstanceResponse.cs new file mode 100644 index 00000000..de3e2eca --- /dev/null +++ b/ElectronNET.API/Entities/SecondInstanceResponse.cs @@ -0,0 +1,9 @@ +namespace ElectronNET.API.Entities +{ + public class SecondInstanceResponse + { + public string[] args { get; set; } + + public string workingDirectory { get;set;} + } +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/Size.cs b/ElectronNET.API/Entities/Size.cs index d63d1800..891144e3 100644 --- a/ElectronNET.API/Entities/Size.cs +++ b/ElectronNET.API/Entities/Size.cs @@ -20,5 +20,17 @@ public class Size /// The height. /// public int Height { get; set; } + + /// + /// Utility implicit conversion + /// + public static implicit operator SixLabors.ImageSharp.Size(Size s) => + new (s.Width, s.Height); + + /// + /// Utility implicit conversion + /// + public static implicit operator Size(SixLabors.ImageSharp.Size s) => + new (){Height = s.Height, Width = s.Width}; } } \ No newline at end of file diff --git a/ElectronNET.API/Entities/ToBitmapOptions.cs b/ElectronNET.API/Entities/ToBitmapOptions.cs index 1a08c3bf..9df47981 100644 --- a/ElectronNET.API/Entities/ToBitmapOptions.cs +++ b/ElectronNET.API/Entities/ToBitmapOptions.cs @@ -1,13 +1,20 @@ -namespace ElectronNET.API.Entities +using System; + +namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use ImageOptions instead.")] public class ToBitmapOptions { /// /// Gets or sets the scalefactor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + /// + /// Utility conversion for obsolete class + /// + public static implicit operator ImageOptions(ToBitmapOptions o) => new () {ScaleFactor = o.ScaleFactor}; } } diff --git a/ElectronNET.API/Entities/ToDataUrlOptions.cs b/ElectronNET.API/Entities/ToDataUrlOptions.cs index 0df4aa99..e6d78318 100644 --- a/ElectronNET.API/Entities/ToDataUrlOptions.cs +++ b/ElectronNET.API/Entities/ToDataUrlOptions.cs @@ -1,13 +1,20 @@ -namespace ElectronNET.API.Entities +using System; + +namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use ImageOptions instead.")] public class ToDataUrlOptions { /// /// Gets or sets the scalefactor /// - public float ScaleFactor { get; set; } = 1.0f; + public float ScaleFactor { get; set; } = NativeImage.DefaultScaleFactor; + /// + /// Utility conversion for obsolete class + /// + public static implicit operator ImageOptions(ToDataUrlOptions o) => new () {ScaleFactor = o.ScaleFactor}; } } diff --git a/ElectronNET.API/Entities/ToPNGOptions.cs b/ElectronNET.API/Entities/ToPNGOptions.cs index f4e36b10..ef0baa7f 100644 --- a/ElectronNET.API/Entities/ToPNGOptions.cs +++ b/ElectronNET.API/Entities/ToPNGOptions.cs @@ -1,13 +1,20 @@ -namespace ElectronNET.API.Entities +using System; + +namespace ElectronNET.API.Entities { /// /// /// + [Obsolete("Use ImageOptions instead.")] public class ToPNGOptions { /// /// Gets or sets the scalefactor /// public float ScaleFactor { get; set; } = 1.0f; + /// + /// Utility conversion for obsolete class + /// + public static implicit operator ImageOptions(ToPNGOptions o) => new () {ScaleFactor = o.ScaleFactor}; } } diff --git a/ElectronNET.API/Entities/TrayClickEventArgs.cs b/ElectronNET.API/Entities/TrayClickEventArgs.cs index 516e192a..ca3a4449 100644 --- a/ElectronNET.API/Entities/TrayClickEventArgs.cs +++ b/ElectronNET.API/Entities/TrayClickEventArgs.cs @@ -1,5 +1,6 @@ namespace ElectronNET.API { + /// /// /// diff --git a/ElectronNET.API/Entities/TrayClickEventResponse.cs b/ElectronNET.API/Entities/TrayClickEventResponse.cs new file mode 100644 index 00000000..e0a51703 --- /dev/null +++ b/ElectronNET.API/Entities/TrayClickEventResponse.cs @@ -0,0 +1,8 @@ +namespace ElectronNET.API.Entities +{ + public class TrayClickEventResponse + { + public TrayClickEventArgs eventArgs { get; set; } + public Rectangle bounds { get; set; } + } +} \ No newline at end of file diff --git a/ElectronNET.API/Entities/UpdateInfo.cs b/ElectronNET.API/Entities/UpdateInfo.cs index 5b33bf0b..01dc54bc 100644 --- a/ElectronNET.API/Entities/UpdateInfo.cs +++ b/ElectronNET.API/Entities/UpdateInfo.cs @@ -23,7 +23,7 @@ public class UpdateInfo /// /// The release notes. /// - public ReleaseNoteInfo[] ReleaseNotes { get; set; } = new ReleaseNoteInfo[0]; + public string ReleaseNotes { get; set; } /// /// diff --git a/ElectronNET.API/Entities/WebPreferences.cs b/ElectronNET.API/Entities/WebPreferences.cs index 382de6aa..34a65317 100644 --- a/ElectronNET.API/Entities/WebPreferences.cs +++ b/ElectronNET.API/Entities/WebPreferences.cs @@ -184,6 +184,7 @@ public class WebPreferences /// can access this context in the dev tools by selecting the 'Electron Isolated /// Context' entry in the combo box at the top of the Console tab. This option is /// currently experimental and may change or be removed in future Electron releases. + /// Default value is false. /// [DefaultValue(false)] public bool ContextIsolation { get; set; } = false; diff --git a/ElectronNET.API/Events.cs b/ElectronNET.API/Events.cs index bbbee340..6c01cdc2 100644 --- a/ElectronNET.API/Events.cs +++ b/ElectronNET.API/Events.cs @@ -1,6 +1,5 @@ using System; using System.Globalization; -using Quobject.EngineIoClientDotNet.ComponentEmitter; namespace ElectronNET.API { @@ -42,17 +41,8 @@ public static Events Instance /// The name of the module, e.g. app, dock, etc... /// The name of the event /// The event handler - public void On(string moduleName, string eventName, Action fn) - => On(moduleName, eventName, new ListenerImpl(fn)); + public void On(string moduleName, string eventName, Action fn) => On(moduleName, eventName, _ => fn()); - /// - /// Subscribe to an unmapped electron event. - /// - /// The name of the module, e.g. app, dock, etc... - /// The name of the event - /// The event handler - public void On(string moduleName, string eventName, Action fn) - => On(moduleName, eventName, new ListenerImpl(fn)); /// /// Subscribe to an unmapped electron event. @@ -60,13 +50,13 @@ public void On(string moduleName, string eventName, Action fn) /// The name of the module, e.g. app, dock, etc... /// The name of the event /// The event handler - private void On(string moduleName, string eventName, IListener fn) + public void On(string moduleName, string eventName, Action fn) { var listener = $"{moduleName}{_ti.ToTitleCase(eventName)}Completed"; var subscriber = $"register-{moduleName}-on-event"; - BridgeConnector.Socket.On(listener, fn); - BridgeConnector.Socket.Emit(subscriber, eventName, listener); + BridgeConnector.On(listener, fn); + BridgeConnector.Emit(subscriber, eventName, listener); } /// @@ -75,8 +65,7 @@ private void On(string moduleName, string eventName, IListener fn) /// The name of the module, e.g. app, dock, etc... /// The name of the event /// The event handler - public void Once(string moduleName, string eventName, Action fn) - => Once(moduleName, eventName, new ListenerImpl(fn)); + public void Once(string moduleName, string eventName, Action fn) => Once(moduleName, eventName, _ => fn()); /// /// Subscribe to an unmapped electron event. @@ -85,21 +74,11 @@ public void Once(string moduleName, string eventName, Action fn) /// The name of the event /// The event handler public void Once(string moduleName, string eventName, Action fn) - => Once(moduleName, eventName, new ListenerImpl(fn)); - - /// - /// Subscribe to an unmapped electron event. - /// - /// The name of the module, e.g. app, dock, etc... - /// The name of the event - /// The event handler - private void Once(string moduleName, string eventName, IListener fn) { var listener = $"{moduleName}{_ti.ToTitleCase(eventName)}Completed"; var subscriber = $"register-{moduleName}-once-event"; - BridgeConnector.Socket.Once(listener, fn); - BridgeConnector.Socket.Emit(subscriber, eventName, listener); + BridgeConnector.Once(listener, fn); + BridgeConnector.Emit(subscriber, eventName, listener); } - } } diff --git a/ElectronNET.API/GlobalShortcut.cs b/ElectronNET.API/GlobalShortcut.cs old mode 100644 new mode 100755 index d2867ecd..d978eb18 --- a/ElectronNET.API/GlobalShortcut.cs +++ b/ElectronNET.API/GlobalShortcut.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Detect keyboard events when the application does not have keyboard focus. /// - public sealed class GlobalShortcut + public sealed class GlobalShortcut : IGlobalShortcut { private static GlobalShortcut _globalShortcut; private static object _syncRoot = new object(); @@ -49,16 +50,16 @@ public void Register(string accelerator, Action function) { _shortcuts.Add(accelerator, function); - BridgeConnector.Socket.Off("globalShortcut-pressed"); - BridgeConnector.Socket.On("globalShortcut-pressed", (shortcut) => + BridgeConnector.Off("globalShortcut-pressed"); + BridgeConnector.On("globalShortcut-pressed", (shortcut) => { - if (_shortcuts.ContainsKey(shortcut.ToString())) + if (_shortcuts.ContainsKey(shortcut)) { _shortcuts[shortcut.ToString()](); } }); - BridgeConnector.Socket.Emit("globalShortcut-register", accelerator); + BridgeConnector.Emit("globalShortcut-register", accelerator); } } @@ -68,21 +69,8 @@ public void Register(string accelerator, Action function) /// since they don’t want applications to fight for global shortcuts. /// /// Whether this application has registered accelerator. - public Task IsRegisteredAsync(string accelerator) - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("globalShortcut-isRegisteredCompleted", (isRegistered) => - { - BridgeConnector.Socket.Off("globalShortcut-isRegisteredCompleted"); + public Task IsRegisteredAsync(string accelerator) => BridgeConnector.OnResult("globalShortcut-isRegistered", "globalShortcut-isRegisteredCompleted", accelerator); - taskCompletionSource.SetResult((bool)isRegistered); - }); - - BridgeConnector.Socket.Emit("globalShortcut-isRegistered", accelerator); - - return taskCompletionSource.Task; - } /// /// Unregisters the global shortcut of accelerator. @@ -90,7 +78,7 @@ public Task IsRegisteredAsync(string accelerator) public void Unregister(string accelerator) { _shortcuts.Remove(accelerator); - BridgeConnector.Socket.Emit("globalShortcut-unregister", accelerator); + BridgeConnector.Emit("globalShortcut-unregister", accelerator); } /// @@ -99,7 +87,7 @@ public void Unregister(string accelerator) public void UnregisterAll() { _shortcuts.Clear(); - BridgeConnector.Socket.Emit("globalShortcut-unregisterAll"); + BridgeConnector.Emit("globalShortcut-unregisterAll"); } } } \ No newline at end of file diff --git a/ElectronNET.API/HostHook.cs b/ElectronNET.API/HostHook.cs old mode 100644 new mode 100755 index 37606250..ea62eb10 --- a/ElectronNET.API/HostHook.cs +++ b/ElectronNET.API/HostHook.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json.Serialization; using System; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { @@ -13,7 +14,7 @@ namespace ElectronNET.API /// ElectronHostHook directory: /// electronize add HostHook /// - public sealed class HostHook + public sealed class HostHook : IHostHook { private static HostHook _electronHostHook; private static object _syncRoot = new object(); @@ -47,13 +48,13 @@ internal static HostHook Instance /// Optional parameters. public void Call(string socketEventName, params dynamic[] arguments) { - BridgeConnector.Socket.On(socketEventName + "Error" + oneCallguid, (result) => + BridgeConnector.On(socketEventName + "Error" + oneCallguid, (result) => { - BridgeConnector.Socket.Off(socketEventName + "Error" + oneCallguid); - Electron.Dialog.ShowErrorBox("Host Hook Exception", result.ToString()); + BridgeConnector.Off(socketEventName + "Error" + oneCallguid); + Electron.Dialog.ShowErrorBox("Host Hook Exception", result); }); - BridgeConnector.Socket.Emit(socketEventName, arguments, oneCallguid); + BridgeConnector.Emit(socketEventName, arguments, oneCallguid); } /// @@ -65,64 +66,26 @@ public void Call(string socketEventName, params dynamic[] arguments) /// public Task CallAsync(string socketEventName, params dynamic[] arguments) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On(socketEventName + "Error" + guid, (result) => + BridgeConnector.On(socketEventName + "Error" + guid, (result) => { - BridgeConnector.Socket.Off(socketEventName + "Error" + guid); - Electron.Dialog.ShowErrorBox("Host Hook Exception", result.ToString()); + BridgeConnector.Off(socketEventName + "Error" + guid); + Electron.Dialog.ShowErrorBox("Host Hook Exception", result); taskCompletionSource.SetException(new Exception($"Host Hook Exception {result}")); }); - BridgeConnector.Socket.On(socketEventName + "Complete" + guid, (result) => + BridgeConnector.On(socketEventName + "Complete" + guid, (result) => { - BridgeConnector.Socket.Off(socketEventName + "Error" + guid); - BridgeConnector.Socket.Off(socketEventName + "Complete" + guid); - T data = default; - - try - { - if (result.GetType().IsValueType || result is string) - { - data = (T)result; - } - else - { - var token = JToken.Parse(result.ToString()); - if (token is JArray) - { - data = token.ToObject(); - } - else if (token is JObject) - { - data = token.ToObject(); - } - else - { - data = (T)result; - } - } - } - catch (Exception exception) - { - taskCompletionSource.SetException(exception); - //throw new InvalidCastException("Return value does not match with the generic type.", exception); - } - - taskCompletionSource.SetResult(data); + BridgeConnector.Off(socketEventName + "Error" + guid); + BridgeConnector.Off(socketEventName + "Complete" + guid); + taskCompletionSource.SetResult(result); }); - BridgeConnector.Socket.Emit(socketEventName, arguments, guid); + BridgeConnector.Emit(socketEventName, arguments, guid); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/Interfaces/IApp.cs b/ElectronNET.API/Interfaces/IApp.cs new file mode 100755 index 00000000..abaee747 --- /dev/null +++ b/ElectronNET.API/Interfaces/IApp.cs @@ -0,0 +1,713 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Control your application's event lifecycle. + /// + public interface IApp + { + /// + /// Emitted when all windows have been closed. + /// + /// If you do not subscribe to this event and all windows are closed, the default behavior is to quit + /// the app; however, if you subscribe, you control whether the app quits or not.If the user pressed + /// Cmd + Q, or the developer called , Electron will first try to close all the windows + /// and then emit the event, and in this case the event + /// would not be emitted. + /// + event Action WindowAllClosed; + + /// + /// Emitted before the application starts closing its windows. + /// + /// Note: If application quit was initiated by then + /// is emitted after emitting close event on all windows and closing them. + /// + /// Note: On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout. + /// + event Func BeforeQuit; + + /// + /// Emitted when all windows have been closed and the application will quit. + /// + /// See the description of the event for the differences between the + /// and events. + /// + /// Note: On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout. + /// + event Func WillQuit; + + /// + /// Emitted when the application is quitting. + /// + /// Note: On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout. + /// + event Func Quitting; + + /// + /// Emitted when a blurred. + /// + event Action BrowserWindowBlur; + + /// + /// Emitted when a gets focused. + /// + event Action BrowserWindowFocus; + + /// + /// Emitted when a new is created. + /// + event Action BrowserWindowCreated; + + /// + /// Emitted when a new is created. + /// + event Action WebContentsCreated; + + /// + /// Emitted when Chrome’s accessibility support changes. This event fires when assistive technologies, such as + /// screen readers, are enabled or disabled. See https://www.chromium.org/developers/design-documents/accessibility for more details. + /// + /// when Chrome's accessibility support is enabled, otherwise. + event Action AccessibilitySupportChanged; + + /// + /// Emitted when the application has finished basic startup. + /// + event Action Ready; + + /// + /// Application host fully started. + /// + bool IsReady { get; } + + /// + /// A property that indicates the current application's name, which is the name in the + /// application's package.json file. + /// + /// Usually the name field of package.json is a short lowercase name, according to the npm modules spec. You + /// should usually also specify a productName field, which is your application's full capitalized name, and + /// which will be preferred over name by Electron. + /// + string Name + { + [Obsolete("Use the asynchronous version NameAsync instead")] + get; + set; + } + + /// + /// A property that indicates the current application's name, which is the name in the + /// application's package.json file. + /// + /// Usually the name field of package.json is a short lowercase name, according to the npm modules spec. You + /// should usually also specify a productName field, which is your application's full capitalized name, and + /// which will be preferred over name by Electron. + /// + Task NameAsync { get; } + + /// + /// A object that allows you to read and manipulate the command line arguments that Chromium uses. + /// + CommandLine CommandLine { get; } + + /// + /// A which is the user agent string Electron will use as a global fallback. + /// + /// This is the user agent that will be used when no user agent is set at the webContents or + /// session level. It is useful for ensuring that your entire app has the same user agent. Set to a + /// custom value as early as possible in your app's initialization to ensure that your overridden value + /// is used. + /// + string UserAgentFallback + { + [Obsolete("Use the asynchronous version UserAgentFallbackAsync instead")] + get; + set; + } + + /// + /// A which is the user agent string Electron will use as a global fallback. + /// + /// This is the user agent that will be used when no user agent is set at the webContents or + /// session level. It is useful for ensuring that your entire app has the same user agent. Set to a + /// custom value as early as possible in your app's initialization to ensure that your overridden value + /// is used. + /// + Task UserAgentFallbackAsync { get; } + + /// + /// Emitted when a MacOS user wants to open a file with the application. The open-file event is usually emitted + /// when the application is already open and the OS wants to reuse the application to open the file. + /// open-file is also emitted when a file is dropped onto the dock and the application is not yet running. + /// + /// On Windows, you have to parse the arguments using App.CommandLine to get the filepath. + /// + event Action OpenFile; + + /// + /// Emitted when a MacOS user wants to open a URL with the application. Your application's Info.plist file must + /// define the URL scheme within the CFBundleURLTypes key, and set NSPrincipalClass to AtomApplication. + /// + event Action OpenUrl; + + /// + /// Try to close all windows. The event will be emitted first. If all windows are successfully + /// closed, the event will be emitted and by default the application will terminate. This method + /// guarantees that all beforeunload and unload event handlers are correctly executed. It is possible + /// that a window cancels the quitting by returning in the beforeunload event handler. + /// + void Quit(); + + /// + /// All windows will be closed immediately without asking user and the and + /// events will not be emitted. + /// + /// Exits immediately with exitCode. exitCode defaults to 0. + void Exit(int exitCode = 0); + + /// + /// Relaunches the app when current instance exits. By default the new instance will use the same working directory + /// and command line arguments with current instance. + /// + /// Note that this method does not quit the app when executed, you have to call or + /// after calling to make the app restart. + /// + /// When is called for multiple times, multiple instances will be started after current instance + /// exited. + /// + void Relaunch(); + + /// + /// Relaunches the app when current instance exits. By default the new instance will use the same working directory + /// and command line arguments with current instance. When is specified, the + /// will be passed as command line arguments instead. When + /// is specified, the will be executed for relaunch instead of current app. + /// + /// Note that this method does not quit the app when executed, you have to call or + /// after calling to make the app restart. + /// + /// When is called for multiple times, multiple instances will be started after current instance + /// exited. + /// + /// Options for the relaunch. + void Relaunch(RelaunchOptions relaunchOptions); + + /// + /// On Linux, focuses on the first visible window. On macOS, makes the application the active app. On Windows, focuses + /// on the application's first window. + /// + void Focus(); + + /// + /// On Linux, focuses on the first visible window. On macOS, makes the application the active app. On Windows, focuses + /// on the application's first window. + /// + /// You should seek to use the option as sparingly as possible. + /// + void Focus(FocusOptions focusOptions); + + /// + /// Hides all application windows without minimizing them. + /// + void Hide(); + + /// + /// Shows application windows after they were hidden. Does not automatically focus them. + /// + void Show(); + + /// + /// The current application directory. + /// + Task GetAppPathAsync(CancellationToken cancellationToken = default); + + /// + /// Sets or creates a directory your app's logs which can then be manipulated with + /// or . + /// + /// Calling without a path parameter will result in this directory being set to + /// ~/Library/Logs/YourAppName on macOS, and inside the userData directory on Linux and Windows. + /// + /// A custom path for your logs. Must be absolute. + void SetAppLogsPath(string path); + + /// + /// The path to a special directory. If is called without called + /// being called first, a default directory will be created equivalent + /// to calling without a path parameter. + /// + /// Special directory. + /// The cancellation token. + /// A path to a special directory or file associated with name. + Task GetPathAsync(PathName pathName, CancellationToken cancellationToken = default); + + /// + /// Overrides the path to a special directory or file associated with name. If the path specifies a directory + /// that does not exist, an Error is thrown. In that case, the directory should be created with fs.mkdirSync or similar. + /// + /// You can only override paths of a name defined in . + /// + /// By default, web pages' cookies and caches will be stored under the directory. If you + /// want to change this location, you have to override the path before the + /// event of the module is emitted. + /// Special directory. + /// New path to a special directory. + /// + void SetPath(PathName name, string path); + + /// + /// The version of the loaded application. If no version is found in the application’s package.json file, + /// the version of the current bundle or executable is returned. + /// + /// The version of the loaded application. + Task GetVersionAsync(CancellationToken cancellationToken = default); + + /// + /// The current application locale. Possible return values are documented here. + /// + /// Note: When distributing your packaged app, you have to also ship the locales folder. + /// + /// Note: On Windows, you have to call it after the events gets emitted. + /// + /// The current application locale. + Task GetLocaleAsync(CancellationToken cancellationToken = default); + + /// + /// Adds path to the recent documents list. This list is managed by the OS. On Windows you can visit the + /// list from the task bar, and on macOS you can visit it from dock menu. + /// + /// Path to add. + void AddRecentDocument(string path); + + /// + /// Clears the recent documents list. + /// + void ClearRecentDocuments(); + + /// + /// Sets the current executable as the default handler for a protocol (aka URI scheme). It allows you to + /// integrate your app deeper into the operating system. Once registered, all links with your-protocol:// + /// will be opened with the current executable. The whole link, including protocol, will be passed to your + /// application as a parameter. + /// + /// Note: On macOS, you can only register protocols that have been added to your app's info.plist, which + /// cannot be modified at runtime. However, you can change the file during build time via + /// Electron Forge, + /// Electron Packager, or by editing info.plist + /// with a text editor. Please refer to + /// Apple's documentation + /// for details. + /// + /// Note: In a Windows Store environment (when packaged as an appx) this API will return true for all calls but + /// the registry key it sets won't be accessible by other applications. In order to register your Windows Store + /// application as a default protocol handler you must declare the protocol in your manifest. + /// + /// The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally. + /// + /// + /// The name of your protocol, without ://. For example, if you want your app to handle electron:// links, + /// call this method with electron as the parameter. + /// The cancellation token. + /// Whether the call succeeded. + Task SetAsDefaultProtocolClientAsync(string protocol, CancellationToken cancellationToken = default); + + /// + /// Sets the current executable as the default handler for a protocol (aka URI scheme). It allows you to + /// integrate your app deeper into the operating system. Once registered, all links with your-protocol:// + /// will be opened with the current executable. The whole link, including protocol, will be passed to your + /// application as a parameter. + /// + /// Note: On macOS, you can only register protocols that have been added to your app's info.plist, which + /// cannot be modified at runtime. However, you can change the file during build time via + /// Electron Forge, + /// Electron Packager, or by editing info.plist + /// with a text editor. Please refer to + /// Apple's documentation + /// for details. + /// + /// Note: In a Windows Store environment (when packaged as an appx) this API will return true for all calls but + /// the registry key it sets won't be accessible by other applications. In order to register your Windows Store + /// application as a default protocol handler you must declare the protocol in your manifest. + /// + /// The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally. + /// + /// + /// The name of your protocol, without ://. For example, if you want your app to handle electron:// links, + /// call this method with electron as the parameter. + /// The path to the Electron executable. Defaults to process.execPath + /// The cancellation token. + /// Whether the call succeeded. + Task SetAsDefaultProtocolClientAsync(string protocol, string path, CancellationToken cancellationToken = default); + + /// + /// Sets the current executable as the default handler for a protocol (aka URI scheme). It allows you to + /// integrate your app deeper into the operating system. Once registered, all links with your-protocol:// + /// will be opened with the current executable. The whole link, including protocol, will be passed to your + /// application as a parameter. + /// + /// Note: On macOS, you can only register protocols that have been added to your app's info.plist, which + /// cannot be modified at runtime. However, you can change the file during build time via + /// Electron Forge, + /// Electron Packager, or by editing info.plist + /// with a text editor. Please refer to + /// Apple's documentation + /// for details. + /// + /// Note: In a Windows Store environment (when packaged as an appx) this API will return true for all calls but + /// the registry key it sets won't be accessible by other applications. In order to register your Windows Store + /// application as a default protocol handler you must declare the protocol in your manifest. + /// + /// The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally. + /// + /// + /// The name of your protocol, without ://. For example, if you want your app to handle electron:// links, + /// call this method with electron as the parameter. + /// The path to the Electron executable. Defaults to process.execPath + /// Arguments passed to the executable. Defaults to an empty array. + /// The cancellation token. + /// Whether the call succeeded. + Task SetAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable as the default handler for a protocol (aka URI scheme). + /// If so, it will remove the app as the default handler. + /// + /// The name of your protocol, without ://. + /// The cancellation token. + /// Whether the call succeeded. + Task RemoveAsDefaultProtocolClientAsync(string protocol, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable as the default handler for a protocol (aka URI scheme). + /// If so, it will remove the app as the default handler. + /// + /// The name of your protocol, without ://. + /// Defaults to process.execPath. + /// The cancellation token. + /// Whether the call succeeded. + Task RemoveAsDefaultProtocolClientAsync(string protocol, string path, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable as the default handler for a protocol (aka URI scheme). + /// If so, it will remove the app as the default handler. + /// + /// The name of your protocol, without ://. + /// Defaults to process.execPath. + /// Defaults to an empty array. + /// The cancellation token. + /// Whether the call succeeded. + Task RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable is the default handler for a protocol (aka URI scheme). + /// + /// Note: On macOS, you can use this method to check if the app has been registered as the default protocol + /// handler for a protocol. You can also verify this by checking ~/Library/Preferences/com.apple.LaunchServices.plist + /// on the macOS machine. Please refer to Apple's documentation + /// for details. + /// + /// The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally. + /// + /// The name of your protocol, without ://. + /// The cancellation token. + /// Whether the current executable is the default handler for a protocol (aka URI scheme). + Task IsDefaultProtocolClientAsync(string protocol, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable is the default handler for a protocol (aka URI scheme). + /// + /// Note: On macOS, you can use this method to check if the app has been registered as the default protocol + /// handler for a protocol. You can also verify this by checking ~/Library/Preferences/com.apple.LaunchServices.plist + /// on the macOS machine. Please refer to Apple's documentation + /// for details. + /// + /// The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally. + /// + /// The name of your protocol, without ://. + /// Defaults to process.execPath. + /// The cancellation token. + /// Whether the current executable is the default handler for a protocol (aka URI scheme). + Task IsDefaultProtocolClientAsync(string protocol, string path, CancellationToken cancellationToken = default); + + /// + /// This method checks if the current executable is the default handler for a protocol (aka URI scheme). + /// + /// Note: On macOS, you can use this method to check if the app has been registered as the default protocol + /// handler for a protocol. You can also verify this by checking ~/Library/Preferences/com.apple.LaunchServices.plist + /// on the macOS machine. Please refer to Apple's documentation + /// for details. + /// + /// The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally. + /// + /// The name of your protocol, without ://. + /// Defaults to process.execPath. + /// Defaults to an empty array. + /// The cancellation token. + /// Whether the current executable is the default handler for a protocol (aka URI scheme). + Task IsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default); + + /// + /// Adds tasks to the category of the JumpList on Windows. + /// + /// Note: If you'd like to customize the Jump List even more use instead. + /// + /// Array of objects. + /// The cancellation token. + /// Whether the call succeeded. + Task SetUserTasksAsync(UserTask[] userTasks, CancellationToken cancellationToken = default); + + /// + /// Jump List settings for the application. + /// + /// The cancellation token. + /// Jump List settings. + Task GetJumpListSettingsAsync(CancellationToken cancellationToken = default); + + /// + /// Sets or removes a custom Jump List for the application. If categories is null the previously set custom + /// Jump List (if any) will be replaced by the standard Jump List for the app (managed by Windows). + /// + /// Note: If a object has neither the nor + /// the property set then its is assumed + /// to be . If the property is set but + /// the property is omitted then the is + /// assumed to be . + /// + /// Note: Users can remove items from custom categories, and Windows will not allow a removed item to be added + /// back into a custom category until after the next successful call to . Any attempt + /// to re-add a removed item to a custom category earlier than that will result in the entire custom category being + /// omitted from the Jump List. The list of removed items can be obtained using . + /// + /// Array of objects. + void SetJumpList(JumpListCategory[] categories); + + /// + /// The return value of this method indicates whether or not this instance of your application successfully obtained + /// the lock. If it failed to obtain the lock, you can assume that another instance of your application is already + /// running with the lock and exit immediately. + /// + /// I.e.This method returns if your process is the primary instance of your application and your + /// app should continue loading. It returns if your process should immediately quit as it has + /// sent its parameters to another instance that has already acquired the lock. + /// + /// On macOS, the system enforces single instance automatically when users try to open a second instance of your app + /// in Finder, and the open-file and open-url events will be emitted for that.However when users start your app in + /// command line, the system's single instance mechanism will be bypassed, and you have to use this method to ensure + /// single instance. + /// + /// Lambda with an array of the second instance’s command line arguments. + /// The second parameter is the working directory path. + /// The cancellation token. + /// This method returns false if your process is the primary instance of the application and your app + /// should continue loading. And returns true if your process has sent its parameters to another instance, and + /// you should immediately quit. + /// + Task RequestSingleInstanceLockAsync(Action newInstanceOpened, CancellationToken cancellationToken = default); + + /// + /// Releases all locks that were created by makeSingleInstance. This will allow + /// multiple instances of the application to once again run side by side. + /// + void ReleaseSingleInstanceLock(); + + /// + /// This method returns whether or not this instance of your app is currently holding the single instance lock. + /// You can request the lock with and release with + /// . + /// + /// The cancellation token. + Task HasSingleInstanceLockAsync(CancellationToken cancellationToken = default); + + /// + /// Creates an NSUserActivity and sets it as the current activity. The activity is + /// eligible for Handoff + /// to another device afterward. + /// + /// Uniquely identifies the activity. Maps to NSUserActivity.activityType. + /// App-specific state to store for use by another device. + void SetUserActivity(string type, object userInfo); + + /// + /// Creates an NSUserActivity and sets it as the current activity. The activity is + /// eligible for Handoff + /// to another device afterward. + /// + /// + /// Uniquely identifies the activity. Maps to NSUserActivity.activityType. + /// + /// App-specific state to store for use by another device. + /// + /// The webpage to load in a browser if no suitable app is installed on the resuming device. The scheme must be http or https. + /// + void SetUserActivity(string type, object userInfo, string webpageUrl); + + /// + /// The type of the currently running activity. + /// + /// The cancellation token. + Task GetCurrentActivityTypeAsync(CancellationToken cancellationToken = default); + + /// + /// Invalidates the current Handoff user activity. + /// + void InvalidateCurrentActivity(); + + /// + /// Marks the current Handoff user activity as inactive without invalidating it. + /// + void ResignCurrentActivity(); + + /// + /// Changes the Application User Model ID to id. + /// + /// Model Id. + void SetAppUserModelId(string id); + + /// TODO: Check new parameter which is a function [App.ImportCertificate] + /// + /// Imports the certificate in pkcs12 format into the platform certificate store. + /// callback is called with the result of import operation, a value of 0 indicates + /// success while any other value indicates failure according to chromium net_error_list. + /// + /// + /// The cancellation token. + /// Result of import. Value of 0 indicates success. + Task ImportCertificateAsync(ImportCertificateOptions options, CancellationToken cancellationToken = default); + + /// + /// Memory and cpu usage statistics of all the processes associated with the app. + /// + /// + /// Array of ProcessMetric objects that correspond to memory and cpu usage + /// statistics of all the processes associated with the app. + /// The cancellation token. + /// + Task GetAppMetricsAsync(CancellationToken cancellationToken = default); + + /// + /// The Graphics Feature Status from chrome://gpu/. + /// + /// Note: This information is only usable after the gpu-info-update event is emitted. + /// The cancellation token. + /// + Task GetGpuFeatureStatusAsync(CancellationToken cancellationToken = default); + + /// + /// Sets the counter badge for current app. Setting the count to 0 will hide the badge. + /// On macOS it shows on the dock icon. On Linux it only works for Unity launcher. + /// + /// Note: Unity launcher requires the existence of a .desktop file to work, for more + /// information please read Desktop Environment Integration. + /// + /// Counter badge. + /// The cancellation token. + /// Whether the call succeeded. + Task SetBadgeCountAsync(int count, CancellationToken cancellationToken = default); + + /// + /// The current value displayed in the counter badge. + /// + /// The cancellation token. + Task GetBadgeCountAsync(CancellationToken cancellationToken = default); + + /// + /// Whether the current desktop environment is Unity launcher. + /// + /// The cancellation token. + Task IsUnityRunningAsync(CancellationToken cancellationToken = default); + + /// + /// If you provided path and args options to then you need to pass the same + /// arguments here for to be set correctly. + /// + Task GetLoginItemSettingsAsync(CancellationToken cancellationToken = default); + + /// + /// If you provided path and args options to then you need to pass the same + /// arguments here for to be set correctly. + /// + /// + /// The cancellation token. + Task GetLoginItemSettingsAsync(LoginItemSettingsOptions options, CancellationToken cancellationToken = default); + + /// + /// Set the app's login item settings. + /// To work with Electron's autoUpdater on Windows, which uses Squirrel, + /// you'll want to set the launch path to Update.exe, and pass arguments that specify your application name. + /// + /// + void SetLoginItemSettings(LoginSettings loginSettings); + + /// + /// if Chrome's accessibility support is enabled, otherwise. This API will + /// return if the use of assistive technologies, such as screen readers, has been detected. + /// See Chromium's accessibility docs for more details. + /// + /// if Chrome’s accessibility support is enabled, otherwise. + Task IsAccessibilitySupportEnabledAsync(CancellationToken cancellationToken = default); + + /// + /// Manually enables Chrome's accessibility support, allowing to expose accessibility switch to users in application settings. + /// See Chromium's accessibility docs for more details. + /// Disabled () by default. + /// + /// This API must be called after the event is emitted. + /// + /// Note: Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default. + /// + /// Enable or disable accessibility tree rendering. + void SetAccessibilitySupportEnabled(bool enabled); + + /// + /// Show the app's about panel options. These options can be overridden with + /// . + /// + void ShowAboutPanel(); + + /// + /// Set the about panel options. This will override the values defined in the app's .plist file on macOS. See the + /// Apple docs + /// for more details. On Linux, values must be set in order to be shown; there are no defaults. + /// + /// If you do not set credits but still wish to surface them in your app, AppKit will look for a file named "Credits.html", + /// "Credits.rtf", and "Credits.rtfd", in that order, in the bundle returned by the NSBundle class method main. The first file + /// found is used, and if none is found, the info area is left blank. See Apple + /// documentation for more information. + /// + /// About panel options. + void SetAboutPanelOptions(AboutPanelOptions options); + + /// + /// Subscribe to an unmapped event on the module. + /// + /// The event name + /// The handler + void On(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module. + /// + /// The event name + /// The handler + void On(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module once. + /// + /// The event name + /// The handler + void Once(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module once. + /// + /// The event name + /// The handler + void Once(string eventName, Action fn); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IApplicationSocket.cs b/ElectronNET.API/Interfaces/IApplicationSocket.cs new file mode 100755 index 00000000..8d4044be --- /dev/null +++ b/ElectronNET.API/Interfaces/IApplicationSocket.cs @@ -0,0 +1,15 @@ +using Quobject.SocketIoClientDotNet.Client; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Wrapper for the underlying Socket connection + /// + public interface IApplicationSocket + { + /// + /// Socket used to communicate with main.js + /// + Socket Socket { get; } + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IAutoUpdater.cs b/ElectronNET.API/Interfaces/IAutoUpdater.cs new file mode 100755 index 00000000..4ff36379 --- /dev/null +++ b/ElectronNET.API/Interfaces/IAutoUpdater.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Enable apps to automatically update themselves. Based on electron-updater. + /// + public interface IAutoUpdater + { + /// + /// Whether to automatically download an update when it is found. (Default is true) + /// + bool AutoDownload { get; set; } + + /// + /// Whether to automatically install a downloaded update on app quit (if `QuitAndInstall` was not called before). + /// + /// Applicable only on Windows and Linux. + /// + bool AutoInstallOnAppQuit { get; set; } + + /// + /// *GitHub provider only.* Whether to allow update to pre-release versions. + /// Defaults to "true" if application version contains prerelease components (e.g. "0.12.1-alpha.1", here "alpha" is a prerelease component), otherwise "false". + /// + /// If "true", downgrade will be allowed("allowDowngrade" will be set to "true"). + /// + bool AllowPrerelease { get; set; } + + /// + /// *GitHub provider only.* + /// Get all release notes (from current version to latest), not just the latest (Default is false). + /// + bool FullChangelog { get; set; } + + /// + /// Whether to allow version downgrade (when a user from the beta channel wants to go back to the stable channel). + /// Taken in account only if channel differs (pre-release version component in terms of semantic versioning). + /// Default is false. + /// + bool AllowDowngrade { get; set; } + + /// + /// For test only. + /// + string UpdateConfigPath { get; } + + /// + /// The current application version + /// + Task CurrentVersionAsync { get; } + + /// + /// Get the update channel. Not applicable for GitHub. + /// Doesn’t return channel from the update configuration, only if was previously set. + /// + string Channel { get; } + + /// + /// Get the update channel. Not applicable for GitHub. + /// Doesn’t return channel from the update configuration, only if was previously set. + /// + Task ChannelAsync { get; } + + /// + /// The request headers. + /// + Task> RequestHeadersAsync { get; } + + /// + /// The request headers. + /// + Dictionary RequestHeaders { set; } + + /// + /// Emitted when there is an error while updating. + /// + event Action OnError; + + /// + /// Emitted when checking if an update has started. + /// + event Action OnCheckingForUpdate; + + /// + /// Emitted when there is an available update. + /// The update is downloaded automatically if AutoDownload is true. + /// + event Action OnUpdateAvailable; + + /// + /// Emitted when there is no available update. + /// + event Action OnUpdateNotAvailable; + + /// + /// Emitted on download progress. + /// + event Action OnDownloadProgress; + + /// + /// Emitted on download complete. + /// + event Action OnUpdateDownloaded; + + /// + /// Asks the server whether there is an update. + /// + /// + Task CheckForUpdatesAsync(); + + /// + /// Asks the server whether there is an update. + /// + /// This will immediately download an update, then install when the app quits. + /// + /// + Task CheckForUpdatesAndNotifyAsync(); + + /// + /// Restarts the app and installs the update after it has been downloaded. + /// It should only be called after `update-downloaded` has been emitted. + /// + /// Note: QuitAndInstall() will close all application windows first and only emit `before-quit` event on `app` after that. + /// This is different from the normal quit event sequence. + /// + /// *windows-only* Runs the installer in silent mode. Defaults to `false`. + /// Run the app after finish even on silent install. Not applicable for macOS. Ignored if `isSilent` is set to `false`. + void QuitAndInstall(bool isSilent = false, bool isForceRunAfter = false); + + /// + /// Start downloading update manually. You can use this method if "AutoDownload" option is set to "false". + /// + /// Path to downloaded file. + Task DownloadUpdateAsync(); + + /// + /// Feed URL. + /// + /// Feed URL. + Task GetFeedURLAsync(); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IClipboard.cs b/ElectronNET.API/Interfaces/IClipboard.cs new file mode 100755 index 00000000..607f536f --- /dev/null +++ b/ElectronNET.API/Interfaces/IClipboard.cs @@ -0,0 +1,122 @@ +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Perform copy and paste operations on the system clipboard. + /// + public interface IClipboard + { + /// + /// Read the content in the clipboard as plain text. + /// + /// + /// The content in the clipboard as plain text. + Task ReadTextAsync(string type = ""); + + /// + /// Writes the text into the clipboard as plain text. + /// + /// + /// + void WriteText(string text, string type = ""); + + /// + /// The content in the clipboard as markup. + /// + /// + /// + Task ReadHTMLAsync(string type = ""); + + /// + /// Writes markup to the clipboard. + /// + /// + /// + void WriteHTML(string markup, string type = ""); + + /// + /// The content in the clipboard as RTF. + /// + /// + /// + Task ReadRTFAsync(string type = ""); + + /// + /// Writes the text into the clipboard in RTF. + /// + /// + /// + void WriteRTF(string text, string type = ""); + + /// + /// Returns an Object containing title and url keys representing + /// the bookmark in the clipboard. The title and url values will + /// be empty strings when the bookmark is unavailable. + /// + /// + Task ReadBookmarkAsync(); + + /// + /// Writes the title and url into the clipboard as a bookmark. + /// + /// Note: Most apps on Windows don’t support pasting bookmarks + /// into them so you can use clipboard.write to write both a + /// bookmark and fallback text to the clipboard. + /// + /// + /// + /// + void WriteBookmark(string title, string url, string type = ""); + + /// + /// macOS: The text on the find pasteboard. This method uses synchronous IPC + /// when called from the renderer process. The cached value is reread from the + /// find pasteboard whenever the application is activated. + /// + /// + Task ReadFindTextAsync(); + + /// + /// macOS: Writes the text into the find pasteboard as plain text. This method uses + /// synchronous IPC when called from the renderer process. + /// + /// + void WriteFindText(string text); + + /// + /// Clears the clipboard content. + /// + /// + void Clear(string type = ""); + + /// + /// An array of supported formats for the clipboard type. + /// + /// + /// + Task AvailableFormatsAsync(string type = ""); + + /// + /// Writes data to the clipboard. + /// + /// + /// + void Write(Data data, string type = ""); + + /// + /// Reads an image from the clipboard. + /// + /// + /// + Task ReadImageAsync(string type = ""); + + /// + /// Writes an image to the clipboard. + /// + /// + /// + void WriteImage(NativeImage image, string type = ""); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IDialog.cs b/ElectronNET.API/Interfaces/IDialog.cs new file mode 100755 index 00000000..eff74231 --- /dev/null +++ b/ElectronNET.API/Interfaces/IDialog.cs @@ -0,0 +1,102 @@ +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Display native system dialogs for opening and saving files, alerting, etc. + /// + public interface IDialog + { + /// + /// Note: On Windows and Linux an open dialog can not be both a file selector + /// and a directory selector, so if you set properties to ['openFile', 'openDirectory'] + /// on these platforms, a directory selector will be shown. + /// + /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. + /// + /// An array of file paths chosen by the user + Task ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialogOptions options); + + /// + /// Dialog for save files. + /// + /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. + /// + /// Returns String, the path of the file chosen by the user, if a callback is provided it returns an empty string. + Task ShowSaveDialogAsync(BrowserWindow browserWindow, SaveDialogOptions options); + + /// + /// Shows a message box, it will block the process until the message box is closed. + /// It returns the index of the clicked button. The browserWindow argument allows + /// the dialog to attach itself to a parent window, making it modal. If a callback + /// is passed, the dialog will not block the process.The API call will be + /// asynchronous and the result will be passed via callback(response). + /// + /// + /// The API call will be asynchronous and the result will be passed via MessageBoxResult. + Task ShowMessageBoxAsync(string message); + + /// + /// Shows a message box, it will block the process until the message box is closed. + /// It returns the index of the clicked button. The browserWindow argument allows + /// the dialog to attach itself to a parent window, making it modal. If a callback + /// is passed, the dialog will not block the process.The API call will be + /// asynchronous and the result will be passed via callback(response). + /// + /// + /// The API call will be asynchronous and the result will be passed via MessageBoxResult. + Task ShowMessageBoxAsync(MessageBoxOptions messageBoxOptions); + + /// + /// Shows a message box, it will block the process until the message box is closed. + /// It returns the index of the clicked button. If a callback + /// is passed, the dialog will not block the process. + /// + /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. + /// + /// The API call will be asynchronous and the result will be passed via MessageBoxResult. + Task ShowMessageBoxAsync(BrowserWindow browserWindow, string message); + + /// + /// Shows a message box, it will block the process until the message box is closed. + /// It returns the index of the clicked button. If a callback + /// is passed, the dialog will not block the process. + /// + /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. + /// + /// The API call will be asynchronous and the result will be passed via MessageBoxResult. + Task ShowMessageBoxAsync(BrowserWindow browserWindow, MessageBoxOptions messageBoxOptions); + + /// + /// Displays a modal dialog that shows an error message. + /// + /// This API can be called safely before the ready event the app module emits, + /// it is usually used to report errors in early stage of startup.If called + /// before the app readyevent on Linux, the message will be emitted to stderr, + /// and no GUI dialog will appear. + /// + /// The title to display in the error box. + /// The text content to display in the error box. + void ShowErrorBox(string title, string content); + + /// + /// On macOS, this displays a modal dialog that shows a message and certificate information, + /// and gives the user the option of trusting/importing the certificate. If you provide a + /// browserWindow argument the dialog will be attached to the parent window, making it modal. + /// + /// + /// + Task ShowCertificateTrustDialogAsync(CertificateTrustDialogOptions options); + + /// + /// On macOS, this displays a modal dialog that shows a message and certificate information, + /// and gives the user the option of trusting/importing the certificate. If you provide a + /// browserWindow argument the dialog will be attached to the parent window, making it modal. + /// + /// + /// + /// + Task ShowCertificateTrustDialogAsync(BrowserWindow browserWindow, CertificateTrustDialogOptions options); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IDock.cs b/ElectronNET.API/Interfaces/IDock.cs new file mode 100755 index 00000000..0a42c491 --- /dev/null +++ b/ElectronNET.API/Interfaces/IDock.cs @@ -0,0 +1,93 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Control your app in the macOS dock. + /// + public interface IDock + { + /// + /// When is passed, the dock icon will bounce until either the application becomes + /// active or the request is canceled. When is passed, the dock icon will bounce + /// for one second. However, the request remains active until either the application becomes active or the request is canceled. + /// + /// Note: This method can only be used while the app is not focused; when the app is focused it will return -1. + /// + /// Can be critical or informational. The default is informational. + /// The cancellation token. + /// Return an ID representing the request. + Task BounceAsync(DockBounceType type, CancellationToken cancellationToken = default); + + /// + /// Cancel the bounce of id. + /// + /// Id of the request. + void CancelBounce(int id); + + /// + /// Bounces the Downloads stack if the filePath is inside the Downloads folder. + /// + /// + void DownloadFinished(string filePath); + + /// + /// Sets the string to be displayed in the dock’s badging area. + /// + /// + void SetBadge(string text); + + /// + /// Gets the string to be displayed in the dock’s badging area. + /// + /// The cancellation token. + /// The badge string of the dock. + Task GetBadgeAsync(CancellationToken cancellationToken = default); + + /// + /// Hides the dock icon. + /// + void Hide(); + + /// + /// Shows the dock icon. + /// + void Show(); + + /// + /// Whether the dock icon is visible. The app.dock.show() call is asynchronous + /// so this method might not return true immediately after that call. + /// + /// The cancellation token. + /// Whether the dock icon is visible. + Task IsVisibleAsync(CancellationToken cancellationToken = default); + + /// + /// Gets the dock menu items. + /// + /// + /// The menu items. + /// + IReadOnlyCollection MenuItems { get; } + + /// + /// Sets the application's dock menu. + /// + void SetMenu(MenuItem[] menuItems); + + /// + /// TODO: Menu (macOS) still to be implemented + /// Gets the application's dock menu. + /// + Task GetMenu(CancellationToken cancellationToken = default); + + /// + /// Sets the image associated with this dock icon. + /// + /// + void SetIcon(string image); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IGlobalShortcut.cs b/ElectronNET.API/Interfaces/IGlobalShortcut.cs new file mode 100755 index 00000000..0f671c64 --- /dev/null +++ b/ElectronNET.API/Interfaces/IGlobalShortcut.cs @@ -0,0 +1,39 @@ +using System; +using System.Threading.Tasks; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Detect keyboard events when the application does not have keyboard focus. + /// + public interface IGlobalShortcut + { + /// + /// Registers a global shortcut of accelerator. + /// The callback is called when the registered shortcut is pressed by the user. + /// + /// When the accelerator is already taken by other applications, this call will + /// silently fail.This behavior is intended by operating systems, since they don’t + /// want applications to fight for global shortcuts. + /// + void Register(string accelerator, Action function); + + /// + /// When the accelerator is already taken by other applications, + /// this call will still return false. This behavior is intended by operating systems, + /// since they don’t want applications to fight for global shortcuts. + /// + /// Whether this application has registered accelerator. + Task IsRegisteredAsync(string accelerator); + + /// + /// Unregisters the global shortcut of accelerator. + /// + void Unregister(string accelerator); + + /// + /// Unregisters all of the global shortcuts. + /// + void UnregisterAll(); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IHostHook.cs b/ElectronNET.API/Interfaces/IHostHook.cs new file mode 100755 index 00000000..0a5b8dc3 --- /dev/null +++ b/ElectronNET.API/Interfaces/IHostHook.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Allows you to execute native JavaScript/TypeScript code from the host process. + /// + /// It is only possible if the Electron.NET CLI has previously added an + /// ElectronHostHook directory: + /// electronize add HostHook + /// + public interface IHostHook + { + /// + /// Execute native JavaScript/TypeScript code. + /// + /// Socket name registered on the host. + /// Optional parameters. + void Call(string socketEventName, params dynamic[] arguments); + + /// + /// Execute native JavaScript/TypeScript code. + /// + /// Results from the executed host code. + /// Socket name registered on the host. + /// Optional parameters. + /// + Task CallAsync(string socketEventName, params dynamic[] arguments); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IIpcMain.cs b/ElectronNET.API/Interfaces/IIpcMain.cs new file mode 100755 index 00000000..8a833e23 --- /dev/null +++ b/ElectronNET.API/Interfaces/IIpcMain.cs @@ -0,0 +1,65 @@ +using System; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Communicate asynchronously from the main process to renderer processes. + /// + public interface IIpcMain + { + /// + /// Listens to channel, when a new message arrives listener would be called with + /// listener(event, args...). + /// + /// Channelname. + /// Callback Method. + void On(string channel, Action listener); + + /// + /// Send a message to the renderer process synchronously via channel, + /// you can also send arbitrary arguments. + /// + /// Note: Sending a synchronous message will block the whole renderer process, + /// unless you know what you are doing you should never use it. + /// + /// + /// + void OnSync(string channel, Func listener); + + /// + /// Adds a one time listener method for the event. This listener is invoked only + /// the next time a message is sent to channel, after which it is removed. + /// + /// Channelname. + /// Callback Method. + void Once(string channel, Action listener); + + /// + /// Removes listeners of the specified channel. + /// + /// Channelname. + void RemoveAllListeners(string channel); + + /// + /// Send a message to the renderer process asynchronously via channel, you can also send + /// arbitrary arguments. Arguments will be serialized in JSON internally and hence + /// no functions or prototype chain will be included. The renderer process handles it by + /// listening for channel with ipcRenderer module. + /// + /// BrowserWindow with channel. + /// Channelname. + /// Arguments data. + void Send(BrowserWindow browserWindow, string channel, params object[] data); + + /// + /// Send a message to the BrowserView renderer process asynchronously via channel, you can also send + /// arbitrary arguments. Arguments will be serialized in JSON internally and hence + /// no functions or prototype chain will be included. The renderer process handles it by + /// listening for channel with ipcRenderer module. + /// + /// BrowserView with channel. + /// Channelname. + /// Arguments data. + void Send(BrowserView browserView, string channel, params object[] data); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IMenu.cs b/ElectronNET.API/Interfaces/IMenu.cs new file mode 100755 index 00000000..6dfdbd4f --- /dev/null +++ b/ElectronNET.API/Interfaces/IMenu.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Create native application menus and context menus. + /// + public interface IMenu + { + /// + /// Gets the menu items. + /// + /// + /// The menu items. + /// + IReadOnlyCollection MenuItems { get; } + + /// + /// Gets the context menu items. + /// + /// + /// The context menu items. + /// + IReadOnlyDictionary> ContextMenuItems { get; } + + /// + /// Sets the application menu. + /// + /// The menu items. + void SetApplicationMenu(MenuItem[] menuItems); + + /// + /// Sets the context menu. + /// + /// The browser window. + /// The menu items. + void SetContextMenu(BrowserWindow browserWindow, MenuItem[] menuItems); + + /// + /// Contexts the menu popup. + /// + /// The browser window. + void ContextMenuPopup(BrowserWindow browserWindow); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/INativeTheme.cs b/ElectronNET.API/Interfaces/INativeTheme.cs new file mode 100755 index 00000000..37f78b2a --- /dev/null +++ b/ElectronNET.API/Interfaces/INativeTheme.cs @@ -0,0 +1,101 @@ +using System; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Read and respond to changes in Chromium's native color theme. + /// + public interface INativeTheme + { + /// + /// Setting this property to will remove the override and everything will be reset to the OS default. By default 'ThemeSource' is . + /// + /// Settings this property to will have the following effects: + /// + /// + /// will be when accessed + /// + /// + /// Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the dark UI. + /// + /// + /// Any UI the OS renders on macOS including menus, window frames, etc. will use the dark UI. + /// + /// + /// The 'prefers-color-scheme' CSS query will match 'dark' mode. + /// + /// + /// The 'updated' event will be emitted + /// + /// + /// + /// Settings this property to will have the following effects: + /// + /// + /// will be when accessed + /// + /// + /// Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the light UI. + /// + /// + /// Any UI the OS renders on macOS including menus, window frames, etc. will use the light UI. + /// + /// + /// The 'prefers-color-scheme' CSS query will match 'light' mode. + /// + /// + /// The 'updated' event will be emitted + /// + /// + /// The usage of this property should align with a classic "dark mode" state machine in your application where the user has three options. + /// + /// + /// + /// Follow OS: SetThemeSource(ThemeSourceMode.System); + /// + /// + /// Dark Mode: SetThemeSource(ThemeSourceMode.Dark); + /// + /// + /// Light Mode: SetThemeSource(ThemeSourceMode.Light); + /// + /// + /// Your application should then always use to determine what CSS to apply. + /// + /// The new ThemeSource. + void SetThemeSource(ThemeSourceMode themeSourceMode); + + /// + /// A property that can be , or . It is used to override () and + /// supercede the value that Chromium has chosen to use internally. + /// + Task GetThemeSourceAsync(); + + /// + /// A for if the OS / Chromium currently has a dark mode enabled or is + /// being instructed to show a dark-style UI. If you want to modify this value you + /// should use . + /// + Task ShouldUseDarkColorsAsync(); + + /// + /// A for if the OS / Chromium currently has high-contrast mode enabled or is + /// being instructed to show a high-contrast UI. + /// + Task ShouldUseHighContrastColorsAsync(); + + /// + /// A for if the OS / Chromium currently has an inverted color scheme or is + /// being instructed to use an inverted color scheme. + /// + Task ShouldUseInvertedColorSchemeAsync(); + + /// + /// Emitted when something in the underlying NativeTheme has changed. This normally means that either the value of , + /// or has changed. You will have to check them to determine which one has changed. + /// + event Action Updated; + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/INotification.cs b/ElectronNET.API/Interfaces/INotification.cs new file mode 100755 index 00000000..95fca190 --- /dev/null +++ b/ElectronNET.API/Interfaces/INotification.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Create OS desktop notifications + /// + public interface INotification + { + /// + /// Create OS desktop notifications + /// + /// + void Show(NotificationOptions notificationOptions); + + /// + /// Whether or not desktop notifications are supported on the current system. + /// + /// + Task IsSupportedAsync(); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IPowerMonitor.cs b/ElectronNET.API/Interfaces/IPowerMonitor.cs new file mode 100755 index 00000000..2e3ad09c --- /dev/null +++ b/ElectronNET.API/Interfaces/IPowerMonitor.cs @@ -0,0 +1,48 @@ +using System; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Monitor power state changes.. + /// + public interface IPowerMonitor + { + /// + /// Emitted when the system is about to lock the screen. + /// + event Action OnLockScreen; + + /// + /// Emitted when the system is about to unlock the screen. + /// + event Action OnUnLockScreen; + + /// + /// Emitted when the system is suspending. + /// + event Action OnSuspend; + + /// + /// Emitted when system is resuming. + /// + event Action OnResume; + + /// + /// Emitted when the system changes to AC power. + /// + event Action OnAC; + + /// + /// Emitted when system changes to battery power. + /// + event Action OnBattery; + + /// + /// Emitted when the system is about to reboot or shut down. If the event handler + /// invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in + /// order for the app to exit cleanly.If `e.preventDefault()` is called, the app + /// should exit as soon as possible by calling something like `app.quit()`. + /// + event Action OnShutdown; + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IProcess.cs b/ElectronNET.API/Interfaces/IProcess.cs new file mode 100644 index 00000000..dc2c3523 --- /dev/null +++ b/ElectronNET.API/Interfaces/IProcess.cs @@ -0,0 +1,76 @@ +using System.Threading.Tasks; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Electron's process object is extended from the Node.js process object. It adds the + /// events, properties, and methods. + /// + public interface IProcess + { + /// + /// The process.execPath property returns the absolute pathname of the executable that + /// started the Node.js process. Symbolic links, if any, are resolved. + /// + Task ExecPathAsync { get; } + + /// + /// The process.argv property returns an array containing the command-line arguments passed + /// when the Node.js process was launched. The first element will be process.execPath. See + /// process.argv0 if access to the original value of argv[0] is needed. The second element + /// will be the path to the JavaScript file being executed. The remaining elements will be + /// any additional command-line arguments + /// + Task ArgvAsync { get; } + + /// + /// The process.execPath property returns the absolute pathname of the executable that + /// started the Node.js process. Symbolic links, if any, are resolved. + /// + Task TypeAsync { get; } + + /// + /// The process.versions property returns an object listing the version strings of + /// chrome and electron. + /// + Task VersionsAsync { get; } + + /// + /// A Boolean. When app is started by being passed as parameter to the default app, this + /// property is true in the main process, otherwise it is false. + /// + Task DefaultAppAsync { get; } + + /// + /// A Boolean, true when the current renderer context is the "main" renderer frame. If you + /// want the ID of the current frame you should use webFrame.routingId + /// + Task IsMainFrameAsync { get; } + + /// + /// A String representing the path to the resources directory. + /// + Task ResourcesPathAsync { get; } + + /// + /// The number of seconds the current Node.js process has been running. The return value + /// includes fractions of a second. Use Math.floor() to get whole seconds. + /// + Task UpTimeAsync { get; } + + /// + /// The PID of the electron process + /// + Task PidAsync { get; } + + /// + /// The operating system CPU architecture for which the Node.js binary was compiled + /// + Task ArchAsync { get; } + + /// + /// A string identifying the operating system platform on which the Node.js process is running + /// + Task PlatformAsync { get; } + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IScreen.cs b/ElectronNET.API/Interfaces/IScreen.cs new file mode 100755 index 00000000..cb51c360 --- /dev/null +++ b/ElectronNET.API/Interfaces/IScreen.cs @@ -0,0 +1,66 @@ +using System; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Retrieve information about screen size, displays, cursor position, etc. + /// + public interface IScreen + { + /// + /// Emitted when an new Display has been added. + /// + event Action OnDisplayAdded; + + /// + /// Emitted when oldDisplay has been removed. + /// + event Action OnDisplayRemoved; + + /// + /// Emitted when one or more metrics change in a display. + /// The changedMetrics is an array of strings that describe the changes. + /// Possible changes are bounds, workArea, scaleFactor and rotation. + /// + event Action OnDisplayMetricsChanged; + + /// + /// The current absolute position of the mouse pointer. + /// + /// + Task GetCursorScreenPointAsync(); + + /// + /// macOS: The height of the menu bar in pixels. + /// + /// The height of the menu bar in pixels. + Task GetMenuBarHeightAsync(); + + /// + /// The primary display. + /// + /// + Task GetPrimaryDisplayAsync(); + + /// + /// An array of displays that are currently available. + /// + /// An array of displays that are currently available. + Task GetAllDisplaysAsync(); + + /// + /// The display nearest the specified point. + /// + /// The display nearest the specified point. + Task GetDisplayNearestPointAsync(Point point); + + /// + /// The display that most closely intersects the provided bounds. + /// + /// + /// The display that most closely intersects the provided bounds. + Task GetDisplayMatchingAsync(Rectangle rectangle); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IShell.cs b/ElectronNET.API/Interfaces/IShell.cs new file mode 100755 index 00000000..605e3dda --- /dev/null +++ b/ElectronNET.API/Interfaces/IShell.cs @@ -0,0 +1,70 @@ +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Manage files and URLs using their default applications. + /// + public interface IShell + { + /// + /// Show the given file in a file manager. If possible, select the file. + /// + /// The full path to the directory / file. + Task ShowItemInFolderAsync(string fullPath); + + /// + /// Open the given file in the desktop's default manner. + /// + /// The path to the directory / file. + /// The error message corresponding to the failure if a failure occurred, otherwise . + Task OpenPathAsync(string path); + + /// + /// Open the given external protocol URL in the desktop’s default manner. + /// (For example, mailto: URLs in the user’s default mail agent). + /// + /// Max 2081 characters on windows. + /// The error message corresponding to the failure if a failure occurred, otherwise . + Task OpenExternalAsync(string url); + + /// + /// Open the given external protocol URL in the desktop’s default manner. + /// (For example, mailto: URLs in the user’s default mail agent). + /// + /// Max 2081 characters on windows. + /// Controls the behavior of OpenExternal. + /// The error message corresponding to the failure if a failure occurred, otherwise . + Task OpenExternalAsync(string url, OpenExternalOptions options); + + /// + /// Move the given file to trash and returns a status for the operation. + /// + /// The full path to the directory / file. + /// Whether the item was successfully moved to the trash. + Task TrashItemAsync(string fullPath); + + /// + /// Play the beep sound. + /// + void Beep(); + + /// + /// Creates or updates a shortcut link at shortcutPath. + /// + /// The path to the shortcut. + /// Default is + /// Structure of a shortcut. + /// Whether the shortcut was created successfully. + Task WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperation operation, ShortcutDetails options); + + /// + /// Resolves the shortcut link at shortcutPath. + /// An exception will be thrown when any error happens. + /// + /// The path tot the shortcut. + /// of the shortcut. + Task ReadShortcutLinkAsync(string shortcutPath); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/ITray.cs b/ElectronNET.API/Interfaces/ITray.cs new file mode 100755 index 00000000..42dd4ed6 --- /dev/null +++ b/ElectronNET.API/Interfaces/ITray.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Add icons and context menus to the system's notification area. + /// + public interface ITray + { + /// + /// Emitted when the tray icon is clicked. + /// + event Action OnClick; + + /// + /// macOS, Windows: Emitted when the tray icon is right clicked. + /// + event Action OnRightClick; + + /// + /// macOS, Windows: Emitted when the tray icon is double clicked. + /// + event Action OnDoubleClick; + + /// + /// Windows: Emitted when the tray balloon shows. + /// + event Action OnBalloonShow; + + /// + /// Windows: Emitted when the tray balloon is clicked. + /// + event Action OnBalloonClick; + + /// + /// Windows: Emitted when the tray balloon is closed + /// because of timeout or user manually closes it. + /// + event Action OnBalloonClosed; + + /// + /// Gets the menu items. + /// + /// + /// The menu items. + /// + IReadOnlyCollection MenuItems { get; } + + /// + /// Shows the Traybar. + /// + /// The image. + /// The menu item. + void Show(string image, MenuItem menuItem); + + /// + /// Shows the Traybar. + /// + /// The image. + /// The menu items. + void Show(string image, MenuItem[] menuItems); + + /// + /// Shows the Traybar (empty). + /// + /// The image. + void Show(string image); + + /// + /// Destroys the tray icon immediately. + /// + void Destroy(); + + /// + /// Sets the image associated with this tray icon. + /// + /// + void SetImage(string image); + + /// + /// Sets the image associated with this tray icon when pressed on macOS. + /// + /// + void SetPressedImage(string image); + + /// + /// Sets the hover text for this tray icon. + /// + /// + void SetToolTip(string toolTip); + + /// + /// macOS: Sets the title displayed aside of the tray icon in the status bar. + /// + /// + void SetTitle(string title); + + /// + /// Windows: Displays a tray balloon. + /// + /// + void DisplayBalloon(DisplayBalloonOptions options); + + /// + /// Whether the tray icon is destroyed. + /// + /// + Task IsDestroyedAsync(); + + /// + /// Subscribe to an unmapped event on the module. + /// + /// The event name + /// The handler + void On(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module. + /// + /// The event name + /// The handler + void On(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module once. + /// + /// The event name + /// The handler + void Once(string eventName, Action fn); + + /// + /// Subscribe to an unmapped event on the module once. + /// + /// The event name + /// The handler + void Once(string eventName, Action fn); + } +} \ No newline at end of file diff --git a/ElectronNET.API/Interfaces/IWindowManager.cs b/ElectronNET.API/Interfaces/IWindowManager.cs new file mode 100755 index 00000000..839b1fa8 --- /dev/null +++ b/ElectronNET.API/Interfaces/IWindowManager.cs @@ -0,0 +1,68 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using ElectronNET.API.Entities; + +namespace ElectronNET.API.Interfaces +{ + /// + /// Manage Browser Windows and Views + /// + public interface IWindowManager + { + /// + /// Quit when all windows are closed. (Default is true) + /// + /// + /// true if [quit window all closed]; otherwise, false. + /// + bool IsQuitOnWindowAllClosed { get; set; } + + /// + /// Gets the browser windows. + /// + /// + /// The browser windows. + /// + IReadOnlyCollection BrowserWindows { get; } + + /// + /// Gets the browser views. + /// + /// + /// The browser view. + /// + IReadOnlyCollection BrowserViews { get; } + + /// + /// Creates the window asynchronous. + /// + /// The load URL. + /// + Task CreateWindowAsync(string loadUrl = "http://localhost"); + + /// + /// Creates the window asynchronous. + /// + /// The options. + /// The load URL. + /// + Task CreateWindowAsync(BrowserWindowOptions options, string loadUrl = "http://localhost"); + + /// + /// A BrowserView can be used to embed additional web content into a BrowserWindow. + /// It is like a child window, except that it is positioned relative to its owning window. + /// It is meant to be an alternative to the webview tag. + /// + /// + Task CreateBrowserViewAsync(); + + /// + /// A BrowserView can be used to embed additional web content into a BrowserWindow. + /// It is like a child window, except that it is positioned relative to its owning window. + /// It is meant to be an alternative to the webview tag. + /// + /// + /// + Task CreateBrowserViewAsync(BrowserViewConstructorOptions options); + } +} \ No newline at end of file diff --git a/ElectronNET.API/IpcMain.cs b/ElectronNET.API/IpcMain.cs old mode 100644 new mode 100755 index 3e950c12..e84e46da --- a/ElectronNET.API/IpcMain.cs +++ b/ElectronNET.API/IpcMain.cs @@ -5,13 +5,14 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Communicate asynchronously from the main process to renderer processes. /// - public sealed class IpcMain + public sealed class IpcMain : IIpcMain { private static IpcMain _ipcMain; private static object _syncRoot = new object(); @@ -45,11 +46,11 @@ internal static IpcMain Instance /// Callback Method. public void On(string channel, Action listener) { - BridgeConnector.Socket.Emit("registerIpcMainChannel", channel); - BridgeConnector.Socket.Off(channel); - BridgeConnector.Socket.On(channel, (args) => + BridgeConnector.Emit("registerIpcMainChannel", channel); + BridgeConnector.Off(channel); + BridgeConnector.On(channel, (args) => { - List objectArray = FormatArguments(args); + var objectArray = FormatArguments(args); if(objectArray.Count == 1) { @@ -62,20 +63,9 @@ public void On(string channel, Action listener) }); } - private List FormatArguments(object args) + private List FormatArguments(object[] objectArray) { - List objectArray = ((JArray)args).ToObject().ToList(); - - for (int index = 0; index < objectArray.Count; index++) - { - var item = objectArray[index]; - if (item == null) - { - objectArray.Remove(item); - } - } - - return objectArray; + return objectArray.Where(o => o is object).ToList(); } /// @@ -89,9 +79,9 @@ private List FormatArguments(object args) /// public void OnSync(string channel, Func listener) { - BridgeConnector.Socket.Emit("registerSyncIpcMainChannel", channel); - BridgeConnector.Socket.On(channel, (args) => { - List objectArray = FormatArguments(args); + BridgeConnector.Emit("registerSyncIpcMainChannel", channel); + BridgeConnector.On(channel, (args) => { + var objectArray = FormatArguments(args); object parameter; if (objectArray.Count == 1) { @@ -103,7 +93,7 @@ public void OnSync(string channel, Func listener) } var result = listener(parameter); - BridgeConnector.Socket.Emit(channel + "Sync", result); + BridgeConnector.Emit(channel + "Sync", result); }); } @@ -115,10 +105,10 @@ public void OnSync(string channel, Func listener) /// Callback Method. public void Once(string channel, Action listener) { - BridgeConnector.Socket.Emit("registerOnceIpcMainChannel", channel); - BridgeConnector.Socket.On(channel, (args) => + BridgeConnector.Emit("registerOnceIpcMainChannel", channel); + BridgeConnector.On(channel, (args) => { - List objectArray = FormatArguments(args); + var objectArray = FormatArguments(args); if (objectArray.Count == 1) { @@ -137,7 +127,7 @@ public void Once(string channel, Action listener) /// Channelname. public void RemoveAllListeners(string channel) { - BridgeConnector.Socket.Emit("removeAllListenersIpcMainChannel", channel); + BridgeConnector.Emit("removeAllListenersIpcMainChannel", channel); } /// @@ -171,11 +161,11 @@ public void Send(BrowserWindow browserWindow, string channel, params object[] da if(jobjects.Count > 0 || jarrays.Count > 0) { - BridgeConnector.Socket.Emit("sendToIpcRenderer", JObject.FromObject(browserWindow, _jsonSerializer), channel, jarrays.ToArray(), jobjects.ToArray(), objects.ToArray()); + BridgeConnector.Emit("sendToIpcRenderer", JObject.FromObject(browserWindow, _jsonSerializer), channel, jarrays.ToArray(), jobjects.ToArray(), objects.ToArray()); } else { - BridgeConnector.Socket.Emit("sendToIpcRenderer", JObject.FromObject(browserWindow, _jsonSerializer), channel, data); + BridgeConnector.Emit("sendToIpcRenderer", JObject.FromObject(browserWindow, _jsonSerializer), channel, data); } } @@ -210,14 +200,35 @@ public void Send(BrowserView browserView, string channel, params object[] data) if(jobjects.Count > 0 || jarrays.Count > 0) { - BridgeConnector.Socket.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, jarrays.ToArray(), jobjects.ToArray(), objects.ToArray()); + BridgeConnector.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, jarrays.ToArray(), jobjects.ToArray(), objects.ToArray()); } else { - BridgeConnector.Socket.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, data); + BridgeConnector.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, data); } } + /// + /// Log a message to the console output pipe. This is used when running with "detachedProcess" : true on the electron.manifest.json, + /// as in that case we can't open pipes to read the console output from the child process anymore + /// + /// Message to log + public static void ConsoleLog(string text) + { + BridgeConnector.Emit("console-stdout", text); + } + + /// + /// Log a message to the console error pipe. This is used when running with "detachedProcess" : true on the electron.manifest.json, + /// as in that case we can't open pipes to read the console output from the child process anymore + /// + /// Message to log + + public static void ConsoleError(string text) + { + BridgeConnector.Emit("console-stderr", text); + } + private JsonSerializer _jsonSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver(), diff --git a/ElectronNET.API/LifetimeServiceHost.cs b/ElectronNET.API/LifetimeServiceHost.cs index cb58eb1b..c99392a5 100644 --- a/ElectronNET.API/LifetimeServiceHost.cs +++ b/ElectronNET.API/LifetimeServiceHost.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Hosting; +using Quobject.SocketIoClientDotNet.Client; namespace ElectronNET.API { @@ -12,10 +13,14 @@ internal class LifetimeServiceHost : IHostedService { public LifetimeServiceHost(IHostApplicationLifetime lifetime) { - lifetime.ApplicationStarted.Register(() => + lifetime.ApplicationStarted.Register(async () => { - App.Instance.IsReady = true; + // wait till the socket is open before setting app to ready + while(BridgeConnector.Socket.Io().ReadyState != Manager.ReadyStateEnum.OPEN) { + await Task.Delay(50).ConfigureAwait(false); + } + App.Instance.IsReady = true; Console.WriteLine("ASP.NET Core host has fully started."); }); } diff --git a/ElectronNET.API/Menu.cs b/ElectronNET.API/Menu.cs old mode 100644 new mode 100755 index 8397a10d..170655ab --- a/ElectronNET.API/Menu.cs +++ b/ElectronNET.API/Menu.cs @@ -6,13 +6,14 @@ using ElectronNET.API.Extensions; using System.Linq; using System.Collections.ObjectModel; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Create native application menus and context menus. /// - public sealed class Menu + public sealed class Menu : IMenu { private static Menu _menu; private static object _syncRoot = new object(); @@ -58,12 +59,12 @@ public void SetApplicationMenu(MenuItem[] menuItems) menuItems.AddMenuItemsId(); menuItems.AddSubmenuTypes(); - BridgeConnector.Socket.Emit("menu-setApplicationMenu", JArray.FromObject(menuItems, _jsonSerializer)); + BridgeConnector.Emit("menu-setApplicationMenu", JArray.FromObject(menuItems, _jsonSerializer)); _menuItems.AddRange(menuItems); - BridgeConnector.Socket.Off("menuItemClicked"); - BridgeConnector.Socket.On("menuItemClicked", (id) => { - MenuItem menuItem = _menuItems.GetMenuItem(id.ToString()); + BridgeConnector.Off("menuItemClicked"); + BridgeConnector.On("menuItemClicked", (id) => { + MenuItem menuItem = _menuItems.GetMenuItem(id); menuItem.Click?.Invoke(); }); } @@ -87,7 +88,7 @@ public void SetContextMenu(BrowserWindow browserWindow, MenuItem[] menuItems) menuItems.AddMenuItemsId(); menuItems.AddSubmenuTypes(); - BridgeConnector.Socket.Emit("menu-setContextMenu", browserWindow.Id, JArray.FromObject(menuItems, _jsonSerializer)); + BridgeConnector.Emit("menu-setContextMenu", browserWindow.Id, JArray.FromObject(menuItems, _jsonSerializer)); if (!_contextMenuItems.ContainsKey(browserWindow.Id)) { @@ -96,13 +97,10 @@ public void SetContextMenu(BrowserWindow browserWindow, MenuItem[] menuItems) ContextMenuItems = new ReadOnlyDictionary>(x); } - BridgeConnector.Socket.Off("contextMenuItemClicked"); - BridgeConnector.Socket.On("contextMenuItemClicked", (results) => + BridgeConnector.Off("contextMenuItemClicked"); + BridgeConnector.On("contextMenuItemClicked", (results) => { - var id = ((JArray)results).First.ToString(); - var browserWindowId = (int)((JArray)results).Last; - - MenuItem menuItem = _contextMenuItems[browserWindowId].GetMenuItem(id); + MenuItem menuItem = _contextMenuItems[results.windowId].GetMenuItem(results.id); menuItem.Click?.Invoke(); }); } @@ -113,7 +111,7 @@ public void SetContextMenu(BrowserWindow browserWindow, MenuItem[] menuItems) /// The browser window. public void ContextMenuPopup(BrowserWindow browserWindow) { - BridgeConnector.Socket.Emit("menu-contextMenuPopup", browserWindow.Id); + BridgeConnector.Emit("menu-contextMenuPopup", browserWindow.Id); } private JsonSerializer _jsonSerializer = new JsonSerializer() diff --git a/ElectronNET.API/MenuResponse.cs b/ElectronNET.API/MenuResponse.cs new file mode 100644 index 00000000..876a3634 --- /dev/null +++ b/ElectronNET.API/MenuResponse.cs @@ -0,0 +1,8 @@ +namespace ElectronNET.API +{ + internal class MenuResponse + { + public string id { get; set; } + public int windowId { get; set; } + } +} \ No newline at end of file diff --git a/ElectronNET.API/NativeTheme.cs b/ElectronNET.API/NativeTheme.cs old mode 100644 new mode 100755 index 037a97a6..d67ffd39 --- a/ElectronNET.API/NativeTheme.cs +++ b/ElectronNET.API/NativeTheme.cs @@ -2,13 +2,14 @@ using System.Threading.Tasks; using ElectronNET.API.Entities; using ElectronNET.API.Extensions; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Read and respond to changes in Chromium's native color theme. /// - public sealed class NativeTheme + public sealed class NativeTheme : INativeTheme { private static NativeTheme _nativeTheme; private static object _syncRoot = new object(); @@ -94,88 +95,33 @@ public void SetThemeSource(ThemeSourceMode themeSourceMode) { var themeSource = themeSourceMode.GetDescription(); - BridgeConnector.Socket.Emit("nativeTheme-themeSource", themeSource); + BridgeConnector.Emit("nativeTheme-themeSource", themeSource); } /// /// A property that can be , or . It is used to override () and /// supercede the value that Chromium has chosen to use internally. /// - public Task GetThemeSourceAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("nativeTheme-themeSource-getCompleted", (themeSource) => - { - BridgeConnector.Socket.Off("nativeTheme-themeSource-getCompleted"); - - var themeSourceValue = (ThemeSourceMode)Enum.Parse(typeof(ThemeSourceMode), (string)themeSource, true); - - taskCompletionSource.SetResult(themeSourceValue); - }); - - BridgeConnector.Socket.Emit("nativeTheme-themeSource-get"); - - return taskCompletionSource.Task; - } + public async Task GetThemeSourceAsync() => Enum.Parse(await BridgeConnector.OnResult("nativeTheme-themeSource-get", "nativeTheme-themeSource-getCompleted"), true); /// /// A for if the OS / Chromium currently has a dark mode enabled or is /// being instructed to show a dark-style UI. If you want to modify this value you /// should use . /// - public Task ShouldUseDarkColorsAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("nativeTheme-shouldUseDarkColors-completed", (shouldUseDarkColors) => { - BridgeConnector.Socket.Off("nativeTheme-shouldUseDarkColors-completed"); - - taskCompletionSource.SetResult((bool)shouldUseDarkColors); - }); - - BridgeConnector.Socket.Emit("nativeTheme-shouldUseDarkColors"); - - return taskCompletionSource.Task; - } + public Task ShouldUseDarkColorsAsync() => BridgeConnector.OnResult("nativeTheme-shouldUseDarkColors", "nativeTheme-shouldUseDarkColors-completed"); /// /// A for if the OS / Chromium currently has high-contrast mode enabled or is /// being instructed to show a high-contrast UI. /// - public Task ShouldUseHighContrastColorsAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("nativeTheme-shouldUseHighContrastColors-completed", (shouldUseHighContrastColors) => { - BridgeConnector.Socket.Off("nativeTheme-shouldUseHighContrastColors-completed"); - - taskCompletionSource.SetResult((bool)shouldUseHighContrastColors); - }); - - BridgeConnector.Socket.Emit("nativeTheme-shouldUseHighContrastColors"); - - return taskCompletionSource.Task; - } + public Task ShouldUseHighContrastColorsAsync() => BridgeConnector.OnResult("nativeTheme-shouldUseHighContrastColors", "nativeTheme-shouldUseHighContrastColors-completed"); /// /// A for if the OS / Chromium currently has an inverted color scheme or is /// being instructed to use an inverted color scheme. /// - public Task ShouldUseInvertedColorSchemeAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("nativeTheme-shouldUseInvertedColorScheme-completed", (shouldUseInvertedColorScheme) => { - BridgeConnector.Socket.Off("nativeTheme-shouldUseInvertedColorScheme-completed"); - - taskCompletionSource.SetResult((bool)shouldUseInvertedColorScheme); - }); - - BridgeConnector.Socket.Emit("nativeTheme-shouldUseInvertedColorScheme"); - - return taskCompletionSource.Task; - } + public Task ShouldUseInvertedColorSchemeAsync() => BridgeConnector.OnResult("nativeTheme-shouldUseInvertedColorScheme", "nativeTheme-shouldUseInvertedColorScheme-completed"); /// /// Emitted when something in the underlying NativeTheme has changed. This normally means that either the value of , @@ -187,12 +133,12 @@ public event Action Updated { if (_updated == null) { - BridgeConnector.Socket.On("nativeTheme-updated" + GetHashCode(), () => + BridgeConnector.On("nativeTheme-updated" + GetHashCode(), () => { _updated(); }); - BridgeConnector.Socket.Emit("register-nativeTheme-updated-event", GetHashCode()); + BridgeConnector.Emit("register-nativeTheme-updated-event", GetHashCode()); } _updated += value; } @@ -202,7 +148,7 @@ public event Action Updated if (_updated == null) { - BridgeConnector.Socket.Off("nativeTheme-updated" + GetHashCode()); + BridgeConnector.Off("nativeTheme-updated" + GetHashCode()); } } } diff --git a/ElectronNET.API/Notification.cs b/ElectronNET.API/Notification.cs old mode 100644 new mode 100755 index 68ac4e14..dc4d2b12 --- a/ElectronNET.API/Notification.cs +++ b/ElectronNET.API/Notification.cs @@ -6,13 +6,14 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Create OS desktop notifications /// - public sealed class Notification + public sealed class Notification : INotification { private static Notification _notification; private static object _syncRoot = new object(); @@ -48,7 +49,7 @@ public void Show(NotificationOptions notificationOptions) { GenerateIDsForDefinedActions(notificationOptions); - BridgeConnector.Socket.Emit("createNotification", JObject.FromObject(notificationOptions, _jsonSerializer)); + BridgeConnector.Emit("createNotification", notificationOptions); } private static void GenerateIDsForDefinedActions(NotificationOptions notificationOptions) @@ -60,9 +61,9 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio notificationOptions.ShowID = Guid.NewGuid().ToString(); isActionDefined = true; - BridgeConnector.Socket.Off("NotificationEventShow"); - BridgeConnector.Socket.On("NotificationEventShow", (id) => { - _notificationOptions.Single(x => x.ShowID == id.ToString()).OnShow(); + BridgeConnector.Off("NotificationEventShow"); + BridgeConnector.On("NotificationEventShow", (id) => { + _notificationOptions.Single(x => x.ShowID == id).OnShow(); }); } @@ -71,9 +72,9 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio notificationOptions.ClickID = Guid.NewGuid().ToString(); isActionDefined = true; - BridgeConnector.Socket.Off("NotificationEventClick"); - BridgeConnector.Socket.On("NotificationEventClick", (id) => { - _notificationOptions.Single(x => x.ClickID == id.ToString()).OnClick(); + BridgeConnector.Off("NotificationEventClick"); + BridgeConnector.On("NotificationEventClick", (id) => { + _notificationOptions.Single(x => x.ClickID == id).OnClick(); }); } @@ -82,8 +83,8 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio notificationOptions.CloseID = Guid.NewGuid().ToString(); isActionDefined = true; - BridgeConnector.Socket.Off("NotificationEventClose"); - BridgeConnector.Socket.On("NotificationEventClose", (id) => { + BridgeConnector.Off("NotificationEventClose"); + BridgeConnector.On("NotificationEventClose", (id) => { _notificationOptions.Single(x => x.CloseID == id.ToString()).OnClose(); }); } @@ -93,10 +94,9 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio notificationOptions.ReplyID = Guid.NewGuid().ToString(); isActionDefined = true; - BridgeConnector.Socket.Off("NotificationEventReply"); - BridgeConnector.Socket.On("NotificationEventReply", (args) => { - var arguments = ((JArray)args).ToObject(); - _notificationOptions.Single(x => x.ReplyID == arguments[0].ToString()).OnReply(arguments[1].ToString()); + BridgeConnector.Off("NotificationEventReply"); + BridgeConnector.On("NotificationEventReply", (args) => { + _notificationOptions.Single(x => x.ReplyID == args[0].ToString()).OnReply(args[1].ToString()); }); } @@ -105,10 +105,9 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio notificationOptions.ActionID = Guid.NewGuid().ToString(); isActionDefined = true; - BridgeConnector.Socket.Off("NotificationEventAction"); - BridgeConnector.Socket.On("NotificationEventAction", (args) => { - var arguments = ((JArray)args).ToObject(); - _notificationOptions.Single(x => x.ReplyID == arguments[0].ToString()).OnAction(arguments[1].ToString()); + BridgeConnector.Off("NotificationEventAction"); + BridgeConnector.On("NotificationEventAction", (args) => { + _notificationOptions.Single(x => x.ReplyID == args[0].ToString()).OnAction(args[1].ToString()); }); } @@ -124,24 +123,17 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio /// public Task IsSupportedAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("notificationIsSupportedComplete", (isSupported) => + BridgeConnector.On("notificationIsSupportedComplete", (isSupported) => { - BridgeConnector.Socket.Off("notificationIsSupportedComplete"); - taskCompletionSource.SetResult((bool)isSupported); + BridgeConnector.Off("notificationIsSupportedComplete"); + taskCompletionSource.SetResult(isSupported); }); - BridgeConnector.Socket.Emit("notificationIsSupported"); + BridgeConnector.Emit("notificationIsSupported"); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/PowerMonitor.cs b/ElectronNET.API/PowerMonitor.cs old mode 100644 new mode 100755 index 03e68748..b5ec6c14 --- a/ElectronNET.API/PowerMonitor.cs +++ b/ElectronNET.API/PowerMonitor.cs @@ -1,12 +1,13 @@ using System; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Monitor power state changes.. /// - public sealed class PowerMonitor + public sealed class PowerMonitor : IPowerMonitor { /// /// Emitted when the system is about to lock the screen. @@ -17,12 +18,12 @@ public event Action OnLockScreen { if (_lockScreen == null) { - BridgeConnector.Socket.On("pm-lock-screen" , () => + BridgeConnector.On("pm-lock-screen" , () => { _lockScreen(); }); - BridgeConnector.Socket.Emit("register-pm-lock-screen"); + BridgeConnector.Emit("register-pm-lock-screen"); } _lockScreen += value; } @@ -31,7 +32,7 @@ public event Action OnLockScreen _lockScreen -= value; if (_lockScreen == null) - BridgeConnector.Socket.Off("pm-lock-screen"); + BridgeConnector.Off("pm-lock-screen"); } } @@ -46,12 +47,12 @@ public event Action OnUnLockScreen { if (_unlockScreen == null) { - BridgeConnector.Socket.On("pm-unlock-screen", () => + BridgeConnector.On("pm-unlock-screen", () => { _unlockScreen(); }); - BridgeConnector.Socket.Emit("register-pm-unlock-screen"); + BridgeConnector.Emit("register-pm-unlock-screen"); } _unlockScreen += value; } @@ -60,7 +61,7 @@ public event Action OnUnLockScreen _unlockScreen -= value; if (_unlockScreen == null) - BridgeConnector.Socket.Off("pm-unlock-screen"); + BridgeConnector.Off("pm-unlock-screen"); } } @@ -75,12 +76,12 @@ public event Action OnSuspend { if (_suspend == null) { - BridgeConnector.Socket.On("pm-suspend", () => + BridgeConnector.On("pm-suspend", () => { _suspend(); }); - BridgeConnector.Socket.Emit("register-pm-suspend"); + BridgeConnector.Emit("register-pm-suspend"); } _suspend += value; } @@ -89,7 +90,7 @@ public event Action OnSuspend _suspend -= value; if (_suspend == null) - BridgeConnector.Socket.Off("pm-suspend"); + BridgeConnector.Off("pm-suspend"); } } @@ -104,12 +105,12 @@ public event Action OnResume { if (_resume == null) { - BridgeConnector.Socket.On("pm-resume", () => + BridgeConnector.On("pm-resume", () => { _resume(); }); - BridgeConnector.Socket.Emit("register-pm-resume"); + BridgeConnector.Emit("register-pm-resume"); } _resume += value; } @@ -118,7 +119,7 @@ public event Action OnResume _resume -= value; if (_resume == null) - BridgeConnector.Socket.Off("pm-resume"); + BridgeConnector.Off("pm-resume"); } } @@ -133,12 +134,12 @@ public event Action OnAC { if (_onAC == null) { - BridgeConnector.Socket.On("pm-on-ac", () => + BridgeConnector.On("pm-on-ac", () => { _onAC(); }); - BridgeConnector.Socket.Emit("register-pm-on-ac"); + BridgeConnector.Emit("register-pm-on-ac"); } _onAC += value; } @@ -147,7 +148,7 @@ public event Action OnAC _onAC -= value; if (_onAC == null) - BridgeConnector.Socket.Off("pm-on-ac"); + BridgeConnector.Off("pm-on-ac"); } } @@ -162,12 +163,12 @@ public event Action OnBattery { if (_onBattery == null) { - BridgeConnector.Socket.On("pm-on-battery", () => + BridgeConnector.On("pm-on-battery", () => { _onBattery(); }); - BridgeConnector.Socket.Emit("register-pm-on-battery"); + BridgeConnector.Emit("register-pm-on-battery"); } _onBattery += value; } @@ -176,7 +177,7 @@ public event Action OnBattery _onBattery -= value; if (_onBattery == null) - BridgeConnector.Socket.Off("pm-on-battery"); + BridgeConnector.Off("pm-on-battery"); } } @@ -195,12 +196,12 @@ public event Action OnShutdown { if (_shutdown == null) { - BridgeConnector.Socket.On("pm-shutdown", () => + BridgeConnector.On("pm-shutdown", () => { _shutdown(); }); - BridgeConnector.Socket.Emit("register-pm-shutdown"); + BridgeConnector.Emit("register-pm-shutdown"); } _shutdown += value; } @@ -209,7 +210,7 @@ public event Action OnShutdown _shutdown -= value; if (_shutdown == null) - BridgeConnector.Socket.Off("pm-on-shutdown"); + BridgeConnector.Off("pm-on-shutdown"); } } diff --git a/ElectronNET.API/Process.cs b/ElectronNET.API/Process.cs new file mode 100644 index 00000000..34cd72af --- /dev/null +++ b/ElectronNET.API/Process.cs @@ -0,0 +1,186 @@ +using System.Threading; +using System.Threading.Tasks; +using ElectronNET.API.Interfaces; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace ElectronNET.API +{ + /// + /// Electron's process object is extended from the Node.js process object. It adds the + /// events, properties, and methods. + /// + public sealed class Process : IProcess + { + internal Process() { } + + internal static Process Instance + { + get + { + if (_process == null) + { + lock (_syncRoot) + { + if (_process == null) + { + _process = new Process(); + } + } + } + + return _process; + } + } + + private static Process _process; + + private static readonly object _syncRoot = new(); + + /// + /// The process.execPath property returns the absolute pathname of the executable that + /// started the Node.js process. Symbolic links, if any, are resolved. + /// + public Task ExecPathAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-execPath", "process-execPath-Completed"); + } + } + + /// + /// The process.argv property returns an array containing the command-line arguments passed + /// when the Node.js process was launched. The first element will be process.execPath. See + /// process.argv0 if access to the original value of argv[0] is needed. The second element + /// will be the path to the JavaScript file being executed. The remaining elements will be + /// any additional command-line arguments + /// + public Task ArgvAsync + { + get + { + return BridgeConnector.GetArrayOverSocketAsync( + "process-argv", "process-argv-Completed"); + } + } + + /// + /// The process.execPath property returns the absolute pathname of the executable that + /// started the Node.js process. Symbolic links, if any, are resolved. + /// + public Task TypeAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-type", "process-type-Completed"); + } + } + + + /// + /// The process.versions property returns an object listing the version strings of + /// chrome and electron. + /// + public Task VersionsAsync + { + get + { + return BridgeConnector.GetObjectOverSocketAsync( + "process-versions", "process-versions-Completed"); + } + } + + + /// + /// A Boolean. When app is started by being passed as parameter to the default app, this + /// property is true in the main process, otherwise it is false. + /// + public Task DefaultAppAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-defaultApp", "process-defaultApp-Completed"); + } + } + + /// + /// A Boolean, true when the current renderer context is the "main" renderer frame. If you + /// want the ID of the current frame you should use webFrame.routingId + /// + public Task IsMainFrameAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-isMainFrame", "process-isMainFrame-Completed"); + } + } + + /// + /// A String representing the path to the resources directory. + /// + public Task ResourcesPathAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-resourcesPath", "process-resourcesPath-Completed"); + } + } + + /// + /// The number of seconds the current Node.js process has been running. The return value + /// includes fractions of a second. Use Math.floor() to get whole seconds. + /// + public Task UpTimeAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-uptime", "process-uptime-Completed"); + } + } + + /// + /// The PID of the electron process + /// + public Task PidAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-pid", "process-pid-Completed"); + } + } + + + /// + /// The operating system CPU architecture for which the Node.js binary was compiled + /// + public Task ArchAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-arch", "process-arch-Completed"); + } + } + + /// + /// A string identifying the operating system platform on which the Node.js process is running + /// + public Task PlatformAsync + { + get + { + return BridgeConnector.GetValueOverSocketAsync( + "process-platform", "process-platform-Completed"); + } + } + + } +} diff --git a/ElectronNET.API/Screen.cs b/ElectronNET.API/Screen.cs old mode 100644 new mode 100755 index 31cecb5f..1fa13d26 --- a/ElectronNET.API/Screen.cs +++ b/ElectronNET.API/Screen.cs @@ -4,13 +4,14 @@ using Newtonsoft.Json.Serialization; using System; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Retrieve information about screen size, displays, cursor position, etc. /// - public sealed class Screen + public sealed class Screen : IScreen { /// /// Emitted when an new Display has been added. @@ -21,12 +22,12 @@ public event Action OnDisplayAdded { if (_onDisplayAdded == null) { - BridgeConnector.Socket.On("screen-display-added-event" + GetHashCode(), (display) => + BridgeConnector.On("screen-display-added-event" + GetHashCode(), (display) => { - _onDisplayAdded(((JObject)display).ToObject()); + _onDisplayAdded(display); }); - BridgeConnector.Socket.Emit("register-screen-display-added", GetHashCode()); + BridgeConnector.Emit("register-screen-display-added", GetHashCode()); } _onDisplayAdded += value; } @@ -35,7 +36,7 @@ public event Action OnDisplayAdded _onDisplayAdded -= value; if (_onDisplayAdded == null) - BridgeConnector.Socket.Off("screen-display-added-event" + GetHashCode()); + BridgeConnector.Off("screen-display-added-event" + GetHashCode()); } } @@ -50,12 +51,12 @@ public event Action OnDisplayRemoved { if (_onDisplayRemoved == null) { - BridgeConnector.Socket.On("screen-display-removed-event" + GetHashCode(), (display) => + BridgeConnector.On("screen-display-removed-event" + GetHashCode(), (display) => { - _onDisplayRemoved(((JObject)display).ToObject()); + _onDisplayRemoved(display); }); - BridgeConnector.Socket.Emit("register-screen-display-removed", GetHashCode()); + BridgeConnector.Emit("register-screen-display-removed", GetHashCode()); } _onDisplayRemoved += value; } @@ -64,7 +65,7 @@ public event Action OnDisplayRemoved _onDisplayRemoved -= value; if (_onDisplayRemoved == null) - BridgeConnector.Socket.Off("screen-display-removed-event" + GetHashCode()); + BridgeConnector.Off("screen-display-removed-event" + GetHashCode()); } } @@ -81,15 +82,12 @@ public event Action OnDisplayMetricsChanged { if (_onDisplayMetricsChanged == null) { - BridgeConnector.Socket.On("screen-display-metrics-changed-event" + GetHashCode(), (args) => + BridgeConnector.On("screen-display-metrics-changed-event" + GetHashCode(), (args) => { - var display = ((JArray)args).First.ToObject(); - var metrics = ((JArray)args).Last.ToObject(); - - _onDisplayMetricsChanged(display, metrics); + _onDisplayMetricsChanged(args.display, args.metrics); }); - BridgeConnector.Socket.Emit("register-screen-display-metrics-changed", GetHashCode()); + BridgeConnector.Emit("register-screen-display-metrics-changed", GetHashCode()); } _onDisplayMetricsChanged += value; } @@ -98,7 +96,7 @@ public event Action OnDisplayMetricsChanged _onDisplayMetricsChanged -= value; if (_onDisplayMetricsChanged == null) - BridgeConnector.Socket.Off("screen-display-metrics-changed-event" + GetHashCode()); + BridgeConnector.Off("screen-display-metrics-changed-event" + GetHashCode()); } } @@ -132,128 +130,38 @@ internal static Screen Instance /// The current absolute position of the mouse pointer. /// /// - public Task GetCursorScreenPointAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("screen-getCursorScreenPointCompleted", (point) => - { - BridgeConnector.Socket.Off("screen-getCursorScreenPointCompleted"); - - taskCompletionSource.SetResult(((JObject)point).ToObject()); - }); - - BridgeConnector.Socket.Emit("screen-getCursorScreenPoint"); - - return taskCompletionSource.Task; - } + public Task GetCursorScreenPointAsync() => BridgeConnector.OnResult("screen-getCursorScreenPoint", "screen-getCursorScreenPointCompleted"); /// /// macOS: The height of the menu bar in pixels. /// /// The height of the menu bar in pixels. - public Task GetMenuBarHeightAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("screen-getMenuBarHeightCompleted", (height) => - { - BridgeConnector.Socket.Off("screen-getMenuBarHeightCompleted"); - - taskCompletionSource.SetResult(int.Parse(height.ToString())); - }); - - BridgeConnector.Socket.Emit("screen-getMenuBarHeight"); - - return taskCompletionSource.Task; - } + public Task GetMenuBarHeightAsync() => BridgeConnector.OnResult("screen-getMenuBarHeight", "screen-getMenuBarHeightCompleted"); /// /// The primary display. /// /// - public Task GetPrimaryDisplayAsync() - { - var taskCompletionSource = new TaskCompletionSource(); + public Task GetPrimaryDisplayAsync() => BridgeConnector.OnResult("screen-getPrimaryDisplay", "screen-getPrimaryDisplayCompleted"); - BridgeConnector.Socket.On("screen-getPrimaryDisplayCompleted", (display) => - { - BridgeConnector.Socket.Off("screen-getPrimaryDisplayCompleted"); - - taskCompletionSource.SetResult(((JObject)display).ToObject()); - }); - - BridgeConnector.Socket.Emit("screen-getPrimaryDisplay"); - - return taskCompletionSource.Task; - } /// /// An array of displays that are currently available. /// /// An array of displays that are currently available. - public Task GetAllDisplaysAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("screen-getAllDisplaysCompleted", (displays) => - { - BridgeConnector.Socket.Off("screen-getAllDisplaysCompleted"); - - taskCompletionSource.SetResult(((JArray)displays).ToObject()); - }); - - BridgeConnector.Socket.Emit("screen-getAllDisplays"); - - return taskCompletionSource.Task; - } + public Task GetAllDisplaysAsync() => BridgeConnector.OnResult("screen-getAllDisplays", "screen-getAllDisplaysCompleted"); /// /// The display nearest the specified point. /// /// The display nearest the specified point. - public Task GetDisplayNearestPointAsync(Point point) - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("screen-getDisplayNearestPointCompleted", (display) => - { - BridgeConnector.Socket.Off("screen-getDisplayNearestPointCompleted"); - - taskCompletionSource.SetResult(((JObject)display).ToObject()); - }); - - BridgeConnector.Socket.Emit("screen-getDisplayNearestPoint", JObject.FromObject(point, _jsonSerializer)); - - return taskCompletionSource.Task; - } + public Task GetDisplayNearestPointAsync(Point point) => BridgeConnector.OnResult("screen-getDisplayNearestPoint", "screen-getDisplayNearestPointCompleted", point); /// /// The display that most closely intersects the provided bounds. /// /// /// The display that most closely intersects the provided bounds. - public Task GetDisplayMatchingAsync(Rectangle rectangle) - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("screen-getDisplayMatching", (display) => - { - BridgeConnector.Socket.Off("screen-getDisplayMatching"); - - taskCompletionSource.SetResult(((JObject)display).ToObject()); - }); - - BridgeConnector.Socket.Emit("screen-getDisplayMatching", JObject.FromObject(rectangle, _jsonSerializer)); - - return taskCompletionSource.Task; - } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; + public Task GetDisplayMatchingAsync(Rectangle rectangle) => BridgeConnector.OnResult("screen-getDisplayMatching", "screen-getDisplayMatchingCompleted", rectangle); } } \ No newline at end of file diff --git a/ElectronNET.API/ServiceCollectionExtensions.cs b/ElectronNET.API/ServiceCollectionExtensions.cs old mode 100644 new mode 100755 index f933731b..d9a59747 --- a/ElectronNET.API/ServiceCollectionExtensions.cs +++ b/ElectronNET.API/ServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using ElectronNET.API.Interfaces; +using Microsoft.Extensions.DependencyInjection; namespace ElectronNET.API { @@ -13,6 +14,7 @@ public static class ServiceCollectionExtensions public static IServiceCollection AddElectron(this IServiceCollection services) => services // adding in this manner to ensure late binding. + // this set for backwards compatibility .AddSingleton(provider => IpcMain.Instance) .AddSingleton(provider => App.Instance) .AddSingleton(provider => AutoUpdater.Instance) @@ -28,6 +30,26 @@ public static IServiceCollection AddElectron(this IServiceCollection services) .AddSingleton(provider => HostHook.Instance) .AddSingleton(provider => PowerMonitor.Instance) .AddSingleton(provider => NativeTheme.Instance) - .AddSingleton(provider => Dock.Instance); + .AddSingleton(provider => Dock.Instance) + .AddSingleton(provider => new ApplicationSocket { Socket = BridgeConnector.Socket, }) + // this set for proper dependency injection + .AddSingleton(_ => IpcMain.Instance) + .AddSingleton(_ => App.Instance) + .AddSingleton(_ => AutoUpdater.Instance) + .AddSingleton(_ => WindowManager.Instance) + .AddSingleton(_ => Menu.Instance) + .AddSingleton(_ => Dialog.Instance) + .AddSingleton(_ => Notification.Instance) + .AddSingleton(_ => Tray.Instance) + .AddSingleton(_ => GlobalShortcut.Instance) + .AddSingleton(_ => Shell.Instance) + .AddSingleton(_ => Screen.Instance) + .AddSingleton(_ => Clipboard.Instance) + .AddSingleton(_ => HostHook.Instance) + .AddSingleton(_ => PowerMonitor.Instance) + .AddSingleton(_ => NativeTheme.Instance) + .AddSingleton(_ => Dock.Instance) + .AddSingleton(_ => Process.Instance) + .AddSingleton(provider => provider.GetService()); } } diff --git a/ElectronNET.API/Session.cs b/ElectronNET.API/Session.cs index a4cb6bb6..83bfa8fe 100644 --- a/ElectronNET.API/Session.cs +++ b/ElectronNET.API/Session.cs @@ -37,7 +37,7 @@ internal Session(int id) /// A comma-separated list of servers for which integrated authentication is enabled. public void AllowNTLMCredentialsForDomains(string domains) { - BridgeConnector.Socket.Emit("webContents-session-allowNTLMCredentialsForDomains", Id, domains); + BridgeConnector.Emit("webContents-session-allowNTLMCredentialsForDomains", Id, domains); } /// @@ -47,16 +47,16 @@ public void AllowNTLMCredentialsForDomains(string domains) /// public Task ClearAuthCacheAsync(RemovePassword options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearAuthCache-completed" + guid, () => + BridgeConnector.On("webContents-session-clearAuthCache-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearAuthCache-completed" + guid); + BridgeConnector.Off("webContents-session-clearAuthCache-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearAuthCache", Id, JObject.FromObject(options, _jsonSerializer), guid); + BridgeConnector.Emit("webContents-session-clearAuthCache", Id, options, guid); return taskCompletionSource.Task; } @@ -66,16 +66,16 @@ public Task ClearAuthCacheAsync(RemovePassword options) /// public Task ClearAuthCacheAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearAuthCache-completed" + guid, () => + BridgeConnector.On("webContents-session-clearAuthCache-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearAuthCache-completed" + guid); + BridgeConnector.Off("webContents-session-clearAuthCache-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearAuthCache", Id, guid); + BridgeConnector.Emit("webContents-session-clearAuthCache", Id, guid); return taskCompletionSource.Task; } @@ -86,16 +86,16 @@ public Task ClearAuthCacheAsync() /// public Task ClearCacheAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearCache-completed" + guid, () => + BridgeConnector.On("webContents-session-clearCache-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearCache-completed" + guid); + BridgeConnector.Off("webContents-session-clearCache-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearCache", Id, guid); + BridgeConnector.Emit("webContents-session-clearCache", Id, guid); return taskCompletionSource.Task; } @@ -106,16 +106,16 @@ public Task ClearCacheAsync() /// public Task ClearHostResolverCacheAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearHostResolverCache-completed" + guid, () => + BridgeConnector.On("webContents-session-clearHostResolverCache-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearHostResolverCache-completed" + guid); + BridgeConnector.Off("webContents-session-clearHostResolverCache-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearHostResolverCache", Id, guid); + BridgeConnector.Emit("webContents-session-clearHostResolverCache", Id, guid); return taskCompletionSource.Task; } @@ -126,16 +126,16 @@ public Task ClearHostResolverCacheAsync() /// public Task ClearStorageDataAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearStorageData-completed" + guid, () => + BridgeConnector.On("webContents-session-clearStorageData-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearStorageData-completed" + guid); + BridgeConnector.Off("webContents-session-clearStorageData-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearStorageData", Id, guid); + BridgeConnector.Emit("webContents-session-clearStorageData", Id, guid); return taskCompletionSource.Task; } @@ -147,16 +147,16 @@ public Task ClearStorageDataAsync() /// public Task ClearStorageDataAsync(ClearStorageDataOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-clearStorageData-options-completed" + guid, () => + BridgeConnector.On("webContents-session-clearStorageData-options-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-clearStorageData-options-completed" + guid); + BridgeConnector.Off("webContents-session-clearStorageData-options-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-clearStorageData-options", Id, JObject.FromObject(options, _jsonSerializer), guid); + BridgeConnector.Emit("webContents-session-clearStorageData-options", Id, options, guid); return taskCompletionSource.Task; } @@ -171,7 +171,7 @@ public Task ClearStorageDataAsync(ClearStorageDataOptions options) /// public void CreateInterruptedDownload(CreateInterruptedDownloadOptions options) { - BridgeConnector.Socket.Emit("webContents-session-createInterruptedDownload", Id, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("webContents-session-createInterruptedDownload", Id, options); } /// @@ -180,7 +180,7 @@ public void CreateInterruptedDownload(CreateInterruptedDownloadOptions options) /// public void DisableNetworkEmulation() { - BridgeConnector.Socket.Emit("webContents-session-disableNetworkEmulation", Id); + BridgeConnector.Emit("webContents-session-disableNetworkEmulation", Id); } /// @@ -189,7 +189,7 @@ public void DisableNetworkEmulation() /// public void EnableNetworkEmulation(EnableNetworkEmulationOptions options) { - BridgeConnector.Socket.Emit("webContents-session-enableNetworkEmulation", Id, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("webContents-session-enableNetworkEmulation", Id, options); } /// @@ -197,7 +197,7 @@ public void EnableNetworkEmulation(EnableNetworkEmulationOptions options) /// public void FlushStorageData() { - BridgeConnector.Socket.Emit("webContents-session-flushStorageData", Id); + BridgeConnector.Emit("webContents-session-flushStorageData", Id); } /// @@ -207,18 +207,16 @@ public void FlushStorageData() /// public Task GetBlobDataAsync(string identifier) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-getBlobData-completed" + guid, (buffer) => + BridgeConnector.On("webContents-session-getBlobData-completed" + guid, (buffer) => { - var result = ((JArray)buffer).ToObject(); - - BridgeConnector.Socket.Off("webContents-session-getBlobData-completed" + guid); - taskCompletionSource.SetResult(result); + BridgeConnector.Off("webContents-session-getBlobData-completed" + guid); + taskCompletionSource.SetResult(buffer); }); - BridgeConnector.Socket.Emit("webContents-session-getBlobData", Id, identifier, guid); + BridgeConnector.Emit("webContents-session-getBlobData", Id, identifier, guid); return taskCompletionSource.Task; } @@ -229,16 +227,16 @@ public Task GetBlobDataAsync(string identifier) /// Callback is invoked with the session's current cache size. public Task GetCacheSizeAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-getCacheSize-completed" + guid, (size) => + BridgeConnector.On("webContents-session-getCacheSize-completed" + guid, (size) => { - BridgeConnector.Socket.Off("webContents-session-getCacheSize-completed" + guid); - taskCompletionSource.SetResult((int)size); + BridgeConnector.Off("webContents-session-getCacheSize-completed" + guid); + taskCompletionSource.SetResult(size); }); - BridgeConnector.Socket.Emit("webContents-session-getCacheSize", Id, guid); + BridgeConnector.Emit("webContents-session-getCacheSize", Id, guid); return taskCompletionSource.Task; } @@ -249,17 +247,16 @@ public Task GetCacheSizeAsync() /// public Task GetPreloadsAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-getPreloads-completed" + guid, (preloads) => + BridgeConnector.On("webContents-session-getPreloads-completed" + guid, (preloads) => { - var result = ((JArray)preloads).ToObject(); - BridgeConnector.Socket.Off("webContents-session-getPreloads-completed" + guid); - taskCompletionSource.SetResult(result); + BridgeConnector.Off("webContents-session-getPreloads-completed" + guid); + taskCompletionSource.SetResult(preloads); }); - BridgeConnector.Socket.Emit("webContents-session-getPreloads", Id, guid); + BridgeConnector.Emit("webContents-session-getPreloads", Id, guid); return taskCompletionSource.Task; } @@ -270,16 +267,16 @@ public Task GetPreloadsAsync() /// public Task GetUserAgent() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-getUserAgent-completed" + guid, (userAgent) => + BridgeConnector.On("webContents-session-getUserAgent-completed" + guid, (userAgent) => { - BridgeConnector.Socket.Off("webContents-session-getUserAgent-completed" + guid); + BridgeConnector.Off("webContents-session-getUserAgent-completed" + guid); taskCompletionSource.SetResult(userAgent.ToString()); }); - BridgeConnector.Socket.Emit("webContents-session-getUserAgent", Id, guid); + BridgeConnector.Emit("webContents-session-getUserAgent", Id, guid); return taskCompletionSource.Task; } @@ -292,16 +289,16 @@ public Task GetUserAgent() /// public Task ResolveProxyAsync(string url) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-resolveProxy-completed" + guid, (proxy) => + BridgeConnector.On("webContents-session-resolveProxy-completed" + guid, (proxy) => { - BridgeConnector.Socket.Off("webContents-session-resolveProxy-completed" + guid); + BridgeConnector.Off("webContents-session-resolveProxy-completed" + guid); taskCompletionSource.SetResult(proxy.ToString()); }); - BridgeConnector.Socket.Emit("webContents-session-resolveProxy", Id, url, guid); + BridgeConnector.Emit("webContents-session-resolveProxy", Id, url, guid); return taskCompletionSource.Task; } @@ -313,7 +310,7 @@ public Task ResolveProxyAsync(string url) /// public void SetDownloadPath(string path) { - BridgeConnector.Socket.Emit("webContents-session-setDownloadPath", Id, path); + BridgeConnector.Emit("webContents-session-setDownloadPath", Id, path); } /// @@ -323,7 +320,7 @@ public void SetDownloadPath(string path) /// public void SetPreloads(string[] preloads) { - BridgeConnector.Socket.Emit("webContents-session-setPreloads", Id, preloads); + BridgeConnector.Emit("webContents-session-setPreloads", Id, preloads); } /// @@ -334,16 +331,16 @@ public void SetPreloads(string[] preloads) /// public Task SetProxyAsync(ProxyConfig config) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); - BridgeConnector.Socket.On("webContents-session-setProxy-completed" + guid, () => + BridgeConnector.On("webContents-session-setProxy-completed" + guid, () => { - BridgeConnector.Socket.Off("webContents-session-setProxy-completed" + guid); + BridgeConnector.Off("webContents-session-setProxy-completed" + guid); taskCompletionSource.SetResult(null); }); - BridgeConnector.Socket.Emit("webContents-session-setProxy", Id, JObject.FromObject(config, _jsonSerializer), guid); + BridgeConnector.Emit("webContents-session-setProxy", Id, config, guid); return taskCompletionSource.Task; } @@ -356,7 +353,7 @@ public Task SetProxyAsync(ProxyConfig config) /// public void SetUserAgent(string userAgent) { - BridgeConnector.Socket.Emit("webContents-session-setUserAgent", Id, userAgent); + BridgeConnector.Emit("webContents-session-setUserAgent", Id, userAgent); } /// @@ -372,7 +369,7 @@ public void SetUserAgent(string userAgent) /// example "en-US,fr,de,ko,zh-CN,ja". public void SetUserAgent(string userAgent, string acceptLanguages) { - BridgeConnector.Socket.Emit("webContents-session-setUserAgent", Id, userAgent, acceptLanguages); + BridgeConnector.Emit("webContents-session-setUserAgent", Id, userAgent, acceptLanguages); } /// @@ -382,17 +379,15 @@ public void SetUserAgent(string userAgent, string acceptLanguages) /// public Task GetAllExtensionsAsync() { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("webContents-session-getAllExtensions-completed", (extensionslist) => + BridgeConnector.On("webContents-session-getAllExtensions-completed", (extensionslist) => { - BridgeConnector.Socket.Off("webContents-session-getAllExtensions-completed"); - var chromeExtensionInfos = ((JArray)extensionslist).ToObject(); - - taskCompletionSource.SetResult(chromeExtensionInfos); + BridgeConnector.Off("webContents-session-getAllExtensions-completed"); + taskCompletionSource.SetResult(extensionslist); }); - BridgeConnector.Socket.Emit("webContents-session-getAllExtensions", Id); + BridgeConnector.Emit("webContents-session-getAllExtensions", Id); return taskCompletionSource.Task; } @@ -404,7 +399,7 @@ public Task GetAllExtensionsAsync() /// Name of the Chrome extension to remove public void RemoveExtension(string name) { - BridgeConnector.Socket.Emit("webContents-session-removeExtension", Id, name); + BridgeConnector.Emit("webContents-session-removeExtension", Id, name); } /// @@ -436,25 +431,18 @@ public void RemoveExtension(string name) /// public Task LoadExtensionAsync(string path, bool allowFileAccess = false) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("webContents-session-loadExtension-completed", (extension) => + BridgeConnector.On("webContents-session-loadExtension-completed", (extension) => { - BridgeConnector.Socket.Off("webContents-session-loadExtension-completed"); + BridgeConnector.Off("webContents-session-loadExtension-completed"); - taskCompletionSource.SetResult(((JObject)extension).ToObject()); + taskCompletionSource.SetResult(extension); }); - BridgeConnector.Socket.Emit("webContents-session-loadExtension", Id, path, allowFileAccess); + BridgeConnector.Emit("webContents-session-loadExtension", Id, path, allowFileAccess); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/Shell.cs b/ElectronNET.API/Shell.cs old mode 100644 new mode 100755 index 71f458e4..cfb843d8 --- a/ElectronNET.API/Shell.cs +++ b/ElectronNET.API/Shell.cs @@ -4,13 +4,14 @@ using Newtonsoft.Json.Serialization; using System.Threading.Tasks; using ElectronNET.API.Extensions; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Manage files and URLs using their default applications. /// - public sealed class Shell + public sealed class Shell : IShell { private static Shell _shell; private static object _syncRoot = new object(); @@ -42,14 +43,14 @@ internal static Shell Instance /// The full path to the directory / file. public Task ShowItemInFolderAsync(string fullPath) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("shell-showItemInFolderCompleted", () => + BridgeConnector.On("shell-showItemInFolderCompleted", () => { - BridgeConnector.Socket.Off("shell-showItemInFolderCompleted"); + BridgeConnector.Off("shell-showItemInFolderCompleted"); }); - BridgeConnector.Socket.Emit("shell-showItemInFolder", fullPath); + BridgeConnector.Emit("shell-showItemInFolder", fullPath); return taskCompletionSource.Task; } @@ -61,16 +62,16 @@ public Task ShowItemInFolderAsync(string fullPath) /// The error message corresponding to the failure if a failure occurred, otherwise . public Task OpenPathAsync(string path) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("shell-openPathCompleted", (errorMessage) => + BridgeConnector.On("shell-openPathCompleted", (errorMessage) => { - BridgeConnector.Socket.Off("shell-openPathCompleted"); + BridgeConnector.Off("shell-openPathCompleted"); - taskCompletionSource.SetResult((string) errorMessage); + taskCompletionSource.SetResult(errorMessage); }); - BridgeConnector.Socket.Emit("shell-openPath", path); + BridgeConnector.Emit("shell-openPath", path); return taskCompletionSource.Task; } @@ -95,22 +96,22 @@ public Task OpenExternalAsync(string url) /// The error message corresponding to the failure if a failure occurred, otherwise . public Task OpenExternalAsync(string url, OpenExternalOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("shell-openExternalCompleted", (error) => + BridgeConnector.On("shell-openExternalCompleted", (error) => { - BridgeConnector.Socket.Off("shell-openExternalCompleted"); + BridgeConnector.Off("shell-openExternalCompleted"); - taskCompletionSource.SetResult((string) error); + taskCompletionSource.SetResult(error); }); if (options == null) { - BridgeConnector.Socket.Emit("shell-openExternal", url); + BridgeConnector.Emit("shell-openExternal", url); } else { - BridgeConnector.Socket.Emit("shell-openExternal", url, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("shell-openExternal", url, options); } return taskCompletionSource.Task; @@ -123,18 +124,7 @@ public Task OpenExternalAsync(string url, OpenExternalOptions options) /// Whether the item was successfully moved to the trash. public Task TrashItemAsync(string fullPath) { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("shell-trashItem-completed", (success) => - { - BridgeConnector.Socket.Off("shell-trashItem-completed"); - - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("shell-trashItem", fullPath); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("shell-trashItem", "shell-trashItem-completed", fullPath); } /// @@ -142,7 +132,7 @@ public Task TrashItemAsync(string fullPath) /// public void Beep() { - BridgeConnector.Socket.Emit("shell-beep"); + BridgeConnector.Emit("shell-beep"); } /// @@ -154,18 +144,7 @@ public void Beep() /// Whether the shortcut was created successfully. public Task WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperation operation, ShortcutDetails options) { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("shell-writeShortcutLinkCompleted", (success) => - { - BridgeConnector.Socket.Off("shell-writeShortcutLinkCompleted"); - - taskCompletionSource.SetResult((bool) success); - }); - - BridgeConnector.Socket.Emit("shell-writeShortcutLink", shortcutPath, operation.GetDescription(), JObject.FromObject(options, _jsonSerializer)); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("shell-writeShortcutLink", "shell-writeShortcutLinkCompleted", shortcutPath, operation.GetDescription(), options); } /// @@ -176,28 +155,7 @@ public Task WriteShortcutLinkAsync(string shortcutPath, ShortcutLinkOperat /// of the shortcut. public Task ReadShortcutLinkAsync(string shortcutPath) { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("shell-readShortcutLinkCompleted", (shortcutDetails) => - { - BridgeConnector.Socket.Off("shell-readShortcutLinkCompleted"); - - var shortcutObject = shortcutDetails as JObject; - var details = shortcutObject?.ToObject(); - - taskCompletionSource.SetResult(details); - }); - - BridgeConnector.Socket.Emit("shell-readShortcutLink", shortcutPath); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("shell-readShortcutLink", "shell-readShortcutLinkCompleted", shortcutPath); } - - private readonly JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/Tray.cs b/ElectronNET.API/Tray.cs old mode 100644 new mode 100755 index a5aac8a1..b8914015 --- a/ElectronNET.API/Tray.cs +++ b/ElectronNET.API/Tray.cs @@ -6,13 +6,14 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// Add icons and context menus to the system's notification area. /// - public sealed class Tray + public sealed class Tray : ITray { /// /// Emitted when the tray icon is clicked. @@ -23,15 +24,12 @@ public event Action OnClick { if (_click == null) { - BridgeConnector.Socket.On("tray-click-event" + GetHashCode(), (result) => + BridgeConnector.On("tray-click-event" + GetHashCode(), (result) => { - var args = ((JArray)result).ToObject(); - var trayClickEventArgs = ((JObject)args[0]).ToObject(); - var bounds = ((JObject)args[1]).ToObject(); - _click(trayClickEventArgs, bounds); + _click(result.eventArgs, result.bounds); }); - BridgeConnector.Socket.Emit("register-tray-click", GetHashCode()); + BridgeConnector.Emit("register-tray-click", GetHashCode()); } _click += value; } @@ -40,7 +38,7 @@ public event Action OnClick _click -= value; if (_click == null) - BridgeConnector.Socket.Off("tray-click-event" + GetHashCode()); + BridgeConnector.Off("tray-click-event" + GetHashCode()); } } @@ -55,15 +53,12 @@ public event Action OnRightClick { if (_rightClick == null) { - BridgeConnector.Socket.On("tray-right-click-event" + GetHashCode(), (result) => + BridgeConnector.On("tray-right-click-event" + GetHashCode(), (result) => { - var args = ((JArray)result).ToObject(); - var trayClickEventArgs = ((JObject)args[0]).ToObject(); - var bounds = ((JObject)args[1]).ToObject(); - _rightClick(trayClickEventArgs, bounds); + _rightClick(result.eventArgs, result.bounds); }); - BridgeConnector.Socket.Emit("register-tray-right-click", GetHashCode()); + BridgeConnector.Emit("register-tray-right-click", GetHashCode()); } _rightClick += value; } @@ -72,7 +67,7 @@ public event Action OnRightClick _rightClick -= value; if (_rightClick == null) - BridgeConnector.Socket.Off("tray-right-click-event" + GetHashCode()); + BridgeConnector.Off("tray-right-click-event" + GetHashCode()); } } @@ -87,15 +82,12 @@ public event Action OnDoubleClick { if (_doubleClick == null) { - BridgeConnector.Socket.On("tray-double-click-event" + GetHashCode(), (result) => + BridgeConnector.On("tray-double-click-event" + GetHashCode(), (result) => { - var args = ((JArray)result).ToObject(); - var trayClickEventArgs = ((JObject)args[0]).ToObject(); - var bounds = ((JObject)args[1]).ToObject(); - _doubleClick(trayClickEventArgs, bounds); + _doubleClick(result.eventArgs, result.bounds); }); - BridgeConnector.Socket.Emit("register-tray-double-click", GetHashCode()); + BridgeConnector.Emit("register-tray-double-click", GetHashCode()); } _doubleClick += value; } @@ -104,7 +96,7 @@ public event Action OnDoubleClick _doubleClick -= value; if (_doubleClick == null) - BridgeConnector.Socket.Off("tray-double-click-event" + GetHashCode()); + BridgeConnector.Off("tray-double-click-event" + GetHashCode()); } } @@ -119,12 +111,12 @@ public event Action OnBalloonShow { if (_balloonShow == null) { - BridgeConnector.Socket.On("tray-balloon-show-event" + GetHashCode(), () => + BridgeConnector.On("tray-balloon-show-event" + GetHashCode(), () => { _balloonShow(); }); - BridgeConnector.Socket.Emit("register-tray-balloon-show", GetHashCode()); + BridgeConnector.Emit("register-tray-balloon-show", GetHashCode()); } _balloonShow += value; } @@ -133,7 +125,7 @@ public event Action OnBalloonShow _balloonShow -= value; if (_balloonShow == null) - BridgeConnector.Socket.Off("tray-balloon-show-event" + GetHashCode()); + BridgeConnector.Off("tray-balloon-show-event" + GetHashCode()); } } @@ -148,12 +140,12 @@ public event Action OnBalloonClick { if (_balloonClick == null) { - BridgeConnector.Socket.On("tray-balloon-click-event" + GetHashCode(), () => + BridgeConnector.On("tray-balloon-click-event" + GetHashCode(), () => { _balloonClick(); }); - BridgeConnector.Socket.Emit("register-tray-balloon-click", GetHashCode()); + BridgeConnector.Emit("register-tray-balloon-click", GetHashCode()); } _balloonClick += value; } @@ -162,7 +154,7 @@ public event Action OnBalloonClick _balloonClick -= value; if (_balloonClick == null) - BridgeConnector.Socket.Off("tray-balloon-click-event" + GetHashCode()); + BridgeConnector.Off("tray-balloon-click-event" + GetHashCode()); } } @@ -178,12 +170,12 @@ public event Action OnBalloonClosed { if (_balloonClosed == null) { - BridgeConnector.Socket.On("tray-balloon-closed-event" + GetHashCode(), () => + BridgeConnector.On("tray-balloon-closed-event" + GetHashCode(), () => { _balloonClosed(); }); - BridgeConnector.Socket.Emit("register-tray-balloon-closed", GetHashCode()); + BridgeConnector.Emit("register-tray-balloon-closed", GetHashCode()); } _balloonClosed += value; } @@ -192,7 +184,7 @@ public event Action OnBalloonClosed _balloonClosed -= value; if (_balloonClosed == null) - BridgeConnector.Socket.Off("tray-balloon-closed-event" + GetHashCode()); + BridgeConnector.Off("tray-balloon-closed-event" + GetHashCode()); } } @@ -251,12 +243,12 @@ public void Show(string image, MenuItem menuItem) public void Show(string image, MenuItem[] menuItems) { menuItems.AddMenuItemsId(); - BridgeConnector.Socket.Emit("create-tray", image, JArray.FromObject(menuItems, _jsonSerializer)); + BridgeConnector.Emit("create-tray", image, JArray.FromObject(menuItems, _jsonSerializer)); _items.Clear(); _items.AddRange(menuItems); - BridgeConnector.Socket.Off("trayMenuItemClicked"); - BridgeConnector.Socket.On("trayMenuItemClicked", (id) => + BridgeConnector.Off("trayMenuItemClicked"); + BridgeConnector.On("trayMenuItemClicked", (id) => { MenuItem menuItem = _items.GetMenuItem(id.ToString()); menuItem?.Click(); @@ -269,7 +261,7 @@ public void Show(string image, MenuItem[] menuItems) /// The image. public void Show(string image) { - BridgeConnector.Socket.Emit("create-tray", image); + BridgeConnector.Emit("create-tray", image); } /// @@ -277,7 +269,7 @@ public void Show(string image) /// public void Destroy() { - BridgeConnector.Socket.Emit("tray-destroy"); + BridgeConnector.Emit("tray-destroy"); _items.Clear(); } @@ -287,7 +279,7 @@ public void Destroy() /// public void SetImage(string image) { - BridgeConnector.Socket.Emit("tray-setImage", image); + BridgeConnector.Emit("tray-setImage", image); } /// @@ -296,7 +288,7 @@ public void SetImage(string image) /// public void SetPressedImage(string image) { - BridgeConnector.Socket.Emit("tray-setPressedImage", image); + BridgeConnector.Emit("tray-setPressedImage", image); } /// @@ -305,7 +297,7 @@ public void SetPressedImage(string image) /// public void SetToolTip(string toolTip) { - BridgeConnector.Socket.Emit("tray-setToolTip", toolTip); + BridgeConnector.Emit("tray-setToolTip", toolTip); } /// @@ -314,7 +306,7 @@ public void SetToolTip(string toolTip) /// public void SetTitle(string title) { - BridgeConnector.Socket.Emit("tray-setTitle", title); + BridgeConnector.Emit("tray-setTitle", title); } /// @@ -323,63 +315,49 @@ public void SetTitle(string title) /// public void DisplayBalloon(DisplayBalloonOptions options) { - BridgeConnector.Socket.Emit("tray-displayBalloon", JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("tray-displayBalloon", options); } /// /// Whether the tray icon is destroyed. /// /// - public Task IsDestroyedAsync() - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("tray-isDestroyedCompleted", (isDestroyed) => - { - BridgeConnector.Socket.Off("tray-isDestroyedCompleted"); - - taskCompletionSource.SetResult((bool)isDestroyed); - }); - - BridgeConnector.Socket.Emit("tray-isDestroyed"); - - return taskCompletionSource.Task; - } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore - }; + public Task IsDestroyedAsync() => BridgeConnector.OnResult("tray-isDestroyed", "tray-isDestroyedCompleted"); private const string ModuleName = "tray"; + /// /// Subscribe to an unmapped event on the module. /// /// The event name /// The handler - public void On(string eventName, Action fn) - => Events.Instance.On(ModuleName, eventName, fn); + public void On(string eventName, Action fn) => Events.Instance.On(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module. /// /// The event name /// The handler - public void On(string eventName, Action fn) - => Events.Instance.On(ModuleName, eventName, fn); + public void On(string eventName, Action fn) => Events.Instance.On(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler - public void Once(string eventName, Action fn) - => Events.Instance.Once(ModuleName, eventName, fn); + public void Once(string eventName, Action fn) => Events.Instance.Once(ModuleName, eventName, fn); + /// /// Subscribe to an unmapped event on the module once. /// /// The event name /// The handler - public void Once(string eventName, Action fn) - => Events.Instance.Once(ModuleName, eventName, fn); + public void Once(string eventName, Action fn) => Events.Instance.Once(ModuleName, eventName, fn); + + private JsonSerializer _jsonSerializer = new JsonSerializer() + { + ContractResolver = new CamelCasePropertyNamesContractResolver(), + NullValueHandling = NullValueHandling.Ignore + }; } } diff --git a/ElectronNET.API/WebContents.cs b/ElectronNET.API/WebContents.cs index 66800d5f..c91a3177 100644 --- a/ElectronNET.API/WebContents.cs +++ b/ElectronNET.API/WebContents.cs @@ -34,12 +34,12 @@ public event Action OnCrashed { if (_crashed == null) { - BridgeConnector.Socket.On("webContents-crashed" + Id, (killed) => + BridgeConnector.On("webContents-crashed" + Id, (killed) => { - _crashed((bool)killed); + _crashed(killed); }); - BridgeConnector.Socket.Emit("register-webContents-crashed", Id); + BridgeConnector.Emit("register-webContents-crashed", Id); } _crashed += value; } @@ -48,7 +48,7 @@ public event Action OnCrashed _crashed -= value; if (_crashed == null) - BridgeConnector.Socket.Off("webContents-crashed" + Id); + BridgeConnector.Off("webContents-crashed" + Id); } } @@ -64,12 +64,12 @@ public event Action OnDidFinishLoad { if (_didFinishLoad == null) { - BridgeConnector.Socket.On("webContents-didFinishLoad" + Id, () => + BridgeConnector.On("webContents-didFinishLoad" + Id, () => { _didFinishLoad(); }); - BridgeConnector.Socket.Emit("register-webContents-didFinishLoad", Id); + BridgeConnector.Emit("register-webContents-didFinishLoad", Id); } _didFinishLoad += value; } @@ -78,7 +78,7 @@ public event Action OnDidFinishLoad _didFinishLoad -= value; if (_didFinishLoad == null) - BridgeConnector.Socket.Off("webContents-didFinishLoad" + Id); + BridgeConnector.Off("webContents-didFinishLoad" + Id); } } @@ -95,7 +95,7 @@ internal WebContents(int id) /// public void OpenDevTools() { - BridgeConnector.Socket.Emit("webContentsOpenDevTools", Id); + BridgeConnector.Emit("webContentsOpenDevTools", Id); } /// @@ -104,7 +104,7 @@ public void OpenDevTools() /// public void OpenDevTools(OpenDevToolsOptions openDevToolsOptions) { - BridgeConnector.Socket.Emit("webContentsOpenDevTools", Id, JObject.FromObject(openDevToolsOptions, _jsonSerializer)); + BridgeConnector.Emit("webContentsOpenDevTools", Id, openDevToolsOptions); } /// @@ -113,18 +113,7 @@ public void OpenDevTools(OpenDevToolsOptions openDevToolsOptions) /// printers public Task GetPrintersAsync() { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("webContents-getPrinters-completed", (printers) => - { - BridgeConnector.Socket.Off("webContents-getPrinters-completed"); - - taskCompletionSource.SetResult(((Newtonsoft.Json.Linq.JArray)printers).ToObject()); - }); - - BridgeConnector.Socket.Emit("webContents-getPrinters", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("webContents-getPrinters", "webContents-getPrinters-completed" + Id, Id); } /// @@ -132,27 +121,8 @@ public Task GetPrintersAsync() /// /// /// success - public Task PrintAsync(PrintOptions options = null) - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("webContents-print-completed", (success) => - { - BridgeConnector.Socket.Off("webContents-print-completed"); - taskCompletionSource.SetResult((bool)success); - }); - - if(options == null) - { - BridgeConnector.Socket.Emit("webContents-print", Id, ""); - } - else - { - BridgeConnector.Socket.Emit("webContents-print", Id, JObject.FromObject(options, _jsonSerializer)); - } - - return taskCompletionSource.Task; - } + public Task PrintAsync(PrintOptions options = null) => options is null ? BridgeConnector.OnResult("webContents-print", "webContents-print-completed" + Id, Id, "") + : BridgeConnector.OnResult("webContents-print", "webContents-print-completed" + Id, Id, options); /// /// Prints window's web page as PDF with Chromium's preview printing custom @@ -163,27 +133,8 @@ public Task PrintAsync(PrintOptions options = null) /// /// /// success - public Task PrintToPDFAsync(string path, PrintToPDFOptions options = null) - { - var taskCompletionSource = new TaskCompletionSource(); - - BridgeConnector.Socket.On("webContents-printToPDF-completed", (success) => - { - BridgeConnector.Socket.Off("webContents-printToPDF-completed"); - taskCompletionSource.SetResult((bool)success); - }); - - if(options == null) - { - BridgeConnector.Socket.Emit("webContents-printToPDF", Id, "", path); - } - else - { - BridgeConnector.Socket.Emit("webContents-printToPDF", Id, JObject.FromObject(options, _jsonSerializer), path); - } - - return taskCompletionSource.Task; - } + public Task PrintToPDFAsync(string path, PrintToPDFOptions options = null) => options is null ? BridgeConnector.OnResult("webContents-printToPDF", "webContents-printToPDF-completed" + Id, Id, "", path) + : BridgeConnector.OnResult("webContents-printToPDF", "webContents-printToPDF-completed" + Id, Id, options, path); /// /// Is used to get the Url of the loaded page. @@ -192,18 +143,7 @@ public Task PrintToPDFAsync(string path, PrintToPDFOptions options = null) /// URL of the loaded page public Task GetUrl() { - var taskCompletionSource = new TaskCompletionSource(); - - var eventString = "webContents-getUrl" + Id; - BridgeConnector.Socket.On(eventString, (url) => - { - BridgeConnector.Socket.Off(eventString); - taskCompletionSource.SetResult((string)url); - }); - - BridgeConnector.Socket.Emit("webContents-getUrl", Id); - - return taskCompletionSource.Task; + return BridgeConnector.OnResult("webContents-getUrl", "webContents-getUrl" + Id, Id); } /// @@ -237,23 +177,24 @@ public Task LoadURLAsync(string url) /// /// public Task LoadURLAsync(string url, LoadURLOptions options) - { - var taskCompletionSource = new TaskCompletionSource(); + { + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("webContents-loadURL-complete" + Id, () => + BridgeConnector.On("webContents-loadURL-complete" + Id, () => { - BridgeConnector.Socket.Off("webContents-loadURL-complete" + Id); - BridgeConnector.Socket.Off("webContents-loadURL-error" + Id); - taskCompletionSource.SetResult(null); + BridgeConnector.Off("webContents-loadURL-complete" + Id); + BridgeConnector.Off("webContents-loadURL-error" + Id); + taskCompletionSource.SetResult(); }); - BridgeConnector.Socket.On("webContents-loadURL-error" + Id, (error) => + BridgeConnector.On("webContents-loadURL-error" + Id, (error) => { - BridgeConnector.Socket.Off("webContents-loadURL-error" + Id); + BridgeConnector.Off("webContents-loadURL-error" + Id); + BridgeConnector.Off("webContents-loadURL-complete" + Id); taskCompletionSource.SetException(new InvalidOperationException(error.ToString())); }); - BridgeConnector.Socket.Emit("webContents-loadURL", Id, url, JObject.FromObject(options, _jsonSerializer)); + BridgeConnector.Emit("webContents-loadURL", Id, url, options); return taskCompletionSource.Task; } @@ -267,14 +208,7 @@ public Task LoadURLAsync(string url, LoadURLOptions options) /// Absolute path to the CSS file location public void InsertCSS(bool isBrowserWindow, string path) { - BridgeConnector.Socket.Emit("webContents-insertCSS", Id, isBrowserWindow, path); + BridgeConnector.Emit("webContents-insertCSS", Id, isBrowserWindow, path); } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } \ No newline at end of file diff --git a/ElectronNET.API/WindowManager.cs b/ElectronNET.API/WindowManager.cs old mode 100644 new mode 100755 index 4ac85dab..c8e3ae94 --- a/ElectronNET.API/WindowManager.cs +++ b/ElectronNET.API/WindowManager.cs @@ -6,14 +6,16 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using System.Text.RegularExpressions; using System.Threading.Tasks; +using ElectronNET.API.Interfaces; namespace ElectronNET.API { /// /// /// - public sealed class WindowManager + public sealed class WindowManager : IWindowManager { private static WindowManager _windowManager; private static object _syncRoot = new object(); @@ -50,7 +52,7 @@ public bool IsQuitOnWindowAllClosed get { return _isQuitOnWindowAllClosed; } set { - BridgeConnector.Socket.Emit("quit-app-window-all-closed-event", value); + BridgeConnector.Emit("quit-app-window-all-closed-event", value); _isQuitOnWindowAllClosed = value; } } @@ -79,7 +81,7 @@ public bool IsQuitOnWindowAllClosed /// /// The load URL. /// - public async Task CreateWindowAsync(string loadUrl = "http://localhost") + public async Task CreateWindowAsync(string loadUrl = "/") { return await CreateWindowAsync(new BrowserWindowOptions(), loadUrl); } @@ -90,26 +92,23 @@ public async Task CreateWindowAsync(string loadUrl = "http://loca /// The options. /// The load URL. /// - public Task CreateWindowAsync(BrowserWindowOptions options, string loadUrl = "http://localhost") + public Task CreateWindowAsync(BrowserWindowOptions options, string loadUrl = "/") { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("BrowserWindowCreated", (id) => + BridgeConnector.On("BrowserWindowCreated", (id) => { - BridgeConnector.Socket.Off("BrowserWindowCreated"); + BridgeConnector.Off("BrowserWindowCreated"); - string windowId = id.ToString(); - BrowserWindow browserWindow = new BrowserWindow(int.Parse(windowId)); + BrowserWindow browserWindow = new BrowserWindow(id); _browserWindows.Add(browserWindow); taskCompletionSource.SetResult(browserWindow); }); - BridgeConnector.Socket.Off("BrowserWindowClosed"); - BridgeConnector.Socket.On("BrowserWindowClosed", (ids) => + BridgeConnector.Off("BrowserWindowClosed"); + BridgeConnector.On("BrowserWindowClosed", (browserWindowIds) => { - var browserWindowIds = ((JArray)ids).ToObject(); - for (int index = 0; index < _browserWindows.Count; index++) { if (!browserWindowIds.Contains(_browserWindows[index].Id)) @@ -119,9 +118,9 @@ public Task CreateWindowAsync(BrowserWindowOptions options, strin } }); - if (loadUrl.ToUpper() == "HTTP://LOCALHOST") - { - loadUrl = $"{loadUrl}:{BridgeSettings.WebPort}"; + if(!TryParseLoadUrl(loadUrl, out loadUrl)) + { + throw new ArgumentException($"Unable to parse {loadUrl}", nameof(loadUrl)); } // Workaround Windows 10 / Electron Bug @@ -137,7 +136,7 @@ public Task CreateWindowAsync(BrowserWindowOptions options, strin options.X = 0; options.Y = 0; - BridgeConnector.Socket.Emit("createBrowserWindow", JObject.FromObject(options, _jsonSerializer), loadUrl); + BridgeConnector.Emit("createBrowserWindow", options, loadUrl); } else { @@ -153,12 +152,27 @@ public Task CreateWindowAsync(BrowserWindowOptions options, strin ContractResolver = new CamelCasePropertyNamesContractResolver(), NullValueHandling = NullValueHandling.Ignore }; - BridgeConnector.Socket.Emit("createBrowserWindow", JObject.FromObject(options, ownjsonSerializer), loadUrl); + + BridgeConnector.Emit("createBrowserWindow", JObject.FromObject(options, ownjsonSerializer), loadUrl); } return taskCompletionSource.Task; } + + private bool TryParseLoadUrl(string loadUrl, out string parsedUrl) + { + Uri BaseUri = new Uri($"http://localhost:{BridgeSettings.WebPort}"); + if (Uri.TryCreate(loadUrl, UriKind.Absolute, out var url) || + Uri.TryCreate(BaseUri, loadUrl, out url)) { + var uri = new UriBuilder(url.ToString()); + parsedUrl = uri.ToString(); + return true; + } + parsedUrl = loadUrl; + return false; + } + private bool isWindows10() { return RuntimeInformation.OSDescription.Contains("Windows 10"); @@ -184,35 +198,28 @@ public Task CreateBrowserViewAsync() /// public Task CreateBrowserViewAsync(BrowserViewConstructorOptions options) { - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - BridgeConnector.Socket.On("BrowserViewCreated", (id) => + BridgeConnector.On("BrowserViewCreated", (id) => { - BridgeConnector.Socket.Off("BrowserViewCreated"); + BridgeConnector.Off("BrowserViewCreated"); - string browserViewId = id.ToString(); - BrowserView browserView = new BrowserView(int.Parse(browserViewId)); + BrowserView browserView = new BrowserView(id); _browserViews.Add(browserView); taskCompletionSource.SetResult(browserView); }); - var ownjsonSerializer = new JsonSerializer() + var keepDefaultValuesSerializer = new JsonSerializer() { ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Include }; - BridgeConnector.Socket.Emit("createBrowserView", JObject.FromObject(options, ownjsonSerializer)); + BridgeConnector.Emit("createBrowserView", JObject.FromObject(options, keepDefaultValuesSerializer)); return taskCompletionSource.Task; } - - private JsonSerializer _jsonSerializer = new JsonSerializer() - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - }; } } diff --git a/ElectronNET.API/runtimeconfig.json b/ElectronNET.API/runtimeconfig.json new file mode 100755 index 00000000..0439511e --- /dev/null +++ b/ElectronNET.API/runtimeconfig.json @@ -0,0 +1,7 @@ +{ + "runtimeOptions": { + "configProperties": { + "System.Drawing.EnableUnixSupport": true + } + } +} \ No newline at end of file diff --git a/ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs b/ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs index fcefcd45..b2aa7b40 100644 --- a/ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs +++ b/ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs @@ -6,6 +6,8 @@ public static class DeployEmbeddedElectronFiles { public static void Do(string tempPath) { + EmbeddedFileHelper.PrintAllResources(); + EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js"); EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json"); EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "build-helper.js"); @@ -33,6 +35,7 @@ public static void Do(string tempPath) EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "browserView.js", "api."); EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "powerMonitor.js", "api."); EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "nativeTheme.js", "api."); + EmbeddedFileHelper.DeployEmbeddedFile(hostApiFolder, "process.js", "api."); string splashscreenFolder = Path.Combine(tempPath, "splashscreen"); if (Directory.Exists(splashscreenFolder) == false) diff --git a/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs b/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs index a12d4275..14962640 100644 --- a/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs +++ b/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Runtime.InteropServices; namespace ElectronNET.CLI.Commands.Actions @@ -27,6 +28,19 @@ public static GetTargetPlatformInformationResult Do(string desiredPlatform, stri netCorePublishRid = "osx-x64"; electronPackerPlatform = "mac"; break; + case "osx-arm64": + netCorePublishRid = "osx-arm64"; + electronPackerPlatform = "mac"; + + //Check to see if .net 6 is installed: + if (!Dotnet6Installed()) + { + throw new ArgumentException("You are using a dotnet version older than dotnet 6. Compiling for osx-arm64 requires that dotnet 6 or greater is installed and targeted by your project.", "osx-arm64"); + } + + //Warn for .net 6 targeting: + Console.WriteLine("Please ensure that your project targets .net 6 or greater. Otherwise you may experience an error compiling for osx-arm64."); + break; case "linux": netCorePublishRid = "linux-x64"; electronPackerPlatform = "linux"; @@ -48,8 +62,20 @@ public static GetTargetPlatformInformationResult Do(string desiredPlatform, stri } if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - netCorePublishRid = "osx-x64"; - electronPackerPlatform = "mac"; + if (RuntimeInformation.OSArchitecture.Equals(Architecture.Arm64) && Dotnet6Installed()) + { + //Warn for .net 6 targeting: + Console.WriteLine("Please ensure that your project targets .net 6. Otherwise you may experience an error."); + + //Apple Silicon Mac: + netCorePublishRid = "osx-arm64"; + electronPackerPlatform = "mac"; + } + else{ + //Intel Mac: + netCorePublishRid = "osx-x64"; + electronPackerPlatform = "mac"; + } } if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { @@ -66,5 +92,42 @@ public static GetTargetPlatformInformationResult Do(string desiredPlatform, stri NetCorePublishRid = netCorePublishRid }; } + /// + /// Checks to see if dotnet 6 or greater is installed. + /// Required for MacOS arm targeting. + /// Note that an error may still occur if the project being compiled does not target dotnet 6 or greater. + /// + /// + /// Returns true if dotnet 6 or greater is installed. + /// + private static bool Dotnet6Installed() + { + //check for .net 6: + //execute dotnet --list-sdks to get versions + Process process = new Process(); + process.StartInfo.FileName = "dotnet"; + process.StartInfo.Arguments = "--list-sdks"; + process.StartInfo.UseShellExecute = false; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.Start(); + + string standard_output; + bool dotnet6Exists = false; + + //get command output: + while ((standard_output = process.StandardOutput.ReadLine()) != null) + { + //get the major version and see if its greater than or equal to 6 + int majorVer = int.Parse(standard_output.Split(".")[0]); + if (majorVer >= 6) + { + dotnet6Exists = true; + break; + } + } + process.WaitForExit(); + return dotnet6Exists; + } } -} +} \ No newline at end of file diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs index d9c07465..f1f9f739 100644 --- a/ElectronNET.CLI/Commands/BuildCommand.cs +++ b/ElectronNET.CLI/Commands/BuildCommand.cs @@ -14,6 +14,7 @@ public class BuildCommand : ICommand public static string COMMAND_ARGUMENTS = "Needed: '/target' with params 'win/osx/linux' to build for a typical app or use 'custom' and specify .NET Core build config & electron build config" + Environment.NewLine + " for custom target, check .NET Core RID Catalog and Electron build target/" + Environment.NewLine + " e.g. '/target win' or '/target custom \"win7-x86;win\"'" + Environment.NewLine + + "Optional: '/dotnet-project' with the desired project file to build" + Environment.NewLine + "Optional: '/dotnet-configuration' with the desired .NET Core build config e.g. release or debug. Default = Release" + Environment.NewLine + "Optional: '/electron-arch' to specify the resulting electron processor architecture (e.g. ia86 for x86 builds). Be aware to use the '/target custom' param as well!" + Environment.NewLine + "Optional: '/electron-params' specify any other valid parameter, which will be routed to the electron-packager." + Environment.NewLine + @@ -23,7 +24,11 @@ public class BuildCommand : ICommand "Optional: '/install-modules' to force node module install. Implied by '/package-json'" + Environment.NewLine + "Optional: '/Version' to specify the version that should be applied to both the `dotnet publish` and `electron-builder` commands. Implied by '/Version'" + Environment.NewLine + "Optional: '/p:[property]' or '/property:[property]' to pass in dotnet publish properties. Example: '/property:Version=1.0.0' to override the FileVersion" + Environment.NewLine + - "Full example for a 32bit debug build with electron prune: build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params \"--prune=true \""; + "Optional: '/dotnet-publish [-a|--arch ] [-f | --framework] [--force] [--no-dependencies] [--no-incremental] [--no-restore] [--nologo]" + Environment.NewLine + + " [--no-self-contained] [--os ] [--self-contained [true|false]] [--source ] [-v|--verbosity ] [--version-suffix ]'" + Environment.NewLine + + " to add additional dot net publish arguments." + Environment.NewLine + Environment.NewLine + + "Full example for a 32bit debug build with electron prune: build /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params \"--prune=true \"" + Environment.NewLine + + "Full example to pass publish parameters: build /PublishReadyToRun false /PublishSingleFile false /target custom win7-x86;win32 /dotnet-configuration Debug /electron-arch ia32 /electron-params \"--prune=true \""; public static IList CommandOptions { get; set; } = new List(); @@ -35,17 +40,20 @@ public BuildCommand(string[] args) } private string _paramTarget = "target"; + private string _paramDotNetProject = "dotnet-project"; private string _paramDotNetConfig = "dotnet-configuration"; private string _paramElectronArch = "electron-arch"; private string _paramElectronParams = "electron-params"; + private string _paramElectronVersion = "electron-version"; private string _paramOutputDirectory = "relative-path"; private string _paramAbsoluteOutput = "absolute-path"; private string _paramPackageJson = "package-json"; private string _paramForceNodeInstall = "install-modules"; private string _manifest = "manifest"; - private string _paramPublishReadyToRun = "PublishReadyToRun"; - private string _paramPublishSingleFile = "PublishSingleFile"; - private string _paramVersion = "Version"; + private static string _paramPublishReadyToRun = "PublishReadyToRun"; + private static string _paramPublishSingleFile = "PublishSingleFile"; + private static string _paramVersion = "Version"; + private string _paramDotNetPublish = "dotnet-publish"; public Task ExecuteAsync() { @@ -61,7 +69,7 @@ public Task ExecuteAsync() if (parser.Arguments.ContainsKey(_paramVersion)) version = parser.Arguments[_paramVersion][0]; - if (!parser.Arguments.ContainsKey(_paramTarget)) + if (!parser.Arguments.ContainsKey(_paramTarget) || parser.Arguments[_paramTarget].Length == 0) { Console.WriteLine($"Error: missing '{_paramTarget}' argument."); Console.WriteLine(COMMAND_ARGUMENTS); @@ -104,11 +112,24 @@ public Task ExecuteAsync() Console.WriteLine($"Build ASP.NET Core App for {platformInfo.NetCorePublishRid} under {configuration}-Configuration..."); - var dotNetPublishFlags = GetDotNetPublishFlags(parser); + var dotNetPublishFlags = GetDotNetPublishFlags(parser, "false", "false"); + + var project = string.Empty; + if (parser.Arguments.ContainsKey(_paramDotNetProject)) + { + project = parser.Arguments[_paramDotNetProject][0]; + } var command = - $"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} --self-contained"; + $"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))}"; + // add any additional dotnet flags + var dotnetFlags = GetDotNetArgs(parser); + if (dotnetFlags.Any()) + { + command += " " + string.Join(" ", dotnetFlags); + } + // output the command Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(command); @@ -123,8 +144,7 @@ public Task ExecuteAsync() } DeployEmbeddedElectronFiles.Do(tempPath); - var nodeModulesDirPath = Path.Combine(tempPath, "node_modules"); - + if (parser.Arguments.ContainsKey(_paramPackageJson)) { Console.WriteLine("Copying custom package.json."); @@ -134,10 +154,11 @@ public Task ExecuteAsync() var checkForNodeModulesDirPath = Path.Combine(tempPath, "node_modules"); - if (Directory.Exists(checkForNodeModulesDirPath) == false || parser.Contains(_paramForceNodeInstall) || parser.Contains(_paramPackageJson)) - + if (!Directory.Exists(checkForNodeModulesDirPath)|| parser.Contains(_paramForceNodeInstall) || parser.Contains(_paramPackageJson)) + { Console.WriteLine("Start npm install..."); - ProcessHelper.CmdExecute("npm install --production", tempPath); + ProcessHelper.CmdExecute("npm install --production", tempPath); + } Console.WriteLine("ElectronHostHook handling started..."); @@ -170,12 +191,24 @@ public Task ExecuteAsync() Console.WriteLine("Executing electron magic in this directory: " + buildPath); + string electronArch = "x64"; + //Somewhat janky fix for Apple Silicon: + if (platformInfo.NetCorePublishRid == "osx-arm64") + { + electronArch = "arm64"; + } if (parser.Arguments.ContainsKey(_paramElectronArch)) { electronArch = parser.Arguments[_paramElectronArch][0]; } + string electronVersion = "13.1.5"; + if (parser.Arguments.ContainsKey(_paramElectronVersion)) + { + electronVersion = parser.Arguments[_paramElectronVersion][0]; + } + string electronParams = ""; if (parser.Arguments.ContainsKey(_paramElectronParams)) { @@ -198,7 +231,7 @@ public Task ExecuteAsync() : $"node build-helper.js {manifestFileName} {version}", tempPath); Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}..."); - ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=13.1.5 {electronParams}", tempPath); + ProcessHelper.CmdExecute($"npx electron-builder --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion={electronVersion} {electronParams}", tempPath); Console.WriteLine("... done"); @@ -206,12 +239,47 @@ public Task ExecuteAsync() }); } - private Dictionary GetDotNetPublishFlags(SimpleCommandLineParser parser) + private static List DotNetFlagsWithValuesReserved = new List + { + "-o", "--output", "-r", "--runtime", "-c", "--configuration" + }; + private static List DotNetFlagsToIgnore = new List + { + "--interactive", "-h", "--help" + }; + private List GetDotNetArgs(SimpleCommandLineParser parser) + { + if (!parser.TryGet(_paramDotNetPublish, out var args)) return new List { "--self-contained" }; + + var list = args + .Except(DotNetFlagsToIgnore) + .ToList(); + + // remove flags that are handled by design + foreach (var flag in DotNetFlagsWithValuesReserved) + { + var f = list.IndexOf(flag); + if (f > -1) + { + list.RemoveRange(f, 2); + } + } + + // enforce backwards compatibility + if (!list.Contains("--no-self-contained") && !list.Contains("--self-contained")) + { + list.Add("--self-contained"); + } + + return list; + } + + internal static Dictionary GetDotNetPublishFlags(SimpleCommandLineParser parser, string defaultReadyToRun, string defaultSingleFile) { var dotNetPublishFlags = new Dictionary { - {"/p:PublishReadyToRun", parser.TryGet(_paramPublishReadyToRun, out var rtr) ? rtr[0] : "true"}, - {"/p:PublishSingleFile", parser.TryGet(_paramPublishSingleFile, out var psf) ? psf[0] : "true"}, + {"/p:PublishReadyToRun", parser.TryGet(_paramPublishReadyToRun, out var rtr) ? rtr[0] : defaultReadyToRun}, + {"/p:PublishSingleFile", parser.TryGet(_paramPublishSingleFile, out var psf) ? psf[0] : defaultSingleFile}, }; if (parser.Arguments.ContainsKey(_paramVersion)) @@ -252,4 +320,4 @@ private Dictionary GetDotNetPublishFlags(SimpleCommandLineParser return dotNetPublishFlags; } } -} \ No newline at end of file +} diff --git a/ElectronNET.CLI/Commands/StartElectronCommand.cs b/ElectronNET.CLI/Commands/StartElectronCommand.cs index 03382ecd..8bfb4028 100644 --- a/ElectronNET.CLI/Commands/StartElectronCommand.cs +++ b/ElectronNET.CLI/Commands/StartElectronCommand.cs @@ -23,11 +23,10 @@ public StartElectronCommand(string[] args) } private string _aspCoreProjectPath = "project-path"; + private string _paramDotNetProject = "dotnet-project"; private string _arguments = "args"; private string _manifest = "manifest"; private string _clearCache = "clear-cache"; - private string _paramPublishReadyToRun = "PublishReadyToRun"; - private string _paramPublishSingleFile = "PublishSingleFile"; private string _paramDotNetConfig = "dotnet-configuration"; private string _paramTarget = "target"; @@ -61,28 +60,12 @@ public Task ExecuteAsync() Directory.CreateDirectory(tempPath); } - string tempBinPath = Path.Combine(tempPath, "bin"); - var resultCode = 0; + string tempBinPath = Path.GetFullPath(Path.Combine(tempPath, "bin")); - string publishReadyToRun = "/p:PublishReadyToRun="; - if (parser.Arguments.ContainsKey(_paramPublishReadyToRun)) - { - publishReadyToRun += parser.Arguments[_paramPublishReadyToRun][0]; - } - else - { - publishReadyToRun += "true"; - } + var dotNetPublishFlags = BuildCommand.GetDotNetPublishFlags(parser, "false", "false"); + + var resultCode = 0; - string publishSingleFile = "/p:PublishSingleFile="; - if (parser.Arguments.ContainsKey(_paramPublishSingleFile)) - { - publishSingleFile += parser.Arguments[_paramPublishSingleFile][0]; - } - else - { - publishSingleFile += "true"; - } // If target is specified as a command line argument, use it. // Format is the same as the build command. @@ -105,9 +88,15 @@ public Task ExecuteAsync() configuration = parser.Arguments[_paramDotNetConfig][0]; } - if (parser != null && !parser.Arguments.ContainsKey("watch")) + var project = string.Empty; + if (parser.Arguments.ContainsKey(_paramDotNetProject)) + { + project = parser.Arguments[_paramDotNetProject][0]; + } + + if (!parser.Arguments.ContainsKey("watch")) { - resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {publishReadyToRun} {publishSingleFile} --no-self-contained", aspCoreProjectPath); + resultCode = ProcessHelper.CmdExecute($"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} /p:DisabledWarnings=true", aspCoreProjectPath); } if (resultCode != 0) @@ -120,10 +109,40 @@ public Task ExecuteAsync() var nodeModulesDirPath = Path.Combine(tempPath, "node_modules"); - Console.WriteLine("node_modules missing in: " + nodeModulesDirPath); + bool runNpmInstall = false; - Console.WriteLine("Start npm install..."); - ProcessHelper.CmdExecute("npm install", tempPath); + Console.WriteLine("node_modules in: " + nodeModulesDirPath); + + if (!Directory.Exists(nodeModulesDirPath)) + { + runNpmInstall = true; + } + + var packagesJson = Path.Combine(tempPath, "package.json"); + var packagesPrevious = Path.Combine(tempPath, "package.json.previous"); + + if (!runNpmInstall) + { + + if (File.Exists(packagesPrevious)) + { + if (File.ReadAllText(packagesPrevious) != File.ReadAllText(packagesJson)) + { + runNpmInstall = true; + } + } + else + { + runNpmInstall = true; + } + } + + if (runNpmInstall) + { + Console.WriteLine("Start npm install..."); + ProcessHelper.CmdExecute("npm install", tempPath); + File.Copy(packagesJson, packagesPrevious, true); + } Console.WriteLine("ElectronHostHook handling started..."); @@ -169,12 +188,14 @@ public Task ExecuteAsync() if (isWindows) { Console.WriteLine("Invoke electron.cmd - in dir: " + path); + Console.WriteLine("\n\n---------------------------------------------------\n\n\n"); ProcessHelper.CmdExecute(@"electron.cmd ""..\..\main.js"" " + arguments, path); } else { Console.WriteLine("Invoke electron - in dir: " + path); + Console.WriteLine("\n\n---------------------------------------------------\n\n\n"); ProcessHelper.CmdExecute(@"./electron ""../../main.js"" " + arguments, path); } diff --git a/ElectronNET.CLI/ElectronNET.CLI.csproj b/ElectronNET.CLI/ElectronNET.CLI.csproj old mode 100644 new mode 100755 index a4bd0118..c7e12874 --- a/ElectronNET.CLI/ElectronNET.CLI.csproj +++ b/ElectronNET.CLI/ElectronNET.CLI.csproj @@ -2,8 +2,6 @@ Exe - - net5.0 dotnet-electronize electronize @@ -13,7 +11,7 @@ ElectronNET.CLI 99.0.0.0 - Gregor Biswanger, Robert Muehsig + Gregor Biswanger, Robert Muehsig, Rafael Oliveira Electron.NET @@ -30,6 +28,7 @@ PackageIcon.png true + net6.0 @@ -74,13 +73,15 @@ + - + all runtime; build; native; contentfiles; analyzers + diff --git a/ElectronNET.CLI/EmbeddedFileHelper.cs b/ElectronNET.CLI/EmbeddedFileHelper.cs index d41e657e..0f65ea71 100644 --- a/ElectronNET.CLI/EmbeddedFileHelper.cs +++ b/ElectronNET.CLI/EmbeddedFileHelper.cs @@ -7,13 +7,38 @@ namespace ElectronNET.CLI public static class EmbeddedFileHelper { private const string ResourcePath = "ElectronNET.CLI.{0}"; + private const string ResourcePath2 = "ElectronNet.CLI.{0}"; private static Stream GetTestResourceFileStream(string folderAndFileInProjectPath) { var asm = Assembly.GetExecutingAssembly(); var resource = string.Format(ResourcePath, folderAndFileInProjectPath); + var resource2 = string.Format(ResourcePath2, folderAndFileInProjectPath); - return asm.GetManifestResourceStream(resource); + var stream = asm.GetManifestResourceStream(resource) ?? asm.GetManifestResourceStream(resource2); + + if(stream is null) + { + PrintAllResources(); + + Console.WriteLine("Was missing resource: {0}", resource); + + return null; + } + else + { + return stream; + } + } + + public static void PrintAllResources() + { + var asm = Assembly.GetExecutingAssembly(); + + foreach (var n in asm.GetManifestResourceNames()) + { + Console.WriteLine("Found resource : {0}", n); + } } public static void DeployEmbeddedFile(string targetPath, string file, string namespacePath = "") diff --git a/ElectronNET.CLI/ProcessHelper.cs b/ElectronNET.CLI/ProcessHelper.cs index 9e0048f4..5f7d6cc1 100644 --- a/ElectronNET.CLI/ProcessHelper.cs +++ b/ElectronNET.CLI/ProcessHelper.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Concurrent; using System.Diagnostics; using System.Runtime.InteropServices; @@ -6,6 +7,33 @@ namespace ElectronNET.CLI { public class ProcessHelper { + private static ConcurrentDictionary _activeProcess = new(); + + public static void KillActive() + { + foreach(var kv in _activeProcess) + { + if (!kv.Key.HasExited) + { + try + { + kv.Key.CloseMainWindow(); + } + catch + { + + } + try + { + kv.Key.Kill(true); + } + catch + { + + } + } + } + } public static int CmdExecute(string command, string workingDirectoryPath, bool output = true, bool waitForExit = true) { using (Process cmd = new Process()) @@ -43,7 +71,11 @@ public static int CmdExecute(string command, string workingDirectoryPath, bool o if (waitForExit) { + _activeProcess[cmd] = true; + cmd.WaitForExit(); + + _activeProcess.TryRemove(cmd, out _); } return cmd.ExitCode; diff --git a/ElectronNET.CLI/Program.cs b/ElectronNET.CLI/Program.cs index 2030030c..891b15ef 100644 --- a/ElectronNET.CLI/Program.cs +++ b/ElectronNET.CLI/Program.cs @@ -4,12 +4,13 @@ using System.Linq; using System.Reflection; using System.Text; +using System.Threading.Tasks; namespace ElectronNET.CLI { class Program { - static void Main(string[] args) + static async Task Main(string[] args) { if (args.Length == 0) { @@ -18,6 +19,12 @@ static void Main(string[] args) Environment.Exit(-1); } + Console.CancelKeyPress += (s,e) => + { + ProcessHelper.KillActive(); + Environment.Exit(-1); + }; + ICommand command = null; switch (args[0]) @@ -56,7 +63,7 @@ static void Main(string[] args) if (command != null) { - var success = command.ExecuteAsync().Result; + var success = await command.ExecuteAsync(); if (!success) { Environment.Exit(-1); diff --git a/ElectronNET.Host/.eslintignore b/ElectronNET.Host/.eslintignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/ElectronNET.Host/.eslintignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/ElectronNET.Host/.eslintrc b/ElectronNET.Host/.eslintrc new file mode 100644 index 00000000..4a83099b --- /dev/null +++ b/ElectronNET.Host/.eslintrc @@ -0,0 +1,18 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off" + }, + "env": { + "node": true + } +} \ No newline at end of file diff --git a/ElectronNET.Host/.vscode/extensions.json b/ElectronNET.Host/.vscode/extensions.json new file mode 100644 index 00000000..dfba1ee4 --- /dev/null +++ b/ElectronNET.Host/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "dbaeumer.vscode-eslint" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + + ] +} \ No newline at end of file diff --git a/ElectronNET.Host/ElectronHostHook/connector.ts b/ElectronNET.Host/ElectronHostHook/connector.ts index aabc182a..919cec21 100644 --- a/ElectronNET.Host/ElectronHostHook/connector.ts +++ b/ElectronNET.Host/ElectronHostHook/connector.ts @@ -1,9 +1,10 @@ +import { Socket } from "socket.io"; + export class Connector { - constructor(private socket: SocketIO.Socket, - // @ts-ignore + constructor(private socket: Socket, public app: Electron.App) { } - on(key: string, javaScriptCode: Function): void { + on(key: string, javaScriptCode: (...args) => void): void { this.socket.on(key, (...args: any[]) => { const id: string = args.pop(); diff --git a/ElectronNET.Host/ElectronHostHook/index.ts b/ElectronNET.Host/ElectronHostHook/index.ts index a2e4e184..ce725126 100644 --- a/ElectronNET.Host/ElectronHostHook/index.ts +++ b/ElectronNET.Host/ElectronHostHook/index.ts @@ -1,13 +1,13 @@ -// @ts-ignore import * as Electron from "electron"; +import { Socket } from "socket.io"; import { Connector } from "./connector"; export class HookService extends Connector { - constructor(socket: SocketIO.Socket, public app: Electron.App) { + constructor(socket: Socket, public app: Electron.App) { super(socket, app); } - onHostReady(): void { + onHostReady() { // execute your own JavaScript Host logic here } } diff --git a/ElectronNET.Host/ElectronHostHook/package.json b/ElectronNET.Host/ElectronHostHook/package.json index 874b6ba6..ceaee40d 100644 --- a/ElectronNET.Host/ElectronHostHook/package.json +++ b/ElectronNET.Host/ElectronHostHook/package.json @@ -13,7 +13,7 @@ "author": "Gregor Biswanger", "license": "MIT", "devDependencies": { - "@types/socket.io": "^2.1.12", - "typescript": "^4.3.5" + "socket.io": "^4.4.1", + "typescript": "^4.6.3" } } diff --git a/ElectronNET.Host/api/app.js b/ElectronNET.Host/api/app.js index 783b204a..e9fb535d 100644 --- a/ElectronNET.Host/api/app.js +++ b/ElectronNET.Host/api/app.js @@ -151,7 +151,7 @@ module.exports = (socket, app) => { const success = app.requestSingleInstanceLock(); electronSocket.emit('appRequestSingleInstanceLockCompleted', success); app.on('second-instance', (event, args = [], workingDirectory = '') => { - electronSocket.emit('secondInstance', [args, workingDirectory]); + electronSocket.emit('secondInstance', { args: args, workingDirectory: workingDirectory }); }); }); socket.on('appHasSingleInstanceLock', () => { diff --git a/ElectronNET.Host/api/app.js.map b/ElectronNET.Host/api/app.js.map index 25e66972..de9eed01 100644 --- a/ElectronNET.Host/api/app.js.map +++ b/ElectronNET.Host/api/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";AAEA,IAAI,qBAAqB,GAAG,IAAI,EAAE,cAAc,CAAC;AACjD,IAAI,yBAAyB,CAAC;AAC9B,iBAAS,CAAC,MAAc,EAAE,GAAiB,EAAE,EAAE;IAC3C,cAAc,GAAG,MAAM,CAAC;IAExB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC7B,4DAA4D;QAC5D,8DAA8D;QAC9D,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,qBAAqB,EAAE;YACxD,GAAG,CAAC,IAAI,EAAE,CAAC;SACd;aAAM,IAAI,yBAAyB,EAAE;YAClC,0BAA0B;YAC1B,SAAS;YACT,qEAAqE;YACrE,kBAAkB;YAClB,cAAc,CAAC,IAAI,CAAC,uBAAuB,GAAG,yBAAyB,CAAC,CAAC;SAC5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AC;aAC9C;iBAAM;gBACH,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACrC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/app.ts b/ElectronNET.Host/api/app.ts index 1f04f9f0..4d8df783 100644 --- a/ElectronNET.Host/api/app.ts +++ b/ElectronNET.Host/api/app.ts @@ -190,7 +190,7 @@ export = (socket: Socket, app: Electron.App) => { electronSocket.emit('appRequestSingleInstanceLockCompleted', success); app.on('second-instance', (event, args = [], workingDirectory = '') => { - electronSocket.emit('secondInstance', [args, workingDirectory]); + electronSocket.emit('secondInstance', { args: args, workingDirectory: workingDirectory }); }); }); diff --git a/ElectronNET.Host/api/browserView.js b/ElectronNET.Host/api/browserView.js index 17e01897..ad31d0e5 100644 --- a/ElectronNET.Host/api/browserView.js +++ b/ElectronNET.Host/api/browserView.js @@ -24,7 +24,7 @@ const browserViewApi = (socket) => { }); socket.on('browserView-getBounds', (id) => { const bounds = getBrowserViewById(id).getBounds(); - electronSocket.emit('browserView-getBounds-reply', bounds); + electronSocket.emit('browserView-getBounds-reply' + id, bounds); }); socket.on('browserView-setBounds', (id, bounds) => { getBrowserViewById(id).setBounds(bounds); @@ -37,7 +37,7 @@ const browserViewApi = (socket) => { }); function hasOwnChildreen(obj, ...childNames) { for (let i = 0; i < childNames.length; i++) { - if (!obj || !obj.hasOwnProperty(childNames[i])) { + if (!obj || !Object.prototype.hasOwnProperty.call(obj, childNames[i])) { return false; } obj = obj[childNames[i]]; diff --git a/ElectronNET.Host/api/browserView.js.map b/ElectronNET.Host/api/browserView.js.map index 596b53ab..75ebd065 100644 --- a/ElectronNET.Host/api/browserView.js.map +++ b/ElectronNET.Host/api/browserView.js.map @@ -1 +1 @@ -{"version":3,"file":"browserView.js","sourceRoot":"","sources":["browserView.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AACvC,MAAM,YAAY,GAAkB,CAAC,M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,CAAC,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;gBACnE,OAAO,KAAK,CAAC;aAChB;YACD,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAeO,wCAAc;AAbvB,MAAM,yBAAyB,GAAG,CAAC,aAAqB,EAAe,EAAE;IACrE,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC7C,CAAC,CAAC;AAWuB,8DAAyB;AATlD,SAAS,kBAAkB,CAAC,EAAU;IAClC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QACtD,MAAM,eAAe,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,eAAe,CAAC;SAC1B;KACJ;AACL,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/browserView.ts b/ElectronNET.Host/api/browserView.ts index 5d7a314b..fe7746ef 100644 --- a/ElectronNET.Host/api/browserView.ts +++ b/ElectronNET.Host/api/browserView.ts @@ -31,7 +31,7 @@ const browserViewApi = (socket: Socket) => { socket.on('browserView-getBounds', (id) => { const bounds = getBrowserViewById(id).getBounds(); - electronSocket.emit('browserView-getBounds-reply', bounds); + electronSocket.emit('browserView-getBounds-reply' + id, bounds); }); socket.on('browserView-setBounds', (id, bounds) => { @@ -48,7 +48,7 @@ const browserViewApi = (socket: Socket) => { function hasOwnChildreen(obj, ...childNames) { for (let i = 0; i < childNames.length; i++) { - if (!obj || !obj.hasOwnProperty(childNames[i])) { + if (!obj || !Object.prototype.hasOwnProperty.call(obj, childNames[i])) { return false; } obj = obj[childNames[i]]; diff --git a/ElectronNET.Host/api/browserWindows.js b/ElectronNET.Host/api/browserWindows.js index e2513868..965f9dab 100644 --- a/ElectronNET.Host/api/browserWindows.js +++ b/ElectronNET.Host/api/browserWindows.js @@ -1,177 +1,207 @@ "use strict"; const electron_1 = require("electron"); const browserView_1 = require("./browserView"); -const path = require('path'); +const path = require("path"); const windows = (global['browserWindows'] = global['browserWindows'] || []); -let readyToShowWindowsIds = []; -let window, lastOptions, electronSocket; -let mainWindowURL; +const readyToShowWindowsIds = (global['readyToShowWindowsIds'] = global['readyToShowWindowsIds'] || []); const proxyToCredentialsMap = (global['proxyToCredentialsMap'] = global['proxyToCredentialsMap'] || []); +let window, lastOptions, electronSocket; module.exports = (socket, app) => { electronSocket = socket; app.on('login', (event, webContents, request, authInfo, callback) => { if (authInfo.isProxy) { - let proxy = `${authInfo.host}:${authInfo.port}`; + const proxy = `${authInfo.host}:${authInfo.port}`; if (proxy in proxyToCredentialsMap && proxyToCredentialsMap[proxy].split(':').length === 2) { event.preventDefault(); - let user = proxyToCredentialsMap[proxy].split(':')[0]; - let pass = proxyToCredentialsMap[proxy].split(':')[1]; + const user = proxyToCredentialsMap[proxy].split(':')[0]; + const pass = proxyToCredentialsMap[proxy].split(':')[1]; callback(user, pass); } } }); socket.on('register-browserWindow-ready-to-show', (id) => { - if (readyToShowWindowsIds.includes(id)) { - readyToShowWindowsIds = readyToShowWindowsIds.filter(value => value !== id); + var _a; + const index = readyToShowWindowsIds.indexOf(id); + if (index > -1) { + readyToShowWindowsIds.splice(index, 1); electronSocket.emit('browserWindow-ready-to-show' + id); } - getWindowById(id).on('ready-to-show', () => { + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('ready-to-show', () => { readyToShowWindowsIds.push(id); electronSocket.emit('browserWindow-ready-to-show' + id); }); }); socket.on('register-browserWindow-page-title-updated', (id) => { - getWindowById(id).on('page-title-updated', (event, title) => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('page-title-updated', (event, title) => { electronSocket.emit('browserWindow-page-title-updated' + id, title); }); }); socket.on('register-browserWindow-close', (id) => { - getWindowById(id).on('close', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('close', () => { electronSocket.emit('browserWindow-close' + id); }); }); socket.on('register-browserWindow-closed', (id) => { - getWindowById(id).on('closed', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('closed', () => { electronSocket.emit('browserWindow-closed' + id); }); }); socket.on('register-browserWindow-session-end', (id) => { - getWindowById(id).on('session-end', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('session-end', () => { electronSocket.emit('browserWindow-session-end' + id); }); }); socket.on('register-browserWindow-unresponsive', (id) => { - getWindowById(id).on('unresponsive', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('unresponsive', () => { electronSocket.emit('browserWindow-unresponsive' + id); }); }); socket.on('register-browserWindow-responsive', (id) => { - getWindowById(id).on('responsive', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('responsive', () => { electronSocket.emit('browserWindow-responsive' + id); }); }); socket.on('register-browserWindow-blur', (id) => { - getWindowById(id).on('blur', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('blur', () => { electronSocket.emit('browserWindow-blur' + id); }); }); socket.on('register-browserWindow-focus', (id) => { - getWindowById(id).on('focus', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('focus', () => { electronSocket.emit('browserWindow-focus' + id); }); }); socket.on('register-browserWindow-show', (id) => { - getWindowById(id).on('show', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('show', () => { electronSocket.emit('browserWindow-show' + id); }); }); socket.on('register-browserWindow-hide', (id) => { - getWindowById(id).on('hide', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('hide', () => { electronSocket.emit('browserWindow-hide' + id); }); }); socket.on('register-browserWindow-maximize', (id) => { - getWindowById(id).on('maximize', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('maximize', () => { electronSocket.emit('browserWindow-maximize' + id); }); }); socket.on('register-browserWindow-unmaximize', (id) => { - getWindowById(id).on('unmaximize', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('unmaximize', () => { electronSocket.emit('browserWindow-unmaximize' + id); }); }); socket.on('register-browserWindow-minimize', (id) => { - getWindowById(id).on('minimize', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('minimize', () => { electronSocket.emit('browserWindow-minimize' + id); }); }); socket.on('register-browserWindow-restore', (id) => { - getWindowById(id).on('restore', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('restore', () => { electronSocket.emit('browserWindow-restore' + id); }); }); socket.on('register-browserWindow-resize', (id) => { - getWindowById(id).on('resize', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('resize', () => { electronSocket.emit('browserWindow-resize' + id); }); }); socket.on('register-browserWindow-move', (id) => { - getWindowById(id).on('move', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('move', () => { electronSocket.emit('browserWindow-move' + id); }); }); socket.on('register-browserWindow-moved', (id) => { - getWindowById(id).on('moved', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('moved', () => { electronSocket.emit('browserWindow-moved' + id); }); }); socket.on('register-browserWindow-enter-full-screen', (id) => { - getWindowById(id).on('enter-full-screen', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('enter-full-screen', () => { electronSocket.emit('browserWindow-enter-full-screen' + id); }); }); socket.on('register-browserWindow-leave-full-screen', (id) => { - getWindowById(id).on('leave-full-screen', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('leave-full-screen', () => { electronSocket.emit('browserWindow-leave-full-screen' + id); }); }); socket.on('register-browserWindow-enter-html-full-screen', (id) => { - getWindowById(id).on('enter-html-full-screen', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('enter-html-full-screen', () => { electronSocket.emit('browserWindow-enter-html-full-screen' + id); }); }); socket.on('register-browserWindow-leave-html-full-screen', (id) => { - getWindowById(id).on('leave-html-full-screen', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('leave-html-full-screen', () => { electronSocket.emit('browserWindow-leave-html-full-screen' + id); }); }); socket.on('register-browserWindow-app-command', (id) => { - getWindowById(id).on('app-command', (event, command) => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('app-command', (event, command) => { electronSocket.emit('browserWindow-app-command' + id, command); }); }); socket.on('register-browserWindow-scroll-touch-begin', (id) => { - getWindowById(id).on('scroll-touch-begin', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('scroll-touch-begin', () => { electronSocket.emit('browserWindow-scroll-touch-begin' + id); }); }); socket.on('register-browserWindow-scroll-touch-end', (id) => { - getWindowById(id).on('scroll-touch-end', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('scroll-touch-end', () => { electronSocket.emit('browserWindow-scroll-touch-end' + id); }); }); socket.on('register-browserWindow-scroll-touch-edge', (id) => { - getWindowById(id).on('scroll-touch-edge', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('scroll-touch-edge', () => { electronSocket.emit('browserWindow-scroll-touch-edge' + id); }); }); socket.on('register-browserWindow-swipe', (id) => { - getWindowById(id).on('swipe', (event, direction) => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('swipe', (event, direction) => { electronSocket.emit('browserWindow-swipe' + id, direction); }); }); socket.on('register-browserWindow-sheet-begin', (id) => { - getWindowById(id).on('sheet-begin', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('sheet-begin', () => { electronSocket.emit('browserWindow-sheet-begin' + id); }); }); socket.on('register-browserWindow-sheet-end', (id) => { - getWindowById(id).on('sheet-end', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('sheet-end', () => { electronSocket.emit('browserWindow-sheet-end' + id); }); }); socket.on('register-browserWindow-new-window-for-tab', (id) => { - getWindowById(id).on('new-window-for-tab', () => { + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.on('new-window-for-tab', () => { electronSocket.emit('browserWindow-new-window-for-tab' + id); }); }); @@ -182,12 +212,17 @@ module.exports = (socket, app) => { else if (!options.webPreferences) { options = { ...options, webPreferences: { nodeIntegration: true, contextIsolation: false } }; } + if (options.parent) { + options.parent = electron_1.BrowserWindow.fromId(options.parent.id); + } // we dont want to recreate the window when watch is ready. if (app.commandLine.hasSwitch('watch') && app['mainWindowURL'] === loadUrl) { window = app['mainWindow']; if (window) { window.reload(); - windows.push(window); + if (windows.findIndex(i => i.id == window.id) == -1) { + windows.push(window); + } electronSocket.emit('BrowserWindowCreated', window.id); return; } @@ -195,22 +230,24 @@ module.exports = (socket, app) => { else { window = new electron_1.BrowserWindow(options); } + const thisWindow = window; if (options.proxy) { - window.webContents.session.setProxy({ proxyRules: options.proxy }); + thisWindow.webContents.session.setProxy({ proxyRules: options.proxy }); } if (options.proxy && options.proxyCredentials) { proxyToCredentialsMap[options.proxy] = options.proxyCredentials; } - window.on('ready-to-show', () => { - if (readyToShowWindowsIds.includes(window.id)) { - readyToShowWindowsIds = readyToShowWindowsIds.filter(value => value !== window.id); + thisWindow.on('ready-to-show', () => { + const index = readyToShowWindowsIds.indexOf(thisWindow.id); + if (index > -1) { + readyToShowWindowsIds.splice(index, 1); } else { - readyToShowWindowsIds.push(window.id); + readyToShowWindowsIds.push(thisWindow.id); } }); lastOptions = options; - window.on('closed', (sender) => { + thisWindow.on('closed', (sender) => { for (let index = 0; index < windows.length; index++) { const windowItem = windows[index]; try { @@ -226,6 +263,7 @@ module.exports = (socket, app) => { } } }); + // this seems dangerous to assume app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. @@ -234,257 +272,328 @@ module.exports = (socket, app) => { } }); if (loadUrl) { - window.loadURL(loadUrl); + thisWindow.loadURL(loadUrl); } if (app.commandLine.hasSwitch('clear-cache') && app.commandLine.getSwitchValue('clear-cache')) { - window.webContents.session.clearCache(); + thisWindow.webContents.session.clearCache(); console.log('auto clear-cache active for new window.'); } // set main window url if (app['mainWindowURL'] == undefined || app['mainWindowURL'] == "") { app['mainWindowURL'] = loadUrl; - app['mainWindow'] = window; + app['mainWindow'] = thisWindow; } - windows.push(window); - electronSocket.emit('BrowserWindowCreated', window.id); + windows.push(thisWindow); + electronSocket.emit('BrowserWindowCreated', thisWindow.id); }); socket.on('browserWindowDestroy', (id) => { - getWindowById(id).destroy(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.destroy(); }); socket.on('browserWindowClose', (id) => { - getWindowById(id).close(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.close(); }); socket.on('browserWindowFocus', (id) => { - getWindowById(id).focus(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.focus(); }); socket.on('browserWindowBlur', (id) => { - getWindowById(id).blur(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.blur(); }); socket.on('browserWindowIsFocused', (id) => { - const isFocused = getWindowById(id).isFocused(); - electronSocket.emit('browserWindow-isFocused-completed', isFocused); + var _a, _b; + const isFocused = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isFocused()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isFocused-completed' + id, isFocused); }); socket.on('browserWindowIsDestroyed', (id) => { - const isDestroyed = getWindowById(id).isDestroyed(); - electronSocket.emit('browserWindow-isDestroyed-completed', isDestroyed); + const w = getWindowById(id); + if (w) { + const isDestroyed = w.isDestroyed(); + electronSocket.emit('browserWindow-isDestroyed-completed', isDestroyed); + } }); socket.on('browserWindowShow', (id) => { - getWindowById(id).show(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.show(); }); socket.on('browserWindowShowInactive', (id) => { - getWindowById(id).showInactive(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.showInactive(); }); socket.on('browserWindowHide', (id) => { - getWindowById(id).hide(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.hide(); }); socket.on('browserWindowIsVisible', (id) => { - const isVisible = getWindowById(id).isVisible(); - electronSocket.emit('browserWindow-isVisible-completed', isVisible); + var _a, _b; + const isVisible = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isVisible()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isVisible-completed' + id, isVisible); }); socket.on('browserWindowIsModal', (id) => { - const isModal = getWindowById(id).isModal(); - electronSocket.emit('browserWindow-isModal-completed', isModal); + var _a, _b; + const isModal = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isModal()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isModal-completed' + id, isModal); }); socket.on('browserWindowMaximize', (id) => { - getWindowById(id).maximize(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.maximize(); }); socket.on('browserWindowUnmaximize', (id) => { - getWindowById(id).unmaximize(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.unmaximize(); }); socket.on('browserWindowIsMaximized', (id) => { - const isMaximized = getWindowById(id).isMaximized(); - electronSocket.emit('browserWindow-isMaximized-completed', isMaximized); + var _a, _b; + const isMaximized = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMaximized()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMaximized-completed' + id, isMaximized); }); socket.on('browserWindowMinimize', (id) => { - getWindowById(id).minimize(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.minimize(); }); socket.on('browserWindowRestore', (id) => { - getWindowById(id).restore(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.restore(); }); socket.on('browserWindowIsMinimized', (id) => { - const isMinimized = getWindowById(id).isMinimized(); - electronSocket.emit('browserWindow-isMinimized-completed', isMinimized); + var _a, _b; + const isMinimized = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMinimized()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMinimized-completed' + id, isMinimized); }); socket.on('browserWindowSetFullScreen', (id, fullscreen) => { - getWindowById(id).setFullScreen(fullscreen); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setFullScreen(fullscreen); }); socket.on('browserWindowIsFullScreen', (id) => { - const isFullScreen = getWindowById(id).isFullScreen(); - electronSocket.emit('browserWindow-isFullScreen-completed', isFullScreen); + var _a, _b; + const isFullScreen = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isFullScreen()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isFullScreen-completed' + id, isFullScreen); }); socket.on('browserWindowSetAspectRatio', (id, aspectRatio, extraSize) => { - getWindowById(id).setAspectRatio(aspectRatio, extraSize); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setAspectRatio(aspectRatio, extraSize); }); socket.on('browserWindowPreviewFile', (id, path, displayname) => { - getWindowById(id).previewFile(path, displayname); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.previewFile(path, displayname); }); socket.on('browserWindowCloseFilePreview', (id) => { - getWindowById(id).closeFilePreview(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.closeFilePreview(); }); socket.on('browserWindowSetBounds', (id, bounds, animate) => { - getWindowById(id).setBounds(bounds, animate); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setBounds(bounds, animate); }); socket.on('browserWindowGetBounds', (id) => { - const rectangle = getWindowById(id).getBounds(); - electronSocket.emit('browserWindow-getBounds-completed', rectangle); + var _a, _b; + const rectangle = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getBounds()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getBounds-completed' + id, rectangle); }); socket.on('browserWindowSetContentBounds', (id, bounds, animate) => { - getWindowById(id).setContentBounds(bounds, animate); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setContentBounds(bounds, animate); }); socket.on('browserWindowGetContentBounds', (id) => { - const rectangle = getWindowById(id).getContentBounds(); - electronSocket.emit('browserWindow-getContentBounds-completed', rectangle); + var _a, _b; + const rectangle = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getContentBounds()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getContentBounds-completed' + id, rectangle); }); socket.on('browserWindowSetSize', (id, width, height, animate) => { - getWindowById(id).setSize(width, height, animate); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setSize(width, height, animate); }); socket.on('browserWindowGetSize', (id) => { - const size = getWindowById(id).getSize(); - electronSocket.emit('browserWindow-getSize-completed', size); + var _a, _b; + const size = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getSize()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getSize-completed' + id, size); }); socket.on('browserWindowSetContentSize', (id, width, height, animate) => { - getWindowById(id).setContentSize(width, height, animate); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setContentSize(width, height, animate); }); socket.on('browserWindowGetContentSize', (id) => { - const size = getWindowById(id).getContentSize(); - electronSocket.emit('browserWindow-getContentSize-completed', size); + var _a, _b; + const size = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getContentSize()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getContentSize-completed' + id, size); }); socket.on('browserWindowSetMinimumSize', (id, width, height) => { - getWindowById(id).setMinimumSize(width, height); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMinimumSize(width, height); }); socket.on('browserWindowGetMinimumSize', (id) => { - const size = getWindowById(id).getMinimumSize(); - electronSocket.emit('browserWindow-getMinimumSize-completed', size); + var _a, _b; + const size = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getMinimumSize()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getMinimumSize-completed' + id, size); }); socket.on('browserWindowSetMaximumSize', (id, width, height) => { - getWindowById(id).setMaximumSize(width, height); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMaximumSize(width, height); }); socket.on('browserWindowGetMaximumSize', (id) => { - const size = getWindowById(id).getMaximumSize(); - electronSocket.emit('browserWindow-getMaximumSize-completed', size); + var _a, _b; + const size = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getMaximumSize()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getMaximumSize-completed' + id, size); }); socket.on('browserWindowSetResizable', (id, resizable) => { - getWindowById(id).setResizable(resizable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setResizable(resizable); }); socket.on('browserWindowIsResizable', (id) => { - const resizable = getWindowById(id).isResizable(); - electronSocket.emit('browserWindow-isResizable-completed', resizable); + var _a, _b; + const resizable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isResizable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isResizable-completed' + id, resizable); }); socket.on('browserWindowSetMovable', (id, movable) => { - getWindowById(id).setMovable(movable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMovable(movable); }); socket.on('browserWindowIsMovable', (id) => { - const movable = getWindowById(id).isMovable(); - electronSocket.emit('browserWindow-isMovable-completed', movable); + var _a, _b; + const movable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMovable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMovable-completed' + id, movable); }); socket.on('browserWindowSetMinimizable', (id, minimizable) => { - getWindowById(id).setMinimizable(minimizable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMinimizable(minimizable); }); socket.on('browserWindowIsMinimizable', (id) => { - const minimizable = getWindowById(id).isMinimizable(); - electronSocket.emit('browserWindow-isMinimizable-completed', minimizable); + var _a, _b; + const minimizable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMinimizable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMinimizable-completed' + id, minimizable); }); socket.on('browserWindowSetMaximizable', (id, maximizable) => { - getWindowById(id).setMaximizable(maximizable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMaximizable(maximizable); }); socket.on('browserWindowIsMaximizable', (id) => { - const maximizable = getWindowById(id).isMaximizable(); - electronSocket.emit('browserWindow-isMaximizable-completed', maximizable); + var _a, _b; + const maximizable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMaximizable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMaximizable-completed' + id, maximizable); }); socket.on('browserWindowSetFullScreenable', (id, fullscreenable) => { - getWindowById(id).setFullScreenable(fullscreenable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setFullScreenable(fullscreenable); }); socket.on('browserWindowIsFullScreenable', (id) => { - const fullscreenable = getWindowById(id).isFullScreenable(); - electronSocket.emit('browserWindow-isFullScreenable-completed', fullscreenable); + var _a, _b; + const fullscreenable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isFullScreenable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isFullScreenable-completed' + id, fullscreenable); }); socket.on('browserWindowSetClosable', (id, closable) => { - getWindowById(id).setClosable(closable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setClosable(closable); }); socket.on('browserWindowIsClosable', (id) => { - const closable = getWindowById(id).isClosable(); - electronSocket.emit('browserWindow-isClosable-completed', closable); + var _a, _b; + const closable = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isClosable()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isClosable-completed' + id, closable); }); socket.on('browserWindowSetAlwaysOnTop', (id, flag, level, relativeLevel) => { - getWindowById(id).setAlwaysOnTop(flag, level, relativeLevel); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setAlwaysOnTop(flag, level, relativeLevel); }); socket.on('browserWindowIsAlwaysOnTop', (id) => { - const isAlwaysOnTop = getWindowById(id).isAlwaysOnTop(); - electronSocket.emit('browserWindow-isAlwaysOnTop-completed', isAlwaysOnTop); + var _a, _b; + const isAlwaysOnTop = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isAlwaysOnTop()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isAlwaysOnTop-completed' + id, isAlwaysOnTop); }); socket.on('browserWindowCenter', (id) => { - getWindowById(id).center(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.center(); }); socket.on('browserWindowSetPosition', (id, x, y, animate) => { - getWindowById(id).setPosition(x, y, animate); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setPosition(x, y, animate); }); socket.on('browserWindowGetPosition', (id) => { - const position = getWindowById(id).getPosition(); - electronSocket.emit('browserWindow-getPosition-completed', position); + var _a, _b; + const position = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getPosition()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getPosition-completed' + id, position); }); socket.on('browserWindowSetTitle', (id, title) => { - getWindowById(id).setTitle(title); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setTitle(title); }); socket.on('browserWindowGetTitle', (id) => { - const title = getWindowById(id).getTitle(); - electronSocket.emit('browserWindow-getTitle-completed', title); + var _a, _b; + const title = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getTitle()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getTitle-completed' + id, title); }); socket.on('browserWindowSetTitle', (id, title) => { - getWindowById(id).setTitle(title); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setTitle(title); }); socket.on('browserWindowSetSheetOffset', (id, offsetY, offsetX) => { + var _a, _b; if (offsetX) { - getWindowById(id).setSheetOffset(offsetY, offsetX); + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setSheetOffset(offsetY, offsetX); } else { - getWindowById(id).setSheetOffset(offsetY); + (_b = getWindowById(id)) === null || _b === void 0 ? void 0 : _b.setSheetOffset(offsetY); } }); socket.on('browserWindowFlashFrame', (id, flag) => { - getWindowById(id).flashFrame(flag); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.flashFrame(flag); }); socket.on('browserWindowSetSkipTaskbar', (id, skip) => { - getWindowById(id).setSkipTaskbar(skip); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setSkipTaskbar(skip); }); socket.on('browserWindowSetKiosk', (id, flag) => { - getWindowById(id).setKiosk(flag); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setKiosk(flag); }); socket.on('browserWindowIsKiosk', (id) => { - const isKiosk = getWindowById(id).isKiosk(); - electronSocket.emit('browserWindow-isKiosk-completed', isKiosk); + var _a, _b; + const isKiosk = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isKiosk()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isKiosk-completed' + id, isKiosk); }); socket.on('browserWindowGetNativeWindowHandle', (id) => { - const nativeWindowHandle = getWindowById(id).getNativeWindowHandle().readInt32LE(0).toString(16); - electronSocket.emit('browserWindow-getNativeWindowHandle-completed', nativeWindowHandle); + var _a, _b, _c, _d; + const nativeWindowHandle = (_d = (_c = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getNativeWindowHandle()) === null || _b === void 0 ? void 0 : _b.readInt32LE(0)) === null || _c === void 0 ? void 0 : _c.toString(16)) !== null && _d !== void 0 ? _d : null; + electronSocket.emit('browserWindow-getNativeWindowHandle-completed' + id, nativeWindowHandle); }); socket.on('browserWindowSetRepresentedFilename', (id, filename) => { - getWindowById(id).setRepresentedFilename(filename); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setRepresentedFilename(filename); }); socket.on('browserWindowGetRepresentedFilename', (id) => { - const pathname = getWindowById(id).getRepresentedFilename(); - electronSocket.emit('browserWindow-getRepresentedFilename-completed', pathname); + var _a, _b; + const pathname = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getRepresentedFilename()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getRepresentedFilename-completed' + id, pathname); }); socket.on('browserWindowSetDocumentEdited', (id, edited) => { - getWindowById(id).setDocumentEdited(edited); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setDocumentEdited(edited); }); socket.on('browserWindowIsDocumentEdited', (id) => { - const edited = getWindowById(id).isDocumentEdited(); - electronSocket.emit('browserWindow-isDocumentEdited-completed', edited); + var _a, _b; + const edited = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isDocumentEdited()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isDocumentEdited-completed' + id, edited); }); socket.on('browserWindowFocusOnWebView', (id) => { - getWindowById(id).focusOnWebView(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.focusOnWebView(); }); socket.on('browserWindowBlurWebView', (id) => { - getWindowById(id).blurWebView(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.blurWebView(); }); socket.on('browserWindowLoadURL', (id, url, options) => { - getWindowById(id).loadURL(url, options); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.loadURL(url, options); }); socket.on('browserWindowReload', (id) => { - getWindowById(id).reload(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.reload(); }); socket.on('browserWindowSetMenu', (id, menuItems) => { + var _a; let menu = null; if (menuItems) { menu = electron_1.Menu.buildFromTemplate(menuItems); @@ -492,10 +601,11 @@ module.exports = (socket, app) => { electronSocket.emit('windowMenuItemClicked', id); }); } - getWindowById(id).setMenu(menu); + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMenu(menu); }); socket.on('browserWindowRemoveMenu', (id) => { - getWindowById(id).removeMenu(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.removeMenu(); }); function addMenuItemClickConnector(menuItems, callback) { menuItems.forEach((item) => { @@ -508,19 +618,24 @@ module.exports = (socket, app) => { }); } socket.on('browserWindowSetProgressBar', (id, progress) => { - getWindowById(id).setProgressBar(progress); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setProgressBar(progress); }); socket.on('browserWindowSetProgressBar', (id, progress, options) => { - getWindowById(id).setProgressBar(progress, options); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setProgressBar(progress, options); }); socket.on('browserWindowSetHasShadow', (id, hasShadow) => { - getWindowById(id).setHasShadow(hasShadow); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setHasShadow(hasShadow); }); socket.on('browserWindowHasShadow', (id) => { - const hasShadow = getWindowById(id).hasShadow(); - electronSocket.emit('browserWindow-hasShadow-completed', hasShadow); + var _a, _b; + const hasShadow = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.hasShadow()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-hasShadow-completed' + id, hasShadow); }); socket.on('browserWindowSetThumbarButtons', (id, thumbarButtons) => { + var _a, _b; thumbarButtons.forEach(thumbarButton => { const imagePath = path.join(__dirname.replace('api', ''), 'bin', thumbarButton.icon.toString()); thumbarButton.icon = electron_1.nativeImage.createFromPath(imagePath); @@ -528,75 +643,94 @@ module.exports = (socket, app) => { electronSocket.emit('thumbarButtonClicked', thumbarButton['id']); }; }); - const success = getWindowById(id).setThumbarButtons(thumbarButtons); - electronSocket.emit('browserWindowSetThumbarButtons-completed', success); + const success = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setThumbarButtons(thumbarButtons)) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindowSetThumbarButtons-completed' + id, success); }); socket.on('browserWindowSetThumbnailClip', (id, rectangle) => { - getWindowById(id).setThumbnailClip(rectangle); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setThumbnailClip(rectangle); }); socket.on('browserWindowSetThumbnailToolTip', (id, toolTip) => { - getWindowById(id).setThumbnailToolTip(toolTip); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setThumbnailToolTip(toolTip); }); socket.on('browserWindowSetAppDetails', (id, options) => { - getWindowById(id).setAppDetails(options); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setAppDetails(options); }); socket.on('browserWindowShowDefinitionForSelection', (id) => { - getWindowById(id).showDefinitionForSelection(); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.showDefinitionForSelection(); }); socket.on('browserWindowSetAutoHideMenuBar', (id, hide) => { - getWindowById(id).setAutoHideMenuBar(hide); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setAutoHideMenuBar(hide); }); socket.on('browserWindowIsMenuBarAutoHide', (id) => { - const isMenuBarAutoHide = getWindowById(id).isMenuBarAutoHide(); - electronSocket.emit('browserWindow-isMenuBarAutoHide-completed', isMenuBarAutoHide); + var _a, _b; + const isMenuBarAutoHide = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMenuBarAutoHide()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMenuBarAutoHide-completed' + id, isMenuBarAutoHide); }); socket.on('browserWindowSetMenuBarVisibility', (id, visible) => { - getWindowById(id).setMenuBarVisibility(visible); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setMenuBarVisibility(visible); }); socket.on('browserWindowIsMenuBarVisible', (id) => { - const isMenuBarVisible = getWindowById(id).isMenuBarVisible(); - electronSocket.emit('browserWindow-isMenuBarVisible-completed', isMenuBarVisible); + var _a, _b; + const isMenuBarVisible = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isMenuBarVisible()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isMenuBarVisible-completed' + id, isMenuBarVisible); }); socket.on('browserWindowSetVisibleOnAllWorkspaces', (id, visible) => { - getWindowById(id).setVisibleOnAllWorkspaces(visible); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setVisibleOnAllWorkspaces(visible); }); socket.on('browserWindowIsVisibleOnAllWorkspaces', (id) => { - const isVisibleOnAllWorkspaces = getWindowById(id).isVisibleOnAllWorkspaces(); - electronSocket.emit('browserWindow-isVisibleOnAllWorkspaces-completed', isVisibleOnAllWorkspaces); + var _a, _b; + const isVisibleOnAllWorkspaces = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.isVisibleOnAllWorkspaces()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-isVisibleOnAllWorkspaces-completed' + id, isVisibleOnAllWorkspaces); }); socket.on('browserWindowSetIgnoreMouseEvents', (id, ignore) => { - getWindowById(id).setIgnoreMouseEvents(ignore); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setIgnoreMouseEvents(ignore); }); socket.on('browserWindowSetContentProtection', (id, enable) => { - getWindowById(id).setContentProtection(enable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setContentProtection(enable); }); socket.on('browserWindowSetFocusable', (id, focusable) => { - getWindowById(id).setFocusable(focusable); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setFocusable(focusable); }); socket.on('browserWindowSetParentWindow', (id, parent) => { + var _a; const browserWindow = electron_1.BrowserWindow.fromId(parent.id); - getWindowById(id).setParentWindow(browserWindow); + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setParentWindow(browserWindow); }); socket.on('browserWindowGetParentWindow', (id) => { - const browserWindow = getWindowById(id).getParentWindow(); - electronSocket.emit('browserWindow-getParentWindow-completed', browserWindow.id); + var _a, _b; + const browserWindow = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getParentWindow()) !== null && _b !== void 0 ? _b : null; + electronSocket.emit('browserWindow-getParentWindow-completed' + id, browserWindow.id); }); socket.on('browserWindowGetChildWindows', (id) => { - const browserWindows = getWindowById(id).getChildWindows(); + var _a, _b; + const browserWindows = (_b = (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.getChildWindows()) !== null && _b !== void 0 ? _b : null; const ids = []; browserWindows.forEach(x => { ids.push(x.id); }); - electronSocket.emit('browserWindow-getChildWindows-completed', ids); + electronSocket.emit('browserWindow-getChildWindows-completed' + id, ids); }); socket.on('browserWindowSetAutoHideCursor', (id, autoHide) => { - getWindowById(id).setAutoHideCursor(autoHide); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setAutoHideCursor(autoHide); }); socket.on('browserWindowSetVibrancy', (id, type) => { - getWindowById(id).setVibrancy(type); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setVibrancy(type); }); socket.on('browserWindow-setBrowserView', (id, browserViewId) => { - getWindowById(id).setBrowserView(browserView_1.browserViewMediateService(browserViewId)); + var _a; + (_a = getWindowById(id)) === null || _a === void 0 ? void 0 : _a.setBrowserView((0, browserView_1.browserViewMediateService)(browserViewId)); }); function getWindowById(id) { for (let index = 0; index < windows.length; index++) { @@ -605,6 +739,7 @@ module.exports = (socket, app) => { return element; } } + return null; } }; //# sourceMappingURL=browserWindows.js.map \ No newline at end of file diff --git a/ElectronNET.Host/api/browserWindows.js.map b/ElectronNET.Host/api/browserWindows.js.map index 23ed93c2..b9021018 100644 --- a/ElectronNET.Host/api/browserWindows.js.map +++ b/ElectronNET.Host/api/browserWindows.js.map @@ -1 +1 @@ -{"version":3,"file":"browserWindows.js","sourceRoot":"","sources":["browserWindows.ts"],"names":[],"mappings":";AACA,uCAA4D;AAC5D,+CAA0D;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,OAAO,GAA6B,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAA6B,CAAC;AAClI,IAAI,qBAAqB,GAAa,EAAE,CAAC;AACzC,IAAI,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC;AACxC,IAAI,aAAa,CAAC;AAClB,MAAM,qBAAqB,GAAgC,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC,uBAAuB,CAAC,IAAI,EAAE,CAAgC,CAAC;AAEpK,iBAAS,CAAC,MAAc,EAAE,GAAiB,EAAE,EAAE;IAC3C,cAAc,GAAG,MAAM,CAAC;IAExB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;QAChE,IAAI,QAAQ,CAAC,OAAO,EAAE;YAClB,IAAI,KAAK,GAAG,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAA;YAC/C,IAAI,KAAK,IAAI,qBAAqB,IAAI,qBAAqB,CAAC,K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EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE;gBACnB,OAAO,OAAO,CAAC;aAClB;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/browserWindows.ts b/ElectronNET.Host/api/browserWindows.ts index 6f086e2f..f2234919 100644 --- a/ElectronNET.Host/api/browserWindows.ts +++ b/ElectronNET.Host/api/browserWindows.ts @@ -1,210 +1,211 @@ import { Socket } from 'net'; import { BrowserWindow, Menu, nativeImage } from 'electron'; import { browserViewMediateService } from './browserView'; -const path = require('path'); +import * as path from 'path'; const windows: Electron.BrowserWindow[] = (global['browserWindows'] = global['browserWindows'] || []) as Electron.BrowserWindow[]; -let readyToShowWindowsIds: number[] = []; -let window, lastOptions, electronSocket; -let mainWindowURL; +const readyToShowWindowsIds: number[] = (global['readyToShowWindowsIds'] = global['readyToShowWindowsIds'] || []) as number[]; const proxyToCredentialsMap: { [proxy: string]: string } = (global['proxyToCredentialsMap'] = global['proxyToCredentialsMap'] || []) as { [proxy: string]: string }; +let window: Electron.BrowserWindow, lastOptions:Electron.BrowserWindowConstructorOptions, electronSocket: Socket; + export = (socket: Socket, app: Electron.App) => { electronSocket = socket; app.on('login', (event, webContents, request, authInfo, callback) => { if (authInfo.isProxy) { - let proxy = `${authInfo.host}:${authInfo.port}` + const proxy = `${authInfo.host}:${authInfo.port}` if (proxy in proxyToCredentialsMap && proxyToCredentialsMap[proxy].split(':').length === 2) { event.preventDefault() - let user = proxyToCredentialsMap[proxy].split(':')[0] - let pass = proxyToCredentialsMap[proxy].split(':')[1] + const user = proxyToCredentialsMap[proxy].split(':')[0] + const pass = proxyToCredentialsMap[proxy].split(':')[1] callback(user, pass) } } }) socket.on('register-browserWindow-ready-to-show', (id) => { - if (readyToShowWindowsIds.includes(id)) { - readyToShowWindowsIds = readyToShowWindowsIds.filter(value => value !== id); + const index = readyToShowWindowsIds.indexOf(id); + if (index > -1) { + readyToShowWindowsIds.splice(index, 1); electronSocket.emit('browserWindow-ready-to-show' + id); } - getWindowById(id).on('ready-to-show', () => { + getWindowById(id)?.on('ready-to-show', () => { readyToShowWindowsIds.push(id); electronSocket.emit('browserWindow-ready-to-show' + id); }); }); socket.on('register-browserWindow-page-title-updated', (id) => { - getWindowById(id).on('page-title-updated', (event, title) => { + getWindowById(id)?.on('page-title-updated', (event, title) => { electronSocket.emit('browserWindow-page-title-updated' + id, title); }); }); socket.on('register-browserWindow-close', (id) => { - getWindowById(id).on('close', () => { + getWindowById(id)?.on('close', () => { electronSocket.emit('browserWindow-close' + id); }); }); socket.on('register-browserWindow-closed', (id) => { - getWindowById(id).on('closed', () => { + getWindowById(id)?.on('closed', () => { electronSocket.emit('browserWindow-closed' + id); }); }); socket.on('register-browserWindow-session-end', (id) => { - getWindowById(id).on('session-end', () => { + getWindowById(id)?.on('session-end', () => { electronSocket.emit('browserWindow-session-end' + id); }); }); socket.on('register-browserWindow-unresponsive', (id) => { - getWindowById(id).on('unresponsive', () => { + getWindowById(id)?.on('unresponsive', () => { electronSocket.emit('browserWindow-unresponsive' + id); }); }); socket.on('register-browserWindow-responsive', (id) => { - getWindowById(id).on('responsive', () => { + getWindowById(id)?.on('responsive', () => { electronSocket.emit('browserWindow-responsive' + id); }); }); socket.on('register-browserWindow-blur', (id) => { - getWindowById(id).on('blur', () => { + getWindowById(id)?.on('blur', () => { electronSocket.emit('browserWindow-blur' + id); }); }); socket.on('register-browserWindow-focus', (id) => { - getWindowById(id).on('focus', () => { + getWindowById(id)?.on('focus', () => { electronSocket.emit('browserWindow-focus' + id); }); }); socket.on('register-browserWindow-show', (id) => { - getWindowById(id).on('show', () => { + getWindowById(id)?.on('show', () => { electronSocket.emit('browserWindow-show' + id); }); }); socket.on('register-browserWindow-hide', (id) => { - getWindowById(id).on('hide', () => { + getWindowById(id)?.on('hide', () => { electronSocket.emit('browserWindow-hide' + id); }); }); socket.on('register-browserWindow-maximize', (id) => { - getWindowById(id).on('maximize', () => { + getWindowById(id)?.on('maximize', () => { electronSocket.emit('browserWindow-maximize' + id); }); }); socket.on('register-browserWindow-unmaximize', (id) => { - getWindowById(id).on('unmaximize', () => { + getWindowById(id)?.on('unmaximize', () => { electronSocket.emit('browserWindow-unmaximize' + id); }); }); socket.on('register-browserWindow-minimize', (id) => { - getWindowById(id).on('minimize', () => { + getWindowById(id)?.on('minimize', () => { electronSocket.emit('browserWindow-minimize' + id); }); }); socket.on('register-browserWindow-restore', (id) => { - getWindowById(id).on('restore', () => { + getWindowById(id)?.on('restore', () => { electronSocket.emit('browserWindow-restore' + id); }); }); socket.on('register-browserWindow-resize', (id) => { - getWindowById(id).on('resize', () => { + getWindowById(id)?.on('resize', () => { electronSocket.emit('browserWindow-resize' + id); }); }); socket.on('register-browserWindow-move', (id) => { - getWindowById(id).on('move', () => { + getWindowById(id)?.on('move', () => { electronSocket.emit('browserWindow-move' + id); }); }); socket.on('register-browserWindow-moved', (id) => { - getWindowById(id).on('moved', () => { + getWindowById(id)?.on('moved', () => { electronSocket.emit('browserWindow-moved' + id); }); }); socket.on('register-browserWindow-enter-full-screen', (id) => { - getWindowById(id).on('enter-full-screen', () => { + getWindowById(id)?.on('enter-full-screen', () => { electronSocket.emit('browserWindow-enter-full-screen' + id); }); }); socket.on('register-browserWindow-leave-full-screen', (id) => { - getWindowById(id).on('leave-full-screen', () => { + getWindowById(id)?.on('leave-full-screen', () => { electronSocket.emit('browserWindow-leave-full-screen' + id); }); }); socket.on('register-browserWindow-enter-html-full-screen', (id) => { - getWindowById(id).on('enter-html-full-screen', () => { + getWindowById(id)?.on('enter-html-full-screen', () => { electronSocket.emit('browserWindow-enter-html-full-screen' + id); }); }); socket.on('register-browserWindow-leave-html-full-screen', (id) => { - getWindowById(id).on('leave-html-full-screen', () => { + getWindowById(id)?.on('leave-html-full-screen', () => { electronSocket.emit('browserWindow-leave-html-full-screen' + id); }); }); socket.on('register-browserWindow-app-command', (id) => { - getWindowById(id).on('app-command', (event, command) => { + getWindowById(id)?.on('app-command', (event, command) => { electronSocket.emit('browserWindow-app-command' + id, command); }); }); socket.on('register-browserWindow-scroll-touch-begin', (id) => { - getWindowById(id).on('scroll-touch-begin', () => { + getWindowById(id)?.on('scroll-touch-begin', () => { electronSocket.emit('browserWindow-scroll-touch-begin' + id); }); }); socket.on('register-browserWindow-scroll-touch-end', (id) => { - getWindowById(id).on('scroll-touch-end', () => { + getWindowById(id)?.on('scroll-touch-end', () => { electronSocket.emit('browserWindow-scroll-touch-end' + id); }); }); socket.on('register-browserWindow-scroll-touch-edge', (id) => { - getWindowById(id).on('scroll-touch-edge', () => { + getWindowById(id)?.on('scroll-touch-edge', () => { electronSocket.emit('browserWindow-scroll-touch-edge' + id); }); }); socket.on('register-browserWindow-swipe', (id) => { - getWindowById(id).on('swipe', (event, direction) => { + getWindowById(id)?.on('swipe', (event, direction) => { electronSocket.emit('browserWindow-swipe' + id, direction); }); }); socket.on('register-browserWindow-sheet-begin', (id) => { - getWindowById(id).on('sheet-begin', () => { + getWindowById(id)?.on('sheet-begin', () => { electronSocket.emit('browserWindow-sheet-begin' + id); }); }); socket.on('register-browserWindow-sheet-end', (id) => { - getWindowById(id).on('sheet-end', () => { + getWindowById(id)?.on('sheet-end', () => { electronSocket.emit('browserWindow-sheet-end' + id); }); }); socket.on('register-browserWindow-new-window-for-tab', (id) => { - getWindowById(id).on('new-window-for-tab', () => { + getWindowById(id)?.on('new-window-for-tab', () => { electronSocket.emit('browserWindow-new-window-for-tab' + id); }); }); @@ -216,12 +217,18 @@ export = (socket: Socket, app: Electron.App) => { options = { ...options, webPreferences: { nodeIntegration: true, contextIsolation: false } }; } + if (options.parent) { + options.parent = BrowserWindow.fromId(options.parent.id); + } + // we dont want to recreate the window when watch is ready. if (app.commandLine.hasSwitch('watch') && app['mainWindowURL'] === loadUrl) { window = app['mainWindow']; if (window) { window.reload(); - windows.push(window); + if (windows.findIndex(i => i.id == window.id) == -1){ + windows.push(window); + } electronSocket.emit('BrowserWindowCreated', window.id); return; } @@ -229,25 +236,27 @@ export = (socket: Socket, app: Electron.App) => { window = new BrowserWindow(options); } + const thisWindow = window; + if (options.proxy) { - window.webContents.session.setProxy({proxyRules: options.proxy}); + thisWindow.webContents.session.setProxy({proxyRules: options.proxy}); } if (options.proxy && options.proxyCredentials) { proxyToCredentialsMap[options.proxy] = options.proxyCredentials; } - - window.on('ready-to-show', () => { - if (readyToShowWindowsIds.includes(window.id)) { - readyToShowWindowsIds = readyToShowWindowsIds.filter(value => value !== window.id); + thisWindow.on('ready-to-show', () => { + const index = readyToShowWindowsIds.indexOf(thisWindow.id); + if (index > -1) { + readyToShowWindowsIds.splice(index, 1); } else { - readyToShowWindowsIds.push(window.id); + readyToShowWindowsIds.push(thisWindow.id); } }); lastOptions = options; - window.on('closed', (sender) => { + thisWindow.on('closed', (sender) => { for (let index = 0; index < windows.length; index++) { const windowItem = windows[index]; try { @@ -264,6 +273,7 @@ export = (socket: Socket, app: Electron.App) => { } }); + // this seems dangerous to assume app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. @@ -273,350 +283,352 @@ export = (socket: Socket, app: Electron.App) => { }); if (loadUrl) { - window.loadURL(loadUrl); + thisWindow.loadURL(loadUrl); } if (app.commandLine.hasSwitch('clear-cache') && app.commandLine.getSwitchValue('clear-cache')) { - window.webContents.session.clearCache(); + thisWindow.webContents.session.clearCache(); console.log('auto clear-cache active for new window.'); } // set main window url if (app['mainWindowURL'] == undefined || app['mainWindowURL'] == "") { app['mainWindowURL'] = loadUrl; - app['mainWindow'] = window; + app['mainWindow'] = thisWindow; } - windows.push(window); - electronSocket.emit('BrowserWindowCreated', window.id); + windows.push(thisWindow); + electronSocket.emit('BrowserWindowCreated', thisWindow.id); }); socket.on('browserWindowDestroy', (id) => { - getWindowById(id).destroy(); + getWindowById(id)?.destroy(); }); socket.on('browserWindowClose', (id) => { - getWindowById(id).close(); + getWindowById(id)?.close(); }); socket.on('browserWindowFocus', (id) => { - getWindowById(id).focus(); + getWindowById(id)?.focus(); }); socket.on('browserWindowBlur', (id) => { - getWindowById(id).blur(); + getWindowById(id)?.blur(); }); socket.on('browserWindowIsFocused', (id) => { - const isFocused = getWindowById(id).isFocused(); + const isFocused = getWindowById(id)?.isFocused() ?? null; - electronSocket.emit('browserWindow-isFocused-completed', isFocused); + electronSocket.emit('browserWindow-isFocused-completed' + id, isFocused); }); socket.on('browserWindowIsDestroyed', (id) => { - const isDestroyed = getWindowById(id).isDestroyed(); - - electronSocket.emit('browserWindow-isDestroyed-completed', isDestroyed); + const w = getWindowById(id); + if (w) { + const isDestroyed = w.isDestroyed(); + electronSocket.emit('browserWindow-isDestroyed-completed', isDestroyed); + } }); socket.on('browserWindowShow', (id) => { - getWindowById(id).show(); + getWindowById(id)?.show(); }); socket.on('browserWindowShowInactive', (id) => { - getWindowById(id).showInactive(); + getWindowById(id)?.showInactive(); }); socket.on('browserWindowHide', (id) => { - getWindowById(id).hide(); + getWindowById(id)?.hide(); }); socket.on('browserWindowIsVisible', (id) => { - const isVisible = getWindowById(id).isVisible(); + const isVisible = getWindowById(id)?.isVisible() ?? null; - electronSocket.emit('browserWindow-isVisible-completed', isVisible); + electronSocket.emit('browserWindow-isVisible-completed' + id, isVisible); }); socket.on('browserWindowIsModal', (id) => { - const isModal = getWindowById(id).isModal(); + const isModal = getWindowById(id)?.isModal() ?? null; - electronSocket.emit('browserWindow-isModal-completed', isModal); + electronSocket.emit('browserWindow-isModal-completed' + id, isModal); }); socket.on('browserWindowMaximize', (id) => { - getWindowById(id).maximize(); + getWindowById(id)?.maximize(); }); socket.on('browserWindowUnmaximize', (id) => { - getWindowById(id).unmaximize(); + getWindowById(id)?.unmaximize(); }); socket.on('browserWindowIsMaximized', (id) => { - const isMaximized = getWindowById(id).isMaximized(); + const isMaximized = getWindowById(id)?.isMaximized() ?? null; - electronSocket.emit('browserWindow-isMaximized-completed', isMaximized); + electronSocket.emit('browserWindow-isMaximized-completed' + id, isMaximized); }); socket.on('browserWindowMinimize', (id) => { - getWindowById(id).minimize(); + getWindowById(id)?.minimize(); }); socket.on('browserWindowRestore', (id) => { - getWindowById(id).restore(); + getWindowById(id)?.restore(); }); socket.on('browserWindowIsMinimized', (id) => { - const isMinimized = getWindowById(id).isMinimized(); + const isMinimized = getWindowById(id)?.isMinimized() ?? null; - electronSocket.emit('browserWindow-isMinimized-completed', isMinimized); + electronSocket.emit('browserWindow-isMinimized-completed' + id, isMinimized); }); socket.on('browserWindowSetFullScreen', (id, fullscreen) => { - getWindowById(id).setFullScreen(fullscreen); + getWindowById(id)?.setFullScreen(fullscreen); }); socket.on('browserWindowIsFullScreen', (id) => { - const isFullScreen = getWindowById(id).isFullScreen(); + const isFullScreen = getWindowById(id)?.isFullScreen() ?? null; - electronSocket.emit('browserWindow-isFullScreen-completed', isFullScreen); + electronSocket.emit('browserWindow-isFullScreen-completed' + id, isFullScreen); }); socket.on('browserWindowSetAspectRatio', (id, aspectRatio, extraSize) => { - getWindowById(id).setAspectRatio(aspectRatio, extraSize); + getWindowById(id)?.setAspectRatio(aspectRatio, extraSize); }); socket.on('browserWindowPreviewFile', (id, path, displayname) => { - getWindowById(id).previewFile(path, displayname); + getWindowById(id)?.previewFile(path, displayname); }); socket.on('browserWindowCloseFilePreview', (id) => { - getWindowById(id).closeFilePreview(); + getWindowById(id)?.closeFilePreview(); }); socket.on('browserWindowSetBounds', (id, bounds, animate) => { - getWindowById(id).setBounds(bounds, animate); + getWindowById(id)?.setBounds(bounds, animate); }); socket.on('browserWindowGetBounds', (id) => { - const rectangle = getWindowById(id).getBounds(); + const rectangle = getWindowById(id)?.getBounds() ?? null; - electronSocket.emit('browserWindow-getBounds-completed', rectangle); + electronSocket.emit('browserWindow-getBounds-completed' + id, rectangle); }); socket.on('browserWindowSetContentBounds', (id, bounds, animate) => { - getWindowById(id).setContentBounds(bounds, animate); + getWindowById(id)?.setContentBounds(bounds, animate); }); socket.on('browserWindowGetContentBounds', (id) => { - const rectangle = getWindowById(id).getContentBounds(); + const rectangle = getWindowById(id)?.getContentBounds() ?? null; - electronSocket.emit('browserWindow-getContentBounds-completed', rectangle); + electronSocket.emit('browserWindow-getContentBounds-completed' + id, rectangle); }); socket.on('browserWindowSetSize', (id, width, height, animate) => { - getWindowById(id).setSize(width, height, animate); + getWindowById(id)?.setSize(width, height, animate); }); socket.on('browserWindowGetSize', (id) => { - const size = getWindowById(id).getSize(); + const size = getWindowById(id)?.getSize() ?? null; - electronSocket.emit('browserWindow-getSize-completed', size); + electronSocket.emit('browserWindow-getSize-completed' + id, size); }); socket.on('browserWindowSetContentSize', (id, width, height, animate) => { - getWindowById(id).setContentSize(width, height, animate); + getWindowById(id)?.setContentSize(width, height, animate); }); socket.on('browserWindowGetContentSize', (id) => { - const size = getWindowById(id).getContentSize(); + const size = getWindowById(id)?.getContentSize() ?? null; - electronSocket.emit('browserWindow-getContentSize-completed', size); + electronSocket.emit('browserWindow-getContentSize-completed' + id, size); }); socket.on('browserWindowSetMinimumSize', (id, width, height) => { - getWindowById(id).setMinimumSize(width, height); + getWindowById(id)?.setMinimumSize(width, height); }); socket.on('browserWindowGetMinimumSize', (id) => { - const size = getWindowById(id).getMinimumSize(); + const size = getWindowById(id)?.getMinimumSize() ?? null; - electronSocket.emit('browserWindow-getMinimumSize-completed', size); + electronSocket.emit('browserWindow-getMinimumSize-completed' + id, size); }); socket.on('browserWindowSetMaximumSize', (id, width, height) => { - getWindowById(id).setMaximumSize(width, height); + getWindowById(id)?.setMaximumSize(width, height); }); socket.on('browserWindowGetMaximumSize', (id) => { - const size = getWindowById(id).getMaximumSize(); + const size = getWindowById(id)?.getMaximumSize() ?? null; - electronSocket.emit('browserWindow-getMaximumSize-completed', size); + electronSocket.emit('browserWindow-getMaximumSize-completed' + id, size); }); socket.on('browserWindowSetResizable', (id, resizable) => { - getWindowById(id).setResizable(resizable); + getWindowById(id)?.setResizable(resizable); }); socket.on('browserWindowIsResizable', (id) => { - const resizable = getWindowById(id).isResizable(); + const resizable = getWindowById(id)?.isResizable() ?? null; - electronSocket.emit('browserWindow-isResizable-completed', resizable); + electronSocket.emit('browserWindow-isResizable-completed' + id, resizable); }); socket.on('browserWindowSetMovable', (id, movable) => { - getWindowById(id).setMovable(movable); + getWindowById(id)?.setMovable(movable); }); socket.on('browserWindowIsMovable', (id) => { - const movable = getWindowById(id).isMovable(); + const movable = getWindowById(id)?.isMovable() ?? null; - electronSocket.emit('browserWindow-isMovable-completed', movable); + electronSocket.emit('browserWindow-isMovable-completed' + id, movable); }); socket.on('browserWindowSetMinimizable', (id, minimizable) => { - getWindowById(id).setMinimizable(minimizable); + getWindowById(id)?.setMinimizable(minimizable); }); socket.on('browserWindowIsMinimizable', (id) => { - const minimizable = getWindowById(id).isMinimizable(); + const minimizable = getWindowById(id)?.isMinimizable() ?? null; - electronSocket.emit('browserWindow-isMinimizable-completed', minimizable); + electronSocket.emit('browserWindow-isMinimizable-completed' + id, minimizable); }); socket.on('browserWindowSetMaximizable', (id, maximizable) => { - getWindowById(id).setMaximizable(maximizable); + getWindowById(id)?.setMaximizable(maximizable); }); socket.on('browserWindowIsMaximizable', (id) => { - const maximizable = getWindowById(id).isMaximizable(); + const maximizable = getWindowById(id)?.isMaximizable() ?? null; - electronSocket.emit('browserWindow-isMaximizable-completed', maximizable); + electronSocket.emit('browserWindow-isMaximizable-completed' + id, maximizable); }); socket.on('browserWindowSetFullScreenable', (id, fullscreenable) => { - getWindowById(id).setFullScreenable(fullscreenable); + getWindowById(id)?.setFullScreenable(fullscreenable); }); socket.on('browserWindowIsFullScreenable', (id) => { - const fullscreenable = getWindowById(id).isFullScreenable(); + const fullscreenable = getWindowById(id)?.isFullScreenable() ?? null; - electronSocket.emit('browserWindow-isFullScreenable-completed', fullscreenable); + electronSocket.emit('browserWindow-isFullScreenable-completed' + id, fullscreenable); }); socket.on('browserWindowSetClosable', (id, closable) => { - getWindowById(id).setClosable(closable); + getWindowById(id)?.setClosable(closable); }); socket.on('browserWindowIsClosable', (id) => { - const closable = getWindowById(id).isClosable(); + const closable = getWindowById(id)?.isClosable() ?? null; - electronSocket.emit('browserWindow-isClosable-completed', closable); + electronSocket.emit('browserWindow-isClosable-completed' + id, closable); }); socket.on('browserWindowSetAlwaysOnTop', (id, flag, level, relativeLevel) => { - getWindowById(id).setAlwaysOnTop(flag, level, relativeLevel); + getWindowById(id)?.setAlwaysOnTop(flag, level, relativeLevel); }); socket.on('browserWindowIsAlwaysOnTop', (id) => { - const isAlwaysOnTop = getWindowById(id).isAlwaysOnTop(); + const isAlwaysOnTop = getWindowById(id)?.isAlwaysOnTop() ?? null; - electronSocket.emit('browserWindow-isAlwaysOnTop-completed', isAlwaysOnTop); + electronSocket.emit('browserWindow-isAlwaysOnTop-completed' + id, isAlwaysOnTop); }); socket.on('browserWindowCenter', (id) => { - getWindowById(id).center(); + getWindowById(id)?.center(); }); socket.on('browserWindowSetPosition', (id, x, y, animate) => { - getWindowById(id).setPosition(x, y, animate); + getWindowById(id)?.setPosition(x, y, animate); }); socket.on('browserWindowGetPosition', (id) => { - const position = getWindowById(id).getPosition(); + const position = getWindowById(id)?.getPosition() ?? null; - electronSocket.emit('browserWindow-getPosition-completed', position); + electronSocket.emit('browserWindow-getPosition-completed' + id, position); }); socket.on('browserWindowSetTitle', (id, title) => { - getWindowById(id).setTitle(title); + getWindowById(id)?.setTitle(title); }); socket.on('browserWindowGetTitle', (id) => { - const title = getWindowById(id).getTitle(); + const title = getWindowById(id)?.getTitle() ?? null; - electronSocket.emit('browserWindow-getTitle-completed', title); + electronSocket.emit('browserWindow-getTitle-completed' + id, title); }); socket.on('browserWindowSetTitle', (id, title) => { - getWindowById(id).setTitle(title); + getWindowById(id)?.setTitle(title); }); socket.on('browserWindowSetSheetOffset', (id, offsetY, offsetX) => { if (offsetX) { - getWindowById(id).setSheetOffset(offsetY, offsetX); + getWindowById(id)?.setSheetOffset(offsetY, offsetX); } else { - getWindowById(id).setSheetOffset(offsetY); + getWindowById(id)?.setSheetOffset(offsetY); } }); socket.on('browserWindowFlashFrame', (id, flag) => { - getWindowById(id).flashFrame(flag); + getWindowById(id)?.flashFrame(flag); }); socket.on('browserWindowSetSkipTaskbar', (id, skip) => { - getWindowById(id).setSkipTaskbar(skip); + getWindowById(id)?.setSkipTaskbar(skip); }); socket.on('browserWindowSetKiosk', (id, flag) => { - getWindowById(id).setKiosk(flag); + getWindowById(id)?.setKiosk(flag); }); socket.on('browserWindowIsKiosk', (id) => { - const isKiosk = getWindowById(id).isKiosk(); + const isKiosk = getWindowById(id)?.isKiosk() ?? null; - electronSocket.emit('browserWindow-isKiosk-completed', isKiosk); + electronSocket.emit('browserWindow-isKiosk-completed' + id, isKiosk); }); socket.on('browserWindowGetNativeWindowHandle', (id) => { - const nativeWindowHandle = getWindowById(id).getNativeWindowHandle().readInt32LE(0).toString(16); - electronSocket.emit('browserWindow-getNativeWindowHandle-completed', nativeWindowHandle); + const nativeWindowHandle = getWindowById(id)?.getNativeWindowHandle()?.readInt32LE(0)?.toString(16) ?? null; + electronSocket.emit('browserWindow-getNativeWindowHandle-completed' + id, nativeWindowHandle); }); socket.on('browserWindowSetRepresentedFilename', (id, filename) => { - getWindowById(id).setRepresentedFilename(filename); + getWindowById(id)?.setRepresentedFilename(filename); }); socket.on('browserWindowGetRepresentedFilename', (id) => { - const pathname = getWindowById(id).getRepresentedFilename(); + const pathname = getWindowById(id)?.getRepresentedFilename() ?? null; - electronSocket.emit('browserWindow-getRepresentedFilename-completed', pathname); + electronSocket.emit('browserWindow-getRepresentedFilename-completed' + id, pathname); }); socket.on('browserWindowSetDocumentEdited', (id, edited) => { - getWindowById(id).setDocumentEdited(edited); + getWindowById(id)?.setDocumentEdited(edited); }); socket.on('browserWindowIsDocumentEdited', (id) => { - const edited = getWindowById(id).isDocumentEdited(); + const edited = getWindowById(id)?.isDocumentEdited() ?? null; - electronSocket.emit('browserWindow-isDocumentEdited-completed', edited); + electronSocket.emit('browserWindow-isDocumentEdited-completed' + id, edited); }); socket.on('browserWindowFocusOnWebView', (id) => { - getWindowById(id).focusOnWebView(); + getWindowById(id)?.focusOnWebView(); }); socket.on('browserWindowBlurWebView', (id) => { - getWindowById(id).blurWebView(); + getWindowById(id)?.blurWebView(); }); socket.on('browserWindowLoadURL', (id, url, options) => { - getWindowById(id).loadURL(url, options); + getWindowById(id)?.loadURL(url, options); }); socket.on('browserWindowReload', (id) => { - getWindowById(id).reload(); + getWindowById(id)?.reload(); }); socket.on('browserWindowSetMenu', (id, menuItems) => { @@ -630,11 +642,11 @@ export = (socket: Socket, app: Electron.App) => { }); } - getWindowById(id).setMenu(menu); + getWindowById(id)?.setMenu(menu); }); socket.on('browserWindowRemoveMenu', (id) => { - getWindowById(id).removeMenu(); + getWindowById(id)?.removeMenu(); }); function addMenuItemClickConnector(menuItems, callback) { @@ -650,21 +662,21 @@ export = (socket: Socket, app: Electron.App) => { } socket.on('browserWindowSetProgressBar', (id, progress) => { - getWindowById(id).setProgressBar(progress); + getWindowById(id)?.setProgressBar(progress); }); socket.on('browserWindowSetProgressBar', (id, progress, options) => { - getWindowById(id).setProgressBar(progress, options); + getWindowById(id)?.setProgressBar(progress, options); }); socket.on('browserWindowSetHasShadow', (id, hasShadow) => { - getWindowById(id).setHasShadow(hasShadow); + getWindowById(id)?.setHasShadow(hasShadow); }); socket.on('browserWindowHasShadow', (id) => { - const hasShadow = getWindowById(id).hasShadow(); + const hasShadow = getWindowById(id)?.hasShadow() ?? null; - electronSocket.emit('browserWindow-hasShadow-completed', hasShadow); + electronSocket.emit('browserWindow-hasShadow-completed' + id, hasShadow); }); socket.on('browserWindowSetThumbarButtons', (id, thumbarButtons: Electron.ThumbarButton[]) => { @@ -676,102 +688,102 @@ export = (socket: Socket, app: Electron.App) => { }; }); - const success = getWindowById(id).setThumbarButtons(thumbarButtons); - electronSocket.emit('browserWindowSetThumbarButtons-completed', success); + const success = getWindowById(id)?.setThumbarButtons(thumbarButtons) ?? null; + electronSocket.emit('browserWindowSetThumbarButtons-completed' + id, success); }); socket.on('browserWindowSetThumbnailClip', (id, rectangle) => { - getWindowById(id).setThumbnailClip(rectangle); + getWindowById(id)?.setThumbnailClip(rectangle); }); socket.on('browserWindowSetThumbnailToolTip', (id, toolTip) => { - getWindowById(id).setThumbnailToolTip(toolTip); + getWindowById(id)?.setThumbnailToolTip(toolTip); }); socket.on('browserWindowSetAppDetails', (id, options) => { - getWindowById(id).setAppDetails(options); + getWindowById(id)?.setAppDetails(options); }); socket.on('browserWindowShowDefinitionForSelection', (id) => { - getWindowById(id).showDefinitionForSelection(); + getWindowById(id)?.showDefinitionForSelection(); }); socket.on('browserWindowSetAutoHideMenuBar', (id, hide) => { - getWindowById(id).setAutoHideMenuBar(hide); + getWindowById(id)?.setAutoHideMenuBar(hide); }); socket.on('browserWindowIsMenuBarAutoHide', (id) => { - const isMenuBarAutoHide = getWindowById(id).isMenuBarAutoHide(); + const isMenuBarAutoHide = getWindowById(id)?.isMenuBarAutoHide() ?? null; - electronSocket.emit('browserWindow-isMenuBarAutoHide-completed', isMenuBarAutoHide); + electronSocket.emit('browserWindow-isMenuBarAutoHide-completed' + id, isMenuBarAutoHide); }); socket.on('browserWindowSetMenuBarVisibility', (id, visible) => { - getWindowById(id).setMenuBarVisibility(visible); + getWindowById(id)?.setMenuBarVisibility(visible); }); socket.on('browserWindowIsMenuBarVisible', (id) => { - const isMenuBarVisible = getWindowById(id).isMenuBarVisible(); + const isMenuBarVisible = getWindowById(id)?.isMenuBarVisible() ?? null; - electronSocket.emit('browserWindow-isMenuBarVisible-completed', isMenuBarVisible); + electronSocket.emit('browserWindow-isMenuBarVisible-completed' + id, isMenuBarVisible); }); socket.on('browserWindowSetVisibleOnAllWorkspaces', (id, visible) => { - getWindowById(id).setVisibleOnAllWorkspaces(visible); + getWindowById(id)?.setVisibleOnAllWorkspaces(visible); }); socket.on('browserWindowIsVisibleOnAllWorkspaces', (id) => { - const isVisibleOnAllWorkspaces = getWindowById(id).isVisibleOnAllWorkspaces(); + const isVisibleOnAllWorkspaces = getWindowById(id)?.isVisibleOnAllWorkspaces() ?? null; - electronSocket.emit('browserWindow-isVisibleOnAllWorkspaces-completed', isVisibleOnAllWorkspaces); + electronSocket.emit('browserWindow-isVisibleOnAllWorkspaces-completed' + id, isVisibleOnAllWorkspaces); }); socket.on('browserWindowSetIgnoreMouseEvents', (id, ignore) => { - getWindowById(id).setIgnoreMouseEvents(ignore); + getWindowById(id)?.setIgnoreMouseEvents(ignore); }); socket.on('browserWindowSetContentProtection', (id, enable) => { - getWindowById(id).setContentProtection(enable); + getWindowById(id)?.setContentProtection(enable); }); socket.on('browserWindowSetFocusable', (id, focusable) => { - getWindowById(id).setFocusable(focusable); + getWindowById(id)?.setFocusable(focusable); }); socket.on('browserWindowSetParentWindow', (id, parent) => { const browserWindow = BrowserWindow.fromId(parent.id); - getWindowById(id).setParentWindow(browserWindow); + getWindowById(id)?.setParentWindow(browserWindow); }); socket.on('browserWindowGetParentWindow', (id) => { - const browserWindow = getWindowById(id).getParentWindow(); + const browserWindow = getWindowById(id)?.getParentWindow() ?? null; - electronSocket.emit('browserWindow-getParentWindow-completed', browserWindow.id); + electronSocket.emit('browserWindow-getParentWindow-completed' + id, browserWindow.id); }); socket.on('browserWindowGetChildWindows', (id) => { - const browserWindows = getWindowById(id).getChildWindows(); + const browserWindows = getWindowById(id)?.getChildWindows() ?? null; - const ids = []; + const ids = []; - browserWindows.forEach(x => { - ids.push(x.id); - }); + browserWindows.forEach(x => { + ids.push(x.id); + }); - electronSocket.emit('browserWindow-getChildWindows-completed', ids); + electronSocket.emit('browserWindow-getChildWindows-completed' + id, ids); }); socket.on('browserWindowSetAutoHideCursor', (id, autoHide) => { - getWindowById(id).setAutoHideCursor(autoHide); + getWindowById(id)?.setAutoHideCursor(autoHide); }); socket.on('browserWindowSetVibrancy', (id, type) => { - getWindowById(id).setVibrancy(type); + getWindowById(id)?.setVibrancy(type); }); socket.on('browserWindow-setBrowserView', (id, browserViewId) => { - getWindowById(id).setBrowserView(browserViewMediateService(browserViewId)); + getWindowById(id)?.setBrowserView(browserViewMediateService(browserViewId)); }); function getWindowById(id: number): Electron.BrowserWindow { @@ -781,5 +793,6 @@ export = (socket: Socket, app: Electron.App) => { return element; } } + return null; } }; diff --git a/ElectronNET.Host/api/clipboard.js b/ElectronNET.Host/api/clipboard.js index f7e7ef10..9ff87515 100644 --- a/ElectronNET.Host/api/clipboard.js +++ b/ElectronNET.Host/api/clipboard.js @@ -55,7 +55,6 @@ module.exports = (socket) => { socket.on('clipboard-writeImage', (data, type) => { const dataContent = JSON.parse(data); const image = electron_1.nativeImage.createEmpty(); - // tslint:disable-next-line: forin for (const key in dataContent) { const scaleFactor = key; const bytes = data[key]; diff --git a/ElectronNET.Host/api/clipboard.js.map b/ElectronNET.Host/api/clipboard.js.map index c45e255f..43394ebd 100644 --- a/ElectronNET.Host/api/clipboard.js.map +++ b/ElectronNET.Host/api/clipboard.js.map @@ -1 +1 @@ -{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["clipboard.ts"],"names":[],"mappings":";AACA,uCAAkD;AAClD,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,oBAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,cAAc,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC5C,oBAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAA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;YACxB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACxB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC5C,KAAK,CAAC,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;SAC1E;QAED,oBAAS,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/clipboard.ts b/ElectronNET.Host/api/clipboard.ts index 6a172299..645bd432 100644 --- a/ElectronNET.Host/api/clipboard.ts +++ b/ElectronNET.Host/api/clipboard.ts @@ -71,7 +71,6 @@ export = (socket: Socket) => { const dataContent = JSON.parse(data); const image = nativeImage.createEmpty(); - // tslint:disable-next-line: forin for (const key in dataContent) { const scaleFactor = key; const bytes = data[key]; diff --git a/ElectronNET.Host/api/dialog.js b/ElectronNET.Host/api/dialog.js index 20f9572f..5234bcb1 100644 --- a/ElectronNET.Host/api/dialog.js +++ b/ElectronNET.Host/api/dialog.js @@ -7,12 +7,12 @@ module.exports = (socket) => { if ('id' in browserWindow) { const window = electron_1.BrowserWindow.fromId(browserWindow.id); const messageBoxReturnValue = await electron_1.dialog.showMessageBox(window, options); - electronSocket.emit('showMessageBoxComplete' + guid, [messageBoxReturnValue.response, messageBoxReturnValue.checkboxChecked]); + electronSocket.emit('showMessageBoxComplete' + guid, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } else { const id = guid || options; const messageBoxReturnValue = await electron_1.dialog.showMessageBox(browserWindow); - electronSocket.emit('showMessageBoxComplete' + id, [messageBoxReturnValue.response, messageBoxReturnValue.checkboxChecked]); + electronSocket.emit('showMessageBoxComplete' + id, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } }); socket.on('showOpenDialog', async (browserWindow, options, guid) => { diff --git a/ElectronNET.Host/api/dialog.js.map b/ElectronNET.Host/api/dialog.js.map index 26467177..e40802d3 100644 --- a/ElectronNET.Host/api/dialog.js.map +++ b/ElectronNET.Host/api/dialog.js.map @@ -1 +1 @@ -{"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":";AACA,uCAAiD;AACjD,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/D,IAAI,IAAI,IAAI,aAAa,EAAE;YACvB,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YAEtD,MAAM,qBAAqB,GAAG,MAAM,iBAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3E,cAAc,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC;SACjI;aAAM;YACH,MAAM,EAAE,GAAG,IAAI,IAAI,OAAO,CAAC;YAC3B,MAAM,qBAAqB,GAAG,MAAM,iBAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YAEzE,cAAc,CAAC,IAAI,CAAC,wBAAwB,GAAG,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC;SAC/H;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/D,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CA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,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/D,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACtD,MAAM,qBAAqB,GAAG,MAAM,iBAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE3E,cAAc,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,EAAE,qBAAqB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACzC,iBAAM,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,4BAA4B,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC3E,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACtD,MAAM,iBAAM,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEzD,cAAc,CAAC,IAAI,CAAC,oCAAoC,GAAG,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/dialog.ts b/ElectronNET.Host/api/dialog.ts index 932c5fdc..095f7b49 100644 --- a/ElectronNET.Host/api/dialog.ts +++ b/ElectronNET.Host/api/dialog.ts @@ -9,12 +9,12 @@ export = (socket: Socket) => { const window = BrowserWindow.fromId(browserWindow.id); const messageBoxReturnValue = await dialog.showMessageBox(window, options); - electronSocket.emit('showMessageBoxComplete' + guid, [messageBoxReturnValue.response, messageBoxReturnValue.checkboxChecked]); + electronSocket.emit('showMessageBoxComplete' + guid, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } else { const id = guid || options; const messageBoxReturnValue = await dialog.showMessageBox(browserWindow); - electronSocket.emit('showMessageBoxComplete' + id, [messageBoxReturnValue.response, messageBoxReturnValue.checkboxChecked]); + electronSocket.emit('showMessageBoxComplete' + id, { response: messageBoxReturnValue.response, checked: messageBoxReturnValue.checkboxChecked }); } }); diff --git a/ElectronNET.Host/api/globalShortcut.js b/ElectronNET.Host/api/globalShortcut.js index dd018d02..742da4e5 100644 --- a/ElectronNET.Host/api/globalShortcut.js +++ b/ElectronNET.Host/api/globalShortcut.js @@ -19,7 +19,9 @@ module.exports = (socket) => { try { electron_1.globalShortcut.unregisterAll(); } - catch (error) { } + catch (error) { + console.error(error); + } }); }; //# sourceMappingURL=globalShortcut.js.map \ No newline at end of file diff --git a/ElectronNET.Host/api/globalShortcut.js.map b/ElectronNET.Host/api/globalShortcut.js.map index bed5642c..2cab736e 100644 --- a/ElectronNET.Host/api/globalShortcut.js.map +++ b/ElectronNET.Host/api/globalShortcut.js.map @@ -1 +1 @@ -{"version":3,"file":"globalShortcut.js","sourceRoot":"","sources":["globalShortcut.ts"],"names":[],"mappings":";AAAA,uCAA0C;AAE1C,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,CAAC,WAAW,EAAE,EAAE;QACjD,yBAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;YACtC,cAAc,CAAC,IAAI,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,6BAA6B,EAAE,CAAC,WAAW,EAAE,EAAE;QACrD,MAAM,YAAY,GAAG,yBAAc,CAAC,YAAY,C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H,MAAM,CAAC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC3C,IAAI;YACA,yBAAc,CAAC,aAAa,EAAE,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/globalShortcut.ts b/ElectronNET.Host/api/globalShortcut.ts index da9e7652..bad981f0 100644 --- a/ElectronNET.Host/api/globalShortcut.ts +++ b/ElectronNET.Host/api/globalShortcut.ts @@ -23,6 +23,8 @@ export = (socket: Socket) => { socket.on('globalShortcut-unregisterAll', () => { try { globalShortcut.unregisterAll(); - } catch (error) { } + } catch (error) { + console.error(error); + } }); }; diff --git a/ElectronNET.Host/api/menu.js b/ElectronNET.Host/api/menu.js index 2500036f..28fac07e 100644 --- a/ElectronNET.Host/api/menu.js +++ b/ElectronNET.Host/api/menu.js @@ -7,7 +7,7 @@ module.exports = (socket) => { socket.on('menu-setContextMenu', (browserWindowId, menuItems) => { const menu = electron_1.Menu.buildFromTemplate(menuItems); addContextMenuItemClickConnector(menu.items, browserWindowId, (id, windowId) => { - electronSocket.emit('contextMenuItemClicked', [id, windowId]); + electronSocket.emit('contextMenuItemClicked', { id: id, windowId: windowId }); }); const index = contextMenuItems.findIndex(contextMenu => contextMenu.browserWindowId === browserWindowId); const contextMenuItem = { diff --git a/ElectronNET.Host/api/menu.js.map b/ElectronNET.Host/api/menu.js.map index 1ad421e4..75447e25 100644 --- a/ElectronNET.Host/api/menu.js.map +++ b/ElectronNET.Host/api/menu.js.map @@ -1 +1 @@ -{"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":";AACA,uCAA+C;AAC/C,MAAM,gBAAgB,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC;AACzF,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,EAAE,QAAQ;QAClD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACvB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/C,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aAC3D;YAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/menu.ts b/ElectronNET.Host/api/menu.ts index efadf31d..4385ab0c 100644 --- a/ElectronNET.Host/api/menu.ts +++ b/ElectronNET.Host/api/menu.ts @@ -9,7 +9,7 @@ export = (socket: Socket) => { const menu = Menu.buildFromTemplate(menuItems); addContextMenuItemClickConnector(menu.items, browserWindowId, (id, windowId) => { - electronSocket.emit('contextMenuItemClicked', [id, windowId]); + electronSocket.emit('contextMenuItemClicked', { id: id, windowId: windowId }); }); const index = contextMenuItems.findIndex(contextMenu => contextMenu.browserWindowId === browserWindowId); diff --git a/ElectronNET.Host/api/process.js b/ElectronNET.Host/api/process.js new file mode 100644 index 00000000..36c08b4a --- /dev/null +++ b/ElectronNET.Host/api/process.js @@ -0,0 +1,62 @@ +"use strict"; +let electronSocket; +module.exports = (socket) => { + electronSocket = socket; + socket.on('process-execPath', () => { + const value = process.execPath; + electronSocket.emit('process-execPath-Completed', value); + }); + socket.on('process-argv', () => { + const value = process.argv; + electronSocket.emit('process-argv-Completed', value); + }); + socket.on('process-type', () => { + const value = process.type; + electronSocket.emit('process-type-Completed', value); + }); + socket.on('process-versions', () => { + const value = process.versions; + electronSocket.emit('process-versions-Completed', value); + }); + socket.on('process-defaultApp', () => { + if (process.defaultApp === undefined) { + electronSocket.emit('process-defaultApp-Completed', false); + return; + } + electronSocket.emit('process-defaultApp-Completed', process.defaultApp); + }); + socket.on('process-isMainFrame', () => { + if (process.isMainFrame === undefined) { + electronSocket.emit('process-isMainFrame-Completed', false); + return; + } + electronSocket.emit('process-isMainFrame-Completed', process.isMainFrame); + }); + socket.on('process-resourcesPath', () => { + const value = process.resourcesPath; + electronSocket.emit('process-resourcesPath-Completed', value); + }); + socket.on('process-uptime', () => { + let value = process.uptime(); + if (value === undefined) { + value = -1; + } + electronSocket.emit('process-uptime-Completed', value); + }); + socket.on('process-pid', () => { + if (process.pid === undefined) { + electronSocket.emit('process-pid-Completed', -1); + return; + } + electronSocket.emit('process-pid-Completed', process.pid); + }); + socket.on('process-arch', () => { + const value = process.arch; + electronSocket.emit('process-arch-Completed', value); + }); + socket.on('process-platform', () => { + const value = process.platform; + electronSocket.emit('process-platform-Completed', value); + }); +}; +//# sourceMappingURL=process.js.map \ No newline at end of file diff --git a/ElectronNET.Host/api/process.js.map b/ElectronNET.Host/api/process.js.map new file mode 100644 index 00000000..096946ca --- /dev/null +++ b/ElectronNET.Host/api/process.js.map @@ -0,0 +1 @@ +{"version":3,"file":"process.js","sourceRoot":"","sources":["process.ts"],"names":[],"mappings":";AACA,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IAExB,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC/B,cAAc,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,cAAc,CAAC,IAAI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E,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC7B,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,KAAK,KAAK,SAAS,EAAE;YACrB,KAAK,GAAG,CAAC,CAAC,CAAC;SACd;QACD,cAAc,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QAC1B,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE;YAC3B,cAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO;SACV;QACD,cAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,cAAc,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC/B,cAAc,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAA;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/process.ts b/ElectronNET.Host/api/process.ts new file mode 100644 index 00000000..ad04dbf2 --- /dev/null +++ b/ElectronNET.Host/api/process.ts @@ -0,0 +1,73 @@ +import { Socket } from 'net'; +let electronSocket; + +export = (socket: Socket) => { + electronSocket = socket; + + socket.on('process-execPath', () => { + const value = process.execPath; + electronSocket.emit('process-execPath-Completed', value); + }); + + socket.on('process-argv', () => { + const value = process.argv; + electronSocket.emit('process-argv-Completed', value); + }); + + socket.on('process-type', () => { + const value = process.type; + electronSocket.emit('process-type-Completed', value); + }); + + socket.on('process-versions', () => { + const value = process.versions; + electronSocket.emit('process-versions-Completed', value); + }); + + socket.on('process-defaultApp', () => { + if (process.defaultApp === undefined) { + electronSocket.emit('process-defaultApp-Completed', false); + return; + } + electronSocket.emit('process-defaultApp-Completed', process.defaultApp); + }); + + socket.on('process-isMainFrame', () => { + if (process.isMainFrame === undefined) { + electronSocket.emit('process-isMainFrame-Completed', false); + return; + } + electronSocket.emit('process-isMainFrame-Completed', process.isMainFrame); + }); + + socket.on('process-resourcesPath', () => { + const value = process.resourcesPath; + electronSocket.emit('process-resourcesPath-Completed', value); + }); + + socket.on('process-uptime', () => { + let value = process.uptime(); + if (value === undefined) { + value = -1; + } + electronSocket.emit('process-uptime-Completed', value); + }); + + socket.on('process-pid', () => { + if (process.pid === undefined) { + electronSocket.emit('process-pid-Completed', -1); + return; + } + electronSocket.emit('process-pid-Completed', process.pid); + }); + + socket.on('process-arch', () => { + const value = process.arch; + electronSocket.emit('process-arch-Completed', value); + }); + + socket.on('process-platform', () => { + const value = process.platform; + electronSocket.emit('process-platform-Completed', value); + }) +}; diff --git a/ElectronNET.Host/api/screen.js b/ElectronNET.Host/api/screen.js index cfd025a3..d522a8b5 100644 --- a/ElectronNET.Host/api/screen.js +++ b/ElectronNET.Host/api/screen.js @@ -15,7 +15,7 @@ module.exports = (socket) => { }); socket.on('register-screen-display-metrics-changed', (id) => { electron_1.screen.on('display-metrics-changed', (event, display, changedMetrics) => { - electronSocket.emit('screen-display-metrics-changed-event' + id, [display, changedMetrics]); + electronSocket.emit('screen-display-metrics-changed-event' + id, { display: display, changedMetrics: changedMetrics }); }); }); socket.on('screen-getCursorScreenPoint', () => { diff --git a/ElectronNET.Host/api/screen.js.map b/ElectronNET.Host/api/screen.js.map index 1514a5e9..2fc6f62f 100644 --- a/ElectronNET.Host/api/screen.js.map +++ b/ElectronNET.Host/api/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AQ,CAAC;QACnD,cAAc,CAAC,IAAI,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACvC,MAAM,OAAO,GAAG,iBAAM,CAAC,iBAAiB,EAAE,CAAC;QAC3C,cAAc,CAAC,IAAI,CAAC,mCAAmC,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACpC,MAAM,OAAO,GAAG,iBAAM,CAAC,cAAc,EAAE,CAAC;QACxC,cAAc,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,+BAA+B,EAAE,CAAC,KAAK,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,iBAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QACrD,cAAc,CAAC,IAAI,CAAC,wCAAwC,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,2BAA2B,EAAE,CAAC,SAAS,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,iBAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACrD,cAAc,CAAC,IAAI,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/screen.ts b/ElectronNET.Host/api/screen.ts index 3a8b91cc..4ee61499 100644 --- a/ElectronNET.Host/api/screen.ts +++ b/ElectronNET.Host/api/screen.ts @@ -18,7 +18,7 @@ export = (socket: Socket) => { socket.on('register-screen-display-metrics-changed', (id) => { screen.on('display-metrics-changed', (event, display, changedMetrics) => { - electronSocket.emit('screen-display-metrics-changed-event' + id, [display, changedMetrics]); + electronSocket.emit('screen-display-metrics-changed-event' + id, { display: display, changedMetrics: changedMetrics }); }); }); diff --git a/ElectronNET.Host/api/shell.js b/ElectronNET.Host/api/shell.js index 0bf8c89e..2b27630f 100644 --- a/ElectronNET.Host/api/shell.js +++ b/ElectronNET.Host/api/shell.js @@ -25,7 +25,7 @@ module.exports = (socket) => { } electronSocket.emit('shell-openExternalCompleted', result); }); - socket.on('shell-trashItem', async (fullPath, deleteOnFail) => { + socket.on('shell-trashItem', async (fullPath) => { let success = false; try { await electron_1.shell.trashItem(fullPath); diff --git a/ElectronNET.Host/api/shell.js.map b/ElectronNET.Host/api/shell.js.map index 83dbfa2b..49882b76 100644 --- a/ElectronNET.Host/api/shell.js.map +++ b/ElectronNET.Host/api/shell.js.map @@ -1 +1 @@ -{"version":3,"file":"shell.js","sourceRoot":"","sources":["shell.ts"],"names":[],"mappings":";AACA,uCAAiC;AACjC,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC7C,gBAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAEjC,cAAc,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACvC,MAAM,YAAY,GAAG,MAAM,gBAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEhD,cAAc,CAAC,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;QACnD,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,IAA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index 9a0dfd7f..3cfb5d3b 100644 --- a/ElectronNET.Host/api/shell.ts +++ b/ElectronNET.Host/api/shell.ts @@ -32,7 +32,7 @@ export = (socket: Socket) => { electronSocket.emit('shell-openExternalCompleted', result); }); - socket.on('shell-trashItem', async (fullPath, deleteOnFail) => { + socket.on('shell-trashItem', async (fullPath) => { let success = false; try { diff --git a/ElectronNET.Host/api/tray.js b/ElectronNET.Host/api/tray.js index 98fb740c..c653a210 100644 --- a/ElectronNET.Host/api/tray.js +++ b/ElectronNET.Host/api/tray.js @@ -1,27 +1,27 @@ "use strict"; const electron_1 = require("electron"); -let tray = (global['$tray'] = global['tray'] || { value: null }); +const tray = (global['$tray'] = global['tray'] || { value: null }); let electronSocket; module.exports = (socket) => { electronSocket = socket; socket.on('register-tray-click', (id) => { if (tray.value) { tray.value.on('click', (event, bounds) => { - electronSocket.emit('tray-click-event' + id, [event.__proto__, bounds]); + electronSocket.emit('tray-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); socket.on('register-tray-right-click', (id) => { if (tray.value) { tray.value.on('right-click', (event, bounds) => { - electronSocket.emit('tray-right-click-event' + id, [event.__proto__, bounds]); + electronSocket.emit('tray-right-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); socket.on('register-tray-double-click', (id) => { if (tray.value) { tray.value.on('double-click', (event, bounds) => { - electronSocket.emit('tray-double-click-event' + id, [event.__proto__, bounds]); + electronSocket.emit('tray-double-click-event' + id, { eventArgs: event.__proto__, bounds: bounds }); }); } }); diff --git a/ElectronNET.Host/api/tray.js.map b/ElectronNET.Host/api/tray.js.map index 6a84a7ad..6ef16201 100644 --- a/ElectronNET.Host/api/tray.js.map +++ b/ElectronNET.Host/api/tray.js.map @@ -1 +1 @@ -{"version":3,"file":"tray.js","sourceRoot":"","sources":["tray.ts"],"names":[],"mappings":";AACA,uCAAmD;AACnD,IAAI,IAAI,GAA6B,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM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,IAAI,CAAC,EAAE,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/tray.ts b/ElectronNET.Host/api/tray.ts index af9f6cf2..05793195 100644 --- a/ElectronNET.Host/api/tray.ts +++ b/ElectronNET.Host/api/tray.ts @@ -1,6 +1,6 @@ import { Socket } from 'net'; import { Menu, Tray, nativeImage } from 'electron'; -let tray: { value: Electron.Tray } = (global['$tray'] = global['tray'] || { value: null }); +const tray: { value: Electron.Tray } = (global['$tray'] = global['tray'] || { value: null }); let electronSocket; export = (socket: Socket) => { @@ -8,7 +8,7 @@ export = (socket: Socket) => { socket.on('register-tray-click', (id) => { if (tray.value) { tray.value.on('click', (event, bounds) => { - electronSocket.emit('tray-click-event' + id, [(event).__proto__, bounds]); + electronSocket.emit('tray-click-event' + id, {eventArgs: (event).__proto__, bounds: bounds }); }); } }); @@ -16,7 +16,7 @@ export = (socket: Socket) => { socket.on('register-tray-right-click', (id) => { if (tray.value) { tray.value.on('right-click', (event, bounds) => { - electronSocket.emit('tray-right-click-event' + id, [(event).__proto__, bounds]); + electronSocket.emit('tray-right-click-event' + id, { eventArgs: (event).__proto__, bounds: bounds }); }); } }); @@ -24,7 +24,7 @@ export = (socket: Socket) => { socket.on('register-tray-double-click', (id) => { if (tray.value) { tray.value.on('double-click', (event, bounds) => { - electronSocket.emit('tray-double-click-event' + id, [(event).__proto__, bounds]); + electronSocket.emit('tray-double-click-event' + id, { eventArgs: (event).__proto__, bounds: bounds }); }); } }); diff --git a/ElectronNET.Host/api/webContents.js b/ElectronNET.Host/api/webContents.js index 71829a81..5c899469 100644 --- a/ElectronNET.Host/api/webContents.js +++ b/ElectronNET.Host/api/webContents.js @@ -1,7 +1,7 @@ "use strict"; const electron_1 = require("electron"); const browserView_1 = require("./browserView"); -const fs = require('fs'); +const fs = require("fs"); let electronSocket; module.exports = (socket) => { electronSocket = socket; @@ -29,20 +29,20 @@ module.exports = (socket) => { }); socket.on('webContents-getPrinters', async (id) => { const printers = await getWindowById(id).webContents.getPrinters(); - electronSocket.emit('webContents-getPrinters-completed', printers); + electronSocket.emit('webContents-getPrinters-completed' + id, printers); }); socket.on('webContents-print', async (id, options = {}) => { await getWindowById(id).webContents.print(options); - electronSocket.emit('webContents-print-completed', true); + electronSocket.emit('webContents-print-completed' + id, true); }); socket.on('webContents-printToPDF', async (id, options = {}, path) => { const buffer = await getWindowById(id).webContents.printToPDF(options); fs.writeFile(path, buffer, (error) => { if (error) { - electronSocket.emit('webContents-printToPDF-completed', false); + electronSocket.emit('webContents-printToPDF-completed' + id, false); } else { - electronSocket.emit('webContents-printToPDF-completed', true); + electronSocket.emit('webContents-printToPDF-completed' + id, true); } }); }); @@ -141,7 +141,7 @@ module.exports = (socket) => { const browserWindow = getWindowById(id); browserWindow.webContents.session.cookies.removeAllListeners('changed'); browserWindow.webContents.session.cookies.on('changed', (event, cookie, cause, removed) => { - electronSocket.emit('webContents-session-cookies-changed' + id, [cookie, cause, removed]); + electronSocket.emit('webContents-session-cookies-changed' + id, { cookie: cookie, cause: cause, removed: removed }); }); }); socket.on('webContents-session-cookies-get', async (id, filter, guid) => { @@ -201,7 +201,7 @@ module.exports = (socket) => { Object.keys(extensionsList).forEach(key => { chromeExtensionInfo.push(extensionsList[key]); }); - electronSocket.emit('webContents-session-getAllExtensions-completed', chromeExtensionInfo); + electronSocket.emit('webContents-session-getAllExtensions-completed' + id, chromeExtensionInfo); }); socket.on('webContents-session-removeExtension', (id, name) => { const browserWindow = getWindowById(id); @@ -210,11 +210,11 @@ module.exports = (socket) => { socket.on('webContents-session-loadExtension', async (id, path, allowFileAccess = false) => { const browserWindow = getWindowById(id); const extension = await browserWindow.webContents.session.loadExtension(path, { allowFileAccess: allowFileAccess }); - electronSocket.emit('webContents-session-loadExtension-completed', extension); + electronSocket.emit('webContents-session-loadExtension-completed' + id, extension); }); function getWindowById(id) { if (id >= 1000) { - return browserView_1.browserViewMediateService(id - 1000); + return (0, browserView_1.browserViewMediateService)(id - 1000); } return electron_1.BrowserWindow.fromId(id); } diff --git a/ElectronNET.Host/api/webContents.js.map b/ElectronNET.Host/api/webContents.js.map index 7e6eed71..53d0e3ea 100644 --- a/ElectronNET.Host/api/webContents.js.map +++ b/ElectronNET.Host/api/webContents.js.map @@ -1 +1 @@ -{"version":3,"file":"webContents.js","sourceRoot":"","sources":["webContents.ts"],"names":[],"mappings":";AACA,uCAAsD;AACtD,+CAA0D;AAC1D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,IAAI,cAAc,CAAC;AAEnB,iBAAS,CAAC,MAAc,EAAE,EAAE;IACxB,cAAc,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,8BAA8B,EAAE,CAAC,EAAE,EAAE,EAAE;QAC7C,MAAM,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAExC,aAAa,CAAC,WAAW,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACxD,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACtD,cAAc,CAAC,IAAI,CAAC,qBAAqB,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,oCAAoC,EAAE,CAAC,EAAE,EAAE,EAAE;QACnD,MAAM,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAExC,aAAa,CAAC,WAAW,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;QAChE,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACjD,cAAc,CA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,CAAC,EAAE,CAAC,qCAAqC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;QAC1D,MAAM,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QACxC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,mCAAmC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,GAAG,KAAK,EAAE,EAAE;QACvF,MAAM,aAAa,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,CAAC;QAEpH,cAAc,CAAC,IAAI,CAAC,6CAA6C,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;IAEH,SAAS,aAAa,CAAC,EAAU;QAE7B,IAAI,EAAE,IAAI,IAAI,EAAE;YACZ,OAAO,IAAA,uCAAyB,EAAC,EAAE,GAAG,IAAI,CAAC,CAAC;SAC/C;QAED,OAAO,wBAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;AACL,CAAC,CAAC"} \ No newline at end of file diff --git a/ElectronNET.Host/api/webContents.ts b/ElectronNET.Host/api/webContents.ts index dfb4df30..1e178662 100644 --- a/ElectronNET.Host/api/webContents.ts +++ b/ElectronNET.Host/api/webContents.ts @@ -1,7 +1,7 @@ import { Socket } from 'net'; import { BrowserWindow, BrowserView } from 'electron'; import { browserViewMediateService } from './browserView'; -const fs = require('fs'); +import * as fs from 'fs'; let electronSocket; export = (socket: Socket) => { @@ -34,12 +34,12 @@ export = (socket: Socket) => { socket.on('webContents-getPrinters', async (id) => { const printers = await getWindowById(id).webContents.getPrinters(); - electronSocket.emit('webContents-getPrinters-completed', printers); + electronSocket.emit('webContents-getPrinters-completed' + id, printers); }); socket.on('webContents-print', async (id, options = {}) => { await getWindowById(id).webContents.print(options); - electronSocket.emit('webContents-print-completed', true); + electronSocket.emit('webContents-print-completed' + id, true); }); socket.on('webContents-printToPDF', async (id, options = {}, path) => { @@ -47,9 +47,9 @@ export = (socket: Socket) => { fs.writeFile(path, buffer, (error) => { if (error) { - electronSocket.emit('webContents-printToPDF-completed', false); + electronSocket.emit('webContents-printToPDF-completed' + id, false); } else { - electronSocket.emit('webContents-printToPDF-completed', true); + electronSocket.emit('webContents-printToPDF-completed' + id, true); } }); }); @@ -181,7 +181,7 @@ export = (socket: Socket) => { browserWindow.webContents.session.cookies.removeAllListeners('changed'); browserWindow.webContents.session.cookies.on('changed', (event, cookie, cause, removed) => { - electronSocket.emit('webContents-session-cookies-changed' + id, [cookie, cause, removed]); + electronSocket.emit('webContents-session-cookies-changed' + id, { cookie: cookie, cause: cause, removed: removed }); }); }); @@ -253,7 +253,7 @@ export = (socket: Socket) => { chromeExtensionInfo.push(extensionsList[key]); }); - electronSocket.emit('webContents-session-getAllExtensions-completed', chromeExtensionInfo); + electronSocket.emit('webContents-session-getAllExtensions-completed' + id, chromeExtensionInfo); }); socket.on('webContents-session-removeExtension', (id, name) => { @@ -265,7 +265,7 @@ export = (socket: Socket) => { const browserWindow = getWindowById(id); const extension = await browserWindow.webContents.session.loadExtension(path, { allowFileAccess: allowFileAccess }); - electronSocket.emit('webContents-session-loadExtension-completed', extension); + electronSocket.emit('webContents-session-loadExtension-completed' + id, extension); }); function getWindowById(id: number): Electron.BrowserWindow | Electron.BrowserView { diff --git a/ElectronNET.Host/electron.manifest.json b/ElectronNET.Host/electron.manifest.json index 014fdec0..ddb69580 100644 --- a/ElectronNET.Host/electron.manifest.json +++ b/ElectronNET.Host/electron.manifest.json @@ -10,7 +10,7 @@ "build": { "appId": "com.{{executable}}.app", "productName": "{{executable}}", - "copyright": "Copyright © 2020", + "copyright": "Copyright © 2019-2022", "buildVersion": "1.0.0", "compression": "maximum", "directories": { diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 37d8be8b..47f1a39c 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -5,6 +5,7 @@ const path = require('path'); const cProcess = require('child_process').spawn; const portscanner = require('portscanner'); const { imageSize } = require('image-size'); + let io, server, browserWindows, ipc, apiProcess, loadURL; let appApi, menu, dialogApi, notification, tray, webContents; let globalShortcut, shellApi, screen, clipboard, autoUpdater; @@ -15,9 +16,11 @@ let mainWindowId, nativeTheme; let dock; let launchFile; let launchUrl; +let processApi; let manifestJsonFileName = 'electron.manifest.json'; let watchable = false; + if (app.commandLine.hasSwitch('manifest')) { manifestJsonFileName = app.commandLine.getSwitchValue('manifest'); }; @@ -54,7 +57,7 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { args.forEach(parameter => { const words = parameter.split('='); - if(words.length > 1) { + if (words.length > 1) { app.commandLine.appendSwitch(words[0].replace('--', ''), words[1]); } else { app.commandLine.appendSwitch(words[0].replace('--', '')); @@ -75,6 +78,27 @@ if (manifestJsonFile.singleInstance || manifestJsonFile.aspCoreBackendPort) { } } +// Bypass all SSL/TLS certificate errors. -- Less secure. +if (manifestJsonFile.ignoreAllCertificateErrors) { + console.log('All SSL/TLS Certificate errors will be ignored.'); + app.commandLine.appendSwitch('ignore-certificate-errors'); +} + +// Bypass SSL/TLS certificate errors only for the domain names specified in the electron.manifest.json file. +if (manifestJsonFile.hasOwnProperty('domainNamesToIgnoreCertificateErrors')) { + if (manifestJsonFile.domainNamesToIgnoreCertificateErrors.length > 0) { + console.log(`SSL/TLS certificate errors will be ignored for ${manifestJsonFile.domainNamesToIgnoreCertificateErrors.join(', ')}`); + + app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { + if (shouldIgnoreCertificateForUrl(url)) { + console.log('SSL/TLS certificate error ignored for URL: ' + url); + event.preventDefault() + callback(true) + } + }) + } +} + app.on('ready', () => { // Fix ERR_UNKNOWN_URL_SCHEME using file protocol @@ -101,7 +125,16 @@ app.on('ready', () => { app.on('quit', async (event, exitCode) => { await server.close(); - apiProcess.kill(); + + var detachedProcess = false; + + if (manifestJsonFile.hasOwnProperty('detachedProcess')) { + detachedProcess = manifestJsonFile.detachedProcess; + } + + if (!detachedProcess) { + apiProcess.kill(); + } }); function isSplashScreenEnabled() { @@ -118,7 +151,7 @@ function startSplashScreen() { let imageFile = path.join(currentBinPath, manifestJsonFile.splashscreen.imageFile); imageSize(imageFile, (error, dimensions) => { if (error) { - console.log(`load splashscreen error:`); + console.log('load splashscreen error:'); console.error(error); throw new Error(error.message); @@ -136,13 +169,28 @@ function startSplashScreen() { alwaysOnTop: true, show: true }); + + if (manifestJsonFile.hasOwnProperty('splashscreen')) { + if (manifestJsonFile.splashscreen.hasOwnProperty('timeout')) { + var timeout = manifestJsonFile.splashscreen.timeout; + setTimeout((t) => { + if (splashScreen) { + splashScreen.hide(); + } + }, timeout); + } + } + + splashScreen.setIgnoreMouseEvents(true); app.once('browser-window-created', () => { splashScreen.destroy(); + splashScreen = null; }); const loadSplashscreenUrl = path.join(__dirname, 'splashscreen', 'index.html') + '?imgPath=' + imageFile; + splashScreen.loadURL('file://' + loadSplashscreenUrl); splashScreen.once('closed', () => { @@ -217,6 +265,7 @@ function startSocketApiBridge(port) { if (powerMonitor === undefined) powerMonitor = require('./api/powerMonitor')(socket); if (nativeTheme === undefined) nativeTheme = require('./api/nativeTheme')(socket); if (dock === undefined) dock = require('./api/dock')(socket); + if (processApi === undefined) processApi = require('./api/process')(socket); socket.on('register-app-open-file-event', (id) => { global['electronsocket'] = socket; @@ -246,6 +295,14 @@ function startSocketApiBridge(port) { } }); + socket.on('console-stdout', (data) => { + console.log(`stdout: ${data.toString()}`); + }); + + socket.on('console-stderr', (data) => { + console.log(`stderr: ${data.toString()}`); + }); + try { const hostHookScriptFilePath = path.join(__dirname, 'ElectronHostHook', 'index.js'); @@ -281,7 +338,7 @@ function startAspCoreBackend(electronPort) { function startBackend(aspCoreBackendPort) { console.log('ASP.NET Core Port: ' + aspCoreBackendPort); loadURL = `http://localhost:${aspCoreBackendPort}`; - const parameters = [getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`]; + const parameters = [getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`, `/electronPID=${process.pid}`]; let binaryFile = manifestJsonFile.executable; const os = require('os'); @@ -289,12 +346,47 @@ function startAspCoreBackend(electronPort) { binaryFile = binaryFile + '.exe'; } + var detachedProcess = false; + var stdioopt = 'pipe'; + + if (manifestJsonFile.hasOwnProperty('detachedProcess')) { + detachedProcess = manifestJsonFile.detachedProcess; + if (detachedProcess) { + stdioopt = 'ignore'; + } + } + let binFilePath = path.join(currentBinPath, binaryFile); - var options = { cwd: currentBinPath }; + + var options = { cwd: currentBinPath, detached: detachedProcess, stdio: stdioopt }; + apiProcess = cProcess(binFilePath, parameters, options); - apiProcess.stdout.on('data', (data) => { - console.log(`stdout: ${data.toString()}`); + if (!detachedProcess) { + apiProcess.stdout.on('data', (data) => { + console.log(`stdout: ${data.toString()}`); + }); + + apiProcess.stderr.on('data', (data) => { + console.log(`stderr: ${data.toString()}`); + }); + } + + apiProcess.on('close', (code) => { + console.log(`ASP.NET Process exited with code ${code}`); + if (code != 0) { + console.log(`Will quit Electron, as exit code != 0 (got ${code})`); + app.exit(code); + } + }); + + if (detachedProcess) { + console.log('Detached from ASP.NET process'); + apiProcess.unref(); + } + + apiProcess.stderr.on('data', (data) => { + console.log(`stderr: ${data.toString()}`); }); } } @@ -312,16 +404,47 @@ function startAspCoreBackendWithWatch(electronPort) { function startBackend(aspCoreBackendPort) { console.log('ASP.NET Core Watch Port: ' + aspCoreBackendPort); loadURL = `http://localhost:${aspCoreBackendPort}`; - const parameters = ['watch', 'run', getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`]; + const parameters = ['watch', 'run', getEnvironmentParameter(), `/electronPort=${electronPort}`, `/electronWebPort=${aspCoreBackendPort}`, `/electronPID=${process.pid}`]; + + var detachedProcess = false; + var stdioopt = 'pipe'; + + if (manifestJsonFile.hasOwnProperty('detachedProcess')) { + detachedProcess = manifestJsonFile.detachedProcess; + if (detachedProcess) { + stdioopt = 'ignore'; + } + } + + var options = { cwd: currentBinPath, env: process.env, detached: detachedProcess, stdio: stdioopt }; - var options = { - cwd: currentBinPath, - env: process.env, - }; apiProcess = cProcess('dotnet', parameters, options); - apiProcess.stdout.on('data', (data) => { - console.log(`stdout: ${data.toString()}`); + if (!detachedProcess) { + apiProcess.stdout.on('data', (data) => { + console.log(`stdout: ${data.toString()}`); + }); + + apiProcess.stderr.on('data', (data) => { + console.log(`stderr: ${data.toString()}`); + }); + } + + apiProcess.on('close', (code) => { + console.log(`ASP.NET Process exited with code ${code}`); + if (code != 0) { + console.log(`Will quit Electron, as exit code != 0 (got ${code})`); + app.exit(code); + } + }); + + if (detachedProcess) { + console.log('Detached from ASP.NET process'); + apiProcess.unref(); + } + + apiProcess.stderr.on('data', (data) => { + console.log(`stderr: ${data.toString()}`); }); } } @@ -333,3 +456,15 @@ function getEnvironmentParameter() { return ''; } + +function shouldIgnoreCertificateForUrl(url) { + if (manifestJsonFile.hasOwnProperty('domainNamesToIgnoreCertificateErrors')) { + // Removing the scheme from the url so it will cover https and wss:// + const urlWithoutScheme = url.replace(/(^\w+:|^)\/\//, ''); + const sites = manifestJsonFile.domainNamesToIgnoreCertificateErrors.filter((oneSite) => urlWithoutScheme.startsWith(oneSite)); + + return sites.length > 0; + } + + return false; +} diff --git a/ElectronNET.Host/package-lock.json b/ElectronNET.Host/package-lock.json index 0f24a4ac..7af0992e 100644 --- a/ElectronNET.Host/package-lock.json +++ b/ElectronNET.Host/package-lock.json @@ -1,122 +1,2936 @@ { "name": "electron.net.host", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "electron.net.host", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "dasherize": "^2.0.0", + "electron-updater": "^4.6.5", + "image-size": "^1.0.0", + "portscanner": "^2.2.0", + "socket.io": "^4.4.1" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.18.0", + "@typescript-eslint/parser": "^5.18.0", + "electron": "^18.0.2", + "eslint": "^8.12.0", + "typescript": "^4.6.3" + } + }, + "node_modules/@electron/get": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.14.1.tgz", + "integrity": "sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "got": "^9.6.0", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" + }, + "engines": { + "node": ">=8.6" + }, + "optionalDependencies": { + "global-agent": "^3.0.0", + "global-tunnel-ng": "^2.7.1" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", + "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.1", + "globals": "^13.9.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@socket.io/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@types/component-emitter": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", + "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==" + }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" + }, + "node_modules/@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.11.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", + "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + }, + "node_modules/@types/semver": { + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.18.0.tgz", + "integrity": "sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/type-utils": "5.18.0", + "@typescript-eslint/utils": "5.18.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.4.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.18.0.tgz", + "integrity": "sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/typescript-estree": "5.18.0", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz", + "integrity": "sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/visitor-keys": "5.18.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz", + "integrity": "sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "5.18.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.18.0.tgz", + "integrity": "sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz", + "integrity": "sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/visitor-keys": "5.18.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.4.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.18.0.tgz", + "integrity": "sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/typescript-estree": "5.18.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz", + "integrity": "sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.18.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/boolean": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", + "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", + "dev": true, + "optional": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/builder-util-runtime": { + "version": "8.9.2", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.9.2.tgz", + "integrity": "sha512-rhuKm5vh7E0aAmT6i8aoSfEjxzdYEFX7zDApK+eNgOhjofnWb74d9SRJv0H/8nsgOkos0TZ4zxW0P8J4N7xQ2A==", + "dependencies": { + "debug": "^4.3.2", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "optional": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dasherize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", + "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "optional": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true, + "optional": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "node_modules/electron": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-18.0.2.tgz", + "integrity": "sha512-7bFKptQDCQBMjjTJEXs0p0KiZPoY28fzq4GnYGorQt4NZJ0TAog8L0NxEkuSJHuIWC/siOUTX0C1H1tWO6KPKQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@electron/get": "^1.13.0", + "@types/node": "^16.11.26", + "extract-zip": "^1.0.3" + }, + "bin": { + "electron": "cli.js" + }, + "engines": { + "node": ">= 8.6" + } + }, + "node_modules/electron-updater": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.6.5.tgz", + "integrity": "sha512-kdTly8O9mSZfm9fslc1mnCY+mYOeaYRy7ERa2Fed240u01BKll3aiupzkd07qKw69KvhBSzuHroIW3mF0D8DWA==", + "dependencies": { + "@types/semver": "^7.3.6", + "builder-util-runtime": "8.9.2", + "fs-extra": "^10.0.0", + "js-yaml": "^4.1.0", + "lazy-val": "^1.0.5", + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "semver": "^7.3.5" + } + }, + "node_modules/electron-updater/node_modules/fs-extra": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/electron-updater/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/electron-updater/node_modules/semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dependencies": { + "lru-cache": "^7.4.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/electron-updater/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/engine.io": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", + "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", + "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.4.1", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", + "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", + "dependencies": { + "@socket.io/base64-arraybuffer": "~1.0.2" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "optional": true + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.2.1", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/espree": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", + "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "dev": true, + "dependencies": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + } + }, + "node_modules/extract-zip/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/extract-zip/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/global-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "es6-error": "^4.1.1", + "matcher": "^3.0.0", + "roarr": "^2.15.3", + "semver": "^7.3.2", + "serialize-error": "^7.0.1" + }, + "engines": { + "node": ">=10.0" + } + }, + "node_modules/global-agent/node_modules/semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "optional": true, + "dependencies": { + "lru-cache": "^7.4.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/global-tunnel-ng": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz", + "integrity": "sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg==", + "dev": true, + "optional": true, + "dependencies": { + "encodeurl": "^1.0.2", + "lodash": "^4.17.10", + "npm-conf": "^1.1.3", + "tunnel": "^0.0.6" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", + "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", + "dev": true, + "optional": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/image-size": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.1.tgz", + "integrity": "sha512-VAwkvNSNGClRw9mDHhc5Efax8PLlsOGcUTh0T/LIriC8vPA3U5PdqXWqkz406MoYHMKW8Uf9gWr05T/rYB44kQ==", + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "optional": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-like": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", + "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", + "dependencies": { + "lodash.isfinite": "^3.3.2" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true, + "optional": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/lazy-val": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", + "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, + "node_modules/lodash.isfinite": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", + "integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz", + "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/matcher": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", + "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", + "dev": true, + "optional": true, + "dependencies": { + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-conf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz", + "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==", + "dev": true, + "optional": true, + "dependencies": { + "config-chain": "^1.1.11", + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true, + "optional": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/portscanner": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.2.0.tgz", + "integrity": "sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==", + "dependencies": { + "async": "^2.6.0", + "is-number-like": "^1.0.3" + }, + "engines": { + "node": ">=0.4", + "npm": ">=1.0.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true, + "optional": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/roarr": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", + "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "detect-node": "^2.0.4", + "globalthis": "^1.0.1", + "json-stringify-safe": "^5.0.1", + "semver-compare": "^1.0.0", + "sprintf-js": "^1.1.2" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true, + "optional": true + }, + "node_modules/serialize-error": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", + "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", + "dev": true, + "optional": true, + "dependencies": { + "type-fest": "^0.13.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/socket.io": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", + "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~6.1.0", + "socket.io-adapter": "~2.3.3", + "socket.io-parser": "~4.0.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", + "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==" + }, + "node_modules/socket.io-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", + "dependencies": { + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true, + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sumchecker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", + "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", + "dev": true, + "dependencies": { + "debug": "^4.1.0" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "node_modules/typescript": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "dependencies": { + "prepend-http": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/ws": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + }, "dependencies": { - "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "@electron/get": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.14.1.tgz", + "integrity": "sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "global-agent": "^3.0.0", + "global-tunnel-ng": "^2.7.1", + "got": "^9.6.0", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" + } + }, + "@eslint/eslintrc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", + "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.1", + "globals": "^13.9.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@socket.io/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==" + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "defer-to-connect": "^1.0.1" } }, - "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "@types/component-emitter": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", + "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==" + }, + "@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" + }, + "@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "@types/node": { + "version": "16.11.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", + "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + }, + "@types/semver": { + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==" + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.18.0.tgz", + "integrity": "sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/type-utils": "5.18.0", + "@typescript-eslint/utils": "5.18.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "requires": { + "lru-cache": "^7.4.0" + } + } } }, - "@electron/get": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.4.tgz", - "integrity": "sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==", + "@typescript-eslint/parser": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.18.0.tgz", + "integrity": "sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ==", "dev": true, "requires": { - "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "global-agent": "^2.0.2", - "global-tunnel-ng": "^2.7.1", - "got": "^9.6.0", - "progress": "^2.0.3", - "semver": "^6.2.0", - "sumchecker": "^3.0.1" + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/typescript-estree": "5.18.0", + "debug": "^4.3.2" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz", + "integrity": "sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/visitor-keys": "5.18.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz", + "integrity": "sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "5.18.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.18.0.tgz", + "integrity": "sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz", + "integrity": "sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/visitor-keys": "5.18.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "requires": { + "lru-cache": "^7.4.0" + } } } }, - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true + "@typescript-eslint/utils": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.18.0.tgz", + "integrity": "sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.18.0", + "@typescript-eslint/types": "5.18.0", + "@typescript-eslint/typescript-estree": "5.18.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "@typescript-eslint/visitor-keys": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz", + "integrity": "sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg==", "dev": true, "requires": { - "defer-to-connect": "^1.0.1" + "@typescript-eslint/types": "5.18.0", + "eslint-visitor-keys": "^3.0.0" } }, - "@types/node": { - "version": "15.14.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.14.0.tgz", - "integrity": "sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ==", + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true }, - "@types/semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-0caWDWmpCp0uifxFh+FaqK3CuZ2SkRR/ZRxAV5+zNdC3QVUi6wyOJnefhPvtNt8NQWXB5OA93BUvZsXpWat2Xw==" + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "async": { "version": "2.6.3", @@ -126,36 +2940,21 @@ "lodash": "^4.17.14" } }, - "backo2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base64-arraybuffer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", - "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=" - }, "base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, - "blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" - }, "boolean": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.1.2.tgz", - "integrity": "sha512-YN6UmV0FfLlBVvRvNPx3pz5W/mUoYB24J4WSXOKP/OOJpi+Oq6WYqPaNTHzjI0QzwWtnvEd5CGYyQPgp1jFxnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", + "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", "dev": true, "optional": true }, @@ -169,6 +2968,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -176,36 +2984,20 @@ "dev": true }, "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "builder-util-runtime": { - "version": "8.7.5", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.5.tgz", - "integrity": "sha512-fgUFHKtMNjdvH6PDRFntdIGUPgwZ69sXsAqEulCtoiqgWes5agrMq/Ud274zjJRTbckYh2PHh8/1CpFc6dpsbQ==", + "version": "8.9.2", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.9.2.tgz", + "integrity": "sha512-rhuKm5vh7E0aAmT6i8aoSfEjxzdYEFX7zDApK+eNgOhjofnWb74d9SRJv0H/8nsgOkos0TZ4zxW0P8J4N7xQ2A==", "requires": { "debug": "^4.3.2", "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - } } }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -238,23 +3030,20 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - } + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "clone-response": { @@ -267,41 +3056,25 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -332,33 +3105,45 @@ } }, "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" - }, - "core-js": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.15.2.tgz", - "integrity": "sha512-tKs41J7NJVuaya8DxIOCnl8QuPHx5/ZVbFo1oKgVl1qHFBBrDctzQGtuLjPpRdNTWmKPH6oEvgN/MUID+l485Q==", - "dev": true, - "optional": true + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "dasherize": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } @@ -372,6 +3157,12 @@ "mimic-response": "^1.0.0" } }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -395,11 +3186,23 @@ "dev": true, "optional": true }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } }, "duplexer3": { "version": "0.1.4", @@ -408,62 +3211,41 @@ "dev": true }, "electron": { - "version": "13.1.5", - "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.5.tgz", - "integrity": "sha512-ZoMCcPQNs/zO/Zdb5hq5H+rwRaKrdI3/sfXEwBVMx7f5jwa9jPQB3dZ2+7t59uD9VcFAWsH/pozr8nPPlv0tyw==", + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-18.0.2.tgz", + "integrity": "sha512-7bFKptQDCQBMjjTJEXs0p0KiZPoY28fzq4GnYGorQt4NZJ0TAog8L0NxEkuSJHuIWC/siOUTX0C1H1tWO6KPKQ==", "dev": true, "requires": { - "@electron/get": "^1.0.1", - "@types/node": "^14.6.2", + "@electron/get": "^1.13.0", + "@types/node": "^16.11.26", "extract-zip": "^1.0.3" - }, - "dependencies": { - "@types/node": { - "version": "14.17.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.4.tgz", - "integrity": "sha512-8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5A==", - "dev": true - } } }, "electron-updater": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.3.9.tgz", - "integrity": "sha512-LCNfedSwZfS4Hza+pDyPR05LqHtGorCStaBgVpRnfKxOlZcvpYEX0AbMeH5XUtbtGRoH2V8osbbf2qKPNb7AsA==", + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.6.5.tgz", + "integrity": "sha512-kdTly8O9mSZfm9fslc1mnCY+mYOeaYRy7ERa2Fed240u01BKll3aiupzkd07qKw69KvhBSzuHroIW3mF0D8DWA==", "requires": { - "@types/semver": "^7.3.5", - "builder-util-runtime": "8.7.5", + "@types/semver": "^7.3.6", + "builder-util-runtime": "8.9.2", "fs-extra": "^10.0.0", "js-yaml": "^4.1.0", - "lazy-val": "^1.0.4", + "lazy-val": "^1.0.5", "lodash.escaperegexp": "^4.1.2", "lodash.isequal": "^4.5.0", "semver": "^7.3.5" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "requires": { - "argparse": "^2.0.1" - } - }, "jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -473,6 +3255,14 @@ "universalify": "^2.0.0" } }, + "semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "requires": { + "lru-cache": "^7.4.0" + } + }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -497,71 +3287,28 @@ } }, "engine.io": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.5.0.tgz", - "integrity": "sha512-21HlvPUKaitDGE4GXNtQ7PLP0Sz4aWLddMPw2VTyFz1FVZqu/kZsJUO8WNpKuE/OCL7nkfRaOui2ZCJloGznGA==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", + "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", "requires": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", "cookie": "~0.4.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "~7.4.2" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "engine.io-client": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.2.tgz", - "integrity": "sha512-QEqIp+gJ/kMHeUun7f5Vv3bteRHppHH/FMBQX/esFj/fuYfjyUKWGMo3VCvIP/V8bE9KcjHmRZrhIz2Z9oNsDA==", - "requires": { - "component-emitter": "~1.3.0", - "component-inherit": "0.0.3", - "debug": "~3.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "ws": "~7.4.2", - "xmlhttprequest-ssl": "~1.6.2", - "yeast": "0.1.2" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3" } }, "engine.io-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", - "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", + "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", "requires": { - "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.4", - "blob": "0.0.5", - "has-binary2": "~1.0.2" + "@socket.io/base64-arraybuffer": "~1.0.2" } }, "env-paths": { @@ -581,13 +3328,157 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", "dev": true, - "optional": true + "requires": { + "@eslint/eslintrc": "^1.2.1", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true + }, + "espree": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", + "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "dev": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "extract-zip": { @@ -619,6 +3510,57 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -628,6 +3570,40 @@ "pend": "~1.2.0" } }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -645,10 +3621,10 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, "get-stream": { @@ -661,9 +3637,9 @@ } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -674,20 +3650,40 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, "global-agent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.2.0.tgz", - "integrity": "sha512-+20KpaW6DDLqhG7JDiJpD1JvNvb8ts+TNl7BPOYcURqCrXqnN1Vf+XVOrkKJAFPqfX+oEhsdzOj1hLWkBTdNJg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", "dev": true, "optional": true, "requires": { "boolean": "^3.0.1", - "core-js": "^3.6.5", "es6-error": "^4.1.1", "matcher": "^3.0.0", "roarr": "^2.15.3", "semver": "^7.3.2", "serialize-error": "^7.0.1" + }, + "dependencies": { + "semver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "dev": true, + "optional": true, + "requires": { + "lru-cache": "^7.4.0" + } + } } }, "global-tunnel-ng": { @@ -703,6 +3699,23 @@ "tunnel": "^0.0.6" } }, + "globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, "globalthis": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", @@ -713,6 +3726,20 @@ "define-properties": "^1.1.3" } }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -733,36 +3760,14 @@ } }, "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "requires": { - "isarray": "2.0.1" - } - }, - "has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "http-cache-semantics": { @@ -771,18 +3776,35 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, "image-size": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.0.tgz", - "integrity": "sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.1.tgz", + "integrity": "sha512-VAwkvNSNGClRw9mDHhc5Efax8PLlsOGcUTh0T/LIriC8vPA3U5PdqXWqkz406MoYHMKW8Uf9gWr05T/rYB44kQ==", "requires": { "queue": "6.0.2" } }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true }, "inflight": { "version": "1.0.6", @@ -806,15 +3828,27 @@ "dev": true, "optional": true }, - "is-core-module": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", - "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { - "has": "^1.0.3" + "is-extglob": "^2.1.1" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-number-like": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", @@ -824,24 +3858,23 @@ } }, "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "json-buffer": { @@ -850,6 +3883,18 @@ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -880,6 +3925,16 @@ "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==" }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -900,6 +3955,12 @@ "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", "integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -907,12 +3968,9 @@ "dev": true }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz", + "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==" }, "matcher": { "version": "3.0.0", @@ -924,17 +3982,33 @@ "escape-string-regexp": "^4.0.0" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.48.0" + "mime-db": "1.52.0" } }, "mimic-response": { @@ -944,27 +4018,27 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "ms": { @@ -972,10 +4046,16 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "normalize-url": { "version": "4.5.1", @@ -994,6 +4074,11 @@ "pify": "^3.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -1010,21 +4095,34 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", "dev": true }, - "parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" - }, - "parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } }, "path-is-absolute": { "version": "1.0.1", @@ -1032,10 +4130,16 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, "pend": { @@ -1044,6 +4148,12 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -1060,6 +4170,12 @@ "is-number-like": "^1.0.3" } }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -1095,6 +4211,12 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "queue": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", @@ -1103,6 +4225,12 @@ "inherits": "~2.0.3" } }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -1116,25 +4244,19 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } } }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, "responselike": { "version": "1.0.2", @@ -1145,6 +4267,21 @@ "lowercase-keys": "^1.0.0" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -1158,15 +4295,15 @@ "json-stringify-safe": "^5.0.1", "semver-compare": "^1.0.0", "sprintf-js": "^1.1.2" - }, - "dependencies": { - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true, - "optional": true - } + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" } }, "safe-buffer": { @@ -1181,12 +4318,10 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true }, "semver-compare": { "version": "1.0.0", @@ -1205,107 +4340,61 @@ "type-fest": "^0.13.1" } }, - "socket.io": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.4.1.tgz", - "integrity": "sha512-Si18v0mMXGAqLqCVpTxBa8MGqriHGQh8ccEOhmsmNS3thNCGBwO8WGrwMibANsWtQQ5NStdZwHqZR3naJVFc3w==", + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "requires": { - "debug": "~4.1.0", - "engine.io": "~3.5.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.4.0", - "socket.io-parser": "~3.4.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } + "shebang-regex": "^3.0.0" } }, - "socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==" + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, - "socket.io-client": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", - "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", + "socket.io": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", + "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", "requires": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "engine.io-client": "~3.5.0", - "has-binary2": "~1.0.2", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", - "requires": { - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "isarray": "2.0.1" - } - } + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~6.1.0", + "socket.io-adapter": "~2.3.3", + "socket.io-parser": "~4.0.4" } }, + "socket.io-adapter": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", + "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==" + }, "socket.io-parser": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", - "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "requires": { - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "isarray": "2.0.1" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" } }, "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true, + "optional": true }, "string_decoder": { "version": "1.1.1", @@ -1316,6 +4405,21 @@ "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, "sumchecker": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", @@ -1326,18 +4430,19 @@ } }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "to-readable-stream": { "version": "1.0.0", @@ -1345,45 +4450,25 @@ "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -1396,6 +4481,15 @@ "dev": true, "optional": true }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, "type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", @@ -1410,9 +4504,9 @@ "dev": true }, "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true }, "universalify": { @@ -1421,6 +4515,15 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -1436,6 +4539,32 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1443,19 +4572,10 @@ "dev": true }, "ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" - }, - "xmlhttprequest-ssl": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz", - "integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", + "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "requires": {} }, "yauzl": { "version": "2.10.0", @@ -1466,11 +4586,6 @@ "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } - }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" } } } diff --git a/ElectronNET.Host/package.json b/ElectronNET.Host/package.json index 628c1525..b03b2803 100644 --- a/ElectronNET.Host/package.json +++ b/ElectronNET.Host/package.json @@ -13,15 +13,16 @@ }, "dependencies": { "dasherize": "^2.0.0", - "electron-updater": "^4.3.9", + "electron-updater": "^4.6.5", "image-size": "^1.0.0", "portscanner": "^2.2.0", - "socket.io": "^2.4.0" + "socket.io": "^4.4.1" }, "devDependencies": { - "@types/node": "^15.14.0", - "electron": "^13.1.5", - "tslint": "^6.1.3", - "typescript": "^4.3.5" + "@typescript-eslint/eslint-plugin": "^5.18.0", + "@typescript-eslint/parser": "^5.18.0", + "electron": "^18.0.2", + "eslint": "^8.12.0", + "typescript": "^4.6.3" } } diff --git a/ElectronNET.Host/tslint.json b/ElectronNET.Host/tslint.json deleted file mode 100644 index 4c7c0dce..00000000 --- a/ElectronNET.Host/tslint.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "rulesDirectory": [], - "rules": { - "arrow-return-shorthand": true, - "callable-types": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "deprecation": { - "severity": "warn" - }, - "eofline": true, - "forin": true, - "import-blacklist": [ - true, - "rxjs/Rx" - ], - "import-spacing": true, - "indent": [ - true, - "spaces" - ], - "interface-over-type-literal": true, - "label-position": true, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-empty": false, - "no-empty-interface": true, - "no-eval": true, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-misused-new": true, - "no-non-null-assertion": true, - "no-redundant-jsdoc": true, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unnecessary-initializer": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "prefer-const": true, - "quotemark": [ - true, - "single" - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "unified-signatures": true, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "no-output-on-prefix": true, - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, - "no-input-rename": true, - "no-output-rename": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "component-class-suffix": true, - "directive-class-suffix": true - } -} \ No newline at end of file diff --git a/ElectronNET.WebApp/ElectronNET.WebApp.csproj b/ElectronNET.WebApp/ElectronNET.WebApp.csproj index 4b7e2319..d2039112 100644 --- a/ElectronNET.WebApp/ElectronNET.WebApp.csproj +++ b/ElectronNET.WebApp/ElectronNET.WebApp.csproj @@ -1,6 +1,6 @@  - net5.0 + net6.0 OutOfProcess AspNetCoreModule win-x64 @@ -16,10 +16,10 @@ - + - + diff --git a/ElectronNET.WebApp/Program.cs b/ElectronNET.WebApp/Program.cs index 6a32e60d..56ad267d 100644 --- a/ElectronNET.WebApp/Program.cs +++ b/ElectronNET.WebApp/Program.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; +using System.Diagnostics; namespace ElectronNET.WebApp { @@ -9,6 +10,12 @@ public class Program { public static void Main(string[] args) { + +#if DEBUG + //Uncomment this line to automatically attach the Debugger on launch. This should only be used in development + //Debugger.Launch(); +#endif + CreateWebHostBuilder(args).Build().Run(); } diff --git a/ElectronNET.WebApp/Properties/launchSettings.json b/ElectronNET.WebApp/Properties/launchSettings.json index 7ea18a5d..d5111d5d 100644 --- a/ElectronNET.WebApp/Properties/launchSettings.json +++ b/ElectronNET.WebApp/Properties/launchSettings.json @@ -1,32 +1,10 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:50394/", - "sslPort": 0 - } - }, "profiles": { "Electron.NET App": { "commandName": "Executable", - "executablePath": "$(SolutionDir)ElectronNET.CLI\\bin\\Debug\\netcoreapp3.1\\dotnet-electronize.exe", + "executablePath": "$(SolutionDir)ElectronNET.CLI\\bin\\Debug\\net5.0\\dotnet-electronize.exe", "commandLineArgs": "start", "workingDirectory": "$(SolutionDir)ElectronNET.WebApp" - }, - "IIS Express": { - "commandName": "IISExpress", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "ElectronNET.WebApp": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:50395/" } } } \ No newline at end of file diff --git a/ElectronNET.WebApp/Startup.cs b/ElectronNET.WebApp/Startup.cs index f6c0c338..ae9b5ccb 100644 --- a/ElectronNET.WebApp/Startup.cs +++ b/ElectronNET.WebApp/Startup.cs @@ -43,7 +43,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) if (HybridSupport.IsElectronActive) { - ElectronBootstrap(); + Electron.App.Ready += () => ElectronBootstrap(); } } @@ -55,12 +55,11 @@ public async void ElectronBootstrap() { Width = 1152, Height = 940, - Show = false - }); + Show = true + }).ConfigureAwait(false); await browserWindow.WebContents.Session.ClearCacheAsync(); - browserWindow.OnReadyToShow += () => browserWindow.Show(); browserWindow.SetTitle(Configuration["DemoTitleInSettings"]); } diff --git a/ElectronNET.WebApp/electron.manifest.json b/ElectronNET.WebApp/electron.manifest.json index 3053f9a0..ef616d28 100644 --- a/ElectronNET.WebApp/electron.manifest.json +++ b/ElectronNET.WebApp/electron.manifest.json @@ -8,8 +8,8 @@ "build": { "appId": "com.electronnetapidemos.app", "productName": "ElectronNET API Demos", - "copyright": "Copyright � 2019-2021", - "buildVersion": "13.5.1", + "copyright": "Copyright � 2019-2022", + "buildVersion": "18.6.1", "compression": "maximum", "win": { "icon": "Assets/electron.ico", diff --git a/ElectronNET.sln b/ElectronNET.sln index eb37b676..99f12b41 100644 --- a/ElectronNET.sln +++ b/ElectronNET.sln @@ -1,9 +1,8 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32328.378 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp", "ElectronNET.WebApp\ElectronNET.WebApp.csproj", "{7C048379-401C-4345-B5E7-BE232DEA8157}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp", "ElectronNET.WebApp\ElectronNET.WebApp.csproj", "{76F72AED-31F4-4289-AFB5-D7ECA84072B8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.API", "ElectronNET.API\ElectronNET.API.csproj", "{A78157BA-B754-45F1-969F-D6A513CA0E72}" EndProject @@ -32,6 +31,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "ElectronNET.Host", "Electro EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2914CCF7-27C2-42AE-849A-2F0C1BC7CDFA}" ProjectSection(SolutionItems) = preProject + .devops\build-nuget.yaml = .devops\build-nuget.yaml buildAll.cmd = buildAll.cmd buildAll.sh = buildAll.sh buildReleaseNuGetPackages.cmd = buildReleaseNuGetPackages.cmd @@ -47,10 +47,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7C048379-401C-4345-B5E7-BE232DEA8157}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C048379-401C-4345-B5E7-BE232DEA8157}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C048379-401C-4345-B5E7-BE232DEA8157}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C048379-401C-4345-B5E7-BE232DEA8157}.Release|Any CPU.Build.0 = Release|Any CPU + {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Release|Any CPU.Build.0 = Release|Any CPU {A78157BA-B754-45F1-969F-D6A513CA0E72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A78157BA-B754-45F1-969F-D6A513CA0E72}.Debug|Any CPU.Build.0 = Debug|Any CPU {A78157BA-B754-45F1-969F-D6A513CA0E72}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/README.md b/README.md index e6e1533a..2100c68e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Well... there are lots of different approaches how to get a X-plat desktop app r ## 🛠 Requirements to run: -The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .NET 5, so our minimum base OS is the same as [.NET 5](https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md). +The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API multi-targets .NET 5 & .NET6, so our minimum base OS is the same as [.NET 5](https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md) or [.NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md). Also you should have installed: @@ -137,10 +137,13 @@ There are additional platforms available: ``` electronize build /target win electronize build /target osx +electronize build /target osx-arm64 electronize build /target linux ``` -Those three "default" targets will produce x64 packages for those platforms. +Those four "default" targets will produce packages for those platforms. + +Note that the `osx-arm64` build requires that the project target `net6.0`. `osx-arm64` is for Apple Silicon Macs. For certain NuGet packages or certain scenarios you may want to build a pure x86 application. To support those things you can define the desired [.NET Core runtime](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog), the [electron platform](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#platform) and [electron architecture](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#arch) like this: @@ -148,6 +151,21 @@ For certain NuGet packages or certain scenarios you may want to build a pure x86 electronize build /target custom "win7-x86;win32" /electron-arch ia32 ``` +### Additional DotNet Publish Flags + +For certain scenarios additional `dotnet publish` arguments may be required. To add additional publish flags use the `/dotnet-publish` flag and add any additional publish flags after. For example if you want to skip the default nuget restore you can do that like this: + +``` +electronize build /target osx /dotnet-publish --no-restore +``` + +#### Self-Contained +> `--self-contained` is enabled by default, to disable use `--no-self-contained` or `--self-contained false` + +#### Ignored Flags +> `-r|--runtime`, `-o|--output`, `-c|--configuration`, `--interactive` & `-h|--help` are ignored by design + + The end result should be an electron app under your __/bin/desktop__ folder. ### Note @@ -188,9 +206,9 @@ MIT-licensed ## 📝 Important notes -### ElectronNET.API & ElectronNET.CLI Version 9.31.2 +### ElectronNET.API & ElectronNET.CLI Version 13.5.1 -Make sure you also have the new Electron.NET API & CLI 9.31.2 version. +Make sure you also have the new Electron.NET API & CLI 13.5.1 version. ``` dotnet tool update ElectronNET.CLI -g diff --git a/appveyor.cmd b/appveyor.cmd new file mode 100755 index 00000000..fe7cd6e9 --- /dev/null +++ b/appveyor.cmd @@ -0,0 +1,28 @@ +echo "Start building Electron.NET dev stack..." + +echo "Restore & Build API" +cd ElectronNet.API +dotnet restore +dotnet build +cd .. + +echo "Restore & Build CLI" +cd ElectronNet.CLI +dotnet restore +dotnet build + +echo "Install CLI" + +dotnet tool uninstall ElectronNET.CLI -g +dotnet tool install ElectronNET.CLI -g +cd .. + +echo "Restore & Build WebApp Demo" +cd ElectronNet.WebApp +dotnet restore ElectronNet.WebApp.NET5.csproj +dotnet build ElectronNet.WebApp.NET5.csproj + +echo "Invoke electronize build in WebApp Demo" + +echo "/target win (dev-build)" +electronize build /target win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never" \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 62d46748..0770f4d0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 1.0.{build} -image: Visual Studio 2019 +image: Visual Studio 2022 build_script: -- cmd: buildAll.cmd +- cmd: appveyor.cmd pull_requests: do_not_increment_build_number: true artifacts: diff --git a/buildAll.cmd b/buildAll.cmd index 31f75f7b..3d276f03 100755 --- a/buildAll.cmd +++ b/buildAll.cmd @@ -5,32 +5,34 @@ cd ElectronNet.API dotnet restore dotnet build cd .. + echo "Restore & Build CLI" cd ElectronNet.CLI dotnet restore dotnet build -cd .. -echo "Restore & Build WebApp Demo" -cd ElectronNet.WebApp -dotnet restore -dotnet build - -echo "Invoke electronize build in WebApp Demo" echo "Install CLI" dotnet tool uninstall ElectronNET.CLI -g dotnet tool install ElectronNET.CLI -g +cd .. + +echo "Restore & Build WebApp Demo" +cd ElectronNet.WebApp +dotnet restore ElectronNet.WebApp.NET5.csproj +dotnet build ElectronNet.WebApp.NET5.csproj + +echo "Invoke electronize build in WebApp Demo" echo "/target xxx (dev-build)" -electronize build /target custom win7-x86;win /dotnet-configuration Debug /electron-arch ia32 /electron-params "--publish never" +electronize build /target custom win7-x86;win /dotnet-project ElectronNet.WebApp.NET5.csproj /dotnet-configuration Debug /electron-arch ia32 /electron-params "--publish never" echo "/target win (dev-build)" -electronize build /target win /electron-params "--publish never" +electronize build /target win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never" echo "/target custom win7-x86;win (dev-build)" -electronize build /target custom win7-x86;win /electron-params "--publish never" +electronize build /target custom win7-x86;win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never" :: Be aware, that for non-electronnet-dev environments the correct :: invoke command would be dotnet electronize ... diff --git a/buildAll.sh b/buildAll.sh old mode 100644 new mode 100755 index b88f32ec..ee09d5f1 --- a/buildAll.sh +++ b/buildAll.sh @@ -1,17 +1,30 @@ # flag arguments to target specific builds are available. # sh ./buildAll.sh + # sh ./buildAll.sh -t osx # sh ./buildAll.sh -t win # sh ./buildAll.sh -t linux +# sh ./buildAll.sh -t osx -p *.NET5.csproj +# sh ./buildAll.sh -t win -p *.NET5.csproj +# sh ./buildAll.sh -t linux -p *.NET5.csproj + +# sh ./buildAll.sh -t osx -p *.NET6.csproj +# sh ./buildAll.sh -t win -p *.NET6.csproj +# sh ./buildAll.sh -t linux -p *.NET6.csproj + target=default -while getopts t: flag; do +project="*.NET5.cspoj" +while getopts t:p: flag; do case "${flag}" in t) target=${OPTARG} ;; + p) project=${OPTARG} ;; esac done +echo "Targeting $target & Project $project" + dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) echo "Start building Electron.NET dev stack..." @@ -31,38 +44,37 @@ echo "Restore & Build CLI" pushd $dir/ElectronNET.CLI dotnet restore dotnet build + + echo "Install CLI as dotnet tool" + dotnet tool uninstall ElectronNET.CLI -g + dotnet tool install ElectronNET.CLI -g popd echo "Restore & Build WebApp Demo" pushd $dir/ElectronNET.WebApp - dotnet restore - dotnet build - - echo "Install CLI as dotnet tool" - - dotnet tool uninstall ElectronNET.CLI -g - dotnet tool install ElectronNET.CLI -g + dotnet restore $project + dotnet build $project echo "Invoke electronize build in WebApp Demo" if [[ "$target" != "default" ]]; then echo "/target $target (dev-build)" - electronize build /target $target + electronize build /target $target /dotnet-project $project else echo "/target win (dev-build)" - electronize build /target win + electronize build /target win /dotnet-project $project echo "/target linux (dev-build)" - electronize build /target linux + electronize build /target linux /dotnet-project $project # Cannot publish osx/win on windows due to: # NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. if [[ "$OSTYPE" != "linux-gnu"* ]]; then echo "/target osx (dev-build)" - electronize build /target osx + electronize build /target osx /dotnet-project $project echo "/target custom win7-x86;win (dev-build)" - electronize build /target custom "win7-x86;win" + electronize build /target custom "win7-x86;win" /dotnet-project $project fi fi popd diff --git a/start.cmd b/start.cmd index a898fde8..a84bbbb8 100644 --- a/start.cmd +++ b/start.cmd @@ -1,8 +1,8 @@ echo Bundle ASP.NET Core Project into EXE cd ElectronNET.WebApp -dotnet restore -dotnet publish -r win-x64 --output ../ElectronNET.Host/bin/ +dotnet restore *.NET5.csproj +dotnet publish *.NET5.csproj -r win-x64 --output ../ElectronNET.Host/bin/ echo Start Electron with bundled EXE cd ..\ElectronNET.Host diff --git a/start.sh b/start.sh index ac13c7e3..c74bac32 100755 --- a/start.sh +++ b/start.sh @@ -1,8 +1,8 @@ echo Bundle ASP.NET Core Project into EXE cd ElectronNET.WebApp -dotnet restore -dotnet publish -r osx-x64 --output ../ElectronNET.Host/bin/ +dotnet restore *.NET5.csproj +dotnet publish *.NET5.csproj -r osx-x64 --output ../ElectronNET.Host/bin/ echo Start Electron with bundled EXE cd ../ElectronNET.Host