youzanyun-sdk-nodejs
Advanced tools
Comparing version 2.0.0-beta.20 to 2.0.0
@@ -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 @@ { |
{ | ||
"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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
29299
884