New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@axolo/egg-dingtalk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axolo/egg-dingtalk

node-dingtalk plugin for Egg.js.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

egg-dingtalk

node-dingtalk plugin for Egg.js.

Install

npm i @axolo/egg-dingtalk --save

Usage

// {app_root}/config/plugin.js
exports.dingtalk = {
  enable: true,
  package: '@axolo/egg-dingtalk',
};

Configuration

// {app_root}/config/config.default.js
exports.dingtalk = {};

see https://github.com/axolo/node-dingtalk for more help. see config/config.default.js for more detail.

Config client or clients as you like:

dingtalk corp app:

{ client: { appKey, appSecret, agentId } }

dingtalk isv suite with single app:

{ client: { suiteKey, suiteSecret, appId } }

dingtalk isv suite with multiple apps:

{
  client: {
    suiteKey,
    suiteSecret,
    apps: [ { appId }, { appId } ],
  }
}

dingtalk isv suite with multiple apps per app:

{
  clients: {
    app1: { suiteKey, suiteSecret, appId },
    app2: { suiteKey, suiteSecret, appId },
  },
}

Example

const Controller = require('egg').Controller;

class DingtalkController extends Controller {
  async index() {
    const { app, ctx } = this;
    const { dingtalk } = app;
    const corpId = 'CORP_ID';
    const params = { id: 1 };
    const result = await dingtalk.execute('/department/get', { params }, { corpId });
    ctx.body = result;
  }
}

module.exports = DingtalkController;

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

egg

FAQs

Package last updated on 08 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts