From 44d1f2fd682d6e4120ecd2bdbccc743be1f5e798 Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Sun, 11 Feb 2024 21:13:51 +0100 Subject: [PATCH] (NT-67) Switch to latest snapshot libnut provider package and use new interface --- lib/provider/provider-registry.class.ts | 16 +++---- package-lock.json | 62 ++++++++++++------------- package.json | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lib/provider/provider-registry.class.ts b/lib/provider/provider-registry.class.ts index 2932bb1..b168c13 100644 --- a/lib/provider/provider-registry.class.ts +++ b/lib/provider/provider-registry.class.ts @@ -5,10 +5,6 @@ import { MouseProviderInterface } from "./mouse-provider.interface"; import { ScreenProviderInterface } from "./screen-provider.interface"; import { WindowProviderInterface } from "./window-provider.interface"; -import Mouse from "./native/libnut-mouse.class"; -import Keyboard from "./native/libnut-keyboard.class"; -import Screen from "./native/libnut-screen.class"; -import Window from "./native/libnut-window.class"; import { ImageReader } from "./image-reader.type"; import { ImageWriter } from "./image-writer.type"; import { ImageProcessor } from "./image-processor.interface"; @@ -375,16 +371,20 @@ if (!process.env[DISABLE_DEFAULT_PROVIDERS_ENV_VAR]) { providerRegistry.registerClipboardProvider(new Clipboard()); } if (!process.env[DISABLE_DEFAULT_KEYBOARD_PROVIDER_ENV_VAR]) { - providerRegistry.registerKeyboardProvider(new Keyboard()); + const { DefaultKeyboardAction } = require("@nut-tree/libnut"); + providerRegistry.registerKeyboardProvider(new DefaultKeyboardAction()); } if (!process.env[DISABLE_DEFAULT_MOUSE_PROVIDER_ENV_VAR]) { - providerRegistry.registerMouseProvider(new Mouse()); + const { DefaultMouseAction } = require("@nut-tree/libnut"); + providerRegistry.registerMouseProvider(new DefaultMouseAction()); } if (!process.env[DISABLE_DEFAULT_SCREEN_PROVIDER_ENV_VAR]) { - providerRegistry.registerScreenProvider(new Screen()); + const { DefaultScreenAction } = require("@nut-tree/libnut"); + providerRegistry.registerScreenProvider(new DefaultScreenAction()); } if (!process.env[DISABLE_DEFAULT_WINDOW_PROVIDER_ENV_VAR]) { - providerRegistry.registerWindowProvider(new Window()); + const { DefaultWindowAction } = require("@nut-tree/libnut"); + providerRegistry.registerWindowProvider(new DefaultWindowAction()); } } diff --git a/package-lock.json b/package-lock.json index 5b028d9..a2514f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ ], "dependencies": { "@nut-tree/default-clipboard-provider": "1.0.0", - "@nut-tree/libnut": "2.6.0", + "@nut-tree/libnut": "^2.6.1-next.20240211200808", "jimp": "0.22.10", "node-abort-controller": "2.0.0" }, @@ -1666,22 +1666,22 @@ } }, "node_modules/@nut-tree/libnut": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut/-/libnut-2.6.0.tgz", - "integrity": "sha512-bXJiLmSbSpzCRRumsYn/nBPL13f8/yLATJSHpjTSoKBjtWXeaOubFL21GVfzckee75jVEDroeoXu0r7EnMvKtA==", + "version": "2.6.1-next.20240211200808", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut/-/libnut-2.6.1-next.20240211200808.tgz", + "integrity": "sha512-gyxKsNuHEX1n80cVmZ9QI/Mirdd/QHLRqV+wTV40PeqiVX8QjLpnpWP2z6FbLv+KOcEMPpa68LXIvzHdaGa4VA==", "dependencies": { - "@nut-tree/libnut-darwin": "2.6.0", - "@nut-tree/libnut-linux": "2.6.0", - "@nut-tree/libnut-win32": "2.6.0" + "@nut-tree/libnut-darwin": "^2.6.1-next.20240129224437", + "@nut-tree/libnut-linux": "^2.6.1-next.20240129224423", + "@nut-tree/libnut-win32": "^2.6.1-next.20240129104452" }, "engines": { "node": ">=10.15.3" } }, "node_modules/@nut-tree/libnut-darwin": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-darwin/-/libnut-darwin-2.6.0.tgz", - "integrity": "sha512-Hx/me+2e2gwzSZthtNZIcp6VVeVlE+kgaMCGBlVlJo45ZzkqG1TSdjpp0jdIApMgGqphj0S/paqaXx3DgdF0Tw==", + "version": "2.6.1-next.20240129224437", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-darwin/-/libnut-darwin-2.6.1-next.20240129224437.tgz", + "integrity": "sha512-CnzMTndZW47VeYmQHflQai6Qkjul+n5Yvu6GRm+QL0K+Kv8L7CiuXm4wcxURB48x2Trinst5WfpaAtEHn26GMQ==", "cpu": [ "x64", "arm64" @@ -1702,9 +1702,9 @@ } }, "node_modules/@nut-tree/libnut-linux": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-linux/-/libnut-linux-2.6.0.tgz", - "integrity": "sha512-N0TvzI6CkiCSzpDUoxk9W8jMTTti2fKyIDPKtasE8MnDjpTENinNg+XemshL8Whz2JILp6uQehbQIS+1kC7H3A==", + "version": "2.6.1-next.20240129224423", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-linux/-/libnut-linux-2.6.1-next.20240129224423.tgz", + "integrity": "sha512-XltjW0lG3fpr6ogqqAZiOpWCO16kYTawAlfQFs8ep+RbX6bMiF6SMjIcwwOc/+lqT8kBChNbX2PicoUmw4XITA==", "cpu": [ "x64", "arm64" @@ -1725,9 +1725,9 @@ } }, "node_modules/@nut-tree/libnut-win32": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-win32/-/libnut-win32-2.6.0.tgz", - "integrity": "sha512-7ShvAM85Gf9P/fpMVnTtL/TqA+SKGkopuYTQqXJfPL4pPpGgsia5UwTzlezmIqcEaUMEQQ+zTYYCPNHWyqW3Dg==", + "version": "2.6.1-next.20240129104452", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-win32/-/libnut-win32-2.6.1-next.20240129104452.tgz", + "integrity": "sha512-6YrlzOjDlp7EyuffpCnwd2iGFyF9EAfCercBH+zSA1JGUDMD+1QmuhA8E1Kas8kg7ICa04vnTTZAdOlfH5gV+w==", "cpu": [ "x64", "arm64" @@ -10713,37 +10713,37 @@ } }, "@nut-tree/libnut": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut/-/libnut-2.6.0.tgz", - "integrity": "sha512-bXJiLmSbSpzCRRumsYn/nBPL13f8/yLATJSHpjTSoKBjtWXeaOubFL21GVfzckee75jVEDroeoXu0r7EnMvKtA==", + "version": "2.6.1-next.20240211200808", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut/-/libnut-2.6.1-next.20240211200808.tgz", + "integrity": "sha512-gyxKsNuHEX1n80cVmZ9QI/Mirdd/QHLRqV+wTV40PeqiVX8QjLpnpWP2z6FbLv+KOcEMPpa68LXIvzHdaGa4VA==", "requires": { - "@nut-tree/libnut-darwin": "2.6.0", - "@nut-tree/libnut-linux": "2.6.0", - "@nut-tree/libnut-win32": "2.6.0" + "@nut-tree/libnut-darwin": "^2.6.1-next.20240129224437", + "@nut-tree/libnut-linux": "^2.6.1-next.20240129224423", + "@nut-tree/libnut-win32": "^2.6.1-next.20240129104452" } }, "@nut-tree/libnut-darwin": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-darwin/-/libnut-darwin-2.6.0.tgz", - "integrity": "sha512-Hx/me+2e2gwzSZthtNZIcp6VVeVlE+kgaMCGBlVlJo45ZzkqG1TSdjpp0jdIApMgGqphj0S/paqaXx3DgdF0Tw==", + "version": "2.6.1-next.20240129224437", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-darwin/-/libnut-darwin-2.6.1-next.20240129224437.tgz", + "integrity": "sha512-CnzMTndZW47VeYmQHflQai6Qkjul+n5Yvu6GRm+QL0K+Kv8L7CiuXm4wcxURB48x2Trinst5WfpaAtEHn26GMQ==", "requires": { "@nut-tree/node-mac-permissions": "2.2.1", "bindings": "1.5.0" } }, "@nut-tree/libnut-linux": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-linux/-/libnut-linux-2.6.0.tgz", - "integrity": "sha512-N0TvzI6CkiCSzpDUoxk9W8jMTTti2fKyIDPKtasE8MnDjpTENinNg+XemshL8Whz2JILp6uQehbQIS+1kC7H3A==", + "version": "2.6.1-next.20240129224423", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-linux/-/libnut-linux-2.6.1-next.20240129224423.tgz", + "integrity": "sha512-XltjW0lG3fpr6ogqqAZiOpWCO16kYTawAlfQFs8ep+RbX6bMiF6SMjIcwwOc/+lqT8kBChNbX2PicoUmw4XITA==", "requires": { "@nut-tree/node-mac-permissions": "2.2.1", "bindings": "1.5.0" } }, "@nut-tree/libnut-win32": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@nut-tree/libnut-win32/-/libnut-win32-2.6.0.tgz", - "integrity": "sha512-7ShvAM85Gf9P/fpMVnTtL/TqA+SKGkopuYTQqXJfPL4pPpGgsia5UwTzlezmIqcEaUMEQQ+zTYYCPNHWyqW3Dg==", + "version": "2.6.1-next.20240129104452", + "resolved": "https://registry.npmjs.org/@nut-tree/libnut-win32/-/libnut-win32-2.6.1-next.20240129104452.tgz", + "integrity": "sha512-6YrlzOjDlp7EyuffpCnwd2iGFyF9EAfCercBH+zSA1JGUDMD+1QmuhA8E1Kas8kg7ICa04vnTTZAdOlfH5gV+w==", "requires": { "@nut-tree/node-mac-permissions": "2.2.1", "bindings": "1.5.0" diff --git a/package.json b/package.json index 2f4216d..ef6f401 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ }, "dependencies": { "@nut-tree/default-clipboard-provider": "1.0.0", - "@nut-tree/libnut": "2.6.0", + "@nut-tree/libnut": "^2.6.1-next.20240211200808", "jimp": "0.22.10", "node-abort-controller": "2.0.0" },