Skip to content

feat(spo): add rule aliases for web alert commands#7221

Open
mvanhorn wants to merge 2 commits intopnp:mainfrom
mvanhorn:osc/7036-web-rule-aliases
Open

feat(spo): add rule aliases for web alert commands#7221
mvanhorn wants to merge 2 commits intopnp:mainfrom
mvanhorn:osc/7036-web-rule-aliases

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Adds spo web rule list as an alias for spo web alert list, and spo web rule remove as an alias for spo 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 — alert doesn't reflect current terminology. The maintainer discussion (@waldekmastykarz, @Adam-it, @milanholemans all signed off) agreed that adding rule aliases is the forward path, with the alert names 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 — added WEB_RULE_LIST and WEB_RULE_REMOVE constants in alphabetical order (after WEB_ROLEINHERITANCE_RESET, before WEB_SET).
  • src/m365/spo/commands/web/web-alert-list.ts — added public alias() returning [commands.WEB_RULE_LIST], following the pattern in src/m365/spo/commands/file/file-remove.ts.
  • src/m365/spo/commands/web/web-alert-remove.ts — same pattern with WEB_RULE_REMOVE.
  • Corresponding spec files gained defines alias and defines correct alias tests, matching the style of file-remove.spec.ts.

Testing

  • npx tsc --noEmit passes on the full project.
  • Test runner (npm test) requires Node 24 via scripts/check-version.js; my local Node is 25, so I ran the typecheck phase alone and verified the new tests mirror the pattern in src/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).

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
@Jwaegebaert
Copy link
Copy Markdown
Contributor

Hi @mvanhorn thanks for the PR.
Next time, can you please comment on an issue you want to work on so we can assign it to you?

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Thanks @Jwaegebaert, noted - I'll claim issues before opening PRs going forward. Sorry for jumping the line.

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

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 list and spo web rule remove command constants.
  • Implemented alias() on spo web alert list/remove commands 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.

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.

Add aliases for spo web alert commands

3 participants