terminal-shop 0.1.0.pre.alpha.15 → 1.1.0
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/README.md +27 -19
- data/lib/terminal-shop/base_client.rb +35 -55
- data/lib/terminal-shop/base_model.rb +457 -438
- data/lib/terminal-shop/base_page.rb +2 -2
- data/lib/terminal-shop/client.rb +1 -1
- data/lib/terminal-shop/errors.rb +3 -2
- data/lib/terminal-shop/models/address_get_params.rb +18 -0
- data/lib/terminal-shop/models/address_get_response.rb +20 -0
- data/lib/terminal-shop/models/app_create_params.rb +14 -2
- data/lib/terminal-shop/models/card_get_params.rb +18 -0
- data/lib/terminal-shop/models/card_get_response.rb +20 -0
- data/lib/terminal-shop/models/cart.rb +35 -2
- data/lib/terminal-shop/models/cart_convert_params.rb +11 -1
- data/lib/terminal-shop/models/cart_redeem_gift_card_params.rb +24 -0
- data/lib/terminal-shop/models/cart_redeem_gift_card_response.rb +48 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_params.rb +18 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_response.rb +19 -0
- data/lib/terminal-shop/models/product.rb +72 -46
- data/lib/terminal-shop/models/product_get_params.rb +18 -0
- data/lib/terminal-shop/models/product_get_response.rb +20 -0
- data/lib/terminal-shop/models/profile_update_params.rb +7 -9
- data/lib/terminal-shop/models/subscription.rb +0 -10
- data/lib/terminal-shop/models/subscription_get_params.rb +18 -0
- data/lib/terminal-shop/models/subscription_get_response.rb +20 -0
- data/lib/terminal-shop/pooled_net_requester.rb +14 -9
- data/lib/terminal-shop/resources/address.rb +19 -0
- data/lib/terminal-shop/resources/app.rb +2 -6
- data/lib/terminal-shop/resources/card.rb +19 -0
- data/lib/terminal-shop/resources/cart.rb +43 -1
- data/lib/terminal-shop/resources/product.rb +19 -0
- data/lib/terminal-shop/resources/profile.rb +3 -3
- data/lib/terminal-shop/resources/subscription.rb +19 -0
- data/lib/terminal-shop/util.rb +135 -1
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +13 -1
- data/rbi/lib/terminal-shop/base_client.rbi +29 -35
- data/rbi/lib/terminal-shop/base_model.rbi +235 -217
- data/rbi/lib/terminal-shop/base_page.rbi +2 -2
- data/rbi/lib/terminal-shop/client.rbi +2 -2
- data/rbi/lib/terminal-shop/errors.rbi +11 -10
- data/rbi/lib/terminal-shop/models/address.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +29 -4
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart.rbi +45 -9
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +17 -3
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_params.rbi +32 -0
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_response.rbi +66 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order.rbi +10 -10
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product.rbi +88 -27
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product_variant.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile.rbi +4 -4
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +9 -14
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription.rbi +15 -13
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -15
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +12 -10
- data/rbi/lib/terminal-shop/request_options.rbi +4 -0
- data/rbi/lib/terminal-shop/resources/address.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/app.rbi +3 -5
- data/rbi/lib/terminal-shop/resources/card.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/cart.rbi +24 -4
- data/rbi/lib/terminal-shop/resources/email.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/order.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/product.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +5 -5
- data/rbi/lib/terminal-shop/resources/subscription.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/token.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/view.rbi +2 -2
- data/rbi/lib/terminal-shop/util.rbi +153 -104
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +3 -7
- data/sig/terminal-shop/base_page.rbs +1 -1
- data/sig/terminal-shop/errors.rbs +2 -1
- data/sig/terminal-shop/models/address_get_params.rbs +19 -0
- data/sig/terminal-shop/models/address_get_response.rbs +18 -0
- data/sig/terminal-shop/models/app_create_params.rbs +12 -3
- data/sig/terminal-shop/models/card_get_params.rbs +18 -0
- data/sig/terminal-shop/models/card_get_response.rbs +18 -0
- data/sig/terminal-shop/models/cart.rbs +27 -2
- data/sig/terminal-shop/models/cart_convert_params.rbs +10 -2
- data/sig/terminal-shop/models/cart_redeem_gift_card_params.rbs +25 -0
- data/sig/terminal-shop/models/cart_redeem_gift_card_response.rbs +47 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_params.rbs +19 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_response.rbs +18 -0
- data/sig/terminal-shop/models/product.rbs +58 -17
- data/sig/terminal-shop/models/product_get_params.rbs +19 -0
- data/sig/terminal-shop/models/product_get_response.rbs +18 -0
- data/sig/terminal-shop/models/profile_update_params.rbs +5 -5
- data/sig/terminal-shop/models/subscription_get_params.rbs +19 -0
- data/sig/terminal-shop/models/subscription_get_response.rbs +19 -0
- data/sig/terminal-shop/request_options.rbs +4 -0
- data/sig/terminal-shop/resources/address.rbs +10 -0
- data/sig/terminal-shop/resources/app.rbs +0 -2
- data/sig/terminal-shop/resources/card.rbs +10 -0
- data/sig/terminal-shop/resources/cart.rbs +20 -0
- data/sig/terminal-shop/resources/product.rbs +10 -0
- data/sig/terminal-shop/resources/profile.rbs +3 -4
- data/sig/terminal-shop/resources/subscription.rbs +11 -0
- data/sig/terminal-shop/util.rbs +19 -0
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +40 -4
@@ -22,33 +22,35 @@ module TerminalShop
|
|
22
22
|
def try_strict_coerce(value)
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
class << self
|
26
|
+
sig do
|
27
|
+
params(
|
28
|
+
spec: T.any(
|
29
|
+
{
|
30
|
+
const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)),
|
31
|
+
enum: T.nilable(T.proc.returns(TerminalShop::Converter::Input)),
|
32
|
+
union: T.nilable(T.proc.returns(TerminalShop::Converter::Input))
|
33
|
+
},
|
34
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
35
|
+
TerminalShop::Converter::Input
|
36
|
+
)
|
35
37
|
)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
38
|
+
.returns(T.proc.returns(T.anything).void)
|
39
|
+
end
|
40
|
+
def self.type_info(spec)
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
sig { params(target: TerminalShop::Converter::Input, value: T.anything).returns(T.anything) }
|
44
|
+
def self.coerce(target, value)
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
sig { params(target: TerminalShop::Converter::Input, value: T.anything).returns(T.anything) }
|
48
|
+
def self.dump(target, value)
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
sig { params(target: TerminalShop::Converter::Input, value: T.anything).returns(T.anything) }
|
52
|
+
def self.try_strict_coerce(target, value)
|
53
|
+
end
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
@@ -65,20 +67,22 @@ module TerminalShop
|
|
65
67
|
def self.==(other)
|
66
68
|
end
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
class << self
|
71
|
+
sig { override.params(value: T.anything).returns(T.anything) }
|
72
|
+
def coerce(value)
|
73
|
+
end
|
71
74
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
sig { override.params(value: T.anything).returns(T.anything) }
|
76
|
+
def dump(value)
|
77
|
+
end
|
75
78
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
sig do
|
80
|
+
override
|
81
|
+
.params(value: T.anything)
|
82
|
+
.returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer]))
|
83
|
+
end
|
84
|
+
def try_strict_coerce(value)
|
85
|
+
end
|
82
86
|
end
|
83
87
|
end
|
84
88
|
|
@@ -95,20 +99,22 @@ module TerminalShop
|
|
95
99
|
def self.==(other)
|
96
100
|
end
|
97
101
|
|
98
|
-
|
99
|
-
|
100
|
-
|
102
|
+
class << self
|
103
|
+
sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) }
|
104
|
+
def coerce(value)
|
105
|
+
end
|
101
106
|
|
102
|
-
|
103
|
-
|
104
|
-
|
107
|
+
sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) }
|
108
|
+
def dump(value)
|
109
|
+
end
|
105
110
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
111
|
+
sig do
|
112
|
+
override
|
113
|
+
.params(value: T.anything)
|
114
|
+
.returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer]))
|
115
|
+
end
|
116
|
+
def try_strict_coerce(value)
|
117
|
+
end
|
112
118
|
end
|
113
119
|
end
|
114
120
|
|
@@ -117,12 +123,14 @@ module TerminalShop
|
|
117
123
|
|
118
124
|
extend TerminalShop::Converter
|
119
125
|
|
120
|
-
|
121
|
-
|
122
|
-
|
126
|
+
class << self
|
127
|
+
sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) }
|
128
|
+
def values
|
129
|
+
end
|
123
130
|
|
124
|
-
|
125
|
-
|
131
|
+
sig { void }
|
132
|
+
private def finalize!
|
133
|
+
end
|
126
134
|
end
|
127
135
|
|
128
136
|
sig { params(other: T.anything).returns(T::Boolean) }
|
@@ -133,20 +141,22 @@ module TerminalShop
|
|
133
141
|
def self.==(other)
|
134
142
|
end
|
135
143
|
|
136
|
-
|
137
|
-
|
138
|
-
|
144
|
+
class << self
|
145
|
+
sig { override.params(value: T.any(String, Symbol, T.anything)).returns(T.any(Symbol, T.anything)) }
|
146
|
+
def coerce(value)
|
147
|
+
end
|
139
148
|
|
140
|
-
|
141
|
-
|
142
|
-
|
149
|
+
sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) }
|
150
|
+
def dump(value)
|
151
|
+
end
|
143
152
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
153
|
+
sig do
|
154
|
+
override
|
155
|
+
.params(value: T.anything)
|
156
|
+
.returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer]))
|
157
|
+
end
|
158
|
+
def try_strict_coerce(value)
|
159
|
+
end
|
150
160
|
end
|
151
161
|
end
|
152
162
|
|
@@ -155,39 +165,41 @@ module TerminalShop
|
|
155
165
|
|
156
166
|
extend TerminalShop::Converter
|
157
167
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
168
|
+
class << self
|
169
|
+
sig { returns(T::Array[[T.nilable(Symbol), Proc]]) }
|
170
|
+
private def known_variants
|
171
|
+
end
|
172
|
+
|
173
|
+
sig { overridable.returns(T::Array[[T.nilable(Symbol), T.anything]]) }
|
174
|
+
protected def variants
|
175
|
+
end
|
176
|
+
|
177
|
+
sig { params(property: Symbol).void }
|
178
|
+
private def discriminator(property)
|
179
|
+
end
|
180
|
+
|
181
|
+
sig do
|
182
|
+
params(
|
183
|
+
key: T.any(
|
184
|
+
Symbol,
|
185
|
+
T::Hash[Symbol, T.anything],
|
186
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
187
|
+
TerminalShop::Converter::Input
|
188
|
+
),
|
189
|
+
spec: T.any(
|
190
|
+
T::Hash[Symbol, T.anything],
|
191
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
192
|
+
TerminalShop::Converter::Input
|
193
|
+
)
|
182
194
|
)
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
end
|
195
|
+
.void
|
196
|
+
end
|
197
|
+
private def variant(key, spec = nil)
|
198
|
+
end
|
188
199
|
|
189
|
-
|
190
|
-
|
200
|
+
sig { params(value: T.anything).returns(T.nilable(TerminalShop::Converter::Input)) }
|
201
|
+
private def resolve_variant(value)
|
202
|
+
end
|
191
203
|
end
|
192
204
|
|
193
205
|
sig { params(other: T.anything).returns(T::Boolean) }
|
@@ -198,20 +210,22 @@ module TerminalShop
|
|
198
210
|
def self.==(other)
|
199
211
|
end
|
200
212
|
|
201
|
-
|
202
|
-
|
203
|
-
|
213
|
+
class << self
|
214
|
+
sig { override.params(value: T.anything).returns(T.anything) }
|
215
|
+
def coerce(value)
|
216
|
+
end
|
204
217
|
|
205
|
-
|
206
|
-
|
207
|
-
|
218
|
+
sig { override.params(value: T.anything).returns(T.anything) }
|
219
|
+
def dump(value)
|
220
|
+
end
|
208
221
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
222
|
+
sig do
|
223
|
+
override
|
224
|
+
.params(value: T.anything)
|
225
|
+
.returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer]))
|
226
|
+
end
|
227
|
+
def try_strict_coerce(value)
|
228
|
+
end
|
215
229
|
end
|
216
230
|
end
|
217
231
|
|
@@ -265,9 +279,9 @@ module TerminalShop
|
|
265
279
|
),
|
266
280
|
spec: T::Hash[Symbol, T.anything]
|
267
281
|
)
|
268
|
-
.
|
282
|
+
.returns(T.attached_class)
|
269
283
|
end
|
270
|
-
def
|
284
|
+
def self.new(type_info, spec = {})
|
271
285
|
end
|
272
286
|
end
|
273
287
|
|
@@ -321,9 +335,9 @@ module TerminalShop
|
|
321
335
|
),
|
322
336
|
spec: T::Hash[Symbol, T.anything]
|
323
337
|
)
|
324
|
-
.
|
338
|
+
.returns(T.attached_class)
|
325
339
|
end
|
326
|
-
def
|
340
|
+
def self.new(type_info, spec = {})
|
327
341
|
end
|
328
342
|
end
|
329
343
|
|
@@ -334,119 +348,123 @@ module TerminalShop
|
|
334
348
|
|
335
349
|
KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean} }
|
336
350
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
351
|
+
class << self
|
352
|
+
sig do
|
353
|
+
returns(
|
354
|
+
T::Hash[
|
355
|
+
Symbol,
|
356
|
+
T.all(
|
357
|
+
TerminalShop::BaseModel::KnownFieldShape,
|
358
|
+
{type_fn: T.proc.returns(TerminalShop::Converter::Input)}
|
359
|
+
)
|
360
|
+
]
|
344
361
|
)
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
)
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
)
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
)
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
def self.optional(name_sym, type_info, spec = {})
|
414
|
-
end
|
362
|
+
end
|
363
|
+
def known_fields
|
364
|
+
end
|
365
|
+
|
366
|
+
sig do
|
367
|
+
returns(
|
368
|
+
T::Hash[Symbol,
|
369
|
+
T.all(TerminalShop::BaseModel::KnownFieldShape, {type: TerminalShop::Converter::Input})]
|
370
|
+
)
|
371
|
+
end
|
372
|
+
def fields
|
373
|
+
end
|
374
|
+
|
375
|
+
sig { returns(T::Hash[Symbol, T.proc.returns(T::Class[T.anything])]) }
|
376
|
+
def defaults
|
377
|
+
end
|
378
|
+
|
379
|
+
sig do
|
380
|
+
params(
|
381
|
+
name_sym: Symbol,
|
382
|
+
required: T::Boolean,
|
383
|
+
type_info: T.any(
|
384
|
+
{
|
385
|
+
const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)),
|
386
|
+
enum: T.nilable(T.proc.returns(TerminalShop::Converter::Input)),
|
387
|
+
union: T.nilable(T.proc.returns(TerminalShop::Converter::Input)),
|
388
|
+
api_name: Symbol,
|
389
|
+
nil?: T::Boolean
|
390
|
+
},
|
391
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
392
|
+
TerminalShop::Converter::Input
|
393
|
+
),
|
394
|
+
spec: T::Hash[Symbol, T.anything]
|
395
|
+
)
|
396
|
+
.void
|
397
|
+
end
|
398
|
+
private def add_field(name_sym, required:, type_info:, spec:)
|
399
|
+
end
|
400
|
+
|
401
|
+
sig do
|
402
|
+
params(
|
403
|
+
name_sym: Symbol,
|
404
|
+
type_info: T.any(
|
405
|
+
T::Hash[Symbol, T.anything],
|
406
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
407
|
+
TerminalShop::Converter::Input
|
408
|
+
),
|
409
|
+
spec: T::Hash[Symbol, T.anything]
|
410
|
+
)
|
411
|
+
.void
|
412
|
+
end
|
413
|
+
def required(name_sym, type_info, spec = {})
|
414
|
+
end
|
415
|
+
|
416
|
+
sig do
|
417
|
+
params(
|
418
|
+
name_sym: Symbol,
|
419
|
+
type_info: T.any(
|
420
|
+
T::Hash[Symbol, T.anything],
|
421
|
+
T.proc.returns(TerminalShop::Converter::Input),
|
422
|
+
TerminalShop::Converter::Input
|
423
|
+
),
|
424
|
+
spec: T::Hash[Symbol, T.anything]
|
425
|
+
)
|
426
|
+
.void
|
427
|
+
end
|
428
|
+
def optional(name_sym, type_info, spec = {})
|
429
|
+
end
|
415
430
|
|
416
|
-
|
417
|
-
|
418
|
-
|
431
|
+
sig { params(blk: T.proc.void).void }
|
432
|
+
private def request_only(&blk)
|
433
|
+
end
|
419
434
|
|
420
|
-
|
421
|
-
|
435
|
+
sig { params(blk: T.proc.void).void }
|
436
|
+
private def response_only(&blk)
|
437
|
+
end
|
422
438
|
end
|
423
439
|
|
424
440
|
sig { params(other: T.anything).returns(T::Boolean) }
|
425
441
|
def ==(other)
|
426
442
|
end
|
427
443
|
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
444
|
+
class << self
|
445
|
+
sig do
|
446
|
+
override
|
447
|
+
.params(value: T.any(TerminalShop::BaseModel, T::Hash[T.anything, T.anything], T.anything))
|
448
|
+
.returns(T.any(T.attached_class, T.anything))
|
449
|
+
end
|
450
|
+
def coerce(value)
|
451
|
+
end
|
452
|
+
|
453
|
+
sig do
|
454
|
+
override
|
455
|
+
.params(value: T.any(T.attached_class, T.anything))
|
456
|
+
.returns(T.any(T::Hash[T.anything, T.anything], T.anything))
|
457
|
+
end
|
458
|
+
def dump(value)
|
459
|
+
end
|
460
|
+
|
461
|
+
sig do
|
462
|
+
override
|
463
|
+
.params(value: T.anything)
|
464
|
+
.returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer]))
|
465
|
+
end
|
466
|
+
def try_strict_coerce(value)
|
467
|
+
end
|
450
468
|
end
|
451
469
|
|
452
470
|
sig { params(key: Symbol).returns(T.nilable(T.anything)) }
|
@@ -463,8 +481,8 @@ module TerminalShop
|
|
463
481
|
def deconstruct_keys(keys)
|
464
482
|
end
|
465
483
|
|
466
|
-
sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).
|
467
|
-
def
|
484
|
+
sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(T.attached_class) }
|
485
|
+
def self.new(data = {})
|
468
486
|
end
|
469
487
|
|
470
488
|
sig { returns(String) }
|
@@ -29,11 +29,11 @@ module TerminalShop
|
|
29
29
|
client: TerminalShop::BaseClient,
|
30
30
|
req: TerminalShop::BaseClient::RequestComponentsShape,
|
31
31
|
headers: T.any(T::Hash[String, String], Net::HTTPHeader),
|
32
|
-
|
32
|
+
page_data: T.anything
|
33
33
|
)
|
34
34
|
.void
|
35
35
|
end
|
36
|
-
def initialize(client:, req:, headers:,
|
36
|
+
def initialize(client:, req:, headers:, page_data:)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -32,9 +32,9 @@ module TerminalShop
|
|
32
32
|
response: NilClass,
|
33
33
|
message: T.nilable(String)
|
34
34
|
)
|
35
|
-
.
|
35
|
+
.returns(T.attached_class)
|
36
36
|
end
|
37
|
-
def
|
37
|
+
def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -56,9 +56,9 @@ module TerminalShop
|
|
56
56
|
response: NilClass,
|
57
57
|
message: T.nilable(String)
|
58
58
|
)
|
59
|
-
.
|
59
|
+
.returns(T.attached_class)
|
60
60
|
end
|
61
|
-
def
|
61
|
+
def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -72,9 +72,9 @@ module TerminalShop
|
|
72
72
|
response: NilClass,
|
73
73
|
message: T.nilable(String)
|
74
74
|
)
|
75
|
-
.
|
75
|
+
.returns(T.attached_class)
|
76
76
|
end
|
77
|
-
def
|
77
|
+
def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.")
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -85,11 +85,12 @@ module TerminalShop
|
|
85
85
|
status: Integer,
|
86
86
|
body: T.nilable(Object),
|
87
87
|
request: NilClass,
|
88
|
-
response: NilClass
|
88
|
+
response: NilClass,
|
89
|
+
message: T.nilable(String)
|
89
90
|
)
|
90
91
|
.returns(T.attached_class)
|
91
92
|
end
|
92
|
-
def self.for(url:, status:, body:, request:, response:)
|
93
|
+
def self.for(url:, status:, body:, request:, response:, message: nil)
|
93
94
|
end
|
94
95
|
|
95
96
|
sig { returns(Integer) }
|
@@ -105,9 +106,9 @@ module TerminalShop
|
|
105
106
|
response: NilClass,
|
106
107
|
message: T.nilable(String)
|
107
108
|
)
|
108
|
-
.
|
109
|
+
.returns(T.attached_class)
|
109
110
|
end
|
110
|
-
def
|
111
|
+
def self.new(url:, status:, body:, request:, response:, message: nil)
|
111
112
|
end
|
112
113
|
end
|
113
114
|
|
@@ -87,9 +87,9 @@ module TerminalShop
|
|
87
87
|
province: String,
|
88
88
|
street2: String
|
89
89
|
)
|
90
|
-
.
|
90
|
+
.returns(T.attached_class)
|
91
91
|
end
|
92
|
-
def
|
92
|
+
def self.new(id:, city:, country:, name:, street1:, zip:, phone: nil, province: nil, street2: nil)
|
93
93
|
end
|
94
94
|
|
95
95
|
sig do
|