@zwave-js/cc
Advanced tools
Comparing version 12.0.0-beta.1 to 12.0.0-beta.2
@@ -46,2 +46,51 @@ "use strict"; | ||
}; | ||
const __assertType__AssociationCCReportSpecificOptions = $o => { | ||
function _number($o) { | ||
return typeof $o !== "number" ? {} : null; | ||
} | ||
function sa__number_ea_3($o) { | ||
if (!Array.isArray($o)) | ||
return {}; | ||
for (let i = 0; i < $o.length; i++) { | ||
const error = _number($o[i]); | ||
if (error) | ||
return error; | ||
} | ||
return null; | ||
} | ||
function _0($o) { | ||
if (typeof $o !== "object" || $o === null || Array.isArray($o)) | ||
return {}; | ||
if ("groupId" in $o && $o["groupId"] !== undefined) { | ||
const error = _number($o["groupId"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("maxNodes" in $o && $o["maxNodes"] !== undefined) { | ||
const error = _number($o["maxNodes"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("nodeIds" in $o && $o["nodeIds"] !== undefined) { | ||
const error = sa__number_ea_3($o["nodeIds"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("reportsToFollow" in $o && $o["reportsToFollow"] !== undefined) { | ||
const error = _number($o["reportsToFollow"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
return null; | ||
} | ||
return _0($o); | ||
}; | ||
const __assertType__sa__number_ea_2 = $o => { | ||
@@ -149,2 +198,3 @@ function _number($o) { | ||
async reportGroupCount(groupCount) { | ||
__assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount)); | ||
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SupportedGroupingsReport); | ||
@@ -178,2 +228,3 @@ const cc = new AssociationCCSupportedGroupingsReport(this.applHost, { | ||
async sendReport(options) { | ||
__assertType("options", "AssociationCCReportSpecificOptions", __assertType__AssociationCCReportSpecificOptions.bind(void 0, options)); | ||
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Report); | ||
@@ -180,0 +231,0 @@ const cc = new AssociationCCReport(this.applHost, { |
@@ -43,2 +43,80 @@ "use strict"; | ||
}; | ||
const __assertType__AssociationGroupInfoCCInfoReportSpecificOptions = $o => { | ||
function _boolean($o) { | ||
return typeof $o !== "boolean" ? {} : null; | ||
} | ||
function _number($o) { | ||
return typeof $o !== "number" ? {} : null; | ||
} | ||
function _3($o) { | ||
if (typeof $o !== "object" || $o === null || Array.isArray($o)) | ||
return {}; | ||
if ("groupId" in $o && $o["groupId"] !== undefined) { | ||
const error = _number($o["groupId"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("mode" in $o && $o["mode"] !== undefined) { | ||
const error = _number($o["mode"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("profile" in $o && $o["profile"] !== undefined) { | ||
const error = _number($o["profile"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("eventCode" in $o && $o["eventCode"] !== undefined) { | ||
const error = _number($o["eventCode"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
return null; | ||
} | ||
function sa__3_ea_3($o) { | ||
if (!Array.isArray($o)) | ||
return {}; | ||
for (let i = 0; i < $o.length; i++) { | ||
const error = _3($o[i]); | ||
if (error) | ||
return error; | ||
} | ||
return null; | ||
} | ||
function _0($o) { | ||
if (typeof $o !== "object" || $o === null || Array.isArray($o)) | ||
return {}; | ||
if ("isListMode" in $o && $o["isListMode"] !== undefined) { | ||
const error = _boolean($o["isListMode"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("hasDynamicInfo" in $o && $o["hasDynamicInfo"] !== undefined) { | ||
const error = _boolean($o["hasDynamicInfo"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
if ("groups" in $o && $o["groups"] !== undefined) { | ||
const error = sa__3_ea_3($o["groups"]); | ||
if (error) | ||
return error; | ||
} | ||
else | ||
return {}; | ||
return null; | ||
} | ||
return _0($o); | ||
}; | ||
const __assertType___0_1_2 = $o => { | ||
@@ -190,2 +268,3 @@ function _ignore() { | ||
async reportGroupInfo(options) { | ||
__assertType("options", "AssociationGroupInfoCCInfoReportSpecificOptions", __assertType__AssociationGroupInfoCCInfoReportSpecificOptions.bind(void 0, options)); | ||
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.InfoReport); | ||
@@ -192,0 +271,0 @@ const cc = new AssociationGroupInfoCCInfoReport(this.applHost, { |
@@ -17,4 +17,5 @@ "use strict"; | ||
// @noInterview This CC only has a single encapsulation command | ||
// @noValidateArgs - Encapsulation CCs are used internally and too frequently that we | ||
// Encapsulation CCs are used internally and too frequently that we | ||
// want to pay the cost of validating each call | ||
/* eslint-disable @zwave-js/ccapi-validate-args */ | ||
let CRC16CCAPI = class CRC16CCAPI extends API_1.CCAPI { | ||
@@ -21,0 +22,0 @@ supportsCommand(_cmd) { |
@@ -16,2 +16,4 @@ "use strict"; | ||
const _Types_1 = require("../lib/_Types"); | ||
// This CC should not be used directly from user code | ||
/* eslint-disable @zwave-js/ccapi-validate-args */ | ||
let InclusionControllerCC = class InclusionControllerCC extends CommandClass_1.CommandClass { | ||
@@ -18,0 +20,0 @@ }; |
@@ -118,2 +118,43 @@ "use strict"; | ||
}; | ||
const __assertType__su__undefined__string__3_eu = $o => { | ||
function _undefined($o) { | ||
return $o !== undefined ? {} : null; | ||
} | ||
function _string($o) { | ||
return typeof $o !== "string" ? {} : null; | ||
} | ||
function _number($o) { | ||
return typeof $o !== "number" ? {} : null; | ||
} | ||
function _3($o) { | ||
if (typeof $o !== "object" || $o === null || Array.isArray($o)) | ||
return {}; | ||
if ("hours" in $o && $o["hours"] !== undefined) { | ||
const error = _number($o["hours"]); | ||
if (error) | ||
return error; | ||
} | ||
if ("minutes" in $o && $o["minutes"] !== undefined) { | ||
const error = _number($o["minutes"]); | ||
if (error) | ||
return error; | ||
} | ||
if ("seconds" in $o && $o["seconds"] !== undefined) { | ||
const error = _number($o["seconds"]); | ||
if (error) | ||
return error; | ||
} | ||
return null; | ||
} | ||
function su__undefined__string__3_eu($o) { | ||
const conditions = [_undefined, _string, _3]; | ||
for (const condition of conditions) { | ||
const error = condition($o); | ||
if (!error) | ||
return null; | ||
} | ||
return {}; | ||
} | ||
return su__undefined__string__3_eu($o); | ||
}; | ||
const safe_1 = require("@zwave-js/core/safe"); | ||
@@ -424,2 +465,4 @@ const safe_2 = require("@zwave-js/shared/safe"); | ||
async setTimeout(indicatorId, timeout) { | ||
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId)); | ||
__assertType("timeout", undefined, __assertType__su__undefined__string__3_eu.bind(void 0, timeout)); | ||
this.assertPhysicalEndpoint(this.endpoint); | ||
@@ -502,2 +545,3 @@ if (this.version < 3) { | ||
async getTimeout(indicatorId) { | ||
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId)); | ||
const values = await this.get(indicatorId); | ||
@@ -504,0 +548,0 @@ if (!(0, typeguards_1.isArray)(values)) |
@@ -193,4 +193,5 @@ "use strict"; | ||
} | ||
// @noValidateArgs - Encapsulation is used internally and too frequently that we | ||
// Encapsulation is used internally and too frequently that we | ||
// want to pay the cost of validating each call | ||
// eslint-disable-next-line @zwave-js/ccapi-validate-args | ||
async sendEncapsulated(options) { | ||
@@ -214,4 +215,5 @@ this.assertSupportsCommand(_Types_1.MultiChannelCommand, _Types_1.MultiChannelCommand.CommandEncapsulation); | ||
} | ||
// @noValidateArgs - Encapsulation is used internally and too frequently that we | ||
// Encapsulation is used internally and too frequently that we | ||
// want to pay the cost of validating each call | ||
// eslint-disable-next-line @zwave-js/ccapi-validate-args | ||
async sendEncapsulatedV1(encapsulated) { | ||
@@ -218,0 +220,0 @@ this.assertSupportsCommand(_Types_1.MultiChannelCommand, _Types_1.MultiChannelCommand.CommandEncapsulationV1); |
@@ -334,2 +334,5 @@ /// <reference types="node" /> | ||
} | ||
export declare function getNotificationEnumBehavior(notificationConfig: Notification, valueConfig: NotificationValueDefinition & { | ||
type: "state"; | ||
}): "none" | "extend" | "replace"; | ||
export declare function getNotificationStateValueWithEnum(stateValue: number, enumValue: number): number; | ||
@@ -336,0 +339,0 @@ /** |
@@ -33,3 +33,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NotificationCCEventSupportedGet = exports.NotificationCCEventSupportedReport = exports.NotificationCCSupportedGet = exports.NotificationCCSupportedReport = exports.NotificationCCGet = exports.NotificationCCReport = exports.NotificationCCSet = exports.NotificationCC = exports.getNotificationValueMetadata = exports.getNotificationStateValueWithEnum = exports.NotificationCCAPI = exports.NotificationCCValues = void 0; | ||
exports.NotificationCCEventSupportedGet = exports.NotificationCCEventSupportedReport = exports.NotificationCCSupportedGet = exports.NotificationCCSupportedReport = exports.NotificationCCGet = exports.NotificationCCReport = exports.NotificationCCSet = exports.NotificationCC = exports.getNotificationValueMetadata = exports.getNotificationStateValueWithEnum = exports.getNotificationEnumBehavior = exports.NotificationCCAPI = exports.NotificationCCValues = void 0; | ||
function __assertType(argName, typeName, boundHasError) { | ||
@@ -394,2 +394,3 @@ const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core"); | ||
} | ||
exports.getNotificationEnumBehavior = getNotificationEnumBehavior; | ||
function getNotificationStateValueWithEnum(stateValue, enumValue) { | ||
@@ -422,3 +423,6 @@ return (stateValue << 8) | enumValue; | ||
for (const [value, label] of valueConfig.parameter.values) { | ||
metadata.states[getNotificationStateValueWithEnum(valueConfig.value, value)] = label; | ||
const stateKey = enumBehavior === "replace" | ||
? value | ||
: getNotificationStateValueWithEnum(valueConfig.value, value); | ||
metadata.states[stateKey] = label; | ||
} | ||
@@ -425,0 +429,0 @@ } |
@@ -44,4 +44,5 @@ "use strict"; | ||
// TODO: Ignore commands if received via multicast | ||
// @noValidateArgs - Encapsulation CCs are used internally and too frequently that we | ||
// Encapsulation CCs are used internally and too frequently that we | ||
// want to pay the cost of validating each call | ||
/* eslint-disable @zwave-js/ccapi-validate-args */ | ||
let SecurityCCAPI = class SecurityCCAPI extends API_1.PhysicalCCAPI { | ||
@@ -48,0 +49,0 @@ supportsCommand(_cmd) { |
@@ -27,4 +27,5 @@ "use strict"; | ||
// @noInterview - This CC is only used for encapsulation | ||
// @noValidateArgs - Encapsulation CCs are used internally and too frequently that we | ||
// Encapsulation CCs are used internally and too frequently that we | ||
// want to pay the cost of validating each call | ||
/* eslint-disable @zwave-js/ccapi-validate-args */ | ||
let SupervisionCCAPI = class SupervisionCCAPI extends API_1.PhysicalCCAPI { | ||
@@ -31,0 +32,0 @@ supportsCommand(cmd) { |
@@ -16,2 +16,8 @@ "use strict"; | ||
} | ||
const __assertType__number = $o => { | ||
function _number($o) { | ||
return typeof $o !== "number" ? {} : null; | ||
} | ||
return _number($o); | ||
}; | ||
const __assertType__DSTInfo = $o => { | ||
@@ -106,2 +112,5 @@ function _date($o) { | ||
async reportTime(hour, minute, second) { | ||
__assertType("hour", "number", __assertType__number.bind(void 0, hour)); | ||
__assertType("minute", "number", __assertType__number.bind(void 0, minute)); | ||
__assertType("second", "number", __assertType__number.bind(void 0, second)); | ||
this.assertSupportsCommand(_Types_1.TimeCommand, _Types_1.TimeCommand.TimeReport); | ||
@@ -130,2 +139,5 @@ const cc = new TimeCCTimeReport(this.applHost, { | ||
async reportDate(year, month, day) { | ||
__assertType("year", "number", __assertType__number.bind(void 0, year)); | ||
__assertType("month", "number", __assertType__number.bind(void 0, month)); | ||
__assertType("day", "number", __assertType__number.bind(void 0, day)); | ||
this.assertSupportsCommand(_Types_1.TimeCommand, _Types_1.TimeCommand.DateReport); | ||
@@ -132,0 +144,0 @@ const cc = new TimeCCDateReport(this.applHost, { |
{ | ||
"name": "@zwave-js/cc", | ||
"version": "12.0.0-beta.1", | ||
"version": "12.0.0-beta.2", | ||
"description": "zwave-js: Command Classes", | ||
@@ -67,4 +67,4 @@ "keywords": [], | ||
"@zwave-js/core": "12.0.0-beta.1", | ||
"@zwave-js/host": "12.0.0-beta.1", | ||
"@zwave-js/serial": "12.0.0-beta.1", | ||
"@zwave-js/host": "12.0.0-beta.2", | ||
"@zwave-js/serial": "12.0.0-beta.2", | ||
"@zwave-js/shared": "12.0.0-beta.1", | ||
@@ -79,4 +79,4 @@ "alcalzone-shared": "^4.0.8", | ||
"@types/node": "^18.17.14", | ||
"@zwave-js/maintenance": "12.0.0-beta.1", | ||
"@zwave-js/testing": "12.0.0-beta.1", | ||
"@zwave-js/maintenance": "12.0.0-beta.2", | ||
"@zwave-js/testing": "12.0.0-beta.2", | ||
"@zwave-js/transformers": "12.0.0-beta.1", | ||
@@ -83,0 +83,0 @@ "ava": "^5.3.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4219284
59615
6
+ Added@zwave-js/config@12.0.0-beta.2(transitive)
+ Added@zwave-js/host@12.0.0-beta.2(transitive)
+ Added@zwave-js/serial@12.0.0-beta.2(transitive)
- Removed@zwave-js/config@12.0.0-beta.1(transitive)
- Removed@zwave-js/host@12.0.0-beta.1(transitive)
- Removed@zwave-js/serial@12.0.0-beta.1(transitive)
Updated@zwave-js/host@12.0.0-beta.2