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

@vonage/cli-plugin-numberinsight

Package Overview
Dependencies
Maintainers
37
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/cli-plugin-numberinsight - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

dist/commands/numberinsight/index.js.map

13

dist/commands/numberinsight/index.d.ts

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

import NumberInsightCommand from '../../numberinsight_base';
import NumberInsightCommand from '../../numberinsight_base.js';
import { ArgInput } from '@oclif/core/lib/interfaces';
import { flags } from '@oclif/parser';
export default class NumberInsight extends NumberInsightCommand<typeof NumberInsight.flags> {

@@ -8,10 +7,4 @@ static description: string;

static flags: {
level: flags.IOptionFlag<string>;
confirm: flags.IBooleanFlag<boolean>;
help: any;
apiKey: any;
apiSecret: any;
appId: any;
keyFile: any;
trace: any;
level: import("@oclif/core/lib/interfaces").OptionFlag<string>;
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
};

@@ -18,0 +11,0 @@ static args: ArgInput;

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

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const numberinsight_base_1 = __importDefault(require("../../numberinsight_base"));
const parser_1 = require("@oclif/parser");
const lodash_1 = require("lodash");
const prompts_1 = require("prompts");
const chalk_1 = __importDefault(require("chalk"));
const cli_ux_1 = __importDefault(require("cli-ux"));
var _a;
import NumberInsightCommand from '../../numberinsight_base.js';
import _ from 'lodash';
import prompts from 'prompts';
import chalk from 'chalk';
import { CliUx, Flags } from '@oclif/core';
const { prompt } = prompts;
const cli = CliUx.ux;
function notBasic(level) {
return level === 'standard' || level === 'advancedSync';
}
class NumberInsight extends numberinsight_base_1.default {
run() {
return __awaiter(this, void 0, void 0, function* () {
const flags = this.parsedFlags;
const args = this.parsedArgs;
if (notBasic(flags.level) && !flags.confirm) {
let response = yield (0, prompts_1.prompt)([
{
type: 'confirm',
name: 'confirm',
message: `This operation will charge your account. Proceed?`,
initial: false
}
]);
if (response.confirm === false) {
this.log('Cancelled Number Insights operation.');
this.exit();
}
;
}
cli_ux_1.default.action.start(chalk_1.default.bold('Fetching Insights'));
let insights = yield this.getInsights(args.number, flags.level);
cli_ux_1.default.action.stop();
if (insights.status !== 0) {
this.log(insights.status_message);
export default class NumberInsight extends NumberInsightCommand {
async run() {
const flags = this.parsedFlags;
const args = this.parsedArgs;
if (notBasic(flags.level) && !flags.confirm) {
const response = await prompt([
{
type: 'confirm',
name: 'confirm',
message: `This operation will charge your account. Proceed?`,
initial: false,
},
]);
if (response.confirm === false) {
this.log('Cancelled Number Insights operation.');
this.exit();
}
this.log(chalk_1.default.underline.bold.inverse(`Number Insights - ${(0, lodash_1.startCase)((0, lodash_1.toLower)(flags.level))}`));
}
cli.action.start(chalk.bold('Fetching Insights'));
const insights = await this.getInsights(args.number, flags.level);
cli.action.stop();
if (insights.status !== 0) {
this.log(insights.status_message);
this.exit();
}
this.log(chalk.underline.bold.inverse(`Number Insights - ${_.startCase(_.toLower(flags.level))}`));
this.log();
if (flags.level === 'advancedSync') {
this.log(insights.lookup_outcome_message);
this.log();
if (flags.level === 'advancedSync') {
this.log(insights.lookup_outcome_message);
this.log();
}
this.log(chalk_1.default.bold(`Number Formats`));
this.log(`National: ${insights.national_format_number}`);
this.log(`International: ${insights.international_format_number}`);
}
this.log(chalk.bold(`Number Formats`));
this.log(`National: ${insights.national_format_number}`);
this.log(`International: ${insights.international_format_number}`);
this.log();
this.log(chalk.bold(`Country Details`));
this.log(`Country: ${insights.country_name}`);
this.log(`Country Code: ${insights.country_code}`);
this.log(`ISO 3 Code: ${insights.country_code_iso3}`);
this.log(`Prefix: ${insights.country_prefix}`);
if (notBasic(flags.level)) {
const { roaming } = insights;
this.log();
this.log(chalk_1.default.bold(`Country Details`));
this.log(`Country: ${insights.country_name}`);
this.log(`Country Code: ${insights.country_code}`);
this.log(`ISO 3 Code: ${insights.country_code_iso3}`);
this.log(`Prefix: ${insights.country_prefix}`);
if (notBasic(flags.level)) {
this.log();
this.log(chalk_1.default.bold(`Current Carrier`));
this.log(`Name: ${insights.current_carrier.name}`);
this.log(`Country: ${insights.current_carrier.country}`);
this.log(`Network Type: ${insights.current_carrier.network_type}`);
this.log(`Network Code: ${insights.current_carrier.network_code}`);
this.log();
this.log(chalk_1.default.bold(`Original Carrier`));
this.log(`Name: ${insights.original_carrier.name}`);
this.log(`Country: ${insights.original_carrier.country}`);
this.log(`Network Type: ${insights.original_carrier.network_type}`);
this.log(`Network Code: ${insights.original_carrier.network_code}`);
this.log();
this.log(chalk_1.default.bold(`Ported: ${insights.ported}`));
this.log();
this.log(chalk_1.default.bold(`Roaming Status: ${insights.roaming.status || insights.roaming}`));
this.log(chalk.bold(`Current Carrier`));
this.log(`Name: ${insights.current_carrier.name}`);
this.log(`Country: ${insights.current_carrier.country}`);
this.log(`Network Type: ${insights.current_carrier.network_type}`);
this.log(`Network Code: ${insights.current_carrier.network_code}`);
this.log();
this.log(chalk.bold(`Original Carrier`));
this.log(`Name: ${insights.original_carrier.name}`);
this.log(`Country: ${insights.original_carrier.country}`);
this.log(`Network Type: ${insights.original_carrier.network_type}`);
this.log(`Network Code: ${insights.original_carrier.network_code}`);
this.log();
this.log(chalk.bold(`Ported: ${insights.ported}`));
this.log();
if (typeof roaming === 'string') {
this.log(chalk.bold(`Roaming: ${roaming}`));
}
if (flags.level === 'advancedSync') {
this.log();
this.log(chalk_1.default.bold(`Valid Number: ${insights.valid_number}`));
this.log();
this.log(chalk_1.default.bold(`Reachable: ${insights.reachable}`));
else if (null !== roaming) {
this.log(chalk.bold(`Roaming`));
this.log(chalk.bold(`Status: ${insights?.roaming?.status || insights.roaming}`));
this.log(chalk.bold(`Country Code ${insights?.roaming?.country_code || insights.roaming}`));
}
if (notBasic(flags.level)) {
this.log();
this.log(chalk_1.default.bold('Account Balance'));
this.log(`Request Cost: ${insights.request_price}`);
this.log(`Remaining Balance: ${insights.remaining_balance}`);
else {
this.log(chalk.bold('Roaming: null'));
}
this.exit();
});
}
if (flags.level === 'advancedSync') {
this.log();
this.log(chalk.bold(`Valid Number: ${insights.valid_number}`));
this.log();
this.log(chalk.bold(`Reachable: ${insights.reachable}`));
}
if (notBasic(flags.level)) {
this.log();
this.log(chalk.bold('Account Balance'));
this.log(`Request Cost: ${insights.request_price}`);
this.log(`Remaining Balance: ${insights.remaining_balance}`);
}
this.exit();
}
}
exports.default = NumberInsight;
_a = NumberInsight;
NumberInsight.description = 'get details about a phone number';
NumberInsight.examples = [
`vonage numberinsight 15555555555`, `vonage numberinsight 15555555555 --level=advanced`
`vonage numberinsight 15555555555`,
`vonage numberinsight 15555555555 --level=advanced`,
];
NumberInsight.flags = Object.assign(Object.assign({}, numberinsight_base_1.default.flags), { level: parser_1.flags.string({
NumberInsight.flags = {
...NumberInsightCommand.flags,
level: Flags.string({
required: false,
default: 'basic',
parse: input => input === 'advanced' ? `advancedSync` : input,
options: ['basic', 'standard', 'advanced']
}), confirm: parser_1.flags.boolean({ char: 'y', required: false }) });
NumberInsight.args = [
{ name: 'number', required: true },
];
parse: async (input) => (input === 'advanced' ? `advancedSync` : input),
options: ['basic', 'standard', 'advanced'],
}),
confirm: Flags.boolean({ char: 'y', required: false }),
};
NumberInsight.args = [{ name: 'number', required: true }];
//# sourceMappingURL=index.js.map

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {};
export default {};
//# sourceMappingURL=index.js.map

@@ -1,11 +0,5 @@

import BaseCommand from '@vonage/cli-utils';
import { OutputFlags } from '@oclif/parser';
import { ArgInput } from '@oclif/core/lib/interfaces';
export default abstract class NumberInsightCommand<T extends typeof BaseCommand.flags> extends BaseCommand<T> {
protected parsedArgs: any;
protected parsedFlags: any;
static flags: OutputFlags<typeof BaseCommand.flags>;
static args: ArgInput;
import VonageCommand from '@vonage/cli-utils';
export default abstract class NumberInsightCommand<T> extends VonageCommand<typeof NumberInsightCommand> {
catch(error: any): Promise<any>;
getInsights(number: any, level?: string): any;
}

@@ -1,24 +0,5 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
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 NumberInsightCommand extends cli_utils_1.default {
catch(error) {
const _super = Object.create(null, {
catch: { get: () => super.catch }
});
return __awaiter(this, void 0, void 0, function* () {
return _super.catch.call(this, error);
});
import VonageCommand from '@vonage/cli-utils';
export default class NumberInsightCommand extends VonageCommand {
async catch(error) {
return super.catch(error);
}

@@ -38,4 +19,2 @@ getInsights(number, level = 'basic') {

}
exports.default = NumberInsightCommand;
NumberInsightCommand.flags = Object.assign({}, cli_utils_1.default.flags);
NumberInsightCommand.args = Object.assign({}, cli_utils_1.default.args);
//# sourceMappingURL=numberinsight_base.js.map

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

{"version":"1.1.3","commands":{"numberinsight":{"id":"numberinsight","description":"get details about a phone number","pluginName":"@vonage/cli-plugin-numberinsight","pluginType":"core","aliases":[],"examples":["vonage numberinsight 15555555555","vonage numberinsight 15555555555 --level=advanced"],"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},"level":{"name":"level","type":"option","required":false,"options":["basic","standard","advanced"],"default":"basic"},"confirm":{"name":"confirm","type":"boolean","char":"y","required":false,"allowNo":false}},"args":[{"name":"number","required":true}]}}}
{"version":"1.2.0","commands":{"numberinsight":{"id":"numberinsight","description":"get details about a phone number","strict":true,"pluginName":"@vonage/cli-plugin-numberinsight","pluginAlias":"@vonage/cli-plugin-numberinsight","pluginType":"core","aliases":[],"examples":["vonage numberinsight 15555555555","vonage numberinsight 15555555555 --level=advanced"],"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},"level":{"name":"level","type":"option","required":false,"multiple":false,"options":["basic","standard","advanced"],"default":"basic"},"confirm":{"name":"confirm","type":"boolean","char":"y","required":false,"allowNo":false}},"args":[{"name":"number","required":true}]}}}
{
"name": "@vonage/cli-plugin-numberinsight",
"version": "1.1.3",
"version": "1.2.0",
"author": "Vonage Dev Rel <devrel@vonage.com>",
"bugs": "https://github.com/Vonage/vonage-cli/issues",
"type": "module",
"dependencies": {
"@oclif/command": "^1.8.0",
"@oclif/config": "^1.17.0",
"@oclif/parser": "^3.8.5",
"@types/inquirer": "^7.3.1",
"@types/node": "^16.6.1",
"@vonage/cli-utils": "^1.2.1",
"chalk": "^2.4.2",
"cli-ux": "^5.6.3",
"lodash": "^4.17.20",
"prompts": "^2.4.0",
"tslib": "^2.1.0"
"@oclif/core": "1.20.4",
"@vonage/cli-utils": "1.3.0",
"chalk": "5.1.2",
"lodash": "4.17.21",
"prompts": "2.4.2"
},
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},
"files": [
"/dist",
"/bin",
"/npm-shrinkwrap.json",
"/node_modules",
"bin",
"dist/**",
"/oclif.manifest.json"

@@ -35,21 +28,11 @@ ],

"oclif": {
"commands": "./dist/commands",
"bin": "oclif-example",
"devPlugins": [
"@oclif/plugin-help"
]
"commands": "./dist/commands"
},
"repository": "Vonage/vonage-cli",
"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"
},
"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"
}
}

@@ -19,9 +19,9 @@ @vonage/cli-plugin-numbers

$ npm install -g @vonage/cli-plugin-numberinsight
$ oclif-example COMMAND
$ @vonage/cli-plugin-numberinsight COMMAND
running command...
$ oclif-example (-v|--version|version)
@vonage/cli-plugin-numberinsight/1.1.3 linux-x64 node-v14.2.0
$ oclif-example --help [COMMAND]
$ @vonage/cli-plugin-numberinsight (--version)
@vonage/cli-plugin-numberinsight/1.2.0 darwin-arm64 node-v16.18.1
$ @vonage/cli-plugin-numberinsight --help [COMMAND]
USAGE
$ oclif-example COMMAND
$ @vonage/cli-plugin-numberinsight COMMAND
...

@@ -32,5 +32,5 @@ ```

<!-- commands -->
* [`oclif-example numberinsight NUMBER`](#oclif-example-numberinsight-number)
* [`@vonage/cli-plugin-numberinsight numberinsight NUMBER`](#vonagecli-plugin-numberinsight-numberinsight-number)
## `oclif-example numberinsight NUMBER`
## `@vonage/cli-plugin-numberinsight numberinsight NUMBER`

@@ -41,15 +41,28 @@ get details about a phone number

USAGE
$ oclif-example numberinsight NUMBER
$ @vonage/cli-plugin-numberinsight numberinsight [NUMBER] [--apiKey <value> --apiSecret <value>] [--appId <value>
--keyFile <value>] [--level basic|standard|advanced] [-y]
OPTIONS
-h, --help show CLI help
FLAGS
-y, --confirm
--level=basic|standard|advanced [default: basic]
--level=<option> [default: basic]
<options: basic|standard|advanced>
VONAGE API FLAGS FLAGS
--apiKey=<value>
--apiSecret=<value>
VONAGE APPLICATION FLAGS FLAGS
--appId=<value>
--keyFile=<value>
DESCRIPTION
get details about a phone number
EXAMPLES
vonage numberinsight 15555555555
vonage numberinsight 15555555555 --level=advanced
```
_See code: [dist/commands/numberinsight/index.js](https://github.com/Vonage/vonage-cli/blob/v1.1.3/dist/commands/numberinsight/index.js)_
_See code: [dist/commands/numberinsight/index.js](https://github.com/Vonage/vonage-cli/blob/v1.2.0/dist/commands/numberinsight/index.js)_
<!-- commandsstop -->
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