dor-services-client 15.2.0 → 15.2.1
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 +15 -12
- data/README.md +1 -20
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/object.rb +17 -46
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/workspace.rb +0 -18
- metadata +4 -11
- data/lib/dor/services/client/transfer.rb +0 -75
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17084d47db10602abff0c9d6bc50840dfac58ac14e2efa96a2a2f38f0dd8b779
|
|
4
|
+
data.tar.gz: 9fa643be94ed39a305199becf67b996759084fbf2ebecbd139cfc2e03b50c6ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fedc3d9668ecc6be0e9139b983ce5ee4469572250c3e354b7152047f27f88c52d2c90f2147aadf72de3b63402a0e23db4b8555f60f8693380e37a72301e01686
|
|
7
|
+
data.tar.gz: 47af1f97d1969b053b64ad9b7a634192e0efaf103e5add43d949cc6c1c7a4f45a41caf9f72ad09d207c5ac193f918acd28a0375153d249050d1c8e0d4b8028b0
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dor-services-client (15.2.
|
|
5
|
-
activesupport (>=
|
|
4
|
+
dor-services-client (15.2.1)
|
|
5
|
+
activesupport (>= 7.0.0)
|
|
6
6
|
cocina-models (~> 0.99.0)
|
|
7
7
|
deprecation
|
|
8
8
|
faraday (~> 2.0)
|
|
@@ -12,8 +12,9 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
activesupport (7.2.
|
|
15
|
+
activesupport (7.2.2)
|
|
16
16
|
base64
|
|
17
|
+
benchmark (>= 0.3)
|
|
17
18
|
bigdecimal
|
|
18
19
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
19
20
|
connection_pool (>= 2.2.5)
|
|
@@ -28,6 +29,7 @@ GEM
|
|
|
28
29
|
ast (2.4.2)
|
|
29
30
|
attr_extras (7.1.0)
|
|
30
31
|
base64 (0.2.0)
|
|
32
|
+
benchmark (0.4.0)
|
|
31
33
|
bigdecimal (3.1.8)
|
|
32
34
|
byebug (11.1.3)
|
|
33
35
|
cocina-models (0.99.0)
|
|
@@ -58,8 +60,9 @@ GEM
|
|
|
58
60
|
diff-lcs (1.5.1)
|
|
59
61
|
docile (1.4.1)
|
|
60
62
|
drb (2.2.1)
|
|
61
|
-
dry-core (1.0.
|
|
63
|
+
dry-core (1.0.2)
|
|
62
64
|
concurrent-ruby (~> 1.0)
|
|
65
|
+
logger
|
|
63
66
|
zeitwerk (~> 2.6)
|
|
64
67
|
dry-inflector (1.1.0)
|
|
65
68
|
dry-logic (1.5.0)
|
|
@@ -94,14 +97,14 @@ GEM
|
|
|
94
97
|
i18n (1.14.6)
|
|
95
98
|
concurrent-ruby (~> 1.0)
|
|
96
99
|
ice_nine (0.11.2)
|
|
97
|
-
json (2.
|
|
100
|
+
json (2.8.1)
|
|
98
101
|
jsonpath (1.1.5)
|
|
99
102
|
multi_json
|
|
100
103
|
language_server-protocol (3.17.0.3)
|
|
101
104
|
logger (1.6.1)
|
|
102
105
|
minitest (5.25.1)
|
|
103
106
|
multi_json (1.15.0)
|
|
104
|
-
net-http (0.
|
|
107
|
+
net-http (0.5.0)
|
|
105
108
|
uri
|
|
106
109
|
nokogiri (1.16.7-arm64-darwin)
|
|
107
110
|
racc (~> 1.4)
|
|
@@ -114,7 +117,7 @@ GEM
|
|
|
114
117
|
openapi_parser (1.0.0)
|
|
115
118
|
optimist (3.1.0)
|
|
116
119
|
parallel (1.26.3)
|
|
117
|
-
parser (3.3.
|
|
120
|
+
parser (3.3.6.0)
|
|
118
121
|
ast (~> 2.4.1)
|
|
119
122
|
racc
|
|
120
123
|
patience_diff (1.2.0)
|
|
@@ -124,7 +127,7 @@ GEM
|
|
|
124
127
|
rainbow (3.1.1)
|
|
125
128
|
rake (13.2.1)
|
|
126
129
|
regexp_parser (2.9.2)
|
|
127
|
-
rexml (3.3.
|
|
130
|
+
rexml (3.3.9)
|
|
128
131
|
rspec (3.13.0)
|
|
129
132
|
rspec-core (~> 3.13.0)
|
|
130
133
|
rspec-expectations (~> 3.13.0)
|
|
@@ -138,7 +141,7 @@ GEM
|
|
|
138
141
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
139
142
|
rspec-support (~> 3.13.0)
|
|
140
143
|
rspec-support (3.13.1)
|
|
141
|
-
rubocop (1.
|
|
144
|
+
rubocop (1.68.0)
|
|
142
145
|
json (~> 2.3)
|
|
143
146
|
language_server-protocol (>= 3.17.0)
|
|
144
147
|
parallel (~> 1.10)
|
|
@@ -148,7 +151,7 @@ GEM
|
|
|
148
151
|
rubocop-ast (>= 1.32.2, < 2.0)
|
|
149
152
|
ruby-progressbar (~> 1.7)
|
|
150
153
|
unicode-display_width (>= 2.4.0, < 3.0)
|
|
151
|
-
rubocop-ast (1.
|
|
154
|
+
rubocop-ast (1.34.1)
|
|
152
155
|
parser (>= 3.3.1.0)
|
|
153
156
|
rubocop-capybara (2.21.0)
|
|
154
157
|
rubocop (~> 1.41)
|
|
@@ -162,7 +165,7 @@ GEM
|
|
|
162
165
|
rubocop-rspec_rails (2.29.1)
|
|
163
166
|
rubocop (~> 1.61)
|
|
164
167
|
ruby-progressbar (1.13.0)
|
|
165
|
-
securerandom (0.3.
|
|
168
|
+
securerandom (0.3.2)
|
|
166
169
|
simplecov (0.22.0)
|
|
167
170
|
docile (~> 1.1)
|
|
168
171
|
simplecov-html (~> 0.11)
|
|
@@ -177,7 +180,7 @@ GEM
|
|
|
177
180
|
tzinfo (2.0.6)
|
|
178
181
|
concurrent-ruby (~> 1.0)
|
|
179
182
|
unicode-display_width (2.6.0)
|
|
180
|
-
uri (0.
|
|
183
|
+
uri (1.0.1)
|
|
181
184
|
webmock (3.24.0)
|
|
182
185
|
addressable (>= 2.8.0)
|
|
183
186
|
crack (>= 0.3.2)
|
data/README.md
CHANGED
|
@@ -87,33 +87,15 @@ object_client.update(params: dro)
|
|
|
87
87
|
# Publish an object (push to PURL)
|
|
88
88
|
object_client.publish(workflow: 'releaseWF', lane_id: 'low')
|
|
89
89
|
|
|
90
|
-
# Shelve an object (push to Stacks)
|
|
91
|
-
object_client.shelve(lane_id: 'low')
|
|
92
|
-
|
|
93
90
|
# Start accessioning an object (initialize assemblyWF or specified workflow, and version object if needed)
|
|
94
91
|
object_client.accession.start(**versioning_params)
|
|
95
92
|
|
|
96
|
-
# Preserve an object (push to SDR)
|
|
97
|
-
object_client.preserve(lane_id: 'low')
|
|
98
|
-
|
|
99
|
-
# Update the MARC record (used in the releaseWF)
|
|
100
|
-
object_client.update_marc_record
|
|
101
|
-
|
|
102
|
-
# Update the DOI metadata (used by robot)
|
|
103
|
-
object_client.update_doi_metadata
|
|
104
|
-
|
|
105
|
-
# Update the Orcid work (used by robot)
|
|
106
|
-
object_client.update_orcid_work
|
|
107
|
-
|
|
108
93
|
# Copy metadata from Symphony into descMetadata
|
|
109
94
|
object_client.refresh_descriptive_metadata_from_ils
|
|
110
95
|
|
|
111
96
|
# Apply defaults from the item's AdminPolicy to the item itself
|
|
112
97
|
object_client.apply_admin_policy_defaults
|
|
113
98
|
|
|
114
|
-
# Send a notification to goobi
|
|
115
|
-
object_client.notify_goobi
|
|
116
|
-
|
|
117
99
|
# Manage versions
|
|
118
100
|
object_client.version.inventory
|
|
119
101
|
object_client.version.current
|
|
@@ -160,9 +142,8 @@ object_client.release_tags.list(public: true) # only public release tags (i.e. l
|
|
|
160
142
|
object_client.events.create(type: type, data: data)
|
|
161
143
|
object_client.events.list
|
|
162
144
|
|
|
163
|
-
# Create
|
|
145
|
+
# Create workspaces
|
|
164
146
|
object_client.workspace.create(source: object_path_string)
|
|
165
|
-
object_client.workspace.cleanup
|
|
166
147
|
|
|
167
148
|
# Reindex
|
|
168
149
|
object_client.reindex
|
data/dor-services-client.gemspec
CHANGED
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
|
|
25
25
|
spec.required_ruby_version = '>= 3.0', '< 4'
|
|
26
26
|
|
|
27
|
-
spec.add_dependency 'activesupport', '>=
|
|
27
|
+
spec.add_dependency 'activesupport', '>= 7.0.0'
|
|
28
28
|
spec.add_dependency 'cocina-models', '~> 0.99.0'
|
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
|
30
30
|
spec.add_dependency 'faraday', '~> 2.0'
|
|
@@ -107,8 +107,6 @@ module Dor
|
|
|
107
107
|
Transfer.new(**parent_params)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
delegate :publish, :preserve, :shelve, to: :transfer
|
|
111
|
-
|
|
112
110
|
def mutate
|
|
113
111
|
Mutate.new(**parent_params)
|
|
114
112
|
end
|
|
@@ -118,68 +116,41 @@ module Dor
|
|
|
118
116
|
alias refresh_metadata refresh_descriptive_metadata_from_ils
|
|
119
117
|
deprecation_deprecate refresh_metadata: 'Use refresh_descriptive_metadata_from_ils instead'
|
|
120
118
|
|
|
121
|
-
#
|
|
119
|
+
# Reindex the object in Solr.
|
|
122
120
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
123
121
|
# @raise [UnexpectedResponse] when the response is not successful.
|
|
124
122
|
# @return [boolean] true on success
|
|
125
|
-
def
|
|
126
|
-
resp = connection.post do |req|
|
|
127
|
-
req.url "#{object_path}/update_marc_record"
|
|
128
|
-
end
|
|
129
|
-
return true if resp.success?
|
|
130
|
-
|
|
131
|
-
raise_exception_based_on_response!(resp)
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
# Update the DOI metadata at DataCite
|
|
135
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
136
|
-
# @return [boolean] true on success
|
|
137
|
-
def update_doi_metadata
|
|
138
|
-
resp = connection.post do |req|
|
|
139
|
-
req.url "#{object_path}/update_doi_metadata"
|
|
140
|
-
end
|
|
141
|
-
return true if resp.success?
|
|
142
|
-
|
|
143
|
-
raise_exception_based_on_response!(resp)
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
# Update the ORCID Work
|
|
147
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
148
|
-
# @return [Boolean] true on success
|
|
149
|
-
def update_orcid_work
|
|
123
|
+
def reindex
|
|
150
124
|
resp = connection.post do |req|
|
|
151
|
-
req.url "#{object_path}/
|
|
125
|
+
req.url "#{object_path}/reindex"
|
|
152
126
|
end
|
|
153
127
|
return true if resp.success?
|
|
154
128
|
|
|
155
129
|
raise_exception_based_on_response!(resp)
|
|
156
130
|
end
|
|
157
131
|
|
|
158
|
-
#
|
|
132
|
+
# Publish an object (send to PURL)
|
|
159
133
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
160
134
|
# @raise [UnexpectedResponse] when the response is not successful.
|
|
161
|
-
# @
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
135
|
+
# @param [String] workflow (nil) which workflow to callback to.
|
|
136
|
+
# @param [String] lane_id for prioritization (default or low)
|
|
137
|
+
# @return [String] the URL of the background job on dor-service-app
|
|
138
|
+
# rubocop:disable Metrics/MethodLength
|
|
139
|
+
def publish(workflow: nil, lane_id: nil)
|
|
140
|
+
query_params = [].tap do |params|
|
|
141
|
+
params << "workflow=#{workflow}" if workflow
|
|
142
|
+
params << "lane-id=#{lane_id}" if lane_id
|
|
165
143
|
end
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
raise_exception_based_on_response!(resp)
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
# Reindex the object in Solr.
|
|
172
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
173
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
|
174
|
-
# @return [boolean] true on success
|
|
175
|
-
def reindex
|
|
144
|
+
query_string = query_params.any? ? "?#{query_params.join('&')}" : ''
|
|
145
|
+
publish_path = "#{object_path}/publish#{query_string}"
|
|
176
146
|
resp = connection.post do |req|
|
|
177
|
-
req.url
|
|
147
|
+
req.url publish_path
|
|
178
148
|
end
|
|
179
|
-
return
|
|
149
|
+
return resp.headers['Location'] if resp.success?
|
|
180
150
|
|
|
181
151
|
raise_exception_based_on_response!(resp)
|
|
182
152
|
end
|
|
153
|
+
# rubocop:enable Metrics/MethodLength
|
|
183
154
|
|
|
184
155
|
private
|
|
185
156
|
|
|
@@ -31,24 +31,6 @@ module Dor
|
|
|
31
31
|
end
|
|
32
32
|
# rubocop:enable Metrics/AbcSize
|
|
33
33
|
|
|
34
|
-
# Cleans up and resets the workspace
|
|
35
|
-
# After an object has been copied to preservation the workspace can be
|
|
36
|
-
# reset. This is called by the reset-workspace step of the accessionWF
|
|
37
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
38
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
|
39
|
-
# @param [String] lane_id for prioritization (default or low)
|
|
40
|
-
# @return [String] the URL of the background job on dor-service-app
|
|
41
|
-
def cleanup(lane_id: nil)
|
|
42
|
-
cleanup_workspace_path = workspace_path
|
|
43
|
-
cleanup_workspace_path += "?lane-id=#{lane_id}" if lane_id
|
|
44
|
-
resp = connection.delete do |req|
|
|
45
|
-
req.url cleanup_workspace_path
|
|
46
|
-
end
|
|
47
|
-
return resp.headers['Location'] if resp.success?
|
|
48
|
-
|
|
49
|
-
raise_exception_based_on_response!(resp, object_identifier)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
34
|
private
|
|
53
35
|
|
|
54
36
|
def workspace_path
|
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.2.
|
|
4
|
+
version: 15.2.1
|
|
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: 2024-
|
|
12
|
+
date: 2024-11-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -17,20 +17,14 @@ dependencies:
|
|
|
17
17
|
requirements:
|
|
18
18
|
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version:
|
|
21
|
-
- - "<"
|
|
22
|
-
- !ruby/object:Gem::Version
|
|
23
|
-
version: '8'
|
|
20
|
+
version: 7.0.0
|
|
24
21
|
type: :runtime
|
|
25
22
|
prerelease: false
|
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
27
24
|
requirements:
|
|
28
25
|
- - ">="
|
|
29
26
|
- !ruby/object:Gem::Version
|
|
30
|
-
version:
|
|
31
|
-
- - "<"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '8'
|
|
27
|
+
version: 7.0.0
|
|
34
28
|
- !ruby/object:Gem::Dependency
|
|
35
29
|
name: cocina-models
|
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -252,7 +246,6 @@ files:
|
|
|
252
246
|
- lib/dor/services/client/release_tag.rb
|
|
253
247
|
- lib/dor/services/client/release_tags.rb
|
|
254
248
|
- lib/dor/services/client/response_error_formatter.rb
|
|
255
|
-
- lib/dor/services/client/transfer.rb
|
|
256
249
|
- lib/dor/services/client/user_version.rb
|
|
257
250
|
- lib/dor/services/client/version.rb
|
|
258
251
|
- lib/dor/services/client/versioned_service.rb
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dor
|
|
4
|
-
module Services
|
|
5
|
-
class Client
|
|
6
|
-
# API calls that move data around.
|
|
7
|
-
class Transfer < 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
|
-
# Publish an object (send to PURL)
|
|
15
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
16
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
|
17
|
-
# @param [String] workflow (nil) which workflow to callback to.
|
|
18
|
-
# @param [String] lane_id for prioritization (default or low)
|
|
19
|
-
# @return [String] the URL of the background job on dor-service-app
|
|
20
|
-
def publish(workflow: nil, lane_id: nil)
|
|
21
|
-
query_params = [].tap do |params|
|
|
22
|
-
params << "workflow=#{workflow}" if workflow
|
|
23
|
-
params << "lane-id=#{lane_id}" if lane_id
|
|
24
|
-
end
|
|
25
|
-
query_string = query_params.any? ? "?#{query_params.join('&')}" : ''
|
|
26
|
-
publish_path = "#{object_path}/publish#{query_string}"
|
|
27
|
-
resp = connection.post do |req|
|
|
28
|
-
req.url publish_path
|
|
29
|
-
end
|
|
30
|
-
return resp.headers['Location'] if resp.success?
|
|
31
|
-
|
|
32
|
-
raise_exception_based_on_response!(resp)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Preserve an object (send to SDR)
|
|
36
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
37
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
|
38
|
-
# @param [String] lane_id for prioritization (default or low)
|
|
39
|
-
# @return [String] URL from Location response header if no errors
|
|
40
|
-
def preserve(lane_id: nil)
|
|
41
|
-
query_string = lane_id ? "?lane-id=#{lane_id}" : ''
|
|
42
|
-
resp = connection.post do |req|
|
|
43
|
-
req.url "#{object_path}/preserve#{query_string}"
|
|
44
|
-
end
|
|
45
|
-
return resp.headers['Location'] if resp.success?
|
|
46
|
-
|
|
47
|
-
raise_exception_based_on_response!(resp)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Shelve an object (send to Stacks)
|
|
51
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
52
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
|
53
|
-
# @param [String] lane_id for prioritization (default or low)
|
|
54
|
-
# @return [boolean] true on success
|
|
55
|
-
def shelve(lane_id: nil)
|
|
56
|
-
query_string = lane_id ? "?lane-id=#{lane_id}" : ''
|
|
57
|
-
resp = connection.post do |req|
|
|
58
|
-
req.url "#{object_path}/shelve#{query_string}"
|
|
59
|
-
end
|
|
60
|
-
return resp.headers['Location'] if resp.success?
|
|
61
|
-
|
|
62
|
-
raise_exception_based_on_response!(resp)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
private
|
|
66
|
-
|
|
67
|
-
def object_path
|
|
68
|
-
"#{api_version}/objects/#{object_identifier}"
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
attr_reader :object_identifier
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|