@livedesk/client 0.1.135 → 0.1.137
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/bin/livedesk-client-node.js +34 -30
- package/fast/linux-x64/livedesk-client-fast.dll +0 -0
- package/fast/linux-x64/livedesk-client-fast.pdb +0 -0
- package/fast/osx-arm64/livedesk-client-fast.dll +0 -0
- package/fast/osx-arm64/livedesk-client-fast.pdb +0 -0
- package/fast/osx-x64/livedesk-client-fast.dll +0 -0
- package/fast/osx-x64/livedesk-client-fast.pdb +0 -0
- package/fast/win-x64/livedesk-client-fast.dll +0 -0
- package/fast/win-x64/livedesk-client-fast.pdb +0 -0
- package/package.json +1 -1
|
@@ -1301,7 +1301,9 @@ function remotePolicyAllows(options, command) {
|
|
|
1301
1301
|
? ['allowFileTransfer']
|
|
1302
1302
|
: command === 'audio.start'
|
|
1303
1303
|
? ['allowRemoteAudio']
|
|
1304
|
-
: command === '
|
|
1304
|
+
: command === 'livedesk.client-update'
|
|
1305
|
+
? []
|
|
1306
|
+
: command === 'agent.task' || NODE_AGENT_OPERATIONS.has(command)
|
|
1305
1307
|
? ['allowAgent']
|
|
1306
1308
|
: [];
|
|
1307
1309
|
const denied = required.find(key => policy[key] === false);
|
|
@@ -1311,37 +1313,39 @@ function remotePolicyAllows(options, command) {
|
|
|
1311
1313
|
function scheduleClientUpdate(options, payload = {}) {
|
|
1312
1314
|
const parentPid = Number(process.env.LIVEDESK_CLIENT_PARENT_PID || process.ppid);
|
|
1313
1315
|
if (!Number.isInteger(parentPid) || parentPid <= 1) {
|
|
1314
|
-
|
|
1316
|
+
return Promise.reject(new Error('LiveDesk client launcher process id is unavailable.'));
|
|
1315
1317
|
}
|
|
1316
1318
|
const command = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1319
|
+
return new Promise((resolve, reject) => {
|
|
1320
|
+
const child = spawn(command, [
|
|
1321
|
+
'-y',
|
|
1322
|
+
'--prefer-online',
|
|
1323
|
+
'livedesk@latest',
|
|
1324
|
+
'client',
|
|
1325
|
+
'--no-login',
|
|
1326
|
+
'--update-wait-pid',
|
|
1327
|
+
String(parentPid)
|
|
1328
|
+
], {
|
|
1329
|
+
env: {
|
|
1330
|
+
...process.env,
|
|
1331
|
+
LIVEDESK_CLIENT_UPDATE_TARGET_VERSION: String(payload.targetVersion || process.env.LIVEDESK_CLIENT_UPDATE_TARGET_VERSION || '')
|
|
1332
|
+
},
|
|
1333
|
+
detached: true,
|
|
1334
|
+
stdio: 'ignore',
|
|
1335
|
+
windowsHide: true
|
|
1336
|
+
});
|
|
1337
|
+
child.once('error', reject);
|
|
1338
|
+
child.once('spawn', () => {
|
|
1339
|
+
child.unref();
|
|
1340
|
+
resolve({
|
|
1341
|
+
ok: true,
|
|
1342
|
+
status: 'update-scheduled',
|
|
1343
|
+
targetVersion: String(payload.targetVersion || ''),
|
|
1344
|
+
parentPid,
|
|
1345
|
+
restartAfterMs: 500
|
|
1346
|
+
});
|
|
1347
|
+
});
|
|
1336
1348
|
});
|
|
1337
|
-
child.unref();
|
|
1338
|
-
return {
|
|
1339
|
-
ok: true,
|
|
1340
|
-
status: 'update-scheduled',
|
|
1341
|
-
targetVersion: String(payload.targetVersion || ''),
|
|
1342
|
-
parentPid,
|
|
1343
|
-
restartAfterMs: 500
|
|
1344
|
-
};
|
|
1345
1349
|
}
|
|
1346
1350
|
|
|
1347
1351
|
async function handleRemoteCommand(socket, options, message, nextFrameSeq, activeStreams) {
|
|
@@ -1371,7 +1375,7 @@ async function handleRemoteCommand(socket, options, message, nextFrameSeq, activ
|
|
|
1371
1375
|
|
|
1372
1376
|
if (command === 'livedesk.client-update') {
|
|
1373
1377
|
try {
|
|
1374
|
-
const result = scheduleClientUpdate(options, message.payload || {});
|
|
1378
|
+
const result = await scheduleClientUpdate(options, message.payload || {});
|
|
1375
1379
|
writeJsonLine(socket, {
|
|
1376
1380
|
type: 'command.result',
|
|
1377
1381
|
commandId: message.commandId,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|