dor-services-client 14.7.0 → 14.9.0
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 +16 -13
- data/lib/dor/services/client/accession.rb +5 -1
- data/lib/dor/services/client/object.rb +4 -0
- data/lib/dor/services/client/object_version.rb +1 -0
- data/lib/dor/services/client/user_version.rb +41 -0
- data/lib/dor/services/client/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5843a507e487e1da137d521f9248440a4c8680a6fdbdcfcd8791a17788aeac3d
|
4
|
+
data.tar.gz: ca2900a871814c6e9f3921dc319505e0edde39f6fe28ac437ff8e967d229fa06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e663d3d99e82b8b5775d7a1f99bf0db9a4e2f5cb9684d4207c79d2181450e14ad8237dad041e21731aa0785512e0877dc6c358268fcfec2b925d9f6f4d1e225
|
7
|
+
data.tar.gz: 3faa6fc0dff1ad7297d4b73075cad8deb23858fdce1cba4f0645cb346897d81a448159876314552d4df3688b35054110f0ce4844f063ad66558ea37298349b51
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (14.
|
4
|
+
dor-services-client (14.9.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
cocina-models (~> 0.96.0)
|
7
7
|
deprecation
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
ast (2.4.2)
|
28
28
|
attr_extras (7.1.0)
|
29
29
|
base64 (0.2.0)
|
30
|
-
bigdecimal (3.1.
|
30
|
+
bigdecimal (3.1.8)
|
31
31
|
byebug (11.1.3)
|
32
32
|
cocina-models (0.96.0)
|
33
33
|
activesupport
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
faraday-retry (2.2.1)
|
88
88
|
faraday (~> 2.0)
|
89
89
|
hashdiff (1.1.0)
|
90
|
-
i18n (1.14.
|
90
|
+
i18n (1.14.5)
|
91
91
|
concurrent-ruby (~> 1.0)
|
92
92
|
ice_nine (0.11.2)
|
93
93
|
json (2.7.2)
|
@@ -99,16 +99,18 @@ GEM
|
|
99
99
|
mutex_m (0.2.0)
|
100
100
|
net-http (0.4.1)
|
101
101
|
uri
|
102
|
-
nokogiri (1.16.
|
102
|
+
nokogiri (1.16.5-arm64-darwin)
|
103
103
|
racc (~> 1.4)
|
104
|
-
nokogiri (1.16.
|
104
|
+
nokogiri (1.16.5-x86_64-darwin)
|
105
|
+
racc (~> 1.4)
|
106
|
+
nokogiri (1.16.5-x86_64-linux)
|
105
107
|
racc (~> 1.4)
|
106
108
|
openapi3_parser (0.9.2)
|
107
109
|
commonmarker (~> 0.17)
|
108
110
|
openapi_parser (1.0.0)
|
109
111
|
optimist (3.1.0)
|
110
112
|
parallel (1.24.0)
|
111
|
-
parser (3.3.0
|
113
|
+
parser (3.3.1.0)
|
112
114
|
ast (~> 2.4.1)
|
113
115
|
racc
|
114
116
|
patience_diff (1.2.0)
|
@@ -117,7 +119,7 @@ GEM
|
|
117
119
|
racc (1.7.3)
|
118
120
|
rainbow (3.1.1)
|
119
121
|
rake (13.2.1)
|
120
|
-
regexp_parser (2.9.
|
122
|
+
regexp_parser (2.9.1)
|
121
123
|
rexml (3.2.6)
|
122
124
|
rspec (3.13.0)
|
123
125
|
rspec-core (~> 3.13.0)
|
@@ -128,13 +130,13 @@ GEM
|
|
128
130
|
rspec-expectations (3.13.0)
|
129
131
|
diff-lcs (>= 1.2.0, < 2.0)
|
130
132
|
rspec-support (~> 3.13.0)
|
131
|
-
rspec-mocks (3.13.
|
133
|
+
rspec-mocks (3.13.1)
|
132
134
|
diff-lcs (>= 1.2.0, < 2.0)
|
133
135
|
rspec-support (~> 3.13.0)
|
134
136
|
rspec-support (3.13.1)
|
135
137
|
rss (0.3.0)
|
136
138
|
rexml
|
137
|
-
rubocop (1.63.
|
139
|
+
rubocop (1.63.5)
|
138
140
|
json (~> 2.3)
|
139
141
|
language_server-protocol (>= 3.17.0)
|
140
142
|
parallel (~> 1.10)
|
@@ -145,13 +147,13 @@ GEM
|
|
145
147
|
rubocop-ast (>= 1.31.1, < 2.0)
|
146
148
|
ruby-progressbar (~> 1.7)
|
147
149
|
unicode-display_width (>= 2.4.0, < 3.0)
|
148
|
-
rubocop-ast (1.31.
|
149
|
-
parser (>= 3.3.0
|
150
|
+
rubocop-ast (1.31.3)
|
151
|
+
parser (>= 3.3.1.0)
|
150
152
|
rubocop-capybara (2.20.0)
|
151
153
|
rubocop (~> 1.41)
|
152
154
|
rubocop-factory_bot (2.25.1)
|
153
155
|
rubocop (~> 1.41)
|
154
|
-
rubocop-rspec (2.29.
|
156
|
+
rubocop-rspec (2.29.2)
|
155
157
|
rubocop (~> 1.40)
|
156
158
|
rubocop-capybara (~> 2.17)
|
157
159
|
rubocop-factory_bot (~> 2.22)
|
@@ -165,7 +167,7 @@ GEM
|
|
165
167
|
simplecov_json_formatter (~> 0.1)
|
166
168
|
simplecov-html (0.12.3)
|
167
169
|
simplecov_json_formatter (0.1.4)
|
168
|
-
super_diff (0.
|
170
|
+
super_diff (0.12.1)
|
169
171
|
attr_extras (>= 6.2.4)
|
170
172
|
diff-lcs
|
171
173
|
patience_diff
|
@@ -181,6 +183,7 @@ GEM
|
|
181
183
|
zeitwerk (2.6.13)
|
182
184
|
|
183
185
|
PLATFORMS
|
186
|
+
arm64-darwin-23
|
184
187
|
x86_64-darwin-19
|
185
188
|
x86_64-darwin-20
|
186
189
|
x86_64-darwin-21
|
@@ -18,12 +18,16 @@ module Dor
|
|
18
18
|
# @option params [String] :description set description of version change - required
|
19
19
|
# @option params [String] :opening_user_name add opening username to the event - optional
|
20
20
|
# @option params [String] :workflow the workflow to start - defaults to 'assemblyWF'
|
21
|
+
# @option params [Hash] :context the workflow context - optional
|
21
22
|
# @return [Boolean] true on success
|
22
23
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
23
24
|
# @raise [UnexpectedResponse] when the response is not successful.
|
24
25
|
def start(params = {})
|
26
|
+
body = params[:context] ? { 'context' => params[:context] }.to_json : ''
|
25
27
|
resp = connection.post do |req|
|
26
|
-
req.url with_querystring(url: path, params: params)
|
28
|
+
req.url with_querystring(url: path, params: params.except(:context))
|
29
|
+
req.headers['Content-Type'] = 'application/json'
|
30
|
+
req.body = body
|
27
31
|
end
|
28
32
|
return true if resp.success?
|
29
33
|
|
@@ -38,6 +38,10 @@ module Dor
|
|
38
38
|
@version ||= ObjectVersion.new(**parent_params)
|
39
39
|
end
|
40
40
|
|
41
|
+
def user_version
|
42
|
+
@user_version ||= UserVersion.new(**parent_params)
|
43
|
+
end
|
44
|
+
|
41
45
|
def accession(params = {})
|
42
46
|
@accession ||= Accession.new(**parent_params.merge(params))
|
43
47
|
end
|
@@ -98,6 +98,7 @@ module Dor
|
|
98
98
|
# @param description [String] (optional) - a description of the object version being opened
|
99
99
|
# @param user_name [String] (optional) - sunetid
|
100
100
|
# @param start_accession [Boolean] (optional) - whether to start accessioning workflow; defaults to true
|
101
|
+
# @param user_versions [String] (optional - values are none, new, or update) - create, update, or do nothing with user versions on close; defaults to none.
|
101
102
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
102
103
|
# @raise [UnexpectedResponse] when the response is not successful.
|
103
104
|
# @return [String] a message confirming successful closing
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dor
|
4
|
+
module Services
|
5
|
+
class Client
|
6
|
+
# API calls that are about user versions
|
7
|
+
class UserVersion < VersionedService
|
8
|
+
Version = Struct.new(:version, :userVersion, keyword_init: true)
|
9
|
+
|
10
|
+
# @param object_identifier [String] the pid for the object
|
11
|
+
def initialize(connection:, version:, object_identifier:)
|
12
|
+
super(connection: connection, version: version)
|
13
|
+
@object_identifier = object_identifier
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Array] a list of the user versions
|
17
|
+
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
18
|
+
def inventory
|
19
|
+
resp = connection.get do |req|
|
20
|
+
req.url base_path
|
21
|
+
end
|
22
|
+
raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
|
23
|
+
|
24
|
+
JSON.parse(resp.body).fetch('user_versions').map { |params| Version.new(**params.symbolize_keys!) }
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :object_identifier
|
30
|
+
|
31
|
+
def object_path
|
32
|
+
"#{api_version}/objects/#{object_identifier}"
|
33
|
+
end
|
34
|
+
|
35
|
+
def base_path
|
36
|
+
"#{object_path}/user_versions"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
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: 14.
|
4
|
+
version: 14.9.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-
|
12
|
+
date: 2024-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -252,6 +252,7 @@ files:
|
|
252
252
|
- lib/dor/services/client/release_tags.rb
|
253
253
|
- lib/dor/services/client/response_error_formatter.rb
|
254
254
|
- lib/dor/services/client/transfer.rb
|
255
|
+
- lib/dor/services/client/user_version.rb
|
255
256
|
- lib/dor/services/client/version.rb
|
256
257
|
- lib/dor/services/client/versioned_service.rb
|
257
258
|
- lib/dor/services/client/virtual_objects.rb
|
@@ -278,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
279
|
- !ruby/object:Gem::Version
|
279
280
|
version: '0'
|
280
281
|
requirements: []
|
281
|
-
rubygems_version: 3.
|
282
|
+
rubygems_version: 3.4.19
|
282
283
|
signing_key:
|
283
284
|
specification_version: 4
|
284
285
|
summary: A client for dor-services-app
|