refactor: remove non-portable sync-versions of methods #7580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the deprecated synchronous versions of several methods related to:
This required moving to Node.js 20 as the minimum - Node.js 22 is LTS.
Complete list of API changes:
CommandClass.parse(...): CommandClass
and theasync CommandClass.parseAsync(...): Promise<CommandClass>
methods have been merged into a single signatureasync CommandClass.parse(...): Promise<CommandClass>
. Synchronous parsing of CommandClasses using theparse
method is no longer possible.CommandClass.from(...): CommandClass
and theasync CommandClass.fromAsync(...): Promise<CommandClass>
methods have been merged into a single signatureCommandClass.from(...): CommandClass | Promise<CommandClass>
. For CCs that support synchronous parsing, this will return a CC instance, otherwise a Promsie that resolves to one.CommandClass.serialize(...): Bytes
and theasync CommandClass.serializeAsync(...): Promise<Bytes>
methods have been merged into a single signatureasync CommandClass.serialize(...): Promise<Bytes>
. Synchronous serialization of CommandClasses is no longer possible.CommandClass.mergePartialCCs(...)
and theasync CommandClass.mergePartialCCsAsync(...)
methods have been merged into a single signatureasync CommandClass.mergePartialCCs(...)
. Synchronous merging of partial CCs is no longer possible, but this should not affect applications.Message.serialize(...): Bytes
and theasync Message.serializeAsync(...): Promise<Bytes>
methods have been merged into a single signatureasync Message.serialize(...): Promise<Bytes>
. Synchronous serialization of Serial API messages is no longer possible.SecurityManager.generateAuthKeySync
andSecurityManager.generateAuthKeyAsync
have been replaced with the methodSecurityManager.generateAuthKey
, which is now purelyasync
SecurityManager.generateEncryptionKeySync
andSecurityManager.generateEncryptionKeyAsync
have been replaced with the methodSecurityManager.generateEncryptionKey
, which is now purelyasync
SecurityManager.authKey
was replaced with an async methodasync getAuthKey(): Promise<Uint8Array>
SecurityManager.encryptionKey
was replaced with an async methodasync getEncryptionKey(): Promise<Uint8Array>
SecurityManager2
class are nowasync
, the corresponding...Async
variants have been removed. Typically applications shouldn't need to use them:setKey
generateNonce
initializeSPAN
initializeTempSPAN
nextNonce
getMulticastKeyAndIV
nextPeerMPAN
extractFirmware
method is nowasync
, its...Async
counterpart was removedController.dsk
property was removed in favor of the methodasync getDSK(): Promise<Uint8Array>