terminal-shop 2.0.0 → 2.1.1
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 +2 -8
- data/lib/terminal-shop/client.rb +4 -4
- data/lib/terminal-shop/models/address_create_params.rb +1 -1
- data/lib/terminal-shop/models/address_delete_params.rb +1 -1
- data/lib/terminal-shop/models/address_get_params.rb +1 -1
- data/lib/terminal-shop/models/address_list_params.rb +1 -1
- data/lib/terminal-shop/models/app_create_params.rb +1 -1
- data/lib/terminal-shop/models/app_delete_params.rb +1 -1
- data/lib/terminal-shop/models/app_get_params.rb +1 -1
- data/lib/terminal-shop/models/app_list_params.rb +1 -1
- data/lib/terminal-shop/models/card_collect_params.rb +1 -1
- data/lib/terminal-shop/models/card_create_params.rb +1 -1
- data/lib/terminal-shop/models/card_delete_params.rb +1 -1
- data/lib/terminal-shop/models/card_get_params.rb +1 -1
- data/lib/terminal-shop/models/card_list_params.rb +1 -1
- data/lib/terminal-shop/models/cart_clear_params.rb +1 -1
- data/lib/terminal-shop/models/cart_convert_params.rb +1 -1
- data/lib/terminal-shop/models/cart_get_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_address_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_card_params.rb +1 -1
- data/lib/terminal-shop/models/cart_set_item_params.rb +1 -1
- data/lib/terminal-shop/models/email_create_params.rb +1 -1
- data/lib/terminal-shop/models/order_create_params.rb +1 -1
- data/lib/terminal-shop/models/order_get_params.rb +1 -1
- data/lib/terminal-shop/models/order_list_params.rb +1 -1
- data/lib/terminal-shop/models/product_get_params.rb +1 -1
- data/lib/terminal-shop/models/product_list_params.rb +1 -1
- data/lib/terminal-shop/models/profile_me_params.rb +1 -1
- data/lib/terminal-shop/models/profile_update_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_create_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_delete_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_get_params.rb +1 -1
- data/lib/terminal-shop/models/subscription_list_params.rb +1 -1
- data/lib/terminal-shop/models/token_create_params.rb +1 -1
- data/lib/terminal-shop/models/token_delete_params.rb +1 -1
- data/lib/terminal-shop/models/token_get_params.rb +1 -1
- data/lib/terminal-shop/models/token_list_params.rb +1 -1
- data/lib/terminal-shop/models/view_init_params.rb +1 -1
- data/lib/terminal-shop/request_options.rb +0 -33
- data/lib/terminal-shop/transport/base_client.rb +459 -0
- data/lib/terminal-shop/transport/pooled_net_requester.rb +182 -0
- data/lib/terminal-shop/type/array_of.rb +112 -0
- data/lib/terminal-shop/type/base_model.rb +364 -0
- data/lib/terminal-shop/type/base_page.rb +61 -0
- data/lib/terminal-shop/type/boolean_model.rb +52 -0
- data/lib/terminal-shop/type/converter.rb +217 -0
- data/lib/terminal-shop/type/enum.rb +101 -0
- data/lib/terminal-shop/type/hash_of.rb +138 -0
- data/lib/terminal-shop/type/request_parameters.rb +38 -0
- data/lib/terminal-shop/type/union.rb +185 -0
- data/lib/terminal-shop/type/unknown.rb +56 -0
- data/lib/terminal-shop/type.rb +23 -0
- data/lib/terminal-shop/util.rb +3 -5
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +29 -20
- data/manifest.yaml +1 -0
- data/rbi/lib/terminal-shop/client.rbi +4 -4
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +12 -2
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_clear_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +1 -1
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +12 -1
- data/rbi/lib/terminal-shop/request_options.rbi +0 -15
- data/rbi/lib/terminal-shop/transport/base_client.rbi +208 -0
- data/rbi/lib/terminal-shop/transport/pooled_net_requester.rbi +64 -0
- data/rbi/lib/terminal-shop/type/array_of.rbi +82 -0
- data/rbi/lib/terminal-shop/type/base_model.rbi +194 -0
- data/rbi/lib/terminal-shop/type/base_page.rbi +38 -0
- data/rbi/lib/terminal-shop/type/boolean_model.rbi +41 -0
- data/rbi/lib/terminal-shop/type/converter.rbi +101 -0
- data/rbi/lib/terminal-shop/type/enum.rbi +58 -0
- data/rbi/lib/terminal-shop/type/hash_of.rbi +85 -0
- data/rbi/lib/terminal-shop/type/request_parameters.rbi +20 -0
- data/rbi/lib/terminal-shop/type/union.rbi +68 -0
- data/rbi/lib/terminal-shop/type/unknown.rbi +37 -0
- data/rbi/lib/terminal-shop/type.rbi +23 -0
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/client.rbs +3 -3
- data/sig/terminal-shop/models/address_create_params.rbs +1 -1
- data/sig/terminal-shop/models/address_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/address_get_params.rbs +1 -1
- data/sig/terminal-shop/models/address_list_params.rbs +1 -1
- data/sig/terminal-shop/models/app_create_params.rbs +1 -1
- data/sig/terminal-shop/models/app_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/app_get_params.rbs +1 -1
- data/sig/terminal-shop/models/app_list_params.rbs +1 -1
- data/sig/terminal-shop/models/card_collect_params.rbs +1 -1
- data/sig/terminal-shop/models/card_create_params.rbs +1 -1
- data/sig/terminal-shop/models/card_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/card_get_params.rbs +1 -1
- data/sig/terminal-shop/models/card_list_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_clear_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_convert_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_get_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_address_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_card_params.rbs +1 -1
- data/sig/terminal-shop/models/cart_set_item_params.rbs +1 -1
- data/sig/terminal-shop/models/email_create_params.rbs +1 -1
- data/sig/terminal-shop/models/order_create_params.rbs +1 -1
- data/sig/terminal-shop/models/order_get_params.rbs +1 -1
- data/sig/terminal-shop/models/order_list_params.rbs +1 -1
- data/sig/terminal-shop/models/product_get_params.rbs +1 -1
- data/sig/terminal-shop/models/product_list_params.rbs +1 -1
- data/sig/terminal-shop/models/profile_me_params.rbs +1 -1
- data/sig/terminal-shop/models/profile_update_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_create_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_get_params.rbs +1 -1
- data/sig/terminal-shop/models/subscription_list_params.rbs +1 -1
- data/sig/terminal-shop/models/token_create_params.rbs +1 -1
- data/sig/terminal-shop/models/token_delete_params.rbs +1 -1
- data/sig/terminal-shop/models/token_get_params.rbs +1 -1
- data/sig/terminal-shop/models/token_list_params.rbs +1 -1
- data/sig/terminal-shop/models/view_init_params.rbs +1 -1
- data/sig/terminal-shop/request_options.rbs +0 -10
- data/sig/terminal-shop/transport/base_client.rbs +110 -0
- data/sig/terminal-shop/transport/pooled_net_requester.rbs +39 -0
- data/sig/terminal-shop/type/array_of.rbs +36 -0
- data/sig/terminal-shop/type/base_model.rbs +73 -0
- data/sig/terminal-shop/type/base_page.rbs +22 -0
- data/sig/terminal-shop/type/boolean_model.rbs +18 -0
- data/sig/terminal-shop/type/converter.rbs +42 -0
- data/sig/terminal-shop/type/enum.rbs +22 -0
- data/sig/terminal-shop/type/hash_of.rbs +36 -0
- data/sig/terminal-shop/type/request_parameters.rbs +13 -0
- data/sig/terminal-shop/type/union.rbs +40 -0
- data/sig/terminal-shop/type/unknown.rbs +18 -0
- data/sig/terminal-shop/type.rbs +22 -0
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +41 -17
- data/lib/terminal-shop/base_client.rb +0 -457
- data/lib/terminal-shop/base_model.rb +0 -1201
- data/lib/terminal-shop/base_page.rb +0 -59
- data/lib/terminal-shop/extern.rb +0 -7
- data/lib/terminal-shop/pooled_net_requester.rb +0 -180
- data/rbi/lib/terminal-shop/base_client.rbi +0 -197
- data/rbi/lib/terminal-shop/base_model.rbi +0 -645
- data/rbi/lib/terminal-shop/base_page.rbi +0 -36
- data/rbi/lib/terminal-shop/extern.rbi +0 -7
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +0 -59
- data/sig/terminal-shop/base_client.rbs +0 -108
- data/sig/terminal-shop/base_model.rbs +0 -262
- data/sig/terminal-shop/base_page.rbs +0 -20
- data/sig/terminal-shop/extern.rbs +0 -4
- data/sig/terminal-shop/pooled_net_requester.rbs +0 -37
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type product_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class ProductListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type profile_me_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class ProfileMeParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -4,7 +4,7 @@ module TerminalShop
|
|
4
4
|
{ email: String, name: String } & TerminalShop::request_parameters
|
5
5
|
|
6
6
|
class ProfileUpdateParams < TerminalShop::BaseModel
|
7
|
-
extend TerminalShop::RequestParameters::Converter
|
7
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
attr_accessor email: String
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type subscription_create_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class SubscriptionCreateParams < TerminalShop::Models::SubscriptionAPI
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type subscription_delete_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class SubscriptionDeleteParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type subscription_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class SubscriptionGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type subscription_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class SubscriptionListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type token_create_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class TokenCreateParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type token_delete_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class TokenDeleteParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type token_get_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class TokenGetParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type token_list_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class TokenListParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -3,7 +3,7 @@ module TerminalShop
|
|
3
3
|
type view_init_params = { } & TerminalShop::request_parameters
|
4
4
|
|
5
5
|
class ViewInitParams < TerminalShop::BaseModel
|
6
|
-
extend TerminalShop::RequestParameters::Converter
|
6
|
+
extend TerminalShop::Type::RequestParameters::Converter
|
7
7
|
include TerminalShop::RequestParameters
|
8
8
|
|
9
9
|
def initialize: (?request_options: TerminalShop::request_opts) -> void
|
@@ -4,16 +4,6 @@ module TerminalShop
|
|
4
4
|
| TerminalShop::request_options
|
5
5
|
| ::Hash[Symbol, top]
|
6
6
|
|
7
|
-
type request_parameters = { request_options: TerminalShop::request_opts }
|
8
|
-
|
9
|
-
module RequestParameters
|
10
|
-
attr_accessor request_options: TerminalShop::request_opts
|
11
|
-
|
12
|
-
module Converter
|
13
|
-
def dump_request: (top params) -> [top, ::Hash[Symbol, top]]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
7
|
type request_options =
|
18
8
|
{
|
19
9
|
idempotency_key: String?,
|
@@ -0,0 +1,110 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Transport
|
3
|
+
class BaseClient
|
4
|
+
type request_components =
|
5
|
+
{
|
6
|
+
method: Symbol,
|
7
|
+
path: String | ::Array[String],
|
8
|
+
query: ::Hash[String, (::Array[String] | String)?]?,
|
9
|
+
headers: ::Hash[String, (String
|
10
|
+
| Integer
|
11
|
+
| ::Array[(String | Integer)?])?]?,
|
12
|
+
body: top?,
|
13
|
+
unwrap: Symbol?,
|
14
|
+
page: Class?,
|
15
|
+
stream: Class?,
|
16
|
+
model: TerminalShop::Type::Converter::input?,
|
17
|
+
options: TerminalShop::request_opts?
|
18
|
+
}
|
19
|
+
|
20
|
+
type request_input =
|
21
|
+
{
|
22
|
+
method: Symbol,
|
23
|
+
url: URI::Generic,
|
24
|
+
headers: ::Hash[String, String],
|
25
|
+
body: top,
|
26
|
+
max_retries: Integer,
|
27
|
+
timeout: Float
|
28
|
+
}
|
29
|
+
|
30
|
+
MAX_REDIRECTS: 20
|
31
|
+
|
32
|
+
PLATFORM_HEADERS: ::Hash[String, String]
|
33
|
+
|
34
|
+
def self.validate!: (
|
35
|
+
TerminalShop::Transport::BaseClient::request_components req
|
36
|
+
) -> void
|
37
|
+
|
38
|
+
def self.should_retry?: (
|
39
|
+
Integer status,
|
40
|
+
headers: ::Hash[String, String]
|
41
|
+
) -> bool
|
42
|
+
|
43
|
+
def self.follow_redirect: (
|
44
|
+
TerminalShop::Transport::BaseClient::request_input request,
|
45
|
+
status: Integer,
|
46
|
+
response_headers: ::Hash[String, String]
|
47
|
+
) -> TerminalShop::Transport::BaseClient::request_input
|
48
|
+
|
49
|
+
def self.reap_connection!: (
|
50
|
+
Integer | TerminalShop::APIConnectionError status,
|
51
|
+
stream: Enumerable[String]?
|
52
|
+
) -> void
|
53
|
+
|
54
|
+
# @api private
|
55
|
+
attr_accessor requester: TerminalShop::Transport::PooledNetRequester
|
56
|
+
|
57
|
+
def initialize: (
|
58
|
+
base_url: String,
|
59
|
+
?timeout: Float,
|
60
|
+
?max_retries: Integer,
|
61
|
+
?initial_retry_delay: Float,
|
62
|
+
?max_retry_delay: Float,
|
63
|
+
?headers: ::Hash[String, (String
|
64
|
+
| Integer
|
65
|
+
| ::Array[(String | Integer)?])?],
|
66
|
+
?idempotency_header: String?
|
67
|
+
) -> void
|
68
|
+
|
69
|
+
private def auth_headers: -> ::Hash[String, String]
|
70
|
+
|
71
|
+
private def generate_idempotency_key: -> String
|
72
|
+
|
73
|
+
private def build_request: (
|
74
|
+
TerminalShop::Transport::BaseClient::request_components req,
|
75
|
+
TerminalShop::request_options opts
|
76
|
+
) -> TerminalShop::Transport::BaseClient::request_input
|
77
|
+
|
78
|
+
private def retry_delay: (
|
79
|
+
::Hash[String, String] headers,
|
80
|
+
retry_count: Integer
|
81
|
+
) -> Float
|
82
|
+
|
83
|
+
private def send_request: (
|
84
|
+
TerminalShop::Transport::BaseClient::request_input request,
|
85
|
+
redirect_count: Integer,
|
86
|
+
retry_count: Integer,
|
87
|
+
send_retry_header: bool
|
88
|
+
) -> [Integer, top, Enumerable[String]]
|
89
|
+
|
90
|
+
def request:
|
91
|
+
(
|
92
|
+
Symbol method,
|
93
|
+
String | ::Array[String] path,
|
94
|
+
?query: ::Hash[String, (::Array[String] | String)?]?,
|
95
|
+
?headers: ::Hash[String, (String
|
96
|
+
| Integer
|
97
|
+
| ::Array[(String | Integer)?])?]?,
|
98
|
+
?body: top?,
|
99
|
+
?unwrap: Symbol?,
|
100
|
+
?page: Class?,
|
101
|
+
?stream: Class?,
|
102
|
+
?model: TerminalShop::Type::Converter::input?,
|
103
|
+
?options: TerminalShop::request_opts?
|
104
|
+
) -> top
|
105
|
+
| (TerminalShop::Transport::BaseClient::request_components req) -> top
|
106
|
+
|
107
|
+
def inspect: -> String
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Transport
|
3
|
+
class PooledNetRequester
|
4
|
+
type request =
|
5
|
+
{
|
6
|
+
method: Symbol,
|
7
|
+
url: URI::Generic,
|
8
|
+
headers: ::Hash[String, String],
|
9
|
+
body: top,
|
10
|
+
deadline: Float
|
11
|
+
}
|
12
|
+
|
13
|
+
KEEP_ALIVE_TIMEOUT: 30
|
14
|
+
|
15
|
+
def self.connect: (URI::Generic url) -> top
|
16
|
+
|
17
|
+
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
18
|
+
|
19
|
+
def self.build_request: (
|
20
|
+
TerminalShop::Transport::PooledNetRequester::request request
|
21
|
+
) {
|
22
|
+
(String arg0) -> void
|
23
|
+
} -> top
|
24
|
+
|
25
|
+
private def with_pool: (
|
26
|
+
URI::Generic url,
|
27
|
+
deadline: Float
|
28
|
+
) {
|
29
|
+
(top arg0) -> void
|
30
|
+
} -> void
|
31
|
+
|
32
|
+
def execute: (
|
33
|
+
TerminalShop::Transport::PooledNetRequester::request request
|
34
|
+
) -> [Integer, top, Enumerable[String]]
|
35
|
+
|
36
|
+
def initialize: (?size: Integer) -> void
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
class ArrayOf[Elem]
|
4
|
+
include TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
def self.[]: (
|
7
|
+
::Hash[Symbol, top]
|
8
|
+
| ^-> TerminalShop::Type::Converter::input
|
9
|
+
| TerminalShop::Type::Converter::input type_info,
|
10
|
+
?::Hash[Symbol, top] spec
|
11
|
+
) -> instance
|
12
|
+
|
13
|
+
def ===: (top other) -> bool
|
14
|
+
|
15
|
+
def ==: (top other) -> bool
|
16
|
+
|
17
|
+
def coerce: (
|
18
|
+
Enumerable[Elem] | top value,
|
19
|
+
state: TerminalShop::Type::Converter::state
|
20
|
+
) -> (::Array[top] | top)
|
21
|
+
|
22
|
+
def dump: (Enumerable[Elem] | top value) -> (::Array[top] | top)
|
23
|
+
|
24
|
+
def item_type: -> Elem
|
25
|
+
|
26
|
+
def nilable?: -> bool
|
27
|
+
|
28
|
+
def initialize: (
|
29
|
+
::Hash[Symbol, top]
|
30
|
+
| ^-> TerminalShop::Type::Converter::input
|
31
|
+
| TerminalShop::Type::Converter::input type_info,
|
32
|
+
?::Hash[Symbol, top] spec
|
33
|
+
) -> void
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
class BaseModel
|
4
|
+
extend TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
type known_field =
|
7
|
+
{ mode: (:coerce | :dump)?, required: bool, nilable: bool }
|
8
|
+
|
9
|
+
def self.known_fields: -> ::Hash[Symbol, (TerminalShop::BaseModel::known_field
|
10
|
+
& { type_fn: (^-> TerminalShop::Type::Converter::input) })]
|
11
|
+
|
12
|
+
def self.fields: -> ::Hash[Symbol, (TerminalShop::BaseModel::known_field
|
13
|
+
& { type: TerminalShop::Type::Converter::input })]
|
14
|
+
|
15
|
+
private def self.add_field: (
|
16
|
+
Symbol name_sym,
|
17
|
+
required: bool,
|
18
|
+
type_info: {
|
19
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
20
|
+
enum: ^-> TerminalShop::Type::Converter::input?,
|
21
|
+
union: ^-> TerminalShop::Type::Converter::input?,
|
22
|
+
api_name: Symbol
|
23
|
+
}
|
24
|
+
| ^-> TerminalShop::Type::Converter::input
|
25
|
+
| TerminalShop::Type::Converter::input,
|
26
|
+
spec: ::Hash[Symbol, top]
|
27
|
+
) -> void
|
28
|
+
|
29
|
+
def self.required: (
|
30
|
+
Symbol name_sym,
|
31
|
+
::Hash[Symbol, top]
|
32
|
+
| ^-> TerminalShop::Type::Converter::input
|
33
|
+
| TerminalShop::Type::Converter::input type_info,
|
34
|
+
?::Hash[Symbol, top] spec
|
35
|
+
) -> void
|
36
|
+
|
37
|
+
def self.optional: (
|
38
|
+
Symbol name_sym,
|
39
|
+
::Hash[Symbol, top]
|
40
|
+
| ^-> TerminalShop::Type::Converter::input
|
41
|
+
| TerminalShop::Type::Converter::input type_info,
|
42
|
+
?::Hash[Symbol, top] spec
|
43
|
+
) -> void
|
44
|
+
|
45
|
+
private def self.request_only: { -> void } -> void
|
46
|
+
|
47
|
+
private def self.response_only: { -> void } -> void
|
48
|
+
|
49
|
+
def self.==: (top other) -> bool
|
50
|
+
|
51
|
+
def ==: (top other) -> bool
|
52
|
+
|
53
|
+
def self.coerce: (
|
54
|
+
TerminalShop::BaseModel | ::Hash[top, top] | top value,
|
55
|
+
state: TerminalShop::Type::Converter::state
|
56
|
+
) -> (instance | top)
|
57
|
+
|
58
|
+
def self.dump: (instance | top value) -> (::Hash[top, top] | top)
|
59
|
+
|
60
|
+
def []: (Symbol key) -> top?
|
61
|
+
|
62
|
+
def to_h: -> ::Hash[Symbol, top]
|
63
|
+
|
64
|
+
alias to_hash to_h
|
65
|
+
|
66
|
+
def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
|
67
|
+
|
68
|
+
def initialize: (?::Hash[Symbol, top] | self data) -> void
|
69
|
+
|
70
|
+
def inspect: -> String
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
module BasePage[Elem]
|
4
|
+
def next_page?: -> bool
|
5
|
+
|
6
|
+
def next_page: -> self
|
7
|
+
|
8
|
+
def auto_paging_each: { (Elem arg0) -> void } -> void
|
9
|
+
|
10
|
+
def to_enum: -> Enumerable[Elem]
|
11
|
+
|
12
|
+
alias enum_for to_enum
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
client: TerminalShop::Transport::BaseClient,
|
16
|
+
req: TerminalShop::Transport::BaseClient::request_components,
|
17
|
+
headers: ::Hash[String, String],
|
18
|
+
page_data: top
|
19
|
+
) -> void
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
class BooleanModel
|
4
|
+
extend TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
def self.===: (top other) -> bool
|
7
|
+
|
8
|
+
def self.==: (top other) -> bool
|
9
|
+
|
10
|
+
def self.coerce: (
|
11
|
+
bool | top value,
|
12
|
+
state: TerminalShop::Type::Converter::state
|
13
|
+
) -> (bool | top)
|
14
|
+
|
15
|
+
def self.dump: (bool | top value) -> (bool | top)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
module Converter
|
4
|
+
type input = TerminalShop::Type::Converter | Class
|
5
|
+
|
6
|
+
type state =
|
7
|
+
{
|
8
|
+
strictness: bool | :strong,
|
9
|
+
exactness: { yes: Integer, no: Integer, maybe: Integer },
|
10
|
+
branched: Integer
|
11
|
+
}
|
12
|
+
|
13
|
+
def coerce: (
|
14
|
+
top value,
|
15
|
+
state: TerminalShop::Type::Converter::state
|
16
|
+
) -> top
|
17
|
+
|
18
|
+
def dump: (top value) -> top
|
19
|
+
|
20
|
+
def self.type_info: (
|
21
|
+
{
|
22
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
23
|
+
enum: ^-> TerminalShop::Type::Converter::input?,
|
24
|
+
union: ^-> TerminalShop::Type::Converter::input?
|
25
|
+
}
|
26
|
+
| ^-> TerminalShop::Type::Converter::input
|
27
|
+
| TerminalShop::Type::Converter::input spec
|
28
|
+
) -> (^-> top)
|
29
|
+
|
30
|
+
def self.coerce: (
|
31
|
+
TerminalShop::Type::Converter::input target,
|
32
|
+
top value,
|
33
|
+
?state: TerminalShop::Type::Converter::state
|
34
|
+
) -> top
|
35
|
+
|
36
|
+
def self.dump: (
|
37
|
+
TerminalShop::Type::Converter::input target,
|
38
|
+
top value
|
39
|
+
) -> top
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
module Enum
|
4
|
+
include TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
|
7
|
+
|
8
|
+
private def self.finalize!: -> void
|
9
|
+
|
10
|
+
def ===: (top other) -> bool
|
11
|
+
|
12
|
+
def ==: (top other) -> bool
|
13
|
+
|
14
|
+
def coerce: (
|
15
|
+
String | Symbol | top value,
|
16
|
+
state: TerminalShop::Type::Converter::state
|
17
|
+
) -> (Symbol | top)
|
18
|
+
|
19
|
+
def dump: (Symbol | top value) -> (Symbol | top)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
class HashOf[Elem]
|
4
|
+
include TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
def self.[]: (
|
7
|
+
::Hash[Symbol, top]
|
8
|
+
| ^-> TerminalShop::Type::Converter::input
|
9
|
+
| TerminalShop::Type::Converter::input type_info,
|
10
|
+
?::Hash[Symbol, top] spec
|
11
|
+
) -> instance
|
12
|
+
|
13
|
+
def ===: (top other) -> bool
|
14
|
+
|
15
|
+
def ==: (top other) -> bool
|
16
|
+
|
17
|
+
def coerce: (
|
18
|
+
::Hash[top, top] | top value,
|
19
|
+
state: TerminalShop::Type::Converter::state
|
20
|
+
) -> (::Hash[Symbol, top] | top)
|
21
|
+
|
22
|
+
def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top)
|
23
|
+
|
24
|
+
def item_type: -> Elem
|
25
|
+
|
26
|
+
def nilable?: -> bool
|
27
|
+
|
28
|
+
def initialize: (
|
29
|
+
::Hash[Symbol, top]
|
30
|
+
| ^-> TerminalShop::Type::Converter::input
|
31
|
+
| TerminalShop::Type::Converter::input type_info,
|
32
|
+
?::Hash[Symbol, top] spec
|
33
|
+
) -> void
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
type request_parameters = { request_options: TerminalShop::request_opts }
|
4
|
+
|
5
|
+
module RequestParameters
|
6
|
+
attr_accessor request_options: TerminalShop::request_opts
|
7
|
+
|
8
|
+
module Converter
|
9
|
+
def dump_request: (top params) -> [top, ::Hash[Symbol, top]]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
module Union
|
4
|
+
include TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
private def self.known_variants: -> ::Array[[Symbol?, (^-> TerminalShop::Type::Converter::input)]]
|
7
|
+
|
8
|
+
def self.derefed_variants: -> ::Array[[Symbol?, top]]
|
9
|
+
|
10
|
+
def self.variants: -> ::Array[top]
|
11
|
+
|
12
|
+
private def self.discriminator: (Symbol property) -> void
|
13
|
+
|
14
|
+
private def self.variant: (
|
15
|
+
Symbol
|
16
|
+
| ::Hash[Symbol, top]
|
17
|
+
| ^-> TerminalShop::Type::Converter::input
|
18
|
+
| TerminalShop::Type::Converter::input key,
|
19
|
+
?::Hash[Symbol, top]
|
20
|
+
| ^-> TerminalShop::Type::Converter::input
|
21
|
+
| TerminalShop::Type::Converter::input spec
|
22
|
+
) -> void
|
23
|
+
|
24
|
+
private def self.resolve_variant: (
|
25
|
+
top value
|
26
|
+
) -> TerminalShop::Type::Converter::input?
|
27
|
+
|
28
|
+
def ===: (top other) -> bool
|
29
|
+
|
30
|
+
def ==: (top other) -> bool
|
31
|
+
|
32
|
+
def coerce: (
|
33
|
+
top value,
|
34
|
+
state: TerminalShop::Type::Converter::state
|
35
|
+
) -> top
|
36
|
+
|
37
|
+
def dump: (top value) -> top
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
module Type
|
3
|
+
class Unknown
|
4
|
+
extend TerminalShop::Type::Converter
|
5
|
+
|
6
|
+
def self.===: (top other) -> bool
|
7
|
+
|
8
|
+
def self.==: (top other) -> bool
|
9
|
+
|
10
|
+
def self.coerce: (
|
11
|
+
top value,
|
12
|
+
state: TerminalShop::Type::Converter::state
|
13
|
+
) -> top
|
14
|
+
|
15
|
+
def self.dump: (top value) -> top
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module TerminalShop
|
2
|
+
class Unknown = TerminalShop::Type::Unknown
|
3
|
+
|
4
|
+
class BooleanModel = TerminalShop::Type::BooleanModel
|
5
|
+
|
6
|
+
module Enum = TerminalShop::Type::Enum
|
7
|
+
|
8
|
+
module Union = TerminalShop::Type::Union
|
9
|
+
|
10
|
+
class ArrayOf = TerminalShop::Type::ArrayOf
|
11
|
+
|
12
|
+
class HashOf = TerminalShop::Type::HashOf
|
13
|
+
|
14
|
+
class BaseModel = TerminalShop::Type::BaseModel
|
15
|
+
|
16
|
+
type request_parameters = TerminalShop::Type::request_parameters
|
17
|
+
|
18
|
+
module RequestParameters = TerminalShop::Type::RequestParameters
|
19
|
+
|
20
|
+
module Type
|
21
|
+
end
|
22
|
+
end
|