incognia_api 3.1.0 → 4.0.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -4
- data/lib/incognia_api/address.rb +7 -5
- data/lib/incognia_api/configuration.rb +1 -1
- data/lib/incognia_api/version.rb +1 -1
- data/lib/incognia_api.rb +3 -1
- 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: d68f4d6839a251feef3d35c6549916f85b61722d3d884c0f01088c55ffdad522
|
|
4
|
+
data.tar.gz: 94ceea8dfb16ace08e710082e511b724eb46e615f747bebcdad53283d58ababd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2323ebadda00bfe03ce0d5fe15eb8bd8a504460a40170822c67f839c0785a942cb926fba49191236adfbbd7c88f60c7cc122372642fd8faf28d27459f65bff0b
|
|
7
|
+
data.tar.gz: 9c85a5715c2f295cd6072f41853fc3664f8624a575dbe78b0df09e333668ec9155d7b54b4a1599c6c6cb03f58b607effbdc8b2a0e2afa9b525329e42a9b6808b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [4.0.0] - 2026-05-27
|
|
4
|
+
- Reuse TCP connection by default
|
|
5
|
+
|
|
6
|
+
## [3.2.0] - 2026-05-04
|
|
7
|
+
- Add `county` support to structured addresses.
|
|
8
|
+
|
|
3
9
|
## [3.1.0] - 2026-04-17
|
|
4
10
|
- Add optional `keep_alive` support with configurable `max_connections` for persistent HTTP connections.
|
|
5
11
|
- Add `X-Incognia-Latency` support by sending the previous successful request latency on subsequent API calls.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -45,19 +45,29 @@ Incognia.configure(
|
|
|
45
45
|
)
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
`max_connections` sets the maximum number of concurrent persistent
|
|
50
|
-
|
|
48
|
+
HTTP connection reuse is enabled by default. When connection reuse is enabled,
|
|
49
|
+
`max_connections` sets the maximum number of concurrent persistent connections
|
|
50
|
+
used by the client.
|
|
51
51
|
|
|
52
52
|
```ruby
|
|
53
53
|
Incognia.configure(
|
|
54
54
|
client_id: ENV['INCOGNIA_CLIENT_ID'],
|
|
55
55
|
client_secret: ENV['INCOGNIA_CLIENT_SECRET'],
|
|
56
|
-
keep_alive: true,
|
|
57
56
|
max_connections: 5
|
|
58
57
|
)
|
|
59
58
|
```
|
|
60
59
|
|
|
60
|
+
To disable persistent connections, set `keep_alive: false`. `max_connections`
|
|
61
|
+
can only be configured when `keep_alive` is enabled.
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
64
|
+
Incognia.configure(
|
|
65
|
+
client_id: ENV['INCOGNIA_CLIENT_ID'],
|
|
66
|
+
client_secret: ENV['INCOGNIA_CLIENT_SECRET'],
|
|
67
|
+
keep_alive: false
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
61
71
|
For sandbox credentials, refer to the [API testing guide](https://developer.incognia.com/).
|
|
62
72
|
|
|
63
73
|
:bulb: For Rails applications it's recommended to create an initializer file, for example `config/initializers/incognia.rb`.
|
data/lib/incognia_api/address.rb
CHANGED
|
@@ -25,19 +25,20 @@ module Incognia
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
class Structured
|
|
28
|
-
attr_reader :locale, :country_name, :country_code, :state, :city, :
|
|
29
|
-
:
|
|
30
|
-
:street, :number, :complements
|
|
28
|
+
attr_reader :locale, :country_name, :country_code, :state, :city, :county,
|
|
29
|
+
:borough, :neighborhood, :postal_code, :street, :number, :complements
|
|
31
30
|
|
|
32
31
|
def initialize(locale: nil, country_name: nil, country_code: nil, \
|
|
33
|
-
state: nil, city: nil,
|
|
34
|
-
|
|
32
|
+
state: nil, city: nil, county: nil, borough: nil, \
|
|
33
|
+
neighborhood: nil, postal_code: nil, street: nil, \
|
|
34
|
+
number: nil, complements: nil)
|
|
35
35
|
|
|
36
36
|
@locale = locale
|
|
37
37
|
@country_name = country_name
|
|
38
38
|
@country_code = country_code
|
|
39
39
|
@state = state
|
|
40
40
|
@city = city
|
|
41
|
+
@county = county
|
|
41
42
|
@borough = borough
|
|
42
43
|
@neighborhood = neighborhood
|
|
43
44
|
@postal_code = postal_code
|
|
@@ -54,6 +55,7 @@ module Incognia
|
|
|
54
55
|
country_code: country_code,
|
|
55
56
|
state: state,
|
|
56
57
|
city: city,
|
|
58
|
+
county: county,
|
|
57
59
|
borough: borough,
|
|
58
60
|
neighborhood: neighborhood,
|
|
59
61
|
street: street,
|
|
@@ -6,7 +6,7 @@ module Incognia
|
|
|
6
6
|
|
|
7
7
|
attr_accessor :client_id, :client_secret, :host, :keep_alive, :max_connections
|
|
8
8
|
|
|
9
|
-
def configure(client_id:, client_secret:, host: nil, keep_alive:
|
|
9
|
+
def configure(client_id:, client_secret:, host: nil, keep_alive: true, max_connections: nil)
|
|
10
10
|
validate_connection_settings!(keep_alive: keep_alive, max_connections: max_connections)
|
|
11
11
|
|
|
12
12
|
@client_id = client_id
|
data/lib/incognia_api/version.rb
CHANGED
data/lib/incognia_api.rb
CHANGED
|
@@ -29,7 +29,9 @@ module Incognia
|
|
|
29
29
|
class APIError < StandardError
|
|
30
30
|
attr_reader :message, :errors, :status
|
|
31
31
|
|
|
32
|
-
def initialize(message, response_info =
|
|
32
|
+
def initialize(message, response_info = nil)
|
|
33
|
+
response_info ||= {}
|
|
34
|
+
|
|
33
35
|
@status = response_info[:status]
|
|
34
36
|
@errors = response_info[:body]
|
|
35
37
|
@message = format_message(message)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: incognia_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guilherme Cavalcanti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|