beyond_api 0.23.0.pre → 0.24.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d8675fa4225b9cbbab16aed477c2bc119be330cde5be9249e363263c292e7df
|
4
|
+
data.tar.gz: 4672536fd5daf3777a55cf253d699447c77c61d26905d65736fde17a4fa42b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b194a0f1819933338bd3241807a65372e4f6a44c440dcd3b7b575a39d188bff7fd4e5af7b97556984f95c5ccce820e73ac0de23691458cadac51588874095af
|
7
|
+
data.tar.gz: d47dad7d298e7b9093a545e28083ea42d0ed3d717d65d7ad6e6bbb0f04c4dd694d66778cd376e4882be956a2eb4c3b7083c62025c7c4d13beb0a91650f39a82e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### v0.24.1.pre
|
2
|
+
|
3
|
+
* bug-fixes
|
4
|
+
* Fix image upload
|
5
|
+
|
6
|
+
### v0.24.0.pre
|
7
|
+
|
8
|
+
* features
|
9
|
+
* Add category preview method
|
10
|
+
* `CategoriesView#preview`
|
11
|
+
|
1
12
|
### v0.23.0.pre
|
2
13
|
|
3
14
|
* feature
|
@@ -20,6 +31,7 @@
|
|
20
31
|
|
21
32
|
* features
|
22
33
|
* Add `Variations#sort_images` method
|
34
|
+
|
23
35
|
### v0.20.0.pre
|
24
36
|
|
25
37
|
* features
|
data/Gemfile.lock
CHANGED
@@ -48,6 +48,64 @@ module BeyondApi
|
|
48
48
|
handle_response(response, status)
|
49
49
|
end
|
50
50
|
|
51
|
+
#
|
52
|
+
# A +POST+ request is read-only and cannot create data. It is used to find products that match the filter criteria.
|
53
|
+
# Thus, it can be used to preview all products that are included in a category that shares the respective filter criteria.
|
54
|
+
#
|
55
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/preview?page=0&size=10&sortBy=NEWEST_FIRST' -i -X POST \
|
56
|
+
# -H 'Content-Type: application/json' \
|
57
|
+
# -H 'Content-Type: application/json' \
|
58
|
+
# -d '{
|
59
|
+
# "filters" : [ {
|
60
|
+
# "key" : "manufacturer",
|
61
|
+
# "values" : [ "Grape Vineyard" ]
|
62
|
+
# }, {
|
63
|
+
# "key" : "all_tags",
|
64
|
+
# "values" : [ "Power Bar", "Bestseller", "High Protein" ]
|
65
|
+
# }, {
|
66
|
+
# "key" : "price_range",
|
67
|
+
# "min" : 3.7,
|
68
|
+
# "max" : 13.7
|
69
|
+
# } ]
|
70
|
+
# }'
|
71
|
+
#
|
72
|
+
# @param body [Hash] the request body
|
73
|
+
# @option params [Integer] :size the page size
|
74
|
+
# @option params [Integer] :page the page number
|
75
|
+
# @option params [String] :sort_by the sorting applied to the list of products
|
76
|
+
#
|
77
|
+
# @return [OpenStruct]
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# body = {
|
81
|
+
# filters => [
|
82
|
+
# {
|
83
|
+
# key => "manufacturer",
|
84
|
+
# values => [ "Grape Vineyard" ]
|
85
|
+
# },
|
86
|
+
# {
|
87
|
+
# key => "all_tags",
|
88
|
+
# values => [ "Power Bar", "Bestseller", "High Protein" ]
|
89
|
+
# },
|
90
|
+
# {
|
91
|
+
# key => "price_range",
|
92
|
+
# min => 3.7,
|
93
|
+
# max => 13.7
|
94
|
+
# }
|
95
|
+
# ]
|
96
|
+
# }
|
97
|
+
#
|
98
|
+
# @products = session.categories_view.preview(body, { size: 100, page: 0, sort_by: "NEWEST_FIRST" })
|
99
|
+
#
|
100
|
+
def preview(body, params = {})
|
101
|
+
response, status = BeyondApi::Request.post(@session,
|
102
|
+
"/product-view/categories/preview",
|
103
|
+
body,
|
104
|
+
params)
|
105
|
+
|
106
|
+
handle_response(response, status)
|
107
|
+
end
|
108
|
+
|
51
109
|
#
|
52
110
|
# A +GET+ request is used to list all products of a category.
|
53
111
|
#
|
@@ -221,7 +221,7 @@ module BeyondApi
|
|
221
221
|
response, status = BeyondApi::Request.upload_by_form(@session,
|
222
222
|
"/products/#{product_id}/images",
|
223
223
|
images_path,
|
224
|
-
file_name: images_name)
|
224
|
+
file_name: images_name.map { |e| URI.encode_www_form([e]) })
|
225
225
|
|
226
226
|
handle_response(response, status)
|
227
227
|
end
|
@@ -226,7 +226,7 @@ module BeyondApi
|
|
226
226
|
response, status = BeyondApi::Request.upload_by_form(@session,
|
227
227
|
"/products/#{product_id}/variations/#{variation_id}/images",
|
228
228
|
images_path,
|
229
|
-
file_name: images_name)
|
229
|
+
file_name: images_name.map { |e| URI.encode_www_form([e]) })
|
230
230
|
|
231
231
|
handle_response(response, status)
|
232
232
|
end
|
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.24.1.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: 2023-
|
14
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: 1.3.1
|
245
245
|
requirements: []
|
246
|
-
rubygems_version: 3.3.
|
246
|
+
rubygems_version: 3.3.3
|
247
247
|
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: Ruby client to access the Beyond API
|