gds-api-adapters 82.0.0 → 84.0.0

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: 872ba36d055a825032e704df99c551581f06010b0b203da72284ea239e3b5170
4
- data.tar.gz: 9b381ac3dc7dcccf7956bfa550da62aaaa6eda85cfbac949dc0c1df026321a50
3
+ metadata.gz: ebd8c9876a6c89de5d0fdae4fcee5466c37e79e64d6841b02bb52ec581876166
4
+ data.tar.gz: 64702ddd905480c111b7da1da758825d15d79d351dc9c4c14fd62308f16ab374
5
5
  SHA512:
6
- metadata.gz: 9461e317a1c2e73c3f5239723acd9abd279d7d5e9e2c4770318f667de7d087b73651ca35097fc484ef719798a8a958335e75c25c8903099d53a551946430cd30
7
- data.tar.gz: 546ec075f67798bd91f3ae0d584ee06ed22b81ab8382a912cac34ff000cb370c843159ea3282d68e29b15d9ae881d167af63fdc96d820c05f706ad736831b61c
6
+ metadata.gz: 177b9edcbb43ea4b9c5b0bd3df452e69a14458af851cb7339524a10c6f5a6d8439db588a9725350a9424ea336dfd2f464763be036112790be9d15ce48d98bde7
7
+ data.tar.gz: c0ed5d8e02c058ca2c848ccf0e9235f664e7e263a0df3d5fa242a07b4c47953d28f3651e1f64567d07cfbd8286dc96a27695862fb13a0ed5577305a62874a9a4
@@ -30,16 +30,6 @@ class GdsApi::Imminence < GdsApi::Base
30
30
  get_raw("#{@endpoint}/places/#{type}.kml").body
31
31
  end
32
32
 
33
- def areas_for_postcode(postcode)
34
- url = "#{@endpoint}/areas/#{uri_encode(postcode)}.json"
35
- get_json(url)
36
- end
37
-
38
- def areas_for_type(type)
39
- url = "#{@endpoint}/areas/#{type}.json"
40
- get_json(url)
41
- end
42
-
43
33
  # @private
44
34
  def self.extract_location_hash(location)
45
35
  # Deal with all known location formats:
@@ -1,7 +1,7 @@
1
1
  module GdsApi
2
2
  module TestHelpers
3
3
  module AssetManager
4
- ASSET_MANAGER_ENDPOINT = Plek.current.find("asset-manager")
4
+ ASSET_MANAGER_ENDPOINT = Plek.find("asset-manager")
5
5
 
6
6
  def stub_any_asset_manager_call
7
7
  stub_request(:any, %r{\A#{ASSET_MANAGER_ENDPOINT}}).to_return(status: 200)
@@ -8,7 +8,7 @@ module GdsApi
8
8
  include ContentItemHelpers
9
9
 
10
10
  def content_store_endpoint(draft: false)
11
- draft ? Plek.current.find("draft-content-store") : Plek.current.find("content-store")
11
+ draft ? Plek.find("draft-content-store") : Plek.find("content-store")
12
12
  end
13
13
 
14
14
  # Stubs a content item in the content store.
@@ -5,28 +5,13 @@ module GdsApi
5
5
  module Imminence
6
6
  # Generally true. If you are initializing the client differently,
7
7
  # you could redefine/override the constant or stub directly.
8
- IMMINENCE_API_ENDPOINT = Plek.current.find("imminence")
8
+ IMMINENCE_API_ENDPOINT = Plek.find("imminence")
9
9
 
10
10
  def stub_imminence_has_places(latitude, longitude, details)
11
11
  query_hash = { "lat" => latitude, "lng" => longitude, "limit" => "5" }
12
12
  stub_imminence_places_request(details["slug"], query_hash, details["details"])
13
13
  end
14
14
 
15
- def stub_imminence_has_areas_for_postcode(postcode, areas)
16
- results = {
17
- "_response_info" => { "status" => "ok" },
18
- "total" => areas.size,
19
- "startIndex" => 1,
20
- "pageSize" => areas.size,
21
- "currentPage" => 1,
22
- "pages" => 1,
23
- "results" => areas,
24
- }
25
-
26
- stub_request(:get, %r{\A#{IMMINENCE_API_ENDPOINT}/areas/#{postcode}\.json})
27
- .to_return(body: results.to_json)
28
- end
29
-
30
15
  def stub_imminence_has_places_for_postcode(places, slug, postcode, limit)
31
16
  query_hash = { "postcode" => postcode, "limit" => limit }
32
17
  stub_imminence_places_request(slug, query_hash, places)
@@ -5,7 +5,7 @@ module GdsApi
5
5
  module LicenceApplication
6
6
  # Generally true. If you are initializing the client differently,
7
7
  # you could redefine/override the constant or stub directly.
8
- LICENCE_APPLICATION_ENDPOINT = Plek.current.find("licensify")
8
+ LICENCE_APPLICATION_ENDPOINT = Plek.find("licensify")
9
9
 
10
10
  def stub_licence_exists(identifier, licence)
11
11
  licence = licence.to_json unless licence.is_a?(String)
@@ -3,7 +3,7 @@ require "gds_api/test_helpers/json_client_helper"
3
3
  module GdsApi
4
4
  module TestHelpers
5
5
  module LinkCheckerApi
6
- LINK_CHECKER_API_ENDPOINT = Plek.current.find("link-checker-api")
6
+ LINK_CHECKER_API_ENDPOINT = Plek.find("link-checker-api")
7
7
 
8
8
  def link_checker_api_link_report_hash(uri:, status: :ok, checked: nil, errors: [], warnings: [], problem_summary: nil, suggested_fix: nil)
9
9
  {
@@ -3,7 +3,7 @@ require "gds_api/test_helpers/json_client_helper"
3
3
  module GdsApi
4
4
  module TestHelpers
5
5
  module LocalLinksManager
6
- LOCAL_LINKS_MANAGER_ENDPOINT = Plek.current.find("local-links-manager")
6
+ LOCAL_LINKS_MANAGER_ENDPOINT = Plek.find("local-links-manager")
7
7
 
8
8
  def stub_local_links_manager_has_a_link(authority_slug:, lgsl:, lgil:, url:, country_name: "England", status: "ok", snac: "00AG", local_custodian_code: nil)
9
9
  response = {
@@ -1,7 +1,7 @@
1
1
  module GdsApi
2
2
  module TestHelpers
3
3
  module LocationsApi
4
- LOCATIONS_API_ENDPOINT = Plek.current.find("locations-api")
4
+ LOCATIONS_API_ENDPOINT = Plek.find("locations-api")
5
5
 
6
6
  def stub_locations_api_has_location(postcode, locations)
7
7
  results = []
@@ -1,7 +1,7 @@
1
1
  module GdsApi
2
2
  module TestHelpers
3
3
  module Mapit
4
- MAPIT_ENDPOINT = Plek.current.find("mapit")
4
+ MAPIT_ENDPOINT = Plek.find("mapit")
5
5
 
6
6
  def stub_mapit_has_a_postcode(postcode, coords)
7
7
  response = {
@@ -8,8 +8,8 @@ module GdsApi
8
8
  module PublishingApi
9
9
  include ContentItemHelpers
10
10
 
11
- PUBLISHING_API_V2_ENDPOINT = "#{Plek.current.find('publishing-api')}/v2".freeze
12
- PUBLISHING_API_ENDPOINT = Plek.current.find("publishing-api")
11
+ PUBLISHING_API_V2_ENDPOINT = "#{Plek.find('publishing-api')}/v2".freeze
12
+ PUBLISHING_API_ENDPOINT = Plek.find("publishing-api")
13
13
 
14
14
  # Stub a PUT /v2/content/:content_id request with the given content id and request body.
15
15
  # if no response_hash is given, a default response as follows is created:
@@ -3,7 +3,7 @@ require "gds_api/test_helpers/json_client_helper"
3
3
  module GdsApi
4
4
  module TestHelpers
5
5
  module Router
6
- ROUTER_API_ENDPOINT = Plek.current.find("router-api")
6
+ ROUTER_API_ENDPOINT = Plek.find("router-api")
7
7
 
8
8
  def stub_router_has_route(path, route, bearer_token = ENV["ROUTER_API_BEARER_TOKEN"])
9
9
  stub_get_route(path, bearer_token).to_return(
@@ -4,7 +4,7 @@ require "gds_api/test_helpers/json_client_helper"
4
4
  module GdsApi
5
5
  module TestHelpers
6
6
  module Search
7
- SEARCH_ENDPOINT = Plek.current.find("search")
7
+ SEARCH_ENDPOINT = Plek.find("search-api")
8
8
 
9
9
  def stub_any_search_post(index: nil)
10
10
  if index
@@ -1,7 +1,7 @@
1
1
  module GdsApi
2
2
  module TestHelpers
3
3
  module Support
4
- SUPPORT_ENDPOINT = Plek.current.find("support")
4
+ SUPPORT_ENDPOINT = Plek.find("support")
5
5
 
6
6
  def stub_support_foi_request_creation(request_details = nil)
7
7
  post_stub = stub_http_request(:post, "#{SUPPORT_ENDPOINT}/foi_requests")
@@ -4,7 +4,7 @@ require "plek"
4
4
  module GdsApi
5
5
  module TestHelpers
6
6
  module SupportApi
7
- SUPPORT_API_ENDPOINT = Plek.current.find("support-api")
7
+ SUPPORT_API_ENDPOINT = Plek.find("support-api")
8
8
 
9
9
  def stub_support_api_problem_report_creation(request_details = nil)
10
10
  post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/problem-reports")
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "82.0.0".freeze
2
+ VERSION = "84.0.0".freeze
3
3
  end
data/lib/gds_api.rb CHANGED
@@ -179,7 +179,7 @@ module GdsApi
179
179
  #
180
180
  # @return [GdsApi::Search]
181
181
  def self.search(options = {})
182
- GdsApi::Search.new(Plek.find("search"), options)
182
+ GdsApi::Search.new(Plek.find("search-api"), options)
183
183
  end
184
184
 
185
185
  # Creates a GdsApi::Support adapter
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 82.0.0
4
+ version: 84.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-12 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable