muffin_man 1.5.3 → 1.5.5

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: a65842148ee282b6d12a552b0c55495a445b183e5a7e5c38a7418de04992f999
4
- data.tar.gz: 383a57d029e7f7938d451698a69a60b808f6fccc9fab074fa0e2d710df3acd2a
3
+ metadata.gz: 716ae095452a690d2761727c60d898d0c7af55a625e46fa3dd3d5db3a4f97328
4
+ data.tar.gz: e8e063861f9b8c83bd6f374c414434d8d6f0c9846f11f6b956e6d0ec72342060
5
5
  SHA512:
6
- metadata.gz: 7993f0f6103ab852b70a457a4b5d29b028e40a3b53c98c169a28336653035dbb70ebdb988000fb6df04595362257924164b63a1cc2e0ea76dc1ba201c8a57245
7
- data.tar.gz: 8f7ccf13026f77ea995fabf36d0c753714daea1ccfdfee63276a17693e86ed8d25466246a00017832050915ada192fa4dfd677d342cbcee1c88d5afeafa029e1
6
+ metadata.gz: 5f58612faf463c8b59e226d43cf680870c4317a5dcf6965fb205b0643b856297d909ffc14c7f8ec28b09818643d7ef79aa6b29b3804de7c244ff36f39c1db6dd
7
+ data.tar.gz: 8c66b92310f5bc1dd5667a1f65c3fd95ba14e0e12df82f8d33567c761eea35bc3bfad5bcc989cf00945aae5297ab08b8d4eee79cf8b5cf5d4a40f10ae2cb39a8
data/.rubocop.yml CHANGED
@@ -31,6 +31,9 @@ Metrics/BlockLength:
31
31
  Metrics/AbcSize:
32
32
  Enabled: false
33
33
 
34
+ Metrics/ParameterLists:
35
+ Enabled: false
36
+
34
37
  Style/Documentation:
35
38
  Enabled: false
36
39
 
@@ -44,4 +47,4 @@ RSpec/MultipleMemoizedHelpers:
44
47
  Enabled: false
45
48
 
46
49
  RSpec/MultipleExpectations:
47
- Enabled: false
50
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,10 +1,15 @@
1
- # Unreleased
1
+ # 1.5.5
2
2
 
3
- - Support for getInventorySummaries [#36](https://github.com/patterninc/muffin_man/pull/36)
3
+ - Support for Merchant Fulfillment [#41](https://github.com/patterninc/muffin_man/pull/41)
4
+
5
+ # 1.5.4
6
+
7
+ - Fix to format create outbound fulfillment request [#40](https://github.com/patterninc/muffin_man/pull/40)
4
8
 
5
9
  # 1.5.3
6
10
 
7
- - Support for Fulfillment Outbound [#34](https://github.com/patterninc/muffin_man/pull/34)
11
+ - Support for getInventorySummaries [#36](https://github.com/patterninc/muffin_man/pull/36)
12
+ - Support for Fulfillment Outbound [#34](https://github.com/patterninc/muffin_man/pull/34)
8
13
 
9
14
  # 1.5.2
10
15
 
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module MerchantFulfillment
5
+ class V0 < SpApiClient
6
+ def get_eligible_shipment_services(shipment_request_details, shipping_offering_filter = {})
7
+ @local_var_path = "/mfn/v0/eligibleShippingServices"
8
+ @request_body = {
9
+ "ShipmentRequestDetails" => shipment_request_details
10
+ }
11
+ @request_body["ShippingOfferingFilter"] = shipping_offering_filter unless shipping_offering_filter.empty?
12
+ @request_type = "POST"
13
+ call_api
14
+ end
15
+
16
+ def get_shipment(shipment_id)
17
+ @local_var_path = "/mfn/v0/shipments/#{shipment_id}"
18
+ @request_type = "GET"
19
+ call_api
20
+ end
21
+
22
+ def cancel_shipment(shipment_id)
23
+ @local_var_path = "/mfn/v0/shipments/#{shipment_id}"
24
+ @request_type = "DELETE"
25
+ call_api
26
+ end
27
+
28
+ def create_shipment(shipment_request_details, shipping_service_id,
29
+ shipping_service_offering_id: nil, hazmat_type: nil, label_format_option: {},
30
+ shipment_level_seller_inputs_list: [])
31
+ @local_var_path = "/mfn/v0/shipments"
32
+ @request_body = {
33
+ "ShipmentRequestDetails" => shipment_request_details,
34
+ "ShippingServiceId" => shipping_service_id
35
+ }
36
+ @request_body["ShippingServiceOfferId"] = shipping_service_offering_id unless shipping_service_offering_id.nil?
37
+ @request_body["HazmatType"] = hazmat_type unless hazmat_type.nil?
38
+ @request_body["LabelFormatOption"] = label_format_option unless label_format_option.empty?
39
+ if shipment_level_seller_inputs_list.any?
40
+ @request_body["ShipmentLevelSellerInputsList"] = shipment_level_seller_inputs_list
41
+ end
42
+ @request_type = "POST"
43
+ call_api
44
+ end
45
+
46
+ def get_additional_seller_inputs(shipping_service_id, ship_from_address, order_id)
47
+ @local_var_path = "/mfn/v0/additionalSellerInputs"
48
+ @request_body = {
49
+ "ShippingServiceId" => shipping_service_id,
50
+ "ShipFromAddress" => ship_from_address,
51
+ "OrderId" => order_id
52
+ }
53
+ @request_type = "POST"
54
+ call_api
55
+ end
56
+ end
57
+ end
58
+ end
@@ -28,7 +28,6 @@ module MuffinMan
28
28
  # @param [MuffinMan::RequestHelpers::OutboundFulfillment::Address] destination_address in form of object
29
29
  # @param [MuffinMan::RequestHelpers::OutboundFulfillment::Item] items in the form of list of items objects
30
30
  # @param [Hash] optional_params optional sp-api attributes in the form of hash
31
- # rubocop:disable Metrics/ParameterLists
32
31
  def initialize(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time,
33
32
  displayable_order_comment, shipping_speed_category, destination_address, items,
34
33
  optional_params = {})
@@ -42,7 +41,6 @@ module MuffinMan
42
41
  @items = items
43
42
  @optional_params = optional_params
44
43
  end
45
- # rubocop:enable Metrics/ParameterLists
46
44
 
47
45
  # Check to see if the all the properties in the model are valid
48
46
  # @return true if the model is valid
@@ -94,7 +92,7 @@ module MuffinMan
94
92
  "displayableOrderDate" => displayable_order_date_time,
95
93
  "displayableOrderComment" => displayable_order_comment,
96
94
  "shippingSpeedCategory" => shipping_speed_category,
97
- "destinationAddress" => destination_address,
95
+ "destinationAddress" => destination_address.to_camelize,
98
96
  "items" => items.map(&:to_camelize)
99
97
  }.merge!(optional_params.slice(*OPTIONAL_CREATE_FULFILLMENT_ORDER_PARAMS))
100
98
  end
@@ -21,7 +21,6 @@ module MuffinMan
21
21
  }.merge(optional_params))
22
22
  end
23
23
 
24
- # rubocop:disable Metrics/ParameterLists
25
24
  def self.fulfillment_order_request(seller_fulfillment_order_id, displayable_order_id,
26
25
  displayable_order_date_time,
27
26
  displayable_order_comment, shipping_speed_category,
@@ -30,7 +29,6 @@ module MuffinMan
30
29
  displayable_order_comment, shipping_speed_category, destination_address,
31
30
  items, optional_params)
32
31
  end
33
- # rubocop:enable Metrics/ParameterLists
34
32
 
35
33
  def self.fulfillment_preview_request(address, items, optional_params = {})
36
34
  FulfillmentPreviewRequest.new(address, items, optional_params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "1.5.3"
4
+ VERSION = "1.5.5"
5
5
  end
data/lib/muffin_man.rb CHANGED
@@ -19,6 +19,7 @@ require "muffin_man/fba_inventory/v1"
19
19
  require "muffin_man/request_helpers"
20
20
  require "muffin_man/feeds/v20210630"
21
21
  require "muffin_man/notifications/v1"
22
+ require "muffin_man/merchant_fulfillment/v0"
22
23
 
23
24
  module MuffinMan
24
25
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-11-02 00:00:00.000000000 Z
13
+ date: 2022-11-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -165,6 +165,7 @@ files:
165
165
  - lib/muffin_man/fulfillment_outbound/v20200701.rb
166
166
  - lib/muffin_man/listings/v20210801.rb
167
167
  - lib/muffin_man/lwa/auth_helper.rb
168
+ - lib/muffin_man/merchant_fulfillment/v0.rb
168
169
  - lib/muffin_man/notifications/v1.rb
169
170
  - lib/muffin_man/orders/v0.rb
170
171
  - lib/muffin_man/product_fees/v0.rb