@velor/remote-mouse 6.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.artifacts/screenshots/remote-mobile-config.png +0 -0
- package/.artifacts/screenshots/remote-mobile-home.png +0 -0
- package/.artifacts/screenshots/remote-mobile-preferences.png +0 -0
- package/.artifacts/screenshots/remote-mobile-server-info.png +0 -0
- package/.artifacts/screenshots/remote-mobile-vlc.png +0 -0
- package/.env.example +93 -0
- package/README.md +370 -0
- package/bin/remote-mouse.js +19 -0
- package/client/core/dom.js +148 -0
- package/client/core/init-socket-io.js +117 -0
- package/client/core/socket-emit.js +6 -0
- package/client/core/window-events.js +23 -0
- package/client/i18n/apply-page-translations.js +18 -0
- package/client/i18n/constants.js +3 -0
- package/client/i18n/core.js +40 -0
- package/client/i18n/locale-registry.js +77 -0
- package/client/i18n/locales/de.js +227 -0
- package/client/i18n/locales/en.js +389 -0
- package/client/i18n/locales/es.js +228 -0
- package/client/i18n/locales/fr.js +389 -0
- package/client/i18n/locales/it.js +227 -0
- package/client/i18n/locales/ja.js +227 -0
- package/client/i18n/locales/pt.js +227 -0
- package/client/i18n/locales/ru.js +240 -0
- package/client/i18n/locales/zh.js +227 -0
- package/client/preferences/constants.js +15 -0
- package/client/preferences/effects.js +24 -0
- package/client/preferences/load.js +19 -0
- package/client/preferences/render.js +26 -0
- package/client/preferences/rows.js +78 -0
- package/client/preferences/state.js +29 -0
- package/client/preview/create-preview-frame-receiver.js +13 -0
- package/client/preview/draw.js +77 -0
- package/client/preview/parse-preview-frame.js +39 -0
- package/client/preview/preview-stream.js +152 -0
- package/client/services/app-state/appStateKeys.js +30 -0
- package/client/services/app-state/createAppStateService.js +216 -0
- package/client/services/app-state/createPersistStoreService.js +122 -0
- package/client/services/app-state/createStateStoreService.js +64 -0
- package/client/services/app-state/localStorageBinding.js +26 -0
- package/client/services/app-state/normalizers.js +74 -0
- package/client/services/app-state/resolveEffectiveStateValue.js +58 -0
- package/client/services/app-state/stateDefinitions.js +107 -0
- package/client/services/backend/createBackendService.js +55 -0
- package/client/services/config/ConfigView.js +45 -0
- package/client/services/config/createClientConfigService.js +122 -0
- package/client/services/config/defaultClientConfig.js +22 -0
- package/client/services/createServicesContainer.js +48 -0
- package/client/services/createServicesRegistry.js +26 -0
- package/client/services/i18n/createI18nService.js +86 -0
- package/client/services/notifications/createNotificationService.js +56 -0
- package/client/services/pubsub/createPubSubService.js +20 -0
- package/client/services/remotes/createRemotesService.js +20 -0
- package/client/services/transport/createSocketIoTransportService.js +50 -0
- package/client/touch/bindTouchPassthrough.js +94 -0
- package/client/touch/createTouchList.js +18 -0
- package/client/touch/dispatchSyntheticTouch.js +20 -0
- package/client/touch/gesture-zone.js +28 -0
- package/client/touch/throttle.js +46 -0
- package/client/touch/touch-handlers.js +193 -0
- package/client/touch/touchpad.js +231 -0
- package/client/ui/config/page.js +840 -0
- package/client/ui/main/applyRemoteVisibilityState.js +60 -0
- package/client/ui/main/bind-client-notifications.js +3 -0
- package/client/ui/main/bindings/bindAccordion.js +121 -0
- package/client/ui/main/bindings/bindActionButtons.js +13 -0
- package/client/ui/main/bindings/bindAdminDrawer.js +137 -0
- package/client/ui/main/bindings/bindAdminRemoteButtons.js +77 -0
- package/client/ui/main/bindings/bindAdminVersion.js +27 -0
- package/client/ui/main/bindings/bindBrowserRemoteButtons.js +119 -0
- package/client/ui/main/bindings/bindRemoteAccordion.js +23 -0
- package/client/ui/main/bindings/bindSamsungRemoteButtons.js +320 -0
- package/client/ui/main/bindings/bindSystemRemoteButtons.js +41 -0
- package/client/ui/main/bindings/bindVlcRemoteButtons.js +64 -0
- package/client/ui/main/canvas-ui.js +33 -0
- package/client/ui/main/connection-overlay.js +57 -0
- package/client/ui/main/init-ui.js +54 -0
- package/client/ui/main/keyboard-panel.js +271 -0
- package/client/ui/main/mouse-buttons.js +94 -0
- package/client/ui/main/page.js +21 -0
- package/client/ui/notifications/show-toast.js +48 -0
- package/client/ui/preferences/bindPreferenceSwitchers.js +49 -0
- package/client/ui/preferences/page.js +61 -0
- package/client/ui/preferences/switchers.js +200 -0
- package/index.js +9 -0
- package/package.json +41 -0
- package/public/admin-config.css +447 -0
- package/public/admin-config.html +63 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/brave-icon.svg +13 -0
- package/public/favicon.svg +30 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/index.html +246 -0
- package/public/manifest.webmanifest +45 -0
- package/public/preferences.html +55 -0
- package/public/server-info.html +574 -0
- package/public/styles.css +1042 -0
- package/public/sw.js +103 -0
- package/scripts/codex-commit.sh +112 -0
- package/scripts/generate-mobile-screenshots.mjs +244 -0
- package/scripts/install-linux.sh +633 -0
- package/scripts/install-windows.ps1 +369 -0
- package/server/application/createApplicationLifecycle.js +15 -0
- package/server/application/logger.js +216 -0
- package/server/application/shutdown.js +81 -0
- package/server/application/start.js +95 -0
- package/server/application/state.js +19 -0
- package/server/connection/api/admin-actions.router.js +65 -0
- package/server/connection/api/admin-configs.router.js +165 -0
- package/server/connection/api/admin-remotes.router.js +61 -0
- package/server/connection/api/admin-subs.router.js +49 -0
- package/server/connection/api/client.router.js +15 -0
- package/server/connection/api/configs.js +96 -0
- package/server/connection/api/qr-page.handler.js +17 -0
- package/server/connection/api/remotes.router.js +30 -0
- package/server/connection/api/server-info.router.js +149 -0
- package/server/connection/api/session.middleware.js +93 -0
- package/server/connection/api/unauthorized-response.js +73 -0
- package/server/connection/socket/createConnectionRegistrar.js +23 -0
- package/server/connection/socket/createSocketSessionAuthMiddleware.js +49 -0
- package/server/connection/socket/socket-action-responder.js +12 -0
- package/server/connection/socket/socket.timestamp-middleware.js +51 -0
- package/server/index.js +12 -0
- package/server/init/bootstrapApi.js +87 -0
- package/server/init/bootstrapSocket.js +79 -0
- package/server/init/createAdminApiRouter.js +22 -0
- package/server/init/createAdminUiRouter.js +21 -0
- package/server/init/createSocketActionRegistrars.js +52 -0
- package/server/init/observers/startConfigObserver.js +51 -0
- package/server/init/observers/startDisplaySizeObserver.js +55 -0
- package/server/init/observers/startNotificationObserver.js +49 -0
- package/server/init/observers/startQrOverlayHoverObserver.js +89 -0
- package/server/init/observers/startQrOverlayRefreshObserver.js +53 -0
- package/server/os/darwin/app.js +45 -0
- package/server/os/darwin/applescript.js +51 -0
- package/server/os/darwin/cliSocket.js +53 -0
- package/server/os/darwin/url.js +9 -0
- package/server/os/darwin/window.js +10 -0
- package/server/os/linux/app.js +120 -0
- package/server/os/linux/cliSocket.js +53 -0
- package/server/os/linux/process.js +69 -0
- package/server/os/linux/screen.js +58 -0
- package/server/os/linux/systemd.js +139 -0
- package/server/os/linux/url.js +17 -0
- package/server/os/linux/windows.js +144 -0
- package/server/os/win32/app.js +66 -0
- package/server/os/win32/cliSocket.js +15 -0
- package/server/os/win32/powershell.js +70 -0
- package/server/os/win32/process.js +20 -0
- package/server/os/win32/service.js +95 -0
- package/server/os/win32/url.js +9 -0
- package/server/os/win32/window.js +10 -0
- package/server/remotes/admin/createAdminEventGuardMiddleware.js +29 -0
- package/server/remotes/admin/createForceUpdateCheckAction.js +39 -0
- package/server/remotes/admin/createInstallUpdateAction.js +64 -0
- package/server/remotes/admin/createOpenQrBrowserAction.js +63 -0
- package/server/remotes/admin/createOpenServerInfoBrowserAction.js +58 -0
- package/server/remotes/admin/createRestartServiceAction.js +20 -0
- package/server/remotes/admin/createRotateEntryTokenAction.js +43 -0
- package/server/remotes/admin/createToggleQrOverlayAction.js +38 -0
- package/server/remotes/admin/index.js +32 -0
- package/server/remotes/admin/notifyIfRestarted.js +102 -0
- package/server/remotes/admin/registrar.js +94 -0
- package/server/remotes/browser/actions/createFocusOrLaunchBrowserAction.js +22 -0
- package/server/remotes/browser/actions/openUrlOnHost.js +3 -0
- package/server/remotes/browser/browserCatalog.js +70 -0
- package/server/remotes/browser/index.js +15 -0
- package/server/remotes/browser/listBrowsersOnHost.js +23 -0
- package/server/remotes/browser/registrar.js +29 -0
- package/server/remotes/browser/spec.js +18 -0
- package/server/remotes/browser/state.js +5 -0
- package/server/remotes/input/registrar.js +39 -0
- package/server/remotes/preview/bgraToRgbaBuffer.js +20 -0
- package/server/remotes/preview/captureAroundCursor.js +19 -0
- package/server/remotes/preview/createPreviewStreamer.js +85 -0
- package/server/remotes/preview/registrar.js +34 -0
- package/server/remotes/samsung/createSamsungCommandService.js +203 -0
- package/server/remotes/samsung/createSamsungRemote.js +26 -0
- package/server/remotes/samsung/createSamsungRemoteGetter.js +46 -0
- package/server/remotes/samsung/createSamsungTvGetter.js +102 -0
- package/server/remotes/samsung/device-config.js +122 -0
- package/server/remotes/samsung/registrar.js +59 -0
- package/server/remotes/samsung/utils.js +56 -0
- package/server/remotes/vlc/index.js +39 -0
- package/server/remotes/vlc/registrar.js +94 -0
- package/server/remotes/vlc/spec.js +15 -0
- package/server/remotes/vlc/state.js +5 -0
- package/server/remotes/window/index.js +6 -0
- package/server/remotes/window/registrar.js +28 -0
- package/server/services/application/createApplicationDaemonService.js +144 -0
- package/server/services/application/getDaemonServiceAdapter.js +56 -0
- package/server/services/application/utils.js +29 -0
- package/server/services/config/bootstrapConfig.js +38 -0
- package/server/services/config/configPaths.js +42 -0
- package/server/services/config/configSchema.js +297 -0
- package/server/services/config/configService.js +89 -0
- package/server/services/config/defaultConfig.js +137 -0
- package/server/services/config/envConfig.js +49 -0
- package/server/services/config/index.js +9 -0
- package/server/services/config/logConfig.js +54 -0
- package/server/services/config/system-config.js +44 -0
- package/server/services/createServicesContainer.js +94 -0
- package/server/services/createServicesRegistry.js +48 -0
- package/server/services/input/createInputController.js +17 -0
- package/server/services/input/createKeyboardController.js +146 -0
- package/server/services/input/createMouseController.js +182 -0
- package/server/services/notifier/createClientNotifier.js +23 -0
- package/server/services/notifier/createHostNotifier.js +41 -0
- package/server/services/notifier/createNotifier.js +13 -0
- package/server/services/notifier/createNotifierComposite.js +122 -0
- package/server/services/notifier/handleOpenQrBrowserEvent.js +40 -0
- package/server/services/notifier/handleOpenServerInfoBrowserEvent.js +40 -0
- package/server/services/notifier/handleRestartServiceEvent.js +37 -0
- package/server/services/notifier/handleRotateEntryTokenEvent.js +42 -0
- package/server/services/notifier/handleSessionEvent.js +24 -0
- package/server/services/notifier/handleToggleQrOverlayEvent.js +21 -0
- package/server/services/notifier/host-notifier/createLinuxHostNotifier.js +23 -0
- package/server/services/notifier/host-notifier/createNodeNotifierHostNotifier.js +24 -0
- package/server/services/notifier/host-notifier/index.js +11 -0
- package/server/services/notifier/mapper/handleForceUpdateCheckEvent.js +24 -0
- package/server/services/notifier/mapper/handleInstallUpdateEvent.js +53 -0
- package/server/services/notifier/mapper/handleSocketEvent.js +40 -0
- package/server/services/notifier/mapper/handleUpdateManagerEvent.js +24 -0
- package/server/services/notifier/mapper/notify.js +7 -0
- package/server/services/os/index.js +23 -0
- package/server/services/os/platforms/createFallbackAdapter.js +31 -0
- package/server/services/os/platforms/darwin/app.js +6 -0
- package/server/services/os/platforms/darwin/index.js +21 -0
- package/server/services/os/platforms/darwin/scripts.js +4 -0
- package/server/services/os/platforms/darwin/url.js +1 -0
- package/server/services/os/platforms/darwin/window.js +4 -0
- package/server/services/os/platforms/linux/app.js +6 -0
- package/server/services/os/platforms/linux/index.js +33 -0
- package/server/services/os/platforms/linux/url.js +1 -0
- package/server/services/os/platforms/linux/windows.js +11 -0
- package/server/services/os/platforms/win32/app.js +6 -0
- package/server/services/os/platforms/win32/index.js +21 -0
- package/server/services/os/platforms/win32/overlay.js +6 -0
- package/server/services/os/platforms/win32/powershell.js +4 -0
- package/server/services/os/platforms/win32/url.js +1 -0
- package/server/services/os/platforms/win32/window.js +4 -0
- package/server/services/os/shared.js +2 -0
- package/server/services/overlay/createNoopOverlay.js +13 -0
- package/server/services/overlay/createQrOverlay.js +27 -0
- package/server/services/overlay/createQrOverlayWin32.js +158 -0
- package/server/services/overlay/createQrOverlayYad.js +178 -0
- package/server/services/overlay/renderQrPage.js +82 -0
- package/server/services/persistence/createConfigDao.js +106 -0
- package/server/services/persistence/createDatabaseProvider.js +23 -0
- package/server/services/persistence/createEntryTokenDao.js +140 -0
- package/server/services/persistence/createRestartLogDao.js +210 -0
- package/server/services/persistence/index.js +19 -0
- package/server/services/pubsub/createEventStore.js +54 -0
- package/server/services/pubsub/createPubSub.js +89 -0
- package/server/services/pubsub/createServiceEvents.js +29 -0
- package/server/services/pubsub/serviceEventConstants.js +39 -0
- package/server/services/remotes/createRemotes.js +25 -0
- package/server/services/server/createHttpsServer.js +12 -0
- package/server/services/server/createServer.js +66 -0
- package/server/services/sse/createSseService.js +96 -0
- package/server/services/sse/utils.js +7 -0
- package/server/services/system/createSystemService.js +170 -0
- package/server/services/system/getNetworkInfo.js +18 -0
- package/server/services/system/getScreenInfo.js +32 -0
- package/server/services/system/listNetworkInterfaces.js +27 -0
- package/server/services/task-manager/createTaskManager.js +68 -0
- package/server/services/task-runner/createTaskRunner.js +114 -0
- package/server/services/token-manager/createTokenManager.js +244 -0
- package/server/services/token-manager/token-format.js +7 -0
- package/server/services/token-manager/token-store-utils.js +8 -0
- package/server/services/update-manager/CommandUpdateSource.js +70 -0
- package/server/services/update-manager/NpmUpdateSource.js +34 -0
- package/server/services/update-manager/buildNpmGlobalUpdateCommand.js +15 -0
- package/server/services/update-manager/chooseUpdateCheckSource.js +20 -0
- package/server/services/update-manager/chooseUpdateInstallSource.js +5 -0
- package/server/services/update-manager/createUpdateManager.js +109 -0
- package/server/services/update-manager/resolveInstallUpdateCommand.js +42 -0
- package/server/term/cli/executeLocalServiceCommand.js +42 -0
- package/server/term/cli/getCliSocketPath.js +5 -0
- package/server/term/cli/parseCliArgs.js +110 -0
- package/server/term/cli/printCliResult.js +18 -0
- package/server/term/cli/runCliCmd.js +50 -0
- package/server/term/cli/sendCliCommand.js +76 -0
- package/server/term/cliSocket.js +29 -0
- package/server/term/srv/commands/configCommand.js +84 -0
- package/server/term/srv/commands/helpCommand.js +6 -0
- package/server/term/srv/commands/infoCommand.js +7 -0
- package/server/term/srv/commands/openQrCommand.js +7 -0
- package/server/term/srv/commands/samsungDetectCommand.js +52 -0
- package/server/term/srv/commands/serviceCommand.js +25 -0
- package/server/term/srv/commands/systemConfigCommand.js +7 -0
- package/server/term/srv/commands/tasksCommand.js +24 -0
- package/server/term/srv/commands/tokensCommand.js +15 -0
- package/server/term/srv/executeCliCommand.js +44 -0
- package/server/term/srv/executeCliRequest.js +38 -0
- package/server/term/srv/startCliServer.js +140 -0
- package/server/utils/createRandomToken.js +11 -0
- package/server/utils/env.js +155 -0
- package/server/utils/git.js +13 -0
- package/server/utils/http.js +7 -0
- package/server/utils/network.js +45 -0
- package/server/utils/paths.js +10 -0
- package/server/utils/process.js +57 -0
- package/server/utils/robot.js +11 -0
- package/server/utils/semver.js +33 -0
- package/server/utils/truncateText.js +7 -0
- package/utils/createLazy.js +13 -0
- package/utils/functional.js +48 -0
- package/utils/math.js +26 -0
- package/utils/notificationSettings.js +61 -0
- package/utils/object.utils.js +79 -0
- package/utils/predicates.js +17 -0
- package/utils/remoteCommands.js +40 -0
- package/utils/sync.js +3 -0
- package/velor-remote-mouse-6.4.8.tgz +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {notify} from "./mapper/notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_ERROR,
|
|
4
|
+
NOTIFIER_LEVEL_INFO,
|
|
5
|
+
NOTIFIER_TARGET_ALL
|
|
6
|
+
} from "./createNotifierComposite.js";
|
|
7
|
+
import {
|
|
8
|
+
PUBSUB_EVENT_ADMIN_CLIENT_OPENED,
|
|
9
|
+
PUBSUB_EVENT_ADMIN_SERVER_OPEN_FAILED,
|
|
10
|
+
PUBSUB_EVENT_ADMIN_SERVER_OPENED
|
|
11
|
+
} from "../pubsub/serviceEventConstants.js";
|
|
12
|
+
import { NOTIFICATION_ID_QR } from '../../../utils/notificationSettings.js';
|
|
13
|
+
|
|
14
|
+
export function handleOpenQrBrowserEvent(notifier, event) {
|
|
15
|
+
if (event.type === PUBSUB_EVENT_ADMIN_CLIENT_OPENED) {
|
|
16
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
17
|
+
notificationId: NOTIFICATION_ID_QR,
|
|
18
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
19
|
+
titleKey: 'notification.qr.title',
|
|
20
|
+
messageKey: 'notification.qr.clientOpened',
|
|
21
|
+
ttlMs: 2200,
|
|
22
|
+
}, {clientId: event.payload?.clientId});
|
|
23
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_SERVER_OPEN_FAILED) {
|
|
24
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
25
|
+
notificationId: NOTIFICATION_ID_QR,
|
|
26
|
+
level: NOTIFIER_LEVEL_ERROR,
|
|
27
|
+
titleKey: 'notification.qr.title',
|
|
28
|
+
messageKey: 'notification.qr.serverOpenFailed',
|
|
29
|
+
ttlMs: 3200,
|
|
30
|
+
}, {clientId: event.payload?.clientId});
|
|
31
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_SERVER_OPENED) {
|
|
32
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
33
|
+
notificationId: NOTIFICATION_ID_QR,
|
|
34
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
35
|
+
titleKey: 'notification.qr.title',
|
|
36
|
+
messageKey: 'notification.qr.serverOpened',
|
|
37
|
+
ttlMs: 2200,
|
|
38
|
+
}, {clientId: event.payload?.clientId});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {notify} from "./mapper/notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_ERROR,
|
|
4
|
+
NOTIFIER_LEVEL_INFO,
|
|
5
|
+
NOTIFIER_TARGET_ALL
|
|
6
|
+
} from "./createNotifierComposite.js";
|
|
7
|
+
import {
|
|
8
|
+
PUBSUB_EVENT_ADMIN_CLIENT_OPENED,
|
|
9
|
+
PUBSUB_EVENT_ADMIN_SERVER_OPEN_FAILED,
|
|
10
|
+
PUBSUB_EVENT_ADMIN_SERVER_OPENED
|
|
11
|
+
} from "../pubsub/serviceEventConstants.js";
|
|
12
|
+
import { NOTIFICATION_ID_SERVER_INFO } from '../../../utils/notificationSettings.js';
|
|
13
|
+
|
|
14
|
+
export function handleOpenServerInfoBrowserEvent(notifier, event) {
|
|
15
|
+
if (event.type === PUBSUB_EVENT_ADMIN_CLIENT_OPENED) {
|
|
16
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
17
|
+
notificationId: NOTIFICATION_ID_SERVER_INFO,
|
|
18
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
19
|
+
titleKey: 'notification.serverInfo.title',
|
|
20
|
+
messageKey: 'notification.serverInfo.clientOpened',
|
|
21
|
+
ttlMs: 2200,
|
|
22
|
+
}, {clientId: event.payload?.clientId});
|
|
23
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_SERVER_OPEN_FAILED) {
|
|
24
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
25
|
+
notificationId: NOTIFICATION_ID_SERVER_INFO,
|
|
26
|
+
level: NOTIFIER_LEVEL_ERROR,
|
|
27
|
+
titleKey: 'notification.serverInfo.title',
|
|
28
|
+
messageKey: 'notification.serverInfo.serverOpenFailed',
|
|
29
|
+
ttlMs: 3200,
|
|
30
|
+
}, {clientId: event.payload?.clientId});
|
|
31
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_SERVER_OPENED) {
|
|
32
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
33
|
+
notificationId: NOTIFICATION_ID_SERVER_INFO,
|
|
34
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
35
|
+
titleKey: 'notification.serverInfo.title',
|
|
36
|
+
messageKey: 'notification.serverInfo.serverOpened',
|
|
37
|
+
ttlMs: 2200,
|
|
38
|
+
}, {clientId: event.payload?.clientId});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {notify} from "./mapper/notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_INFO,
|
|
4
|
+
NOTIFIER_LEVEL_WARNING,
|
|
5
|
+
NOTIFIER_TARGET_ALL
|
|
6
|
+
} from "./createNotifierComposite.js";
|
|
7
|
+
import {
|
|
8
|
+
PUBSUB_EVENT_ADMIN_RESTART_DETECTED,
|
|
9
|
+
PUBSUB_EVENT_ADMIN_STARTED
|
|
10
|
+
} from "../pubsub/serviceEventConstants.js";
|
|
11
|
+
import {
|
|
12
|
+
NOTIFICATION_ID_SERVICE_RESTARTED,
|
|
13
|
+
NOTIFICATION_ID_SERVICE_RESTARTING
|
|
14
|
+
} from '../../../utils/notificationSettings.js';
|
|
15
|
+
|
|
16
|
+
export function handleRestartServiceEvent(notifier, event) {
|
|
17
|
+
if (event.type === PUBSUB_EVENT_ADMIN_STARTED) {
|
|
18
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
19
|
+
notificationId: NOTIFICATION_ID_SERVICE_RESTARTING,
|
|
20
|
+
level: NOTIFIER_LEVEL_WARNING,
|
|
21
|
+
titleKey: 'notification.serviceRestarting.title',
|
|
22
|
+
messageKey: 'notification.serviceRestarting.message',
|
|
23
|
+
params: {
|
|
24
|
+
serviceName: event.payload?.serviceName || 'Remote Mouse',
|
|
25
|
+
},
|
|
26
|
+
ttlMs: 2200,
|
|
27
|
+
}, {clientId: event.payload?.clientId});
|
|
28
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_RESTART_DETECTED) {
|
|
29
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
30
|
+
notificationId: NOTIFICATION_ID_SERVICE_RESTARTED,
|
|
31
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
32
|
+
titleKey: 'notification.serviceRestarted.title',
|
|
33
|
+
messageKey: 'notification.serviceRestarted.message',
|
|
34
|
+
ttlMs: 3000,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {notify} from "./mapper/notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_ERROR,
|
|
4
|
+
NOTIFIER_LEVEL_INFO,
|
|
5
|
+
NOTIFIER_LEVEL_WARNING,
|
|
6
|
+
NOTIFIER_TARGET_ALL,
|
|
7
|
+
NOTIFIER_TARGET_CLIENT
|
|
8
|
+
} from "./createNotifierComposite.js";
|
|
9
|
+
import {
|
|
10
|
+
PUBSUB_EVENT_ADMIN_REJECTED_DISABLED,
|
|
11
|
+
PUBSUB_EVENT_ADMIN_ROTATED,
|
|
12
|
+
PUBSUB_EVENT_ADMIN_UNCHANGED
|
|
13
|
+
} from "../pubsub/serviceEventConstants.js";
|
|
14
|
+
import { NOTIFICATION_ID_ENTRY_TOKEN } from '../../../utils/notificationSettings.js';
|
|
15
|
+
|
|
16
|
+
export function handleRotateEntryTokenEvent(notifier, event) {
|
|
17
|
+
if (event.type === PUBSUB_EVENT_ADMIN_REJECTED_DISABLED) {
|
|
18
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
19
|
+
notificationId: NOTIFICATION_ID_ENTRY_TOKEN,
|
|
20
|
+
level: NOTIFIER_LEVEL_ERROR,
|
|
21
|
+
titleKey: 'notification.entryToken.title',
|
|
22
|
+
messageKey: 'notification.entryToken.disabled',
|
|
23
|
+
ttlMs: 2800,
|
|
24
|
+
}, {clientId: event.payload?.clientId});
|
|
25
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_UNCHANGED) {
|
|
26
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
27
|
+
notificationId: NOTIFICATION_ID_ENTRY_TOKEN,
|
|
28
|
+
level: NOTIFIER_LEVEL_WARNING,
|
|
29
|
+
titleKey: 'notification.entryToken.title',
|
|
30
|
+
messageKey: 'notification.entryToken.unchanged',
|
|
31
|
+
ttlMs: 2800,
|
|
32
|
+
}, {clientId: event.payload?.clientId});
|
|
33
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_ROTATED) {
|
|
34
|
+
notify(notifier, NOTIFIER_TARGET_CLIENT, {
|
|
35
|
+
notificationId: NOTIFICATION_ID_ENTRY_TOKEN,
|
|
36
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
37
|
+
titleKey: 'notification.entryToken.title',
|
|
38
|
+
messageKey: 'notification.entryToken.rotated',
|
|
39
|
+
ttlMs: 2400,
|
|
40
|
+
}, {clientId: event.payload?.clientId});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { notify } from './mapper/notify.js';
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_INFO,
|
|
4
|
+
NOTIFIER_TARGET_ALL,
|
|
5
|
+
} from './createNotifierComposite.js';
|
|
6
|
+
import { PUBSUB_EVENT_SESSION_CREATED } from '../pubsub/serviceEventConstants.js';
|
|
7
|
+
import { NOTIFICATION_ID_SESSION_CREATED } from '../../../utils/notificationSettings.js';
|
|
8
|
+
|
|
9
|
+
export function handleSessionEvent(notifier, event) {
|
|
10
|
+
if (event.type !== PUBSUB_EVENT_SESSION_CREATED) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
15
|
+
notificationId: NOTIFICATION_ID_SESSION_CREATED,
|
|
16
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
17
|
+
titleKey: 'notification.sessionCreated.title',
|
|
18
|
+
messageKey: 'notification.sessionCreated.message',
|
|
19
|
+
params: {
|
|
20
|
+
address: event.payload?.address || 'unknown',
|
|
21
|
+
},
|
|
22
|
+
ttlMs: 2800,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {notify} from "./mapper/notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_INFO,
|
|
4
|
+
NOTIFIER_TARGET_ALL
|
|
5
|
+
} from "./createNotifierComposite.js";
|
|
6
|
+
import {PUBSUB_EVENT_ADMIN_TOGGLED} from "../pubsub/serviceEventConstants.js";
|
|
7
|
+
import { NOTIFICATION_ID_QR_OVERLAY } from '../../../utils/notificationSettings.js';
|
|
8
|
+
|
|
9
|
+
export function handleToggleQrOverlayEvent(notifier, event) {
|
|
10
|
+
if (event.type !== PUBSUB_EVENT_ADMIN_TOGGLED) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
15
|
+
notificationId: NOTIFICATION_ID_QR_OVERLAY,
|
|
16
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
17
|
+
titleKey: 'notification.qrOverlay.title',
|
|
18
|
+
messageKey: event.payload?.visible ? 'notification.qrOverlay.shown' : 'notification.qrOverlay.hidden',
|
|
19
|
+
ttlMs: 2200,
|
|
20
|
+
}, {clientId: event.payload?.clientId});
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execFileAsync } from '../../../utils/process.js';
|
|
2
|
+
import {NOTIFIER_LEVEL_ERROR} from '../createNotifierComposite.js';
|
|
3
|
+
|
|
4
|
+
export function createLinuxHostNotifier({ fallbackNotifier }) {
|
|
5
|
+
return {
|
|
6
|
+
notify({ title, message, level, ttlMs }) {
|
|
7
|
+
const safeTtlMs = Math.max(500, Math.round(ttlMs));
|
|
8
|
+
void (async () => {
|
|
9
|
+
const result = await execFileAsync('notify-send', [
|
|
10
|
+
'-u',
|
|
11
|
+
level === NOTIFIER_LEVEL_ERROR ? 'critical' : 'normal',
|
|
12
|
+
'-t',
|
|
13
|
+
String(safeTtlMs),
|
|
14
|
+
title,
|
|
15
|
+
message,
|
|
16
|
+
]);
|
|
17
|
+
if (!result.ok && fallbackNotifier) {
|
|
18
|
+
fallbackNotifier.notify({ title, message, level, ttlMs: safeTtlMs });
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import nodeNotifier from 'node-notifier';
|
|
2
|
+
|
|
3
|
+
export function createNodeNotifierHostNotifier() {
|
|
4
|
+
function sendViaNodeNotifier({ title, message, safeTtlMs }) {
|
|
5
|
+
try {
|
|
6
|
+
nodeNotifier.notify({
|
|
7
|
+
title,
|
|
8
|
+
message,
|
|
9
|
+
wait: false,
|
|
10
|
+
sound: false,
|
|
11
|
+
timeout: Math.max(1, Math.round(safeTtlMs / 1000)),
|
|
12
|
+
});
|
|
13
|
+
} catch (_error) {
|
|
14
|
+
// Best effort.
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
notify({ title, message, ttlMs }) {
|
|
20
|
+
const safeTtlMs = Math.max(500, Math.round(ttlMs));
|
|
21
|
+
sendViaNodeNotifier({ title, message, safeTtlMs });
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
import { createLinuxHostNotifier } from './createLinuxHostNotifier.js';
|
|
3
|
+
import { createNodeNotifierHostNotifier } from './createNodeNotifierHostNotifier.js';
|
|
4
|
+
|
|
5
|
+
export function createHostNotifierByPlatform(platform = os.platform()) {
|
|
6
|
+
const fallbackNotifier = createNodeNotifierHostNotifier();
|
|
7
|
+
if (platform === 'linux') {
|
|
8
|
+
return createLinuxHostNotifier({ fallbackNotifier });
|
|
9
|
+
}
|
|
10
|
+
return fallbackNotifier;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {notify} from "./notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_INFO,
|
|
4
|
+
NOTIFIER_LEVEL_WARNING,
|
|
5
|
+
NOTIFIER_TARGET_ALL
|
|
6
|
+
} from "../createNotifierComposite.js";
|
|
7
|
+
import {PUBSUB_EVENT_ADMIN_COMPLETED} from "../../pubsub/serviceEventConstants.js";
|
|
8
|
+
import { NOTIFICATION_ID_FORCE_UPDATE_CHECK } from '../../../../utils/notificationSettings.js';
|
|
9
|
+
|
|
10
|
+
export function handleForceUpdateCheckEvent(notifier, event) {
|
|
11
|
+
if (event.type !== PUBSUB_EVENT_ADMIN_COMPLETED) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
16
|
+
notificationId: NOTIFICATION_ID_FORCE_UPDATE_CHECK,
|
|
17
|
+
level: event.payload?.hasUpdate ? NOTIFIER_LEVEL_WARNING : NOTIFIER_LEVEL_INFO,
|
|
18
|
+
titleKey: 'notification.updateCheck.title',
|
|
19
|
+
messageKey: event.payload?.hasUpdate
|
|
20
|
+
? 'notification.updateCheck.available'
|
|
21
|
+
: 'notification.updateCheck.none',
|
|
22
|
+
ttlMs: event.payload?.hasUpdate ? 2500 : 2200,
|
|
23
|
+
}, {clientId: event.payload?.clientId});
|
|
24
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {notify} from "./notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_ERROR,
|
|
4
|
+
NOTIFIER_LEVEL_INFO,
|
|
5
|
+
NOTIFIER_LEVEL_WARNING,
|
|
6
|
+
NOTIFIER_TARGET_ALL
|
|
7
|
+
} from "../createNotifierComposite.js";
|
|
8
|
+
import {
|
|
9
|
+
PUBSUB_EVENT_ADMIN_COMPLETED,
|
|
10
|
+
PUBSUB_EVENT_ADMIN_FAILED,
|
|
11
|
+
PUBSUB_EVENT_ADMIN_REJECTED_NO_COMMAND,
|
|
12
|
+
PUBSUB_EVENT_ADMIN_STARTED
|
|
13
|
+
} from "../../pubsub/serviceEventConstants.js";
|
|
14
|
+
import { NOTIFICATION_ID_UPDATE_INSTALL } from '../../../../utils/notificationSettings.js';
|
|
15
|
+
|
|
16
|
+
export function handleInstallUpdateEvent(notifier, event) {
|
|
17
|
+
if (event.type === PUBSUB_EVENT_ADMIN_REJECTED_NO_COMMAND) {
|
|
18
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
19
|
+
notificationId: NOTIFICATION_ID_UPDATE_INSTALL,
|
|
20
|
+
level: NOTIFIER_LEVEL_ERROR,
|
|
21
|
+
titleKey: 'notification.updateInstall.title',
|
|
22
|
+
messageKey: 'notification.updateInstall.noCommand',
|
|
23
|
+
ttlMs: 3600,
|
|
24
|
+
}, {clientId: event.payload?.clientId});
|
|
25
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_STARTED) {
|
|
26
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
27
|
+
notificationId: NOTIFICATION_ID_UPDATE_INSTALL,
|
|
28
|
+
level: NOTIFIER_LEVEL_WARNING,
|
|
29
|
+
titleKey: 'notification.updateInstall.title',
|
|
30
|
+
messageKey: 'notification.updateInstall.started',
|
|
31
|
+
ttlMs: 2200,
|
|
32
|
+
}, {clientId: event.payload?.clientId});
|
|
33
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_COMPLETED) {
|
|
34
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
35
|
+
notificationId: NOTIFICATION_ID_UPDATE_INSTALL,
|
|
36
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
37
|
+
titleKey: 'notification.updateInstall.title',
|
|
38
|
+
messageKey: 'notification.updateInstall.completed',
|
|
39
|
+
ttlMs: 3200,
|
|
40
|
+
}, {clientId: event.payload?.clientId});
|
|
41
|
+
} else if (event.type === PUBSUB_EVENT_ADMIN_FAILED) {
|
|
42
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
43
|
+
notificationId: NOTIFICATION_ID_UPDATE_INSTALL,
|
|
44
|
+
level: NOTIFIER_LEVEL_ERROR,
|
|
45
|
+
titleKey: 'notification.updateInstall.title',
|
|
46
|
+
messageKey: 'notification.updateInstall.failed',
|
|
47
|
+
params: {
|
|
48
|
+
details: event.payload?.details || 'Unknown error',
|
|
49
|
+
},
|
|
50
|
+
ttlMs: 5000,
|
|
51
|
+
}, {clientId: event.payload?.clientId});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {notify} from "./notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_INFO,
|
|
4
|
+
NOTIFIER_TARGET_ALL
|
|
5
|
+
} from "../createNotifierComposite.js";
|
|
6
|
+
import {
|
|
7
|
+
PUBSUB_EVENT_SOCKET_CLIENT_CONNECTED,
|
|
8
|
+
PUBSUB_EVENT_SOCKET_CLIENT_DISCONNECTED
|
|
9
|
+
} from "../../pubsub/serviceEventConstants.js";
|
|
10
|
+
import {
|
|
11
|
+
NOTIFICATION_ID_CLIENT_CONNECTED,
|
|
12
|
+
NOTIFICATION_ID_CLIENT_DISCONNECTED
|
|
13
|
+
} from "../../../../utils/notificationSettings.js";
|
|
14
|
+
|
|
15
|
+
export function handleSocketEvent(notifier, event) {
|
|
16
|
+
const clientId = event.payload?.clientId;
|
|
17
|
+
const shortClientId = String(clientId || '').slice(0, 8);
|
|
18
|
+
|
|
19
|
+
if (event.type === PUBSUB_EVENT_SOCKET_CLIENT_CONNECTED) {
|
|
20
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
21
|
+
notificationId: NOTIFICATION_ID_CLIENT_CONNECTED,
|
|
22
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
23
|
+
titleKey: 'notification.clientConnected.title',
|
|
24
|
+
messageKey: 'notification.clientConnected.message',
|
|
25
|
+
params: {
|
|
26
|
+
clientId: shortClientId,
|
|
27
|
+
},
|
|
28
|
+
}, {clientId});
|
|
29
|
+
} else if (event.type === PUBSUB_EVENT_SOCKET_CLIENT_DISCONNECTED) {
|
|
30
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
31
|
+
notificationId: NOTIFICATION_ID_CLIENT_DISCONNECTED,
|
|
32
|
+
level: NOTIFIER_LEVEL_INFO,
|
|
33
|
+
titleKey: 'notification.clientDisconnected.title',
|
|
34
|
+
messageKey: 'notification.clientDisconnected.message',
|
|
35
|
+
params: {
|
|
36
|
+
clientId: shortClientId,
|
|
37
|
+
},
|
|
38
|
+
}, {clientId});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {notify} from "./notify.js";
|
|
2
|
+
import {
|
|
3
|
+
NOTIFIER_LEVEL_WARNING,
|
|
4
|
+
NOTIFIER_TARGET_ALL
|
|
5
|
+
} from "../createNotifierComposite.js";
|
|
6
|
+
import {PUBSUB_EVENT_UPDATE_AVAILABLE} from "../../pubsub/serviceEventConstants.js";
|
|
7
|
+
import { NOTIFICATION_ID_UPDATE_AVAILABLE } from '../../../../utils/notificationSettings.js';
|
|
8
|
+
|
|
9
|
+
export function handleUpdateManagerEvent(notifier, event) {
|
|
10
|
+
if (event.type !== PUBSUB_EVENT_UPDATE_AVAILABLE) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const result = event.payload?.lastResult || {};
|
|
15
|
+
notify(notifier, NOTIFIER_TARGET_ALL, {
|
|
16
|
+
notificationId: NOTIFICATION_ID_UPDATE_AVAILABLE,
|
|
17
|
+
level: NOTIFIER_LEVEL_WARNING,
|
|
18
|
+
title: result.title,
|
|
19
|
+
titleKey: result.title ? undefined : 'notification.update.title',
|
|
20
|
+
message: result.message,
|
|
21
|
+
messageKey: result.message ? undefined : 'notification.update.available',
|
|
22
|
+
ttlMs: result.ttlMs || 8000,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import {createLinuxOsAdapter} from './platforms/linux/index.js';
|
|
3
|
+
import {createDarwinOsAdapter} from './platforms/darwin/index.js';
|
|
4
|
+
import {createWin32OsAdapter} from './platforms/win32/index.js';
|
|
5
|
+
import {createFallbackAdapter} from './platforms/createFallbackAdapter.js';
|
|
6
|
+
|
|
7
|
+
export function createOsService() {
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
const adapter = platform === 'linux'
|
|
10
|
+
? createLinuxOsAdapter()
|
|
11
|
+
: platform === 'darwin'
|
|
12
|
+
? createDarwinOsAdapter()
|
|
13
|
+
: platform === 'win32'
|
|
14
|
+
? createWin32OsAdapter()
|
|
15
|
+
: createFallbackAdapter();
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
platform,
|
|
19
|
+
app: adapter.app,
|
|
20
|
+
window: adapter.window,
|
|
21
|
+
url: adapter.url,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function createFallbackAdapter() {
|
|
2
|
+
return {
|
|
3
|
+
app: {
|
|
4
|
+
async resolve() {
|
|
5
|
+
return null;
|
|
6
|
+
},
|
|
7
|
+
async openOrFocus() {
|
|
8
|
+
return false;
|
|
9
|
+
},
|
|
10
|
+
async toggleWindow() {
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
async closeWindow() {
|
|
14
|
+
return false;
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
window: {
|
|
18
|
+
async toggleActive() {
|
|
19
|
+
return false;
|
|
20
|
+
},
|
|
21
|
+
async closeActive() {
|
|
22
|
+
return false;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
url: {
|
|
26
|
+
async open() {
|
|
27
|
+
return false;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {closeAppWindow, openOrFocusApp, resolveApp, toggleAppWindow} from './app.js';
|
|
2
|
+
import {closeActiveWindow, toggleActiveWindow} from './window.js';
|
|
3
|
+
import {openUrl} from './url.js';
|
|
4
|
+
|
|
5
|
+
export function createDarwinOsAdapter() {
|
|
6
|
+
return {
|
|
7
|
+
app: {
|
|
8
|
+
resolve: resolveApp,
|
|
9
|
+
openOrFocus: openOrFocusApp,
|
|
10
|
+
toggleWindow: toggleAppWindow,
|
|
11
|
+
closeWindow: closeAppWindow,
|
|
12
|
+
},
|
|
13
|
+
window: {
|
|
14
|
+
toggleActive: toggleActiveWindow,
|
|
15
|
+
closeActive: closeActiveWindow,
|
|
16
|
+
},
|
|
17
|
+
url: {
|
|
18
|
+
open: openUrl,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {openDarwinUrl as openUrl} from '../../../../os/darwin/url.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {closeAppWindow, openOrFocusApp, resolveApp, toggleAppWindow} from './app.js';
|
|
2
|
+
import {getActiveWindowId, toggleWindow, closeWindow} from './windows.js';
|
|
3
|
+
import {openUrl} from './url.js';
|
|
4
|
+
|
|
5
|
+
export function createLinuxOsAdapter() {
|
|
6
|
+
return {
|
|
7
|
+
app: {
|
|
8
|
+
resolve: resolveApp,
|
|
9
|
+
openOrFocus: openOrFocusApp,
|
|
10
|
+
toggleWindow: toggleAppWindow,
|
|
11
|
+
closeWindow: closeAppWindow,
|
|
12
|
+
},
|
|
13
|
+
window: {
|
|
14
|
+
async toggleActive() {
|
|
15
|
+
const activeWindowId = await getActiveWindowId();
|
|
16
|
+
if (!activeWindowId) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return toggleWindow(activeWindowId);
|
|
20
|
+
},
|
|
21
|
+
async closeActive() {
|
|
22
|
+
const activeWindowId = await getActiveWindowId();
|
|
23
|
+
if (!activeWindowId) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return closeWindow(activeWindowId);
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
url: {
|
|
30
|
+
open: openUrl,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {openLinuxUrl as openUrl} from '../../../../os/linux/url.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {closeAppWindow, openOrFocusApp, resolveApp, toggleAppWindow} from './app.js';
|
|
2
|
+
import {closeActiveWindow, toggleActiveWindow} from './window.js';
|
|
3
|
+
import {openUrl} from './url.js';
|
|
4
|
+
|
|
5
|
+
export function createWin32OsAdapter() {
|
|
6
|
+
return {
|
|
7
|
+
app: {
|
|
8
|
+
resolve: resolveApp,
|
|
9
|
+
openOrFocus: openOrFocusApp,
|
|
10
|
+
toggleWindow: toggleAppWindow,
|
|
11
|
+
closeWindow: closeAppWindow,
|
|
12
|
+
},
|
|
13
|
+
window: {
|
|
14
|
+
toggleActive: toggleActiveWindow,
|
|
15
|
+
closeActive: closeActiveWindow,
|
|
16
|
+
},
|
|
17
|
+
url: {
|
|
18
|
+
open: openUrl,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {openWin32Url as openUrl} from '../../../../os/win32/url.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createNoopOverlay() {
|
|
2
|
+
return {
|
|
3
|
+
close: () => {},
|
|
4
|
+
show: async () => false,
|
|
5
|
+
hide: () => false,
|
|
6
|
+
update: async () => {},
|
|
7
|
+
setSuppressed: () => false,
|
|
8
|
+
toggle: async () => false,
|
|
9
|
+
isVisible: () => false,
|
|
10
|
+
isSuppressed: () => false,
|
|
11
|
+
getBounds: () => null,
|
|
12
|
+
};
|
|
13
|
+
}
|