broadcasts.update rejects a single replyTo address (type is string[] only)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- api
調査の方向性
範囲の狭い型は src/broadcasts/interfaces/update-broadcast.interface.ts にあり、そこで replyTo は string[] として宣言されています。create-broadcast のオプションインターフェースと比較してください。そちらはすでに string | string[] を使っています。update 側の型を合わせて変更し、そのあと TypeScript の型チェックを実行して、単一の文字列が受け入れられることを確認してください。broadcasts.update に 1 つのアドレスを渡しても型チェックが通り、既存の配列形式も引き続き動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the Bug
resend.broadcasts.update() only accepts replyTo as string[], so passing a single address fails to typecheck:
await resend.broadcasts.update(id, { replyTo: '[email protected]' });
// Type 'string' is not assignable to type 'string[]'
broadcasts.create() (and emails/templates) type replyTo as string | string[], and the API docs describe reply_to the same way for creating and updating a broadcast. The SDK already sends the value through unchanged, so it's only the type in UpdateBroadcastOptions that's narrower.
Link to the code that reproduces this issue
https://github.com/resend/resend-node/blob/main/src/broadcasts/interfaces/update-broadcast.interface.ts (replyTo?: string[];), compared with src/broadcasts/interfaces/create-broadcast-options.interface.ts (replyTo?: string | string[];)
To Reproduce
- In a TypeScript project, call
resend.broadcasts.update('<id>', { replyTo: '[email protected]' }). - Run
tsc.
Expected Behavior
A single address is accepted on update, the same as on create: replyTo?: string | string[].
What's your node version? (if relevant)
Not relevant (type-only).
- 主要言語
- TypeScript
- スター
- 986
- フォーク
- 101
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
resend/resend-node のほかの issue
-
Dependency Dashboardオープン
難易度 4/5 3〜5日 初心者へのやさしさ 10/100
resend/resend-node#3 ·
メンテナーはふだん 1 日以内に返信
resend/resend-node の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
siyuan-note/siyuan#21692 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
GetStream/stream-chat-react#3467 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cloudflare/cloudflare-typescript#2821 ·
-
Autocomplete: the element's api leaves out highlight() and getHighlighted()対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vercel-labs/ui#1139 ·
メンテナーはふだん 1 日以内に返信