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

New Command: pp website webfile list #6415

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

ktskumar
Copy link
Contributor

@ktskumar ktskumar commented Oct 8, 2024

Closes #6262
Add new command for listing webfiles from Powerpages website

@milanholemans
Copy link
Contributor

Thanks, we'll try to review it ASAP!

@Adam-it Adam-it added the hacktoberfest-accepted Accept for hacktoberfest, will merge later label Oct 29, 2024
@Adam-it
Copy link
Member

Adam-it commented Oct 29, 2024

@ktskumar I added the hacktoberfest-accepted label to this PR which means that this PR will count as done for the Hacktoberfest event. So if you participate in this event it will get you unblocked and it allows us to merge this PR later when we catch up 👍
Thanks for your support and awesome contribution 👏 You Rock 🤩

@martinlingstuyl martinlingstuyl self-assigned this Nov 19, 2024
Copy link
Contributor

@martinlingstuyl martinlingstuyl left a comment

Choose a reason for hiding this comment

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

Hi @ktskumar, I reviewed your PR. Could you look at my comments? Thanks in advance!

);
}

#initValidators(): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move to using zod here instead, just like you did for the weblinks Pr.

);
}

private async getWebSiteId(dynamicsApiUrl: string, args: CommandArgs): Promise<any> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move private functions to below the commandAction function. Could we also type this to string instead of any?

also:

Suggested change
private async getWebSiteId(dynamicsApiUrl: string, args: CommandArgs): Promise<any> {
private async getWebsiteId(dynamicsApiUrl: string, args: CommandArgs): Promise<string> {

if (args.options.websiteId) {
return args.options.websiteId;
}
const options: PpWebSiteOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This options object is not really used, let's remove it.

responseType: 'json'
};

if (options.name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this if statement because we know for certain args.options.websiteName should be filled here. Let's use args.options.websiteName! if necessary.

private async getWebSiteId(dynamicsApiUrl: string, args: CommandArgs): Promise<any> {
if (args.options.websiteId) {
return args.options.websiteId;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a verbose logging line below here, about retrieving the website Id

@martinlingstuyl martinlingstuyl marked this pull request as draft November 19, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accept for hacktoberfest, will merge later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New command: m365 pp website webfile list
4 participants