node-switchbot 3.6.5 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/npm-version-script-esm.js +97 -0
- package/CHANGELOG.md +586 -0
- package/PRODUCTION_READY.md +135 -0
- package/README.md +92 -0
- package/dist/api.d.ts +130 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +286 -0
- package/dist/api.js.map +1 -0
- package/dist/ble.d.ts +116 -0
- package/dist/ble.d.ts.map +1 -0
- package/dist/ble.js +430 -0
- package/dist/ble.js.map +1 -0
- package/dist/devices/base.d.ts +146 -0
- package/dist/devices/base.d.ts.map +1 -0
- package/dist/devices/base.js +324 -0
- package/dist/devices/base.js.map +1 -0
- package/dist/devices/index.d.ts +30 -0
- package/dist/devices/index.d.ts.map +1 -0
- package/dist/devices/index.js +34 -0
- package/dist/devices/index.js.map +1 -0
- package/dist/devices/wo-air-purifier-table.d.ts +8 -0
- package/dist/devices/wo-air-purifier-table.d.ts.map +1 -0
- package/dist/devices/wo-air-purifier-table.js +12 -0
- package/dist/devices/wo-air-purifier-table.js.map +1 -0
- package/dist/devices/wo-air-purifier.d.ts +28 -0
- package/dist/devices/wo-air-purifier.d.ts.map +1 -0
- package/dist/devices/wo-air-purifier.js +105 -0
- package/dist/devices/wo-air-purifier.js.map +1 -0
- package/dist/devices/wo-blind-tilt.d.ts +36 -0
- package/dist/devices/wo-blind-tilt.d.ts.map +1 -0
- package/dist/devices/wo-blind-tilt.js +95 -0
- package/dist/devices/wo-blind-tilt.js.map +1 -0
- package/dist/devices/wo-bulb.d.ts +32 -0
- package/dist/devices/wo-bulb.d.ts.map +1 -0
- package/dist/devices/wo-bulb.js +109 -0
- package/dist/devices/wo-bulb.js.map +1 -0
- package/dist/devices/wo-ceiling-light.d.ts +8 -0
- package/dist/devices/wo-ceiling-light.d.ts.map +1 -0
- package/dist/devices/wo-ceiling-light.js +12 -0
- package/dist/devices/wo-ceiling-light.js.map +1 -0
- package/dist/devices/wo-contact.d.ts +12 -0
- package/dist/devices/wo-contact.d.ts.map +1 -0
- package/dist/devices/wo-contact.js +50 -0
- package/dist/devices/wo-contact.js.map +1 -0
- package/dist/devices/wo-curtain.d.ts +28 -0
- package/dist/devices/wo-curtain.d.ts.map +1 -0
- package/dist/devices/wo-curtain.js +82 -0
- package/dist/devices/wo-curtain.js.map +1 -0
- package/dist/devices/wo-hand.d.ts +24 -0
- package/dist/devices/wo-hand.d.ts.map +1 -0
- package/dist/devices/wo-hand.js +70 -0
- package/dist/devices/wo-hand.js.map +1 -0
- package/dist/devices/wo-hub2.d.ts +12 -0
- package/dist/devices/wo-hub2.d.ts.map +1 -0
- package/dist/devices/wo-hub2.js +48 -0
- package/dist/devices/wo-hub2.js.map +1 -0
- package/dist/devices/wo-hub3.d.ts +8 -0
- package/dist/devices/wo-hub3.d.ts.map +1 -0
- package/dist/devices/wo-hub3.js +12 -0
- package/dist/devices/wo-hub3.js.map +1 -0
- package/dist/devices/wo-humi.d.ts +28 -0
- package/dist/devices/wo-humi.d.ts.map +1 -0
- package/dist/devices/wo-humi.js +91 -0
- package/dist/devices/wo-humi.js.map +1 -0
- package/dist/devices/wo-humi2.d.ts +8 -0
- package/dist/devices/wo-humi2.d.ts.map +1 -0
- package/dist/devices/wo-humi2.js +12 -0
- package/dist/devices/wo-humi2.js.map +1 -0
- package/dist/devices/wo-io-sensor-th.d.ts +8 -0
- package/dist/devices/wo-io-sensor-th.d.ts.map +1 -0
- package/dist/devices/wo-io-sensor-th.js +12 -0
- package/dist/devices/wo-io-sensor-th.js.map +1 -0
- package/dist/devices/wo-keypad.d.ts +13 -0
- package/dist/devices/wo-keypad.d.ts.map +1 -0
- package/dist/devices/wo-keypad.js +46 -0
- package/dist/devices/wo-keypad.js.map +1 -0
- package/dist/devices/wo-leak.d.ts +12 -0
- package/dist/devices/wo-leak.d.ts.map +1 -0
- package/dist/devices/wo-leak.js +46 -0
- package/dist/devices/wo-leak.js.map +1 -0
- package/dist/devices/wo-lock-pro.d.ts +24 -0
- package/dist/devices/wo-lock-pro.d.ts.map +1 -0
- package/dist/devices/wo-lock-pro.js +72 -0
- package/dist/devices/wo-lock-pro.js.map +1 -0
- package/dist/devices/wo-lock.d.ts +20 -0
- package/dist/devices/wo-lock.d.ts.map +1 -0
- package/dist/devices/wo-lock.js +64 -0
- package/dist/devices/wo-lock.js.map +1 -0
- package/dist/devices/wo-plug-mini-jp.d.ts +8 -0
- package/dist/devices/wo-plug-mini-jp.d.ts.map +1 -0
- package/dist/devices/wo-plug-mini-jp.js +12 -0
- package/dist/devices/wo-plug-mini-jp.js.map +1 -0
- package/dist/devices/wo-plug-mini-us.d.ts +24 -0
- package/dist/devices/wo-plug-mini-us.d.ts.map +1 -0
- package/dist/devices/wo-plug-mini-us.js +70 -0
- package/dist/devices/wo-plug-mini-us.js.map +1 -0
- package/dist/devices/wo-presence.d.ts +12 -0
- package/dist/devices/wo-presence.d.ts.map +1 -0
- package/dist/devices/wo-presence.js +48 -0
- package/dist/devices/wo-presence.js.map +1 -0
- package/dist/devices/wo-relay-switch-1.d.ts +24 -0
- package/dist/devices/wo-relay-switch-1.d.ts.map +1 -0
- package/dist/devices/wo-relay-switch-1.js +70 -0
- package/dist/devices/wo-relay-switch-1.js.map +1 -0
- package/dist/devices/wo-relay-switch-1pm.d.ts +8 -0
- package/dist/devices/wo-relay-switch-1pm.d.ts.map +1 -0
- package/dist/devices/wo-relay-switch-1pm.js +12 -0
- package/dist/devices/wo-relay-switch-1pm.js.map +1 -0
- package/dist/devices/wo-remote.d.ts +13 -0
- package/dist/devices/wo-remote.d.ts.map +1 -0
- package/dist/devices/wo-remote.js +45 -0
- package/dist/devices/wo-remote.js.map +1 -0
- package/dist/devices/wo-sensor-th-plus.d.ts +8 -0
- package/dist/devices/wo-sensor-th-plus.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-plus.js +12 -0
- package/dist/devices/wo-sensor-th-plus.js.map +1 -0
- package/dist/devices/wo-sensor-th-pro-co2.d.ts +8 -0
- package/dist/devices/wo-sensor-th-pro-co2.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-pro-co2.js +12 -0
- package/dist/devices/wo-sensor-th-pro-co2.js.map +1 -0
- package/dist/devices/wo-sensor-th-pro.d.ts +8 -0
- package/dist/devices/wo-sensor-th-pro.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-pro.js +12 -0
- package/dist/devices/wo-sensor-th-pro.js.map +1 -0
- package/dist/devices/wo-sensor-th.d.ts +12 -0
- package/dist/devices/wo-sensor-th.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th.js +49 -0
- package/dist/devices/wo-sensor-th.js.map +1 -0
- package/dist/devices/wo-strip.d.ts +8 -0
- package/dist/devices/wo-strip.d.ts.map +1 -0
- package/dist/devices/wo-strip.js +12 -0
- package/dist/devices/wo-strip.js.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +103 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/settings.d.ts +126 -47
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +214 -64
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts +80 -0
- package/dist/switchbot.d.ts.map +1 -0
- package/dist/switchbot.js +376 -0
- package/dist/switchbot.js.map +1 -0
- package/dist/types/api.d.ts +187 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/ble.d.ts +246 -343
- package/dist/types/ble.d.ts.map +1 -1
- package/dist/types/ble.js +94 -1
- package/dist/types/ble.js.map +1 -1
- package/dist/types/device.d.ts +209 -0
- package/dist/types/device.d.ts.map +1 -0
- package/dist/types/device.js +6 -0
- package/dist/types/device.js.map +1 -0
- package/dist/types/index.d.ts +115 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +97 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +206 -0
- package/dist/utils/index.js.map +1 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +20 -6
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +3 -3
- package/docs/classes/APIError.html +6 -0
- package/docs/classes/APINotAvailableError.html +4 -0
- package/docs/classes/BLEConnection.html +17 -0
- package/docs/classes/BLENotAvailableError.html +4 -0
- package/docs/classes/BLEScanner.html +15 -0
- package/docs/classes/CommandFailedError.html +6 -0
- package/docs/classes/ConnectionTimeoutError.html +5 -0
- package/docs/classes/DeviceManager.html +25 -0
- package/docs/classes/DeviceNotFoundError.html +4 -0
- package/docs/classes/DiscoveryError.html +5 -0
- package/docs/classes/OpenAPIClient.html +66 -0
- package/docs/classes/SwitchBot.html +21 -0
- package/docs/classes/SwitchBotDevice.html +28 -0
- package/docs/classes/SwitchBotError.html +4 -0
- package/docs/classes/ValidationError.html +5 -0
- package/docs/classes/WoAirPurifier.html +32 -80
- package/docs/classes/WoAirPurifierTable.html +36 -83
- package/docs/classes/WoBlindTilt.html +34 -73
- package/docs/classes/WoBulb.html +33 -85
- package/docs/classes/WoCeilingLight.html +38 -107
- package/docs/classes/WoContact.html +27 -52
- package/docs/classes/WoCurtain.html +32 -69
- package/docs/classes/WoHand.html +30 -59
- package/docs/classes/WoHub2.html +27 -52
- package/docs/classes/WoHub3.html +28 -52
- package/docs/classes/WoHumi.html +33 -65
- package/docs/classes/WoHumi2.html +36 -67
- package/docs/classes/WoIOSensorTH.html +28 -53
- package/docs/classes/WoKeypad.html +28 -52
- package/docs/classes/WoLeak.html +27 -53
- package/docs/classes/WoPlugMiniJP.html +34 -78
- package/docs/classes/WoPlugMiniUS.html +30 -75
- package/docs/classes/WoPresence.html +27 -60
- package/docs/classes/WoRelaySwitch1.html +31 -55
- package/docs/classes/WoRelaySwitch1PM.html +34 -57
- package/docs/classes/WoRemote.html +28 -52
- package/docs/classes/WoSensorTH.html +27 -46
- package/docs/classes/WoSensorTHPlus.html +28 -46
- package/docs/classes/WoSensorTHPro.html +28 -46
- package/docs/classes/WoSensorTHProCO2.html +28 -46
- package/docs/classes/WoSmartLock.html +29 -111
- package/docs/classes/WoSmartLockPro.html +31 -111
- package/docs/classes/WoStrip.html +38 -94
- package/docs/enums/LogLevel.html +4 -7
- package/docs/enums/SwitchBotBLEModel.html +11 -5
- package/docs/enums/SwitchBotBLEModelName.html +13 -6
- package/docs/functions/updateBaseURL.html +3 -3
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +40 -6
- package/docs/interfaces/APICommandRequest.html +5 -0
- package/docs/interfaces/APICommandResponse.html +5 -0
- package/docs/interfaces/APIDevice.html +18 -0
- package/docs/interfaces/APIDeviceStatus.html +36 -0
- package/docs/interfaces/APIErrorResponse.html +5 -0
- package/docs/interfaces/APIResponse.html +5 -0
- package/docs/interfaces/AirPurifierCommands.html +5 -0
- package/docs/interfaces/AirPurifierServiceData.html +14 -0
- package/docs/interfaces/AirPurifierStatus.html +17 -0
- package/docs/interfaces/BLEAdvertisement.html +6 -0
- package/docs/interfaces/BLEScanOptions.html +10 -0
- package/docs/interfaces/BLEServiceData.html +10 -0
- package/docs/interfaces/BlindTiltCommands.html +7 -0
- package/docs/interfaces/BlindTiltServiceData.html +14 -0
- package/docs/interfaces/BlindTiltStatus.html +15 -0
- package/docs/interfaces/BotCommands.html +4 -0
- package/docs/interfaces/BotServiceData.html +12 -0
- package/docs/interfaces/BotStatus.html +14 -0
- package/docs/interfaces/BulbCommands.html +6 -0
- package/docs/interfaces/BulbServiceData.html +19 -0
- package/docs/interfaces/BulbStatus.html +16 -0
- package/docs/interfaces/CeilingLightCommands.html +6 -0
- package/docs/interfaces/CeilingLightServiceData.html +19 -0
- package/docs/interfaces/CeilingLightStatus.html +16 -0
- package/docs/interfaces/CommandResult.html +12 -0
- package/docs/interfaces/ContactServiceData.html +13 -0
- package/docs/interfaces/ContactStatus.html +15 -0
- package/docs/interfaces/CurtainCommands.html +5 -0
- package/docs/interfaces/CurtainServiceData.html +14 -0
- package/docs/interfaces/CurtainStatus.html +17 -0
- package/docs/interfaces/DeviceInfo.html +26 -0
- package/docs/interfaces/DeviceListResponse.html +4 -0
- package/docs/interfaces/DeviceStatus.html +12 -0
- package/docs/interfaces/DiscoveryOptions.html +14 -0
- package/docs/interfaces/HubServiceData.html +14 -0
- package/docs/interfaces/HubStatus.html +15 -0
- package/docs/interfaces/HumidifierCommands.html +5 -0
- package/docs/interfaces/HumidifierServiceData.html +14 -0
- package/docs/interfaces/HumidifierStatus.html +18 -0
- package/docs/interfaces/KeypadStatus.html +13 -0
- package/docs/interfaces/LeakServiceData.html +11 -0
- package/docs/interfaces/LeakStatus.html +13 -0
- package/docs/interfaces/LockCommands.html +3 -0
- package/docs/interfaces/LockServiceData.html +15 -0
- package/docs/interfaces/LockStatus.html +15 -0
- package/docs/interfaces/MeterServiceData.html +13 -0
- package/docs/interfaces/MeterStatus.html +15 -0
- package/docs/interfaces/MotionServiceData.html +13 -0
- package/docs/interfaces/MotionStatus.html +14 -0
- package/docs/interfaces/PlugCommands.html +4 -0
- package/docs/interfaces/PlugServiceData.html +17 -0
- package/docs/interfaces/PlugStatus.html +16 -0
- package/docs/interfaces/PresenceServiceData.html +12 -0
- package/docs/interfaces/PresenceStatus.html +14 -0
- package/docs/interfaces/RelaySwitchCommands.html +4 -0
- package/docs/interfaces/RelaySwitchServiceData.html +14 -0
- package/docs/interfaces/RelaySwitchStatus.html +16 -0
- package/docs/interfaces/RemoteStatus.html +12 -0
- package/docs/interfaces/SceneListResponse.html +3 -0
- package/docs/interfaces/StripCommands.html +6 -0
- package/docs/interfaces/StripServiceData.html +19 -0
- package/docs/interfaces/StripStatus.html +16 -0
- package/docs/interfaces/SwitchBotConfig.html +18 -0
- package/docs/interfaces/WebhookConfig.html +4 -0
- package/docs/interfaces/WebhookDetails.html +7 -0
- package/docs/interfaces/WebhookQueryResponse.html +5 -0
- package/docs/interfaces/WebhookSetupResponse.html +5 -0
- package/docs/modules.html +1 -1
- package/docs/types/ConnectionType.html +2 -0
- package/docs/types/PhysicalDeviceType.html +2 -0
- package/docs/types/VirtualDeviceType.html +2 -0
- package/docs/variables/urls.html +1 -1
- package/package.json +11 -20
- package/.github/scripts/npm-version-script-esm-auto.js +0 -207
- package/dist/device.d.ts +0 -1577
- package/dist/device.d.ts.map +0 -1
- package/dist/device.js +0 -3493
- package/dist/device.js.map +0 -1
- package/dist/device.test.d.ts +0 -2
- package/dist/device.test.d.ts.map +0 -1
- package/dist/device.test.js +0 -255
- package/dist/device.test.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -14
- package/dist/index.test.js.map +0 -1
- package/dist/parameter-checker.d.ts +0 -91
- package/dist/parameter-checker.d.ts.map +0 -1
- package/dist/parameter-checker.js +0 -262
- package/dist/parameter-checker.js.map +0 -1
- package/dist/parameter-checker.test.d.ts +0 -2
- package/dist/parameter-checker.test.d.ts.map +0 -1
- package/dist/parameter-checker.test.js +0 -56
- package/dist/parameter-checker.test.js.map +0 -1
- package/dist/settings.test.d.ts +0 -2
- package/dist/settings.test.d.ts.map +0 -1
- package/dist/settings.test.js +0 -61
- package/dist/settings.test.js.map +0 -1
- package/dist/switchbot-ble.d.ts +0 -89
- package/dist/switchbot-ble.d.ts.map +0 -1
- package/dist/switchbot-ble.js +0 -319
- package/dist/switchbot-ble.js.map +0 -1
- package/dist/switchbot-ble.test.d.ts +0 -2
- package/dist/switchbot-ble.test.d.ts.map +0 -1
- package/dist/switchbot-ble.test.js +0 -32
- package/dist/switchbot-ble.test.js.map +0 -1
- package/dist/switchbot-openapi.d.ts +0 -139
- package/dist/switchbot-openapi.d.ts.map +0 -1
- package/dist/switchbot-openapi.js +0 -375
- package/dist/switchbot-openapi.js.map +0 -1
- package/dist/switchbot-openapi.test.d.ts +0 -2
- package/dist/switchbot-openapi.test.d.ts.map +0 -1
- package/dist/switchbot-openapi.test.js +0 -36
- package/dist/switchbot-openapi.test.js.map +0 -1
- package/dist/types/ble-guards.d.ts +0 -12
- package/dist/types/ble-guards.d.ts.map +0 -1
- package/dist/types/ble-guards.js +0 -10
- package/dist/types/ble-guards.js.map +0 -1
- package/dist/types/ble-guards.test.d.ts +0 -2
- package/dist/types/ble-guards.test.d.ts.map +0 -1
- package/dist/types/ble-guards.test.js +0 -62
- package/dist/types/ble-guards.test.js.map +0 -1
- package/dist/types/openapi.d.ts +0 -635
- package/dist/types/openapi.d.ts.map +0 -1
- package/dist/types/openapi.js +0 -3
- package/dist/types/openapi.js.map +0 -1
- package/docs/classes/Advertising.html +0 -21
- package/docs/classes/ErrorUtils.html +0 -25
- package/docs/classes/ParameterChecker.html +0 -69
- package/docs/classes/SwitchBotBLE.html +0 -39
- package/docs/classes/SwitchBotOpenAPI.html +0 -57
- package/docs/classes/SwitchbotDevice.html +0 -47
- package/docs/classes/ValidationUtils.html +0 -51
- package/docs/classes/WoSmartLockUltra.html +0 -113
- package/docs/enums/SwitchBotBLEModelFriendlyName.html +0 -39
- package/docs/enums/SwitchBotModel.html +0 -52
- package/docs/interfaces/AdvertisementData.html +0 -3
- package/docs/interfaces/Chars.html +0 -4
- package/docs/interfaces/ColorLightServiceDataBase.html +0 -17
- package/docs/interfaces/ErrorObject.html +0 -3
- package/docs/interfaces/LockBaseServiceData.html +0 -15
- package/docs/interfaces/NobleTypes.html +0 -3
- package/docs/interfaces/Params.html +0 -6
- package/docs/interfaces/PlugMiniServiceDataBase.html +0 -12
- package/docs/interfaces/Rule.html +0 -9
- package/docs/interfaces/ServiceData.html +0 -2
- package/docs/interfaces/SwitchBotBLEDevice.html +0 -27
- package/docs/interfaces/SwitchBotScanner.html +0 -6
- package/docs/interfaces/TemperatureServiceDataBase.html +0 -10
- package/docs/interfaces/WebhookDetail.html +0 -6
- package/docs/interfaces/ad.html +0 -5
- package/docs/interfaces/body.html +0 -3
- package/docs/interfaces/bodyChange.html +0 -4
- package/docs/interfaces/deleteWebhookResponse.html +0 -4
- package/docs/interfaces/device.html +0 -7
- package/docs/interfaces/deviceList.html +0 -2
- package/docs/interfaces/deviceStatus.html +0 -7
- package/docs/interfaces/deviceStatusRequest.html +0 -4
- package/docs/interfaces/deviceWebhook.html +0 -4
- package/docs/interfaces/deviceWebhookContext.html +0 -4
- package/docs/interfaces/devices.html +0 -4
- package/docs/interfaces/infraredRemoteList.html +0 -2
- package/docs/interfaces/irdevice.html +0 -5
- package/docs/interfaces/pushRequest.html +0 -5
- package/docs/interfaces/pushResponse.html +0 -5
- package/docs/interfaces/pushResponseBody.html +0 -3
- package/docs/interfaces/queryWebhookResponse.html +0 -4
- package/docs/interfaces/setupWebhookResponse.html +0 -4
- package/docs/interfaces/updateWebhookResponse.html +0 -4
- package/docs/interfaces/webhookRequest.html +0 -4
- package/docs/types/BLEDeviceServiceData.html +0 -1
- package/docs/types/IndoorCam.html +0 -1
- package/docs/types/MacAddress.html +0 -1
- package/docs/types/airPurifier.html +0 -1
- package/docs/types/airPurifierPM25WebhookContext.html +0 -1
- package/docs/types/airPurifierServiceData.html +0 -1
- package/docs/types/airPurifierStatus.html +0 -1
- package/docs/types/airPurifierTable.html +0 -1
- package/docs/types/airPurifierTablePM25WebhookContext.html +0 -1
- package/docs/types/airPurifierTableServiceData.html +0 -1
- package/docs/types/airPurifierTableStatus.html +0 -1
- package/docs/types/airPurifierTableVOC.html +0 -1
- package/docs/types/airPurifierTableVOCStatus.html +0 -1
- package/docs/types/airPurifierTableVOCWebhookContext.html +0 -1
- package/docs/types/airPurifierTableWebhookContext.html +0 -1
- package/docs/types/airPurifierVOC.html +0 -1
- package/docs/types/airPurifierVOCStatus.html +0 -1
- package/docs/types/airPurifierVOCWebhookContext.html +0 -1
- package/docs/types/airPurifierWebhookContext.html +0 -1
- package/docs/types/batteryCirculatorFan.html +0 -1
- package/docs/types/batteryCirculatorFanServiceData.html +0 -1
- package/docs/types/batteryCirculatorFanStatus.html +0 -1
- package/docs/types/batteryCirculatorFanWebhookContext.html +0 -1
- package/docs/types/blindTilt.html +0 -1
- package/docs/types/blindTiltServiceData.html +0 -1
- package/docs/types/blindTiltStatus.html +0 -1
- package/docs/types/blindTiltWebhookContext.html +0 -1
- package/docs/types/bot.html +0 -1
- package/docs/types/botServiceData.html +0 -1
- package/docs/types/botStatus.html +0 -1
- package/docs/types/botWebhookContext.html +0 -1
- package/docs/types/ceilingLight.html +0 -1
- package/docs/types/ceilingLightPro.html +0 -1
- package/docs/types/ceilingLightProServiceData.html +0 -1
- package/docs/types/ceilingLightProStatus.html +0 -1
- package/docs/types/ceilingLightProWebhookContext.html +0 -1
- package/docs/types/ceilingLightServiceData.html +0 -1
- package/docs/types/ceilingLightStatus.html +0 -1
- package/docs/types/ceilingLightWebhookContext.html +0 -1
- package/docs/types/circulatorFanStatus.html +0 -1
- package/docs/types/circulatorFanWebhookContext.html +0 -1
- package/docs/types/colorBulb.html +0 -1
- package/docs/types/colorBulbServiceData.html +0 -1
- package/docs/types/colorBulbStatus.html +0 -1
- package/docs/types/colorBulbWebhookContext.html +0 -1
- package/docs/types/commandType.html +0 -2
- package/docs/types/contactSensor.html +0 -1
- package/docs/types/contactSensorServiceData.html +0 -1
- package/docs/types/contactSensorStatus.html +0 -1
- package/docs/types/contactSensorWebhookContext.html +0 -1
- package/docs/types/curtain.html +0 -1
- package/docs/types/curtain3.html +0 -1
- package/docs/types/curtain3ServiceData.html +0 -1
- package/docs/types/curtain3WebhookContext.html +0 -1
- package/docs/types/curtainServiceData.html +0 -1
- package/docs/types/curtainStatus.html +0 -1
- package/docs/types/curtainWebhookContext.html +0 -1
- package/docs/types/floorCleaningRobotS10.html +0 -1
- package/docs/types/floorCleaningRobotS10Status.html +0 -1
- package/docs/types/floorCleaningRobotS10WebhookContext.html +0 -1
- package/docs/types/hub2.html +0 -1
- package/docs/types/hub2ServiceData.html +0 -1
- package/docs/types/hub2Status.html +0 -1
- package/docs/types/hub2WebhookContext.html +0 -1
- package/docs/types/hub3ServiceData.html +0 -1
- package/docs/types/humidifier.html +0 -1
- package/docs/types/humidifier2ServiceData.html +0 -1
- package/docs/types/humidifier2Status.html +0 -1
- package/docs/types/humidifier2WebhookContext.html +0 -1
- package/docs/types/humidifierServiceData.html +0 -1
- package/docs/types/humidifierStatus.html +0 -1
- package/docs/types/humidifierWebhookContext.html +0 -1
- package/docs/types/indoorCameraWebhookContext.html +0 -1
- package/docs/types/keypad.html +0 -1
- package/docs/types/keypadDetectorServiceData.html +0 -1
- package/docs/types/keypadTouch.html +0 -1
- package/docs/types/keypadTouchWebhookContext.html +0 -1
- package/docs/types/keypadWebhookContext.html +0 -1
- package/docs/types/lock.html +0 -1
- package/docs/types/lockPro.html +0 -1
- package/docs/types/lockProServiceData.html +0 -1
- package/docs/types/lockProStatus.html +0 -1
- package/docs/types/lockProWebhookContext.html +0 -1
- package/docs/types/lockServiceData.html +0 -1
- package/docs/types/lockStatus.html +0 -1
- package/docs/types/lockWebhookContext.html +0 -1
- package/docs/types/meter.html +0 -1
- package/docs/types/meterPlus.html +0 -1
- package/docs/types/meterPlusServiceData.html +0 -1
- package/docs/types/meterPlusStatus.html +0 -1
- package/docs/types/meterPlusWebhookContext.html +0 -1
- package/docs/types/meterPro.html +0 -1
- package/docs/types/meterProCO2ServiceData.html +0 -1
- package/docs/types/meterProCO2Status.html +0 -1
- package/docs/types/meterProCO2WebhookContext.html +0 -1
- package/docs/types/meterProServiceData.html +0 -1
- package/docs/types/meterProStatus.html +0 -1
- package/docs/types/meterProWebhookContext.html +0 -1
- package/docs/types/meterServiceData.html +0 -1
- package/docs/types/meterStatus.html +0 -1
- package/docs/types/meterWebhookContext.html +0 -1
- package/docs/types/motionSensor.html +0 -1
- package/docs/types/motionSensorServiceData.html +0 -1
- package/docs/types/motionSensorStatus.html +0 -1
- package/docs/types/motionSensorWebhookContext.html +0 -1
- package/docs/types/onadvertisement.html +0 -1
- package/docs/types/ondiscover.html +0 -1
- package/docs/types/outdoorMeter.html +0 -1
- package/docs/types/outdoorMeterServiceData.html +0 -1
- package/docs/types/outdoorMeterStatus.html +0 -1
- package/docs/types/outdoorMeterWebhookContext.html +0 -1
- package/docs/types/panTiltCamWebhookContext.html +0 -1
- package/docs/types/pantiltCam.html +0 -1
- package/docs/types/pantiltCam2k.html +0 -1
- package/docs/types/plug.html +0 -1
- package/docs/types/plugMini.html +0 -1
- package/docs/types/plugMiniJPServiceData.html +0 -1
- package/docs/types/plugMiniJPWebhookContext.html +0 -1
- package/docs/types/plugMiniStatus.html +0 -1
- package/docs/types/plugMiniUSServiceData.html +0 -1
- package/docs/types/plugMiniUSWebhookContext.html +0 -1
- package/docs/types/plugStatus.html +0 -1
- package/docs/types/plugWebhookContext.html +0 -1
- package/docs/types/presenceSensor.html +0 -1
- package/docs/types/presenceSensorServiceData.html +0 -1
- package/docs/types/presenceSensorStatus.html +0 -1
- package/docs/types/presenceSensorWebhookContext.html +0 -1
- package/docs/types/relaySwitch1Context.html +0 -1
- package/docs/types/relaySwitch1PMContext.html +0 -1
- package/docs/types/relaySwitch1PMServiceData.html +0 -1
- package/docs/types/relaySwitch1PMStatus.html +0 -1
- package/docs/types/relaySwitch1ServiceData.html +0 -1
- package/docs/types/relaySwitch1Status.html +0 -1
- package/docs/types/remote.html +0 -1
- package/docs/types/remoteServiceData.html +0 -1
- package/docs/types/robotVacuumCleanerS1.html +0 -1
- package/docs/types/robotVacuumCleanerS1Plus.html +0 -1
- package/docs/types/robotVacuumCleanerS1PlusStatus.html +0 -1
- package/docs/types/robotVacuumCleanerS1PlusWebhookContext.html +0 -1
- package/docs/types/robotVacuumCleanerS1Status.html +0 -1
- package/docs/types/robotVacuumCleanerS1WebhookContext.html +0 -1
- package/docs/types/robotVacuumCleanerServiceData.html +0 -1
- package/docs/types/stripLight.html +0 -1
- package/docs/types/stripLightServiceData.html +0 -1
- package/docs/types/stripLightStatus.html +0 -1
- package/docs/types/stripLightWebhookContext.html +0 -1
- package/docs/types/waterLeakDetector.html +0 -1
- package/docs/types/waterLeakDetectorServiceData.html +0 -1
- package/docs/types/waterLeakDetectorStatus.html +0 -1
- package/docs/types/waterLeakDetectorWebhookContext.html +0 -1
- package/docs/variables/parameterChecker.html +0 -1
- package/eslint.config.js +0 -48
- package/typedoc.json +0 -17
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ConnectionType | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">ConnectionType</a></li></ul><h1>Type Alias ConnectionType</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">ConnectionType</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"ble"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"api"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"hybrid"</span></div><div class="tsd-comment tsd-typography"><p>Device connection type</p>
|
|
2
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/57c71304aee59f576e5cb0c8194e5bd1cb1f8fa7/src/types/index.ts#L20">types/index.ts:20</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PhysicalDeviceType | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">PhysicalDeviceType</a></li></ul><h1>Type Alias PhysicalDeviceType</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">PhysicalDeviceType</span><span class="tsd-signature-symbol">:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Bot"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Curtain"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Curtain3"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Plug"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Plug Mini (US)"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Plug Mini (JP)"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Meter"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Meter Plus"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Meter Pro"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Meter Pro (CO2)"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Outdoor Meter"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Lock"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Lock Pro"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Keypad"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Keypad Touch"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Motion Sensor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Contact Sensor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Ceiling Light"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Ceiling Light Pro"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Strip Light"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Color Bulb"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Robot Vacuum Cleaner S1"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Robot Vacuum Cleaner S1 Plus"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Robot Vacuum Cleaner K10 Plus"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Humidifier"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Humidifier 2"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Blind Tilt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Hub 2"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Hub Mini"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Hub Plus"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Remote"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Battery Circulator Fan"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Air Purifier"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Air Purifier Table"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Water Leak Detector"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Presence Sensor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Relay Switch 1PM"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Relay Switch 1"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"K10+ Pro Combo"</span></div><div class="tsd-comment tsd-typography"><p>Physical device types supported by OpenAPI</p>
|
|
2
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/57c71304aee59f576e5cb0c8194e5bd1cb1f8fa7/src/types/api.ts#L213">types/api.ts:213</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>VirtualDeviceType | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">VirtualDeviceType</a></li></ul><h1>Type Alias VirtualDeviceType</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">VirtualDeviceType</span><span class="tsd-signature-symbol">:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Air Conditioner"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"TV"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Light"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"IPTV/Streamer"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Set Top Box"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"DVD"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Fan"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Projector"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Camera"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Air Purifier"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Speaker"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Water Heater"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Vacuum Cleaner"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"Others"</span></div><div class="tsd-comment tsd-typography"><p>Virtual/Infrared device types</p>
|
|
2
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/57c71304aee59f576e5cb0c8194e5bd1cb1f8fa7/src/types/api.ts#L257">types/api.ts:257</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/docs/variables/urls.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>urls | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">urls</a></li></ul><h1>Variable urls<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">urls</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>urls | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">urls</a></li></ul><h1>Variable urls<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">urls</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="base"><span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="devices"><span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="scenes"><span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="webhook"><span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/57c71304aee59f576e5cb0c8194e5bd1cb1f8fa7/src/settings.ts#L14">settings.ts:14</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-switchbot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).",
|
|
4
|
+
"version": "4.0.0-beta.0",
|
|
5
|
+
"description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE) with automatic OpenAPI fallback.",
|
|
6
6
|
"author": "OpenWonderLabs (https://github.com/OpenWonderLabs)",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/OpenWonderLabs/node-switchbot",
|
|
@@ -52,31 +52,22 @@
|
|
|
52
52
|
"readmeFilename": "README.md",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@stoprocent/noble": "^2.3.14",
|
|
55
|
-
"async-mutex": "^0.5.0",
|
|
56
55
|
"undici": "^7.15.0"
|
|
57
56
|
},
|
|
58
57
|
"optionalDependencies": {
|
|
59
|
-
"@stoprocent/bluetooth-hci-socket": "^2.2.
|
|
58
|
+
"@stoprocent/bluetooth-hci-socket": "^2.2.5"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
|
-
"@antfu/eslint-config": "^5.
|
|
63
|
-
"@types/
|
|
64
|
-
"@
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"@types/node": "^24.3.0",
|
|
68
|
-
"@types/semver": "^7.7.0",
|
|
69
|
-
"@types/source-map-support": "^0.5.10",
|
|
70
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
71
|
-
"eslint": "^9.34.0",
|
|
72
|
-
"eslint-plugin-format": "^1.0.1",
|
|
61
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
62
|
+
"@types/node": "^25.3.3",
|
|
63
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
64
|
+
"eslint": "^9.39.3",
|
|
65
|
+
"eslint-plugin-format": "^2.0.1",
|
|
73
66
|
"eslint-plugin-import": "^2.32.0",
|
|
74
67
|
"eslint-plugin-import-x": "^4.16.1",
|
|
75
|
-
"nodemon": "^3.1.10",
|
|
76
68
|
"shx": "^0.4.0",
|
|
77
|
-
"ts-node": "^10.9.2",
|
|
78
69
|
"typedoc": "^0.28.11",
|
|
79
|
-
"typescript": "^5.9.
|
|
80
|
-
"vitest": "^
|
|
70
|
+
"typescript": "^5.9.3",
|
|
71
|
+
"vitest": "^4.0.18"
|
|
81
72
|
}
|
|
82
|
-
}
|
|
73
|
+
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Standalone ESM implementation — self-contained so this file can be copied
|
|
5
|
-
* into other repos without pulling any other files.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import assert from 'node:assert'
|
|
9
|
-
import child_process from 'node:child_process'
|
|
10
|
-
import fs from 'node:fs'
|
|
11
|
-
import process from 'node:process'
|
|
12
|
-
// Minimal, in-file semver utilities used by this script.
|
|
13
|
-
// This avoids an external dependency so the script can run in environments
|
|
14
|
-
// where `semver` isn't installed.
|
|
15
|
-
const semver = {
|
|
16
|
-
// Very small validation: match major.minor.patch with optional prerelease/build
|
|
17
|
-
valid(v) {
|
|
18
|
-
return /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?(?:\+[0-9A-Za-z-.]+)?$/.test(v)
|
|
19
|
-
},
|
|
20
|
-
// Return prerelease identifiers array or null
|
|
21
|
-
prerelease(v) {
|
|
22
|
-
const m = v.match(/^\d+\.\d+\.\d+-(.+)$/)
|
|
23
|
-
return m ? m[1].split('.') : null
|
|
24
|
-
},
|
|
25
|
-
// Compare two semver strings in reverse order (for rcompare use)
|
|
26
|
-
rcompare(a, b) {
|
|
27
|
-
// Use standard semver precedence rules for major.minor.patch; ignore prerelease complexity except that prerelease is lower than release
|
|
28
|
-
const pa = a.split('-')
|
|
29
|
-
const pb = b.split('-')
|
|
30
|
-
const aCore = pa[0].split('.').map(Number)
|
|
31
|
-
const bCore = pb[0].split('.').map(Number)
|
|
32
|
-
for (let i = 0; i < 3; i++) {
|
|
33
|
-
if (aCore[i] > bCore[i]) return -1
|
|
34
|
-
if (aCore[i] < bCore[i]) return 1
|
|
35
|
-
}
|
|
36
|
-
// equal core; releases (no prerelease) are greater than prerelease
|
|
37
|
-
if (pa.length === 1 && pb.length > 1) return -1
|
|
38
|
-
if (pa.length > 1 && pb.length === 1) return 1
|
|
39
|
-
// both same prerelease status: compare as strings
|
|
40
|
-
if (a > b) return -1
|
|
41
|
-
if (a < b) return 1
|
|
42
|
-
return 0
|
|
43
|
-
},
|
|
44
|
-
// Increment version by 'major'|'minor'|'patch'
|
|
45
|
-
inc(v, level) {
|
|
46
|
-
if (!this.valid(v)) throw new Error(`Invalid semver passed to inc: ${v}`)
|
|
47
|
-
// strip prerelease/build
|
|
48
|
-
const core = v.split('-')[0].split('+')[0]
|
|
49
|
-
const parts = core.split('.').map(Number)
|
|
50
|
-
switch (level) {
|
|
51
|
-
case 'major':
|
|
52
|
-
parts[0] += 1
|
|
53
|
-
parts[1] = 0
|
|
54
|
-
parts[2] = 0
|
|
55
|
-
break
|
|
56
|
-
case 'minor':
|
|
57
|
-
parts[1] += 1
|
|
58
|
-
parts[2] = 0
|
|
59
|
-
break
|
|
60
|
-
case 'patch':
|
|
61
|
-
default:
|
|
62
|
-
parts[2] += 1
|
|
63
|
-
break
|
|
64
|
-
}
|
|
65
|
-
return parts.join('.')
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const BRANCH_VERSION_PATTERN = /^([A-Z]+)-(\d+\.\d+\.\d+)$/i
|
|
70
|
-
|
|
71
|
-
// Load package.json
|
|
72
|
-
const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8'))
|
|
73
|
-
|
|
74
|
-
const refArgument = process.argv[2]
|
|
75
|
-
const tagArgument = process.argv[3] || 'latest'
|
|
76
|
-
const prLabel = process.argv[4] || null // optional PR label: major, minor, patch
|
|
77
|
-
|
|
78
|
-
if (!refArgument) {
|
|
79
|
-
console.error('ref argument is missing')
|
|
80
|
-
console.error('Usage: npm-version-script-esm.js <ref> [tag] [pr_label]')
|
|
81
|
-
process.exit(1)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Queries the NPM registry for the latest version for the provided base version and tag.
|
|
86
|
-
* If the tag is latest, then the base version is returned if it exists. For other tags, the latest
|
|
87
|
-
* version found for that base version and tag is returned.
|
|
88
|
-
* @param baseVersion The base version to query for, e.g. 2.0.0
|
|
89
|
-
* @param tag The tag to query for, e.g. beta or latest
|
|
90
|
-
* @returns {string} Returns the version, or '' if not found
|
|
91
|
-
*/
|
|
92
|
-
function getTagVersionFromNpm(baseVersion, tag) {
|
|
93
|
-
try {
|
|
94
|
-
return JSON.parse(child_process.execSync(`npm info ${packageJSON.name} versions --json`).toString('utf8').trim())
|
|
95
|
-
.filter(v => (tag === 'latest' ? v === baseVersion : v.startsWith(`${baseVersion}-${tag}.`)))
|
|
96
|
-
.reduce((_, current) => current, '')
|
|
97
|
-
} catch (e) {
|
|
98
|
-
console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`, e)
|
|
99
|
-
// throw e;
|
|
100
|
-
return ''
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function getLatestStableVersionFromNpm() {
|
|
105
|
-
try {
|
|
106
|
-
const versions = JSON.parse(child_process.execSync(`npm info ${packageJSON.name} versions --json`).toString('utf8').trim())
|
|
107
|
-
if (!Array.isArray(versions) || versions.length === 0) return ''
|
|
108
|
-
|
|
109
|
-
// Only consider stable semver versions (no prerelease)
|
|
110
|
-
const stable = versions.filter(v => semver.valid(v) && !semver.prerelease(v))
|
|
111
|
-
if (stable.length === 0) return ''
|
|
112
|
-
|
|
113
|
-
// Sort descending and return the highest
|
|
114
|
-
const sorted = stable.sort(semver.rcompare)
|
|
115
|
-
return sorted[0]
|
|
116
|
-
} catch (e) {
|
|
117
|
-
console.error('Failed to query the npm registry for published versions', e)
|
|
118
|
-
return ''
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function desiredTargetVersion(ref) {
|
|
123
|
-
// ref is a GitHub action ref string
|
|
124
|
-
if (ref.startsWith('refs/pull/')) {
|
|
125
|
-
throw new Error('The version script was executed inside a PR!')
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
assert(ref.startsWith('refs/heads/'))
|
|
129
|
-
const branchName = ref.slice('refs/heads/'.length)
|
|
130
|
-
|
|
131
|
-
const results = branchName.match(BRANCH_VERSION_PATTERN)
|
|
132
|
-
if (results !== null) {
|
|
133
|
-
if (results[1].toLowerCase() !== tagArgument.toLowerCase()) {
|
|
134
|
-
console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return results[2]
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (branchName === 'latest') {
|
|
141
|
-
// For latest branch, start with package.json version as base
|
|
142
|
-
return packageJSON.version
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
throw new Error(`Malformed branch name for ref: ${ref}. Must be beta-x.x.x, alpha-x.x.x, or 'latest'`)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function bumpVersion(baseVersion, prLabel) {
|
|
149
|
-
const label = (prLabel || 'patch').toLowerCase()
|
|
150
|
-
if (!semver.valid(baseVersion)) {
|
|
151
|
-
throw new Error(`Invalid base version passed to bumpVersion: ${baseVersion}`)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
switch (label) {
|
|
155
|
-
case 'major':
|
|
156
|
-
return semver.inc(baseVersion, 'major')
|
|
157
|
-
case 'minor':
|
|
158
|
-
return semver.inc(baseVersion, 'minor')
|
|
159
|
-
case 'patch':
|
|
160
|
-
default:
|
|
161
|
-
return semver.inc(baseVersion, 'patch')
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const baseVersion = desiredTargetVersion(refArgument)
|
|
166
|
-
let publishTag = baseVersion
|
|
167
|
-
|
|
168
|
-
if (refArgument.includes('latest')) {
|
|
169
|
-
if (prLabel) {
|
|
170
|
-
// For latest branch when a PR label is provided, bump according to PR label
|
|
171
|
-
publishTag = bumpVersion(baseVersion, prLabel)
|
|
172
|
-
} else {
|
|
173
|
-
// No PR label: determine next version based on the highest published stable version
|
|
174
|
-
const latestPublishedStable = getLatestStableVersionFromNpm()
|
|
175
|
-
if (latestPublishedStable) {
|
|
176
|
-
console.warn(`Latest published stable version is ${latestPublishedStable}; bumping patch`)
|
|
177
|
-
publishTag = bumpVersion(latestPublishedStable, 'patch')
|
|
178
|
-
} else {
|
|
179
|
-
console.warn('No published stable versions found; bumping package.json version patch')
|
|
180
|
-
publishTag = bumpVersion(baseVersion, 'patch')
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
// For alpha/beta, query npm for latest
|
|
185
|
-
const latestReleasedVersion = getTagVersionFromNpm(baseVersion, tagArgument)
|
|
186
|
-
if (latestReleasedVersion) {
|
|
187
|
-
console.warn(`Latest published version for ${baseVersion} with tag ${tagArgument} is ${latestReleasedVersion}`)
|
|
188
|
-
publishTag = latestReleasedVersion
|
|
189
|
-
} else {
|
|
190
|
-
console.warn(`No published versions for ${baseVersion} with tag ${tagArgument}`)
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (packageJSON.version !== publishTag) {
|
|
195
|
-
console.warn(`Updating version in package.json from ${packageJSON.version} to ${publishTag}`)
|
|
196
|
-
packageJSON.version = publishTag
|
|
197
|
-
fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2))
|
|
198
|
-
|
|
199
|
-
// perform the same change to the package-lock.json
|
|
200
|
-
const packageLockJSON = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'))
|
|
201
|
-
packageLockJSON.version = publishTag
|
|
202
|
-
fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJSON, null, 2))
|
|
203
|
-
} else {
|
|
204
|
-
console.warn(`Version in package.json is already ${packageJSON.version}`)
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
console.log(publishTag)
|