terminal-shop 1.8.0 → 2.0.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 +14 -0
- data/lib/terminal-shop/base_client.rb +11 -10
- data/lib/terminal-shop/base_model.rb +257 -244
- data/lib/terminal-shop/base_page.rb +19 -20
- data/lib/terminal-shop/client.rb +1 -0
- data/lib/terminal-shop/models/product.rb +7 -3
- data/lib/terminal-shop/models/region.rb +7 -3
- data/lib/terminal-shop/models/subscription.rb +5 -7
- data/lib/terminal-shop/pooled_net_requester.rb +12 -1
- data/lib/terminal-shop/request_options.rb +1 -1
- data/lib/terminal-shop/util.rb +16 -7
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +15 -0
- data/rbi/lib/terminal-shop/base_client.rbi +40 -41
- data/rbi/lib/terminal-shop/base_model.rbi +139 -116
- data/rbi/lib/terminal-shop/base_page.rbi +0 -2
- data/rbi/lib/terminal-shop/client.rbi +18 -30
- data/rbi/lib/terminal-shop/errors.rbi +7 -42
- data/rbi/lib/terminal-shop/models/address.rbi +15 -51
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +15 -46
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/app.rbi +4 -24
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +8 -20
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/card.rbi +14 -36
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +7 -14
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart.rbi +34 -88
- data/rbi/lib/terminal-shop/models/cart_clear_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_clear_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -7
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/order.rbi +52 -139
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +4 -19
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/product.rbi +43 -77
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/product_variant.rbi +3 -18
- data/rbi/lib/terminal-shop/models/profile.rbi +12 -36
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/region.rbi +10 -5
- data/rbi/lib/terminal-shop/models/subscription.rbi +28 -75
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +7 -6
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +3 -8
- data/rbi/lib/terminal-shop/models/token.rbi +3 -18
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +8 -20
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_delete_response.rbi +1 -6
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +4 -6
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +32 -81
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +14 -3
- data/rbi/lib/terminal-shop/request_options.rbi +11 -55
- data/rbi/lib/terminal-shop/resources/address.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/app.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/card.rbi +5 -5
- data/rbi/lib/terminal-shop/resources/cart.rbi +6 -6
- data/rbi/lib/terminal-shop/resources/email.rbi +1 -1
- data/rbi/lib/terminal-shop/resources/order.rbi +3 -3
- data/rbi/lib/terminal-shop/resources/product.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/subscription.rbi +5 -4
- data/rbi/lib/terminal-shop/resources/token.rbi +4 -4
- data/rbi/lib/terminal-shop/resources/view.rbi +1 -1
- data/rbi/lib/terminal-shop/util.rbi +24 -13
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +14 -14
- data/sig/terminal-shop/base_model.rbs +34 -18
- data/sig/terminal-shop/client.rbs +8 -8
- data/sig/terminal-shop/errors.rbs +17 -17
- data/sig/terminal-shop/models/address.rbs +11 -15
- data/sig/terminal-shop/models/address_create_params.rbs +11 -16
- data/sig/terminal-shop/models/address_create_response.rbs +1 -6
- data/sig/terminal-shop/models/address_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/address_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/address_get_params.rbs +1 -6
- data/sig/terminal-shop/models/address_get_response.rbs +1 -6
- data/sig/terminal-shop/models/address_list_params.rbs +1 -6
- data/sig/terminal-shop/models/address_list_response.rbs +1 -6
- data/sig/terminal-shop/models/app.rbs +6 -5
- data/sig/terminal-shop/models/app_create_params.rbs +5 -10
- data/sig/terminal-shop/models/app_create_response.rbs +4 -12
- data/sig/terminal-shop/models/app_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/app_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/app_get_params.rbs +1 -5
- data/sig/terminal-shop/models/app_get_response.rbs +1 -5
- data/sig/terminal-shop/models/app_list_params.rbs +1 -5
- data/sig/terminal-shop/models/app_list_response.rbs +1 -6
- data/sig/terminal-shop/models/card.rbs +7 -16
- data/sig/terminal-shop/models/card_collect_params.rbs +1 -6
- data/sig/terminal-shop/models/card_collect_response.rbs +4 -12
- data/sig/terminal-shop/models/card_create_params.rbs +4 -6
- data/sig/terminal-shop/models/card_create_response.rbs +1 -6
- data/sig/terminal-shop/models/card_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/card_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/card_get_params.rbs +1 -5
- data/sig/terminal-shop/models/card_get_response.rbs +1 -6
- data/sig/terminal-shop/models/card_list_params.rbs +1 -5
- data/sig/terminal-shop/models/card_list_response.rbs +1 -6
- data/sig/terminal-shop/models/cart.rbs +20 -34
- data/sig/terminal-shop/models/cart_clear_params.rbs +1 -6
- data/sig/terminal-shop/models/cart_clear_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_convert_params.rbs +1 -6
- data/sig/terminal-shop/models/cart_convert_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_get_params.rbs +1 -5
- data/sig/terminal-shop/models/cart_get_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_address_params.rbs +4 -9
- data/sig/terminal-shop/models/cart_set_address_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_card_params.rbs +4 -6
- data/sig/terminal-shop/models/cart_set_card_response.rbs +1 -6
- data/sig/terminal-shop/models/cart_set_item_params.rbs +5 -10
- data/sig/terminal-shop/models/cart_set_item_response.rbs +1 -6
- data/sig/terminal-shop/models/email_create_params.rbs +4 -6
- data/sig/terminal-shop/models/email_create_response.rbs +1 -6
- data/sig/terminal-shop/models/order.rbs +31 -50
- data/sig/terminal-shop/models/order_create_params.rbs +6 -11
- data/sig/terminal-shop/models/order_create_response.rbs +1 -6
- data/sig/terminal-shop/models/order_get_params.rbs +1 -5
- data/sig/terminal-shop/models/order_get_response.rbs +1 -6
- data/sig/terminal-shop/models/order_list_params.rbs +1 -6
- data/sig/terminal-shop/models/order_list_response.rbs +1 -6
- data/sig/terminal-shop/models/product.rbs +20 -27
- data/sig/terminal-shop/models/product_get_params.rbs +1 -6
- data/sig/terminal-shop/models/product_get_response.rbs +1 -6
- data/sig/terminal-shop/models/product_list_params.rbs +1 -6
- data/sig/terminal-shop/models/product_list_response.rbs +1 -6
- data/sig/terminal-shop/models/product_variant.rbs +1 -5
- data/sig/terminal-shop/models/profile.rbs +8 -17
- data/sig/terminal-shop/models/profile_me_params.rbs +1 -6
- data/sig/terminal-shop/models/profile_me_response.rbs +1 -6
- data/sig/terminal-shop/models/profile_update_params.rbs +5 -10
- data/sig/terminal-shop/models/profile_update_response.rbs +1 -6
- data/sig/terminal-shop/models/region.rbs +4 -2
- data/sig/terminal-shop/models/subscription.rbs +15 -27
- data/sig/terminal-shop/models/subscription_create_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_create_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_get_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_get_response.rbs +1 -6
- data/sig/terminal-shop/models/subscription_list_params.rbs +1 -6
- data/sig/terminal-shop/models/subscription_list_response.rbs +3 -6
- data/sig/terminal-shop/models/token.rbs +1 -5
- data/sig/terminal-shop/models/token_create_params.rbs +1 -6
- data/sig/terminal-shop/models/token_create_response.rbs +4 -12
- data/sig/terminal-shop/models/token_delete_params.rbs +1 -6
- data/sig/terminal-shop/models/token_delete_response.rbs +1 -6
- data/sig/terminal-shop/models/token_get_params.rbs +1 -5
- data/sig/terminal-shop/models/token_get_response.rbs +1 -6
- data/sig/terminal-shop/models/token_list_params.rbs +1 -6
- data/sig/terminal-shop/models/token_list_response.rbs +1 -6
- data/sig/terminal-shop/models/view_init_params.rbs +1 -5
- data/sig/terminal-shop/models/view_init_response.rbs +15 -23
- data/sig/terminal-shop/pooled_net_requester.rbs +3 -1
- data/sig/terminal-shop/request_options.rbs +2 -2
- data/sig/terminal-shop/resources/address.rbs +22 -41
- data/sig/terminal-shop/resources/app.rbs +16 -34
- data/sig/terminal-shop/resources/card.rbs +18 -40
- data/sig/terminal-shop/resources/cart.rbs +22 -47
- data/sig/terminal-shop/resources/email.rbs +4 -8
- data/sig/terminal-shop/resources/order.rbs +13 -26
- data/sig/terminal-shop/resources/product.rbs +7 -16
- data/sig/terminal-shop/resources/profile.rbs +8 -16
- data/sig/terminal-shop/resources/subscription.rbs +21 -43
- data/sig/terminal-shop/resources/token.rbs +14 -32
- data/sig/terminal-shop/resources/view.rbs +3 -7
- data/sig/terminal-shop/util.rbs +5 -5
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +2 -2
@@ -3,6 +3,10 @@
|
|
3
3
|
module TerminalShop
|
4
4
|
# @api private
|
5
5
|
module Util
|
6
|
+
# Due to the current WIP status of Shapes support in Sorbet, types referencing
|
7
|
+
# this alias might be refined in the future.
|
8
|
+
AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
|
9
|
+
|
6
10
|
# @api private
|
7
11
|
sig { returns(Float) }
|
8
12
|
def self.monotonic_secs
|
@@ -52,6 +56,11 @@ module TerminalShop
|
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
59
|
+
# Use this to indicate that a value should be explicitly removed from a data
|
60
|
+
# structure when using `TerminalShop::Util.deep_merge`.
|
61
|
+
#
|
62
|
+
# e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging
|
63
|
+
# `{a: 1}` and `{}` would produce `{a: 1}`.
|
55
64
|
OMIT = T.let(T.anything, T.anything)
|
56
65
|
|
57
66
|
class << self
|
@@ -80,7 +89,7 @@ module TerminalShop
|
|
80
89
|
# @api private
|
81
90
|
sig do
|
82
91
|
params(
|
83
|
-
data: T.any(
|
92
|
+
data: T.any(TerminalShop::Util::AnyHash, T::Array[T.anything], T.anything),
|
84
93
|
pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])),
|
85
94
|
sentinel: T.nilable(T.anything),
|
86
95
|
blk: T.nilable(T.proc.returns(T.anything))
|
@@ -118,15 +127,16 @@ module TerminalShop
|
|
118
127
|
end
|
119
128
|
end
|
120
129
|
|
121
|
-
ParsedUriShape =
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
+
ParsedUriShape =
|
131
|
+
T.type_alias do
|
132
|
+
{
|
133
|
+
scheme: T.nilable(String),
|
134
|
+
host: T.nilable(String),
|
135
|
+
port: T.nilable(Integer),
|
136
|
+
path: T.nilable(String),
|
137
|
+
query: T::Hash[String, T::Array[String]]
|
138
|
+
}
|
139
|
+
end
|
130
140
|
|
131
141
|
class << self
|
132
142
|
# @api private
|
@@ -249,9 +259,10 @@ module TerminalShop
|
|
249
259
|
end
|
250
260
|
end
|
251
261
|
|
252
|
-
ServerSentEvent =
|
253
|
-
|
254
|
-
|
262
|
+
ServerSentEvent =
|
263
|
+
T.type_alias do
|
264
|
+
{event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)}
|
265
|
+
end
|
255
266
|
|
256
267
|
class << self
|
257
268
|
# @api private
|
@@ -55,14 +55,14 @@ module TerminalShop
|
|
55
55
|
|
56
56
|
def initialize: (
|
57
57
|
base_url: String,
|
58
|
-
timeout: Float,
|
59
|
-
max_retries: Integer,
|
60
|
-
initial_retry_delay: Float,
|
61
|
-
max_retry_delay: Float,
|
62
|
-
headers: ::Hash[String, (String
|
58
|
+
?timeout: Float,
|
59
|
+
?max_retries: Integer,
|
60
|
+
?initial_retry_delay: Float,
|
61
|
+
?max_retry_delay: Float,
|
62
|
+
?headers: ::Hash[String, (String
|
63
63
|
| Integer
|
64
64
|
| ::Array[(String | Integer)?])?],
|
65
|
-
idempotency_header: String?
|
65
|
+
?idempotency_header: String?
|
66
66
|
) -> void
|
67
67
|
|
68
68
|
private def auth_headers: -> ::Hash[String, String]
|
@@ -90,16 +90,16 @@ module TerminalShop
|
|
90
90
|
(
|
91
91
|
Symbol method,
|
92
92
|
String | ::Array[String] path,
|
93
|
-
query: ::Hash[String, (::Array[String] | String)?]?,
|
94
|
-
headers: ::Hash[String, (String
|
93
|
+
?query: ::Hash[String, (::Array[String] | String)?]?,
|
94
|
+
?headers: ::Hash[String, (String
|
95
95
|
| Integer
|
96
96
|
| ::Array[(String | Integer)?])?]?,
|
97
|
-
body: top?,
|
98
|
-
unwrap: Symbol?,
|
99
|
-
page: Class?,
|
100
|
-
stream: Class?,
|
101
|
-
model: TerminalShop::Converter::input?,
|
102
|
-
options: TerminalShop::request_opts?
|
97
|
+
?body: top?,
|
98
|
+
?unwrap: Symbol?,
|
99
|
+
?page: Class?,
|
100
|
+
?stream: Class?,
|
101
|
+
?model: TerminalShop::Converter::input?,
|
102
|
+
?options: TerminalShop::request_opts?
|
103
103
|
) -> top
|
104
104
|
| (TerminalShop::BaseClient::request_components req) -> top
|
105
105
|
|
@@ -62,28 +62,28 @@ module TerminalShop
|
|
62
62
|
) -> ([true, top, nil] | [false, bool, Integer])
|
63
63
|
end
|
64
64
|
|
65
|
-
|
66
|
-
|
65
|
+
module Enum
|
66
|
+
include TerminalShop::Converter
|
67
67
|
|
68
68
|
def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
|
69
69
|
|
70
70
|
private def self.finalize!: -> void
|
71
71
|
|
72
|
-
def
|
72
|
+
def ===: (top other) -> bool
|
73
73
|
|
74
|
-
def
|
74
|
+
def ==: (top other) -> bool
|
75
75
|
|
76
|
-
def
|
76
|
+
def coerce: (String | Symbol | top value) -> (Symbol | top)
|
77
77
|
|
78
|
-
def
|
78
|
+
def dump: (Symbol | top value) -> (Symbol | top)
|
79
79
|
|
80
|
-
def
|
80
|
+
def try_strict_coerce: (
|
81
81
|
top value
|
82
82
|
) -> ([true, top, nil] | [false, bool, Integer])
|
83
83
|
end
|
84
84
|
|
85
|
-
|
86
|
-
|
85
|
+
module Union
|
86
|
+
include TerminalShop::Converter
|
87
87
|
|
88
88
|
private def self.known_variants: -> ::Array[[Symbol?, (^-> TerminalShop::Converter::input)]]
|
89
89
|
|
@@ -107,22 +107,29 @@ module TerminalShop
|
|
107
107
|
top value
|
108
108
|
) -> TerminalShop::Converter::input?
|
109
109
|
|
110
|
-
def
|
110
|
+
def ===: (top other) -> bool
|
111
111
|
|
112
|
-
def
|
112
|
+
def ==: (top other) -> bool
|
113
113
|
|
114
|
-
def
|
114
|
+
def coerce: (top value) -> top
|
115
115
|
|
116
|
-
def
|
116
|
+
def dump: (top value) -> top
|
117
117
|
|
118
|
-
def
|
118
|
+
def try_strict_coerce: (
|
119
119
|
top value
|
120
120
|
) -> ([true, top, nil] | [false, bool, Integer])
|
121
121
|
end
|
122
122
|
|
123
|
-
class ArrayOf
|
123
|
+
class ArrayOf
|
124
124
|
include TerminalShop::Converter
|
125
125
|
|
126
|
+
def self.[]: (
|
127
|
+
::Hash[Symbol, top]
|
128
|
+
| ^-> TerminalShop::Converter::input
|
129
|
+
| TerminalShop::Converter::input type_info,
|
130
|
+
?::Hash[Symbol, top] spec
|
131
|
+
) -> instance
|
132
|
+
|
126
133
|
def ===: (top other) -> bool
|
127
134
|
|
128
135
|
def ==: (top other) -> bool
|
@@ -135,7 +142,7 @@ module TerminalShop
|
|
135
142
|
top value
|
136
143
|
) -> ([true, top, nil] | [false, bool, Integer])
|
137
144
|
|
138
|
-
def item_type: ->
|
145
|
+
def item_type: -> top
|
139
146
|
|
140
147
|
def initialize: (
|
141
148
|
::Hash[Symbol, top]
|
@@ -145,9 +152,16 @@ module TerminalShop
|
|
145
152
|
) -> void
|
146
153
|
end
|
147
154
|
|
148
|
-
class HashOf
|
155
|
+
class HashOf
|
149
156
|
include TerminalShop::Converter
|
150
157
|
|
158
|
+
def self.[]: (
|
159
|
+
::Hash[Symbol, top]
|
160
|
+
| ^-> TerminalShop::Converter::input
|
161
|
+
| TerminalShop::Converter::input type_info,
|
162
|
+
?::Hash[Symbol, top] spec
|
163
|
+
) -> instance
|
164
|
+
|
151
165
|
def ===: (top other) -> bool
|
152
166
|
|
153
167
|
def ==: (top other) -> bool
|
@@ -160,7 +174,7 @@ module TerminalShop
|
|
160
174
|
top value
|
161
175
|
) -> ([true, top, nil] | [false, bool, Integer])
|
162
176
|
|
163
|
-
def item_type: ->
|
177
|
+
def item_type: -> top
|
164
178
|
|
165
179
|
def initialize: (
|
166
180
|
::Hash[Symbol, top]
|
@@ -178,6 +192,8 @@ module TerminalShop
|
|
178
192
|
def self.known_fields: -> ::Hash[Symbol, (TerminalShop::BaseModel::known_field
|
179
193
|
& { type_fn: (^-> TerminalShop::Converter::input) })]
|
180
194
|
|
195
|
+
def self.reverse_map: -> ::Hash[Symbol, Symbol]
|
196
|
+
|
181
197
|
def self.fields: -> ::Hash[Symbol, (TerminalShop::BaseModel::known_field
|
182
198
|
& { type: TerminalShop::Converter::input })]
|
183
199
|
|
@@ -42,14 +42,14 @@ module TerminalShop
|
|
42
42
|
private def auth_headers: -> ::Hash[String, String]
|
43
43
|
|
44
44
|
def initialize: (
|
45
|
-
environment: :production | :dev | nil,
|
46
|
-
base_url: String?,
|
47
|
-
bearer_token: String?,
|
48
|
-
app_id: String?,
|
49
|
-
max_retries: Integer,
|
50
|
-
timeout: Float,
|
51
|
-
initial_retry_delay: Float,
|
52
|
-
max_retry_delay: Float
|
45
|
+
?environment: :production | :dev | nil,
|
46
|
+
?base_url: String?,
|
47
|
+
?bearer_token: String?,
|
48
|
+
?app_id: String?,
|
49
|
+
?max_retries: Integer,
|
50
|
+
?timeout: Float,
|
51
|
+
?initial_retry_delay: Float,
|
52
|
+
?max_retry_delay: Float
|
53
53
|
) -> void
|
54
54
|
end
|
55
55
|
end
|
@@ -15,33 +15,33 @@ module TerminalShop
|
|
15
15
|
|
16
16
|
def initialize: (
|
17
17
|
url: URI::Generic,
|
18
|
-
status: Integer?,
|
19
|
-
body: Object?,
|
20
|
-
request: nil,
|
21
|
-
response: nil,
|
22
|
-
message: String?
|
18
|
+
?status: Integer?,
|
19
|
+
?body: Object?,
|
20
|
+
?request: nil,
|
21
|
+
?response: nil,
|
22
|
+
?message: String?
|
23
23
|
) -> void
|
24
24
|
end
|
25
25
|
|
26
26
|
class APIConnectionError < TerminalShop::APIError
|
27
27
|
def initialize: (
|
28
28
|
url: URI::Generic,
|
29
|
-
status: nil,
|
30
|
-
body: nil,
|
31
|
-
request: nil,
|
32
|
-
response: nil,
|
33
|
-
message: String?
|
29
|
+
?status: nil,
|
30
|
+
?body: nil,
|
31
|
+
?request: nil,
|
32
|
+
?response: nil,
|
33
|
+
?message: String?
|
34
34
|
) -> void
|
35
35
|
end
|
36
36
|
|
37
37
|
class APITimeoutError < TerminalShop::APIConnectionError
|
38
38
|
def initialize: (
|
39
39
|
url: URI::Generic,
|
40
|
-
status: nil,
|
41
|
-
body: nil,
|
42
|
-
request: nil,
|
43
|
-
response: nil,
|
44
|
-
message: String?
|
40
|
+
?status: nil,
|
41
|
+
?body: nil,
|
42
|
+
?request: nil,
|
43
|
+
?response: nil,
|
44
|
+
?message: String?
|
45
45
|
) -> void
|
46
46
|
end
|
47
47
|
|
@@ -52,7 +52,7 @@ module TerminalShop
|
|
52
52
|
body: Object?,
|
53
53
|
request: nil,
|
54
54
|
response: nil,
|
55
|
-
message: String?
|
55
|
+
?message: String?
|
56
56
|
) -> instance
|
57
57
|
|
58
58
|
def initialize: (
|
@@ -61,7 +61,7 @@ module TerminalShop
|
|
61
61
|
body: Object?,
|
62
62
|
request: nil,
|
63
63
|
response: nil,
|
64
|
-
message: String?
|
64
|
+
?message: String?
|
65
65
|
) -> void
|
66
66
|
end
|
67
67
|
|
@@ -38,21 +38,17 @@ module TerminalShop
|
|
38
38
|
|
39
39
|
def street2=: (String) -> String
|
40
40
|
|
41
|
-
def initialize:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
) -> void
|
53
|
-
| (
|
54
|
-
?TerminalShop::Models::address_api | TerminalShop::BaseModel data
|
55
|
-
) -> void
|
41
|
+
def initialize: (
|
42
|
+
id: String,
|
43
|
+
city: String,
|
44
|
+
country: String,
|
45
|
+
name: String,
|
46
|
+
street1: String,
|
47
|
+
zip: String,
|
48
|
+
?phone: String,
|
49
|
+
?province: String,
|
50
|
+
?street2: String
|
51
|
+
) -> void
|
56
52
|
|
57
53
|
def to_hash: -> TerminalShop::Models::address_api
|
58
54
|
end
|
@@ -39,22 +39,17 @@ module TerminalShop
|
|
39
39
|
|
40
40
|
def street2=: (String) -> String
|
41
41
|
|
42
|
-
def initialize:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
) -> void
|
54
|
-
| (
|
55
|
-
?TerminalShop::Models::address_create_params
|
56
|
-
| TerminalShop::BaseModel data
|
57
|
-
) -> void
|
42
|
+
def initialize: (
|
43
|
+
city: String,
|
44
|
+
country: String,
|
45
|
+
name: String,
|
46
|
+
street1: String,
|
47
|
+
zip: String,
|
48
|
+
?phone: String,
|
49
|
+
?province: String,
|
50
|
+
?street2: String,
|
51
|
+
?request_options: TerminalShop::request_opts
|
52
|
+
) -> void
|
58
53
|
|
59
54
|
def to_hash: -> TerminalShop::Models::address_create_params
|
60
55
|
end
|
@@ -5,12 +5,7 @@ module TerminalShop
|
|
5
5
|
class AddressCreateResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: String
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: String) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::address_create_response
|
12
|
-
| TerminalShop::BaseModel data
|
13
|
-
) -> void
|
8
|
+
def initialize: (data: String) -> void
|
14
9
|
|
15
10
|
def to_hash: -> TerminalShop::Models::address_create_response
|
16
11
|
end
|
@@ -6,12 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::address_delete_params
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
15
10
|
|
16
11
|
def to_hash: -> TerminalShop::Models::address_delete_params
|
17
12
|
end
|
@@ -5,12 +5,7 @@ module TerminalShop
|
|
5
5
|
class AddressDeleteResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: :ok
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: :ok) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::address_delete_response
|
12
|
-
| TerminalShop::BaseModel data
|
13
|
-
) -> void
|
8
|
+
def initialize: (?data: :ok) -> void
|
14
9
|
|
15
10
|
def to_hash: -> TerminalShop::Models::address_delete_response
|
16
11
|
end
|
@@ -6,12 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::address_get_params
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
15
10
|
|
16
11
|
def to_hash: -> TerminalShop::Models::address_get_params
|
17
12
|
end
|
@@ -5,12 +5,7 @@ module TerminalShop
|
|
5
5
|
class AddressGetResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: TerminalShop::Models::AddressAPI
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: TerminalShop::Models::AddressAPI) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::address_get_response
|
12
|
-
| TerminalShop::BaseModel data
|
13
|
-
) -> void
|
8
|
+
def initialize: (data: TerminalShop::Models::AddressAPI) -> void
|
14
9
|
|
15
10
|
def to_hash: -> TerminalShop::Models::address_get_response
|
16
11
|
end
|
@@ -6,12 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::address_list_params
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
15
10
|
|
16
11
|
def to_hash: -> TerminalShop::Models::address_list_params
|
17
12
|
end
|
@@ -6,12 +6,7 @@ module TerminalShop
|
|
6
6
|
class AddressListResponse < TerminalShop::BaseModel
|
7
7
|
attr_accessor data: ::Array[TerminalShop::Models::AddressAPI]
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(data: ::Array[TerminalShop::Models::AddressAPI]) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::address_list_response
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (data: ::Array[TerminalShop::Models::AddressAPI]) -> void
|
15
10
|
|
16
11
|
def to_hash: -> TerminalShop::Models::address_list_response
|
17
12
|
end
|
@@ -12,11 +12,12 @@ module TerminalShop
|
|
12
12
|
|
13
13
|
attr_accessor secret: String
|
14
14
|
|
15
|
-
def initialize:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
def initialize: (
|
16
|
+
id: String,
|
17
|
+
name: String,
|
18
|
+
redirect_uri: String,
|
19
|
+
secret: String
|
20
|
+
) -> void
|
20
21
|
|
21
22
|
def to_hash: -> TerminalShop::Models::app_api
|
22
23
|
end
|
@@ -11,16 +11,11 @@ module TerminalShop
|
|
11
11
|
|
12
12
|
attr_accessor redirect_uri: String
|
13
13
|
|
14
|
-
def initialize:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
) -> void
|
20
|
-
| (
|
21
|
-
?TerminalShop::Models::app_create_params
|
22
|
-
| TerminalShop::BaseModel data
|
23
|
-
) -> void
|
14
|
+
def initialize: (
|
15
|
+
name: String,
|
16
|
+
redirect_uri: String,
|
17
|
+
?request_options: TerminalShop::request_opts
|
18
|
+
) -> void
|
24
19
|
|
25
20
|
def to_hash: -> TerminalShop::Models::app_create_params
|
26
21
|
end
|
@@ -6,12 +6,9 @@ module TerminalShop
|
|
6
6
|
class AppCreateResponse < TerminalShop::BaseModel
|
7
7
|
attr_accessor data: TerminalShop::Models::AppCreateResponse::Data
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
|
11
|
-
|
12
|
-
?TerminalShop::Models::app_create_response
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (
|
10
|
+
data: TerminalShop::Models::AppCreateResponse::Data
|
11
|
+
) -> void
|
15
12
|
|
16
13
|
def to_hash: -> TerminalShop::Models::app_create_response
|
17
14
|
|
@@ -22,12 +19,7 @@ module TerminalShop
|
|
22
19
|
|
23
20
|
attr_accessor secret: String
|
24
21
|
|
25
|
-
def initialize:
|
26
|
-
(id: String, secret: String) -> void
|
27
|
-
| (
|
28
|
-
?TerminalShop::Models::AppCreateResponse::data
|
29
|
-
| TerminalShop::BaseModel data
|
30
|
-
) -> void
|
22
|
+
def initialize: (id: String, secret: String) -> void
|
31
23
|
|
32
24
|
def to_hash: -> TerminalShop::Models::AppCreateResponse::data
|
33
25
|
end
|
@@ -6,12 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::app_delete_params
|
13
|
-
| TerminalShop::BaseModel data
|
14
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
15
10
|
|
16
11
|
def to_hash: -> TerminalShop::Models::app_delete_params
|
17
12
|
end
|
@@ -5,12 +5,7 @@ module TerminalShop
|
|
5
5
|
class AppDeleteResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: :ok
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: :ok) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::app_delete_response
|
12
|
-
| TerminalShop::BaseModel data
|
13
|
-
) -> void
|
8
|
+
def initialize: (?data: :ok) -> void
|
14
9
|
|
15
10
|
def to_hash: -> TerminalShop::Models::app_delete_response
|
16
11
|
end
|
@@ -6,11 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::app_get_params | TerminalShop::BaseModel data
|
13
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
14
10
|
|
15
11
|
def to_hash: -> TerminalShop::Models::app_get_params
|
16
12
|
end
|
@@ -5,11 +5,7 @@ module TerminalShop
|
|
5
5
|
class AppGetResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: TerminalShop::Models::AppAPI
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: TerminalShop::Models::AppAPI) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::app_get_response | TerminalShop::BaseModel data
|
12
|
-
) -> void
|
8
|
+
def initialize: (data: TerminalShop::Models::AppAPI) -> void
|
13
9
|
|
14
10
|
def to_hash: -> TerminalShop::Models::app_get_response
|
15
11
|
end
|
@@ -6,11 +6,7 @@ module TerminalShop
|
|
6
6
|
extend TerminalShop::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
|
-
def initialize:
|
10
|
-
(request_options: TerminalShop::request_opts) -> void
|
11
|
-
| (
|
12
|
-
?TerminalShop::Models::app_list_params | TerminalShop::BaseModel data
|
13
|
-
) -> void
|
9
|
+
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
14
10
|
|
15
11
|
def to_hash: -> TerminalShop::Models::app_list_params
|
16
12
|
end
|
@@ -5,12 +5,7 @@ module TerminalShop
|
|
5
5
|
class AppListResponse < TerminalShop::BaseModel
|
6
6
|
attr_accessor data: ::Array[TerminalShop::Models::AppAPI]
|
7
7
|
|
8
|
-
def initialize:
|
9
|
-
(data: ::Array[TerminalShop::Models::AppAPI]) -> void
|
10
|
-
| (
|
11
|
-
?TerminalShop::Models::app_list_response
|
12
|
-
| TerminalShop::BaseModel data
|
13
|
-
) -> void
|
8
|
+
def initialize: (data: ::Array[TerminalShop::Models::AppAPI]) -> void
|
14
9
|
|
15
10
|
def to_hash: -> TerminalShop::Models::app_list_response
|
16
11
|
end
|