diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml deleted file mode 100644 index 84517747..00000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Bug-Report -description: Report a Bug to help us improve -title: "Bug:" -labels: [bug] -assignees: "donavanbecker" -body: - - type: markdown - attributes: - value: | - You must use the issue template below when submitting a bug. - - type: input - attributes: - label: Describe The Bug - placeholder: A clear and concise description of what the bug is. - validations: - required: true - - type: input - attributes: - label: To Reproduce - placeholder: Steps to reproduce the behavior. - validations: - required: true - - type: input - attributes: - label: Expected behavior - placeholder: A clear and concise description of what you expected to happen. - validations: - required: true - - type: textarea - id: Logs - attributes: - label: Relevant log output - placeholder: Bug reports that do not contain logs may be closed without warning. - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 8a869089..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: SwitchBot (Official website) - url: https://www.switch-bot.com/ - about: The Offical SwitchBot Website. - - name: Facebook @SwitchBotRobot - url: https://www.facebook.com/SwitchBotRobot/ - about: The Offical SwitchBot Facebook Page. - - name: Twitter @SwitchBot - url: https://twitter.com/switchbot - about: The Offical SwitchBot Twitter. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml deleted file mode 100644 index ae155bb0..00000000 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Feature Request -description: Suggest an idea for this project -title: "Feature Request: " -labels: [enhancement] -assignees: "donavanbecker" -body: - - type: markdown - attributes: - value: | - You must use the issue template below when submitting a feature request. - - type: markdown - attributes: - value: | - Is your feature request related to a problem? Please describe. - - type: input - attributes: - label: Problem - placeholder: A clear and concise description of what the problem is. Ex. I am always frustrated when [...] - validations: - required: false - - type: input - attributes: - label: Solution - placeholder: A clear and concise description of what you want to happen. - validations: - required: true - - type: input - attributes: - label: Alternatives - placeholder: A clear and concise description of any alternative solutions or features you have considered. - validations: - required: false - - type: input - attributes: - label: Additional context - placeholder: Add any other context or screenshots about the feature request here. Post devicediscovery logs here. - validations: - required: false diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request.md b/.github/PULL_REQUEST_TEMPLATE/pull_request.md deleted file mode 100644 index 61c15a0e..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Enhancement -about: Contribute to Plugin through Pull Request -title: "" -labels: "enhancement" -assignees: "donavanbecker" ---- - -**Is your enhancement related to a problem? Please describe.** - - - -**Describe the solution you are addding** - - - -**Changes Proposed in this Pull Request** - - - -**Describe alternatives you've considered** - - - -**Additional context** - - diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml new file mode 100644 index 00000000..b4697d72 --- /dev/null +++ b/.github/workflows/beta-release.yml @@ -0,0 +1,31 @@ +name: Node-CI Beta + +on: + push: + branches: [beta-*.*.*, beta] + workflow_dispatch: + +jobs: + build_and_test: + uses: OpenWonderLabs/.github/.github/workflows/nodejs-build-and-test.yml@latest + with: + enable_coverage: true + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + lint: + needs: build_and_test + uses: OpenWonderLabs/.github/.github/workflows/eslint.yml@latest + + publish: + needs: lint + + if: ${{ github.repository == 'OpenWonderLabs/node-switchbot' }} + + uses: OpenWonderLabs/.github/.github/workflows/npm-publish.yml@latest + with: + tag: 'beta' + dynamically_adjust_version: true + npm_version_command: 'pre' + pre_id: 'beta' + secrets: + npm_auth_token: ${{ secrets.npm_token }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..45d93f00 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,18 @@ +name: Node Build + +on: + push: + branches: [latest] + pull_request: + workflow_dispatch: + +jobs: + build_and_test: + uses: OpenWonderLabs/.github/.github/workflows/nodejs-build-and-test.yml@latest + with: + enable_coverage: true + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + lint: + needs: build_and_test + uses: OpenWonderLabs/.github/.github/workflows/eslint.yml@latest diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f0550477..4fd93a25 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,70 +1,13 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: push: - branches: [latest] + branches: [ latest, beta* ] pull_request: - # The branches below must be a subset of the branches above - branches: [latest] + branches: [ latest, beta* ] schedule: - - cron: "25 20 * * 2" + - cron: '17 9 * * 2' jobs: analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["javascript"] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: OpenWonderLabs/.github/.github/workflows/codeql-analysis.yml@latest diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index d2b57b3f..36f19d83 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - beta + - beta jobs: automerge: diff --git a/.github/workflows/label.yml b/.github/workflows/labeler.yml similarity index 60% rename from .github/workflows/label.yml rename to .github/workflows/labeler.yml index 95d18dc3..caaf78d5 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/labeler.yml @@ -3,16 +3,14 @@ # # To use this workflow, you will need to set up a .github/labeler.yml # file with configuration. For more information, see: -# https://github.com/actions/labeler/blob/master/README.md +# https://github.com/actions/labeler/blob/main/README.md name: Labeler + on: [pull_request] jobs: label: - runs-on: ubuntu-latest - - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + uses: OpenWonderLabs/.github/.github/workflows/labeler.yml@latest + secrets: + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/nodejs-beta.yml b/.github/workflows/nodejs-beta.yml deleted file mode 100644 index 1ba20696..00000000 --- a/.github/workflows/nodejs-beta.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - -name: Beta - -on: - push: - branches: - - beta - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: npm install - run: | - npm install - env: - CI: true - - publish-npm: - if: github.repository == 'OpenWonderLabs/node-switchbot' - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: node .github/workflows/prerelease.js - - run: npm --no-git-tag-version version prerelease --preid=beta - - run: npm publish --tag=beta - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index d3a06d57..00000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Latest - -on: - push: - branches: latest - pull_request: - release: # Run when release is created - types: [created] - -jobs: - build: - strategy: - matrix: - node-version: [14.x, 16.x] - os: [ubuntu-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: npm install - run: | - npm install - env: - CI: true - - publish-npm: - # publish only if we are on our own repo, event was 'release' (a tag was created) and the tag starts with "v" (aka version tag) - if: github.repository == 'OpenWonderLabs/node-switchbot' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') - needs: build # only run if build succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 # use the minimum required version - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.npm_token }} diff --git a/.github/workflows/old-workflow.zip b/.github/workflows/old-workflow.zip new file mode 100644 index 00000000..334ca41b Binary files /dev/null and b/.github/workflows/old-workflow.zip differ diff --git a/.github/workflows/prerelease.js b/.github/workflows/prerelease.js deleted file mode 100644 index 67692a32..00000000 --- a/.github/workflows/prerelease.js +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/env node - -const fs = require('fs'); -const semver = require('semver'); -const child_process = require('child_process'); - -function getTagVersionFromNpm(tag) { - try { - return child_process.execSync(`npm info ${package.name} version --tag="${tag}"`).toString('utf8').trim(); - } catch (e) { - return null; - } -} - -// load package.json -const package = JSON.parse(fs.readFileSync('package.json', 'utf8')); - -// work out the correct tag -const currentLatest = getTagVersionFromNpm('latest') || '0.0.0'; -const currentBeta = getTagVersionFromNpm('beta') || '0.0.0'; -const latestNpmTag = semver.gt(currentBeta, currentLatest, { - includePrerelease: true, -}) - ? currentBeta - : currentLatest; -const publishTag = semver.gt(package.version, latestNpmTag, { - includePrerelease: true, -}) - ? package.version - : latestNpmTag; - -// save the package.json -package.version = publishTag; -fs.writeFileSync('package.json', JSON.stringify(package, null, 4)); diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..87e9ab56 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: [latest] + pull_request: # required for autolabeler + types: [opened, reopened, synchronize] + workflow_dispatch: + +jobs: + stale: + uses: OpenWonderLabs/.github/.github/workflows/release-drafter.yml@latest + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2c856835 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Node Release + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + +jobs: + build_and_test: + uses: OpenWonderLabs/.github/.github/workflows/nodejs-build-and-test.yml@latest + with: + enable_coverage: true + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + + publish: + needs: build_and_test + + if: ${{ github.repository == 'OpenWonderLabs/node-switchbot' }} + + uses: OpenWonderLabs/.github/.github/workflows/npm-publish.yml@latest + secrets: + npm_auth_token: ${{ secrets.npm_token }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 25faafef..c3b7181e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,28 +1,12 @@ -name: Stale +name: Stale workflow on: - issues: - types: [reopened] + workflow_dispatch: schedule: - - cron: '*/60 * * * *' + - cron: '45 11 * * *' jobs: stale: - runs-on: ubuntu-latest - env: - ACTIONS_STEP_DEBUG: true - steps: - - uses: actions/stale@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' - stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' - stale-issue-label: 'stale' - stale-pr-label: 'stale' - days-before-stale: 30 - days-before-close: 5 - exempt-issue-labels: 'pinned' - exempt-pr-labels: 'awaiting-approval,work-in-progress' - remove-stale-when-updated: true - close-issue-message: 'This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.' - close-pr-message: 'This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.' + uses: OpenWonderLabs/.github/.github/workflows/stale.yml@latest + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d263ba2c..0c25b1a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [Version 1.5.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v1.5.0) (2022-08-27) + +## What's Changed + +- Added Color Bulb & Strip Light Support +- Fixed issue that caused excessive logging. + +**Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v1.4.1...v1.5.0 + ## [Version 1.4.1](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v1.4.1) (2022-08-27) ## What's Changed diff --git a/lib/switchbot-advertising.js b/lib/switchbot-advertising.js index ef8f6b4c..f4202854 100644 --- a/lib/switchbot-advertising.js +++ b/lib/switchbot-advertising.js @@ -75,7 +75,7 @@ class SwitchbotAdvertising { !Buffer.isBuffer(manufacturerData) || manufacturerData.length < 3; - if (bufIsInvalid && manufacturerDataIsInvalid) { + if (bufIsInvalid || manufacturerDataIsInvalid) { return null; } @@ -83,41 +83,29 @@ class SwitchbotAdvertising { let sd = null; if (model === "H") { - // WoHand - sd = this._parseServiceDataForWoHand(buf, onlog); + sd = this._parseServiceDataForWoHand(buf, onlog);//WoHand } else if (model === "T") { - // WoSensorTH - sd = this._parseServiceDataForWoSensorTH(buf, onlog); + sd = this._parseServiceDataForWoSensorTH(buf, onlog);//WoSensorTH } else if (model === "e") { - // WoHumi - sd = this._parseServiceDataForWoHumi(buf, onlog); + sd = this._parseServiceDataForWoHumi(buf, onlog);//WoHumi } else if (model === "s") { - // WoMotion - sd = this._parseServiceDataForWoPresence(buf, onlog); + sd = this._parseServiceDataForWoPresence(buf, onlog);//WoPresence } else if (model === "d") { - // WoContact - sd = this._parseServiceDataForWoContact(buf, onlog); + sd = this._parseServiceDataForWoContact(buf, onlog);//WoContact } else if (model === "c") { - // WoCurtain - sd = this._parseServiceDataForWoCurtain(buf, onlog); + sd = this._parseServiceDataForWoCurtain(buf, onlog);// WoCurtain } else if (model === "u") { - // WoColorBulb - sd = this._parseServiceDataForWoColorBulb(buf, onlog); + sd = this._parseServiceDataForWoBulb(manufacturerData, onlog);// WoBulb } else if (model === "g") { - // WoPlugMini (US) - sd = this._parseServiceDataForWoPlugMiniUS(manufacturerData, onlog); + sd = this._parseServiceDataForWoPlugMiniUS(manufacturerData, onlog); // WoPlugMini (US) } else if (model === "j") { - // WoPlugMini (JP) - sd = this._parseServiceDataForWoPlugMiniJP(manufacturerData, onlog); + sd = this._parseServiceDataForWoPlugMiniJP(manufacturerData, onlog);// WoPlugMini (JP) } else if (model === "o") { - // WoSmartLock - sd = this._parseServiceDataForWoSmartLock(buf, onlog); + sd = this._parseServiceDataForWoSmartLock(buf, onlog);// WoSmartLock } else if (model === "i") { - // WoMeterPlus - sd = this._parseServiceDataForWoSensorTHPlus(buf, onlog); + sd = this._parseServiceDataForWoSensorTHPlus(buf, onlog);// WoMeterPlus } else if (model === "r") { - // WoLEDStripLight - sd = this._parseServiceDataForWoLEDStripLight(buf, onlog); + sd = this._parseServiceDataForWoStrip(buf, onlog);// WoStrip } else { if (onlog && typeof onlog === "function") { onlog( @@ -363,25 +351,49 @@ class SwitchbotAdvertising { return data; } - _parseServiceDataForWoColorBulb(buf, onlog) { - if (buf.length !== 6) { + _parseServiceDataForWoBulb(buf, onlog) { + if (buf.length !== 13) { if (onlog && typeof onlog === "function") { onlog( - `[_parseServiceDataForWoColorBulb] Buffer length ${buf.length} !== 6!` + `[_parseServiceDataForWoBulb] Buffer length ${buf.length} !== 13!` ); } return null; } - let byte1 = buf.readUInt8(1); - let byte2 = buf.readUInt8(2); - // let byte3 = buf.readUInt8(3); - // let byte4 = buf.readUInt8(4); - let byte5 = buf.readUInt8(5); + const byte9 = buf.readUInt8(9); // byte9: color bulb state; 0x00=off, 0x80=on & lightLevel: 1~100% + //const byte10 = buf.readUInt8(10); // byte10: bit0: 0=no delay,1=delay, bit1:0=no timer, 1=timer; bit2:0=no sync time, 1=sync'ed time + //const byte11 = buf.readUInt8(11); // byte11: wifi rssi + //const byte12 = buf.readUInt8(12); // byte12: bit7: overload? + //const byte13 = buf.readUInt8(13); // byte12[bit0~6] + byte13: current power value + + const state = byte9 === 0x01 ? "off" : byte9 === 0x80 ? "on" : null; + const lightLevel = byte9 & 0b00000011; + //const delay = !!(byte10 & 0b00000001); + //const networkStatus = !!(byte10 & 0b00000001); + //const statePreset = !!(byte10 & 0b00000010); + //const lightState = !!(byte10 & 0b00000100); + //const wifiRssi = byte11; + //const dynamicRate = !!(byte12 & 0b10000000); + //const loopIndex = (((byte12 & 0b01111111) << 8) + byte13) / 10; // in watt - let data = { + const data = { model: "u", - modelName: "WoColorBulb", + modelName: "WoBulb", + state: state, }; + /* const data = { + model: "u", + modelName: "WoBulb", + state: state, + lightLevel: lightLevel, + delay: delay, + networkStatus: networkStatus, + statePreset: statePreset, + lightState: lightState, + wifiRssi: wifiRssi, + dynamicRate: dynamicRate, + loopIndex: loopIndex, + };*/ return data; } @@ -425,8 +437,6 @@ class SwitchbotAdvertising { return data; } - - _parseServiceDataForWoPlugMiniJP(buf, onlog) { if (buf.length !== 14) { if (onlog && typeof onlog === "function") { @@ -530,25 +540,49 @@ class SwitchbotAdvertising { return data; } - _parseServiceDataForWoLEDStripLight(buf, onlog) { - if (buf.length !== 6) { + _parseServiceDataForWoStrip(buf, onlog) { + if (buf.length !== 18) { if (onlog && typeof onlog === "function") { onlog( - `[_parseServiceDataForWoLEDStripLight] Buffer length ${buf.length} !== 6!` + `[_parseServiceDataForWoStrip] Buffer length ${buf.length} !== 18!` ); } return null; } - let byte1 = buf.readUInt8(1); - let byte2 = buf.readUInt8(2); - // let byte3 = buf.readUInt8(3); - // let byte4 = buf.readUInt8(4); - let byte5 = buf.readUInt8(5); + const byte9 = buf.readUInt8(9); // byte9: color bulb state; 0x00=off, 0x80=on & lightLevel: 1~100% + //const byte10 = buf.readUInt8(10); // byte10: bit0: 0=no delay,1=delay, bit1:0=no timer, 1=timer; bit2:0=no sync time, 1=sync'ed time + //const byte11 = buf.readUInt8(11); // byte11: wifi rssi + //const byte12 = buf.readUInt8(12); // byte12: bit7: overload? + //const byte13 = buf.readUInt8(13); // byte12[bit0~6] + byte13: current power value + + const state = byte9 === 0x01 ? "off" : byte9 === 0x80 ? "on" : null; + //const lightLevel = byte9 & 0b00000011; + //const delay = !!(byte10 & 0b00000001); + //const networkStatus = !!(byte10 & 0b00000001); + //const statePreset = !!(byte10 & 0b00000010); + //const lightState = !!(byte10 & 0b00000100); + //const wifiRssi = byte11; + //const dynamicRate = !!(byte12 & 0b10000000); + //const loopIndex = (((byte12 & 0b01111111) << 8) + byte13) / 10; // in watt - let data = { + const data = { model: "r", - modelName: "WoLEDStripLight", + modelName: "WoStrip", + state: state, }; + /* const data = { + model: "u", + modelName: "WoBulb", + state: state, + lightLevel: lightLevel, + delay: delay, + networkStatus: networkStatus, + statePreset: statePreset, + lightState: lightState, + wifiRssi: wifiRssi, + dynamicRate: dynamicRate, + loopIndex: loopIndex, + };*/ return data; } diff --git a/lib/switchbot-device-wobulb.js b/lib/switchbot-device-wobulb.js new file mode 100644 index 00000000..1b0c7048 --- /dev/null +++ b/lib/switchbot-device-wobulb.js @@ -0,0 +1,81 @@ +"use strict"; +const SwitchbotDevice = require("./switchbot-device.js"); + +/** + * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/colorbulb.md + */ +class SwitchbotDeviceWoBulb extends SwitchbotDevice { + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + readState() { + return this._operateBot([0x57, 0x0f, 0x48, 0x01]); + } + + /** + * @private + */ + _setState(reqByteArray) { + const base = [0x57, 0x0f, 0x47, 0x01]; + return this._operateBot([].concat(base, reqByteArray)); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + turnOn() { + return this._setState([0x01, 0x01]); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + turnOff() { + return this._setState([0x01, 0x02]); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + toggle() { + return this._setState([0x02, 0x03]); + } + + /** + * @private + */ + _operateBot(bytes) { + const req_buf = Buffer.from(bytes); + return new Promise((resolve, reject) => { + this._command(req_buf) + .then((res_bytes) => { + const res_buf = Buffer.from(res_bytes); + if (res_buf.length === 2) { + let code = res_buf.readUInt8(1); + if (code === 0x00 || code === 0x80) { + const is_on = code === 0x80; + resolve(is_on); + } else { + reject( + new Error( + "The device returned an error: 0x" + res_buf.toString("hex") + ) + ); + } + } else { + reject( + new Error( + "Expecting a 2-byte response, got instead: 0x" + + res_buf.toString("hex") + ) + ); + } + }) + .catch((error) => { + reject(error); + }); + }); + } +} + +module.exports = SwitchbotDeviceWoBulb; diff --git a/lib/switchbot-device-wostrip.js b/lib/switchbot-device-wostrip.js new file mode 100644 index 00000000..ada1fb68 --- /dev/null +++ b/lib/switchbot-device-wostrip.js @@ -0,0 +1,81 @@ +"use strict"; +const SwitchbotDevice = require("./switchbot-device.js"); + +/** + * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/colorbulb.md + */ +class SwitchbotDeviceWoStrip extends SwitchbotDevice { + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + readState() { + return this._operateBot([0x57, 0x0f, 0x4A, 0x01]); + } + + /** + * @private + */ + _setState(reqByteArray) { + const base = [0x57, 0x0f, 0x49, 0x01]; + return this._operateBot([].concat(base, reqByteArray)); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + turnOn() { + return this._setState([0x01, 0x01]); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + turnOff() { + return this._setState([0x01, 0x02]); + } + + /** + * @returns {Promise} resolves with a boolean that tells whether the plug in ON(true) or OFF(false) + */ + toggle() { + return this._setState([0x02, 0x03]); + } + + /** + * @private + */ + _operateBot(bytes) { + const req_buf = Buffer.from(bytes); + return new Promise((resolve, reject) => { + this._command(req_buf) + .then((res_bytes) => { + const res_buf = Buffer.from(res_bytes); + if (res_buf.length === 2) { + let code = res_buf.readUInt8(1); + if (code === 0x00 || code === 0x80) { + const is_on = code === 0x80; + resolve(is_on); + } else { + reject( + new Error( + "The device returned an error: 0x" + res_buf.toString("hex") + ) + ); + } + } else { + reject( + new Error( + "Expecting a 2-byte response, got instead: 0x" + + res_buf.toString("hex") + ) + ); + } + }) + .catch((error) => { + reject(error); + }); + }); + } +} + +module.exports = SwitchbotDeviceWoStrip; diff --git a/lib/switchbot.js b/lib/switchbot.js index 7f079fec..3eac618e 100644 --- a/lib/switchbot.js +++ b/lib/switchbot.js @@ -10,6 +10,8 @@ const SwitchbotDeviceWoContact = require("./switchbot-device-wocontact.js"); const SwitchbotDeviceWoSensorTH = require("./switchbot-device-wosensorth.js"); const SwitchbotDeviceWoHumi = require("./switchbot-device-wohumi.js"); const SwitchbotDeviceWoPlugMini = require("./switchbot-device-woplugmini.js"); +const SwitchbotDeviceWoBulb = require("./switchbot-device-wobulb.js"); +const SwitchbotDeviceWoStrip = require("./switchbot-device-wostrip.js"); class Switchbot { /* ------------------------------------------------------------------ @@ -226,7 +228,7 @@ class Switchbot { device = new SwitchbotDeviceWoCurtain(peripheral, this.noble); break; case "u": - device = new SwitchbotDeviceWoColorBulb(peripheral, this.noble); + device = new SwitchbotDeviceWoBulb(peripheral, this.noble); break; case "g": case "j": @@ -239,7 +241,7 @@ class Switchbot { device = new SwitchbotDeviceWoSensorTHPlus(peripheral, this.noble); break; case "r": - device = new SwitchbotDeviceWoLEDStripLight(peripheral, this.noble); + device = new SwitchbotDeviceWoStrip(peripheral, this.noble); break; default: // 'resetting', 'unknown' device = new SwitchbotDevice(peripheral, this.noble); diff --git a/package-lock.json b/package-lock.json index 4e95e1b7..57971f96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "node-switchbot", - "version": "1.4.1", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "node-switchbot", - "version": "1.4.1", + "version": "1.5.0", "license": "MIT", "dependencies": { "@abandonware/noble": "^1.9.2-15" }, "devDependencies": { - "npm-check-updates": "^16.0.6" + "npm-check-updates": "^16.3.8" } }, "node_modules/@abandonware/bluetooth-hci-socket": { @@ -65,9 +65,9 @@ "dev": true }, "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", - "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", "optional": true, "dependencies": { "detect-libc": "^2.0.0", @@ -276,54 +276,12 @@ "node": ">= 10" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, - "node_modules/@types/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==", - "dev": true - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "18.7.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", - "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", - "dev": true - }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -388,9 +346,9 @@ } }, "node_modules/ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.1.tgz", + "integrity": "sha512-qDOv24WjnYuL+wbwHdlsYZFy+cgPtrYw0Tn7GLORicQp9BkQLzrgI3Pm4VyR9ERZ41YTn7KlMPuL1n05WdZvmg==", "dev": true, "engines": { "node": ">=12" @@ -577,54 +535,30 @@ } }, "node_modules/cacheable-lookup": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", - "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, "engines": { - "node": ">=10.6.0" + "node": ">=14.16" } }, "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.1.tgz", + "integrity": "sha512-3tLJyBjGuXw1s5gpKFSG3iS4kaKT4id04dZi98wzHQp/8cqZNweBnrF9J+rrlvrf4M53OdtDGNctNHFias8BEA==", "dev": true, "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.0", + "keyv": "^4.5.0", + "mimic-response": "^4.0.0", + "normalize-url": "^7.1.0", + "responselike": "^3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, "engines": { - "node": ">=8" + "node": ">=14.16" } }, "node_modules/camelcase": { @@ -640,9 +574,9 @@ } }, "node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.0.tgz", + "integrity": "sha512-56zD4khRTBoIyzUYAFgDDaPhUMN/fC/rySe6aZGqbj/VWiU2eI3l6ZLOtYGFZAV5v02mwPjtpzlrOveJiz5eZQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -661,9 +595,9 @@ } }, "node_modules/ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", + "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", "dev": true }, "node_modules/clean-stack": { @@ -699,18 +633,6 @@ "node": ">= 0.2.0" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", @@ -730,27 +652,14 @@ } }, "node_modules/commander": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", - "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", + "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", "dev": true, "engines": { "node": "^12.20.0 || >=14" } }, - "node_modules/compress-brotli": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz", - "integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==", - "dev": true, - "dependencies": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" - }, - "engines": { - "node": ">= 12" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -958,15 +867,6 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -995,9 +895,9 @@ } }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1054,9 +954,9 @@ } }, "node_modules/form-data-encoder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.0.tgz", - "integrity": "sha512-njK60LnfhfDWy+AEUIf9ZQNRAcmXCdDfiNOm2emuPtzwh7U9k/mo9F3S54aPiaZ3vhqUjikVLfcPg2KuBddskQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true, "engines": { "node": ">= 14.17" @@ -1206,24 +1106,22 @@ } }, "node_modules/got": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.3.1.tgz", - "integrity": "sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw==", + "version": "12.5.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.1.tgz", + "integrity": "sha512-sD16AK8cCyUoPtKr/NMvLTFFa+T3i3S+zoiuvhq0HP2YiqBZA9AtlBjAdsQBsLBK7slPuvmfE0OxhGi7N5dD4w==", "dev": true, "dependencies": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", - "form-data-encoder": "^2.0.1", + "form-data-encoder": "^2.1.2", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.10", "lowercase-keys": "^3.0.0", "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" + "responselike": "^3.0.0" }, "engines": { "node": ">=14.16" @@ -1635,12 +1533,11 @@ ] }, "node_modules/keyv": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.4.1.tgz", - "integrity": "sha512-PzByhNxfBLnSBW2MZi1DF+W5+qB/7BMpOokewqIvqS8GFtP7xHm2oeGU72Y1fhtfOv/FiEnI4+nyViYDmUChnw==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", + "integrity": "sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA==", "dev": true, "dependencies": { - "compress-brotli": "^1.3.8", "json-buffer": "3.0.1" } }, @@ -1784,12 +1681,15 @@ } }, "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, "engines": { - "node": ">=4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimatch": { @@ -1968,16 +1868,16 @@ } }, "node_modules/node-gyp": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", - "integrity": "sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.2.0.tgz", + "integrity": "sha512-/+/YxGfIJOh/fnMsr4Ep0v6oOIjnO1BgLd2dcDspBX1spTkQU7xSIox5RdRE/2/Uq3ZwK8Z5swRIbMUmPlslmg==", "dev": true, "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", @@ -2076,6 +1976,21 @@ "node": "*" } }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dev": true, + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/node-gyp/node_modules/npmlog": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", @@ -2095,7 +2010,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "devOptional": true, + "optional": true, "dependencies": { "abbrev": "1" }, @@ -2122,12 +2037,12 @@ } }, "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", + "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2143,26 +2058,26 @@ } }, "node_modules/npm-check-updates": { - "version": "16.0.6", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.0.6.tgz", - "integrity": "sha512-lASxdKqOGAkxriOLuscNM93V3L92tU/9uWepyqeKN7UPtd6oPKM/J/CYg0ll4Mxm2YvqzB21IaGHJq0vsHm3Ag==", + "version": "16.3.8", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.3.8.tgz", + "integrity": "sha512-2CUeCWEs+arWQUJH2IEkiZU/Ak2fLBqGkMyM5JDkfnGhz1VHNe3yyGiXD+0JeVmjbXTEpgZ0t6C9VK52atGuAw==", "dev": true, "dependencies": { "chalk": "^5.0.1", "cli-table": "^0.3.11", - "commander": "^9.4.0", + "commander": "^9.4.1", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", "get-stdin": "^8.0.0", "globby": "^11.0.4", - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^5.1.0", "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", "minimatch": "^5.1.0", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^2.5.1", @@ -2173,6 +2088,7 @@ "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", + "untildify": "^4.0.0", "update-notifier": "^6.0.2", "yaml": "^2.1.1" }, @@ -2203,9 +2119,9 @@ "dev": true }, "node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { "hosted-git-info": "^5.0.0", @@ -2542,16 +2458,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", @@ -2735,26 +2641,20 @@ "dev": true }, "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "dependencies": { - "lowercase-keys": "^2.0.0" + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/responselike/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -2881,9 +2781,9 @@ "optional": true }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "devOptional": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2966,9 +2866,9 @@ } }, "node_modules/socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "dependencies": { "ip": "^2.0.0", @@ -3204,6 +3104,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/update-notifier": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", @@ -3489,9 +3398,9 @@ "devOptional": true }, "node_modules/yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", + "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==", "dev": true, "engines": { "node": ">= 14" @@ -3540,9 +3449,9 @@ "dev": true }, "@mapbox/node-pre-gyp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", - "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", "optional": true, "requires": { "detect-libc": "^2.0.0", @@ -3697,54 +3606,12 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "dev": true, - "requires": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, "@types/http-cache-semantics": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, - "@types/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==", - "dev": true - }, - "@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "18.7.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", - "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", - "dev": true - }, - "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -3797,9 +3664,9 @@ "devOptional": true }, "ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.1.tgz", + "integrity": "sha512-qDOv24WjnYuL+wbwHdlsYZFy+cgPtrYw0Tn7GLORicQp9BkQLzrgI3Pm4VyR9ERZ41YTn7KlMPuL1n05WdZvmg==", "dev": true }, "aproba": { @@ -3946,41 +3813,24 @@ } }, "cacheable-lookup": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", - "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true }, "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.1.tgz", + "integrity": "sha512-3tLJyBjGuXw1s5gpKFSG3iS4kaKT4id04dZi98wzHQp/8cqZNweBnrF9J+rrlvrf4M53OdtDGNctNHFias8BEA==", "dev": true, "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "dependencies": { - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.0", + "keyv": "^4.5.0", + "mimic-response": "^4.0.0", + "normalize-url": "^7.1.0", + "responselike": "^3.0.0" } }, "camelcase": { @@ -3990,9 +3840,9 @@ "dev": true }, "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.0.tgz", + "integrity": "sha512-56zD4khRTBoIyzUYAFgDDaPhUMN/fC/rySe6aZGqbj/VWiU2eI3l6ZLOtYGFZAV5v02mwPjtpzlrOveJiz5eZQ==", "dev": true }, "chownr": { @@ -4002,9 +3852,9 @@ "devOptional": true }, "ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", + "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", "dev": true }, "clean-stack": { @@ -4028,15 +3878,6 @@ "colors": "1.0.3" } }, - "clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, "color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", @@ -4050,21 +3891,11 @@ "dev": true }, "commander": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", - "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", + "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", "dev": true }, - "compress-brotli": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz", - "integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==", - "dev": true, - "requires": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4219,15 +4050,6 @@ "iconv-lite": "^0.6.2" } }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, "env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -4247,9 +4069,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -4294,9 +4116,9 @@ } }, "form-data-encoder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.0.tgz", - "integrity": "sha512-njK60LnfhfDWy+AEUIf9ZQNRAcmXCdDfiNOm2emuPtzwh7U9k/mo9F3S54aPiaZ3vhqUjikVLfcPg2KuBddskQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true }, "fp-and-or": { @@ -4401,24 +4223,22 @@ } }, "got": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.3.1.tgz", - "integrity": "sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw==", + "version": "12.5.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.1.tgz", + "integrity": "sha512-sD16AK8cCyUoPtKr/NMvLTFFa+T3i3S+zoiuvhq0HP2YiqBZA9AtlBjAdsQBsLBK7slPuvmfE0OxhGi7N5dD4w==", "dev": true, "requires": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", - "form-data-encoder": "^2.0.1", + "form-data-encoder": "^2.1.2", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.10", "lowercase-keys": "^3.0.0", "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" + "responselike": "^3.0.0" } }, "graceful-fs": { @@ -4731,12 +4551,11 @@ "dev": true }, "keyv": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.4.1.tgz", - "integrity": "sha512-PzByhNxfBLnSBW2MZi1DF+W5+qB/7BMpOokewqIvqS8GFtP7xHm2oeGU72Y1fhtfOv/FiEnI4+nyViYDmUChnw==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", + "integrity": "sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA==", "dev": true, "requires": { - "compress-brotli": "^1.3.8", "json-buffer": "3.0.1" } }, @@ -4840,9 +4659,9 @@ } }, "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true }, "minimatch": { @@ -4975,16 +4794,16 @@ } }, "node-gyp": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", - "integrity": "sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.2.0.tgz", + "integrity": "sha512-/+/YxGfIJOh/fnMsr4Ep0v6oOIjnO1BgLd2dcDspBX1spTkQU7xSIox5RdRE/2/Uq3ZwK8Z5swRIbMUmPlslmg==", "dev": true, "requires": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", @@ -5051,6 +4870,15 @@ "brace-expansion": "^1.1.7" } }, + "nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dev": true, + "requires": { + "abbrev": "^1.0.0" + } + }, "npmlog": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", @@ -5075,7 +4903,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "devOptional": true, + "optional": true, "requires": { "abbrev": "1" } @@ -5093,9 +4921,9 @@ } }, "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", + "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", "dev": true }, "npm-bundled": { @@ -5108,26 +4936,26 @@ } }, "npm-check-updates": { - "version": "16.0.6", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.0.6.tgz", - "integrity": "sha512-lASxdKqOGAkxriOLuscNM93V3L92tU/9uWepyqeKN7UPtd6oPKM/J/CYg0ll4Mxm2YvqzB21IaGHJq0vsHm3Ag==", + "version": "16.3.8", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.3.8.tgz", + "integrity": "sha512-2CUeCWEs+arWQUJH2IEkiZU/Ak2fLBqGkMyM5JDkfnGhz1VHNe3yyGiXD+0JeVmjbXTEpgZ0t6C9VK52atGuAw==", "dev": true, "requires": { "chalk": "^5.0.1", "cli-table": "^0.3.11", - "commander": "^9.4.0", + "commander": "^9.4.1", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", "get-stdin": "^8.0.0", "globby": "^11.0.4", - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^5.1.0", "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", "minimatch": "^5.1.0", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^2.5.1", @@ -5138,6 +4966,7 @@ "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", + "untildify": "^4.0.0", "update-notifier": "^6.0.2", "yaml": "^2.1.1" } @@ -5158,9 +4987,9 @@ "dev": true }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -5408,16 +5237,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", @@ -5549,20 +5368,12 @@ "dev": true }, "responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "requires": { - "lowercase-keys": "^2.0.0" - }, - "dependencies": { - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } + "lowercase-keys": "^3.0.0" } }, "retry": { @@ -5643,9 +5454,9 @@ "optional": true }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "devOptional": true, "requires": { "lru-cache": "^6.0.0" @@ -5708,9 +5519,9 @@ "dev": true }, "socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "requires": { "ip": "^2.0.0", @@ -5897,6 +5708,12 @@ "crypto-random-string": "^4.0.0" } }, + "untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true + }, "update-notifier": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", @@ -6115,9 +5932,9 @@ "devOptional": true }, "yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", + "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==", "dev": true }, "yocto-queue": { diff --git a/package.json b/package.json index a67a8fb8..61950b86 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "node-switchbot", - "version": "1.4.1", - "description": "The node-switchbot is a Node.js module which allows you to move your Switchbot (Bot)'s arm and Switchbot Curtain(Curtain), also monitor the temperature/humidity from SwitchBot Thermometer & Hygrometer (Meter).", + "version": "1.5.0", + "description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).", "main": "./lib/switchbot.js", "files": [ "lib" @@ -25,7 +25,7 @@ "Bluetooth smart", "Bluetooth" ], - "homepage": "https://github.com/OpenWonderLabs", + "homepage": "https://github.com/OpenWonderLabs/node-switchbot", "author": "OpenWonderLabs (https://github.com/OpenWonderLabs)", "license": "MIT", "repository": { @@ -37,6 +37,6 @@ "@abandonware/noble": "^1.9.2-15" }, "devDependencies": { - "npm-check-updates": "^16.0.6" + "npm-check-updates": "^16.3.8" } } \ No newline at end of file