gds-api-adapters 97.4.0 → 97.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65cb765ee9c7ec5ecc14786031a300445ebe47913fd1725dc45029544ca4bbae
4
- data.tar.gz: e4a1d38fc0d071fb94a8c23f3ca9835a39782ff494c6ac169ff5f4a54d1aa74a
3
+ metadata.gz: f1eb266c1aeb0bea17c497f8fc50f2c63acde3d912ac9912fee8ab5f75e98fde
4
+ data.tar.gz: d77d9241107d1c03ce40eed9c590819419475f8ba0e3b1a0b544ecc29c4a755e
5
5
  SHA512:
6
- metadata.gz: 1789520088667eed07cff11b73c47b8b88f0f44a9dcfddb3ac18c876f502011d88e545bd0a3bf687f48991a64aaa39afd49e82905be68e10043964f4e5caa65a
7
- data.tar.gz: 130e302e05e3337dc9a2a536cba8cde370c809c9efab27e9ba394ab97ed494c313cf30cf88a6206e0be29cda8855706a6300471d2f86565e337fe26b3bf73719
6
+ metadata.gz: 94266ef292952415ab4115c3725f11aacd433e26ee1c13ca21990be51c5b858d2bfa3a3857d26a311fcb60d429c7676f75331139870156348b7a6824185fe95e
7
+ data.tar.gz: d4227f9e0aaa8a3ac834bf2df109b560ba00bceb9186a2221421494f0bab4f611d75bc701982d1213a47dfbde809ad47c499381b2bf204b9f162dc0164a152c4
@@ -562,9 +562,9 @@ class GdsApi::PublishingApi < GdsApi::Base
562
562
  #
563
563
  # @param query [String]
564
564
  #
565
- # @return [Hash] A response with the result of the GraphQL query.
565
+ # @return [GdsApi::Response] A response with the result of the GraphQL query.
566
566
  def graphql_query(query)
567
- post_json("#{endpoint}/graphql", query:).to_hash
567
+ post_json("#{endpoint}/graphql", query:)
568
568
  end
569
569
 
570
570
  private
@@ -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.5.0".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.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: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -268,14 +268,14 @@ dependencies:
268
268
  requirements:
269
269
  - - '='
270
270
  - !ruby/object:Gem::Version
271
- version: 5.0.3
271
+ version: 5.0.4
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - '='
277
277
  - !ruby/object:Gem::Version
278
- version: 5.0.3
278
+ version: 5.0.4
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: simplecov
281
281
  requirement: !ruby/object:Gem::Requirement