Enhances spo site list. Closes #6547#7004
Draft
MathijsVerbeeck wants to merge 1 commit intopnp:mainfrom
Draft
Conversation
| ```md definition-list | ||
| `-t, --type [type]` | ||
| : convenience option for type of sites to list. Allowed values are `TeamSite,CommunicationSite`. | ||
| : convenience option for type of sites to list. Allowed values are `TeamSite,CommunicationSite,fullyArchived,recentlyArchived,archived`. |
Contributor
There was a problem hiding this comment.
I'm unsure about this setup, I'm reopening the discussion on the specs for a bit on this: #6547 (comment)
martinlingstuyl
requested changes
Oct 22, 2025
| let archivedFilter: string = ''; | ||
| switch (options.type) { | ||
| case 'fullyArchived': | ||
| archivedFilter = "ArchiveStatus -eq 'FullyArchived'"; |
Contributor
There was a problem hiding this comment.
Let's not use double quotes.
Suggested change
| archivedFilter = "ArchiveStatus -eq 'FullyArchived'"; | |
| archivedFilter = `ArchiveStatus -eq 'FullyArchived'`; |
| }); | ||
|
|
||
| it('passes validation if type fullyArchived specified', async () => { | ||
| const actual = await command.validate({ options: { type: 'fullyArchived' } }, commandInfo); |
Contributor
There was a problem hiding this comment.
Let's use commandOptionsSchema.safeParse() instead of command.validate()
| }); | ||
|
|
||
| it('passes validation if type recentlyArchived specified', async () => { | ||
| const actual = await command.validate({ options: { type: 'recentlyArchived' } }, commandInfo); |
Contributor
There was a problem hiding this comment.
In this test file, could you add the commandOptionsSchema.parse() function call everywhere where an options object is constructed?
like:
Suggested change
| const actual = await command.validate({ options: { type: 'recentlyArchived' } }, commandInfo); | |
| const actual = await command.validate({ options: commandOptionsSchema.parse({ type: 'recentlyArchived' }) }, commandInfo); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6547
I also modified the command to use zod instead of the old way of working.