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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tng/soa-node-org

v1.3.1

Published

SOA-ORG for Node ================

Downloads

5

Readme

SOA-ORG for Node

安装

yarn add @tng/soa-node-org

request 模块

  • https://github.com/teambition/tws-auth
  • https://github.com/teambition/node-teambition

使用

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(): 获取部门成员