hubrise_client 2.0.15 → 2.0.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b05c00e55ba2498337eacf6f67d8d8e4c56a48d41c7bdb280dd475219efff7c6
4
- data.tar.gz: '079dc44ad7cd1728fbf50fe5c8a6226d78615a8738a01655fe23e9ba8f5af056'
3
+ metadata.gz: 5a5efc4d9d115b36d1644adbdb7760808eed52c6532272520bbed995e0a18425
4
+ data.tar.gz: 3a930aec0a980055b08694c3af4e76db5f5a477dd3d0cd46aae4e8fe55b54172
5
5
  SHA512:
6
- metadata.gz: 25477048e5358e52ed29bc5a32294dbfad3c9a703388bb8a5fa698c64fcc3a236596d0c1e70fe7f7c22217322ab6ce52881c35ade25b062599229d5828ef5a8c
7
- data.tar.gz: 1e51ad7068e667ed17640456e80d6ecf3802bb7d1904ac6d0860f2f33a1a0939ef9654c81bbd4f5eb6f1f1808e8ceb98e38ab9f19d6a2977d8079303b3d92596
6
+ metadata.gz: 7d184e875c81ef04dcf3d839afbe07345011eb01ac2705c4ccb9f8ae6ee2362bba6159b2e00cf7c170b8af755b78bab3aeba72e8df0c7f117b9d5d262c56fa1a
7
+ data.tar.gz: 718bffe6ff5551ea8b011922ae194d63831a513130b24a7bf9266ee8354117f5d92488ce17f5f2d7da278a3ca61a24883491e55b5ee13bd0e02440b594a9d956
data/README.md CHANGED
@@ -115,7 +115,7 @@ bundle exec rspec
115
115
  3. Tag the repository:
116
116
 
117
117
  ```bash
118
- VERSION=2.0.9
118
+ VERSION=2.0.16
119
119
  git add lib/hubrise_client/version.rb
120
120
  git commit -m "Version $VERSION"
121
121
  git tag v$VERSION
data/V1_ENDPOINTS.md CHANGED
@@ -119,6 +119,38 @@ client = HubriseClient::V1.new(CLIENT_ID, CLIENT_SECRET, client_attrs)
119
119
  # [PATCH] /locations/locationIdX/orders/orderIdX/delivery with { headers: { "Content-Type": "application/json" }, body: "{\"status\":\"delivered\" }" }
120
120
  ```
121
121
 
122
+ ### GET_DELIVERY_QUOTES
123
+
124
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
125
+ ```ruby
126
+ client.get_delivery_quotes("locationIdX", "orderIdX")
127
+ # [GET] /locations/locationIdX/orders/orderIdX/delivery_quotes with { headers: { "X-Access-Token": "accessTokenX" }}
128
+ ```
129
+
130
+ ### GET_DELIVERY_QUOTE
131
+
132
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
133
+ ```ruby
134
+ client.get_delivery_quote("locationIdX", "orderIdX", "quoteIdX")
135
+ # [GET] /locations/locationIdX/orders/orderIdX/delivery_quotes/quoteIdX with { headers: { "X-Access-Token": "accessTokenX" }}
136
+ ```
137
+
138
+ ### CREATE_DELIVERY_QUOTE
139
+
140
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
141
+ ```ruby
142
+ client.create_delivery_quote("locationIdX", "orderIdX", { carrier: "UPS" })
143
+ # [POST] /locations/locationIdX/orders/orderIdX/delivery_quotes with { headers: { "Content-Type": "application/json" }, body: "{\"carrier\":\"UPS\" }" }
144
+ ```
145
+
146
+ ### ACCEPT_DELIVERY_QUOTE
147
+
148
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
149
+ ```ruby
150
+ client.accept_delivery_quote("locationIdX", "orderIdX", "quoteIdX")
151
+ # [POST] /locations/locationIdX/orders/orderIdX/delivery_quotes/quoteIdX/accept with { headers: { "X-Access-Token": "accessTokenX" }}
152
+ ```
153
+
122
154
  ### GET_CALLBACK
123
155
 
124
156
  - Initialized with `client_attrs = { access_token: "accessTokenX" }`
@@ -38,8 +38,8 @@ module HubriseClient
38
38
 
39
39
  def build_authorization_url(redirect_uri, scope, params = {})
40
40
  params = params.merge(
41
- redirect_uri: redirect_uri,
42
- scope: scope,
41
+ redirect_uri:,
42
+ scope:,
43
43
  client_id: @app_id
44
44
  )
45
45
 
@@ -83,9 +83,9 @@ module HubriseClient
83
83
  raise(HubriseAccessTokenMissing) if @access_token.nil?
84
84
 
85
85
  api_request(
86
- "#{@api_host}:#{@api_port}/#{version}", path, method, data: data,
87
- json: json,
88
- headers: headers,
86
+ "#{@api_host}:#{@api_port}/#{version}", path, method, data:,
87
+ json:,
88
+ headers:,
89
89
  access_token: @access_token,
90
90
  callback: @request_callback
91
91
  ).perform
@@ -94,9 +94,9 @@ module HubriseClient
94
94
  def api_request(hostname, path, method, attrs = {})
95
95
  Request.from_h(
96
96
  {
97
- hostname: hostname,
98
- path: path,
99
- method: method,
97
+ hostname:,
98
+ path:,
99
+ method:,
100
100
  use_https: @use_https,
101
101
  logger: @verbous && @logger,
102
102
  json: true,
@@ -83,6 +83,25 @@ module HubriseClient
83
83
  call_api("/locations/#{location_id}/orders/#{order_id}/delivery", :patch, data: params)
84
84
  end
85
85
 
86
+ # --------------------
87
+ # Delivery quotes
88
+ # --------------------
89
+ def get_delivery_quotes(location_id, order_id)
90
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes")
91
+ end
92
+
93
+ def get_delivery_quote(location_id, order_id, quote_id)
94
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes/#{quote_id}")
95
+ end
96
+
97
+ def create_delivery_quote(location_id, order_id, params)
98
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes", :post, data: params)
99
+ end
100
+
101
+ def accept_delivery_quote(location_id, order_id, quote_id)
102
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes/#{quote_id}/accept", :post)
103
+ end
104
+
86
105
  # --------------------
87
106
  # Callback, events
88
107
  # --------------------
@@ -180,7 +199,7 @@ module HubriseClient
180
199
  def create_image(data, mime_type, catalog_id = nil, options = {})
181
200
  path = "/catalogs/#{catalog_id_fallback(catalog_id)}/images"
182
201
  path += "?private_ref=#{CGI.escape(options[:private_ref])}" if options[:private_ref]
183
- call_api(path, :post, data: data, headers: { "Content-Type" => mime_type }, json: false)
202
+ call_api(path, :post, data:, headers: { "Content-Type" => mime_type }, json: false)
184
203
  end
185
204
 
186
205
  def get_images(catalog_id = nil)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module HubriseClient
3
- VERSION = "2.0.15"
3
+ VERSION = "2.0.16"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubrise_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.15
4
+ version: 2.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Monnier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-06-12 00:00:00.000000000 Z
12
+ date: 2025-09-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -39,14 +39,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 2.7.7
42
+ version: 3.1.4
43
43
  required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.4.20
49
+ rubygems_version: 3.3.26
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: HubRise Ruby client