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

Verbose flag #59

Merged
merged 12 commits into from
Oct 26, 2023
Merged

Verbose flag #59

merged 12 commits into from
Oct 26, 2023

Conversation

AgustinSilverfin
Copy link
Contributor

@AgustinSilverfin AgustinSilverfin commented Aug 30, 2023

Description

Implement the use of package consola
Differentiate different output types error, log, debug, info, success, warn
By default use a level of info.
Add the --verbose flag which will set the the level to debug.

Fixes #37

BLOCKED BY: #56
BLOCKED BY: #57
BLOCKED BY: #50

Type of change

  • Bug fix
  • New feature
  • Breaking change

Checklist

  • README updated (if needed)
  • Version updated (if needed)
  • Documentation updated (if needed)

@AgustinSilverfin AgustinSilverfin added the feature request New feature or request label Aug 30, 2023
@AgustinSilverfin AgustinSilverfin self-assigned this Aug 30, 2023
@AgustinSilverfin AgustinSilverfin changed the title Verbose flag [DRAFT] Verbose flag Sep 12, 2023
@AgustinSilverfin AgustinSilverfin changed the title [DRAFT] Verbose flag [BLOCKED] Verbose flag Sep 12, 2023
@AgustinSilverfin AgustinSilverfin force-pushed the verbose-flag branch 2 times, most recently from 3821624 to 47cc638 Compare September 12, 2023 11:53
@AgustinSilverfin AgustinSilverfin force-pushed the verbose-flag branch 2 times, most recently from 515a3fa to 3c41278 Compare October 13, 2023 07:26
Copy link
Contributor

@Woetfin Woetfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on the update & nice find with consola!

Besides the code comments, also some general remarks:

Some merge conflicts still outstanding

Tested commands:

  • run-test: OK
  • import-reconciliation: OK
  • update-reconciliation: OK
  • get-reconciliation-id: No output of success

consola.prompt for authorization flow

Consola also has a prompt function, for the authorization command, it wouldn't be too big of a refactor to already use this.
Created separate issue to integrate this for the rest of the commands: #83

consola.info(

      `NOTE: if you need to exit this process you can press "Ctrl/Cmmd + C"`

    );

    const redirectUri = "urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob";

    const scope =

      "administration%3Aread%20administration%3Awrite%20financials%3Aread%20financials%3Awrite%20workflows%3Aread";

  

    const firmIdPrompt = await consola.prompt("Enter the firm ID: ", {

      initial: firmId,

    });

  

    const url = `${apiUtils.BASE_URL}/f/${firmIdPrompt}/oauth/authorize?client_id=${process.env.SF_API_CLIENT_ID}&redirect_uri=${redirectUri}&response_type=code&scope=${scope}`;

  

    await open(url);

    consola.info(`You need to authorize your APP in the browser`);

    consola.info("Insert your credentials...");

    const authCodePrompt = await consola.prompt(

      "Enter your API authorization code: ",

      {

        echo: "*",

      }

    );

lib/utils/fsUtils.js Outdated Show resolved Hide resolved
lib/api/sfApi.js Show resolved Hide resolved
lib/cli/utils.js Show resolved Hide resolved
lib/utils/apiUtils.js Outdated Show resolved Hide resolved
lib/utils/fsUtils.js Show resolved Hide resolved
lib/utils/fsUtils.js Show resolved Hide resolved
lib/utils/fsUtils.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@AgustinSilverfin
Copy link
Contributor Author

Changes implemented. Also rebased (again) from export-files to align.

@AgustinSilverfin AgustinSilverfin changed the title [BLOCKED] Verbose flag Verbose flag Oct 26, 2023
@AgustinSilverfin AgustinSilverfin force-pushed the verbose-flag branch 4 times, most recently from ddd6c1d to c42681f Compare October 26, 2023 14:02
Woetfin and others added 5 commits October 26, 2023 16:10
Rename several methods to align across template types
Create separate classes for each template type
Rename several methods to align across template types
Create separate classes for each template type
Copy link
Contributor

@Woetfin Woetfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as well to go live!

@AgustinSilverfin AgustinSilverfin merged commit a704aed into main Oct 26, 2023
@AgustinSilverfin AgustinSilverfin deleted the verbose-flag branch October 26, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: reducing printed information when using import-shared-part command
2 participants