matterbridge 3.0.0 → 3.0.1-dev-20250501-4f463f9
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 +2 -0
- package/README.md +22 -4
- package/dist/cli.js +2 -37
- package/dist/cluster/export.js +0 -2
- package/dist/defaultConfigSchema.js +0 -23
- package/dist/deviceManager.js +1 -94
- package/dist/frontend.js +19 -352
- package/dist/index.js +1 -28
- package/dist/logger/export.js +0 -1
- package/dist/matter/behaviors.js +0 -2
- package/dist/matter/clusters.js +0 -2
- package/dist/matter/devices.js +0 -2
- package/dist/matter/endpoints.js +0 -2
- package/dist/matter/export.js +0 -2
- package/dist/matter/types.js +0 -2
- package/dist/matterbridge.js +46 -747
- package/dist/matterbridgeAccessoryPlatform.js +0 -34
- package/dist/matterbridgeBehaviors.js +1 -33
- package/dist/matterbridgeDeviceTypes.js +12 -431
- package/dist/matterbridgeDynamicPlatform.js +0 -34
- package/dist/matterbridgeEndpoint.js +11 -794
- package/dist/matterbridgeEndpointHelpers.js +9 -142
- package/dist/matterbridgePlatform.js +7 -225
- package/dist/matterbridgeTypes.js +0 -24
- package/dist/pluginManager.js +3 -262
- package/dist/shelly.js +6 -146
- package/dist/storage/export.js +0 -1
- package/dist/update.js +0 -52
- package/dist/utils/colorUtils.js +2 -205
- package/dist/utils/copyDirectory.js +1 -37
- package/dist/utils/createZip.js +2 -42
- package/dist/utils/deepCopy.js +0 -40
- package/dist/utils/deepEqual.js +1 -65
- package/dist/utils/export.js +0 -1
- package/dist/utils/isvalid.js +0 -86
- package/dist/utils/network.js +5 -76
- package/dist/utils/parameter.js +0 -53
- package/dist/utils/wait.js +5 -48
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.1d983660.js → main.356788d7.js} +3 -3
- package/frontend/build/static/js/{main.1d983660.js.map → main.356788d7.js.map} +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -2
- package/dist/cli.d.ts +0 -29
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cluster/export.d.ts +0 -2
- package/dist/cluster/export.d.ts.map +0 -1
- package/dist/cluster/export.js.map +0 -1
- package/dist/defaultConfigSchema.d.ts +0 -27
- package/dist/defaultConfigSchema.d.ts.map +0 -1
- package/dist/defaultConfigSchema.js.map +0 -1
- package/dist/deviceManager.d.ts +0 -114
- package/dist/deviceManager.d.ts.map +0 -1
- package/dist/deviceManager.js.map +0 -1
- package/dist/frontend.d.ts +0 -222
- package/dist/frontend.d.ts.map +0 -1
- package/dist/frontend.js.map +0 -1
- package/dist/index.d.ts +0 -35
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger/export.d.ts +0 -2
- package/dist/logger/export.d.ts.map +0 -1
- package/dist/logger/export.js.map +0 -1
- package/dist/matter/behaviors.d.ts +0 -2
- package/dist/matter/behaviors.d.ts.map +0 -1
- package/dist/matter/behaviors.js.map +0 -1
- package/dist/matter/clusters.d.ts +0 -2
- package/dist/matter/clusters.d.ts.map +0 -1
- package/dist/matter/clusters.js.map +0 -1
- package/dist/matter/devices.d.ts +0 -2
- package/dist/matter/devices.d.ts.map +0 -1
- package/dist/matter/devices.js.map +0 -1
- package/dist/matter/endpoints.d.ts +0 -2
- package/dist/matter/endpoints.d.ts.map +0 -1
- package/dist/matter/endpoints.js.map +0 -1
- package/dist/matter/export.d.ts +0 -5
- package/dist/matter/export.d.ts.map +0 -1
- package/dist/matter/export.js.map +0 -1
- package/dist/matter/types.d.ts +0 -3
- package/dist/matter/types.d.ts.map +0 -1
- package/dist/matter/types.js.map +0 -1
- package/dist/matterbridge.d.ts +0 -431
- package/dist/matterbridge.d.ts.map +0 -1
- package/dist/matterbridge.js.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +0 -40
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
- package/dist/matterbridgeBehaviors.d.ts +0 -1514
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts +0 -494
- package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
- package/dist/matterbridgeDeviceTypes.js.map +0 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +0 -40
- package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
- package/dist/matterbridgeDynamicPlatform.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts +0 -943
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgeEndpointHelpers.d.ts +0 -2706
- package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
- package/dist/matterbridgeEndpointHelpers.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts +0 -294
- package/dist/matterbridgePlatform.d.ts.map +0 -1
- package/dist/matterbridgePlatform.js.map +0 -1
- package/dist/matterbridgeTypes.d.ts +0 -187
- package/dist/matterbridgeTypes.d.ts.map +0 -1
- package/dist/matterbridgeTypes.js.map +0 -1
- package/dist/pluginManager.d.ts +0 -271
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/shelly.d.ts +0 -92
- package/dist/shelly.d.ts.map +0 -1
- package/dist/shelly.js.map +0 -1
- package/dist/storage/export.d.ts +0 -2
- package/dist/storage/export.d.ts.map +0 -1
- package/dist/storage/export.js.map +0 -1
- package/dist/update.d.ts +0 -32
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js.map +0 -1
- package/dist/utils/colorUtils.d.ts +0 -61
- package/dist/utils/colorUtils.d.ts.map +0 -1
- package/dist/utils/colorUtils.js.map +0 -1
- package/dist/utils/copyDirectory.d.ts +0 -32
- package/dist/utils/copyDirectory.d.ts.map +0 -1
- package/dist/utils/copyDirectory.js.map +0 -1
- package/dist/utils/createZip.d.ts +0 -38
- package/dist/utils/createZip.d.ts.map +0 -1
- package/dist/utils/createZip.js.map +0 -1
- package/dist/utils/deepCopy.d.ts +0 -31
- package/dist/utils/deepCopy.d.ts.map +0 -1
- package/dist/utils/deepCopy.js.map +0 -1
- package/dist/utils/deepEqual.d.ts +0 -53
- package/dist/utils/deepEqual.d.ts.map +0 -1
- package/dist/utils/deepEqual.js.map +0 -1
- package/dist/utils/export.d.ts +0 -10
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/utils/isvalid.d.ts +0 -87
- package/dist/utils/isvalid.d.ts.map +0 -1
- package/dist/utils/isvalid.js.map +0 -1
- package/dist/utils/network.d.ts +0 -69
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/network.js.map +0 -1
- package/dist/utils/parameter.d.ts +0 -58
- package/dist/utils/parameter.d.ts.map +0 -1
- package/dist/utils/parameter.js.map +0 -1
- package/dist/utils/wait.d.ts +0 -43
- package/dist/utils/wait.d.ts.map +0 -1
- package/dist/utils/wait.js.map +0 -1
- /package/frontend/build/static/js/{main.1d983660.js.LICENSE.txt → main.356788d7.js.LICENSE.txt} +0 -0
package/dist/utils/parameter.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the deepEqual function.
|
|
3
|
-
*
|
|
4
|
-
* @file parameter.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2025-02-16
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2025, 2026, 2027 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
|
-
/**
|
|
24
|
-
* Checks if a command-line parameter is present.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} name - The name of the parameter to check.
|
|
27
|
-
* @returns {boolean} True if the parameter is present, otherwise false.
|
|
28
|
-
*/
|
|
29
1
|
export function hasParameter(name) {
|
|
30
2
|
const commandArguments = process.argv.slice(2);
|
|
31
3
|
let markerIncluded = commandArguments.includes(`-${name}`);
|
|
@@ -34,12 +6,6 @@ export function hasParameter(name) {
|
|
|
34
6
|
return markerIncluded;
|
|
35
7
|
}
|
|
36
8
|
import { isValidNumber } from './export.js';
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves the value of a command-line parameter.
|
|
39
|
-
*
|
|
40
|
-
* @param {string} name - The name of the parameter to retrieve.
|
|
41
|
-
* @returns {string | undefined} The value of the parameter, or undefined if not found.
|
|
42
|
-
*/
|
|
43
9
|
export function getParameter(name) {
|
|
44
10
|
const commandArguments = process.argv.slice(2);
|
|
45
11
|
let markerIndex = commandArguments.indexOf(`-${name}`);
|
|
@@ -49,12 +15,6 @@ export function getParameter(name) {
|
|
|
49
15
|
return undefined;
|
|
50
16
|
return commandArguments[markerIndex + 1];
|
|
51
17
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Retrieves the value of a command-line parameter as an integer.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} name - The name of the parameter to retrieve.
|
|
56
|
-
* @returns {number | undefined} The integer value of the parameter, or undefined if not found or invalid.
|
|
57
|
-
*/
|
|
58
18
|
export function getIntParameter(name) {
|
|
59
19
|
const value = getParameter(name);
|
|
60
20
|
if (value === undefined)
|
|
@@ -64,12 +24,6 @@ export function getIntParameter(name) {
|
|
|
64
24
|
return undefined;
|
|
65
25
|
return intValue;
|
|
66
26
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Retrieves the value of a command-line parameter as a number array.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} name - The name of the parameter to retrieve.
|
|
71
|
-
* @returns {number[] | undefined} An array of string values for the parameter, or undefined if not found.
|
|
72
|
-
*/
|
|
73
27
|
export function getIntArrayParameter(name) {
|
|
74
28
|
const commandArguments = process.argv.slice(2);
|
|
75
29
|
let markerIndex = commandArguments.indexOf(`--${name}`);
|
|
@@ -87,12 +41,6 @@ export function getIntArrayParameter(name) {
|
|
|
87
41
|
return undefined;
|
|
88
42
|
return intValues;
|
|
89
43
|
}
|
|
90
|
-
/**
|
|
91
|
-
* Retrieves the value of a command-line parameter as a string array.
|
|
92
|
-
*
|
|
93
|
-
* @param {string} name - The name of the parameter to retrieve.
|
|
94
|
-
* @returns {string[] | undefined} An array of string values for the parameter, or undefined if not found.
|
|
95
|
-
*/
|
|
96
44
|
export function getStringArrayParameter(name) {
|
|
97
45
|
const commandArguments = process.argv.slice(2);
|
|
98
46
|
let markerIndex = commandArguments.indexOf(`--${name}`);
|
|
@@ -108,4 +56,3 @@ export function getStringArrayParameter(name) {
|
|
|
108
56
|
return undefined;
|
|
109
57
|
return values;
|
|
110
58
|
}
|
|
111
|
-
//# sourceMappingURL=parameter.js.map
|
package/dist/utils/wait.js
CHANGED
|
@@ -1,42 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the wait, waiter and withTimeout functions.
|
|
3
|
-
*
|
|
4
|
-
* @file wait.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2025-02-16
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2025, 2026, 2027 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
|
-
// AnsiLogger module
|
|
24
1
|
import { AnsiLogger } from '../logger/export.js';
|
|
25
|
-
const log = new AnsiLogger({ logName: 'MatterbridgeUtils', logTimestampFormat: 4
|
|
26
|
-
/**
|
|
27
|
-
* Asynchronous waiter function that resolves when the provided condition is met or rejects on timeout.
|
|
28
|
-
* @param {string} name - The name of the waiter.
|
|
29
|
-
* @param {() => boolean} check - A function that checks the condition. Should return a boolean.
|
|
30
|
-
* @param {boolean} [exitWithReject=false] - Optional. If true, the promise will be rejected on timeout. Default is false.
|
|
31
|
-
* @param {number} [resolveTimeout=5000] - Optional. The timeout duration in milliseconds. Default is 5000ms.
|
|
32
|
-
* @param {number} [resolveInterval=500] - Optional. The interval duration in milliseconds between condition checks. Default is 500ms.
|
|
33
|
-
* @param {boolean} [debug=false] - Optional. If true, debug messages will be logged to the console. Default is false.
|
|
34
|
-
* @returns {Promise<boolean>} A promise that resolves to true when the condition is met, or false if the timeout occurs.
|
|
35
|
-
*/
|
|
2
|
+
const log = new AnsiLogger({ logName: 'MatterbridgeUtils', logTimestampFormat: 4, logLevel: "info" });
|
|
36
3
|
export async function waiter(name, check, exitWithReject = false, resolveTimeout = 5000, resolveInterval = 500, debug = false) {
|
|
37
4
|
if (check())
|
|
38
5
|
return true;
|
|
39
|
-
log.logLevel = "debug"
|
|
6
|
+
log.logLevel = "debug";
|
|
40
7
|
log.logName = 'Waiter';
|
|
41
8
|
if (debug)
|
|
42
9
|
log.debug(`Waiter "${name}" started...`);
|
|
@@ -62,19 +29,11 @@ export async function waiter(name, check, exitWithReject = false, resolveTimeout
|
|
|
62
29
|
}, resolveInterval);
|
|
63
30
|
});
|
|
64
31
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Asynchronously waits for a specified amount of time.
|
|
67
|
-
* @param {number} timeout - The duration to wait in milliseconds. Default is 1000ms.
|
|
68
|
-
* @param {string} name - The name of the wait operation. Default is undefined.
|
|
69
|
-
* @param {boolean} debug - Whether to enable debug logging. Default is false.
|
|
70
|
-
* @returns {Promise<void>} A Promise that resolves after the specified timeout.
|
|
71
|
-
*/
|
|
72
32
|
export async function wait(timeout = 1000, name, debug = false) {
|
|
73
|
-
log.logLevel = "debug"
|
|
33
|
+
log.logLevel = "debug";
|
|
74
34
|
log.logName = 'Wait';
|
|
75
35
|
if (debug)
|
|
76
36
|
log.debug(`Wait "${name}" started...`);
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
78
37
|
return new Promise((resolve, reject) => {
|
|
79
38
|
const timeoutId = setTimeout(() => {
|
|
80
39
|
if (debug)
|
|
@@ -84,19 +43,17 @@ export async function wait(timeout = 1000, name, debug = false) {
|
|
|
84
43
|
}, timeout);
|
|
85
44
|
});
|
|
86
45
|
}
|
|
87
|
-
// Helper function to add a timeout to a promise
|
|
88
46
|
export function withTimeout(promise, ms) {
|
|
89
47
|
return new Promise((resolve, reject) => {
|
|
90
48
|
const timer = setTimeout(() => reject(new Error('Operation timed out')), ms);
|
|
91
49
|
promise
|
|
92
50
|
.then((result) => {
|
|
93
|
-
clearTimeout(timer);
|
|
51
|
+
clearTimeout(timer);
|
|
94
52
|
resolve(result);
|
|
95
53
|
})
|
|
96
54
|
.catch((error) => {
|
|
97
|
-
clearTimeout(timer);
|
|
55
|
+
clearTimeout(timer);
|
|
98
56
|
reject(error);
|
|
99
57
|
});
|
|
100
58
|
});
|
|
101
59
|
}
|
|
102
|
-
//# sourceMappingURL=wait.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "./static/css/main.944b63c3.css",
|
|
4
|
-
"main.js": "./static/js/main.
|
|
4
|
+
"main.js": "./static/js/main.356788d7.js",
|
|
5
5
|
"static/js/453.d855a71b.chunk.js": "./static/js/453.d855a71b.chunk.js",
|
|
6
6
|
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.c4d6cab43bec89049809.woff2",
|
|
7
7
|
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.599f66a60bdf974e578e.woff2",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"static/media/roboto-greek-ext-300-normal.woff": "./static/media/roboto-greek-ext-300-normal.60729cafbded24073dfb.woff",
|
|
78
78
|
"index.html": "./index.html",
|
|
79
79
|
"main.944b63c3.css.map": "./static/css/main.944b63c3.css.map",
|
|
80
|
-
"main.
|
|
80
|
+
"main.356788d7.js.map": "./static/js/main.356788d7.js.map",
|
|
81
81
|
"453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
|
|
82
82
|
},
|
|
83
83
|
"entrypoints": [
|
|
84
84
|
"static/css/main.944b63c3.css",
|
|
85
|
-
"static/js/main.
|
|
85
|
+
"static/js/main.356788d7.js"
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.356788d7.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|