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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41dc491640fb564e4c8fd798a66e86411f24e9e31c9b10cd233ff280d488ee3e
4
- data.tar.gz: 0c0e7e91983fdab51ed16657a42b5c7ac92beb4afc6028689732b202a3535129
3
+ metadata.gz: 9070ffa50e9886a1c1a46c91575c3252469ea22423bbc0658d0b4c86f325c1ac
4
+ data.tar.gz: 29b2bfef12c6352492aa3fbb5f19031aaf263e39dacc3e334bf6470df07de7e7
5
5
  SHA512:
6
- metadata.gz: dbc7f99b2de4af84ddfca9978e51d187bfa2f94af1ac09745c7e14b3fd60c0b4a4eb492172a686e2a1f3419dacf7af6228a02b1dc7b0e40b2437f529e46b1254
7
- data.tar.gz: f6ebda3cfdac93c5c0188fbf2a099619075396a5f9e9c507c390985ccc56ae5d6fb72dd6ddec155d01c3d04ba1bbe9d28fc0295e36f97b0ac864312de6047181
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
 
@@ -8,7 +8,8 @@ module FmRest
8
8
  BASE_PATH = "/fmi/data/v1"
9
9
  DATABASES_PATH = "#{BASE_PATH}/databases"
10
10
 
11
- AUTH_HEADERS = { "Content-Type" => "application/json" }.freeze
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, { headers: AUTH_HEADERS }) do |conn|
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
- # https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help/error-codes.html
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.18.0.rc2"
4
+ VERSION = "0.18.0.rc3"
5
5
  end
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.rc2
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-02 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday