dor-services-client 6.23.0 → 6.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/metadata.rb +13 -1
- data/lib/dor/services/client/object.rb +14 -1
- data/lib/dor/services/client/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27f8d5a9a2aa24911e5f169e843c7512971808087ea1164c1c08b6fa746c053b
|
4
|
+
data.tar.gz: be2661cb87f7d338a47ade38e331ea582522dbc739d1ab92ba4a08bb23f28f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4f943d0c005e0b92c166836ef3fe8c141023292cb59fbaca75caf33bf8c71d8c53068a2454ec6f3baaa55aade87a13fcd1560ba19baea61d014a5191979e2de
|
7
|
+
data.tar.gz: 01cea84dc24fbe256125e5c0df71547d29f33e621e556184f88f6d7274d035075835c3bc2bc223eb912edf4c4afde1fad6073317375ac28b81487cac9c7ec2d2
|
data/dor-services-client.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
25
|
spec.add_dependency 'activesupport', '>= 4.2', '< 7'
|
26
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
26
|
+
spec.add_dependency 'cocina-models', '~> 0.55.0' # leave pinned to patch level until cocina-models hits 1.0
|
27
27
|
spec.add_dependency 'deprecation', '>= 0'
|
28
28
|
spec.add_dependency 'faraday', '>= 0.15', '< 2'
|
29
29
|
spec.add_dependency 'moab-versioning', '~> 4.0'
|
@@ -51,7 +51,7 @@ module Dor
|
|
51
51
|
raise_exception_based_on_response!(resp, object_identifier)
|
52
52
|
end
|
53
53
|
|
54
|
-
# @return [String, NilClass] The descriptive metadata XML representation of the object or nil if response is 404
|
54
|
+
# @return [String, NilClass] The public descriptive metadata XML representation of the object or nil if response is 404
|
55
55
|
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
56
56
|
def descriptive
|
57
57
|
resp = connection.get do |req|
|
@@ -63,6 +63,18 @@ module Dor
|
|
63
63
|
raise_exception_based_on_response!(resp, object_identifier)
|
64
64
|
end
|
65
65
|
|
66
|
+
# @return [String, NilClass] the dor object's source MODS XML or nil if response is 404
|
67
|
+
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
68
|
+
def mods
|
69
|
+
resp = connection.get do |req|
|
70
|
+
req.url "#{base_path}/mods"
|
71
|
+
end
|
72
|
+
return resp.body if resp.success?
|
73
|
+
return if resp.status == 404
|
74
|
+
|
75
|
+
raise_exception_based_on_response!(resp, object_identifier)
|
76
|
+
end
|
77
|
+
|
66
78
|
private
|
67
79
|
|
68
80
|
attr_reader :object_identifier
|
@@ -4,7 +4,7 @@ module Dor
|
|
4
4
|
module Services
|
5
5
|
class Client
|
6
6
|
# API calls that are about a repository object
|
7
|
-
class Object < VersionedService
|
7
|
+
class Object < VersionedService # rubocop:disable Metrics/ClassLength
|
8
8
|
attr_reader :object_identifier
|
9
9
|
|
10
10
|
# @param object_identifier [String] the pid for the object
|
@@ -183,6 +183,19 @@ module Dor
|
|
183
183
|
raise_exception_based_on_response!(resp)
|
184
184
|
end
|
185
185
|
|
186
|
+
# Destroys an object
|
187
|
+
# @return [Boolean] true if successful
|
188
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
189
|
+
# @raise [UnexpectedResponse] if the request is unsuccessful.
|
190
|
+
def destroy
|
191
|
+
resp = connection.delete do |req|
|
192
|
+
req.url object_path
|
193
|
+
end
|
194
|
+
raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
|
195
|
+
|
196
|
+
true
|
197
|
+
end
|
198
|
+
|
186
199
|
# Notify the external Goobi system for a new object that was registered in DOR
|
187
200
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
188
201
|
# @raise [UnexpectedResponse] when the response is not successful.
|
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: 6.
|
4
|
+
version: 6.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-03-
|
12
|
+
date: 2021-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.55.0
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.55.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: deprecation
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
rubygems_version: 3.1.
|
270
|
+
rubygems_version: 3.1.4
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: A client for dor-services-app
|