dor-services-client 15.0.0 → 15.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +68 -9
- data/Gemfile.lock +5 -5
- data/README.md +0 -4
- data/lib/dor/services/client/object.rb +1 -1
- data/lib/dor/services/client/object_version.rb +17 -24
- data/lib/dor/services/client/transfer.rb +0 -13
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/workspace.rb +4 -17
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaec16bd6ab8deb272496997f7e8b3289652e81b01a8fd9b5cf3bbb7e19b04f8
|
4
|
+
data.tar.gz: 0fb8f67b2da1991cc2ae8439d49e1bb3ec526db4d762a17efdaa7612bdbe858f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7035e7003d3ac05987dd5ecdb902040ab3f5a5ac57c74fe245e7745e502b7a60ec4319fe0f9ac2f68713e062f46094493de01d3c748fdf93b6acb708a80240b2
|
7
|
+
data.tar.gz: 87950288c58bef7e0795d05908a2a5fb700c3651ff0b780c54289e8f3ec66b9ac6c1c25415e54a3d5f16837b46a3835f21406223db9d277979abf82f15e3cfdd
|
data/.rubocop.yml
CHANGED
@@ -12,15 +12,15 @@ Metrics/BlockLength:
|
|
12
12
|
- 'dor-services-client.gemspec'
|
13
13
|
- 'spec/**/*'
|
14
14
|
|
15
|
+
RSpec/ExampleLength:
|
16
|
+
Enabled: false
|
17
|
+
|
15
18
|
RSpec/MultipleExpectations:
|
16
19
|
Enabled: false
|
17
20
|
|
18
21
|
RSpec/MultipleMemoizedHelpers:
|
19
22
|
Enabled: false
|
20
23
|
|
21
|
-
RSpec/ExampleLength:
|
22
|
-
Max: 10
|
23
|
-
|
24
24
|
Gemspec/DeprecatedAttributeAssignment: # (new in 1.10)
|
25
25
|
Enabled: true
|
26
26
|
Layout/SpaceBeforeBrackets: # (new in 1.7)
|
@@ -135,7 +135,7 @@ RSpec/SubjectDeclaration: # new in 2.5
|
|
135
135
|
Enabled: true
|
136
136
|
FactoryBot/SyntaxMethods: # new in 2.7
|
137
137
|
Enabled: true
|
138
|
-
|
138
|
+
RSpecRails/AvoidSetupHook: # new in 2.4
|
139
139
|
Enabled: true
|
140
140
|
|
141
141
|
Lint/RefinementImportMethods: # new in 1.27
|
@@ -179,7 +179,7 @@ RSpec/ChangeByZero: # new in 2.11.0
|
|
179
179
|
Enabled: true
|
180
180
|
Capybara/SpecificMatcher: # new in 2.12
|
181
181
|
Enabled: false
|
182
|
-
|
182
|
+
RSpecRails/HaveHttpStatus: # new in 2.12
|
183
183
|
Enabled: false
|
184
184
|
|
185
185
|
RSpec/ClassCheck: # new in 2.13
|
@@ -271,11 +271,11 @@ RSpec/SkipBlockInsideExample: # new in 2.19
|
|
271
271
|
Enabled: true
|
272
272
|
RSpec/SortMetadata: # new in 2.14
|
273
273
|
Enabled: true
|
274
|
-
|
274
|
+
RSpecRails/InferredSpecType: # new in 2.14
|
275
275
|
Enabled: true
|
276
|
-
|
276
|
+
RSpecRails/MinitestAssertions: # new in 2.17
|
277
277
|
Enabled: true
|
278
|
-
|
278
|
+
RSpecRails/TravelAround: # new in 2.19
|
279
279
|
Enabled: true
|
280
280
|
|
281
281
|
Lint/MixedCaseRange: # new in 1.53
|
@@ -292,5 +292,64 @@ Style/YAMLFileRead: # new in 1.53
|
|
292
292
|
Enabled: true
|
293
293
|
RSpec/ReceiveMessages: # new in 2.23
|
294
294
|
Enabled: true
|
295
|
-
|
295
|
+
RSpecRails/NegationBeValid: # new in 2.23
|
296
|
+
Enabled: true
|
297
|
+
|
298
|
+
Gemspec/AddRuntimeDependency: # new in 1.65
|
299
|
+
Enabled: true
|
300
|
+
Lint/DuplicateSetElement: # new in 1.67
|
301
|
+
Enabled: true
|
302
|
+
Lint/ItWithoutArgumentsInBlock: # new in 1.59
|
303
|
+
Enabled: true
|
304
|
+
Lint/LiteralAssignmentInCondition: # new in 1.58
|
305
|
+
Enabled: true
|
306
|
+
Lint/UselessNumericOperation: # new in 1.66
|
307
|
+
Enabled: true
|
308
|
+
Style/MapIntoArray: # new in 1.63
|
309
|
+
Enabled: true
|
310
|
+
Style/RedundantInterpolationUnfreeze: # new in 1.66
|
311
|
+
Enabled: true
|
312
|
+
Style/SendWithLiteralMethodName: # new in 1.64
|
313
|
+
Enabled: true
|
314
|
+
Style/SingleLineDoEndBlock: # new in 1.57
|
315
|
+
Enabled: true
|
316
|
+
Style/SuperArguments: # new in 1.64
|
317
|
+
Enabled: true
|
318
|
+
Style/SuperWithArgsParentheses: # new in 1.58
|
319
|
+
Enabled: true
|
320
|
+
Capybara/ClickLinkOrButtonStyle: # new in 2.19
|
321
|
+
Enabled: true
|
322
|
+
Capybara/RedundantWithinFind: # new in 2.20
|
323
|
+
Enabled: true
|
324
|
+
Capybara/RSpec/HaveSelector: # new in 2.19
|
325
|
+
Enabled: true
|
326
|
+
Capybara/RSpec/PredicateMatcher: # new in 2.19
|
327
|
+
Enabled: true
|
328
|
+
FactoryBot/ExcessiveCreateList: # new in 2.25
|
329
|
+
Enabled: true
|
330
|
+
FactoryBot/IdSequence: # new in 2.24
|
331
|
+
Enabled: true
|
332
|
+
RSpec/EmptyMetadata: # new in 2.24
|
333
|
+
Enabled: true
|
334
|
+
RSpec/EmptyOutput: # new in 2.29
|
335
|
+
Enabled: true
|
336
|
+
RSpec/Eq: # new in 2.24
|
337
|
+
Enabled: true
|
338
|
+
RSpec/ExpectInLet: # new in 2.30
|
339
|
+
Enabled: true
|
340
|
+
RSpec/IsExpectedSpecify: # new in 2.27
|
341
|
+
Enabled: true
|
342
|
+
RSpec/MetadataStyle: # new in 2.24
|
343
|
+
Enabled: true
|
344
|
+
RSpec/RedundantPredicateMatcher: # new in 2.26
|
345
|
+
Enabled: true
|
346
|
+
RSpec/RemoveConst: # new in 2.26
|
347
|
+
Enabled: true
|
348
|
+
RSpec/RepeatedSubjectCall: # new in 2.27
|
349
|
+
Enabled: true
|
350
|
+
RSpec/SpecFilePathFormat: # new in 2.24
|
351
|
+
Enabled: true
|
352
|
+
RSpec/SpecFilePathSuffix: # new in 2.24
|
353
|
+
Enabled: true
|
354
|
+
RSpec/UndescriptiveLiteralsDescription: # new in 2.29
|
296
355
|
Enabled: true
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (15.
|
4
|
+
dor-services-client (15.2.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
cocina-models (~> 0.99.0)
|
7
7
|
deprecation
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (7.2.1)
|
15
|
+
activesupport (7.2.1.1)
|
16
16
|
base64
|
17
17
|
bigdecimal
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
@@ -129,7 +129,7 @@ GEM
|
|
129
129
|
rspec-core (~> 3.13.0)
|
130
130
|
rspec-expectations (~> 3.13.0)
|
131
131
|
rspec-mocks (~> 3.13.0)
|
132
|
-
rspec-core (3.13.
|
132
|
+
rspec-core (3.13.2)
|
133
133
|
rspec-support (~> 3.13.0)
|
134
134
|
rspec-expectations (3.13.3)
|
135
135
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -138,7 +138,7 @@ GEM
|
|
138
138
|
diff-lcs (>= 1.2.0, < 2.0)
|
139
139
|
rspec-support (~> 3.13.0)
|
140
140
|
rspec-support (3.13.1)
|
141
|
-
rubocop (1.
|
141
|
+
rubocop (1.67.0)
|
142
142
|
json (~> 2.3)
|
143
143
|
language_server-protocol (>= 3.17.0)
|
144
144
|
parallel (~> 1.10)
|
@@ -182,7 +182,7 @@ GEM
|
|
182
182
|
addressable (>= 2.8.0)
|
183
183
|
crack (>= 0.3.2)
|
184
184
|
hashdiff (>= 0.4.0, < 2.0.0)
|
185
|
-
zeitwerk (2.
|
185
|
+
zeitwerk (2.7.1)
|
186
186
|
|
187
187
|
PLATFORMS
|
188
188
|
arm64-darwin-23
|
data/README.md
CHANGED
@@ -87,9 +87,6 @@ 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
|
-
# Unpublish an object (yank from PURL)
|
91
|
-
object_client.unpublish()
|
92
|
-
|
93
90
|
# Shelve an object (push to Stacks)
|
94
91
|
object_client.shelve(lane_id: 'low')
|
95
92
|
|
@@ -123,7 +120,6 @@ object_client.version.current
|
|
123
120
|
# Returns a struct containing the status.
|
124
121
|
# Status includes whether the object is open, assembling, accessioning, or closeable.
|
125
122
|
object_client.version.status
|
126
|
-
object_client.version.openable?
|
127
123
|
# see dor-services-app openapi.yml for optional params
|
128
124
|
object_client.version.open(description: 'Changed title')
|
129
125
|
# see dor-services-app openapi.yml for optional params
|
@@ -13,7 +13,7 @@ module Dor
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
VersionStatus = Struct.new(:versionId, :open, :openable, :assembling, :accessioning, :closeable, keyword_init: true) do
|
16
|
+
VersionStatus = Struct.new(:versionId, :open, :openable, :assembling, :accessioning, :closeable, :discardable, keyword_init: true) do
|
17
17
|
alias_method :version, :versionId
|
18
18
|
|
19
19
|
def open?
|
@@ -39,6 +39,10 @@ module Dor
|
|
39
39
|
def closeable?
|
40
40
|
closeable
|
41
41
|
end
|
42
|
+
|
43
|
+
def discardable?
|
44
|
+
discardable
|
45
|
+
end
|
42
46
|
end
|
43
47
|
|
44
48
|
# @param object_identifier [String] the pid for the object
|
@@ -71,29 +75,6 @@ module Dor
|
|
71
75
|
raise_exception_based_on_response!(resp)
|
72
76
|
end
|
73
77
|
|
74
|
-
# Determines if a new version can be opened for a DOR object.
|
75
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
76
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
77
|
-
# @return [Boolean] true if a new version can be opened
|
78
|
-
# rubocop:disable Metrics/MethodLength
|
79
|
-
def openable?
|
80
|
-
resp = connection.get do |req|
|
81
|
-
req.url "#{base_path}/openable"
|
82
|
-
end
|
83
|
-
|
84
|
-
raise_exception_based_on_response!(resp) unless resp.success?
|
85
|
-
|
86
|
-
case resp.body
|
87
|
-
when 'true'
|
88
|
-
true
|
89
|
-
when 'false'
|
90
|
-
false
|
91
|
-
else
|
92
|
-
raise MalformedResponse, "Expected true or false, not #{resp.body}"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
# rubocop:enable Metrics/MethodLength
|
96
|
-
|
97
78
|
# Open new version for an object
|
98
79
|
# @param description [String] a description of the object version being opened - required
|
99
80
|
# @param opening_user_name [String] sunetid - defaults to nil
|
@@ -163,6 +144,18 @@ module Dor
|
|
163
144
|
JSON.parse(resp.body)
|
164
145
|
end
|
165
146
|
|
147
|
+
# Discard current version for an object
|
148
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
149
|
+
# @raise [UnexpectedResponse] when the response is not successful.
|
150
|
+
def discard
|
151
|
+
resp = connection.delete do |req|
|
152
|
+
req.url "#{base_path}/current"
|
153
|
+
end
|
154
|
+
return if resp.success?
|
155
|
+
|
156
|
+
raise_exception_based_on_response!(resp)
|
157
|
+
end
|
158
|
+
|
166
159
|
private
|
167
160
|
|
168
161
|
attr_reader :object_identifier
|
@@ -32,19 +32,6 @@ module Dor
|
|
32
32
|
raise_exception_based_on_response!(resp)
|
33
33
|
end
|
34
34
|
|
35
|
-
# Unpublish an object (yank from to PURL)
|
36
|
-
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
37
|
-
# @raise [UnexpectedResponse] when the response is not successful.
|
38
|
-
# @return [String] the URL of the background job on dor-service-app
|
39
|
-
def unpublish
|
40
|
-
resp = connection.post do |req|
|
41
|
-
req.url "#{object_path}/unpublish"
|
42
|
-
end
|
43
|
-
return resp.headers['Location'] if resp.success?
|
44
|
-
|
45
|
-
raise_exception_based_on_response!(resp)
|
46
|
-
end
|
47
|
-
|
48
35
|
# Preserve an object (send to SDR)
|
49
36
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
50
37
|
# @raise [UnexpectedResponse] when the response is not successful.
|
@@ -36,12 +36,13 @@ module Dor
|
|
36
36
|
# reset. This is called by the reset-workspace step of the accessionWF
|
37
37
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
38
38
|
# @raise [UnexpectedResponse] when the response is not successful.
|
39
|
-
# @param [String] workflow (nil) which workflow to callback to.
|
40
39
|
# @param [String] lane_id for prioritization (default or low)
|
41
40
|
# @return [String] the URL of the background job on dor-service-app
|
42
|
-
def cleanup(
|
41
|
+
def cleanup(lane_id: nil)
|
42
|
+
cleanup_workspace_path = workspace_path
|
43
|
+
cleanup_workspace_path += "?lane-id=#{lane_id}" if lane_id
|
43
44
|
resp = connection.delete do |req|
|
44
|
-
req.url
|
45
|
+
req.url cleanup_workspace_path
|
45
46
|
end
|
46
47
|
return resp.headers['Location'] if resp.success?
|
47
48
|
|
@@ -54,20 +55,6 @@ module Dor
|
|
54
55
|
"#{api_version}/objects/#{object_identifier}/workspace"
|
55
56
|
end
|
56
57
|
|
57
|
-
def query_params_for(workflow, lane_id)
|
58
|
-
[].tap do |params|
|
59
|
-
params << "workflow=#{workflow}" if workflow
|
60
|
-
params << "lane-id=#{lane_id}" if lane_id
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def with_query_params(url, workflow, lane_id)
|
65
|
-
query_params = query_params_for(workflow, lane_id)
|
66
|
-
return url unless query_params.any?
|
67
|
-
|
68
|
-
"#{url}?#{query_params.join('&')}"
|
69
|
-
end
|
70
|
-
|
71
58
|
attr_reader :object_identifier
|
72
59
|
end
|
73
60
|
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.
|
4
|
+
version: 15.2.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: 2024-10-
|
12
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
280
|
- !ruby/object:Gem::Version
|
281
281
|
version: '0'
|
282
282
|
requirements: []
|
283
|
-
rubygems_version: 3.5.
|
283
|
+
rubygems_version: 3.5.11
|
284
284
|
signing_key:
|
285
285
|
specification_version: 4
|
286
286
|
summary: A client for dor-services-app
|