finch-api 0.1.0.pre.alpha.26 → 0.1.0.pre.alpha.28

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/finch_api/internal/transport/pooled_net_requester.rb +1 -9
  5. data/lib/finch_api/internal/type/base_model.rb +1 -8
  6. data/lib/finch_api/internal/util.rb +1 -1
  7. data/lib/finch_api/models/access_token_create_params.rb +21 -13
  8. data/lib/finch_api/models/account_update_event.rb +28 -84
  9. data/lib/finch_api/models/create_access_token_response.rb +42 -42
  10. data/lib/finch_api/models/hris/benefit_create_params.rb +1 -3
  11. data/lib/finch_api/models/hris/benefits/individual_enroll_many_params.rb +6 -18
  12. data/lib/finch_api/models/hris/company/pay_statement_item/rule_create_params.rb +3 -10
  13. data/lib/finch_api/models/hris/company/pay_statement_item_list_params.rb +1 -3
  14. data/lib/finch_api/models/hris/company_benefit.rb +1 -3
  15. data/lib/finch_api/models/hris/document_list_params.rb +1 -4
  16. data/lib/finch_api/models/hris/employment_retrieve_many_params.rb +1 -3
  17. data/lib/finch_api/models/hris/individual_retrieve_many_params.rb +1 -3
  18. data/lib/finch_api/models/hris/pay_statement.rb +1 -4
  19. data/lib/finch_api/models/hris/pay_statement_retrieve_many_params.rb +1 -3
  20. data/lib/finch_api/models/introspection.rb +180 -137
  21. data/lib/finch_api/models/provider.rb +19 -68
  22. data/lib/finch_api/models/sandbox/connection_create_params.rb +1 -4
  23. data/lib/finch_api/models/sandbox/directory_create_params.rb +1 -4
  24. data/lib/finch_api/models/sandbox/payment_create_params.rb +7 -22
  25. data/lib/finch_api/resources/access_tokens.rb +9 -5
  26. data/lib/finch_api/version.rb +1 -1
  27. data/rbi/finch_api/errors.rbi +2 -2
  28. data/rbi/finch_api/models/access_token_create_params.rbi +17 -15
  29. data/rbi/finch_api/models/create_access_token_response.rbi +54 -51
  30. data/rbi/finch_api/models/introspection.rbi +309 -236
  31. data/rbi/finch_api/resources/access_tokens.rbi +7 -3
  32. data/sig/finch_api/models/access_token_create_params.rbs +7 -11
  33. data/sig/finch_api/models/create_access_token_response.rbs +25 -23
  34. data/sig/finch_api/models/introspection.rbs +139 -117
  35. data/sig/finch_api/resources/access_tokens.rbs +2 -2
  36. metadata +2 -2
@@ -6,17 +6,21 @@ module FinchAPI
6
6
  # Exchange the authorization code for an access token
7
7
  sig do
8
8
  params(
9
- code: String,
10
9
  client_id: String,
11
10
  client_secret: String,
11
+ code: String,
12
12
  redirect_uri: String,
13
13
  request_options: FinchAPI::RequestOptions::OrHash
14
14
  ).returns(FinchAPI::CreateAccessTokenResponse)
15
15
  end
16
16
  def create(
17
+ # The client ID for your application
18
+ client_id:,
19
+ # The client secret for your application
20
+ client_secret:,
21
+ # The authorization code received from the authorization server
17
22
  code:,
18
- client_id: nil,
19
- client_secret: nil,
23
+ # The redirect URI used in the authorization request (optional)
20
24
  redirect_uri: nil,
21
25
  request_options: {}
22
26
  )
@@ -2,9 +2,9 @@ module FinchAPI
2
2
  module Models
3
3
  type access_token_create_params =
4
4
  {
5
- code: String,
6
5
  client_id: String,
7
6
  client_secret: String,
7
+ code: String,
8
8
  redirect_uri: String
9
9
  }
10
10
  & FinchAPI::Internal::Type::request_parameters
@@ -13,32 +13,28 @@ module FinchAPI
13
13
  extend FinchAPI::Internal::Type::RequestParameters::Converter
14
14
  include FinchAPI::Internal::Type::RequestParameters
15
15
 
16
- attr_accessor code: String
17
-
18
- attr_reader client_id: String?
19
-
20
- def client_id=: (String) -> String
16
+ attr_accessor client_id: String
21
17
 
22
- attr_reader client_secret: String?
18
+ attr_accessor client_secret: String
23
19
 
24
- def client_secret=: (String) -> String
20
+ attr_accessor code: String
25
21
 
26
22
  attr_reader redirect_uri: String?
27
23
 
28
24
  def redirect_uri=: (String) -> String
29
25
 
30
26
  def initialize: (
27
+ client_id: String,
28
+ client_secret: String,
31
29
  code: String,
32
- ?client_id: String,
33
- ?client_secret: String,
34
30
  ?redirect_uri: String,
35
31
  ?request_options: FinchAPI::request_opts
36
32
  ) -> void
37
33
 
38
34
  def to_hash: -> {
39
- code: String,
40
35
  client_id: String,
41
36
  client_secret: String,
37
+ code: String,
42
38
  redirect_uri: String,
43
39
  request_options: FinchAPI::RequestOptions
44
40
  }
@@ -3,26 +3,22 @@ module FinchAPI
3
3
  type create_access_token_response =
4
4
  {
5
5
  access_token: String,
6
- account_id: String,
7
6
  client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type,
8
- company_id: String,
9
7
  connection_id: String,
10
8
  connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type,
11
9
  products: ::Array[String],
12
10
  provider_id: String,
13
- customer_id: String?,
14
- token_type: String
11
+ token_type: String,
12
+ account_id: String,
13
+ company_id: String,
14
+ customer_id: String?
15
15
  }
16
16
 
17
17
  class CreateAccessTokenResponse < FinchAPI::Internal::Type::BaseModel
18
18
  attr_accessor access_token: String
19
19
 
20
- attr_accessor account_id: String
21
-
22
20
  attr_accessor client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type
23
21
 
24
- attr_accessor company_id: String
25
-
26
22
  attr_accessor connection_id: String
27
23
 
28
24
  attr_accessor connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type
@@ -31,57 +27,63 @@ module FinchAPI
31
27
 
32
28
  attr_accessor provider_id: String
33
29
 
34
- attr_accessor customer_id: String?
30
+ attr_accessor token_type: String
31
+
32
+ attr_reader account_id: String?
33
+
34
+ def account_id=: (String) -> String
35
35
 
36
- attr_reader token_type: String?
36
+ attr_reader company_id: String?
37
37
 
38
- def token_type=: (String) -> String
38
+ def company_id=: (String) -> String
39
+
40
+ attr_accessor customer_id: String?
39
41
 
40
42
  def initialize: (
41
43
  access_token: String,
42
- account_id: String,
43
44
  client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type,
44
- company_id: String,
45
45
  connection_id: String,
46
46
  connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type,
47
47
  products: ::Array[String],
48
48
  provider_id: String,
49
- ?customer_id: String?,
50
- ?token_type: String
49
+ token_type: String,
50
+ ?account_id: String,
51
+ ?company_id: String,
52
+ ?customer_id: String?
51
53
  ) -> void
52
54
 
53
55
  def to_hash: -> {
54
56
  access_token: String,
55
- account_id: String,
56
57
  client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type,
57
- company_id: String,
58
58
  connection_id: String,
59
59
  connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type,
60
60
  products: ::Array[String],
61
61
  provider_id: String,
62
- customer_id: String?,
63
- token_type: String
62
+ token_type: String,
63
+ account_id: String,
64
+ company_id: String,
65
+ customer_id: String?
64
66
  }
65
67
 
66
- type client_type = :production | :development | :sandbox
68
+ type client_type = :development | :production | :sandbox
67
69
 
68
70
  module ClientType
69
71
  extend FinchAPI::Internal::Type::Enum
70
72
 
71
- PRODUCTION: :production
72
73
  DEVELOPMENT: :development
74
+ PRODUCTION: :production
73
75
  SANDBOX: :sandbox
74
76
 
75
77
  def self?.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::client_type]
76
78
  end
77
79
 
78
- type connection_type = :provider | :finch
80
+ type connection_type = :finch | :provider
79
81
 
80
82
  module ConnectionType
81
83
  extend FinchAPI::Internal::Type::Enum
82
84
 
83
- PROVIDER: :provider
84
85
  FINCH: :finch
86
+ PROVIDER: :provider
85
87
 
86
88
  def self?.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::connection_type]
87
89
  end
@@ -3,107 +3,181 @@ module FinchAPI
3
3
  type introspection =
4
4
  {
5
5
  id: String,
6
- account_id: String,
7
- authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
8
6
  client_id: String,
9
7
  client_type: FinchAPI::Models::Introspection::client_type,
10
- company_id: String,
11
8
  connection_id: String,
12
9
  connection_status: FinchAPI::Introspection::ConnectionStatus,
13
10
  connection_type: FinchAPI::Models::Introspection::connection_type,
11
+ products: ::Array[String],
12
+ provider_id: String,
13
+ account_id: String,
14
+ authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
15
+ company_id: String,
14
16
  customer_email: String?,
15
17
  customer_id: String?,
16
18
  customer_name: String?,
17
19
  manual: bool,
18
20
  payroll_provider_id: String,
19
- products: ::Array[String],
20
- provider_id: String,
21
- username: String
21
+ username: String?
22
22
  }
23
23
 
24
24
  class Introspection < FinchAPI::Internal::Type::BaseModel
25
25
  attr_accessor id: String
26
26
 
27
- attr_accessor account_id: String
28
-
29
- attr_accessor authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod]
30
-
31
27
  attr_accessor client_id: String
32
28
 
33
29
  attr_accessor client_type: FinchAPI::Models::Introspection::client_type
34
30
 
35
- attr_accessor company_id: String
36
-
37
31
  attr_accessor connection_id: String
38
32
 
39
33
  attr_accessor connection_status: FinchAPI::Introspection::ConnectionStatus
40
34
 
41
35
  attr_accessor connection_type: FinchAPI::Models::Introspection::connection_type
42
36
 
37
+ attr_accessor products: ::Array[String]
38
+
39
+ attr_accessor provider_id: String
40
+
41
+ attr_reader account_id: String?
42
+
43
+ def account_id=: (String) -> String
44
+
45
+ attr_reader authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod]?
46
+
47
+ def authentication_methods=: (
48
+ ::Array[FinchAPI::Introspection::AuthenticationMethod]
49
+ ) -> ::Array[FinchAPI::Introspection::AuthenticationMethod]
50
+
51
+ attr_reader company_id: String?
52
+
53
+ def company_id=: (String) -> String
54
+
43
55
  attr_accessor customer_email: String?
44
56
 
45
57
  attr_accessor customer_id: String?
46
58
 
47
59
  attr_accessor customer_name: String?
48
60
 
49
- attr_accessor manual: bool
61
+ attr_reader manual: bool?
50
62
 
51
- attr_accessor payroll_provider_id: String
63
+ def manual=: (bool) -> bool
52
64
 
53
- attr_accessor products: ::Array[String]
65
+ attr_reader payroll_provider_id: String?
54
66
 
55
- attr_accessor provider_id: String
67
+ def payroll_provider_id=: (String) -> String
56
68
 
57
- attr_accessor username: String
69
+ attr_accessor username: String?
58
70
 
59
71
  def initialize: (
60
72
  id: String,
61
- account_id: String,
62
- authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
63
73
  client_id: String,
64
74
  client_type: FinchAPI::Models::Introspection::client_type,
65
- company_id: String,
66
75
  connection_id: String,
67
76
  connection_status: FinchAPI::Introspection::ConnectionStatus,
68
77
  connection_type: FinchAPI::Models::Introspection::connection_type,
69
- customer_email: String?,
70
- customer_id: String?,
71
- customer_name: String?,
72
- manual: bool,
73
- payroll_provider_id: String,
74
78
  products: ::Array[String],
75
79
  provider_id: String,
76
- username: String
80
+ ?account_id: String,
81
+ ?authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
82
+ ?company_id: String,
83
+ ?customer_email: String?,
84
+ ?customer_id: String?,
85
+ ?customer_name: String?,
86
+ ?manual: bool,
87
+ ?payroll_provider_id: String,
88
+ ?username: String?
77
89
  ) -> void
78
90
 
79
91
  def to_hash: -> {
80
92
  id: String,
81
- account_id: String,
82
- authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
83
93
  client_id: String,
84
94
  client_type: FinchAPI::Models::Introspection::client_type,
85
- company_id: String,
86
95
  connection_id: String,
87
96
  connection_status: FinchAPI::Introspection::ConnectionStatus,
88
97
  connection_type: FinchAPI::Models::Introspection::connection_type,
98
+ products: ::Array[String],
99
+ provider_id: String,
100
+ account_id: String,
101
+ authentication_methods: ::Array[FinchAPI::Introspection::AuthenticationMethod],
102
+ company_id: String,
89
103
  customer_email: String?,
90
104
  customer_id: String?,
91
105
  customer_name: String?,
92
106
  manual: bool,
93
107
  payroll_provider_id: String,
94
- products: ::Array[String],
95
- provider_id: String,
96
- username: String
108
+ username: String?
97
109
  }
98
110
 
111
+ type client_type = :development | :production | :sandbox
112
+
113
+ module ClientType
114
+ extend FinchAPI::Internal::Type::Enum
115
+
116
+ DEVELOPMENT: :development
117
+ PRODUCTION: :production
118
+ SANDBOX: :sandbox
119
+
120
+ def self?.values: -> ::Array[FinchAPI::Models::Introspection::client_type]
121
+ end
122
+
123
+ type connection_status =
124
+ {
125
+ status: FinchAPI::Models::connection_status_type,
126
+ last_successful_sync: FinchAPI::Models::Introspection::ConnectionStatus::last_successful_sync?,
127
+ message: String
128
+ }
129
+
130
+ class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
131
+ attr_accessor status: FinchAPI::Models::connection_status_type
132
+
133
+ attr_accessor last_successful_sync: FinchAPI::Models::Introspection::ConnectionStatus::last_successful_sync?
134
+
135
+ attr_reader message: String?
136
+
137
+ def message=: (String) -> String
138
+
139
+ def initialize: (
140
+ status: FinchAPI::Models::connection_status_type,
141
+ ?last_successful_sync: FinchAPI::Models::Introspection::ConnectionStatus::last_successful_sync?,
142
+ ?message: String
143
+ ) -> void
144
+
145
+ def to_hash: -> {
146
+ status: FinchAPI::Models::connection_status_type,
147
+ last_successful_sync: FinchAPI::Models::Introspection::ConnectionStatus::last_successful_sync?,
148
+ message: String
149
+ }
150
+
151
+ type last_successful_sync = Time | String
152
+
153
+ module LastSuccessfulSync
154
+ extend FinchAPI::Internal::Type::Union
155
+
156
+ def self?.variants: -> ::Array[FinchAPI::Models::Introspection::ConnectionStatus::last_successful_sync]
157
+ end
158
+ end
159
+
160
+ type connection_type = :finch | :provider
161
+
162
+ module ConnectionType
163
+ extend FinchAPI::Internal::Type::Enum
164
+
165
+ FINCH: :finch
166
+ PROVIDER: :provider
167
+
168
+ def self?.values: -> ::Array[FinchAPI::Models::Introspection::connection_type]
169
+ end
170
+
99
171
  type authentication_method =
100
172
  {
173
+ type: FinchAPI::Models::Introspection::AuthenticationMethod::type_,
101
174
  connection_status: FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus,
102
- products: ::Array[String],
103
- type: FinchAPI::Models::Introspection::AuthenticationMethod::type_
175
+ products: ::Array[String]
104
176
  }
105
177
 
106
178
  class AuthenticationMethod < FinchAPI::Internal::Type::BaseModel
179
+ attr_accessor type: FinchAPI::Models::Introspection::AuthenticationMethod::type_
180
+
107
181
  attr_reader connection_status: FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus?
108
182
 
109
183
  def connection_status=: (
@@ -114,49 +188,18 @@ module FinchAPI
114
188
 
115
189
  def products=: (::Array[String]) -> ::Array[String]
116
190
 
117
- attr_reader type: FinchAPI::Models::Introspection::AuthenticationMethod::type_?
118
-
119
- def type=: (
120
- FinchAPI::Models::Introspection::AuthenticationMethod::type_
121
- ) -> FinchAPI::Models::Introspection::AuthenticationMethod::type_
122
-
123
191
  def initialize: (
192
+ type: FinchAPI::Models::Introspection::AuthenticationMethod::type_,
124
193
  ?connection_status: FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus,
125
- ?products: ::Array[String],
126
- ?type: FinchAPI::Models::Introspection::AuthenticationMethod::type_
194
+ ?products: ::Array[String]
127
195
  ) -> void
128
196
 
129
197
  def to_hash: -> {
198
+ type: FinchAPI::Models::Introspection::AuthenticationMethod::type_,
130
199
  connection_status: FinchAPI::Introspection::AuthenticationMethod::ConnectionStatus,
131
- products: ::Array[String],
132
- type: FinchAPI::Models::Introspection::AuthenticationMethod::type_
200
+ products: ::Array[String]
133
201
  }
134
202
 
135
- type connection_status =
136
- { message: String, status: FinchAPI::Models::connection_status_type }
137
-
138
- class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
139
- attr_reader message: String?
140
-
141
- def message=: (String) -> String
142
-
143
- attr_reader status: FinchAPI::Models::connection_status_type?
144
-
145
- def status=: (
146
- FinchAPI::Models::connection_status_type
147
- ) -> FinchAPI::Models::connection_status_type
148
-
149
- def initialize: (
150
- ?message: String,
151
- ?status: FinchAPI::Models::connection_status_type
152
- ) -> void
153
-
154
- def to_hash: -> {
155
- message: String,
156
- status: FinchAPI::Models::connection_status_type
157
- }
158
- end
159
-
160
203
  type type_ =
161
204
  :assisted | :credential | :api_token | :api_credential | :oauth
162
205
 
@@ -171,64 +214,43 @@ module FinchAPI
171
214
 
172
215
  def self?.values: -> ::Array[FinchAPI::Models::Introspection::AuthenticationMethod::type_]
173
216
  end
174
- end
175
-
176
- type client_type = :production | :development | :sandbox
177
-
178
- module ClientType
179
- extend FinchAPI::Internal::Type::Enum
180
217
 
181
- PRODUCTION: :production
182
- DEVELOPMENT: :development
183
- SANDBOX: :sandbox
184
-
185
- def self?.values: -> ::Array[FinchAPI::Models::Introspection::client_type]
186
- end
187
-
188
- type connection_status =
189
- {
190
- last_successful_sync: Time,
191
- message: String,
192
- status: FinchAPI::Models::connection_status_type
193
- }
194
-
195
- class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
196
- attr_reader last_successful_sync: Time?
197
-
198
- def last_successful_sync=: (Time) -> Time
199
-
200
- attr_reader message: String?
218
+ type connection_status =
219
+ {
220
+ status: FinchAPI::Models::connection_status_type,
221
+ last_successful_sync: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus::last_successful_sync?,
222
+ message: String
223
+ }
201
224
 
202
- def message=: (String) -> String
225
+ class ConnectionStatus < FinchAPI::Internal::Type::BaseModel
226
+ attr_accessor status: FinchAPI::Models::connection_status_type
203
227
 
204
- attr_reader status: FinchAPI::Models::connection_status_type?
228
+ attr_accessor last_successful_sync: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus::last_successful_sync?
205
229
 
206
- def status=: (
207
- FinchAPI::Models::connection_status_type
208
- ) -> FinchAPI::Models::connection_status_type
230
+ attr_reader message: String?
209
231
 
210
- def initialize: (
211
- ?last_successful_sync: Time,
212
- ?message: String,
213
- ?status: FinchAPI::Models::connection_status_type
214
- ) -> void
232
+ def message=: (String) -> String
215
233
 
216
- def to_hash: -> {
217
- last_successful_sync: Time,
218
- message: String,
219
- status: FinchAPI::Models::connection_status_type
220
- }
221
- end
234
+ def initialize: (
235
+ status: FinchAPI::Models::connection_status_type,
236
+ ?last_successful_sync: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus::last_successful_sync?,
237
+ ?message: String
238
+ ) -> void
222
239
 
223
- type connection_type = :provider | :finch
240
+ def to_hash: -> {
241
+ status: FinchAPI::Models::connection_status_type,
242
+ last_successful_sync: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus::last_successful_sync?,
243
+ message: String
244
+ }
224
245
 
225
- module ConnectionType
226
- extend FinchAPI::Internal::Type::Enum
246
+ type last_successful_sync = Time | String
227
247
 
228
- PROVIDER: :provider
229
- FINCH: :finch
248
+ module LastSuccessfulSync
249
+ extend FinchAPI::Internal::Type::Union
230
250
 
231
- def self?.values: -> ::Array[FinchAPI::Models::Introspection::connection_type]
251
+ def self?.variants: -> ::Array[FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus::last_successful_sync]
252
+ end
253
+ end
232
254
  end
233
255
  end
234
256
  end
@@ -2,9 +2,9 @@ module FinchAPI
2
2
  module Resources
3
3
  class AccessTokens
4
4
  def create: (
5
+ client_id: String,
6
+ client_secret: String,
5
7
  code: String,
6
- ?client_id: String,
7
- ?client_secret: String,
8
8
  ?redirect_uri: String,
9
9
  ?request_options: FinchAPI::request_opts
10
10
  ) -> FinchAPI::CreateAccessTokenResponse
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.26
4
+ version: 0.1.0.pre.alpha.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Finch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-14 00:00:00.000000000 Z
11
+ date: 2025-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool