dor-services-client 15.34.0 → 15.35.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6006578d9c1200071a5c5f649d9a91bb1fe0d02199c009575796772db94a6b40
4
- data.tar.gz: 8950118cf5d28e602d82b783ae1eee710d58e32677281cb6129ab4ab852b99f5
3
+ metadata.gz: 21437f77d59163089589ea78eac61216253c76a10b64ac3c1c03a08ef98c4ef3
4
+ data.tar.gz: b917969d026fd62a189aad6caec892320978d344de629f4b9bf50e643f4b2b59
5
5
  SHA512:
6
- metadata.gz: 52beafa824323b21cabcbca06650561969a002992fd2d37679f46ccee07cbb6ff6914fd8f765997f72a1020126f69d0e682b3e4b000610e1995102abb02ebd5a
7
- data.tar.gz: b9b17d5d79e7e7b2781d42ca8141a2b4ff33be34d13c61bd32b6d814c9ccfcfccffd2d6f1467f910dbee30e6dd40283b84640c48ad024867641ff62a672d19c9
6
+ metadata.gz: 6ad73ddaf9dc31b582740d1e0ca45f60fd9718f997b4e16d1d0a31c6d158dc0e3d1fcf2e02066e1957d1aaaddbf7ee4630c6e6844e46f1ecaa6851a1c5449eef
7
+ data.tar.gz: b58cf3874bfb966078cbe5557b1a999455be512ebbd7fad3262d45e16d655eba4e1532efe4fc2b6cdece1775e08cdb0847c57a41e23e9290043f12c0f8b58826
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.34.0)
4
+ dor-services-client (15.35.0)
5
5
  activesupport (>= 7.0.0)
6
6
  cocina-models (~> 0.114.0)
7
7
  deprecation
data/README.md CHANGED
@@ -121,6 +121,7 @@ object_client.version.close
121
121
  # Manage user versions
122
122
  object_client.user_version.inventory
123
123
  object_client.user_version.find(2)
124
+ # Include `validate: false` as a param to return the Solr representation of a user version w/ invalid Cocina
124
125
  object_client.user_version.solr(2)
125
126
  object_client.user_version.create(object_version: 3)
126
127
  object_client.user_version.update(user_version: Dor::Services::Client::UserVersion::Version.new(version: 3, userVersion: 3, withdrawn: true))
@@ -66,7 +66,7 @@ module Dor
66
66
  elsif resp.status == 409 # Signals the Cocina is present but invalid
67
67
  build_invalid_cocina_from_response(resp)
68
68
  else
69
- raise_exception_based_on_response!(resp) unless resp.success?
69
+ raise_exception_based_on_response!(resp)
70
70
  end
71
71
  end
72
72
 
@@ -36,22 +36,28 @@ module Dor
36
36
  JSON.parse(resp.body).fetch('user_versions').map { |params| Version.new(**params.symbolize_keys!) }
37
37
  end
38
38
 
39
- # @return [Cocina::Models::DROWithMetadata] the object metadata
40
- # @raise [UnexpectedResponse] on an unsuccessful response from the server
39
+ # @return [Cocina::Models::DROWithMetadata, Dor::Services::Client::InvalidCocina] the object version or an
40
+ # InvalidCocina instance that behaves similarly to a Cocina object
41
+ # @raise [Dor::Services::Client::Error] on an unsuccessful response from the server
41
42
  def find(version)
42
43
  resp = connection.get do |req|
43
44
  req.url "#{base_path}/#{version}"
44
45
  end
45
- raise_exception_based_on_response!(resp) unless resp.success?
46
46
 
47
- build_cocina_from_response(JSON.parse(resp.body), headers: resp.headers, validate: false)
47
+ if resp.success?
48
+ build_cocina_from_response(JSON.parse(resp.body), headers: resp.headers, validate: false)
49
+ elsif resp.status == 409 # Signals the Cocina is present but invalid
50
+ build_invalid_cocina_from_response(resp)
51
+ else
52
+ raise_exception_based_on_response!(resp)
53
+ end
48
54
  end
49
55
 
50
56
  # @return [Hash] the solr document for the user version
51
57
  # @raise [UnexpectedResponse] on an unsuccessful response from the server
52
- def solr(version)
58
+ def solr(version, validate: true)
53
59
  resp = connection.get do |req|
54
- req.url "#{base_path}/#{version}/solr"
60
+ req.url "#{base_path}/#{version}/solr?validate=#{validate}"
55
61
  end
56
62
  raise_exception_based_on_response!(resp) unless resp.success?
57
63
 
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.34.0'
6
+ VERSION = '15.35.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.34.0
4
+ version: 15.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  - !ruby/object:Gem::Version
308
308
  version: '0'
309
309
  requirements: []
310
- rubygems_version: 4.0.6
310
+ rubygems_version: 4.0.8
311
311
  specification_version: 4
312
312
  summary: A client for dor-services-app
313
313
  test_files: []