muffin_man 2.1.3 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -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 +2 -0
- metadata +4 -2
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
data/README.md
CHANGED
@@ -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,6 +16,7 @@ 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"
|
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.1
|
4
|
+
version: 2.2.1
|
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: 2024-07-
|
13
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -158,12 +158,14 @@ files:
|
|
158
158
|
- lib/muffin_man/catalog_items/base_api.rb
|
159
159
|
- lib/muffin_man/catalog_items/v20201201.rb
|
160
160
|
- lib/muffin_man/catalog_items/v20220401.rb
|
161
|
+
- lib/muffin_man/data_kiosk/v20231115.rb
|
161
162
|
- lib/muffin_man/enable_logger.rb
|
162
163
|
- lib/muffin_man/fba_inventory/v1.rb
|
163
164
|
- lib/muffin_man/feeds/v20210630.rb
|
164
165
|
- lib/muffin_man/finances/v0.rb
|
165
166
|
- lib/muffin_man/fulfillment_inbound/v0.rb
|
166
167
|
- lib/muffin_man/fulfillment_inbound/v1.rb
|
168
|
+
- lib/muffin_man/fulfillment_inbound/v20240320.rb
|
167
169
|
- lib/muffin_man/fulfillment_outbound/v20200701.rb
|
168
170
|
- lib/muffin_man/listings/v20200901.rb
|
169
171
|
- lib/muffin_man/listings/v20210801.rb
|