gds-api-adapters 97.1.0 → 97.2.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 +9 -6
- data/lib/gds_api/test_helpers/publishing_api.rb +4 -2
- data/lib/gds_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28d51629867498d4a82ac5e2ea9a1062a016144545e905060d4dadf6a8116b1a
|
4
|
+
data.tar.gz: 5c376df981bae6c3197e3c3a98e45375d168256a3d5b6bd3700704e64ca4ee39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb03d3158c4e924abd93cbef80c524e65b2efd190056d0fa63a296ba7a58ea5af80e98bf53d45ebef59903d02121bc1d826901c2cedc8028521ed5ede199a605
|
7
|
+
data.tar.gz: '0334915fa9576323f28f07d4bc9aa5d904ad3573078a63b9b62f6dd5fb3c63bd96f2e6f22ffab5981639bac730231719959686034f91614d111ac4de4d3e0d4a'
|
@@ -339,18 +339,21 @@ class GdsApi::PublishingApi < GdsApi::Base
|
|
339
339
|
|
340
340
|
# Get content items which embed a reusable content_id
|
341
341
|
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
# @example
|
342
|
+
# @param content_id [UUID]
|
343
|
+
# @param params [Hash]
|
345
344
|
#
|
346
|
-
# publishing_api.get_content_by_embedded_document(
|
345
|
+
# publishing_api.get_content_by_embedded_document(
|
346
|
+
# "4b148ebc-b2bb-40db-8e48-dd8cff363ff7",
|
347
|
+
# { page: 1, order: '-last_edited_at' }
|
348
|
+
# )
|
347
349
|
#
|
348
350
|
# @return [GdsApi::Response] A response containing a summarised list of the content items which embed the target.
|
349
351
|
# The content items returned will be in either the draft of published state.
|
350
352
|
#
|
351
353
|
# @see https://github.com/alphagov/publishing-api/blob/main/docs/api.md#get-v2contentcontent_idembedded
|
352
|
-
def get_content_by_embedded_document(content_id)
|
353
|
-
|
354
|
+
def get_content_by_embedded_document(content_id, params = {})
|
355
|
+
query = query_string(params)
|
356
|
+
get_json("#{endpoint}/v2/content/#{content_id}/embedded#{query}")
|
354
357
|
end
|
355
358
|
|
356
359
|
# Returns an Enumerator of content items for the provided
|
@@ -374,8 +374,9 @@ module GdsApi
|
|
374
374
|
# )
|
375
375
|
# @param content_id [UUID, Mocha::ParameterMatchers::Anything]
|
376
376
|
# @param total Integer
|
377
|
-
# @param
|
378
|
-
|
377
|
+
# @param total_pages Integer
|
378
|
+
# @param results [Hash]
|
379
|
+
def stub_publishing_api_has_embedded_content(content_id:, total: 0, total_pages: 0, results: [])
|
379
380
|
url = if content_id.is_a?(Mocha::ParameterMatchers::Anything)
|
380
381
|
%r{\A#{PUBLISHING_API_V2_ENDPOINT}/content/[0-9a-fA-F-]{36}/embedded}
|
381
382
|
else
|
@@ -386,6 +387,7 @@ module GdsApi
|
|
386
387
|
.to_return(body: {
|
387
388
|
"content_id" => content_id,
|
388
389
|
"total" => total,
|
390
|
+
"total_pages" => total_pages,
|
389
391
|
"results" => results,
|
390
392
|
}.to_json)
|
391
393
|
end
|
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: 97.
|
4
|
+
version: 97.2.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-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -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.23
|
406
406
|
signing_key:
|
407
407
|
specification_version: 4
|
408
408
|
summary: Adapters to work with GDS APIs
|