fmrest-core 0.18.0.rc2 → 0.18.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/fmrest/v1/connection.rb +6 -5
- data/lib/fmrest/v1/raise_errors.rb +2 -3
- data/lib/fmrest/version.rb +1 -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: 9070ffa50e9886a1c1a46c91575c3252469ea22423bbc0658d0b4c86f325c1ac
|
4
|
+
data.tar.gz: 29b2bfef12c6352492aa3fbb5f19031aaf263e39dacc3e334bf6470df07de7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65ea5b666e2debed130714df05a9275e991e8127d17d44dbee94a4651a05394472ab1381e1bbf35551648234a6d3c6c174fcc4fe8025ec45148bcc27a5aef495
|
7
|
+
data.tar.gz: bfdc063f4701eb03ed3f8e2edc7c9b2131cb6cc82175c88462debdd67891050fd53dfa160f47f35323809d6860d4a89ec341d8116791cae6d4e69b900b7715af
|
data/CHANGELOG.md
CHANGED
@@ -3,8 +3,11 @@
|
|
3
3
|
### 0.18.0
|
4
4
|
|
5
5
|
* Better support for portals with mismatching field qualifiers
|
6
|
+
* Better ergonomics for script execution, improved documentation
|
6
7
|
* Defining an attribute on a model that would collide with an existing method
|
7
8
|
now raises an error
|
9
|
+
* Cleared Faraday deprecation messages on authentication methods
|
10
|
+
* Added fmrest-ruby/VERSION to User-Agent headers
|
8
11
|
|
9
12
|
### 0.17.1
|
10
13
|
|
data/lib/fmrest/v1/connection.rb
CHANGED
@@ -8,7 +8,8 @@ module FmRest
|
|
8
8
|
BASE_PATH = "/fmi/data/v1"
|
9
9
|
DATABASES_PATH = "#{BASE_PATH}/databases"
|
10
10
|
|
11
|
-
|
11
|
+
DEFAULT_HEADERS = { "User-Agent" => "fmrest-ruby/#{::FmRest::VERSION} Faraday/#{::Faraday::VERSION}" }.freeze
|
12
|
+
AUTH_CONNECTION_HEADERS = DEFAULT_HEADERS.merge("Content-Type" => "application/json").freeze
|
12
13
|
CLARIS_ID_HTTP_AUTH_TYPE = "FMID"
|
13
14
|
|
14
15
|
# Builds a complete DAPI Faraday connection with middleware already
|
@@ -21,7 +22,7 @@ module FmRest
|
|
21
22
|
def build_connection(settings = FmRest.default_connection_settings, &block)
|
22
23
|
settings = ConnectionSettings.wrap(settings)
|
23
24
|
|
24
|
-
base_connection(settings) do |conn|
|
25
|
+
base_connection(settings, headers: DEFAULT_HEADERS) do |conn|
|
25
26
|
conn.use RaiseErrors
|
26
27
|
conn.use TokenSession, settings
|
27
28
|
|
@@ -56,13 +57,13 @@ module FmRest
|
|
56
57
|
def auth_connection(settings = FmRest.default_connection_settings)
|
57
58
|
settings = ConnectionSettings.wrap(settings)
|
58
59
|
|
59
|
-
base_connection(settings,
|
60
|
+
base_connection(settings, headers: AUTH_CONNECTION_HEADERS) do |conn|
|
60
61
|
conn.use RaiseErrors
|
61
62
|
|
62
63
|
if settings.fmid_token?
|
63
|
-
conn.authorization CLARIS_ID_HTTP_AUTH_TYPE, settings.fmid_token
|
64
|
+
conn.request :authorization, CLARIS_ID_HTTP_AUTH_TYPE, settings.fmid_token
|
64
65
|
else
|
65
|
-
conn.basic_auth settings.username!, settings.password!
|
66
|
+
conn.request :basic_auth, settings.username!, settings.password!
|
66
67
|
end
|
67
68
|
|
68
69
|
if settings.log
|
@@ -5,10 +5,9 @@ module FmRest
|
|
5
5
|
# FM Data API response middleware for raising exceptions on API response
|
6
6
|
# errors
|
7
7
|
#
|
8
|
-
# https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help/error-codes.html
|
9
|
-
#
|
10
8
|
class RaiseErrors < Faraday::Response::Middleware
|
11
|
-
#
|
9
|
+
# Error codes reference:
|
10
|
+
# https://help.claris.com/en/pro-help/content/error-codes.html
|
12
11
|
ERROR_RANGES = {
|
13
12
|
-1 => APIError::UnknownError,
|
14
13
|
100 => APIError::ResourceMissingError,
|
data/lib/fmrest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fmrest-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.0.
|
4
|
+
version: 0.18.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Carbajal
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|