@tng/soa-node-org

1.3.1 • Public • Published

SOA-ORG for Node

安装

yarn add @tng/soa-node-org

request 模块

使用

const SOAOrg = require('@tng/soa-node-org')
const TWSAuth = require('tws-auth')
const Teambition = require('teambition')

// use tws-auth
let twsAuth = new TWSAuth({ ... })
let soaorg = new SOAOrg({ twsAuth: twsAuth })

// use teambition
let teambition = new Teambition({ ... })
let soaorg = new SOAOrg({ teambition: teambition })

let orgInfo = yield soaorg.organizations('org id').info()
console.log(orgInfo)

// set timeout
let orgInfo = yield soaorg.organizations('org id').info().exec({
  timeout: 5000
})
console.log(orgInfo)

测试

npm test

接口

users

  • users()
  • .organizations().list(): 用户已加入的企业列表
  • .groups().list(): 用户已加入的群组列表
  • .teams().list(): 用户已加入的部门列表

organizations

  • organizations()
    • .create(): 创建企业
    • .info(): 获取企业详细信息
    • .update(): 更新企业信息
    • .remove(): 删除企业
    • .owners(): 查找企业拥有者
    • .transfer(): 移交企业

organizations.members

  • organizations().members()
    • .list(): 获取企业下成员
    • .add(): 添加企业成员
    • .removeByUser(): 通过用户 ID 删除成员
    • .remove(): 删除成员
    • .disable(): 禁用成员
    • .enable(): 恢复成员
    • .batchAdd(): 批量添加成员
    • .batchGet(): 批量获取成员
    • .batchUpdate(): 批量更新成员
    • .checkExist(): 检查成员是否存在
    • .getByUser(): 通过用户ID获取成员信息
    • .getChecksum(): 获取企业成员摘要信息
    • .getCount(): 获取企业成员数量
    • .listUnassigned(): 获取未分配部门的成员
    • .search(): 搜索成员

organizations.groups

  • organizations().groups()
    • .list(): 获取企业下群组列表
    • .create(): 创建企业群组
    • .info(): 获取群组详情
    • .update(): 更新群组
    • .remove(): 删除群组
    • .search(): 搜索群组

organizations.groups.members

  • organizations().groups().members()
    • .list(): 获取群组成员列表
    • .add(): 添加群组成员
    • .removeByUser(): 根据用户 ID 删除群组成员
    • .remove(): 删除群组成员
    • .batchAdd(): 批量添加群组成员
    • .batchGet(): 批量获取群组成员
    • .batchUpdate(): 批量更新群组成员
    • .getChecksum(): 获取群组成员摘要信息
    • .getCount(): 获取群组成员数量
    • .search(): 获取群组成员

organizations.teams

  • organizations().teams()
    • .list(): 获取企业下部门列表
    • .create(): 创建企业部门
    • .createChainByNames(): 根据名称链批量创建部门
    • .info(): 获取部门详情
    • .getByName(): 根据部门名精确查找部门
    • .getMapping(): 获取各用户加入的部门,多对多, 不包含默认部门
    • .update(): 更新部门
    • .remove(): 删除部门
    • .$path()
      • .info(): 获取部门路径
    • .subteams().list(): 获取部门的子部门列表
    • .move(): 移动同级部门
    • .search(): 搜索部门

organizations.teams.members

  • organizations().teams().members()
    • .list(): 获取部门成员列表
    • .add(): 添加部门成员
    • .removeByUser(): 根据用户 ID 删除部门成员
    • .remove(): 删除部门成员
    • .batchAdd(): 批量添加部门成员
    • .batchGet(): 批量获取部门成员
    • .batchUpdate(): 批量更新部门成员
    • .getChecksum(): 获取部门成员摘要信息
    • .getCount(): 获取部门成员数量
    • .search(): 获取部门成员

Readme

Keywords

none

Package Sidebar

Install

npm i @tng/soa-node-org

Weekly Downloads

0

Version

1.3.1

License

ISC

Unpacked Size

65.5 kB

Total Files

13

Last publish

Collaborators

  • aerohui
  • isayme
  • orangemi