matterbridge 3.0.1-dev-20250502-6d36575 → 3.0.1-dev-20250502-c002841
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 +6 -4
- package/README-DOCKER.md +2 -0
- package/dist/frontend.js +204 -207
- package/dist/matterbridge.js +8 -5
- package/dist/matterbridgeEndpoint.js +8 -8
- package/dist/utils/isvalid.js +17 -1
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.2093c348.js → main.53d64feb.js} +3 -3
- package/frontend/build/static/js/{main.2093c348.js.map → main.53d64feb.js.map} +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- /package/frontend/build/static/js/{main.2093c348.js.LICENSE.txt → main.53d64feb.js.LICENSE.txt} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AnsiLogger, BLUE, CYAN, YELLOW, db, debugStringify, er, hk, or, zb } from './logger/export.js';
|
|
2
2
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
3
|
-
import { isValidNumber, isValidObject } from './utils/export.js';
|
|
3
|
+
import { isValidNumber, isValidObject, isValidString } from './utils/export.js';
|
|
4
4
|
import { MatterbridgeServer, MatterbridgeServerDevice, MatterbridgeIdentifyServer, MatterbridgeOnOffServer, MatterbridgeLevelControlServer, MatterbridgeColorControlServer, MatterbridgeWindowCoveringServer, MatterbridgeThermostatServer, MatterbridgeFanControlServer, MatterbridgeDoorLockServer, MatterbridgeModeSelectServer, MatterbridgeValveConfigurationAndControlServer, MatterbridgeSmokeCoAlarmServer, MatterbridgeBooleanStateConfigurationServer, MatterbridgeSwitchServer, } from './matterbridgeBehaviors.js';
|
|
5
5
|
import { addClusterServers, addFixedLabel, addOptionalClusterServers, addRequiredClusterServers, addUserLabel, capitalizeFirstLetter, createUniqueId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, getDefaultOccupancySensingClusterServer, lowercaseFirstLetter, updateAttribute, getClusterId, getAttributeId, setAttribute, getAttribute, checkNotLatinCharacters, generateUniqueId, subscribeAttribute, } from './matterbridgeEndpointHelpers.js';
|
|
6
|
-
import { Endpoint, Lifecycle, MutableEndpoint, NamedHandler, SupportedBehaviors, VendorId } from '@matter/main';
|
|
6
|
+
import { Endpoint, Lifecycle, MutableEndpoint, NamedHandler, SupportedBehaviors, UINT16_MAX, UINT32_MAX, VendorId } from '@matter/main';
|
|
7
7
|
import { getClusterNameById, MeasurementType } from '@matter/main/types';
|
|
8
8
|
import { Descriptor } from '@matter/main/clusters/descriptor';
|
|
9
9
|
import { PowerSource } from '@matter/main/clusters/power-source';
|
|
@@ -486,15 +486,15 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
486
486
|
vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined,
|
|
487
487
|
vendorName: vendorName.slice(0, 32),
|
|
488
488
|
productName: productName.slice(0, 32),
|
|
489
|
-
productUrl: this.productUrl,
|
|
489
|
+
productUrl: this.productUrl.slice(0, 256),
|
|
490
490
|
productLabel: deviceName.slice(0, 64),
|
|
491
491
|
nodeLabel: deviceName.slice(0, 32),
|
|
492
492
|
serialNumber: serialNumber.slice(0, 32),
|
|
493
|
-
uniqueId: this.uniqueId,
|
|
494
|
-
softwareVersion,
|
|
495
|
-
softwareVersionString: softwareVersionString.slice(0, 64),
|
|
496
|
-
hardwareVersion,
|
|
497
|
-
hardwareVersionString: hardwareVersionString.slice(0, 64),
|
|
493
|
+
uniqueId: this.uniqueId.slice(0, 32),
|
|
494
|
+
softwareVersion: isValidNumber(softwareVersion, 0, UINT32_MAX) ? softwareVersion : undefined,
|
|
495
|
+
softwareVersionString: isValidString(softwareVersionString) ? softwareVersionString.slice(0, 64) : undefined,
|
|
496
|
+
hardwareVersion: isValidNumber(hardwareVersion, 0, UINT16_MAX) ? hardwareVersion : undefined,
|
|
497
|
+
hardwareVersionString: isValidString(hardwareVersionString) ? hardwareVersionString.slice(0, 64) : undefined,
|
|
498
498
|
reachable: true,
|
|
499
499
|
});
|
|
500
500
|
return this;
|
package/dist/utils/isvalid.js
CHANGED
|
@@ -3,7 +3,7 @@ export function isValidIpv4Address(ipv4Address) {
|
|
|
3
3
|
return ipv4Regex.test(ipv4Address);
|
|
4
4
|
}
|
|
5
5
|
export function isValidNumber(value, min, max) {
|
|
6
|
-
if (value === undefined || value === null || typeof value !== 'number' || Number.isNaN(value))
|
|
6
|
+
if (value === undefined || value === null || typeof value !== 'number' || Number.isNaN(value) || !Number.isFinite(value))
|
|
7
7
|
return false;
|
|
8
8
|
if (min !== undefined && value < min)
|
|
9
9
|
return false;
|
|
@@ -48,3 +48,19 @@ export function isValidNull(value) {
|
|
|
48
48
|
export function isValidUndefined(value) {
|
|
49
49
|
return value === undefined;
|
|
50
50
|
}
|
|
51
|
+
export function parseVersionString(versionString) {
|
|
52
|
+
if (!isValidString(versionString))
|
|
53
|
+
return undefined;
|
|
54
|
+
versionString = versionString.trim();
|
|
55
|
+
const match = versionString.match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
56
|
+
if (!match)
|
|
57
|
+
return undefined;
|
|
58
|
+
const [, majorStr, minorStr, patchStr] = match;
|
|
59
|
+
const major = parseInt(majorStr, 10);
|
|
60
|
+
const minor = parseInt(minorStr, 10);
|
|
61
|
+
const patch = parseInt(patchStr, 10);
|
|
62
|
+
if ([major, minor, patch].some((n) => !Number.isFinite(n)) || major > 99 || minor > 99 || patch > 99) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return major * 10000 + minor * 100 + patch;
|
|
66
|
+
}
|
|
@@ -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.53d64feb.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.53d64feb.js.map": "./static/js/main.53d64feb.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.53d64feb.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.53d64feb.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>
|