fmrest-core 0.17.0.rc1 → 0.18.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312c477604d1cd806fd0e403222baf2485409ee15774b9b0a94da22dee585435
4
- data.tar.gz: 2d229e1b3ad0ef228868c6298964a43e0a22ada7e23c8e00aa7d6b8b9be75e98
3
+ metadata.gz: 41dc491640fb564e4c8fd798a66e86411f24e9e31c9b10cd233ff280d488ee3e
4
+ data.tar.gz: 0c0e7e91983fdab51ed16657a42b5c7ac92beb4afc6028689732b202a3535129
5
5
  SHA512:
6
- metadata.gz: aad3c75eb9841885c78f9f0ed583ffc321eb66b1c2437181d84760cb44e52f4d27a3e4ce7d1c30c1697f77b36506075d98e3c925962ba90669198961497567a9
7
- data.tar.gz: '0826d82c0a298a5a6ab0aec9f8fc582f73279d19e770080614f4faef368b21d646df33ac6065cf373ccd9e13e9ee6e2feefc66a3367e587883cfbd631dc52698'
6
+ metadata.gz: dbc7f99b2de4af84ddfca9978e51d187bfa2f94af1ac09745c7e14b3fd60c0b4a4eb492172a686e2a1f3419dacf7af6228a02b1dc7b0e40b2437f529e46b1254
7
+ data.tar.gz: f6ebda3cfdac93c5c0188fbf2a099619075396a5f9e9c507c390985ccc56ae5d6fb72dd6ddec155d01c3d04ba1bbe9d28fc0295e36f97b0ac864312de6047181
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.18.0
4
+
5
+ * Better support for portals with mismatching field qualifiers
6
+ * Defining an attribute on a model that would collide with an existing method
7
+ now raises an error
8
+
9
+ ### 0.17.1
10
+
11
+ * Fixed crash when `fmid_token` is set but `username` isn't
12
+
3
13
  ### 0.17.0
4
14
 
5
15
  * Added support for Claris ID token login
data/README.md CHANGED
@@ -543,6 +543,10 @@ class LoggyBee < FmRest::Layout
543
543
  end
544
544
  ```
545
545
 
546
+ ## Gotchas
547
+
548
+ Read about unexpected scenarios in the [gotchas doc](docs/Gotchas.md).
549
+
546
550
  ## API implementation completeness table
547
551
 
548
552
  FM Data API reference: https://fmhelp.filemaker.com/docs/18/en/dataapi/
@@ -100,7 +100,13 @@ module FmRest
100
100
  # Strip the host part to just the hostname (i.e. no scheme or port)
101
101
  host = @settings.host!
102
102
  host = URI(host).hostname if host =~ /\Ahttps?:\/\//
103
- "#{host}:#{@settings.database!}:#{@settings.username!}"
103
+ identity_segment = if fmid_token = @settings.fmid_token
104
+ require "digest"
105
+ Digest::SHA256.hexdigest(fmid_token)
106
+ else
107
+ @settings.username!
108
+ end
109
+ "#{host}:#{@settings.database!}:#{identity_segment}"
104
110
  end
105
111
  end
106
112
 
@@ -8,6 +8,8 @@ module FmRest
8
8
  # See https://help.claris.com/en/pro-help/content/finding-text.html
9
9
  FM_FIND_OPERATORS_RE = /([@\*#\?!=<>"])/
10
10
 
11
+ FULLY_QUALIFIED_FIELD_NAME_MATCHER = /\A[^:]+::[^:]+\Z/.freeze
12
+
11
13
  # Converts custom script options to a hash with the Data API's expected
12
14
  # JSON script format.
13
15
  #
@@ -104,6 +106,18 @@ module FmRest
104
106
  s.gsub(FM_FIND_OPERATORS_RE, "\\\\\\1")
105
107
  end
106
108
 
109
+ # Returns whether the given FileMaker field name is a fully-qualified
110
+ # name. In other words, whether it contains the string "::".
111
+ #
112
+ # Note that this is a simple naive check which doesn't account for
113
+ # invalid field names.
114
+ #
115
+ # @param field_name [String] The field name to test
116
+ # @return [Boolean] Whether the field is a FQN
117
+ def is_fully_qualified?(field_name)
118
+ FULLY_QUALIFIED_FIELD_NAME_MATCHER === field_name.to_s
119
+ end
120
+
107
121
  private
108
122
 
109
123
  def convert_script_arguments(script_arguments, suffix = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.17.0.rc1"
4
+ VERSION = "0.18.0.rc2"
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.17.0.rc1
4
+ version: 0.18.0.rc2
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-07-26 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday