Skip to content

feat(sms): a command, a route test and a doc line for every SMS endpoint - #29

Merged
Domantas merged 4 commits into
mainfrom
audit/sms-cli
Oct 3, 2026
Merged

Domantas merged 4 commits into
mainfrom
audit/sms-cli

Conversation

@Domantas

@Domantas Domantas commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What changed

  • @norbix.ai/ts ^2.1.0 → ^4.2.0 (the published release with all 35 Sms methods; the transport now resolves route tokens case-insensitively and the preview methods are scoped optional). The one test that pinned 2.1.0's refusal of push preview with no login now checks the request goes out with no Authorization header, as its own comment asked.
  • 24 new sms commands next to the 9 that existed, shaped like their push twins: sms enable / disable / disable-dependencies / settings; sms integrations, sms integration <id>, sms integration save / enable / disable / default / delete / test / confirm-delivery; sms template create / update / render / tokens; sms campaign create / delete / batches / batch / messages / message; sms preview (signed link, no login needed).
  • sms campaign create builds the flat Sms request (deliveryType + exactly one of allUsers / specifiedUsers / collection / phoneNumbers), with --phone for raw numbers and --respect-time-zone — it is not the push campaign.source shape. --audience account-users is refused on purpose: the gateway enum has it but the request has no settings block for it.
  • sms stop calls the SDK method directly; the older-SDK probe and norbix api fallback were dead since the CLI requires ^4.2.0.
  • Docs: docs/sms.md (one line per command with its endpoint), README row, COVERAGE.md notifications/sms 12/35 → 35/35.

Tests

  • npm test: 7 files / 225 tests green (118 before; 107 new in tests/sms-existing.test.ts, tests/sms.test.ts, tests/sms-routes.test.ts).
  • tests/sms-routes.test.ts runs every command through oclif and the real @norbix.ai/ts transport with fetch replaced, asserting verb + resolved path for all 35 distinct routes and the request bodies (Fake integration save, template translation, the four campaign audiences, schedule / time zone / tokens). No test contacts an SMS provider; the only provider a test saves is Fake.
  • npx tsc --noEmit: clean.

Expected release after squash merge: v1.3.0 (minor; main has only a chore unreleased since v1.2.0).

Item file (campaign tracker, branch audit/sms in the gateway repo): docs/testing/testing-plan/14-sms/items/cli.md.

🤖 Generated with Claude Code

Domantas and others added 4 commits October 2, 2026 16:39
…ery Sms method

The CLI builds on the published TypeScript SDK; 4.2.0 ships all 35 Sms methods
(the preview method is scoped 'optional', the transport resolves route tokens
case-insensitively). One test pinned 2.1.0's refusal of a push preview with no
login; it now checks the request goes out with no Authorization header.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s, template write, campaign create and reads, preview

24 new commands next to the 9 that existed, shaped like their push twins:
sms enable / disable / disable-dependencies / settings; sms integrations,
integration <id>, integration save / enable / disable / default / delete /
test / confirm-delivery; sms template create / update / render / tokens;
sms campaign create / delete / batches / batch / messages / message; sms
preview (signed link, no login needed).

`sms campaign create` is not a copy of the push one: the Sms request is flat —
`deliveryType` plus exactly one settings block (allUsers / specifiedUsers /
collection / phoneNumbers), with `--phone` for raw numbers and
`--respect-time-zone` for the per-recipient schedule. `sms stop` calls the
SDK method directly; the older-SDK guard is dead since the CLI requires
@norbix.ai/ts ^4.2.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nsport route test for the 35 routes

tests/sms-existing.test.ts covers the 9 commands that shipped with no test;
tests/sms.test.ts the new ones (plus the signed-link preview with no login);
tests/sms-routes.test.ts runs every command through oclif and the real
@norbix.ai/ts transport with fetch replaced, asserting verb + resolved path
(35 distinct routes) and the request bodies: Fake integration save, the
template translation, and the four campaign audiences on the wire.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…RAGE rows say every SMS endpoint is covered

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Domantas
Domantas merged commit 591c0e7 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.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Domantas added a commit that referenced this pull request Oct 3, 2026
…ndpoint (#30)

* [1] fix(push,sms): @norbix.ai/ts ^4.4.0; `campaign message` reads the 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>

* [2] fix(email): `email stop` calls stopEmailCampaign directly

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>

* [3] feat(email): a command for every Email endpoint a developer calls 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>

* [4] test(email): recorder tests for all 46 email commands plus a real-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>

* [5] docs(email): docs/email.md with one line per command and the command-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>

* [6] fix(raw): help examples print `norbix raw …`, not `norbix api …`

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>

* [3] feat(email): a topic line for `email validation` in the help

Without it oclif shows the first subcommand's description for the topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [4] test(email): the route-count comment names the one shared route

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>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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