npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quec-wx-mp/api-ota

v1.0.0

Published

OTA

Readme

设备升级

设备升级模块,提供设备升级计划查询、批量确认升级计划和批量查询升级详情等API。

安装

npm install @quec-wx-mp/api-ota
import apiOTA from '@quec-wx-mp/api-ota'
const plugin = requirePlugin('quecPlugin')

plugin.use(apiOTA)

API 列表

| 方法 | 说明 | | ----------------------- | -------------------- | | getDeviceUpgradePlan | 查询设备升级计划 | | userBatchConfirmUpgrade | 用户批量确认升级计划 | | getBatchUpgradeDetails | 批量查询设备升级详情 |


API 详细说明

1) 查询设备升级计划

接口名称

getDeviceUpgradePlan

功能描述

CLOAT-OTA 查询设备升级计划。

参数

| 属性 | 类型 | 默认值 | 必填 | 说明 | | ------------- | ------------ | ------ | ---- | ------------------------------------------------ | | deviceKey | string | - | 是 | 设备 deviceKey | | productKey | string | - | 是 | 产品 productKey | | moduleVersion | string | - | 是 | 模组版本 | | mcuVersions | McuVersion[] | - | 是 | MCU 版本列表,元素结构:{ componentNo, version } | | success | function | - | 否 | 成功回调 | | fail | function | - | 否 | 失败回调 | | complete | function | - | 否 | 结束回调 |

返回数据

  • success(res):接口成功响应,res.data 为设备升级计划信息。

示例代码

plugin.ota.getDeviceUpgradePlan({
  deviceKey: 'device_key',
  productKey: 'product_key',
  moduleVersion: '1.0.0',
  mcuVersions: [
    {
      componentNo: 'MCU_MAIN',
      version: '1.0.0'
    }
  ],
  success(res) {
    console.log(res)
  },
  fail(err) {
    console.log(JSON.stringify(err))
  },
  complete() {}
})

2) 用户批量确认升级计划

接口名称

userBatchConfirmUpgrade

功能描述

用户批量确认升级计划。

参数

| 属性 | 类型 | 默认值 | 必填 | 说明 | | -------- | -------------------------- | ------ | ---- | -------------------- | | arr | BatchConfirmUpgradeParam[] | - | 是 | 批量确认升级参数列表 | | success | function | - | 否 | 成功回调 | | fail | function | - | 否 | 失败回调 | | complete | function | - | 否 | 结束回调 |

arr 元素字段说明:

| 字段 | 类型 | 必填 | 说明 | | ---------------- | ------ | ---- | ------------------------------------------------- | | deviceKey | string | 是 | 设备 deviceKey | | productKey | string | 是 | 产品 productKey | | operType | number | 是 | 操作类型(1 马上升级,2 预约升级) | | planId | number | 是 | 计划 ID | | appointStartTime | number | 否 | 预约升级开始时间(毫秒时间戳,operType=2 时必传) | | appointEndTime | number | 否 | 预约升级结束时间(毫秒时间戳,operType=2 时必传) |

返回数据

  • success(res):接口成功响应,res.data 为批量确认结果。

示例代码

plugin.ota.userBatchConfirmUpgrade({
  arr: [
    {
      deviceKey: 'device_key',
      productKey: 'product_key',
      operType: 1,
      planId: 1001
    }
  ],
  success(res) {
    console.log(res)
  },
  fail(err) {
    console.log(JSON.stringify(err))
  },
  complete() {}
})

3) 批量查询设备升级详情

接口名称

getBatchUpgradeDetails

功能描述

批量查询设备升级详情。

参数

| 属性 | 类型 | 默认值 | 必填 | 说明 | | -------- | -------------------------- | ------ | ---- | ---------------- | | arr | BatchUpgradeDetailsParam[] | - | 是 | 批量查询参数列表 | | success | function | - | 否 | 成功回调 | | fail | function | - | 否 | 失败回调 | | complete | function | - | 否 | 结束回调 |

arr 元素字段说明:

| 字段 | 类型 | 必填 | 说明 | | ---------- | ------ | ---- | --------------- | | deviceKey | string | 是 | 设备 deviceKey | | productKey | string | 是 | 产品 productKey | | planId | number | 是 | 计划 ID |

返回数据

  • success(res):接口成功响应,res.data 为升级详情列表。

示例代码

plugin.ota.getBatchUpgradeDetails({
  arr: [
    {
      deviceKey: 'device_key',
      productKey: 'product_key',
      planId: 1001
    }
  ],
  success(res) {
    console.log(res)
  },
  fail(err) {
    console.log(JSON.stringify(err))
  },
  complete() {}
})