matterbridge 3.0.1-dev-20250502-f374923 → 3.0.1-dev-20250502-7ffc38b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/matterbridge.js
CHANGED
|
@@ -5,14 +5,14 @@ import EventEmitter from 'node:events';
|
|
|
5
5
|
import { inspect } from 'node:util';
|
|
6
6
|
import { AnsiLogger, UNDERLINE, UNDERLINEOFF, YELLOW, db, debugStringify, BRIGHT, RESET, er, nf, rs, wr, RED, GREEN, zb, CYAN } from './logger/export.js';
|
|
7
7
|
import { NodeStorageManager } from './storage/export.js';
|
|
8
|
-
import { getParameter, getIntParameter, hasParameter, copyDirectory, withTimeout, waiter, isValidString, parseVersionString } from './utils/export.js';
|
|
8
|
+
import { getParameter, getIntParameter, hasParameter, copyDirectory, withTimeout, waiter, isValidString, parseVersionString, isValidNumber } from './utils/export.js';
|
|
9
9
|
import { logInterfaces, getGlobalNodeModules } from './utils/network.js';
|
|
10
10
|
import { PluginManager } from './pluginManager.js';
|
|
11
11
|
import { DeviceManager } from './deviceManager.js';
|
|
12
12
|
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
13
13
|
import { bridge } from './matterbridgeDeviceTypes.js';
|
|
14
14
|
import { Frontend } from './frontend.js';
|
|
15
|
-
import { DeviceTypeId, Endpoint as EndpointNode, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageService, Environment, ServerNode } from '@matter/main';
|
|
15
|
+
import { DeviceTypeId, Endpoint as EndpointNode, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageService, Environment, ServerNode, UINT32_MAX, UINT16_MAX, } from '@matter/main';
|
|
16
16
|
import { DeviceCommissioner, FabricAction, MdnsService, PaseClient } from '@matter/main/protocol';
|
|
17
17
|
import { AggregatorEndpoint } from '@matter/main/endpoints';
|
|
18
18
|
import { BasicInformationServer } from '@matter/main/behaviors/basic-information';
|
|
@@ -1406,10 +1406,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
1406
1406
|
await storageContext.set('productLabel', productName.slice(0, 32));
|
|
1407
1407
|
await storageContext.set('serialNumber', await storageContext.get('serialNumber', serialNumber ? serialNumber.slice(0, 32) : 'SN' + random));
|
|
1408
1408
|
await storageContext.set('uniqueId', await storageContext.get('uniqueId', 'UI' + random));
|
|
1409
|
-
await storageContext.set('softwareVersion', parseVersionString(this.matterbridgeVersion)
|
|
1410
|
-
await storageContext.set('softwareVersionString', isValidString(this.matterbridgeVersion, 5) ? this.matterbridgeVersion : '1.0.0');
|
|
1411
|
-
await storageContext.set('hardwareVersion', parseVersionString(this.systemInformation.osRelease)
|
|
1412
|
-
await storageContext.set('hardwareVersionString', isValidString(this.systemInformation.osRelease, 5) ? this.systemInformation.osRelease : '1.0.0');
|
|
1409
|
+
await storageContext.set('softwareVersion', isValidNumber(parseVersionString(this.matterbridgeVersion), 0, UINT32_MAX) ? parseVersionString(this.matterbridgeVersion) : 1);
|
|
1410
|
+
await storageContext.set('softwareVersionString', isValidString(this.matterbridgeVersion, 5, 64) ? this.matterbridgeVersion : '1.0.0');
|
|
1411
|
+
await storageContext.set('hardwareVersion', isValidNumber(parseVersionString(this.systemInformation.osRelease), 0, UINT16_MAX) ? parseVersionString(this.systemInformation.osRelease) : 1);
|
|
1412
|
+
await storageContext.set('hardwareVersionString', isValidString(this.systemInformation.osRelease, 5, 64) ? this.systemInformation.osRelease : '1.0.0');
|
|
1413
1413
|
this.log.debug(`Created server node storage context "${pluginName}.persist" for ${pluginName}:`);
|
|
1414
1414
|
this.log.debug(`- storeId: ${await storageContext.get('storeId')}`);
|
|
1415
1415
|
this.log.debug(`- deviceName: ${await storageContext.get('deviceName')}`);
|
|
@@ -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;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.0.1-dev-20250502-
|
|
3
|
+
"version": "3.0.1-dev-20250502-7ffc38b",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.0.1-dev-20250502-
|
|
9
|
+
"version": "3.0.1-dev-20250502-7ffc38b",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.13.0",
|
package/package.json
CHANGED