Skip to content

Commit dae94f7

Browse files
authoredNov 13, 2024··
[chore]: update @types/node to our current nvmrc version (#2959)
* update @types/node to our current nvmrc version - and perform needed adaptions * added missing changelog
1 parent 5a1e8e3 commit dae94f7

File tree

4 files changed

+81
-143
lines changed

4 files changed

+81
-143
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Placeholder for the next version (at the beginning of the line):
44
## __WORK IN PROGRESS__
55
-->
6+
## __WORK IN PROGRESS__ - Lucy
7+
* (@foxriver76) Introduce "Vendor Packages Workflow" (only relevant for vendors - see README.md)
68

79
## 7.0.2 (2024-10-28) - Lucy
810
* (@foxriver76) the UI upgrade now runs as the same user as the js-controller

‎package-lock.json

+67-102
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@types/jsonwebtoken": "^8.5.9",
4141
"@types/mime-types": "^2.1.1",
4242
"@types/mocha": "^10.0.6",
43-
"@types/node": "^18.19.31",
43+
"@types/node": "^20.17.6",
4444
"@types/node-forge": "^1.3.0",
4545
"@types/node-schedule": "^2.1.0",
4646
"@types/pidusage": "^2.0.2",

‎packages/cli/src/lib/setup/setupMultihost.ts

+11-40
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import fs from 'fs-extra';
22
import path from 'node:path';
3+
import readline from 'node:readline';
34
import { tools } from '@iobroker/js-controller-common';
45
import { isLocalObjectsDbServer, isLocalStatesDbServer } from '@iobroker/js-controller-common';
56
import type { Client as ObjectsRedisClient } from '@iobroker/db-objects-redis';
67
import { MHClient, type BrowseResultEntry } from './multihostClient.js';
7-
import readline from 'node:readline';
8+
import readlineSync from 'readline-sync';
89
import prompt from 'prompt';
910

1011
interface MHParams {
@@ -30,7 +31,7 @@ export class Multihost {
3031
}
3132

3233
/**
33-
* Retrive config (iobroker.json content)
34+
* Retrieve config (iobroker.json content)
3435
*/
3536
getConfig(): ioBroker.IoBrokerJson {
3637
let config;
@@ -257,38 +258,9 @@ export class Multihost {
257258

258259
/**
259260
* Read password from cli
260-
*
261-
* @param callback
262261
*/
263-
readPassword(callback: (password: string) => void): void {
264-
const rl = readline.createInterface({
265-
input: process.stdin,
266-
output: process.stdout,
267-
});
268-
269-
function hidden(query: string, callback: (pw: string) => void): void {
270-
const stdin = process.openStdin();
271-
process.stdin.on('data', _char => {
272-
const char = _char.toString();
273-
switch (char) {
274-
case '\n':
275-
case '\r':
276-
case '\u0004':
277-
stdin.pause();
278-
break;
279-
280-
default:
281-
process.stdout.write(`\x1B[2K\x1B[200D${query}${new Array(rl.line.length + 1).join('*')}`);
282-
break;
283-
}
284-
});
285-
286-
rl.question(query, value => {
287-
callback(value);
288-
});
289-
}
290-
291-
hidden('Enter secret phrase for connection: ', password => callback(password));
262+
readPassword(): string {
263+
return readlineSync.question('Enter secret phrase for connection: ', { hideEchoBack: true });
292264
}
293265

294266
/**
@@ -400,13 +372,12 @@ export class Multihost {
400372
callback(new Error(`Invalid index: ${answer}`));
401373
} else {
402374
if (listEntry.auth) {
403-
this.readPassword(password => {
404-
if (password) {
405-
this.connectHelper(mhClient, listEntry.ip!, password, callback);
406-
} else {
407-
callback(new Error('No password entered!'));
408-
}
409-
});
375+
const password = this.readPassword();
376+
if (password) {
377+
this.connectHelper(mhClient, listEntry.ip!, password, callback);
378+
} else {
379+
callback(new Error('No password entered!'));
380+
}
410381
} else {
411382
this.connectHelper(mhClient, listEntry.ip!, '', callback);
412383
}

0 commit comments

Comments
 (0)
Please sign in to comment.