fmrest-core 0.20.0 → 0.21.0.rc1
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 +4 -4
- data/README.md +8 -25
- data/lib/fmrest/v1/connection.rb +1 -1
- data/lib/fmrest/v1/container_fields.rb +2 -2
- data/lib/fmrest/v1/raise_errors.rb +1 -1
- data/lib/fmrest/v1/type_coercer.rb +1 -1
- data/lib/fmrest/version.rb +1 -1
- data/lib/fmrest.rb +6 -5
- metadata +8 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2404b4260deeceb47d94995c5952a87a5e012138f7b5700995e8554f82278d94
|
4
|
+
data.tar.gz: 48b31d91a7017d1d4c1c27ab006d09855fd110ebb8b09babb8ad99e653450e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7dcc78c4eebaa745b7b49c0d3cf05d1ac954d759f38ee906bd3cb45e0f73d68b4fec8e0c66c837f7ca1539d3d87881b58980517c514520ab2a18df7473d6d4
|
7
|
+
data.tar.gz: d4d403552c87f7f6a735fc76b613300818640f15135e567bd5e528c61cac14146dff4c4794d5d01a0d15d7db1816fd221a38456ed2ebb838373310760c6b3a63
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[](https://rubygems.org/gems/fmrest)
|
4
4
|

|
5
5
|
[](https://rubydoc.info/github/beezwax/fmrest-ruby)
|
6
|
+
[](https://beezwax.net/)
|
6
7
|
|
7
8
|
A Ruby client for
|
8
9
|
[FileMaker's Data API](https://help.claris.com/en/data-api-guide)
|
@@ -16,20 +17,6 @@ is natively supported by the gem.
|
|
16
17
|
Need Ruby or FileMaker consulting? Contact us at
|
17
18
|
[Beezwax.net](https://beezwax.net/)
|
18
19
|
|
19
|
-
## Contents
|
20
|
-
|
21
|
-
* [Gems](#gems)
|
22
|
-
* [Installation](#installation)
|
23
|
-
* [Simple example](#simple-example)
|
24
|
-
* [Connection settings](#connection-settings)
|
25
|
-
* [Session token store](#session-token-store)
|
26
|
-
* [Date fields and timezones](#date-fields-and-timezones)
|
27
|
-
* [ActiveRecord-like ORM (fmrest-spyke)](#activerecord-like-orm-fmrest-spyke)
|
28
|
-
* [Logging](#logging)
|
29
|
-
* [Gotchas](#gotchas)
|
30
|
-
* [API implementation completeness table](#api-implementation-completeness-table)
|
31
|
-
* [Supported Ruby versions](#supported-ruby-versions)
|
32
|
-
|
33
20
|
## Gems
|
34
21
|
|
35
22
|
The `fmrest` gem is a wrapper for two other gems:
|
@@ -124,7 +111,8 @@ to, for instance, disable SSL verification:
|
|
124
111
|
{
|
125
112
|
host: "…",
|
126
113
|
…
|
127
|
-
ssl: { verify: false }
|
114
|
+
ssl: { verify: false },
|
115
|
+
proxy: "http://user:password@proxy.host:4321"
|
128
116
|
}
|
129
117
|
```
|
130
118
|
|
@@ -135,13 +123,13 @@ You can also pass a `:log` option for basic request logging, see the section on
|
|
135
123
|
|
136
124
|
Option | Description | Format | Default
|
137
125
|
--------------------|--------------------------------------------|-----------------------------|--------
|
138
|
-
`:host` | Hostname with optional port, e.g. `
|
126
|
+
`:host` | Hostname with optional port, e.g. `example.com:9000` | String | None
|
139
127
|
`:database` | The name of the database to connect to | String | None
|
140
128
|
`:username` | A Data API-ready account | String | None
|
141
129
|
`:password` | Your password | String | None
|
142
130
|
`:account_name` | Alias of `:username` | String | None
|
143
|
-
`:ssl` | SSL options to be forwarded to Faraday | Faraday SSL options
|
144
|
-
`:proxy` | Proxy URI e.g. `http://
|
131
|
+
`:ssl` | SSL options to be forwarded to Faraday | [Faraday SSL options](https://www.rubydoc.info/gems/faraday/Faraday/SSLOptions) hash | None
|
132
|
+
`:proxy` | Proxy URI, e.g. `http://user:password@proxy.host:4321` | String | None
|
145
133
|
`:log` | Log JSON responses to STDOUT | Boolean | `false`
|
146
134
|
`:log_level` | Which log level to log into | Values accepted by `Logger#level=` | `:debug`
|
147
135
|
`:coerce_dates` | See section on [date fields](#date-fields-and-timezones) | Boolean \| `:hybrid` \| `:full` | `false`
|
@@ -561,13 +549,8 @@ FM Data API reference: https://help.claris.com/en/data-api-guide/
|
|
561
549
|
|
562
550
|
## Supported Ruby versions
|
563
551
|
|
564
|
-
fmrest-ruby
|
565
|
-
|
566
|
-
|
567
|
-
* Ruby 2.5
|
568
|
-
* Ruby 2.6
|
569
|
-
* Ruby 2.7
|
570
|
-
* Ruby 3.0
|
552
|
+
fmrest-ruby is [tested against](https://github.com/beezwax/fmrest-ruby/actions?query=workflow%3ACI)
|
553
|
+
Ruby 2.6 through 3.1.
|
571
554
|
|
572
555
|
## Gem development
|
573
556
|
|
data/lib/fmrest/v1/connection.rb
CHANGED
@@ -72,7 +72,7 @@ module FmRest
|
|
72
72
|
elsif is_cloud_host
|
73
73
|
conn.request :authorization, CLARIS_ID_HTTP_AUTH_TYPE, -> { Cloud::ClarisIdTokenManager.new(settings).fetch_token }
|
74
74
|
else
|
75
|
-
conn.request :
|
75
|
+
conn.request :authorization, :basic, settings.username!, settings.password!
|
76
76
|
end
|
77
77
|
|
78
78
|
if settings.log
|
@@ -80,11 +80,11 @@ module FmRest
|
|
80
80
|
|
81
81
|
connection.post do |request|
|
82
82
|
request.url container_path
|
83
|
-
request.headers['Content-Type'] = ::Faraday::
|
83
|
+
request.headers['Content-Type'] = ::Faraday::Multipart::Middleware.mime_type
|
84
84
|
|
85
85
|
filename = options[:filename] || filename_or_io.try(:original_filename)
|
86
86
|
|
87
|
-
request.body = { upload: Faraday::
|
87
|
+
request.body = { upload: Faraday::Multipart::FilePart.new(filename_or_io, content_type, filename) }
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -5,7 +5,7 @@ module FmRest
|
|
5
5
|
# FM Data API response middleware for raising exceptions on API response
|
6
6
|
# errors
|
7
7
|
#
|
8
|
-
class RaiseErrors < Faraday::
|
8
|
+
class RaiseErrors < Faraday::Middleware
|
9
9
|
# Error codes reference:
|
10
10
|
# https://help.claris.com/en/pro-help/content/error-codes.html
|
11
11
|
ERROR_RANGES = {
|
@@ -4,7 +4,7 @@ require "fmrest/string_date"
|
|
4
4
|
|
5
5
|
module FmRest
|
6
6
|
module V1
|
7
|
-
class TypeCoercer < Faraday::
|
7
|
+
class TypeCoercer < Faraday::Middleware
|
8
8
|
# We use this date to represent a FileMaker time for consistency with
|
9
9
|
# ginjo-rfm
|
10
10
|
JULIAN_ZERO_DAY = "-4712/1/1"
|
data/lib/fmrest/version.rb
CHANGED
data/lib/fmrest.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "faraday"
|
4
|
-
require "
|
4
|
+
require "faraday/multipart"
|
5
5
|
|
6
6
|
require "fmrest/version"
|
7
7
|
require "fmrest/connection_settings"
|
8
8
|
require "fmrest/errors"
|
9
9
|
|
10
10
|
module FmRest
|
11
|
-
autoload :V1,
|
12
|
-
autoload :TokenStore,
|
13
|
-
autoload :Spyke,
|
14
|
-
autoload :Layout,
|
11
|
+
autoload :V1, "fmrest/v1"
|
12
|
+
autoload :TokenStore, "fmrest/token_store"
|
13
|
+
autoload :Spyke, "fmrest/spyke"
|
14
|
+
autoload :Layout, "fmrest/spyke"
|
15
|
+
autoload :StringDateAwareness, "fmrest/string_date"
|
15
16
|
|
16
17
|
class << self
|
17
18
|
attr_accessor :token_store
|
metadata
CHANGED
@@ -1,23 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fmrest-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.21.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Carbajal
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.8.0
|
20
|
-
- - "<"
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: '2.0'
|
23
20
|
type: :runtime
|
@@ -25,31 +22,22 @@ dependencies:
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.8.0
|
30
|
-
- - "<"
|
31
25
|
- !ruby/object:Gem::Version
|
32
26
|
version: '2.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: faraday-multipart
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0
|
40
|
-
- - "<"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '2.0'
|
33
|
+
version: '0'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
38
|
- - ">="
|
48
39
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0
|
50
|
-
- - "<"
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '2.0'
|
40
|
+
version: '0'
|
53
41
|
description: fmrest-core is a FileMaker Data API client built with Faraday. It handles
|
54
42
|
authentication as well as providing many utilities for working with the Data API.
|
55
43
|
An ORM library built on top of fmrest-core is also available.
|
@@ -104,11 +92,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
92
|
version: '0'
|
105
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
94
|
requirements:
|
107
|
-
- - "
|
95
|
+
- - ">"
|
108
96
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
97
|
+
version: 1.3.1
|
110
98
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.3.3
|
112
100
|
signing_key:
|
113
101
|
specification_version: 4
|
114
102
|
summary: FileMaker Data API client using Faraday, core library
|