fmrest-core 0.20.0.rc1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +10 -24
- 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: 1dcd50851dca459061ccd7a2f55a2b3dcadea27ed5aa91aa854fb23660747667
|
4
|
+
data.tar.gz: ee483bb0ded64cda1342d38a9afa97789e1bcc6b813602543787c049eea038b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5570a533c122bbfae3d3cbdbcee96bdf4ed1d3ebfe43691ec92acb0ed078a2b5badf0cf546afd2d6a9d877425203fefab737bf24594b92cf64639c66ebb51ba4
|
7
|
+
data.tar.gz: adbd2c191f65cc2a67f2db3b571f7c287c12eddbfd6c3c31e32a5d730b7d8ada2f61197c9e0df731aa748b1a2caa443ca3d17d16f483437107d16fc4440c6f79
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/fmrest.svg?style=flat)](https://rubygems.org/gems/fmrest)
|
4
4
|
![CI](https://github.com/beezwax/fmrest-ruby/workflows/CI/badge.svg)
|
5
5
|
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/beezwax/fmrest-ruby)
|
6
|
+
[![Powered by Beezwax](https://img.shields.io/badge/Powered%20By-Beezwax-gold?logo=data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD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MTMuMjI0OEw1MC42IDAuNjI0ODQ1QzQ4LjEgLTAuNjc1MTU1IDQ1LjUgMC40MjQ4NDUgNDUuMyAwLjYyNDg0NUwyMy4xIDEzLjMyNDhIMjIuOVoiIGZpbGw9IiNGRkQ5MzkiPjwvcGF0aD4NCiAgICAgIDxwYXRoIGQ9Ik0wLjEgMzEuNTI0NFY3OC4yMjQ0QzAuMSA4MC44MjQ0IDIuMiA4Mi4zMjQ0IDIuNyA4Mi43MjQ0TDE0LjggODkuNjI0NEwxNy44IDkxLjMyNDRDMjQuNCA4NC43MjQ0IDI4LjQgNzYuMzI0NCAyOC41IDY3LjEyNDRDMjguNSA1MS41MjQ0IDE2LjggMzguMDI0NCAwIDMxLjUyNDRIMC4xWiIgZmlsbD0iI0ZGRDkzOSI+PC9wYXRoPg0KICAgPC9nPg0KPC9zdmc+)](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)
|
@@ -13,19 +14,8 @@ While pretty feature-rich, fmrest-ruby doesn't yet support 100% of FileMaker
|
|
13
14
|
table](#api-implementation-completeness-table) to check if a feature you need
|
14
15
|
is natively supported by the gem.
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
* [Gems](#gems)
|
19
|
-
* [Installation](#installation)
|
20
|
-
* [Simple example](#simple-example)
|
21
|
-
* [Connection settings](#connection-settings)
|
22
|
-
* [Session token store](#session-token-store)
|
23
|
-
* [Date fields and timezones](#date-fields-and-timezones)
|
24
|
-
* [ActiveRecord-like ORM (fmrest-spyke)](#activerecord-like-orm-fmrest-spyke)
|
25
|
-
* [Logging](#logging)
|
26
|
-
* [Gotchas](#gotchas)
|
27
|
-
* [API implementation completeness table](#api-implementation-completeness-table)
|
28
|
-
* [Supported Ruby versions](#supported-ruby-versions)
|
17
|
+
Need Ruby or FileMaker consulting? Contact us at
|
18
|
+
[Beezwax.net](https://beezwax.net/)
|
29
19
|
|
30
20
|
## Gems
|
31
21
|
|
@@ -121,7 +111,8 @@ to, for instance, disable SSL verification:
|
|
121
111
|
{
|
122
112
|
host: "…",
|
123
113
|
…
|
124
|
-
ssl: { verify: false }
|
114
|
+
ssl: { verify: false },
|
115
|
+
proxy: "http://user:password@proxy.host:4321"
|
125
116
|
}
|
126
117
|
```
|
127
118
|
|
@@ -132,13 +123,13 @@ You can also pass a `:log` option for basic request logging, see the section on
|
|
132
123
|
|
133
124
|
Option | Description | Format | Default
|
134
125
|
--------------------|--------------------------------------------|-----------------------------|--------
|
135
|
-
`:host` | Hostname with optional port, e.g. `
|
126
|
+
`:host` | Hostname with optional port, e.g. `example.com:9000` | String | None
|
136
127
|
`:database` | The name of the database to connect to | String | None
|
137
128
|
`:username` | A Data API-ready account | String | None
|
138
129
|
`:password` | Your password | String | None
|
139
130
|
`:account_name` | Alias of `:username` | String | None
|
140
|
-
`:ssl` | SSL options to be forwarded to Faraday | Faraday SSL options
|
141
|
-
`: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
|
142
133
|
`:log` | Log JSON responses to STDOUT | Boolean | `false`
|
143
134
|
`:log_level` | Which log level to log into | Values accepted by `Logger#level=` | `:debug`
|
144
135
|
`:coerce_dates` | See section on [date fields](#date-fields-and-timezones) | Boolean \| `:hybrid` \| `:full` | `false`
|
@@ -558,13 +549,8 @@ FM Data API reference: https://help.claris.com/en/data-api-guide/
|
|
558
549
|
|
559
550
|
## Supported Ruby versions
|
560
551
|
|
561
|
-
fmrest-ruby
|
562
|
-
|
563
|
-
|
564
|
-
* Ruby 2.5
|
565
|
-
* Ruby 2.6
|
566
|
-
* Ruby 2.7
|
567
|
-
* 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.
|
568
554
|
|
569
555
|
## Gem development
|
570
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
|
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: '0'
|
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
|