faithteams-api 2.0.2 → 4.0.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/.rubocop.yml +2 -0
- data/.tool-versions +2 -1
- data/CHANGELOG.md +32 -1
- data/Gemfile.lock +9 -12
- data/README.md +4 -1
- data/faithteams-api.gemspec +4 -1
- data/lib/faithteams/api/v2/connection.rb +1 -16
- data/lib/faithteams/api/v2/gateway.rb +0 -5
- data/lib/faithteams/api/v2/resource.rb +0 -1
- data/lib/faithteams/version.rb +1 -1
- data/thunder-tests/collections/tc_col_faithteams-api.json +1301 -0
- data/thunder-tests/collections/tc_col_faithteams-app.json +1189 -0
- data/thunder-tests/environments/tc_env_faithteams.json +5 -5
- data/thunder-tests/faithteams.env.template +0 -1
- metadata +51 -9
- data/lib/faithteams/api/v2/resource/user.rb +0 -40
- data/thunder-tests/collections/tc_col_faithteams.json +0 -2390
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afff0cd17cd9ca90fc5d06344b7f06b1a00c5c9cc59b847863b49250b9bb6370
|
|
4
|
+
data.tar.gz: 80ae0d53fe6c6f5ac4ed7fa5dffacd49eaa2344a7930a6a596f29afffc9d6886
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f2aad0a7290c1f4d0c4de4b4fdca861f384d4fbb46849d1797231af10d5648e832689d288c2456846af35b20f9716407d049f949f8f58624e847d5155059dde
|
|
7
|
+
data.tar.gz: cef29cf607a5fbc61daf9709818f7aab3db01d752323fcb51c31e8ca849ec87788d944bedc25f22058ab76c16f72354448c716202a38660d3edb8db5115f7143
|
data/.rubocop.yml
CHANGED
|
@@ -65,6 +65,8 @@ Layout/EmptyLinesAroundModuleBody:
|
|
|
65
65
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
66
66
|
Style/HashSyntax:
|
|
67
67
|
Enabled: true
|
|
68
|
+
EnforcedStyle: ruby19
|
|
69
|
+
EnforcedShorthandSyntax: never # Ruby 3.1 allows omission of value name, but we want to support prior Ruby versions
|
|
68
70
|
|
|
69
71
|
Layout/FirstArgumentIndentation:
|
|
70
72
|
Enabled: true
|
data/.tool-versions
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
ruby 3.
|
|
1
|
+
ruby 3.3.5
|
|
2
|
+
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,38 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
-
## [
|
|
10
|
+
## [4.0.1] - 2024-09-13
|
|
11
|
+
|
|
12
|
+
This version adds support for Ruby 3.3.5. No real changes were required. We just needed to add some gems to the gemspec
|
|
13
|
+
to silence deprecation warnings.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
1. Add dependencies which will be removed from a future version of Ruby. (IN-2512)
|
|
18
|
+
|
|
19
|
+
## [4.0.0] - 2024-09-11
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
1. Update ActiveSupport Version to support Rails 7. (IN-2109)
|
|
24
|
+
|
|
25
|
+
## [3.0.1] - 2024-09-09
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
1. Update dependencies to address security warnings. (IN-2494)
|
|
30
|
+
|
|
31
|
+
## [3.0.0] - 2024-05-21 - https://github.com/tithely/faithteams-api/pull/8
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
1. Use basic auth for all API requests and remove User. (IN-2429)
|
|
36
|
+
|
|
37
|
+
### Removed
|
|
38
|
+
|
|
39
|
+
1. Remove `Resource::User` and `Resource::User#authenticate`. (IN-2429)
|
|
40
|
+
|
|
41
|
+
## [2.0.2] - 2024-04-04 - https://github.com/tithely/faithteams-api/pull/5
|
|
11
42
|
|
|
12
43
|
### Fixed
|
|
13
44
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
faithteams-api (
|
|
5
|
-
activesupport (
|
|
4
|
+
faithteams-api (4.0.1)
|
|
5
|
+
activesupport (~> 7.0.8)
|
|
6
6
|
http (~> 5.1)
|
|
7
|
+
logger (~> 1.6.1)
|
|
8
|
+
ostruct (~> 0.6.0)
|
|
9
|
+
rexml (~> 3.3.6)
|
|
7
10
|
|
|
8
11
|
GEM
|
|
9
12
|
remote: https://rubygems.org/
|
|
10
13
|
specs:
|
|
11
|
-
activesupport (7.
|
|
12
|
-
base64
|
|
13
|
-
bigdecimal
|
|
14
|
+
activesupport (7.0.8.4)
|
|
14
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
15
|
-
connection_pool (>= 2.2.5)
|
|
16
|
-
drb
|
|
17
16
|
i18n (>= 1.6, < 2)
|
|
18
17
|
minitest (>= 5.1)
|
|
19
|
-
mutex_m
|
|
20
18
|
tzinfo (~> 2.0)
|
|
21
19
|
addressable (2.8.6)
|
|
22
20
|
public_suffix (>= 2.0.2, < 6.0)
|
|
@@ -26,14 +24,12 @@ GEM
|
|
|
26
24
|
byebug (11.1.3)
|
|
27
25
|
coderay (1.1.3)
|
|
28
26
|
concurrent-ruby (1.2.3)
|
|
29
|
-
connection_pool (2.4.1)
|
|
30
27
|
crack (1.0.0)
|
|
31
28
|
bigdecimal
|
|
32
29
|
rexml
|
|
33
30
|
diff-lcs (1.5.1)
|
|
34
31
|
docile (1.4.0)
|
|
35
32
|
domain_name (0.6.20240107)
|
|
36
|
-
drb (2.2.1)
|
|
37
33
|
ffi (1.16.3)
|
|
38
34
|
ffi-compiler (1.3.2)
|
|
39
35
|
ffi (>= 1.15.5)
|
|
@@ -73,14 +69,15 @@ GEM
|
|
|
73
69
|
llhttp-ffi (0.5.0)
|
|
74
70
|
ffi-compiler (~> 1.0)
|
|
75
71
|
rake (~> 13.0)
|
|
72
|
+
logger (1.6.1)
|
|
76
73
|
lumberjack (1.2.10)
|
|
77
74
|
method_source (1.0.0)
|
|
78
75
|
minitest (5.22.3)
|
|
79
|
-
mutex_m (0.2.0)
|
|
80
76
|
nenv (0.3.0)
|
|
81
77
|
notiffany (0.1.3)
|
|
82
78
|
nenv (~> 0.1)
|
|
83
79
|
shellany (~> 0.0)
|
|
80
|
+
ostruct (0.6.0)
|
|
84
81
|
parallel (1.24.0)
|
|
85
82
|
parser (3.3.0.5)
|
|
86
83
|
ast (~> 2.4.1)
|
|
@@ -96,7 +93,7 @@ GEM
|
|
|
96
93
|
rb-inotify (0.10.1)
|
|
97
94
|
ffi (~> 1.0)
|
|
98
95
|
regexp_parser (2.9.0)
|
|
99
|
-
rexml (3.
|
|
96
|
+
rexml (3.3.7)
|
|
100
97
|
rspec (3.13.0)
|
|
101
98
|
rspec-core (~> 3.13.0)
|
|
102
99
|
rspec-expectations (~> 3.13.0)
|
data/README.md
CHANGED
|
@@ -60,7 +60,10 @@ Use the Thunder Client extension for VS Code to test/inspect API calls.
|
|
|
60
60
|
|
|
61
61
|
General instructions for publishing a gem are available in this [RubyGems guide](https://guides.rubygems.org/publishing/#publishing-to-rubygemsorg).
|
|
62
62
|
|
|
63
|
-
Once a gem is ready to be published
|
|
63
|
+
Once a gem is ready to be published:
|
|
64
|
+
1. Create a PR to merge `master` into `production`
|
|
65
|
+
1. After merge, [create a release](https://github.com/tithely/faithteams-api/releases) on the `production` branch
|
|
66
|
+
1. The [GitHub Action](https://guides.rubygems.org/trusted-publishing/releasing-gems/) [rubygems.yml](./.github/workflows/rubygems.yml) will publish the gem to RubyGems.
|
|
64
67
|
|
|
65
68
|
## License
|
|
66
69
|
|
data/faithteams-api.gemspec
CHANGED
|
@@ -32,8 +32,11 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
33
33
|
spec.require_paths = ["lib"]
|
|
34
34
|
|
|
35
|
-
spec.add_dependency "activesupport", "
|
|
35
|
+
spec.add_dependency "activesupport", "~> 7.0.8"
|
|
36
36
|
spec.add_dependency "http", "~> 5.1"
|
|
37
|
+
spec.add_dependency "logger", "~> 1.6.1"
|
|
38
|
+
spec.add_dependency "ostruct", "~> 0.6.0"
|
|
39
|
+
spec.add_dependency "rexml", "~> 3.3.6" # only needs to be specified to address security warning
|
|
37
40
|
|
|
38
41
|
spec.add_development_dependency "byebug", "~> 11.1"
|
|
39
42
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
|
@@ -10,7 +10,6 @@ module FaithTeams
|
|
|
10
10
|
class Connection
|
|
11
11
|
# Specific base urls for different resources
|
|
12
12
|
ENDPOINT_BASE_URLS = {
|
|
13
|
-
"authenticate" => "https://app.faithteams.com/api/v2",
|
|
14
13
|
"batches" => "https://api-v2.faithteams.com",
|
|
15
14
|
"contributions" => "https://api-v2.faithteams.com",
|
|
16
15
|
"contributiontypes" => "https://api-v2.faithteams.com",
|
|
@@ -77,8 +76,6 @@ module FaithTeams
|
|
|
77
76
|
response = http.get(url, params: params)
|
|
78
77
|
end
|
|
79
78
|
break if response.status != 401 || retries >= 2
|
|
80
|
-
|
|
81
|
-
authenticate
|
|
82
79
|
end
|
|
83
80
|
|
|
84
81
|
raise Error::Request.new(response: response, message: "Request unsuccessful (#{response.status})") unless response.status.success?
|
|
@@ -116,7 +113,7 @@ module FaithTeams
|
|
|
116
113
|
|
|
117
114
|
# @return [HTTP::Client]
|
|
118
115
|
def http
|
|
119
|
-
@http ||= HTTP.
|
|
116
|
+
@http ||= HTTP.basic_auth(user: user_id, pass: password)
|
|
120
117
|
end
|
|
121
118
|
|
|
122
119
|
# @param path [String]
|
|
@@ -124,18 +121,6 @@ module FaithTeams
|
|
|
124
121
|
def base_url(path:)
|
|
125
122
|
ENDPOINT_BASE_URLS[path.split("/")[1]]
|
|
126
123
|
end
|
|
127
|
-
|
|
128
|
-
# Set the auth_token for these requests
|
|
129
|
-
# @return [String]
|
|
130
|
-
def auth_token
|
|
131
|
-
@auth_token ||= user_resource.authenticate
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
# Resets existing auth_token and re-authenticates
|
|
135
|
-
def authenticate
|
|
136
|
-
@auth_token = nil
|
|
137
|
-
auth_token
|
|
138
|
-
end
|
|
139
124
|
end
|
|
140
125
|
end
|
|
141
126
|
end
|
|
@@ -32,11 +32,6 @@ module FaithTeams
|
|
|
32
32
|
@contribution ||= Resource::Contribution.new(connection: connection)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
# @return [Resource::User]
|
|
36
|
-
def user
|
|
37
|
-
@user ||= Resource::User.new(connection: connection)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
35
|
# @return [Resource::ContributionType]
|
|
41
36
|
def contribution_type
|
|
42
37
|
@contribution_type ||= Resource::ContributionType.new(connection: connection)
|
data/lib/faithteams/version.rb
CHANGED