airrecord 1.0.9 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7751aefc887a2bdd71a1a9f05465ba5fe4c1bc7df38e239f562b9f83cdc03f93
4
- data.tar.gz: ad1ce14c2dd0f326608a910776100f22bb01bb8a3d5f13d5188911750edaab35
3
+ metadata.gz: 822d1414500650adcb7973b15f14a80abbacff9b950111f2d43eb814302c482e
4
+ data.tar.gz: ffa9215e1b8af1e052fe56f4c666bbacb5f3c953b040a321e22c2a24b102497c
5
5
  SHA512:
6
- metadata.gz: 3f5fdd59c488f214fd60340a82b0a607673b5054f4c402c310d37d2bd96a11f4a5e57b8a4541ae5aeddb26004330aaa01188c071f91eb505c91e42d6161539f6
7
- data.tar.gz: a3bcc2698d7bab1219b11f6faec3047f104a2a1f6779cf150e7fce7b79653f17c661b1c7c8f8e24b794d932c9bbc4afc26d8a789dde71b016e2050feb6e54fd1
6
+ metadata.gz: 87faf37f38ce8599147a0bd240d2756a99226cced0c6e0faceb1a9df64e28835f3d41ea269c62377c829f96b20b60334d04332fa2552cdea016fa2a92f529c39
7
+ data.tar.gz: d42aa8a2b78cbf7eb278887a443aec027d69aa2d26207a47894116f0bc3370e7e973d0bb5eb39f8a2f4a6209f09abac5f18feba95ffcf11ef122a3531635a223
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 1.0.11
2
+
3
+ * Switch back to default Faraday encoder and change list-records call to POST
4
+
5
+ # 1.0.10
6
+
7
+ * No longer compatible with Faraday < 1
8
+
1
9
  # 1.0.9
2
10
 
3
11
  * Faraday 2 compatibility round 2 (#90)
data/airrecord.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
  spec.required_ruby_version = ">= 2.2"
23
23
 
24
- spec.add_dependency "faraday", [">= 0.10", "< 3.0"]
24
+ spec.add_dependency "faraday", [">= 1.0", "< 3.0"]
25
25
  spec.add_dependency "net-http-persistent"
26
26
  spec.add_dependency "faraday-net_http_persistent"
27
27
 
@@ -1,9 +1,11 @@
1
1
  require 'airrecord'
2
2
 
3
+ p Faraday::VERSION
4
+
3
5
  Tea = Airrecord.table(
4
6
  ENV["AIRTABLE_TOKEN"],
5
7
  "appZJC9q8TBYPDF7j",
6
8
  "Teas"
7
9
  )
8
10
 
9
- p Tea.all
11
+ # p Tea.all
@@ -1,5 +1,3 @@
1
- require 'uri'
2
- require_relative 'query_string'
3
1
  require_relative 'faraday_rate_limiter'
4
2
 
5
3
  module Airrecord
@@ -21,9 +19,7 @@ module Airrecord
21
19
  headers: {
22
20
  "Authorization" => "Bearer #{api_key}",
23
21
  "User-Agent" => "Airrecord/#{Airrecord::VERSION}",
24
- "X-API-VERSION" => "0.1.0",
25
22
  },
26
- request: { params_encoder: Airrecord::QueryString }
27
23
  ) do |conn|
28
24
  if Airrecord.throttle?
29
25
  conn.request :airrecord_rate_limiter, requests_per_second: AIRTABLE_RPS_LIMIT
@@ -33,7 +29,7 @@ module Airrecord
33
29
  end
34
30
 
35
31
  def escape(*args)
36
- QueryString.escape(*args)
32
+ CGI.escape(*args)
37
33
  end
38
34
 
39
35
  def parse(body)
@@ -76,8 +76,8 @@ module Airrecord
76
76
  options[:maxRecords] = max_records if max_records
77
77
  options[:pageSize] = page_size if page_size
78
78
 
79
- path = "/v0/#{base_key}/#{client.escape(table_name)}"
80
- response = client.connection.get(path, options)
79
+ path = "/v0/#{base_key}/#{client.escape(table_name)}/listRecords"
80
+ response = client.connection.post(path, options.to_json, { 'Content-Type' => 'application/json' })
81
81
  parsed_response = client.parse(response.body)
82
82
 
83
83
  if response.success?
@@ -1,3 +1,3 @@
1
1
  module Airrecord
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airrecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Eskildsen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.10'
19
+ version: '1.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.10'
29
+ version: '1.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'
@@ -135,7 +135,6 @@ files:
135
135
  - lib/airrecord.rb
136
136
  - lib/airrecord/client.rb
137
137
  - lib/airrecord/faraday_rate_limiter.rb
138
- - lib/airrecord/query_string.rb
139
138
  - lib/airrecord/table.rb
140
139
  - lib/airrecord/version.rb
141
140
  homepage: https://github.com/sirupsen/airrecord
@@ -157,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
156
  - !ruby/object:Gem::Version
158
157
  version: '0'
159
158
  requirements: []
160
- rubygems_version: 3.3.3
159
+ rubygems_version: 3.2.3
161
160
  signing_key:
162
161
  specification_version: 4
163
162
  summary: Airtable client
@@ -1,45 +0,0 @@
1
- require 'erb'
2
-
3
- module Airrecord
4
- # Airtable expects that arrays in query strings be encoded with indices.
5
- # Faraday follows Rack conventions and encodes arrays _without_ indices.
6
- #
7
- # Airrecord::QueryString is a Faraday-compliant params_encoder that follows
8
- # the Airtable spec.
9
- module QueryString
10
- def self.encode(params)
11
- params.map { |key, val| Encodings[val].call(key, val) }.join('&')
12
- end
13
-
14
- def self.decode(query)
15
- Faraday::NestedParamsEncoder.decode(query)
16
- end
17
-
18
- def self.escape(*query)
19
- query.map { |qs| ERB::Util.url_encode(qs) }.join('')
20
- end
21
-
22
- module Encodings
23
- def self.[](value)
24
- TYPES.fetch(value.class, DEFAULT)
25
- end
26
-
27
- TYPES = {
28
- Array => lambda do |prefix, array|
29
- array.each_with_index.map do |value, index|
30
- self[value].call("#{prefix}[#{index}]", value)
31
- end
32
- end,
33
- Hash => lambda do |prefix, hash|
34
- hash.map do |key, value|
35
- self[value].call("#{prefix}[#{key}]", value)
36
- end
37
- end
38
- }.freeze
39
-
40
- DEFAULT = lambda do |key, value|
41
- "#{QueryString.escape(key)}=#{QueryString.escape(value)}"
42
- end
43
- end
44
- end
45
- end