Skip to content

feat(email): a command, a route test and a doc line for every Email endpoint - #30

Merged
Domantas merged 8 commits into
mainfrom
feat/emails-coverage
Oct 3, 2026
Merged

Domantas merged 8 commits into
mainfrom
feat/emails-coverage

Conversation

@Domantas

@Domantas Domantas commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

A norbix email command, a route test and a doc line for every Email endpoint a developer calls from a terminal — the Email twin of #29 (SMS).

What changed

  • @norbix.ai/ts ^4.2.0 → ^4.4.0 (published; has every Email method). 4.4.0 dropped getPushCampaignMessage / getSmsCampaignMessage because the gateway removed GET /campaigns/{campaignId}/messages/{notificationId}; push campaign message and sms campaign message keep their arguments and now read the same notification from GET /campaigns/{id}/batches/{batchId}/{notificationId}. No command was removed.
  • 37 new email commands next to the 9 old ones: module (enable / disable / disable-dependencies / settings), integrations (list, get, save, enable, disable, default, delete, test, confirm-delivery, domain-health), validation integrations (save, test), footers and signatures (list, get, save, delete), system templates (list, get), template create / update / tokens / render (MJML) / attach, campaign create (5 audiences: all-users, users, account-users, emails, collection) / delete / batches / batch / messages, and email preview (signed link with no login, or --notification <id> with a login).
  • email stop calls stopEmailCampaign directly; its dead old-SDK guard printed a wrong norbix api "<path>" fallback.
  • raw help examples printed norbix api … and a --hub flag raw does not have; now norbix raw …. A new test checks that every example of every command starts with its own command.
  • Docs: docs/email.md (one line per command, plus the 3 routes with no command and why: the recipient's preferences page, the mail client's one-click unsubscribe, the Mailgun webhook); README and COVERAGE rows (email 48/51, sms 34/34).

Test evidence (after git rebase origin/main, a no-op): npx tsc --noEmit clean; npm test 11 files, 370 tests passed (was 7 files / 225 on main). tests/email-routes.test.ts runs every email command through oclif and the real SDK transport with fetch replaced — 48 distinct verb + path pairs, plus the request bodies. Only the Fake provider is ever saved; nothing leaves the process.

Expected version: v1.3.0 → v1.4.0 (feat → minor; nothing breaking).

Campaign item file: docs/testing/testing-plan/13-emails/items/cli.md on gateway branch audit/emails.

🤖 Generated with Claude Code

Domantas and others added 8 commits October 3, 2026 09:55
… batch-notification route

4.4.0 is the published release with every Email method. It drops
getPushCampaignMessage / getSmsCampaignMessage because the gateway removed
GET /campaigns/{campaignId}/messages/{notificationId}. `push campaign message`
and `sms campaign message` keep their arguments and now read the same
notification from GET /campaigns/{id}/batches/{batchId}/{notificationId}, so
scripts that use them keep working. Route counts: push 37, sms 34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard for SDKs older than 1.3.0 is dead (the CLI requires
@norbix.ai/ts ^4.4.0), and its fallback line told users to run
`norbix api "<path>" --hub --method POST` — `api` takes plain words, not a
path; the raw path command is `norbix raw`. Same change `sms stop` got in #29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… from a terminal

37 new commands next to the 9 that existed, shaped like their push / SMS twins:
email enable / disable / disable-dependencies / settings; email integrations,
integration <id>, integration save / enable / disable / default / delete /
test / confirm-delivery / domain-health; email validation save / test; email
footers, footer <id>, footer save / delete; email signatures, signature <id>,
signature save / delete; email system-templates, system-template <id>; email
template create / update / tokens / render / attach; email campaign create /
delete / batches / batch / messages; email preview (signed link with no login,
or a notification id with a login).

`email campaign create` follows the push shape (campaign.source), with the
five Email audiences: all-users, users, account-users, emails, collection.
Template bodies are MJML with Razor tokens; --body-file / --content-file read
them from a file, because Razor code itself starts with `@`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-transport route test for 48 routes

tests/email-existing.test.ts covers the 9 commands that shipped with no test
(and pins that `email stop` no longer prints the `norbix api` fallback — red
on the old command, green now); tests/email.test.ts the new ones, the
signed-link preview with no login, and that every sms command has an email
twin; tests/email-routes.test.ts runs every command through oclif and the
real @norbix.ai/ts transport with fetch replaced, asserting verb + resolved
path (48 distinct routes) and the request bodies: Fake integration save, the
validation provider sent by name, the MJML template translation, and the five
campaign audiences on the wire. Suite: 10 files, 369 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and-less list; README and COVERAGE rows

COVERAGE: email 48/51 (the three without a command are the recipient's
preferences page, the mail client's one-click unsubscribe and the Mailgun
webhook — reasons in docs/email.md); sms 34/34 after the campaign-message
route was removed; the version note says ^4.4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three examples of the raw path command started with `norbix api` (the
plain-words command, which does not take a path) and two of them passed
`--hub`, a flag `raw` does not have (the hub is its default; `--api` picks
the data-plane service). tests/examples.test.ts checks that every example of
every CLI command starts with that command — red on the old raw examples,
green now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without it oclif shows the first subcommand's description for the topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the two `preview` rows share a route (49 rows, 48 routes); `--stats`
and the two `batch` rows each have their own path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Domantas
Domantas merged commit da8d89d into main Oct 3, 2026
11 checks passed
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant