Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

youzanyun-sdk-nodejs

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youzanyun-sdk-nodejs - npm Package Compare versions

Comparing version 2.0.0-beta.20 to 2.0.0

66

lib/token.js

@@ -9,28 +9,5 @@ "use strict";

const config = require('./config'); // const Type_GetCloudToolToken = 'authorization_code';
// const Type_RefreshCloudToolToken = 'refresh_token';
// const Type_RefreshCloudSelfToken = 'silent';
const config = require('./config');
const Type_CloudFunction = 'cloud_function';
/**
* 工具型应用token
* {
* access_token
* expires
* scope
* refresh_token
* authority_id
* }
*
* 自用型
* {
* access_token
* expires
* scope
* authority_id
* }
*
*/
module.exports = class Token {

@@ -47,31 +24,4 @@ constructor({

this.requestTokenUrl = `https://${tokenHost || config.TOKEN_HOST}/auth/token`;
} // /**
// * 获取自用型应用token。token过期后,需要再次调用此接口获取新token
// */
// async getCloudSelfToken(kdtId) {
// return await this.getToken({
// type: Type_RefreshCloudSelfToken,
// kdtId,
// });
// }
// /**
// * 获取工具型应用token
// */
// async getCloudToolToken(code) {
// return await this.getToken({
// type: Type_GetCloudToolToken,
// code,
// });
// }
// /**
// * 刷新工具型应用token
// */
// async refreshCloudToolToken(refreshToken) {
// return await this.getToken({
// type: Type_RefreshCloudToolToken,
// refreshToken,
// });
// }
}
async getToken({

@@ -91,14 +41,2 @@ type,

switch (type) {
// // 自用型应用获取 token
// case Type_RefreshCloudSelfToken:
// params['grant_id'] = kdtId;
// break;
// // 工具型应用获取 token
// case Type_GetCloudToolToken:
// params['code'] = code;
// break;
// // 工具型应用刷新 token
// case Type_RefreshCloudToolToken:
// params['refresh_token'] = refreshToken;
// break;
case Type_CloudFunction:

@@ -105,0 +43,0 @@ {

2

package.json
{
"name": "youzanyun-sdk-nodejs",
"version": "2.0.0-beta.20",
"version": "2.0.0",
"description": "有赞云 nodejs sdk",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

const config = require('./config');
// const Type_GetCloudToolToken = 'authorization_code';
// const Type_RefreshCloudToolToken = 'refresh_token';
// const Type_RefreshCloudSelfToken = 'silent';
const Type_CloudFunction = 'cloud_function';
/**
* 工具型应用token
* {
* access_token
* expires
* scope
* refresh_token
* authority_id
* }
*
* 自用型
* {
* access_token
* expires
* scope
* authority_id
* }
*
*/
module.exports = class Token {

@@ -35,32 +11,2 @@ constructor({ clientId, clientSecret, httpClient, tokenHost }) {

// /**
// * 获取自用型应用token。token过期后,需要再次调用此接口获取新token
// */
// async getCloudSelfToken(kdtId) {
// return await this.getToken({
// type: Type_RefreshCloudSelfToken,
// kdtId,
// });
// }
// /**
// * 获取工具型应用token
// */
// async getCloudToolToken(code) {
// return await this.getToken({
// type: Type_GetCloudToolToken,
// code,
// });
// }
// /**
// * 刷新工具型应用token
// */
// async refreshCloudToolToken(refreshToken) {
// return await this.getToken({
// type: Type_RefreshCloudToolToken,
// refreshToken,
// });
// }
async getToken(

@@ -82,14 +28,2 @@ {

switch (type) {
// // 自用型应用获取 token
// case Type_RefreshCloudSelfToken:
// params['grant_id'] = kdtId;
// break;
// // 工具型应用获取 token
// case Type_GetCloudToolToken:
// params['code'] = code;
// break;
// // 工具型应用刷新 token
// case Type_RefreshCloudToolToken:
// params['refresh_token'] = refreshToken;
// break;
case Type_CloudFunction: {

@@ -96,0 +30,0 @@ params['grant_id'] = kdtId;

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