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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/airrecord/client.rb +1 -5
- data/lib/airrecord/table.rb +2 -2
- data/lib/airrecord/version.rb +1 -1
- metadata +3 -4
- data/lib/airrecord/query_string.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 822d1414500650adcb7973b15f14a80abbacff9b950111f2d43eb814302c482e
|
4
|
+
data.tar.gz: ffa9215e1b8af1e052fe56f4c666bbacb5f3c953b040a321e22c2a24b102497c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87faf37f38ce8599147a0bd240d2756a99226cced0c6e0faceb1a9df64e28835f3d41ea269c62377c829f96b20b60334d04332fa2552cdea016fa2a92f529c39
|
7
|
+
data.tar.gz: d42aa8a2b78cbf7eb278887a443aec027d69aa2d26207a47894116f0bc3370e7e973d0bb5eb39f8a2f4a6209f09abac5f18feba95ffcf11ef122a3531635a223
|
data/CHANGELOG.md
CHANGED
data/lib/airrecord/client.rb
CHANGED
@@ -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
|
-
|
32
|
+
CGI.escape(*args)
|
37
33
|
end
|
38
34
|
|
39
35
|
def parse(body)
|
data/lib/airrecord/table.rb
CHANGED
@@ -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.
|
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?
|
data/lib/airrecord/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|