airrecord 1.0.10 → 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: 2140fe15354970d81a69ca08eccffeae0b01bdb2b479f90081cca5304438fbd2
4
- data.tar.gz: 76ce4af2fb471aa3a04e95b7e03481c9421120b5a5875afa5c3c1aa9d4b2dc00
3
+ metadata.gz: 822d1414500650adcb7973b15f14a80abbacff9b950111f2d43eb814302c482e
4
+ data.tar.gz: ffa9215e1b8af1e052fe56f4c666bbacb5f3c953b040a321e22c2a24b102497c
5
5
  SHA512:
6
- metadata.gz: f8817c39c254feb9cefe90305193954e689d949014bc348b4d2a053e4b850244781cd571f376e10a5b5f70d3b8db2b1bb6a4ede2eac5758293bb021baaabdc26
7
- data.tar.gz: df2f9499f1cf610bce130acad4d498453bcc6ecb0da2b204eac0ba471132267ec39c4b9449e44ed2a19c05462b871c081aefe332e808d18cb244f41bdad27b25
6
+ metadata.gz: 87faf37f38ce8599147a0bd240d2756a99226cced0c6e0faceb1a9df64e28835f3d41ea269c62377c829f96b20b60334d04332fa2552cdea016fa2a92f529c39
7
+ data.tar.gz: d42aa8a2b78cbf7eb278887a443aec027d69aa2d26207a47894116f0bc3370e7e973d0bb5eb39f8a2f4a6209f09abac5f18feba95ffcf11ef122a3531635a223
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.11
2
+
3
+ * Switch back to default Faraday encoder and change list-records call to POST
4
+
1
5
  # 1.0.10
2
6
 
3
7
  * No longer compatible with Faraday < 1
@@ -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.10"
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.10
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-04-24 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
@@ -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