Socket
Socket
Sign inDemoInstall

clever-client

Package Overview
Dependencies
49
Maintainers
6
Versions
89
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3

17

cjs/oauth.browser.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc