Skip to content

Adds command spo site accessrequest list#7218

Open
MathijsVerbeeck wants to merge 1 commit intopnp:mainfrom
MathijsVerbeeck:add-spo-site-accessrequest-list
Open

Adds command spo site accessrequest list#7218
MathijsVerbeeck wants to merge 1 commit intopnp:mainfrom
MathijsVerbeeck:add-spo-site-accessrequest-list

Conversation

@MathijsVerbeeck
Copy link
Copy Markdown
Contributor

Closes #6304

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new SharePoint Online command to the CLI for Microsoft 365 to list site access requests, with accompanying tests and documentation, aligning SPO command capabilities with the requested feature in #6304.

Changes:

  • Introduces m365 spo site accessrequest list command implementation, including optional filtering by request state and adding a derived StatusLabel.
  • Adds a comprehensive Mocha test suite for validation, filtering behavior, and error handling.
  • Adds command documentation and registers it in the SPO commands list and docs sidebar.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/m365/spo/commands/site/site-accessrequest-list.ts Implements the new SPO access request listing command with optional state filtering and StatusLabel projection.
src/m365/spo/commands/site/site-accessrequest-list.spec.ts Adds unit tests covering validation, state filtering, empty results, and error handling.
src/m365/spo/commands.ts Registers the new command name constant.
docs/src/config/sidebars.ts Adds the new command page to the SPO site commands navigation.
docs/docs/cmd/spo/site/site-accessrequest-list.mdx Adds the reference documentation page for the new command.

Comment on lines +41 to +45
private static readonly statusMap: { [key: number]: string } = {
0: 'pending',
1: 'approved',
3: 'declined'
};
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

statusMap (Status -> label) and getStatusValue (label -> Status) duplicate the same mapping in two places, which can drift over time (eg if SharePoint adds/changes status codes). Consider defining a single source of truth (eg two maps derived from one definition, or a single map used for both directions) and reusing it for both labeling and filtering.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +40
<Global />

## Examples

List all access requests of a specific site.

```sh
m365 spo site accessrequest list --siteUrl https://contoso.sharepoint.com/sites/Marketing
```

List all pending access requests of a specific site.

```sh
m365 spo site accessrequest list --siteUrl https://contoso.sharepoint.com/sites/Marketing --state pending
```

Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The new command docs page is missing a Permissions section. Related SPO site commands (including spo site accessrequest setting set) document required SharePoint delegated/application permissions, and without this section users can’t easily determine what consent is needed to run the command.

Copilot uses AI. Check for mistakes.
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.

New command: spo site accessrequest list

2 participants