resend 0.17.2 → 0.18.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 +4 -4
- data/lib/resend/api_keys.rb +0 -3
- data/lib/resend/audiences.rb +0 -3
- data/lib/resend/batch.rb +0 -2
- data/lib/resend/broadcasts.rb +0 -3
- data/lib/resend/client.rb +1 -7
- data/lib/resend/contacts.rb +11 -4
- data/lib/resend/domains.rb +0 -3
- data/lib/resend/emails.rb +0 -2
- data/lib/resend/request.rb +0 -4
- data/lib/resend/version.rb +1 -1
- data/lib/resend.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 767d6913b962d3ed93b05c04675368f1890fd6275963fc58e865a008cad85e24
|
4
|
+
data.tar.gz: 1d4559ae1bb176f8cf3ace48133fd0c0a12a02dbf6f4bec356149c1f5f7a3dda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df4ee127839e025a307c5d077a2de30149b0166d12329d5a0360eb4da4e7878e615b3cd6431456fa2a8fe81b2a4c88233ab029dacf9e0fff5a281c7814c2e07b
|
7
|
+
data.tar.gz: d0c046663acce27285dcd91220249154086ba4666310b0487cfe4ea97882632e8bfa0d5fcfcd7a36c2fb9b957b2c4ee4f70441d67d753fb1fe93cf7db9a9ce14
|
data/lib/resend/api_keys.rb
CHANGED
data/lib/resend/audiences.rb
CHANGED
data/lib/resend/batch.rb
CHANGED
data/lib/resend/broadcasts.rb
CHANGED
data/lib/resend/client.rb
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "resend/api_keys"
|
5
|
-
require "resend/broadcasts"
|
6
|
-
require "resend/batch"
|
7
|
-
require "resend/contacts"
|
8
|
-
require "resend/domains"
|
3
|
+
# backwards compatibility
|
9
4
|
require "resend/emails"
|
10
|
-
require "httparty"
|
11
5
|
|
12
6
|
module Resend
|
13
7
|
# Client class.
|
data/lib/resend/contacts.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "resend/request"
|
4
|
-
require "resend/errors"
|
5
|
-
|
6
3
|
module Resend
|
7
4
|
# Contacts api wrapper
|
8
5
|
module Contacts
|
@@ -19,6 +16,10 @@ module Resend
|
|
19
16
|
Resend::Request.new(path, {}, "get").perform
|
20
17
|
end
|
21
18
|
|
19
|
+
#
|
20
|
+
# List contacts in an audience
|
21
|
+
#
|
22
|
+
# @param audience_id [String] the audience id
|
22
23
|
# https://resend.com/docs/api-reference/contacts/list-contacts
|
23
24
|
def list(audience_id)
|
24
25
|
path = "audiences/#{audience_id}/contacts"
|
@@ -37,9 +38,15 @@ module Resend
|
|
37
38
|
Resend::Request.new(path, {}, "delete").perform
|
38
39
|
end
|
39
40
|
|
41
|
+
#
|
42
|
+
# Update a contact
|
43
|
+
#
|
44
|
+
# @param params [Hash] the contact params
|
40
45
|
# https://resend.com/docs/api-reference/contacts/update-contact
|
41
46
|
def update(params)
|
42
|
-
|
47
|
+
raise ArgumentError, "id or email is required" if params[:id].nil? && params[:email].nil?
|
48
|
+
|
49
|
+
path = "audiences/#{params[:audience_id]}/contacts/#{params[:id] || params[:email]}"
|
43
50
|
Resend::Request.new(path, params, "patch").perform
|
44
51
|
end
|
45
52
|
end
|
data/lib/resend/domains.rb
CHANGED
data/lib/resend/emails.rb
CHANGED
data/lib/resend/request.rb
CHANGED
data/lib/resend/version.rb
CHANGED
data/lib/resend.rb
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Version
|
3
4
|
require "resend/version"
|
5
|
+
|
6
|
+
# Utils
|
7
|
+
require "httparty"
|
8
|
+
require "json"
|
9
|
+
require "resend/errors"
|
4
10
|
require "resend/client"
|
11
|
+
require "resend/request"
|
12
|
+
|
13
|
+
# API Operations
|
14
|
+
require "resend/audiences"
|
15
|
+
require "resend/api_keys"
|
16
|
+
require "resend/broadcasts"
|
17
|
+
require "resend/batch"
|
18
|
+
require "resend/contacts"
|
19
|
+
require "resend/domains"
|
20
|
+
require "resend/emails"
|
5
21
|
|
22
|
+
# Rails
|
6
23
|
require "resend/railtie" if defined?(Rails) && defined?(ActionMailer)
|
7
24
|
|
8
25
|
# Main Resend module
|
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.
|
4
|
+
version: 0.18.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-
|
11
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|