beyond_api 0.23.0.pre → 0.24.0.pre

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: 88d9a67d129db14679f16fd1728f729befc0c1f835da84004a7ae6b372747d74
4
- data.tar.gz: 6f94b54fdc048cb9e4c9eddb4d19cb5376891d9e04d663b4e9fc8c6139de16f7
3
+ metadata.gz: 6da6567d2a64ac33b9c160fccaf6c8cd694b752450517b20ac60a9040c8227b6
4
+ data.tar.gz: c88ebfdc202da7b8b17d14031bd1502b319a5754c3f575e96ba258b1641932dc
5
5
  SHA512:
6
- metadata.gz: 621abe68a32f9cffc620b3af736b108d8e7ffe05c06be660216d8e1adb55f3695fde69be2324d52454f3f11593c98d2191f62df437df009bb536416c2809d16b
7
- data.tar.gz: 5d9e908136b7ad10760379b5f12078e9d11bd7d8d58b65cc12d8ccb5161ea10a2be816f161356d00f4881a81831f7630bdc56175101ba7458ead3e3a5b86bd34
6
+ metadata.gz: f954f6572aed87a243514cf798da0550e12013f26b1c0668379662318c959b0697ae74ab26795711298f3b05636cc7293622e6e9e7ef97cf51ad59463fcc4d98
7
+ data.tar.gz: f48e8d78fa746d5166faca83e9713456f172626f49c5f2e2af3e6a999a30bdc480d9e48eadeff49ba60cfe0a8f4a1f5120f8b01b215e7ab1ae537a1805fccfb3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### v0.24.0.pre
2
+
3
+ * features
4
+ * Add category preview method
5
+ * `CategoriesView#preview`
6
+
1
7
  ### v0.23.0.pre
2
8
 
3
9
  * feature
@@ -20,6 +26,7 @@
20
26
 
21
27
  * features
22
28
  * Add `Variations#sort_images` method
29
+
23
30
  ### v0.20.0.pre
24
31
 
25
32
  * features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.23.0.pre)
4
+ beyond_api (0.24.0.pre)
5
5
  faraday (~> 1.9.0)
6
6
 
7
7
  GEM
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondApi
4
- VERSION = "0.23.0.pre"
4
+ VERSION = "0.24.0.pre"
5
5
  end
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.23.0.pre
4
+ version: 0.24.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: 2023-05-25 00:00:00.000000000 Z
14
+ date: 2023-10-06 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.7
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