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

super-dingtalk

v0.9.1

Published

DingTalk and OAuth client for Node.js

Downloads

14

Readme

super-dingtalk

DingTalk client for Node.js 钉钉 Node.js 客户端

安装

$ npm install super-dingtalk --save

使用方法

应用方法说明

各个方法需要的 Token 在接口请求(requestgetpost)自动获取和续期,也可以通过 getToken() 获得

/**
  * 通用请求接口
  *
  * @param {String} method - GET、POST
  * @param {String} api - API地址(以 / 开头)
  * @param {Object} query - 请求URL参数(获取AccessToken后默认会带上)
  * @param {String} body - POST请求的body(JSON需要JSON.stringify)
  * @param {String|Array} key - 返回数据中取出需要的key(不传全部ret返回)
  *
  * @returns {Promise}
  */
request(method, api, query, body, key)

// GET 方法简化接口
get(api, query, key)

// POST 方法简化接口
post(api, body, key)

企业应用

使用方法: dingtalk.js

const DingTalk = require('super-dingtalk').DingTalk;

const client = new DingTalk({
  corpId: 'xxxxx',
  secret: 'xxxxx',
});

免登服务

使用方法: dtoauth.js

const DTOAuth = require('../lib').DTOAuth;

const oauth = new DTOAuth({
  appId: 'xxx',
  appSecret: 'xxx',
});

// 获取扫描登录链接
const url = oauth.getQRParmasUrl('http://blog.yourtion.com');

其他操作详见测试与相关文档

相关资源:

免登接入 (DTOAuth)

  • [X] 生成扫码登录URL getQRParmasUrl(redirectUri)
  • [X] 获取钉钉开放应用 AccessToken getToken()
  • [X] 获取用户授权的持久授权码 getPersistentCode(tmpAuthCode)
  • [X] 获取用户授权的 SnsToken getSnsToken(openId, persistentCode)
  • [X] 获取用户授权的个人信息 getUserInfo(snsToken)
  • [X] 通过临时授权吗获取用户信息 getUserInfoFromCode(tmpAuthCode)

参考: 免登服务

钉钉服务端 (DingTalk)

基础功能

  • [x] 获取 AccessToken getToken()
  • [x] 获取 jsapi_ticket getTicket()
  • [X] 获取 Web 端签名 getSign(url)
  • [X] 获取企业员工人数 get('/user/get_org_user_count', { onlyActive: 0|1 }, 'count')
  • [ ] 服务端加密
  • [ ] 服务端解密
  • [ ] 记录统计数据
  • [ ] 更新统计数据

管理通讯录

  • [X] 获取部门列表 get('/department/list', { id: 1|"parentid" }, 'department')
  • [X] 获取部门详情 get('/department/get', { id: "department_id" })
  • [ ] 创建部门
  • [ ] 更新部门
  • [ ] 删除部门
  • [X] 根据 unionid 获取成员的 userid get('/user/getUseridByUnionid', { unionid }, 'userid')
  • [X] 获取成员详情 get('/user/get', { userid })
  • [ ] 创建成员
  • [ ] 创建成员
  • [ ] 更新成员
  • [ ] 删除成员
  • [ ] 批量删除成员
  • [x] 获取部门成员 get('/user/simplelist', pamras, 'userlist')
  • [ ] 获取部门成员(详情)get('/user/list', pamras, 'userlist')
  • [ ] 获取管理员列表

企业会话消息接口

  • [x] 发送企业会话消息
  • [ ] 获取企业会话消息已读未读状态