queues subscriptions create: no email.sending source type, and no zone/domain flags

Đang mở Phù hợp với người mới
#262 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ 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
cli

Hướng nghiên cứu

Bắt đầu từ lệnh cf queues subscriptions create và xem cách lệnh này định nghĩa các lựa chọn của --source-type cùng các flag dành riêng cho từng nguồn. So sánh cách xử lý đó với lệnh Wrangler được nêu trong issue và nội dung subscription mà API chấp nhận. Hoàn tất khi email.sending được chấp nhận và các flag zone ID và domain điền giá trị vào source.zone_id và source.domain.

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

Mô tả

upstream

cf queues subscriptions create cannot create an Email Sending event subscription with flags. The --source-type choice list has no email.sending, and there are no flags for the two fields that source needs (zone_id and domain). The only way is --body. This is the same kind of gap as #179 (Artifacts), plus the missing source fields.

Version: cf v1.0.0-beta.10

Actual

$ cf queues subscriptions create --source-type email.sending --events message.bounced --dry-run
┌ Error
│ Invalid values:
│ Argument: source-type, Given: "email.sending", Choices: "images", "kv", "r2",
│ "superSlurper", "vectorize", "workersAi.model", "workersBuilds.worker",
│ "workers.script", "workflows.workflow"
└

Expected

  • email.sending in the --source-type choices.
  • Flags for the source's zone_id and domain, for example --source-zone-id and --source-domain. Wrangler has --zone-id and --domain for this source (wrangler queues subscription create <queue> --source email.sending --zone-id <id> --domain <domain>), and it sends them as source.zone_id and source.domain.

The Email Service docs describe these subscriptions: https://developers.cloudflare.com/email-service/platform/event-subscriptions/

Workaround that works

cf queues subscriptions create --body '{"name":"<name>","enabled":true,"source":{"type":"email.sending","zone_id":"<zone id>","domain":"<sending domain>"},"destination":{"type":"queues.queue","queue_id":"<queue id>"},"events":["message.bounced","message.complained","message.rejected","message.failed"]}'

The API accepted this and returned the subscription with "source": {"name": "Email Service", "type": "email.sending", ...}. Related: #181 (events typed as a string in the schema).

Ngôn ngữ chính
TypeScript
Star
960
Fork
62
Merge trung bình
19 giờ 7 phút
Pull request đã merge (30 ngày)
193

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 cloudflare/cf

Tất cả issue của cloudflare/cf

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.