resend 0.4.0 → 0.5.0

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: e3e46d09490b1ad19c59f04e55fd16b0da3d3c2573ed5c9dcba3297f0f92f5fc
4
- data.tar.gz: 6c9dfb7910fd6199bc9c75aa9f3c2e9200677ce9e2ba1e9a29e124908489e714
3
+ metadata.gz: d3e4d80d6041ac5d061ec2eafce26da90a106d14be6ae2b23dc66741b29a7d55
4
+ data.tar.gz: 3d486cd3522bda376cc61ee41c0ef1bdc91b6af2db07b4f05530d01d5a74f616
5
5
  SHA512:
6
- metadata.gz: 58e0cdd7ae1d48654ff33761b1fcb8a4e96061142d154232f85bac348c38956505d11ee3a0cdf6d86592389d2d8c69eba48941d7d97e1c4de904d0c8b5b6d7a6
7
- data.tar.gz: 2069dfd99a67245da05ebf8e58658c2771de51cd6999d8d824116174b0aeba38dcc4f4423f05cb73e63388f5497377dba4c4b98eebddba2b2205864530790d3a
6
+ metadata.gz: 548f3a9603ecba1a0d44f7846d08e2194bd29d5baae28c6df8bdd3c1d5f3827210dacddad009556ff4d33c9eb1c567be60d522f3eda6f240fe7b1a3e0b3e6e49
7
+ data.tar.gz: a775247f3a2c7ab2a17e277d30f1b44700a5b9a17082de247aeff0a781e17c728bd67aa9bf1ad7e7807d78f43be43bd717c6c77ed464e333540a70efb325afd8
@@ -9,19 +9,19 @@ module Resend
9
9
  class << self
10
10
  # https://resend.com/docs/api-reference/api-keys/create-api-key
11
11
  def create(params)
12
- path = "/api-keys"
12
+ path = "api-keys"
13
13
  Resend::Request.new(path, params, "post").perform
14
14
  end
15
15
 
16
16
  # https://resend.com/docs/api-reference/api-keys/list-api-keys
17
17
  def list
18
- path = "/api-keys"
18
+ path = "api-keys"
19
19
  Resend::Request.new(path, {}, "get").perform
20
20
  end
21
21
 
22
22
  # https://resend.com/docs/api-reference/api-keys/delete-api-key
23
23
  def remove(api_key_id = "")
24
- path = "/api-keys/#{api_key_id}"
24
+ path = "api-keys/#{api_key_id}"
25
25
  Resend::Request.new(path, {}, "delete").perform
26
26
  end
27
27
  end
@@ -9,25 +9,31 @@ module Resend
9
9
  class << self
10
10
  # https://resend.com/docs/api-reference/domains/create-domain
11
11
  def create(params)
12
- path = "/domains"
12
+ path = "domains"
13
13
  Resend::Request.new(path, params, "post").perform
14
14
  end
15
15
 
16
+ # https://resend.com/docs/api-reference/domains/get-domain
17
+ def get(domain_id = "")
18
+ path = "domains/#{domain_id}"
19
+ Resend::Request.new(path, {}, "get").perform
20
+ end
21
+
16
22
  # https://resend.com/docs/api-reference/api-keys/list-api-keys
17
23
  def list
18
- path = "/domains"
24
+ path = "domains"
19
25
  Resend::Request.new(path, {}, "get").perform
20
26
  end
21
27
 
22
28
  # https://resend.com/docs/api-reference/domains/delete-domain
23
29
  def remove(domain_id = "")
24
- path = "/domains/#{domain_id}"
30
+ path = "domains/#{domain_id}"
25
31
  Resend::Request.new(path, {}, "delete").perform
26
32
  end
27
33
 
28
34
  # https://resend.com/docs/api-reference/domains/verify-domain
29
35
  def verify(domain_id = "")
30
- path = "/domains/#{domain_id}/verify"
36
+ path = "domains/#{domain_id}/verify"
31
37
  Resend::Request.new(path, {}, "post").perform
32
38
  end
33
39
  end
@@ -31,10 +31,11 @@ module Resend
31
31
  options = {
32
32
  headers: @headers
33
33
  }
34
+
34
35
  options[:body] = @body.to_json unless @body.empty?
35
36
  resp = HTTParty.send(@verb.to_sym, "#{BASE_URL}#{@path}", options)
36
37
  resp.transform_keys!(&:to_sym) unless resp.body.empty?
37
- handle_error!(resp) if resp[:statusCode] && resp[:statusCode] != 200
38
+ handle_error!(resp) if resp[:statusCode] && (resp[:statusCode] != 200 || resp[:statusCode] != 201)
38
39
  resp
39
40
  end
40
41
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resend
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
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.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derich Pacheco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-20 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty