@velor/remote-mouse 6.4.11 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -305,6 +305,7 @@ Useful CLI commands:
305
305
  - `config get <path>` prints one persisted configuration value
306
306
  - `config set <path> <value>` updates one persisted configuration value
307
307
  - `sys-config` prints the system configuration
308
+ - `system-config` is an alias of `sys-config`
308
309
  - `service install` installs the local daemon/service
309
310
  - `service disable` disables the local daemon/service
310
311
  - `service uninstall` uninstalls the local daemon/service
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velor/remote-mouse",
3
- "version": "6.4.11",
3
+ "version": "6.5.0",
4
4
  "type": "module",
5
5
  "description": "Remote mouse and keyboard with mobile client",
6
6
  "homepage": "https://github.com/glennerichall/node-mouse#readme",
@@ -29,6 +29,22 @@ function redactSecrets(value, key = '') {
29
29
  return value;
30
30
  }
31
31
 
32
+ function buildConfigSnapshots(rawConfig, rawSystemConfig) {
33
+ const config = redactSecrets(rawConfig);
34
+ const sysConfig = redactSecrets(rawSystemConfig);
35
+
36
+ return {
37
+ config: {
38
+ ...config,
39
+ updateCheck: {
40
+ ...sysConfig?.updateCheck,
41
+ ...config?.updateCheck,
42
+ },
43
+ },
44
+ sysConfig,
45
+ };
46
+ }
47
+
32
48
  function getConnectedClients(io) {
33
49
  return Array.from(io.of('/').sockets.values()).map((socket) => ({
34
50
  id: socket.id,
@@ -106,8 +122,7 @@ export function createServerInfoRouter(services) {
106
122
  const clients = getConnectedClients(services.getServer().io);
107
123
  const rawConfig = services.getConfig();
108
124
  const rawSystemConfig = services.getSystemConfig();
109
- const config = redactSecrets(rawConfig);
110
- const sysConfig = redactSecrets(rawSystemConfig);
125
+ const {config, sysConfig} = buildConfigSnapshots(rawConfig, rawSystemConfig);
111
126
  const logs = getRecentLogs(250);
112
127
  const version = readPackageVersion(packageJsonPath);
113
128
  const tasks = services.getTaskManager().getTasksSnapshot();
@@ -145,5 +160,6 @@ export function createServerInfoRouter(services) {
145
160
 
146
161
  export const __testables = {
147
162
  buildTokenEntries,
163
+ buildConfigSnapshots,
148
164
  redactSecrets,
149
165
  };
@@ -11,7 +11,7 @@ import fs from "node:fs";
11
11
 
12
12
  const __filename = fileURLToPath(import.meta.url);
13
13
  const __dirname = path.dirname(__filename);
14
- export const projectRoot = path.join(__dirname, '../..');
14
+ export const projectRoot = path.join(__dirname, '../../..');
15
15
  export const packageJsonPath = path.join(projectRoot, 'package.json');
16
16
 
17
17
  export const bootstrapConfigDir = resolveConfigDir(process.env.CONFIG_DIR || '');
@@ -27,12 +27,8 @@ loadEnvFile(envFilePath);
27
27
  export const CONFIG_DIR = resolveConfigDir(readString('CONFIG_DIR', bootstrapConfigDir));
28
28
 
29
29
  export function readPackageJson() {
30
- try {
31
- const raw = fs.readFileSync(packageJsonPath, 'utf8');
32
- return JSON.parse(raw);
33
- } catch (_error) {
34
- return {};
35
- }
30
+ const raw = fs.readFileSync(packageJsonPath, 'utf8');
31
+ return JSON.parse(raw);
36
32
  }
37
33
 
38
34
  export const packageJson = readPackageJson();
@@ -51,6 +51,9 @@ export function parseCliArgs(args) {
51
51
  .command('sys-config', false, () => {}, () => {
52
52
  command = {name: 'sys-config', args: {}};
53
53
  })
54
+ .command('system-config', false, () => {}, () => {
55
+ command = {name: 'system-config', args: {}};
56
+ })
54
57
  .command('info', false, () => {}, () => {
55
58
  command = {name: 'info', args: {}};
56
59
  })
@@ -18,7 +18,12 @@ export async function runCliCmd(args) {
18
18
  if (!command?.name || command.name === 'help') {
19
19
  console.log('Usage:');
20
20
  console.log(' remote-mouse Demarre le serveur');
21
+ console.log(' remote-mouse help Affiche cette aide');
21
22
  console.log(' remote-mouse config Affiche la configuration persistée effective');
23
+ console.log(' remote-mouse config get <path> Affiche une valeur de configuration persistée');
24
+ console.log(' remote-mouse config set <path> <value> Met a jour une valeur de configuration persistée');
25
+ console.log(' remote-mouse sys-config Affiche la configuration systeme');
26
+ console.log(' remote-mouse system-config Alias de sys-config');
22
27
  console.log(' remote-mouse service install Installe le daemon/service local');
23
28
  console.log(' remote-mouse service disable Desactive le daemon/service local');
24
29
  console.log(' remote-mouse service uninstall Desinstalle le daemon/service local');
@@ -28,6 +33,7 @@ export async function runCliCmd(args) {
28
33
  console.log(' remote-mouse info --verbosity 2 Affiche les capacites serveur avec logs detailles');
29
34
  console.log(' remote-mouse system-info Alias de info');
30
35
  console.log(' remote-mouse tokens Liste les tokens en base');
36
+ console.log(' remote-mouse samsung-detect Detecte les TV Samsung sur le reseau');
31
37
  console.log(' remote-mouse open-qr Envoie une commande au service deja demarre');
32
38
  console.log(' remote-mouse qr Alias de open-qr');
33
39
  process.exit(0);
@@ -1,6 +1,23 @@
1
1
  export async function executeHelpCommand() {
2
2
  return {
3
3
  ok: true,
4
- message: 'Utilisez remote-mouse --help pour afficher les commandes disponibles.',
4
+ message: [
5
+ 'Commandes disponibles:',
6
+ 'remote-mouse help',
7
+ 'remote-mouse config',
8
+ 'remote-mouse config get <path>',
9
+ 'remote-mouse config set <path> <value>',
10
+ 'remote-mouse sys-config',
11
+ 'remote-mouse system-config',
12
+ 'remote-mouse info',
13
+ 'remote-mouse system-info',
14
+ 'remote-mouse service <install|disable|uninstall|restart>',
15
+ 'remote-mouse tasks',
16
+ 'remote-mouse task-manager',
17
+ 'remote-mouse samsung-detect',
18
+ 'remote-mouse tokens',
19
+ 'remote-mouse open-qr',
20
+ 'remote-mouse qr',
21
+ ].join('\n'),
5
22
  };
6
23
  }
@@ -15,6 +15,7 @@ const commandHandlers = {
15
15
  qr: executeOpenQrCommand,
16
16
  config: executeConfigCommand,
17
17
  'sys-config': executeSystemConfigCommand,
18
+ 'system-config': executeSystemConfigCommand,
18
19
  info: executeInfoCommand,
19
20
  'system-info': executeInfoCommand,
20
21
  service: executeServiceCommand,