beyond_api 0.19.0.pre → 0.20.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2d0989b9c2efdb165c8411d97aac823941fc1eae61e2dac30352746191fa146
4
- data.tar.gz: 449c75efb650ec8b65f9686c5993b2d6ab643002f1732e9fb8c28c24ce574a38
3
+ metadata.gz: '084d3533192827ae43bcbbdcef706d5e6a3fd9ab7c518492c87dcf57e2ff8233'
4
+ data.tar.gz: e28b3a3526b2a97eb511137acf723345512dadcaa9fd7532990245ef0846d572
5
5
  SHA512:
6
- metadata.gz: 5e3aabaf8efe9424ecca4a4df173d8ecb370ff73e60144c2bdf1306f889b1dc3bb62ffe0f12307b8c12ce9c52b8f74e86d43362d69f4f405274ede477bf9fd69
7
- data.tar.gz: beea89efdd34dd846ded24f57f0e64f8ec0202146efcdd239f7b06b2ff99b2cd2a0a30fb7ef250afd3509cf3e538a990fedc9ae7250852c0dc4411bc1b805cc4
6
+ metadata.gz: 25f33bb7cefa616071fb0b29bbf1c9a104eeb963407e58049a61ee80d9fa93e920859350129c6c398160e357b2de0fb3c9bbf2da4aac63c61cfeccf5f2154e5c
7
+ data.tar.gz: ca5922134ab627f9fa3482e4a4b367bd0b1252df4a15f6536045b5390518876c597dbedeca3738c51c16402d7dafdf67bc314c3e995398d421d1d7dca0bde74d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### v0.20.0.pre
2
+
3
+ * features
4
+ * Add product search method
5
+ * `Products#search`
6
+
1
7
  ### v0.19.0.pre
2
8
 
3
9
  * features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.19.0.pre)
4
+ beyond_api (0.20.0.pre)
5
5
  faraday (~> 1.8.0)
6
6
 
7
7
  GEM
@@ -4,6 +4,67 @@ require "beyond_api/utils"
4
4
 
5
5
  module BeyondApi
6
6
  module ProductSearches
7
+ #
8
+ # A +POST+ request is used to search for products by a search term. Optionally, you can also filter the search results.
9
+ #
10
+ # $ curl 'https://api-shop.beyondshop.cloud/api/products/search' -i -X POST \
11
+ # -H 'Content-Type: application/hal+json;charset=UTF-8' \
12
+ # -H 'Accept: application/hal+json' \
13
+ # -H 'Authorization: Bearer <Access token>'
14
+ # -d '{
15
+ # "search" : {
16
+ # "term" : "Tony Highfinger, Poloshirt, Men",
17
+ # "category" : "NAME"
18
+ # },
19
+ # "filters" : [ {
20
+ # "key" : "status",
21
+ # "values" : [ "PUBLISHED" ]
22
+ # } ],
23
+ # "paging" : {
24
+ # "page" : 0,
25
+ # "pageSize" : 20,
26
+ # "sort" : {
27
+ # "property" : "name",
28
+ # "direction" : "ASC"
29
+ # }
30
+ # }
31
+ # }'
32
+ #
33
+ # @beyond_api.scopes +prod:r+
34
+ #
35
+ # @param body [String] the request body
36
+ #
37
+ # @return [OpenStruct]
38
+ #
39
+ # @example
40
+ # body = {
41
+ # search: {
42
+ # term: "Tony Highfinger, Poloshirt, Men",
43
+ # category: "NAME"
44
+ # },
45
+ # filters: [ {
46
+ # key: "status",
47
+ # values: [ "PUBLISHED" ]
48
+ # } ],
49
+ # paging: {
50
+ # page: 0,
51
+ # page_size: 20,
52
+ # sort: {
53
+ # property: "name",
54
+ # direction: "ASC"
55
+ # }
56
+ # }
57
+ # }
58
+ # @products = session.product.search(body)
59
+ #
60
+ def search(body)
61
+ response, status = BeyondApi::Request.post(@session,
62
+ "/products/search",
63
+ body)
64
+
65
+ handle_response(response, status)
66
+ end
67
+
7
68
  #
8
69
  # A +GET+ request is used to search for a product by SKU.
9
70
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondApi
4
- VERSION = "0.19.0.pre"
4
+ VERSION = "0.20.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.19.0.pre
4
+ version: 0.20.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-12-01 00:00:00.000000000 Z
14
+ date: 2021-12-03 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.2.16
246
+ rubygems_version: 3.0.3
247
247
  signing_key:
248
248
  specification_version: 4
249
249
  summary: Ruby client to access the Beyond API