faithteams-api 2.0.2 → 3.0.0
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 +11 -1
- data/Gemfile.lock +1 -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 +5 -5
- data/lib/faithteams/api/v2/resource/user.rb +0 -40
- data/thunder-tests/collections/tc_col_faithteams.json +0 -2390
@@ -8,7 +8,7 @@
|
|
8
8
|
"data": [
|
9
9
|
{
|
10
10
|
"name": "auth_token",
|
11
|
-
"value": "
|
11
|
+
"value": "8kLF5Ok2knX9qZMe2JEgEQ22L4YLTZA3w9yXk49NnR9Ld0r5urUcAnna97suOcvkhH"
|
12
12
|
},
|
13
13
|
{
|
14
14
|
"name": "contribution_type_id",
|
@@ -16,11 +16,11 @@
|
|
16
16
|
},
|
17
17
|
{
|
18
18
|
"name": "contribution_id",
|
19
|
-
"value": "
|
19
|
+
"value": "5384950"
|
20
20
|
},
|
21
21
|
{
|
22
22
|
"name": "contribution_parent_id",
|
23
|
-
"value": "
|
23
|
+
"value": "5384949"
|
24
24
|
},
|
25
25
|
{
|
26
26
|
"name": "batch_id",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
},
|
37
37
|
{
|
38
38
|
"name": "person_id",
|
39
|
-
"value": "
|
39
|
+
"value": "814107"
|
40
40
|
},
|
41
41
|
{
|
42
42
|
"name": "person_id_created",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
},
|
53
53
|
{
|
54
54
|
"name": "user_id",
|
55
|
-
"value": "tithely-
|
55
|
+
"value": "tithely-2@mg.faithteams.com"
|
56
56
|
}
|
57
57
|
],
|
58
58
|
"envFile": "faithteams.env"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faithteams-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tithe.ly Integrations
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -249,10 +249,10 @@ files:
|
|
249
249
|
- lib/faithteams/api/v2/resource/contribution_type.rb
|
250
250
|
- lib/faithteams/api/v2/resource/fund.rb
|
251
251
|
- lib/faithteams/api/v2/resource/person.rb
|
252
|
-
- lib/faithteams/api/v2/resource/user.rb
|
253
252
|
- lib/faithteams/version.rb
|
254
253
|
- thunder-tests/.gitignore
|
255
|
-
- thunder-tests/collections/tc_col_faithteams.json
|
254
|
+
- thunder-tests/collections/tc_col_faithteams-api.json
|
255
|
+
- thunder-tests/collections/tc_col_faithteams-app.json
|
256
256
|
- thunder-tests/environments/tc_env_faithteams.json
|
257
257
|
- thunder-tests/faithteams.env.template
|
258
258
|
homepage: https://github.com/tithely/faithteams-api
|
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: '0'
|
283
283
|
requirements: []
|
284
|
-
rubygems_version: 3.5.
|
284
|
+
rubygems_version: 3.5.9
|
285
285
|
signing_key:
|
286
286
|
specification_version: 4
|
287
287
|
summary: A Faithteams API client gem.
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module FaithTeams
|
4
|
-
module API
|
5
|
-
module V2
|
6
|
-
module Resource
|
7
|
-
# User resource
|
8
|
-
class User < Base
|
9
|
-
# @return [String] auth_token
|
10
|
-
# @raise [Error::Request]
|
11
|
-
def authenticate
|
12
|
-
response = http.post("#{FaithTeams::API::V2::Connection::ENDPOINT_BASE_URLS["authenticate"]}/authenticate")
|
13
|
-
|
14
|
-
# raise errors
|
15
|
-
raise Error::Request.new(response: response, message: "Request unsuccessful (#{response.status})") unless response.status.success?
|
16
|
-
|
17
|
-
# parse response
|
18
|
-
begin
|
19
|
-
response_body = response.parse(:json)
|
20
|
-
rescue JSON::ParserError
|
21
|
-
raise Error::Request.new(response: response, message: "Failed to parse JSON")
|
22
|
-
end
|
23
|
-
|
24
|
-
response_body.dig("data", "token")
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
attr_reader :http
|
30
|
-
|
31
|
-
# @return [HTTP::Client]
|
32
|
-
def http
|
33
|
-
user_credentials = Base64.strict_encode64("#{connection.user_id}:#{connection.password}")
|
34
|
-
@http ||= HTTP.auth("Basic #{user_credentials}")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|