Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(utils): Fix build issue with OutputArgs #47

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/numberInsight/src/commands/numberinsight/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NumberInsightCommand from '../../numberinsight_base';
import { OutputFlags, OutputArgs, flags } from '@oclif/parser';
import { OutputFlags, flags } from '@oclif/parser';
import { startCase, toLower } from 'lodash';
import { prompt } from 'prompts'
import chalk from 'chalk';
Expand Down
8 changes: 2 additions & 6 deletions packages/numbers/src/commands/numbers/buy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import NumberCommand from '../../number_base';
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';

interface buyArgs extends OutputArgs {
number: string,
countryCode: string
}

export default class NumberBuy extends NumberCommand {
static description = 'buy a Vonage number'
Expand All @@ -21,7 +17,7 @@ export default class NumberBuy extends NumberCommand {
]

async run() {
const args = this.parsedArgs! as buyArgs;
const args = this.parsedArgs!;
await this.numberBuy(args);
this.log(`Number ${args.number} has been purchased.`)
}
Expand Down
7 changes: 2 additions & 5 deletions packages/numbers/src/commands/numbers/cancel.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import NumberCommand from '../../number_base';
import { OutputFlags } from '@oclif/parser';

interface cancelArgs {
number: string,
countryCode: string
}

export default class NumberCancel extends NumberCommand {
static description = 'cancel a Vonage number'

Expand All @@ -20,7 +17,7 @@ export default class NumberCancel extends NumberCommand {
]

async run() {
const args = this.parsedArgs! as cancelArgs;
const args = this.parsedArgs!;
await this.numberCancel(args);
this.log(`Number ${args.number} has been cancelled.`)
}
Expand Down
6 changes: 1 addition & 5 deletions packages/numbers/src/commands/numbers/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ interface searchFlags {
features?: any
}

interface searchArgs {
countryCode?: string
}


export default class NumberSearch extends NumberCommand {
static description = 'search for available Vonage numbers'
Expand Down Expand Up @@ -62,7 +58,7 @@ export default class NumberSearch extends NumberCommand {

async run() {
const flags = this.parsedFlags as OutputFlags<typeof NumberCommand.flags> & searchFlags
const args = this.parsedArgs! as searchArgs;
const args = this.parsedArgs!;

let numberData = await this.numberSearch(args.countryCode, flags);
cli.table(numberData.numbers, {
Expand Down
8 changes: 2 additions & 6 deletions packages/users/src/commands/apps/users/create.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';
import { flags } from '@oclif/command'
import UserCommand from '../../../users_base';
import cli from 'cli-ux';
Expand All @@ -10,10 +10,6 @@ interface CreateFlags {
image_url: any
}

interface CreateArgs extends OutputArgs {
name: string,
}

export default class UsersCreate extends UserCommand {
static description = ""

Expand All @@ -32,7 +28,7 @@ export default class UsersCreate extends UserCommand {

async run() {
const flags = this.parsedFlags
const args = this.parsedArgs! as CreateArgs;
const args = this.parsedArgs!;

// check for name

Expand Down
7 changes: 2 additions & 5 deletions packages/users/src/commands/apps/users/delete.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';
import UserCommand from '../../../users_base';
import chalk from 'chalk';

interface DeleteArgs extends OutputArgs {
userID: string,
}

export default class UsersDelete extends UserCommand {
static description = ""
Expand All @@ -21,7 +18,7 @@ export default class UsersDelete extends UserCommand {
]

async run() {
const args = this.parsedArgs! as DeleteArgs;
const args = this.parsedArgs!;

await this.deleteUser(args.userID);

Expand Down
7 changes: 2 additions & 5 deletions packages/users/src/commands/apps/users/show.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';
import UserCommand from '../../../users_base';
import chalk from 'chalk';
import { VetchResponse } from '../../../types';

interface ShowArgs extends OutputArgs {
userID: string,
}

export default class UsersShow extends UserCommand {
static description = ""
Expand All @@ -22,7 +19,7 @@ export default class UsersShow extends UserCommand {
]

async run() {
const args = this.parsedArgs! as ShowArgs;
const args = this.parsedArgs!;

let response = await this.getUserById(args.userID) as VetchResponse;

Expand Down
7 changes: 2 additions & 5 deletions packages/users/src/commands/apps/users/update.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';
import { flags } from '@oclif/command'
import UserCommand from '../../../users_base';
import chalk from 'chalk';
Expand All @@ -10,9 +10,6 @@ interface UpdateFlags {
image_url: any
}

interface UpdateArgs extends OutputArgs {
userID: string,
}

export default class UsersUpdate extends UserCommand {
static description = ""
Expand All @@ -33,7 +30,7 @@ export default class UsersUpdate extends UserCommand {

async run() {
const flags = this.parsedFlags
const args = this.parsedArgs! as UpdateArgs;
const args = this.parsedArgs!;


let response = await this.updateUser({ ...args, ...flags }) as VetchResponse;
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command, flags } from '@oclif/command';
import { OutputArgs, OutputFlags } from '@oclif/parser';
import { OutputFlags } from '@oclif/parser';
import Vonage from '@vonage/server-sdk';
import { CredentialsObject } from '@vonage/server-sdk';
import { readFileSync, writeFileSync } from 'fs';
Expand Down Expand Up @@ -44,7 +44,7 @@ export default abstract class BaseCommand extends Command {
protected _keyFile!: any
protected _userConfig!: UserConfig

protected parsedArgs?: OutputArgs;
protected parsedArgs?;
protected parsedFlags?: OutputFlags<typeof BaseCommand.flags>;
protected globalFlags?: OutputFlags<any>;

Expand Down