fountain-papi 0.1.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bbdbeb5c23aba4ccce04ea6388164db25f1605791c71f418a93614207a34f76
4
- data.tar.gz: 64a18f729b985d07af85d1a5119a936634b8d8c83c48ad06d7306e4c43c7030a
3
+ metadata.gz: 5922f36b8eece478e88c52bfc74d645f47d3734008adbbb4a063ebdc18b46c32
4
+ data.tar.gz: 9a6c3c26b49a8ad0a842148de810bd98cadb37b85f93af0c917f116f557b699f
5
5
  SHA512:
6
- metadata.gz: 943343fa0f4af9bd5b6c6e47acaf6db42da74ebf2effe2af1de0b456bca7248a549f974d0f21cfb3a68c04499759bdc633ec25c7c3abd7a49e66a38679441af5
7
- data.tar.gz: eb7d9959c8b1aa616aaccd6c9aff8d4ae0923bffafa470c1d109b1f142457d8bae1aabbb7113b08709adbcc6fc89dddfcfc168477272232e3e92673b5a7b69d3
6
+ metadata.gz: a418e9f11b7c55acdb0ce630dff19be1b578363f78581190870909d86f10df516cc7aeacda3260aa78740f90e6dfea1c30003569d6c21a641c7db7553fdabe2b
7
+ data.tar.gz: 409ff8ed87947e966b55cf1e257da01816b8ba0f3da1570e6c04d3411bf323c692c4d1c7699045d587acd4789b5959cb0a265e338976414a6f9f2f886700261b
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 3.0
3
3
 
4
4
  Style/StringLiterals:
5
5
  Enabled: true
@@ -11,3 +11,9 @@ Style/StringLiteralsInInterpolation:
11
11
 
12
12
  Layout/LineLength:
13
13
  Max: 120
14
+
15
+ Metrics/BlockLength:
16
+ Enabled: false
17
+
18
+ Style/Documentation:
19
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-06-01
3
+ ## [1.0.0] - 2023-04-13
4
+ - Bump minimum version of Ruby to 3.0
4
5
 
6
+ ## [0.1.0] - 2022-06-01
5
7
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fountain-papi (0.1.0)
4
+ fountain-papi (1.1.0)
5
5
  dry-struct (~> 1.4)
6
6
  httparty (~> 0.20.0)
7
7
 
@@ -12,32 +12,29 @@ GEM
12
12
  public_suffix (>= 2.0.2, < 5.0)
13
13
  ast (2.4.2)
14
14
  coderay (1.1.3)
15
- concurrent-ruby (1.1.10)
15
+ concurrent-ruby (1.2.2)
16
16
  crack (0.4.5)
17
17
  rexml
18
18
  diff-lcs (1.5.0)
19
- dry-configurable (0.15.0)
19
+ dry-core (1.0.0)
20
20
  concurrent-ruby (~> 1.0)
21
- dry-core (~> 0.6)
22
- dry-container (0.9.0)
21
+ zeitwerk (~> 2.6)
22
+ dry-inflector (1.0.0)
23
+ dry-logic (1.5.0)
23
24
  concurrent-ruby (~> 1.0)
24
- dry-configurable (~> 0.13, >= 0.13.0)
25
- dry-core (0.7.1)
26
- concurrent-ruby (~> 1.0)
27
- dry-inflector (0.2.1)
28
- dry-logic (1.2.0)
29
- concurrent-ruby (~> 1.0)
30
- dry-core (~> 0.5, >= 0.5)
31
- dry-struct (1.4.0)
32
- dry-core (~> 0.5, >= 0.5)
33
- dry-types (~> 1.5)
25
+ dry-core (~> 1.0, < 2)
26
+ zeitwerk (~> 2.6)
27
+ dry-struct (1.6.0)
28
+ dry-core (~> 1.0, < 2)
29
+ dry-types (>= 1.7, < 2)
34
30
  ice_nine (~> 0.11)
35
- dry-types (1.5.1)
31
+ zeitwerk (~> 2.6)
32
+ dry-types (1.7.1)
36
33
  concurrent-ruby (~> 1.0)
37
- dry-container (~> 0.3)
38
- dry-core (~> 0.5, >= 0.5)
39
- dry-inflector (~> 0.1, >= 0.1.2)
40
- dry-logic (~> 1.0, >= 1.0.2)
34
+ dry-core (~> 1.0)
35
+ dry-inflector (~> 1.0)
36
+ dry-logic (~> 1.4)
37
+ zeitwerk (~> 2.6)
41
38
  hashdiff (1.0.1)
42
39
  httparty (0.20.0)
43
40
  mime-types (~> 3.0)
@@ -46,7 +43,7 @@ GEM
46
43
  method_source (1.0.0)
47
44
  mime-types (3.4.1)
48
45
  mime-types-data (~> 3.2015)
49
- mime-types-data (3.2022.0105)
46
+ mime-types-data (3.2023.0218.1)
50
47
  multi_xml (0.6.0)
51
48
  parallel (1.22.1)
52
49
  parser (3.1.2.0)
@@ -89,9 +86,13 @@ GEM
89
86
  addressable (>= 2.8.0)
90
87
  crack (>= 0.3.2)
91
88
  hashdiff (>= 0.4.0, < 2.0.0)
89
+ zeitwerk (2.6.7)
92
90
 
93
91
  PLATFORMS
92
+ arm64-darwin-21
93
+ arm64-darwin-22
94
94
  x86_64-darwin-20
95
+ x86_64-linux
95
96
 
96
97
  DEPENDENCIES
97
98
  fountain-papi!
@@ -102,4 +103,4 @@ DEPENDENCIES
102
103
  webmock
103
104
 
104
105
  BUNDLED WITH
105
- 2.3.6
106
+ 2.3.22
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fountain
2
4
  module Papi
3
5
  def self.create_status(params)
@@ -13,20 +15,21 @@ module Fountain
13
15
  end
14
16
 
15
17
  def call
18
+ uri = Fountain::Papi.config.base_uri(override_partner_id: status.partner_id)
16
19
  response = Client.post(
17
- "#{Fountain::Papi.config.base_uri}/applicants/#{status.applicant_id}/status",
20
+ "#{uri}/applicants/#{status.applicant_id}/status",
18
21
  body: { applicant: { partner_status: status } }.to_json,
19
22
  headers: Fountain::Papi.config.headers
20
23
  )
21
24
 
22
- raise Fountain::Papi::Error.new(response) unless response.success?
25
+ raise Fountain::Papi::Error, response unless response.success?
23
26
 
24
27
  created_status(response)
25
28
  end
26
29
 
27
30
  def created_status(response)
28
- result_status = response["partner_status"].
29
- merge(applicant_id: status.applicant_id)
31
+ result_status = response["partner_status"]
32
+ .merge(applicant_id: status.applicant_id)
30
33
 
31
34
  Fountain::Papi::Applicant::Status.new(result_status)
32
35
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fountain
2
4
  module Papi
3
5
  module Applicant
@@ -20,9 +22,12 @@ module Fountain
20
22
  attribute? :color, Types::Strict::String
21
23
  attribute? :display_status, Types::Strict::String
22
24
  attribute? :display_title, Types::Strict::String
23
- attribute? :external_id, Types::UUID
25
+ attribute? :external_id, Types::UUID.optional
24
26
  attribute? :show_redo, Types::Params::Bool.optional
25
27
  attribute? :status_type, Types::Strict::String.optional
28
+
29
+ # config override attributes:
30
+ attribute? :partner_id, Types::UUID.optional
26
31
  end
27
32
  end
28
33
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fountain
2
4
  module Papi
3
5
  class Client
@@ -1,11 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fountain
2
4
  module Papi
3
5
  class Config
4
- attr_accessor :api_key
5
- attr_accessor :partner_id
6
- attr_accessor :sandbox
7
- attr_accessor :version
8
- attr_accessor :base_domain
6
+ attr_accessor :api_key, :partner_id, :sandbox, :version, :base_domain
9
7
 
10
8
  def initialize
11
9
  @api_key = nil # Partner API Key
@@ -15,8 +13,8 @@ module Fountain
15
13
  @base_domain = "https://partners-sandbox.fountain.com" # Default to sandbox base domain
16
14
  end
17
15
 
18
- def base_uri
19
- "#{base_domain}/v#{version}/partners/#{partner_id}"
16
+ def base_uri(override_partner_id: nil)
17
+ "#{base_domain}/v#{version}/partners/#{override_partner_id || partner_id}"
20
18
  end
21
19
 
22
20
  def headers
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fountain
2
4
  module Papi
3
5
  module Types
4
6
  include Dry.Types()
5
7
 
6
- UUID = Strict::String.
7
- constrained(format: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
8
+ UUID = Strict::String
9
+ .constrained(format: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
8
10
  end
9
11
  end
10
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fountain
4
4
  module Papi
5
- VERSION = "0.1.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fountain-papi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Cody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-24 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.20.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -117,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 2.6.0
120
+ version: 3.0.0
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.2.32
127
+ rubygems_version: 3.1.6
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Ruby client for interfacing with Fountain Partners API.