Repository navigation
Add campaign contact frequency caps to TypeScript SDK - #351
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83eb304784
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "messaging": { | ||
| "sourcePath": "apps/api/docs/openapi.json", | ||
| "sourceSha256": "9d8faf13be970bee800ad15e308c130bc4ae8703865ae99278b9ae315cc27638", | ||
| "schemas": {}, |
There was a problem hiding this comment.
Include the Messaging frequency-cap schemas
When this supplement is combined with the pinned openapi.messaging.json, its new CampaignFrequencyCap and CampaignFrequencyCapAnalytics references cannot be resolved because schemas is empty and the pinned snapshot predates both definitions. This also leaves the Messaging limits and analytics shape unrecorded and untested, so add both new schema definitions here rather than relying on the Platform copy.
Useful? React with 👍 / 👎.
| readonly maxPer7Days: number | null; | ||
| } | ||
|
|
||
| export type CampaignRecipientFailureReason = |
There was a problem hiding this comment.
Keep recipient failure reasons forward-compatible
When the API adds a new failure code—as the accompanying contract explicitly says it may—this closed union makes CampaignRecipient.failureReason unsound and can lead consumers to treat exhaustive switches as complete even though an unknown string arrives at runtime. Keep the query filter restricted to the accepted known values, but model the response reason as the known union plus string & {}, following the SDK's existing forward-compatible enum pattern.
Useful? React with 👍 / 👎.
Summary
Add TypeScript support for campaign contact frequency caps from merged API dev
e404a727dd. Team settings preserve revisions and 409 conflicts; campaign requests, recipient reason filters and skip analytics match the merged contract. Existingfeature_unavailableerrors remain typed.Companion PRs: SDK #351, CLI #80, docs #619. Native-client additions on active SDK #348.
Impact
Impact table
No impact table
Verification
Node 24 typecheck, lint, format, all workspace builds, coverage ledger and function checks pass. Full suite: 1,521 tests pass before the final added projection test; all six frequency-cap HTTP/contract tests pass at head 5583e43. CI tests both Node 20 and 22. Synthetic HTTP covers settings GET/PUT/null, 409/403 codes without write retries, campaign fields on both APIs, read projections, skip analytics and reason filters. No deployed API or native send exercised.
Session provenance and UI evidence
Parent T3 thread:
646a0c0a-e900-4d0f-9a25-0b8834d7d4e6. Implementation agent: OpenAI gpt-6.1-sol, T3 Code Codex harness. Shared brief and repository guides read; implementation sequential, no delegated agents or requested automated reviews. The parent orchestrator owns publication of the sanitized transcript checkpoint and registration link; those links remain pending. No graphical UI changed. CLI output and SDK transport use synthetic loopback HTTP fixtures, not customer data.Rollout and rollback
Do not merge or publish as part of this task. Merge SDK source before updating the CLI to a matching accepted SDK prerelease; then release CLI and publish aligned documentation only after acceptance. Existing API contract date is unchanged. Beta enrollment remains server enforced; reads and cap removal remain available without beta access. Revert these additive client/doc changes if necessary; no migration or data rollback is required. No deployed API, native send or hosted beta acceptance was exercised.
Open questions: publication secrets and staging acceptance are owned by release coordination. No product decision remains open.
Summary by CodeRabbit