beyond_api 0.4.0.pre → 0.5.0.pre
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +2 -2
- data/lib/beyond_api/ext.rb +11 -0
- data/lib/beyond_api/request.rb +1 -1
- data/lib/beyond_api/resources/products.rb +8 -0
- data/lib/beyond_api/resources/variations.rb +2 -0
- data/lib/beyond_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f5722d39666c38bb6841935cb63bd8da7d2df05e511b83091f000f7733385ab
|
4
|
+
data.tar.gz: 6e2a20dc312c23b53ba5b8bce7cb43ac19ac1e821cbf04a9ba98aa7316838f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb2dd3dd349cc524ba03258c92bb21798fc47a72d164791acde044afb113480f2799823eea1491f8c903ef6e81c408630330e554a8e79fc3b1163b04358406b4
|
7
|
+
data.tar.gz: 691bb06fdf8bb6d7e25dd46054ee41d0f66cac08356ce2bb36ccc368f3e55092f1967b8cee9ac6596f7dfe8b2a98cd07f653d58feb26e5216f791d32dc530788
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
### v0.5.0.pre
|
2
|
+
|
3
|
+
* bug-fixes
|
4
|
+
* Fix handling of array as request body
|
5
|
+
* Include `BeyondApi::ProductAttachments` module into `BeyondApi::Products` class
|
6
|
+
* Include `BeyondApi::ProductAvailability` module into `BeyondApi::Products` class
|
7
|
+
* Include `BeyondApi::ProductSearches` module into `BeyondApi::Products` class
|
8
|
+
* Include `BeyondApi::ProductVariationProperties` module into `BeyondApi::Products` class
|
9
|
+
* Include `BeyondApi::VariationAvailability` module into `BeyondApi::Variations` class
|
10
|
+
|
1
11
|
### v0.4.0.pre
|
2
12
|
|
3
13
|
* bug-fixes
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
beyond_api (0.
|
4
|
+
beyond_api (0.5.0.pre)
|
5
5
|
faraday (~> 0.15)
|
6
6
|
|
7
7
|
GEM
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
dotenv (2.7.5)
|
14
14
|
faker (2.4.0)
|
15
15
|
i18n (~> 1.6.0)
|
16
|
-
faraday (0.17.
|
16
|
+
faraday (0.17.1)
|
17
17
|
multipart-post (>= 1.2, < 3)
|
18
18
|
i18n (1.6.0)
|
19
19
|
concurrent-ruby (~> 1.0)
|
data/lib/beyond_api/ext.rb
CHANGED
@@ -41,3 +41,14 @@ class String
|
|
41
41
|
string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub("/", "::")
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
class Array
|
46
|
+
def camelize_keys
|
47
|
+
map do |elem|
|
48
|
+
case elem
|
49
|
+
when Hash, Array; elem.camelize_keys
|
50
|
+
else; elem
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/beyond_api/request.rb
CHANGED
@@ -23,7 +23,7 @@ module BeyondApi
|
|
23
23
|
request.url(session.api_url + path)
|
24
24
|
request.headers['Authorization'] = "Bearer #{ session.access_token }"
|
25
25
|
request.params = params.to_h.camelize_keys
|
26
|
-
request.body = body.
|
26
|
+
request.body = body.camelize_keys.to_json
|
27
27
|
end
|
28
28
|
|
29
29
|
[response.body.blank? ? nil : JSON.parse(response.body), response.status]
|
@@ -1,13 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "beyond_api/utils"
|
4
|
+
require "beyond_api/resources/products/attachments"
|
5
|
+
require "beyond_api/resources/products/availability"
|
4
6
|
require "beyond_api/resources/products/custom_attributes"
|
5
7
|
require "beyond_api/resources/products/images"
|
8
|
+
require "beyond_api/resources/products/searches"
|
9
|
+
require "beyond_api/resources/products/variation_properties"
|
6
10
|
|
7
11
|
module BeyondApi
|
8
12
|
class Products < Base
|
13
|
+
include BeyondApi::ProductAttachments
|
14
|
+
include BeyondApi::ProductAvailability
|
9
15
|
include BeyondApi::ProductCustomAttributes
|
10
16
|
include BeyondApi::ProductImages
|
17
|
+
include BeyondApi::ProductSearches
|
18
|
+
include BeyondApi::ProductVariationProperties
|
11
19
|
include BeyondApi::Utils
|
12
20
|
|
13
21
|
#
|
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.5.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unai Abrisketa
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-11-
|
13
|
+
date: 2019-11-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|