gds-api-adapters 50.5.0 → 50.6.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
  SHA1:
3
- metadata.gz: 81558843425038efe29e29bd2734ec42c3d657cf
4
- data.tar.gz: 519e2305d857c6346235d40bd4d4edac23151cef
3
+ metadata.gz: 93fcd5da9a5f27a2e82a990912901e5ae8d4445a
4
+ data.tar.gz: fbbf8f938fa996b7f331d3bea7f6770d5782375b
5
5
  SHA512:
6
- metadata.gz: 4a26a0788d6296f501679a6f01422a23249420da6e0544f4ab8de2c5618f5916b261c127d146b09c427a989cff762dcd95d8da0b592b233a79db958b5c11c52a
7
- data.tar.gz: da84698c100de4de06949f2259e60f493703c3fe3d24649cd21ca0899a50f011b49cb9a12952bc56e9a8695631abfc59a690253547e51d389dcb4ef63170f388
6
+ metadata.gz: 38da5cc897641bc41215db477fc983726ed883e1ecbe80d400de7dc1519dbb4c2452c05e6980a214f8c1c58de097656c49c12cb9617e63b57acdb81bad4cb76d
7
+ data.tar.gz: 674443b0ab9ff517bbeeb30fcde8250e06110bcc7368a92700918e9e59941290d2da98601d80f4cf8ae5335560891603b551070a0a2ff878a5a410b7a98868f1
@@ -43,6 +43,7 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
43
43
  # @param base_paths [Array]
44
44
  # @param exclude_document_types [Array] (optional)
45
45
  # @param exclude_unpublishing_types [Array] (optional)
46
+ # @param with_drafts [Boolean] (optional)
46
47
  # @return [Hash] a hash, keyed by `base_path` with `content_id` as value
47
48
  # @example
48
49
  #
@@ -50,10 +51,11 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
50
51
  # # => { "/foo" => "51ac4247-fd92-470a-a207-6b852a97f2db", "/bar" => "261bd281-f16c-48d5-82d2-9544019ad9ca" }
51
52
  #
52
53
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-lookup-by-base-path
53
- def lookup_content_ids(base_paths:, exclude_document_types: nil, exclude_unpublishing_types: nil)
54
+ def lookup_content_ids(base_paths:, exclude_document_types: nil, exclude_unpublishing_types: nil, with_drafts: false)
54
55
  options = { base_paths: base_paths }
55
56
  options[:exclude_document_types] = exclude_document_types if exclude_document_types
56
57
  options[:exclude_unpublishing_types] = exclude_unpublishing_types if exclude_unpublishing_types
58
+ options[:with_drafts] = with_drafts if with_drafts
57
59
  response = post_json("#{endpoint}/lookup-by-base-path", options)
58
60
  response.to_hash
59
61
  end
@@ -66,6 +68,7 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
66
68
  # @param base_path [String]
67
69
  # @param exclude_document_types [Array] (optional)
68
70
  # @param exclude_unpublishing_types [Array] (optional)
71
+ # @param with_drafts [Boolean] (optional)
69
72
  #
70
73
  # @return [UUID] the `content_id` for the `base_path`
71
74
  #
@@ -75,11 +78,12 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
75
78
  # # => "51ac4247-fd92-470a-a207-6b852a97f2db"
76
79
  #
77
80
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-lookup-by-base-path
78
- def lookup_content_id(base_path:, exclude_document_types: nil, exclude_unpublishing_types: nil)
81
+ def lookup_content_id(base_path:, exclude_document_types: nil, exclude_unpublishing_types: nil, with_drafts: false)
79
82
  lookups = lookup_content_ids(
80
83
  base_paths: [base_path],
81
84
  exclude_document_types: exclude_document_types,
82
- exclude_unpublishing_types: exclude_unpublishing_types
85
+ exclude_unpublishing_types: exclude_unpublishing_types,
86
+ with_drafts: with_drafts,
83
87
  )
84
88
  lookups[base_path]
85
89
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '50.5.0'.freeze
2
+ VERSION = '50.6.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: 50.5.0
4
+ version: 50.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek