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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/dor/services/client/object_version.rb +1 -1
- data/lib/dor/services/client/user_version.rb +12 -6
- data/lib/dor/services/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21437f77d59163089589ea78eac61216253c76a10b64ac3c1c03a08ef98c4ef3
|
|
4
|
+
data.tar.gz: b917969d026fd62a189aad6caec892320978d344de629f4b9bf50e643f4b2b59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ad73ddaf9dc31b582740d1e0ca45f60fd9718f997b4e16d1d0a31c6d158dc0e3d1fcf2e02066e1957d1aaaddbf7ee4630c6e6844e46f1ecaa6851a1c5449eef
|
|
7
|
+
data.tar.gz: b58cf3874bfb966078cbe5557b1a999455be512ebbd7fad3262d45e16d655eba4e1532efe4fc2b6cdece1775e08cdb0847c57a41e23e9290043f12c0f8b58826
|
data/Gemfile.lock
CHANGED
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)
|
|
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
|
|
40
|
-
#
|
|
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
|
-
|
|
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
|
|
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.
|
|
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.
|
|
310
|
+
rubygems_version: 4.0.8
|
|
311
311
|
specification_version: 4
|
|
312
312
|
summary: A client for dor-services-app
|
|
313
313
|
test_files: []
|