gds-api-adapters 95.1.0 → 96.0.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/gds_api/email_alert_api.rb +0 -13
- data/lib/gds_api/{imminence.rb → places_manager.rb} +1 -1
- data/lib/gds_api/test_helpers/email_alert_api.rb +0 -18
- data/lib/gds_api/test_helpers/{imminence.rb → places_manager.rb} +10 -10
- data/lib/gds_api/version.rb +1 -1
- data/lib/gds_api.rb +5 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ab536f0fbe0e60f60edea9d2b153f7c7db489571459b2d87d355d4d31a4f21d
|
4
|
+
data.tar.gz: 0c14e46d9e034a2e18a8c2a8a89b77998cfe9da6d33b7475af87309ea4a9faa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eed5df27e224986a79a0f64e93f130a88e1bac77917ad58b686173a1363ac688b3409831a12ca4f80adbc6183a885a38d1d84e3497e8e9823b52256e13f19c25
|
7
|
+
data.tar.gz: 663b024e797914e9b490b14f278aea5f9071c5fd9429e7e1ab764711f0dcb47a7d61ffcf0085eccfd0f9fac4909a17c0a3e2f006e6c0da8b7ca900a1b53cc75b
|
@@ -273,19 +273,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
273
273
|
)
|
274
274
|
end
|
275
275
|
|
276
|
-
# Migrate all users from one existing subscriber list to another existing subscriber list
|
277
|
-
#
|
278
|
-
# @param [string] to_slug Identifier for the successor subscription list
|
279
|
-
# @param [string] from_slug Identifier for the source subscription list
|
280
|
-
|
281
|
-
def bulk_migrate(from_slug:, to_slug:)
|
282
|
-
post_json(
|
283
|
-
"#{endpoint}/subscriber-lists/bulk-migrate",
|
284
|
-
from_slug:,
|
285
|
-
to_slug:,
|
286
|
-
)
|
287
|
-
end
|
288
|
-
|
289
276
|
# Update subscriber list details, such as title
|
290
277
|
# @param [Hash] params A hash of detail paramaters that can be updated. For example title.
|
291
278
|
# For allowed parameters see:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative "base"
|
2
2
|
|
3
|
-
class GdsApi::
|
3
|
+
class GdsApi::PlacesManager < GdsApi::Base
|
4
4
|
def api_url(type, params)
|
5
5
|
vals = %i[limit lat lng postcode local_authority_slug].select { |p| params.include? p }
|
6
6
|
querystring = URI.encode_www_form(vals.map { |p| [p, params[p]] })
|
@@ -466,24 +466,6 @@ module GdsApi
|
|
466
466
|
.to_return(status: 422)
|
467
467
|
end
|
468
468
|
|
469
|
-
def stub_email_alert_api_bulk_migrate(from_slug:, to_slug:)
|
470
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
471
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
472
|
-
.to_return(status: 202)
|
473
|
-
end
|
474
|
-
|
475
|
-
def stub_email_alert_api_bulk_migrate_bad_request(from_slug:, to_slug:)
|
476
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
477
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
478
|
-
.to_return(status: 422)
|
479
|
-
end
|
480
|
-
|
481
|
-
def stub_email_alert_api_bulk_migrate_not_found(from_slug:, to_slug:)
|
482
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
483
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
484
|
-
.to_return(status: 404)
|
485
|
-
end
|
486
|
-
|
487
469
|
def stub_update_subscriber_list_details(slug:, params:)
|
488
470
|
stub_request(:patch, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}")
|
489
471
|
.with(body: params.to_json)
|
@@ -2,32 +2,32 @@ require "gds_api/test_helpers/json_client_helper"
|
|
2
2
|
|
3
3
|
module GdsApi
|
4
4
|
module TestHelpers
|
5
|
-
module
|
5
|
+
module PlacesManager
|
6
6
|
# Generally true. If you are initializing the client differently,
|
7
7
|
# you could redefine/override the constant or stub directly.
|
8
|
-
|
8
|
+
PLACES_MANAGER_API_ENDPOINT = Plek.find("places-manager")
|
9
9
|
|
10
|
-
def
|
10
|
+
def stub_places_manager_has_places(latitude, longitude, details)
|
11
11
|
query_hash = { "lat" => latitude, "lng" => longitude, "limit" => "5" }
|
12
12
|
response_data = {
|
13
13
|
status: "ok",
|
14
14
|
content: "places",
|
15
15
|
places: details["details"],
|
16
16
|
}
|
17
|
-
|
17
|
+
stub_places_manager_places_request(details["slug"], query_hash, response_data)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def stub_places_manager_has_multiple_authorities_for_postcode(addresses, slug, postcode, limit)
|
21
21
|
query_hash = { "postcode" => postcode, "limit" => limit }
|
22
22
|
response_data = {
|
23
23
|
status: "address-information-required",
|
24
24
|
content: "addresses",
|
25
25
|
addresses:,
|
26
26
|
}
|
27
|
-
|
27
|
+
stub_places_manager_places_request(slug, query_hash, response_data)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def stub_places_manager_has_places_for_postcode(places, slug, postcode, limit, local_authority_slug)
|
31
31
|
query_hash = { "postcode" => postcode, "limit" => limit }
|
32
32
|
query_hash.merge!(local_authority_slug:) if local_authority_slug
|
33
33
|
response_data = {
|
@@ -35,11 +35,11 @@ module GdsApi
|
|
35
35
|
content: "places",
|
36
36
|
places:,
|
37
37
|
}
|
38
|
-
|
38
|
+
stub_places_manager_places_request(slug, query_hash, response_data)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
stub_request(:get, "#{
|
41
|
+
def stub_places_manager_places_request(slug, query_hash, return_data, status_code = 200)
|
42
|
+
stub_request(:get, "#{PLACES_MANAGER_API_ENDPOINT}/places/#{slug}.json")
|
43
43
|
.with(query: query_hash)
|
44
44
|
.to_return(status: status_code, body: return_data.to_json, headers: {})
|
45
45
|
end
|
data/lib/gds_api/version.rb
CHANGED
data/lib/gds_api.rb
CHANGED
@@ -6,7 +6,7 @@ require "gds_api/asset_manager"
|
|
6
6
|
require "gds_api/calendars"
|
7
7
|
require "gds_api/content_store"
|
8
8
|
require "gds_api/email_alert_api"
|
9
|
-
require "gds_api/
|
9
|
+
require "gds_api/places_manager"
|
10
10
|
require "gds_api/licence_application"
|
11
11
|
require "gds_api/link_checker_api"
|
12
12
|
require "gds_api/local_links_manager"
|
@@ -82,11 +82,11 @@ module GdsApi
|
|
82
82
|
)
|
83
83
|
end
|
84
84
|
|
85
|
-
# Creates a GdsApi::
|
85
|
+
# Creates a GdsApi::PlacesManager adapter
|
86
86
|
#
|
87
|
-
# @return [GdsApi::
|
88
|
-
def self.
|
89
|
-
GdsApi::
|
87
|
+
# @return [GdsApi::PlacesManager]
|
88
|
+
def self.places_manager(options = {})
|
89
|
+
GdsApi::PlacesManager.new(Plek.find("places-manager"), options)
|
90
90
|
end
|
91
91
|
|
92
92
|
# Creates a GdsApi::LicenceApplication
|
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:
|
4
|
+
version: 96.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: 2024-
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -337,7 +337,6 @@ files:
|
|
337
337
|
- lib/gds_api/email_alert_api.rb
|
338
338
|
- lib/gds_api/exceptions.rb
|
339
339
|
- lib/gds_api/govuk_headers.rb
|
340
|
-
- lib/gds_api/imminence.rb
|
341
340
|
- lib/gds_api/json_client.rb
|
342
341
|
- lib/gds_api/licence_application.rb
|
343
342
|
- lib/gds_api/link_checker_api.rb
|
@@ -347,6 +346,7 @@ files:
|
|
347
346
|
- lib/gds_api/maslow.rb
|
348
347
|
- lib/gds_api/middleware/govuk_header_sniffer.rb
|
349
348
|
- lib/gds_api/organisations.rb
|
349
|
+
- lib/gds_api/places_manager.rb
|
350
350
|
- lib/gds_api/publishing_api.rb
|
351
351
|
- lib/gds_api/publishing_api/special_route_publisher.rb
|
352
352
|
- lib/gds_api/railtie.rb
|
@@ -363,13 +363,13 @@ files:
|
|
363
363
|
- lib/gds_api/test_helpers/content_item_helpers.rb
|
364
364
|
- lib/gds_api/test_helpers/content_store.rb
|
365
365
|
- lib/gds_api/test_helpers/email_alert_api.rb
|
366
|
-
- lib/gds_api/test_helpers/imminence.rb
|
367
366
|
- lib/gds_api/test_helpers/json_client_helper.rb
|
368
367
|
- lib/gds_api/test_helpers/licence_application.rb
|
369
368
|
- lib/gds_api/test_helpers/link_checker_api.rb
|
370
369
|
- lib/gds_api/test_helpers/local_links_manager.rb
|
371
370
|
- lib/gds_api/test_helpers/locations_api.rb
|
372
371
|
- lib/gds_api/test_helpers/organisations.rb
|
372
|
+
- lib/gds_api/test_helpers/places_manager.rb
|
373
373
|
- lib/gds_api/test_helpers/publishing_api.rb
|
374
374
|
- lib/gds_api/test_helpers/router.rb
|
375
375
|
- lib/gds_api/test_helpers/search.rb
|
@@ -402,7 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
402
402
|
- !ruby/object:Gem::Version
|
403
403
|
version: '0'
|
404
404
|
requirements: []
|
405
|
-
rubygems_version: 3.5.
|
405
|
+
rubygems_version: 3.5.10
|
406
406
|
signing_key:
|
407
407
|
specification_version: 4
|
408
408
|
summary: Adapters to work with GDS APIs
|