hearth 1.0.0.pre2 → 1.0.0.pre3

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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/VERSION +1 -1
  4. data/lib/hearth/anonymous_auth_resolver.rb +11 -0
  5. data/lib/hearth/auth_schemes/anonymous.rb +3 -3
  6. data/lib/hearth/auth_schemes.rb +3 -3
  7. data/lib/hearth/client.rb +66 -0
  8. data/lib/hearth/client_stubs.rb +1 -3
  9. data/lib/hearth/config/resolver.rb +6 -5
  10. data/lib/hearth/context.rb +1 -0
  11. data/lib/hearth/dns/host_address.rb +20 -16
  12. data/lib/hearth/endpoint_rules.rb +154 -0
  13. data/lib/hearth/http/client.rb +5 -7
  14. data/lib/hearth/http/error_inspector.rb +2 -2
  15. data/lib/hearth/http/field.rb +4 -19
  16. data/lib/hearth/http/header_list_builder.rb +42 -0
  17. data/lib/hearth/http/header_list_parser.rb +92 -0
  18. data/lib/hearth/http/middleware/content_length.rb +3 -3
  19. data/lib/hearth/http/middleware/content_md5.rb +0 -1
  20. data/lib/hearth/http/middleware/request_compression.rb +7 -10
  21. data/lib/hearth/http.rb +2 -0
  22. data/lib/hearth/{identity_resolver.rb → identity_provider.rb} +1 -1
  23. data/lib/hearth/interceptor_context.rb +8 -4
  24. data/lib/hearth/interceptors.rb +2 -1
  25. data/lib/hearth/json.rb +4 -4
  26. data/lib/hearth/middleware/auth.rb +9 -6
  27. data/lib/hearth/middleware/build.rb +0 -1
  28. data/lib/hearth/middleware/endpoint.rb +79 -0
  29. data/lib/hearth/middleware/host_prefix.rb +1 -2
  30. data/lib/hearth/middleware/initialize.rb +0 -1
  31. data/lib/hearth/middleware/parse.rb +0 -1
  32. data/lib/hearth/middleware/retry.rb +9 -2
  33. data/lib/hearth/middleware/send.rb +0 -1
  34. data/lib/hearth/middleware.rb +1 -0
  35. data/lib/hearth/middleware_stack.rb +1 -1
  36. data/lib/hearth/number_helper.rb +1 -1
  37. data/lib/hearth/query/param.rb +7 -3
  38. data/lib/hearth/query/param_matcher.rb +5 -6
  39. data/lib/hearth/{refreshing_identity_resolver.rb → refreshing_identity_provider.rb} +2 -2
  40. data/lib/hearth/request.rb +2 -2
  41. data/lib/hearth/response.rb +5 -2
  42. data/lib/hearth/retry/adaptive.rb +2 -2
  43. data/lib/hearth/retry/client_rate_limiter.rb +8 -6
  44. data/lib/hearth/retry/exponential_backoff.rb +1 -1
  45. data/lib/hearth/retry/standard.rb +2 -2
  46. data/lib/hearth/retry.rb +16 -3
  47. data/lib/hearth/structure.rb +7 -3
  48. data/lib/hearth/stubs.rb +12 -4
  49. data/lib/hearth/time_helper.rb +1 -2
  50. data/lib/hearth/validator.rb +37 -21
  51. data/lib/hearth/waiters/poller.rb +4 -2
  52. data/lib/hearth/waiters/waiter.rb +6 -5
  53. data/lib/hearth/xml/node.rb +0 -1
  54. data/lib/hearth/xml/node_matcher.rb +0 -1
  55. data/lib/hearth.rb +8 -4
  56. data/sig/lib/hearth/aliases.rbs +5 -3
  57. data/sig/lib/hearth/anonymous_auth_resolver.rbs +5 -0
  58. data/sig/lib/hearth/auth_schemes.rbs +1 -1
  59. data/sig/lib/hearth/client.rbs +9 -0
  60. data/sig/lib/hearth/configuration.rbs +2 -2
  61. data/sig/lib/hearth/dns/host_address.rbs +1 -3
  62. data/sig/lib/hearth/dns/host_resolver.rbs +3 -3
  63. data/sig/lib/hearth/endpoint_rules.rbs +17 -0
  64. data/sig/lib/hearth/http/field.rbs +1 -1
  65. data/sig/lib/hearth/http/fields.rbs +1 -1
  66. data/sig/lib/hearth/http/header_list_builder.rbs +15 -0
  67. data/sig/lib/hearth/http/header_list_parser.rbs +19 -0
  68. data/sig/lib/hearth/http/networking_error.rbs +6 -0
  69. data/sig/lib/hearth/http/response.rbs +1 -1
  70. data/sig/lib/hearth/identities.rbs +1 -1
  71. data/sig/lib/hearth/{identity_resolver.rbs → identity_provider.rbs} +1 -1
  72. data/sig/lib/hearth/interceptor_context.rbs +4 -2
  73. data/sig/lib/hearth/interfaces.rbs +52 -30
  74. data/sig/lib/hearth/json/parse_error.rbs +9 -0
  75. data/sig/lib/hearth/networking_error.rbs +7 -0
  76. data/sig/lib/hearth/output.rbs +4 -4
  77. data/sig/lib/hearth/plugin_list.rbs +5 -7
  78. data/sig/lib/hearth/query/param.rbs +2 -2
  79. data/sig/lib/hearth/refreshing_identity_provider.rbs +10 -0
  80. data/sig/lib/hearth/request.rbs +2 -2
  81. data/sig/lib/hearth/response.rbs +2 -2
  82. data/sig/lib/hearth/retry/exponential_backoff.rbs +1 -1
  83. data/sig/lib/hearth/retry.rbs +1 -1
  84. data/sig/lib/hearth/structure.rbs +1 -2
  85. data/sig/lib/hearth/stubs.rbs +9 -0
  86. data/sig/lib/hearth/union.rbs +1 -1
  87. data/sig/lib/hearth/xml/parse_error.rbs +9 -0
  88. metadata +26 -10
  89. data/lib/hearth/retry/strategy.rb +0 -20
@@ -1,8 +1,8 @@
1
1
  module Hearth
2
2
  class Response
3
- def initialize: (?body: IO) -> void
3
+ def initialize: (?body: (IO | StringIO)) -> void
4
4
 
5
- attr_accessor body: IO
5
+ attr_accessor body: (IO | StringIO)
6
6
 
7
7
  def replace: (Response other) -> self
8
8
 
@@ -1,7 +1,7 @@
1
1
  module Hearth
2
2
  module Retry
3
3
  class ExponentialBackoff
4
- def call: (Integer attempts) -> Float
4
+ def call: (Integer attempts) -> Numeric
5
5
  end
6
6
  end
7
7
  end
@@ -3,7 +3,7 @@ module Hearth
3
3
  class Token < Struct[untyped]
4
4
  attr_accessor retry_count (): Integer
5
5
 
6
- attr_accessor retry_delay (): Float
6
+ attr_accessor retry_delay (): Numeric
7
7
  end
8
8
  end
9
9
  end
@@ -1,7 +1,6 @@
1
1
  module Hearth
2
2
  module Structure
3
- def to_h: (self) -> Hash[Symbol, untyped]
4
-
3
+ def to_h: (self) -> (Hash[Symbol, untyped] | self)
5
4
  alias to_hash to_h
6
5
  end
7
6
  end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ class Stubs
3
+ def initialize: (?Hash[Symbol, Array[stub]]) -> void
4
+
5
+ def set_stubs: (Symbol, Array[stub]) -> void
6
+
7
+ def next: (Symbol) -> stub?
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module Hearth
2
2
  class Union < SimpleDelegator
3
- include Hearth::Structure
3
+ include Structure
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module XML
3
+ class ParseError < StandardError
4
+ def initialize: (StandardError original_error) -> void
5
+
6
+ attr_reader original_error: StandardError
7
+ end
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hearth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre2
4
+ version: 1.0.0.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-19 00:00:00.000000000 Z
11
+ date: 2024-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -53,6 +53,7 @@ files:
53
53
  - CHANGELOG.md
54
54
  - VERSION
55
55
  - lib/hearth.rb
56
+ - lib/hearth/anonymous_auth_resolver.rb
56
57
  - lib/hearth/api_error.rb
57
58
  - lib/hearth/auth_option.rb
58
59
  - lib/hearth/auth_schemes.rb
@@ -63,6 +64,7 @@ files:
63
64
  - lib/hearth/auth_schemes/http_digest.rb
64
65
  - lib/hearth/block_io.rb
65
66
  - lib/hearth/checksums.rb
67
+ - lib/hearth/client.rb
66
68
  - lib/hearth/client_stubs.rb
67
69
  - lib/hearth/config/env_provider.rb
68
70
  - lib/hearth/config/resolver.rb
@@ -72,6 +74,7 @@ files:
72
74
  - lib/hearth/dns.rb
73
75
  - lib/hearth/dns/host_address.rb
74
76
  - lib/hearth/dns/host_resolver.rb
77
+ - lib/hearth/endpoint_rules.rb
75
78
  - lib/hearth/http.rb
76
79
  - lib/hearth/http/api_error.rb
77
80
  - lib/hearth/http/client.rb
@@ -79,6 +82,8 @@ files:
79
82
  - lib/hearth/http/error_parser.rb
80
83
  - lib/hearth/http/field.rb
81
84
  - lib/hearth/http/fields.rb
85
+ - lib/hearth/http/header_list_builder.rb
86
+ - lib/hearth/http/header_list_parser.rb
82
87
  - lib/hearth/http/middleware.rb
83
88
  - lib/hearth/http/middleware/content_length.rb
84
89
  - lib/hearth/http/middleware/content_md5.rb
@@ -91,7 +96,7 @@ files:
91
96
  - lib/hearth/identities/http_api_key.rb
92
97
  - lib/hearth/identities/http_bearer.rb
93
98
  - lib/hearth/identities/http_login.rb
94
- - lib/hearth/identity_resolver.rb
99
+ - lib/hearth/identity_provider.rb
95
100
  - lib/hearth/interceptor.rb
96
101
  - lib/hearth/interceptor_context.rb
97
102
  - lib/hearth/interceptor_list.rb
@@ -101,6 +106,7 @@ files:
101
106
  - lib/hearth/middleware.rb
102
107
  - lib/hearth/middleware/auth.rb
103
108
  - lib/hearth/middleware/build.rb
109
+ - lib/hearth/middleware/endpoint.rb
104
110
  - lib/hearth/middleware/host_prefix.rb
105
111
  - lib/hearth/middleware/initialize.rb
106
112
  - lib/hearth/middleware/parse.rb
@@ -116,7 +122,7 @@ files:
116
122
  - lib/hearth/query/param.rb
117
123
  - lib/hearth/query/param_list.rb
118
124
  - lib/hearth/query/param_matcher.rb
119
- - lib/hearth/refreshing_identity_resolver.rb
125
+ - lib/hearth/refreshing_identity_provider.rb
120
126
  - lib/hearth/request.rb
121
127
  - lib/hearth/response.rb
122
128
  - lib/hearth/retry.rb
@@ -126,7 +132,6 @@ files:
126
132
  - lib/hearth/retry/exponential_backoff.rb
127
133
  - lib/hearth/retry/retry_quota.rb
128
134
  - lib/hearth/retry/standard.rb
129
- - lib/hearth/retry/strategy.rb
130
135
  - lib/hearth/signers.rb
131
136
  - lib/hearth/signers/anonymous.rb
132
137
  - lib/hearth/signers/http_api_key.rb
@@ -146,6 +151,7 @@ files:
146
151
  - lib/hearth/xml/node_matcher.rb
147
152
  - lib/hearth/xml/parse_error.rb
148
153
  - sig/lib/hearth/aliases.rbs
154
+ - sig/lib/hearth/anonymous_auth_resolver.rbs
149
155
  - sig/lib/hearth/api_error.rbs
150
156
  - sig/lib/hearth/auth_option.rbs
151
157
  - sig/lib/hearth/auth_schemes.rbs
@@ -155,14 +161,19 @@ files:
155
161
  - sig/lib/hearth/auth_schemes/http_bearer.rbs
156
162
  - sig/lib/hearth/auth_schemes/http_digest.rbs
157
163
  - sig/lib/hearth/block_io.rbs
164
+ - sig/lib/hearth/client.rbs
158
165
  - sig/lib/hearth/client_stubs.rbs
159
166
  - sig/lib/hearth/configuration.rbs
160
167
  - sig/lib/hearth/dns/host_address.rbs
161
168
  - sig/lib/hearth/dns/host_resolver.rbs
169
+ - sig/lib/hearth/endpoint_rules.rbs
162
170
  - sig/lib/hearth/http/api_error.rbs
163
171
  - sig/lib/hearth/http/client.rbs
164
172
  - sig/lib/hearth/http/field.rbs
165
173
  - sig/lib/hearth/http/fields.rbs
174
+ - sig/lib/hearth/http/header_list_builder.rbs
175
+ - sig/lib/hearth/http/header_list_parser.rbs
176
+ - sig/lib/hearth/http/networking_error.rbs
166
177
  - sig/lib/hearth/http/request.rbs
167
178
  - sig/lib/hearth/http/response.rbs
168
179
  - sig/lib/hearth/identities.rbs
@@ -170,15 +181,18 @@ files:
170
181
  - sig/lib/hearth/identities/http_api_key.rbs
171
182
  - sig/lib/hearth/identities/http_bearer.rbs
172
183
  - sig/lib/hearth/identities/http_login.rbs
173
- - sig/lib/hearth/identity_resolver.rbs
184
+ - sig/lib/hearth/identity_provider.rbs
174
185
  - sig/lib/hearth/interceptor.rbs
175
186
  - sig/lib/hearth/interceptor_context.rbs
176
187
  - sig/lib/hearth/interceptor_list.rbs
177
188
  - sig/lib/hearth/interfaces.rbs
189
+ - sig/lib/hearth/json/parse_error.rbs
190
+ - sig/lib/hearth/networking_error.rbs
178
191
  - sig/lib/hearth/output.rbs
179
192
  - sig/lib/hearth/plugin_list.rbs
180
193
  - sig/lib/hearth/query/param.rbs
181
194
  - sig/lib/hearth/query/param_list.rbs
195
+ - sig/lib/hearth/refreshing_identity_provider.rbs
182
196
  - sig/lib/hearth/request.rbs
183
197
  - sig/lib/hearth/response.rbs
184
198
  - sig/lib/hearth/retry.rbs
@@ -193,9 +207,11 @@ files:
193
207
  - sig/lib/hearth/signers/http_bearer.rbs
194
208
  - sig/lib/hearth/signers/http_digest.rbs
195
209
  - sig/lib/hearth/structure.rbs
210
+ - sig/lib/hearth/stubs.rbs
196
211
  - sig/lib/hearth/union.rbs
197
212
  - sig/lib/hearth/waiters/waiter.rbs
198
- homepage:
213
+ - sig/lib/hearth/xml/parse_error.rbs
214
+ homepage: https://github.com/smithy-lang/smithy-ruby
199
215
  licenses:
200
216
  - Apache-2.0
201
217
  metadata: {}
@@ -210,11 +226,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
226
  version: '3.0'
211
227
  required_rubygems_version: !ruby/object:Gem::Requirement
212
228
  requirements:
213
- - - ">"
229
+ - - ">="
214
230
  - !ruby/object:Gem::Version
215
- version: 1.3.1
231
+ version: '0'
216
232
  requirements: []
217
- rubygems_version: 3.4.22
233
+ rubygems_version: 3.5.9
218
234
  signing_key:
219
235
  specification_version: 4
220
236
  summary: A base library for Smithy generated SDKs
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hearth
4
- module Retry
5
- # Interface for retry strategies.
6
- class Strategy
7
- def acquire_initial_retry_token(_token_scope = nil)
8
- raise NotImplementedError
9
- end
10
-
11
- def refresh_retry_token(_retry_token, _error_info)
12
- raise NotImplementedError
13
- end
14
-
15
- def record_success(_retry_token)
16
- raise NotImplementedError
17
- end
18
- end
19
- end
20
- end