From 584f7b4f4793218b9c932ccf12d83d9294b54022 Mon Sep 17 00:00:00 2001 From: GerA Date: Tue, 2 Jun 2026 22:18:14 +0200 Subject: [PATCH 01/10] migrate to esm --- package-lock.json | 10 +- package.json | 3 +- src/api/airPurifiers.ts | 6 +- src/api/blinds.ts | 6 +- src/api/controllers.ts | 6 +- src/api/deviceSets.ts | 8 +- src/api/devices.ts | 4 +- src/api/environmentSensors.ts | 6 +- src/api/hub.ts | 4 +- src/api/lightSensors.ts | 6 +- src/api/lights.ts | 6 +- src/api/motionSensors.ts | 6 +- src/api/music.ts | 4 +- src/api/occupancySensors.ts | 6 +- src/api/openCloseSensors.ts | 6 +- src/api/outlets.ts | 6 +- src/api/repeaters.ts | 6 +- src/api/rooms.ts | 6 +- src/api/scenes.ts | 4 +- src/api/speakers.ts | 6 +- src/api/users.ts | 4 +- src/api/waterSensors.ts | 6 +- src/bin.ts | 6 +- src/index.ts | 139 +++++++++--------- src/types/Home.ts | 14 +- src/types/Scene.ts | 2 +- src/types/device/AirPurifier.ts | 5 +- src/types/device/Blinds.ts | 5 +- src/types/device/Controller.ts | 12 +- src/types/device/Device.ts | 30 ++-- src/types/device/EnvironmentSensor.ts | 2 +- src/types/device/Hub.ts | 2 +- src/types/device/Light.ts | 2 +- src/types/device/LightSensor.ts | 2 +- src/types/device/MotionSensor.ts | 5 +- src/types/device/OccupancySensor.ts | 2 +- src/types/device/OpenCloseSensor.ts | 5 +- src/types/device/Outlet.ts | 5 +- src/types/device/Repeater.ts | 5 +- src/types/device/Speaker.ts | 7 +- src/types/device/WaterSensor.ts | 13 +- src/types/event/DeviceAddedEvent.ts | 4 +- .../event/DeviceConfigurationChangedEvent.ts | 6 +- src/types/event/DeviceDiscoveredEvent.ts | 2 +- src/types/event/DeviceRemovedEvent.ts | 2 +- src/types/event/DeviceSetCreatedEvent.ts | 4 +- src/types/event/DeviceSetDeletedEvent.ts | 2 +- src/types/event/DeviceSetUpdatedEvent.ts | 4 +- src/types/event/DeviceStateChangedEvent.ts | 4 +- src/types/event/Event.ts | 42 +++--- src/types/event/MusicUpdatedEvent.ts | 4 +- src/types/event/PingEvent.ts | 2 +- src/types/event/PongEvent.ts | 2 +- src/types/event/RemotePressEvent.ts | 2 +- src/types/event/RoomCreatedEvent.ts | 4 +- src/types/event/RoomDeletedEvent.ts | 2 +- src/types/event/RoomUpdatedEvent.ts | 4 +- src/types/event/SceneCompletedEvent.ts | 2 +- src/types/event/SceneCreatedEvent.ts | 4 +- src/types/event/SceneDeletedEvent.ts | 2 +- src/types/event/SceneTriggeredEvent.ts | 2 +- src/types/event/SceneUpdatedEvent.ts | 4 +- src/types/event/TerminationEvent.ts | 2 +- src/ws.ts | 11 +- test/events/deviceSetCreated.ts | 2 +- test/events/deviceSetDeleted.ts | 2 +- test/events/deviceSetUpdated.ts | 2 +- test/events/deviceStateChanged.ts | 2 +- test/events/pongEvent.ts | 2 +- test/events/remotePress.ts | 2 +- test/events/roomCreated.ts | 2 +- test/events/roomDeleted.ts | 2 +- test/events/roomUpdated.ts | 2 +- test/events/sceneCreated.ts | 2 +- test/events/sceneDeleted.ts | 2 +- test/events/sceneUpdated.ts | 2 +- test/responses/airPurifier.ts | 2 +- test/responses/blinds.ts | 2 +- test/responses/controller.ts | 2 +- test/responses/deviceSet.ts | 2 +- test/responses/environmentSensor.ts | 2 +- test/responses/home.ts | 38 ++--- test/responses/hub.ts | 2 +- test/responses/light.ts | 2 +- test/responses/lightSensor.ts | 2 +- test/responses/motionSensor.ts | 2 +- test/responses/occupancySensor.ts | 2 +- test/responses/openCloseSensor.ts | 2 +- test/responses/outlet.ts | 2 +- test/responses/repeater.ts | 2 +- test/responses/room.ts | 2 +- test/responses/scene.ts | 2 +- test/responses/speaker.ts | 2 +- test/responses/user.ts | 2 +- test/responses/waterSensor.ts | 2 +- tsconfig.json | 12 +- 96 files changed, 313 insertions(+), 302 deletions(-) diff --git a/package-lock.json b/package-lock.json index c263074..2b7840a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "dirigera": "dist/src/bin.js" }, "devDependencies": { - "@tsconfig/node20": "^20.1.8", + "@tsconfig/node24": "^24.0.4", "@tsconfig/strictest": "^2.0.8", "@types/node": "^24.10.1", "@types/ws": "^8.18.1", @@ -503,10 +503,10 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@tsconfig/node20": { - "version": "20.1.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.8.tgz", - "integrity": "sha512-Em+IdPfByIzWRRpqWL4Z7ArLHZGxmc36BxE3jCz9nBFSm+5aLaPMZyjwu4yetvyKXeogWcxik4L1jB5JTWfw7A==", + "node_modules/@tsconfig/node24": { + "version": "24.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node24/-/node24-24.0.4.tgz", + "integrity": "sha512-2A933l5P5oCbv6qSxHs7ckKwobs8BDAe9SJ/Xr2Hy+nDlwmLE1GhFh/g/vXGRZWgxBg9nX/5piDtHR9Dkw/XuA==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 479a393..3930afc 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "dirigera", "version": "1.8.1", "description": "A TypeScript client for IKEA's DIRIGERA smart home hub", + "type": "module", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", "bin": "dist/src/bin.js", @@ -40,7 +41,7 @@ "ws": "^8.21.0" }, "devDependencies": { - "@tsconfig/node20": "^20.1.8", + "@tsconfig/node24": "^24.0.4", "@tsconfig/strictest": "^2.0.8", "@types/node": "^24.10.1", "@types/ws": "^8.18.1", diff --git a/src/api/airPurifiers.ts b/src/api/airPurifiers.ts index e8ef32a..0c81a6b 100644 --- a/src/api/airPurifiers.ts +++ b/src/api/airPurifiers.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { AirPurifier } from '../types/device/AirPurifier' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { AirPurifier } from '../types/device/AirPurifier.ts' export default (got: Got) => { return { diff --git a/src/api/blinds.ts b/src/api/blinds.ts index c289bb4..c9123b9 100644 --- a/src/api/blinds.ts +++ b/src/api/blinds.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Blinds } from '../types/device/Blinds' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Blinds } from '../types/device/Blinds.ts' export default (got: Got) => { return { diff --git a/src/api/controllers.ts b/src/api/controllers.ts index 3df5ed3..d5a5374 100644 --- a/src/api/controllers.ts +++ b/src/api/controllers.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Controller, GenericSwitch } from '../types/device/Controller' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Controller, GenericSwitch } from '../types/device/Controller.ts' export default (got: Got) => { return { diff --git a/src/api/deviceSets.ts b/src/api/deviceSets.ts index 254e4c7..300720f 100644 --- a/src/api/deviceSets.ts +++ b/src/api/deviceSets.ts @@ -1,7 +1,7 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Home } from '../types/Home' -import type { DeviceSet } from '../types/DeviceSet' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Home } from '../types/Home.ts' +import type { DeviceSet } from '../types/DeviceSet.ts' export default (got: Got) => { return { diff --git a/src/api/devices.ts b/src/api/devices.ts index 27f65f7..b17a7d6 100644 --- a/src/api/devices.ts +++ b/src/api/devices.ts @@ -1,5 +1,5 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' export default (got: Got) => { return { diff --git a/src/api/environmentSensors.ts b/src/api/environmentSensors.ts index 19a6d2d..c163f3a 100644 --- a/src/api/environmentSensors.ts +++ b/src/api/environmentSensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { EnvironmentSensor } from '../types/device/EnvironmentSensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { EnvironmentSensor } from '../types/device/EnvironmentSensor.ts' export default (got: Got) => { return { diff --git a/src/api/hub.ts b/src/api/hub.ts index cf18bc9..f7a518e 100644 --- a/src/api/hub.ts +++ b/src/api/hub.ts @@ -1,5 +1,5 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Hub } from '../types/device/Hub' +import type { Got } from 'got' +import type { Hub } from '../types/device/Hub.ts' export default (got: Got) => { return { diff --git a/src/api/lightSensors.ts b/src/api/lightSensors.ts index 35ca715..9a291ff 100644 --- a/src/api/lightSensors.ts +++ b/src/api/lightSensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { LightSensor } from '../types/device/LightSensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { LightSensor } from '../types/device/LightSensor.ts' export default (got: Got) => { return { diff --git a/src/api/lights.ts b/src/api/lights.ts index 83ed5e1..f15c820 100644 --- a/src/api/lights.ts +++ b/src/api/lights.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Light } from '../types/device/Light' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Light } from '../types/device/Light.ts' export default (got: Got) => { return { diff --git a/src/api/motionSensors.ts b/src/api/motionSensors.ts index b3d907e..61197fc 100644 --- a/src/api/motionSensors.ts +++ b/src/api/motionSensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { MotionSensor } from '../types/device/MotionSensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { MotionSensor } from '../types/device/MotionSensor.ts' export default (got: Got) => { return { diff --git a/src/api/music.ts b/src/api/music.ts index 07b5028..c30f152 100644 --- a/src/api/music.ts +++ b/src/api/music.ts @@ -1,5 +1,5 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Music } from '../types/Music' +import type { Got } from 'got' +import type { Music } from '../types/Music.ts' export default (got: Got) => { return { diff --git a/src/api/occupancySensors.ts b/src/api/occupancySensors.ts index 120ac2e..0ea644b 100644 --- a/src/api/occupancySensors.ts +++ b/src/api/occupancySensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { OccupancySensor } from '../types/device/OccupancySensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { OccupancySensor } from '../types/device/OccupancySensor.ts' export default (got: Got) => { return { diff --git a/src/api/openCloseSensors.ts b/src/api/openCloseSensors.ts index 2ff2d27..d2808c5 100644 --- a/src/api/openCloseSensors.ts +++ b/src/api/openCloseSensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { OpenCloseSensor } from '../types/device/OpenCloseSensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { OpenCloseSensor } from '../types/device/OpenCloseSensor.ts' export default (got: Got) => { return { diff --git a/src/api/outlets.ts b/src/api/outlets.ts index 4b6dcdd..026638d 100644 --- a/src/api/outlets.ts +++ b/src/api/outlets.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Outlet } from '../types/device/Outlet' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Outlet } from '../types/device/Outlet.ts' export default (got: Got) => { return { diff --git a/src/api/repeaters.ts b/src/api/repeaters.ts index 21bf69a..d1b547a 100644 --- a/src/api/repeaters.ts +++ b/src/api/repeaters.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Repeater } from '../types/device/Repeater' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Repeater } from '../types/device/Repeater.ts' export default (got: Got) => { return { diff --git a/src/api/rooms.ts b/src/api/rooms.ts index 2d1e5c3..f7b95e9 100644 --- a/src/api/rooms.ts +++ b/src/api/rooms.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Room } from '../types/Room' -import type { Device } from '../types/device/Device' +import type { Got } from 'got' +import type { Room } from '../types/Room.ts' +import type { Device } from '../types/device/Device.ts' export default (got: Got) => { return { diff --git a/src/api/scenes.ts b/src/api/scenes.ts index 8cb20d6..7a7c13d 100644 --- a/src/api/scenes.ts +++ b/src/api/scenes.ts @@ -1,5 +1,5 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Scene } from '../types/Scene' +import type { Got } from 'got' +import type { Scene } from '../types/Scene.ts' export default (got: Got) => { return { diff --git a/src/api/speakers.ts b/src/api/speakers.ts index cd6d845..98a0883 100644 --- a/src/api/speakers.ts +++ b/src/api/speakers.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { Speaker } from '../types/device/Speaker' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { Speaker } from '../types/device/Speaker.ts' export default (got: Got) => { return { diff --git a/src/api/users.ts b/src/api/users.ts index 2618a10..cfe5e45 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -1,5 +1,5 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { User } from '../types/User' +import type { Got } from 'got' +import type { User } from '../types/User.ts' export default (got: Got) => { return { diff --git a/src/api/waterSensors.ts b/src/api/waterSensors.ts index 840b54e..758a8c5 100644 --- a/src/api/waterSensors.ts +++ b/src/api/waterSensors.ts @@ -1,6 +1,6 @@ -import type { Got } from 'got' with { 'resolution-mode': 'require' } -import type { Device } from '../types/device/Device' -import type { WaterSensor } from '../types/device/WaterSensor' +import type { Got } from 'got' +import type { Device } from '../types/device/Device.ts' +import type { WaterSensor } from '../types/device/WaterSensor.ts' export default (got: Got) => { return { diff --git a/src/bin.ts b/src/bin.ts index b53ff36..0febca8 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -1,11 +1,11 @@ #!/usr/bin/env node import { program } from 'commander' -import { createDirigeraClient } from './index' -import { version } from '../package.json' +import { createDirigeraClient } from './index.ts' +import packageJson from '../package.json' with { type: 'json' } program - .version(version) + .version(packageJson.version) .description( 'CLI utility to help get started with the dirigera library and to debug issues' ) diff --git a/src/index.ts b/src/index.ts index 8bb3b6c..67344b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,78 +4,79 @@ import { calculateCodeChallenge, CODE_CHALLENGE_METHOD, generateCodeVerifier, -} from './authCode' -import certificate from './certificate' -import { discoverGatewayIP } from './mdnsDiscovery' -import { closeWebSocket, initializeWebSocket } from './ws' -import type { Home } from './types/Home' -import type { Event } from './types/event/Event' -import hub from './api/hub' -import devices from './api/devices' -import lights from './api/lights' -import outlets from './api/outlets' -import controllers from './api/controllers' -import speakers from './api/speakers' -import blinds from './api/blinds' -import airPurifiers from './api/airPurifiers' -import repeaters from './api/repeaters' -import motionSensors from './api/motionSensors' -import occupancySensors from './api/occupancySensors' -import lightSensors from './api/lightSensors' -import environmentSensors from './api/environmentSensors' -import openCloseSensors from './api/openCloseSensors' -import waterSensors from './api/waterSensors' -import deviceSets from './api/deviceSets' -import rooms from './api/rooms' -import scenes from './api/scenes' -import music from './api/music' -import users from './api/users' +} from './authCode.ts' +import certificate from './certificate.ts' +import { discoverGatewayIP } from './mdnsDiscovery.ts' +import { closeWebSocket, initializeWebSocket } from './ws.ts' +import type { Home } from './types/Home.ts' +import type { Event } from './types/event/Event.ts' +import hub from './api/hub.ts' +import devices from './api/devices.ts' +import lights from './api/lights.ts' +import outlets from './api/outlets.ts' +import controllers from './api/controllers.ts' +import speakers from './api/speakers.ts' +import blinds from './api/blinds.ts' +import airPurifiers from './api/airPurifiers.ts' +import repeaters from './api/repeaters.ts' +import motionSensors from './api/motionSensors.ts' +import occupancySensors from './api/occupancySensors.ts' +import lightSensors from './api/lightSensors.ts' +import environmentSensors from './api/environmentSensors.ts' +import openCloseSensors from './api/openCloseSensors.ts' +import waterSensors from './api/waterSensors.ts' +import deviceSets from './api/deviceSets.ts' +import rooms from './api/rooms.ts' +import scenes from './api/scenes.ts' +import music from './api/music.ts' +import users from './api/users.ts' export type DirigeraClient = Awaited> -export type { AirPurifier } from './types/device/AirPurifier' -export type { Blinds } from './types/device/Blinds' -export type { Capabilities } from './types/Capabilities' -export type { Controller } from './types/device/Controller' -export type { Device } from './types/device/Device' -export type { DeviceSet } from './types/DeviceSet' -export type { EnvironmentSensor } from './types/device/EnvironmentSensor' -export type { Home } from './types/Home' -export type { Hub } from './types/device/Hub' -export type { Light } from './types/device/Light' -export type { LightSensor } from './types/device/LightSensor' -export type { MotionSensor } from './types/device/MotionSensor' -export type { Music } from './types/Music' -export type { OpenCloseSensor } from './types/device/OpenCloseSensor' -export type { Outlet } from './types/device/Outlet' -export type { Repeater } from './types/device/Repeater' -export type { Room } from './types/Room' -export type { Scene } from './types/Scene' -export type { Speaker } from './types/device/Speaker' -export type { User } from './types/User' -export type { WaterSensor } from './types/device/WaterSensor' +export type { AirPurifier } from './types/device/AirPurifier.ts' +export type { Blinds } from './types/device/Blinds.ts' +export type { Capabilities } from './types/Capabilities.ts' +export type { Controller } from './types/device/Controller.ts' +export type { Device } from './types/device/Device.ts' +export type { DeviceSet } from './types/DeviceSet.ts' +export type { EnvironmentSensor } from './types/device/EnvironmentSensor.ts' +export type { Home } from './types/Home.ts' +export type { Hub } from './types/device/Hub.ts' +export type { Light } from './types/device/Light.ts' +export type { LightSensor } from './types/device/LightSensor.ts' +export type { MotionSensor } from './types/device/MotionSensor.ts' +export type { Music } from './types/Music.ts' +export type { OccupancySensor } from './types/device/OccupancySensor.ts' +export type { OpenCloseSensor } from './types/device/OpenCloseSensor.ts' +export type { Outlet } from './types/device/Outlet.ts' +export type { Repeater } from './types/device/Repeater.ts' +export type { Room } from './types/Room.ts' +export type { Scene } from './types/Scene.ts' +export type { Speaker } from './types/device/Speaker.ts' +export type { User } from './types/User.ts' +export type { WaterSensor } from './types/device/WaterSensor.ts' -export type { Event } from './types/event/Event' -export type { DeviceAddedEvent } from './types/event/DeviceAddedEvent' -export type { DeviceConfigurationChangedEvent } from './types/event/DeviceConfigurationChangedEvent' -export type { DeviceDiscoveredEvent } from './types/event/DeviceDiscoveredEvent' -export type { DeviceRemovedEvent } from './types/event/DeviceRemovedEvent' -export type { DeviceSetCreatedEvent } from './types/event/DeviceSetCreatedEvent' -export type { DeviceSetDeletedEvent } from './types/event/DeviceSetDeletedEvent' -export type { DeviceSetUpdatedEvent } from './types/event/DeviceSetUpdatedEvent' -export type { DeviceStateChangedEvent } from './types/event/DeviceStateChangedEvent' -export type { MusicUpdatedEvent } from './types/event/MusicUpdatedEvent' -export type { PingEvent } from './types/event/PingEvent' -export type { PongEvent } from './types/event/PongEvent' -export type { RemotePressEvent } from './types/event/RemotePressEvent' -export type { RoomCreatedEvent } from './types/event/RoomCreatedEvent' -export type { RoomDeletedEvent } from './types/event/RoomDeletedEvent' -export type { RoomUpdatedEvent } from './types/event/RoomUpdatedEvent' -export type { SceneCompletedEvent } from './types/event/SceneCompletedEvent' -export type { SceneCreatedEvent } from './types/event/SceneCreatedEvent' -export type { SceneDeletedEvent } from './types/event/SceneDeletedEvent' -export type { SceneTriggeredEvent } from './types/event/SceneTriggeredEvent' -export type { SceneUpdatedEvent } from './types/event/SceneUpdatedEvent' -export type { TerminationEvent } from './types/event/TerminationEvent' +export type { Event } from './types/event/Event.ts' +export type { DeviceAddedEvent } from './types/event/DeviceAddedEvent.ts' +export type { DeviceConfigurationChangedEvent } from './types/event/DeviceConfigurationChangedEvent.ts' +export type { DeviceDiscoveredEvent } from './types/event/DeviceDiscoveredEvent.ts' +export type { DeviceRemovedEvent } from './types/event/DeviceRemovedEvent.ts' +export type { DeviceSetCreatedEvent } from './types/event/DeviceSetCreatedEvent.ts' +export type { DeviceSetDeletedEvent } from './types/event/DeviceSetDeletedEvent.ts' +export type { DeviceSetUpdatedEvent } from './types/event/DeviceSetUpdatedEvent.ts' +export type { DeviceStateChangedEvent } from './types/event/DeviceStateChangedEvent.ts' +export type { MusicUpdatedEvent } from './types/event/MusicUpdatedEvent.ts' +export type { PingEvent } from './types/event/PingEvent.ts' +export type { PongEvent } from './types/event/PongEvent.ts' +export type { RemotePressEvent } from './types/event/RemotePressEvent.ts' +export type { RoomCreatedEvent } from './types/event/RoomCreatedEvent.ts' +export type { RoomDeletedEvent } from './types/event/RoomDeletedEvent.ts' +export type { RoomUpdatedEvent } from './types/event/RoomUpdatedEvent.ts' +export type { SceneCompletedEvent } from './types/event/SceneCompletedEvent.ts' +export type { SceneCreatedEvent } from './types/event/SceneCreatedEvent.ts' +export type { SceneDeletedEvent } from './types/event/SceneDeletedEvent.ts' +export type { SceneTriggeredEvent } from './types/event/SceneTriggeredEvent.ts' +export type { SceneUpdatedEvent } from './types/event/SceneUpdatedEvent.ts' +export type { TerminationEvent } from './types/event/TerminationEvent.ts' export async function createDirigeraClient({ gatewayIP, diff --git a/src/types/Home.ts b/src/types/Home.ts index 1e027f7..aac6900 100644 --- a/src/types/Home.ts +++ b/src/types/Home.ts @@ -1,10 +1,10 @@ -import type { User } from './User' -import type { Room } from './Room' -import type { Music } from './Music' -import type { Hub } from './device/Hub' -import type { DeviceSet } from './DeviceSet' -import type { Scene } from './Scene' -import type { Device } from './device/Device' +import type { User } from './User.ts' +import type { Room } from './Room.ts' +import type { Music } from './Music.ts' +import type { Hub } from './device/Hub.ts' +import type { DeviceSet } from './DeviceSet.ts' +import type { Scene } from './Scene.ts' +import type { Device } from './device/Device.ts' export interface Home { hub: Hub diff --git a/src/types/Scene.ts b/src/types/Scene.ts index 237f3f5..fda8f21 100644 --- a/src/types/Scene.ts +++ b/src/types/Scene.ts @@ -1,4 +1,4 @@ -import type { Device } from './device/Device' +import type { Device } from './device/Device.ts' interface CommonSceneTriggerProperties { id?: string diff --git a/src/types/device/AirPurifier.ts b/src/types/device/AirPurifier.ts index 08d3c41..014c9e5 100644 --- a/src/types/device/AirPurifier.ts +++ b/src/types/device/AirPurifier.ts @@ -4,10 +4,11 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface AirPurifierAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes { diff --git a/src/types/device/Blinds.ts b/src/types/device/Blinds.ts index ff729ac..a419a67 100644 --- a/src/types/device/Blinds.ts +++ b/src/types/device/Blinds.ts @@ -3,10 +3,11 @@ import type { Device, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface BlindsAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes { batteryPercentage: number diff --git a/src/types/device/Controller.ts b/src/types/device/Controller.ts index d6ce74a..10b8472 100644 --- a/src/types/device/Controller.ts +++ b/src/types/device/Controller.ts @@ -1,10 +1,10 @@ import { - CommonDeviceAttributes, - Device, - IdentifiableDeviceAttributes, - JoinableDeviceAttributes, - OtaUpdatableDeviceAttributes, -} from './Device' + type CommonDeviceAttributes, + type Device, + type IdentifiableDeviceAttributes, + type JoinableDeviceAttributes, + type OtaUpdatableDeviceAttributes, +} from './Device.ts' export interface CommonControllerAttributes extends diff --git a/src/types/device/Device.ts b/src/types/device/Device.ts index 698d116..4b22396 100644 --- a/src/types/device/Device.ts +++ b/src/types/device/Device.ts @@ -1,18 +1,18 @@ -import type { Capabilities } from '../Capabilities' -import type { Room } from '../Room' -import type { DeviceSet } from '../DeviceSet' -import type { AirPurifierAttributes } from './AirPurifier' -import type { BlindsAttributes } from './Blinds' -import type { Controller } from './Controller' -import type { EnvironmentSensorAttributes } from './EnvironmentSensor' -import type { HubAttributes } from './Hub' -import type { LightAttributes } from './Light' -import type { LightSensorAttributes } from './LightSensor' -import type { MotionSensorAttributes } from './MotionSensor' -import type { OpenCloseSensorAttributes } from './OpenCloseSensor' -import type { OutletAttributes } from './Outlet' -import type { RepeaterAttributes } from './Repeater' -import type { SpeakerAttributes } from './Speaker' +import type { Capabilities } from '../Capabilities.ts' +import type { Room } from '../Room.ts' +import type { DeviceSet } from '../DeviceSet.ts' +import type { AirPurifierAttributes } from './AirPurifier.ts' +import type { BlindsAttributes } from './Blinds.ts' +import type { Controller } from './Controller.ts' +import type { EnvironmentSensorAttributes } from './EnvironmentSensor.ts' +import type { HubAttributes } from './Hub.ts' +import type { LightAttributes } from './Light.ts' +import type { LightSensorAttributes } from './LightSensor.ts' +import type { MotionSensorAttributes } from './MotionSensor.ts' +import type { OpenCloseSensorAttributes } from './OpenCloseSensor.ts' +import type { OutletAttributes } from './Outlet.ts' +import type { RepeaterAttributes } from './Repeater.ts' +import type { SpeakerAttributes } from './Speaker.ts' export interface CommonDeviceAttributes { customName: string diff --git a/src/types/device/EnvironmentSensor.ts b/src/types/device/EnvironmentSensor.ts index 066f319..66b38d5 100644 --- a/src/types/device/EnvironmentSensor.ts +++ b/src/types/device/EnvironmentSensor.ts @@ -4,7 +4,7 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface EnvironmentSensorAttributes extends diff --git a/src/types/device/Hub.ts b/src/types/device/Hub.ts index 3d3d0b3..b300585 100644 --- a/src/types/device/Hub.ts +++ b/src/types/device/Hub.ts @@ -4,7 +4,7 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface HubAttributes extends diff --git a/src/types/device/Light.ts b/src/types/device/Light.ts index a2fbac9..356b9de 100644 --- a/src/types/device/Light.ts +++ b/src/types/device/Light.ts @@ -4,7 +4,7 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface LightAttributes extends diff --git a/src/types/device/LightSensor.ts b/src/types/device/LightSensor.ts index 1d8faff..be8c2fd 100644 --- a/src/types/device/LightSensor.ts +++ b/src/types/device/LightSensor.ts @@ -4,7 +4,7 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface LightSensorAttributes extends diff --git a/src/types/device/MotionSensor.ts b/src/types/device/MotionSensor.ts index fd34776..4fee868 100644 --- a/src/types/device/MotionSensor.ts +++ b/src/types/device/MotionSensor.ts @@ -4,10 +4,11 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface MotionSensorAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, JoinableDeviceAttributes, Partial, Partial { diff --git a/src/types/device/OccupancySensor.ts b/src/types/device/OccupancySensor.ts index 59b7db2..3d55db3 100644 --- a/src/types/device/OccupancySensor.ts +++ b/src/types/device/OccupancySensor.ts @@ -4,7 +4,7 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface OccupancySensorAttributes extends diff --git a/src/types/device/OpenCloseSensor.ts b/src/types/device/OpenCloseSensor.ts index c5cd9ae..d71ae13 100644 --- a/src/types/device/OpenCloseSensor.ts +++ b/src/types/device/OpenCloseSensor.ts @@ -3,10 +3,11 @@ import type { Device, IdentifiableDeviceAttributes, JoinableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface OpenCloseSensorAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, IdentifiableDeviceAttributes, JoinableDeviceAttributes { isOpen: boolean diff --git a/src/types/device/Outlet.ts b/src/types/device/Outlet.ts index 4782663..dd32e69 100644 --- a/src/types/device/Outlet.ts +++ b/src/types/device/Outlet.ts @@ -4,10 +4,11 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface OutletAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes { diff --git a/src/types/device/Repeater.ts b/src/types/device/Repeater.ts index c555659..361ca53 100644 --- a/src/types/device/Repeater.ts +++ b/src/types/device/Repeater.ts @@ -4,10 +4,11 @@ import type { IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes, -} from './Device' +} from './Device.ts' export interface RepeaterAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, IdentifiableDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes {} diff --git a/src/types/device/Speaker.ts b/src/types/device/Speaker.ts index c677f65..75620e3 100644 --- a/src/types/device/Speaker.ts +++ b/src/types/device/Speaker.ts @@ -2,12 +2,11 @@ import type { CommonDeviceAttributes, Device, IdentifiableDeviceAttributes, -} from './Device' -import type { MusicPlayItem } from '../Music' +} from './Device.ts' +import type { MusicPlayItem } from '../Music.ts' export interface SpeakerAttributes - extends CommonDeviceAttributes, - IdentifiableDeviceAttributes { + extends CommonDeviceAttributes, IdentifiableDeviceAttributes { playback: | 'playbackIdle' | 'playbackPlaying' diff --git a/src/types/device/WaterSensor.ts b/src/types/device/WaterSensor.ts index 07384c9..9e440b3 100644 --- a/src/types/device/WaterSensor.ts +++ b/src/types/device/WaterSensor.ts @@ -1,12 +1,13 @@ import { - CommonDeviceAttributes, - Device, - JoinableDeviceAttributes, - OtaUpdatableDeviceAttributes, -} from './Device' + type CommonDeviceAttributes, + type Device, + type JoinableDeviceAttributes, + type OtaUpdatableDeviceAttributes, +} from './Device.ts' export interface WaterSensorAttributes - extends CommonDeviceAttributes, + extends + CommonDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes { batteryPercentage: number diff --git a/src/types/event/DeviceAddedEvent.ts b/src/types/event/DeviceAddedEvent.ts index e8b474a..f587157 100644 --- a/src/types/event/DeviceAddedEvent.ts +++ b/src/types/event/DeviceAddedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Device } from '../device/Device' +import type { CommonEventProperties } from './Event.ts' +import type { Device } from '../device/Device.ts' export type DeviceAddedEvent = { type: 'deviceAdded' diff --git a/src/types/event/DeviceConfigurationChangedEvent.ts b/src/types/event/DeviceConfigurationChangedEvent.ts index 0363e8d..d00ac43 100644 --- a/src/types/event/DeviceConfigurationChangedEvent.ts +++ b/src/types/event/DeviceConfigurationChangedEvent.ts @@ -1,6 +1,6 @@ -import type { CommonEventProperties } from './Event' -import type { Device } from '../device/Device' -import type { MotionSensorAttributes } from '../device/MotionSensor' +import type { CommonEventProperties } from './Event.ts' +import type { Device } from '../device/Device.ts' +import type { MotionSensorAttributes } from '../device/MotionSensor.ts' export type DeviceConfigurationChangedEvent = { type: 'deviceConfigurationChanged' diff --git a/src/types/event/DeviceDiscoveredEvent.ts b/src/types/event/DeviceDiscoveredEvent.ts index 6f4b40c..439a7ca 100644 --- a/src/types/event/DeviceDiscoveredEvent.ts +++ b/src/types/event/DeviceDiscoveredEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type DeviceDiscoveredEvent = { type: 'deviceDiscovered' diff --git a/src/types/event/DeviceRemovedEvent.ts b/src/types/event/DeviceRemovedEvent.ts index 17a346e..fe20e4b 100644 --- a/src/types/event/DeviceRemovedEvent.ts +++ b/src/types/event/DeviceRemovedEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type DeviceRemovedEvent = { type: 'deviceRemoved' diff --git a/src/types/event/DeviceSetCreatedEvent.ts b/src/types/event/DeviceSetCreatedEvent.ts index bf83de6..2507a97 100644 --- a/src/types/event/DeviceSetCreatedEvent.ts +++ b/src/types/event/DeviceSetCreatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { DeviceSet } from '../DeviceSet' +import type { CommonEventProperties } from './Event.ts' +import type { DeviceSet } from '../DeviceSet.ts' export type DeviceSetCreatedEvent = { type: 'deviceSetCreated' diff --git a/src/types/event/DeviceSetDeletedEvent.ts b/src/types/event/DeviceSetDeletedEvent.ts index e0783d5..89393a6 100644 --- a/src/types/event/DeviceSetDeletedEvent.ts +++ b/src/types/event/DeviceSetDeletedEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type DeviceSetDeletedEvent = { type: 'deviceSetDeleted' diff --git a/src/types/event/DeviceSetUpdatedEvent.ts b/src/types/event/DeviceSetUpdatedEvent.ts index 01536d1..2b16906 100644 --- a/src/types/event/DeviceSetUpdatedEvent.ts +++ b/src/types/event/DeviceSetUpdatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { DeviceSet } from '../DeviceSet' +import type { CommonEventProperties } from './Event.ts' +import type { DeviceSet } from '../DeviceSet.ts' export type DeviceSetUpdatedEvent = { type: 'deviceSetUpdated' diff --git a/src/types/event/DeviceStateChangedEvent.ts b/src/types/event/DeviceStateChangedEvent.ts index 4745807..5be8b00 100644 --- a/src/types/event/DeviceStateChangedEvent.ts +++ b/src/types/event/DeviceStateChangedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Device } from '../device/Device' +import type { CommonEventProperties } from './Event.ts' +import type { Device } from '../device/Device.ts' export type DeviceStateChangedEvent = { type: 'deviceStateChanged' diff --git a/src/types/event/Event.ts b/src/types/event/Event.ts index a71c314..832a7b9 100644 --- a/src/types/event/Event.ts +++ b/src/types/event/Event.ts @@ -1,24 +1,24 @@ -import type { DeviceAddedEvent } from './DeviceAddedEvent' -import type { DeviceConfigurationChangedEvent } from './DeviceConfigurationChangedEvent' -import type { DeviceDiscoveredEvent } from './DeviceDiscoveredEvent' -import type { DeviceRemovedEvent } from './DeviceRemovedEvent' -import type { DeviceSetCreatedEvent } from './DeviceSetCreatedEvent' -import type { DeviceSetDeletedEvent } from './DeviceSetDeletedEvent' -import type { DeviceSetUpdatedEvent } from './DeviceSetUpdatedEvent' -import type { DeviceStateChangedEvent } from './DeviceStateChangedEvent' -import type { MusicUpdatedEvent } from './MusicUpdatedEvent' -import type { PingEvent } from './PingEvent' -import type { PongEvent } from './PongEvent' -import type { RemotePressEvent } from './RemotePressEvent' -import type { RoomCreatedEvent } from './RoomCreatedEvent' -import type { RoomDeletedEvent } from './RoomDeletedEvent' -import type { RoomUpdatedEvent } from './RoomUpdatedEvent' -import type { SceneCompletedEvent } from './SceneCompletedEvent' -import type { SceneCreatedEvent } from './SceneCreatedEvent' -import type { SceneDeletedEvent } from './SceneDeletedEvent' -import type { SceneTriggeredEvent } from './SceneTriggeredEvent' -import type { SceneUpdatedEvent } from './SceneUpdatedEvent' -import type { TerminationEvent } from './TerminationEvent' +import type { DeviceAddedEvent } from './DeviceAddedEvent.ts' +import type { DeviceConfigurationChangedEvent } from './DeviceConfigurationChangedEvent.ts' +import type { DeviceDiscoveredEvent } from './DeviceDiscoveredEvent.ts' +import type { DeviceRemovedEvent } from './DeviceRemovedEvent.ts' +import type { DeviceSetCreatedEvent } from './DeviceSetCreatedEvent.ts' +import type { DeviceSetDeletedEvent } from './DeviceSetDeletedEvent.ts' +import type { DeviceSetUpdatedEvent } from './DeviceSetUpdatedEvent.ts' +import type { DeviceStateChangedEvent } from './DeviceStateChangedEvent.ts' +import type { MusicUpdatedEvent } from './MusicUpdatedEvent.ts' +import type { PingEvent } from './PingEvent.ts' +import type { PongEvent } from './PongEvent.ts' +import type { RemotePressEvent } from './RemotePressEvent.ts' +import type { RoomCreatedEvent } from './RoomCreatedEvent.ts' +import type { RoomDeletedEvent } from './RoomDeletedEvent.ts' +import type { RoomUpdatedEvent } from './RoomUpdatedEvent.ts' +import type { SceneCompletedEvent } from './SceneCompletedEvent.ts' +import type { SceneCreatedEvent } from './SceneCreatedEvent.ts' +import type { SceneDeletedEvent } from './SceneDeletedEvent.ts' +import type { SceneTriggeredEvent } from './SceneTriggeredEvent.ts' +import type { SceneUpdatedEvent } from './SceneUpdatedEvent.ts' +import type { TerminationEvent } from './TerminationEvent.ts' export interface CommonEventProperties { id: string diff --git a/src/types/event/MusicUpdatedEvent.ts b/src/types/event/MusicUpdatedEvent.ts index d0b5c53..ccfbfd8 100644 --- a/src/types/event/MusicUpdatedEvent.ts +++ b/src/types/event/MusicUpdatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Music } from '../Music' +import type { CommonEventProperties } from './Event.ts' +import type { Music } from '../Music.ts' export type MusicUpdatedEvent = { type: 'musicUpdated' diff --git a/src/types/event/PingEvent.ts b/src/types/event/PingEvent.ts index 1f7d349..92dabf4 100644 --- a/src/types/event/PingEvent.ts +++ b/src/types/event/PingEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type PingEvent = { type: 'ping' diff --git a/src/types/event/PongEvent.ts b/src/types/event/PongEvent.ts index db1d047..39454e6 100644 --- a/src/types/event/PongEvent.ts +++ b/src/types/event/PongEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type PongEvent = { type: 'pong' diff --git a/src/types/event/RemotePressEvent.ts b/src/types/event/RemotePressEvent.ts index 871f79f..d4794e7 100644 --- a/src/types/event/RemotePressEvent.ts +++ b/src/types/event/RemotePressEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type RemotePressEvent = { type: 'remotePressEvent' diff --git a/src/types/event/RoomCreatedEvent.ts b/src/types/event/RoomCreatedEvent.ts index 019e98b..d9a0788 100644 --- a/src/types/event/RoomCreatedEvent.ts +++ b/src/types/event/RoomCreatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Room } from '../Room' +import type { CommonEventProperties } from './Event.ts' +import type { Room } from '../Room.ts' export type RoomCreatedEvent = { type: 'roomCreated' diff --git a/src/types/event/RoomDeletedEvent.ts b/src/types/event/RoomDeletedEvent.ts index 166d56e..fd588d4 100644 --- a/src/types/event/RoomDeletedEvent.ts +++ b/src/types/event/RoomDeletedEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type RoomDeletedEvent = { type: 'roomDeleted' diff --git a/src/types/event/RoomUpdatedEvent.ts b/src/types/event/RoomUpdatedEvent.ts index 8c7a250..61d32e2 100644 --- a/src/types/event/RoomUpdatedEvent.ts +++ b/src/types/event/RoomUpdatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Room } from '../Room' +import type { CommonEventProperties } from './Event.ts' +import type { Room } from '../Room.ts' export type RoomUpdatedEvent = { type: 'roomUpdated' diff --git a/src/types/event/SceneCompletedEvent.ts b/src/types/event/SceneCompletedEvent.ts index fe700f4..9fdc500 100644 --- a/src/types/event/SceneCompletedEvent.ts +++ b/src/types/event/SceneCompletedEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type SceneCompletedEvent = { type: 'sceneCompleted' diff --git a/src/types/event/SceneCreatedEvent.ts b/src/types/event/SceneCreatedEvent.ts index 72db2e7..fe82b88 100644 --- a/src/types/event/SceneCreatedEvent.ts +++ b/src/types/event/SceneCreatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Scene } from '../Scene' +import type { CommonEventProperties } from './Event.ts' +import type { Scene } from '../Scene.ts' export type SceneCreatedEvent = { type: 'sceneCreated' diff --git a/src/types/event/SceneDeletedEvent.ts b/src/types/event/SceneDeletedEvent.ts index fe93d7e..a27add2 100644 --- a/src/types/event/SceneDeletedEvent.ts +++ b/src/types/event/SceneDeletedEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type SceneDeletedEvent = { type: 'sceneDeleted' diff --git a/src/types/event/SceneTriggeredEvent.ts b/src/types/event/SceneTriggeredEvent.ts index a8a1183..5604651 100644 --- a/src/types/event/SceneTriggeredEvent.ts +++ b/src/types/event/SceneTriggeredEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type SceneTriggeredEvent = { type: 'sceneTriggered' diff --git a/src/types/event/SceneUpdatedEvent.ts b/src/types/event/SceneUpdatedEvent.ts index 403d6af..3f3947c 100644 --- a/src/types/event/SceneUpdatedEvent.ts +++ b/src/types/event/SceneUpdatedEvent.ts @@ -1,5 +1,5 @@ -import type { CommonEventProperties } from './Event' -import type { Scene } from '../Scene' +import type { CommonEventProperties } from './Event.ts' +import type { Scene } from '../Scene.ts' export type SceneUpdatedEvent = { type: 'sceneUpdated' diff --git a/src/types/event/TerminationEvent.ts b/src/types/event/TerminationEvent.ts index 71d24e9..43d16b7 100644 --- a/src/types/event/TerminationEvent.ts +++ b/src/types/event/TerminationEvent.ts @@ -1,4 +1,4 @@ -import type { CommonEventProperties } from './Event' +import type { CommonEventProperties } from './Event.ts' export type TerminationEvent = { type: 'termination' diff --git a/src/ws.ts b/src/ws.ts index 8ee7f5a..d28bf5a 100644 --- a/src/ws.ts +++ b/src/ws.ts @@ -1,9 +1,9 @@ import crypto from 'node:crypto' import ReconnectingWebSocket from 'reconnecting-websocket' import WebSocket from 'ws' -import type { Event } from './types/event/Event' +import type { Event } from './types/event/Event.ts' -let ws: ReconnectingWebSocket | null = null +let ws: ReconnectingWebSocket.default | null = null let timeout: NodeJS.Timeout | null = null export function initializeWebSocket({ @@ -15,7 +15,8 @@ export function initializeWebSocket({ accessToken: string callback: (o: Event) => void | Promise }) { - ws = new ReconnectingWebSocket(`wss://${ip}:8443/v1`, [], { + // https://github.com/pladaria/reconnecting-websocket/issues/196 + ws = new (ReconnectingWebSocket as any)(`wss://${ip}:8443/v1`, [], { minReconnectionDelay: 10, maxReconnectionDelay: 10000, maxRetries: Number.MAX_SAFE_INTEGER, @@ -30,9 +31,9 @@ export function initializeWebSocket({ } }, debug: process.env['NODE_ENV'] === 'development', - }) + }) as ReconnectingWebSocket.default - ws.addEventListener('message', (message) => { + ws.addEventListener('message', (message: MessageEvent) => { callback(JSON.parse(String(message.data))) }) diff --git a/test/events/deviceSetCreated.ts b/test/events/deviceSetCreated.ts index a543544..b5e5c3d 100644 --- a/test/events/deviceSetCreated.ts +++ b/test/events/deviceSetCreated.ts @@ -1,4 +1,4 @@ -import type { DeviceSetCreatedEvent } from '../../src' +import type { DeviceSetCreatedEvent } from '../../src/index.ts' const event: DeviceSetCreatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/deviceSetDeleted.ts b/test/events/deviceSetDeleted.ts index aa7a204..8030be3 100644 --- a/test/events/deviceSetDeleted.ts +++ b/test/events/deviceSetDeleted.ts @@ -1,4 +1,4 @@ -import type { DeviceSetDeletedEvent } from '../../src' +import type { DeviceSetDeletedEvent } from '../../src/index.ts' const event: DeviceSetDeletedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/deviceSetUpdated.ts b/test/events/deviceSetUpdated.ts index 7c05068..f0cc134 100644 --- a/test/events/deviceSetUpdated.ts +++ b/test/events/deviceSetUpdated.ts @@ -1,4 +1,4 @@ -import type { DeviceSetUpdatedEvent } from '../../src' +import type { DeviceSetUpdatedEvent } from '../../src/index.ts' const event: DeviceSetUpdatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/deviceStateChanged.ts b/test/events/deviceStateChanged.ts index c3ab70d..67e3c7f 100644 --- a/test/events/deviceStateChanged.ts +++ b/test/events/deviceStateChanged.ts @@ -1,4 +1,4 @@ -import type { DeviceStateChangedEvent } from '../../src' +import type { DeviceStateChangedEvent } from '../../src/index.ts' const event1: DeviceStateChangedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/pongEvent.ts b/test/events/pongEvent.ts index 9a234cb..335e687 100644 --- a/test/events/pongEvent.ts +++ b/test/events/pongEvent.ts @@ -1,4 +1,4 @@ -import type { PongEvent } from '../../src' +import type { PongEvent } from '../../src/index.ts' const event: PongEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/remotePress.ts b/test/events/remotePress.ts index 0ea5c1e..c8025a7 100644 --- a/test/events/remotePress.ts +++ b/test/events/remotePress.ts @@ -1,4 +1,4 @@ -import type { RemotePressEvent } from '../../src' +import type { RemotePressEvent } from '../../src/index.ts' const singlePressEvent: RemotePressEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/roomCreated.ts b/test/events/roomCreated.ts index cd8425e..7413cbf 100644 --- a/test/events/roomCreated.ts +++ b/test/events/roomCreated.ts @@ -1,4 +1,4 @@ -import type { RoomCreatedEvent } from '../../src' +import type { RoomCreatedEvent } from '../../src/index.ts' const event: RoomCreatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/roomDeleted.ts b/test/events/roomDeleted.ts index 3b941a2..c4e655b 100644 --- a/test/events/roomDeleted.ts +++ b/test/events/roomDeleted.ts @@ -1,4 +1,4 @@ -import type { RoomDeletedEvent } from '../../src' +import type { RoomDeletedEvent } from '../../src/index.ts' const event: RoomDeletedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/roomUpdated.ts b/test/events/roomUpdated.ts index df472bd..8272113 100644 --- a/test/events/roomUpdated.ts +++ b/test/events/roomUpdated.ts @@ -1,4 +1,4 @@ -import type { RoomUpdatedEvent } from '../../src' +import type { RoomUpdatedEvent } from '../../src/index.ts' const event: RoomUpdatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/sceneCreated.ts b/test/events/sceneCreated.ts index b0d69f8..62cbdd7 100644 --- a/test/events/sceneCreated.ts +++ b/test/events/sceneCreated.ts @@ -1,4 +1,4 @@ -import type { SceneCreatedEvent } from '../../src' +import type { SceneCreatedEvent } from '../../src/index.ts' const event: SceneCreatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/sceneDeleted.ts b/test/events/sceneDeleted.ts index af2cc9a..d09be15 100644 --- a/test/events/sceneDeleted.ts +++ b/test/events/sceneDeleted.ts @@ -1,4 +1,4 @@ -import type { SceneDeletedEvent } from '../../src' +import type { SceneDeletedEvent } from '../../src/index.ts' const event: SceneDeletedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/events/sceneUpdated.ts b/test/events/sceneUpdated.ts index 3547a16..45dd327 100644 --- a/test/events/sceneUpdated.ts +++ b/test/events/sceneUpdated.ts @@ -1,4 +1,4 @@ -import type { SceneUpdatedEvent } from '../../src' +import type { SceneUpdatedEvent } from '../../src/index.ts' const event: SceneUpdatedEvent = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/airPurifier.ts b/test/responses/airPurifier.ts index 4fc2c36..d218e1d 100644 --- a/test/responses/airPurifier.ts +++ b/test/responses/airPurifier.ts @@ -1,4 +1,4 @@ -import type { AirPurifier } from '../../src' +import type { AirPurifier } from '../../src/index.ts' export const airPurifier: AirPurifier = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/blinds.ts b/test/responses/blinds.ts index b27c739..d3e0b7e 100644 --- a/test/responses/blinds.ts +++ b/test/responses/blinds.ts @@ -1,4 +1,4 @@ -import type { Blinds } from '../../src' +import type { Blinds } from '../../src/index.ts' export const blinds: Blinds = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/controller.ts b/test/responses/controller.ts index 671cf4e..d7e63ac 100644 --- a/test/responses/controller.ts +++ b/test/responses/controller.ts @@ -1,4 +1,4 @@ -import type { Controller } from '../../src' +import type { Controller } from '../../src/index.ts' export const lightController: Controller = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/deviceSet.ts b/test/responses/deviceSet.ts index fb744ec..3be0f3a 100644 --- a/test/responses/deviceSet.ts +++ b/test/responses/deviceSet.ts @@ -1,4 +1,4 @@ -import type { DeviceSet } from '../../src' +import type { DeviceSet } from '../../src/index.ts' export const deviceSet: DeviceSet = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/environmentSensor.ts b/test/responses/environmentSensor.ts index 4b12f74..8b8a9bd 100644 --- a/test/responses/environmentSensor.ts +++ b/test/responses/environmentSensor.ts @@ -1,4 +1,4 @@ -import type { EnvironmentSensor } from '../../src' +import type { EnvironmentSensor } from '../../src/index.ts' export const environmentSensor1: EnvironmentSensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/home.ts b/test/responses/home.ts index ce7fdc6..eb4d0ff 100644 --- a/test/responses/home.ts +++ b/test/responses/home.ts @@ -1,32 +1,33 @@ -import type { Home } from '../../src' -import { hub } from './hub' -import { airPurifier } from './airPurifier' -import { blinds } from './blinds' +import type { Home } from '../../src/index.ts' +import { hub } from './hub.ts' +import { airPurifier } from './airPurifier.ts' +import { blinds } from './blinds.ts' import { lightController, shortcutController, blindsController, scrollWheelController, dualButtonController, -} from './controller' +} from './controller.ts' import { environmentSensor1, environmentSensor2, environmentSensor3, environmentSensor4, -} from './environmentSensor' -import { colorTemperatureLight, dimmableLight, rgbLight } from './light' -import { lightSensor1, lightSensor2 } from './lightSensor' -import { motionSensor1, motionSensor2 } from './motionSensor' -import { occupancySensor } from './occupancySensor' -import { outlet1, outlet2 } from './outlet' -import { repeater } from './repeater' -import { speaker } from './speaker' -import { waterSensor } from './waterSensor' -import { hostUser, memberUser } from './user' -import { scene1, scene2 } from './scene' -import { room } from './room' -import { deviceSet } from './deviceSet' +} from './environmentSensor.ts' +import { colorTemperatureLight, dimmableLight, rgbLight } from './light.ts' +import { lightSensor1, lightSensor2 } from './lightSensor.ts' +import { motionSensor1, motionSensor2 } from './motionSensor.ts' +import { occupancySensor } from './occupancySensor.ts' +import { outlet1, outlet2 } from './outlet.ts' +import { openCloseSensor } from './openCloseSensor.ts' +import { repeater } from './repeater.ts' +import { speaker } from './speaker.ts' +import { waterSensor } from './waterSensor.ts' +import { hostUser, memberUser } from './user.ts' +import { scene1, scene2 } from './scene.ts' +import { room } from './room.ts' +import { deviceSet } from './deviceSet.ts' const home: Home = { hub, @@ -53,6 +54,7 @@ const home: Home = { occupancySensor, outlet1, outlet2, + openCloseSensor, repeater, speaker, waterSensor, diff --git a/test/responses/hub.ts b/test/responses/hub.ts index 183aa90..8d4884c 100644 --- a/test/responses/hub.ts +++ b/test/responses/hub.ts @@ -1,4 +1,4 @@ -import type { Hub } from '../../src' +import type { Hub } from '../../src/index.ts' export const hub: Hub = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/light.ts b/test/responses/light.ts index 5a6f299..094f095 100644 --- a/test/responses/light.ts +++ b/test/responses/light.ts @@ -1,4 +1,4 @@ -import type { Light } from '../../src' +import type { Light } from '../../src/index.ts' export const rgbLight: Light = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/lightSensor.ts b/test/responses/lightSensor.ts index bc2b2cd..ff4765a 100644 --- a/test/responses/lightSensor.ts +++ b/test/responses/lightSensor.ts @@ -1,4 +1,4 @@ -import { LightSensor } from '../../src/types/device/LightSensor' +import { type LightSensor } from '../../src/index.ts' export const lightSensor1: LightSensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/motionSensor.ts b/test/responses/motionSensor.ts index f720b73..b46aee0 100644 --- a/test/responses/motionSensor.ts +++ b/test/responses/motionSensor.ts @@ -1,4 +1,4 @@ -import type { MotionSensor } from '../../src' +import type { MotionSensor } from '../../src/index.ts' export const motionSensor1: MotionSensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/occupancySensor.ts b/test/responses/occupancySensor.ts index 02ccbd9..7fa65a3 100644 --- a/test/responses/occupancySensor.ts +++ b/test/responses/occupancySensor.ts @@ -1,4 +1,4 @@ -import { OccupancySensor } from '../../src/types/device/OccupancySensor' +import { type OccupancySensor } from '../../src/index.ts' export const occupancySensor: OccupancySensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/openCloseSensor.ts b/test/responses/openCloseSensor.ts index f32176c..9d7fb63 100644 --- a/test/responses/openCloseSensor.ts +++ b/test/responses/openCloseSensor.ts @@ -1,4 +1,4 @@ -import type { OpenCloseSensor } from '../../src' +import type { OpenCloseSensor } from '../../src/index.ts' export const openCloseSensor: OpenCloseSensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/outlet.ts b/test/responses/outlet.ts index 2806eb5..6d1ef18 100644 --- a/test/responses/outlet.ts +++ b/test/responses/outlet.ts @@ -1,4 +1,4 @@ -import type { Outlet } from '../../src' +import type { Outlet } from '../../src/index.ts' export const outlet1: Outlet = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/repeater.ts b/test/responses/repeater.ts index 75907ad..4e05be3 100644 --- a/test/responses/repeater.ts +++ b/test/responses/repeater.ts @@ -1,4 +1,4 @@ -import type { Repeater } from '../../src' +import type { Repeater } from '../../src/index.ts' export const repeater: Repeater = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/room.ts b/test/responses/room.ts index 71a609b..d7ec012 100644 --- a/test/responses/room.ts +++ b/test/responses/room.ts @@ -1,4 +1,4 @@ -import type { Room } from '../../src' +import type { Room } from '../../src/index.ts' export const room: Room = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/scene.ts b/test/responses/scene.ts index 0266a2d..3473894 100644 --- a/test/responses/scene.ts +++ b/test/responses/scene.ts @@ -1,4 +1,4 @@ -import type { Scene } from '../../src' +import type { Scene } from '../../src/index.ts' export const scene1: Scene = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/speaker.ts b/test/responses/speaker.ts index 8e9c5ab..20c4cc9 100644 --- a/test/responses/speaker.ts +++ b/test/responses/speaker.ts @@ -1,4 +1,4 @@ -import type { Speaker } from '../../src' +import type { Speaker } from '../../src/index.ts' export const speaker: Speaker = { id: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/user.ts b/test/responses/user.ts index 2c3f72e..988f539 100644 --- a/test/responses/user.ts +++ b/test/responses/user.ts @@ -1,4 +1,4 @@ -import type { User } from '../../src' +import type { User } from '../../src/index.ts' export const memberUser: User = { uid: '00000000-0000-0000-0000-000000000000', diff --git a/test/responses/waterSensor.ts b/test/responses/waterSensor.ts index f82fb1b..ec1bef5 100644 --- a/test/responses/waterSensor.ts +++ b/test/responses/waterSensor.ts @@ -1,4 +1,4 @@ -import type { WaterSensor } from '../../src' +import type { WaterSensor } from '../../src/index.ts' export const waterSensor: WaterSensor = { id: '00000000-0000-0000-0000-000000000000', diff --git a/tsconfig.json b/tsconfig.json index 428ae6c..6455257 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,14 @@ { - "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node20/tsconfig"], + "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node24/tsconfig"], "exclude": ["test", "dist"], "compilerOptions": { - "verbatimModuleSyntax": false, - "moduleResolution": "node16", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "erasableSyntaxOnly": true, + "esModuleInterop": true, + "moduleResolution": "NodeNext", "declaration": true, "outDir": "dist", "resolveJsonModule": true - }, - "ts-node": { - "files": true } } From 165a5aff215606f7fc3959ec7d4733b94e32f600 Mon Sep 17 00:00:00 2001 From: GerA Date: Tue, 2 Jun 2026 22:44:40 +0200 Subject: [PATCH 02/10] update dependencies --- package-lock.json | 195 +++++++++++++++++++++++++++------------------- package.json | 12 +-- src/index.ts | 3 +- 3 files changed, 121 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b7840a..842dd37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,10 @@ "version": "1.8.1", "license": "MIT", "dependencies": { - "commander": "^14.0.2", - "got": "^14.6.6", + "commander": "^15.0.0", + "got": "^15.0.5", "mdns-server": "^1.0.11", - "p-retry": "^7.1.1", + "p-retry": "^8.0.0", "reconnecting-websocket": "^4.4.0", "ws": "^8.21.0" }, @@ -22,11 +22,11 @@ "devDependencies": { "@tsconfig/node24": "^24.0.4", "@tsconfig/strictest": "^2.0.8", - "@types/node": "^24.10.1", + "@types/node": "^25.9.1", "@types/ws": "^8.18.1", "husky": "^9.1.7", - "lint-staged": "^17.0.8", - "prettier": "^3.9.1", + "lint-staged": "^17.0.7", + "prettier": "^3.8.3", "tsx": "^4.22.4", "typescript": "^6.0.3" } @@ -492,12 +492,12 @@ "license": "MIT" }, "node_modules/@sindresorhus/is": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", - "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-8.1.0.tgz", + "integrity": "sha512-2SX/1jW6CIMAiebvVv5ZInoCEuWQmMyBoJXXGC6Vjakjp/fpxP5eHs7/V6WKuPEIbuK06+VpjH+vjLQhr98rDQ==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=22" }, "funding": { "url": "https://github.com/sindresorhus/is?sponsor=1" @@ -518,19 +518,19 @@ "license": "MIT" }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==", "license": "MIT" }, "node_modules/@types/node": { - "version": "24.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", - "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "version": "25.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.4.tgz", + "integrity": "sha512-dszCsrKb5U7ZsVZBWiHFklTloVl0mSEnWH/iZXfZUlI4rzCUnsvGmgqfuVRHL54ugE7/wRuxEIXRa2iMZ+BG6g==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~7.16.0" + "undici-types": ">=7.24.0 <7.24.7" } }, "node_modules/@types/ws": { @@ -607,23 +607,35 @@ } }, "node_modules/cacheable-request": { - "version": "13.0.15", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-13.0.15.tgz", - "integrity": "sha512-NjiSrjv37X73FmGGU5ec/M83vWQ6q1Ae3BFe+ABfdeeMy4LOMKYTpfEjrBnLedu43clKZtsYbKrHTIQE7vKq+A==", + "version": "13.0.19", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-13.0.19.tgz", + "integrity": "sha512-SVXGH037+Mo1aIMO5B2UcleR43FGjFdN+M8JObSyEoQ2Mn4CODRWx28gN5jiTF0n5ItsgtIZfyargMNs8GX4kg==", "license": "MIT", "dependencies": { - "@types/http-cache-semantics": "^4.0.4", + "@types/http-cache-semantics": "^4.2.0", "get-stream": "^9.0.1", "http-cache-semantics": "^4.2.0", - "keyv": "^5.5.4", + "keyv": "^5.6.0", "mimic-response": "^4.0.0", - "normalize-url": "^8.1.0", + "normalize-url": "^8.1.1", "responselike": "^4.0.2" }, "engines": { "node": ">=18" } }, + "node_modules/chunk-data": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/chunk-data/-/chunk-data-0.1.0.tgz", + "integrity": "sha512-zFyPtyC0SZ6Zu79b9sOYtXZcgrsXe0RpePrzRyj52hYVFG1+Rk6rBqjjOEk+GNQwc3PIX+86teQMok970pod1g==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-cursor": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", @@ -658,12 +670,12 @@ } }, "node_modules/commander": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", - "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz", + "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.12.0" } }, "node_modules/decompress-response": { @@ -762,15 +774,6 @@ "dev": true, "license": "MIT" }, - "node_modules/form-data-encoder": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", - "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==", - "license": "MIT", - "engines": { - "node": ">= 18" - } - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -816,26 +819,26 @@ } }, "node_modules/got": { - "version": "14.6.6", - "resolved": "https://registry.npmjs.org/got/-/got-14.6.6.tgz", - "integrity": "sha512-QLV1qeYSo5l13mQzWgP/y0LbMr5Plr5fJilgAIwgnwseproEbtNym8xpLsDzeZ6MWXgNE6kdWGBjdh3zT/Qerg==", + "version": "15.0.7", + "resolved": "https://registry.npmjs.org/got/-/got-15.0.7.tgz", + "integrity": "sha512-HA4XUhL2xk0/sA4l3zRyOzfqPtDEiVYpzDae56WLX2aHZYF6v6hjTnuDvURIdznSTPFYW1JUdlREhZjGAF9LCQ==", "license": "MIT", "dependencies": { - "@sindresorhus/is": "^7.0.1", + "@sindresorhus/is": "^8.0.0", "byte-counter": "^0.1.0", "cacheable-lookup": "^7.0.0", - "cacheable-request": "^13.0.12", + "cacheable-request": "^13.0.18", + "chunk-data": "^0.1.0", "decompress-response": "^10.0.0", - "form-data-encoder": "^4.0.2", "http2-wrapper": "^2.2.1", - "keyv": "^5.5.3", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^4.0.1", + "keyv": "^5.6.0", + "lowercase-keys": "^4.0.1", "responselike": "^4.0.2", - "type-fest": "^4.26.1" + "type-fest": "^5.6.0", + "uint8array-extras": "^1.5.0" }, "engines": { - "node": ">=20" + "node": ">=22" }, "funding": { "url": "https://github.com/sindresorhus/got?sponsor=1" @@ -893,9 +896,9 @@ } }, "node_modules/is-network-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", - "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.3.2.tgz", + "integrity": "sha512-PhBY86zaxNZUuWP6h13Vu5oFe0XY6/UlKzQnYFELzGVHygP3MxmvTfYSG7GN3aIab/iWudSMgjSnG9Dq+nHrgA==", "license": "MIT", "engines": { "node": ">=16" @@ -917,9 +920,9 @@ } }, "node_modules/keyv": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.4.tgz", - "integrity": "sha512-eohl3hKTiVyD1ilYdw9T0OiB4hnjef89e3dMYKz+mVKDzj+5IteTseASUsOB+EU9Tf6VNTCjDePcP6wkDGmLKQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", + "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", "license": "MIT", "dependencies": { "@keyv/serialize": "^1.1.1" @@ -1041,12 +1044,12 @@ } }, "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-4.0.1.tgz", + "integrity": "sha512-wI9Nui/L8VfADa/cr/7NQruaASk1k23/Uh1khQ02BCVYiiy8F4AhOGnQzJy3Fl/c44GnYSbZHv8g7EcG3kJ1Qg==", "license": "MIT", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1087,9 +1090,9 @@ } }, "node_modules/normalize-url": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.1.0.tgz", - "integrity": "sha512-X06Mfd/5aKsRHc0O0J5CUedwnPmnDtLF2+nq+KN9KSDlJHkPuh0JUviWjEWMe0SW/9TDdSLVPuk7L5gGTIA1/w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.1.1.tgz", + "integrity": "sha512-JYc0DPlpGWB40kH5g07gGTrYuMqV653k3uBKY6uITPWds3M0ov3GaWGp9lbE3Bzngx8+XkfzgvASb9vk9JDFXQ==", "license": "MIT", "engines": { "node": ">=14.16" @@ -1114,25 +1117,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-cancelable": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", - "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==", - "license": "MIT", - "engines": { - "node": ">=14.16" - } - }, "node_modules/p-retry": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-7.1.1.tgz", - "integrity": "sha512-J5ApzjyRkkf601HpEeykoiCvzHQjWxPAHhyjFcEUP2SWq0+35NKh8TLhpLw+Dkq5TZBFvUM6UigdE9hIVYTl5w==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-8.0.0.tgz", + "integrity": "sha512-kFVqH1HxOHp8LupNsOys7bSV09VYTRLxarH/mokO4Rqhk6wGi70E0jh4VzvVGXfEVNggHoHLAMWsQqHyU1Ey9A==", "license": "MIT", "dependencies": { - "is-network-error": "^1.1.0" + "is-network-error": "^1.3.0" }, "engines": { - "node": ">=20" + "node": ">=22" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1206,6 +1200,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/responselike/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/restore-cursor": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", @@ -1303,6 +1309,18 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tinyexec": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", @@ -1333,12 +1351,15 @@ } }, "node_modules/type-fest": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.30.0.tgz", - "integrity": "sha512-G6zXWS1dLj6eagy6sVhOMQiLtJdxQBHIA9Z6HFUNLOlr6MFOgzV8wvmidtPONfPtEUv0uZsy77XJNzTAfwPDaA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.7.0.tgz", + "integrity": "sha512-1URUxUqfHFM1c+zfSPsa3gnkO7Aq21qyH75SIduNYz4SzY964rn1X2vCMQaHSHhktiw+0kPa2iyb6PUpXqB6Vg==", "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, "engines": { - "node": ">=16" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1358,10 +1379,22 @@ "node": ">=14.17" } }, + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 3930afc..f097444 100644 --- a/package.json +++ b/package.json @@ -33,21 +33,21 @@ }, "homepage": "https://github.com/lpgera/dirigera#readme", "dependencies": { - "commander": "^14.0.2", - "got": "^14.6.6", + "commander": "^15.0.0", + "got": "^15.0.5", "mdns-server": "^1.0.11", - "p-retry": "^7.1.1", + "p-retry": "^8.0.0", "reconnecting-websocket": "^4.4.0", "ws": "^8.21.0" }, "devDependencies": { "@tsconfig/node24": "^24.0.4", "@tsconfig/strictest": "^2.0.8", - "@types/node": "^24.10.1", + "@types/node": "^25.9.1", "@types/ws": "^8.18.1", "husky": "^9.1.7", - "lint-staged": "^17.0.8", - "prettier": "^3.9.1", + "lint-staged": "^17.0.7", + "prettier": "^3.8.3", "tsx": "^4.22.4", "typescript": "^6.0.3" }, diff --git a/src/index.ts b/src/index.ts index 67344b0..bcd4c17 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import os from 'node:os' import { Agent } from 'node:https' +import got from 'got' import { calculateCodeChallenge, CODE_CHALLENGE_METHOD, @@ -89,8 +90,6 @@ export async function createDirigeraClient({ } = {}) { const ip = gatewayIP ?? (await discoverGatewayIP()) - const { got } = await import('got') - const gotInstance = got.extend({ prefixUrl: `https://${ip}:8443/v1`, headers: { From c3037ba042df90ee2a1488d585a35ddbf6220b0f Mon Sep 17 00:00:00 2001 From: GerA Date: Tue, 2 Jun 2026 22:47:35 +0200 Subject: [PATCH 03/10] remove unnecessary tsx dependency --- package-lock.json | 519 ---------------------------------------------- package.json | 1 - 2 files changed, 520 deletions(-) diff --git a/package-lock.json b/package-lock.json index 842dd37..272c867 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,452 +27,9 @@ "husky": "^9.1.7", "lint-staged": "^17.0.7", "prettier": "^3.8.3", - "tsx": "^4.22.4", "typescript": "^6.0.3" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@keyv/serialize": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", @@ -725,48 +282,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" - } - }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", @@ -774,21 +289,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/get-east-asian-width": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", @@ -1331,25 +831,6 @@ "node": ">=18" } }, - "node_modules/tsx": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz", - "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.28.0" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/type-fest": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.7.0.tgz", diff --git a/package.json b/package.json index f097444..8c58198 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "husky": "^9.1.7", "lint-staged": "^17.0.7", "prettier": "^3.8.3", - "tsx": "^4.22.4", "typescript": "^6.0.3" }, "volta": { From d41c4839c0a1b22c7b79b58c6a672e6b0c951a5b Mon Sep 17 00:00:00 2001 From: GerA Date: Tue, 2 Jun 2026 22:48:10 +0200 Subject: [PATCH 04/10] update volta node version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c58198..6e3e491 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "typescript": "^6.0.3" }, "volta": { - "node": "24.12.0" + "node": "24.16.0" }, "lint-staged": { "*.{ts,md,json}": "prettier --write" From 13395279fc5b8c73070fc524dcd70c18372dc612 Mon Sep 17 00:00:00 2001 From: GerA Date: Wed, 3 Jun 2026 18:01:12 +0200 Subject: [PATCH 05/10] remove unnecessary explicit type --- src/ws.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ws.ts b/src/ws.ts index d28bf5a..2cf0359 100644 --- a/src/ws.ts +++ b/src/ws.ts @@ -33,7 +33,7 @@ export function initializeWebSocket({ debug: process.env['NODE_ENV'] === 'development', }) as ReconnectingWebSocket.default - ws.addEventListener('message', (message: MessageEvent) => { + ws.addEventListener('message', (message) => { callback(JSON.parse(String(message.data))) }) From 2d37593d94cbe9b8820eba97d8aa86b9e28beb75 Mon Sep 17 00:00:00 2001 From: GerA Date: Wed, 3 Jun 2026 18:06:30 +0200 Subject: [PATCH 06/10] switch to @tsconfig/node22 --- package-lock.json | 10 +++++----- package.json | 2 +- tsconfig.json | 4 +--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 272c867..e5ac2b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "dirigera": "dist/src/bin.js" }, "devDependencies": { - "@tsconfig/node24": "^24.0.4", + "@tsconfig/node22": "^22.0.5", "@tsconfig/strictest": "^2.0.8", "@types/node": "^25.9.1", "@types/ws": "^8.18.1", @@ -60,10 +60,10 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@tsconfig/node24": { - "version": "24.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node24/-/node24-24.0.4.tgz", - "integrity": "sha512-2A933l5P5oCbv6qSxHs7ckKwobs8BDAe9SJ/Xr2Hy+nDlwmLE1GhFh/g/vXGRZWgxBg9nX/5piDtHR9Dkw/XuA==", + "node_modules/@tsconfig/node22": { + "version": "22.0.5", + "resolved": "https://registry.npmjs.org/@tsconfig/node22/-/node22-22.0.5.tgz", + "integrity": "sha512-hLf2ld+sYN/BtOJjHUWOk568dvjFQkHnLNa6zce25GIH+vxKfvTgm3qpaH6ToF5tu/NN0IH66s+Bb5wElHrLcw==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 6e3e491..49e7fc8 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "ws": "^8.21.0" }, "devDependencies": { - "@tsconfig/node24": "^24.0.4", + "@tsconfig/node22": "^22.0.5", "@tsconfig/strictest": "^2.0.8", "@types/node": "^25.9.1", "@types/ws": "^8.18.1", diff --git a/tsconfig.json b/tsconfig.json index 6455257..c5078cc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,10 @@ { - "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node24/tsconfig"], + "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node22/tsconfig"], "exclude": ["test", "dist"], "compilerOptions": { "allowImportingTsExtensions": true, "rewriteRelativeImportExtensions": true, "erasableSyntaxOnly": true, - "esModuleInterop": true, - "moduleResolution": "NodeNext", "declaration": true, "outDir": "dist", "resolveJsonModule": true From a85d62c87be8fa85b4c547c2dff3b9f51f9cb896 Mon Sep 17 00:00:00 2001 From: GerA Date: Wed, 3 Jun 2026 18:13:34 +0200 Subject: [PATCH 07/10] add node version to package.json engines --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 49e7fc8..55729e9 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,9 @@ "prettier": "^3.8.3", "typescript": "^6.0.3" }, + "engines": { + "node": ">=22" + }, "volta": { "node": "24.16.0" }, From ccc29bd33c330bba8913528771dbbdcf4b3cf817 Mon Sep 17 00:00:00 2001 From: GerA Date: Wed, 17 Jun 2026 11:12:05 +0200 Subject: [PATCH 08/10] move p-retry to regular import --- src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index bcd4c17..991406b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import os from 'node:os' import { Agent } from 'node:https' import got from 'got' +import pRetry from 'p-retry' import { calculateCodeChallenge, CODE_CHALLENGE_METHOD, @@ -139,8 +140,6 @@ export async function createDirigeraClient({ }) .json() - const { default: pRetry } = await import('p-retry') - if (verbose) { console.log( 'Press the Action Button on the bottom of your Dirigera Hub within 60 seconds.' From 9bbccc70ec544c82e857a505224cec7fff990a37 Mon Sep 17 00:00:00 2001 From: GerA Date: Sun, 28 Jun 2026 20:12:38 +0200 Subject: [PATCH 09/10] update dependencies --- package-lock.json | 9 ++++++--- package.json | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5ac2b5..c130fda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "commander": "^15.0.0", - "got": "^15.0.5", + "got": "^15.0.7", "mdns-server": "^1.0.11", "p-retry": "^8.0.0", "reconnecting-websocket": "^4.4.0", @@ -25,9 +25,12 @@ "@types/node": "^25.9.1", "@types/ws": "^8.18.1", "husky": "^9.1.7", - "lint-staged": "^17.0.7", - "prettier": "^3.8.3", + "lint-staged": "^17.0.8", + "prettier": "^3.9.1", "typescript": "^6.0.3" + }, + "engines": { + "node": ">=22" } }, "node_modules/@keyv/serialize": { diff --git a/package.json b/package.json index 55729e9..75847e4 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "homepage": "https://github.com/lpgera/dirigera#readme", "dependencies": { "commander": "^15.0.0", - "got": "^15.0.5", + "got": "^15.0.7", "mdns-server": "^1.0.11", "p-retry": "^8.0.0", "reconnecting-websocket": "^4.4.0", @@ -46,8 +46,8 @@ "@types/node": "^25.9.1", "@types/ws": "^8.18.1", "husky": "^9.1.7", - "lint-staged": "^17.0.7", - "prettier": "^3.8.3", + "lint-staged": "^17.0.8", + "prettier": "^3.9.1", "typescript": "^6.0.3" }, "engines": { From 1dca16a3ec5c71402bb36c2228e137a4131f0afa Mon Sep 17 00:00:00 2001 From: GerA Date: Sun, 28 Jun 2026 20:26:15 +0200 Subject: [PATCH 10/10] update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d62e14..580ee7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## [Unreleased](https://github.com/lpgera/dirigera/compare/v1.8.2...HEAD) -- +- Breaking: The package is now ESM-only. +- Breaking: Node.js versions below 22 are no longer supported. +- Update dependencies. ## [1.8.2](https://github.com/lpgera/dirigera/compare/v1.8.1...v1.8.2) - 2026-06-28