internetdata 2.6.2 → 2.6.4

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: f69abe2610330795d8ce7f3df969a5436ace62d059813870aa30cbe94f87848b
4
- data.tar.gz: 6c7c9b29b91ee4a50f8c3daf3f6c70cbca615f1e092ddc8ad3e1e06e7e01820d
3
+ metadata.gz: afd47ed11a5c7584109ee4cd24d9a80355735d93ab75f34b2e259d00c7bf5a1c
4
+ data.tar.gz: b1e54653b61eecfc115d38f31479419189ceef73892117c392340c07edfd7b7d
5
5
  SHA512:
6
- metadata.gz: ec36dc5c448517e40721e16396c578aa37026072ca6116c99410f3580bc0ffcbc683112c8b5419d03259b16533cb50e82191a9ac82289d9ea6db1b2baabf1cb8
7
- data.tar.gz: fe1d3242727a5ccde538a69ce611efeda5003ad08e0404e436a162fc4b5af84fad13ea832e75eb9d9aade9fa0190ef5e874e5f0ba612d3130112eca16f422a78
6
+ metadata.gz: 2103eda9f58619d97eea99a26cba2eabdb00f766a4a2baaa2b71c17f1bffb5bc10f34ea322e5614010d8e8a65d27afb7b9371d2cbe4249187363aabb225e7581
7
+ data.tar.gz: e2997411f2e09d36b335c0c55ad1a2e8a9df52e1b413ad686502c712536d587cd16f50b391b07d7500602e0bfd90733a4148c69109cc6cb5a5798139125ac417
data/README.md CHANGED
@@ -23,7 +23,7 @@ Requires Ruby 3.3 or newer.
23
23
 
24
24
  ## Usage
25
25
 
26
- Every database published today needs an API key carrying the `db.download` scope. Access is granted by contract, one family at a time, so there is no self-serve tier: if your organization doesn't have a license yet, [request an evaluation](https://internetdata.io/contact?purpose=evaluation&subject=Evaluation+license). `api_key:` is nevertheless optional - a client built without one sends no `Authorization` header at all, ready for a database served without a license.
26
+ Every database published today needs an API key carrying the `db.download` scope. The Open databases are licensed to every organization from the start and are free under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), and `list` marks them `open`. The rest are licensed by contract, one family at a time: if your organization doesn't have a license yet, [request an evaluation](https://internetdata.io/contact?purpose=evaluation&subject=Evaluation+license). `api_key:` is nevertheless optional - a client built without one sends no `Authorization` header at all, ready for a database served without a license.
27
27
 
28
28
  ```ruby
29
29
  require 'internetdata'
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.10.13
6
+ The version of the OpenAPI document: 2026.10.15
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -90,11 +90,17 @@ module InternetData
90
90
  # the spec requires. The generated reader raised a RuntimeError, a
91
91
  # JSON::ParserError or an ArgumentError for those, none of them retried, and
92
92
  # handed an empty or non-object body back as nil, as if it were the answer.
93
+ #
94
+ # Every member present is checked against the type the spec gives it before
95
+ # the answer is handed back: the generated reader converts with `to_i` and
96
+ # `to_s`, so `"version":"x"` came back as version 0 and `"version":"3"` as 3,
97
+ # as if either were the answer (2.6.3, measured 2026-10-16).
93
98
  def deserialize(response, return_type)
94
99
  data = super
95
- return data unless data.nil?
100
+ raise Error.new(:server_error, "the API answered with no #{return_type}", status: response.code) if data.nil?
96
101
 
97
- raise Error.new(:server_error, "the API answered with no #{return_type}", status: response.code)
102
+ check_type!(JSON.parse(response.body, symbolize_names: true), return_type.to_s, 'the answer') if return_type
103
+ data
98
104
  rescue Error
99
105
  raise
100
106
  rescue StandardError => e
@@ -189,5 +195,42 @@ module InternetData
189
195
  end
190
196
 
191
197
  private_class_method :transport_failure?, :parse_object, :oauth_refusal
198
+
199
+ private
200
+
201
+ # True when `value` has the generated `type`, a model's members recursively;
202
+ # raises TypeError naming where it does not. A null is left to the models'
203
+ # own required-member checks.
204
+ def check_type!(value, type, where)
205
+ return true if value.nil?
206
+
207
+ typed =
208
+ case type
209
+ when 'String', 'Date', 'Time' then value.is_a?(String)
210
+ when 'Integer' then value.is_a?(Integer)
211
+ when 'Float' then value.is_a?(Numeric)
212
+ when 'Boolean' then [true, false].include?(value)
213
+ when 'Object' then true
214
+ when /\AArray<(?<inner>.+)>\z/
215
+ inner = Regexp.last_match(:inner)
216
+ value.is_a?(Array) && value.each_with_index.all? { |v, i| check_type!(v, inner, "#{where}[#{i}]") }
217
+ when /\AHash<String, ?(?<inner>.+)>\z/
218
+ inner = Regexp.last_match(:inner)
219
+ value.is_a?(Hash) && value.all? { |k, v| check_type!(v, inner, "#{where}.#{k}") }
220
+ else
221
+ model = InternetData.const_get(type)
222
+ if model.respond_to?(:openapi_types)
223
+ value.is_a?(Hash) && model.openapi_types.all? do |attr, member|
224
+ key = model.attribute_map[attr]
225
+ check_type!(value[key], member.to_s, "#{where}.#{key}")
226
+ end
227
+ else
228
+ value.is_a?(String) # an enum
229
+ end
230
+ end
231
+ return true if typed
232
+
233
+ raise TypeError, "#{where} is not a #{type}"
234
+ end
192
235
  end
193
236
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InternetData
4
- VERSION = '2.6.2'
4
+ VERSION = '2.6.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: internetdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mslm Dev