New command: spo brandcenter settings list. Closes #6653#7058
New command: spo brandcenter settings list. Closes #6653#7058milanholemans merged 3 commits intopnp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new command spo brandcenter settings list to retrieve SharePoint Brand Center configuration settings. The implementation follows the established patterns for SPO commands that accept only global options, using the Zod schema validation approach.
- Adds a new SPO command to list Brand Center configuration
- Includes comprehensive test coverage with schema validation tests
- Provides complete documentation with examples and response formats in multiple output types
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/m365/spo/commands/brandcenter/brandcenter-settings-list.ts | Main command implementation that fetches Brand Center configuration via SharePoint REST API |
| src/m365/spo/commands/brandcenter/brandcenter-settings-list.spec.ts | Comprehensive test suite covering validation, success scenarios, and error handling |
| src/m365/spo/commands.ts | Registers the new BRANDCENTER_SETTINGS_LIST command constant |
| docs/src/config/sidebars.ts | Adds the new command to the documentation sidebar under brandcenter category |
| docs/docs/cmd/spo/brandcenter/brandcenter-settings-list.mdx | Complete documentation including usage, permissions, examples, and response formats |
| .devproxy/api-specs/sharepoint.yaml | Adds API specification for the Brand Center Configuration endpoint with security requirements |
c3e8745 to
856edfe
Compare
|
Thanks! We'll try to review it soon. |
milanholemans
left a comment
There was a problem hiding this comment.
Nice work! Let's do a couple of changes before we merge it.
9e5cf9f to
e117083
Compare
e117083 to
fe2317a
Compare
milanholemans
left a comment
There was a problem hiding this comment.
Awesome work! Made a few small adjustments while merging.
| }); | ||
|
|
||
| await command.action(logger, { options: {} }); | ||
| assert.strictEqual(getStub.firstCall.args[0].url, 'https://contoso.sharepoint.com/_api/Brandcenter/Configuration'); |
There was a problem hiding this comment.
This is actually already tested in the stub defined above. Instead, we should just check if the stub was executed once.
| }); | ||
|
|
||
| await command.action(logger, { options: { verbose: true } }); | ||
| assert(loggerLogSpy.calledWith(successResponse)); |
There was a problem hiding this comment.
Let's be a bit more strict here:
| assert(loggerLogSpy.calledWith(successResponse)); | |
| assert(loggerLogSpy.calledOnceWithExactly(successResponse)); |
| ```json | ||
| { | ||
| "BrandColorsListId": "00000000-0000-0000-0000-000000000000", | ||
| "BrandColorsListUrl": null, |
There was a problem hiding this comment.
Enhanced the response with this property.
Closes #6653