publishing_platform_api_adapters 0.12.0 → 0.13.0

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: 7d98513bb44934332a9fe5a7e64933d721d2978aae2244b3f482ce8940ee81fe
4
- data.tar.gz: 9472ad4033345b101e7e39291b7658f1d3c9d7abb9e436f99ad94411e4c6c651
3
+ metadata.gz: c489cc0c17611c94c8d182dc12064cfeec8a77e6aef3d61e70c2e83ee06a9218
4
+ data.tar.gz: c08de2b92e99185097aa3eb834196aa5289b023dbe8b3170d58b848c50d46aa8
5
5
  SHA512:
6
- metadata.gz: c0eccb8a41e6b80059a13c772f9943b4a1989df6e36e4e47abfe71db925c8402758dea35db9ce35709b80de34ec29ef2ae30377a3ef2e5ecf080c4b9c36ed7d5
7
- data.tar.gz: 98294ca2cf9e577ccd4a3708268d584dbdb20385eb7b8c182a31bf8ee87da7b4f1c24eddb967ce1766da847d362ba258e1ac110aa41eceadab35a3c4361baea5
6
+ metadata.gz: afebcbc50bb0d165f63c13f1c01517f1065ea6db1c068ff2c3377d26ede37572276d78fc96a0015228ba4032dc81cebd8dd904e3d1adb816f0a097719e6b0b17
7
+ data.tar.gz: ae01a6fc51589ad66d1500f43f4ce3a84edaa8caa49f25a3bb3146c529535bfc4c7fe95fcf0717fcdfcf2c5c63bfc8ca965119498d3c5a262e2f4b588acf79b5
@@ -0,0 +1,15 @@
1
+ require_relative "base"
2
+ require "rack/utils"
3
+
4
+ module PublishingPlatformApi
5
+ # @api documented
6
+ class Search < Base
7
+ # Perform a search.
8
+ #
9
+ # @param args [Hash] A valid search query. See search-api documentation for options.
10
+ def search(args, additional_headers = {})
11
+ request_url = "#{endpoint}/search.json?#{Rack::Utils.build_nested_query(args)}"
12
+ get_json(request_url, additional_headers)
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PublishingPlatformApi
4
- VERSION = "0.12.0"
4
+ VERSION = "0.13.0"
5
5
  end
@@ -6,6 +6,7 @@ require "publishing_platform_api/content_store"
6
6
  require "publishing_platform_api/publishing_api"
7
7
  require "publishing_platform_api/organisations"
8
8
  require "publishing_platform_api/router"
9
+ require "publishing_platform_api/search"
9
10
 
10
11
  # @api documented
11
12
  module PublishingPlatformApi
@@ -72,4 +73,14 @@ module PublishingPlatformApi
72
73
  { bearer_token: ENV["ROUTER_API_BEARER_TOKEN"] }.merge(options),
73
74
  )
74
75
  end
76
+
77
+ # Creates a PublishingPlatformApi::Search adapter to access via a search.* hostname
78
+ #
79
+ # @return [PublishingPlatformApi::Search]
80
+ def self.search(options = {})
81
+ PublishingPlatformApi::Search.new(
82
+ PublishingPlatformLocation.find("search-api"),
83
+ options,
84
+ )
85
+ end
75
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publishing_platform_api_adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Publishing Platform
@@ -199,6 +199,7 @@ files:
199
199
  - lib/publishing_platform_api/railtie.rb
200
200
  - lib/publishing_platform_api/response.rb
201
201
  - lib/publishing_platform_api/router.rb
202
+ - lib/publishing_platform_api/search.rb
202
203
  - lib/publishing_platform_api/test_helpers/asset_manager.rb
203
204
  - lib/publishing_platform_api/test_helpers/common_responses.rb
204
205
  - lib/publishing_platform_api/test_helpers/content_item_helpers.rb
@@ -225,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  - !ruby/object:Gem::Version
226
227
  version: '0'
227
228
  requirements: []
228
- rubygems_version: 4.0.2
229
+ rubygems_version: 4.0.6
229
230
  specification_version: 4
230
231
  summary: Adapters to work with Publishing Platform APIs
231
232
  test_files: []