sofia 0.1.1 → 0.1.2
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 +10 -0
- data/CLAUDE.md +53 -0
- data/README.md +67 -1
- data/lib/sofia/adapter/net_http.rb +28 -14
- data/lib/sofia/adapter/soren.rb +101 -0
- data/lib/sofia/adapter.rb +1 -0
- data/lib/sofia/client.rb +9 -4
- data/lib/sofia/defaults/timeouts.rb +12 -0
- data/lib/sofia/defaults.rb +8 -0
- data/lib/sofia/options.rb +29 -0
- data/lib/sofia/request.rb +18 -14
- data/lib/sofia/response.rb +2 -2
- data/lib/sofia/types/client/adapter.rb +43 -0
- data/lib/sofia/types/client/base_url.rb +35 -0
- data/lib/sofia/types/client/body.rb +62 -0
- data/lib/sofia/types/client/headers.rb +58 -0
- data/lib/sofia/types/client/options.rb +33 -0
- data/lib/sofia/types/client/params.rb +57 -0
- data/lib/sofia/types/client/path.rb +30 -0
- data/lib/sofia/types/client.rb +16 -0
- data/lib/sofia/types/options/timeout/base.rb +34 -0
- data/lib/sofia/types/options/timeout/connection.rb +12 -0
- data/lib/sofia/types/options/timeout/read.rb +12 -0
- data/lib/sofia/types/options/timeout/write.rb +12 -0
- data/lib/sofia/types/options/timeout.rb +15 -0
- data/lib/sofia/types/options.rb +10 -0
- data/lib/sofia/types.rb +2 -6
- data/lib/sofia/version.rb +1 -1
- data/lib/sofia.rb +7 -5
- data/sorbet/rbi/gems/soren@0.1.2.rbi +934 -0
- metadata +36 -8
- data/lib/sofia/types/adapter.rb +0 -39
- data/lib/sofia/types/base_url.rb +0 -33
- data/lib/sofia/types/body.rb +0 -60
- data/lib/sofia/types/headers.rb +0 -56
- data/lib/sofia/types/params.rb +0 -56
- data/lib/sofia/types/path.rb +0 -28
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `soren` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem soren`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# source://soren//lib/soren/core_ext/blank.rb#4
|
|
9
|
+
class Object < ::BasicObject
|
|
10
|
+
include ::Kernel
|
|
11
|
+
include ::PP::ObjectMixin
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# source://soren//lib/soren/version.rb#3
|
|
15
|
+
module Soren; end
|
|
16
|
+
|
|
17
|
+
# source://soren//lib/soren/connection.rb#19
|
|
18
|
+
class Soren::Connection
|
|
19
|
+
# : (?host: untyped, ?port: untyped, ?scheme: untyped, ?uri: untyped, ?options: untyped) -> void
|
|
20
|
+
#
|
|
21
|
+
# @return [Connection] a new instance of Connection
|
|
22
|
+
#
|
|
23
|
+
# source://soren//lib/soren/connection.rb#23
|
|
24
|
+
def initialize(host: T.unsafe(nil), port: T.unsafe(nil), scheme: T.unsafe(nil), uri: T.unsafe(nil), options: T.unsafe(nil)); end
|
|
25
|
+
|
|
26
|
+
# : -> (TCPSocket | OpenSSL::SSL::SSLSocket)
|
|
27
|
+
#
|
|
28
|
+
# source://soren//lib/soren/connection.rb#33
|
|
29
|
+
def open_socket; end
|
|
30
|
+
|
|
31
|
+
# : Soren::Options?
|
|
32
|
+
#
|
|
33
|
+
# source://soren//lib/soren/connection.rb#20
|
|
34
|
+
def options; end
|
|
35
|
+
|
|
36
|
+
# : (Soren::Request) -> Soren::Response
|
|
37
|
+
#
|
|
38
|
+
# source://soren//lib/soren/connection.rb#65
|
|
39
|
+
def send(request); end
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
# : (Float?) -> TCPSocket
|
|
44
|
+
#
|
|
45
|
+
# source://soren//lib/soren/connection.rb#82
|
|
46
|
+
def open_tcp_socket(timeout); end
|
|
47
|
+
|
|
48
|
+
# : (host: untyped, port: untyped, scheme: untyped, uri: untyped) -> [untyped, untyped, untyped]
|
|
49
|
+
#
|
|
50
|
+
# source://soren//lib/soren/connection.rb#105
|
|
51
|
+
def resolve_connection_parts(host:, port:, scheme:, uri:); end
|
|
52
|
+
|
|
53
|
+
# : (OpenSSL::SSL::SSLSocket, Soren::Deadline?) -> void
|
|
54
|
+
#
|
|
55
|
+
# source://soren//lib/soren/connection.rb#87
|
|
56
|
+
def ssl_connect_with_timeout(ssl, deadline); end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# source://soren//lib/soren/deadline.rb#5
|
|
60
|
+
class Soren::Deadline
|
|
61
|
+
# : (Float) -> void
|
|
62
|
+
#
|
|
63
|
+
# @return [Deadline] a new instance of Deadline
|
|
64
|
+
#
|
|
65
|
+
# source://soren//lib/soren/deadline.rb#16
|
|
66
|
+
def initialize(deadline_at); end
|
|
67
|
+
|
|
68
|
+
# : -> bool
|
|
69
|
+
#
|
|
70
|
+
# @return [Boolean]
|
|
71
|
+
#
|
|
72
|
+
# source://soren//lib/soren/deadline.rb#27
|
|
73
|
+
def expired?; end
|
|
74
|
+
|
|
75
|
+
# : -> Float
|
|
76
|
+
#
|
|
77
|
+
# source://soren//lib/soren/deadline.rb#21
|
|
78
|
+
def remaining; end
|
|
79
|
+
|
|
80
|
+
class << self
|
|
81
|
+
# : (Float?) -> Soren::Deadline?
|
|
82
|
+
#
|
|
83
|
+
# source://soren//lib/soren/deadline.rb#8
|
|
84
|
+
def start(timeout); end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# source://soren//lib/soren/decoders/gzip.rb#8
|
|
89
|
+
module Soren::Decoders; end
|
|
90
|
+
|
|
91
|
+
# source://soren//lib/soren/decoders/deflate.rb#8
|
|
92
|
+
class Soren::Decoders::Deflate
|
|
93
|
+
# : (String) -> void
|
|
94
|
+
#
|
|
95
|
+
# @return [Deflate] a new instance of Deflate
|
|
96
|
+
#
|
|
97
|
+
# source://soren//lib/soren/decoders/deflate.rb#10
|
|
98
|
+
def initialize(body); end
|
|
99
|
+
|
|
100
|
+
# : -> String
|
|
101
|
+
#
|
|
102
|
+
# source://soren//lib/soren/decoders/deflate.rb#15
|
|
103
|
+
def decode; end
|
|
104
|
+
|
|
105
|
+
private
|
|
106
|
+
|
|
107
|
+
# : -> String
|
|
108
|
+
#
|
|
109
|
+
# source://soren//lib/soren/decoders/deflate.rb#24
|
|
110
|
+
def decode_raw_deflate; end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# source://soren//lib/soren/decoders/gzip.rb#9
|
|
114
|
+
class Soren::Decoders::Gzip
|
|
115
|
+
# : (String) -> void
|
|
116
|
+
#
|
|
117
|
+
# @return [Gzip] a new instance of Gzip
|
|
118
|
+
#
|
|
119
|
+
# source://soren//lib/soren/decoders/gzip.rb#11
|
|
120
|
+
def initialize(body); end
|
|
121
|
+
|
|
122
|
+
# : -> String
|
|
123
|
+
#
|
|
124
|
+
# source://soren//lib/soren/decoders/gzip.rb#16
|
|
125
|
+
def decode; end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# source://soren//lib/soren/defaults/options.rb#5
|
|
129
|
+
module Soren::Defaults; end
|
|
130
|
+
|
|
131
|
+
# source://soren//lib/soren/defaults/options.rb#6
|
|
132
|
+
module Soren::Defaults::Options; end
|
|
133
|
+
|
|
134
|
+
# source://soren//lib/soren/defaults/options.rb#8
|
|
135
|
+
Soren::Defaults::Options::CONNECT_TIMEOUT = T.let(T.unsafe(nil), Float)
|
|
136
|
+
|
|
137
|
+
# source://soren//lib/soren/defaults/options.rb#7
|
|
138
|
+
Soren::Defaults::Options::READ_TIMEOUT = T.let(T.unsafe(nil), Float)
|
|
139
|
+
|
|
140
|
+
# source://soren//lib/soren/defaults/options.rb#9
|
|
141
|
+
Soren::Defaults::Options::WRITE_TIMEOUT = T.let(T.unsafe(nil), Float)
|
|
142
|
+
|
|
143
|
+
# source://soren//lib/soren/error.rb#5
|
|
144
|
+
module Soren::Error; end
|
|
145
|
+
|
|
146
|
+
# source://soren//lib/soren/error/argument_error.rb#6
|
|
147
|
+
class Soren::Error::ArgumentError < ::Soren::Error::Base; end
|
|
148
|
+
|
|
149
|
+
# source://soren//lib/soren/error.rb#6
|
|
150
|
+
class Soren::Error::Base < ::StandardError; end
|
|
151
|
+
|
|
152
|
+
# source://soren//lib/soren/error/connection_error.rb#6
|
|
153
|
+
class Soren::Error::ConnectionError < ::Soren::Error::Base; end
|
|
154
|
+
|
|
155
|
+
# source://soren//lib/soren/error/connection_refused.rb#6
|
|
156
|
+
class Soren::Error::ConnectionRefused < ::Soren::Error::ConnectionError; end
|
|
157
|
+
|
|
158
|
+
# source://soren//lib/soren/error/dns_failure.rb#6
|
|
159
|
+
class Soren::Error::DNSFailure < ::Soren::Error::ConnectionError; end
|
|
160
|
+
|
|
161
|
+
# source://soren//lib/soren/error/parse_error.rb#6
|
|
162
|
+
class Soren::Error::ParseError < ::Soren::Error::Base; end
|
|
163
|
+
|
|
164
|
+
# source://soren//lib/soren/error/protocol_error.rb#6
|
|
165
|
+
class Soren::Error::ProtocolError < ::Soren::Error::Base; end
|
|
166
|
+
|
|
167
|
+
# source://soren//lib/soren/error/read_error.rb#6
|
|
168
|
+
class Soren::Error::ReadError < ::Soren::Error::Base; end
|
|
169
|
+
|
|
170
|
+
# source://soren//lib/soren/error/read_timeout.rb#6
|
|
171
|
+
class Soren::Error::ReadTimeout < ::Soren::Error::TimeoutError; end
|
|
172
|
+
|
|
173
|
+
# source://soren//lib/soren/error/ssl_error.rb#6
|
|
174
|
+
class Soren::Error::SSLError < ::Soren::Error::Base; end
|
|
175
|
+
|
|
176
|
+
# source://soren//lib/soren/error/timeout_error.rb#6
|
|
177
|
+
class Soren::Error::TimeoutError < ::Soren::Error::ConnectionError; end
|
|
178
|
+
|
|
179
|
+
# source://soren//lib/soren/error/write_timeout.rb#6
|
|
180
|
+
class Soren::Error::WriteTimeout < ::Soren::Error::TimeoutError; end
|
|
181
|
+
|
|
182
|
+
# source://soren//lib/soren/options.rb#8
|
|
183
|
+
class Soren::Options
|
|
184
|
+
# : (?untyped) -> void
|
|
185
|
+
#
|
|
186
|
+
# @return [Options] a new instance of Options
|
|
187
|
+
#
|
|
188
|
+
# source://soren//lib/soren/options.rb#13
|
|
189
|
+
def initialize(options = T.unsafe(nil)); end
|
|
190
|
+
|
|
191
|
+
# : -> Float
|
|
192
|
+
#
|
|
193
|
+
# source://soren//lib/soren/options.rb#28
|
|
194
|
+
def connect_timeout; end
|
|
195
|
+
|
|
196
|
+
# : -> Float
|
|
197
|
+
#
|
|
198
|
+
# source://soren//lib/soren/options.rb#23
|
|
199
|
+
def read_timeout; end
|
|
200
|
+
|
|
201
|
+
# : -> Float
|
|
202
|
+
#
|
|
203
|
+
# source://soren//lib/soren/options.rb#33
|
|
204
|
+
def write_timeout; end
|
|
205
|
+
|
|
206
|
+
private
|
|
207
|
+
|
|
208
|
+
# : (Symbol | String) -> Symbol
|
|
209
|
+
#
|
|
210
|
+
# @raise [Soren::Error::ArgumentError]
|
|
211
|
+
#
|
|
212
|
+
# source://soren//lib/soren/options.rb#61
|
|
213
|
+
def normalize_key(key); end
|
|
214
|
+
|
|
215
|
+
# : (untyped) -> Hash[Symbol, untyped]
|
|
216
|
+
#
|
|
217
|
+
# source://soren//lib/soren/options.rb#40
|
|
218
|
+
def normalize_options(options); end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# source://soren//lib/soren/options.rb#9
|
|
222
|
+
Soren::Options::AVAILABLE_OPTIONS = T.let(T.unsafe(nil), Array)
|
|
223
|
+
|
|
224
|
+
# source://soren//lib/soren/parsers/response/status_line.rb#5
|
|
225
|
+
module Soren::Parsers; end
|
|
226
|
+
|
|
227
|
+
# source://soren//lib/soren/parsers/response/status_line.rb#6
|
|
228
|
+
class Soren::Parsers::Response
|
|
229
|
+
# : (untyped, ?deadline: Deadline?) -> void
|
|
230
|
+
#
|
|
231
|
+
# @return [Response] a new instance of Response
|
|
232
|
+
#
|
|
233
|
+
# source://soren//lib/soren/parsers/response.rb#21
|
|
234
|
+
def initialize(source, deadline: T.unsafe(nil)); end
|
|
235
|
+
|
|
236
|
+
# : -> Hash[Symbol, untyped]
|
|
237
|
+
#
|
|
238
|
+
# source://soren//lib/soren/parsers/response.rb#27
|
|
239
|
+
def parse; end
|
|
240
|
+
|
|
241
|
+
private
|
|
242
|
+
|
|
243
|
+
# : (Soren::Socket::Reader) -> Array[String]
|
|
244
|
+
#
|
|
245
|
+
# source://soren//lib/soren/parsers/response.rb#64
|
|
246
|
+
def read_header_lines(reader); end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# source://soren//lib/soren/parsers/response/body.rb#12
|
|
250
|
+
class Soren::Parsers::Response::Body
|
|
251
|
+
# : (reader: Soren::Socket::Reader, headers: Soren::Types::Response::Headers, code: Soren::Types::Response::Code) -> void
|
|
252
|
+
#
|
|
253
|
+
# @return [Body] a new instance of Body
|
|
254
|
+
#
|
|
255
|
+
# source://soren//lib/soren/parsers/response/body.rb#14
|
|
256
|
+
def initialize(reader:, headers:, code:); end
|
|
257
|
+
|
|
258
|
+
# : -> String
|
|
259
|
+
#
|
|
260
|
+
# source://soren//lib/soren/parsers/response/body.rb#21
|
|
261
|
+
def parse; end
|
|
262
|
+
|
|
263
|
+
private
|
|
264
|
+
|
|
265
|
+
# : -> void
|
|
266
|
+
#
|
|
267
|
+
# source://soren//lib/soren/parsers/response/body.rb#89
|
|
268
|
+
def consume_chunked_trailers; end
|
|
269
|
+
|
|
270
|
+
# : (String) -> String
|
|
271
|
+
#
|
|
272
|
+
# source://soren//lib/soren/parsers/response/body.rb#48
|
|
273
|
+
def decode_content_encodings(body); end
|
|
274
|
+
|
|
275
|
+
# : -> bool
|
|
276
|
+
#
|
|
277
|
+
# @return [Boolean]
|
|
278
|
+
#
|
|
279
|
+
# source://soren//lib/soren/parsers/response/body.rb#43
|
|
280
|
+
def no_body?; end
|
|
281
|
+
|
|
282
|
+
# : -> String
|
|
283
|
+
#
|
|
284
|
+
# source://soren//lib/soren/parsers/response/body.rb#66
|
|
285
|
+
def parse_chunked_body; end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# source://soren//lib/soren/parsers/response/headers.rb#7
|
|
289
|
+
class Soren::Parsers::Response::Headers
|
|
290
|
+
# : (untyped) -> void
|
|
291
|
+
#
|
|
292
|
+
# @return [Headers] a new instance of Headers
|
|
293
|
+
#
|
|
294
|
+
# source://soren//lib/soren/parsers/response/headers.rb#9
|
|
295
|
+
def initialize(header_lines); end
|
|
296
|
+
|
|
297
|
+
# : -> Hash[String, Array[String]]
|
|
298
|
+
#
|
|
299
|
+
# source://soren//lib/soren/parsers/response/headers.rb#14
|
|
300
|
+
def parse; end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# source://soren//lib/soren/parsers/response/status_line.rb#7
|
|
304
|
+
class Soren::Parsers::Response::StatusLine
|
|
305
|
+
# : (untyped) -> void
|
|
306
|
+
#
|
|
307
|
+
# @return [StatusLine] a new instance of StatusLine
|
|
308
|
+
#
|
|
309
|
+
# source://soren//lib/soren/parsers/response/status_line.rb#9
|
|
310
|
+
def initialize(status_line); end
|
|
311
|
+
|
|
312
|
+
# : -> Hash[Symbol, untyped]
|
|
313
|
+
#
|
|
314
|
+
# source://soren//lib/soren/parsers/response/status_line.rb#14
|
|
315
|
+
def parse; end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# source://soren//lib/soren/request.rb#10
|
|
319
|
+
class Soren::Request
|
|
320
|
+
# : (method: untyped, target: untyped, ?headers: untyped, ?body: untyped) -> void
|
|
321
|
+
#
|
|
322
|
+
# @return [Request] a new instance of Request
|
|
323
|
+
#
|
|
324
|
+
# source://soren//lib/soren/request.rb#18
|
|
325
|
+
def initialize(method:, target:, headers: T.unsafe(nil), body: T.unsafe(nil)); end
|
|
326
|
+
|
|
327
|
+
# : Soren::Types::Request::Body?
|
|
328
|
+
#
|
|
329
|
+
# source://soren//lib/soren/request.rb#15
|
|
330
|
+
def body; end
|
|
331
|
+
|
|
332
|
+
# : Soren::Types::Request::Headers?
|
|
333
|
+
#
|
|
334
|
+
# source://soren//lib/soren/request.rb#14
|
|
335
|
+
def headers; end
|
|
336
|
+
|
|
337
|
+
# : Soren::Types::Request::Method?
|
|
338
|
+
#
|
|
339
|
+
# source://soren//lib/soren/request.rb#12
|
|
340
|
+
def method; end
|
|
341
|
+
|
|
342
|
+
# : Soren::Types::Request::Target?
|
|
343
|
+
#
|
|
344
|
+
# source://soren//lib/soren/request.rb#13
|
|
345
|
+
def target; end
|
|
346
|
+
|
|
347
|
+
# : (host: String) -> String
|
|
348
|
+
#
|
|
349
|
+
# source://soren//lib/soren/request.rb#26
|
|
350
|
+
def to_http(host:); end
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# source://soren//lib/soren/response.rb#11
|
|
354
|
+
class Soren::Response
|
|
355
|
+
# : (Hash[Symbol, untyped]) -> void
|
|
356
|
+
#
|
|
357
|
+
# @return [Response] a new instance of Response
|
|
358
|
+
#
|
|
359
|
+
# source://soren//lib/soren/response.rb#38
|
|
360
|
+
def initialize(parsed_response); end
|
|
361
|
+
|
|
362
|
+
# : -> String
|
|
363
|
+
#
|
|
364
|
+
# source://soren//lib/soren/response.rb#33
|
|
365
|
+
def body; end
|
|
366
|
+
|
|
367
|
+
# : -> Integer
|
|
368
|
+
#
|
|
369
|
+
# source://soren//lib/soren/response.rb#13
|
|
370
|
+
def code; end
|
|
371
|
+
|
|
372
|
+
# : -> Hash[String, Array[String]]
|
|
373
|
+
#
|
|
374
|
+
# source://soren//lib/soren/response.rb#28
|
|
375
|
+
def headers; end
|
|
376
|
+
|
|
377
|
+
# : -> String
|
|
378
|
+
#
|
|
379
|
+
# source://soren//lib/soren/response.rb#18
|
|
380
|
+
def message; end
|
|
381
|
+
|
|
382
|
+
# : -> String
|
|
383
|
+
#
|
|
384
|
+
# source://soren//lib/soren/response.rb#23
|
|
385
|
+
def version; end
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# source://soren//lib/soren/socket/reader.rb#9
|
|
389
|
+
module Soren::Socket; end
|
|
390
|
+
|
|
391
|
+
# source://soren//lib/soren/socket/io.rb#11
|
|
392
|
+
class Soren::Socket::IO
|
|
393
|
+
# : ((TCPSocket | OpenSSL::SSL::SSLSocket), Soren::Request, Soren::Options, host: Soren::Types::Connection::Host) -> void
|
|
394
|
+
#
|
|
395
|
+
# @return [IO] a new instance of IO
|
|
396
|
+
#
|
|
397
|
+
# source://soren//lib/soren/socket/io.rb#13
|
|
398
|
+
def initialize(socket, request, options, host:); end
|
|
399
|
+
|
|
400
|
+
# : -> Hash[Symbol, untyped]
|
|
401
|
+
#
|
|
402
|
+
# source://soren//lib/soren/socket/io.rb#42
|
|
403
|
+
def read_response; end
|
|
404
|
+
|
|
405
|
+
# : -> Integer
|
|
406
|
+
#
|
|
407
|
+
# source://soren//lib/soren/socket/io.rb#21
|
|
408
|
+
def write_request; end
|
|
409
|
+
|
|
410
|
+
private
|
|
411
|
+
|
|
412
|
+
# : (StandardError, Deadline?) -> void
|
|
413
|
+
#
|
|
414
|
+
# @raise [Soren::Error::WriteTimeout]
|
|
415
|
+
#
|
|
416
|
+
# source://soren//lib/soren/socket/io.rb#50
|
|
417
|
+
def handle_write_error(error, deadline); end
|
|
418
|
+
|
|
419
|
+
# : (Float?) -> bool
|
|
420
|
+
#
|
|
421
|
+
# source://soren//lib/soren/socket/io.rb#58
|
|
422
|
+
def wait_writable(timeout); end
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
# source://soren//lib/soren/socket/reader.rb#10
|
|
426
|
+
class Soren::Socket::Reader
|
|
427
|
+
# : (untyped, ?deadline: Deadline?) -> void
|
|
428
|
+
#
|
|
429
|
+
# @return [Reader] a new instance of Reader
|
|
430
|
+
#
|
|
431
|
+
# source://soren//lib/soren/socket/reader.rb#12
|
|
432
|
+
def initialize(source, deadline: T.unsafe(nil)); end
|
|
433
|
+
|
|
434
|
+
# : -> String
|
|
435
|
+
#
|
|
436
|
+
# source://soren//lib/soren/socket/reader.rb#47
|
|
437
|
+
def read_all; end
|
|
438
|
+
|
|
439
|
+
# : (Integer) -> String
|
|
440
|
+
#
|
|
441
|
+
# source://soren//lib/soren/socket/reader.rb#30
|
|
442
|
+
def read_exactly(length); end
|
|
443
|
+
|
|
444
|
+
# : -> String?
|
|
445
|
+
#
|
|
446
|
+
# source://soren//lib/soren/socket/reader.rb#18
|
|
447
|
+
def read_line; end
|
|
448
|
+
|
|
449
|
+
# : (String) -> String?
|
|
450
|
+
#
|
|
451
|
+
# source://soren//lib/soren/socket/reader.rb#24
|
|
452
|
+
def read_line_with_terminator(terminator); end
|
|
453
|
+
|
|
454
|
+
private
|
|
455
|
+
|
|
456
|
+
# : -> void
|
|
457
|
+
#
|
|
458
|
+
# @raise [Soren::Error::ReadTimeout]
|
|
459
|
+
#
|
|
460
|
+
# source://soren//lib/soren/socket/reader.rb#55
|
|
461
|
+
def check_deadline_expired; end
|
|
462
|
+
|
|
463
|
+
# : (untyped) -> untyped
|
|
464
|
+
#
|
|
465
|
+
# @raise [Soren::Error::ParseError]
|
|
466
|
+
#
|
|
467
|
+
# source://soren//lib/soren/socket/reader.rb#62
|
|
468
|
+
def to_io(source); end
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#5
|
|
472
|
+
module Soren::Types; end
|
|
473
|
+
|
|
474
|
+
# source://soren//lib/soren/types/connection/host.rb#6
|
|
475
|
+
module Soren::Types::Connection; end
|
|
476
|
+
|
|
477
|
+
# source://soren//lib/soren/types/connection/host.rb#7
|
|
478
|
+
class Soren::Types::Connection::Host
|
|
479
|
+
# : (untyped) -> void
|
|
480
|
+
#
|
|
481
|
+
# @return [Host] a new instance of Host
|
|
482
|
+
#
|
|
483
|
+
# source://soren//lib/soren/types/connection/host.rb#9
|
|
484
|
+
def initialize(host); end
|
|
485
|
+
|
|
486
|
+
# : -> String
|
|
487
|
+
#
|
|
488
|
+
# source://soren//lib/soren/types/connection/host.rb#14
|
|
489
|
+
def to_s; end
|
|
490
|
+
|
|
491
|
+
private
|
|
492
|
+
|
|
493
|
+
# : (String) -> bool
|
|
494
|
+
#
|
|
495
|
+
# @return [Boolean]
|
|
496
|
+
#
|
|
497
|
+
# source://soren//lib/soren/types/connection/host.rb#37
|
|
498
|
+
def resolvable?(host); end
|
|
499
|
+
|
|
500
|
+
# : (untyped) -> String
|
|
501
|
+
#
|
|
502
|
+
# @raise [Soren::Error::ArgumentError]
|
|
503
|
+
#
|
|
504
|
+
# source://soren//lib/soren/types/connection/host.rb#21
|
|
505
|
+
def validate(host); end
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# source://soren//lib/soren/types/connection/port.rb#7
|
|
509
|
+
class Soren::Types::Connection::Port
|
|
510
|
+
# : (untyped) -> void
|
|
511
|
+
#
|
|
512
|
+
# @return [Port] a new instance of Port
|
|
513
|
+
#
|
|
514
|
+
# source://soren//lib/soren/types/connection/port.rb#9
|
|
515
|
+
def initialize(port); end
|
|
516
|
+
|
|
517
|
+
# : -> Integer
|
|
518
|
+
#
|
|
519
|
+
# source://soren//lib/soren/types/connection/port.rb#19
|
|
520
|
+
def to_i; end
|
|
521
|
+
|
|
522
|
+
# : -> String
|
|
523
|
+
#
|
|
524
|
+
# source://soren//lib/soren/types/connection/port.rb#14
|
|
525
|
+
def to_s; end
|
|
526
|
+
|
|
527
|
+
private
|
|
528
|
+
|
|
529
|
+
# : (untyped) -> Integer
|
|
530
|
+
#
|
|
531
|
+
# source://soren//lib/soren/types/connection/port.rb#26
|
|
532
|
+
def validate(port); end
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
# source://soren//lib/soren/types/connection/scheme.rb#7
|
|
536
|
+
class Soren::Types::Connection::Scheme
|
|
537
|
+
# : (untyped) -> void
|
|
538
|
+
#
|
|
539
|
+
# @return [Scheme] a new instance of Scheme
|
|
540
|
+
#
|
|
541
|
+
# source://soren//lib/soren/types/connection/scheme.rb#9
|
|
542
|
+
def initialize(scheme); end
|
|
543
|
+
|
|
544
|
+
# : -> bool
|
|
545
|
+
#
|
|
546
|
+
# @return [Boolean]
|
|
547
|
+
#
|
|
548
|
+
# source://soren//lib/soren/types/connection/scheme.rb#19
|
|
549
|
+
def https?; end
|
|
550
|
+
|
|
551
|
+
# : -> String
|
|
552
|
+
#
|
|
553
|
+
# source://soren//lib/soren/types/connection/scheme.rb#14
|
|
554
|
+
def to_s; end
|
|
555
|
+
|
|
556
|
+
private
|
|
557
|
+
|
|
558
|
+
# : (untyped) -> String
|
|
559
|
+
#
|
|
560
|
+
# source://soren//lib/soren/types/connection/scheme.rb#26
|
|
561
|
+
def validate(scheme); end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# source://soren//lib/soren/types/connection/uri.rb#9
|
|
565
|
+
class Soren::Types::Connection::Uri
|
|
566
|
+
# : (untyped) -> void
|
|
567
|
+
#
|
|
568
|
+
# @return [Uri] a new instance of Uri
|
|
569
|
+
#
|
|
570
|
+
# source://soren//lib/soren/types/connection/uri.rb#11
|
|
571
|
+
def initialize(uri); end
|
|
572
|
+
|
|
573
|
+
# : -> String?
|
|
574
|
+
#
|
|
575
|
+
# source://soren//lib/soren/types/connection/uri.rb#16
|
|
576
|
+
def host; end
|
|
577
|
+
|
|
578
|
+
# : -> Integer?
|
|
579
|
+
#
|
|
580
|
+
# source://soren//lib/soren/types/connection/uri.rb#21
|
|
581
|
+
def port; end
|
|
582
|
+
|
|
583
|
+
# : -> String?
|
|
584
|
+
#
|
|
585
|
+
# source://soren//lib/soren/types/connection/uri.rb#26
|
|
586
|
+
def scheme; end
|
|
587
|
+
|
|
588
|
+
private
|
|
589
|
+
|
|
590
|
+
# : (untyped) -> URI::HTTP
|
|
591
|
+
#
|
|
592
|
+
# source://soren//lib/soren/types/connection/uri.rb#33
|
|
593
|
+
def validate(uri); end
|
|
594
|
+
end
|
|
595
|
+
|
|
596
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#6
|
|
597
|
+
module Soren::Types::Options; end
|
|
598
|
+
|
|
599
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#7
|
|
600
|
+
module Soren::Types::Options::Timeout; end
|
|
601
|
+
|
|
602
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#8
|
|
603
|
+
class Soren::Types::Options::Timeout::Base
|
|
604
|
+
# : (Float | Integer | String | nil, ?default: Float?) -> void
|
|
605
|
+
#
|
|
606
|
+
# @return [Base] a new instance of Base
|
|
607
|
+
#
|
|
608
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#10
|
|
609
|
+
def initialize(timeout, default: T.unsafe(nil)); end
|
|
610
|
+
|
|
611
|
+
# : -> Float
|
|
612
|
+
#
|
|
613
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#16
|
|
614
|
+
def to_f; end
|
|
615
|
+
|
|
616
|
+
private
|
|
617
|
+
|
|
618
|
+
# : (Float | Integer | String | nil) -> Float
|
|
619
|
+
#
|
|
620
|
+
# source://soren//lib/soren/types/options/timeout/base.rb#23
|
|
621
|
+
def validate(timeout); end
|
|
622
|
+
end
|
|
623
|
+
|
|
624
|
+
# source://soren//lib/soren/types/options/timeout/connect_timeout.rb#11
|
|
625
|
+
class Soren::Types::Options::Timeout::ConnectTimeout < ::Soren::Types::Options::Timeout::Base
|
|
626
|
+
# : (untyped) -> void
|
|
627
|
+
#
|
|
628
|
+
# @return [ConnectTimeout] a new instance of ConnectTimeout
|
|
629
|
+
#
|
|
630
|
+
# source://soren//lib/soren/types/options/timeout/connect_timeout.rb#13
|
|
631
|
+
def initialize(timeout); end
|
|
632
|
+
end
|
|
633
|
+
|
|
634
|
+
# source://soren//lib/soren/types/options/timeout/read_timeout.rb#11
|
|
635
|
+
class Soren::Types::Options::Timeout::ReadTimeout < ::Soren::Types::Options::Timeout::Base
|
|
636
|
+
# : (untyped) -> void
|
|
637
|
+
#
|
|
638
|
+
# @return [ReadTimeout] a new instance of ReadTimeout
|
|
639
|
+
#
|
|
640
|
+
# source://soren//lib/soren/types/options/timeout/read_timeout.rb#13
|
|
641
|
+
def initialize(timeout); end
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
# source://soren//lib/soren/types/options/timeout/write_timeout.rb#11
|
|
645
|
+
class Soren::Types::Options::Timeout::WriteTimeout < ::Soren::Types::Options::Timeout::Base
|
|
646
|
+
# : (untyped) -> void
|
|
647
|
+
#
|
|
648
|
+
# @return [WriteTimeout] a new instance of WriteTimeout
|
|
649
|
+
#
|
|
650
|
+
# source://soren//lib/soren/types/options/timeout/write_timeout.rb#13
|
|
651
|
+
def initialize(timeout); end
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
# source://soren//lib/soren/types/request/target.rb#6
|
|
655
|
+
module Soren::Types::Request; end
|
|
656
|
+
|
|
657
|
+
# source://soren//lib/soren/types/request/body.rb#7
|
|
658
|
+
class Soren::Types::Request::Body
|
|
659
|
+
# : (untyped) -> void
|
|
660
|
+
#
|
|
661
|
+
# @return [Body] a new instance of Body
|
|
662
|
+
#
|
|
663
|
+
# source://soren//lib/soren/types/request/body.rb#9
|
|
664
|
+
def initialize(body); end
|
|
665
|
+
|
|
666
|
+
# : -> String?
|
|
667
|
+
#
|
|
668
|
+
# source://soren//lib/soren/types/request/body.rb#19
|
|
669
|
+
def to_http; end
|
|
670
|
+
|
|
671
|
+
# : -> String?
|
|
672
|
+
#
|
|
673
|
+
# source://soren//lib/soren/types/request/body.rb#14
|
|
674
|
+
def to_s; end
|
|
675
|
+
|
|
676
|
+
private
|
|
677
|
+
|
|
678
|
+
# : (untyped) -> String?
|
|
679
|
+
#
|
|
680
|
+
# source://soren//lib/soren/types/request/body.rb#26
|
|
681
|
+
def validate(body); end
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
# source://soren//lib/soren/types/request/headers.rb#7
|
|
685
|
+
class Soren::Types::Request::Headers
|
|
686
|
+
# : (untyped, ?content_length: Integer?) -> void
|
|
687
|
+
#
|
|
688
|
+
# @return [Headers] a new instance of Headers
|
|
689
|
+
#
|
|
690
|
+
# source://soren//lib/soren/types/request/headers.rb#9
|
|
691
|
+
def initialize(headers, content_length: T.unsafe(nil)); end
|
|
692
|
+
|
|
693
|
+
# : -> Hash[String, String]
|
|
694
|
+
#
|
|
695
|
+
# source://soren//lib/soren/types/request/headers.rb#14
|
|
696
|
+
def to_h; end
|
|
697
|
+
|
|
698
|
+
# : (host: untyped) -> Array[String]
|
|
699
|
+
#
|
|
700
|
+
# source://soren//lib/soren/types/request/headers.rb#19
|
|
701
|
+
def to_http(host:); end
|
|
702
|
+
|
|
703
|
+
private
|
|
704
|
+
|
|
705
|
+
# : (untyped, content_length: Integer?) -> Hash[String, String]
|
|
706
|
+
#
|
|
707
|
+
# source://soren//lib/soren/types/request/headers.rb#35
|
|
708
|
+
def validate(headers, content_length:); end
|
|
709
|
+
end
|
|
710
|
+
|
|
711
|
+
# source://soren//lib/soren/types/request/method.rb#7
|
|
712
|
+
class Soren::Types::Request::Method
|
|
713
|
+
# : (untyped) -> void
|
|
714
|
+
#
|
|
715
|
+
# @return [Method] a new instance of Method
|
|
716
|
+
#
|
|
717
|
+
# source://soren//lib/soren/types/request/method.rb#11
|
|
718
|
+
def initialize(method); end
|
|
719
|
+
|
|
720
|
+
# : -> String
|
|
721
|
+
#
|
|
722
|
+
# source://soren//lib/soren/types/request/method.rb#21
|
|
723
|
+
def to_http; end
|
|
724
|
+
|
|
725
|
+
# : -> String
|
|
726
|
+
#
|
|
727
|
+
# source://soren//lib/soren/types/request/method.rb#16
|
|
728
|
+
def to_s; end
|
|
729
|
+
|
|
730
|
+
private
|
|
731
|
+
|
|
732
|
+
# : (untyped) -> String
|
|
733
|
+
#
|
|
734
|
+
# source://soren//lib/soren/types/request/method.rb#28
|
|
735
|
+
def validate(method); end
|
|
736
|
+
end
|
|
737
|
+
|
|
738
|
+
# source://soren//lib/soren/types/request/method.rb#8
|
|
739
|
+
Soren::Types::Request::Method::ALLOWED_METHODS = T.let(T.unsafe(nil), Array)
|
|
740
|
+
|
|
741
|
+
# source://soren//lib/soren/types/request/target.rb#7
|
|
742
|
+
class Soren::Types::Request::Target
|
|
743
|
+
# : (untyped) -> void
|
|
744
|
+
#
|
|
745
|
+
# @return [Target] a new instance of Target
|
|
746
|
+
#
|
|
747
|
+
# source://soren//lib/soren/types/request/target.rb#9
|
|
748
|
+
def initialize(target); end
|
|
749
|
+
|
|
750
|
+
# : -> String
|
|
751
|
+
#
|
|
752
|
+
# source://soren//lib/soren/types/request/target.rb#19
|
|
753
|
+
def to_http; end
|
|
754
|
+
|
|
755
|
+
# : -> String
|
|
756
|
+
#
|
|
757
|
+
# source://soren//lib/soren/types/request/target.rb#14
|
|
758
|
+
def to_s; end
|
|
759
|
+
|
|
760
|
+
private
|
|
761
|
+
|
|
762
|
+
# : (untyped) -> String
|
|
763
|
+
#
|
|
764
|
+
# source://soren//lib/soren/types/request/target.rb#26
|
|
765
|
+
def validate(target); end
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
# source://soren//lib/soren/types/response/code.rb#6
|
|
769
|
+
module Soren::Types::Response; end
|
|
770
|
+
|
|
771
|
+
# source://soren//lib/soren/types/response/body.rb#7
|
|
772
|
+
class Soren::Types::Response::Body
|
|
773
|
+
# : (untyped) -> void
|
|
774
|
+
#
|
|
775
|
+
# @return [Body] a new instance of Body
|
|
776
|
+
#
|
|
777
|
+
# source://soren//lib/soren/types/response/body.rb#9
|
|
778
|
+
def initialize(body); end
|
|
779
|
+
|
|
780
|
+
# : -> String
|
|
781
|
+
#
|
|
782
|
+
# source://soren//lib/soren/types/response/body.rb#14
|
|
783
|
+
def to_s; end
|
|
784
|
+
|
|
785
|
+
private
|
|
786
|
+
|
|
787
|
+
# : (untyped) -> String
|
|
788
|
+
#
|
|
789
|
+
# source://soren//lib/soren/types/response/body.rb#21
|
|
790
|
+
def validate(body); end
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
# source://soren//lib/soren/types/response/code.rb#7
|
|
794
|
+
class Soren::Types::Response::Code
|
|
795
|
+
# : (untyped) -> void
|
|
796
|
+
#
|
|
797
|
+
# @return [Code] a new instance of Code
|
|
798
|
+
#
|
|
799
|
+
# source://soren//lib/soren/types/response/code.rb#12
|
|
800
|
+
def initialize(code); end
|
|
801
|
+
|
|
802
|
+
# : -> bool
|
|
803
|
+
#
|
|
804
|
+
# @return [Boolean]
|
|
805
|
+
#
|
|
806
|
+
# source://soren//lib/soren/types/response/code.rb#22
|
|
807
|
+
def no_body?; end
|
|
808
|
+
|
|
809
|
+
# : -> Integer
|
|
810
|
+
#
|
|
811
|
+
# source://soren//lib/soren/types/response/code.rb#17
|
|
812
|
+
def to_i; end
|
|
813
|
+
|
|
814
|
+
private
|
|
815
|
+
|
|
816
|
+
# : (untyped) -> Integer
|
|
817
|
+
#
|
|
818
|
+
# source://soren//lib/soren/types/response/code.rb#29
|
|
819
|
+
def validate(code); end
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
# source://soren//lib/soren/types/response/code.rb#9
|
|
823
|
+
Soren::Types::Response::Code::NOT_MODIFIED = T.let(T.unsafe(nil), Integer)
|
|
824
|
+
|
|
825
|
+
# source://soren//lib/soren/types/response/code.rb#8
|
|
826
|
+
Soren::Types::Response::Code::NO_CONTENT = T.let(T.unsafe(nil), Integer)
|
|
827
|
+
|
|
828
|
+
# source://soren//lib/soren/types/response/headers.rb#7
|
|
829
|
+
class Soren::Types::Response::Headers
|
|
830
|
+
# : (untyped) -> void
|
|
831
|
+
#
|
|
832
|
+
# @return [Headers] a new instance of Headers
|
|
833
|
+
#
|
|
834
|
+
# source://soren//lib/soren/types/response/headers.rb#9
|
|
835
|
+
def initialize(headers); end
|
|
836
|
+
|
|
837
|
+
# : -> bool
|
|
838
|
+
#
|
|
839
|
+
# @return [Boolean]
|
|
840
|
+
#
|
|
841
|
+
# source://soren//lib/soren/types/response/headers.rb#36
|
|
842
|
+
def chunked?; end
|
|
843
|
+
|
|
844
|
+
# : -> Array[String]
|
|
845
|
+
#
|
|
846
|
+
# source://soren//lib/soren/types/response/headers.rb#51
|
|
847
|
+
def content_encodings; end
|
|
848
|
+
|
|
849
|
+
# : -> Integer?
|
|
850
|
+
#
|
|
851
|
+
# source://soren//lib/soren/types/response/headers.rb#26
|
|
852
|
+
def content_length; end
|
|
853
|
+
|
|
854
|
+
# : (untyped) -> Array[String]
|
|
855
|
+
#
|
|
856
|
+
# source://soren//lib/soren/types/response/headers.rb#19
|
|
857
|
+
def get_all(key); end
|
|
858
|
+
|
|
859
|
+
# : -> bool
|
|
860
|
+
#
|
|
861
|
+
# @return [Boolean]
|
|
862
|
+
#
|
|
863
|
+
# source://soren//lib/soren/types/response/headers.rb#41
|
|
864
|
+
def keep_alive?; end
|
|
865
|
+
|
|
866
|
+
# : -> Hash[String, Array[String]]
|
|
867
|
+
#
|
|
868
|
+
# source://soren//lib/soren/types/response/headers.rb#14
|
|
869
|
+
def to_h; end
|
|
870
|
+
|
|
871
|
+
private
|
|
872
|
+
|
|
873
|
+
# : (Array[String]) -> Array[String]
|
|
874
|
+
#
|
|
875
|
+
# source://soren//lib/soren/types/response/headers.rb#78
|
|
876
|
+
def split_header_values(values); end
|
|
877
|
+
|
|
878
|
+
# : (untyped) -> Hash[String, Array[String]]
|
|
879
|
+
#
|
|
880
|
+
# source://soren//lib/soren/types/response/headers.rb#58
|
|
881
|
+
def validate(headers); end
|
|
882
|
+
end
|
|
883
|
+
|
|
884
|
+
# source://soren//lib/soren/types/response/message.rb#7
|
|
885
|
+
class Soren::Types::Response::Message
|
|
886
|
+
# : (untyped) -> void
|
|
887
|
+
#
|
|
888
|
+
# @return [Message] a new instance of Message
|
|
889
|
+
#
|
|
890
|
+
# source://soren//lib/soren/types/response/message.rb#9
|
|
891
|
+
def initialize(message); end
|
|
892
|
+
|
|
893
|
+
# : -> String
|
|
894
|
+
#
|
|
895
|
+
# source://soren//lib/soren/types/response/message.rb#14
|
|
896
|
+
def to_s; end
|
|
897
|
+
|
|
898
|
+
private
|
|
899
|
+
|
|
900
|
+
# : (untyped) -> String
|
|
901
|
+
#
|
|
902
|
+
# source://soren//lib/soren/types/response/message.rb#21
|
|
903
|
+
def validate(message); end
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
# source://soren//lib/soren/types/response/version.rb#7
|
|
907
|
+
class Soren::Types::Response::Version
|
|
908
|
+
# : (untyped) -> void
|
|
909
|
+
#
|
|
910
|
+
# @return [Version] a new instance of Version
|
|
911
|
+
#
|
|
912
|
+
# source://soren//lib/soren/types/response/version.rb#9
|
|
913
|
+
def initialize(version); end
|
|
914
|
+
|
|
915
|
+
# : -> String
|
|
916
|
+
#
|
|
917
|
+
# source://soren//lib/soren/types/response/version.rb#14
|
|
918
|
+
def to_s; end
|
|
919
|
+
|
|
920
|
+
private
|
|
921
|
+
|
|
922
|
+
# : (untyped) -> String
|
|
923
|
+
#
|
|
924
|
+
# source://soren//lib/soren/types/response/version.rb#21
|
|
925
|
+
def validate(version); end
|
|
926
|
+
end
|
|
927
|
+
|
|
928
|
+
# source://soren//lib/soren/version.rb#4
|
|
929
|
+
Soren::VERSION = T.let(T.unsafe(nil), String)
|
|
930
|
+
|
|
931
|
+
# source://soren//lib/soren/core_ext/blank.rb#18
|
|
932
|
+
class String
|
|
933
|
+
include ::Comparable
|
|
934
|
+
end
|