terminal-shop 3.7.0 → 3.8.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.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/README.md +81 -53
  4. data/SECURITY.md +2 -2
  5. data/lib/terminal_shop/client.rb +4 -4
  6. data/lib/terminal_shop/internal/transport/pooled_net_requester.rb +3 -1
  7. data/lib/terminal_shop/internal/type/array_of.rb +8 -0
  8. data/lib/terminal_shop/internal/type/base_model.rb +15 -0
  9. data/lib/terminal_shop/internal/type/boolean.rb +8 -0
  10. data/lib/terminal_shop/internal/type/enum.rb +12 -0
  11. data/lib/terminal_shop/internal/type/file_input.rb +7 -0
  12. data/lib/terminal_shop/internal/type/hash_of.rb +8 -0
  13. data/lib/terminal_shop/internal/type/union.rb +12 -0
  14. data/lib/terminal_shop/internal/type/unknown.rb +8 -0
  15. data/lib/terminal_shop/internal/util.rb +50 -1
  16. data/lib/terminal_shop/internal.rb +3 -0
  17. data/lib/terminal_shop/models/address.rb +2 -2
  18. data/lib/terminal_shop/models/address_get_response.rb +2 -2
  19. data/lib/terminal_shop/models/address_list_response.rb +2 -2
  20. data/lib/terminal_shop/models/app.rb +2 -2
  21. data/lib/terminal_shop/models/app_get_response.rb +2 -2
  22. data/lib/terminal_shop/models/app_list_response.rb +2 -2
  23. data/lib/terminal_shop/models/card.rb +5 -5
  24. data/lib/terminal_shop/models/card_get_response.rb +2 -2
  25. data/lib/terminal_shop/models/card_list_response.rb +2 -2
  26. data/lib/terminal_shop/models/cart.rb +9 -9
  27. data/lib/terminal_shop/models/cart_convert_response.rb +2 -2
  28. data/lib/terminal_shop/models/cart_get_response.rb +2 -2
  29. data/lib/terminal_shop/models/cart_set_item_response.rb +2 -2
  30. data/lib/terminal_shop/models/order.rb +17 -17
  31. data/lib/terminal_shop/models/order_get_response.rb +2 -2
  32. data/lib/terminal_shop/models/order_list_response.rb +2 -2
  33. data/lib/terminal_shop/models/product.rb +10 -10
  34. data/lib/terminal_shop/models/product_get_response.rb +2 -2
  35. data/lib/terminal_shop/models/product_list_response.rb +2 -2
  36. data/lib/terminal_shop/models/product_variant.rb +4 -4
  37. data/lib/terminal_shop/models/profile.rb +4 -4
  38. data/lib/terminal_shop/models/profile_me_response.rb +2 -2
  39. data/lib/terminal_shop/models/profile_update_response.rb +2 -2
  40. data/lib/terminal_shop/models/subscription.rb +5 -14
  41. data/lib/terminal_shop/models/subscription_get_response.rb +2 -2
  42. data/lib/terminal_shop/models/subscription_list_response.rb +2 -2
  43. data/lib/terminal_shop/models/subscription_update_params.rb +3 -12
  44. data/lib/terminal_shop/models/subscription_update_response.rb +2 -2
  45. data/lib/terminal_shop/models/token.rb +2 -2
  46. data/lib/terminal_shop/models/token_get_response.rb +2 -2
  47. data/lib/terminal_shop/models/token_list_response.rb +2 -2
  48. data/lib/terminal_shop/models/view_init_response.rb +20 -20
  49. data/lib/terminal_shop/models.rb +30 -19
  50. data/lib/terminal_shop/resources/subscription.rb +2 -2
  51. data/lib/terminal_shop/version.rb +1 -1
  52. data/rbi/terminal_shop/internal/transport/pooled_net_requester.rbi +5 -1
  53. data/rbi/terminal_shop/internal/type/array_of.rbi +6 -0
  54. data/rbi/terminal_shop/internal/type/base_model.rbi +5 -0
  55. data/rbi/terminal_shop/internal/type/boolean.rbi +6 -0
  56. data/rbi/terminal_shop/internal/type/enum.rbi +5 -0
  57. data/rbi/terminal_shop/internal/type/file_input.rbi +5 -0
  58. data/rbi/terminal_shop/internal/type/hash_of.rbi +6 -0
  59. data/rbi/terminal_shop/internal/type/union.rbi +5 -0
  60. data/rbi/terminal_shop/internal/type/unknown.rbi +6 -0
  61. data/rbi/terminal_shop/internal/util.rbi +34 -0
  62. data/rbi/terminal_shop/internal.rbi +5 -0
  63. data/rbi/terminal_shop/models/subscription.rbi +2 -13
  64. data/sig/terminal_shop/internal/transport/pooled_net_requester.rbs +2 -0
  65. data/sig/terminal_shop/internal/type/array_of.rbs +3 -0
  66. data/sig/terminal_shop/internal/type/base_model.rbs +2 -0
  67. data/sig/terminal_shop/internal/type/boolean.rbs +3 -0
  68. data/sig/terminal_shop/internal/type/enum.rbs +2 -0
  69. data/sig/terminal_shop/internal/type/file_input.rbs +2 -0
  70. data/sig/terminal_shop/internal/type/hash_of.rbs +3 -0
  71. data/sig/terminal_shop/internal/type/union.rbs +2 -0
  72. data/sig/terminal_shop/internal/type/unknown.rbs +3 -0
  73. data/sig/terminal_shop/internal/util.rbs +12 -0
  74. data/sig/terminal_shop/internal.rbs +2 -0
  75. data/sig/terminal_shop/models/address.rbs +13 -0
  76. data/sig/terminal_shop/models/address_create_params.rbs +12 -0
  77. data/sig/terminal_shop/models/address_create_response.rbs +2 -0
  78. data/sig/terminal_shop/models/address_delete_params.rbs +2 -0
  79. data/sig/terminal_shop/models/address_delete_response.rbs +2 -0
  80. data/sig/terminal_shop/models/address_get_params.rbs +2 -0
  81. data/sig/terminal_shop/models/address_get_response.rbs +2 -0
  82. data/sig/terminal_shop/models/address_list_params.rbs +2 -0
  83. data/sig/terminal_shop/models/address_list_response.rbs +2 -0
  84. data/sig/terminal_shop/models/app.rbs +7 -0
  85. data/sig/terminal_shop/models/app_create_params.rbs +6 -0
  86. data/sig/terminal_shop/models/app_create_response.rbs +4 -0
  87. data/sig/terminal_shop/models/app_delete_params.rbs +2 -0
  88. data/sig/terminal_shop/models/app_delete_response.rbs +2 -0
  89. data/sig/terminal_shop/models/app_get_params.rbs +2 -0
  90. data/sig/terminal_shop/models/app_get_response.rbs +2 -0
  91. data/sig/terminal_shop/models/app_list_params.rbs +2 -0
  92. data/sig/terminal_shop/models/app_list_response.rbs +2 -0
  93. data/sig/terminal_shop/models/card.rbs +10 -0
  94. data/sig/terminal_shop/models/card_collect_params.rbs +2 -0
  95. data/sig/terminal_shop/models/card_collect_response.rbs +4 -0
  96. data/sig/terminal_shop/models/card_create_params.rbs +5 -0
  97. data/sig/terminal_shop/models/card_create_response.rbs +2 -0
  98. data/sig/terminal_shop/models/card_delete_params.rbs +2 -0
  99. data/sig/terminal_shop/models/card_delete_response.rbs +2 -0
  100. data/sig/terminal_shop/models/card_get_params.rbs +2 -0
  101. data/sig/terminal_shop/models/card_get_response.rbs +2 -0
  102. data/sig/terminal_shop/models/card_list_params.rbs +2 -0
  103. data/sig/terminal_shop/models/card_list_response.rbs +2 -0
  104. data/sig/terminal_shop/models/cart.rbs +20 -0
  105. data/sig/terminal_shop/models/cart_clear_params.rbs +2 -0
  106. data/sig/terminal_shop/models/cart_clear_response.rbs +2 -0
  107. data/sig/terminal_shop/models/cart_convert_params.rbs +2 -0
  108. data/sig/terminal_shop/models/cart_convert_response.rbs +2 -0
  109. data/sig/terminal_shop/models/cart_get_params.rbs +2 -0
  110. data/sig/terminal_shop/models/cart_get_response.rbs +2 -0
  111. data/sig/terminal_shop/models/cart_set_address_params.rbs +5 -0
  112. data/sig/terminal_shop/models/cart_set_address_response.rbs +2 -0
  113. data/sig/terminal_shop/models/cart_set_card_params.rbs +5 -0
  114. data/sig/terminal_shop/models/cart_set_card_response.rbs +2 -0
  115. data/sig/terminal_shop/models/cart_set_item_params.rbs +6 -0
  116. data/sig/terminal_shop/models/cart_set_item_response.rbs +2 -0
  117. data/sig/terminal_shop/models/email_create_params.rbs +5 -0
  118. data/sig/terminal_shop/models/email_create_response.rbs +2 -0
  119. data/sig/terminal_shop/models/order.rbs +46 -6
  120. data/sig/terminal_shop/models/order_create_params.rbs +7 -0
  121. data/sig/terminal_shop/models/order_create_response.rbs +2 -0
  122. data/sig/terminal_shop/models/order_get_params.rbs +2 -0
  123. data/sig/terminal_shop/models/order_get_response.rbs +2 -0
  124. data/sig/terminal_shop/models/order_list_params.rbs +2 -0
  125. data/sig/terminal_shop/models/order_list_response.rbs +2 -0
  126. data/sig/terminal_shop/models/product.rbs +25 -6
  127. data/sig/terminal_shop/models/product_get_params.rbs +2 -0
  128. data/sig/terminal_shop/models/product_get_response.rbs +2 -0
  129. data/sig/terminal_shop/models/product_list_params.rbs +2 -0
  130. data/sig/terminal_shop/models/product_list_response.rbs +2 -0
  131. data/sig/terminal_shop/models/product_variant.rbs +15 -0
  132. data/sig/terminal_shop/models/profile.rbs +10 -0
  133. data/sig/terminal_shop/models/profile_me_params.rbs +2 -0
  134. data/sig/terminal_shop/models/profile_me_response.rbs +2 -0
  135. data/sig/terminal_shop/models/profile_update_params.rbs +6 -0
  136. data/sig/terminal_shop/models/profile_update_response.rbs +2 -0
  137. data/sig/terminal_shop/models/subscription.rbs +22 -6
  138. data/sig/terminal_shop/models/subscription_create_params.rbs +2 -0
  139. data/sig/terminal_shop/models/subscription_create_response.rbs +2 -0
  140. data/sig/terminal_shop/models/subscription_delete_params.rbs +2 -0
  141. data/sig/terminal_shop/models/subscription_delete_response.rbs +2 -0
  142. data/sig/terminal_shop/models/subscription_get_params.rbs +2 -0
  143. data/sig/terminal_shop/models/subscription_get_response.rbs +2 -0
  144. data/sig/terminal_shop/models/subscription_list_params.rbs +2 -0
  145. data/sig/terminal_shop/models/subscription_list_response.rbs +2 -0
  146. data/sig/terminal_shop/models/subscription_update_params.rbs +11 -0
  147. data/sig/terminal_shop/models/subscription_update_response.rbs +2 -0
  148. data/sig/terminal_shop/models/token.rbs +2 -0
  149. data/sig/terminal_shop/models/token_create_params.rbs +2 -0
  150. data/sig/terminal_shop/models/token_create_response.rbs +4 -0
  151. data/sig/terminal_shop/models/token_delete_params.rbs +2 -0
  152. data/sig/terminal_shop/models/token_delete_response.rbs +2 -0
  153. data/sig/terminal_shop/models/token_get_params.rbs +2 -0
  154. data/sig/terminal_shop/models/token_get_response.rbs +2 -0
  155. data/sig/terminal_shop/models/token_list_params.rbs +2 -0
  156. data/sig/terminal_shop/models/token_list_response.rbs +2 -0
  157. data/sig/terminal_shop/models/view_init_params.rbs +2 -0
  158. data/sig/terminal_shop/models/view_init_response.rbs +15 -0
  159. metadata +2 -2
@@ -7,11 +7,11 @@ module TerminalShop
7
7
  # @!attribute data
8
8
  # Subscription to a Terminal shop product.
9
9
  #
10
- # @return [TerminalShop::SubscriptionAPI]
10
+ # @return [TerminalShop::Models::SubscriptionAPI]
11
11
  required :data, -> { TerminalShop::SubscriptionAPI }
12
12
 
13
13
  # @!method initialize(data:)
14
- # @param data [TerminalShop::SubscriptionAPI] Subscription to a Terminal shop product.
14
+ # @param data [TerminalShop::Models::SubscriptionAPI] Subscription to a Terminal shop product.
15
15
  end
16
16
  end
17
17
  end
@@ -22,8 +22,8 @@ module TerminalShop
22
22
  required :created, String
23
23
 
24
24
  # @!method initialize(id:, token:, created:)
25
- # Some parameter documentations has been truncated, see {TerminalShop::TokenAPI}
26
- # for more details.
25
+ # Some parameter documentations has been truncated, see
26
+ # {TerminalShop::Models::TokenAPI} for more details.
27
27
  #
28
28
  # A personal access token used to access the Terminal API. If you leak this,
29
29
  # expect large sums of coffee to be ordered on your credit card.
@@ -8,14 +8,14 @@ module TerminalShop
8
8
  # A personal access token used to access the Terminal API. If you leak this,
9
9
  # expect large sums of coffee to be ordered on your credit card.
10
10
  #
11
- # @return [TerminalShop::TokenAPI]
11
+ # @return [TerminalShop::Models::TokenAPI]
12
12
  required :data, -> { TerminalShop::TokenAPI }
13
13
 
14
14
  # @!method initialize(data:)
15
15
  # Some parameter documentations has been truncated, see
16
16
  # {TerminalShop::Models::TokenGetResponse} for more details.
17
17
  #
18
- # @param data [TerminalShop::TokenAPI] A personal access token used to access the Terminal API. If you leak this, expec
18
+ # @param data [TerminalShop::Models::TokenAPI] A personal access token used to access the Terminal API. If you leak this, expec
19
19
  end
20
20
  end
21
21
  end
@@ -7,11 +7,11 @@ module TerminalShop
7
7
  # @!attribute data
8
8
  # List of personal access tokens.
9
9
  #
10
- # @return [Array<TerminalShop::TokenAPI>]
10
+ # @return [Array<TerminalShop::Models::TokenAPI>]
11
11
  required :data, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::TokenAPI] }
12
12
 
13
13
  # @!method initialize(data:)
14
- # @param data [Array<TerminalShop::TokenAPI>] List of personal access tokens.
14
+ # @param data [Array<TerminalShop::Models::TokenAPI>] List of personal access tokens.
15
15
  end
16
16
  end
17
17
  end
@@ -17,79 +17,79 @@ module TerminalShop
17
17
  class Data < TerminalShop::Internal::Type::BaseModel
18
18
  # @!attribute addresses
19
19
  #
20
- # @return [Array<TerminalShop::AddressAPI>]
20
+ # @return [Array<TerminalShop::Models::AddressAPI>]
21
21
  required :addresses, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::AddressAPI] }
22
22
 
23
23
  # @!attribute apps
24
24
  #
25
- # @return [Array<TerminalShop::AppAPI>]
25
+ # @return [Array<TerminalShop::Models::AppAPI>]
26
26
  required :apps, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::AppAPI] }
27
27
 
28
28
  # @!attribute cards
29
29
  #
30
- # @return [Array<TerminalShop::CardAPI>]
30
+ # @return [Array<TerminalShop::Models::CardAPI>]
31
31
  required :cards, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::CardAPI] }
32
32
 
33
33
  # @!attribute cart
34
34
  # The current Terminal shop user's cart.
35
35
  #
36
- # @return [TerminalShop::CartAPI]
36
+ # @return [TerminalShop::Models::CartAPI]
37
37
  required :cart, -> { TerminalShop::CartAPI }
38
38
 
39
39
  # @!attribute orders
40
40
  #
41
- # @return [Array<TerminalShop::OrderAPI>]
41
+ # @return [Array<TerminalShop::Models::OrderAPI>]
42
42
  required :orders, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::OrderAPI] }
43
43
 
44
44
  # @!attribute products
45
45
  #
46
- # @return [Array<TerminalShop::ProductAPI>]
46
+ # @return [Array<TerminalShop::Models::ProductAPI>]
47
47
  required :products, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::ProductAPI] }
48
48
 
49
49
  # @!attribute profile
50
50
  # A Terminal shop user's profile. (We have users, btw.)
51
51
  #
52
- # @return [TerminalShop::ProfileAPI]
52
+ # @return [TerminalShop::Models::ProfileAPI]
53
53
  required :profile, -> { TerminalShop::ProfileAPI }
54
54
 
55
55
  # @!attribute region
56
56
  # A Terminal shop user's region.
57
57
  #
58
- # @return [Symbol, TerminalShop::Region]
58
+ # @return [Symbol, TerminalShop::Models::Region]
59
59
  required :region, enum: -> { TerminalShop::Region }
60
60
 
61
61
  # @!attribute subscriptions
62
62
  #
63
- # @return [Array<TerminalShop::SubscriptionAPI>]
63
+ # @return [Array<TerminalShop::Models::SubscriptionAPI>]
64
64
  required :subscriptions, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::SubscriptionAPI] }
65
65
 
66
66
  # @!attribute tokens
67
67
  #
68
- # @return [Array<TerminalShop::TokenAPI>]
68
+ # @return [Array<TerminalShop::Models::TokenAPI>]
69
69
  required :tokens, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::TokenAPI] }
70
70
 
71
71
  # @!method initialize(addresses:, apps:, cards:, cart:, orders:, products:, profile:, region:, subscriptions:, tokens:)
72
72
  # Initial app data.
73
73
  #
74
- # @param addresses [Array<TerminalShop::AddressAPI>]
74
+ # @param addresses [Array<TerminalShop::Models::AddressAPI>]
75
75
  #
76
- # @param apps [Array<TerminalShop::AppAPI>]
76
+ # @param apps [Array<TerminalShop::Models::AppAPI>]
77
77
  #
78
- # @param cards [Array<TerminalShop::CardAPI>]
78
+ # @param cards [Array<TerminalShop::Models::CardAPI>]
79
79
  #
80
- # @param cart [TerminalShop::CartAPI] The current Terminal shop user's cart.
80
+ # @param cart [TerminalShop::Models::CartAPI] The current Terminal shop user's cart.
81
81
  #
82
- # @param orders [Array<TerminalShop::OrderAPI>]
82
+ # @param orders [Array<TerminalShop::Models::OrderAPI>]
83
83
  #
84
- # @param products [Array<TerminalShop::ProductAPI>]
84
+ # @param products [Array<TerminalShop::Models::ProductAPI>]
85
85
  #
86
- # @param profile [TerminalShop::ProfileAPI] A Terminal shop user's profile. (We have users, btw.)
86
+ # @param profile [TerminalShop::Models::ProfileAPI] A Terminal shop user's profile. (We have users, btw.)
87
87
  #
88
- # @param region [Symbol, TerminalShop::Region] A Terminal shop user's region.
88
+ # @param region [Symbol, TerminalShop::Models::Region] A Terminal shop user's region.
89
89
  #
90
- # @param subscriptions [Array<TerminalShop::SubscriptionAPI>]
90
+ # @param subscriptions [Array<TerminalShop::Models::SubscriptionAPI>]
91
91
  #
92
- # @param tokens [Array<TerminalShop::TokenAPI>]
92
+ # @param tokens [Array<TerminalShop::Models::TokenAPI>]
93
93
  end
94
94
  end
95
95
  end
@@ -5,29 +5,40 @@ module TerminalShop
5
5
  cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, TerminalShop::Internal::AnyHash) } }
6
6
  end
7
7
 
8
- [
9
- *TerminalShop::Internal::Type::Enum.included_modules,
10
- *TerminalShop::Internal::Type::Union.included_modules
11
- ].each do |cls|
12
- cls.constants.each do |name|
13
- case cls.const_get(name)
14
- in true | false
15
- cls.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, cls) } }
16
- cls.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
17
- in Integer
18
- cls.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, cls) } }
19
- cls.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
20
- in Float
21
- cls.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, cls) } }
22
- cls.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
23
- in Symbol
24
- cls.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, cls) } }
25
- cls.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
26
- else
8
+ TerminalShop::Internal::Util.walk_namespaces(TerminalShop::Models).each do |mod|
9
+ case mod
10
+ in TerminalShop::Internal::Type::Enum | TerminalShop::Internal::Type::Union
11
+ mod.constants.each do |name|
12
+ case mod.const_get(name)
13
+ in true | false
14
+ mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
15
+ mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
16
+ in Integer
17
+ mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
18
+ mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
19
+ in Float
20
+ mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
21
+ mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
22
+ in Symbol
23
+ mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
24
+ mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
25
+ else
26
+ end
27
27
  end
28
+ else
28
29
  end
29
30
  end
30
31
 
32
+ TerminalShop::Internal::Util.walk_namespaces(TerminalShop::Models)
33
+ .lazy
34
+ .grep(TerminalShop::Internal::Type::Union)
35
+ .each do |mod|
36
+ const = :Variants
37
+ next if mod.sorbet_constant_defined?(const)
38
+
39
+ mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
40
+ end
41
+
31
42
  AddressAPI = TerminalShop::Models::AddressAPI
32
43
 
33
44
  AddressCreateParams = TerminalShop::Models::AddressCreateParams
@@ -26,7 +26,7 @@ module TerminalShop
26
26
  #
27
27
  # @param next_ [String] Next shipment and billing date for the subscription.
28
28
  #
29
- # @param schedule [TerminalShop::SubscriptionAPI::Schedule::Fixed, TerminalShop::SubscriptionAPI::Schedule::Weekly] Schedule of the subscription.
29
+ # @param schedule [TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly] Schedule of the subscription.
30
30
  #
31
31
  # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil]
32
32
  #
@@ -54,7 +54,7 @@ module TerminalShop
54
54
  #
55
55
  # @param card_id [String] New payment method ID for the subscription.
56
56
  #
57
- # @param schedule [TerminalShop::SubscriptionUpdateParams::Schedule::Fixed, TerminalShop::SubscriptionUpdateParams::Schedule::Weekly] New schedule for the subscription.
57
+ # @param schedule [TerminalShop::Models::SubscriptionUpdateParams::Schedule::Fixed, TerminalShop::Models::SubscriptionUpdateParams::Schedule::Weekly] New schedule for the subscription.
58
58
  #
59
59
  # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil]
60
60
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- VERSION = "3.7.0"
4
+ VERSION = "3.8.1"
5
5
  end
@@ -22,6 +22,8 @@ module TerminalShop
22
22
  # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49
23
23
  KEEP_ALIVE_TIMEOUT = 30
24
24
 
25
+ DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer)
26
+
25
27
  class << self
26
28
  # @api private
27
29
  sig { params(url: URI::Generic).returns(Net::HTTP) }
@@ -68,7 +70,9 @@ module TerminalShop
68
70
 
69
71
  # @api private
70
72
  sig { params(size: Integer).returns(T.attached_class) }
71
- def self.new(size: Etc.nprocessors)
73
+ def self.new(
74
+ size: TerminalShop::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS
75
+ )
72
76
  end
73
77
  end
74
78
  end
@@ -8,6 +8,7 @@ module TerminalShop
8
8
  # Array of items of a given type.
9
9
  class ArrayOf
10
10
  include TerminalShop::Internal::Type::Converter
11
+ include TerminalShop::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module TerminalShop
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -205,6 +205,11 @@ module TerminalShop
205
205
  end
206
206
  def dump(value, state:)
207
207
  end
208
+
209
+ # @api private
210
+ sig { returns(T.anything) }
211
+ def to_sorbet_type
212
+ end
208
213
  end
209
214
 
210
215
  class << self
@@ -8,6 +8,7 @@ module TerminalShop
8
8
  # Ruby has no Boolean class; this is something for models to refer to.
9
9
  class Boolean
10
10
  extend TerminalShop::Internal::Type::Converter
11
+ extend TerminalShop::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module TerminalShop
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -67,6 +67,11 @@ module TerminalShop
67
67
  def dump(value, state:)
68
68
  end
69
69
 
70
+ # @api private
71
+ sig { returns(T.anything) }
72
+ def to_sorbet_type
73
+ end
74
+
70
75
  # @api private
71
76
  sig { params(depth: Integer).returns(String) }
72
77
  def inspect(depth: 0)
@@ -47,6 +47,11 @@ module TerminalShop
47
47
  end
48
48
  def dump(value, state:)
49
49
  end
50
+
51
+ # @api private
52
+ sig { returns(T.anything) }
53
+ def to_sorbet_type
54
+ end
50
55
  end
51
56
  end
52
57
  end
@@ -8,6 +8,7 @@ module TerminalShop
8
8
  # Hash of items of a given type.
9
9
  class HashOf
10
10
  include TerminalShop::Internal::Type::Converter
11
+ include TerminalShop::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module TerminalShop
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -101,6 +101,11 @@ module TerminalShop
101
101
  def dump(value, state:)
102
102
  end
103
103
 
104
+ # @api private
105
+ sig { returns(T.anything) }
106
+ def to_sorbet_type
107
+ end
108
+
104
109
  # @api private
105
110
  sig { params(depth: Integer).returns(String) }
106
111
  def inspect(depth: 0)
@@ -8,6 +8,7 @@ module TerminalShop
8
8
  # When we don't know what to expect for the value.
9
9
  class Unknown
10
10
  extend TerminalShop::Internal::Type::Converter
11
+ extend TerminalShop::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module TerminalShop
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -11,6 +11,15 @@ module TerminalShop
11
11
  def self.monotonic_secs
12
12
  end
13
13
 
14
+ # @api private
15
+ sig do
16
+ params(ns: T.any(Module, T::Class[T.anything])).returns(
17
+ T::Enumerable[T.any(Module, T::Class[T.anything])]
18
+ )
19
+ end
20
+ def self.walk_namespaces(ns)
21
+ end
22
+
14
23
  class << self
15
24
  # @api private
16
25
  sig { returns(String) }
@@ -441,10 +450,35 @@ module TerminalShop
441
450
  def const_missing(name)
442
451
  end
443
452
 
453
+ # @api private
454
+ sig { params(name: Symbol).returns(T::Boolean) }
455
+ def sorbet_constant_defined?(name)
456
+ end
457
+
444
458
  # @api private
445
459
  sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void }
446
460
  def define_sorbet_constant!(name, &blk)
447
461
  end
462
+
463
+ # @api private
464
+ sig { returns(T.anything) }
465
+ def to_sorbet_type
466
+ end
467
+
468
+ class << self
469
+ # @api private
470
+ sig do
471
+ params(
472
+ type:
473
+ T.any(
474
+ TerminalShop::Internal::Util::SorbetRuntimeSupport,
475
+ T.anything
476
+ )
477
+ ).returns(T.anything)
478
+ end
479
+ def to_sorbet_type(type)
480
+ end
481
+ end
448
482
  end
449
483
  end
450
484
  end
@@ -8,6 +8,11 @@ module TerminalShop
8
8
  # this alias might be refined in the future.
9
9
  AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
10
10
 
11
+ FileInput =
12
+ T.type_alias do
13
+ T.any(Pathname, StringIO, IO, String, TerminalShop::FilePart)
14
+ end
15
+
11
16
  OMIT = T.let(Object.new.freeze, T.anything)
12
17
  end
13
18
  end
@@ -45,14 +45,7 @@ module TerminalShop
45
45
 
46
46
  # Schedule of the subscription.
47
47
  sig do
48
- returns(
49
- T.nilable(
50
- T.any(
51
- TerminalShop::SubscriptionAPI::Schedule::Fixed,
52
- TerminalShop::SubscriptionAPI::Schedule::Weekly
53
- )
54
- )
55
- )
48
+ returns(T.nilable(TerminalShop::SubscriptionAPI::Schedule::Variants))
56
49
  end
57
50
  attr_reader :schedule
58
51
 
@@ -118,11 +111,7 @@ module TerminalShop
118
111
  product_variant_id: String,
119
112
  quantity: Integer,
120
113
  next_: String,
121
- schedule:
122
- T.any(
123
- TerminalShop::SubscriptionAPI::Schedule::Fixed,
124
- TerminalShop::SubscriptionAPI::Schedule::Weekly
125
- )
114
+ schedule: TerminalShop::SubscriptionAPI::Schedule::Variants
126
115
  }
127
116
  )
128
117
  end
@@ -15,6 +15,8 @@ module TerminalShop
15
15
 
16
16
  KEEP_ALIVE_TIMEOUT: 30
17
17
 
18
+ DEFAULT_MAX_CONNECTIONS: Integer
19
+
18
20
  def self.connect: (URI::Generic url) -> top
19
21
 
20
22
  def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
@@ -3,6 +3,7 @@ module TerminalShop
3
3
  module Type
4
4
  class ArrayOf[Elem]
5
5
  include TerminalShop::Internal::Type::Converter
6
+ include TerminalShop::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  def self.[]: (
8
9
  ::Hash[Symbol, top]
@@ -27,6 +28,8 @@ module TerminalShop
27
28
  state: TerminalShop::Internal::Type::Converter::dump_state
28
29
  ) -> (::Array[top] | top)
29
30
 
31
+ def to_sorbet_type: -> top
32
+
30
33
  def item_type: -> Elem
31
34
 
32
35
  def nilable?: -> bool
@@ -70,6 +70,8 @@ module TerminalShop
70
70
  state: TerminalShop::Internal::Type::Converter::dump_state
71
71
  ) -> (::Hash[top, top] | top)
72
72
 
73
+ def self.to_sorbet_type: -> top
74
+
73
75
  def self.recursively_to_h: (
74
76
  TerminalShop::Internal::Type::BaseModel model,
75
77
  convert: bool
@@ -3,6 +3,7 @@ module TerminalShop
3
3
  module Type
4
4
  class Boolean
5
5
  extend TerminalShop::Internal::Type::Converter
6
+ extend TerminalShop::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  def self.===: (top other) -> bool
8
9
 
@@ -17,6 +18,8 @@ module TerminalShop
17
18
  bool | top value,
18
19
  state: TerminalShop::Internal::Type::Converter::dump_state
19
20
  ) -> (bool | top)
21
+
22
+ def self.to_sorbet_type: -> top
20
23
  end
21
24
  end
22
25
  end
@@ -23,6 +23,8 @@ module TerminalShop
23
23
  state: TerminalShop::Internal::Type::Converter::dump_state
24
24
  ) -> (Symbol | top)
25
25
 
26
+ def to_sorbet_type: -> top
27
+
26
28
  def inspect: (?depth: Integer) -> String
27
29
  end
28
30
  end
@@ -17,6 +17,8 @@ module TerminalShop
17
17
  Pathname | StringIO | IO | String | top value,
18
18
  state: TerminalShop::Internal::Type::Converter::dump_state
19
19
  ) -> (Pathname | StringIO | IO | String | top)
20
+
21
+ def self.to_sorbet_type: -> top
20
22
  end
21
23
  end
22
24
  end
@@ -3,6 +3,7 @@ module TerminalShop
3
3
  module Type
4
4
  class HashOf[Elem]
5
5
  include TerminalShop::Internal::Type::Converter
6
+ include TerminalShop::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  def self.[]: (
8
9
  ::Hash[Symbol, top]
@@ -27,6 +28,8 @@ module TerminalShop
27
28
  state: TerminalShop::Internal::Type::Converter::dump_state
28
29
  ) -> (::Hash[Symbol, top] | top)
29
30
 
31
+ def to_sorbet_type: -> top
32
+
30
33
  def item_type: -> Elem
31
34
 
32
35
  def nilable?: -> bool
@@ -43,6 +43,8 @@ module TerminalShop
43
43
  state: TerminalShop::Internal::Type::Converter::dump_state
44
44
  ) -> top
45
45
 
46
+ def to_sorbet_type: -> top
47
+
46
48
  def inspect: (?depth: Integer) -> String
47
49
  end
48
50
  end
@@ -3,6 +3,7 @@ module TerminalShop
3
3
  module Type
4
4
  class Unknown
5
5
  extend TerminalShop::Internal::Type::Converter
6
+ extend TerminalShop::Internal::Util::SorbetRuntimeSupport
6
7
 
7
8
  def self.===: (top other) -> bool
8
9
 
@@ -17,6 +18,8 @@ module TerminalShop
17
18
  top value,
18
19
  state: TerminalShop::Internal::Type::Converter::dump_state
19
20
  ) -> top
21
+
22
+ def self.to_sorbet_type: -> top
20
23
  end
21
24
  end
22
25
  end
@@ -5,6 +5,10 @@ module TerminalShop
5
5
 
6
6
  def self?.monotonic_secs: -> Float
7
7
 
8
+ def self?.walk_namespaces: (
9
+ Module | Class ns
10
+ ) -> Enumerable[(Module | Class)]
11
+
8
12
  def self?.arch: -> String
9
13
 
10
14
  def self?.os: -> String
@@ -166,7 +170,15 @@ module TerminalShop
166
170
 
167
171
  def const_missing: (Symbol name) -> void
168
172
 
173
+ def sorbet_constant_defined?: (Symbol name) -> bool
174
+
169
175
  def define_sorbet_constant!: (Symbol name) { -> top } -> void
176
+
177
+ def to_sorbet_type: -> top
178
+
179
+ def self.to_sorbet_type: (
180
+ TerminalShop::Internal::Util::SorbetRuntimeSupport | top `type`
181
+ ) -> top
170
182
  end
171
183
  end
172
184
  end
@@ -2,6 +2,8 @@ module TerminalShop
2
2
  module Internal
3
3
  extend TerminalShop::Internal::Util::SorbetRuntimeSupport
4
4
 
5
+ type file_input = Pathname | StringIO | IO | String | TerminalShop::FilePart
6
+
5
7
  OMIT: Object
6
8
  end
7
9
  end