finch-api 0.1.0.pre.alpha.3 → 0.1.0.pre.alpha.4
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/lib/finch-api/base_model.rb +421 -473
- data/lib/finch-api/individuals_page.rb +1 -1
- data/lib/finch-api/models/introspection.rb +12 -1
- data/lib/finch-api/page.rb +1 -1
- data/lib/finch-api/single_page.rb +1 -1
- data/lib/finch-api/util.rb +3 -5
- data/lib/finch-api/version.rb +1 -1
- data/lib/finch-api.rb +0 -1
- data/rbi/lib/finch-api/base_client.rbi +1 -1
- data/rbi/lib/finch-api/base_model.rbi +84 -118
- data/rbi/lib/finch-api/models/introspection.rbi +20 -3
- data/rbi/lib/finch-api/version.rbi +1 -1
- data/sig/finch-api/base_client.rbs +1 -1
- data/sig/finch-api/base_model.rbs +41 -53
- data/sig/finch-api/models/introspection.rbs +10 -1
- data/sig/finch-api/version.rbs +1 -1
- metadata +2 -5
- data/lib/finch-api/extern.rb +0 -7
- data/rbi/lib/finch-api/extern.rbi +0 -7
- data/sig/finch-api/extern.rbs +0 -4
@@ -2,13 +2,16 @@ module FinchAPI
|
|
2
2
|
module Converter
|
3
3
|
type input = FinchAPI::Converter | Class
|
4
4
|
|
5
|
-
|
5
|
+
type state =
|
6
|
+
{
|
7
|
+
strictness: bool | :strong,
|
8
|
+
exactness: { yes: Integer, no: Integer, maybe: Integer },
|
9
|
+
branched: Integer
|
10
|
+
}
|
6
11
|
|
7
|
-
def
|
12
|
+
def coerce: (top value, state: FinchAPI::Converter::state) -> top
|
8
13
|
|
9
|
-
def
|
10
|
-
top value
|
11
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
14
|
+
def dump: (top value) -> top
|
12
15
|
|
13
16
|
def self.type_info: (
|
14
17
|
{
|
@@ -20,14 +23,13 @@ module FinchAPI
|
|
20
23
|
| FinchAPI::Converter::input spec
|
21
24
|
) -> (^-> top)
|
22
25
|
|
23
|
-
def self.coerce: (
|
24
|
-
|
25
|
-
def self.dump: (FinchAPI::Converter::input target, top value) -> top
|
26
|
-
|
27
|
-
def self.try_strict_coerce: (
|
26
|
+
def self.coerce: (
|
28
27
|
FinchAPI::Converter::input target,
|
29
|
-
top value
|
28
|
+
top value,
|
29
|
+
?state: FinchAPI::Converter::state
|
30
30
|
) -> top
|
31
|
+
|
32
|
+
def self.dump: (FinchAPI::Converter::input target, top value) -> top
|
31
33
|
end
|
32
34
|
|
33
35
|
class Unknown
|
@@ -37,13 +39,9 @@ module FinchAPI
|
|
37
39
|
|
38
40
|
def self.==: (top other) -> bool
|
39
41
|
|
40
|
-
def self.coerce: (top value) -> top
|
42
|
+
def self.coerce: (top value, state: FinchAPI::Converter::state) -> top
|
41
43
|
|
42
44
|
def self.dump: (top value) -> top
|
43
|
-
|
44
|
-
def self.try_strict_coerce: (
|
45
|
-
top value
|
46
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
47
45
|
end
|
48
46
|
|
49
47
|
class BooleanModel
|
@@ -53,13 +51,12 @@ module FinchAPI
|
|
53
51
|
|
54
52
|
def self.==: (top other) -> bool
|
55
53
|
|
56
|
-
def self.coerce: (
|
54
|
+
def self.coerce: (
|
55
|
+
bool | top value,
|
56
|
+
state: FinchAPI::Converter::state
|
57
|
+
) -> (bool | top)
|
57
58
|
|
58
59
|
def self.dump: (bool | top value) -> (bool | top)
|
59
|
-
|
60
|
-
def self.try_strict_coerce: (
|
61
|
-
top value
|
62
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
63
60
|
end
|
64
61
|
|
65
62
|
module Enum
|
@@ -73,13 +70,12 @@ module FinchAPI
|
|
73
70
|
|
74
71
|
def ==: (top other) -> bool
|
75
72
|
|
76
|
-
def coerce: (
|
73
|
+
def coerce: (
|
74
|
+
String | Symbol | top value,
|
75
|
+
state: FinchAPI::Converter::state
|
76
|
+
) -> (Symbol | top)
|
77
77
|
|
78
78
|
def dump: (Symbol | top value) -> (Symbol | top)
|
79
|
-
|
80
|
-
def try_strict_coerce: (
|
81
|
-
top value
|
82
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
83
79
|
end
|
84
80
|
|
85
81
|
module Union
|
@@ -109,13 +105,9 @@ module FinchAPI
|
|
109
105
|
|
110
106
|
def ==: (top other) -> bool
|
111
107
|
|
112
|
-
def coerce: (top value) -> top
|
108
|
+
def coerce: (top value, state: FinchAPI::Converter::state) -> top
|
113
109
|
|
114
110
|
def dump: (top value) -> top
|
115
|
-
|
116
|
-
def try_strict_coerce: (
|
117
|
-
top value
|
118
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
119
111
|
end
|
120
112
|
|
121
113
|
class ArrayOf
|
@@ -132,16 +124,17 @@ module FinchAPI
|
|
132
124
|
|
133
125
|
def ==: (top other) -> bool
|
134
126
|
|
135
|
-
def coerce: (
|
127
|
+
def coerce: (
|
128
|
+
Enumerable[top] | top value,
|
129
|
+
state: FinchAPI::Converter::state
|
130
|
+
) -> (::Array[top] | top)
|
136
131
|
|
137
132
|
def dump: (Enumerable[top] | top value) -> (::Array[top] | top)
|
138
133
|
|
139
|
-
def try_strict_coerce: (
|
140
|
-
top value
|
141
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
142
|
-
|
143
134
|
def item_type: -> top
|
144
135
|
|
136
|
+
def nilable?: -> bool
|
137
|
+
|
145
138
|
def initialize: (
|
146
139
|
::Hash[Symbol, top]
|
147
140
|
| ^-> FinchAPI::Converter::input
|
@@ -164,16 +157,17 @@ module FinchAPI
|
|
164
157
|
|
165
158
|
def ==: (top other) -> bool
|
166
159
|
|
167
|
-
def coerce: (
|
160
|
+
def coerce: (
|
161
|
+
::Hash[top, top] | top value,
|
162
|
+
state: FinchAPI::Converter::state
|
163
|
+
) -> (::Hash[Symbol, top] | top)
|
168
164
|
|
169
165
|
def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top)
|
170
166
|
|
171
|
-
def try_strict_coerce: (
|
172
|
-
top value
|
173
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
174
|
-
|
175
167
|
def item_type: -> top
|
176
168
|
|
169
|
+
def nilable?: -> bool
|
170
|
+
|
177
171
|
def initialize: (
|
178
172
|
::Hash[Symbol, top]
|
179
173
|
| ^-> FinchAPI::Converter::input
|
@@ -185,18 +179,15 @@ module FinchAPI
|
|
185
179
|
class BaseModel
|
186
180
|
extend FinchAPI::Converter
|
187
181
|
|
188
|
-
type known_field =
|
182
|
+
type known_field =
|
183
|
+
{ mode: (:coerce | :dump)?, required: bool, nilable: bool }
|
189
184
|
|
190
185
|
def self.known_fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field
|
191
186
|
& { type_fn: (^-> FinchAPI::Converter::input) })]
|
192
187
|
|
193
|
-
def self.reverse_map: -> ::Hash[Symbol, Symbol]
|
194
|
-
|
195
188
|
def self.fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field
|
196
189
|
& { type: FinchAPI::Converter::input })]
|
197
190
|
|
198
|
-
def self.defaults: -> ::Hash[Symbol, (^-> Class)]
|
199
|
-
|
200
191
|
private def self.add_field: (
|
201
192
|
Symbol name_sym,
|
202
193
|
required: bool,
|
@@ -231,18 +222,17 @@ module FinchAPI
|
|
231
222
|
|
232
223
|
private def self.response_only: { -> void } -> void
|
233
224
|
|
225
|
+
def self.==: (top other) -> bool
|
226
|
+
|
234
227
|
def ==: (top other) -> bool
|
235
228
|
|
236
229
|
def self.coerce: (
|
237
|
-
FinchAPI::BaseModel | ::Hash[top, top] | top value
|
230
|
+
FinchAPI::BaseModel | ::Hash[top, top] | top value,
|
231
|
+
state: FinchAPI::Converter::state
|
238
232
|
) -> (instance | top)
|
239
233
|
|
240
234
|
def self.dump: (instance | top value) -> (::Hash[top, top] | top)
|
241
235
|
|
242
|
-
def self.try_strict_coerce: (
|
243
|
-
top value
|
244
|
-
) -> ([true, top, nil] | [false, bool, Integer])
|
245
|
-
|
246
236
|
def []: (Symbol key) -> top?
|
247
237
|
|
248
238
|
def to_h: -> ::Hash[Symbol, top]
|
@@ -253,8 +243,6 @@ module FinchAPI
|
|
253
243
|
|
254
244
|
def initialize: (?::Hash[Symbol, top] | self data) -> void
|
255
245
|
|
256
|
-
def to_s: -> String
|
257
|
-
|
258
246
|
def inspect: -> String
|
259
247
|
end
|
260
248
|
end
|
@@ -157,9 +157,17 @@ module FinchAPI
|
|
157
157
|
end
|
158
158
|
|
159
159
|
type connection_status =
|
160
|
-
{
|
160
|
+
{
|
161
|
+
last_successful_sync: Time,
|
162
|
+
message: String,
|
163
|
+
status: FinchAPI::Models::connection_status_type
|
164
|
+
}
|
161
165
|
|
162
166
|
class ConnectionStatus < FinchAPI::BaseModel
|
167
|
+
attr_reader last_successful_sync: Time?
|
168
|
+
|
169
|
+
def last_successful_sync=: (Time) -> Time
|
170
|
+
|
163
171
|
attr_reader message: String?
|
164
172
|
|
165
173
|
def message=: (String) -> String
|
@@ -171,6 +179,7 @@ module FinchAPI
|
|
171
179
|
) -> FinchAPI::Models::connection_status_type
|
172
180
|
|
173
181
|
def initialize: (
|
182
|
+
?last_successful_sync: Time,
|
174
183
|
?message: String,
|
175
184
|
?status: FinchAPI::Models::connection_status_type
|
176
185
|
) -> void
|
data/sig/finch-api/version.rbs
CHANGED
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.
|
4
|
+
version: 0.1.0.pre.alpha.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Finch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -38,7 +38,6 @@ files:
|
|
38
38
|
- lib/finch-api/base_page.rb
|
39
39
|
- lib/finch-api/client.rb
|
40
40
|
- lib/finch-api/errors.rb
|
41
|
-
- lib/finch-api/extern.rb
|
42
41
|
- lib/finch-api/individuals_page.rb
|
43
42
|
- lib/finch-api/models/access_token_create_params.rb
|
44
43
|
- lib/finch-api/models/account_disconnect_params.rb
|
@@ -198,7 +197,6 @@ files:
|
|
198
197
|
- rbi/lib/finch-api/base_page.rbi
|
199
198
|
- rbi/lib/finch-api/client.rbi
|
200
199
|
- rbi/lib/finch-api/errors.rbi
|
201
|
-
- rbi/lib/finch-api/extern.rbi
|
202
200
|
- rbi/lib/finch-api/individuals_page.rbi
|
203
201
|
- rbi/lib/finch-api/models/access_token_create_params.rbi
|
204
202
|
- rbi/lib/finch-api/models/account_disconnect_params.rbi
|
@@ -357,7 +355,6 @@ files:
|
|
357
355
|
- sig/finch-api/base_page.rbs
|
358
356
|
- sig/finch-api/client.rbs
|
359
357
|
- sig/finch-api/errors.rbs
|
360
|
-
- sig/finch-api/extern.rbs
|
361
358
|
- sig/finch-api/individuals_page.rbs
|
362
359
|
- sig/finch-api/models/access_token_create_params.rbs
|
363
360
|
- sig/finch-api/models/account_disconnect_params.rbs
|
data/lib/finch-api/extern.rb
DELETED
data/sig/finch-api/extern.rbs
DELETED