akeneo 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/akeneo.gemspec +1 -1
- data/lib/akeneo/api.rb +7 -10
- data/lib/akeneo/service_base.rb +15 -4
- 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: e7106ae925bd2cad04c32f0c7352c2d56dcff9ea011966a993b84701b0a10646
|
4
|
+
data.tar.gz: a2af5399f0b6bdc968633af6f9271fa694588183d28b78ee27651bcb294d665b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb9c83524f92918b7a6aa40184788db6da2161101f5d6d313f29589dd36677e84b1beba8924e5d7ff5e39c29a669a73e8fadd4466ac81bf951db12cb8d74161
|
7
|
+
data.tar.gz: da185c7637374c421ff0333940c33be170a9f101902e1a3679c136d72780e0000de65b6b4744a2792800b0fa419539dea10e204d1a410cc66b712878000d0bb3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
akeneo (1.
|
4
|
+
akeneo (1.7.1)
|
5
5
|
httparty (~> 0.17.0)
|
6
6
|
mime-types
|
7
7
|
redis
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
public_suffix (3.0.3)
|
34
34
|
rainbow (3.0.0)
|
35
35
|
rake (12.3.2)
|
36
|
-
redis (4.1.
|
36
|
+
redis (4.1.2)
|
37
37
|
rspec (3.8.0)
|
38
38
|
rspec-core (~> 3.8.0)
|
39
39
|
rspec-expectations (~> 3.8.0)
|
data/akeneo.gemspec
CHANGED
data/lib/akeneo/api.rb
CHANGED
@@ -19,8 +19,8 @@ module Akeneo
|
|
19
19
|
authorization_service.fresh_access_token
|
20
20
|
end
|
21
21
|
|
22
|
-
def product(
|
23
|
-
product_service.find(
|
22
|
+
def product(code)
|
23
|
+
product_service.find(code)
|
24
24
|
end
|
25
25
|
|
26
26
|
def products(with_family: nil, with_completeness: nil, updated_after: nil)
|
@@ -78,8 +78,8 @@ module Akeneo
|
|
78
78
|
product_model_service.find(product_parent['parent'])
|
79
79
|
end
|
80
80
|
|
81
|
-
def family(
|
82
|
-
family_service.find(
|
81
|
+
def family(code)
|
82
|
+
family_service.find(code)
|
83
83
|
end
|
84
84
|
|
85
85
|
def family_variant(family_code, family_variant_code)
|
@@ -90,14 +90,11 @@ module Akeneo
|
|
90
90
|
family_variant = family_service.variant(family_code, family_variant_code)
|
91
91
|
return [] unless family_variant
|
92
92
|
|
93
|
-
[
|
94
|
-
find_attribute_code_for_level(family_variant, 1),
|
95
|
-
find_attribute_code_for_level(family_variant, 2)
|
96
|
-
].compact
|
93
|
+
[find_attribute_code_for_level(family_variant, 1), find_attribute_code_for_level(family_variant, 2)].compact
|
97
94
|
end
|
98
95
|
|
99
|
-
def brothers_and_sisters(
|
100
|
-
product_service.brothers_and_sisters(
|
96
|
+
def brothers_and_sisters(code)
|
97
|
+
product_service.brothers_and_sisters(code)
|
101
98
|
end
|
102
99
|
|
103
100
|
def attribute(code)
|
data/lib/akeneo/service_base.rb
CHANGED
@@ -9,6 +9,7 @@ module Akeneo
|
|
9
9
|
class ServiceBase
|
10
10
|
prepend Cache
|
11
11
|
|
12
|
+
API_VERSION = 'v1'
|
12
13
|
DEFAULT_PAGINATION_TYPE = :search_after
|
13
14
|
DEFAULT_PAGINATION_LIMIT = 100
|
14
15
|
|
@@ -55,21 +56,21 @@ module Akeneo
|
|
55
56
|
|
56
57
|
def get_request(path, options = {})
|
57
58
|
HTTParty.get(
|
58
|
-
|
59
|
+
build_url(path),
|
59
60
|
options.merge(headers: default_request_headers)
|
60
61
|
)
|
61
62
|
end
|
62
63
|
|
63
64
|
def patch_request(path, options = {})
|
64
65
|
HTTParty.patch(
|
65
|
-
|
66
|
+
build_url(path),
|
66
67
|
options.merge(headers: default_request_headers)
|
67
68
|
)
|
68
69
|
end
|
69
70
|
|
70
71
|
def patch_for_collection_request(path, options = {})
|
71
72
|
HTTParty.patch(
|
72
|
-
|
73
|
+
build_url(path),
|
73
74
|
options.merge(headers: collection_request_headers)
|
74
75
|
)
|
75
76
|
end
|
@@ -92,7 +93,17 @@ module Akeneo
|
|
92
93
|
return unless response.success?
|
93
94
|
|
94
95
|
url = response.parsed_response.dig('_links', 'next', 'href')
|
95
|
-
url.to_s.split(
|
96
|
+
url.to_s.split("/api/rest/#{API_VERSION}").last
|
97
|
+
end
|
98
|
+
|
99
|
+
def build_url(path)
|
100
|
+
"#{@url}/api/rest/#{API_VERSION}#{escape_path(path)}"
|
101
|
+
end
|
102
|
+
|
103
|
+
def escape_path(path)
|
104
|
+
return if path.nil?
|
105
|
+
|
106
|
+
path.to_s.gsub(' ', '%20')
|
96
107
|
end
|
97
108
|
end
|
98
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akeneo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AWN Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|