onebusaway-sdk 1.0.23 → 1.0.25
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 +18 -0
- data/README.md +1 -1
- data/lib/onebusaway_sdk/internal/transport/base_client.rb +1 -4
- data/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/onebusaway_sdk/internal/type/array_of.rb +1 -0
- data/lib/onebusaway_sdk/internal/type/base_model.rb +4 -9
- data/lib/onebusaway_sdk/internal/type/converter.rb +27 -0
- data/lib/onebusaway_sdk/internal/type/hash_of.rb +1 -0
- data/lib/onebusaway_sdk/internal/type/union.rb +9 -7
- data/lib/onebusaway_sdk/internal/util.rb +1 -1
- data/lib/onebusaway_sdk/models/references.rb +2 -7
- data/lib/onebusaway_sdk/version.rb +1 -1
- data/rbi/onebusaway_sdk/errors.rbi +2 -2
- data/rbi/onebusaway_sdk/internal/type/converter.rbi +58 -0
- data/rbi/onebusaway_sdk/internal/type/union.rbi +9 -2
- data/sig/onebusaway_sdk/internal/type/converter.rbs +17 -0
- data/sig/onebusaway_sdk/internal/type/union.rbs +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a554c182517dea5b598f687715eceaf57488b94a2f678bcc88d8ed2e04f939eb
|
4
|
+
data.tar.gz: 985496dde2a75445bb278d3e908ccf327cfdb6fa02d5b420895c8413078d95c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1451c42307884127c9b18b8c14748770dc68902ea7fb7682a76c4f2bf35ca026793a37a3dab35ec563022cd43efd824161aac504e5db07a58cb72fe21b64affd
|
7
|
+
data.tar.gz: d6a2f02233fa296a2f149b5ff7dc1b0c181156275449be8ca69891eb733bf2d502c02ea0e811bfabf0dd9a4b6098b585e111bfb4678cd2711f05db545e6b59ab
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.25 (2025-08-20)
|
4
|
+
|
5
|
+
Full Changelog: [v1.0.24...v1.0.25](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.24...v1.0.25)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* bump sorbet version and fix new type errors from the breaking change ([c072aac](https://github.com/OneBusAway/ruby-sdk/commit/c072aac4d761e83878e4cb6a1ef9d66f277d5269))
|
10
|
+
|
11
|
+
## 1.0.24 (2025-08-10)
|
12
|
+
|
13
|
+
Full Changelog: [v1.0.23...v1.0.24](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.23...v1.0.24)
|
14
|
+
|
15
|
+
### Chores
|
16
|
+
|
17
|
+
* collect metadata from type DSL ([8c6ebea](https://github.com/OneBusAway/ruby-sdk/commit/8c6ebea6b7370965b7809e6747599dda37628a93))
|
18
|
+
* **internal:** update comment in script ([008e80f](https://github.com/OneBusAway/ruby-sdk/commit/008e80fd1d7f13cfe7c09f8cca1da9b11072388d))
|
19
|
+
* update @stainless-api/prism-cli to v5.15.0 ([2849a58](https://github.com/OneBusAway/ruby-sdk/commit/2849a582e1b7446b830f9e882575b9d5ba9e629c))
|
20
|
+
|
3
21
|
## 1.0.23 (2025-08-01)
|
4
22
|
|
5
23
|
Full Changelog: [v1.0.22...v1.0.23](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.22...v1.0.23)
|
data/README.md
CHANGED
@@ -370,10 +370,7 @@ module OnebusawaySDK
|
|
370
370
|
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
|
371
371
|
def send_request(request, redirect_count:, retry_count:, send_retry_header:)
|
372
372
|
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
|
373
|
-
input = {
|
374
|
-
**request.except(:timeout),
|
375
|
-
deadline: OnebusawaySDK::Internal::Util.monotonic_secs + timeout
|
376
|
-
}
|
373
|
+
input = {**request.except(:timeout), deadline: OnebusawaySDK::Internal::Util.monotonic_secs + timeout}
|
377
374
|
|
378
375
|
if send_retry_header
|
379
376
|
headers["x-stainless-retry-count"] = retry_count.to_s
|
@@ -193,15 +193,7 @@ module OnebusawaySDK
|
|
193
193
|
end
|
194
194
|
|
195
195
|
define_sorbet_constant!(:Request) do
|
196
|
-
T.type_alias
|
197
|
-
{
|
198
|
-
method: Symbol,
|
199
|
-
url: URI::Generic,
|
200
|
-
headers: T::Hash[String, String],
|
201
|
-
body: T.anything,
|
202
|
-
deadline: Float
|
203
|
-
}
|
204
|
-
end
|
196
|
+
T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} }
|
205
197
|
end
|
206
198
|
end
|
207
199
|
end
|
@@ -148,6 +148,7 @@ module OnebusawaySDK
|
|
148
148
|
# @option spec [Boolean] :"nil?"
|
149
149
|
def initialize(type_info, spec = {})
|
150
150
|
@item_type_fn = OnebusawaySDK::Internal::Type::Converter.type_info(type_info || spec)
|
151
|
+
@meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
|
151
152
|
@nilable = spec.fetch(:nil?, false)
|
152
153
|
end
|
153
154
|
|
@@ -52,6 +52,7 @@ module OnebusawaySDK
|
|
52
52
|
#
|
53
53
|
# @option spec [Boolean] :"nil?"
|
54
54
|
private def add_field(name_sym, required:, type_info:, spec:)
|
55
|
+
meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
|
55
56
|
type_fn, info =
|
56
57
|
case type_info
|
57
58
|
in Proc | OnebusawaySDK::Internal::Type::Converter | Class
|
@@ -63,14 +64,7 @@ module OnebusawaySDK
|
|
63
64
|
setter = :"#{name_sym}="
|
64
65
|
api_name = info.fetch(:api_name, name_sym)
|
65
66
|
nilable = info.fetch(:nil?, false)
|
66
|
-
const =
|
67
|
-
info.fetch(
|
68
|
-
:const,
|
69
|
-
OnebusawaySDK::Internal::OMIT
|
70
|
-
)
|
71
|
-
else
|
72
|
-
OnebusawaySDK::Internal::OMIT
|
73
|
-
end
|
67
|
+
const = required && !nilable ? info.fetch(:const, OnebusawaySDK::Internal::OMIT) : OnebusawaySDK::Internal::OMIT
|
74
68
|
|
75
69
|
[name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym)
|
76
70
|
|
@@ -81,7 +75,8 @@ module OnebusawaySDK
|
|
81
75
|
required: required,
|
82
76
|
nilable: nilable,
|
83
77
|
const: const,
|
84
|
-
type_fn: type_fn
|
78
|
+
type_fn: type_fn,
|
79
|
+
meta: meta
|
85
80
|
}
|
86
81
|
|
87
82
|
define_method(setter) do |value|
|
@@ -98,6 +98,33 @@ module OnebusawaySDK
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
# @api private
|
102
|
+
#
|
103
|
+
# @param type_info [Hash{Symbol=>Object}, Proc, OnebusawaySDK::Internal::Type::Converter, Class] .
|
104
|
+
#
|
105
|
+
# @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
106
|
+
#
|
107
|
+
# @option type_info [Proc] :enum
|
108
|
+
#
|
109
|
+
# @option type_info [Proc] :union
|
110
|
+
#
|
111
|
+
# @option type_info [Boolean] :"nil?"
|
112
|
+
#
|
113
|
+
# @param spec [Hash{Symbol=>Object}, Proc, OnebusawaySDK::Internal::Type::Converter, Class] .
|
114
|
+
#
|
115
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
116
|
+
#
|
117
|
+
# @option spec [Proc] :enum
|
118
|
+
#
|
119
|
+
# @option spec [Proc] :union
|
120
|
+
#
|
121
|
+
# @option spec [Boolean] :"nil?"
|
122
|
+
#
|
123
|
+
# @return [Hash{Symbol=>Object}]
|
124
|
+
def meta_info(type_info, spec)
|
125
|
+
[spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
|
126
|
+
end
|
127
|
+
|
101
128
|
# @api private
|
102
129
|
#
|
103
130
|
# @param translate_names [Boolean]
|
@@ -168,6 +168,7 @@ module OnebusawaySDK
|
|
168
168
|
# @option spec [Boolean] :"nil?"
|
169
169
|
def initialize(type_info, spec = {})
|
170
170
|
@item_type_fn = OnebusawaySDK::Internal::Type::Converter.type_info(type_info || spec)
|
171
|
+
@meta = OnebusawaySDK::Internal::Type::Converter.meta_info(type_info, spec)
|
171
172
|
@nilable = spec.fetch(:nil?, false)
|
172
173
|
end
|
173
174
|
|
@@ -12,20 +12,20 @@ module OnebusawaySDK
|
|
12
12
|
#
|
13
13
|
# All of the specified variant info for this union.
|
14
14
|
#
|
15
|
-
# @return [Array<Array(Symbol, Proc)>]
|
15
|
+
# @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
|
16
16
|
private def known_variants = (@known_variants ||= [])
|
17
17
|
|
18
18
|
# @api private
|
19
19
|
#
|
20
|
-
# @return [Array<Array(Symbol, Object)>]
|
20
|
+
# @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
|
21
21
|
protected def derefed_variants
|
22
|
-
known_variants.map { |key, variant_fn| [key, variant_fn.call] }
|
22
|
+
known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
|
23
23
|
end
|
24
24
|
|
25
25
|
# All of the specified variants for this union.
|
26
26
|
#
|
27
27
|
# @return [Array<Object>]
|
28
|
-
def variants = derefed_variants.map
|
28
|
+
def variants = derefed_variants.map { _2 }
|
29
29
|
|
30
30
|
# @api private
|
31
31
|
#
|
@@ -51,12 +51,13 @@ module OnebusawaySDK
|
|
51
51
|
#
|
52
52
|
# @option spec [Boolean] :"nil?"
|
53
53
|
private def variant(key, spec = nil)
|
54
|
+
meta = OnebusawaySDK::Internal::Type::Converter.meta_info(nil, spec)
|
54
55
|
variant_info =
|
55
56
|
case key
|
56
57
|
in Symbol
|
57
|
-
[key, OnebusawaySDK::Internal::Type::Converter.type_info(spec)]
|
58
|
+
[key, OnebusawaySDK::Internal::Type::Converter.type_info(spec), meta]
|
58
59
|
in Proc | OnebusawaySDK::Internal::Type::Converter | Class | Hash
|
59
|
-
[nil, OnebusawaySDK::Internal::Type::Converter.type_info(key)]
|
60
|
+
[nil, OnebusawaySDK::Internal::Type::Converter.type_info(key), meta]
|
60
61
|
end
|
61
62
|
|
62
63
|
known_variants << variant_info
|
@@ -79,7 +80,8 @@ module OnebusawaySDK
|
|
79
80
|
return nil if key == OnebusawaySDK::Internal::OMIT
|
80
81
|
|
81
82
|
key = key.to_sym if key.is_a?(String)
|
82
|
-
known_variants.find { |k,| k == key }
|
83
|
+
_, found = known_variants.find { |k,| k == key }
|
84
|
+
found&.call
|
83
85
|
else
|
84
86
|
nil
|
85
87
|
end
|
@@ -244,7 +244,7 @@ module OnebusawaySDK
|
|
244
244
|
#
|
245
245
|
# @return [String]
|
246
246
|
def uri_origin(uri)
|
247
|
-
"#{uri.scheme}://#{uri.host}#{uri.port
|
247
|
+
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
248
248
|
end
|
249
249
|
|
250
250
|
# @api private
|
@@ -16,10 +16,7 @@ module OnebusawaySDK
|
|
16
16
|
# @!attribute situations
|
17
17
|
#
|
18
18
|
# @return [Array<OnebusawaySDK::Models::References::Situation>]
|
19
|
-
required :situations,
|
20
|
-
-> {
|
21
|
-
OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation]
|
22
|
-
}
|
19
|
+
required :situations, -> { OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation] }
|
23
20
|
|
24
21
|
# @!attribute stops
|
25
22
|
#
|
@@ -215,9 +212,7 @@ module OnebusawaySDK
|
|
215
212
|
#
|
216
213
|
# @return [Array<OnebusawaySDK::Models::References::Situation::Consequence>, nil]
|
217
214
|
optional :consequences,
|
218
|
-
-> {
|
219
|
-
OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation::Consequence]
|
220
|
-
}
|
215
|
+
-> { OnebusawaySDK::Internal::Type::ArrayOf[OnebusawaySDK::References::Situation::Consequence] }
|
221
216
|
|
222
217
|
# @!attribute description
|
223
218
|
#
|
@@ -59,10 +59,10 @@ module OnebusawaySDK
|
|
59
59
|
end
|
60
60
|
|
61
61
|
class APIConnectionError < OnebusawaySDK::Errors::APIError
|
62
|
-
sig {
|
62
|
+
sig { returns(NilClass) }
|
63
63
|
attr_accessor :status
|
64
64
|
|
65
|
-
sig {
|
65
|
+
sig { returns(NilClass) }
|
66
66
|
attr_accessor :body
|
67
67
|
|
68
68
|
# @api private
|
@@ -95,6 +95,64 @@ module OnebusawaySDK
|
|
95
95
|
def self.type_info(spec)
|
96
96
|
end
|
97
97
|
|
98
|
+
# @api private
|
99
|
+
sig do
|
100
|
+
params(
|
101
|
+
type_info:
|
102
|
+
T.any(
|
103
|
+
{
|
104
|
+
const:
|
105
|
+
T.nilable(
|
106
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
107
|
+
),
|
108
|
+
enum:
|
109
|
+
T.nilable(
|
110
|
+
T.proc.returns(
|
111
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
112
|
+
)
|
113
|
+
),
|
114
|
+
union:
|
115
|
+
T.nilable(
|
116
|
+
T.proc.returns(
|
117
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
118
|
+
)
|
119
|
+
)
|
120
|
+
},
|
121
|
+
T.proc.returns(
|
122
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
123
|
+
),
|
124
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
125
|
+
),
|
126
|
+
spec:
|
127
|
+
T.any(
|
128
|
+
{
|
129
|
+
const:
|
130
|
+
T.nilable(
|
131
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
132
|
+
),
|
133
|
+
enum:
|
134
|
+
T.nilable(
|
135
|
+
T.proc.returns(
|
136
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
137
|
+
)
|
138
|
+
),
|
139
|
+
union:
|
140
|
+
T.nilable(
|
141
|
+
T.proc.returns(
|
142
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
143
|
+
)
|
144
|
+
)
|
145
|
+
},
|
146
|
+
T.proc.returns(
|
147
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
148
|
+
),
|
149
|
+
OnebusawaySDK::Internal::Type::Converter::Input
|
150
|
+
)
|
151
|
+
).returns(OnebusawaySDK::Internal::AnyHash)
|
152
|
+
end
|
153
|
+
def self.meta_info(type_info, spec)
|
154
|
+
end
|
155
|
+
|
98
156
|
# @api private
|
99
157
|
sig do
|
100
158
|
params(translate_names: T::Boolean).returns(
|
@@ -16,7 +16,8 @@ module OnebusawaySDK
|
|
16
16
|
T::Array[
|
17
17
|
[
|
18
18
|
T.nilable(Symbol),
|
19
|
-
T.proc.returns(OnebusawaySDK::Internal::Type::Converter::Input)
|
19
|
+
T.proc.returns(OnebusawaySDK::Internal::Type::Converter::Input),
|
20
|
+
OnebusawaySDK::Internal::AnyHash
|
20
21
|
]
|
21
22
|
]
|
22
23
|
)
|
@@ -25,7 +26,13 @@ module OnebusawaySDK
|
|
25
26
|
end
|
26
27
|
|
27
28
|
# @api private
|
28
|
-
sig
|
29
|
+
sig do
|
30
|
+
returns(
|
31
|
+
T::Array[
|
32
|
+
[T.nilable(Symbol), T.anything, OnebusawaySDK::Internal::AnyHash]
|
33
|
+
]
|
34
|
+
)
|
35
|
+
end
|
29
36
|
protected def derefed_variants
|
30
37
|
end
|
31
38
|
|
@@ -39,6 +39,23 @@ module OnebusawaySDK
|
|
39
39
|
| OnebusawaySDK::Internal::Type::Converter::input spec
|
40
40
|
) -> (^-> top)
|
41
41
|
|
42
|
+
def self.meta_info: (
|
43
|
+
{
|
44
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
45
|
+
enum: ^-> OnebusawaySDK::Internal::Type::Converter::input?,
|
46
|
+
union: ^-> OnebusawaySDK::Internal::Type::Converter::input?
|
47
|
+
}
|
48
|
+
| ^-> OnebusawaySDK::Internal::Type::Converter::input
|
49
|
+
| OnebusawaySDK::Internal::Type::Converter::input type_info,
|
50
|
+
{
|
51
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
52
|
+
enum: ^-> OnebusawaySDK::Internal::Type::Converter::input?,
|
53
|
+
union: ^-> OnebusawaySDK::Internal::Type::Converter::input?
|
54
|
+
}
|
55
|
+
| ^-> OnebusawaySDK::Internal::Type::Converter::input
|
56
|
+
| OnebusawaySDK::Internal::Type::Converter::input spec
|
57
|
+
) -> ::Hash[Symbol, top]
|
58
|
+
|
42
59
|
def self.new_coerce_state: (
|
43
60
|
?translate_names: bool
|
44
61
|
) -> OnebusawaySDK::Internal::Type::Converter::coerce_state
|
@@ -5,9 +5,9 @@ module OnebusawaySDK
|
|
5
5
|
include OnebusawaySDK::Internal::Type::Converter
|
6
6
|
include OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
|
7
7
|
|
8
|
-
private def self.known_variants: -> ::Array[[Symbol?, (^-> OnebusawaySDK::Internal::Type::Converter::input)]]
|
8
|
+
private def self.known_variants: -> ::Array[[Symbol?, (^-> OnebusawaySDK::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
|
9
9
|
|
10
|
-
def self.derefed_variants: -> ::Array[[Symbol?, top]]
|
10
|
+
def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
|
11
11
|
|
12
12
|
def self.variants: -> ::Array[top]
|
13
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebusaway-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Onebusaway SDK
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|