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

fix(demo): direct import to remove warnings #1094

Merged
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
16 changes: 8 additions & 8 deletions demo/src/AliceInquirer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CredentialExchangeRecord, ProofExchangeRecord } from '@aries-frame

import { clear } from 'console'
import { textSync } from 'figlet'
import inquirer from 'inquirer'
import { prompt } from 'inquirer'

import { Alice } from './Alice'
import { BaseInquirer, ConfirmOptions } from './BaseInquirer'
Expand Down Expand Up @@ -42,10 +42,10 @@ export class AliceInquirer extends BaseInquirer {
}

private async getPromptChoice() {
if (this.alice.connectionRecordFaberId) return inquirer.prompt([this.inquireOptions(this.promptOptionsString)])
if (this.alice.connectionRecordFaberId) return prompt([this.inquireOptions(this.promptOptionsString)])

const reducedOption = [PromptOptions.ReceiveConnectionUrl, PromptOptions.Exit, PromptOptions.Restart]
return inquirer.prompt([this.inquireOptions(reducedOption)])
return prompt([this.inquireOptions(reducedOption)])
}

public async processAnswer() {
Expand All @@ -70,7 +70,7 @@ export class AliceInquirer extends BaseInquirer {
}

public async acceptCredentialOffer(credentialRecord: CredentialExchangeRecord) {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.CredentialOfferTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.CredentialOfferTitle)])
if (confirm.options === ConfirmOptions.No) {
await this.alice.agent.credentials.declineOffer(credentialRecord.id)
} else if (confirm.options === ConfirmOptions.Yes) {
Expand All @@ -79,7 +79,7 @@ export class AliceInquirer extends BaseInquirer {
}

public async acceptProofRequest(proofRecord: ProofExchangeRecord) {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.ProofRequestTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.ProofRequestTitle)])
if (confirm.options === ConfirmOptions.No) {
await this.alice.agent.proofs.declineRequest(proofRecord.id)
} else if (confirm.options === ConfirmOptions.Yes) {
Expand All @@ -89,7 +89,7 @@ export class AliceInquirer extends BaseInquirer {

public async connection() {
const title = Title.InvitationTitle
const getUrl = await inquirer.prompt([this.inquireInput(title)])
const getUrl = await prompt([this.inquireInput(title)])
await this.alice.acceptConnection(getUrl.input)
if (!this.alice.connected) return

Expand All @@ -105,7 +105,7 @@ export class AliceInquirer extends BaseInquirer {
}

public async exit() {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.ConfirmTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.ConfirmTitle)])
if (confirm.options === ConfirmOptions.No) {
return
} else if (confirm.options === ConfirmOptions.Yes) {
Expand All @@ -114,7 +114,7 @@ export class AliceInquirer extends BaseInquirer {
}

public async restart() {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.ConfirmTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.ConfirmTitle)])
if (confirm.options === ConfirmOptions.No) {
await this.processAnswer()
return
Expand Down
4 changes: 2 additions & 2 deletions demo/src/BaseInquirer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import inquirer from 'inquirer'
import { prompt } from 'inquirer'

import { Title } from './OutputClass'

Expand Down Expand Up @@ -48,7 +48,7 @@ export class BaseInquirer {

public async inquireMessage() {
this.inputInquirer.message = Title.MessageTitle
const message = await inquirer.prompt([this.inputInquirer])
const message = await prompt([this.inputInquirer])

return message.input[0] === 'q' ? null : message.input
}
Expand Down
12 changes: 6 additions & 6 deletions demo/src/FaberInquirer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { clear } from 'console'
import { textSync } from 'figlet'
import inquirer from 'inquirer'
import { prompt } from 'inquirer'

import { BaseInquirer, ConfirmOptions } from './BaseInquirer'
import { Faber } from './Faber'
Expand Down Expand Up @@ -42,10 +42,10 @@ export class FaberInquirer extends BaseInquirer {
}

private async getPromptChoice() {
if (this.faber.outOfBandId) return inquirer.prompt([this.inquireOptions(this.promptOptionsString)])
if (this.faber.outOfBandId) return prompt([this.inquireOptions(this.promptOptionsString)])

const reducedOption = [PromptOptions.CreateConnection, PromptOptions.Exit, PromptOptions.Restart]
return inquirer.prompt([this.inquireOptions(reducedOption)])
return prompt([this.inquireOptions(reducedOption)])
}

public async processAnswer() {
Expand Down Expand Up @@ -80,7 +80,7 @@ export class FaberInquirer extends BaseInquirer {
}

public async exitUseCase(title: string) {
const confirm = await inquirer.prompt([this.inquireConfirmation(title)])
const confirm = await prompt([this.inquireConfirmation(title)])
if (confirm.options === ConfirmOptions.No) {
return false
} else if (confirm.options === ConfirmOptions.Yes) {
Expand Down Expand Up @@ -108,7 +108,7 @@ export class FaberInquirer extends BaseInquirer {
}

public async exit() {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.ConfirmTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.ConfirmTitle)])
if (confirm.options === ConfirmOptions.No) {
return
} else if (confirm.options === ConfirmOptions.Yes) {
Expand All @@ -117,7 +117,7 @@ export class FaberInquirer extends BaseInquirer {
}

public async restart() {
const confirm = await inquirer.prompt([this.inquireConfirmation(Title.ConfirmTitle)])
const confirm = await prompt([this.inquireConfirmation(Title.ConfirmTitle)])
if (confirm.options === ConfirmOptions.No) {
await this.processAnswer()
return
Expand Down