gds-api-adapters 101.0.0 → 101.1.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/publishing_api.rb +2 -12
- data/lib/gds_api/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 960d745ee91c73b2d8a54b7bc73f8280b6961b83cefb6137703935c95b8df485
|
|
4
|
+
data.tar.gz: '091cd209020f815a8cbe3ae6b01bd4c70b17e524cee8b1da1f156f1facc8cc14'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c89a594778ea1704d8c0a41a348bc7fbd5e9bb7e3c79cfd74cbf3d6bc49a33414f81e2335463edf4c215f64392b2259ee165f3f9c216134f3084a517b35c7d91
|
|
7
|
+
data.tar.gz: d6e8d6d1f8eb154164bb76657caf359b4a674faa5490292dd5bba0543cb020f111ae9b1322e28c446eb9f9e76e8456b349709b9adce6da29599bad0845130b9e
|
|
@@ -8,8 +8,6 @@ require_relative "exceptions"
|
|
|
8
8
|
# @see https://github.com/alphagov/publishing-api/blob/main/docs/model.md
|
|
9
9
|
# @api documented
|
|
10
10
|
class GdsApi::PublishingApi < GdsApi::Base
|
|
11
|
-
class NoLiveVersion < GdsApi::BaseError; end
|
|
12
|
-
|
|
13
11
|
# Put a content item
|
|
14
12
|
#
|
|
15
13
|
# @param content_id [UUID]
|
|
@@ -45,18 +43,10 @@ class GdsApi::PublishingApi < GdsApi::Base
|
|
|
45
43
|
#
|
|
46
44
|
# @return [GdsApi::Response] a content item
|
|
47
45
|
#
|
|
48
|
-
# @raise [
|
|
46
|
+
# @raise [HTTPNotFound] when the content item is not found
|
|
49
47
|
# @see https://github.com/alphagov/publishing-api/blob/main/docs/api.md#get-v2contentcontent_id
|
|
50
48
|
def get_live_content(content_id, locale = "en")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
live_states = %w[published unpublished]
|
|
54
|
-
return content_item if live_states.include?(content_item.to_h["publication_state"])
|
|
55
|
-
|
|
56
|
-
live_version_number = content_item["state_history"].find { |_, v| live_states.include?(v) }&.first
|
|
57
|
-
raise NoLiveVersion, "No live version exists for content_id: #{content_id}" unless live_version_number
|
|
58
|
-
|
|
59
|
-
get_content(content_id, locale:, version: live_version_number)
|
|
49
|
+
get_content(content_id, locale:, content_store: :live)
|
|
60
50
|
end
|
|
61
51
|
|
|
62
52
|
# Find the content_ids for a list of base_paths.
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gds-api-adapters
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 101.
|
|
4
|
+
version: 101.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
@@ -169,14 +169,14 @@ dependencies:
|
|
|
169
169
|
requirements:
|
|
170
170
|
- - "~>"
|
|
171
171
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '
|
|
172
|
+
version: '3.0'
|
|
173
173
|
type: :development
|
|
174
174
|
prerelease: false
|
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
|
176
176
|
requirements:
|
|
177
177
|
- - "~>"
|
|
178
178
|
- !ruby/object:Gem::Version
|
|
179
|
-
version: '
|
|
179
|
+
version: '3.0'
|
|
180
180
|
- !ruby/object:Gem::Dependency
|
|
181
181
|
name: pact
|
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -267,14 +267,14 @@ dependencies:
|
|
|
267
267
|
requirements:
|
|
268
268
|
- - '='
|
|
269
269
|
- !ruby/object:Gem::Version
|
|
270
|
-
version: 5.1.
|
|
270
|
+
version: 5.1.20
|
|
271
271
|
type: :development
|
|
272
272
|
prerelease: false
|
|
273
273
|
version_requirements: !ruby/object:Gem::Requirement
|
|
274
274
|
requirements:
|
|
275
275
|
- - '='
|
|
276
276
|
- !ruby/object:Gem::Version
|
|
277
|
-
version: 5.1.
|
|
277
|
+
version: 5.1.20
|
|
278
278
|
- !ruby/object:Gem::Dependency
|
|
279
279
|
name: simplecov
|
|
280
280
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -398,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
398
398
|
- !ruby/object:Gem::Version
|
|
399
399
|
version: '0'
|
|
400
400
|
requirements: []
|
|
401
|
-
rubygems_version:
|
|
401
|
+
rubygems_version: 4.0.2
|
|
402
402
|
specification_version: 4
|
|
403
403
|
summary: Adapters to work with GDS APIs
|
|
404
404
|
test_files: []
|