muffin_man 1.5.0 → 1.5.2
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 +4 -0
- data/.rubocop.yml +31 -0
- data/.rubocop_todo.yml +480 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +4 -0
- data/README.md +2 -0
- data/lib/muffin_man/fba_inventory/v1.rb +30 -0
- data/lib/muffin_man/feeds/v20210630.rb +45 -0
- data/lib/muffin_man/fulfillment_inbound/v1.rb +16 -0
- data/lib/muffin_man/notifications/v1.rb +85 -0
- data/lib/muffin_man/sp_api_client.rb +5 -1
- data/lib/muffin_man/version.rb +1 -1
- data/lib/muffin_man.rb +4 -1
- data/lib/sp_api_helpers.rb +1 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a50a949121a2dbd7a3b4b6ba0862d8d3bf9336957164fe78c81a08bf5f508f8
|
4
|
+
data.tar.gz: 5a288706a99e4e9820dd22307cbfb22820ce4ca23f662f25b6e1089adba2ba1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc2bab060e40d070cf093647e557a674e7f8c2cea7adb6039bc79553fce3412b2f22f72822065ee213b1fbb782d5559be48ac4476ddb3d748a8d0ba1e038fea4
|
7
|
+
data.tar.gz: 7037a0e94bdbd7fc918ef8548b5c39a395b0ea8b740f55c04f3b02762fdf422e7f4b441c9ee79fe91a56ff35e18c4105b18d61cd92531eefdddc80512c43891b
|
data/.github/workflows/ci.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require:
|
4
|
+
- rubocop-rspec
|
5
|
+
- rubocop-rake
|
6
|
+
|
1
7
|
AllCops:
|
2
8
|
TargetRubyVersion: 2.5
|
9
|
+
NewCops: enable
|
3
10
|
|
4
11
|
Style/StringLiterals:
|
5
12
|
Enabled: true
|
@@ -14,3 +21,27 @@ Layout/LineLength:
|
|
14
21
|
|
15
22
|
Metrics/MethodLength:
|
16
23
|
Max: 30
|
24
|
+
|
25
|
+
Metrics/ModuleLength:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Metrics/AbcSize:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/Documentation:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Style/OptionalBooleanParameter:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
RSpec/ExampleLength:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
RSpec/MultipleMemoizedHelpers:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
RSpec/MultipleExpectations:
|
47
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,480 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 10000`
|
3
|
+
# on 2022-11-01 12:11:40 UTC using RuboCop version 1.37.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 3
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/OrderedDependencies:
|
14
|
+
Exclude:
|
15
|
+
- 'muffin_man.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# This cop supports safe autocorrection (--autocorrect).
|
19
|
+
# Configuration parameters: Include.
|
20
|
+
# Include: **/*.gemspec
|
21
|
+
Gemspec/RequireMFA:
|
22
|
+
Exclude:
|
23
|
+
- 'muffin_man.gemspec'
|
24
|
+
|
25
|
+
# Offense count: 1
|
26
|
+
# Configuration parameters: Include.
|
27
|
+
# Include: **/*.gemspec
|
28
|
+
Gemspec/RequiredRubyVersion:
|
29
|
+
Exclude:
|
30
|
+
- 'muffin_man.gemspec'
|
31
|
+
|
32
|
+
# Offense count: 3
|
33
|
+
# This cop supports safe autocorrection (--autocorrect).
|
34
|
+
# Configuration parameters: EnforcedStyle.
|
35
|
+
# SupportedStyles: leading, trailing
|
36
|
+
Layout/DotPosition:
|
37
|
+
Exclude:
|
38
|
+
- 'spec/support/sp_api_helpers.rb'
|
39
|
+
|
40
|
+
# Offense count: 1
|
41
|
+
# This cop supports safe autocorrection (--autocorrect).
|
42
|
+
Layout/EmptyLines:
|
43
|
+
Exclude:
|
44
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
45
|
+
|
46
|
+
# Offense count: 3
|
47
|
+
# This cop supports safe autocorrection (--autocorrect).
|
48
|
+
# Configuration parameters: EnforcedStyle.
|
49
|
+
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
|
50
|
+
Layout/EmptyLinesAroundClassBody:
|
51
|
+
Exclude:
|
52
|
+
- 'lib/muffin_man/catalog_items/v20201201.rb'
|
53
|
+
- 'lib/muffin_man/fba_inventory/v1.rb'
|
54
|
+
- 'lib/muffin_man/orders/v0.rb'
|
55
|
+
|
56
|
+
# Offense count: 1
|
57
|
+
# This cop supports safe autocorrection (--autocorrect).
|
58
|
+
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
59
|
+
Layout/ExtraSpacing:
|
60
|
+
Exclude:
|
61
|
+
- 'spec/muffin_man/orders_spec.rb'
|
62
|
+
|
63
|
+
# Offense count: 4
|
64
|
+
# This cop supports safe autocorrection (--autocorrect).
|
65
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
66
|
+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
|
67
|
+
Layout/FirstArrayElementIndentation:
|
68
|
+
Exclude:
|
69
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
70
|
+
|
71
|
+
# Offense count: 22
|
72
|
+
# This cop supports safe autocorrection (--autocorrect).
|
73
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
74
|
+
# SupportedHashRocketStyles: key, separator, table
|
75
|
+
# SupportedColonStyles: key, separator, table
|
76
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
77
|
+
Layout/HashAlignment:
|
78
|
+
Exclude:
|
79
|
+
- 'lib/muffin_man/listings/v20210801.rb'
|
80
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
81
|
+
|
82
|
+
# Offense count: 2
|
83
|
+
# This cop supports safe autocorrection (--autocorrect).
|
84
|
+
Layout/MultilineBlockLayout:
|
85
|
+
Exclude:
|
86
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
87
|
+
|
88
|
+
# Offense count: 3
|
89
|
+
# This cop supports safe autocorrection (--autocorrect).
|
90
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
91
|
+
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
92
|
+
Layout/MultilineMethodCallIndentation:
|
93
|
+
Exclude:
|
94
|
+
- 'spec/support/sp_api_helpers.rb'
|
95
|
+
|
96
|
+
# Offense count: 3
|
97
|
+
# This cop supports safe autocorrection (--autocorrect).
|
98
|
+
# Configuration parameters: EnforcedStyle.
|
99
|
+
# SupportedStyles: space, no_space
|
100
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
101
|
+
Exclude:
|
102
|
+
- 'lib/muffin_man/catalog_items/base_api.rb'
|
103
|
+
- 'lib/muffin_man/product_pricing/v0.rb'
|
104
|
+
|
105
|
+
# Offense count: 43
|
106
|
+
# This cop supports safe autocorrection (--autocorrect).
|
107
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
108
|
+
# SupportedStylesForExponentOperator: space, no_space
|
109
|
+
Layout/SpaceAroundOperators:
|
110
|
+
Exclude:
|
111
|
+
- 'lib/muffin_man/listings/v20210801.rb'
|
112
|
+
- 'lib/muffin_man/reports/v20210630.rb'
|
113
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
114
|
+
- 'spec/muffin_man/orders_spec.rb'
|
115
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
116
|
+
- 'spec/support/sp_api_helpers.rb'
|
117
|
+
|
118
|
+
# Offense count: 4
|
119
|
+
# This cop supports safe autocorrection (--autocorrect).
|
120
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
|
121
|
+
# SupportedStyles: space, no_space, compact
|
122
|
+
# SupportedStylesForEmptyBrackets: space, no_space
|
123
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
124
|
+
Exclude:
|
125
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
126
|
+
|
127
|
+
# Offense count: 24
|
128
|
+
# This cop supports safe autocorrection (--autocorrect).
|
129
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
130
|
+
# SupportedStyles: space, no_space, compact
|
131
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
132
|
+
Layout/SpaceInsideHashLiteralBraces:
|
133
|
+
Exclude:
|
134
|
+
- 'spec/muffin_man/catalog_items_v20220401_spec.rb'
|
135
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
136
|
+
- 'spec/muffin_man/orders_spec.rb'
|
137
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
138
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
139
|
+
- 'spec/support/sp_api_helpers.rb'
|
140
|
+
|
141
|
+
# Offense count: 2
|
142
|
+
# This cop supports safe autocorrection (--autocorrect).
|
143
|
+
# Configuration parameters: EnforcedStyle.
|
144
|
+
# SupportedStyles: final_newline, final_blank_line
|
145
|
+
Layout/TrailingEmptyLines:
|
146
|
+
Exclude:
|
147
|
+
- 'Gemfile'
|
148
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
149
|
+
|
150
|
+
# Offense count: 1
|
151
|
+
# Configuration parameters: AllowedMethods.
|
152
|
+
# AllowedMethods: enums
|
153
|
+
Lint/ConstantDefinitionInBlock:
|
154
|
+
Exclude:
|
155
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
156
|
+
|
157
|
+
# Offense count: 1
|
158
|
+
Lint/MissingSuper:
|
159
|
+
Exclude:
|
160
|
+
- 'lib/muffin_man/request_helpers/inbound_shipment_plan_request_item.rb'
|
161
|
+
|
162
|
+
# Offense count: 17
|
163
|
+
# This cop supports safe autocorrection (--autocorrect).
|
164
|
+
# Configuration parameters: EnforcedStyle.
|
165
|
+
# SupportedStyles: strict, consistent
|
166
|
+
Lint/SymbolConversion:
|
167
|
+
Exclude:
|
168
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
169
|
+
- 'lib/muffin_man/request_helpers/inbound_shipment_plan_request_item.rb'
|
170
|
+
- 'spec/support/sp_api_helpers.rb'
|
171
|
+
|
172
|
+
# Offense count: 1
|
173
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
174
|
+
Metrics/ClassLength:
|
175
|
+
Exclude:
|
176
|
+
- 'lib/muffin_man/sp_api_client.rb'
|
177
|
+
|
178
|
+
# Offense count: 11
|
179
|
+
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
|
180
|
+
Metrics/ParameterLists:
|
181
|
+
Exclude:
|
182
|
+
- 'lib/muffin_man/finances/v0.rb'
|
183
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
184
|
+
- 'lib/muffin_man/product_fees/v0.rb'
|
185
|
+
- 'lib/muffin_man/request_helpers/inbound_shipment_plan_request_item.rb'
|
186
|
+
- 'lib/sp_api_helpers.rb'
|
187
|
+
|
188
|
+
# Offense count: 1
|
189
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
190
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
191
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
192
|
+
Naming/VariableNumber:
|
193
|
+
Exclude:
|
194
|
+
- 'spec/muffin_man/orders_spec.rb'
|
195
|
+
|
196
|
+
# Offense count: 2
|
197
|
+
RSpec/AnyInstance:
|
198
|
+
Exclude:
|
199
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
200
|
+
|
201
|
+
# Offense count: 1
|
202
|
+
# This cop supports safe autocorrection (--autocorrect).
|
203
|
+
# Configuration parameters: EnforcedStyle.
|
204
|
+
# SupportedStyles: be, be_nil
|
205
|
+
RSpec/BeNil:
|
206
|
+
Exclude:
|
207
|
+
- 'spec/muffin_man_spec.rb'
|
208
|
+
|
209
|
+
# Offense count: 2
|
210
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
211
|
+
# Prefixes: when, with, without
|
212
|
+
RSpec/ContextWording:
|
213
|
+
Exclude:
|
214
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
215
|
+
|
216
|
+
# Offense count: 4
|
217
|
+
# This cop supports safe autocorrection (--autocorrect).
|
218
|
+
RSpec/EmptyLineAfterFinalLet:
|
219
|
+
Exclude:
|
220
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
221
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
222
|
+
|
223
|
+
# Offense count: 16
|
224
|
+
# This cop supports safe autocorrection (--autocorrect).
|
225
|
+
# Configuration parameters: AllowConsecutiveOneLiners.
|
226
|
+
RSpec/EmptyLineAfterHook:
|
227
|
+
Exclude:
|
228
|
+
- 'spec/muffin_man/authorization_spec.rb'
|
229
|
+
- 'spec/muffin_man/fba_inventory/v1_spec.rb'
|
230
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
231
|
+
- 'spec/muffin_man/fulfillment_inbound/v1_spec.rb'
|
232
|
+
- 'spec/muffin_man/listings_spec.rb'
|
233
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
234
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
235
|
+
- 'spec/muffin_man/reports_spec.rb'
|
236
|
+
- 'spec/muffin_man/solicitations_spec.rb'
|
237
|
+
- 'spec/muffin_man/tokens_spec.rb'
|
238
|
+
|
239
|
+
# Offense count: 12
|
240
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
241
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
242
|
+
RSpec/FilePath:
|
243
|
+
Exclude:
|
244
|
+
- 'spec/muffin_man/authorization_spec.rb'
|
245
|
+
- 'spec/muffin_man/catalog_items_spec.rb'
|
246
|
+
- 'spec/muffin_man/catalog_items_v20220401_spec.rb'
|
247
|
+
- 'spec/muffin_man/finances_spec.rb'
|
248
|
+
- 'spec/muffin_man/listings_spec.rb'
|
249
|
+
- 'spec/muffin_man/lwa_spec.rb'
|
250
|
+
- 'spec/muffin_man/orders_spec.rb'
|
251
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
252
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
253
|
+
- 'spec/muffin_man/reports_spec.rb'
|
254
|
+
- 'spec/muffin_man/solicitations_spec.rb'
|
255
|
+
- 'spec/muffin_man/tokens_spec.rb'
|
256
|
+
|
257
|
+
# Offense count: 15
|
258
|
+
# This cop supports safe autocorrection (--autocorrect).
|
259
|
+
RSpec/LeadingSubject:
|
260
|
+
Exclude:
|
261
|
+
- 'spec/muffin_man/authorization_spec.rb'
|
262
|
+
- 'spec/muffin_man/catalog_items_spec.rb'
|
263
|
+
- 'spec/muffin_man/catalog_items_v20220401_spec.rb'
|
264
|
+
- 'spec/muffin_man/fba_inventory/v1_spec.rb'
|
265
|
+
- 'spec/muffin_man/finances_spec.rb'
|
266
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
267
|
+
- 'spec/muffin_man/fulfillment_inbound/v1_spec.rb'
|
268
|
+
- 'spec/muffin_man/listings_spec.rb'
|
269
|
+
- 'spec/muffin_man/orders_spec.rb'
|
270
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
271
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
272
|
+
- 'spec/muffin_man/reports_spec.rb'
|
273
|
+
- 'spec/muffin_man/solicitations_spec.rb'
|
274
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
275
|
+
- 'spec/muffin_man/tokens_spec.rb'
|
276
|
+
|
277
|
+
# Offense count: 2
|
278
|
+
RSpec/LeakyConstantDeclaration:
|
279
|
+
Exclude:
|
280
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
281
|
+
|
282
|
+
# Offense count: 1
|
283
|
+
RSpec/LetSetup:
|
284
|
+
Exclude:
|
285
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
286
|
+
|
287
|
+
# Offense count: 6
|
288
|
+
# Configuration parameters: .
|
289
|
+
# SupportedStyles: have_received, receive
|
290
|
+
RSpec/MessageSpies:
|
291
|
+
EnforcedStyle: receive
|
292
|
+
|
293
|
+
# Offense count: 4
|
294
|
+
# Configuration parameters: Max, AllowedGroups.
|
295
|
+
RSpec/NestedGroups:
|
296
|
+
Exclude:
|
297
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
298
|
+
|
299
|
+
# Offense count: 1
|
300
|
+
RSpec/StubbedMock:
|
301
|
+
Exclude:
|
302
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
303
|
+
|
304
|
+
# Offense count: 1
|
305
|
+
# This cop supports safe autocorrection (--autocorrect).
|
306
|
+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
307
|
+
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
308
|
+
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
309
|
+
# FunctionalMethods: let, let!, subject, watch
|
310
|
+
# AllowedMethods: lambda, proc, it
|
311
|
+
Style/BlockDelimiters:
|
312
|
+
Exclude:
|
313
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
314
|
+
|
315
|
+
# Offense count: 1
|
316
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
317
|
+
# Configuration parameters: EnforcedStyle.
|
318
|
+
# SupportedStyles: nested, compact
|
319
|
+
Style/ClassAndModuleChildren:
|
320
|
+
Exclude:
|
321
|
+
- 'lib/muffin_man/lwa/auth_helper.rb'
|
322
|
+
|
323
|
+
# Offense count: 1
|
324
|
+
# This cop supports safe autocorrection (--autocorrect).
|
325
|
+
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
326
|
+
# SupportedStyles: assign_to_condition, assign_inside_condition
|
327
|
+
Style/ConditionalAssignment:
|
328
|
+
Exclude:
|
329
|
+
- 'lib/muffin_man/sp_api_client.rb'
|
330
|
+
|
331
|
+
# Offense count: 38
|
332
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
333
|
+
# Configuration parameters: EnforcedStyle.
|
334
|
+
# SupportedStyles: always, always_true, never
|
335
|
+
Style/FrozenStringLiteralComment:
|
336
|
+
Exclude:
|
337
|
+
- 'lib/muffin_man.rb'
|
338
|
+
- 'lib/muffin_man/authorization/v1.rb'
|
339
|
+
- 'lib/muffin_man/catalog_items/base_api.rb'
|
340
|
+
- 'lib/muffin_man/catalog_items/v20201201.rb'
|
341
|
+
- 'lib/muffin_man/catalog_items/v20220401.rb'
|
342
|
+
- 'lib/muffin_man/fba_inventory/v1.rb'
|
343
|
+
- 'lib/muffin_man/finances/v0.rb'
|
344
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
345
|
+
- 'lib/muffin_man/fulfillment_inbound/v1.rb'
|
346
|
+
- 'lib/muffin_man/listings/v20210801.rb'
|
347
|
+
- 'lib/muffin_man/lwa/auth_helper.rb'
|
348
|
+
- 'lib/muffin_man/orders/v0.rb'
|
349
|
+
- 'lib/muffin_man/reports/v20210630.rb'
|
350
|
+
- 'lib/muffin_man/request_helpers.rb'
|
351
|
+
- 'lib/muffin_man/request_helpers/base.rb'
|
352
|
+
- 'lib/muffin_man/request_helpers/inbound_shipment_plan_request_item.rb'
|
353
|
+
- 'lib/muffin_man/solicitations/v1.rb'
|
354
|
+
- 'lib/muffin_man/sp_api_client.rb'
|
355
|
+
- 'lib/muffin_man/tokens/v20210301.rb'
|
356
|
+
- 'muffin_man.gemspec'
|
357
|
+
- 'spec/muffin_man/authorization_spec.rb'
|
358
|
+
- 'spec/muffin_man/catalog_items_spec.rb'
|
359
|
+
- 'spec/muffin_man/catalog_items_v20220401_spec.rb'
|
360
|
+
- 'spec/muffin_man/fba_inventory/v1_spec.rb'
|
361
|
+
- 'spec/muffin_man/finances_spec.rb'
|
362
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
363
|
+
- 'spec/muffin_man/fulfillment_inbound/v1_spec.rb'
|
364
|
+
- 'spec/muffin_man/listings_spec.rb'
|
365
|
+
- 'spec/muffin_man/lwa_spec.rb'
|
366
|
+
- 'spec/muffin_man/orders_spec.rb'
|
367
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
368
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
369
|
+
- 'spec/muffin_man/reports_spec.rb'
|
370
|
+
- 'spec/muffin_man/solicitations_spec.rb'
|
371
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
372
|
+
- 'spec/muffin_man/tokens_spec.rb'
|
373
|
+
- 'spec/support/lwa_helpers.rb'
|
374
|
+
- 'spec/support/sp_api_helpers.rb'
|
375
|
+
|
376
|
+
# Offense count: 4
|
377
|
+
# This cop supports safe autocorrection (--autocorrect).
|
378
|
+
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
379
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
380
|
+
# SupportedShorthandSyntax: always, never, either, consistent
|
381
|
+
Style/HashSyntax:
|
382
|
+
Exclude:
|
383
|
+
- 'spec/support/sp_api_helpers.rb'
|
384
|
+
|
385
|
+
# Offense count: 1
|
386
|
+
# This cop supports safe autocorrection (--autocorrect).
|
387
|
+
Style/IfUnlessModifier:
|
388
|
+
Exclude:
|
389
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
390
|
+
|
391
|
+
# Offense count: 3
|
392
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
393
|
+
# Configuration parameters: EnforcedStyle.
|
394
|
+
# SupportedStyles: literals, strict
|
395
|
+
Style/MutableConstant:
|
396
|
+
Exclude:
|
397
|
+
- 'lib/muffin_man/orders/v0.rb'
|
398
|
+
- 'lib/muffin_man/solicitations/v1.rb'
|
399
|
+
|
400
|
+
# Offense count: 1
|
401
|
+
# This cop supports safe autocorrection (--autocorrect).
|
402
|
+
# Configuration parameters: PreferredDelimiters.
|
403
|
+
Style/PercentLiteralDelimiters:
|
404
|
+
Exclude:
|
405
|
+
- 'lib/muffin_man/catalog_items/v20220401.rb'
|
406
|
+
|
407
|
+
# Offense count: 6
|
408
|
+
# This cop supports safe autocorrection (--autocorrect).
|
409
|
+
Style/RedundantSelfAssignmentBranch:
|
410
|
+
Exclude:
|
411
|
+
- 'lib/muffin_man/reports/v20210630.rb'
|
412
|
+
|
413
|
+
# Offense count: 1
|
414
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
415
|
+
Style/SingleArgumentDig:
|
416
|
+
Exclude:
|
417
|
+
- 'spec/muffin_man/listings_spec.rb'
|
418
|
+
|
419
|
+
# Offense count: 1
|
420
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
421
|
+
# Configuration parameters: Mode.
|
422
|
+
Style/StringConcatenation:
|
423
|
+
Exclude:
|
424
|
+
- 'lib/muffin_man/solicitations/v1.rb'
|
425
|
+
|
426
|
+
# Offense count: 35
|
427
|
+
# This cop supports safe autocorrection (--autocorrect).
|
428
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
429
|
+
# SupportedStyles: single_quotes, double_quotes
|
430
|
+
Style/StringLiterals:
|
431
|
+
Exclude:
|
432
|
+
- 'lib/muffin_man/fba_inventory/v1.rb'
|
433
|
+
- 'lib/muffin_man/product_pricing/v0.rb'
|
434
|
+
- 'lib/muffin_man/reports/v20210630.rb'
|
435
|
+
- 'lib/muffin_man/request_helpers.rb'
|
436
|
+
- 'muffin_man.gemspec'
|
437
|
+
- 'spec/muffin_man/fba_inventory/v1_spec.rb'
|
438
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
439
|
+
- 'spec/muffin_man/fulfillment_inbound/v1_spec.rb'
|
440
|
+
- 'spec/muffin_man/orders_spec.rb'
|
441
|
+
- 'spec/muffin_man/product_pricing_spec.rb'
|
442
|
+
- 'spec/support/sp_api_helpers.rb'
|
443
|
+
|
444
|
+
# Offense count: 8
|
445
|
+
# This cop supports safe autocorrection (--autocorrect).
|
446
|
+
# Configuration parameters: EnforcedStyleForMultiline.
|
447
|
+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
448
|
+
Style/TrailingCommaInHashLiteral:
|
449
|
+
Exclude:
|
450
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
451
|
+
- 'lib/muffin_man/fulfillment_inbound/v1.rb'
|
452
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
453
|
+
|
454
|
+
# Offense count: 2
|
455
|
+
# This cop supports safe autocorrection (--autocorrect).
|
456
|
+
# Configuration parameters: WordRegex.
|
457
|
+
# SupportedStyles: percent, brackets
|
458
|
+
Style/WordArray:
|
459
|
+
EnforcedStyle: percent
|
460
|
+
MinSize: 5
|
461
|
+
|
462
|
+
# Offense count: 41
|
463
|
+
# This cop supports safe autocorrection (--autocorrect).
|
464
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
465
|
+
# URISchemes: http, https
|
466
|
+
Layout/LineLength:
|
467
|
+
Exclude:
|
468
|
+
- 'lib/muffin_man/finances/v0.rb'
|
469
|
+
- 'lib/muffin_man/fulfillment_inbound/v0.rb'
|
470
|
+
- 'lib/muffin_man/product_fees/v0.rb'
|
471
|
+
- 'lib/muffin_man/solicitations/v1.rb'
|
472
|
+
- 'lib/muffin_man/sp_api_client.rb'
|
473
|
+
- 'spec/muffin_man/fulfillment_inbound/v0_spec.rb'
|
474
|
+
- 'spec/muffin_man/listings_spec.rb'
|
475
|
+
- 'spec/muffin_man/lwa_spec.rb'
|
476
|
+
- 'spec/muffin_man/product_fees_spec.rb'
|
477
|
+
- 'spec/muffin_man/solicitations_spec.rb'
|
478
|
+
- 'spec/muffin_man/sp_api_client_spec.rb'
|
479
|
+
- 'spec/support/lwa_helpers.rb'
|
480
|
+
- 'spec/support/sp_api_helpers.rb'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# Unreleased
|
2
|
+
|
3
|
+
- Support for getInventorySummaries [#36](https://github.com/patterninc/muffin_man/pull/36)
|
4
|
+
|
5
|
+
# 1.5.2
|
6
|
+
|
7
|
+
- Support for Feeds and Notifications [#33](https://github.com/patterninc/muffin_man/pull/33)
|
8
|
+
|
9
|
+
# 1.5.1
|
10
|
+
|
11
|
+
- Support for getItemEligibilityPreview [#35](https://github.com/patterninc/muffin_man/pull/35)
|
12
|
+
|
1
13
|
# 1.5.0
|
2
14
|
|
3
15
|
## Breaking changes - 1. v20220401 search_catalog_items method signature updated
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
module MuffinMan
|
2
|
+
module FbaInventory
|
3
|
+
class V1 < SpApiClient
|
4
|
+
|
5
|
+
GET_INVENTORY_SUMMARIES_PARAMS = %w[
|
6
|
+
details
|
7
|
+
granularityType
|
8
|
+
granularityId
|
9
|
+
startDateTime
|
10
|
+
sellerSkus
|
11
|
+
nextToken
|
12
|
+
marketplaceIds
|
13
|
+
].freeze
|
14
|
+
|
15
|
+
# NOTE: when passing nextToken, if the original request had a
|
16
|
+
# startDateTime, that must be included in subsequent requests.
|
17
|
+
def get_inventory_summaries(params)
|
18
|
+
if sandbox
|
19
|
+
params['granularityType'] = 'Marketplace'
|
20
|
+
params['granularityId'] = 'ATVPDKIKX0DER'
|
21
|
+
params['marketplaceIds'] = 'ATVPDKIKX0DER'
|
22
|
+
end
|
23
|
+
@local_var_path = "/fba/inventory/v1/summaries"
|
24
|
+
@query_params = params.slice(*GET_INVENTORY_SUMMARIES_PARAMS)
|
25
|
+
@request_type = "GET"
|
26
|
+
call_api
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MuffinMan
|
4
|
+
module Feeds
|
5
|
+
require "sp_api_helpers"
|
6
|
+
class V20210630 < SpApiClient
|
7
|
+
FEED_PATH = "/feeds/2021-06-30"
|
8
|
+
|
9
|
+
def create_feed(feed_type, marketplace_ids, input_feed_document_id, params = {})
|
10
|
+
@local_var_path = "#{FEED_PATH}/feeds"
|
11
|
+
@request_body = { "feedType" => feed_type, "marketplaceIds" => marketplace_ids,
|
12
|
+
"inputFeedDocumentId" => input_feed_document_id }.merge(sp_api_params(params))
|
13
|
+
@request_type = "POST"
|
14
|
+
call_api
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_feeds(params)
|
18
|
+
@local_var_path = "#{FEED_PATH}/feeds"
|
19
|
+
sp_api_params = sp_api_params(params)
|
20
|
+
@query_params = sp_api_params.key?("nextToken") ? sp_api_params.slice("nextToken") : sp_api_params
|
21
|
+
@request_type = "GET"
|
22
|
+
call_api
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_feed(feed_id)
|
26
|
+
@local_var_path = "#{FEED_PATH}/feeds/#{feed_id}"
|
27
|
+
@request_type = "GET"
|
28
|
+
call_api
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_feed_document(content_type, params = {})
|
32
|
+
@local_var_path = "#{FEED_PATH}/documents"
|
33
|
+
@request_body = { "contentType" => content_type }.merge(sp_api_params(params))
|
34
|
+
@request_type = "POST"
|
35
|
+
call_api
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_feed_document(feed_document_id)
|
39
|
+
@local_var_path = "#{FEED_PATH}/documents/#{feed_document_id}"
|
40
|
+
@request_type = "GET"
|
41
|
+
call_api
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module MuffinMan
|
2
|
+
module FulfillmentInbound
|
3
|
+
class V1 < SpApiClient
|
4
|
+
def get_item_eligibility_preview(asin, program, marketplace_ids: [])
|
5
|
+
@local_var_path = "/fba/inbound/v1/eligibility/itemPreview"
|
6
|
+
@query_params = {
|
7
|
+
"asin" => asin,
|
8
|
+
"program" => program,
|
9
|
+
}
|
10
|
+
@query_params["marketplaceIds"] = marketplace_ids.join(",") if marketplace_ids.any?
|
11
|
+
@request_type = "GET"
|
12
|
+
call_api
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MuffinMan
|
4
|
+
module Notifications
|
5
|
+
require "json"
|
6
|
+
require "sp_api_helpers"
|
7
|
+
class V1 < SpApiClient
|
8
|
+
NOTIFICATION_PATH = "/notifications/v1"
|
9
|
+
NOTIFICATION_SCOPE = "sellingpartnerapi::notifications"
|
10
|
+
PROCESSING_DIRECTIVE_SUPPORTED_NOTIFICATIONS = ["ANY_OFFER_CHANGED"].freeze
|
11
|
+
|
12
|
+
def create_destination(arn, name, params = {})
|
13
|
+
@local_var_path = "#{NOTIFICATION_PATH}/destinations"
|
14
|
+
params = params.transform_keys(&:to_s)
|
15
|
+
@scope = NOTIFICATION_SCOPE
|
16
|
+
destination_params = { "resourceSpecification" => { "sqs" => { "arn" => arn } }, "name" => name }
|
17
|
+
unless params["region"].nil? || params["account_id"].nil?
|
18
|
+
destination_params["resourceSpecification"].merge!("eventBridge" => { "region" => params["region"],
|
19
|
+
"accountId" => params["account_id"] })
|
20
|
+
end
|
21
|
+
@request_body = destination_params
|
22
|
+
@request_type = "POST"
|
23
|
+
call_api
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_destinations(params = {})
|
27
|
+
@local_var_path = "#{NOTIFICATION_PATH}/destinations"
|
28
|
+
@scope = NOTIFICATION_SCOPE
|
29
|
+
@query_params = sp_api_params(params)
|
30
|
+
@request_type = "GET"
|
31
|
+
call_api
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_destination(destination_id)
|
35
|
+
@local_var_path = "#{NOTIFICATION_PATH}/destinations/#{destination_id}"
|
36
|
+
@scope = NOTIFICATION_SCOPE
|
37
|
+
@request_type = "GET"
|
38
|
+
call_api
|
39
|
+
end
|
40
|
+
|
41
|
+
def create_subscription(notification_type, params = {})
|
42
|
+
@local_var_path = "#{NOTIFICATION_PATH}/subscriptions/#{notification_type}"
|
43
|
+
params = params.transform_keys(&:to_s)
|
44
|
+
subscription_params = { "destinationId" => params["destination_id"] }
|
45
|
+
# currently SP-API's `processingDirective` only supports ANY_OFFER_CHANGED notification type.
|
46
|
+
if PROCESSING_DIRECTIVE_SUPPORTED_NOTIFICATIONS.include? notification_type
|
47
|
+
subscription_params["processingDirective"] =
|
48
|
+
{ "eventFilter" => { "eventFilterType" => notification_type,
|
49
|
+
"marketplaceIds" => params["marketplace_ids"] } }
|
50
|
+
unless params["aggregation_time_period"].nil?
|
51
|
+
subscription_params["processingDirective"]["eventFilter"]
|
52
|
+
.merge!("aggregationSettings" => {
|
53
|
+
"aggregationTimePeriod" => params["aggregation_time_period"]
|
54
|
+
})
|
55
|
+
end
|
56
|
+
end
|
57
|
+
subscription_params.merge!("payloadVersion" => params["payload_version"]) unless params["payload_version"].nil?
|
58
|
+
@request_body = subscription_params
|
59
|
+
@request_type = "POST"
|
60
|
+
call_api
|
61
|
+
end
|
62
|
+
|
63
|
+
def get_subscription(notification_type, params = {})
|
64
|
+
@local_var_path = "#{NOTIFICATION_PATH}/subscriptions/#{notification_type}"
|
65
|
+
@query_params = sp_api_params(params)
|
66
|
+
@request_type = "GET"
|
67
|
+
call_api
|
68
|
+
end
|
69
|
+
|
70
|
+
def get_subscription_by_id(notification_type, subscription_id)
|
71
|
+
@local_var_path = "#{NOTIFICATION_PATH}/subscriptions/#{notification_type}/#{subscription_id}"
|
72
|
+
@scope = NOTIFICATION_SCOPE
|
73
|
+
@request_type = "GET"
|
74
|
+
call_api
|
75
|
+
end
|
76
|
+
|
77
|
+
def delete_subscription_by_id(notification_type, subscription_id)
|
78
|
+
@local_var_path = "#{NOTIFICATION_PATH}/subscriptions/#{notification_type}/#{subscription_id}"
|
79
|
+
@scope = NOTIFICATION_SCOPE
|
80
|
+
@request_type = "DELETE"
|
81
|
+
call_api
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -127,7 +127,7 @@ module MuffinMan
|
|
127
127
|
client = Aws::STS::Client.new(
|
128
128
|
region: derive_aws_region,
|
129
129
|
credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_access_key),
|
130
|
-
http_wire_trace: (ENV
|
130
|
+
http_wire_trace: (ENV.fetch("AWS_DEBUG", nil) == "true" || false)
|
131
131
|
)
|
132
132
|
client.assume_role(role_arn: sts_iam_role_arn, role_session_name: SecureRandom.uuid)
|
133
133
|
end
|
@@ -182,5 +182,9 @@ module MuffinMan
|
|
182
182
|
|
183
183
|
@aws_region
|
184
184
|
end
|
185
|
+
|
186
|
+
def sp_api_params(params)
|
187
|
+
params.to_h.transform_keys { |key| key.to_s.split("_").map.with_index { |x, i| i.positive? ? x.capitalize : x }.join }
|
188
|
+
end
|
185
189
|
end
|
186
190
|
end
|
data/lib/muffin_man/version.rb
CHANGED
data/lib/muffin_man.rb
CHANGED
@@ -13,7 +13,10 @@ require "muffin_man/tokens/v20210301"
|
|
13
13
|
require "muffin_man/product_pricing/v0"
|
14
14
|
require "muffin_man/listings/v20210801"
|
15
15
|
require "muffin_man/fulfillment_inbound/v0"
|
16
|
-
|
16
|
+
require "muffin_man/fulfillment_inbound/v1"
|
17
|
+
require "muffin_man/feeds/v20210630"
|
18
|
+
require "muffin_man/notifications/v1"
|
19
|
+
require "muffin_man/fba_inventory/v1"
|
17
20
|
|
18
21
|
module MuffinMan
|
19
22
|
class Error < StandardError; end
|
data/lib/sp_api_helpers.rb
CHANGED
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: 1.5.
|
4
|
+
version: 1.5.2
|
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: 2022-
|
13
|
+
date: 2022-11-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- ".gitignore"
|
130
130
|
- ".rspec"
|
131
131
|
- ".rubocop.yml"
|
132
|
+
- ".rubocop_todo.yml"
|
132
133
|
- CHANGELOG.md
|
133
134
|
- CODE_OF_CONDUCT.md
|
134
135
|
- Gemfile
|
@@ -142,10 +143,14 @@ files:
|
|
142
143
|
- lib/muffin_man/catalog_items/base_api.rb
|
143
144
|
- lib/muffin_man/catalog_items/v20201201.rb
|
144
145
|
- lib/muffin_man/catalog_items/v20220401.rb
|
146
|
+
- lib/muffin_man/fba_inventory/v1.rb
|
147
|
+
- lib/muffin_man/feeds/v20210630.rb
|
145
148
|
- lib/muffin_man/finances/v0.rb
|
146
149
|
- lib/muffin_man/fulfillment_inbound/v0.rb
|
150
|
+
- lib/muffin_man/fulfillment_inbound/v1.rb
|
147
151
|
- lib/muffin_man/listings/v20210801.rb
|
148
152
|
- lib/muffin_man/lwa/auth_helper.rb
|
153
|
+
- lib/muffin_man/notifications/v1.rb
|
149
154
|
- lib/muffin_man/orders/v0.rb
|
150
155
|
- lib/muffin_man/product_fees/v0.rb
|
151
156
|
- lib/muffin_man/product_pricing/v0.rb
|