gds-api-adapters 57.4.2 → 57.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/gds_api/base.rb +0 -1
- data/lib/gds_api/email_alert_api.rb +0 -2
- data/lib/gds_api/json_client.rb +1 -13
- data/lib/gds_api/publishing_api.rb +9 -0
- data/lib/gds_api/rummager.rb +1 -0
- data/lib/gds_api/test_helpers/email_alert_api.rb +0 -2
- data/lib/gds_api/test_helpers/publishing_api.rb +18 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d790bf7e187109ce1f31d1ca428cd65493698bc72bbb5ebbf33eb60f38f0b66f
|
4
|
+
data.tar.gz: ff50c34b2405d4f1286df944e243857da924ef91a541b514810a2f7b41f38b33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ecc5a522a057ecb122889c5a7e88ecef23b4242784bc08e6ef7be94d7f1ce6611b238ace87b0e2449b9c6847377358f1bed66474e3d2cb010f6b3ec0cc55c2
|
7
|
+
data.tar.gz: 7f98a8869d10d02c99b20d1cc867285b82fbcd3320ef1ddfd46883a0d5b2736e26f2bf2a38445b569af635d19049213f4728364ec2d1a804cf7d07b015858eef
|
data/Rakefile
CHANGED
data/lib/gds_api/base.rb
CHANGED
@@ -26,7 +26,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
26
26
|
government_document_supertype = attributes["government_document_supertype"]
|
27
27
|
gov_delivery_id = attributes["gov_delivery_id"]
|
28
28
|
content_purpose_supergroup = attributes["content_purpose_supergroup"]
|
29
|
-
reject_content_purpose_supergroup = attributes["reject_content_purpose_supergroup"]
|
30
29
|
|
31
30
|
if tags && links
|
32
31
|
message = "please provide either tags or links (or neither), but not both"
|
@@ -41,7 +40,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
41
40
|
params[:government_document_supertype] = government_document_supertype if government_document_supertype
|
42
41
|
params[:gov_delivery_id] = gov_delivery_id if gov_delivery_id
|
43
42
|
params[:content_purpose_supergroup] = content_purpose_supergroup if content_purpose_supergroup
|
44
|
-
params[:reject_content_purpose_supergroup] = reject_content_purpose_supergroup if reject_content_purpose_supergroup
|
45
43
|
|
46
44
|
query_string = nested_query_string(params)
|
47
45
|
get_json("#{endpoint}/subscriber-lists?" + query_string)
|
data/lib/gds_api/json_client.rb
CHANGED
@@ -64,19 +64,7 @@ module GdsApi
|
|
64
64
|
do_json_request(:patch, url, params, additional_headers)
|
65
65
|
end
|
66
66
|
|
67
|
-
def delete_json(url, additional_headers = {})
|
68
|
-
do_json_request(:delete, url, nil, additional_headers)
|
69
|
-
end
|
70
|
-
|
71
|
-
def delete_json_with_params!(url, params, additional_headers = {})
|
72
|
-
warn <<-doc
|
73
|
-
DEPRECATION NOTICE: Delete requests should not include parameters.
|
74
|
-
|
75
|
-
Do not use this method as the ability to do this will be removed.
|
76
|
-
|
77
|
-
Called from: #{caller[2]}
|
78
|
-
doc
|
79
|
-
|
67
|
+
def delete_json(url, params = {}, additional_headers = {})
|
80
68
|
do_json_request(:delete, url, params, additional_headers)
|
81
69
|
end
|
82
70
|
|
@@ -12,8 +12,17 @@ class GdsApi::PublishingApi < GdsApi::Base
|
|
12
12
|
e
|
13
13
|
end
|
14
14
|
|
15
|
+
def unreserve_path(base_path, publishing_app)
|
16
|
+
payload = { publishing_app: publishing_app }
|
17
|
+
delete_json(unreserve_url(base_path), payload)
|
18
|
+
end
|
19
|
+
|
15
20
|
private
|
16
21
|
|
22
|
+
def unreserve_url(base_path)
|
23
|
+
"#{endpoint}/paths#{base_path}"
|
24
|
+
end
|
25
|
+
|
17
26
|
def intent_url(base_path)
|
18
27
|
"#{endpoint}/publish-intent#{base_path}"
|
19
28
|
end
|
data/lib/gds_api/rummager.rb
CHANGED
@@ -329,7 +329,6 @@ module GdsApi
|
|
329
329
|
government_document_supertype = attributes["government_document_supertype"]
|
330
330
|
gov_delivery_id = attributes["gov_delivery_id"]
|
331
331
|
content_purpose_supergroup = attributes["content_purpose_supergroup"]
|
332
|
-
reject_content_purpose_supergroup = attributes["reject_content_purpose_supergroup"]
|
333
332
|
|
334
333
|
params = {}
|
335
334
|
params[:tags] = tags if tags
|
@@ -339,7 +338,6 @@ module GdsApi
|
|
339
338
|
params[:government_document_supertype] = government_document_supertype if government_document_supertype
|
340
339
|
params[:gov_delivery_id] = gov_delivery_id if gov_delivery_id
|
341
340
|
params[:content_purpose_supergroup] = content_purpose_supergroup if content_purpose_supergroup
|
342
|
-
params[:reject_content_purpose_supergroup] = reject_content_purpose_supergroup if reject_content_purpose_supergroup
|
343
341
|
|
344
342
|
query = Rack::Utils.build_nested_query(params)
|
345
343
|
end
|
@@ -11,6 +11,18 @@ module GdsApi
|
|
11
11
|
|
12
12
|
PUBLISHING_API_ENDPOINT = Plek.current.find('publishing-api')
|
13
13
|
|
14
|
+
def stub_publishing_api_unreserve_path(base_path, publishing_app = /.*/)
|
15
|
+
stub_publishing_api_unreserve_path_with_code(base_path, publishing_app, 200)
|
16
|
+
end
|
17
|
+
|
18
|
+
def stub_publishing_api_unreserve_path_not_found(base_path, publishing_app = /.*/)
|
19
|
+
stub_publishing_api_unreserve_path_with_code(base_path, publishing_app, 404)
|
20
|
+
end
|
21
|
+
|
22
|
+
def stub_publishing_api_unreserve_path_invalid(base_path, publishing_app = /.*/)
|
23
|
+
stub_publishing_api_unreserve_path_with_code(base_path, publishing_app, 422)
|
24
|
+
end
|
25
|
+
|
14
26
|
def stub_publishing_api_put_intent(base_path, body = intent_for_publishing_api(base_path))
|
15
27
|
url = PUBLISHING_API_ENDPOINT + "/publish-intent" + base_path
|
16
28
|
body = body.to_json unless body.is_a?(String)
|
@@ -101,6 +113,12 @@ module GdsApi
|
|
101
113
|
|
102
114
|
private
|
103
115
|
|
116
|
+
def stub_publishing_api_unreserve_path_with_code(base_path, publishing_app, code)
|
117
|
+
url = PUBLISHING_API_ENDPOINT + "/paths" + base_path
|
118
|
+
body = { publishing_app: publishing_app }
|
119
|
+
stub_request(:delete, url).with(body: body).to_return(status: code, body: '{}', headers: { "Content-Type" => "application/json; charset=utf-8" })
|
120
|
+
end
|
121
|
+
|
104
122
|
def values_match_recursively(expected_value, actual_value)
|
105
123
|
case expected_value
|
106
124
|
when Hash
|
data/lib/gds_api/version.rb
CHANGED
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: 57.
|
4
|
+
version: 57.5.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: 2019-03-
|
11
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -338,14 +338,14 @@ dependencies:
|
|
338
338
|
requirements:
|
339
339
|
- - "~>"
|
340
340
|
- !ruby/object:Gem::Version
|
341
|
-
version: '3.
|
341
|
+
version: '3.5'
|
342
342
|
type: :development
|
343
343
|
prerelease: false
|
344
344
|
version_requirements: !ruby/object:Gem::Requirement
|
345
345
|
requirements:
|
346
346
|
- - "~>"
|
347
347
|
- !ruby/object:Gem::Version
|
348
|
-
version: '3.
|
348
|
+
version: '3.5'
|
349
349
|
- !ruby/object:Gem::Dependency
|
350
350
|
name: webrick
|
351
351
|
requirement: !ruby/object:Gem::Requirement
|