muffin_man 2.1.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e9269248aa6303968c89ad3f90d7a6165b249cebaa15b905ee0596b2a8916ce
4
- data.tar.gz: 61dcfad92370fd8553a702976dffd4109b9e5eaf9158929c45803ca23b0af238
3
+ metadata.gz: 49ec853c9c790152131d186d3b30b660f0f688fc390383183be87be38944f377
4
+ data.tar.gz: 5e7e4f2ae5af32e5abbd7fc4a6da0d84c5ac9e9f2ffd3f6a5b1ea5931d413918
5
5
  SHA512:
6
- metadata.gz: cb1133daaa98b531f1123985494fe1718de374e00877109a21579592758fc10f7aef91f0f76612dec83bf39357ea6ef449ca7063ef49f8515561c4598f421db6
7
- data.tar.gz: b4dc27b5e26ffd6cf3d91f386225431e22006bc96217411300c2122ec8a6a3b50397399ed3c5c4bf0a29c408453943b782dc17ba8fcb938ddacdc1956cbfc962
6
+ metadata.gz: c708c548584bb883bce5663dc80f9aff62170cfbfcf4ea5f299acf0b98c12ae26a5dcfd35312b85561beb2dfec4059923e5755851225774d86c61a6b5793f507
7
+ data.tar.gz: ec33e1214dd886a96fcf953391655596e160f6d0c8f69a439acf47fb3e5f2de44a0eb3a5b0d412f95bff5361afd2f1a92e054592b413fbd8fbf3eb93636c4acc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.2.0 [#66](https://github.com/patterninc/muffin_man/pull/66)
2
+
3
+ - Support for Data Kiosk API v2023-11-15
4
+
1
5
  # 2.1.3
2
6
 
3
7
  - Support for AWD getInboundShipment [#64](https://github.com/patterninc/muffin_man/pull/64)
data/README.md CHANGED
@@ -8,6 +8,7 @@ As of now, this gem only supports portions of the following APIs with more to co
8
8
 
9
9
  - `create_product_review_and_seller_feedback_solicitation`
10
10
  - `catalog_items`
11
+ - `data_kiosk`
11
12
  - `reports`
12
13
  - `product_fees`
13
14
  - `product_pricing`
@@ -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: (ENV.fetch("AWS_DEBUG", nil) == "true" || false)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "2.1.3"
4
+ VERSION = "2.2.1"
5
5
  end
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.3
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-09 00:00:00.000000000 Z
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