gds-api-adapters 97.4.0 → 97.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65cb765ee9c7ec5ecc14786031a300445ebe47913fd1725dc45029544ca4bbae
4
- data.tar.gz: e4a1d38fc0d071fb94a8c23f3ca9835a39782ff494c6ac169ff5f4a54d1aa74a
3
+ metadata.gz: a3d86ff9c8bece588fe1eae2ec8ec8c71ca5ef5108c7b900f19f8444fb2d016b
4
+ data.tar.gz: 4d83794af16a9af548c3a1f803afb2e05f619728e3623305b6af667a9315b635
5
5
  SHA512:
6
- metadata.gz: 1789520088667eed07cff11b73c47b8b88f0f44a9dcfddb3ac18c876f502011d88e545bd0a3bf687f48991a64aaa39afd49e82905be68e10043964f4e5caa65a
7
- data.tar.gz: 130e302e05e3337dc9a2a536cba8cde370c809c9efab27e9ba394ab97ed494c313cf30cf88a6206e0be29cda8855706a6300471d2f86565e337fe26b3bf73719
6
+ metadata.gz: bc5856e22afbf5d6484a1b31074e14ed3a1d40dbdb902cb6ed7fb8f62c01c28ea238dbbe0d370373a9d08180057fbf69207916dc72a3706eee9174eacfc62129
7
+ data.tar.gz: 18e2a2894684c34f4ee5fe549bb88dae6cdc712e885996d597239e6ae8b9b780314c68ad3c2e7fc13b7af898eedb222541597272b1552400a83353fba08d246c
@@ -371,13 +371,28 @@ module GdsApi
371
371
  # "base_path" => "/organisation/bar",
372
372
  # },
373
373
  # }] # an array of content items that embed the target content_id
374
+ # rollup: {
375
+ # "views" => 1
376
+ # "locations" => 1
377
+ # "instances" => 1
378
+ # "organisations" => 1
379
+ # } # metadata with the total counts across all pages
374
380
  # )
375
- # @param content_id [UUID, Mocha::ParameterMatchers::Anything]
381
+ # @param content_id [UUID]
376
382
  # @param total Integer
377
383
  # @param total_pages Integer
378
- # @param results [Hash]
379
- def stub_publishing_api_has_embedded_content(content_id:, total: 0, total_pages: 0, results: [], page_number: nil, order: nil)
380
- url = "#{PUBLISHING_API_V2_ENDPOINT}/content/#{content_id}/embedded"
384
+ # @param results [Array]
385
+ # @param rollup [Hash]
386
+ def stub_publishing_api_has_embedded_content(
387
+ content_id:,
388
+ total: 0,
389
+ total_pages: 0,
390
+ results: [],
391
+ page_number: nil,
392
+ order: nil,
393
+ rollup: {}
394
+ )
395
+ url = "#{PUBLISHING_API_V2_ENDPOINT}/content/#{content_id}/host-content"
381
396
 
382
397
  query = {
383
398
  "page" => page_number,
@@ -390,12 +405,20 @@ module GdsApi
390
405
  "content_id" => content_id,
391
406
  "total" => total,
392
407
  "total_pages" => total_pages,
408
+ "rollup" => rollup,
393
409
  "results" => results,
394
410
  }.to_json)
395
411
  end
396
412
 
397
- def stub_publishing_api_has_embedded_content_for_any_content_id(total: 0, total_pages: 0, results: [], page_number: nil, order: nil)
398
- url = %r{\A#{PUBLISHING_API_V2_ENDPOINT}/content/[0-9a-fA-F-]{36}/embedded}
413
+ def stub_publishing_api_has_embedded_content_for_any_content_id(
414
+ total: 0,
415
+ total_pages: 0,
416
+ results: [],
417
+ page_number: nil,
418
+ order: nil,
419
+ rollup: {}
420
+ )
421
+ url = %r{\A#{PUBLISHING_API_V2_ENDPOINT}/content/[0-9a-fA-F-]{36}/host-content}
399
422
 
400
423
  query = {
401
424
  "page" => page_number,
@@ -408,6 +431,7 @@ module GdsApi
408
431
  "content_id" => SecureRandom.uuid,
409
432
  "total" => total,
410
433
  "total_pages" => total_pages,
434
+ "rollup" => rollup,
411
435
  "results" => results,
412
436
  }.to_json)
413
437
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "97.4.0".freeze
2
+ VERSION = "97.4.1".freeze
3
3
  end
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.0
4
+ version: 97.4.1
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-26 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable