@tng/soa-node-tracker
v1.0.0
Published
SOA-TRACKER for Node ================
Downloads
4
Readme
SOA-TRACKER for Node
安装
yarn add @tng/soa-node-tracker
request 模块
- https://github.com/teambition/tws-auth
- https://github.com/teambition/node-teambition
使用
const SOAOrg = require('@tng/soa-node-tracker')
const TWSAuth = require('tws-auth')
const Teambition = require('teambition')
// use tws-auth
let twsAuth = new TWSAuth({ ... })
let soatracker = new SOAOrg({ twsAuth: twsAuth })
// use teambition
let teambition = new Teambition({ ... })
let soatracker = new SOAOrg({ teambition: teambition })
// create a track
let track = await soatracker.v1().tracks().create({
"_resourceId": "50c32afae8cf1439d35a87e6",
"_userId": "50c32afae8cf1439d35a87e6",
"operation": "foo",
"payload": {},
"resourceType": "bar",
"tags": [
"50c32afae8cf1439d35a87e6"
]
}
// query tracks
let track = await soatracker.v1().tracks().list()
测试
npm test
接口
tracks
- users()
- .tracks().create(): 提交用户的行为
- .tracks().delete(): 删除用户的行为记录
- .tracks().list(): 查询用户的行为记录