New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

youzanyun-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youzanyun-sdk

YouzanYun SDK for Node

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

YouzanYun SDK

NPM Version License Downloads Build Status Coverage Status

YouzanYun SDK for Node.

Install

npm i youzanyun-sdk --save

Usage

可参考 examples

1. 获取 accessToken

自用型应用
const youzanyun = require('youzanyun-sdk');

const resp = youzanyun.token.get({
  authorize_type: 'silent',
  client_id: 'YOUR_CLIENT_ID',
  client_secret: 'YOUR_CLIENT_SECRET',
  grant_id: 110,
});
工具型应用
const youzanyun = require('youzanyun-sdk');

// 获取token
const resp = youzanyun.token.get({
  authorize_type: 'authorization_code',
  client_id: 'YOUR_CLIENT_ID',
  client_secret: 'YOUR_CLIENT_SECRET',
  code: 'YOUR_CODE',
  redirect_uri: 'YOUR_REDIRECT_URI',
});

// 刷新token
const resp = youzanyun.token.get({
  authorize_type: 'refresh_token',
  client_id: 'YOUR_CLIENT_ID',
  client_secret: 'YOUR_CLIENT_SECRET',
  refresh_token: 'YOUR_REFRESH_TOKEN',
});

2. 接口调用

Token方式
const youzanyun = require('youzanyun-sdk');

const token = 'f59b1a6bb04f4eqweqd1c6af315d';
const params = {tid: 'E20190509110527067500013'};

const resp = youzanyun.client.call({
  api: 'youzan.trade.get',
  version: '4.0.0',
  token,
  params,
});
文件上传
const youzanyun = require('youzanyun-sdk');

const token = 'f59b1a6bb0asdasq613d1c6af315d';
const files = {'image': path.resolve(__dirname, './pic.png')};

const resp = youzanyun.client.call({
  api: 'youzan.materials.storage.platform.img.upload',
  version: '3.0.0',
  token,
  params: {},
  files,
});

3. 消息解密

const youzanyun = require('youzanyun-sdk');

const messages = 'YOUR_RECEIVED_MESSAGES';
const clientSecret = 'YOUR_CLIENT_SECRET';

const resp = youzanyun.crypto.decrypt(messages, clientSecret);

License

MIT

Keywords

FAQs

Package last updated on 31 Oct 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc