dor-services-client 6.30.0 → 6.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/metadata.rb +13 -1
- data/lib/dor/services/client/object.rb +0 -4
- data/lib/dor/services/client/version.rb +1 -1
- metadata +9 -10
- data/lib/dor/services/client/embargo.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d82703eaa8f5daf88bf1214d8d57f0791812eda65c3f42e2c3504dfd06fc2a6
|
4
|
+
data.tar.gz: 78db360c9476e30db12f82d1fcb06b0d4eb49d31079acb86a4c7c306e2a81d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7e59b66673dc2cbd5df31c65132db5d5185a944fcd9f66ab084a620b3313b485c4744c26d3d9f66433916384d138ef0c51c9c5f836bdd1f4021b1e9936590fb
|
7
|
+
data.tar.gz: 75e0565d8a27b44b59112aeac4aff0c4c5c01aecc4260e2cc544ecca798cf5efd3c548bc1ff7a3c71d5fa736b0fa976dc91e61f10e2ec161fea099336d0c53ac
|
data/README.md
CHANGED
@@ -129,6 +129,9 @@ object_client.metadata.dublin_core
|
|
129
129
|
# Get the public descriptive XML representation
|
130
130
|
object_client.metadata.descriptive
|
131
131
|
|
132
|
+
# Get the public XML representation
|
133
|
+
object_client.metadata.public_xml
|
134
|
+
|
132
135
|
# Update legacy XML representation
|
133
136
|
object_client.metadata.legacy_update(
|
134
137
|
descriptive: {
|
@@ -166,10 +169,6 @@ object_client.workspace.create(source: object_path_string)
|
|
166
169
|
object_client.workspace.cleanup
|
167
170
|
object_client.workspace.reset
|
168
171
|
|
169
|
-
|
170
|
-
# Update embargo
|
171
|
-
object_client.embargo.update(embargo_date: date_string, requesting_user: username_string)
|
172
|
-
|
173
172
|
# Search for administrative tags:
|
174
173
|
Dor::Services::Client.administrative_tags.search(q: 'Project')
|
175
174
|
```
|
data/dor-services-client.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = '~> 2.6'
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 4.2', '< 7'
|
28
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
28
|
+
spec.add_dependency 'cocina-models', '~> 0.59.0' # leave pinned to patch level until cocina-models hits 1.0
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
30
30
|
spec.add_dependency 'faraday', '>= 0.15', '< 2'
|
31
31
|
spec.add_dependency 'moab-versioning', '~> 4.0'
|
@@ -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 public XML representation of the object or nil if response is 404
|
67
|
+
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
68
|
+
def public_xml
|
69
|
+
resp = connection.get do |req|
|
70
|
+
req.url "#{base_path}/public_xml"
|
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
|
# @return [String, NilClass] the dor object's source MODS XML or nil if response is 404
|
67
79
|
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
68
80
|
def mods
|
@@ -76,7 +88,7 @@ module Dor
|
|
76
88
|
end
|
77
89
|
|
78
90
|
# rubocop:disable Lint/StructNewOverride
|
79
|
-
Datastream = Struct.new(:label, :dsid, :pid, :size, :mimeType, keyword_init: true)
|
91
|
+
Datastream = Struct.new(:label, :dsid, :pid, :size, :mimeType, :versionId, keyword_init: true)
|
80
92
|
# rubocop:enable Lint/StructNewOverride
|
81
93
|
|
82
94
|
# @return [Array] the list of datastreams for the item
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
- Michael Giarlo
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-04-23 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.59.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.59.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: deprecation
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,7 +205,7 @@ dependencies:
|
|
205
205
|
- - ">="
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
|
-
description:
|
208
|
+
description:
|
209
209
|
email:
|
210
210
|
- jcoyne@justincoyne.com
|
211
211
|
- leftwing@alumni.rutgers.edu
|
@@ -234,7 +234,6 @@ files:
|
|
234
234
|
- lib/dor/services/client/background_job_results.rb
|
235
235
|
- lib/dor/services/client/collections.rb
|
236
236
|
- lib/dor/services/client/connection_wrapper.rb
|
237
|
-
- lib/dor/services/client/embargo.rb
|
238
237
|
- lib/dor/services/client/error_faraday_middleware.rb
|
239
238
|
- lib/dor/services/client/events.rb
|
240
239
|
- lib/dor/services/client/marcxml.rb
|
@@ -254,7 +253,7 @@ files:
|
|
254
253
|
homepage: https://github.com/sul-dlss/dor-services-client
|
255
254
|
licenses: []
|
256
255
|
metadata: {}
|
257
|
-
post_install_message:
|
256
|
+
post_install_message:
|
258
257
|
rdoc_options: []
|
259
258
|
require_paths:
|
260
259
|
- lib
|
@@ -269,8 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
268
|
- !ruby/object:Gem::Version
|
270
269
|
version: '0'
|
271
270
|
requirements: []
|
272
|
-
rubygems_version: 3.0.
|
273
|
-
signing_key:
|
271
|
+
rubygems_version: 3.0.6
|
272
|
+
signing_key:
|
274
273
|
specification_version: 4
|
275
274
|
summary: A client for dor-services-app
|
276
275
|
test_files: []
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dor
|
4
|
-
module Services
|
5
|
-
class Client
|
6
|
-
# API calls that are about managing embargo on a repository object
|
7
|
-
class Embargo < VersionedService
|
8
|
-
# @param object_identifier [String] the pid for the object
|
9
|
-
def initialize(connection:, version:, object_identifier:)
|
10
|
-
super(connection: connection, version: version)
|
11
|
-
@object_identifier = object_identifier
|
12
|
-
end
|
13
|
-
|
14
|
-
# @param [String] embargo_date The date to update the embargo to (ISO 8601)
|
15
|
-
# @param [String] requesting_user Who is making this change.
|
16
|
-
#
|
17
|
-
# @example
|
18
|
-
# client.update(embargo_date: '2099-10-20', requesting_user: 'jane')
|
19
|
-
#
|
20
|
-
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
21
|
-
#
|
22
|
-
# @return [NilClass] when the update is successful
|
23
|
-
def update(embargo_date:, requesting_user:)
|
24
|
-
resp = connection.patch do |req|
|
25
|
-
req.url path
|
26
|
-
req.headers['Content-Type'] = 'application/json'
|
27
|
-
req.body = {
|
28
|
-
embargo_date: embargo_date,
|
29
|
-
requesting_user: requesting_user
|
30
|
-
}.to_json
|
31
|
-
end
|
32
|
-
return if resp.success?
|
33
|
-
|
34
|
-
raise_exception_based_on_response!(resp, object_identifier)
|
35
|
-
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
attr_reader :object_identifier
|
40
|
-
|
41
|
-
def path
|
42
|
-
"#{api_version}/objects/#{object_identifier}/embargo"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|