muffin_man 2.0.5 → 2.1.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: b20bd7372fb78d4918fb05ec2ff20476211daa573a36394f4b491edc2d150510
4
- data.tar.gz: 01a0ff848f35f0a4a8bf871b244de2ff6b3a3f8be8e368c9c00e2652663e134c
3
+ metadata.gz: 42d41a72e708c859b3fba7fd92fdcae714730a8bb959d543cc74c1c44bbaa7a8
4
+ data.tar.gz: 66c384cee7964c5041528132e822feda6e4bc32324bfa441499f4e031e1abf5c
5
5
  SHA512:
6
- metadata.gz: 809d74bca2430ea7c2608d48b1eeaa78ad23096382767bf745c6221ab1f07845961a17c22739a53a2cf23cdbf1eaeb5c5f184e029331030b671c24b84738ee41
7
- data.tar.gz: aed350969ba049588093fee9ff83527c052161a7f28d1dec3c357cc54c9415993e66c7895386910242e7e5fce7ed3ec47f004b5899fc93c7a1d2b2f4655d9939
6
+ metadata.gz: 2dcafda67c6adb2230feb4e71dc5120f5d26ed268b4165aa5e0cbf72782bdfb1d0a48950679b7bd6756ee2c784f0111cecc0b077eeac21ffd7911b2dfb9c4eb6
7
+ data.tar.gz: 4df599f9720c61ceba199a64f2a8f63dd3fb9d80a7722686bb719ea31d30612f65292eb5b25b62a005fc4afec2ca49415bf68df72b91ed2793bb5c41a3e55b42
data/.rubocop_todo.yml CHANGED
@@ -255,7 +255,6 @@ RSpec/FilePath:
255
255
  - 'spec/muffin_man/solicitations_spec.rb'
256
256
  - 'spec/muffin_man/tokens_spec.rb'
257
257
 
258
-
259
258
  # Offense count: 15
260
259
  # This cop supports safe autocorrection (--autocorrect).
261
260
  RSpec/LeadingSubject:
@@ -363,7 +362,6 @@ Style/FrozenStringLiteralComment:
363
362
  - 'spec/muffin_man/finances_spec.rb'
364
363
  - 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
365
364
  - 'spec/muffin_man/fulfillment_inbound/v1_spec.rb'
366
- - 'spec/muffin_man/listings_spec.rb'
367
365
  - 'spec/muffin_man/lwa_spec.rb'
368
366
  - 'spec/muffin_man/orders_spec.rb'
369
367
  - 'spec/muffin_man/product_fees_spec.rb'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 2.1.0 [#58](https://github.com/patterninc/muffin_man/pull/58)
2
+
3
+ - Support for Product Type Definitions
4
+
5
+ # 2.0.6 [#54](https://github.com/patterninc/muffin_man/pull/54)
6
+
7
+ - Support for getOrder
8
+
1
9
  # 2.0.5 [#53](https://github.com/patterninc/muffin_man/pull/53)
2
10
 
3
11
  - Fix for files auto-unzipping from GZIP now
data/Gemfile CHANGED
@@ -13,4 +13,4 @@ gem "rubocop", "<= 1.43"
13
13
 
14
14
  gem "rubocop-rake"
15
15
 
16
- gem "rubocop-rspec"
16
+ gem "rubocop-rspec", "<=2.20"
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module Listings
5
+ class V20200901 < SpApiClient
6
+ REQUIREMENTS = %w[LISTING LISTING_PRODUCT_ONLY LISTING_OFFER_ONLY].freeze
7
+ REQUIREMENTS_ENFORCED = %w[ENFORCED NOT_ENFORCED].freeze
8
+ LOCALE = %w[DEFAULT ar ar_AE de de_DE en en_AE en_AU en_CA en_GB en_IN en_SG en_US es es_ES es_MX es_US fr
9
+ fr_CA fr_FR it it_IT ja ja_JP nl nl_NL pl pl_PL pt pt_BR pt_PT sv sv_SE tr tr_TR zh zh_CN zh_TW]
10
+ .freeze
11
+ PRODUCT_TYPES_PATH = "/definitions/2020-09-01/productTypes"
12
+
13
+ def search_definitions_product_types(marketplace_ids, keywords = nil)
14
+ @local_var_path = PRODUCT_TYPES_PATH
15
+ @marketplace_ids = marketplace_ids.is_a?(Array) ? marketplace_ids : [marketplace_ids]
16
+ @query_params = { "marketplaceIds" => @marketplace_ids.join(",") }
17
+ @query_params["keywords"] = keywords if keywords.present?
18
+ @request_type = "GET"
19
+ call_api
20
+ end
21
+
22
+ # rubocop:disable Metrics/CyclomaticComplexity
23
+ # rubocop:disable Metrics/PerceivedComplexity
24
+ def get_definitions_product_type(product_type, marketplace_ids, options = {})
25
+ options = options.with_indifferent_access
26
+ @local_var_path = "#{PRODUCT_TYPES_PATH}/#{product_type}"
27
+ @marketplace_ids = marketplace_ids.is_a?(Array) ? marketplace_ids : [marketplace_ids]
28
+ @query_params = { "marketplaceIds" => @marketplace_ids.join(",") }
29
+ @query_params["sellerId"] = options["sellerId"] if options["sellerId"]
30
+ @query_params["productTypeVersion"] = options["productTypeVersion"].upcase if options["productTypeVersion"]
31
+ if REQUIREMENTS.include?(options["requirements"]&.upcase)
32
+ @query_params["requirements"] = options["requirements"].upcase
33
+ end
34
+
35
+ if REQUIREMENTS_ENFORCED.include?(options["requirementsEnforced"]&.upcase)
36
+ @query_params["requirementsEnforced"] = options["requirementsEnforced"].upcase
37
+ end
38
+
39
+ @query_params["locale"] = options["locale"] if LOCALE.include?(options["locale"])
40
+
41
+ @request_type = "GET"
42
+ call_api
43
+ end
44
+ # rubocop:enable Metrics/CyclomaticComplexity
45
+ # rubocop:enable Metrics/PerceivedComplexity
46
+ end
47
+ end
48
+ end
@@ -38,6 +38,12 @@ module MuffinMan
38
38
  call_api
39
39
  end
40
40
 
41
+ def get_order(order_id)
42
+ @local_var_path = "/orders/v0/orders/#{order_id}"
43
+ @request_type = "GET"
44
+ call_api
45
+ end
46
+
41
47
  def get_order_items(order_id, params = {})
42
48
  @query_params = params.slice(*GET_ORDER_ITEMS_PARAMS)
43
49
  @local_var_path = "/orders/v0/orders/#{order_id}/orderItems"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "2.0.5"
4
+ VERSION = "2.1.0"
5
5
  end
data/lib/muffin_man.rb CHANGED
@@ -12,6 +12,7 @@ require "muffin_man/authorization/v1"
12
12
  require "muffin_man/tokens/v20210301"
13
13
  require "muffin_man/product_pricing/v0"
14
14
  require "muffin_man/listings/v20210801"
15
+ require "muffin_man/listings/v20200901"
15
16
  require "muffin_man/fulfillment_inbound/v0"
16
17
  require "muffin_man/fulfillment_inbound/v1"
17
18
  require "muffin_man/fulfillment_outbound/v20200701"
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin
8
8
  - Jason
9
9
  - Nate
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-06-22 00:00:00.000000000 Z
13
+ date: 2023-09-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -130,7 +130,7 @@ dependencies:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
- description:
133
+ description:
134
134
  email:
135
135
  - gavin@pattern.com
136
136
  - jason@pattern.com
@@ -163,6 +163,7 @@ files:
163
163
  - lib/muffin_man/fulfillment_inbound/v0.rb
164
164
  - lib/muffin_man/fulfillment_inbound/v1.rb
165
165
  - lib/muffin_man/fulfillment_outbound/v20200701.rb
166
+ - lib/muffin_man/listings/v20200901.rb
166
167
  - lib/muffin_man/listings/v20210801.rb
167
168
  - lib/muffin_man/lwa/auth_helper.rb
168
169
  - lib/muffin_man/merchant_fulfillment/v0.rb
@@ -190,7 +191,7 @@ homepage: https://github.com/patterninc/muffin_man
190
191
  licenses:
191
192
  - MIT
192
193
  metadata: {}
193
- post_install_message:
194
+ post_install_message:
194
195
  rdoc_options: []
195
196
  require_paths:
196
197
  - lib
@@ -205,8 +206,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
206
  - !ruby/object:Gem::Version
206
207
  version: '0'
207
208
  requirements: []
208
- rubygems_version: 3.1.6
209
- signing_key:
209
+ rubygems_version: 3.0.3
210
+ signing_key:
210
211
  specification_version: 4
211
212
  summary: Amazon Selling Partner API client
212
213
  test_files: []