beyond_api 0.17.0.pre → 0.18.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +2 -2
- data/lib/beyond_api/resources/products.rb +4 -4
- data/lib/beyond_api/resources/token.rb +16 -15
- data/lib/beyond_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b48b71a8bbe959b3250221b561ea742a3d82e0d80a0f0b9f4638cc2f57b5ed
|
4
|
+
data.tar.gz: 4c9353fd93cef022310c1b7ae1b147776d1e1bc6da94a751adc68f14852efb2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7cbc7f1f943fc00701e2f548756dfa0cc2808cc51096bf0c6a6be5bbf9b7edfcfd16b80ae351251feb3d26f9be0cba23df3fbf093ff4a69b5ff169b0087a297
|
7
|
+
data.tar.gz: 946ce5ce94a725e55ee7e1c172b4094b6146836c5e4f8cb28b4823c0426db1923044c4b4cc22f9f470ff55101a5698be694e82876a05f296510a07d91b465b02
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### v0.18.0.pre
|
2
|
+
|
3
|
+
* features
|
4
|
+
* Add new token retrieval/refresh methods
|
5
|
+
* `Token#authorization_code`
|
6
|
+
* `Token#refresh_token`
|
7
|
+
* `Token#client_credentials`
|
8
|
+
* Add alias methods for avoiding deprecation
|
9
|
+
* `refresh` -> `refresh_token`
|
10
|
+
* `create` -> `authorization_code`
|
11
|
+
|
1
12
|
### v0.17.0.pre
|
2
13
|
|
3
14
|
* enhancements
|
data/Gemfile.lock
CHANGED
@@ -98,8 +98,8 @@ module BeyondApi
|
|
98
98
|
# }
|
99
99
|
# },
|
100
100
|
# "shippingPeriod" : {
|
101
|
-
# "
|
102
|
-
# "
|
101
|
+
# "min" : 2,
|
102
|
+
# "max" : 4,
|
103
103
|
# "displayUnit" : "WEEKS"
|
104
104
|
# }
|
105
105
|
# }'
|
@@ -157,8 +157,8 @@ module BeyondApi
|
|
157
157
|
# }
|
158
158
|
# },
|
159
159
|
# "shippingPeriod": {
|
160
|
-
# "
|
161
|
-
# "
|
160
|
+
# "min": 2,
|
161
|
+
# "max": 4,
|
162
162
|
# "displayUnit": "WEEKS"
|
163
163
|
# }
|
164
164
|
# }
|
@@ -17,31 +17,32 @@ module BeyondApi
|
|
17
17
|
raise InvalidSessionError.new("Session api_url cannot be nil") if session.api_url.nil?
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
|
22
|
-
grant_type: "authorization_code",
|
23
|
-
code: code)
|
24
|
-
|
25
|
-
handle_response(response, status)
|
20
|
+
def authorization_code(code)
|
21
|
+
handle_token_call("authorization_code", code: code)
|
26
22
|
end
|
27
23
|
|
28
|
-
def
|
29
|
-
|
30
|
-
grant_type: "refresh_token",
|
31
|
-
refresh_token: @session.refresh_token)
|
32
|
-
|
33
|
-
handle_response(response, status)
|
24
|
+
def refresh_token
|
25
|
+
handle_token_call("refresh_token", refresh_token: @session.refresh_token)
|
34
26
|
end
|
35
27
|
|
36
28
|
def client_credentials
|
29
|
+
handle_token_call("client_credentials")
|
30
|
+
end
|
31
|
+
|
32
|
+
alias_method :refresh, :refresh_token
|
33
|
+
alias_method :create, :authorization_code
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def handle_token_call(grant_type, params = {})
|
38
|
+
params.merge!(grant_type: grant_type)
|
39
|
+
|
37
40
|
response, status = BeyondApi::Request.token(@session.api_url + "/oauth/token",
|
38
|
-
|
41
|
+
params)
|
39
42
|
|
40
43
|
handle_response(response, status)
|
41
44
|
end
|
42
45
|
|
43
|
-
private
|
44
|
-
|
45
46
|
def handle_response(response, status)
|
46
47
|
if status.between?(200, 299)
|
47
48
|
@session.access_token = response["access_token"]
|
data/lib/beyond_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyond_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unai Abrisketa
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-08-
|
14
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: 1.3.1
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
202
|
+
rubygems_version: 3.2.26
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Ruby client to access the Beyond API
|