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

egg-dd-sdk

v1.1.1

Published

> API文档请参见:https://cathayjs.github.io/egg-dd-sdk/

Downloads

11

Readme

关于

API文档请参见:https://cathayjs.github.io/egg-dd-sdk/

由于钉钉未提供nodejs sdk,初次用nodejs对应相应接口时比较费时费力,所以将项目中的钉钉对接接口整理出来,以egg插件的方式提供呈现。

本sdk的主要达到三个目的:

  1. config: 钉钉相关配置的约定
  2. utils: 将钉钉加解密之类的复杂方法抽象为工具类
  3. service: 将与钉钉相关的API接口进行封装,以service方式提供,方便调用

另外,关于为什么基于egg插件,说明一下原因:

  1. egg框架本身在企业级应用框架中的分层非常清晰,扩展机制极其灵活,配套完整,极力推荐
  2. 通过egg插件的组织,能够非常方便的组织钉钉的配置文件管理、工具使用及service使用
  3. 提供了统一的配置管理
  4. 提供统一的工具调用方式
  5. 提供统一的service调用方式
  6. 提供统一的日志服务

自己参与的项目非ISV类型,未针对ISV做设计,有需求的同学可以一起参与完善。

API文档请参见:https://cathayjs.github.io/egg-dd-sdk/

egg 配置说明

package.json

{
    "dependecies": {
        "egg-dd-sdk": "0.1.4"
    }
}

config/config.default.js

module.exports.DD_CONFIG = {
    corpId: "dingdcf94075751f540635c2f4657eb6378f",
    secret: "C-uQKbuaA1zrne3ni2fwBfifMir9h4MEQTIrRi2LoQiE68LdxIWhBqnFxKLYABWT",
    token: '123456',    // 加解密时有用到
    aesKey: "1234567890123456789012345678901234567890123",  // 加解密时有用到
    agentId: {
        'default': '116146340'
    },
    nonceStr: "123456",
    sso: {
        appId: 'dingoa9l870sdqembng3je',
        appSecret: 'h0Y1uH4w4nkToIvzJzd6VKRNbJsqevOi791B0eeOVM87GrumW4xLEGOQqjzmo9eK'
    }
};

config/plugin.js

exports.dd = {
  enable: true,
  package: 'egg-dd-sdk',
};

NEXT

此目录为所有钉钉官方服务端开发文档的目录结构,打钩的是实现的:

  • [x] 建立连接
  • [x] 免登授权
    • [x] 企业应用中调用免登
    • [x] 普通钉钉用户账号开放及免登
    • [x] 网站应用钉钉扫码登录开发指南
    • [ ] 微应用后台管理员免登
    • [ ] ISV应用中调用免登
  • [x] 通讯录管理
    • [x] 人员管理
    • [x] 部门管理
    • [ ] 权限管理
    • [ ] 角色管理
  • [ ] 微应用管理
  • [x] 消息会话管理
    • [x] 普通会话消息
    • [ ] 群会话消息
  • [x] 文件管理
    • [x] 多媒体文件管理
    • [x] 钉盘
      • [x] 单步文件上传
      • [x] 发送文件给指定用户
      • [ ] 文件事务
      • [ ] 其他
  • [x] 智能办公
    • [x] 审批
    • [ ] 考勤
    • [ ] 签到
  • [ ] 外部联系人管理
  • [ ] 群机器人
  • [x] 服务端加密、解密
  • [x] js接口API

关于单测

egg-dd-sdk虽然是egg插件,但有完善的单测机制,且与egg框架目录结构使用方式一致:

  • cnpm install
  • npm run dev

目前以公共19个用例,覆盖了大部分接口