feat(spo): add rule aliases for web alert commands#7221
Open
feat(spo): add rule aliases for web alert commands#7221
Conversation
Add 'spo web rule list' as alias for 'spo web alert list' and 'spo web rule remove' as alias for 'spo web alert remove'. Closes pnp#7036
Contributor
|
Hi @mvanhorn thanks for the PR. |
Contributor
Author
|
Thanks @Jwaegebaert, noted - I'll claim issues before opening PRs going forward. Sorry for jumping the line. |
There was a problem hiding this comment.
Pull request overview
This PR introduces user-facing aliases for SharePoint Online web alert commands so users can use the newer “rule” terminology while continuing to support existing “alert” scripts.
Changes:
- Added
spo web rule listandspo web rule removecommand constants. - Implemented
alias()onspo web alert list/removecommands to expose the new “rule” aliases. - Added/updated tests to validate alias definitions and updated lazy-loading alias allowlist.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/m365/spo/commands/web/web-alert-remove.ts | Adds alias() returning commands.WEB_RULE_REMOVE so spo web rule remove resolves to the existing remove implementation. |
| src/m365/spo/commands/web/web-alert-remove.spec.ts | Adds tests asserting the alias exists and includes WEB_RULE_REMOVE. |
| src/m365/spo/commands/web/web-alert-list.ts | Adds alias() returning commands.WEB_RULE_LIST so spo web rule list resolves to the existing list implementation. |
| src/m365/spo/commands/web/web-alert-list.spec.ts | Adds tests asserting the alias exists and includes WEB_RULE_LIST. |
| src/m365/spo/commands.ts | Introduces WEB_RULE_LIST and WEB_RULE_REMOVE command string constants. |
| src/index.spec.ts | Adds the new alias command strings to the lazy-loading test’s alias allowlist. |
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.
Summary
Adds
spo web rule listas an alias forspo web alert list, andspo web rule removeas an alias forspo web alert remove, per #7036. Both names now resolve to the same underlying command, so scripts using either one keep working.Why this matters
From the issue thread: SharePoint alerts are deprecated, and #7036 traces the user-visible confusion —
alertdoesn't reflect current terminology. The maintainer discussion (@waldekmastykarz, @Adam-it, @milanholemans all signed off) agreed that addingrulealiases is the forward path, with thealertnames kept as the existing aliases on the command classes. The issue opens the door to a full rename later; this PR delivers the user-visible outcome (both names work) without renaming the files.Changes
src/m365/spo/commands.ts— addedWEB_RULE_LISTandWEB_RULE_REMOVEconstants in alphabetical order (afterWEB_ROLEINHERITANCE_RESET, beforeWEB_SET).src/m365/spo/commands/web/web-alert-list.ts— addedpublic alias()returning[commands.WEB_RULE_LIST], following the pattern insrc/m365/spo/commands/file/file-remove.ts.src/m365/spo/commands/web/web-alert-remove.ts— same pattern withWEB_RULE_REMOVE.defines aliasanddefines correct aliastests, matching the style offile-remove.spec.ts.Testing
npx tsc --noEmitpasses on the full project.npm test) requires Node 24 viascripts/check-version.js; my local Node is 25, so I ran the typecheck phase alone and verified the new tests mirror the pattern insrc/m365/spo/commands/file/file-remove.spec.ts. CI will exercise them on the supported Node.Closes #7036
This contribution was developed with AI assistance (Codex).