clever-client
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -13,3 +13,3 @@ 'use strict'; | ||
function arrayBufferToBase64(buffer) { | ||
const binary = ''; | ||
let binary = ''; | ||
const bytes = new Uint8Array(buffer); | ||
@@ -25,6 +25,3 @@ const len = bytes.byteLength; | ||
function addOauthHeader({ | ||
consumer, | ||
token | ||
}) { | ||
function addOauthHeader(tokens) { | ||
return async function (requestParams) { | ||
@@ -39,3 +36,6 @@ const { | ||
const oauth = (0, _oauth.default)({ | ||
consumer, | ||
consumer: { | ||
key: tokens.OAUTH_CONSUMER_KEY, | ||
secret: tokens.OAUTH_CONSUMER_SECRET | ||
}, | ||
signature_method: 'HMAC-SHA512', | ||
@@ -65,3 +65,6 @@ | ||
}; | ||
const oauthData = oauth.authorize(requestData, token); // unwrap promise | ||
const oauthData = oauth.authorize(requestData, { | ||
key: tokens.API_OAUTH_TOKEN, | ||
secret: tokens.API_OAUTH_TOKEN_SECRET | ||
}); // unwrap promise | ||
@@ -68,0 +71,0 @@ oauthData.oauth_signature = await oauthData.oauth_signature; |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { |
@@ -6,3 +6,3 @@ 'use strict'; | ||
function arrayBufferToBase64 (buffer) { | ||
const binary = ''; | ||
let binary = ''; | ||
const bytes = new Uint8Array(buffer); | ||
@@ -16,3 +16,3 @@ const len = bytes.byteLength; | ||
export function addOauthHeader ({ consumer, token }) { | ||
export function addOauthHeader (tokens) { | ||
@@ -24,3 +24,6 @@ return async function (requestParams) { | ||
const oauth = OAuth({ | ||
consumer, | ||
consumer: { | ||
key: tokens.OAUTH_CONSUMER_KEY, | ||
secret: tokens.OAUTH_CONSUMER_SECRET, | ||
}, | ||
signature_method: 'HMAC-SHA512', | ||
@@ -53,3 +56,6 @@ async hash_function (base_string, key) { | ||
const requestData = { url, method, data: queryParams }; | ||
const oauthData = oauth.authorize(requestData, token); | ||
const oauthData = oauth.authorize(requestData, { | ||
key: tokens.API_OAUTH_TOKEN, | ||
secret: tokens.API_OAUTH_TOKEN_SECRET, | ||
}); | ||
// unwrap promise | ||
@@ -56,0 +62,0 @@ oauthData.oauth_signature = await oauthData.oauth_signature; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
export async function request (requestParams) { | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
export function sendLegacyRequest (sendCallback) { | ||
@@ -2,0 +4,0 @@ |
{ | ||
"name": "clever-client", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "JavaScript REST client for Clever-Cloud API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
275810
9212
2