checkout-intents 0.5.0 → 0.6.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/CHANGELOG.md +22 -0
- data/README.md +1 -1
- data/lib/checkout_intents/client.rb +9 -2
- data/lib/checkout_intents/errors.rb +2 -1
- data/lib/checkout_intents/internal/cursor_pagination.rb +5 -1
- data/lib/checkout_intents/internal/type/base_model.rb +2 -1
- data/lib/checkout_intents/internal/util.rb +2 -1
- data/lib/checkout_intents/models/checkout_intents/shipment_list_params.rb +34 -0
- data/lib/checkout_intents/models/shipment.rb +617 -0
- data/lib/checkout_intents/models/shipment_list_params.rb +44 -0
- data/lib/checkout_intents/models/shipment_retrieve_params.rb +14 -0
- data/lib/checkout_intents/models/shipment_status.rb +19 -0
- data/lib/checkout_intents/models/shipment_tracking.rb +33 -0
- data/lib/checkout_intents/models.rb +12 -0
- data/lib/checkout_intents/resources/checkout_intents/shipments.rb +45 -0
- data/lib/checkout_intents/resources/checkout_intents.rb +4 -0
- data/lib/checkout_intents/resources/shipments.rb +65 -0
- data/lib/checkout_intents/version.rb +1 -1
- data/lib/checkout_intents.rb +8 -0
- data/rbi/checkout_intents/client.rbi +3 -0
- data/rbi/checkout_intents/models/checkout_intents/shipment_list_params.rbi +62 -0
- data/rbi/checkout_intents/models/shipment.rbi +1151 -0
- data/rbi/checkout_intents/models/shipment_list_params.rbi +91 -0
- data/rbi/checkout_intents/models/shipment_retrieve_params.rbi +32 -0
- data/rbi/checkout_intents/models/shipment_status.rbi +34 -0
- data/rbi/checkout_intents/models/shipment_tracking.rbi +56 -0
- data/rbi/checkout_intents/models.rbi +12 -0
- data/rbi/checkout_intents/resources/checkout_intents/shipments.rbi +40 -0
- data/rbi/checkout_intents/resources/checkout_intents.rbi +3 -0
- data/rbi/checkout_intents/resources/shipments.rbi +58 -0
- data/sig/checkout_intents/client.rbs +2 -0
- data/sig/checkout_intents/models/checkout_intents/shipment_list_params.rbs +40 -0
- data/sig/checkout_intents/models/shipment.rbs +600 -0
- data/sig/checkout_intents/models/shipment_list_params.rbs +58 -0
- data/sig/checkout_intents/models/shipment_retrieve_params.rbs +17 -0
- data/sig/checkout_intents/models/shipment_status.rbs +24 -0
- data/sig/checkout_intents/models/shipment_tracking.rbs +35 -0
- data/sig/checkout_intents/models.rbs +12 -0
- data/sig/checkout_intents/resources/checkout_intents/shipments.rbs +17 -0
- data/sig/checkout_intents/resources/checkout_intents.rbs +2 -0
- data/sig/checkout_intents/resources/shipments.rbs +21 -0
- metadata +26 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce29208993c02ac89b468c6cc077de7c54d80fcfd7a249605258fb2c30771950
|
|
4
|
+
data.tar.gz: 8f65f6ecce5527f4463097a090c91e1bc5390125fb1841b564a66c464bbead12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50dd8b8be1e03bb1b1968d9f536c2dbe960a72eb48da47116242c6a4b5e40d9694bb3148b5fe325645afbc6d9ac0b7fd3cd18d74c84d870c43feaf3bee3e4398
|
|
7
|
+
data.tar.gz: 9fabba90a0fc93417125b1e1fa62597b39001884f7a55e16c094646872b3b95dad9d82b54c3bb2e720dfa6bf75454e22a21163e7a872535498737a00f102b40a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0 (2026-02-28)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/rye-com/checkout-intents-ruby/compare/v0.5.0...v0.6.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Added new shipments endpoint for tracking Amazon orders ([df5feee](https://github.com/rye-com/checkout-intents-ruby/commit/df5feee5d104954650c7e9234066058d5b6eaa03))
|
|
10
|
+
* Added new shipments endpoint for tracking Amazon orders ([bf2793e](https://github.com/rye-com/checkout-intents-ruby/commit/bf2793e4af8d171cc0d06cd2ce287322dc431327))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **internal:** formatting ([10a3965](https://github.com/rye-com/checkout-intents-ruby/commit/10a3965176768f5d49355a503cefb682c3abd8c4))
|
|
16
|
+
* properly mock time in ruby ci tests ([4e1da16](https://github.com/rye-com/checkout-intents-ruby/commit/4e1da16802345fa29a8172938c9deca2adb388e6))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
|
|
21
|
+
* **internal:** format and fix absolute references ([e0a8160](https://github.com/rye-com/checkout-intents-ruby/commit/e0a816094249932edfd882f20323ce85dbabfe55))
|
|
22
|
+
* **internal:** format and fix absolute references ([19b428e](https://github.com/rye-com/checkout-intents-ruby/commit/19b428e84f06b1d7d2d712850d440a50fac9237d))
|
|
23
|
+
* **internal:** improvements ([63a81a1](https://github.com/rye-com/checkout-intents-ruby/commit/63a81a1d1a92de0ebf4da632363724040d7359fa))
|
|
24
|
+
|
|
3
25
|
## 0.5.0 (2026-02-27)
|
|
4
26
|
|
|
5
27
|
Full Changelog: [v0.4.0...v0.5.0](https://github.com/rye-com/checkout-intents-ruby/compare/v0.4.0...v0.5.0)
|
data/README.md
CHANGED
|
@@ -36,6 +36,9 @@ module CheckoutIntents
|
|
|
36
36
|
# @return [::CheckoutIntents::Resources::Products]
|
|
37
37
|
attr_reader :products
|
|
38
38
|
|
|
39
|
+
# @return [::CheckoutIntents::Resources::Shipments]
|
|
40
|
+
attr_reader :shipments
|
|
41
|
+
|
|
39
42
|
# @return [::CheckoutIntents::Resources::Billing]
|
|
40
43
|
attr_reader :billing
|
|
41
44
|
|
|
@@ -96,7 +99,9 @@ module CheckoutIntents
|
|
|
96
99
|
idempotency_header: "Idempotency-Key"
|
|
97
100
|
)
|
|
98
101
|
if api_key.nil?
|
|
99
|
-
raise ArgumentError.new(
|
|
102
|
+
raise ArgumentError.new(
|
|
103
|
+
"api_key is required, and can be set via environ: \"CHECKOUT_INTENTS_API_KEY\""
|
|
104
|
+
)
|
|
100
105
|
end
|
|
101
106
|
|
|
102
107
|
@api_key = api_key.to_s
|
|
@@ -118,7 +123,8 @@ module CheckoutIntents
|
|
|
118
123
|
resolved_environment = environment&.to_sym || inferred_environment || :staging
|
|
119
124
|
|
|
120
125
|
base_url ||= ::CheckoutIntents::Client::ENVIRONMENTS.fetch(resolved_environment) do
|
|
121
|
-
|
|
126
|
+
envs = ::CheckoutIntents::Client::ENVIRONMENTS.keys
|
|
127
|
+
message = "environment must be one of #{envs}, got #{resolved_environment}"
|
|
122
128
|
raise ArgumentError.new(message)
|
|
123
129
|
end
|
|
124
130
|
|
|
@@ -135,6 +141,7 @@ module CheckoutIntents
|
|
|
135
141
|
@betas = ::CheckoutIntents::Resources::Betas.new(client: self)
|
|
136
142
|
@brands = ::CheckoutIntents::Resources::Brands.new(client: self)
|
|
137
143
|
@products = ::CheckoutIntents::Resources::Products.new(client: self)
|
|
144
|
+
@shipments = ::CheckoutIntents::Resources::Shipments.new(client: self)
|
|
138
145
|
@billing = ::CheckoutIntents::Resources::Billing.new(client: self)
|
|
139
146
|
end
|
|
140
147
|
end
|
|
@@ -252,7 +252,8 @@ module CheckoutIntents
|
|
|
252
252
|
@max_attempts = max_attempts
|
|
253
253
|
|
|
254
254
|
message ||= "Polling timeout for checkout intent '#{intent_id}': " \
|
|
255
|
-
"condition not met after #{attempts} attempts
|
|
255
|
+
"condition not met after #{attempts} attempts " \
|
|
256
|
+
"(#{(max_attempts * poll_interval).round(1)}s). " \
|
|
256
257
|
"Consider increasing max_attempts or poll_interval."
|
|
257
258
|
super(message)
|
|
258
259
|
end
|
|
@@ -37,7 +37,11 @@ module CheckoutIntents
|
|
|
37
37
|
|
|
38
38
|
req = ::CheckoutIntents::Internal::Util.deep_merge(
|
|
39
39
|
@req,
|
|
40
|
-
|
|
40
|
+
if page_info&.start_cursor.nil?
|
|
41
|
+
{query: {after: page_info&.end_cursor}}
|
|
42
|
+
else
|
|
43
|
+
{query: {before: page_info&.start_cursor}}
|
|
44
|
+
end
|
|
41
45
|
)
|
|
42
46
|
@client.request(req)
|
|
43
47
|
end
|
|
@@ -113,7 +113,8 @@ module CheckoutIntents
|
|
|
113
113
|
else
|
|
114
114
|
Kernel.then do
|
|
115
115
|
value = @data.fetch(name_sym) { const == ::CheckoutIntents::Internal::OMIT ? nil : const }
|
|
116
|
-
|
|
116
|
+
converter = ::CheckoutIntents::Internal::Type::Converter
|
|
117
|
+
state = converter.new_coerce_state(translate_names: false)
|
|
117
118
|
if (nilable || !required) && value.nil?
|
|
118
119
|
nil
|
|
119
120
|
else
|
|
@@ -157,7 +157,8 @@ module CheckoutIntents
|
|
|
157
157
|
in Hash | nil => coerced
|
|
158
158
|
coerced
|
|
159
159
|
else
|
|
160
|
-
|
|
160
|
+
base_model = ::CheckoutIntents::Internal::Type::BaseModel
|
|
161
|
+
message = "Expected a #{Hash} or #{base_model}, got #{data.inspect}"
|
|
161
162
|
raise ArgumentError.new(message)
|
|
162
163
|
end
|
|
163
164
|
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
module CheckoutIntents
|
|
6
|
+
# @see ::CheckoutIntents::Resources::CheckoutIntents::Shipments#list
|
|
7
|
+
class ShipmentListParams < ::CheckoutIntents::Internal::Type::BaseModel
|
|
8
|
+
extend ::CheckoutIntents::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include ::CheckoutIntents::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute after
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :after, String
|
|
15
|
+
|
|
16
|
+
# @!attribute before
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :before, String
|
|
20
|
+
|
|
21
|
+
# @!attribute limit
|
|
22
|
+
#
|
|
23
|
+
# @return [Float, nil]
|
|
24
|
+
optional :limit, Float
|
|
25
|
+
|
|
26
|
+
# @!method initialize(after: nil, before: nil, limit: nil, request_options: {})
|
|
27
|
+
# @param after [String]
|
|
28
|
+
# @param before [String]
|
|
29
|
+
# @param limit [Float]
|
|
30
|
+
# @param request_options [::CheckoutIntents::RequestOptions, Hash{Symbol=>Object}]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|