amzn_sp_api 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a479c21b1f86bf4691e808b07cd8d6f8c1e07279f386af90ed47b7cd1e879981
|
4
|
+
data.tar.gz: 03005c132e4945257e0e56552814c7a7021b6cecd18976d61056e85f7e4bf2d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa6d95db9b0fa85a43855f28178b28984e5447de1355dfe7dde907426137366eaff59ffb79baaf8087039d65e31c8ada1d70275118dbe0570be5b7ad8b958fd
|
7
|
+
data.tar.gz: 730ebd84560cf052abcdd72db224065c22bc3a349f2c2ab339587ae2453a3885be09f429ae5ec09351c41473faefdca37ef91f2add89c0db5d32bb2d1c5a1b99
|
data/Gemfile.lock
CHANGED
@@ -39,11 +39,13 @@ module AmznSpApi
|
|
39
39
|
new_access_token.config.host = 'api.amazon.com'
|
40
40
|
|
41
41
|
header_params = { 'Content-Type' => 'application/x-www-form-urlencoded' }
|
42
|
+
grant_type = config.scope.present? ? 'client_credentials' : 'refresh_token'
|
42
43
|
form_params = {
|
43
|
-
grant_type:
|
44
|
+
grant_type: grant_type,
|
44
45
|
refresh_token: config.refresh_token,
|
45
46
|
client_id: config.client_id,
|
46
|
-
client_secret: config.client_secret
|
47
|
+
client_secret: config.client_secret,
|
48
|
+
scope: config.scope
|
47
49
|
}
|
48
50
|
data, status_code, headers = new_access_token.super_call_api(:POST, '/auth/o2/token', header_params: header_params,
|
49
51
|
form_params: form_params, return_type: 'Object')
|
@@ -1,10 +1,21 @@
|
|
1
1
|
require 'amzn_sp_api/configuration'
|
2
2
|
|
3
|
+
# from https://developer-docs.amazon.com/sp-api/docs/connecting-to-the-selling-partner-api
|
3
4
|
module AmznSpApi
|
4
5
|
class SpApiConfiguration < Configuration
|
6
|
+
# The type of access grant requested.
|
7
|
+
# @values: refresh_token Use this for calling operations that require authorization from a selling partner. All operations that are not grantless operations require authorization from a selling partner. When specifying this value, include the refresh_token parameter.
|
8
|
+
# @values: client_credentials Use this for calling grantless operations. When specifying this value, include the parameter.scope
|
9
|
+
attr_accessor :grant_type
|
10
|
+
|
5
11
|
# The LWA refresh token.
|
6
12
|
attr_accessor :refresh_token
|
7
13
|
|
14
|
+
# The scope of the LWA authorization grant.
|
15
|
+
# @values: sellingpartnerapi::notifications. For the Notifications API.
|
16
|
+
# @values: sellingpartnerapi::migration. For the Authorization API.
|
17
|
+
attr_accessor :scope
|
18
|
+
|
8
19
|
# The LWA client identifier.
|
9
20
|
attr_accessor :client_id
|
10
21
|
|
@@ -31,6 +42,12 @@ module AmznSpApi
|
|
31
42
|
|
32
43
|
attr_accessor :get_access_token
|
33
44
|
|
45
|
+
# from https://developer-docs.amazon.com/sp-api/docs/connecting-to-the-selling-partner-api#step-1-request-a-login-with-amazon-access-token
|
46
|
+
SCOPE = {
|
47
|
+
'client_credentials' => 'sellingpartnerapi::notifications',
|
48
|
+
'refresh_token' => 'sellingpartnerapi::migration'
|
49
|
+
}.freeze
|
50
|
+
|
34
51
|
# from https://developer-docs.amazon.com/sp-api/docs/sp-api-endpoints
|
35
52
|
AWS_REGION_MAP = {
|
36
53
|
'na' => 'us-east-1',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amzn_sp_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zevinto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sigv4
|