New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

clever-tools

Package Overview
Dependencies
Maintainers
6
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clever-tools - npm Package Compare versions

Comparing version 2.8.1 to 2.9.0

6

CHANGELOG.md
# clever-tools changelog
## 2.8.1 (2021-01-10)
## 2.9.0 (2022-01-12)
* Add NewRelic support in `clever drains`
## 2.8.1 (2022-01-10)
* Fix `colors` to `1.4.0`

@@ -6,0 +10,0 @@

2

package.json
{
"name": "clever-tools",
"version": "2.8.1",
"version": "2.9.0",
"description": "Command Line Interface for Clever Cloud.",

@@ -5,0 +5,0 @@ "main": "bin/clever.js",

@@ -323,2 +323,3 @@ # clever-tools

- `DatadogHTTP`: for Datadog endpoint (note that this endpoint needs your Datadog API Key).
- `NewRelicHTTP`: for NewRelic endpoint (note that this endpoint needs your NewRelic API Key).

@@ -341,2 +342,12 @@ #### ElasticSearch logs drains

#### NewRelic logs drains
NewRelic has two zones, EU and US. An account on one zone is not available on the other, make sure to target the good EU or US intake endpoint.
To create a [NewRelic](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/) drain, you just need to use:
```sh
clever drain create NewRelicHTTP "https://log-api.eu.newrelic.com/log/v1" --api-key <API_KEY>
```
### Display help

@@ -343,0 +354,0 @@

@@ -11,2 +11,3 @@ 'use strict';

{ id: 'DatadogHTTP' },
{ id: 'NewRelicHTTP', apiKey: 'MANDATORY' },
];

@@ -16,4 +17,4 @@

if (!authorizeDrainCreation(drainTargetType, drainTargetCredentials)) {
throw new Error("Credentials are: optional for HTTP, mandatory for ElasticSearch and TCPSyslog/UDPSyslog don't need them.");
if (!authorizeDrainCreation(drainTargetType, drainTargetCredentials, drainTargetConfig)) {
throw new Error("Credentials are: optional for HTTP, mandatory for ElasticSearch, NewRelicHTTP and TCPSyslog/UDPSyslog don't need them.");
}

@@ -31,16 +32,33 @@

}
if (keyExist(drainTargetConfig)) {
body.APIKey = drainTargetConfig.apiKey;
}
return body;
}
function authorizeDrainCreation (drainTargetType, drainTargetCredentials) {
function authorizeDrainCreation (drainTargetType, drainTargetCredentials, drainTargetConfig) {
if (drainTypeExists(drainTargetType)) {
// retrieve creds for drain type ('mandatory', 'optional', undefined)
const status = credentialsStatus(drainTargetType).credentials;
if (status === 'MANDATORY') {
const credStatus = credentialsStatus(drainTargetType).credentials;
const keyStatus = credentialsStatus(drainTargetType).apiKey;
if (credStatus === 'MANDATORY') {
return credentialsExist(drainTargetCredentials);
}
if (status === 'OPTIONAL') {
if (credStatus === 'OPTIONAL') {
return true;
}
return credentialsEmpty(drainTargetCredentials);
if (!credStatus && !keyStatus) {
return credentialsEmpty(drainTargetCredentials);
}
if (keyStatus === 'MANDATORY') {
return keyExist(drainTargetConfig);
}
if (keyStatus === 'OPTIONAL') {
return true;
}
if (!keyStatus) {
return keyEmpty(drainTargetConfig);
}
}

@@ -65,2 +83,10 @@ }

function keyExist ({ apiKey }) {
return apiKey != null;
}
function keyEmpty ({ apiKey }) {
return apiKey == null;
}
function listDrainTypes () {

@@ -67,0 +93,0 @@ return autocomplete.words(DRAIN_TYPES.map((type) => type.id));

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