muffin_man 2.1.2 → 2.2.1
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -0
- data/lib/muffin_man/awd/v20240509.rb +15 -0
- data/lib/muffin_man/data_kiosk/v20231115.rb +91 -0
- data/lib/muffin_man/fulfillment_inbound/v20240320.rb +42 -0
- data/lib/muffin_man/sp_api_client.rb +1 -1
- data/lib/muffin_man/version.rb +1 -1
- data/lib/muffin_man.rb +3 -0
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ec853c9c790152131d186d3b30b660f0f688fc390383183be87be38944f377
|
4
|
+
data.tar.gz: 5e7e4f2ae5af32e5abbd7fc4a6da0d84c5ac9e9f2ffd3f6a5b1ea5931d413918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c708c548584bb883bce5663dc80f9aff62170cfbfcf4ea5f299acf0b98c12ae26a5dcfd35312b85561beb2dfec4059923e5755851225774d86c61a6b5793f507
|
7
|
+
data.tar.gz: ec33e1214dd886a96fcf953391655596e160f6d0c8f69a439acf47fb3e5f2de44a0eb3a5b0d412f95bff5361afd2f1a92e054592b413fbd8fbf3eb93636c4acc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 2.2.0 [#66](https://github.com/patterninc/muffin_man/pull/66)
|
2
|
+
|
3
|
+
- Support for Data Kiosk API v2023-11-15
|
4
|
+
|
5
|
+
# 2.1.3
|
6
|
+
|
7
|
+
- Support for AWD getInboundShipment [#64](https://github.com/patterninc/muffin_man/pull/64)
|
8
|
+
|
1
9
|
# 2.1.2 [#63](https://github.com/patterninc/muffin_man/pull/63)
|
2
10
|
|
3
11
|
- Support for patchListingsItem
|
data/README.md
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MuffinMan
|
4
|
+
module Awd
|
5
|
+
class V20240509 < SpApiClient
|
6
|
+
AWD_PATH = "/awd/2024-05-09"
|
7
|
+
|
8
|
+
def get_inbound_shipment(shipment_id)
|
9
|
+
@local_var_path = "#{AWD_PATH}/inboundShipments/#{shipment_id}"
|
10
|
+
@request_type = "GET"
|
11
|
+
call_api
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MuffinMan
|
4
|
+
module DataKiosk
|
5
|
+
class V20231115 < SpApiClient
|
6
|
+
SANDBOX_PAGE_SIZE = 1
|
7
|
+
SANDBOX_PROCESSING_STATUSES = "DONE, IN_PROGRESS"
|
8
|
+
SANDBOX_QUERY = <<-QUERY
|
9
|
+
query {
|
10
|
+
sampleQuery(
|
11
|
+
startDate: "2023-03-01"
|
12
|
+
endDate: "2023-03-31"
|
13
|
+
marketplaceIds: ["ATVPDKIKX0DER"]
|
14
|
+
) {
|
15
|
+
sales {
|
16
|
+
date
|
17
|
+
averageSellingPrice {
|
18
|
+
amount
|
19
|
+
currencyCode
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
QUERY
|
25
|
+
SANDBOX_QUERY_ID = "QueryId1"
|
26
|
+
SANDBOX_DOCUMENT_ID = "DocumentId1"
|
27
|
+
|
28
|
+
GET_QUERIES_PARAMS = %w[
|
29
|
+
processingStatuses
|
30
|
+
pageSize
|
31
|
+
createdSince
|
32
|
+
createdUntil
|
33
|
+
paginationToken
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
def get_queries(params = {})
|
37
|
+
@local_var_path = "/datakiosk/2023-11-15/queries"
|
38
|
+
if sandbox
|
39
|
+
params = {
|
40
|
+
"pageSize" => SANDBOX_PAGE_SIZE,
|
41
|
+
"processingStatuses" => SANDBOX_PROCESSING_STATUSES
|
42
|
+
}
|
43
|
+
end
|
44
|
+
@query_params = params.slice(*GET_QUERIES_PARAMS)
|
45
|
+
@request_type = "GET"
|
46
|
+
call_api
|
47
|
+
end
|
48
|
+
|
49
|
+
def create_query(query, pagination_token = nil)
|
50
|
+
@local_var_path = "/datakiosk/2023-11-15/queries"
|
51
|
+
query = SANDBOX_QUERY if sandbox
|
52
|
+
@request_body = {
|
53
|
+
"query" => query
|
54
|
+
}
|
55
|
+
@request_body["paginationToken"] = pagination_token unless pagination_token.nil?
|
56
|
+
@request_type = "POST"
|
57
|
+
call_api
|
58
|
+
end
|
59
|
+
|
60
|
+
def get_query(query_id)
|
61
|
+
query_id = SANDBOX_QUERY_ID if sandbox
|
62
|
+
@local_var_path = "/datakiosk/2023-11-15/queries/#{query_id}"
|
63
|
+
@request_type = "GET"
|
64
|
+
call_api
|
65
|
+
end
|
66
|
+
|
67
|
+
def cancel_query(query_id)
|
68
|
+
query_id = SANDBOX_QUERY_ID if sandbox
|
69
|
+
@local_var_path = "/datakiosk/2023-11-15/queries/#{query_id}"
|
70
|
+
@request_type = "DELETE"
|
71
|
+
call_api
|
72
|
+
end
|
73
|
+
|
74
|
+
def get_document(document_id)
|
75
|
+
document_id = SANDBOX_DOCUMENT_ID if sandbox
|
76
|
+
@local_var_path = "/datakiosk/2023-11-15/documents/#{document_id}"
|
77
|
+
@request_type = "GET"
|
78
|
+
call_api
|
79
|
+
end
|
80
|
+
|
81
|
+
def download_document(document_id)
|
82
|
+
response = get_document(document_id)
|
83
|
+
if response.success?
|
84
|
+
Typhoeus.get(JSON.parse(response.body)["documentUrl"])
|
85
|
+
else
|
86
|
+
response
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MuffinMan
|
4
|
+
module FulfillmentInbound
|
5
|
+
class V20240320 < SpApiClient
|
6
|
+
INBOUND_PATH = "/inbound/fba/2024-03-20"
|
7
|
+
|
8
|
+
def list_inbound_plans(page_size: nil, pagination_token: nil, status: nil, sort_by: nil, sort_order: nil)
|
9
|
+
@local_var_path = "#{INBOUND_PATH}/inboundPlans"
|
10
|
+
@query_params = {}
|
11
|
+
@query_params["pageSize"] = page_size if page_size
|
12
|
+
@query_params["paginationToken"] = pagination_token if pagination_token
|
13
|
+
@query_params["status"] = status if status
|
14
|
+
@query_params["sortBy"] = sort_by if sort_by
|
15
|
+
@query_params["sortOrder"] = sort_order if sort_order
|
16
|
+
@request_type = "GET"
|
17
|
+
call_api
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_inbound_plan(inbound_plan_id)
|
21
|
+
@local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}"
|
22
|
+
@request_type = "GET"
|
23
|
+
call_api
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_shipment(inbound_plan_id, shipment_id)
|
27
|
+
@local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}"
|
28
|
+
@request_type = "GET"
|
29
|
+
call_api
|
30
|
+
end
|
31
|
+
|
32
|
+
def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
|
33
|
+
@local_var_path = "#{INBOUND_PATH}/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/boxes"
|
34
|
+
@query_params = {}
|
35
|
+
@query_params["pageSize"] = page_size if page_size
|
36
|
+
@query_params["paginationToken"] = pagination_token if pagination_token
|
37
|
+
@request_type = "GET"
|
38
|
+
call_api
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -139,7 +139,7 @@ module MuffinMan
|
|
139
139
|
client = Aws::STS::Client.new(
|
140
140
|
region: derive_aws_region,
|
141
141
|
credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_access_key),
|
142
|
-
http_wire_trace:
|
142
|
+
http_wire_trace: ENV.fetch("AWS_DEBUG", nil) == "true" || false
|
143
143
|
)
|
144
144
|
client.assume_role(role_arn: sts_iam_role_arn, role_session_name: SecureRandom.uuid)
|
145
145
|
end
|
data/lib/muffin_man/version.rb
CHANGED
data/lib/muffin_man.rb
CHANGED
@@ -6,6 +6,7 @@ require "muffin_man/orders/v0"
|
|
6
6
|
require "muffin_man/reports/v20210630"
|
7
7
|
require "muffin_man/catalog_items/v20201201"
|
8
8
|
require "muffin_man/catalog_items/v20220401"
|
9
|
+
require "muffin_man/data_kiosk/v20231115"
|
9
10
|
require "muffin_man/finances/v0"
|
10
11
|
require "muffin_man/product_fees/v0"
|
11
12
|
require "muffin_man/authorization/v1"
|
@@ -15,12 +16,14 @@ require "muffin_man/listings/v20210801"
|
|
15
16
|
require "muffin_man/listings/v20200901"
|
16
17
|
require "muffin_man/fulfillment_inbound/v0"
|
17
18
|
require "muffin_man/fulfillment_inbound/v1"
|
19
|
+
require "muffin_man/fulfillment_inbound/v20240320"
|
18
20
|
require "muffin_man/fulfillment_outbound/v20200701"
|
19
21
|
require "muffin_man/fba_inventory/v1"
|
20
22
|
require "muffin_man/request_helpers"
|
21
23
|
require "muffin_man/feeds/v20210630"
|
22
24
|
require "muffin_man/notifications/v1"
|
23
25
|
require "muffin_man/merchant_fulfillment/v0"
|
26
|
+
require "muffin_man/awd/v20240509"
|
24
27
|
|
25
28
|
module MuffinMan
|
26
29
|
class Error < StandardError; end
|
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.1
|
4
|
+
version: 2.2.1
|
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: 2024-
|
13
|
+
date: 2024-07-29 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
|
@@ -154,15 +154,18 @@ files:
|
|
154
154
|
- bin/setup
|
155
155
|
- lib/muffin_man.rb
|
156
156
|
- lib/muffin_man/authorization/v1.rb
|
157
|
+
- lib/muffin_man/awd/v20240509.rb
|
157
158
|
- lib/muffin_man/catalog_items/base_api.rb
|
158
159
|
- lib/muffin_man/catalog_items/v20201201.rb
|
159
160
|
- lib/muffin_man/catalog_items/v20220401.rb
|
161
|
+
- lib/muffin_man/data_kiosk/v20231115.rb
|
160
162
|
- lib/muffin_man/enable_logger.rb
|
161
163
|
- lib/muffin_man/fba_inventory/v1.rb
|
162
164
|
- lib/muffin_man/feeds/v20210630.rb
|
163
165
|
- lib/muffin_man/finances/v0.rb
|
164
166
|
- lib/muffin_man/fulfillment_inbound/v0.rb
|
165
167
|
- lib/muffin_man/fulfillment_inbound/v1.rb
|
168
|
+
- lib/muffin_man/fulfillment_inbound/v20240320.rb
|
166
169
|
- lib/muffin_man/fulfillment_outbound/v20200701.rb
|
167
170
|
- lib/muffin_man/listings/v20200901.rb
|
168
171
|
- lib/muffin_man/listings/v20210801.rb
|
@@ -192,7 +195,7 @@ homepage: https://github.com/patterninc/muffin_man
|
|
192
195
|
licenses:
|
193
196
|
- MIT
|
194
197
|
metadata: {}
|
195
|
-
post_install_message:
|
198
|
+
post_install_message:
|
196
199
|
rdoc_options: []
|
197
200
|
require_paths:
|
198
201
|
- lib
|
@@ -207,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
210
|
- !ruby/object:Gem::Version
|
208
211
|
version: '0'
|
209
212
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
211
|
-
signing_key:
|
213
|
+
rubygems_version: 3.4.19
|
214
|
+
signing_key:
|
212
215
|
specification_version: 4
|
213
216
|
summary: Amazon Selling Partner API client
|
214
217
|
test_files: []
|