easypost 7.0.1 → 7.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d64abe11f1d5f8e57a32b4f421e36a5e09560bbf40ecd089d17dfe4d7ca666d
4
- data.tar.gz: bd74b6576f7be7b710c75d3995313145a00d363b87328a22cdc392ec79a1f117
3
+ metadata.gz: a08cbfad9326fdf0e2071f10a725b1608c055169442c01623ef5518eb985a9b4
4
+ data.tar.gz: 5bfd2b54331d581c091cbff1d22ba770feaa2f30ac55988a295844b74e04252e
5
5
  SHA512:
6
- metadata.gz: fa064855f8c823989c16826785dba35b9ea50e5a67fd807c5e6092647452b0b9a030e49164be9daad347a816aaeb1b621079fcf23290db11f7954ef0ecc79435
7
- data.tar.gz: 8093c8bb9daacf509f0e8ba7ccd3bcd41c0fe34241e677fcfdca0d1dafc3d1c292151beaeafb83236c1cfdfeec61829380dbceea0a270ea33524c81d1975058d
6
+ metadata.gz: e919e31aa3ad7c7324c2b6eb7980e3a8b449a289fb19f535d7d7f109f3e647dfbcdfc8e9bebdc1ff87ea0501a5c9fe6455220425475e5b90c0d1f39279f2e827
7
+ data.tar.gz: dcbc7720b5b394cd5502694f9c09e3938cbd100f8e76582a26a4bc8edd11302d000a378d6295a7081828d8db65c76cca55a150b8c9c9721c60b5f3a901eea61b
data/.github/CODEOWNERS CHANGED
@@ -1,2 +1,7 @@
1
- # Ping the Shippers team for reviews on every PR
2
- * @EasyPost/team-shippers
1
+ ## These are the standard rules for all EasyPost public repositories.
2
+ ##
3
+
4
+ * @EasyPost/team-shippers @EasyPost/easypost-public-maintainers
5
+
6
+ # The devtools team owns the codeowners file, this is for auditing purposes
7
+ .github/CODEOWNERS @easypost/dev-tools
@@ -27,7 +27,7 @@ jobs:
27
27
  env:
28
28
  RUBYGEMS_API_KEY: '${{secrets.RUBYGEMS_API_KEY}}'
29
29
  - name: Upload assets to release
30
- uses: AButler/upload-release-assets@v3.0
30
+ uses: AButler/upload-release-assets@v3.0.1
31
31
  with:
32
32
  files: 'dist/*'
33
33
  repo-token: ${{ secrets.GITHUB_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v7.2.0 (2025-11-10)
4
+
5
+ - Adds support for `UspsShipAccount`
6
+ - Adds `tracker.retrieve_batch` function
7
+ - Adds `verify_carrier` address param
8
+
9
+ ## v7.1.0 (2025-06-18)
10
+
11
+ - Adds the following functions
12
+ - `shipment.create_and_buy_luma`
13
+ - `shipment.buy_luma`
14
+ - `luma.get_promise`
15
+
3
16
  ## v7.0.1 (2025-05-27)
4
17
 
5
18
  - Corrects the endpoint used for creating/updating UPS accounts
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.1
1
+ 7.2.0
@@ -48,6 +48,7 @@ class EasyPost::Client
48
48
  EasyPost::Services::EndShipper,
49
49
  EasyPost::Services::Event,
50
50
  EasyPost::Services::Insurance,
51
+ EasyPost::Services::Luma,
51
52
  EasyPost::Services::Order,
52
53
  EasyPost::Services::Parcel,
53
54
  EasyPost::Services::Pickup,
@@ -5,7 +5,7 @@ class EasyPost::Services::Address < EasyPost::Services::Service
5
5
 
6
6
  # Create an address.
7
7
  def create(params = {})
8
- address = params.reject { |k, _| [:verify, :verify_strict].include?(k) }
8
+ address = params.reject { |k, _| [:verify, :verify_strict, :verify_carrier].include?(k) }
9
9
 
10
10
  wrapped_params = { address: address }
11
11
 
@@ -17,6 +17,10 @@ class EasyPost::Services::Address < EasyPost::Services::Service
17
17
  wrapped_params[:verify_strict] = params[:verify_strict]
18
18
  end
19
19
 
20
+ if params[:verify_carrier]
21
+ wrapped_params[:verify_carrier] = params[:verify_carrier]
22
+ end
23
+
20
24
  response = @client.make_request(:post, 'addresses', params)
21
25
 
22
26
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
@@ -24,8 +28,13 @@ class EasyPost::Services::Address < EasyPost::Services::Service
24
28
 
25
29
  # Create and verify an Address in one call.
26
30
  def create_and_verify(params = {})
27
- wrapped_params = {}
28
- wrapped_params[:address] = params
31
+ address = params.reject { |k, _| [:verify_carrier].include?(k) }
32
+
33
+ wrapped_params = { address: address }
34
+
35
+ if params[:verify_carrier]
36
+ wrapped_params[:verify_carrier] = params[:verify_carrier]
37
+ end
29
38
 
30
39
  response = @client.make_request(:post, 'addresses/create_and_verify', wrapped_params)
31
40
 
@@ -4,7 +4,7 @@ class EasyPost::Services::CarrierAccount < EasyPost::Services::Service
4
4
  CUSTOM_WORKFLOW_CARRIER_TYPES = %w[FedexAccount FedexSmartpostAccount].freeze
5
5
  CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH = %w[
6
6
  AmazonShippingAccount UpsAccount UpsMailInnovationsAccount
7
- UpsSurepostAccount
7
+ UpsSurepostAccount UspsShipAccount
8
8
  ].freeze
9
9
  MODEL_CLASS = EasyPost::Models::CarrierAccount # :nodoc:
10
10
 
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EasyPost::Services::Luma < EasyPost::Services::Service
4
+ # Get service recommendations from Luma that meet the criteria of your ruleset.
5
+ def get_promise(params = {})
6
+ url = 'luma/promise'
7
+ wrapped_params = { shipment: params }
8
+ response = @client.make_request(:post, url, wrapped_params)
9
+
10
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response).luma_info
11
+ end
12
+ end
@@ -113,8 +113,8 @@ class EasyPost::Services::Shipment < EasyPost::Services::Service
113
113
  # Retrieves the estimated delivery date of each Rate via SmartRate.
114
114
  def retrieve_estimated_delivery_date(id, planned_ship_date)
115
115
  url = "shipments/#{id}/smartrate/delivery_date"
116
- params = { planned_ship_date: planned_ship_date }
117
- response = @client.make_request(:get, url, params)
116
+ wrapped_params = { planned_ship_date: planned_ship_date }
117
+ response = @client.make_request(:get, url, wrapped_params)
118
118
 
119
119
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS).rates
120
120
  end
@@ -122,9 +122,26 @@ class EasyPost::Services::Shipment < EasyPost::Services::Service
122
122
  # Retrieve a recommended ship date for an existing Shipment via the Precision Shipping API, based on a specific desired delivery date.
123
123
  def recommend_ship_date(id, desired_delivery_date)
124
124
  url = "shipments/#{id}/smartrate/precision_shipping"
125
- params = { desired_delivery_date: desired_delivery_date }
126
- response = @client.make_request(:get, url, params)
125
+ wrapped_params = { desired_delivery_date: desired_delivery_date }
126
+ response = @client.make_request(:get, url, wrapped_params)
127
127
 
128
128
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS).rates
129
129
  end
130
+
131
+ # Create and buy a Luma Shipment in one call.
132
+ def create_and_buy_luma(params = {})
133
+ url = 'shipments/luma'
134
+ wrapped_params = { shipment: params }
135
+ response = @client.make_request(:post, url, wrapped_params)
136
+
137
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
138
+ end
139
+
140
+ # Buy a Shipment with Luma.
141
+ def buy_luma(id, params = {})
142
+ url = "shipments/#{id}/luma"
143
+ response = @client.make_request(:post, url, params)
144
+
145
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
146
+ end
130
147
  end
@@ -29,6 +29,13 @@ class EasyPost::Services::Tracker < EasyPost::Services::Service
29
29
  get_all_helper('trackers', MODEL_CLASS, params, filters)
30
30
  end
31
31
 
32
+ # Retrieve a batch of Trackers
33
+ def retrieve_batch(params = {})
34
+ response = @client.make_request(:post, 'trackers/batch', params)
35
+
36
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
37
+ end
38
+
32
39
  # Get the next page of trackers.
33
40
  def get_next_page(collection, page_size = nil)
34
41
  raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection)
@@ -20,6 +20,7 @@ require_relative 'services/customs_item'
20
20
  require_relative 'services/end_shipper'
21
21
  require_relative 'services/event'
22
22
  require_relative 'services/insurance'
23
+ require_relative 'services/luma'
23
24
  require_relative 'services/order'
24
25
  require_relative 'services/parcel'
25
26
  require_relative 'services/pickup'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - EasyPost Developers
@@ -341,6 +341,7 @@ files:
341
341
  - lib/easypost/services/end_shipper.rb
342
342
  - lib/easypost/services/event.rb
343
343
  - lib/easypost/services/insurance.rb
344
+ - lib/easypost/services/luma.rb
344
345
  - lib/easypost/services/order.rb
345
346
  - lib/easypost/services/parcel.rb
346
347
  - lib/easypost/services/pickup.rb
@@ -378,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
379
  - !ruby/object:Gem::Version
379
380
  version: '0'
380
381
  requirements: []
381
- rubygems_version: 3.6.7
382
+ rubygems_version: 3.6.9
382
383
  specification_version: 4
383
384
  summary: EasyPost Ruby Client Library
384
385
  test_files: []