muffin_man 2.0.6 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d0cac4283872c9438e32917662f5c85654409bf8cea874a12eefc2b3106908e
4
- data.tar.gz: c2108cb8339b7c7ad472f441c24ba1ad193bc2d73225e48a4b0cb779c122fc8a
3
+ metadata.gz: 42d41a72e708c859b3fba7fd92fdcae714730a8bb959d543cc74c1c44bbaa7a8
4
+ data.tar.gz: 66c384cee7964c5041528132e822feda6e4bc32324bfa441499f4e031e1abf5c
5
5
  SHA512:
6
- metadata.gz: 494fb99a4e25b8519d993a14e2e005e9347497b1a277a5e715f99d3ca5c111f44dc55e492dbb63f7be33873923f797aa7fb5b9ec2ca2db69fcf97d6d94c4be1d
7
- data.tar.gz: f048455b4e557c6fa6a585ab711cb445b9de6927b6e14844aaa9ab9ff005f037524192339db3a773d21645b7aa7cc576e0cb420398af0c81cb086eded59cbe8c
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,7 @@
1
+ # 2.1.0 [#58](https://github.com/patterninc/muffin_man/pull/58)
2
+
3
+ - Support for Product Type Definitions
4
+
1
5
  # 2.0.6 [#54](https://github.com/patterninc/muffin_man/pull/54)
2
6
 
3
7
  - Support for getOrder
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "2.0.6"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.1.0
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: 2023-06-28 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
@@ -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