@matterbridge/thread 3.6.2-dev-20260314-d28b48a → 3.6.2-dev-20260315-d23fd18
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/dist/threadsManager.js
CHANGED
|
@@ -22,6 +22,7 @@ export class ThreadsManager {
|
|
|
22
22
|
{ name: 'SystemCheck', path: 'workerSystemCheck.js', type: 'worker' },
|
|
23
23
|
{ name: 'GlobalPrefix', path: 'workerGlobalPrefix.js', type: 'worker' },
|
|
24
24
|
{ name: 'SpawnCommand', path: 'workerSpawnCommand.js', type: 'worker' },
|
|
25
|
+
{ name: 'ArchiveCommand', path: 'workerArchiveCommand.js', type: 'worker' },
|
|
25
26
|
];
|
|
26
27
|
constructor(intervalMs = 10_000) {
|
|
27
28
|
this.debug = hasParameter('debug') || hasParameter('verbose') || hasParameter('debug-threads') || hasParameter('verbose-threads');
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isArchiveWorkerData } from '@matterbridge/types';
|
|
2
|
+
import { WorkerWrapper } from './workerWrapper.js';
|
|
3
|
+
import { createZip, readZip, unZip } from './zipjs.js';
|
|
4
|
+
export default new WorkerWrapper('ArchiveCommand', async (worker) => {
|
|
5
|
+
if (!isArchiveWorkerData(worker.workerData)) {
|
|
6
|
+
worker.logger("error", `ArchiveCommand invalid parameters`);
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
worker.logger("info", `Starting archive command ${worker.workerData.command} on ${worker.workerData.archivePath} with source paths ${worker.workerData.sourcePaths.join(', ')} and destination path ${worker.workerData.destinationPath}...`);
|
|
10
|
+
let success = false;
|
|
11
|
+
if (worker.workerData.command === 'zip')
|
|
12
|
+
success = (await createZip(worker.workerData.archivePath, worker.workerData.sourcePaths)) > 0;
|
|
13
|
+
else if (worker.workerData.command === 'verify')
|
|
14
|
+
success = (await readZip(worker.workerData.archivePath)).length > 0;
|
|
15
|
+
else if (worker.workerData.command === 'unzip')
|
|
16
|
+
success = (await unZip(worker.workerData.archivePath, worker.workerData.destinationPath)).length > 0;
|
|
17
|
+
if (success)
|
|
18
|
+
worker.logger("info", `Archive command ${worker.workerData.command} on ${worker.workerData.archivePath} with source paths ${worker.workerData.sourcePaths.join(', ')} and destination path ${worker.workerData.destinationPath} executed successfully`);
|
|
19
|
+
else
|
|
20
|
+
worker.logger("error", `Archive command ${worker.workerData.command} on ${worker.workerData.archivePath} with source paths ${worker.workerData.sourcePaths.join(', ')} and destination path ${worker.workerData.destinationPath} failed`);
|
|
21
|
+
worker.server.respond({
|
|
22
|
+
type: 'manager_archive_response',
|
|
23
|
+
src: `manager`,
|
|
24
|
+
dst: 'frontend',
|
|
25
|
+
id: worker.server.getUniqueId(),
|
|
26
|
+
result: {
|
|
27
|
+
command: worker.workerData.command,
|
|
28
|
+
archivePath: worker.workerData.archivePath,
|
|
29
|
+
sourcePaths: worker.workerData.sourcePaths,
|
|
30
|
+
destinationPath: worker.workerData.destinationPath,
|
|
31
|
+
success,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return success;
|
|
35
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/thread",
|
|
3
|
-
"version": "3.6.2-dev-
|
|
3
|
+
"version": "3.6.2-dev-20260315-d23fd18",
|
|
4
4
|
"description": "Matterbridge thread library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"CHANGELOG.md"
|
|
70
70
|
],
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@matterbridge/types": "3.6.2-dev-
|
|
73
|
-
"@matterbridge/utils": "3.6.2-dev-
|
|
72
|
+
"@matterbridge/types": "3.6.2-dev-20260315-d23fd18",
|
|
73
|
+
"@matterbridge/utils": "3.6.2-dev-20260315-d23fd18",
|
|
74
74
|
"@zip.js/zip.js": "2.8.23",
|
|
75
75
|
"node-ansi-logger": "3.2.0"
|
|
76
76
|
}
|