JSPM

  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q68243F
  • License ISC

node sdk for open tapd

Package Exports

  • @tapd/tapd-node-sdk
  • @tapd/tapd-node-sdk/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tapd/tapd-node-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

简介 🐕🐕

主要用于调用TAPD api v2 接口的SDK<( ̄︶ ̄)↗[GO!]

推荐版本: NodeJs 12.13.0+

Install

安装SDK包

npm install @tapd/tapd-node-sdk

Usage

DEMO

const SDK = require('@tapd/tapd-node-sdk');

const api = new SDK({
    client: 'gggg123', // 你的应用CODE
    secret: '112A5B9F-D7B9-EC9C-B688-24E44F5043C4', // 密钥 注意保密
});


// api 详细文档可参考tapdAPI的文档
api.getStories({
    workspace_id: '755'
}).then(data => {
    console.log(data);
}).catch(e => console.log(e)); 

// 文件上传接口使用方式
var file = fs.createReadStream('your file path')

// 支持Buffer
// const {FILE}= require('@tencent/tapd-node-sdk');
// const { Readable } = require('stream');
// //Readable
// const file_stdout = Readable.from(bitmap);
// var file = new FILE({
//   stdout: file_stdout,
//   filename: 'test.jpg',
// });

api.uploadImage({
    workspace_id: "755", 
    image: file
}).then(data => {
    console.log(data);
}).catch(e => console.log(e));


api.uploadImage({
    workspace_id: "755", 
    image: file
}).then(data => {
    console.log(data);
}).catch(e => console.log(e));

查看所有SDK方法和参数