Skip to content

Commit

Permalink
feat: switch to createPromptModule (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-dixit authored Jan 21, 2025
1 parent 1d5f767 commit 2fc3c20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions js/src/cli/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export default class AddCommand {
}

async shouldForceConnectionSetup() {
const { shouldForce } = await inquirer.prompt([
const prompt = inquirer.createPromptModule();
const { shouldForce } = await prompt([
{
type: "confirm",
name: "shouldForce",
Expand Down Expand Up @@ -263,7 +264,8 @@ export default class AddCommand {
!skipDefaultConnectorAuth &&
testConnectors.find((connector) => connector.auth_mode === userAuthMode)
) {
const { doYouWantToUseComposioAuth } = await inquirer.prompt({
const prompt = inquirer.createPromptModule();
const { doYouWantToUseComposioAuth } = await prompt({
type: "confirm",
name: "doYouWantToUseComposioAuth",
message: "Do you want to use Composio Auth?",
Expand All @@ -275,7 +277,8 @@ export default class AddCommand {
useComposioAuth = false;
}

const { integrationName } = await inquirer.prompt({
const prompt = inquirer.createPromptModule();
const { integrationName } = await prompt({
type: "input",
name: "integrationName",
message: "Enter the Integration name",
Expand Down Expand Up @@ -411,7 +414,8 @@ export default class AddCommand {
continue;
}

const { [field.name]: value } = await inquirer.prompt({
const prompt = inquirer.createPromptModule();
const { [field.name]: value } = await prompt({
type: "input",
name: field.name,
message: (field.displayName || field.display_name) as string,
Expand Down
3 changes: 2 additions & 1 deletion js/src/cli/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default class LoginCommand {
}

private async promptForAuthCode(): Promise<string> {
const { authCode } = await inquirer.prompt({
const prompt = inquirer.createPromptModule();
const { authCode } = await prompt({
type: "input",
name: "authCode",
message: "Enter authentication code:",
Expand Down
3 changes: 2 additions & 1 deletion js/src/cli/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ export class TriggerAdd {

for (const key in properties) {
if (requiredProperties.includes(key)) {
const answer = await inquirer.prompt([
const prompt = inquirer.createPromptModule();
const answer = await prompt([
{
type: "input",
name: key,
Expand Down

0 comments on commit 2fc3c20

Please sign in to comment.