resend 0.26.0 → 0.27.0.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 380fc77dd4f78646cea876d8a41c040c2456f5d83de51794adb366ae0cdf4c68
4
- data.tar.gz: 6e868e3144a11781a20dcdd7fc2613e01885820d621595421845bceefee4c334
3
+ metadata.gz: c2285e905778c2a5332f4adc94ac29f229ed02b62645c4e074febd95202d56cc
4
+ data.tar.gz: 978ae7cf38ac0906c40d8af4b55aa5f0602a929bed2bc543b29500b157a94eaf
5
5
  SHA512:
6
- metadata.gz: 6aecfeb42d92ef7a7c90620a0a529f522b26c00b9341cdcf2ca0ae71c100710703b4162b96d4889f29a09825285a923ce1feaef465765ce2d060dffcf17405d4
7
- data.tar.gz: c14fb10e9a778579ad5c1615899db85b90e2feba28a7b6441f0b3dcde4679a1d4bafe26ef93e9631ca2087540ade271687b174d797acad10afda53eacef4f10b
6
+ metadata.gz: 6c338e6d9b06847278ba7cd9bbd146f3d0d8012d5c614418a6ef9066c931cb73b4a270a407e74dfba7e6a5a27944c1996537c720d7108d6a838f5003a2aa2b7f
7
+ data.tar.gz: 396fdd53a1e21840dcbd996735a8570ec7e5353a87b4ce86ccb311f9dfcdd2cfa0928a0883b0727423ed39d8f5bf30a6b7afa45e60743191fd29ca593307f3e9
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Resend
4
+ module Attachments
5
+ # Module for receiving email attachments API operations
6
+ module Receiving
7
+ class << self
8
+ # Retrieve a single attachment from a received email
9
+ #
10
+ # @param params [Hash] Parameters for retrieving the attachment
11
+ # @option params [String] :id The attachment ID (required)
12
+ # @option params [String] :email_id The email ID (required)
13
+ # @return [Hash] The attachment object
14
+ #
15
+ # @example
16
+ # Resend::Attachments::Receiving.get(
17
+ # id: "2a0c9ce0-3112-4728-976e-47ddcd16a318",
18
+ # email_id: "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
19
+ # )
20
+ def get(params = {})
21
+ attachment_id = params[:id]
22
+ email_id = params[:email_id]
23
+
24
+ path = "emails/receiving/#{email_id}/attachments/#{attachment_id}"
25
+ Resend::Request.new(path, {}, "get").perform
26
+ end
27
+
28
+ # List attachments from a received email with optional pagination
29
+ #
30
+ # @param params [Hash] Parameters for listing attachments
31
+ # @option params [String] :email_id The email ID (required)
32
+ # @option params [Integer] :limit Maximum number of attachments to return (1-100)
33
+ # @option params [String] :after Cursor for pagination (newer attachments)
34
+ # @option params [String] :before Cursor for pagination (older attachments)
35
+ # @return [Hash] List of attachments with pagination info
36
+ #
37
+ # @example List all attachments
38
+ # Resend::Attachments::Receiving.list(
39
+ # email_id: "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
40
+ # )
41
+ #
42
+ # @example List with custom limit
43
+ # Resend::Attachments::Receiving.list(
44
+ # email_id: "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
45
+ # limit: 50
46
+ # )
47
+ #
48
+ # @example List with pagination
49
+ # Resend::Attachments::Receiving.list(
50
+ # email_id: "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
51
+ # limit: 20,
52
+ # after: "attachment_id_123"
53
+ # )
54
+ def list(params = {})
55
+ email_id = params[:email_id]
56
+ path = "emails/receiving/#{email_id}/attachments"
57
+
58
+ # Build query parameters, filtering out nil values
59
+ query_params = {}
60
+ query_params[:limit] = params[:limit] if params[:limit]
61
+ query_params[:after] = params[:after] if params[:after]
62
+ query_params[:before] = params[:before] if params[:before]
63
+
64
+ Resend::Request.new(path, query_params, "get").perform
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Resend
4
+ module Emails
5
+ # Module for receiving emails API operations
6
+ module Receiving
7
+ class << self
8
+ # Retrieve a single received email
9
+ #
10
+ # @param email_id [String] The ID of the received email
11
+ # @return [Hash] The received email object
12
+ #
13
+ # @example
14
+ # Resend::Emails::Receiving.get("4ef9a417-02e9-4d39-ad75-9611e0fcc33c")
15
+ def get(email_id = "")
16
+ path = "emails/receiving/#{email_id}"
17
+ Resend::Request.new(path, {}, "get").perform
18
+ end
19
+
20
+ # List received emails with optional pagination
21
+ #
22
+ # @param params [Hash] Optional parameters for pagination
23
+ # @option params [Integer] :limit Maximum number of emails to return (1-100)
24
+ # @option params [String] :after Cursor for pagination (newer emails)
25
+ # @option params [String] :before Cursor for pagination (older emails)
26
+ # @return [Hash] List of received emails with pagination info
27
+ #
28
+ # @example List all received emails
29
+ # Resend::Emails::Receiving.list
30
+ #
31
+ # @example List with custom limit
32
+ # Resend::Emails::Receiving.list(limit: 50)
33
+ #
34
+ # @example List with pagination
35
+ # Resend::Emails::Receiving.list(limit: 20, after: "email_id_123")
36
+ def list(params = {})
37
+ path = Resend::PaginationHelper.build_paginated_path("emails/receiving", params)
38
+ Resend::Request.new(path, {}, "get").perform
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Resend
4
+ # Topics api wrapper
5
+ module Topics
6
+ class << self
7
+ # https://resend.com/docs/api-reference/topics/create-topic
8
+ def create(params = {})
9
+ path = "topics"
10
+ Resend::Request.new(path, params, "post").perform
11
+ end
12
+
13
+ # https://resend.com/docs/api-reference/topics/get-topic
14
+ def get(topic_id = "")
15
+ path = "topics/#{topic_id}"
16
+ Resend::Request.new(path, {}, "get").perform
17
+ end
18
+
19
+ # https://resend.com/docs/api-reference/topics/update-topic
20
+ def update(params = {})
21
+ path = "topics/#{params[:topic_id]}"
22
+ Resend::Request.new(path, params, "patch").perform
23
+ end
24
+
25
+ # https://resend.com/docs/api-reference/topics/list-topics
26
+ def list(params = {})
27
+ path = Resend::PaginationHelper.build_paginated_path("topics", params)
28
+ Resend::Request.new(path, {}, "get").perform
29
+ end
30
+
31
+ # https://resend.com/docs/api-reference/topics/delete-topic
32
+ def remove(topic_id = "")
33
+ path = "topics/#{topic_id}"
34
+ Resend::Request.new(path, {}, "delete").perform
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resend
4
- VERSION = "0.26.0"
4
+ VERSION = "0.27.0.alpha.1"
5
5
  end
data/lib/resend.rb CHANGED
@@ -20,6 +20,9 @@ require "resend/batch"
20
20
  require "resend/contacts"
21
21
  require "resend/domains"
22
22
  require "resend/emails"
23
+ require "resend/emails/receiving"
24
+ require "resend/attachments/receiving"
25
+ require "resend/topics"
23
26
 
24
27
  # Rails
25
28
  require "resend/railtie" if defined?(Rails) && defined?(ActionMailer)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derich Pacheco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-14 00:00:00.000000000 Z
11
+ date: 2025-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -47,6 +47,7 @@ files:
47
47
  - README.md
48
48
  - lib/resend.rb
49
49
  - lib/resend/api_keys.rb
50
+ - lib/resend/attachments/receiving.rb
50
51
  - lib/resend/audiences.rb
51
52
  - lib/resend/batch.rb
52
53
  - lib/resend/broadcasts.rb
@@ -54,11 +55,13 @@ files:
54
55
  - lib/resend/contacts.rb
55
56
  - lib/resend/domains.rb
56
57
  - lib/resend/emails.rb
58
+ - lib/resend/emails/receiving.rb
57
59
  - lib/resend/errors.rb
58
60
  - lib/resend/mailer.rb
59
61
  - lib/resend/pagination_helper.rb
60
62
  - lib/resend/railtie.rb
61
63
  - lib/resend/request.rb
64
+ - lib/resend/topics.rb
62
65
  - lib/resend/version.rb
63
66
  homepage: https://github.com/resend/resend-ruby
64
67
  licenses:
@@ -75,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
78
  version: '2.6'
76
79
  required_rubygems_version: !ruby/object:Gem::Requirement
77
80
  requirements:
78
- - - ">="
81
+ - - ">"
79
82
  - !ruby/object:Gem::Version
80
- version: '0'
83
+ version: 1.3.1
81
84
  requirements: []
82
85
  rubygems_version: 3.4.10
83
86
  signing_key: