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
@@ -10,8 +10,18 @@ module TerminalShop
|
|
10
10
|
def list(request_options: {})
|
11
11
|
end
|
12
12
|
|
13
|
-
sig
|
14
|
-
|
13
|
+
sig do
|
14
|
+
params(
|
15
|
+
id: String,
|
16
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
|
17
|
+
)
|
18
|
+
.returns(TerminalShop::Models::ProductGetResponse)
|
19
|
+
end
|
20
|
+
def get(id, request_options: {})
|
21
|
+
end
|
22
|
+
|
23
|
+
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
24
|
+
def self.new(client:)
|
15
25
|
end
|
16
26
|
end
|
17
27
|
end
|
@@ -5,13 +5,13 @@ module TerminalShop
|
|
5
5
|
class Profile
|
6
6
|
sig do
|
7
7
|
params(
|
8
|
-
email:
|
9
|
-
name:
|
8
|
+
email: String,
|
9
|
+
name: String,
|
10
10
|
request_options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
|
11
11
|
)
|
12
12
|
.returns(TerminalShop::Models::ProfileUpdateResponse)
|
13
13
|
end
|
14
|
-
def update(email
|
14
|
+
def update(email:, name:, request_options: {})
|
15
15
|
end
|
16
16
|
|
17
17
|
sig do
|
@@ -21,8 +21,8 @@ module TerminalShop
|
|
21
21
|
def me(request_options: {})
|
22
22
|
end
|
23
23
|
|
24
|
-
sig { params(client: TerminalShop::Client).
|
25
|
-
def
|
24
|
+
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
25
|
+
def self.new(client:)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -48,8 +48,18 @@ module TerminalShop
|
|
48
48
|
def delete(id, request_options: {})
|
49
49
|
end
|
50
50
|
|
51
|
-
sig
|
52
|
-
|
51
|
+
sig do
|
52
|
+
params(
|
53
|
+
id: String,
|
54
|
+
request_options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
|
55
|
+
)
|
56
|
+
.returns(TerminalShop::Models::SubscriptionGetResponse)
|
57
|
+
end
|
58
|
+
def get(id, request_options: {})
|
59
|
+
end
|
60
|
+
|
61
|
+
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
62
|
+
def self.new(client:)
|
53
63
|
end
|
54
64
|
end
|
55
65
|
end
|
@@ -37,8 +37,8 @@ module TerminalShop
|
|
37
37
|
def get(id, request_options: {})
|
38
38
|
end
|
39
39
|
|
40
|
-
sig { params(client: TerminalShop::Client).
|
41
|
-
def
|
40
|
+
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
41
|
+
def self.new(client:)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -10,8 +10,8 @@ module TerminalShop
|
|
10
10
|
def init(request_options: {})
|
11
11
|
end
|
12
12
|
|
13
|
-
sig { params(client: TerminalShop::Client).
|
14
|
-
def
|
13
|
+
sig { params(client: TerminalShop::Client).returns(T.attached_class) }
|
14
|
+
def self.new(client:)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -6,80 +6,90 @@ module TerminalShop
|
|
6
6
|
def self.monotonic_secs
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
class << self
|
10
|
+
sig { returns(String) }
|
11
|
+
def arch
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
sig { returns(String) }
|
15
|
+
def os
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
class << self
|
20
|
+
sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) }
|
21
|
+
def primitive?(input)
|
22
|
+
end
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) }
|
25
|
+
def coerce_boolean(input)
|
26
|
+
end
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
sig { params(input: T.anything).returns(T.nilable(T::Boolean)) }
|
29
|
+
def coerce_boolean!(input)
|
30
|
+
end
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
+
sig { params(input: T.anything).returns(T.any(Integer, T.anything)) }
|
33
|
+
def coerce_integer(input)
|
34
|
+
end
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
+
sig { params(input: T.anything).returns(T.any(Float, T.anything)) }
|
37
|
+
def coerce_float(input)
|
38
|
+
end
|
36
39
|
|
37
|
-
|
38
|
-
|
40
|
+
sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) }
|
41
|
+
def coerce_hash(input)
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
OMIT = T.let(T.anything, T.anything)
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
.
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
|
79
|
-
params(query: T.nilable(T::Hash[String, T
|
80
|
-
|
81
|
-
|
82
|
-
|
47
|
+
class << self
|
48
|
+
sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) }
|
49
|
+
private def deep_merge_lr(lhs, rhs, concat: false)
|
50
|
+
end
|
51
|
+
|
52
|
+
sig do
|
53
|
+
params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean)
|
54
|
+
.returns(T.anything)
|
55
|
+
end
|
56
|
+
def deep_merge(*values, sentinel: nil, concat: false)
|
57
|
+
end
|
58
|
+
|
59
|
+
sig do
|
60
|
+
params(
|
61
|
+
data: T.any(T::Hash[Symbol, T.anything], T::Array[T.anything], T.anything),
|
62
|
+
pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])),
|
63
|
+
sentinel: T.nilable(T.anything),
|
64
|
+
blk: T.nilable(T.proc.returns(T.anything))
|
65
|
+
)
|
66
|
+
.returns(T.nilable(T.anything))
|
67
|
+
end
|
68
|
+
def dig(data, pick, sentinel = nil, &blk)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
class << self
|
73
|
+
sig { params(uri: URI::Generic).returns(String) }
|
74
|
+
def uri_origin(uri)
|
75
|
+
end
|
76
|
+
|
77
|
+
sig { params(path: T.any(String, T::Array[String])).returns(String) }
|
78
|
+
def interpolate_path(path)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
class << self
|
83
|
+
sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) }
|
84
|
+
def decode_query(query)
|
85
|
+
end
|
86
|
+
|
87
|
+
sig do
|
88
|
+
params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]))
|
89
|
+
.returns(T.nilable(String))
|
90
|
+
end
|
91
|
+
def encode_query(query)
|
92
|
+
end
|
83
93
|
end
|
84
94
|
|
85
95
|
ParsedUriShape = T.type_alias do
|
@@ -92,48 +102,87 @@ module TerminalShop
|
|
92
102
|
}
|
93
103
|
end
|
94
104
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
params(
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
105
|
+
class << self
|
106
|
+
sig { params(url: T.any(URI::Generic, String)).returns(TerminalShop::Util::ParsedUriShape) }
|
107
|
+
def parse_uri(url)
|
108
|
+
end
|
109
|
+
|
110
|
+
sig { params(parsed: TerminalShop::Util::ParsedUriShape).returns(URI::Generic) }
|
111
|
+
def unparse_uri(parsed)
|
112
|
+
end
|
113
|
+
|
114
|
+
sig do
|
115
|
+
params(lhs: TerminalShop::Util::ParsedUriShape, rhs: TerminalShop::Util::ParsedUriShape)
|
116
|
+
.returns(URI::Generic)
|
117
|
+
end
|
118
|
+
def join_parsed_uri(lhs, rhs)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
class << self
|
123
|
+
sig do
|
124
|
+
params(
|
125
|
+
headers: T::Hash[String,
|
126
|
+
T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))]
|
127
|
+
)
|
128
|
+
.returns(T::Hash[String, String])
|
129
|
+
end
|
130
|
+
def normalized_headers(*headers)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
class << self
|
135
|
+
sig { params(io: StringIO, boundary: String, key: T.any(Symbol, String), val: T.anything).void }
|
136
|
+
private def encode_multipart_formdata(io, boundary:, key:, val:)
|
137
|
+
end
|
138
|
+
|
139
|
+
sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) }
|
140
|
+
def encode_content(headers, body)
|
141
|
+
end
|
142
|
+
|
143
|
+
sig do
|
144
|
+
params(
|
145
|
+
headers: T.any(T::Hash[String, String], Net::HTTPHeader),
|
146
|
+
stream: T::Enumerable[String],
|
147
|
+
suppress_error: T::Boolean
|
148
|
+
)
|
149
|
+
.returns(T.anything)
|
150
|
+
end
|
151
|
+
def decode_content(headers, stream:, suppress_error: false)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
class << self
|
156
|
+
sig { params(enum: T::Enumerable[T.anything], close: T.proc.void).returns(T::Enumerable[T.anything]) }
|
157
|
+
def fused_enum(enum, &close)
|
158
|
+
end
|
159
|
+
|
160
|
+
sig { params(enum: T.nilable(T::Enumerable[T.anything])).void }
|
161
|
+
def close_fused!(enum)
|
162
|
+
end
|
163
|
+
|
164
|
+
sig do
|
165
|
+
params(
|
166
|
+
enum: T.nilable(T::Enumerable[T.anything]),
|
167
|
+
blk: T.proc.params(arg0: Enumerator::Yielder).void
|
168
|
+
).void
|
169
|
+
end
|
170
|
+
def chain_fused(enum, &blk)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
SSEMessage = T.type_alias do
|
175
|
+
{event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)}
|
176
|
+
end
|
177
|
+
|
178
|
+
class << self
|
179
|
+
sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) }
|
180
|
+
def decode_lines(enum)
|
181
|
+
end
|
182
|
+
|
183
|
+
sig { params(lines: T::Enumerable[String]).returns(TerminalShop::Util::SSEMessage) }
|
184
|
+
def decode_sse(lines)
|
185
|
+
end
|
137
186
|
end
|
138
187
|
end
|
139
188
|
end
|
@@ -11,6 +11,7 @@ module TerminalShop
|
|
11
11
|
body: top?,
|
12
12
|
unwrap: Symbol?,
|
13
13
|
page: Class?,
|
14
|
+
stream: Class?,
|
14
15
|
model: TerminalShop::Converter::input?,
|
15
16
|
options: TerminalShop::request_opts?
|
16
17
|
}
|
@@ -78,13 +79,7 @@ module TerminalShop
|
|
78
79
|
redirect_count: Integer,
|
79
80
|
retry_count: Integer,
|
80
81
|
send_retry_header: bool
|
81
|
-
) -> [top, Enumerable[String]]
|
82
|
-
|
83
|
-
private def parse_response: (
|
84
|
-
TerminalShop::BaseClient::request_components req,
|
85
|
-
headers: ::Hash[String, String],
|
86
|
-
stream: Enumerable[String]
|
87
|
-
) -> top
|
82
|
+
) -> [Integer, top, Enumerable[String]]
|
88
83
|
|
89
84
|
def request:
|
90
85
|
(
|
@@ -97,6 +92,7 @@ module TerminalShop
|
|
97
92
|
body: top?,
|
98
93
|
unwrap: Symbol?,
|
99
94
|
page: Class?,
|
95
|
+
stream: Class?,
|
100
96
|
model: TerminalShop::Converter::input?,
|
101
97
|
options: TerminalShop::request_opts?
|
102
98
|
) -> top
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Models
|
3
|
+
type address_get_params = { } & TerminalShop::request_parameters
|
4
|
+
|
5
|
+
class AddressGetParams < TerminalShop::BaseModel
|
6
|
+
extend TerminalShop::RequestParameters::Converter
|
7
|
+
include TerminalShop::RequestParameters
|
8
|
+
|
9
|
+
def initialize:
|
10
|
+
(request_options: TerminalShop::request_opts) -> void
|
11
|
+
| (
|
12
|
+
?TerminalShop::Models::address_get_params
|
13
|
+
| TerminalShop::BaseModel data
|
14
|
+
) -> void
|
15
|
+
|
16
|
+
def to_hash: -> TerminalShop::Models::address_get_params
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Models
|
3
|
+
type address_get_response = { data: TerminalShop::Models::AddressAPI }
|
4
|
+
|
5
|
+
class AddressGetResponse < TerminalShop::BaseModel
|
6
|
+
attr_accessor data: TerminalShop::Models::AddressAPI
|
7
|
+
|
8
|
+
def initialize:
|
9
|
+
(data: TerminalShop::Models::AddressAPI) -> void
|
10
|
+
| (
|
11
|
+
?TerminalShop::Models::address_get_response
|
12
|
+
| TerminalShop::BaseModel data
|
13
|
+
) -> void
|
14
|
+
|
15
|
+
def to_hash: -> TerminalShop::Models::address_get_response
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,13 +1,22 @@
|
|
1
1
|
module TerminalShop
|
2
2
|
module Models
|
3
|
-
type app_create_params =
|
3
|
+
type app_create_params =
|
4
|
+
{ name: String, redirect_uri: String } & TerminalShop::request_parameters
|
4
5
|
|
5
|
-
class AppCreateParams < TerminalShop::
|
6
|
+
class AppCreateParams < TerminalShop::BaseModel
|
6
7
|
extend TerminalShop::RequestParameters::Converter
|
7
8
|
include TerminalShop::RequestParameters
|
8
9
|
|
10
|
+
attr_accessor name: String
|
11
|
+
|
12
|
+
attr_accessor redirect_uri: String
|
13
|
+
|
9
14
|
def initialize:
|
10
|
-
(
|
15
|
+
(
|
16
|
+
name: String,
|
17
|
+
redirect_uri: String,
|
18
|
+
request_options: TerminalShop::request_opts
|
19
|
+
) -> void
|
11
20
|
| (
|
12
21
|
?TerminalShop::Models::app_create_params
|
13
22
|
| TerminalShop::BaseModel data
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Models
|
3
|
+
type card_get_params = { } & TerminalShop::request_parameters
|
4
|
+
|
5
|
+
class CardGetParams < TerminalShop::BaseModel
|
6
|
+
extend TerminalShop::RequestParameters::Converter
|
7
|
+
include TerminalShop::RequestParameters
|
8
|
+
|
9
|
+
def initialize:
|
10
|
+
(request_options: TerminalShop::request_opts) -> void
|
11
|
+
| (
|
12
|
+
?TerminalShop::Models::card_get_params | TerminalShop::BaseModel data
|
13
|
+
) -> void
|
14
|
+
|
15
|
+
def to_hash: -> TerminalShop::Models::card_get_params
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Models
|
3
|
+
type card_get_response = { data: TerminalShop::Models::CardAPI }
|
4
|
+
|
5
|
+
class CardGetResponse < TerminalShop::BaseModel
|
6
|
+
attr_accessor data: TerminalShop::Models::CardAPI
|
7
|
+
|
8
|
+
def initialize:
|
9
|
+
(data: TerminalShop::Models::CardAPI) -> void
|
10
|
+
| (
|
11
|
+
?TerminalShop::Models::card_get_response
|
12
|
+
| TerminalShop::BaseModel data
|
13
|
+
) -> void
|
14
|
+
|
15
|
+
def to_hash: -> TerminalShop::Models::card_get_response
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -7,6 +7,7 @@ module TerminalShop
|
|
7
7
|
subtotal: Integer,
|
8
8
|
address_id: String,
|
9
9
|
card_id: String,
|
10
|
+
gift_card_id: String,
|
10
11
|
shipping: TerminalShop::Models::CartAPI::Shipping
|
11
12
|
}
|
12
13
|
|
@@ -25,6 +26,10 @@ module TerminalShop
|
|
25
26
|
|
26
27
|
def card_id=: (String) -> String
|
27
28
|
|
29
|
+
attr_reader gift_card_id: String?
|
30
|
+
|
31
|
+
def gift_card_id=: (String) -> String
|
32
|
+
|
28
33
|
attr_reader shipping: TerminalShop::Models::CartAPI::Shipping?
|
29
34
|
|
30
35
|
def shipping=: (
|
@@ -38,6 +43,7 @@ module TerminalShop
|
|
38
43
|
subtotal: Integer,
|
39
44
|
address_id: String,
|
40
45
|
card_id: String,
|
46
|
+
gift_card_id: String,
|
41
47
|
shipping: TerminalShop::Models::CartAPI::Shipping
|
42
48
|
) -> void
|
43
49
|
| (
|
@@ -46,17 +52,36 @@ module TerminalShop
|
|
46
52
|
|
47
53
|
def to_hash: -> TerminalShop::Models::cart_api
|
48
54
|
|
49
|
-
type amount =
|
55
|
+
type amount =
|
56
|
+
{
|
57
|
+
subtotal: Integer,
|
58
|
+
gift_card: Integer,
|
59
|
+
shipping: Integer,
|
60
|
+
total: Integer
|
61
|
+
}
|
50
62
|
|
51
63
|
class Amount < TerminalShop::BaseModel
|
52
64
|
attr_accessor subtotal: Integer
|
53
65
|
|
66
|
+
attr_reader gift_card: Integer?
|
67
|
+
|
68
|
+
def gift_card=: (Integer) -> Integer
|
69
|
+
|
54
70
|
attr_reader shipping: Integer?
|
55
71
|
|
56
72
|
def shipping=: (Integer) -> Integer
|
57
73
|
|
74
|
+
attr_reader total: Integer?
|
75
|
+
|
76
|
+
def total=: (Integer) -> Integer
|
77
|
+
|
58
78
|
def initialize:
|
59
|
-
(
|
79
|
+
(
|
80
|
+
subtotal: Integer,
|
81
|
+
gift_card: Integer,
|
82
|
+
shipping: Integer,
|
83
|
+
total: Integer
|
84
|
+
) -> void
|
60
85
|
| (
|
61
86
|
?TerminalShop::Models::CartAPI::amount
|
62
87
|
| TerminalShop::BaseModel data
|
@@ -1,13 +1,21 @@
|
|
1
1
|
module TerminalShop
|
2
2
|
module Models
|
3
|
-
type cart_convert_params =
|
3
|
+
type cart_convert_params =
|
4
|
+
{ recipient_email: String } & TerminalShop::request_parameters
|
4
5
|
|
5
6
|
class CartConvertParams < TerminalShop::BaseModel
|
6
7
|
extend TerminalShop::RequestParameters::Converter
|
7
8
|
include TerminalShop::RequestParameters
|
8
9
|
|
10
|
+
attr_reader recipient_email: String?
|
11
|
+
|
12
|
+
def recipient_email=: (String) -> String
|
13
|
+
|
9
14
|
def initialize:
|
10
|
-
(
|
15
|
+
(
|
16
|
+
recipient_email: String,
|
17
|
+
request_options: TerminalShop::request_opts
|
18
|
+
) -> void
|
11
19
|
| (
|
12
20
|
?TerminalShop::Models::cart_convert_params
|
13
21
|
| TerminalShop::BaseModel data
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Models
|
3
|
+
type cart_redeem_gift_card_params =
|
4
|
+
{ gift_card_id: String } & TerminalShop::request_parameters
|
5
|
+
|
6
|
+
class CartRedeemGiftCardParams < TerminalShop::BaseModel
|
7
|
+
extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
attr_accessor gift_card_id: String
|
11
|
+
|
12
|
+
def initialize:
|
13
|
+
(
|
14
|
+
gift_card_id: String,
|
15
|
+
request_options: TerminalShop::request_opts
|
16
|
+
) -> void
|
17
|
+
| (
|
18
|
+
?TerminalShop::Models::cart_redeem_gift_card_params
|
19
|
+
| TerminalShop::BaseModel data
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> TerminalShop::Models::cart_redeem_gift_card_params
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|