muffin_man 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +32 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -1
- data/LICENSE.txt +1 -1
- data/lib/muffin_man/v20201201/catalog_items.rb +56 -0
- data/lib/muffin_man/version.rb +1 -1
- data/lib/muffin_man.rb +1 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1b217205a970848a9dc08eea1daf04d52da4d5970bff2a00f0041867c320837
|
4
|
+
data.tar.gz: d7df1a7bd5738e336380d3ce6c17df85610d36498997374b2f5e34061a17cf69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d9be6ff3849a9a45ef506e90c4a13d407aeef6ea8f7e84cf1f3c30d4384e451e70ca704f1d7ffb5f621b5bfa0fed4c058a7dabdffdae35c2019c7a545b2914
|
7
|
+
data.tar.gz: 7d7696a4e3e9400471e0444b5864592dd0f5297ad1733b51a51bfbe5253564059d5397489acb0f53d7529611bd778cab1d6206eeab4606d39b8f0bc779703434
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Ruby CI
|
2
|
+
|
3
|
+
# Controls when the workflow will run
|
4
|
+
on:
|
5
|
+
# Triggers the workflow on push or pull request events but only for the master branch
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- 'master'
|
9
|
+
pull_request:
|
10
|
+
branches:
|
11
|
+
- 'master'
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
ci-build:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
ruby-version: [2.7, 2.6, 2.5]
|
20
|
+
|
21
|
+
# Check-out repo
|
22
|
+
steps:
|
23
|
+
- name: Checkout
|
24
|
+
uses: actions/checkout@v2
|
25
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
29
|
+
- name: Install dependencies
|
30
|
+
run: bundle install
|
31
|
+
- name: Run RSpec
|
32
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/LICENSE.txt
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
module MuffinMan
|
2
|
+
module V20201201
|
3
|
+
class CatalogItems < SpApiClient
|
4
|
+
SANDBOX_KEYWORDS = "shoes".freeze
|
5
|
+
SANDBOX_ASIN = "B07N4M94X4".freeze
|
6
|
+
SANDBOX_MARKETPLACE_IDS = "ATVPDKIKX0DER".freeze
|
7
|
+
attr_reader :keywords, :asin, :marketplace_ids, :params
|
8
|
+
|
9
|
+
SEARCH_CATALOG_ITEMS_PARAMS = %w[
|
10
|
+
includedData
|
11
|
+
brandNames
|
12
|
+
classificationIds
|
13
|
+
pageSize
|
14
|
+
pageToken
|
15
|
+
keywordsLocale
|
16
|
+
locale
|
17
|
+
].freeze
|
18
|
+
GET_CATALOG_ITEM_PARAMS = %w[includeData locale].freeze
|
19
|
+
|
20
|
+
def search_catalog_items(keywords, marketplace_ids, params = {})
|
21
|
+
if sandbox
|
22
|
+
keywords = SANDBOX_KEYWORDS
|
23
|
+
marketplace_ids = SANDBOX_MARKETPLACE_IDS
|
24
|
+
params = {}
|
25
|
+
end
|
26
|
+
@keywords = keywords.is_a?(Array) ? keywords : [keywords]
|
27
|
+
@marketplace_ids = marketplace_ids.is_a?(Array) ? marketplace_ids : [marketplace_ids]
|
28
|
+
@params = params
|
29
|
+
@local_var_path = "/catalog/2020-12-01/items"
|
30
|
+
@query_params = {
|
31
|
+
"keywords" => @keywords.join(","),
|
32
|
+
"marketplaceIds" => @marketplace_ids.join(",")
|
33
|
+
}
|
34
|
+
@query_params.merge!(@params.slice(*SEARCH_CATALOG_ITEMS_PARAMS))
|
35
|
+
@request_type = "GET"
|
36
|
+
call_api
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_catalog_item(asin, marketplace_ids, params = {})
|
40
|
+
if sandbox
|
41
|
+
asin = SANDBOX_ASIN
|
42
|
+
marketplace_ids = SANDBOX_MARKETPLACE_IDS
|
43
|
+
params = {}
|
44
|
+
end
|
45
|
+
@asin = asin
|
46
|
+
@marketplace_ids = marketplace_ids.is_a?(Array) ? marketplace_ids : [marketplace_ids]
|
47
|
+
@params = params
|
48
|
+
@local_var_path = "/catalog/2020-12-01/items/#{@asin}"
|
49
|
+
@query_params = { "marketplaceIds" => @marketplace_ids.join(",") }
|
50
|
+
@query_params.merge!(@params.slice(*GET_CATALOG_ITEM_PARAMS))
|
51
|
+
@request_type = "GET"
|
52
|
+
call_api
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/muffin_man/version.rb
CHANGED
data/lib/muffin_man.rb
CHANGED
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: 0.
|
4
|
+
version: 0.2.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:
|
13
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -102,7 +102,7 @@ dependencies:
|
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: 2.4.4
|
105
|
-
description:
|
105
|
+
description:
|
106
106
|
email:
|
107
107
|
- gavin@pattern.com
|
108
108
|
- jason@pattern.com
|
@@ -112,6 +112,7 @@ extensions: []
|
|
112
112
|
extra_rdoc_files: []
|
113
113
|
files:
|
114
114
|
- ".circleci/config.yml"
|
115
|
+
- ".github/workflows/ci.yml"
|
115
116
|
- ".gitignore"
|
116
117
|
- ".rspec"
|
117
118
|
- ".rubocop.yml"
|
@@ -126,13 +127,14 @@ files:
|
|
126
127
|
- lib/muffin_man/reports.rb
|
127
128
|
- lib/muffin_man/solicitations.rb
|
128
129
|
- lib/muffin_man/sp_api_client.rb
|
130
|
+
- lib/muffin_man/v20201201/catalog_items.rb
|
129
131
|
- lib/muffin_man/version.rb
|
130
132
|
- muffin_man.gemspec
|
131
133
|
homepage: https://github.com/patterninc/muffin_man
|
132
134
|
licenses:
|
133
135
|
- MIT
|
134
136
|
metadata: {}
|
135
|
-
post_install_message:
|
137
|
+
post_install_message:
|
136
138
|
rdoc_options: []
|
137
139
|
require_paths:
|
138
140
|
- lib
|
@@ -147,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
149
|
- !ruby/object:Gem::Version
|
148
150
|
version: '0'
|
149
151
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
152
|
+
rubygems_version: 3.1.6
|
153
|
+
signing_key:
|
152
154
|
specification_version: 4
|
153
155
|
summary: Amazon Selling Partner API client
|
154
156
|
test_files: []
|