matterbridge 2.1.1-dev.2 → 2.1.1
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/CHANGELOG.md +3 -2
- package/dist/cli.d.ts +25 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -0
- package/dist/cluster/export.d.ts +2 -0
- package/dist/cluster/export.d.ts.map +1 -0
- package/dist/cluster/export.js +2 -0
- package/dist/cluster/export.js.map +1 -0
- package/dist/defaultConfigSchema.d.ts +27 -0
- package/dist/defaultConfigSchema.d.ts.map +1 -0
- package/dist/defaultConfigSchema.js +23 -0
- package/dist/defaultConfigSchema.js.map +1 -0
- package/dist/deviceManager.d.ts +46 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +26 -1
- package/dist/deviceManager.js.map +1 -0
- package/dist/frontend.d.ts +109 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +227 -22
- package/dist/frontend.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/export.d.ts +2 -0
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matter/behaviors.d.ts +2 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +2 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +2 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +2 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +2 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +2 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +2 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +2 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +4 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +2 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +3 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +2 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterbridge.d.ts +409 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +754 -40
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +39 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +33 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +1056 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +32 -1
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +177 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +112 -11
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +39 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +33 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +834 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +690 -6
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +2262 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +96 -0
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +164 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +123 -3
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +165 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +24 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/pluginManager.d.ts +238 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +240 -3
- package/dist/pluginManager.js.map +1 -0
- package/dist/storage/export.d.ts +2 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +1 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +61 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +205 -2
- package/dist/utils/colorUtils.js.map +1 -0
- package/dist/utils/export.d.ts +3 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +1 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/utils.d.ts +221 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +251 -7
- package/dist/utils/utils.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
package/dist/pluginManager.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the Plugins class.
|
|
3
|
+
*
|
|
4
|
+
* @file plugins.ts
|
|
5
|
+
* @author Luca Liguori
|
|
6
|
+
* @date 2024-07-14
|
|
7
|
+
* @version 1.1.0
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License. *
|
|
22
|
+
*/
|
|
23
|
+
// NodeStorage and AnsiLogger modules
|
|
1
24
|
import { AnsiLogger, BLUE, db, er, nf, nt, rs, UNDERLINE, UNDERLINEOFF, wr } from './logger/export.js';
|
|
25
|
+
// Node.js modules
|
|
2
26
|
import path from 'path';
|
|
3
27
|
import { promises as fs } from 'fs';
|
|
4
28
|
import { pathToFileURL } from 'url';
|
|
@@ -12,8 +36,9 @@ export class PluginManager {
|
|
|
12
36
|
log;
|
|
13
37
|
constructor(matterbridge) {
|
|
14
38
|
this.matterbridge = matterbridge;
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
40
|
this.nodeContext = matterbridge.nodeContext;
|
|
16
|
-
this.log = new AnsiLogger({ logName: 'PluginManager', logTimestampFormat: 4
|
|
41
|
+
this.log = new AnsiLogger({ logName: 'PluginManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
|
|
17
42
|
this.log.debug('Matterbridge plugin manager starting...');
|
|
18
43
|
}
|
|
19
44
|
get length() {
|
|
@@ -48,6 +73,7 @@ export class PluginManager {
|
|
|
48
73
|
}
|
|
49
74
|
catch (error) {
|
|
50
75
|
this.log.error(`Error processing forEach plugin ${plg}${plugin.name}${er}:`, error);
|
|
76
|
+
// throw error;
|
|
51
77
|
}
|
|
52
78
|
});
|
|
53
79
|
await Promise.all(tasks);
|
|
@@ -58,13 +84,31 @@ export class PluginManager {
|
|
|
58
84
|
set logLevel(logLevel) {
|
|
59
85
|
this.log.logLevel = logLevel;
|
|
60
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Loads registered plugins from storage.
|
|
89
|
+
*
|
|
90
|
+
* This method retrieves an array of registered plugins from the storage and converts it
|
|
91
|
+
* into a map where the plugin names are the keys and the plugin objects are the values.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Promise<RegisteredPlugin[]>} A promise that resolves to an array of registered plugins.
|
|
94
|
+
*/
|
|
61
95
|
async loadFromStorage() {
|
|
96
|
+
// Load the array from storage and convert it to a map
|
|
62
97
|
const pluginsArray = await this.nodeContext.get('plugins', []);
|
|
63
98
|
for (const plugin of pluginsArray)
|
|
64
99
|
this._plugins.set(plugin.name, plugin);
|
|
65
100
|
return pluginsArray;
|
|
66
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Loads registered plugins from storage.
|
|
104
|
+
*
|
|
105
|
+
* This method retrieves an array of registered plugins from the storage and converts it
|
|
106
|
+
* into a map where the plugin names are the keys and the plugin objects are the values.
|
|
107
|
+
*
|
|
108
|
+
* @returns {Promise<RegisteredPlugin[]>} A promise that resolves to an array of registered plugins.
|
|
109
|
+
*/
|
|
67
110
|
async saveToStorage() {
|
|
111
|
+
// Convert the map to an array
|
|
68
112
|
const plugins = [];
|
|
69
113
|
const pluginArrayFromMap = Array.from(this._plugins.values());
|
|
70
114
|
for (const plugin of pluginArrayFromMap) {
|
|
@@ -84,11 +128,18 @@ export class PluginManager {
|
|
|
84
128
|
this.log.debug(`Saved ${BLUE}${plugins.length}${db} plugins to storage`);
|
|
85
129
|
return plugins.length;
|
|
86
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Resolves the name of a plugin by loading and parsing its package.json file.
|
|
133
|
+
* @param pluginPath - The path to the plugin or the path to the plugin's package.json file.
|
|
134
|
+
* @returns The path to the resolved package.json file, or null if the package.json file is not found or does not contain a name.
|
|
135
|
+
*/
|
|
87
136
|
async resolve(pluginPath) {
|
|
88
137
|
if (!pluginPath.endsWith('package.json'))
|
|
89
138
|
pluginPath = path.join(pluginPath, 'package.json');
|
|
139
|
+
// Resolve the package.json of the plugin
|
|
90
140
|
let packageJsonPath = path.resolve(pluginPath);
|
|
91
141
|
this.log.debug(`Resolving plugin path ${plg}${packageJsonPath}${db}`);
|
|
142
|
+
// Check if the package.json file exists
|
|
92
143
|
try {
|
|
93
144
|
await fs.access(packageJsonPath);
|
|
94
145
|
}
|
|
@@ -98,11 +149,13 @@ export class PluginManager {
|
|
|
98
149
|
this.log.debug(`Trying at ${plg}${packageJsonPath}${db}`);
|
|
99
150
|
}
|
|
100
151
|
try {
|
|
152
|
+
// Load the package.json of the plugin
|
|
101
153
|
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
|
|
102
154
|
if (!packageJson.name) {
|
|
103
155
|
this.log.error(`Package.json name not found at ${packageJsonPath}`);
|
|
104
156
|
return null;
|
|
105
157
|
}
|
|
158
|
+
// Check for main issues
|
|
106
159
|
if (!packageJson.type || packageJson.type !== 'module') {
|
|
107
160
|
this.log.error(`Plugin at ${packageJsonPath} is not a module`);
|
|
108
161
|
return null;
|
|
@@ -111,6 +164,13 @@ export class PluginManager {
|
|
|
111
164
|
this.log.error(`Plugin at ${packageJsonPath} has no main entrypoint in package.json`);
|
|
112
165
|
return null;
|
|
113
166
|
}
|
|
167
|
+
/*
|
|
168
|
+
if (!packageJson.types) {
|
|
169
|
+
this.log.error(`Plugin at ${packageJsonPath} has no types in package.json`);
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
*/
|
|
173
|
+
// Check for @project-chip packages in dependencies and devDependencies
|
|
114
174
|
const checkForProjectChipPackages = (dependencies) => {
|
|
115
175
|
return Object.keys(dependencies).filter((pkg) => pkg.startsWith('@project-chip') || pkg.startsWith('@matter'));
|
|
116
176
|
};
|
|
@@ -132,6 +192,7 @@ export class PluginManager {
|
|
|
132
192
|
this.log.error(`Please open an issue on the plugin repository to remove them.`);
|
|
133
193
|
return null;
|
|
134
194
|
}
|
|
195
|
+
// Check for matterbridge package in dependencies and devDependencies
|
|
135
196
|
const checkForMatterbridgePackage = (dependencies) => {
|
|
136
197
|
return Object.keys(dependencies).filter((pkg) => pkg === 'matterbridge');
|
|
137
198
|
};
|
|
@@ -161,6 +222,11 @@ export class PluginManager {
|
|
|
161
222
|
return null;
|
|
162
223
|
}
|
|
163
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Loads and parse the plugin package.json and returns it.
|
|
227
|
+
* @param plugin - The plugin to load the package from.
|
|
228
|
+
* @returns A Promise that resolves to the package.json object or undefined if the package.json could not be loaded.
|
|
229
|
+
*/
|
|
164
230
|
async parse(plugin) {
|
|
165
231
|
this.log.debug(`Parsing package.json of plugin ${plg}${plugin.name}${db}`);
|
|
166
232
|
try {
|
|
@@ -177,6 +243,7 @@ export class PluginManager {
|
|
|
177
243
|
this.log.error(`Plugin ${plg}${plugin.name}${er} is not a module`);
|
|
178
244
|
if (!packageJson.main)
|
|
179
245
|
this.log.error(`Plugin ${plg}${plugin.name}${er} has no main entrypoint in package.json`);
|
|
246
|
+
// if (!packageJson.types) this.log.error(`Plugin ${plg}${plugin.name}${er} has no types in package.json`);
|
|
180
247
|
plugin.name = packageJson.name || 'Unknown name';
|
|
181
248
|
plugin.version = packageJson.version || '1.0.0';
|
|
182
249
|
plugin.description = packageJson.description || 'Unknown description';
|
|
@@ -185,6 +252,7 @@ export class PluginManager {
|
|
|
185
252
|
this.log.warn(`Plugin ${plg}${plugin.name}${wr} has no path`);
|
|
186
253
|
if (!plugin.type)
|
|
187
254
|
this.log.warn(`Plugin ${plg}${plugin.name}${wr} has no type`);
|
|
255
|
+
// Check for @project-chip packages in dependencies and devDependencies
|
|
188
256
|
const checkForProjectChipPackages = (dependencies) => {
|
|
189
257
|
return Object.keys(dependencies).filter((pkg) => pkg.startsWith('@project-chip') || pkg.startsWith('@matter'));
|
|
190
258
|
};
|
|
@@ -206,6 +274,7 @@ export class PluginManager {
|
|
|
206
274
|
this.log.error(`Please open an issue on the plugin repository to remove them.`);
|
|
207
275
|
return null;
|
|
208
276
|
}
|
|
277
|
+
// Check for matterbridge package in dependencies and devDependencies
|
|
209
278
|
const checkForMatterbridgePackage = (dependencies) => {
|
|
210
279
|
return Object.keys(dependencies).filter((pkg) => pkg === 'matterbridge');
|
|
211
280
|
};
|
|
@@ -227,6 +296,7 @@ export class PluginManager {
|
|
|
227
296
|
this.log.error(`Please open an issue on the plugin repository to remove them.`);
|
|
228
297
|
return null;
|
|
229
298
|
}
|
|
299
|
+
// await this.saveToStorage(); // No need to save the plugin to storage
|
|
230
300
|
return packageJson;
|
|
231
301
|
}
|
|
232
302
|
catch (err) {
|
|
@@ -235,6 +305,16 @@ export class PluginManager {
|
|
|
235
305
|
return null;
|
|
236
306
|
}
|
|
237
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Enables a plugin by its name or path.
|
|
310
|
+
*
|
|
311
|
+
* This method enables a plugin by setting its `enabled` property to `true` and saving the updated
|
|
312
|
+
* plugin information to storage. It first checks if the plugin is already registered in the `_plugins` map.
|
|
313
|
+
* If not, it attempts to resolve the plugin's `package.json` file to retrieve its name and enable it.
|
|
314
|
+
*
|
|
315
|
+
* @param {string} nameOrPath - The name or path of the plugin to enable.
|
|
316
|
+
* @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the enabled plugin object, or null if the plugin could not be enabled.
|
|
317
|
+
*/
|
|
238
318
|
async enable(nameOrPath) {
|
|
239
319
|
if (!nameOrPath || nameOrPath === '')
|
|
240
320
|
return null;
|
|
@@ -267,6 +347,16 @@ export class PluginManager {
|
|
|
267
347
|
return null;
|
|
268
348
|
}
|
|
269
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Enables a plugin by its name or path.
|
|
352
|
+
*
|
|
353
|
+
* This method enables a plugin by setting its `enabled` property to `true` and saving the updated
|
|
354
|
+
* plugin information to storage. It first checks if the plugin is already registered in the `_plugins` map.
|
|
355
|
+
* If not, it attempts to resolve the plugin's `package.json` file to retrieve its name and enable it.
|
|
356
|
+
*
|
|
357
|
+
* @param {string} nameOrPath - The name or path of the plugin to enable.
|
|
358
|
+
* @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the enabled plugin object, or null if the plugin could not be enabled.
|
|
359
|
+
*/
|
|
270
360
|
async disable(nameOrPath) {
|
|
271
361
|
if (!nameOrPath || nameOrPath === '')
|
|
272
362
|
return null;
|
|
@@ -299,6 +389,16 @@ export class PluginManager {
|
|
|
299
389
|
return null;
|
|
300
390
|
}
|
|
301
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Removes a plugin by its name or path.
|
|
394
|
+
*
|
|
395
|
+
* This method removes a plugin from the `_plugins` map and saves the updated plugin information to storage.
|
|
396
|
+
* It first checks if the plugin is already registered in the `_plugins` map. If not, it attempts to resolve
|
|
397
|
+
* the plugin's `package.json` file to retrieve its name and remove it.
|
|
398
|
+
*
|
|
399
|
+
* @param {string} nameOrPath - The name or path of the plugin to remove.
|
|
400
|
+
* @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the removed plugin object, or null if the plugin could not be removed.
|
|
401
|
+
*/
|
|
302
402
|
async remove(nameOrPath) {
|
|
303
403
|
if (!nameOrPath || nameOrPath === '')
|
|
304
404
|
return null;
|
|
@@ -331,6 +431,17 @@ export class PluginManager {
|
|
|
331
431
|
return null;
|
|
332
432
|
}
|
|
333
433
|
}
|
|
434
|
+
/**
|
|
435
|
+
* Adds a plugin by its name or path.
|
|
436
|
+
*
|
|
437
|
+
* This method adds a plugin to the `_plugins` map and saves the updated plugin information to storage.
|
|
438
|
+
* It first resolves the plugin's `package.json` file to retrieve its details. If the plugin is already
|
|
439
|
+
* registered, it logs an info message and returns null. Otherwise, it registers the plugin, enables it,
|
|
440
|
+
* and saves the updated plugin information to storage.
|
|
441
|
+
*
|
|
442
|
+
* @param {string} nameOrPath - The name or path of the plugin to add.
|
|
443
|
+
* @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the added plugin object, or null if the plugin could not be added.
|
|
444
|
+
*/
|
|
334
445
|
async add(nameOrPath) {
|
|
335
446
|
if (!nameOrPath || nameOrPath === '')
|
|
336
447
|
return null;
|
|
@@ -356,9 +467,19 @@ export class PluginManager {
|
|
|
356
467
|
return null;
|
|
357
468
|
}
|
|
358
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Installs a plugin by its name.
|
|
472
|
+
*
|
|
473
|
+
* This method first uninstalls any existing version of the plugin, then installs the plugin globally using npm.
|
|
474
|
+
* It logs the installation process and retrieves the installed version of the plugin.
|
|
475
|
+
*
|
|
476
|
+
* @param {string} name - The name of the plugin to install.
|
|
477
|
+
* @returns {Promise<string | undefined>} A promise that resolves to the installed version of the plugin, or undefined if the installation failed.
|
|
478
|
+
*/
|
|
359
479
|
async install(name) {
|
|
360
480
|
await this.uninstall(name);
|
|
361
481
|
this.log.info(`Installing plugin ${plg}${name}${nf}`);
|
|
482
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
362
483
|
return new Promise((resolve, reject) => {
|
|
363
484
|
exec(`npm install -g ${name} --omit=dev --force`, (error, stdout, stderr) => {
|
|
364
485
|
if (error) {
|
|
@@ -369,11 +490,14 @@ export class PluginManager {
|
|
|
369
490
|
else {
|
|
370
491
|
this.log.info(`Installed plugin ${plg}${name}${nf}`);
|
|
371
492
|
this.log.debug(`Installed plugin ${plg}${name}${db}: ${stdout}`);
|
|
493
|
+
// Get the installed version
|
|
494
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
372
495
|
exec(`npm list -g ${name} --depth=0`, (listError, listStdout, listStderr) => {
|
|
373
496
|
if (listError) {
|
|
374
497
|
this.log.error(`List error: ${listError}`);
|
|
375
498
|
resolve(undefined);
|
|
376
499
|
}
|
|
500
|
+
// Clean the output to get only the package name and version
|
|
377
501
|
const lines = listStdout.split('\n');
|
|
378
502
|
const versionLine = lines.find((line) => line.includes(`${name}@`));
|
|
379
503
|
if (versionLine) {
|
|
@@ -389,8 +513,18 @@ export class PluginManager {
|
|
|
389
513
|
});
|
|
390
514
|
});
|
|
391
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* Uninstalls a plugin by its name.
|
|
518
|
+
*
|
|
519
|
+
* This method uninstalls a globally installed plugin using npm. It logs the uninstallation process
|
|
520
|
+
* and returns the name of the uninstalled plugin if successful, or undefined if the uninstallation failed.
|
|
521
|
+
*
|
|
522
|
+
* @param {string} name - The name of the plugin to uninstall.
|
|
523
|
+
* @returns {Promise<string | undefined>} A promise that resolves to the name of the uninstalled plugin, or undefined if the uninstallation failed.
|
|
524
|
+
*/
|
|
392
525
|
async uninstall(name) {
|
|
393
526
|
this.log.info(`Uninstalling plugin ${plg}${name}${nf}`);
|
|
527
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
394
528
|
return new Promise((resolve, reject) => {
|
|
395
529
|
exec(`npm uninstall -g ${name} --force`, (error, stdout, stderr) => {
|
|
396
530
|
if (error) {
|
|
@@ -406,6 +540,14 @@ export class PluginManager {
|
|
|
406
540
|
});
|
|
407
541
|
});
|
|
408
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Loads a plugin and returns the corresponding MatterbridgePlatform instance.
|
|
545
|
+
* @param plugin - The plugin to load.
|
|
546
|
+
* @param start - Optional flag indicating whether to start the plugin after loading. Default is false.
|
|
547
|
+
* @param message - Optional message to pass to the plugin when starting.
|
|
548
|
+
* @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
|
|
549
|
+
* @throws An error if the plugin is not enabled, already loaded, or fails to load.
|
|
550
|
+
*/
|
|
409
551
|
async load(plugin, start = false, message = '', configure = false) {
|
|
410
552
|
if (!plugin.enabled) {
|
|
411
553
|
this.log.error(`Plugin ${plg}${plugin.name}${er} not enabled`);
|
|
@@ -417,14 +559,19 @@ export class PluginManager {
|
|
|
417
559
|
}
|
|
418
560
|
this.log.info(`Loading plugin ${plg}${plugin.name}${nf} type ${typ}${plugin.type}${nf}`);
|
|
419
561
|
try {
|
|
562
|
+
// Load the package.json of the plugin
|
|
420
563
|
const packageJson = JSON.parse(await fs.readFile(plugin.path, 'utf8'));
|
|
564
|
+
// Resolve the main module path relative to package.json
|
|
421
565
|
const pluginEntry = path.resolve(path.dirname(plugin.path), packageJson.main);
|
|
566
|
+
// Dynamically import the plugin
|
|
422
567
|
const pluginUrl = pathToFileURL(pluginEntry);
|
|
423
568
|
this.log.debug(`Importing plugin ${plg}${plugin.name}${db} from ${pluginUrl.href}`);
|
|
424
569
|
const pluginInstance = await import(pluginUrl.href);
|
|
425
570
|
this.log.debug(`Imported plugin ${plg}${plugin.name}${db} from ${pluginUrl.href}`);
|
|
571
|
+
// Call the default export function of the plugin, passing this MatterBridge instance, the log and the config
|
|
426
572
|
if (pluginInstance.default) {
|
|
427
573
|
const config = await this.loadConfig(plugin);
|
|
574
|
+
// Preset the plugin properties here in case the plugin throws an error during loading. In this case the user can change the config and restart the plugin.
|
|
428
575
|
plugin.name = packageJson.name;
|
|
429
576
|
plugin.description = packageJson.description ?? 'No description';
|
|
430
577
|
plugin.version = packageJson.version;
|
|
@@ -433,7 +580,7 @@ export class PluginManager {
|
|
|
433
580
|
plugin.schemaJson = await this.loadSchema(plugin);
|
|
434
581
|
config.name = plugin.name;
|
|
435
582
|
config.version = packageJson.version;
|
|
436
|
-
const log = new AnsiLogger({ logName: plugin.description ?? 'No description', logTimestampFormat: 4
|
|
583
|
+
const log = new AnsiLogger({ logName: plugin.description ?? 'No description', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: config.debug ? "debug" /* LogLevel.DEBUG */ : this.matterbridge.log.logLevel });
|
|
437
584
|
const platform = pluginInstance.default(this.matterbridge, log, config);
|
|
438
585
|
config.type = platform.type;
|
|
439
586
|
platform.name = packageJson.name;
|
|
@@ -450,7 +597,7 @@ export class PluginManager {
|
|
|
450
597
|
plugin.addedDevices = 0;
|
|
451
598
|
plugin.configJson = config;
|
|
452
599
|
plugin.schemaJson = await this.loadSchema(plugin);
|
|
453
|
-
await this.saveToStorage();
|
|
600
|
+
await this.saveToStorage(); // Save the plugin to storage
|
|
454
601
|
this.log.notice(`Loaded plugin ${plg}${plugin.name}${nf} type ${typ}${platform.type}${db} (entrypoint ${UNDERLINE}${pluginEntry}${UNDERLINEOFF})`);
|
|
455
602
|
if (start)
|
|
456
603
|
await this.start(plugin, message, false);
|
|
@@ -469,6 +616,14 @@ export class PluginManager {
|
|
|
469
616
|
}
|
|
470
617
|
return undefined;
|
|
471
618
|
}
|
|
619
|
+
/**
|
|
620
|
+
* Starts a plugin.
|
|
621
|
+
*
|
|
622
|
+
* @param {RegisteredPlugin} plugin - The plugin to start.
|
|
623
|
+
* @param {string} [message] - Optional message to pass to the plugin's onStart method.
|
|
624
|
+
* @param {boolean} [configure] - Indicates whether to configure the plugin after starting (default false).
|
|
625
|
+
* @returns {Promise<RegisteredPlugin | undefined>} A promise that resolves when the plugin is started successfully, or rejects with an error if starting the plugin fails.
|
|
626
|
+
*/
|
|
472
627
|
async start(plugin, message, configure = false) {
|
|
473
628
|
if (!plugin.loaded) {
|
|
474
629
|
this.log.error(`Plugin ${plg}${plugin.name}${er} not loaded`);
|
|
@@ -498,6 +653,12 @@ export class PluginManager {
|
|
|
498
653
|
}
|
|
499
654
|
return undefined;
|
|
500
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* Configures a plugin.
|
|
658
|
+
*
|
|
659
|
+
* @param {RegisteredPlugin} plugin - The plugin to configure.
|
|
660
|
+
* @returns {Promise<void>} A promise that resolves when the plugin is configured successfully, or rejects with an error if configuration fails.
|
|
661
|
+
*/
|
|
501
662
|
async configure(plugin) {
|
|
502
663
|
if (!plugin.loaded) {
|
|
503
664
|
this.log.error(`Plugin ${plg}${plugin.name}${er} not loaded`);
|
|
@@ -520,6 +681,7 @@ export class PluginManager {
|
|
|
520
681
|
await plugin.platform.onConfigure();
|
|
521
682
|
this.log.notice(`Configured plugin ${plg}${plugin.name}${nt} type ${typ}${plugin.type}${nt}`);
|
|
522
683
|
plugin.configured = true;
|
|
684
|
+
// await this.saveConfigFromPlugin(plugin);
|
|
523
685
|
return plugin;
|
|
524
686
|
}
|
|
525
687
|
catch (err) {
|
|
@@ -528,6 +690,18 @@ export class PluginManager {
|
|
|
528
690
|
}
|
|
529
691
|
return undefined;
|
|
530
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* Shuts down a plugin.
|
|
695
|
+
*
|
|
696
|
+
* This method shuts down a plugin by calling its `onShutdown` method and resetting its state.
|
|
697
|
+
* It logs the shutdown process and optionally removes all devices associated with the plugin.
|
|
698
|
+
*
|
|
699
|
+
* @param {RegisteredPlugin} plugin - The plugin to shut down.
|
|
700
|
+
* @param {string} [reason] - The reason for shutting down the plugin.
|
|
701
|
+
* @param {boolean} [removeAllDevices=false] - Whether to remove all devices associated with the plugin.
|
|
702
|
+
* @param {boolean} [force=false] - Whether to force the shutdown even if the plugin is not loaded or started.
|
|
703
|
+
* @returns {Promise<RegisteredPlugin | undefined>} A promise that resolves to the shut down plugin object, or undefined if the shutdown failed.
|
|
704
|
+
*/
|
|
531
705
|
async shutdown(plugin, reason, removeAllDevices = false, force = false) {
|
|
532
706
|
this.log.debug(`Shutting down plugin ${plg}${plugin.name}${db}`);
|
|
533
707
|
if (!plugin.loaded) {
|
|
@@ -570,6 +744,15 @@ export class PluginManager {
|
|
|
570
744
|
}
|
|
571
745
|
return undefined;
|
|
572
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* Loads the configuration for a plugin.
|
|
749
|
+
* If the configuration file exists, it reads the file and returns the parsed JSON data.
|
|
750
|
+
* If the configuration file does not exist, it creates a new file with default configuration and returns it.
|
|
751
|
+
* If any error occurs during file access or creation, it logs an error and return un empty config.
|
|
752
|
+
*
|
|
753
|
+
* @param plugin - The plugin for which to load the configuration.
|
|
754
|
+
* @returns A promise that resolves to the loaded or created configuration.
|
|
755
|
+
*/
|
|
573
756
|
async loadConfig(plugin) {
|
|
574
757
|
const configFile = path.join(this.matterbridge.matterbridgeDirectory, `${plugin.name}.config.json`);
|
|
575
758
|
try {
|
|
@@ -577,6 +760,8 @@ export class PluginManager {
|
|
|
577
760
|
const data = await fs.readFile(configFile, 'utf8');
|
|
578
761
|
const config = JSON.parse(data);
|
|
579
762
|
this.log.debug(`Loaded config file ${configFile} for plugin ${plg}${plugin.name}${db}.`);
|
|
763
|
+
// this.log.debug(`Loaded config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
|
|
764
|
+
// The first time a plugin is added to the system, the config file is created with the plugin name and type "AnyPlatform".
|
|
580
765
|
config.name = plugin.name;
|
|
581
766
|
config.type = plugin.type;
|
|
582
767
|
if (config.debug === undefined)
|
|
@@ -601,6 +786,7 @@ export class PluginManager {
|
|
|
601
786
|
try {
|
|
602
787
|
await fs.writeFile(configFile, JSON.stringify(config, null, 2), 'utf8');
|
|
603
788
|
this.log.debug(`Created config file ${configFile} for plugin ${plg}${plugin.name}${db}.`);
|
|
789
|
+
// this.log.debug(`Created config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
|
|
604
790
|
return config;
|
|
605
791
|
}
|
|
606
792
|
catch (err) {
|
|
@@ -617,6 +803,18 @@ export class PluginManager {
|
|
|
617
803
|
return { name: plugin.name, type: plugin.type, debug: false, unregisterOnShutdown: false };
|
|
618
804
|
}
|
|
619
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* Saves the configuration of a plugin to a file.
|
|
808
|
+
*
|
|
809
|
+
* This method saves the configuration of the specified plugin to a JSON file in the matterbridge directory.
|
|
810
|
+
* If the plugin's configuration is not found, it logs an error and rejects the promise. If the configuration
|
|
811
|
+
* is successfully saved, it logs a debug message. If an error occurs during the file write operation, it logs
|
|
812
|
+
* the error and rejects the promise.
|
|
813
|
+
*
|
|
814
|
+
* @param {RegisteredPlugin} plugin - The plugin whose configuration is to be saved.
|
|
815
|
+
* @returns {Promise<void>} A promise that resolves when the configuration is successfully saved, or rejects if an error occurs.
|
|
816
|
+
* @throws {Error} If the plugin's configuration is not found.
|
|
817
|
+
*/
|
|
620
818
|
async saveConfigFromPlugin(plugin) {
|
|
621
819
|
if (!plugin.platform?.config) {
|
|
622
820
|
this.log.error(`Error saving config file for plugin ${plg}${plugin.name}${er}: config not found`);
|
|
@@ -626,6 +824,7 @@ export class PluginManager {
|
|
|
626
824
|
try {
|
|
627
825
|
await fs.writeFile(configFile, JSON.stringify(plugin.platform.config, null, 2), 'utf8');
|
|
628
826
|
this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}`);
|
|
827
|
+
// this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, plugin.platform.config);
|
|
629
828
|
return Promise.resolve();
|
|
630
829
|
}
|
|
631
830
|
catch (err) {
|
|
@@ -633,6 +832,19 @@ export class PluginManager {
|
|
|
633
832
|
return Promise.reject(err);
|
|
634
833
|
}
|
|
635
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Saves the configuration of a plugin from a JSON object to a file.
|
|
837
|
+
*
|
|
838
|
+
* This method saves the provided configuration of the specified plugin to a JSON file in the matterbridge directory.
|
|
839
|
+
* It first checks if the configuration data is valid by ensuring it contains the correct name and type, and matches
|
|
840
|
+
* the plugin's name. If the configuration data is invalid, it logs an error and returns. If the configuration is
|
|
841
|
+
* successfully saved, it updates the plugin's `configJson` property and logs a debug message. If an error occurs
|
|
842
|
+
* during the file write operation, it logs the error and returns.
|
|
843
|
+
*
|
|
844
|
+
* @param {RegisteredPlugin} plugin - The plugin whose configuration is to be saved.
|
|
845
|
+
* @param {PlatformConfig} config - The configuration data to be saved.
|
|
846
|
+
* @returns {Promise<void>} A promise that resolves when the configuration is successfully saved, or returns if an error occurs.
|
|
847
|
+
*/
|
|
636
848
|
async saveConfigFromJson(plugin, config) {
|
|
637
849
|
if (!config.name || !config.type || config.name !== plugin.name) {
|
|
638
850
|
this.log.error(`Error saving config file for plugin ${plg}${plugin.name}${er}. Wrong config data content:${rs}\n`, config);
|
|
@@ -643,12 +855,24 @@ export class PluginManager {
|
|
|
643
855
|
await fs.writeFile(configFile, JSON.stringify(config, null, 2), 'utf8');
|
|
644
856
|
plugin.configJson = config;
|
|
645
857
|
this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}`);
|
|
858
|
+
// this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
|
|
646
859
|
}
|
|
647
860
|
catch (err) {
|
|
648
861
|
this.log.error(`Error saving config file ${configFile} for plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
649
862
|
return;
|
|
650
863
|
}
|
|
651
864
|
}
|
|
865
|
+
/**
|
|
866
|
+
* Loads the schema for a plugin.
|
|
867
|
+
*
|
|
868
|
+
* This method attempts to load the schema file for the specified plugin. If the schema file is found,
|
|
869
|
+
* it reads and parses the file, updates the schema's title and description, and logs the process.
|
|
870
|
+
* It also attempts to delete any old schema file from the matterbridge directory. If the schema file
|
|
871
|
+
* is not found, it logs the event and loads a default schema for the plugin.
|
|
872
|
+
*
|
|
873
|
+
* @param {RegisteredPlugin} plugin - The plugin whose schema is to be loaded.
|
|
874
|
+
* @returns {Promise<PlatformSchema>} A promise that resolves to the loaded schema object, or the default schema if the schema file is not found.
|
|
875
|
+
*/
|
|
652
876
|
async loadSchema(plugin) {
|
|
653
877
|
const schemaFile = plugin.path.replace('package.json', `${plugin.name}.schema.json`);
|
|
654
878
|
try {
|
|
@@ -658,6 +882,8 @@ export class PluginManager {
|
|
|
658
882
|
schema.title = plugin.description;
|
|
659
883
|
schema.description = plugin.name + ' v. ' + plugin.version + ' by ' + plugin.author;
|
|
660
884
|
this.log.debug(`Loaded schema file ${schemaFile} for plugin ${plg}${plugin.name}${db}.`);
|
|
885
|
+
// this.log.debug(`Loaded schema file ${schemaFile} for plugin ${plg}${plugin.name}${db}.\nSchema:${rs}\n`, schema);
|
|
886
|
+
// Delete the schema file from old position
|
|
661
887
|
return schema;
|
|
662
888
|
}
|
|
663
889
|
catch (error) {
|
|
@@ -665,6 +891,16 @@ export class PluginManager {
|
|
|
665
891
|
return this.getDefaultSchema(plugin);
|
|
666
892
|
}
|
|
667
893
|
}
|
|
894
|
+
/**
|
|
895
|
+
* Returns the default schema for a plugin.
|
|
896
|
+
*
|
|
897
|
+
* This method generates a default schema object for the specified plugin. The schema includes
|
|
898
|
+
* metadata such as the plugin's title, description, version, and author. It also defines the
|
|
899
|
+
* properties of the schema, including the plugin's name, type, debug flag, and unregisterOnShutdown flag.
|
|
900
|
+
*
|
|
901
|
+
* @param {RegisteredPlugin} plugin - The plugin for which the default schema is to be generated.
|
|
902
|
+
* @returns {PlatformSchema} The default schema object for the plugin.
|
|
903
|
+
*/
|
|
668
904
|
getDefaultSchema(plugin) {
|
|
669
905
|
return {
|
|
670
906
|
title: plugin.description,
|
|
@@ -695,3 +931,4 @@ export class PluginManager {
|
|
|
695
931
|
};
|
|
696
932
|
}
|
|
697
933
|
}
|
|
934
|
+
//# sourceMappingURL=pluginManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManager.js","sourceRoot":"","sources":["../src/pluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAY,EAAE,EAAE,EAAE,EAAE,EAAE,EAAmB,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAGlI,kBAAkB;AAClB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;AAIpD,OAAO,EAAE,GAAG,EAAoB,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEjG,MAAM,OAAO,aAAa;IAChB,QAAQ,GAAG,IAAI,GAAG,EAA4B,CAAC;IAC/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E;oBACJ,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,KAAK,EAAE;oBACL,WAAW,EAAE,oDAAoD;oBACjE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;iBACf;gBACD,oBAAoB,EAAE;oBACpB,WAAW,EAAE,uDAAuD;oBACpE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;iBACf;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/storage/export.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/dist/storage/export.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/storage/export.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|