matterbridge 1.6.8-dev.8 → 1.7.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README-DOCKER.md +8 -6
  3. package/README-EDGE.md +76 -0
  4. package/README-SERVICE.md +3 -3
  5. package/README.md +6 -3
  6. package/dist/cli.d.ts +25 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +26 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/cluster/export.d.ts +2 -0
  11. package/dist/cluster/export.d.ts.map +1 -0
  12. package/dist/cluster/export.js +2 -0
  13. package/dist/cluster/export.js.map +1 -0
  14. package/dist/defaultConfigSchema.d.ts +27 -0
  15. package/dist/defaultConfigSchema.d.ts.map +1 -0
  16. package/dist/defaultConfigSchema.js +23 -0
  17. package/dist/defaultConfigSchema.js.map +1 -0
  18. package/dist/deviceManager.d.ts +46 -0
  19. package/dist/deviceManager.d.ts.map +1 -0
  20. package/dist/deviceManager.js +26 -1
  21. package/dist/deviceManager.js.map +1 -0
  22. package/dist/index.d.ts +40 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +30 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/logger/export.d.ts +2 -0
  27. package/dist/logger/export.d.ts.map +1 -0
  28. package/dist/logger/export.js +1 -0
  29. package/dist/logger/export.js.map +1 -0
  30. package/dist/matter/export.d.ts +11 -0
  31. package/dist/matter/export.d.ts.map +1 -0
  32. package/dist/matter/export.js +4 -0
  33. package/dist/matter/export.js.map +1 -0
  34. package/dist/matterbridge.d.ts +483 -0
  35. package/dist/matterbridge.d.ts.map +1 -0
  36. package/dist/matterbridge.js +851 -106
  37. package/dist/matterbridge.js.map +1 -0
  38. package/dist/matterbridgeAccessoryPlatform.d.ts +39 -0
  39. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  40. package/dist/matterbridgeAccessoryPlatform.js +33 -0
  41. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  42. package/dist/matterbridgeBehaviors.d.ts +942 -0
  43. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  44. package/dist/matterbridgeBehaviors.js +29 -1
  45. package/dist/matterbridgeBehaviors.js.map +1 -0
  46. package/dist/matterbridgeDevice.d.ts +7077 -0
  47. package/dist/matterbridgeDevice.d.ts.map +1 -0
  48. package/dist/matterbridgeDevice.js +996 -9
  49. package/dist/matterbridgeDevice.js.map +1 -0
  50. package/dist/matterbridgeDeviceTypes.d.ts +109 -0
  51. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  52. package/dist/matterbridgeDeviceTypes.js +82 -11
  53. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  54. package/dist/matterbridgeDynamicPlatform.d.ts +39 -0
  55. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  56. package/dist/matterbridgeDynamicPlatform.js +33 -0
  57. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  58. package/dist/matterbridgeEdge.d.ts +91 -0
  59. package/dist/matterbridgeEdge.d.ts.map +1 -0
  60. package/dist/matterbridgeEdge.js +558 -11
  61. package/dist/matterbridgeEdge.js.map +1 -0
  62. package/dist/matterbridgeEndpoint.d.ts +10151 -0
  63. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  64. package/dist/matterbridgeEndpoint.js +1120 -11
  65. package/dist/matterbridgeEndpoint.js.map +1 -0
  66. package/dist/matterbridgePlatform.d.ts +140 -0
  67. package/dist/matterbridgePlatform.d.ts.map +1 -0
  68. package/dist/matterbridgePlatform.js +179 -7
  69. package/dist/matterbridgePlatform.js.map +1 -0
  70. package/dist/matterbridgeTypes.d.ts +169 -0
  71. package/dist/matterbridgeTypes.d.ts.map +1 -0
  72. package/dist/matterbridgeTypes.js +24 -0
  73. package/dist/matterbridgeTypes.js.map +1 -0
  74. package/dist/matterbridgeWebsocket.d.ts +49 -0
  75. package/dist/matterbridgeWebsocket.d.ts.map +1 -0
  76. package/dist/matterbridgeWebsocket.js +139 -17
  77. package/dist/matterbridgeWebsocket.js.map +1 -0
  78. package/dist/pluginManager.d.ts +238 -0
  79. package/dist/pluginManager.d.ts.map +1 -0
  80. package/dist/pluginManager.js +238 -3
  81. package/dist/pluginManager.js.map +1 -0
  82. package/dist/storage/export.d.ts +2 -0
  83. package/dist/storage/export.d.ts.map +1 -0
  84. package/dist/storage/export.js +1 -0
  85. package/dist/storage/export.js.map +1 -0
  86. package/dist/utils/colorUtils.d.ts +61 -0
  87. package/dist/utils/colorUtils.d.ts.map +1 -0
  88. package/dist/utils/colorUtils.js +205 -2
  89. package/dist/utils/colorUtils.js.map +1 -0
  90. package/dist/utils/export.d.ts +3 -0
  91. package/dist/utils/export.d.ts.map +1 -0
  92. package/dist/utils/export.js +1 -0
  93. package/dist/utils/export.js.map +1 -0
  94. package/dist/utils/utils.d.ts +221 -0
  95. package/dist/utils/utils.d.ts.map +1 -0
  96. package/dist/utils/utils.js +252 -7
  97. package/dist/utils/utils.js.map +1 -0
  98. package/frontend/build/asset-manifest.json +6 -6
  99. package/frontend/build/index.html +1 -1
  100. package/frontend/build/static/css/{main.823e08b6.css → main.f1fce054.css} +2 -2
  101. package/frontend/build/static/css/main.f1fce054.css.map +1 -0
  102. package/frontend/build/static/js/{main.4dd7e165.js → main.5caad8c7.js} +15 -15
  103. package/frontend/build/static/js/main.5caad8c7.js.map +1 -0
  104. package/npm-shrinkwrap.json +30 -17
  105. package/package.json +2 -1
  106. package/frontend/build/static/css/main.823e08b6.css.map +0 -1
  107. package/frontend/build/static/js/main.4dd7e165.js.map +0 -1
  108. /package/frontend/build/static/js/{main.4dd7e165.js.LICENSE.txt → main.5caad8c7.js.LICENSE.txt} +0 -0
@@ -1,4 +1,29 @@
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
+ /* eslint-disable @typescript-eslint/no-unused-vars */
24
+ // NodeStorage and AnsiLogger modules
1
25
  import { AnsiLogger, BLUE, db, er, nf, nt, rs, UNDERLINE, UNDERLINEOFF, wr } from 'node-ansi-logger';
26
+ // Node.js modules
2
27
  import path from 'path';
3
28
  import { promises as fs } from 'fs';
4
29
  import { pathToFileURL } from 'url';
@@ -12,8 +37,9 @@ export class PluginManager {
12
37
  log;
13
38
  constructor(matterbridge) {
14
39
  this.matterbridge = matterbridge;
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
41
  this.nodeContext = matterbridge.nodeContext;
16
- this.log = new AnsiLogger({ logName: 'PluginManager', logTimestampFormat: 4, logLevel: matterbridge.log.logLevel });
42
+ this.log = new AnsiLogger({ logName: 'PluginManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
17
43
  this.log.debug('Matterbridge plugin manager starting...');
18
44
  }
19
45
  get length() {
@@ -48,6 +74,7 @@ export class PluginManager {
48
74
  }
49
75
  catch (error) {
50
76
  this.log.error(`Error processing forEach plugin ${plg}${plugin.name}${er}:`, error);
77
+ // throw error;
51
78
  }
52
79
  });
53
80
  await Promise.all(tasks);
@@ -58,13 +85,31 @@ export class PluginManager {
58
85
  set logLevel(logLevel) {
59
86
  this.log.logLevel = logLevel;
60
87
  }
88
+ /**
89
+ * Loads registered plugins from storage.
90
+ *
91
+ * This method retrieves an array of registered plugins from the storage and converts it
92
+ * into a map where the plugin names are the keys and the plugin objects are the values.
93
+ *
94
+ * @returns {Promise<RegisteredPlugin[]>} A promise that resolves to an array of registered plugins.
95
+ */
61
96
  async loadFromStorage() {
97
+ // Load the array from storage and convert it to a map
62
98
  const pluginsArray = await this.nodeContext.get('plugins', []);
63
99
  for (const plugin of pluginsArray)
64
100
  this._plugins.set(plugin.name, plugin);
65
101
  return pluginsArray;
66
102
  }
103
+ /**
104
+ * Loads registered plugins from storage.
105
+ *
106
+ * This method retrieves an array of registered plugins from the storage and converts it
107
+ * into a map where the plugin names are the keys and the plugin objects are the values.
108
+ *
109
+ * @returns {Promise<RegisteredPlugin[]>} A promise that resolves to an array of registered plugins.
110
+ */
67
111
  async saveToStorage() {
112
+ // Convert the map to an array
68
113
  const plugins = [];
69
114
  const pluginArrayFromMap = Array.from(this._plugins.values());
70
115
  for (const plugin of pluginArrayFromMap) {
@@ -84,11 +129,18 @@ export class PluginManager {
84
129
  this.log.debug(`Saved ${BLUE}${plugins.length}${db} plugins to storage`);
85
130
  return plugins.length;
86
131
  }
132
+ /**
133
+ * Resolves the name of a plugin by loading and parsing its package.json file.
134
+ * @param pluginPath - The path to the plugin or the path to the plugin's package.json file.
135
+ * @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.
136
+ */
87
137
  async resolve(pluginPath) {
88
138
  if (!pluginPath.endsWith('package.json'))
89
139
  pluginPath = path.join(pluginPath, 'package.json');
140
+ // Resolve the package.json of the plugin
90
141
  let packageJsonPath = path.resolve(pluginPath);
91
142
  this.log.debug(`Resolving plugin path ${plg}${packageJsonPath}${db}`);
143
+ // Check if the package.json file exists
92
144
  try {
93
145
  await fs.access(packageJsonPath);
94
146
  }
@@ -98,11 +150,13 @@ export class PluginManager {
98
150
  this.log.debug(`Trying at ${plg}${packageJsonPath}${db}`);
99
151
  }
100
152
  try {
153
+ // Load the package.json of the plugin
101
154
  const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
102
155
  if (!packageJson.name) {
103
156
  this.log.error(`Package.json name not found at ${packageJsonPath}`);
104
157
  return null;
105
158
  }
159
+ // Check for main issues
106
160
  if (!packageJson.type || packageJson.type !== 'module') {
107
161
  this.log.error(`Plugin at ${packageJsonPath} is not a module`);
108
162
  return null;
@@ -111,6 +165,13 @@ export class PluginManager {
111
165
  this.log.error(`Plugin at ${packageJsonPath} has no main entrypoint in package.json`);
112
166
  return null;
113
167
  }
168
+ /*
169
+ if (!packageJson.types) {
170
+ this.log.error(`Plugin at ${packageJsonPath} has no types in package.json`);
171
+ return null;
172
+ }
173
+ */
174
+ // Check for @project-chip packages in dependencies and devDependencies
114
175
  const checkForProjectChipPackages = (dependencies) => {
115
176
  return Object.keys(dependencies).filter((pkg) => pkg.startsWith('@project-chip') || pkg.startsWith('@matter'));
116
177
  };
@@ -132,6 +193,7 @@ export class PluginManager {
132
193
  this.log.error(`Please open an issue on the plugin repository to remove them.`);
133
194
  return null;
134
195
  }
196
+ // Check for matterbridge package in dependencies and devDependencies
135
197
  const checkForMatterbridgePackage = (dependencies) => {
136
198
  return Object.keys(dependencies).filter((pkg) => pkg === 'matterbridge');
137
199
  };
@@ -161,6 +223,11 @@ export class PluginManager {
161
223
  return null;
162
224
  }
163
225
  }
226
+ /**
227
+ * Loads and parse the plugin package.json and returns it.
228
+ * @param plugin - The plugin to load the package from.
229
+ * @returns A Promise that resolves to the package.json object or undefined if the package.json could not be loaded.
230
+ */
164
231
  async parse(plugin) {
165
232
  this.log.debug(`Parsing package.json of plugin ${plg}${plugin.name}${db}`);
166
233
  try {
@@ -177,6 +244,7 @@ export class PluginManager {
177
244
  this.log.error(`Plugin ${plg}${plugin.name}${er} is not a module`);
178
245
  if (!packageJson.main)
179
246
  this.log.error(`Plugin ${plg}${plugin.name}${er} has no main entrypoint in package.json`);
247
+ // if (!packageJson.types) this.log.error(`Plugin ${plg}${plugin.name}${er} has no types in package.json`);
180
248
  plugin.name = packageJson.name || 'Unknown name';
181
249
  plugin.version = packageJson.version || '1.0.0';
182
250
  plugin.description = packageJson.description || 'Unknown description';
@@ -185,6 +253,7 @@ export class PluginManager {
185
253
  this.log.warn(`Plugin ${plg}${plugin.name}${wr} has no path`);
186
254
  if (!plugin.type)
187
255
  this.log.warn(`Plugin ${plg}${plugin.name}${wr} has no type`);
256
+ // Check for @project-chip packages in dependencies and devDependencies
188
257
  const checkForProjectChipPackages = (dependencies) => {
189
258
  return Object.keys(dependencies).filter((pkg) => pkg.startsWith('@project-chip') || pkg.startsWith('@matter'));
190
259
  };
@@ -206,6 +275,7 @@ export class PluginManager {
206
275
  this.log.error(`Please open an issue on the plugin repository to remove them.`);
207
276
  return null;
208
277
  }
278
+ // Check for matterbridge package in dependencies and devDependencies
209
279
  const checkForMatterbridgePackage = (dependencies) => {
210
280
  return Object.keys(dependencies).filter((pkg) => pkg === 'matterbridge');
211
281
  };
@@ -227,6 +297,7 @@ export class PluginManager {
227
297
  this.log.error(`Please open an issue on the plugin repository to remove them.`);
228
298
  return null;
229
299
  }
300
+ // await this.saveToStorage(); // No need to save the plugin to storage
230
301
  return packageJson;
231
302
  }
232
303
  catch (err) {
@@ -235,6 +306,16 @@ export class PluginManager {
235
306
  return null;
236
307
  }
237
308
  }
309
+ /**
310
+ * Enables a plugin by its name or path.
311
+ *
312
+ * This method enables a plugin by setting its `enabled` property to `true` and saving the updated
313
+ * plugin information to storage. It first checks if the plugin is already registered in the `_plugins` map.
314
+ * If not, it attempts to resolve the plugin's `package.json` file to retrieve its name and enable it.
315
+ *
316
+ * @param {string} nameOrPath - The name or path of the plugin to enable.
317
+ * @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the enabled plugin object, or null if the plugin could not be enabled.
318
+ */
238
319
  async enable(nameOrPath) {
239
320
  if (!nameOrPath || nameOrPath === '')
240
321
  return null;
@@ -267,6 +348,16 @@ export class PluginManager {
267
348
  return null;
268
349
  }
269
350
  }
351
+ /**
352
+ * Enables a plugin by its name or path.
353
+ *
354
+ * This method enables a plugin by setting its `enabled` property to `true` and saving the updated
355
+ * plugin information to storage. It first checks if the plugin is already registered in the `_plugins` map.
356
+ * If not, it attempts to resolve the plugin's `package.json` file to retrieve its name and enable it.
357
+ *
358
+ * @param {string} nameOrPath - The name or path of the plugin to enable.
359
+ * @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the enabled plugin object, or null if the plugin could not be enabled.
360
+ */
270
361
  async disable(nameOrPath) {
271
362
  if (!nameOrPath || nameOrPath === '')
272
363
  return null;
@@ -299,6 +390,16 @@ export class PluginManager {
299
390
  return null;
300
391
  }
301
392
  }
393
+ /**
394
+ * Removes a plugin by its name or path.
395
+ *
396
+ * This method removes a plugin from the `_plugins` map and saves the updated plugin information to storage.
397
+ * It first checks if the plugin is already registered in the `_plugins` map. If not, it attempts to resolve
398
+ * the plugin's `package.json` file to retrieve its name and remove it.
399
+ *
400
+ * @param {string} nameOrPath - The name or path of the plugin to remove.
401
+ * @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the removed plugin object, or null if the plugin could not be removed.
402
+ */
302
403
  async remove(nameOrPath) {
303
404
  if (!nameOrPath || nameOrPath === '')
304
405
  return null;
@@ -331,6 +432,17 @@ export class PluginManager {
331
432
  return null;
332
433
  }
333
434
  }
435
+ /**
436
+ * Adds a plugin by its name or path.
437
+ *
438
+ * This method adds a plugin to the `_plugins` map and saves the updated plugin information to storage.
439
+ * It first resolves the plugin's `package.json` file to retrieve its details. If the plugin is already
440
+ * registered, it logs an info message and returns null. Otherwise, it registers the plugin, enables it,
441
+ * and saves the updated plugin information to storage.
442
+ *
443
+ * @param {string} nameOrPath - The name or path of the plugin to add.
444
+ * @returns {Promise<RegisteredPlugin | null>} A promise that resolves to the added plugin object, or null if the plugin could not be added.
445
+ */
334
446
  async add(nameOrPath) {
335
447
  if (!nameOrPath || nameOrPath === '')
336
448
  return null;
@@ -356,6 +468,15 @@ export class PluginManager {
356
468
  return null;
357
469
  }
358
470
  }
471
+ /**
472
+ * Installs a plugin by its name.
473
+ *
474
+ * This method first uninstalls any existing version of the plugin, then installs the plugin globally using npm.
475
+ * It logs the installation process and retrieves the installed version of the plugin.
476
+ *
477
+ * @param {string} name - The name of the plugin to install.
478
+ * @returns {Promise<string | undefined>} A promise that resolves to the installed version of the plugin, or undefined if the installation failed.
479
+ */
359
480
  async install(name) {
360
481
  await this.uninstall(name);
361
482
  this.log.info(`Installing plugin ${plg}${name}${nf}`);
@@ -369,11 +490,13 @@ 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
372
494
  exec(`npm list -g ${name} --depth=0`, (listError, listStdout, listStderr) => {
373
495
  if (listError) {
374
496
  this.log.error(`List error: ${listError}`);
375
497
  resolve(undefined);
376
498
  }
499
+ // Clean the output to get only the package name and version
377
500
  const lines = listStdout.split('\n');
378
501
  const versionLine = lines.find((line) => line.includes(`${name}@`));
379
502
  if (versionLine) {
@@ -389,6 +512,15 @@ export class PluginManager {
389
512
  });
390
513
  });
391
514
  }
515
+ /**
516
+ * Uninstalls a plugin by its name.
517
+ *
518
+ * This method uninstalls a globally installed plugin using npm. It logs the uninstallation process
519
+ * and returns the name of the uninstalled plugin if successful, or undefined if the uninstallation failed.
520
+ *
521
+ * @param {string} name - The name of the plugin to uninstall.
522
+ * @returns {Promise<string | undefined>} A promise that resolves to the name of the uninstalled plugin, or undefined if the uninstallation failed.
523
+ */
392
524
  async uninstall(name) {
393
525
  this.log.info(`Uninstalling plugin ${plg}${name}${nf}`);
394
526
  return new Promise((resolve, reject) => {
@@ -406,6 +538,14 @@ export class PluginManager {
406
538
  });
407
539
  });
408
540
  }
541
+ /**
542
+ * Loads a plugin and returns the corresponding MatterbridgePlatform instance.
543
+ * @param plugin - The plugin to load.
544
+ * @param start - Optional flag indicating whether to start the plugin after loading. Default is false.
545
+ * @param message - Optional message to pass to the plugin when starting.
546
+ * @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
547
+ * @throws An error if the plugin is not enabled, already loaded, or fails to load.
548
+ */
409
549
  async load(plugin, start = false, message = '', configure = false) {
410
550
  if (!plugin.enabled) {
411
551
  this.log.error(`Plugin ${plg}${plugin.name}${er} not enabled`);
@@ -417,14 +557,19 @@ export class PluginManager {
417
557
  }
418
558
  this.log.info(`Loading plugin ${plg}${plugin.name}${nf} type ${typ}${plugin.type}${nf}`);
419
559
  try {
560
+ // Load the package.json of the plugin
420
561
  const packageJson = JSON.parse(await fs.readFile(plugin.path, 'utf8'));
562
+ // Resolve the main module path relative to package.json
421
563
  const pluginEntry = path.resolve(path.dirname(plugin.path), packageJson.main);
564
+ // Dynamically import the plugin
422
565
  const pluginUrl = pathToFileURL(pluginEntry);
423
566
  this.log.debug(`Importing plugin ${plg}${plugin.name}${db} from ${pluginUrl.href}`);
424
567
  const pluginInstance = await import(pluginUrl.href);
425
568
  this.log.debug(`Imported plugin ${plg}${plugin.name}${db} from ${pluginUrl.href}`);
569
+ // Call the default export function of the plugin, passing this MatterBridge instance, the log and the config
426
570
  if (pluginInstance.default) {
427
571
  const config = await this.loadConfig(plugin);
572
+ // 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
573
  plugin.name = packageJson.name;
429
574
  plugin.description = packageJson.description ?? 'No description';
430
575
  plugin.version = packageJson.version;
@@ -433,7 +578,7 @@ export class PluginManager {
433
578
  plugin.schemaJson = await this.loadSchema(plugin);
434
579
  config.name = plugin.name;
435
580
  config.version = packageJson.version;
436
- const log = new AnsiLogger({ logName: plugin.description ?? 'No description', logTimestampFormat: 4, logLevel: config.debug ? "debug" : this.matterbridge.log.logLevel });
581
+ 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
582
  const platform = pluginInstance.default(this.matterbridge, log, config);
438
583
  config.type = platform.type;
439
584
  platform.name = packageJson.name;
@@ -450,7 +595,7 @@ export class PluginManager {
450
595
  plugin.addedDevices = 0;
451
596
  plugin.configJson = config;
452
597
  plugin.schemaJson = await this.loadSchema(plugin);
453
- await this.saveToStorage();
598
+ await this.saveToStorage(); // Save the plugin to storage
454
599
  this.log.notice(`Loaded plugin ${plg}${plugin.name}${nf} type ${typ}${platform.type}${db} (entrypoint ${UNDERLINE}${pluginEntry}${UNDERLINEOFF})`);
455
600
  if (start)
456
601
  await this.start(plugin, message, false);
@@ -469,6 +614,14 @@ export class PluginManager {
469
614
  }
470
615
  return undefined;
471
616
  }
617
+ /**
618
+ * Starts a plugin.
619
+ *
620
+ * @param {RegisteredPlugin} plugin - The plugin to start.
621
+ * @param {string} [message] - Optional message to pass to the plugin's onStart method.
622
+ * @param {boolean} [configure] - Indicates whether to configure the plugin after starting (default false).
623
+ * @returns {Promise<RegisteredPlugin | undefined>} A promise that resolves when the plugin is started successfully, or rejects with an error if starting the plugin fails.
624
+ */
472
625
  async start(plugin, message, configure = false) {
473
626
  if (!plugin.loaded) {
474
627
  this.log.error(`Plugin ${plg}${plugin.name}${er} not loaded`);
@@ -498,6 +651,12 @@ export class PluginManager {
498
651
  }
499
652
  return undefined;
500
653
  }
654
+ /**
655
+ * Configures a plugin.
656
+ *
657
+ * @param {RegisteredPlugin} plugin - The plugin to configure.
658
+ * @returns {Promise<void>} A promise that resolves when the plugin is configured successfully, or rejects with an error if configuration fails.
659
+ */
501
660
  async configure(plugin) {
502
661
  if (!plugin.loaded) {
503
662
  this.log.error(`Plugin ${plg}${plugin.name}${er} not loaded`);
@@ -520,6 +679,7 @@ export class PluginManager {
520
679
  await plugin.platform.onConfigure();
521
680
  this.log.notice(`Configured plugin ${plg}${plugin.name}${nt} type ${typ}${plugin.type}${nt}`);
522
681
  plugin.configured = true;
682
+ // await this.saveConfigFromPlugin(plugin);
523
683
  return plugin;
524
684
  }
525
685
  catch (err) {
@@ -528,6 +688,18 @@ export class PluginManager {
528
688
  }
529
689
  return undefined;
530
690
  }
691
+ /**
692
+ * Shuts down a plugin.
693
+ *
694
+ * This method shuts down a plugin by calling its `onShutdown` method and resetting its state.
695
+ * It logs the shutdown process and optionally removes all devices associated with the plugin.
696
+ *
697
+ * @param {RegisteredPlugin} plugin - The plugin to shut down.
698
+ * @param {string} [reason] - The reason for shutting down the plugin.
699
+ * @param {boolean} [removeAllDevices=false] - Whether to remove all devices associated with the plugin.
700
+ * @param {boolean} [force=false] - Whether to force the shutdown even if the plugin is not loaded or started.
701
+ * @returns {Promise<RegisteredPlugin | undefined>} A promise that resolves to the shut down plugin object, or undefined if the shutdown failed.
702
+ */
531
703
  async shutdown(plugin, reason, removeAllDevices = false, force = false) {
532
704
  this.log.debug(`Shutting down plugin ${plg}${plugin.name}${db}`);
533
705
  if (!plugin.loaded) {
@@ -577,6 +749,15 @@ export class PluginManager {
577
749
  }
578
750
  return undefined;
579
751
  }
752
+ /**
753
+ * Loads the configuration for a plugin.
754
+ * If the configuration file exists, it reads the file and returns the parsed JSON data.
755
+ * If the configuration file does not exist, it creates a new file with default configuration and returns it.
756
+ * If any error occurs during file access or creation, it logs an error and return un empty config.
757
+ *
758
+ * @param plugin - The plugin for which to load the configuration.
759
+ * @returns A promise that resolves to the loaded or created configuration.
760
+ */
580
761
  async loadConfig(plugin) {
581
762
  const configFile = path.join(this.matterbridge.matterbridgeDirectory, `${plugin.name}.config.json`);
582
763
  try {
@@ -584,6 +765,8 @@ export class PluginManager {
584
765
  const data = await fs.readFile(configFile, 'utf8');
585
766
  const config = JSON.parse(data);
586
767
  this.log.debug(`Loaded config file ${configFile} for plugin ${plg}${plugin.name}${db}.`);
768
+ // this.log.debug(`Loaded config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
769
+ // The first time a plugin is added to the system, the config file is created with the plugin name and type "AnyPlatform".
587
770
  config.name = plugin.name;
588
771
  config.type = plugin.type;
589
772
  if (config.debug === undefined)
@@ -608,6 +791,7 @@ export class PluginManager {
608
791
  try {
609
792
  await fs.writeFile(configFile, JSON.stringify(config, null, 2), 'utf8');
610
793
  this.log.debug(`Created config file ${configFile} for plugin ${plg}${plugin.name}${db}.`);
794
+ // this.log.debug(`Created config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
611
795
  return config;
612
796
  }
613
797
  catch (err) {
@@ -624,6 +808,18 @@ export class PluginManager {
624
808
  return { name: plugin.name, type: plugin.type, debug: false, unregisterOnShutdown: false };
625
809
  }
626
810
  }
811
+ /**
812
+ * Saves the configuration of a plugin to a file.
813
+ *
814
+ * This method saves the configuration of the specified plugin to a JSON file in the matterbridge directory.
815
+ * If the plugin's configuration is not found, it logs an error and rejects the promise. If the configuration
816
+ * is successfully saved, it logs a debug message. If an error occurs during the file write operation, it logs
817
+ * the error and rejects the promise.
818
+ *
819
+ * @param {RegisteredPlugin} plugin - The plugin whose configuration is to be saved.
820
+ * @returns {Promise<void>} A promise that resolves when the configuration is successfully saved, or rejects if an error occurs.
821
+ * @throws {Error} If the plugin's configuration is not found.
822
+ */
627
823
  async saveConfigFromPlugin(plugin) {
628
824
  if (!plugin.platform?.config) {
629
825
  this.log.error(`Error saving config file for plugin ${plg}${plugin.name}${er}: config not found`);
@@ -633,6 +829,7 @@ export class PluginManager {
633
829
  try {
634
830
  await fs.writeFile(configFile, JSON.stringify(plugin.platform.config, null, 2), 'utf8');
635
831
  this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}`);
832
+ // this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, plugin.platform.config);
636
833
  return Promise.resolve();
637
834
  }
638
835
  catch (err) {
@@ -640,6 +837,19 @@ export class PluginManager {
640
837
  return Promise.reject(err);
641
838
  }
642
839
  }
840
+ /**
841
+ * Saves the configuration of a plugin from a JSON object to a file.
842
+ *
843
+ * This method saves the provided configuration of the specified plugin to a JSON file in the matterbridge directory.
844
+ * It first checks if the configuration data is valid by ensuring it contains the correct name and type, and matches
845
+ * the plugin's name. If the configuration data is invalid, it logs an error and returns. If the configuration is
846
+ * successfully saved, it updates the plugin's `configJson` property and logs a debug message. If an error occurs
847
+ * during the file write operation, it logs the error and returns.
848
+ *
849
+ * @param {RegisteredPlugin} plugin - The plugin whose configuration is to be saved.
850
+ * @param {PlatformConfig} config - The configuration data to be saved.
851
+ * @returns {Promise<void>} A promise that resolves when the configuration is successfully saved, or returns if an error occurs.
852
+ */
643
853
  async saveConfigFromJson(plugin, config) {
644
854
  if (!config.name || !config.type || config.name !== plugin.name) {
645
855
  this.log.error(`Error saving config file for plugin ${plg}${plugin.name}${er}. Wrong config data content:${rs}\n`, config);
@@ -650,12 +860,24 @@ export class PluginManager {
650
860
  await fs.writeFile(configFile, JSON.stringify(config, null, 2), 'utf8');
651
861
  plugin.configJson = config;
652
862
  this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}`);
863
+ // this.log.debug(`Saved config file ${configFile} for plugin ${plg}${plugin.name}${db}.\nConfig:${rs}\n`, config);
653
864
  }
654
865
  catch (err) {
655
866
  this.log.error(`Error saving config file ${configFile} for plugin ${plg}${plugin.name}${er}: ${err}`);
656
867
  return;
657
868
  }
658
869
  }
870
+ /**
871
+ * Loads the schema for a plugin.
872
+ *
873
+ * This method attempts to load the schema file for the specified plugin. If the schema file is found,
874
+ * it reads and parses the file, updates the schema's title and description, and logs the process.
875
+ * It also attempts to delete any old schema file from the matterbridge directory. If the schema file
876
+ * is not found, it logs the event and loads a default schema for the plugin.
877
+ *
878
+ * @param {RegisteredPlugin} plugin - The plugin whose schema is to be loaded.
879
+ * @returns {Promise<PlatformSchema>} A promise that resolves to the loaded schema object, or the default schema if the schema file is not found.
880
+ */
659
881
  async loadSchema(plugin) {
660
882
  let schemaFile = plugin.path.replace('package.json', `${plugin.name}.schema.json`);
661
883
  try {
@@ -665,6 +887,8 @@ export class PluginManager {
665
887
  schema.title = plugin.description;
666
888
  schema.description = plugin.name + ' v. ' + plugin.version + ' by ' + plugin.author;
667
889
  this.log.debug(`Loaded schema file ${schemaFile} for plugin ${plg}${plugin.name}${db}.`);
890
+ // this.log.debug(`Loaded schema file ${schemaFile} for plugin ${plg}${plugin.name}${db}.\nSchema:${rs}\n`, schema);
891
+ // Delete the schema file from old position
668
892
  schemaFile = path.join(this.matterbridge.matterbridgeDirectory, `${plugin.name}.schema.json`);
669
893
  try {
670
894
  await fs.unlink(schemaFile);
@@ -680,6 +904,16 @@ export class PluginManager {
680
904
  return this.getDefaultSchema(plugin);
681
905
  }
682
906
  }
907
+ /**
908
+ * Returns the default schema for a plugin.
909
+ *
910
+ * This method generates a default schema object for the specified plugin. The schema includes
911
+ * metadata such as the plugin's title, description, version, and author. It also defines the
912
+ * properties of the schema, including the plugin's name, type, debug flag, and unregisterOnShutdown flag.
913
+ *
914
+ * @param {RegisteredPlugin} plugin - The plugin for which the default schema is to be generated.
915
+ * @returns {PlatformSchema} The default schema object for the plugin.
916
+ */
683
917
  getDefaultSchema(plugin) {
684
918
  return {
685
919
  title: plugin.description,
@@ -710,3 +944,4 @@ export class PluginManager {
710
944
  };
711
945
  }
712
946
  }
947
+ //# sourceMappingURL=pluginManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManager.js","sourceRoot":"","sources":["../src/pluginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sDAAsD;AAEtD,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,kBAAkB,CAAC;AAGhI,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,EAA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L=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/storage/export.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from 'node-persist-manager';
2
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/storage/export.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}