Skip to content

feature: help menu call for flag issues only, adjustment of getTokens api call#99

Open
brycentrivir wants to merge 5 commits into
mainfrom
feature/help-menu-display-locations
Open

feature: help menu call for flag issues only, adjustment of getTokens api call#99
brycentrivir wants to merge 5 commits into
mainfrom
feature/help-menu-display-locations

Conversation

@brycentrivir

Copy link
Copy Markdown

No description provided.

@brycentrivir
brycentrivir marked this pull request as ready for review April 23, 2026 20:56

@phalestrivir phalestrivir left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have a lot of comments mentioning to remove options.file when checking for the allSeparate case (this is for imports). All this is doing is making -f take precedence over -A, which I think does make sense, so I'm thinking you should go through all these import files and re-order them so that options.file case comes before options.allSeparate, and this would achieve the same affect.

Comment on lines +70 to 74
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be replaced with // code goes here, since we already handled the exit code with process.exit(1) prior to this.

Comment on lines +58 to 62
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be replaced with // code goes here, since we already handled the exit code with process.exit(1) prior to this.

Comment on lines +68 to 72
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be replaced with // code goes here, since we already handled the exit code with process.exit(1) prior to this.

Comment on lines +56 to 60
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be replaced with // code goes here, since we already handled the exit code with process.exit(1) prior to this.

Comment on lines +80 to 84
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be replaced with // code goes here, since we already handled the exit code with process.exit(1) prior to this.

options.file &&
(await getTokens(false, true, deploymentTypes))
) {
else if (options.individualObject && options.file) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd change this to an if since the previous if will always exit if it's true.

Comment thread src/cli/idp/idp-delete.ts

program
.description('Delete (social) identity providers.')
.addOption(new Option('-i, --idp-id <idp-id>', 'Id/name of a provider.'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make this required

Comment thread src/cli/idp/idp-delete.ts
Comment on lines +26 to 33
if (!options.idpId) {
printMessage(
'Unrecognized combination of options or no options...',
'error'
);
program.help();
process.exitCode = 1;
program.help();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete this, it is not necessary since id is required

Comment thread src/cli/idp/idp-import.ts
Comment on lines +58 to +61
!options.idpId &&
!options.all &&
!options.allSeparate &&
!options.file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing options.file for both id and all cases

Comment thread src/cli/idp/idp-import.ts
}
// --all-separate -A
else if (options.allSeparate && !options.file && (await getTokens())) {
else if (options.allSeparate && !options.file) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove options.file here

@phalestrivir phalestrivir left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Accidentally submitted my first review before I finished, so here are all the other changes you need to make.

Note that you forgot to update the theme-import file. There might be other files you didn't update as well, so make sure you double check, especially if you end up rebasing with main there will likely be new commands that need to be updated as well.

Comment on lines 13 to 15
.addOption(
new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make this required

Comment on lines 16 to 21
// .addOption(
// new Option(
// '-a, --all',
// 'Disable all the journeys/trees in a realm. Ignored with -i.'
// )
// )

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would just delete this I think since it's not implemented

Comment on lines +33 to +40
if (!options.journeyId) {
printMessage(
'Unrecognized combination of options or no options...',
'error'
);
process.exitCode = 1;
program.help();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete this, not necessary since id is required


// disable
if (options.journeyId && (await getTokens())) {
if (options.journeyId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete this if statement, not necessary since id is required

program
.description('Enable journeys/trees.')
.addOption(
new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make this requried

Comment on lines +57 to +64
if (!options.secretstoreType && !options.secretstoreId) {
printMessage(
`'${options.secretstoreType}' does not have mappings.`,
'Unrecognized combination of options or no options...',
'error'
);
process.exitCode = 1;
} else if (
options.secretstoreId &&
(await getTokens(
false,
true,
options.global ? globalDeploymentTypes : deploymentTypes
))
program.help();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete this whole if statement

Comment on lines +46 to 50
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be // code goes here

Comment on lines +44 to 48
if (options) {
// code goes here
} else {
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be // code goes here

Comment on lines +66 to +70
!options.serverId &&
!options.serverUrl &&
!options.all &&
!options.allSeparate &&
!options.file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing options.file for id, url, and all cases

Comment on lines +95 to +98
!options.serviceId &&
!options.file &&
!options.all &&
!options.allSeparate

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing options.file for id and all cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants