@zwave-js/cc 14.0.0-beta.1 → 14.0.0-beta.5
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/build/cjs/cc/AlarmSensorCC.d.ts +194 -0
- package/build/cjs/cc/AlarmSensorCC.js +510 -0
- package/build/cjs/cc/AlarmSensorCC.js.map +7 -0
- package/build/cjs/cc/AssociationCC.d.ts +253 -0
- package/build/cjs/cc/AssociationCC.js +877 -0
- package/build/cjs/cc/AssociationCC.js.map +7 -0
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js +887 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +7 -0
- package/build/cjs/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/cjs/cc/BarrierOperatorCC.js +748 -0
- package/build/cjs/cc/BarrierOperatorCC.js.map +7 -0
- package/build/cjs/cc/BasicCC.d.ts +191 -0
- package/build/cjs/cc/BasicCC.js +478 -0
- package/build/cjs/cc/BasicCC.js.map +7 -0
- package/build/cjs/cc/BatteryCC.d.ts +406 -0
- package/build/cjs/cc/BatteryCC.js +590 -0
- package/build/cjs/cc/BatteryCC.js.map +7 -0
- package/build/cjs/cc/BinarySensorCC.d.ts +122 -0
- package/build/cjs/cc/BinarySensorCC.js +546 -0
- package/build/cjs/cc/BinarySensorCC.js.map +7 -0
- package/build/cjs/cc/BinarySwitchCC.d.ts +139 -0
- package/build/cjs/cc/BinarySwitchCC.js +472 -0
- package/build/cjs/cc/BinarySwitchCC.js.map +7 -0
- package/build/cjs/cc/CRC16CC.d.ts +29 -0
- package/build/cjs/cc/CRC16CC.js +208 -0
- package/build/cjs/cc/CRC16CC.js.map +7 -0
- package/build/cjs/cc/CentralSceneCC.d.ts +210 -0
- package/build/cjs/cc/CentralSceneCC.js +584 -0
- package/build/cjs/cc/CentralSceneCC.js.map +7 -0
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js +646 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +7 -0
- package/build/cjs/cc/ClockCC.d.ts +47 -0
- package/build/cjs/cc/ClockCC.js +330 -0
- package/build/cjs/cc/ClockCC.js.map +7 -0
- package/build/cjs/cc/ColorSwitchCC.d.ts +339 -0
- package/build/cjs/cc/ColorSwitchCC.js +1265 -0
- package/build/cjs/cc/ColorSwitchCC.js.map +7 -0
- package/build/cjs/cc/ConfigurationCC.d.ts +396 -0
- package/build/cjs/cc/ConfigurationCC.js +2477 -0
- package/build/cjs/cc/ConfigurationCC.js.map +7 -0
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js +168 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +7 -0
- package/build/cjs/cc/DoorLockCC.d.ts +837 -0
- package/build/cjs/cc/DoorLockCC.js +1366 -0
- package/build/cjs/cc/DoorLockCC.js.map +7 -0
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/cjs/cc/DoorLockLoggingCC.js +458 -0
- package/build/cjs/cc/DoorLockLoggingCC.js.map +7 -0
- package/build/cjs/cc/EnergyProductionCC.d.ts +77 -0
- package/build/cjs/cc/EnergyProductionCC.js +329 -0
- package/build/cjs/cc/EnergyProductionCC.js.map +7 -0
- package/build/cjs/cc/EntryControlCC.d.ts +231 -0
- package/build/cjs/cc/EntryControlCC.js +754 -0
- package/build/cjs/cc/EntryControlCC.js.map +7 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +1322 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +7 -0
- package/build/cjs/cc/HailCC.d.ts +6 -0
- package/build/cjs/cc/HailCC.js +91 -0
- package/build/cjs/cc/HailCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/cjs/cc/HumidityControlModeCC.js +449 -0
- package/build/cjs/cc/HumidityControlModeCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +250 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js +821 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +7 -0
- package/build/cjs/cc/InclusionControllerCC.d.ts +42 -0
- package/build/cjs/cc/InclusionControllerCC.js +251 -0
- package/build/cjs/cc/InclusionControllerCC.js.map +7 -0
- package/build/cjs/cc/IndicatorCC.d.ts +338 -0
- package/build/cjs/cc/IndicatorCC.js +1395 -0
- package/build/cjs/cc/IndicatorCC.js.map +7 -0
- package/build/cjs/cc/IrrigationCC.d.ts +1496 -0
- package/build/cjs/cc/IrrigationCC.js +2224 -0
- package/build/cjs/cc/IrrigationCC.js.map +7 -0
- package/build/cjs/cc/LanguageCC.d.ts +101 -0
- package/build/cjs/cc/LanguageCC.js +364 -0
- package/build/cjs/cc/LanguageCC.js.map +7 -0
- package/build/cjs/cc/LockCC.d.ts +73 -0
- package/build/cjs/cc/LockCC.js +322 -0
- package/build/cjs/cc/LockCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js +269 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js +440 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +7 -0
- package/build/cjs/cc/MeterCC.d.ts +318 -0
- package/build/cjs/cc/MeterCC.js +1355 -0
- package/build/cjs/cc/MeterCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js +1090 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelCC.d.ts +394 -0
- package/build/cjs/cc/MultiChannelCC.js +1268 -0
- package/build/cjs/cc/MultiChannelCC.js.map +7 -0
- package/build/cjs/cc/MultiCommandCC.d.ts +27 -0
- package/build/cjs/cc/MultiCommandCC.js +234 -0
- package/build/cjs/cc/MultiCommandCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/cjs/cc/MultilevelSensorCC.js +856 -0
- package/build/cjs/cc/MultilevelSensorCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/cjs/cc/MultilevelSwitchCC.js +928 -0
- package/build/cjs/cc/MultilevelSwitchCC.js.map +7 -0
- package/build/cjs/cc/NoOperationCC.d.ts +9 -0
- package/build/cjs/cc/NoOperationCC.js +126 -0
- package/build/cjs/cc/NoOperationCC.js.map +7 -0
- package/build/cjs/cc/NodeNamingCC.d.ts +118 -0
- package/build/cjs/cc/NodeNamingCC.js +504 -0
- package/build/cjs/cc/NodeNamingCC.js.map +7 -0
- package/build/cjs/cc/NotificationCC.d.ts +479 -0
- package/build/cjs/cc/NotificationCC.js +1399 -0
- package/build/cjs/cc/NotificationCC.js.map +7 -0
- package/build/cjs/cc/PowerlevelCC.d.ts +82 -0
- package/build/cjs/cc/PowerlevelCC.js +657 -0
- package/build/cjs/cc/PowerlevelCC.js.map +7 -0
- package/build/cjs/cc/ProtectionCC.d.ts +325 -0
- package/build/cjs/cc/ProtectionCC.js +859 -0
- package/build/cjs/cc/ProtectionCC.js.map +7 -0
- package/build/cjs/cc/SceneActivationCC.d.ts +89 -0
- package/build/cjs/cc/SceneActivationCC.js +261 -0
- package/build/cjs/cc/SceneActivationCC.js.map +7 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +473 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +7 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js +526 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +7 -0
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js +2043 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +7 -0
- package/build/cjs/cc/Security2CC.d.ts +251 -0
- package/build/cjs/cc/Security2CC.js +1853 -0
- package/build/cjs/cc/Security2CC.js.map +7 -0
- package/build/cjs/cc/SecurityCC.d.ts +128 -0
- package/build/cjs/cc/SecurityCC.js +977 -0
- package/build/cjs/cc/SecurityCC.js.map +7 -0
- package/build/cjs/cc/SoundSwitchCC.d.ts +232 -0
- package/build/cjs/cc/SoundSwitchCC.js +853 -0
- package/build/cjs/cc/SoundSwitchCC.js.map +7 -0
- package/build/cjs/cc/SupervisionCC.d.ts +104 -0
- package/build/cjs/cc/SupervisionCC.js +398 -0
- package/build/cjs/cc/SupervisionCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/cjs/cc/ThermostatFanModeCC.js +495 -0
- package/build/cjs/cc/ThermostatFanModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/cjs/cc/ThermostatFanStateCC.js +252 -0
- package/build/cjs/cc/ThermostatFanStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatModeCC.d.ts +150 -0
- package/build/cjs/cc/ThermostatModeCC.js +559 -0
- package/build/cjs/cc/ThermostatModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js +248 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/cjs/cc/ThermostatSetbackCC.js +366 -0
- package/build/cjs/cc/ThermostatSetbackCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/cjs/cc/ThermostatSetpointCC.js +792 -0
- package/build/cjs/cc/ThermostatSetpointCC.js.map +7 -0
- package/build/cjs/cc/TimeCC.d.ts +88 -0
- package/build/cjs/cc/TimeCC.js +635 -0
- package/build/cjs/cc/TimeCC.js.map +7 -0
- package/build/cjs/cc/TimeParametersCC.d.ts +72 -0
- package/build/cjs/cc/TimeParametersCC.js +413 -0
- package/build/cjs/cc/TimeParametersCC.js.map +7 -0
- package/build/cjs/cc/TransportServiceCC.d.ts +107 -0
- package/build/cjs/cc/TransportServiceCC.js +522 -0
- package/build/cjs/cc/TransportServiceCC.js.map +7 -0
- package/build/cjs/cc/UserCodeCC.d.ts +683 -0
- package/build/cjs/cc/UserCodeCC.js +1903 -0
- package/build/cjs/cc/UserCodeCC.js.map +7 -0
- package/build/cjs/cc/VersionCC.d.ts +469 -0
- package/build/cjs/cc/VersionCC.js +962 -0
- package/build/cjs/cc/VersionCC.js.map +7 -0
- package/build/cjs/cc/WakeUpCC.d.ts +150 -0
- package/build/cjs/cc/WakeUpCC.js +609 -0
- package/build/cjs/cc/WakeUpCC.js.map +7 -0
- package/build/cjs/cc/WindowCoveringCC.d.ts +315 -0
- package/build/cjs/cc/WindowCoveringCC.js +924 -0
- package/build/cjs/cc/WindowCoveringCC.js.map +7 -0
- package/build/cjs/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js +90 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +7 -0
- package/build/cjs/cc/ZWavePlusCC.d.ts +163 -0
- package/build/cjs/cc/ZWavePlusCC.js +362 -0
- package/build/cjs/cc/ZWavePlusCC.js.map +7 -0
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/cjs/cc/ZWaveProtocolCC.js +1638 -0
- package/build/cjs/cc/ZWaveProtocolCC.js.map +7 -0
- package/build/cjs/cc/index.d.ts +132 -0
- package/build/cjs/cc/index.js +1180 -0
- package/build/cjs/cc/index.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js +76 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +533 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +7 -0
- package/build/cjs/index.d.ts +15 -0
- package/build/cjs/index.js +77 -0
- package/build/cjs/index.js.map +7 -0
- package/build/cjs/index_safe.d.ts +3 -0
- package/build/cjs/index_safe.js +25 -0
- package/build/cjs/index_safe.js.map +7 -0
- package/build/cjs/lib/API.d.ts +271 -0
- package/build/cjs/lib/API.js +413 -0
- package/build/cjs/lib/API.js.map +7 -0
- package/build/cjs/lib/CommandClass.d.ts +234 -0
- package/build/cjs/lib/CommandClass.js +692 -0
- package/build/cjs/lib/CommandClass.js.map +7 -0
- package/build/cjs/lib/CommandClassDecorators.d.ts +108 -0
- package/build/cjs/lib/CommandClassDecorators.js +181 -0
- package/build/cjs/lib/CommandClassDecorators.js.map +7 -0
- package/build/cjs/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js +71 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js.map +7 -0
- package/build/cjs/lib/ICommandClassContainer.js +17 -0
- package/build/cjs/lib/ICommandClassContainer.js.map +7 -0
- package/build/cjs/lib/NotificationEventPayload.d.ts +10 -0
- package/build/cjs/lib/NotificationEventPayload.js +31 -0
- package/build/cjs/lib/NotificationEventPayload.js.map +7 -0
- package/build/cjs/lib/Security2/Extension.d.ts +106 -0
- package/build/cjs/lib/Security2/Extension.js +424 -0
- package/build/cjs/lib/Security2/Extension.js.map +7 -0
- package/build/cjs/lib/Security2/shared.js +69 -0
- package/build/cjs/lib/Security2/shared.js.map +7 -0
- package/build/cjs/lib/SetValueResult.js +65 -0
- package/build/cjs/lib/SetValueResult.js.map +7 -0
- package/build/cjs/lib/Values.d.ts +223 -0
- package/build/cjs/lib/Values.js +191 -0
- package/build/cjs/lib/Values.js.map +7 -0
- package/build/cjs/lib/_Types.js +1676 -0
- package/build/cjs/lib/_Types.js.map +7 -0
- package/build/cjs/lib/serializers.d.ts +34 -0
- package/build/cjs/lib/serializers.js +110 -0
- package/build/cjs/lib/serializers.js.map +7 -0
- package/build/cjs/lib/utils.d.ts +17 -0
- package/build/cjs/lib/utils.js +678 -0
- package/build/cjs/lib/utils.js.map +7 -0
- package/build/cjs/package.json +3 -0
- package/build/esm/cc/AlarmSensorCC.d.ts +194 -0
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -0
- package/build/esm/cc/AlarmSensorCC.js +490 -0
- package/build/esm/cc/AlarmSensorCC.js.map +1 -0
- package/build/esm/cc/AssociationCC.d.ts +253 -0
- package/build/esm/cc/AssociationCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationCC.js +847 -0
- package/build/esm/cc/AssociationCC.js.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.js +889 -0
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.js +751 -0
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -0
- package/build/esm/cc/BasicCC.d.ts +191 -0
- package/build/esm/cc/BasicCC.d.ts.map +1 -0
- package/build/esm/cc/BasicCC.js +468 -0
- package/build/esm/cc/BasicCC.js.map +1 -0
- package/build/esm/cc/BatteryCC.d.ts +406 -0
- package/build/esm/cc/BatteryCC.d.ts.map +1 -0
- package/build/esm/cc/BatteryCC.js +578 -0
- package/build/esm/cc/BatteryCC.js.map +1 -0
- package/build/esm/cc/BinarySensorCC.d.ts +122 -0
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySensorCC.js +515 -0
- package/build/esm/cc/BinarySensorCC.js.map +1 -0
- package/build/esm/cc/BinarySwitchCC.d.ts +139 -0
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySwitchCC.js +441 -0
- package/build/esm/cc/BinarySwitchCC.js.map +1 -0
- package/build/esm/cc/CRC16CC.d.ts +29 -0
- package/build/esm/cc/CRC16CC.d.ts.map +1 -0
- package/build/esm/cc/CRC16CC.js +187 -0
- package/build/esm/cc/CRC16CC.js.map +1 -0
- package/build/esm/cc/CentralSceneCC.d.ts +210 -0
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -0
- package/build/esm/cc/CentralSceneCC.js +541 -0
- package/build/esm/cc/CentralSceneCC.js.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.js +607 -0
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -0
- package/build/esm/cc/ClockCC.d.ts +47 -0
- package/build/esm/cc/ClockCC.d.ts.map +1 -0
- package/build/esm/cc/ClockCC.js +294 -0
- package/build/esm/cc/ClockCC.js.map +1 -0
- package/build/esm/cc/ColorSwitchCC.d.ts +339 -0
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/ColorSwitchCC.js +1274 -0
- package/build/esm/cc/ColorSwitchCC.js.map +1 -0
- package/build/esm/cc/ConfigurationCC.d.ts +396 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/ConfigurationCC.js +2666 -0
- package/build/esm/cc/ConfigurationCC.js.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.js +138 -0
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -0
- package/build/esm/cc/DoorLockCC.d.ts +837 -0
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockCC.js +1372 -0
- package/build/esm/cc/DoorLockCC.js.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.js +414 -0
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -0
- package/build/esm/cc/EnergyProductionCC.d.ts +77 -0
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -0
- package/build/esm/cc/EnergyProductionCC.js +289 -0
- package/build/esm/cc/EnergyProductionCC.js.map +1 -0
- package/build/esm/cc/EntryControlCC.d.ts +231 -0
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -0
- package/build/esm/cc/EntryControlCC.js +717 -0
- package/build/esm/cc/EntryControlCC.js.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +1311 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
- package/build/esm/cc/HailCC.d.ts +6 -0
- package/build/esm/cc/HailCC.d.ts.map +1 -0
- package/build/esm/cc/HailCC.js +60 -0
- package/build/esm/cc/HailCC.js.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.js +412 -0
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js +210 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.js +805 -0
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -0
- package/build/esm/cc/InclusionControllerCC.d.ts +42 -0
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -0
- package/build/esm/cc/InclusionControllerCC.js +211 -0
- package/build/esm/cc/InclusionControllerCC.js.map +1 -0
- package/build/esm/cc/IndicatorCC.d.ts +338 -0
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -0
- package/build/esm/cc/IndicatorCC.js +1455 -0
- package/build/esm/cc/IndicatorCC.js.map +1 -0
- package/build/esm/cc/IrrigationCC.d.ts +1496 -0
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -0
- package/build/esm/cc/IrrigationCC.js +2239 -0
- package/build/esm/cc/IrrigationCC.js.map +1 -0
- package/build/esm/cc/LanguageCC.d.ts +101 -0
- package/build/esm/cc/LanguageCC.d.ts.map +1 -0
- package/build/esm/cc/LanguageCC.js +325 -0
- package/build/esm/cc/LanguageCC.js.map +1 -0
- package/build/esm/cc/LockCC.d.ts +73 -0
- package/build/esm/cc/LockCC.d.ts.map +1 -0
- package/build/esm/cc/LockCC.js +282 -0
- package/build/esm/cc/LockCC.js.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js +252 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.js +404 -0
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -0
- package/build/esm/cc/MeterCC.d.ts +318 -0
- package/build/esm/cc/MeterCC.d.ts.map +1 -0
- package/build/esm/cc/MeterCC.js +1409 -0
- package/build/esm/cc/MeterCC.js.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.js +1094 -0
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -0
- package/build/esm/cc/MultiChannelCC.d.ts +394 -0
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelCC.js +1312 -0
- package/build/esm/cc/MultiChannelCC.js.map +1 -0
- package/build/esm/cc/MultiCommandCC.d.ts +27 -0
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -0
- package/build/esm/cc/MultiCommandCC.js +206 -0
- package/build/esm/cc/MultiCommandCC.js.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.js +872 -0
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.js +935 -0
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -0
- package/build/esm/cc/NoOperationCC.d.ts +9 -0
- package/build/esm/cc/NoOperationCC.d.ts.map +1 -0
- package/build/esm/cc/NoOperationCC.js +92 -0
- package/build/esm/cc/NoOperationCC.js.map +1 -0
- package/build/esm/cc/NodeNamingCC.d.ts +118 -0
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -0
- package/build/esm/cc/NodeNamingCC.js +464 -0
- package/build/esm/cc/NodeNamingCC.js.map +1 -0
- package/build/esm/cc/NotificationCC.d.ts +479 -0
- package/build/esm/cc/NotificationCC.d.ts.map +1 -0
- package/build/esm/cc/NotificationCC.js +1481 -0
- package/build/esm/cc/NotificationCC.js.map +1 -0
- package/build/esm/cc/PowerlevelCC.d.ts +82 -0
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -0
- package/build/esm/cc/PowerlevelCC.js +611 -0
- package/build/esm/cc/PowerlevelCC.js.map +1 -0
- package/build/esm/cc/ProtectionCC.d.ts +325 -0
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -0
- package/build/esm/cc/ProtectionCC.js +830 -0
- package/build/esm/cc/ProtectionCC.js.map +1 -0
- package/build/esm/cc/SceneActivationCC.d.ts +89 -0
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActivationCC.js +223 -0
- package/build/esm/cc/SceneActivationCC.js.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js +462 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js +534 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.js +2065 -0
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -0
- package/build/esm/cc/Security2CC.d.ts +251 -0
- package/build/esm/cc/Security2CC.d.ts.map +1 -0
- package/build/esm/cc/Security2CC.js +2041 -0
- package/build/esm/cc/Security2CC.js.map +1 -0
- package/build/esm/cc/SecurityCC.d.ts +128 -0
- package/build/esm/cc/SecurityCC.d.ts.map +1 -0
- package/build/esm/cc/SecurityCC.js +989 -0
- package/build/esm/cc/SecurityCC.js.map +1 -0
- package/build/esm/cc/SoundSwitchCC.d.ts +232 -0
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/SoundSwitchCC.js +796 -0
- package/build/esm/cc/SoundSwitchCC.js.map +1 -0
- package/build/esm/cc/SupervisionCC.d.ts +104 -0
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -0
- package/build/esm/cc/SupervisionCC.js +396 -0
- package/build/esm/cc/SupervisionCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.js +463 -0
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.js +212 -0
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatModeCC.d.ts +150 -0
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatModeCC.js +530 -0
- package/build/esm/cc/ThermostatModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js +208 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.js +333 -0
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.js +786 -0
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -0
- package/build/esm/cc/TimeCC.d.ts +88 -0
- package/build/esm/cc/TimeCC.d.ts.map +1 -0
- package/build/esm/cc/TimeCC.js +590 -0
- package/build/esm/cc/TimeCC.js.map +1 -0
- package/build/esm/cc/TimeParametersCC.d.ts +72 -0
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -0
- package/build/esm/cc/TimeParametersCC.js +385 -0
- package/build/esm/cc/TimeParametersCC.js.map +1 -0
- package/build/esm/cc/TransportServiceCC.d.ts +107 -0
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -0
- package/build/esm/cc/TransportServiceCC.js +523 -0
- package/build/esm/cc/TransportServiceCC.js.map +1 -0
- package/build/esm/cc/UserCodeCC.d.ts +683 -0
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -0
- package/build/esm/cc/UserCodeCC.js +1933 -0
- package/build/esm/cc/UserCodeCC.js.map +1 -0
- package/build/esm/cc/VersionCC.d.ts +469 -0
- package/build/esm/cc/VersionCC.d.ts.map +1 -0
- package/build/esm/cc/VersionCC.js +971 -0
- package/build/esm/cc/VersionCC.js.map +1 -0
- package/build/esm/cc/WakeUpCC.d.ts +150 -0
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -0
- package/build/esm/cc/WakeUpCC.js +568 -0
- package/build/esm/cc/WakeUpCC.js.map +1 -0
- package/build/esm/cc/WindowCoveringCC.d.ts +315 -0
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -0
- package/build/esm/cc/WindowCoveringCC.js +905 -0
- package/build/esm/cc/WindowCoveringCC.js.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.js +57 -0
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -0
- package/build/esm/cc/ZWavePlusCC.d.ts +163 -0
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -0
- package/build/esm/cc/ZWavePlusCC.js +328 -0
- package/build/esm/cc/ZWavePlusCC.js.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.js +1520 -0
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -0
- package/build/esm/cc/index.d.ts +132 -0
- package/build/esm/cc/index.d.ts.map +1 -0
- package/build/esm/cc/index.js +71 -0
- package/build/esm/cc/index.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js +79 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +489 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
- package/build/esm/index.d.ts +15 -0
- package/build/esm/index.d.ts.map +1 -0
- package/build/esm/index.js +14 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/index_safe.d.ts +3 -0
- package/build/esm/index_safe.d.ts.map +1 -0
- package/build/esm/index_safe.js +4 -0
- package/build/esm/index_safe.js.map +1 -0
- package/build/esm/lib/API.d.ts +271 -0
- package/build/esm/lib/API.d.ts.map +1 -0
- package/build/esm/lib/API.js +448 -0
- package/build/esm/lib/API.js.map +1 -0
- package/build/esm/lib/CommandClass.d.ts +234 -0
- package/build/esm/lib/CommandClass.d.ts.map +1 -0
- package/build/esm/lib/CommandClass.js +781 -0
- package/build/esm/lib/CommandClass.js.map +1 -0
- package/build/esm/lib/CommandClassDecorators.d.ts +108 -0
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -0
- package/build/esm/lib/CommandClassDecorators.js +229 -0
- package/build/esm/lib/CommandClassDecorators.js.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.js +56 -0
- package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -0
- package/build/esm/lib/ICommandClassContainer.d.ts +2 -0
- package/build/esm/lib/ICommandClassContainer.d.ts.map +1 -0
- package/build/esm/lib/ICommandClassContainer.js +2 -0
- package/build/esm/lib/ICommandClassContainer.js.map +1 -0
- package/build/esm/lib/NotificationEventPayload.d.ts +10 -0
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -0
- package/build/esm/lib/NotificationEventPayload.js +7 -0
- package/build/esm/lib/NotificationEventPayload.js.map +1 -0
- package/build/esm/lib/Security2/Extension.d.ts +106 -0
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -0
- package/build/esm/lib/Security2/Extension.js +380 -0
- package/build/esm/lib/Security2/Extension.js.map +1 -0
- package/build/esm/lib/Security2/shared.d.ts +37 -0
- package/build/esm/lib/Security2/shared.d.ts.map +1 -0
- package/build/esm/lib/Security2/shared.js +40 -0
- package/build/esm/lib/Security2/shared.js.map +1 -0
- package/build/esm/lib/SetValueResult.d.ts +55 -0
- package/build/esm/lib/SetValueResult.d.ts.map +1 -0
- package/build/esm/lib/SetValueResult.js +53 -0
- package/build/esm/lib/SetValueResult.js.map +1 -0
- package/build/esm/lib/Values.d.ts +223 -0
- package/build/esm/lib/Values.d.ts.map +1 -0
- package/build/esm/lib/Values.js +169 -0
- package/build/esm/lib/Values.js.map +1 -0
- package/build/esm/lib/_Types.d.ts +1461 -0
- package/build/esm/lib/_Types.d.ts.map +1 -0
- package/build/esm/lib/_Types.js +1432 -0
- package/build/esm/lib/_Types.js.map +1 -0
- package/build/esm/lib/serializers.d.ts +34 -0
- package/build/esm/lib/serializers.d.ts.map +1 -0
- package/build/esm/lib/serializers.js +98 -0
- package/build/esm/lib/serializers.js.map +1 -0
- package/build/esm/lib/utils.d.ts +17 -0
- package/build/esm/lib/utils.d.ts.map +1 -0
- package/build/esm/lib/utils.js +847 -0
- package/build/esm/lib/utils.js.map +1 -0
- package/build/esm/package.json +3 -0
- package/package.json +28 -23
- package/build/cc/AlarmSensorCC.d.ts +0 -194
- package/build/cc/AlarmSensorCC.d.ts.map +0 -1
- package/build/cc/AlarmSensorCC.js +0 -395
- package/build/cc/AlarmSensorCC.js.map +0 -1
- package/build/cc/AssociationCC.d.ts +0 -253
- package/build/cc/AssociationCC.d.ts.map +0 -1
- package/build/cc/AssociationCC.js +0 -732
- package/build/cc/AssociationCC.js.map +0 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +0 -230
- package/build/cc/AssociationGroupInfoCC.d.ts.map +0 -1
- package/build/cc/AssociationGroupInfoCC.js +0 -772
- package/build/cc/AssociationGroupInfoCC.js.map +0 -1
- package/build/cc/BarrierOperatorCC.d.ts +0 -243
- package/build/cc/BarrierOperatorCC.d.ts.map +0 -1
- package/build/cc/BarrierOperatorCC.js +0 -613
- package/build/cc/BarrierOperatorCC.js.map +0 -1
- package/build/cc/BasicCC.d.ts +0 -191
- package/build/cc/BasicCC.d.ts.map +0 -1
- package/build/cc/BasicCC.js +0 -393
- package/build/cc/BasicCC.js.map +0 -1
- package/build/cc/BatteryCC.d.ts +0 -406
- package/build/cc/BatteryCC.d.ts.map +0 -1
- package/build/cc/BatteryCC.js +0 -516
- package/build/cc/BatteryCC.js.map +0 -1
- package/build/cc/BinarySensorCC.d.ts +0 -122
- package/build/cc/BinarySensorCC.d.ts.map +0 -1
- package/build/cc/BinarySensorCC.js +0 -420
- package/build/cc/BinarySensorCC.js.map +0 -1
- package/build/cc/BinarySwitchCC.d.ts +0 -139
- package/build/cc/BinarySwitchCC.d.ts.map +0 -1
- package/build/cc/BinarySwitchCC.js +0 -365
- package/build/cc/BinarySwitchCC.js.map +0 -1
- package/build/cc/CRC16CC.d.ts +0 -29
- package/build/cc/CRC16CC.d.ts.map +0 -1
- package/build/cc/CRC16CC.js +0 -126
- package/build/cc/CRC16CC.js.map +0 -1
- package/build/cc/CentralSceneCC.d.ts +0 -210
- package/build/cc/CentralSceneCC.d.ts.map +0 -1
- package/build/cc/CentralSceneCC.js +0 -453
- package/build/cc/CentralSceneCC.js.map +0 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +0 -177
- package/build/cc/ClimateControlScheduleCC.d.ts.map +0 -1
- package/build/cc/ClimateControlScheduleCC.js +0 -469
- package/build/cc/ClimateControlScheduleCC.js.map +0 -1
- package/build/cc/ClockCC.d.ts +0 -47
- package/build/cc/ClockCC.d.ts.map +0 -1
- package/build/cc/ClockCC.js +0 -208
- package/build/cc/ClockCC.js.map +0 -1
- package/build/cc/ColorSwitchCC.d.ts +0 -339
- package/build/cc/ColorSwitchCC.d.ts.map +0 -1
- package/build/cc/ColorSwitchCC.js +0 -1152
- package/build/cc/ColorSwitchCC.js.map +0 -1
- package/build/cc/ConfigurationCC.d.ts +0 -396
- package/build/cc/ConfigurationCC.d.ts.map +0 -1
- package/build/cc/ConfigurationCC.js +0 -2458
- package/build/cc/ConfigurationCC.js.map +0 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +0 -17
- package/build/cc/DeviceResetLocallyCC.d.ts.map +0 -1
- package/build/cc/DeviceResetLocallyCC.js +0 -76
- package/build/cc/DeviceResetLocallyCC.js.map +0 -1
- package/build/cc/DoorLockCC.d.ts +0 -837
- package/build/cc/DoorLockCC.d.ts.map +0 -1
- package/build/cc/DoorLockCC.js +0 -1273
- package/build/cc/DoorLockCC.js.map +0 -1
- package/build/cc/DoorLockLoggingCC.d.ts +0 -77
- package/build/cc/DoorLockLoggingCC.d.ts.map +0 -1
- package/build/cc/DoorLockLoggingCC.js +0 -319
- package/build/cc/DoorLockLoggingCC.js.map +0 -1
- package/build/cc/EnergyProductionCC.d.ts +0 -77
- package/build/cc/EnergyProductionCC.d.ts.map +0 -1
- package/build/cc/EnergyProductionCC.js +0 -216
- package/build/cc/EnergyProductionCC.js.map +0 -1
- package/build/cc/EntryControlCC.d.ts +0 -231
- package/build/cc/EntryControlCC.d.ts.map +0 -1
- package/build/cc/EntryControlCC.js +0 -607
- package/build/cc/EntryControlCC.js.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +0 -359
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +0 -1145
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +0 -1
- package/build/cc/HailCC.d.ts +0 -6
- package/build/cc/HailCC.d.ts.map +0 -1
- package/build/cc/HailCC.js +0 -24
- package/build/cc/HailCC.js.map +0 -1
- package/build/cc/HumidityControlModeCC.d.ts +0 -111
- package/build/cc/HumidityControlModeCC.d.ts.map +0 -1
- package/build/cc/HumidityControlModeCC.js +0 -308
- package/build/cc/HumidityControlModeCC.js.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +0 -60
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.js +0 -140
- package/build/cc/HumidityControlOperatingStateCC.js.map +0 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +0 -209
- package/build/cc/HumidityControlSetpointCC.d.ts.map +0 -1
- package/build/cc/HumidityControlSetpointCC.js +0 -648
- package/build/cc/HumidityControlSetpointCC.js.map +0 -1
- package/build/cc/InclusionControllerCC.d.ts +0 -42
- package/build/cc/InclusionControllerCC.d.ts.map +0 -1
- package/build/cc/InclusionControllerCC.js +0 -136
- package/build/cc/InclusionControllerCC.js.map +0 -1
- package/build/cc/IndicatorCC.d.ts +0 -338
- package/build/cc/IndicatorCC.d.ts.map +0 -1
- package/build/cc/IndicatorCC.js +0 -1320
- package/build/cc/IndicatorCC.js.map +0 -1
- package/build/cc/IrrigationCC.d.ts +0 -1496
- package/build/cc/IrrigationCC.d.ts.map +0 -1
- package/build/cc/IrrigationCC.js +0 -2041
- package/build/cc/IrrigationCC.js.map +0 -1
- package/build/cc/LanguageCC.d.ts +0 -101
- package/build/cc/LanguageCC.d.ts.map +0 -1
- package/build/cc/LanguageCC.js +0 -246
- package/build/cc/LanguageCC.js.map +0 -1
- package/build/cc/LockCC.d.ts +0 -73
- package/build/cc/LockCC.d.ts.map +0 -1
- package/build/cc/LockCC.js +0 -200
- package/build/cc/LockCC.js.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +0 -32
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.js +0 -204
- package/build/cc/ManufacturerProprietaryCC.js.map +0 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +0 -171
- package/build/cc/ManufacturerSpecificCC.d.ts.map +0 -1
- package/build/cc/ManufacturerSpecificCC.js +0 -318
- package/build/cc/ManufacturerSpecificCC.js.map +0 -1
- package/build/cc/MeterCC.d.ts +0 -318
- package/build/cc/MeterCC.d.ts.map +0 -1
- package/build/cc/MeterCC.js +0 -1312
- package/build/cc/MeterCC.js.map +0 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +0 -241
- package/build/cc/MultiChannelAssociationCC.d.ts.map +0 -1
- package/build/cc/MultiChannelAssociationCC.js +0 -1007
- package/build/cc/MultiChannelAssociationCC.js.map +0 -1
- package/build/cc/MultiChannelCC.d.ts +0 -394
- package/build/cc/MultiChannelCC.d.ts.map +0 -1
- package/build/cc/MultiChannelCC.js +0 -1130
- package/build/cc/MultiChannelCC.js.map +0 -1
- package/build/cc/MultiCommandCC.d.ts +0 -27
- package/build/cc/MultiCommandCC.d.ts.map +0 -1
- package/build/cc/MultiCommandCC.js +0 -145
- package/build/cc/MultiCommandCC.js.map +0 -1
- package/build/cc/MultilevelSensorCC.d.ts +0 -185
- package/build/cc/MultilevelSensorCC.d.ts.map +0 -1
- package/build/cc/MultilevelSensorCC.js +0 -756
- package/build/cc/MultilevelSensorCC.js.map +0 -1
- package/build/cc/MultilevelSwitchCC.d.ts +0 -357
- package/build/cc/MultilevelSwitchCC.d.ts.map +0 -1
- package/build/cc/MultilevelSwitchCC.js +0 -813
- package/build/cc/MultilevelSwitchCC.js.map +0 -1
- package/build/cc/NoOperationCC.d.ts +0 -9
- package/build/cc/NoOperationCC.d.ts.map +0 -1
- package/build/cc/NoOperationCC.js +0 -42
- package/build/cc/NoOperationCC.js.map +0 -1
- package/build/cc/NodeNamingCC.d.ts +0 -118
- package/build/cc/NodeNamingCC.d.ts.map +0 -1
- package/build/cc/NodeNamingCC.js +0 -348
- package/build/cc/NodeNamingCC.js.map +0 -1
- package/build/cc/NotificationCC.d.ts +0 -479
- package/build/cc/NotificationCC.d.ts.map +0 -1
- package/build/cc/NotificationCC.js +0 -1379
- package/build/cc/NotificationCC.js.map +0 -1
- package/build/cc/PowerlevelCC.d.ts +0 -82
- package/build/cc/PowerlevelCC.d.ts.map +0 -1
- package/build/cc/PowerlevelCC.js +0 -488
- package/build/cc/PowerlevelCC.js.map +0 -1
- package/build/cc/ProtectionCC.d.ts +0 -325
- package/build/cc/ProtectionCC.d.ts.map +0 -1
- package/build/cc/ProtectionCC.js +0 -672
- package/build/cc/ProtectionCC.js.map +0 -1
- package/build/cc/SceneActivationCC.d.ts +0 -89
- package/build/cc/SceneActivationCC.d.ts.map +0 -1
- package/build/cc/SceneActivationCC.js +0 -169
- package/build/cc/SceneActivationCC.js.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +0 -120
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.js +0 -377
- package/build/cc/SceneActuatorConfigurationCC.js.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +0 -129
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.js +0 -449
- package/build/cc/SceneControllerConfigurationCC.js.map +0 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +0 -434
- package/build/cc/ScheduleEntryLockCC.d.ts.map +0 -1
- package/build/cc/ScheduleEntryLockCC.js +0 -1829
- package/build/cc/ScheduleEntryLockCC.js.map +0 -1
- package/build/cc/Security2CC.d.ts +0 -251
- package/build/cc/Security2CC.d.ts.map +0 -1
- package/build/cc/Security2CC.js +0 -1817
- package/build/cc/Security2CC.js.map +0 -1
- package/build/cc/SecurityCC.d.ts +0 -128
- package/build/cc/SecurityCC.d.ts.map +0 -1
- package/build/cc/SecurityCC.js +0 -803
- package/build/cc/SecurityCC.js.map +0 -1
- package/build/cc/SoundSwitchCC.d.ts +0 -232
- package/build/cc/SoundSwitchCC.d.ts.map +0 -1
- package/build/cc/SoundSwitchCC.js +0 -636
- package/build/cc/SoundSwitchCC.js.map +0 -1
- package/build/cc/SupervisionCC.d.ts +0 -104
- package/build/cc/SupervisionCC.d.ts.map +0 -1
- package/build/cc/SupervisionCC.js +0 -322
- package/build/cc/SupervisionCC.js.map +0 -1
- package/build/cc/ThermostatFanModeCC.d.ts +0 -141
- package/build/cc/ThermostatFanModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanModeCC.js +0 -362
- package/build/cc/ThermostatFanModeCC.js.map +0 -1
- package/build/cc/ThermostatFanStateCC.d.ts +0 -60
- package/build/cc/ThermostatFanStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanStateCC.js +0 -142
- package/build/cc/ThermostatFanStateCC.js.map +0 -1
- package/build/cc/ThermostatModeCC.d.ts +0 -150
- package/build/cc/ThermostatModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatModeCC.js +0 -429
- package/build/cc/ThermostatModeCC.js.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +0 -61
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.js +0 -138
- package/build/cc/ThermostatOperatingStateCC.js.map +0 -1
- package/build/cc/ThermostatSetbackCC.d.ts +0 -46
- package/build/cc/ThermostatSetbackCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetbackCC.js +0 -247
- package/build/cc/ThermostatSetbackCC.js.map +0 -1
- package/build/cc/ThermostatSetpointCC.d.ts +0 -197
- package/build/cc/ThermostatSetpointCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetpointCC.js +0 -658
- package/build/cc/ThermostatSetpointCC.js.map +0 -1
- package/build/cc/TimeCC.d.ts +0 -88
- package/build/cc/TimeCC.d.ts.map +0 -1
- package/build/cc/TimeCC.js +0 -454
- package/build/cc/TimeCC.js.map +0 -1
- package/build/cc/TimeParametersCC.d.ts +0 -72
- package/build/cc/TimeParametersCC.d.ts.map +0 -1
- package/build/cc/TimeParametersCC.js +0 -303
- package/build/cc/TimeParametersCC.js.map +0 -1
- package/build/cc/TransportServiceCC.d.ts +0 -107
- package/build/cc/TransportServiceCC.d.ts.map +0 -1
- package/build/cc/TransportServiceCC.js +0 -426
- package/build/cc/TransportServiceCC.js.map +0 -1
- package/build/cc/UserCodeCC.d.ts +0 -683
- package/build/cc/UserCodeCC.d.ts.map +0 -1
- package/build/cc/UserCodeCC.js +0 -1699
- package/build/cc/UserCodeCC.js.map +0 -1
- package/build/cc/VersionCC.d.ts +0 -469
- package/build/cc/VersionCC.d.ts.map +0 -1
- package/build/cc/VersionCC.js +0 -865
- package/build/cc/VersionCC.js.map +0 -1
- package/build/cc/WakeUpCC.d.ts +0 -150
- package/build/cc/WakeUpCC.d.ts.map +0 -1
- package/build/cc/WakeUpCC.js +0 -441
- package/build/cc/WakeUpCC.js.map +0 -1
- package/build/cc/WindowCoveringCC.d.ts +0 -315
- package/build/cc/WindowCoveringCC.d.ts.map +0 -1
- package/build/cc/WindowCoveringCC.js +0 -783
- package/build/cc/WindowCoveringCC.js.map +0 -1
- package/build/cc/ZWaveLongRangeCC.d.ts +0 -4
- package/build/cc/ZWaveLongRangeCC.d.ts.map +0 -1
- package/build/cc/ZWaveLongRangeCC.js +0 -20
- package/build/cc/ZWaveLongRangeCC.js.map +0 -1
- package/build/cc/ZWavePlusCC.d.ts +0 -163
- package/build/cc/ZWavePlusCC.d.ts.map +0 -1
- package/build/cc/ZWavePlusCC.js +0 -270
- package/build/cc/ZWavePlusCC.js.map +0 -1
- package/build/cc/ZWaveProtocolCC.d.ts +0 -344
- package/build/cc/ZWaveProtocolCC.d.ts.map +0 -1
- package/build/cc/ZWaveProtocolCC.js +0 -1033
- package/build/cc/ZWaveProtocolCC.js.map +0 -1
- package/build/cc/index.d.ts +0 -132
- package/build/cc/index.d.ts.map +0 -1
- package/build/cc/index.js +0 -627
- package/build/cc/index.js.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.d.ts +0 -64
- package/build/cc/manufacturerProprietary/Decorators.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.js +0 -83
- package/build/cc/manufacturerProprietary/Decorators.js.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +0 -79
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +0 -392
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +0 -1
- package/build/index.d.ts +0 -15
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -52
- package/build/index.js.map +0 -1
- package/build/index_safe.d.ts +0 -3
- package/build/index_safe.d.ts.map +0 -1
- package/build/index_safe.js +0 -20
- package/build/index_safe.js.map +0 -1
- package/build/lib/API.d.ts +0 -271
- package/build/lib/API.d.ts.map +0 -1
- package/build/lib/API.js +0 -458
- package/build/lib/API.js.map +0 -1
- package/build/lib/CommandClass.d.ts +0 -234
- package/build/lib/CommandClass.d.ts.map +0 -1
- package/build/lib/CommandClass.js +0 -788
- package/build/lib/CommandClass.js.map +0 -1
- package/build/lib/CommandClassDecorators.d.ts +0 -112
- package/build/lib/CommandClassDecorators.d.ts.map +0 -1
- package/build/lib/CommandClassDecorators.js +0 -243
- package/build/lib/CommandClassDecorators.js.map +0 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +0 -22
- package/build/lib/EncapsulatingCommandClass.d.ts.map +0 -1
- package/build/lib/EncapsulatingCommandClass.js +0 -61
- package/build/lib/EncapsulatingCommandClass.js.map +0 -1
- package/build/lib/ICommandClassContainer.d.ts.map +0 -1
- package/build/lib/ICommandClassContainer.js +0 -3
- package/build/lib/ICommandClassContainer.js.map +0 -1
- package/build/lib/NotificationEventPayload.d.ts +0 -10
- package/build/lib/NotificationEventPayload.d.ts.map +0 -1
- package/build/lib/NotificationEventPayload.js +0 -10
- package/build/lib/NotificationEventPayload.js.map +0 -1
- package/build/lib/Security2/Extension.d.ts +0 -106
- package/build/lib/Security2/Extension.d.ts.map +0 -1
- package/build/lib/Security2/Extension.js +0 -303
- package/build/lib/Security2/Extension.js.map +0 -1
- package/build/lib/Security2/shared.d.ts.map +0 -1
- package/build/lib/Security2/shared.js +0 -43
- package/build/lib/Security2/shared.js.map +0 -1
- package/build/lib/SetValueResult.d.ts.map +0 -1
- package/build/lib/SetValueResult.js +0 -60
- package/build/lib/SetValueResult.js.map +0 -1
- package/build/lib/Values.d.ts +0 -223
- package/build/lib/Values.d.ts.map +0 -1
- package/build/lib/Values.js +0 -172
- package/build/lib/Values.js.map +0 -1
- package/build/lib/_Types.d.ts.map +0 -1
- package/build/lib/_Types.js +0 -1443
- package/build/lib/_Types.js.map +0 -1
- package/build/lib/serializers.d.ts +0 -34
- package/build/lib/serializers.d.ts.map +0 -1
- package/build/lib/serializers.js +0 -107
- package/build/lib/serializers.js.map +0 -1
- package/build/lib/utils.d.ts +0 -17
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -860
- package/build/lib/utils.js.map +0 -1
- /package/build/{lib → cjs/lib}/ICommandClassContainer.d.ts +0 -0
- /package/build/{lib → cjs/lib}/Security2/shared.d.ts +0 -0
- /package/build/{lib → cjs/lib}/SetValueResult.d.ts +0 -0
- /package/build/{lib → cjs/lib}/_Types.d.ts +0 -0
|
@@ -0,0 +1,1853 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Security2CC_exports = {};
|
|
20
|
+
__export(Security2CC_exports, {
|
|
21
|
+
Security2CC: () => Security2CC,
|
|
22
|
+
Security2CCAPI: () => Security2CCAPI,
|
|
23
|
+
Security2CCCommandsSupportedGet: () => Security2CCCommandsSupportedGet,
|
|
24
|
+
Security2CCCommandsSupportedReport: () => Security2CCCommandsSupportedReport,
|
|
25
|
+
Security2CCKEXFail: () => Security2CCKEXFail,
|
|
26
|
+
Security2CCKEXGet: () => Security2CCKEXGet,
|
|
27
|
+
Security2CCKEXReport: () => Security2CCKEXReport,
|
|
28
|
+
Security2CCKEXSet: () => Security2CCKEXSet,
|
|
29
|
+
Security2CCMessageEncapsulation: () => Security2CCMessageEncapsulation,
|
|
30
|
+
Security2CCNetworkKeyGet: () => Security2CCNetworkKeyGet,
|
|
31
|
+
Security2CCNetworkKeyReport: () => Security2CCNetworkKeyReport,
|
|
32
|
+
Security2CCNetworkKeyVerify: () => Security2CCNetworkKeyVerify,
|
|
33
|
+
Security2CCNonceGet: () => Security2CCNonceGet,
|
|
34
|
+
Security2CCNonceReport: () => Security2CCNonceReport,
|
|
35
|
+
Security2CCPublicKeyReport: () => Security2CCPublicKeyReport,
|
|
36
|
+
Security2CCTransferEnd: () => Security2CCTransferEnd
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(Security2CC_exports);
|
|
39
|
+
var import_core = require("@zwave-js/core");
|
|
40
|
+
var import_safe = require("@zwave-js/core/safe");
|
|
41
|
+
var import_safe2 = require("@zwave-js/shared/safe");
|
|
42
|
+
var import_safe3 = require("@zwave-js/shared/safe");
|
|
43
|
+
var import_async = require("alcalzone-shared/async/index.js");
|
|
44
|
+
var import_typeguards = require("alcalzone-shared/typeguards/index.js");
|
|
45
|
+
var import_API = require("../lib/API.js");
|
|
46
|
+
var import_CommandClass = require("../lib/CommandClass.js");
|
|
47
|
+
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
48
|
+
var import_Extension = require("../lib/Security2/Extension.js");
|
|
49
|
+
var import_shared = require("../lib/Security2/shared.js");
|
|
50
|
+
var import_Types = require("../lib/_Types.js");
|
|
51
|
+
var import_CRC16CC = require("./CRC16CC.js");
|
|
52
|
+
var import_MultiChannelCC = require("./MultiChannelCC.js");
|
|
53
|
+
var import_SecurityCC = require("./SecurityCC.js");
|
|
54
|
+
var import_TransportServiceCC = require("./TransportServiceCC.js");
|
|
55
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
56
|
+
function accept(f) {
|
|
57
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
58
|
+
return f;
|
|
59
|
+
}
|
|
60
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
61
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
62
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
63
|
+
var _, done = false;
|
|
64
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
65
|
+
var context = {};
|
|
66
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
67
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
68
|
+
context.addInitializer = function(f) {
|
|
69
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
70
|
+
extraInitializers.push(accept(f || null));
|
|
71
|
+
};
|
|
72
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
73
|
+
if (kind === "accessor") {
|
|
74
|
+
if (result === void 0) continue;
|
|
75
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
76
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
77
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
78
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
79
|
+
} else if (_ = accept(result)) {
|
|
80
|
+
if (kind === "field") initializers.unshift(_);
|
|
81
|
+
else descriptor[key] = _;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
85
|
+
done = true;
|
|
86
|
+
};
|
|
87
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
88
|
+
var useValue = arguments.length > 2;
|
|
89
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
90
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
91
|
+
}
|
|
92
|
+
return useValue ? value : void 0;
|
|
93
|
+
};
|
|
94
|
+
function securityClassToBitMask(key) {
|
|
95
|
+
return (0, import_core.encodeBitMask)([key], import_core.SecurityClass.S0_Legacy, import_core.SecurityClass.S2_Unauthenticated);
|
|
96
|
+
}
|
|
97
|
+
function bitMaskToSecurityClass(buffer, offset) {
|
|
98
|
+
const keys = (0, import_core.parseBitMask)(buffer.subarray(offset, offset + 1), import_core.SecurityClass.S2_Unauthenticated);
|
|
99
|
+
(0, import_core.validatePayload)(keys.length === 1);
|
|
100
|
+
return keys[0];
|
|
101
|
+
}
|
|
102
|
+
function getAuthenticationData(sendingNodeId, destination, homeId, commandLength, unencryptedPayload) {
|
|
103
|
+
const nodeIdSize = (0, import_core.isLongRangeNodeId)(sendingNodeId) || (0, import_core.isLongRangeNodeId)(destination) ? 2 : 1;
|
|
104
|
+
const ret = new import_safe2.Bytes(2 * nodeIdSize + 6 + unencryptedPayload.length);
|
|
105
|
+
let offset = 0;
|
|
106
|
+
ret.writeUIntBE(sendingNodeId, offset, nodeIdSize);
|
|
107
|
+
offset += nodeIdSize;
|
|
108
|
+
ret.writeUIntBE(destination, offset, nodeIdSize);
|
|
109
|
+
offset += nodeIdSize;
|
|
110
|
+
ret.writeUInt32BE(homeId, offset);
|
|
111
|
+
offset += 4;
|
|
112
|
+
ret.writeUInt16BE(commandLength, offset);
|
|
113
|
+
offset += 2;
|
|
114
|
+
ret.set(unencryptedPayload, offset);
|
|
115
|
+
return ret;
|
|
116
|
+
}
|
|
117
|
+
function getSecurityManager(ownNodeId, securityManagers, otherNodeId) {
|
|
118
|
+
const longRange = (0, import_core.isLongRangeNodeId)(ownNodeId) || (0, import_core.isLongRangeNodeId)((0, import_typeguards.isArray)(otherNodeId) ? otherNodeId[0] : otherNodeId);
|
|
119
|
+
return longRange ? securityManagers.securityManagerLR : securityManagers.securityManager2;
|
|
120
|
+
}
|
|
121
|
+
function validateSequenceNumber(securityManager, sourceNodeId, sequenceNumber) {
|
|
122
|
+
import_core.validatePayload.withReason(`Duplicate command (sequence number ${sequenceNumber})`)(!securityManager.isDuplicateSinglecast(sourceNodeId, sequenceNumber));
|
|
123
|
+
return securityManager.storeSequenceNumber(sourceNodeId, sequenceNumber);
|
|
124
|
+
}
|
|
125
|
+
const MAX_DECRYPT_ATTEMPTS_SINGLECAST = 5;
|
|
126
|
+
const MAX_DECRYPT_ATTEMPTS_MULTICAST = 5;
|
|
127
|
+
const MAX_DECRYPT_ATTEMPTS_SC_FOLLOWUP = 1;
|
|
128
|
+
function assertSecurityRX(ctx) {
|
|
129
|
+
if (!ctx.ownNodeId) {
|
|
130
|
+
throw new import_core.ZWaveError(`Secure commands (S2) can only be decoded when the controller's node id is known!`, import_core.ZWaveErrorCodes.Driver_NotReady);
|
|
131
|
+
}
|
|
132
|
+
const ret = getSecurityManager(ctx.ownNodeId, ctx, ctx.sourceNodeId);
|
|
133
|
+
if (!ret) {
|
|
134
|
+
throw new import_core.ZWaveError(`Secure commands (S2) can only be decoded when the security manager is set up!`, import_core.ZWaveErrorCodes.Driver_NoSecurity);
|
|
135
|
+
}
|
|
136
|
+
return ret;
|
|
137
|
+
}
|
|
138
|
+
function assertSecurityTX(ctx, destination) {
|
|
139
|
+
if (!ctx.ownNodeId) {
|
|
140
|
+
throw new import_core.ZWaveError(`Secure commands (S2) can only be sent when the controller's node id is known!`, import_core.ZWaveErrorCodes.Driver_NotReady);
|
|
141
|
+
}
|
|
142
|
+
const ret = getSecurityManager(ctx.ownNodeId, ctx, destination);
|
|
143
|
+
if (!ret) {
|
|
144
|
+
throw new import_core.ZWaveError(`Secure commands (S2) can only be sent when the security manager is set up!`, import_core.ZWaveErrorCodes.Driver_NoSecurity);
|
|
145
|
+
}
|
|
146
|
+
return ret;
|
|
147
|
+
}
|
|
148
|
+
function decryptSinglecast(ctx, securityManager, sendingNodeId, curSequenceNumber, prevSequenceNumber, ciphertext, authData, authTag, spanState, extensions) {
|
|
149
|
+
const decryptWithNonce = (nonce) => {
|
|
150
|
+
const { keyCCM: key } = securityManager.getKeysForNode(sendingNodeId);
|
|
151
|
+
const iv = nonce;
|
|
152
|
+
return {
|
|
153
|
+
key,
|
|
154
|
+
iv,
|
|
155
|
+
...(0, import_core.decryptAES128CCM)(key, iv, ciphertext, authData, authTag)
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
const getNonceAndDecrypt = () => {
|
|
159
|
+
const iv = securityManager.nextNonce(sendingNodeId);
|
|
160
|
+
return decryptWithNonce(iv);
|
|
161
|
+
};
|
|
162
|
+
if (spanState.type === import_core.SPANState.SPAN) {
|
|
163
|
+
if (
|
|
164
|
+
// The previous SPAN is still known, i.e. the node didn't send another command that was successfully decrypted
|
|
165
|
+
!!spanState.currentSPAN && spanState.currentSPAN.expires > (0, import_core.highResTimestamp)() && prevSequenceNumber != void 0 && curSequenceNumber === (prevSequenceNumber + 1 & 255) && !ctx.__internalIsMockNode
|
|
166
|
+
) {
|
|
167
|
+
const nonce = spanState.currentSPAN.nonce;
|
|
168
|
+
spanState.currentSPAN = void 0;
|
|
169
|
+
const result = decryptWithNonce(nonce);
|
|
170
|
+
if (result.authOK) {
|
|
171
|
+
return {
|
|
172
|
+
...result,
|
|
173
|
+
securityClass: spanState.securityClass
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
spanState.currentSPAN = void 0;
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
...getNonceAndDecrypt(),
|
|
181
|
+
securityClass: spanState.securityClass
|
|
182
|
+
};
|
|
183
|
+
} else if (spanState.type === import_core.SPANState.LocalEI) {
|
|
184
|
+
const senderEI = getSenderEI(extensions);
|
|
185
|
+
if (!senderEI)
|
|
186
|
+
failNoSPAN();
|
|
187
|
+
const receiverEI = spanState.receiverEI;
|
|
188
|
+
const isBootstrappingNode = securityManager.tempKeys.has(sendingNodeId);
|
|
189
|
+
if (isBootstrappingNode) {
|
|
190
|
+
securityManager.initializeTempSPAN(sendingNodeId, senderEI, receiverEI);
|
|
191
|
+
const ret = getNonceAndDecrypt();
|
|
192
|
+
if (ret.authOK) {
|
|
193
|
+
return {
|
|
194
|
+
...ret,
|
|
195
|
+
securityClass: import_core.SecurityClass.Temporary
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
securityManager.setSPANState(sendingNodeId, spanState);
|
|
199
|
+
}
|
|
200
|
+
const possibleSecurityClasses = isBootstrappingNode ? [ctx.getHighestSecurityClass(sendingNodeId)] : import_core.securityClassOrder.filter((s) => ctx.hasSecurityClass(sendingNodeId, s) !== false);
|
|
201
|
+
for (const secClass of possibleSecurityClasses) {
|
|
202
|
+
if (!securityManager.hasKeysForSecurityClass(secClass)) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
securityManager.initializeSPAN(sendingNodeId, secClass, senderEI, receiverEI);
|
|
206
|
+
const ret = getNonceAndDecrypt();
|
|
207
|
+
if (ret.authOK) {
|
|
208
|
+
if (ctx.hasSecurityClass(sendingNodeId, secClass) === void 0) {
|
|
209
|
+
ctx.setSecurityClass(sendingNodeId, secClass, true);
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
...ret,
|
|
213
|
+
securityClass: secClass
|
|
214
|
+
};
|
|
215
|
+
} else {
|
|
216
|
+
securityManager.setSPANState(sendingNodeId, spanState);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
plaintext: new Uint8Array(),
|
|
222
|
+
authOK: false,
|
|
223
|
+
securityClass: void 0
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function decryptMulticast(sendingNodeId, securityManager, groupId, ciphertext, authData, authTag) {
|
|
227
|
+
const iv = securityManager.nextPeerMPAN(sendingNodeId, groupId);
|
|
228
|
+
const { keyCCM: key } = securityManager.getKeysForNode(sendingNodeId);
|
|
229
|
+
return {
|
|
230
|
+
key,
|
|
231
|
+
iv,
|
|
232
|
+
...(0, import_core.decryptAES128CCM)(key, iv, ciphertext, authData, authTag),
|
|
233
|
+
// The security class is irrelevant when decrypting multicast commands
|
|
234
|
+
securityClass: void 0
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function getDestinationIDTX() {
|
|
238
|
+
if (this.isSinglecast())
|
|
239
|
+
return this.nodeId;
|
|
240
|
+
const ret = getMulticastGroupId(this.extensions);
|
|
241
|
+
if (ret == void 0) {
|
|
242
|
+
throw new import_core.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", import_core.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
243
|
+
}
|
|
244
|
+
return ret;
|
|
245
|
+
}
|
|
246
|
+
function getDestinationIDRX(ctx, extensions) {
|
|
247
|
+
if (ctx.frameType === "singlecast") {
|
|
248
|
+
return ctx.ownNodeId;
|
|
249
|
+
}
|
|
250
|
+
const ret = getMulticastGroupId(extensions);
|
|
251
|
+
if (ret == void 0) {
|
|
252
|
+
throw new import_core.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", import_core.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
253
|
+
}
|
|
254
|
+
return ret;
|
|
255
|
+
}
|
|
256
|
+
function getMulticastGroupId(extensions) {
|
|
257
|
+
const mgrpExtension = extensions.find((e) => e instanceof import_Extension.MGRPExtension);
|
|
258
|
+
return mgrpExtension?.groupId;
|
|
259
|
+
}
|
|
260
|
+
function getSenderEI(extensions) {
|
|
261
|
+
const spanExtension = extensions.find((e) => e instanceof import_Extension.SPANExtension);
|
|
262
|
+
return spanExtension?.senderEI;
|
|
263
|
+
}
|
|
264
|
+
let Security2CCAPI = (() => {
|
|
265
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Security 2"])];
|
|
266
|
+
let _classDescriptor;
|
|
267
|
+
let _classExtraInitializers = [];
|
|
268
|
+
let _classThis;
|
|
269
|
+
let _classSuper = import_API.CCAPI;
|
|
270
|
+
var Security2CCAPI2 = class extends _classSuper {
|
|
271
|
+
static {
|
|
272
|
+
_classThis = this;
|
|
273
|
+
}
|
|
274
|
+
static {
|
|
275
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
276
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
277
|
+
Security2CCAPI2 = _classThis = _classDescriptor.value;
|
|
278
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
279
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
280
|
+
}
|
|
281
|
+
supportsCommand(_cmd) {
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Sends a nonce to the node, either in response to a NonceGet request or a message that failed to decrypt. The message is sent without any retransmission etc.
|
|
286
|
+
* The return value indicates whether a nonce was successfully sent
|
|
287
|
+
*/
|
|
288
|
+
async sendNonce() {
|
|
289
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.NonceReport);
|
|
290
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
291
|
+
const securityManager = getSecurityManager(this.host.ownNodeId, this.host, this.endpoint.nodeId);
|
|
292
|
+
if (!securityManager) {
|
|
293
|
+
throw new import_core.ZWaveError(`Nonces can only be sent if secure communication is set up!`, import_core.ZWaveErrorCodes.Driver_NoSecurity);
|
|
294
|
+
}
|
|
295
|
+
const receiverEI = securityManager.generateNonce(this.endpoint.nodeId);
|
|
296
|
+
const cc = new Security2CCNonceReport({
|
|
297
|
+
nodeId: this.endpoint.nodeId,
|
|
298
|
+
endpointIndex: this.endpoint.index,
|
|
299
|
+
SOS: true,
|
|
300
|
+
MOS: false,
|
|
301
|
+
receiverEI
|
|
302
|
+
});
|
|
303
|
+
try {
|
|
304
|
+
await this.host.sendCommand(cc, {
|
|
305
|
+
...this.commandOptions,
|
|
306
|
+
// Seems we need these options or some nodes won't accept the nonce
|
|
307
|
+
transmitOptions: import_core.TransmitOptions.ACK | import_core.TransmitOptions.AutoRoute,
|
|
308
|
+
// Only try sending a nonce once
|
|
309
|
+
maxSendAttempts: 1,
|
|
310
|
+
// Nonce requests must be handled immediately
|
|
311
|
+
priority: import_core.MessagePriority.Immediate,
|
|
312
|
+
// We don't want failures causing us to treat the node as asleep or dead
|
|
313
|
+
changeNodeStatusOnMissingACK: false
|
|
314
|
+
// And we need to react to
|
|
315
|
+
});
|
|
316
|
+
} catch (e) {
|
|
317
|
+
if ((0, import_core.isTransmissionError)(e)) {
|
|
318
|
+
securityManager.deleteNonce(this.endpoint.nodeId);
|
|
319
|
+
return false;
|
|
320
|
+
} else {
|
|
321
|
+
throw e;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
/** Notifies the target node that the MPAN state is out of sync */
|
|
327
|
+
async sendMOS() {
|
|
328
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.NonceReport);
|
|
329
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
330
|
+
const cc = new Security2CCNonceReport({
|
|
331
|
+
nodeId: this.endpoint.nodeId,
|
|
332
|
+
endpointIndex: this.endpoint.index,
|
|
333
|
+
SOS: false,
|
|
334
|
+
MOS: true
|
|
335
|
+
});
|
|
336
|
+
try {
|
|
337
|
+
await this.host.sendCommand(cc, {
|
|
338
|
+
...this.commandOptions,
|
|
339
|
+
// Seems we need these options or some nodes won't accept the nonce
|
|
340
|
+
transmitOptions: import_core.TransmitOptions.ACK | import_core.TransmitOptions.AutoRoute,
|
|
341
|
+
// Only try sending a nonce once
|
|
342
|
+
maxSendAttempts: 1,
|
|
343
|
+
// Nonce requests must be handled immediately
|
|
344
|
+
priority: import_core.MessagePriority.Immediate,
|
|
345
|
+
// We don't want failures causing us to treat the node as asleep or dead
|
|
346
|
+
changeNodeStatusOnMissingACK: false
|
|
347
|
+
});
|
|
348
|
+
} catch (e) {
|
|
349
|
+
if ((0, import_core.isTransmissionError)(e)) {
|
|
350
|
+
return false;
|
|
351
|
+
} else {
|
|
352
|
+
throw e;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
/** Sends the given MPAN to the node */
|
|
358
|
+
async sendMPAN(groupId, innerMPANState) {
|
|
359
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.MessageEncapsulation);
|
|
360
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
361
|
+
const cc = new Security2CCMessageEncapsulation({
|
|
362
|
+
nodeId: this.endpoint.nodeId,
|
|
363
|
+
endpointIndex: this.endpoint.index,
|
|
364
|
+
extensions: [
|
|
365
|
+
new import_Extension.MPANExtension({
|
|
366
|
+
groupId,
|
|
367
|
+
innerMPANState
|
|
368
|
+
})
|
|
369
|
+
]
|
|
370
|
+
});
|
|
371
|
+
try {
|
|
372
|
+
await this.host.sendCommand(cc, {
|
|
373
|
+
...this.commandOptions,
|
|
374
|
+
// Seems we need these options or some nodes won't accept the nonce
|
|
375
|
+
transmitOptions: import_core.TransmitOptions.ACK | import_core.TransmitOptions.AutoRoute,
|
|
376
|
+
// Only try sending a nonce once
|
|
377
|
+
maxSendAttempts: 1,
|
|
378
|
+
// Nonce requests must be handled immediately
|
|
379
|
+
priority: import_core.MessagePriority.Immediate,
|
|
380
|
+
// We don't want failures causing us to treat the node as asleep or dead
|
|
381
|
+
changeNodeStatusOnMissingACK: false
|
|
382
|
+
});
|
|
383
|
+
} catch (e) {
|
|
384
|
+
if ((0, import_core.isTransmissionError)(e)) {
|
|
385
|
+
return false;
|
|
386
|
+
} else {
|
|
387
|
+
throw e;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Queries the securely supported commands for the current security class
|
|
394
|
+
* @param securityClass Can be used to overwrite the security class to use. If this doesn't match the current one, new nonces will need to be exchanged.
|
|
395
|
+
*/
|
|
396
|
+
async getSupportedCommands(securityClass) {
|
|
397
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.CommandsSupportedGet);
|
|
398
|
+
let cc = new Security2CCCommandsSupportedGet({
|
|
399
|
+
nodeId: this.endpoint.nodeId,
|
|
400
|
+
endpointIndex: this.endpoint.index
|
|
401
|
+
});
|
|
402
|
+
if (import_MultiChannelCC.MultiChannelCC.requiresEncapsulation(cc)) {
|
|
403
|
+
const multiChannelCCVersion = this.host.getSupportedCCVersion(import_core.CommandClasses["Multi Channel"], this.endpoint.nodeId);
|
|
404
|
+
cc = multiChannelCCVersion === 1 ? import_MultiChannelCC.MultiChannelCC.encapsulateV1(cc) : import_MultiChannelCC.MultiChannelCC.encapsulate(cc);
|
|
405
|
+
}
|
|
406
|
+
cc = Security2CC.encapsulate(cc, this.host.ownNodeId, this.host, { securityClass });
|
|
407
|
+
const response = await this.host.sendCommand(cc, {
|
|
408
|
+
...this.commandOptions,
|
|
409
|
+
autoEncapsulate: false
|
|
410
|
+
});
|
|
411
|
+
return response?.supportedCCs;
|
|
412
|
+
}
|
|
413
|
+
async reportSupportedCommands(supportedCCs) {
|
|
414
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.CommandsSupportedReport);
|
|
415
|
+
const cc = new Security2CCCommandsSupportedReport({
|
|
416
|
+
nodeId: this.endpoint.nodeId,
|
|
417
|
+
endpointIndex: this.endpoint.index,
|
|
418
|
+
supportedCCs
|
|
419
|
+
});
|
|
420
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
421
|
+
}
|
|
422
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
423
|
+
async getKeyExchangeParameters() {
|
|
424
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXGet);
|
|
425
|
+
const cc = new Security2CCKEXGet({
|
|
426
|
+
nodeId: this.endpoint.nodeId,
|
|
427
|
+
endpointIndex: this.endpoint.index
|
|
428
|
+
});
|
|
429
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
430
|
+
if (response) {
|
|
431
|
+
return (0, import_safe3.pick)(response, [
|
|
432
|
+
"requestCSA",
|
|
433
|
+
"echo",
|
|
434
|
+
"supportedKEXSchemes",
|
|
435
|
+
"supportedECDHProfiles",
|
|
436
|
+
"requestedKeys",
|
|
437
|
+
"_reserved"
|
|
438
|
+
]);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/** Requests the given keys from an including node */
|
|
442
|
+
async requestKeys(params) {
|
|
443
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXReport);
|
|
444
|
+
const cc = new Security2CCKEXReport({
|
|
445
|
+
nodeId: this.endpoint.nodeId,
|
|
446
|
+
endpointIndex: this.endpoint.index,
|
|
447
|
+
...params,
|
|
448
|
+
echo: false
|
|
449
|
+
});
|
|
450
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
451
|
+
}
|
|
452
|
+
/** Grants the joining node the given keys */
|
|
453
|
+
async grantKeys(params) {
|
|
454
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXSet);
|
|
455
|
+
const cc = new Security2CCKEXSet({
|
|
456
|
+
nodeId: this.endpoint.nodeId,
|
|
457
|
+
endpointIndex: this.endpoint.index,
|
|
458
|
+
...params,
|
|
459
|
+
echo: false
|
|
460
|
+
});
|
|
461
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
462
|
+
}
|
|
463
|
+
/** Confirms the keys that were requested by a node */
|
|
464
|
+
async confirmRequestedKeys(params) {
|
|
465
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXReport);
|
|
466
|
+
const cc = new Security2CCKEXReport({
|
|
467
|
+
nodeId: this.endpoint.nodeId,
|
|
468
|
+
endpointIndex: this.endpoint.index,
|
|
469
|
+
...params,
|
|
470
|
+
echo: true
|
|
471
|
+
});
|
|
472
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
473
|
+
}
|
|
474
|
+
/** Confirms the keys that were granted by the including node */
|
|
475
|
+
async confirmGrantedKeys(params) {
|
|
476
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXSet);
|
|
477
|
+
const cc = new Security2CCKEXSet({
|
|
478
|
+
nodeId: this.endpoint.nodeId,
|
|
479
|
+
endpointIndex: this.endpoint.index,
|
|
480
|
+
...params,
|
|
481
|
+
echo: true
|
|
482
|
+
});
|
|
483
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
484
|
+
}
|
|
485
|
+
/** Notifies the other node that the ongoing key exchange was aborted */
|
|
486
|
+
async abortKeyExchange(failType) {
|
|
487
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXFail);
|
|
488
|
+
const cc = new Security2CCKEXFail({
|
|
489
|
+
nodeId: this.endpoint.nodeId,
|
|
490
|
+
endpointIndex: this.endpoint.index,
|
|
491
|
+
failType
|
|
492
|
+
});
|
|
493
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
494
|
+
}
|
|
495
|
+
async sendPublicKey(publicKey, includingNode = true) {
|
|
496
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.PublicKeyReport);
|
|
497
|
+
const cc = new Security2CCPublicKeyReport({
|
|
498
|
+
nodeId: this.endpoint.nodeId,
|
|
499
|
+
endpointIndex: this.endpoint.index,
|
|
500
|
+
includingNode,
|
|
501
|
+
publicKey
|
|
502
|
+
});
|
|
503
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
504
|
+
}
|
|
505
|
+
async requestNetworkKey(securityClass) {
|
|
506
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.NetworkKeyGet);
|
|
507
|
+
const cc = new Security2CCNetworkKeyGet({
|
|
508
|
+
nodeId: this.endpoint.nodeId,
|
|
509
|
+
endpointIndex: this.endpoint.index,
|
|
510
|
+
requestedKey: securityClass
|
|
511
|
+
});
|
|
512
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
513
|
+
}
|
|
514
|
+
async sendNetworkKey(securityClass, networkKey) {
|
|
515
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.NetworkKeyReport);
|
|
516
|
+
const cc = new Security2CCNetworkKeyReport({
|
|
517
|
+
nodeId: this.endpoint.nodeId,
|
|
518
|
+
endpointIndex: this.endpoint.index,
|
|
519
|
+
grantedKey: securityClass,
|
|
520
|
+
networkKey
|
|
521
|
+
});
|
|
522
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
523
|
+
}
|
|
524
|
+
async verifyNetworkKey() {
|
|
525
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.NetworkKeyVerify);
|
|
526
|
+
const cc = new Security2CCNetworkKeyVerify({
|
|
527
|
+
nodeId: this.endpoint.nodeId,
|
|
528
|
+
endpointIndex: this.endpoint.index
|
|
529
|
+
});
|
|
530
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
531
|
+
}
|
|
532
|
+
async confirmKeyVerification() {
|
|
533
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.TransferEnd);
|
|
534
|
+
const cc = new Security2CCTransferEnd({
|
|
535
|
+
nodeId: this.endpoint.nodeId,
|
|
536
|
+
endpointIndex: this.endpoint.index,
|
|
537
|
+
keyVerified: true,
|
|
538
|
+
keyRequestComplete: false
|
|
539
|
+
});
|
|
540
|
+
await this.host.sendCommand(cc, {
|
|
541
|
+
...this.commandOptions,
|
|
542
|
+
// Don't wait for an ACK from the node
|
|
543
|
+
transmitOptions: import_core.TransmitOptions.DEFAULT & ~import_core.TransmitOptions.ACK
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
async endKeyExchange() {
|
|
547
|
+
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.TransferEnd);
|
|
548
|
+
const cc = new Security2CCTransferEnd({
|
|
549
|
+
nodeId: this.endpoint.nodeId,
|
|
550
|
+
endpointIndex: this.endpoint.index,
|
|
551
|
+
keyVerified: false,
|
|
552
|
+
keyRequestComplete: true
|
|
553
|
+
});
|
|
554
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
return Security2CCAPI2 = _classThis;
|
|
558
|
+
})();
|
|
559
|
+
let Security2CC = (() => {
|
|
560
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Security 2"]), (0, import_CommandClassDecorators.implementedVersion)(1)];
|
|
561
|
+
let _classDescriptor;
|
|
562
|
+
let _classExtraInitializers = [];
|
|
563
|
+
let _classThis;
|
|
564
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
565
|
+
var Security2CC2 = class extends _classSuper {
|
|
566
|
+
static {
|
|
567
|
+
_classThis = this;
|
|
568
|
+
}
|
|
569
|
+
static {
|
|
570
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
571
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
572
|
+
Security2CC2 = _classThis = _classDescriptor.value;
|
|
573
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
574
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
575
|
+
}
|
|
576
|
+
async interview(ctx) {
|
|
577
|
+
const securityManager = getSecurityManager(ctx.ownNodeId, ctx, this.nodeId);
|
|
578
|
+
const node = this.getNode(ctx);
|
|
579
|
+
const endpoint = this.getEndpoint(ctx);
|
|
580
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses["Security 2"], ctx, endpoint).withOptions({
|
|
581
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
582
|
+
});
|
|
583
|
+
const secClass = node.getHighestSecurityClass();
|
|
584
|
+
let hasReceivedSecureCommands = false;
|
|
585
|
+
let possibleSecurityClasses;
|
|
586
|
+
if ((0, import_core.securityClassIsS2)(secClass)) {
|
|
587
|
+
possibleSecurityClasses = [secClass];
|
|
588
|
+
} else if (endpoint.index === 0) {
|
|
589
|
+
possibleSecurityClasses = [
|
|
590
|
+
import_core.SecurityClass.S2_Unauthenticated,
|
|
591
|
+
import_core.SecurityClass.S2_Authenticated,
|
|
592
|
+
import_core.SecurityClass.S2_AccessControl
|
|
593
|
+
];
|
|
594
|
+
} else {
|
|
595
|
+
ctx.logNode(node.id, {
|
|
596
|
+
endpoint: endpoint.index,
|
|
597
|
+
message: `Cannot query securely supported commands for endpoint because the node's security class isn't known...`,
|
|
598
|
+
level: "error"
|
|
599
|
+
});
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
for (const secClass2 of possibleSecurityClasses) {
|
|
603
|
+
if (node.hasSecurityClass(secClass2) === false)
|
|
604
|
+
continue;
|
|
605
|
+
if (!securityManager?.hasKeysForSecurityClass(secClass2)) {
|
|
606
|
+
ctx.logNode(node.id, {
|
|
607
|
+
endpoint: endpoint.index,
|
|
608
|
+
message: `Cannot query securely supported commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}) - network key is not configured...`,
|
|
609
|
+
level: "warn"
|
|
610
|
+
});
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
ctx.logNode(node.id, {
|
|
614
|
+
endpoint: endpoint.index,
|
|
615
|
+
message: `Querying securely supported commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)})...`,
|
|
616
|
+
direction: "outbound"
|
|
617
|
+
});
|
|
618
|
+
let supportedCCs;
|
|
619
|
+
const MAX_ATTEMPTS = this.endpointIndex === 0 ? 3 : 1;
|
|
620
|
+
for (let attempts = 1; attempts <= MAX_ATTEMPTS; attempts++) {
|
|
621
|
+
try {
|
|
622
|
+
supportedCCs = await api.getSupportedCommands(secClass2);
|
|
623
|
+
} catch (e) {
|
|
624
|
+
if ((0, import_core.isZWaveError)(e) && e.code === import_core.ZWaveErrorCodes.Security2CC_CannotDecode) {
|
|
625
|
+
supportedCCs = void 0;
|
|
626
|
+
} else {
|
|
627
|
+
throw e;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (supportedCCs == void 0 && possibleSecurityClasses.length === 1) {
|
|
631
|
+
if (attempts < MAX_ATTEMPTS) {
|
|
632
|
+
ctx.logNode(node.id, {
|
|
633
|
+
endpoint: endpoint.index,
|
|
634
|
+
message: `Querying securely supported commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}), attempt ${attempts}/${MAX_ATTEMPTS} failed. Retrying in 500ms...`,
|
|
635
|
+
level: "warn"
|
|
636
|
+
});
|
|
637
|
+
await (0, import_async.wait)(500);
|
|
638
|
+
continue;
|
|
639
|
+
} else if (endpoint.index > 0) {
|
|
640
|
+
ctx.logNode(node.id, {
|
|
641
|
+
endpoint: endpoint.index,
|
|
642
|
+
message: `Querying securely supported commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}) failed. Assuming the endpoint supports all its mandatory CCs securely...`,
|
|
643
|
+
level: "warn"
|
|
644
|
+
});
|
|
645
|
+
for (const [ccId] of endpoint.getCCs()) {
|
|
646
|
+
endpoint.addCC(ccId, { secure: true });
|
|
647
|
+
}
|
|
648
|
+
break;
|
|
649
|
+
} else {
|
|
650
|
+
ctx.logNode(node.id, {
|
|
651
|
+
endpoint: endpoint.index,
|
|
652
|
+
message: `Querying securely supported commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}) failed. Let's hope for the best...`,
|
|
653
|
+
level: "warn"
|
|
654
|
+
});
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (supportedCCs == void 0) {
|
|
662
|
+
if (endpoint.index === 0 && possibleSecurityClasses.length > 1) {
|
|
663
|
+
node.setSecurityClass(secClass2, false);
|
|
664
|
+
ctx.logNode(node.id, {
|
|
665
|
+
message: `The node was NOT granted the security class ${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}`,
|
|
666
|
+
direction: "inbound"
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
continue;
|
|
670
|
+
}
|
|
671
|
+
if (endpoint.index === 0 && possibleSecurityClasses.length > 1) {
|
|
672
|
+
node.setSecurityClass(secClass2, true);
|
|
673
|
+
ctx.logNode(node.id, {
|
|
674
|
+
message: `The node was granted the security class ${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)}`,
|
|
675
|
+
direction: "inbound"
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
if (!hasReceivedSecureCommands && supportedCCs.length > 0) {
|
|
679
|
+
hasReceivedSecureCommands = true;
|
|
680
|
+
const logLines = [
|
|
681
|
+
`received secure commands (${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, secClass2)})`,
|
|
682
|
+
"supported CCs:"
|
|
683
|
+
];
|
|
684
|
+
for (const cc of supportedCCs) {
|
|
685
|
+
logLines.push(`\xB7 ${(0, import_core.getCCName)(cc)}`);
|
|
686
|
+
}
|
|
687
|
+
ctx.logNode(node.id, {
|
|
688
|
+
endpoint: endpoint.index,
|
|
689
|
+
message: logLines.join("\n"),
|
|
690
|
+
direction: "inbound"
|
|
691
|
+
});
|
|
692
|
+
for (const cc of supportedCCs) {
|
|
693
|
+
if (cc === import_core.CommandClasses.Basic) {
|
|
694
|
+
endpoint.addCC(cc, { secure: true });
|
|
695
|
+
} else {
|
|
696
|
+
endpoint.addCC(cc, {
|
|
697
|
+
isSupported: true,
|
|
698
|
+
secure: true
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
this.setInterviewComplete(ctx, true);
|
|
705
|
+
}
|
|
706
|
+
/** Tests if a command should be sent secure and thus requires encapsulation */
|
|
707
|
+
static requiresEncapsulation(cc) {
|
|
708
|
+
if (!(cc.encapsulationFlags & import_safe.EncapsulationFlags.Security)) {
|
|
709
|
+
return false;
|
|
710
|
+
}
|
|
711
|
+
if (cc instanceof import_SecurityCC.SecurityCC || cc instanceof import_CRC16CC.CRC16CC || cc instanceof import_TransportServiceCC.TransportServiceCC) {
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
if (cc instanceof Security2CC2) {
|
|
715
|
+
switch (cc.ccCommand) {
|
|
716
|
+
case import_Types.Security2Command.CommandsSupportedGet:
|
|
717
|
+
case import_Types.Security2Command.CommandsSupportedReport:
|
|
718
|
+
case import_Types.Security2Command.NetworkKeyGet:
|
|
719
|
+
case import_Types.Security2Command.NetworkKeyReport:
|
|
720
|
+
case import_Types.Security2Command.NetworkKeyVerify:
|
|
721
|
+
case import_Types.Security2Command.TransferEnd:
|
|
722
|
+
return true;
|
|
723
|
+
case import_Types.Security2Command.KEXSet:
|
|
724
|
+
case import_Types.Security2Command.KEXReport:
|
|
725
|
+
return cc.echo;
|
|
726
|
+
case import_Types.Security2Command.KEXFail: {
|
|
727
|
+
switch (cc.failType) {
|
|
728
|
+
case import_shared.KEXFailType.Decrypt:
|
|
729
|
+
case import_shared.KEXFailType.WrongSecurityLevel:
|
|
730
|
+
case import_shared.KEXFailType.KeyNotGranted:
|
|
731
|
+
case import_shared.KEXFailType.NoVerify:
|
|
732
|
+
return true;
|
|
733
|
+
default:
|
|
734
|
+
return false;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
return true;
|
|
741
|
+
}
|
|
742
|
+
/** Encapsulates a command that should be sent encrypted */
|
|
743
|
+
static encapsulate(cc, ownNodeId, securityManagers, options) {
|
|
744
|
+
const extensions = [];
|
|
745
|
+
if (options?.multicastOutOfSync) {
|
|
746
|
+
extensions.push(new import_Extension.MOSExtension());
|
|
747
|
+
}
|
|
748
|
+
if (options?.multicastGroupId != void 0) {
|
|
749
|
+
extensions.push(new import_Extension.MGRPExtension({ groupId: options.multicastGroupId }));
|
|
750
|
+
}
|
|
751
|
+
let nodeId;
|
|
752
|
+
if (cc.isMulticast()) {
|
|
753
|
+
if (cc.nodeId.some((nodeId2) => (0, import_core.isLongRangeNodeId)(nodeId2))) {
|
|
754
|
+
nodeId = import_safe.NODE_ID_BROADCAST_LR;
|
|
755
|
+
} else {
|
|
756
|
+
nodeId = import_safe.NODE_ID_BROADCAST;
|
|
757
|
+
}
|
|
758
|
+
} else {
|
|
759
|
+
nodeId = cc.nodeId;
|
|
760
|
+
}
|
|
761
|
+
const ret = new Security2CCMessageEncapsulation({
|
|
762
|
+
nodeId,
|
|
763
|
+
encapsulated: cc,
|
|
764
|
+
securityClass: options?.securityClass,
|
|
765
|
+
extensions,
|
|
766
|
+
verifyDelivery: options?.verifyDelivery
|
|
767
|
+
});
|
|
768
|
+
ret.encapsulationFlags = cc.encapsulationFlags & ~import_safe.EncapsulationFlags.Security;
|
|
769
|
+
return ret;
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
return Security2CC2 = _classThis;
|
|
773
|
+
})();
|
|
774
|
+
function failNoSPAN() {
|
|
775
|
+
import_core.validatePayload.fail(import_core.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
776
|
+
}
|
|
777
|
+
function failNoMPAN() {
|
|
778
|
+
import_core.validatePayload.fail(import_core.ZWaveErrorCodes.Security2CC_NoMPAN);
|
|
779
|
+
}
|
|
780
|
+
function getCCResponseForMessageEncapsulation(sent) {
|
|
781
|
+
if (sent.encapsulated?.expectsCCResponse()) {
|
|
782
|
+
const ret = [
|
|
783
|
+
Security2CCMessageEncapsulation,
|
|
784
|
+
Security2CCNonceReport
|
|
785
|
+
];
|
|
786
|
+
if (sent.encapsulated instanceof Security2CCKEXSet || sent.encapsulated instanceof Security2CCKEXReport || sent.encapsulated instanceof Security2CCNetworkKeyGet || sent.encapsulated instanceof Security2CCNetworkKeyReport || sent.encapsulated instanceof Security2CCNetworkKeyVerify) {
|
|
787
|
+
ret.push(Security2CCKEXFail);
|
|
788
|
+
}
|
|
789
|
+
return ret;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
function testCCResponseForMessageEncapsulation(sent, received) {
|
|
793
|
+
if (received instanceof Security2CCMessageEncapsulation) {
|
|
794
|
+
return "checkEncapsulated";
|
|
795
|
+
} else if (received instanceof Security2CCKEXFail) {
|
|
796
|
+
return true;
|
|
797
|
+
} else {
|
|
798
|
+
return received.SOS && !!received.receiverEI;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
let Security2CCMessageEncapsulation = (() => {
|
|
802
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.MessageEncapsulation), (0, import_CommandClassDecorators.expectedCCResponse)(getCCResponseForMessageEncapsulation, testCCResponseForMessageEncapsulation)];
|
|
803
|
+
let _classDescriptor;
|
|
804
|
+
let _classExtraInitializers = [];
|
|
805
|
+
let _classThis;
|
|
806
|
+
let _classSuper = Security2CC;
|
|
807
|
+
var Security2CCMessageEncapsulation2 = class extends _classSuper {
|
|
808
|
+
static {
|
|
809
|
+
_classThis = this;
|
|
810
|
+
}
|
|
811
|
+
static {
|
|
812
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
813
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
814
|
+
Security2CCMessageEncapsulation2 = _classThis = _classDescriptor.value;
|
|
815
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
816
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
817
|
+
}
|
|
818
|
+
constructor(options) {
|
|
819
|
+
super(options);
|
|
820
|
+
if (!options.encapsulated && !options.extensions?.length) {
|
|
821
|
+
throw new import_core.ZWaveError("Security S2 encapsulation requires an encapsulated CC and/or extensions", import_core.ZWaveErrorCodes.Argument_Invalid);
|
|
822
|
+
}
|
|
823
|
+
this.sequenceNumber = options.sequenceNumber;
|
|
824
|
+
this.securityClass = options.securityClass;
|
|
825
|
+
if (options.encapsulated) {
|
|
826
|
+
this.encapsulated = options.encapsulated;
|
|
827
|
+
options.encapsulated.encapsulatingCC = this;
|
|
828
|
+
}
|
|
829
|
+
this.verifyDelivery = options.verifyDelivery !== false;
|
|
830
|
+
this.extensions = options.extensions ?? [];
|
|
831
|
+
if (typeof this.nodeId !== "number" && !this.extensions.some((e) => e instanceof import_Extension.MGRPExtension)) {
|
|
832
|
+
throw new import_core.ZWaveError("Multicast Security S2 encapsulation requires the MGRP extension", import_core.ZWaveErrorCodes.Security2CC_MissingExtension);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
static from(raw, ctx) {
|
|
836
|
+
const securityManager = assertSecurityRX(ctx);
|
|
837
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
838
|
+
const sequenceNumber = raw.payload[0];
|
|
839
|
+
import_core.validatePayload.withReason("No security class granted")(ctx.getHighestSecurityClass(ctx.sourceNodeId) !== import_core.SecurityClass.None);
|
|
840
|
+
const hasExtensions = !!(raw.payload[1] & 1);
|
|
841
|
+
const hasEncryptedExtensions = !!(raw.payload[1] & 2);
|
|
842
|
+
let offset = 2;
|
|
843
|
+
const extensions = [];
|
|
844
|
+
let mustDiscardCommand = false;
|
|
845
|
+
const parseExtensions = (buffer, wasEncrypted) => {
|
|
846
|
+
while (true) {
|
|
847
|
+
if (buffer.length < offset + 2) {
|
|
848
|
+
mustDiscardCommand = true;
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const { actual: actualLength, expected: expectedLength } = import_Extension.Security2Extension.getExtensionLength(buffer.subarray(offset));
|
|
852
|
+
const extensionLength = expectedLength ?? actualLength;
|
|
853
|
+
if (extensionLength < 2) {
|
|
854
|
+
mustDiscardCommand = true;
|
|
855
|
+
return;
|
|
856
|
+
} else if (extensionLength > buffer.length - offset - (wasEncrypted ? 0 : import_core.SECURITY_S2_AUTH_TAG_LENGTH)) {
|
|
857
|
+
mustDiscardCommand = true;
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
const extensionData = buffer.subarray(offset, offset + extensionLength);
|
|
861
|
+
offset += extensionLength;
|
|
862
|
+
const ext = import_Extension.Security2Extension.parse(extensionData);
|
|
863
|
+
switch ((0, import_Extension.validateS2Extension)(ext, wasEncrypted)) {
|
|
864
|
+
case import_Extension.ValidateS2ExtensionResult.OK:
|
|
865
|
+
if (expectedLength != void 0 && actualLength !== expectedLength) {
|
|
866
|
+
} else {
|
|
867
|
+
extensions.push(ext);
|
|
868
|
+
}
|
|
869
|
+
break;
|
|
870
|
+
case import_Extension.ValidateS2ExtensionResult.DiscardExtension:
|
|
871
|
+
break;
|
|
872
|
+
case import_Extension.ValidateS2ExtensionResult.DiscardCommand:
|
|
873
|
+
mustDiscardCommand = true;
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
if (!ext.moreToFollow)
|
|
877
|
+
break;
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
if (hasExtensions)
|
|
881
|
+
parseExtensions(raw.payload, false);
|
|
882
|
+
const mcctx = (() => {
|
|
883
|
+
const multicastGroupId = getMulticastGroupId(extensions);
|
|
884
|
+
if (ctx.frameType === "multicast" || ctx.frameType === "broadcast") {
|
|
885
|
+
if (multicastGroupId == void 0) {
|
|
886
|
+
import_core.validatePayload.fail("Multicast frames without MGRP extension");
|
|
887
|
+
}
|
|
888
|
+
return {
|
|
889
|
+
isMulticast: true,
|
|
890
|
+
groupId: multicastGroupId
|
|
891
|
+
};
|
|
892
|
+
} else {
|
|
893
|
+
return { isMulticast: false, groupId: multicastGroupId };
|
|
894
|
+
}
|
|
895
|
+
})();
|
|
896
|
+
if (mustDiscardCommand) {
|
|
897
|
+
if (mcctx.isMulticast) {
|
|
898
|
+
securityManager.nextPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
899
|
+
} else {
|
|
900
|
+
securityManager.nextNonce(ctx.sourceNodeId);
|
|
901
|
+
}
|
|
902
|
+
import_core.validatePayload.fail("Invalid S2 extension");
|
|
903
|
+
}
|
|
904
|
+
let prevSequenceNumber;
|
|
905
|
+
let mpanState;
|
|
906
|
+
if (mcctx.isMulticast) {
|
|
907
|
+
mpanState = securityManager.getPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
908
|
+
} else {
|
|
909
|
+
prevSequenceNumber = validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
910
|
+
if (mcctx.groupId == void 0) {
|
|
911
|
+
securityManager.resetOutOfSyncMPANs(ctx.sourceNodeId);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
const unencryptedPayload = raw.payload.subarray(0, offset);
|
|
915
|
+
const ciphertext = raw.payload.subarray(offset, -import_core.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
916
|
+
const authTag = raw.payload.subarray(-import_core.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
917
|
+
const messageLength = 2 + raw.payload.length;
|
|
918
|
+
const authData = getAuthenticationData(ctx.sourceNodeId, getDestinationIDRX(ctx, extensions), ctx.homeId, messageLength, unencryptedPayload);
|
|
919
|
+
let decrypt;
|
|
920
|
+
if (mcctx.isMulticast) {
|
|
921
|
+
if (mpanState?.type !== import_core.MPANState.MPAN) {
|
|
922
|
+
securityManager.storePeerMPAN(ctx.sourceNodeId, mcctx.groupId, { type: import_core.MPANState.OutOfSync });
|
|
923
|
+
failNoMPAN();
|
|
924
|
+
}
|
|
925
|
+
decrypt = () => decryptMulticast(ctx.sourceNodeId, securityManager, mcctx.groupId, ciphertext, authData, authTag);
|
|
926
|
+
} else {
|
|
927
|
+
const spanState = securityManager.getSPANState(ctx.sourceNodeId);
|
|
928
|
+
if (spanState.type === import_core.SPANState.None) {
|
|
929
|
+
failNoSPAN();
|
|
930
|
+
} else if (spanState.type === import_core.SPANState.RemoteEI) {
|
|
931
|
+
failNoSPAN();
|
|
932
|
+
}
|
|
933
|
+
decrypt = () => decryptSinglecast(ctx, securityManager, ctx.sourceNodeId, sequenceNumber, prevSequenceNumber, ciphertext, authData, authTag, spanState, extensions);
|
|
934
|
+
}
|
|
935
|
+
let plaintext;
|
|
936
|
+
let authOK = false;
|
|
937
|
+
let key;
|
|
938
|
+
let iv;
|
|
939
|
+
let decryptionSecurityClass;
|
|
940
|
+
const decryptAttempts = mcctx.isMulticast ? MAX_DECRYPT_ATTEMPTS_MULTICAST : mcctx.groupId != void 0 ? MAX_DECRYPT_ATTEMPTS_SC_FOLLOWUP : MAX_DECRYPT_ATTEMPTS_SINGLECAST;
|
|
941
|
+
for (let i = 0; i < decryptAttempts; i++) {
|
|
942
|
+
({
|
|
943
|
+
plaintext,
|
|
944
|
+
authOK,
|
|
945
|
+
key,
|
|
946
|
+
iv,
|
|
947
|
+
securityClass: decryptionSecurityClass
|
|
948
|
+
} = decrypt());
|
|
949
|
+
if (!!authOK && !!plaintext)
|
|
950
|
+
break;
|
|
951
|
+
if (!!getSenderEI(extensions))
|
|
952
|
+
break;
|
|
953
|
+
}
|
|
954
|
+
if (!authOK || !plaintext) {
|
|
955
|
+
if (mcctx.isMulticast) {
|
|
956
|
+
securityManager.storePeerMPAN(ctx.sourceNodeId, mcctx.groupId, { type: import_core.MPANState.OutOfSync });
|
|
957
|
+
import_core.validatePayload.fail(import_core.ZWaveErrorCodes.Security2CC_CannotDecodeMulticast);
|
|
958
|
+
} else {
|
|
959
|
+
import_core.validatePayload.fail(import_core.ZWaveErrorCodes.Security2CC_CannotDecode);
|
|
960
|
+
}
|
|
961
|
+
} else if (!mcctx.isMulticast && mcctx.groupId != void 0) {
|
|
962
|
+
securityManager.tryIncrementPeerMPAN(ctx.sourceNodeId, mcctx.groupId);
|
|
963
|
+
}
|
|
964
|
+
const securityClass = decryptionSecurityClass;
|
|
965
|
+
offset = 0;
|
|
966
|
+
if (hasEncryptedExtensions)
|
|
967
|
+
parseExtensions(plaintext, true);
|
|
968
|
+
if (mustDiscardCommand) {
|
|
969
|
+
import_core.validatePayload.fail("Invalid extension");
|
|
970
|
+
}
|
|
971
|
+
if (!mcctx.isMulticast) {
|
|
972
|
+
const mpanExtension = extensions.find((e) => e instanceof import_Extension.MPANExtension);
|
|
973
|
+
if (mpanExtension) {
|
|
974
|
+
securityManager.storePeerMPAN(ctx.sourceNodeId, mpanExtension.groupId, {
|
|
975
|
+
type: import_core.MPANState.MPAN,
|
|
976
|
+
currentMPAN: mpanExtension.innerMPANState
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
const decryptedCCBytes = plaintext.subarray(offset);
|
|
981
|
+
let encapsulated;
|
|
982
|
+
if (decryptedCCBytes.length > 0) {
|
|
983
|
+
(0, import_core.validatePayload)(decryptedCCBytes.length >= 2);
|
|
984
|
+
encapsulated = import_CommandClass.CommandClass.parse(decryptedCCBytes, ctx);
|
|
985
|
+
}
|
|
986
|
+
const ret = new Security2CCMessageEncapsulation2({
|
|
987
|
+
nodeId: ctx.sourceNodeId,
|
|
988
|
+
sequenceNumber,
|
|
989
|
+
securityClass,
|
|
990
|
+
extensions,
|
|
991
|
+
encapsulated
|
|
992
|
+
});
|
|
993
|
+
ret.key = key;
|
|
994
|
+
ret.iv = iv;
|
|
995
|
+
ret.authData = authData;
|
|
996
|
+
ret.authTag = authTag;
|
|
997
|
+
ret.plaintext = decryptedCCBytes;
|
|
998
|
+
return ret;
|
|
999
|
+
}
|
|
1000
|
+
securityClass;
|
|
1001
|
+
// Only used for testing/debugging purposes
|
|
1002
|
+
key;
|
|
1003
|
+
iv;
|
|
1004
|
+
authData;
|
|
1005
|
+
authTag;
|
|
1006
|
+
ciphertext;
|
|
1007
|
+
plaintext;
|
|
1008
|
+
verifyDelivery = true;
|
|
1009
|
+
sequenceNumber;
|
|
1010
|
+
ensureSequenceNumber(securityManager) {
|
|
1011
|
+
if (this.sequenceNumber == void 0) {
|
|
1012
|
+
if (this.isSinglecast()) {
|
|
1013
|
+
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1014
|
+
} else {
|
|
1015
|
+
const groupId = getDestinationIDTX.call(this);
|
|
1016
|
+
this.sequenceNumber = securityManager.nextMulticastSequenceNumber(groupId);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
encapsulated;
|
|
1021
|
+
extensions;
|
|
1022
|
+
prepareRetransmission() {
|
|
1023
|
+
super.prepareRetransmission();
|
|
1024
|
+
this.sequenceNumber = void 0;
|
|
1025
|
+
}
|
|
1026
|
+
hasMOSExtension() {
|
|
1027
|
+
return this.extensions.some((e) => e instanceof import_Extension.MOSExtension);
|
|
1028
|
+
}
|
|
1029
|
+
/** Returns the Sender's Entropy Input if this command contains an SPAN extension */
|
|
1030
|
+
getSenderEI() {
|
|
1031
|
+
return getSenderEI(this.extensions);
|
|
1032
|
+
}
|
|
1033
|
+
/** Returns the multicast group ID if this command contains an MGRP extension */
|
|
1034
|
+
getMulticastGroupId() {
|
|
1035
|
+
return getMulticastGroupId(this.extensions);
|
|
1036
|
+
}
|
|
1037
|
+
maybeAddSPANExtension(ctx, securityManager) {
|
|
1038
|
+
if (!this.isSinglecast())
|
|
1039
|
+
return;
|
|
1040
|
+
const receiverNodeId = this.nodeId;
|
|
1041
|
+
const spanState = securityManager.getSPANState(receiverNodeId);
|
|
1042
|
+
if (spanState.type === import_core.SPANState.None || spanState.type === import_core.SPANState.LocalEI) {
|
|
1043
|
+
throw new import_core.ZWaveError(`Security S2 CC requires the receiver's nonce to be sent!`, import_core.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
1044
|
+
} else if (spanState.type === import_core.SPANState.RemoteEI) {
|
|
1045
|
+
const senderEI = securityManager.generateNonce(void 0);
|
|
1046
|
+
const receiverEI = spanState.receiverEI;
|
|
1047
|
+
if (this.securityClass == void 0 && securityManager.tempKeys.has(receiverNodeId)) {
|
|
1048
|
+
securityManager.initializeTempSPAN(receiverNodeId, senderEI, receiverEI);
|
|
1049
|
+
} else {
|
|
1050
|
+
const securityClass = this.securityClass ?? ctx.getHighestSecurityClass(receiverNodeId);
|
|
1051
|
+
if (securityClass == void 0) {
|
|
1052
|
+
throw new import_core.ZWaveError("No security class defined for this command!", import_core.ZWaveErrorCodes.Security2CC_NoSPAN);
|
|
1053
|
+
}
|
|
1054
|
+
securityManager.initializeSPAN(receiverNodeId, securityClass, senderEI, receiverEI);
|
|
1055
|
+
}
|
|
1056
|
+
let spanExtension = this.extensions.find((e) => e instanceof import_Extension.SPANExtension);
|
|
1057
|
+
if (spanExtension) {
|
|
1058
|
+
spanExtension.senderEI = senderEI;
|
|
1059
|
+
} else {
|
|
1060
|
+
spanExtension = new import_Extension.SPANExtension({ senderEI });
|
|
1061
|
+
this.extensions.push(spanExtension);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
serialize(ctx) {
|
|
1066
|
+
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1067
|
+
this.ensureSequenceNumber(securityManager);
|
|
1068
|
+
this.maybeAddSPANExtension(ctx, securityManager);
|
|
1069
|
+
const unencryptedExtensions = this.extensions.filter((e) => !e.isEncrypted());
|
|
1070
|
+
const encryptedExtensions = this.extensions.filter((e) => e.isEncrypted());
|
|
1071
|
+
const unencryptedPayload = import_safe2.Bytes.concat([
|
|
1072
|
+
import_safe2.Bytes.from([
|
|
1073
|
+
this.sequenceNumber,
|
|
1074
|
+
(encryptedExtensions.length > 0 ? 2 : 0) | (unencryptedExtensions.length > 0 ? 1 : 0)
|
|
1075
|
+
]),
|
|
1076
|
+
...unencryptedExtensions.map((e, index) => e.serialize(index < unencryptedExtensions.length - 1))
|
|
1077
|
+
]);
|
|
1078
|
+
const serializedCC = this.encapsulated?.serialize(ctx) ?? new import_safe2.Bytes();
|
|
1079
|
+
const plaintextPayload = import_safe2.Bytes.concat([
|
|
1080
|
+
...encryptedExtensions.map((e, index) => e.serialize(index < encryptedExtensions.length - 1)),
|
|
1081
|
+
serializedCC
|
|
1082
|
+
]);
|
|
1083
|
+
const destinationTag = getDestinationIDTX.call(this);
|
|
1084
|
+
const messageLength = this.computeEncapsulationOverhead() + serializedCC.length;
|
|
1085
|
+
const authData = getAuthenticationData(ctx.ownNodeId, destinationTag, ctx.homeId, messageLength, unencryptedPayload);
|
|
1086
|
+
let key;
|
|
1087
|
+
let iv;
|
|
1088
|
+
if (this.isSinglecast()) {
|
|
1089
|
+
iv = securityManager.nextNonce(this.nodeId, true);
|
|
1090
|
+
const { keyCCM } = (
|
|
1091
|
+
// Prefer the overridden security class if it was given
|
|
1092
|
+
this.securityClass != void 0 ? securityManager.getKeysForSecurityClass(this.securityClass) : securityManager.getKeysForNode(this.nodeId)
|
|
1093
|
+
);
|
|
1094
|
+
key = keyCCM;
|
|
1095
|
+
} else {
|
|
1096
|
+
const keyAndIV = securityManager.getMulticastKeyAndIV(destinationTag);
|
|
1097
|
+
key = keyAndIV.key;
|
|
1098
|
+
iv = keyAndIV.iv;
|
|
1099
|
+
}
|
|
1100
|
+
const { ciphertext: ciphertextPayload, authTag } = (0, import_core.encryptAES128CCM)(key, iv, plaintextPayload, authData, import_core.SECURITY_S2_AUTH_TAG_LENGTH);
|
|
1101
|
+
this.key = key;
|
|
1102
|
+
this.iv = iv;
|
|
1103
|
+
this.authData = authData;
|
|
1104
|
+
this.authTag = authTag;
|
|
1105
|
+
this.ciphertext = ciphertextPayload;
|
|
1106
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1107
|
+
unencryptedPayload,
|
|
1108
|
+
ciphertextPayload,
|
|
1109
|
+
authTag
|
|
1110
|
+
]);
|
|
1111
|
+
return super.serialize(ctx);
|
|
1112
|
+
}
|
|
1113
|
+
computeEncapsulationOverhead() {
|
|
1114
|
+
const extensionBytes = this.extensions.map((e) => e.computeLength()).reduce((a, b) => a + b, 0);
|
|
1115
|
+
return super.computeEncapsulationOverhead() + 2 + import_core.SECURITY_S2_AUTH_TAG_LENGTH + extensionBytes;
|
|
1116
|
+
}
|
|
1117
|
+
toLogEntry(ctx) {
|
|
1118
|
+
const message = {
|
|
1119
|
+
"sequence number": this.sequenceNumber ?? "(not set)"
|
|
1120
|
+
};
|
|
1121
|
+
if (this.extensions.length > 0) {
|
|
1122
|
+
message.extensions = this.extensions.map((e) => e.toLogEntry()).join("");
|
|
1123
|
+
}
|
|
1124
|
+
if (process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development") {
|
|
1125
|
+
if (this.key) {
|
|
1126
|
+
message.key = (0, import_safe3.buffer2hex)(this.key);
|
|
1127
|
+
}
|
|
1128
|
+
if (this.iv) {
|
|
1129
|
+
message.IV = (0, import_safe3.buffer2hex)(this.iv);
|
|
1130
|
+
}
|
|
1131
|
+
if (this.ciphertext) {
|
|
1132
|
+
message.ciphertext = (0, import_safe3.buffer2hex)(this.ciphertext);
|
|
1133
|
+
} else if (this.plaintext) {
|
|
1134
|
+
message.plaintext = (0, import_safe3.buffer2hex)(this.plaintext);
|
|
1135
|
+
}
|
|
1136
|
+
if (this.authData) {
|
|
1137
|
+
message["auth data"] = (0, import_safe3.buffer2hex)(this.authData);
|
|
1138
|
+
}
|
|
1139
|
+
if (this.authTag) {
|
|
1140
|
+
message["auth tag"] = (0, import_safe3.buffer2hex)(this.authTag);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
if (this.securityClass != void 0) {
|
|
1144
|
+
message["security class"] = (0, import_safe3.getEnumMemberName)(import_core.SecurityClass, this.securityClass);
|
|
1145
|
+
}
|
|
1146
|
+
return {
|
|
1147
|
+
...super.toLogEntry(ctx),
|
|
1148
|
+
message
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
return Security2CCMessageEncapsulation2 = _classThis;
|
|
1153
|
+
})();
|
|
1154
|
+
let Security2CCNonceReport = (() => {
|
|
1155
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.NonceReport)];
|
|
1156
|
+
let _classDescriptor;
|
|
1157
|
+
let _classExtraInitializers = [];
|
|
1158
|
+
let _classThis;
|
|
1159
|
+
let _classSuper = Security2CC;
|
|
1160
|
+
var Security2CCNonceReport2 = class extends _classSuper {
|
|
1161
|
+
static {
|
|
1162
|
+
_classThis = this;
|
|
1163
|
+
}
|
|
1164
|
+
static {
|
|
1165
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1166
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1167
|
+
Security2CCNonceReport2 = _classThis = _classDescriptor.value;
|
|
1168
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1169
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1170
|
+
}
|
|
1171
|
+
constructor(options) {
|
|
1172
|
+
super(options);
|
|
1173
|
+
this.SOS = options.SOS;
|
|
1174
|
+
this.MOS = options.MOS;
|
|
1175
|
+
this.sequenceNumber = options.sequenceNumber;
|
|
1176
|
+
if (options.SOS)
|
|
1177
|
+
this.receiverEI = options.receiverEI;
|
|
1178
|
+
}
|
|
1179
|
+
static from(raw, ctx) {
|
|
1180
|
+
const securityManager = assertSecurityRX(ctx);
|
|
1181
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
1182
|
+
const sequenceNumber = raw.payload[0];
|
|
1183
|
+
validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
1184
|
+
const MOS = !!(raw.payload[1] & 2);
|
|
1185
|
+
const SOS = !!(raw.payload[1] & 1);
|
|
1186
|
+
if (SOS) {
|
|
1187
|
+
(0, import_core.validatePayload)(raw.payload.length >= 18);
|
|
1188
|
+
const receiverEI = raw.payload.subarray(2, 18);
|
|
1189
|
+
securityManager.storeRemoteEI(ctx.sourceNodeId, receiverEI);
|
|
1190
|
+
return new this({
|
|
1191
|
+
nodeId: ctx.sourceNodeId,
|
|
1192
|
+
sequenceNumber,
|
|
1193
|
+
MOS,
|
|
1194
|
+
SOS,
|
|
1195
|
+
receiverEI
|
|
1196
|
+
});
|
|
1197
|
+
} else if (MOS) {
|
|
1198
|
+
return new this({
|
|
1199
|
+
nodeId: ctx.sourceNodeId,
|
|
1200
|
+
sequenceNumber,
|
|
1201
|
+
MOS,
|
|
1202
|
+
SOS: false
|
|
1203
|
+
});
|
|
1204
|
+
} else {
|
|
1205
|
+
import_core.validatePayload.fail("Either MOS or SOS must be set");
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
sequenceNumber;
|
|
1209
|
+
ensureSequenceNumber(securityManager) {
|
|
1210
|
+
if (this.sequenceNumber == void 0) {
|
|
1211
|
+
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
SOS;
|
|
1215
|
+
MOS;
|
|
1216
|
+
receiverEI;
|
|
1217
|
+
serialize(ctx) {
|
|
1218
|
+
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1219
|
+
this.ensureSequenceNumber(securityManager);
|
|
1220
|
+
this.payload = import_safe2.Bytes.from([
|
|
1221
|
+
this.sequenceNumber,
|
|
1222
|
+
(this.MOS ? 2 : 0) + (this.SOS ? 1 : 0)
|
|
1223
|
+
]);
|
|
1224
|
+
if (this.SOS) {
|
|
1225
|
+
this.payload = import_safe2.Bytes.concat([this.payload, this.receiverEI]);
|
|
1226
|
+
}
|
|
1227
|
+
return super.serialize(ctx);
|
|
1228
|
+
}
|
|
1229
|
+
toLogEntry(ctx) {
|
|
1230
|
+
const message = {
|
|
1231
|
+
"sequence number": this.sequenceNumber ?? "(not set)",
|
|
1232
|
+
SOS: this.SOS,
|
|
1233
|
+
MOS: this.MOS
|
|
1234
|
+
};
|
|
1235
|
+
if (this.receiverEI) {
|
|
1236
|
+
message["receiver entropy"] = (0, import_safe3.buffer2hex)(this.receiverEI);
|
|
1237
|
+
}
|
|
1238
|
+
return {
|
|
1239
|
+
...super.toLogEntry(ctx),
|
|
1240
|
+
message
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
return Security2CCNonceReport2 = _classThis;
|
|
1245
|
+
})();
|
|
1246
|
+
let Security2CCNonceGet = (() => {
|
|
1247
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.NonceGet), (0, import_CommandClassDecorators.expectedCCResponse)(Security2CCNonceReport)];
|
|
1248
|
+
let _classDescriptor;
|
|
1249
|
+
let _classExtraInitializers = [];
|
|
1250
|
+
let _classThis;
|
|
1251
|
+
let _classSuper = Security2CC;
|
|
1252
|
+
var Security2CCNonceGet2 = class extends _classSuper {
|
|
1253
|
+
static {
|
|
1254
|
+
_classThis = this;
|
|
1255
|
+
}
|
|
1256
|
+
static {
|
|
1257
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1258
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1259
|
+
Security2CCNonceGet2 = _classThis = _classDescriptor.value;
|
|
1260
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1261
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1262
|
+
}
|
|
1263
|
+
// TODO: A node sending this command MUST accept a delay up to <Previous Round-trip-time to peer node> +
|
|
1264
|
+
// 250 ms before receiving the Security 2 Nonce Report Command.
|
|
1265
|
+
constructor(options) {
|
|
1266
|
+
super(options);
|
|
1267
|
+
this.sequenceNumber = options.sequenceNumber;
|
|
1268
|
+
}
|
|
1269
|
+
static from(raw, ctx) {
|
|
1270
|
+
const securityManager = assertSecurityRX(ctx);
|
|
1271
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1272
|
+
const sequenceNumber = raw.payload[0];
|
|
1273
|
+
validateSequenceNumber(securityManager, ctx.sourceNodeId, sequenceNumber);
|
|
1274
|
+
return new this({
|
|
1275
|
+
nodeId: ctx.sourceNodeId,
|
|
1276
|
+
sequenceNumber
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
sequenceNumber;
|
|
1280
|
+
ensureSequenceNumber(securityManager) {
|
|
1281
|
+
if (this.sequenceNumber == void 0) {
|
|
1282
|
+
this.sequenceNumber = securityManager.nextSequenceNumber(this.nodeId);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
serialize(ctx) {
|
|
1286
|
+
const securityManager = assertSecurityTX(ctx, this.nodeId);
|
|
1287
|
+
this.ensureSequenceNumber(securityManager);
|
|
1288
|
+
this.payload = import_safe2.Bytes.from([this.sequenceNumber]);
|
|
1289
|
+
return super.serialize(ctx);
|
|
1290
|
+
}
|
|
1291
|
+
toLogEntry(ctx) {
|
|
1292
|
+
return {
|
|
1293
|
+
...super.toLogEntry(ctx),
|
|
1294
|
+
message: {
|
|
1295
|
+
"sequence number": this.sequenceNumber ?? "(not set)"
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
return Security2CCNonceGet2 = _classThis;
|
|
1301
|
+
})();
|
|
1302
|
+
let Security2CCKEXReport = (() => {
|
|
1303
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.KEXReport)];
|
|
1304
|
+
let _classDescriptor;
|
|
1305
|
+
let _classExtraInitializers = [];
|
|
1306
|
+
let _classThis;
|
|
1307
|
+
let _classSuper = Security2CC;
|
|
1308
|
+
var Security2CCKEXReport2 = class extends _classSuper {
|
|
1309
|
+
static {
|
|
1310
|
+
_classThis = this;
|
|
1311
|
+
}
|
|
1312
|
+
static {
|
|
1313
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1314
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1315
|
+
Security2CCKEXReport2 = _classThis = _classDescriptor.value;
|
|
1316
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1317
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1318
|
+
}
|
|
1319
|
+
constructor(options) {
|
|
1320
|
+
super(options);
|
|
1321
|
+
this.requestCSA = options.requestCSA;
|
|
1322
|
+
this.echo = options.echo;
|
|
1323
|
+
this._reserved = options._reserved ?? 0;
|
|
1324
|
+
this.supportedKEXSchemes = options.supportedKEXSchemes;
|
|
1325
|
+
this.supportedECDHProfiles = options.supportedECDHProfiles;
|
|
1326
|
+
this.requestedKeys = options.requestedKeys;
|
|
1327
|
+
}
|
|
1328
|
+
static from(raw, ctx) {
|
|
1329
|
+
(0, import_core.validatePayload)(raw.payload.length >= 4);
|
|
1330
|
+
const requestCSA = !!(raw.payload[0] & 2);
|
|
1331
|
+
const echo = !!(raw.payload[0] & 1);
|
|
1332
|
+
const _reserved = raw.payload[0] & 252;
|
|
1333
|
+
const supportedKEXSchemes = (0, import_core.parseBitMask)(raw.payload.subarray(1, 2), 0).filter((s) => s !== 0);
|
|
1334
|
+
const supportedECDHProfiles = (0, import_core.parseBitMask)(raw.payload.subarray(2, 3), import_shared.ECDHProfiles.Curve25519);
|
|
1335
|
+
const requestedKeys = (0, import_core.parseBitMask)(raw.payload.subarray(3, 4), import_core.SecurityClass.S2_Unauthenticated);
|
|
1336
|
+
return new this({
|
|
1337
|
+
nodeId: ctx.sourceNodeId,
|
|
1338
|
+
requestCSA,
|
|
1339
|
+
echo,
|
|
1340
|
+
_reserved,
|
|
1341
|
+
supportedKEXSchemes,
|
|
1342
|
+
supportedECDHProfiles,
|
|
1343
|
+
requestedKeys
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
_reserved;
|
|
1347
|
+
requestCSA;
|
|
1348
|
+
echo;
|
|
1349
|
+
supportedKEXSchemes;
|
|
1350
|
+
supportedECDHProfiles;
|
|
1351
|
+
requestedKeys;
|
|
1352
|
+
serialize(ctx) {
|
|
1353
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1354
|
+
import_safe2.Bytes.from([
|
|
1355
|
+
this._reserved + (this.requestCSA ? 2 : 0) + (this.echo ? 1 : 0)
|
|
1356
|
+
]),
|
|
1357
|
+
// The bit mask starts at 0, but bit 0 is not used
|
|
1358
|
+
(0, import_core.encodeBitMask)(this.supportedKEXSchemes, 7, 0),
|
|
1359
|
+
(0, import_core.encodeBitMask)(this.supportedECDHProfiles, 7, import_shared.ECDHProfiles.Curve25519),
|
|
1360
|
+
(0, import_core.encodeBitMask)(this.requestedKeys, import_core.SecurityClass.S0_Legacy, import_core.SecurityClass.S2_Unauthenticated)
|
|
1361
|
+
]);
|
|
1362
|
+
return super.serialize(ctx);
|
|
1363
|
+
}
|
|
1364
|
+
toLogEntry(ctx) {
|
|
1365
|
+
return {
|
|
1366
|
+
...super.toLogEntry(ctx),
|
|
1367
|
+
message: {
|
|
1368
|
+
echo: this.echo,
|
|
1369
|
+
"supported schemes": this.supportedKEXSchemes.map((s) => `
|
|
1370
|
+
\xB7 ${(0, import_safe3.getEnumMemberName)(import_shared.KEXSchemes, s)}`).join(""),
|
|
1371
|
+
"supported ECDH profiles": this.supportedECDHProfiles.map((s) => `
|
|
1372
|
+
\xB7 ${(0, import_safe3.getEnumMemberName)(import_shared.ECDHProfiles, s)}`).join(""),
|
|
1373
|
+
"CSA requested": this.requestCSA,
|
|
1374
|
+
"requested security classes": this.requestedKeys.map((s) => `
|
|
1375
|
+
\xB7 ${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, s)}`).join("")
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
return Security2CCKEXReport2 = _classThis;
|
|
1381
|
+
})();
|
|
1382
|
+
let Security2CCKEXGet = (() => {
|
|
1383
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.KEXGet), (0, import_CommandClassDecorators.expectedCCResponse)(Security2CCKEXReport)];
|
|
1384
|
+
let _classDescriptor;
|
|
1385
|
+
let _classExtraInitializers = [];
|
|
1386
|
+
let _classThis;
|
|
1387
|
+
let _classSuper = Security2CC;
|
|
1388
|
+
var Security2CCKEXGet2 = class extends _classSuper {
|
|
1389
|
+
static {
|
|
1390
|
+
_classThis = this;
|
|
1391
|
+
}
|
|
1392
|
+
static {
|
|
1393
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1394
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1395
|
+
Security2CCKEXGet2 = _classThis = _classDescriptor.value;
|
|
1396
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1397
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
return Security2CCKEXGet2 = _classThis;
|
|
1401
|
+
})();
|
|
1402
|
+
function getExpectedResponseForKEXSet(sent) {
|
|
1403
|
+
if (sent.echo) {
|
|
1404
|
+
return [Security2CCKEXReport, Security2CCKEXFail];
|
|
1405
|
+
} else {
|
|
1406
|
+
return void 0;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
function testExpectedResponseForKEXSet(sent, received) {
|
|
1410
|
+
if (sent.echo) {
|
|
1411
|
+
if (received instanceof Security2CCKEXReport) {
|
|
1412
|
+
return received.echo;
|
|
1413
|
+
} else if (received instanceof Security2CCKEXFail) {
|
|
1414
|
+
return true;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
let Security2CCKEXSet = (() => {
|
|
1420
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.KEXSet), (0, import_CommandClassDecorators.expectedCCResponse)(getExpectedResponseForKEXSet, testExpectedResponseForKEXSet)];
|
|
1421
|
+
let _classDescriptor;
|
|
1422
|
+
let _classExtraInitializers = [];
|
|
1423
|
+
let _classThis;
|
|
1424
|
+
let _classSuper = Security2CC;
|
|
1425
|
+
var Security2CCKEXSet2 = class extends _classSuper {
|
|
1426
|
+
static {
|
|
1427
|
+
_classThis = this;
|
|
1428
|
+
}
|
|
1429
|
+
static {
|
|
1430
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1431
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1432
|
+
Security2CCKEXSet2 = _classThis = _classDescriptor.value;
|
|
1433
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1434
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1435
|
+
}
|
|
1436
|
+
constructor(options) {
|
|
1437
|
+
super(options);
|
|
1438
|
+
this.permitCSA = options.permitCSA;
|
|
1439
|
+
this.echo = options.echo;
|
|
1440
|
+
this._reserved = options._reserved ?? 0;
|
|
1441
|
+
this.selectedKEXScheme = options.selectedKEXScheme;
|
|
1442
|
+
this.selectedECDHProfile = options.selectedECDHProfile;
|
|
1443
|
+
this.grantedKeys = options.grantedKeys;
|
|
1444
|
+
}
|
|
1445
|
+
static from(raw, ctx) {
|
|
1446
|
+
(0, import_core.validatePayload)(raw.payload.length >= 4);
|
|
1447
|
+
const _reserved = raw.payload[0] & 252;
|
|
1448
|
+
const permitCSA = !!(raw.payload[0] & 2);
|
|
1449
|
+
const echo = !!(raw.payload[0] & 1);
|
|
1450
|
+
const selectedKEXSchemes = (0, import_core.parseBitMask)(raw.payload.subarray(1, 2), 0).filter((s) => s !== 0);
|
|
1451
|
+
(0, import_core.validatePayload)(selectedKEXSchemes.length === 1);
|
|
1452
|
+
const selectedKEXScheme = selectedKEXSchemes[0];
|
|
1453
|
+
const selectedECDHProfiles = (0, import_core.parseBitMask)(raw.payload.subarray(2, 3), import_shared.ECDHProfiles.Curve25519);
|
|
1454
|
+
(0, import_core.validatePayload)(selectedECDHProfiles.length === 1);
|
|
1455
|
+
const selectedECDHProfile = selectedECDHProfiles[0];
|
|
1456
|
+
const grantedKeys = (0, import_core.parseBitMask)(raw.payload.subarray(3, 4), import_core.SecurityClass.S2_Unauthenticated);
|
|
1457
|
+
return new this({
|
|
1458
|
+
nodeId: ctx.sourceNodeId,
|
|
1459
|
+
_reserved,
|
|
1460
|
+
permitCSA,
|
|
1461
|
+
echo,
|
|
1462
|
+
selectedKEXScheme,
|
|
1463
|
+
selectedECDHProfile,
|
|
1464
|
+
grantedKeys
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
_reserved;
|
|
1468
|
+
permitCSA;
|
|
1469
|
+
echo;
|
|
1470
|
+
selectedKEXScheme;
|
|
1471
|
+
selectedECDHProfile;
|
|
1472
|
+
grantedKeys;
|
|
1473
|
+
serialize(ctx) {
|
|
1474
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1475
|
+
import_safe2.Bytes.from([
|
|
1476
|
+
this._reserved + (this.permitCSA ? 2 : 0) + (this.echo ? 1 : 0)
|
|
1477
|
+
]),
|
|
1478
|
+
// The bit mask starts at 0, but bit 0 is not used
|
|
1479
|
+
(0, import_core.encodeBitMask)([this.selectedKEXScheme], 7, 0),
|
|
1480
|
+
(0, import_core.encodeBitMask)([this.selectedECDHProfile], 7, import_shared.ECDHProfiles.Curve25519),
|
|
1481
|
+
(0, import_core.encodeBitMask)(this.grantedKeys, import_core.SecurityClass.S0_Legacy, import_core.SecurityClass.S2_Unauthenticated)
|
|
1482
|
+
]);
|
|
1483
|
+
return super.serialize(ctx);
|
|
1484
|
+
}
|
|
1485
|
+
toLogEntry(ctx) {
|
|
1486
|
+
return {
|
|
1487
|
+
...super.toLogEntry(ctx),
|
|
1488
|
+
message: {
|
|
1489
|
+
echo: this.echo,
|
|
1490
|
+
"selected scheme": (0, import_safe3.getEnumMemberName)(import_shared.KEXSchemes, this.selectedKEXScheme),
|
|
1491
|
+
"selected ECDH profile": (0, import_safe3.getEnumMemberName)(import_shared.ECDHProfiles, this.selectedECDHProfile),
|
|
1492
|
+
"CSA permitted": this.permitCSA,
|
|
1493
|
+
"granted security classes": this.grantedKeys.map((s) => `
|
|
1494
|
+
\xB7 ${(0, import_safe3.getEnumMemberName)(import_core.SecurityClass, s)}`).join("")
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
return Security2CCKEXSet2 = _classThis;
|
|
1500
|
+
})();
|
|
1501
|
+
let Security2CCKEXFail = (() => {
|
|
1502
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.KEXFail)];
|
|
1503
|
+
let _classDescriptor;
|
|
1504
|
+
let _classExtraInitializers = [];
|
|
1505
|
+
let _classThis;
|
|
1506
|
+
let _classSuper = Security2CC;
|
|
1507
|
+
var Security2CCKEXFail2 = class extends _classSuper {
|
|
1508
|
+
static {
|
|
1509
|
+
_classThis = this;
|
|
1510
|
+
}
|
|
1511
|
+
static {
|
|
1512
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1513
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1514
|
+
Security2CCKEXFail2 = _classThis = _classDescriptor.value;
|
|
1515
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1516
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1517
|
+
}
|
|
1518
|
+
constructor(options) {
|
|
1519
|
+
super(options);
|
|
1520
|
+
this.failType = options.failType;
|
|
1521
|
+
}
|
|
1522
|
+
static from(raw, ctx) {
|
|
1523
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1524
|
+
const failType = raw.payload[0];
|
|
1525
|
+
return new this({
|
|
1526
|
+
nodeId: ctx.sourceNodeId,
|
|
1527
|
+
failType
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
failType;
|
|
1531
|
+
serialize(ctx) {
|
|
1532
|
+
this.payload = import_safe2.Bytes.from([this.failType]);
|
|
1533
|
+
return super.serialize(ctx);
|
|
1534
|
+
}
|
|
1535
|
+
toLogEntry(ctx) {
|
|
1536
|
+
return {
|
|
1537
|
+
...super.toLogEntry(ctx),
|
|
1538
|
+
message: { reason: (0, import_safe3.getEnumMemberName)(import_shared.KEXFailType, this.failType) }
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
return Security2CCKEXFail2 = _classThis;
|
|
1543
|
+
})();
|
|
1544
|
+
let Security2CCPublicKeyReport = (() => {
|
|
1545
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.PublicKeyReport)];
|
|
1546
|
+
let _classDescriptor;
|
|
1547
|
+
let _classExtraInitializers = [];
|
|
1548
|
+
let _classThis;
|
|
1549
|
+
let _classSuper = Security2CC;
|
|
1550
|
+
var Security2CCPublicKeyReport2 = class extends _classSuper {
|
|
1551
|
+
static {
|
|
1552
|
+
_classThis = this;
|
|
1553
|
+
}
|
|
1554
|
+
static {
|
|
1555
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1556
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1557
|
+
Security2CCPublicKeyReport2 = _classThis = _classDescriptor.value;
|
|
1558
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1559
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1560
|
+
}
|
|
1561
|
+
constructor(options) {
|
|
1562
|
+
super(options);
|
|
1563
|
+
this.includingNode = options.includingNode;
|
|
1564
|
+
this.publicKey = options.publicKey;
|
|
1565
|
+
}
|
|
1566
|
+
static from(raw, ctx) {
|
|
1567
|
+
(0, import_core.validatePayload)(raw.payload.length >= 17);
|
|
1568
|
+
const includingNode = !!(raw.payload[0] & 1);
|
|
1569
|
+
const publicKey = raw.payload.subarray(1);
|
|
1570
|
+
return new this({
|
|
1571
|
+
nodeId: ctx.sourceNodeId,
|
|
1572
|
+
includingNode,
|
|
1573
|
+
publicKey
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
includingNode;
|
|
1577
|
+
publicKey;
|
|
1578
|
+
serialize(ctx) {
|
|
1579
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1580
|
+
import_safe2.Bytes.from([this.includingNode ? 1 : 0]),
|
|
1581
|
+
this.publicKey
|
|
1582
|
+
]);
|
|
1583
|
+
return super.serialize(ctx);
|
|
1584
|
+
}
|
|
1585
|
+
toLogEntry(ctx) {
|
|
1586
|
+
return {
|
|
1587
|
+
...super.toLogEntry(ctx),
|
|
1588
|
+
message: {
|
|
1589
|
+
"is including node": this.includingNode,
|
|
1590
|
+
"public key": (0, import_safe3.buffer2hex)(this.publicKey)
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
return Security2CCPublicKeyReport2 = _classThis;
|
|
1596
|
+
})();
|
|
1597
|
+
let Security2CCNetworkKeyReport = (() => {
|
|
1598
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.NetworkKeyReport)];
|
|
1599
|
+
let _classDescriptor;
|
|
1600
|
+
let _classExtraInitializers = [];
|
|
1601
|
+
let _classThis;
|
|
1602
|
+
let _classSuper = Security2CC;
|
|
1603
|
+
var Security2CCNetworkKeyReport2 = class extends _classSuper {
|
|
1604
|
+
static {
|
|
1605
|
+
_classThis = this;
|
|
1606
|
+
}
|
|
1607
|
+
static {
|
|
1608
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1609
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1610
|
+
Security2CCNetworkKeyReport2 = _classThis = _classDescriptor.value;
|
|
1611
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1612
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1613
|
+
}
|
|
1614
|
+
constructor(options) {
|
|
1615
|
+
super(options);
|
|
1616
|
+
this.grantedKey = options.grantedKey;
|
|
1617
|
+
this.networkKey = options.networkKey;
|
|
1618
|
+
}
|
|
1619
|
+
static from(raw, ctx) {
|
|
1620
|
+
(0, import_core.validatePayload)(raw.payload.length >= 17);
|
|
1621
|
+
const grantedKey = bitMaskToSecurityClass(raw.payload, 0);
|
|
1622
|
+
const networkKey = raw.payload.subarray(1, 17);
|
|
1623
|
+
return new this({
|
|
1624
|
+
nodeId: ctx.sourceNodeId,
|
|
1625
|
+
grantedKey,
|
|
1626
|
+
networkKey
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
grantedKey;
|
|
1630
|
+
networkKey;
|
|
1631
|
+
serialize(ctx) {
|
|
1632
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1633
|
+
securityClassToBitMask(this.grantedKey),
|
|
1634
|
+
this.networkKey
|
|
1635
|
+
]);
|
|
1636
|
+
return super.serialize(ctx);
|
|
1637
|
+
}
|
|
1638
|
+
toLogEntry(ctx) {
|
|
1639
|
+
return {
|
|
1640
|
+
...super.toLogEntry(ctx),
|
|
1641
|
+
message: {
|
|
1642
|
+
"security class": (0, import_safe3.getEnumMemberName)(import_core.SecurityClass, this.grantedKey)
|
|
1643
|
+
// This shouldn't be logged, so users can safely post their logs online
|
|
1644
|
+
// "network key": buffer2hex(this.networkKey),
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
};
|
|
1649
|
+
return Security2CCNetworkKeyReport2 = _classThis;
|
|
1650
|
+
})();
|
|
1651
|
+
let Security2CCNetworkKeyGet = (() => {
|
|
1652
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.NetworkKeyGet)];
|
|
1653
|
+
let _classDescriptor;
|
|
1654
|
+
let _classExtraInitializers = [];
|
|
1655
|
+
let _classThis;
|
|
1656
|
+
let _classSuper = Security2CC;
|
|
1657
|
+
var Security2CCNetworkKeyGet2 = class extends _classSuper {
|
|
1658
|
+
static {
|
|
1659
|
+
_classThis = this;
|
|
1660
|
+
}
|
|
1661
|
+
static {
|
|
1662
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1663
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1664
|
+
Security2CCNetworkKeyGet2 = _classThis = _classDescriptor.value;
|
|
1665
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1666
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1667
|
+
}
|
|
1668
|
+
constructor(options) {
|
|
1669
|
+
super(options);
|
|
1670
|
+
this.requestedKey = options.requestedKey;
|
|
1671
|
+
}
|
|
1672
|
+
static from(raw, ctx) {
|
|
1673
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1674
|
+
const requestedKey = bitMaskToSecurityClass(raw.payload, 0);
|
|
1675
|
+
return new this({
|
|
1676
|
+
nodeId: ctx.sourceNodeId,
|
|
1677
|
+
requestedKey
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
requestedKey;
|
|
1681
|
+
serialize(ctx) {
|
|
1682
|
+
this.payload = securityClassToBitMask(this.requestedKey);
|
|
1683
|
+
return super.serialize(ctx);
|
|
1684
|
+
}
|
|
1685
|
+
toLogEntry(ctx) {
|
|
1686
|
+
return {
|
|
1687
|
+
...super.toLogEntry(ctx),
|
|
1688
|
+
message: {
|
|
1689
|
+
"security class": (0, import_safe3.getEnumMemberName)(import_core.SecurityClass, this.requestedKey)
|
|
1690
|
+
}
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
return Security2CCNetworkKeyGet2 = _classThis;
|
|
1695
|
+
})();
|
|
1696
|
+
let Security2CCNetworkKeyVerify = (() => {
|
|
1697
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.NetworkKeyVerify)];
|
|
1698
|
+
let _classDescriptor;
|
|
1699
|
+
let _classExtraInitializers = [];
|
|
1700
|
+
let _classThis;
|
|
1701
|
+
let _classSuper = Security2CC;
|
|
1702
|
+
var Security2CCNetworkKeyVerify2 = class extends _classSuper {
|
|
1703
|
+
static {
|
|
1704
|
+
_classThis = this;
|
|
1705
|
+
}
|
|
1706
|
+
static {
|
|
1707
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1708
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1709
|
+
Security2CCNetworkKeyVerify2 = _classThis = _classDescriptor.value;
|
|
1710
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1711
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1712
|
+
}
|
|
1713
|
+
};
|
|
1714
|
+
return Security2CCNetworkKeyVerify2 = _classThis;
|
|
1715
|
+
})();
|
|
1716
|
+
let Security2CCTransferEnd = (() => {
|
|
1717
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.TransferEnd)];
|
|
1718
|
+
let _classDescriptor;
|
|
1719
|
+
let _classExtraInitializers = [];
|
|
1720
|
+
let _classThis;
|
|
1721
|
+
let _classSuper = Security2CC;
|
|
1722
|
+
var Security2CCTransferEnd2 = class extends _classSuper {
|
|
1723
|
+
static {
|
|
1724
|
+
_classThis = this;
|
|
1725
|
+
}
|
|
1726
|
+
static {
|
|
1727
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1728
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1729
|
+
Security2CCTransferEnd2 = _classThis = _classDescriptor.value;
|
|
1730
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1731
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1732
|
+
}
|
|
1733
|
+
constructor(options) {
|
|
1734
|
+
super(options);
|
|
1735
|
+
this.keyVerified = options.keyVerified;
|
|
1736
|
+
this.keyRequestComplete = options.keyRequestComplete;
|
|
1737
|
+
}
|
|
1738
|
+
static from(raw, ctx) {
|
|
1739
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1740
|
+
const keyVerified = !!(raw.payload[0] & 2);
|
|
1741
|
+
const keyRequestComplete = !!(raw.payload[0] & 1);
|
|
1742
|
+
return new this({
|
|
1743
|
+
nodeId: ctx.sourceNodeId,
|
|
1744
|
+
keyVerified,
|
|
1745
|
+
keyRequestComplete
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
keyVerified;
|
|
1749
|
+
keyRequestComplete;
|
|
1750
|
+
serialize(ctx) {
|
|
1751
|
+
this.payload = import_safe2.Bytes.from([
|
|
1752
|
+
(this.keyVerified ? 2 : 0) + (this.keyRequestComplete ? 1 : 0)
|
|
1753
|
+
]);
|
|
1754
|
+
return super.serialize(ctx);
|
|
1755
|
+
}
|
|
1756
|
+
toLogEntry(ctx) {
|
|
1757
|
+
return {
|
|
1758
|
+
...super.toLogEntry(ctx),
|
|
1759
|
+
message: {
|
|
1760
|
+
"key verified": this.keyVerified,
|
|
1761
|
+
"request complete": this.keyRequestComplete
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1766
|
+
return Security2CCTransferEnd2 = _classThis;
|
|
1767
|
+
})();
|
|
1768
|
+
let Security2CCCommandsSupportedReport = (() => {
|
|
1769
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.CommandsSupportedReport)];
|
|
1770
|
+
let _classDescriptor;
|
|
1771
|
+
let _classExtraInitializers = [];
|
|
1772
|
+
let _classThis;
|
|
1773
|
+
let _classSuper = Security2CC;
|
|
1774
|
+
var Security2CCCommandsSupportedReport2 = class extends _classSuper {
|
|
1775
|
+
static {
|
|
1776
|
+
_classThis = this;
|
|
1777
|
+
}
|
|
1778
|
+
static {
|
|
1779
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1780
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1781
|
+
Security2CCCommandsSupportedReport2 = _classThis = _classDescriptor.value;
|
|
1782
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1783
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1784
|
+
}
|
|
1785
|
+
constructor(options) {
|
|
1786
|
+
super(options);
|
|
1787
|
+
this.supportedCCs = options.supportedCCs;
|
|
1788
|
+
}
|
|
1789
|
+
static from(raw, ctx) {
|
|
1790
|
+
const CCs = (0, import_core.parseCCList)(raw.payload);
|
|
1791
|
+
const supportedCCs = CCs.supportedCCs;
|
|
1792
|
+
return new this({
|
|
1793
|
+
nodeId: ctx.sourceNodeId,
|
|
1794
|
+
supportedCCs
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
supportedCCs;
|
|
1798
|
+
serialize(ctx) {
|
|
1799
|
+
this.payload = (0, import_safe.encodeCCList)(this.supportedCCs, []);
|
|
1800
|
+
return super.serialize(ctx);
|
|
1801
|
+
}
|
|
1802
|
+
toLogEntry(ctx) {
|
|
1803
|
+
return {
|
|
1804
|
+
...super.toLogEntry(ctx),
|
|
1805
|
+
message: {
|
|
1806
|
+
"supported CCs": this.supportedCCs.map((cc) => (0, import_core.getCCName)(cc)).map((cc) => `
|
|
1807
|
+
\xB7 ${cc}`).join("")
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
return Security2CCCommandsSupportedReport2 = _classThis;
|
|
1813
|
+
})();
|
|
1814
|
+
let Security2CCCommandsSupportedGet = (() => {
|
|
1815
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.Security2Command.CommandsSupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(Security2CCCommandsSupportedReport)];
|
|
1816
|
+
let _classDescriptor;
|
|
1817
|
+
let _classExtraInitializers = [];
|
|
1818
|
+
let _classThis;
|
|
1819
|
+
let _classSuper = Security2CC;
|
|
1820
|
+
var Security2CCCommandsSupportedGet2 = class extends _classSuper {
|
|
1821
|
+
static {
|
|
1822
|
+
_classThis = this;
|
|
1823
|
+
}
|
|
1824
|
+
static {
|
|
1825
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1826
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1827
|
+
Security2CCCommandsSupportedGet2 = _classThis = _classDescriptor.value;
|
|
1828
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1829
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
return Security2CCCommandsSupportedGet2 = _classThis;
|
|
1833
|
+
})();
|
|
1834
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1835
|
+
0 && (module.exports = {
|
|
1836
|
+
Security2CC,
|
|
1837
|
+
Security2CCAPI,
|
|
1838
|
+
Security2CCCommandsSupportedGet,
|
|
1839
|
+
Security2CCCommandsSupportedReport,
|
|
1840
|
+
Security2CCKEXFail,
|
|
1841
|
+
Security2CCKEXGet,
|
|
1842
|
+
Security2CCKEXReport,
|
|
1843
|
+
Security2CCKEXSet,
|
|
1844
|
+
Security2CCMessageEncapsulation,
|
|
1845
|
+
Security2CCNetworkKeyGet,
|
|
1846
|
+
Security2CCNetworkKeyReport,
|
|
1847
|
+
Security2CCNetworkKeyVerify,
|
|
1848
|
+
Security2CCNonceGet,
|
|
1849
|
+
Security2CCNonceReport,
|
|
1850
|
+
Security2CCPublicKeyReport,
|
|
1851
|
+
Security2CCTransferEnd
|
|
1852
|
+
});
|
|
1853
|
+
//# sourceMappingURL=Security2CC.js.map
|