Code Monkey home page Code Monkey logo

china-carrier-iot-sdk's Introduction

**主流运营商物联网平台接口 SDK

功能说明

本 SDK 包含**移动、联通、电信三大运营商物联网平台的以下接口。

移动

  • 查询设备状态;
  • 查询使用流量;
  • 更改设备状态(库存期 -> 已激活);
  • 更改设备状态(已激活 -> 停机);
  • 更改设备状态(停机 -> 已激活);

联通

  • 查询设备详情;
  • 查询使用流量;
  • 更改设备状态;

电信

  • 查询设备详情;
  • 查询使用流量;
  • 更改设备状态;

TODO

  • 加入代码风格检测工具和格式化工具;
  • 加入编译命令;
  • 将几个接口相同的定义或者方法提到项目公有,并解决因为引入项目公共类型导致编译打包时目标文件夹目录错乱的问题;

移动

  • 打印日志;
  • 处理 Token 异常失效的问题;
  • 单元测试;

联通

  • 打印日志;
  • 单元测试;

电信

  • 单元测试;

SOAP

  • 打印日志
  • 处理文档中可能发生的异常;
  • 处理文档外可能发生的异常;

REST

  • 打印日志
  • 处理 Token 异常失效的问题;
  • 处理文档中可能发生的异常;
  • 处理文档外可能发生的异常;

开发

准备

首先全局安装一些项目开发用到的依赖包。

$ npm i -g lerna typescript ts-node

在项目根目录下安装依赖包,在每个 package 下面也同样安装对应的依赖。

$ yarn
$ lerna bootstrap

编译

进入到 package/ 下要编译的目录,运行以下命令即可编译成功。

$ rm -rf lib # 手动删除之前编译的包
$ tsc

代码格式化

在项目根目录下执行以下命令。

$ yarn lint
$ yarn prettier

发布

发布前准备

需要先根据本次发布的功能修改一下本次发布的版本号。

$ npm version <update_type>

发布

进入到 package/ 下要发布的包目录,运行以下命令。

$ npm publish

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.