Skip to content

refactor(notifications): split compileNotifications into Strategy pattern#763

Open
VirtueMe wants to merge 1 commit intomasterfrom
refactor/759_notifications-strategy
Open

refactor(notifications): split compileNotifications into Strategy pattern#763
VirtueMe wants to merge 1 commit intomasterfrom
refactor/759_notifications-strategy

Conversation

@VirtueMe
Copy link
Copy Markdown
Collaborator

Closes #759

Summary

  • Add notificationStrategies/ with one module per target type (sns, sqs, kinesis, firehose, lambda, stepFunctions), each exporting compileTarget and compilePermission — mirroring the existing iamStrategies/ pattern
  • Extract shared utilities (generateTargetId, generatePolicyName, buildInputOptions) into utils.js
  • Replace if/else dispatch chains in compileNotifications.js with a Map registry + getStrategy() lookup

Test plan

  • All 17 new strategy unit tests pass
  • All 17 existing compileNotifications integration tests pass
  • Full suite passes
  • No changes to plugin configuration or public API

Part of #708

🤖 Generated with Claude Code

…tern

- Add notificationStrategies/ directory with one module per target type
  (sns, sqs, kinesis, firehose, lambda, stepFunctions)
- Each strategy exports compileTarget and compilePermission
- Extract generateTargetId, generatePolicyName, buildInputOptions to utils.js
- Replace if/else dispatch in compileNotifications.js with getStrategy() registry lookup
- Add 17 unit tests covering each strategy's target and permission compilation

Part of #759

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/serverless-operations/serverless-step-functions@763

commit: b9bcc8f

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.

refactor(notifications): split compileNotifications into Strategy pattern

1 participant