dor-services-client 14.4.0 → 14.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -4
- data/README.md +4 -1
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/accession.rb +0 -1
- data/lib/dor/services/client/object_version.rb +36 -2
- 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: f174f312d81c83f4eb16c9d833623fb69b8a010f4afbca1b57018a38819c10f2
|
4
|
+
data.tar.gz: 7230f8d8093bc586cb5a083b7b292c12d47fbba648e1999f3c697bcb7d56a216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7d5cffdeb8ce04d90055bce6a9e5a751dcf7eaef4483e7f206eb10a68eecd3c3519d2295b470e006b88d1d2b2bbc8ae47fdaae8ab45e28d403bdc9b68615c28
|
7
|
+
data.tar.gz: dbcf6972c5b6dacd76407eb6a8573377ea0372a0447f9c834a5a1803b6a9cc6d0d2d25f83b90cec6ec02e9f7ddd6648e51d4175ad7e62ef4bc48fead47f7daa6
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (14.
|
4
|
+
dor-services-client (14.6.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
|
-
cocina-models (~> 0.
|
6
|
+
cocina-models (~> 0.96.0)
|
7
7
|
deprecation
|
8
8
|
faraday (~> 2.0)
|
9
9
|
faraday-retry
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
base64 (0.2.0)
|
30
30
|
bigdecimal (3.1.7)
|
31
31
|
byebug (11.1.3)
|
32
|
-
cocina-models (0.
|
32
|
+
cocina-models (0.96.0)
|
33
33
|
activesupport
|
34
34
|
deprecation
|
35
35
|
dry-struct (~> 1.0)
|
@@ -151,10 +151,13 @@ GEM
|
|
151
151
|
rubocop (~> 1.41)
|
152
152
|
rubocop-factory_bot (2.25.1)
|
153
153
|
rubocop (~> 1.41)
|
154
|
-
rubocop-rspec (2.
|
154
|
+
rubocop-rspec (2.28.0)
|
155
155
|
rubocop (~> 1.40)
|
156
156
|
rubocop-capybara (~> 2.17)
|
157
157
|
rubocop-factory_bot (~> 2.22)
|
158
|
+
rubocop-rspec_rails (~> 2.28)
|
159
|
+
rubocop-rspec_rails (2.28.2)
|
160
|
+
rubocop (~> 1.40)
|
158
161
|
ruby-progressbar (1.13.0)
|
159
162
|
simplecov (0.22.0)
|
160
163
|
docile (~> 1.1)
|
data/README.md
CHANGED
@@ -120,9 +120,12 @@ object_client.notify_goobi
|
|
120
120
|
# Manage versions
|
121
121
|
object_client.version.inventory
|
122
122
|
object_client.version.current
|
123
|
+
# Returns a struct containing the status.
|
124
|
+
# Status includes whether the object is open, assembling, accessioning, or closeable.
|
125
|
+
object_client.version.status
|
123
126
|
object_client.version.openable?
|
124
127
|
# see dor-services-app openapi.yml for optional params
|
125
|
-
object_client.version.open(description: 'Changed title'
|
128
|
+
object_client.version.open(description: 'Changed title')
|
126
129
|
# see dor-services-app openapi.yml for optional params
|
127
130
|
object_client.version.close
|
128
131
|
|
data/dor-services-client.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = '>= 3.0', '< 4'
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 4.2', '< 8'
|
28
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
28
|
+
spec.add_dependency 'cocina-models', '~> 0.96.0'
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
30
30
|
spec.add_dependency 'faraday', '~> 2.0'
|
31
31
|
spec.add_dependency 'faraday-retry'
|
@@ -15,7 +15,6 @@ module Dor
|
|
15
15
|
|
16
16
|
# Start accession on an object (start specified workflow, assemblyWF by default, and version if needed)
|
17
17
|
# @param params [Hash<Symbol,String>] optional parameter hash
|
18
|
-
# @option params [String] :significance set significance (major/minor/patch) of version change - required
|
19
18
|
# @option params [String] :description set description of version change - required
|
20
19
|
# @option params [String] :opening_user_name add opening username to the event - optional
|
21
20
|
# @option params [String] :workflow the workflow to start - defaults to 'assemblyWF'
|
@@ -6,6 +6,31 @@ module Dor
|
|
6
6
|
# API calls that are about versions
|
7
7
|
class ObjectVersion < VersionedService
|
8
8
|
Version = Struct.new(:versionId, :tag, :message, keyword_init: true)
|
9
|
+
VersionStatus = Struct.new(:versionId, :open, :openable, :assembling, :accessioning, :closeable, keyword_init: true) do
|
10
|
+
def open?
|
11
|
+
open
|
12
|
+
end
|
13
|
+
|
14
|
+
def openable?
|
15
|
+
openable
|
16
|
+
end
|
17
|
+
|
18
|
+
def assembling?
|
19
|
+
assembling
|
20
|
+
end
|
21
|
+
|
22
|
+
def accessioning?
|
23
|
+
accessioning
|
24
|
+
end
|
25
|
+
|
26
|
+
def closed?
|
27
|
+
!open
|
28
|
+
end
|
29
|
+
|
30
|
+
def closeable?
|
31
|
+
closeable
|
32
|
+
end
|
33
|
+
end
|
9
34
|
|
10
35
|
# @param object_identifier [String] the pid for the object
|
11
36
|
def initialize(connection:, version:, object_identifier:)
|
@@ -51,7 +76,6 @@ module Dor
|
|
51
76
|
|
52
77
|
# Open new version for an object
|
53
78
|
# @param description [String] a description of the object version being opened - required
|
54
|
-
# @param significance [String] 'major' 'minor' or 'admin' - required
|
55
79
|
# @param opening_user_name [String] sunetid - defaults to nil
|
56
80
|
# @param assume_accessioned [Boolean] if true, does not check whether object has been accessioned; defaults to false
|
57
81
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
@@ -70,7 +94,6 @@ module Dor
|
|
70
94
|
|
71
95
|
# Close current version for an object
|
72
96
|
# @param description [String] (optional) - a description of the object version being opened
|
73
|
-
# @param significance [String] (optional) - 'major' 'minor' or 'admin'
|
74
97
|
# @param user_name [String] (optional) - sunetid
|
75
98
|
# @param start_accession [Boolean] (optional) - whether to start accessioning workflow; defaults to true
|
76
99
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
@@ -97,6 +120,17 @@ module Dor
|
|
97
120
|
JSON.parse(resp.body).fetch('versions').map { |params| Version.new(**params.symbolize_keys!) }
|
98
121
|
end
|
99
122
|
|
123
|
+
# @return [VersionStatus] status of the version
|
124
|
+
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
125
|
+
def status
|
126
|
+
resp = connection.get do |req|
|
127
|
+
req.url "#{base_path}/status"
|
128
|
+
end
|
129
|
+
raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
|
130
|
+
|
131
|
+
VersionStatus.new(JSON.parse(resp.body).symbolize_keys!)
|
132
|
+
end
|
133
|
+
|
100
134
|
private
|
101
135
|
|
102
136
|
attr_reader :object_identifier
|
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: 14.
|
4
|
+
version: 14.6.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-03
|
12
|
+
date: 2024-04-03 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.96.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.96.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: deprecation
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
278
|
- !ruby/object:Gem::Version
|
279
279
|
version: '0'
|
280
280
|
requirements: []
|
281
|
-
rubygems_version: 3.
|
281
|
+
rubygems_version: 3.5.7
|
282
282
|
signing_key:
|
283
283
|
specification_version: 4
|
284
284
|
summary: A client for dor-services-app
|