broadcasts.update rejects a single replyTo address (type is string[] only)

Đang mở Phù hợp với người mới
#1,206 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api

Hướng nghiên cứu

Kiểu hạn chế nằm trong src/broadcasts/interfaces/update-broadcast.interface.ts, nơi replyTo được khai báo là string[]. Hãy so sánh với interface options của create-broadcast, vốn đã dùng string | string[]. Hãy sửa kiểu của update cho khớp, sau đó chạy kiểm tra kiểu TypeScript để xác nhận một chuỗi đơn được chấp nhận. Hoàn thành khi truyền một địa chỉ vào broadcasts.update vượt qua kiểm tra kiểu và dạng mảng hiện có vẫn hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
  1. In a TypeScript project, call resend.broadcasts.update('<id>', { replyTo: '[email protected]' }).
  2. 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).

Ngôn ngữ chính
TypeScript
Star
986
Fork
101
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của resend/resend-node

Tất cả issue của resend/resend-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.