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

@clevercloud/client

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clevercloud/client - npm Package Compare versions

Comparing version 8.3.0 to 9.0.0

20

cjs/oauth.js

@@ -12,20 +12,4 @@ "use strict";

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
async function getSubtleCrypto() {
// Browser environment
if (globalThis.crypto?.subtle != null) {
return globalThis.crypto?.subtle;
} // Node environment
else {
const cryptoModule = await Promise.resolve().then(() => _interopRequireWildcard(require('node:crypto')));
return cryptoModule.subtle;
}
}
function addOauthHeader(tokens) {
return async function (requestParams) {
const cryptoSubtle = await getSubtleCrypto();
const {

@@ -48,7 +32,7 @@ method,

const encodedKey = encoder.encode(key);
const cryptoKey = await cryptoSubtle.importKey('raw', encodedKey, {
const cryptoKey = await globalThis.crypto.subtle.importKey('raw', encodedKey, {
name: 'HMAC',
hash: 'SHA-512'
}, false, ['sign']);
const result = await cryptoSubtle.sign({
const result = await globalThis.crypto.subtle.sign({
name: 'HMAC',

@@ -55,0 +39,0 @@ hash: 'SHA-512'

import OAuth from 'oauth-1.0a';
async function getSubtleCrypto () {
// Browser environment
if (globalThis.crypto?.subtle != null) {
return globalThis.crypto?.subtle;
}
// Node environment
else {
const cryptoModule = await import('node:crypto');
return cryptoModule.subtle;
}
}
export function addOauthHeader (tokens) {

@@ -20,4 +7,2 @@

const cryptoSubtle = await getSubtleCrypto();
const { method, url, headers, queryParams } = requestParams;

@@ -37,3 +22,3 @@

const cryptoKey = await cryptoSubtle.importKey(
const cryptoKey = await globalThis.crypto.subtle.importKey(
'raw',

@@ -46,3 +31,3 @@ encodedKey,

const result = await cryptoSubtle.sign(
const result = await globalThis.crypto.subtle.sign(
{ name: 'HMAC', hash: 'SHA-512' },

@@ -49,0 +34,0 @@ cryptoKey,

4

package.json
{
"name": "@clevercloud/client",
"version": "8.3.0",
"version": "9.0.0",
"description": "JavaScript REST client and utils for Clever Cloud's API",

@@ -63,4 +63,4 @@ "homepage": "https://github.com/CleverCloud/clever-client.js",

"volta": {
"node": "18.18.0"
"node": "22.7.0"
}
}
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