finch-api 0.1.0.pre.alpha.34 → 0.1.0.pre.alpha.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ede02583d2b0c445b277a885b7fd9618866a4d8507cf77fc55d22315bb738474
4
- data.tar.gz: f2a3ea53b6308dfcdf758c8adc92ce32f97fbbe6833069da6e332a7927a185e7
3
+ metadata.gz: d382ea34dabd520b04483278dfe908e7873e5c9435b99ffe7e370be976f19651
4
+ data.tar.gz: 2c4ceee0a29b216ec1836c8cff53adce92b920edb2be415f0fe5c0630b09a981
5
5
  SHA512:
6
- metadata.gz: c597ba4db22f2703c89d7abbfa8abba5f5b777a0cd27006ac51dba6f8bc1e03fbbd1fa5865d2a85cad45402671d76fc1c88fb57e4e3a8141d13a79e8290b4260
7
- data.tar.gz: 05fa8f40fe7583702b86c013419ef743f87f05f0f08a97a35a342d0e7363148b830a4370a8e6716eea654be5449dbf6c97927cfc18b6ca4425e119acf286cce8
6
+ metadata.gz: 58006f5d1e528a5aee8469362ef3752bd824de6b115e9a191b0c8d16d58c993da04c352274c6da09d24906c68aac9e9f3fd3d193d6888bad7a032ce4799aa5a6
7
+ data.tar.gz: ff112d22c9211fdafff2a3e322cc81fe4ce89d2f963fc5d423722e35a18c06a3eb588f0c83499f748324463c086c445197fbfa93290b01026f50580656c2ffa8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.35 (2025-11-09)
4
+
5
+ Full Changelog: [v0.1.0-alpha.34...v0.1.0-alpha.35](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.34...v0.1.0-alpha.35)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([9ef0063](https://github.com/Finch-API/finch-api-ruby/commit/9ef0063aae5d7d717450833073f81fc6f9834566))
10
+ * **api:** api update ([edeff3b](https://github.com/Finch-API/finch-api-ruby/commit/edeff3bdb90eb9cecbc26b3a6c0c569e594425dd))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * better thread safety via early initializing SSL store during HTTP client creation ([ed1ac81](https://github.com/Finch-API/finch-api-ruby/commit/ed1ac81b9f90890405a00c49b23239dbd1d088dd))
16
+
3
17
  ## 0.1.0-alpha.34 (2025-11-04)
4
18
 
5
19
  Full Changelog: [v0.1.0-alpha.33...v0.1.0-alpha.34](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.33...v0.1.0-alpha.34)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "finch-api", "~> 0.1.0.pre.alpha.34"
20
+ gem "finch-api", "~> 0.1.0.pre.alpha.35"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -16,10 +16,11 @@ module FinchAPI
16
16
  class << self
17
17
  # @api private
18
18
  #
19
+ # @param cert_store [OpenSSL::X509::Store]
19
20
  # @param url [URI::Generic]
20
21
  #
21
22
  # @return [Net::HTTP]
22
- def connect(url)
23
+ def connect(cert_store:, url:)
23
24
  port =
24
25
  case [url.port, url.scheme]
25
26
  in [Integer, _]
@@ -33,6 +34,8 @@ module FinchAPI
33
34
  Net::HTTP.new(url.host, port).tap do
34
35
  _1.use_ssl = %w[https wss].include?(url.scheme)
35
36
  _1.max_retries = 0
37
+
38
+ (_1.cert_store = cert_store) if _1.use_ssl?
36
39
  end
37
40
  end
38
41
 
@@ -102,7 +105,7 @@ module FinchAPI
102
105
  pool =
103
106
  @mutex.synchronize do
104
107
  @pools[origin] ||= ConnectionPool.new(size: @size) do
105
- self.class.connect(url)
108
+ self.class.connect(cert_store: @cert_store, url: url)
106
109
  end
107
110
  end
108
111
 
@@ -192,6 +195,7 @@ module FinchAPI
192
195
  def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
193
196
  @mutex = Mutex.new
194
197
  @size = size
198
+ @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
195
199
  @pools = {}
196
200
  end
197
201
 
@@ -49,6 +49,9 @@ module FinchAPI
49
49
  required :catch_up, FinchAPI::Internal::Type::Boolean, nil?: true
50
50
 
51
51
  # @!attribute company_contribution
52
+ # Company contribution configuration. Supports fixed amounts (in cents),
53
+ # percentage-based contributions (in basis points where 100 = 1%), or tiered
54
+ # matching structures.
52
55
  #
53
56
  # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2, nil]
54
57
  required :company_contribution,
@@ -58,6 +61,8 @@ module FinchAPI
58
61
  nil?: true
59
62
 
60
63
  # @!attribute employee_deduction
64
+ # Employee deduction configuration. Supports both fixed amounts (in cents) and
65
+ # percentage-based contributions (in basis points where 100 = 1%).
61
66
  #
62
67
  # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1, nil]
63
68
  required :employee_deduction,
@@ -85,12 +90,16 @@ module FinchAPI
85
90
  #
86
91
  # @param catch_up [Boolean, nil] If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled
87
92
  #
88
- # @param company_contribution [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2, nil]
93
+ # @param company_contribution [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2, nil] Company contribution configuration. Supports fixed amounts (in cents), percentag
89
94
  #
90
- # @param employee_deduction [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1, nil]
95
+ # @param employee_deduction [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1, nil] Employee deduction configuration. Supports both fixed amounts (in cents) and per
91
96
  #
92
97
  # @param hsa_contribution_limit [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::HsaContributionLimit, nil] Type for HSA contribution limit if the benefit is a HSA.
93
98
 
99
+ # Company contribution configuration. Supports fixed amounts (in cents),
100
+ # percentage-based contributions (in basis points where 100 = 1%), or tiered
101
+ # matching structures.
102
+ #
94
103
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0#company_contribution
95
104
  module CompanyContribution
96
105
  extend FinchAPI::Internal::Type::Union
@@ -103,24 +112,31 @@ module FinchAPI
103
112
 
104
113
  class UnionMember0 < FinchAPI::Internal::Type::BaseModel
105
114
  # @!attribute amount
106
- # Contribution amount in cents.
115
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
116
+ # where 100 = 1%). Not used for type=tiered.
107
117
  #
108
118
  # @return [Integer]
109
119
  required :amount, Integer
110
120
 
111
121
  # @!attribute type
112
- # Fixed contribution type.
122
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
123
+ # (amount in basis points), or "tiered" (multi-tier matching).
113
124
  #
114
125
  # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0::Type]
115
126
  required :type,
116
127
  enum: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0::Type }
117
128
 
118
129
  # @!method initialize(amount:, type:)
119
- # @param amount [Integer] Contribution amount in cents.
130
+ # Some parameter documentations has been truncated, see
131
+ # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0}
132
+ # for more details.
133
+ #
134
+ # @param amount [Integer] Contribution amount in cents (for type=fixed) or basis points (for type=percent,
120
135
  #
121
- # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0::Type] Fixed contribution type.
136
+ # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0::Type] Contribution type. Supported values: "fixed" (amount in cents), "percent" (amoun
122
137
 
123
- # Fixed contribution type.
138
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
139
+ # (amount in basis points), or "tiered" (multi-tier matching).
124
140
  #
125
141
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0#type
126
142
  module Type
@@ -135,24 +151,31 @@ module FinchAPI
135
151
 
136
152
  class UnionMember1 < FinchAPI::Internal::Type::BaseModel
137
153
  # @!attribute amount
138
- # Contribution amount in basis points (1/100th of a percent).
154
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
155
+ # where 100 = 1%). Not used for type=tiered.
139
156
  #
140
157
  # @return [Integer]
141
158
  required :amount, Integer
142
159
 
143
160
  # @!attribute type
144
- # Percentage contribution type.
161
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
162
+ # (amount in basis points), or "tiered" (multi-tier matching).
145
163
  #
146
164
  # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1::Type]
147
165
  required :type,
148
166
  enum: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1::Type }
149
167
 
150
168
  # @!method initialize(amount:, type:)
151
- # @param amount [Integer] Contribution amount in basis points (1/100th of a percent).
169
+ # Some parameter documentations has been truncated, see
170
+ # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1}
171
+ # for more details.
172
+ #
173
+ # @param amount [Integer] Contribution amount in cents (for type=fixed) or basis points (for type=percent,
152
174
  #
153
- # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1::Type] Percentage contribution type.
175
+ # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1::Type] Contribution type. Supported values: "fixed" (amount in cents), "percent" (amoun
154
176
 
155
- # Percentage contribution type.
177
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
178
+ # (amount in basis points), or "tiered" (multi-tier matching).
156
179
  #
157
180
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1#type
158
181
  module Type
@@ -168,14 +191,15 @@ module FinchAPI
168
191
  class UnionMember2 < FinchAPI::Internal::Type::BaseModel
169
192
  # @!attribute tiers
170
193
  # Array of tier objects defining employer match tiers based on employee
171
- # contribution thresholds.
194
+ # contribution thresholds. Required when type=tiered.
172
195
  #
173
196
  # @return [Array<FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Tier>]
174
197
  required :tiers,
175
198
  -> { FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Tier] }
176
199
 
177
200
  # @!attribute type
178
- # Tiered contribution type (only valid for company_contribution).
201
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
202
+ # (amount in basis points), or "tiered" (multi-tier matching).
179
203
  #
180
204
  # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Type]
181
205
  required :type,
@@ -188,7 +212,7 @@ module FinchAPI
188
212
  #
189
213
  # @param tiers [Array<FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Tier>] Array of tier objects defining employer match tiers based on employee contributi
190
214
  #
191
- # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Type] Tiered contribution type (only valid for company_contribution).
215
+ # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Type] Contribution type. Supported values: "fixed" (amount in cents), "percent" (amoun
192
216
 
193
217
  class Tier < FinchAPI::Internal::Type::BaseModel
194
218
  # @!attribute match
@@ -206,7 +230,8 @@ module FinchAPI
206
230
  # @param threshold [Integer]
207
231
  end
208
232
 
209
- # Tiered contribution type (only valid for company_contribution).
233
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
234
+ # (amount in basis points), or "tiered" (multi-tier matching).
210
235
  #
211
236
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2#type
212
237
  module Type
@@ -223,6 +248,9 @@ module FinchAPI
223
248
  # @return [Array(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2)]
224
249
  end
225
250
 
251
+ # Employee deduction configuration. Supports both fixed amounts (in cents) and
252
+ # percentage-based contributions (in basis points where 100 = 1%).
253
+ #
226
254
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0#employee_deduction
227
255
  module EmployeeDeduction
228
256
  extend FinchAPI::Internal::Type::Union
@@ -233,24 +261,31 @@ module FinchAPI
233
261
 
234
262
  class UnionMember0 < FinchAPI::Internal::Type::BaseModel
235
263
  # @!attribute amount
236
- # Contribution amount in cents.
264
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
265
+ # where 100 = 1%).
237
266
  #
238
267
  # @return [Integer]
239
268
  required :amount, Integer
240
269
 
241
270
  # @!attribute type
242
- # Fixed contribution type.
271
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
272
+ # (amount in basis points).
243
273
  #
244
274
  # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0::Type]
245
275
  required :type,
246
276
  enum: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0::Type }
247
277
 
248
278
  # @!method initialize(amount:, type:)
249
- # @param amount [Integer] Contribution amount in cents.
279
+ # Some parameter documentations has been truncated, see
280
+ # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0}
281
+ # for more details.
282
+ #
283
+ # @param amount [Integer] Contribution amount in cents (for type=fixed) or basis points (for type=percent,
250
284
  #
251
- # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0::Type] Fixed contribution type.
285
+ # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0::Type] Contribution type. Supported values: "fixed" (amount in cents) or "percent" (amo
252
286
 
253
- # Fixed contribution type.
287
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
288
+ # (amount in basis points).
254
289
  #
255
290
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0#type
256
291
  module Type
@@ -265,24 +300,31 @@ module FinchAPI
265
300
 
266
301
  class UnionMember1 < FinchAPI::Internal::Type::BaseModel
267
302
  # @!attribute amount
268
- # Contribution amount in basis points (1/100th of a percent).
303
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
304
+ # where 100 = 1%).
269
305
  #
270
306
  # @return [Integer]
271
307
  required :amount, Integer
272
308
 
273
309
  # @!attribute type
274
- # Percentage contribution type.
310
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
311
+ # (amount in basis points).
275
312
  #
276
313
  # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1::Type]
277
314
  required :type,
278
315
  enum: -> { FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1::Type }
279
316
 
280
317
  # @!method initialize(amount:, type:)
281
- # @param amount [Integer] Contribution amount in basis points (1/100th of a percent).
318
+ # Some parameter documentations has been truncated, see
319
+ # {FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1}
320
+ # for more details.
321
+ #
322
+ # @param amount [Integer] Contribution amount in cents (for type=fixed) or basis points (for type=percent,
282
323
  #
283
- # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1::Type] Percentage contribution type.
324
+ # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1::Type] Contribution type. Supported values: "fixed" (amount in cents) or "percent" (amo
284
325
 
285
- # Percentage contribution type.
326
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
327
+ # (amount in basis points).
286
328
  #
287
329
  # @see FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1#type
288
330
  module Type
@@ -346,20 +346,12 @@ module FinchAPI
346
346
  # @return [String, nil]
347
347
  required :source_id, String, nil?: true
348
348
 
349
- # @!attribute type
350
- # The type of entity
351
- #
352
- # @return [String, nil]
353
- required :type, String, nil?: true
354
-
355
- # @!method initialize(id:, name:, source_id:, type:)
349
+ # @!method initialize(id:, name:, source_id:)
356
350
  # @param id [String] The connection account ID for this entity
357
351
  #
358
352
  # @param name [String, nil] The name of the entity (payroll provider company name)
359
353
  #
360
354
  # @param source_id [String, nil] The source ID of the entity
361
- #
362
- # @param type [String, nil] The type of entity
363
355
  end
364
356
  end
365
357
  end
@@ -73,10 +73,8 @@ module FinchAPI
73
73
  # @!attribute headers
74
74
  # The HTTP headers that were specified for the forwarded request.
75
75
  #
76
- # @return [Hash{Symbol=>Object, nil}, nil]
77
- optional :headers,
78
- FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true],
79
- nil?: true
76
+ # @return [Hash{Symbol=>String}, nil]
77
+ optional :headers, FinchAPI::Internal::Type::HashOf[String], nil?: true
80
78
 
81
79
  # @!attribute params
82
80
  # The query parameters that were specified for the forwarded request.
@@ -99,7 +97,7 @@ module FinchAPI
99
97
  #
100
98
  # @param data [String, Hash{Symbol=>Object, nil}, nil] The body that was specified for the forwarded request.
101
99
  #
102
- # @param headers [Hash{Symbol=>Object, nil}, nil] The HTTP headers that were specified for the forwarded request.
100
+ # @param headers [Hash{Symbol=>String}, nil] The HTTP headers that were specified for the forwarded request.
103
101
  #
104
102
  # @param params [Hash{Symbol=>Object, nil}, nil] The query parameters that were specified for the forwarded request.
105
103
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinchAPI
4
- VERSION = "0.1.0.pre.alpha.34"
4
+ VERSION = "0.1.0.pre.alpha.35"
5
5
  end
data/lib/finch_api.rb CHANGED
@@ -9,6 +9,7 @@ require "erb"
9
9
  require "etc"
10
10
  require "json"
11
11
  require "net/http"
12
+ require "openssl"
12
13
  require "pathname"
13
14
  require "rbconfig"
14
15
  require "securerandom"
data/manifest.yaml CHANGED
@@ -6,6 +6,7 @@ dependencies:
6
6
  - etc
7
7
  - json
8
8
  - net/http
9
+ - openssl
9
10
  - pathname
10
11
  - rbconfig
11
12
  - securerandom
@@ -26,8 +26,12 @@ module FinchAPI
26
26
 
27
27
  class << self
28
28
  # @api private
29
- sig { params(url: URI::Generic).returns(Net::HTTP) }
30
- def connect(url)
29
+ sig do
30
+ params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
31
+ Net::HTTP
32
+ )
33
+ end
34
+ def connect(cert_store:, url:)
31
35
  end
32
36
 
33
37
  # @api private
@@ -82,6 +82,9 @@ module FinchAPI
82
82
  sig { returns(T.nilable(T::Boolean)) }
83
83
  attr_accessor :catch_up
84
84
 
85
+ # Company contribution configuration. Supports fixed amounts (in cents),
86
+ # percentage-based contributions (in basis points where 100 = 1%), or tiered
87
+ # matching structures.
85
88
  sig do
86
89
  returns(
87
90
  T.nilable(
@@ -91,6 +94,8 @@ module FinchAPI
91
94
  end
92
95
  attr_accessor :company_contribution
93
96
 
97
+ # Employee deduction configuration. Supports both fixed amounts (in cents) and
98
+ # percentage-based contributions (in basis points where 100 = 1%).
94
99
  sig do
95
100
  returns(
96
101
  T.nilable(
@@ -141,7 +146,12 @@ module FinchAPI
141
146
  # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled
142
147
  # for this individual.
143
148
  catch_up:,
149
+ # Company contribution configuration. Supports fixed amounts (in cents),
150
+ # percentage-based contributions (in basis points where 100 = 1%), or tiered
151
+ # matching structures.
144
152
  company_contribution:,
153
+ # Employee deduction configuration. Supports both fixed amounts (in cents) and
154
+ # percentage-based contributions (in basis points where 100 = 1%).
145
155
  employee_deduction:,
146
156
  # Type for HSA contribution limit if the benefit is a HSA.
147
157
  hsa_contribution_limit: nil
@@ -171,6 +181,9 @@ module FinchAPI
171
181
  def to_hash
172
182
  end
173
183
 
184
+ # Company contribution configuration. Supports fixed amounts (in cents),
185
+ # percentage-based contributions (in basis points where 100 = 1%), or tiered
186
+ # matching structures.
174
187
  module CompanyContribution
175
188
  extend FinchAPI::Internal::Type::Union
176
189
 
@@ -192,11 +205,13 @@ module FinchAPI
192
205
  )
193
206
  end
194
207
 
195
- # Contribution amount in cents.
208
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
209
+ # where 100 = 1%). Not used for type=tiered.
196
210
  sig { returns(Integer) }
197
211
  attr_accessor :amount
198
212
 
199
- # Fixed contribution type.
213
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
214
+ # (amount in basis points), or "tiered" (multi-tier matching).
200
215
  sig do
201
216
  returns(
202
217
  FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember0::Type::TaggedSymbol
@@ -212,9 +227,11 @@ module FinchAPI
212
227
  ).returns(T.attached_class)
213
228
  end
214
229
  def self.new(
215
- # Contribution amount in cents.
230
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
231
+ # where 100 = 1%). Not used for type=tiered.
216
232
  amount:,
217
- # Fixed contribution type.
233
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
234
+ # (amount in basis points), or "tiered" (multi-tier matching).
218
235
  type:
219
236
  )
220
237
  end
@@ -231,7 +248,8 @@ module FinchAPI
231
248
  def to_hash
232
249
  end
233
250
 
234
- # Fixed contribution type.
251
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
252
+ # (amount in basis points), or "tiered" (multi-tier matching).
235
253
  module Type
236
254
  extend FinchAPI::Internal::Type::Enum
237
255
 
@@ -271,11 +289,13 @@ module FinchAPI
271
289
  )
272
290
  end
273
291
 
274
- # Contribution amount in basis points (1/100th of a percent).
292
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
293
+ # where 100 = 1%). Not used for type=tiered.
275
294
  sig { returns(Integer) }
276
295
  attr_accessor :amount
277
296
 
278
- # Percentage contribution type.
297
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
298
+ # (amount in basis points), or "tiered" (multi-tier matching).
279
299
  sig do
280
300
  returns(
281
301
  FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember1::Type::TaggedSymbol
@@ -291,9 +311,11 @@ module FinchAPI
291
311
  ).returns(T.attached_class)
292
312
  end
293
313
  def self.new(
294
- # Contribution amount in basis points (1/100th of a percent).
314
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
315
+ # where 100 = 1%). Not used for type=tiered.
295
316
  amount:,
296
- # Percentage contribution type.
317
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
318
+ # (amount in basis points), or "tiered" (multi-tier matching).
297
319
  type:
298
320
  )
299
321
  end
@@ -310,7 +332,8 @@ module FinchAPI
310
332
  def to_hash
311
333
  end
312
334
 
313
- # Percentage contribution type.
335
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
336
+ # (amount in basis points), or "tiered" (multi-tier matching).
314
337
  module Type
315
338
  extend FinchAPI::Internal::Type::Enum
316
339
 
@@ -351,7 +374,7 @@ module FinchAPI
351
374
  end
352
375
 
353
376
  # Array of tier objects defining employer match tiers based on employee
354
- # contribution thresholds.
377
+ # contribution thresholds. Required when type=tiered.
355
378
  sig do
356
379
  returns(
357
380
  T::Array[
@@ -361,7 +384,8 @@ module FinchAPI
361
384
  end
362
385
  attr_accessor :tiers
363
386
 
364
- # Tiered contribution type (only valid for company_contribution).
387
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
388
+ # (amount in basis points), or "tiered" (multi-tier matching).
365
389
  sig do
366
390
  returns(
367
391
  FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::CompanyContribution::UnionMember2::Type::TaggedSymbol
@@ -381,9 +405,10 @@ module FinchAPI
381
405
  end
382
406
  def self.new(
383
407
  # Array of tier objects defining employer match tiers based on employee
384
- # contribution thresholds.
408
+ # contribution thresholds. Required when type=tiered.
385
409
  tiers:,
386
- # Tiered contribution type (only valid for company_contribution).
410
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
411
+ # (amount in basis points), or "tiered" (multi-tier matching).
387
412
  type:
388
413
  )
389
414
  end
@@ -433,7 +458,8 @@ module FinchAPI
433
458
  end
434
459
  end
435
460
 
436
- # Tiered contribution type (only valid for company_contribution).
461
+ # Contribution type. Supported values: "fixed" (amount in cents), "percent"
462
+ # (amount in basis points), or "tiered" (multi-tier matching).
437
463
  module Type
438
464
  extend FinchAPI::Internal::Type::Enum
439
465
 
@@ -475,6 +501,8 @@ module FinchAPI
475
501
  end
476
502
  end
477
503
 
504
+ # Employee deduction configuration. Supports both fixed amounts (in cents) and
505
+ # percentage-based contributions (in basis points where 100 = 1%).
478
506
  module EmployeeDeduction
479
507
  extend FinchAPI::Internal::Type::Union
480
508
 
@@ -495,11 +523,13 @@ module FinchAPI
495
523
  )
496
524
  end
497
525
 
498
- # Contribution amount in cents.
526
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
527
+ # where 100 = 1%).
499
528
  sig { returns(Integer) }
500
529
  attr_accessor :amount
501
530
 
502
- # Fixed contribution type.
531
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
532
+ # (amount in basis points).
503
533
  sig do
504
534
  returns(
505
535
  FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember0::Type::TaggedSymbol
@@ -515,9 +545,11 @@ module FinchAPI
515
545
  ).returns(T.attached_class)
516
546
  end
517
547
  def self.new(
518
- # Contribution amount in cents.
548
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
549
+ # where 100 = 1%).
519
550
  amount:,
520
- # Fixed contribution type.
551
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
552
+ # (amount in basis points).
521
553
  type:
522
554
  )
523
555
  end
@@ -534,7 +566,8 @@ module FinchAPI
534
566
  def to_hash
535
567
  end
536
568
 
537
- # Fixed contribution type.
569
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
570
+ # (amount in basis points).
538
571
  module Type
539
572
  extend FinchAPI::Internal::Type::Enum
540
573
 
@@ -574,11 +607,13 @@ module FinchAPI
574
607
  )
575
608
  end
576
609
 
577
- # Contribution amount in basis points (1/100th of a percent).
610
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
611
+ # where 100 = 1%).
578
612
  sig { returns(Integer) }
579
613
  attr_accessor :amount
580
614
 
581
- # Percentage contribution type.
615
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
616
+ # (amount in basis points).
582
617
  sig do
583
618
  returns(
584
619
  FinchAPI::HRIS::Benefits::IndividualBenefit::Body::UnionMember0::EmployeeDeduction::UnionMember1::Type::TaggedSymbol
@@ -594,9 +629,11 @@ module FinchAPI
594
629
  ).returns(T.attached_class)
595
630
  end
596
631
  def self.new(
597
- # Contribution amount in basis points (1/100th of a percent).
632
+ # Contribution amount in cents (for type=fixed) or basis points (for type=percent,
633
+ # where 100 = 1%).
598
634
  amount:,
599
- # Percentage contribution type.
635
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
636
+ # (amount in basis points).
600
637
  type:
601
638
  )
602
639
  end
@@ -613,7 +650,8 @@ module FinchAPI
613
650
  def to_hash
614
651
  end
615
652
 
616
- # Percentage contribution type.
653
+ # Contribution type. Supported values: "fixed" (amount in cents) or "percent"
654
+ # (amount in basis points).
617
655
  module Type
618
656
  extend FinchAPI::Internal::Type::Enum
619
657
 
@@ -578,16 +578,11 @@ module FinchAPI
578
578
  sig { returns(T.nilable(String)) }
579
579
  attr_accessor :source_id
580
580
 
581
- # The type of entity
582
- sig { returns(T.nilable(String)) }
583
- attr_accessor :type
584
-
585
581
  sig do
586
582
  params(
587
583
  id: String,
588
584
  name: T.nilable(String),
589
- source_id: T.nilable(String),
590
- type: T.nilable(String)
585
+ source_id: T.nilable(String)
591
586
  ).returns(T.attached_class)
592
587
  end
593
588
  def self.new(
@@ -596,9 +591,7 @@ module FinchAPI
596
591
  # The name of the entity (payroll provider company name)
597
592
  name:,
598
593
  # The source ID of the entity
599
- source_id:,
600
- # The type of entity
601
- type:
594
+ source_id:
602
595
  )
603
596
  end
604
597
 
@@ -607,8 +600,7 @@ module FinchAPI
607
600
  {
608
601
  id: String,
609
602
  name: T.nilable(String),
610
- source_id: T.nilable(String),
611
- type: T.nilable(String)
603
+ source_id: T.nilable(String)
612
604
  }
613
605
  )
614
606
  end
@@ -111,7 +111,7 @@ module FinchAPI
111
111
  attr_accessor :data
112
112
 
113
113
  # The HTTP headers that were specified for the forwarded request.
114
- sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
114
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
115
115
  attr_accessor :headers
116
116
 
117
117
  # The query parameters that were specified for the forwarded request.
@@ -128,7 +128,7 @@ module FinchAPI
128
128
  T.nilable(
129
129
  FinchAPI::Models::RequestForwardingForwardResponse::Request::Data::Variants
130
130
  ),
131
- headers: T.nilable(T::Hash[Symbol, T.nilable(T.anything)]),
131
+ headers: T.nilable(T::Hash[Symbol, String]),
132
132
  params: T.nilable(T::Hash[Symbol, T.nilable(T.anything)])
133
133
  ).returns(T.attached_class)
134
134
  end
@@ -156,7 +156,7 @@ module FinchAPI
156
156
  T.nilable(
157
157
  FinchAPI::Models::RequestForwardingForwardResponse::Request::Data::Variants
158
158
  ),
159
- headers: T.nilable(T::Hash[Symbol, T.nilable(T.anything)]),
159
+ headers: T.nilable(T::Hash[Symbol, String]),
160
160
  params: T.nilable(T::Hash[Symbol, T.nilable(T.anything)])
161
161
  }
162
162
  )
@@ -17,7 +17,10 @@ module FinchAPI
17
17
 
18
18
  DEFAULT_MAX_CONNECTIONS: Integer
19
19
 
20
- def self.connect: (URI::Generic url) -> top
20
+ def self.connect: (
21
+ cert_store: OpenSSL::X509::Store,
22
+ url: URI::Generic
23
+ ) -> top
21
24
 
22
25
  def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
23
26
 
@@ -262,8 +262,7 @@ module FinchAPI
262
262
  end
263
263
  end
264
264
 
265
- type entity =
266
- { id: String, name: String?, source_id: String?, type: String? }
265
+ type entity = { id: String, name: String?, source_id: String? }
267
266
 
268
267
  class Entity < FinchAPI::Internal::Type::BaseModel
269
268
  attr_accessor id: String
@@ -272,21 +271,9 @@ module FinchAPI
272
271
 
273
272
  attr_accessor source_id: String?
274
273
 
275
- attr_accessor type: String?
274
+ def initialize: (id: String, name: String?, source_id: String?) -> void
276
275
 
277
- def initialize: (
278
- id: String,
279
- name: String?,
280
- source_id: String?,
281
- type: String?
282
- ) -> void
283
-
284
- def to_hash: -> {
285
- id: String,
286
- name: String?,
287
- source_id: String?,
288
- type: String?
289
- }
276
+ def to_hash: -> { id: String, name: String?, source_id: String? }
290
277
  end
291
278
  end
292
279
  end
@@ -36,7 +36,7 @@ module FinchAPI
36
36
  method_: String,
37
37
  route: String,
38
38
  data: FinchAPI::Models::RequestForwardingForwardResponse::Request::data?,
39
- headers: ::Hash[Symbol, top?]?,
39
+ headers: ::Hash[Symbol, String]?,
40
40
  params: ::Hash[Symbol, top?]?
41
41
  }
42
42
 
@@ -47,7 +47,7 @@ module FinchAPI
47
47
 
48
48
  attr_accessor data: FinchAPI::Models::RequestForwardingForwardResponse::Request::data?
49
49
 
50
- attr_accessor headers: ::Hash[Symbol, top?]?
50
+ attr_accessor headers: ::Hash[Symbol, String]?
51
51
 
52
52
  attr_accessor params: ::Hash[Symbol, top?]?
53
53
 
@@ -55,7 +55,7 @@ module FinchAPI
55
55
  method_: String,
56
56
  route: String,
57
57
  ?data: FinchAPI::Models::RequestForwardingForwardResponse::Request::data?,
58
- ?headers: ::Hash[Symbol, top?]?,
58
+ ?headers: ::Hash[Symbol, String]?,
59
59
  ?params: ::Hash[Symbol, top?]?
60
60
  ) -> void
61
61
 
@@ -63,7 +63,7 @@ module FinchAPI
63
63
  method_: String,
64
64
  route: String,
65
65
  data: FinchAPI::Models::RequestForwardingForwardResponse::Request::data?,
66
- headers: ::Hash[Symbol, top?]?,
66
+ headers: ::Hash[Symbol, String]?,
67
67
  params: ::Hash[Symbol, top?]?
68
68
  }
69
69
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finch-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.34
4
+ version: 0.1.0.pre.alpha.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Finch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-04 00:00:00.000000000 Z
11
+ date: 2025-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool