Repository navigation
Use Number-scoped test event commands #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e5aacc6
Use Number-scoped test event commands
purpshell fa9ff0d
Fix contract pin format and patch MCP server dependency
purpshell 1b70d2b
Merge remote-tracking branch 'origin/main' into codex/test-number-dro…
purpshell ff8db6d
Merge main into the Number-scoped test event commands
purpshell 4488960
docs: regenerate the command reference for Number-scoped trigger on c…
purpshell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "repository": "polymorfa/polymorfa", | ||
| "commit": "79e62733b1b3d523618232a3794e26df64b7f486", | ||
| "sourcePath": "apps/api/docs/openapi.json", | ||
| "sourceSha256": "dcbd21ba3dafe0c30e52c260ccef759eaca1c0a11d6cc092f2a3ef68bf50f4d3", | ||
| "operations": [ | ||
| { | ||
| "command": "trigger --list", | ||
| "method": "GET", | ||
| "path": "/messaging/test-events/fixtures" | ||
| }, | ||
| { | ||
| "command": "trigger <event> --session <numberId> [--from-number <numberId>]", | ||
| "method": "POST", | ||
| "path": "/messaging/{session}/test-events", | ||
| "requestFields": ["event", "overrides", "fromNumber"] | ||
| }, | ||
| { | ||
| "command": "testing history-fixture create --project <projectId>", | ||
| "method": "POST", | ||
| "path": "/messaging/projects/{projectId}/test-history-fixtures" | ||
| } | ||
| ], | ||
| "sdkTransport": "Released SDK raw.request; no dependency pin or publication required.", | ||
| "scopes": ["sandbox:read", "sandbox:write"], | ||
| "historicalReferences": [ | ||
| "docs/internal/2026-09-22-trigger-fixture-parity.md", | ||
| "docs/internal/2026-09-23-trigger-launch-docs.md" | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Number-scoped test routes | ||
|
|
||
| Source contract: `contracts/test-number-dropin-routes.json`, API PR | ||
| https://github.com/polymorfa/polymorfa/pull/792. The API base is #647. | ||
|
|
||
| `trigger` sends the Number ID in the path, never body `session`. The optional | ||
| `--from-number` is another Test Number ID, serialized as `fromNumber`; | ||
| `--from-session` has no alias. Trigger/list require no project flag. History | ||
| fixture creation keeps its project flag because it precedes Number creation. | ||
|
|
||
| These commands use the installed SDK's public `raw.request` transport and keep | ||
| its auth, timeout, retries and errors. The existing package pin stays valid; | ||
| there is no unpublished SDK dependency. No credential handling changes. | ||
|
|
||
| API: consumed and pinned; no API implementation here. SDK: transport reused, | ||
| typed methods updated separately. CLI: commands/help/examples/tests updated. | ||
| Docs: README and internal launch sample updated; public docs app handoff stays | ||
| with #783. Feature releases: no flag or availability change. Admin: no new | ||
| state/action and no direct dependency. Historical September notes remain | ||
| evidence of their original snapshot; their old names do not describe aliases. | ||
|
|
||
| Scope names remain `sandbox:read` / `sandbox:write`. Renaming affects CLI README | ||
| and internal launch/reference notes, SDK contracts/scope inputs, API scope | ||
| parsing and enforcement, Console key pickers and public documentation. No | ||
| spelling or numeric scope bit changes are included. No publication or | ||
| deployment is performed. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| ## Trigger with the CLI | ||
|
|
||
| Use a server API key with `sandbox:write` and a project with Test numbers access. Listing fixtures needs `sandbox:read`. | ||
| Use a team key or project token (including a Test key) with `sandbox:write` and a project with Test numbers access. Listing fixtures needs `sandbox:read`. | ||
|
purpshell marked this conversation as resolved.
Resolved
|
||
|
|
||
| ```sh | ||
| polymorfa trigger --list --project PROJECT_ID | ||
| polymorfa trigger message.received --project PROJECT_ID --session my-test-number --text "hi" | ||
| polymorfa trigger session.restriction_updated --project PROJECT_ID --session my-test-number \ | ||
| polymorfa trigger --list | ||
| polymorfa trigger message.received --session my-test-number --text "hi" | ||
| polymorfa trigger session.restriction_updated --session my-test-number \ | ||
| --override restrictionActive=false | ||
| ``` | ||
|
|
||
| The command prints the event type and ID returned by the API. The event also appears in event history and reaches subscribed webhooks with `source: "test"`. A real number is refused without sending an event. | ||
|
|
||
| To send a simulated message from another Test number in the same project, use `--from-session OTHER_TEST_NUMBER` with `message.received`. That sends a message you can reply to; the named fixtures above only generate events. | ||
| To send a simulated message from another Test number in the same project, use `--from-number OTHER_TEST_NUMBER` with `message.received`. That sends a message you can reply to; the named fixtures above only generate events. | ||
|
|
||
| The Number ID in `--session` determines the project. Fixture listing is a static catalog and needs no project selector. The trigger sends `fromNumber` as an optional Number ID; body `session` is not sent. Real Numbers return `404 resource_not_found`. | ||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.