antbird 1.1.0 → 1.2.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/.github/workflows/build-os.yml +4 -1
- data/Gemfile.lock +4 -4
- data/lib/antbird/client/json_decoder.rb +20 -0
- data/lib/antbird/client.rb +2 -1
- data/lib/antbird/rest_api/rest_api_opensearch_v3_6.rb +1505 -0
- data/lib/antbird/rest_api/rest_api_opensearch_v3_7.rb +1505 -0
- data/lib/antbird/rest_api/rest_api_opensearch_v3_8.rb +1514 -0
- data/lib/antbird/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4fa1a5ef17ca8b183c23e877b88386b4b28bdf9da8cfc35faf1285be1adb8a13
|
|
4
|
+
data.tar.gz: b7084f2d7fd314254d20f6f382f6947b456efde369ec444ec7621f68ae567920
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e552dc0dfa4fdfa137a157de7f6b110047542c9c1e79ad881e9b7aeeb48a463e9021ce209b9dac868357aeab16bb2d5f58f37e0644f5faf402852c93a9314a5f
|
|
7
|
+
data.tar.gz: dbac1bc2360ab6120349d8a003d75929142fce2a286f65623b3e9dd75e9699d13e7c113c4394035b7b0d33e88cb7ecb1b7eb6d772c98462f36be527199f653bf
|
|
@@ -13,6 +13,9 @@ jobs:
|
|
|
13
13
|
matrix:
|
|
14
14
|
# https://github.com/opensearch-project/OpenSearch/releases
|
|
15
15
|
search_versions:
|
|
16
|
+
- 3.8.0
|
|
17
|
+
- 3.7.0
|
|
18
|
+
- 3.6.0
|
|
16
19
|
- 3.5.0
|
|
17
20
|
- 3.4.0
|
|
18
21
|
- 3.3.2
|
|
@@ -36,7 +39,7 @@ jobs:
|
|
|
36
39
|
sudo sysctl -w vm.swappiness=1
|
|
37
40
|
sudo sysctl -w fs.file-max=262144
|
|
38
41
|
sudo sysctl -w vm.max_map_count=262144
|
|
39
|
-
- uses: actions/checkout@
|
|
42
|
+
- uses: actions/checkout@v7
|
|
40
43
|
- uses: ruby/setup-ruby@v1
|
|
41
44
|
with:
|
|
42
45
|
ruby-version: "4.0"
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
antbird (1.
|
|
4
|
+
antbird (1.2.0)
|
|
5
5
|
faraday (>= 2.0.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -11,18 +11,18 @@ GEM
|
|
|
11
11
|
public_suffix (>= 2.0.2, < 8.0)
|
|
12
12
|
connection_pool (3.0.2)
|
|
13
13
|
diff-lcs (1.6.2)
|
|
14
|
-
faraday (2.14.
|
|
14
|
+
faraday (2.14.3)
|
|
15
15
|
faraday-net_http (>= 2.0, < 3.5)
|
|
16
16
|
json
|
|
17
17
|
logger
|
|
18
|
-
faraday-net_http (3.4.
|
|
18
|
+
faraday-net_http (3.4.4)
|
|
19
19
|
net-http (~> 0.5)
|
|
20
20
|
faraday-net_http_persistent (2.3.1)
|
|
21
21
|
faraday (~> 2.5)
|
|
22
22
|
net-http-persistent (>= 4.0.4, < 5)
|
|
23
23
|
faraday-retry (2.4.0)
|
|
24
24
|
faraday (~> 2.0)
|
|
25
|
-
json (
|
|
25
|
+
json (3.0.1)
|
|
26
26
|
logger (1.7.0)
|
|
27
27
|
net-http (0.9.1)
|
|
28
28
|
uri (>= 0.11.1)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
module Antbird
|
|
4
|
+
class Client
|
|
5
|
+
# Faraday's JSON response middleware hands parser options to the decoder as
|
|
6
|
+
# a positional Hash (`decoder.parse(body, options)`). json 3.0 turned
|
|
7
|
+
# JSON.parse into `parse(source, **options)`, so that call raises
|
|
8
|
+
# ArgumentError and every response fails with Faraday::ParsingError.
|
|
9
|
+
# Decoding through here keeps antbird working on both json 2.x and 3.x.
|
|
10
|
+
module JsonDecoder
|
|
11
|
+
module_function
|
|
12
|
+
|
|
13
|
+
def parse(body, options = {})
|
|
14
|
+
return ::JSON.parse(body) if options.nil? || options.empty?
|
|
15
|
+
|
|
16
|
+
::JSON.parse(body, **options)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/antbird/client.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'faraday'
|
|
2
2
|
require 'antbird/client/errors'
|
|
3
|
+
require 'antbird/client/json_decoder'
|
|
3
4
|
|
|
4
5
|
module Antbird
|
|
5
6
|
class Client
|
|
@@ -186,7 +187,7 @@ module Antbird
|
|
|
186
187
|
@block&.call(conn)
|
|
187
188
|
|
|
188
189
|
conn.request :json
|
|
189
|
-
conn.response :json, content_type: /\bjson
|
|
190
|
+
conn.response :json, content_type: /\bjson$/, parser_options: { decoder: [JsonDecoder, :parse] }
|
|
190
191
|
|
|
191
192
|
conn.options[:timeout] = read_timeout
|
|
192
193
|
conn.options[:open_timeout] = open_timeout
|