Socket
Socket
Sign inDemoInstall

@chuva.io/less-cli

Package Overview
Dependencies
99
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-beta.13 to 1.0.0-beta.14

commands/helpers/credentials.js

18

bin/index.js

@@ -12,2 +12,4 @@ #!/usr/bin/env node

import create_account from '../commands/user/create_account.js';
import create_session from '../commands/user/create_session.js';
import { verify_auth_token } from '../commands/helpers/credentials.js';

@@ -20,3 +22,3 @@ const program = new Command();

.description('CLI to interact with Less')
.version('1.0.0-beta.13')
.version('1.0.0-beta.14')
.usage('[COMMAND]');

@@ -28,7 +30,4 @@

.option('--static', 'Deploy your less static websites')
.action((project_name, options) => {
if (!process.env.LESS_TOKEN) {
console.log(chalk.redBright('Error:'), 'Environment variable LESS_TOKEN must be defined');
process.exit(1);
}
.action(async (project_name, options) => {
verify_auth_token();

@@ -61,2 +60,9 @@ if (!/^[a-z][-a-z0-9]*$/.test(project_name)) {

program
.command('login')
.description('Log in with email and password.')
.option('-u, --user <email>', 'User email address')
.option('-p, --password <password>', 'User password', '*')
.action(create_session);
const template = program

@@ -63,0 +69,0 @@ .command('template')

@@ -11,2 +11,5 @@ import AdmZip from 'adm-zip';

import { get_less_token } from '../helpers/credentials.js';
const spinner = ora({ text: '' });

@@ -87,4 +90,6 @@

const LESS_TOKEN = await get_less_token();
const headers = {
Authorization: `Bearer ${process.env.LESS_TOKEN}`,
Authorization: `Bearer ${LESS_TOKEN}`,
'connection_id': connectionId,

@@ -91,0 +96,0 @@ ...formData.getHeaders(),

@@ -12,2 +12,4 @@ import AdmZip from 'adm-zip';

import { get_less_token } from '../helpers/credentials.js';
const spinner = ora({ text: '' });

@@ -35,3 +37,3 @@

if (value === undefined) {
console.error(chalk.redBright(`Environment variable '${key}' must be defined`));
console.error(chalk.redBright(`\nEnvironment variable '${key}' must be defined`));
process.exit(1);

@@ -123,4 +125,6 @@ }

const LESS_TOKEN = await get_less_token();
const headers = {
Authorization: `Bearer ${process.env.LESS_TOKEN}`,
Authorization: `Bearer ${LESS_TOKEN}`,
'connection_id': connectionId,

@@ -137,3 +141,3 @@ ...formData.getHeaders(),

spinner.stop();
console.error(chalk.redBright('Error:'), error?.response?.data || 'Deployment failed');
console.error(chalk.redBright('Error:'), error?.response?.data?.error || 'Deployment failed');
socket.close();

@@ -140,0 +144,0 @@ process.exit(1); // Non-success exit code for failure

import axios from 'axios';
import chalk from 'chalk';
import config from '../../utils/config.js';
import { verify_auth_token, get_less_token } from '../helpers/credentials.js';
export default async function get_all() {
if (!process.env.LESS_TOKEN) {
console.log(chalk.redBright('Error:'), 'Environment variable LESS_TOKEN must be defined');
process.exit(1);
}
await verify_auth_token();

@@ -14,4 +12,5 @@ const serverUrl = `${config.SERVER_URL}/v1/projects`;

try {
const LESS_TOKEN = await get_less_token();
const headers = {
Authorization: `Bearer ${process.env.LESS_TOKEN}`
Authorization: `Bearer ${LESS_TOKEN}`
};

@@ -32,5 +31,5 @@

} catch (error) {
console.error(chalk.redBright('Error:'), error?.response?.data || 'Get projects failed');
console.error(chalk.redBright('Error:'), error?.response?.data?.error || 'Get projects failed');
process.exit(1);
}
}
import axios from 'axios';
import chalk from 'chalk';
import config from '../../utils/config.js';
import { verify_auth_token, get_less_token } from '../helpers/credentials.js';

@@ -11,6 +12,3 @@ export default async function get_by_id(project_name) {

if (!process.env.LESS_TOKEN) {
console.log(chalk.redBright('Error:'), 'Environment variable LESS_TOKEN must be defined');
process.exit(1);
}
await verify_auth_token();

@@ -20,4 +18,5 @@ const serverUrl = `${config.SERVER_URL}/v1/projects/${project_name}`;

try {
const LESS_TOKEN = await get_less_token();
const headers = {
Authorization: `Bearer ${process.env.LESS_TOKEN}`
Authorization: `Bearer ${LESS_TOKEN}`
};

@@ -44,5 +43,5 @@

} catch (error) {
console.error(chalk.redBright('Error:'), error?.response?.data || 'Get projects failed');
console.error(chalk.redBright('Error:'), error?.response?.data?.error || 'Get projects failed');
process.exit(1);
}
}
{
"name": "@chuva.io/less-cli",
"version": "1.0.0-beta.13",
"version": "1.0.0-beta.14",
"description": "`less-cli` is a CLI tool that allows you to deploy your Less projects to AWS while providing several other tools to facilitate your interaction with Less.",

@@ -5,0 +5,0 @@ "author": "Chuva, LLC",

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