Skip to content

Conversation

@Cisneiros
Copy link
Member

@Cisneiros Cisneiros commented Oct 14, 2025

This PR merges the commits from preview-topics-contacts and preview-templates into canary.

Summary by cubic

Adds Templates, Inbound, Topics, and richer Contacts features, and enables sending emails via templates with topic targeting. Also adds pagination helpers and bumps the preview version.

  • New Features

    • Templates: create, update, duplicate, publish, list, remove; camelCase inputs; chainable publish; typed variables (string/number/boolean/object/list).
    • Emails and Broadcasts: send with template { id, variables }; support topicId for targeting; batch tests for template emails.
    • Inbound: fetch inbound emails and list/get attachments.
    • Contacts: global list (no audience required), get/remove by id or email, new audiences and topics subclients (list/add/remove, get/update).
    • Topics: create, get, list, update, remove.
    • Utils/Types: pagination helpers (before/after/limit, PaginatedData), API option parsers, new exports and Resend clients.
  • Migration

    • Sending templates: use template: { id, variables? }; from and subject are optional when a template is used; topicId is supported on emails and broadcasts.
    • Contacts: audienceId is optional across create/get/update/list/remove; get/remove accept a string id or an options object.
    • Some list/get endpoints now return paginated shapes (object: 'list', has_more); pass before/after/limit when needed.

CarolinaMoraes and others added 30 commits September 29, 2025 15:31
…camelCase (which is default for the other entities) (#630)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/resend-node/resend@680

commit: 1cef818

@Cisneiros Cisneiros marked this pull request as ready for review October 14, 2025 22:01
@Cisneiros Cisneiros requested a review from a team as a code owner October 14, 2025 22:01
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13 issues found across 67 files

Prompt for AI agents (all 13 issues)

Understand the root cause of the following 13 issues and fix them.


<file name="src/common/utils/parse-template-to-api-options.spec.ts">

<violation number="1" location="src/common/utils/parse-template-to-api-options.spec.ts:6">
Rule violated: **No `should` in tests**

Rewrite this test description without using “should” to comply with the No `should` in tests rule.</violation>

<violation number="2" location="src/common/utils/parse-template-to-api-options.spec.ts:26">
Rule violated: **No `should` in tests**

Update this test description to avoid the word “should” in accordance with the No `should` in tests guideline.</violation>

<violation number="3" location="src/common/utils/parse-template-to-api-options.spec.ts:74">
Rule violated: **No `should` in tests**

Adjust this test name so it no longer contains “should,” per the No `should` in tests rule.</violation>

<violation number="4" location="src/common/utils/parse-template-to-api-options.spec.ts:86">
Rule violated: **No `should` in tests**

Rename this test description to remove “should,” aligning with the No `should` in tests guideline.</violation>

<violation number="5" location="src/common/utils/parse-template-to-api-options.spec.ts:119">
Rule violated: **No `should` in tests**

Replace “should” in this test description with a direct verb phrase to satisfy the No `should` in tests rule.</violation>

<violation number="6" location="src/common/utils/parse-template-to-api-options.spec.ts:146">
Rule violated: **No `should` in tests**

Update this test name to remove “should,” complying with the No `should` in tests requirement.</violation>

<violation number="7" location="src/common/utils/parse-template-to-api-options.spec.ts:200">
Rule violated: **No `should` in tests**

Revise this test description to avoid “should,” as mandated by the No `should` in tests rule.</violation>

<violation number="8" location="src/common/utils/parse-template-to-api-options.spec.ts:211">
Rule violated: **No `should` in tests**

Change this test description to remove “should,” keeping test names declarative per the rule.</violation>
</file>

<file name="src/inbound/inbound.spec.ts">

<violation number="1" location="src/inbound/inbound.spec.ts:8">
The Resend client is being instantiated with a literal API token, which commits sensitive credentials to source control. Replace it with a redacted or environment-sourced value to avoid leaking secrets.

(Based on your team&#39;s feedback about redacting secrets from tests.) [FEEDBACK_USED]</violation>

<violation number="2" location="src/inbound/inbound.spec.ts:26">
The mocked response headers embed the API token directly, leaking the same credential in the test data. Use a redacted or placeholder token instead.

(Based on your team&#39;s feedback about redacting secrets from tests.) [FEEDBACK_USED]</violation>
</file>

<file name="src/batch/batch.spec.ts">

<violation number="1" location="src/batch/batch.spec.ts:430">
JSON.stringify strips undefined fields, so after parsing the request body it will not contain attachments/bcc/etc. This equality assertion will always fail; omit those undefined properties (or match only the defined fields) when checking the payload.</violation>
</file>

<file name="src/contacts/contacts.ts">

<violation number="1" location="src/contacts/contacts.ts:76">
If callers pass `{ audienceId: undefined }` (allowed by ListContactsOptions), `&#39;audienceId&#39; in options` is still true, so we try to hit `/audiences/undefined/contacts`. Please treat undefined audienceIds as the global branch instead of the audience-specific path.</violation>
</file>

<file name="src/common/utils/parse-email-to-api-options.spec.ts">

<violation number="1" location="src/common/utils/parse-email-to-api-options.spec.ts:55">
The expectation omits topic_id, but parseEmailToApiOptions always returns topic_id (even when undefined), so this assertion will fail. Please include topic_id: undefined in the expected object or use a matcher that tolerates additional keys.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Cisneiros and others added 2 commits October 14, 2025 15:19
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
/**
* The id of the topic you want to send to
*
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is leading to a broken link

export * from './email-api-options.interface';
export * from './get-option.interface';
export * from './idempotent-request.interface';
export * from './list-option.interface';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this deletion related to this merge?

}
);

export type PaginatedData<Data> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for all pagination related files

@Cisneiros Cisneiros merged commit 5fdafdd into canary Oct 14, 2025
12 checks passed
@Cisneiros Cisneiros deleted the preview-projects branch October 14, 2025 23:10
gabrielmfern added a commit that referenced this pull request Oct 16, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
@gabrielmfern
Copy link
Member

I think this should've been a bump to 6.2.0-canary.4, now we're going to have a skipped 6.2.0 version that's not released in latest

gabrielmfern added a commit that referenced this pull request Oct 17, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
lucasfcosta added a commit that referenced this pull request Oct 17, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
gabrielmfern added a commit that referenced this pull request Oct 21, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
gabrielmfern added a commit that referenced this pull request Oct 21, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
lucasfcosta added a commit that referenced this pull request Oct 27, 2025
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: Carolina de Moraes Josephik <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Lucas da Costa <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: Vitor Capretz <[email protected]>
Co-authored-by: Cassio Zen <[email protected]>
Co-authored-by: Bu Kinoshita <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants