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 +4 -4
- data/lib/publishing_platform_api/search.rb +15 -0
- data/lib/publishing_platform_api/version.rb +1 -1
- data/lib/publishing_platform_api.rb +11 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c489cc0c17611c94c8d182dc12064cfeec8a77e6aef3d61e70c2e83ee06a9218
|
|
4
|
+
data.tar.gz: c08de2b92e99185097aa3eb834196aa5289b023dbe8b3170d58b848c50d46aa8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
@@ -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.
|
|
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.
|
|
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: []
|