fmrest 0.5.0 → 0.5.1
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/CHANGELOG.md +5 -0
- data/README.md +46 -12
- data/fmrest.gemspec +1 -0
- data/lib/fmrest/v1/connection.rb +4 -2
- data/lib/fmrest/v1/token_session.rb +3 -1
- data/lib/fmrest/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79fff3279b30b2bf4ba228646218abc622366aa97f48b1a60eee06d1cea249c8
|
4
|
+
data.tar.gz: a7b9c8fb36117733176ec355e6e80ef6981ee0e990f1b42fb5721a0baca46ff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e38235d837ddd968164256c78f64bab77ed9464c2f33ee69d4e4f5920d093eeea082b0547f544edc409c5416d470bdd13998b42cb1ac2c501a2f485709ff5a5
|
7
|
+
data.tar.gz: 813305093670cbe0a684f0d63d079e9a5d799373521099d6229cf22a4cf34d3107167ac5a6b8750bf6abd410bc24f89fd84ea7aacf040e696c8196e57d8f21b4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,19 +3,17 @@
|
|
3
3
|
<a href="https://rubygems.org/gems/fmrest"><img src="https://badge.fury.io/rb/fmrest.svg?style=flat" alt="Gem Version"></a>
|
4
4
|
|
5
5
|
A Ruby client for
|
6
|
-
[FileMaker
|
6
|
+
[FileMaker 18's Data API](https://fmhelp.filemaker.com/docs/18/en/dataapi/)
|
7
7
|
using
|
8
8
|
[Faraday](https://github.com/lostisland/faraday) and with optional
|
9
9
|
[Spyke](https://github.com/balvig/spyke) support (ActiveRecord-ish models).
|
10
10
|
|
11
|
-
FileMaker 16's Data API is not supported (but you shouldn't be using it
|
12
|
-
anyway).
|
13
|
-
|
14
11
|
If you're looking for a Ruby client for the legacy XML/Custom Web Publishing
|
15
12
|
API try the fabulous [ginjo-rfm gem](https://github.com/ginjo/rfm) instead.
|
16
13
|
|
17
|
-
fmrest-ruby
|
18
|
-
|
14
|
+
fmrest-ruby only partially implements FileMaker 18's Data API.
|
15
|
+
See the [implementation completeness table](#api-implementation-completeness-table)
|
16
|
+
to see if a feature you need is natively supported by the gem.
|
19
17
|
|
20
18
|
## Installation
|
21
19
|
|
@@ -24,11 +22,11 @@ Add this line to your Gemfile:
|
|
24
22
|
```ruby
|
25
23
|
gem 'fmrest'
|
26
24
|
|
27
|
-
# Optional (for ORM features)
|
25
|
+
# Optional but recommended (for ORM features)
|
28
26
|
gem 'spyke'
|
29
27
|
```
|
30
28
|
|
31
|
-
## Basic usage
|
29
|
+
## Basic usage (without ORM)
|
32
30
|
|
33
31
|
To get a Faraday connection that can handle FM's Data API auth workflow:
|
34
32
|
|
@@ -79,9 +77,12 @@ FmRest::V1.build_connection(
|
|
79
77
|
)
|
80
78
|
```
|
81
79
|
|
82
|
-
You can
|
80
|
+
You can also pass a `:log` option for basic request logging, see the section on
|
83
81
|
[Logging](#Logging) below.
|
84
82
|
|
83
|
+
`:username` is also aliased as `:account_name` to provide cross-compatibility
|
84
|
+
with the ginjo-rfm gem.
|
85
|
+
|
85
86
|
### Default connection settings
|
86
87
|
|
87
88
|
If you're only connecting to a single FM database you can configure it globally
|
@@ -234,13 +235,15 @@ class Honeybee < FmRest::Spyke::Base
|
|
234
235
|
end
|
235
236
|
```
|
236
237
|
|
237
|
-
In this case you can pass the `fmrest_config` hash as an
|
238
|
+
In this case you can pass the [`fmrest_config`](#modelfmrest_config) hash as an
|
239
|
+
argument to `Base()`:
|
238
240
|
|
239
241
|
```ruby
|
240
242
|
class Honeybee < FmRest::Spyke::Base(host: "...", database: "...", username: "...", password: "...")
|
241
243
|
end
|
242
244
|
|
243
|
-
Honeybee.fmrest_config
|
245
|
+
Honeybee.fmrest_config
|
246
|
+
# => { host: "...", database: "...", username: "...", password: "..." }
|
244
247
|
```
|
245
248
|
|
246
249
|
All of Spyke's basic ORM operations work:
|
@@ -839,6 +842,37 @@ class LoggyBee < FmRest::Spyke::Base
|
|
839
842
|
end
|
840
843
|
```
|
841
844
|
|
845
|
+
## API implementation completeness table
|
846
|
+
|
847
|
+
FM Data API reference: https://fmhelp.filemaker.com/docs/18/en/dataapi/
|
848
|
+
|
849
|
+
| FM 18 Data API feature | Supported by basic connection | Supported by FmRest::Spyke::Base |
|
850
|
+
|-------------------------------------|-------------------------------|----------------------------------|
|
851
|
+
| Log in using HTTP Basic Auth | Yes | Yes |
|
852
|
+
| Log in using OAuth | No | No |
|
853
|
+
| Log in to an external data source | No | No |
|
854
|
+
| Log in using a FileMaker ID account | No | No |
|
855
|
+
| Log out | Manual* | No |
|
856
|
+
| Get product information | Manual* | No |
|
857
|
+
| Get database names | Manual* | No |
|
858
|
+
| Get script names | Manual* | No |
|
859
|
+
| Get layout names | Manual* | No |
|
860
|
+
| Get layout metadata | Manual* | No |
|
861
|
+
| Create a record | Manual* | Yes |
|
862
|
+
| Edit a record | Manual* | Yes |
|
863
|
+
| Duplicate a record | Manual* | No |
|
864
|
+
| Delete a record | Manual* | Yes |
|
865
|
+
| Get a single record | Manual* | Yes |
|
866
|
+
| Get a range of records | Manual* | Yes |
|
867
|
+
| Get container data | Manual* | Yes |
|
868
|
+
| Upload container data | Manual* | Yes |
|
869
|
+
| Perform a find request | Manual* | Yes |
|
870
|
+
| Set global field values | Manual* | No |
|
871
|
+
| Run a script | Manual* | Yes |
|
872
|
+
| Run a script with another request | Manual* | Yes |
|
873
|
+
|
874
|
+
\* You can manually supply the URL and JSON to a `FmRest` connection.
|
875
|
+
|
842
876
|
## TODO
|
843
877
|
|
844
878
|
- [ ] Support for FM18 features
|
@@ -853,7 +887,7 @@ end
|
|
853
887
|
- [x] Specs
|
854
888
|
- [x] Support for portal data
|
855
889
|
|
856
|
-
##
|
890
|
+
## Gem development
|
857
891
|
|
858
892
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
859
893
|
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
data/fmrest.gemspec
CHANGED
data/lib/fmrest/v1/connection.rb
CHANGED
@@ -14,6 +14,10 @@ module FmRest
|
|
14
14
|
# error handling. A block can be optionally given for additional
|
15
15
|
# middleware configuration
|
16
16
|
#
|
17
|
+
# @option options [String] :username The username for DAPI authentication
|
18
|
+
# @option options [String] :account_name Alias of :username for
|
19
|
+
# compatibility with Rfm gem
|
20
|
+
# @option options [String] :password The password for DAPI authentication
|
17
21
|
# @option (see #base_connection)
|
18
22
|
# @return (see #base_connection)
|
19
23
|
def build_connection(options = FmRest.default_connection_settings, &block)
|
@@ -49,8 +53,6 @@ module FmRest
|
|
49
53
|
#
|
50
54
|
# @option options [String] :host The hostname for the FM server
|
51
55
|
# @option options [String] :database The FM database name
|
52
|
-
# @option options [String] :username The username for DAPI authentication
|
53
|
-
# @option options [String] :password The password for DAPI authentication
|
54
56
|
# @option options [String] :ssl SSL options to forward to the Faraday
|
55
57
|
# connection
|
56
58
|
# @option options [String] :proxy Proxy options to forward to the Faraday
|
@@ -96,7 +96,9 @@ module FmRest
|
|
96
96
|
|
97
97
|
def auth_connection
|
98
98
|
@auth_connection ||= V1.base_connection(@options) do |conn|
|
99
|
-
|
99
|
+
username = @options.fetch(:account_name) { @options.fetch(:username) }
|
100
|
+
|
101
|
+
conn.basic_auth username, @options.fetch(:password)
|
100
102
|
|
101
103
|
if @options[:log]
|
102
104
|
conn.response :logger, nil, bodies: true, headers: true
|
data/lib/fmrest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fmrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Carbajal
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -190,6 +190,20 @@ dependencies:
|
|
190
190
|
- - ">="
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: yard
|
195
|
+
requirement: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
type: :development
|
201
|
+
prerelease: false
|
202
|
+
version_requirements: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
193
207
|
description: FileMaker Data API client using Faraday, with optional ActiveRecord-like
|
194
208
|
ORM based on Spyke
|
195
209
|
email:
|