Repository navigation
feat(domains): add forge activation methods - #1193
Conversation
commit: |
There was a problem hiding this comment.
1 issue found across 13 files
Confidence score: 4/5
src/domains/forge/forge.tsoperations require an API key withfull_access; callers usingsending_accessmay be denied. Confirm the required permission is clear to production callers.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/domains/forge/forge.ts">
<violation number="1" location="src/domains/forge/forge.ts:26">
P2: Custom agent: **API Key Permission Check SDK Methods**
These Forge operations act on domain resources, so production callers need an API key with `full_access`; `sending_access` is limited to sending. Please confirm the existing production keys have the required permission before rollout.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 5 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
e2a80f3 to
c6d21c0
Compare
There was a problem hiding this comment.
0 issues found across 5 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
Co-Authored-By: Claude Fable 5 <[email protected]>
c6d21c0 to
578b3fd
Compare
Matches the reshaped API: domains.forge keeps only enable (returnPath optional), domains.verify gains an optional scope of ['forge'] that re-checks only the Forge record, and domains.update gains forgeReturnPath to move the Forge return path. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
Existing callers pass headers or an abort signal as verify's second argument. The scoped options object stays the documented form, and the legacy form is detected at runtime and still applied. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
…argument VerifyDomainsOptions now extends RequestOptions, so scope, headers, and signal all ride in verify's second argument and the implementation is a single destructure. Replaces the deprecated overload and the runtime key detection from the previous commit; every existing call keeps working unchanged. Also drops the forgeReturnPath doc comment. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 5 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
# Conflicts: # package.json
…rop it from update
|
@cubic-dev-ai review |
@vieiralucas I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
0 issues found across 6 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
klotty
left a comment
There was a problem hiding this comment.
No issues found across 10 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds the Forge enable subresource and an optional Forge scope to domains.verify, with unit tests pinning request bodies; existing verify calls stay byte-identical and no server or policy behavior changes.
View guided diff | Re-trigger cubic
Summary
Adds Forge activation to
domains: aforge.enablesubresource call plus a Forge scope on the classicverify, matching the public API shape.resend.domains.forge.enable({ id, customReturnPath? })->POST /domains/:id/forgewith{ custom_return_path }. Same name and validation ascustomReturnPathondomains.create. Activates Forge on the domain and returns the full domain response (same shape asGET /domains/:id). WhencustomReturnPathis omitted, the API picks a subdomain that is free in the domain's DNS. The return path is set once and cannot be changed afterwards. Idempotent on the API side: enabling an already-migrated domain returns its current state.resend.domains.verify(id, { scope: ['forge'] })->POST /domains/:id/verify. The optionalscope(only value'forge') re-checks just the Forge record, so the records that are already verified are not re-proven. Returns{ object: 'domain', id }. Withoutscope, the request is byte-identical to before.domains.updateis unchanged: there is no Forge field onPATCH /domains/:id.The domain response types are unchanged: the API carries Forge state in the records array, so callers poll the Forge record status after adding DNS.
Validation
Unit tests cover the forge enable (URL, method, snake_case body mapping, the empty-body enable), the scoped verify body, request options in the second argument both alone and mixed with scope, and the per-request options coverage spec.
pnpm lint,pnpm typecheck,pnpm test(798 passing) andpnpm buildpass.Notes for reviewers
verifykeeps its two-argument shape:VerifyDomainsOptionsextendsRequestOptions, soscope,headers, andsignalall ride in the second argument and the implementation destructures them apart (the same merged-options shape asfetch). Every existing call compiles and behaves unchanged, and nothing is deprecated.Summary by cubic
Adds Forge activation to
domains: aforgesubresource and a Forge scope on the classicverify. Bumps the package to6.39.0.resend.domains.forge.enable({ id, customReturnPath? })activates Forge viaPOST /domains/:id/forgeand returns the full domain; re-enabling an already-activated domain is idempotent. WhencustomReturnPathis omitted, the API picks a free subdomain.resend.domains.verify(id, { scope: ['forge'] })re-checks only the Forge record viaPOST /domains/:id/verifyand returns{ object: 'domain', id }.VerifyDomainsOptionsextendsRequestOptions, so headers and signal ride in the same second argument alongside scope; existing callers passing request options are unaffected.domains.updateis unchanged; there is no Forge field onPATCH /domains/:id.Domain response types are unchanged; callers track Forge state by polling the Forge record status after adding DNS.
Written for commit 33395fe. Summary will update on new commits.
Part of DEV-2471.