dnsimple 12.0.0 → 12.1.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: bf5d85da45a3b9f1f9cfdf8eebb6e138f7701b105d3b5e1168374712bf0c962a
4
- data.tar.gz: 243d214bf5ecc19649eeac0ee2035591702108e0b49588921466ddba787623d6
3
+ metadata.gz: 371112dc13ce900d770aa434d297b19f75892d3a90a3b2f4292ddffb88574c3f
4
+ data.tar.gz: c312bc89ea319f11c94bf3ed157c663264d206480033076c9b122a5d31dee2a2
5
5
  SHA512:
6
- metadata.gz: 529d35b92ffd260c29bd62c0dfe5302112b82620cf77f3b59b69c8bae4d7705a47dee1b09d86af8431f420c56fb916860bee1c6b2718b6441e61d08635823f98
7
- data.tar.gz: 5a0536f22fb8fe8e0833fad81476c2e92433e349b4c8722c9cc57270644bab5931bea8cf67172f971f886e0b6db35c15e719af4bef20cc61c393423c10bb5dd9
6
+ metadata.gz: 40334df4d23d15a5a70fde859aacfaffe0407f71fb8cde5524a03b4be98b4df710d71b8eaa7fb3c8484c38fb7845b3b54c95326c84328d44524d771700a39f39
7
+ data.tar.gz: 190c114666115887b7724778e72ad511a204a084f06d30494fed5cc47f8a4ca76a4465e1e8d3b44773b71b55105bdfcfca00c38aaf50a20beb714926e2fd2b5f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/), the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## 12.1.0 - 2025-02-26
6
+
7
+ ### Added
8
+
9
+ - Added `Dnsimple::Client::DomainsResearch#domain_research_status` to research a domain for availability and registration status. (#450)
10
+
5
11
  ## 12.0.0 - 2026-01-22
6
12
 
7
13
  ### Removed
data/README.md CHANGED
@@ -76,6 +76,21 @@ response = client.domains.domain(account_id, "example.com")
76
76
  puts response.data
77
77
  ```
78
78
 
79
+ ### Research a domain
80
+
81
+ > **Note:** This endpoint is part of a Private Beta. During the beta period, changes to the endpoint may occur at any time. If interested in using this endpoint, reach out to [DNSimple support](support@dnsimple.com).
82
+
83
+ Research a domain name for availability and registration status information:
84
+
85
+ ```ruby
86
+ response = client.domains.domain_research_status(account_id, "example.com")
87
+ research = response.data
88
+ puts research.domain # => "example.com"
89
+ puts research.availability # => "unavailable"
90
+ puts research.request_id # => "f453dabc-a27e-4bf1-a93e-f263577ffaae"
91
+ puts research.errors # => []
92
+ ```
93
+
79
94
  ## Configuration
80
95
 
81
96
  ### Sandbox Environment
@@ -143,6 +143,7 @@ module Dnsimple
143
143
 
144
144
 
145
145
  require_relative "domains"
146
+ require_relative "domains_research"
146
147
  require_relative "domains_delegation_signer_records"
147
148
  require_relative "domains_dnssec"
148
149
  require_relative "domains_email_forwards"
@@ -150,6 +151,7 @@ module Dnsimple
150
151
 
151
152
  class DomainsService < ClientService
152
153
  include Client::Domains
154
+ include Client::DomainsResearch
153
155
  include Client::DomainsDelegationSignerRecords
154
156
  include Client::DomainsDnssec
155
157
  include Client::DomainsEmailForwards
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dnsimple
4
+ class Client
5
+ module DomainsResearch
6
+ # Research a domain name for availability and registration status information.
7
+ #
8
+ # This endpoint provides information about a domain's availability status.
9
+ #
10
+ # @example Research the domain example.com:
11
+ # client.domains.domain_research_status(1010, "example.com")
12
+ #
13
+ # @param account_id [Integer] the account ID
14
+ # @param domain_name [#to_s] the domain name to research
15
+ # @param options [Hash]
16
+ # @return [Dnsimple::Response<Dnsimple::Struct::DomainResearchStatus>]
17
+ #
18
+ # @raise [Dnsimple::RequestError] When the request fails.
19
+ def domain_research_status(account_id, domain_name, options = {})
20
+ endpoint = Client.versioned("/%s/domains/research/status" % [account_id])
21
+ options = options.merge(query: { domain: domain_name })
22
+ response = client.get(endpoint, options)
23
+
24
+ Dnsimple::Response.new(response, Struct::DomainResearchStatus.new(response["data"]))
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dnsimple
4
+ module Struct
5
+ class DomainResearchStatus < Base
6
+ # @return [String] UUID identifier for this research request.
7
+ attr_accessor :request_id
8
+
9
+ # @return [String] The domain name that was researched.
10
+ attr_accessor :domain
11
+
12
+ # @return [String] The availability status. See https://developer.dnsimple.com/v2/domains/research/#getDomainsResearchStatus
13
+ attr_accessor :availability
14
+
15
+ # @return [Array<String>] Array of error messages if the domain cannot be researched.
16
+ attr_accessor :errors
17
+ end
18
+ end
19
+ end
@@ -29,6 +29,7 @@ require_relative "struct/domain_premium_price"
29
29
  require_relative "struct/domain_price"
30
30
  require_relative "struct/domain_push"
31
31
  require_relative "struct/domain_registration"
32
+ require_relative "struct/domain_research_status"
32
33
  require_relative "struct/domain_restore"
33
34
  require_relative "struct/domain_transfer"
34
35
  require_relative "struct/domain_renewal"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dnsimple
4
- VERSION = "12.0.0"
4
+ VERSION = "12.1.0"
5
5
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ describe Dnsimple::Client, ".domains" do
6
+
7
+ subject { described_class.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").domains }
8
+
9
+ describe "#domain_research_status" do
10
+ let(:account_id) { 1010 }
11
+
12
+ before do
13
+ stub_request(:get, %r{/v2/#{account_id}/domains/research/status})
14
+ .with(query: { domain: "taken.com" })
15
+ .to_return(read_http_fixture("getDomainsResearchStatus/success-unavailable.http"))
16
+ end
17
+
18
+ it "builds the correct request" do
19
+ subject.domain_research_status(account_id, domain_name = "taken.com")
20
+
21
+ expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/research/status")
22
+ .with(query: { domain: domain_name })
23
+ .with(headers: { "Accept" => "application/json" })
24
+ end
25
+
26
+ it "returns the domain research status" do
27
+ response = subject.domain_research_status(account_id, "taken.com")
28
+ expect(response).to be_a(Dnsimple::Response)
29
+
30
+ result = response.data
31
+ expect(result).to be_a(Dnsimple::Struct::DomainResearchStatus)
32
+ expect(result.request_id).to eq("25dd77cb-2f71-48b9-b6be-1dacd2881418")
33
+ expect(result.domain).to eq("taken.com")
34
+ expect(result.availability).to eq("unavailable")
35
+ expect(result.errors).to eq([])
36
+ end
37
+ end
38
+ end
@@ -18,4 +18,4 @@ x-permitted-cross-domain-policies: none
18
18
  content-security-policy: frame-ancestors 'none'
19
19
  strict-transport-security: max-age=31536000
20
20
 
21
- {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com","active":true}}
21
+ {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","active":true}}
@@ -17,4 +17,4 @@ x-permitted-cross-domain-policies: none
17
17
  x-xss-protection: 1; mode=block
18
18
  strict-transport-security: max-age=31536000
19
19
 
20
- {"data":{"enabled":true,"created_at":"2017-03-03T13:49:58Z","updated_at":"2017-03-03T13:49:58Z"}}
20
+ {"data":{"enabled":true,"active":true,"created_at":"2017-03-03T13:49:58Z","updated_at":"2017-03-03T13:49:58Z"}}
@@ -17,4 +17,4 @@ x-permitted-cross-domain-policies: none
17
17
  x-xss-protection: 1; mode=block
18
18
  strict-transport-security: max-age=31536000
19
19
 
20
- {"data":{"enabled":true,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}}
20
+ {"data":{"enabled":true,"active":true,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}}
@@ -0,0 +1,15 @@
1
+ HTTP/1.1 400 Bad Request
2
+ server: nginx
3
+ date: Mon, 16 Feb 2026 11:30:46 GMT
4
+ content-type: application/json; charset=utf-8
5
+ content-length: 176
6
+ x-ratelimit-limit: 2400
7
+ x-ratelimit-remaining: 2394
8
+ x-ratelimit-reset: 1771244870
9
+ x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
10
+ cache-control: no-cache
11
+ x-request-id: 5e818c7b-2bd3-478b-9b0d-23dcfedb276d
12
+ x-runtime: 0.030532
13
+ strict-transport-security: max-age=63072000
14
+
15
+ {"data":{"request_id":"5e818c7b-2bd3-478b-9b0d-23dcfedb276d","domain":"not..a..domain..name","availability":"unknown","errors":["'not..a..domain..name': Invalid domain name"]}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ server: nginx
3
+ date: Mon, 16 Feb 2026 11:44:31 GMT
4
+ content-type: application/json; charset=utf-8
5
+ content-length: 126
6
+ x-ratelimit-limit: 2400
7
+ x-ratelimit-remaining: 2393
8
+ x-ratelimit-reset: 1771244869
9
+ x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
10
+ etag: W/"95174d25b104c446b9516f4a3a6fc4f4"
11
+ cache-control: max-age=0, private, must-revalidate
12
+ x-request-id: 275ba39a-88a5-4ca5-892a-7e991af4b31c
13
+ x-runtime: 0.042963
14
+ strict-transport-security: max-age=63072000
15
+
16
+ {"data":{"request_id":"275ba39a-88a5-4ca5-892a-7e991af4b31c","domain":"available.com","availability":"available","errors":[]}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ server: nginx
3
+ date: Mon, 16 Feb 2026 11:29:45 GMT
4
+ content-type: application/json; charset=utf-8
5
+ content-length: 124
6
+ x-ratelimit-limit: 2400
7
+ x-ratelimit-remaining: 2396
8
+ x-ratelimit-reset: 1771244869
9
+ x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
10
+ etag: W/"b51102adca57ea1f194855dffa8d4d25"
11
+ cache-control: max-age=0, private, must-revalidate
12
+ x-request-id: 25dd77cb-2f71-48b9-b6be-1dacd2881418
13
+ x-runtime: 0.025187
14
+ strict-transport-security: max-age=63072000
15
+
16
+ {"data":{"request_id":"25dd77cb-2f71-48b9-b6be-1dacd2881418","domain":"taken.com","availability":"unavailable","errors":[]}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ server: nginx
3
+ date: Mon, 16 Feb 2026 11:29:59 GMT
4
+ content-type: application/json; charset=utf-8
5
+ content-length: 158
6
+ x-ratelimit-limit: 2400
7
+ x-ratelimit-remaining: 2395
8
+ x-ratelimit-reset: 1771244870
9
+ x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
10
+ etag: W/"9e0846a6b79a3ce70c53bcd660d5524f"
11
+ cache-control: max-age=0, private, must-revalidate
12
+ x-request-id: 7f417577-eafb-41ff-ac21-51f7a5ca0170
13
+ x-runtime: 0.031308
14
+ strict-transport-security: max-age=63072000
15
+
16
+ {"data":{"request_id":"7f417577-eafb-41ff-ac21-51f7a5ca0170","domain":"taken.co.fa","availability":"unknown","errors":["TLD not supported for registration"]}}
@@ -18,4 +18,4 @@ x-permitted-cross-domain-policies: none
18
18
  content-security-policy: frame-ancestors 'none'
19
19
  strict-transport-security: max-age=31536000
20
20
 
21
- {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com","active":true}}
21
+ {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","active":true}}
@@ -13,4 +13,4 @@ x-request-id: e42df983-a8a5-4123-8c74-fb89ab934aba
13
13
  x-runtime: 0.025456
14
14
  strict-transport-security: max-age=63072000
15
15
 
16
- {"data":[{"id":24809,"domain_id":235146,"alias_email":".*@a-domain.com","destination_email":"jane.smith@example.com","created_at":"2017-05-25T19:23:16Z","updated_at":"2017-05-25T19:23:16Z","from":".*@a-domain.com","to":"jane.smith@example.com","active":true}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}}
16
+ {"data":[{"id":24809,"domain_id":235146,"alias_email":".*@a-domain.com","destination_email":"jane.smith@example.com","created_at":"2017-05-25T19:23:16Z","updated_at":"2017-05-25T19:23:16Z","active":true}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DNSimple
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-22 00:00:00.000000000 Z
11
+ date: 2026-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -120,6 +120,7 @@ files:
120
120
  - lib/dnsimple/client/domains_dnssec.rb
121
121
  - lib/dnsimple/client/domains_email_forwards.rb
122
122
  - lib/dnsimple/client/domains_pushes.rb
123
+ - lib/dnsimple/client/domains_research.rb
123
124
  - lib/dnsimple/client/identity.rb
124
125
  - lib/dnsimple/client/oauth.rb
125
126
  - lib/dnsimple/client/registrar.rb
@@ -163,6 +164,7 @@ files:
163
164
  - lib/dnsimple/struct/domain_push.rb
164
165
  - lib/dnsimple/struct/domain_registration.rb
165
166
  - lib/dnsimple/struct/domain_renewal.rb
167
+ - lib/dnsimple/struct/domain_research_status.rb
166
168
  - lib/dnsimple/struct/domain_restore.rb
167
169
  - lib/dnsimple/struct/domain_transfer.rb
168
170
  - lib/dnsimple/struct/email_forward.rb
@@ -197,6 +199,7 @@ files:
197
199
  - spec/dnsimple/client/domains_dnssec_spec.rb
198
200
  - spec/dnsimple/client/domains_email_forwards_spec.rb
199
201
  - spec/dnsimple/client/domains_pushes_spec.rb
202
+ - spec/dnsimple/client/domains_research_spec.rb
200
203
  - spec/dnsimple/client/domains_spec.rb
201
204
  - spec/dnsimple/client/identity_spec.rb
202
205
  - spec/dnsimple/client/oauth_spec.rb
@@ -302,6 +305,10 @@ files:
302
305
  - spec/fixtures.http/getDomainRestore/success.http
303
306
  - spec/fixtures.http/getDomainTransfer/success.http
304
307
  - spec/fixtures.http/getDomainTransferLock/success.http
308
+ - spec/fixtures.http/getDomainsResearchStatus/error-validation.http
309
+ - spec/fixtures.http/getDomainsResearchStatus/success-available.http
310
+ - spec/fixtures.http/getDomainsResearchStatus/success-unavailable.http
311
+ - spec/fixtures.http/getDomainsResearchStatus/success-unsupported-tld.http
305
312
  - spec/fixtures.http/getEmailForward/success.http
306
313
  - spec/fixtures.http/getPrimaryServer/success.http
307
314
  - spec/fixtures.http/getRegistrantChange/success.http