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

@vonage/cli

Package Overview
Dependencies
Maintainers
37
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/cli - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

dist/commands/balance/index.js.map

4

dist/commands/balance/index.d.ts

@@ -1,3 +0,3 @@

import BaseCommand from '@vonage/cli-utils';
export default class DisplayBalance extends BaseCommand<typeof DisplayBalance.flags> {
import VonageCommand from '@vonage/cli-utils';
export default class DisplayBalance extends VonageCommand<typeof DisplayBalance> {
static description: string;

@@ -4,0 +4,0 @@ static examples: string[];

@@ -1,10 +0,5 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cli_utils_1 = __importDefault(require("@vonage/cli-utils"));
class DisplayBalance extends cli_utils_1.default {
import VonageCommand from '@vonage/cli-utils';
export default class DisplayBalance extends VonageCommand {
async run() {
let res = await this.displayBalance();
const res = await this.displayBalance();
this.log(`Current balance: ${res.value.toFixed(2)} EUR`);

@@ -14,8 +9,8 @@ this.exit();

}
exports.default = DisplayBalance;
DisplayBalance.description = "display your Vonage account balance";
DisplayBalance.description = 'display your Vonage account balance';
DisplayBalance.examples = [
`$vonage balance
Displays your current balance in Euros
`
`,
];
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import BaseCommand from '@vonage/cli-utils';
export default class ConfigList extends BaseCommand<typeof ConfigList.flags> {
import VonageCommand from '@vonage/cli-utils';
export default class ConfigList extends VonageCommand<typeof ConfigList> {
static description: string;

@@ -4,0 +4,0 @@ static examples: any[];

@@ -1,16 +0,12 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cli_utils_1 = __importDefault(require("@vonage/cli-utils"));
const cli_ux_1 = __importDefault(require("cli-ux"));
class ConfigList extends cli_utils_1.default {
import VonageCommand from '@vonage/cli-utils';
import { CliUx } from '@oclif/core';
const cli = CliUx.ux;
export default class ConfigList extends VonageCommand {
async run() {
this.log("~~~User Config~~~");
cli_ux_1.default.log(JSON.stringify(Object.assign({}, this.userConfig)));
this.log('~~~User Config~~~');
cli.log(JSON.stringify(Object.assign({}, this._userConfig)));
}
}
exports.default = ConfigList;
ConfigList.description = 'manage Vonage CLI configuration';
ConfigList.examples = [];
//# sourceMappingURL=index.js.map

@@ -1,13 +0,8 @@

import BaseCommand from '@vonage/cli-utils';
import { flags } from '@oclif/command';
import VonageCommand from '@vonage/cli-utils';
import { ArgInput } from '@oclif/core/lib/interfaces';
export default class ConfigSet extends BaseCommand<typeof ConfigSet.flags> {
export default class ConfigSet extends VonageCommand<typeof ConfigSet> {
static description: string;
static flags: {
apiKey: flags.IOptionFlag<string>;
apiSecret: flags.IOptionFlag<string>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
appId: flags.IOptionFlag<string>;
keyFile: flags.IOptionFlag<string>;
trace: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
apiKey: import("@oclif/core/lib/interfaces").OptionFlag<string>;
apiSecret: import("@oclif/core/lib/interfaces").OptionFlag<string>;
};

@@ -14,0 +9,0 @@ static args: ArgInput;

@@ -1,28 +0,21 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cli_utils_1 = __importDefault(require("@vonage/cli-utils"));
const command_1 = require("@oclif/command");
const lodash_1 = require("lodash");
class ConfigSet extends cli_utils_1.default {
import VonageCommand from '@vonage/cli-utils';
import { Flags } from '@oclif/core';
import _ from 'lodash';
export default class ConfigSet extends VonageCommand {
async run() {
const flags = this.globalFlags;
//add start, stop process indicators
this.saveConfig((0, lodash_1.merge)({}, this.userConfig, flags));
this.saveConfig(_.merge({}, this._userConfig, flags));
this.log('Configuration saved.');
}
}
exports.default = ConfigSet;
ConfigSet.description = 'set Vonage CLI config';
ConfigSet.flags = {
...cli_utils_1.default.flags,
'apiKey': command_1.flags.string({
apiKey: Flags.string({
description: 'Vonage API Key',
}),
'apiSecret': command_1.flags.string({
apiSecret: Flags.string({
description: 'Vonage API Key',
})
}),
};
ConfigSet.args = [];
//# sourceMappingURL=set.js.map

@@ -1,17 +0,14 @@

import BaseCommand from '@vonage/cli-utils';
import { OutputFlags } from '@oclif/parser';
interface GenerateJWTFlags {
app_id: any;
key_file: any;
subject?: any;
acl?: any;
exp?: any;
}
export default class GenerateJWT extends BaseCommand<typeof GenerateJWT.flags> {
import VonageCommand from '@vonage/cli-utils';
export default class GenerateJWT extends VonageCommand<typeof GenerateJWT> {
static description: string;
static examples: string[];
static flags: OutputFlags<typeof BaseCommand.flags> & GenerateJWTFlags;
static flags: {
app_id: import("@oclif/core/lib/interfaces").OptionFlag<string>;
key_file: import("@oclif/core/lib/interfaces").OptionFlag<string>;
subject: import("@oclif/core/lib/interfaces").OptionFlag<string>;
acl: import("@oclif/core/lib/interfaces").OptionFlag<string>;
exp: import("@oclif/core/lib/interfaces").OptionFlag<string>;
};
static args: any[];
run(): Promise<void>;
}
export {};

@@ -1,20 +0,17 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cli_utils_1 = __importDefault(require("@vonage/cli-utils"));
const command_1 = require("@oclif/command");
const fs_1 = require("fs");
class GenerateJWT extends cli_utils_1.default {
import VonageCommand from '@vonage/cli-utils';
import { Flags } from '@oclif/core';
import { readFileSync } from 'fs';
export default class GenerateJWT extends VonageCommand {
async run() {
const flags = this.parsedFlags;
let private_key = typeof flags.key_file === 'string' ? (0, fs_1.readFileSync)(flags.key_file.replace(/(\s+)/g, '\\$1')) : null;
let claims = {
const privateKey = typeof flags.key_file === 'string'
? readFileSync(flags.key_file.replace(/(\s+)/g, '\\$1'))
: null;
const claims = {
application_id: flags.app_id,
sub: flags.subject,
exp: flags.exp || Date.now() + 21600
exp: flags.exp || Date.now() + 21600,
};
flags.acl ? claims['acl'] = JSON.parse(flags.acl.toString()) : null;
let jwt = this.Vonage.generateJwt(private_key, claims);
flags.acl ? (claims['acl'] = JSON.parse(flags.acl.toString())) : null;
const jwt = this.Vonage.generateJwt(privateKey, claims);
this.log(jwt);

@@ -24,26 +21,28 @@ this.exit();

}
exports.default = GenerateJWT;
GenerateJWT.description = 'generate a Vonage JWT token';
GenerateJWT.examples = [
`jwt --key_file='./testing.key' --app_id=31521081-e4c7-41fe-bccc-44af98879068`
`jwt --key_file='./testing.key' --app_id=31521081-e4c7-41fe-bccc-44af98879068`,
];
GenerateJWT.flags = {
...cli_utils_1.default.flags,
app_id: command_1.flags.string({
app_id: Flags.string({
required: true,
description: "Application ID to authenticate with"
description: 'Application ID to authenticate with',
}),
key_file: command_1.flags.string({
key_file: Flags.string({
required: true,
description: "Path to private key file location"
description: 'Path to private key file location',
}),
subject: command_1.flags.string({
subject: Flags.string({
required: false,
}),
acl: command_1.flags.string({
acl: Flags.string({
required: false,
description: `Read more about it in the ACL overview - https://developer.vonage.com/conversation/guides/jwt-acl#acls`,
}),
exp: command_1.flags.string({ required: false, description: "Expiration of created JWT - defaults to 24 hours." }),
exp: Flags.string({
required: false,
description: 'Expiration of created JWT - defaults to 24 hours.',
}),
};
GenerateJWT.args = [];
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import { Hook } from '@oclif/config';
import { Hook } from '@oclif/core';
declare const hook: Hook<'init'>;
export default hook;

@@ -1,36 +0,8 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const fs_2 = require("fs");
const path = __importStar(require("path"));
const shelljs_1 = __importDefault(require("shelljs"));
import { promises as fs } from 'fs';
import { writeFileSync, constants } from 'fs';
import * as path from 'path';
import shell from 'shelljs';
async function isExists(path) {
try {
let result = await fs_1.promises.access(path, fs_2.constants.F_OK);
await fs.access(path, constants.F_OK);
return true;

@@ -42,4 +14,3 @@ }

}
;
async function writeFile(filePath, data) {
async function writeFile(filePath) {
try {

@@ -49,7 +20,7 @@ const dirname = path.dirname(filePath);

if (!exist) {
await shelljs_1.default.mkdir('-p', dirname);
await shell.mkdir('-p', dirname);
}
exist = await isExists(filePath);
if (!exist) {
(0, fs_2.writeFileSync)(filePath, JSON.stringify({ apiKey: '', apiSecret: '' }, null, 2), 'utf8');
writeFileSync(filePath, JSON.stringify({ apiKey: '', apiSecret: '' }, null, 2), 'utf8');
}

@@ -62,6 +33,7 @@ }

const hook = async function (options) {
let name = path.join(this.config.configDir, 'vonage.config.json');
writeFile(name, '');
const name = path.join(this.config.configDir, 'vonage.config.json');
writeFile(name);
return;
};
exports.default = hook;
export default hook;
//# sourceMappingURL=init.js.map

@@ -1,1 +0,1 @@

export { run } from '@oclif/command';
export { run } from '@oclif/core';

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
var command_1 = require("@oclif/command");
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return command_1.run; } });
export { run } from '@oclif/core';
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":"1.1.4","commands":{"balance":{"id":"balance","description":"display your Vonage account balance","pluginName":"@vonage/cli","pluginType":"core","aliases":[],"examples":["$vonage balance\nDisplays your current balance in Euros\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"apiKey":{"name":"apiKey","type":"option","hidden":true},"apiSecret":{"name":"apiSecret","type":"option","hidden":true},"appId":{"name":"appId","type":"option","hidden":true},"keyFile":{"name":"keyFile","type":"option","hidden":true},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"config":{"id":"config","description":"manage Vonage CLI configuration","pluginName":"@vonage/cli","pluginType":"core","aliases":[],"examples":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"apiKey":{"name":"apiKey","type":"option","hidden":true},"apiSecret":{"name":"apiSecret","type":"option","hidden":true},"appId":{"name":"appId","type":"option","hidden":true},"keyFile":{"name":"keyFile","type":"option","hidden":true},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"config:set":{"id":"config:set","description":"set Vonage CLI config","pluginName":"@vonage/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"apiKey":{"name":"apiKey","type":"option","description":"Vonage API Key"},"apiSecret":{"name":"apiSecret","type":"option","description":"Vonage API Key"},"appId":{"name":"appId","type":"option","hidden":true},"keyFile":{"name":"keyFile","type":"option","hidden":true},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"jwt":{"id":"jwt","description":"generate a Vonage JWT token","pluginName":"@vonage/cli","pluginType":"core","aliases":[],"examples":["jwt --key_file='./testing.key' --app_id=31521081-e4c7-41fe-bccc-44af98879068"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"apiKey":{"name":"apiKey","type":"option","hidden":true},"apiSecret":{"name":"apiSecret","type":"option","hidden":true},"appId":{"name":"appId","type":"option","hidden":true},"keyFile":{"name":"keyFile","type":"option","hidden":true},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false},"app_id":{"name":"app_id","type":"option","description":"Application ID to authenticate with","required":true},"key_file":{"name":"key_file","type":"option","description":"Path to private key file location","required":true},"subject":{"name":"subject","type":"option","required":false},"acl":{"name":"acl","type":"option","description":"Read more about it in the ACL overview - https://developer.vonage.com/conversation/guides/jwt-acl#acls","required":false},"exp":{"name":"exp","type":"option","description":"Expiration of created JWT - defaults to 24 hours.","required":false}},"args":[]}}}
{"version":"1.2.0","commands":{"balance":{"id":"balance","description":"display your Vonage account balance","strict":true,"pluginName":"@vonage/cli","pluginAlias":"@vonage/cli","pluginType":"core","aliases":[],"examples":["$vonage balance\nDisplays your current balance in Euros\n"],"flags":{"apiKey":{"name":"apiKey","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiSecret"]},"apiSecret":{"name":"apiSecret","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiKey"]},"appId":{"name":"appId","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["keyFile"]},"keyFile":{"name":"keyFile","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["appId"]},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"config":{"id":"config","description":"manage Vonage CLI configuration","strict":true,"pluginName":"@vonage/cli","pluginAlias":"@vonage/cli","pluginType":"core","aliases":[],"examples":[],"flags":{"apiKey":{"name":"apiKey","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiSecret"]},"apiSecret":{"name":"apiSecret","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiKey"]},"appId":{"name":"appId","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["keyFile"]},"keyFile":{"name":"keyFile","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["appId"]},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"config:set":{"id":"config:set","description":"set Vonage CLI config","strict":true,"pluginName":"@vonage/cli","pluginAlias":"@vonage/cli","pluginType":"core","aliases":[],"flags":{"apiKey":{"name":"apiKey","type":"option","description":"Vonage API Key","multiple":false},"apiSecret":{"name":"apiSecret","type":"option","description":"Vonage API Key","multiple":false},"appId":{"name":"appId","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["keyFile"]},"keyFile":{"name":"keyFile","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["appId"]},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"jwt":{"id":"jwt","description":"generate a Vonage JWT token","strict":true,"pluginName":"@vonage/cli","pluginAlias":"@vonage/cli","pluginType":"core","aliases":[],"examples":["jwt --key_file='./testing.key' --app_id=31521081-e4c7-41fe-bccc-44af98879068"],"flags":{"apiKey":{"name":"apiKey","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiSecret"]},"apiSecret":{"name":"apiSecret","type":"option","helpGroup":"Vonage API Flags","multiple":false,"dependsOn":["apiKey"]},"appId":{"name":"appId","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["keyFile"]},"keyFile":{"name":"keyFile","type":"option","helpGroup":"Vonage Application Flags","multiple":false,"dependsOn":["appId"]},"trace":{"name":"trace","type":"boolean","hidden":true,"allowNo":false},"app_id":{"name":"app_id","type":"option","description":"Application ID to authenticate with","required":true,"multiple":false},"key_file":{"name":"key_file","type":"option","description":"Path to private key file location","required":true,"multiple":false},"subject":{"name":"subject","type":"option","required":false,"multiple":false},"acl":{"name":"acl","type":"option","description":"Read more about it in the ACL overview - https://developer.vonage.com/conversation/guides/jwt-acl#acls","required":false,"multiple":false},"exp":{"name":"exp","type":"option","description":"Expiration of created JWT - defaults to 24 hours.","required":false,"multiple":false}},"args":[]}}}
{
"name": "@vonage/cli",
"description": "CLI to interact with Vonage APIs",
"version": "1.1.4",
"version": "1.2.0",
"author": "Vonage Dev Rel <devrel@vonage.com>",

@@ -10,28 +10,24 @@ "bin": {

"bugs": "https://github.com/Vonage/vonage-cli/issues",
"type": "module",
"dependencies": {
"@oclif/command": "^1.8.0",
"@oclif/config": "^1.17.0",
"@oclif/plugin-help": "^3.2.0",
"@oclif/plugin-plugins": "^1.9.1",
"@types/lodash.merge": "^4.6.6",
"@types/node": "^16.6.1",
"@types/shelljs": "^0.8.8",
"@vonage/cli-plugin-applications": "^1.1.2",
"@vonage/cli-plugin-numberinsight": "^1.1.3",
"@vonage/cli-plugin-numbers": "^1.1.2",
"@vonage/cli-plugin-users": "^1.1.2",
"@vonage/cli-utils": "^1.2.1",
"cli-ux": "^5.6.3",
"lodash": "^4.17.20",
"shelljs": "^0.8.4",
"tslib": "^2.1.0"
"@oclif/core": "1.20.4",
"@oclif/plugin-help": "5.1.19",
"@oclif/plugin-plugins": "2.1.7",
"@types/node": "18.11.11",
"@types/shelljs": "0.8.11",
"@vonage/cli-plugin-applications": "1.2.0",
"@vonage/cli-plugin-numberinsight": "1.2.0",
"@vonage/cli-plugin-sms": "1.2.0",
"@vonage/cli-plugin-users": "1.2.0",
"@vonage/cli-utils": "1.3.0",
"lodash": "4.17.21",
"shelljs": "0.8.5",
"ts-node": "10.9.1"
},
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},
"files": [
"/bin",
"/dist",
"/npm-shrinkwrap.json",
"/node_modules",
"bin",
"dist/**",
"/oclif.manifest.json"

@@ -54,41 +50,8 @@ ],

"@vonage/cli-plugin-numberinsight",
"@vonage/cli-plugin-users"
"@vonage/cli-plugin-users",
"@vonage/cli-plugin-sms",
"@vonage/cli-plugin-conversations"
],
"hooks": {
"init": "./dist/hooks/init"
},
"topics": {
"auth": {
"hidden": true
},
"apps": {
"hidden": true
},
"apps:conversations": {
"hidden": true
},
"apps:users": {
"hidden": true
},
"apps:conversations:members": {
"hidden": true
},
"apps:users:conversations": {
"hidden": true
},
"account": {
"hidden": true
},
"balance": {
"hidden": true
},
"config": {
"hidden": true
},
"numbers": {
"hidden": true
},
"plugins": {
"hidden": true
}
}

@@ -98,14 +61,7 @@ },

"scripts": {
"postpack": "rm -f oclif.manifest.json",
"posttest": "eslint . --ext .ts --config .eslintrc",
"prepack": "rm -rf dist && tsc -b && oclif-dev manifest && oclif-dev readme",
"test": "../../node_modules/.bin/jest test",
"test-watch": "../../node_modules/.bin/jest test --watch",
"version": "oclif-dev readme && git add README.md",
"build": "rm -rf ./dist && tsc -b"
},
"gitHead": "e04bdc633e101ef1c1fe0190ed5d2f8452253dc4",
"devDependencies": {
"@oclif/core": "^1.6.3"
"postpack": "npx shx rm -f oclif.manifest.json",
"prepack": "npm run build && npx oclif manifest && npx oclif readme",
"version": "npx oclif readme && git add README.md",
"build": "npx shx rm -rf dist tsconfig.tsbuildinfo && tsc --build --verbose"
}
}

Sorry, the diff of this file is not supported yet

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