dor-services-client 15.2.1 → 15.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -1
- data/Gemfile.lock +51 -52
- data/README.md +6 -2
- data/lib/dor/services/client/object_version.rb +3 -1
- data/lib/dor/services/client/objects.rb +16 -0
- data/lib/dor/services/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af025cd4df3276cc4c2e5793794861a55332ba2d9e8d9c69e9168df4901038c1
|
4
|
+
data.tar.gz: e7e7d2778580bf7641010cadf17c37faf85f6067c5606b52b9f39e25e0860ba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b865de43d42a4d2fab0bfb5749d477f90514f6cf6a2ef7b3678ae7c339ba620f3de2ef4f3fdc9f95cb2abb4edfc4bf0be1023a70066bfa86a0d0980fed76f0
|
7
|
+
data.tar.gz: bcedec265771008b92a3f59d34e11820871dad15419924d9fce4a2d1786f9e826bc262a5a6fb13ff3c88332a0c03d2241102efd81b226186d0add9c61a1c6bde
|
data/.circleci/config.yml
CHANGED
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.4.0)
|
5
5
|
activesupport (>= 7.0.0)
|
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 (
|
15
|
+
activesupport (8.0.1)
|
16
16
|
base64
|
17
17
|
benchmark (>= 0.3)
|
18
18
|
bigdecimal
|
@@ -24,15 +24,16 @@ GEM
|
|
24
24
|
minitest (>= 5.1)
|
25
25
|
securerandom (>= 0.3)
|
26
26
|
tzinfo (~> 2.0, >= 2.0.5)
|
27
|
+
uri (>= 0.13.1)
|
27
28
|
addressable (2.8.7)
|
28
29
|
public_suffix (>= 2.0.2, < 7.0)
|
29
30
|
ast (2.4.2)
|
30
31
|
attr_extras (7.1.0)
|
31
32
|
base64 (0.2.0)
|
32
33
|
benchmark (0.4.0)
|
33
|
-
bigdecimal (3.1.
|
34
|
+
bigdecimal (3.1.9)
|
34
35
|
byebug (11.1.3)
|
35
|
-
cocina-models (0.99.
|
36
|
+
cocina-models (0.99.4)
|
36
37
|
activesupport
|
37
38
|
deprecation
|
38
39
|
dry-struct (~> 1.0)
|
@@ -42,16 +43,12 @@ GEM
|
|
42
43
|
i18n
|
43
44
|
jsonpath
|
44
45
|
nokogiri
|
45
|
-
openapi3_parser
|
46
46
|
openapi_parser (~> 1.0)
|
47
47
|
super_diff
|
48
48
|
thor
|
49
49
|
zeitwerk (~> 2.1)
|
50
|
-
|
51
|
-
|
52
|
-
commonmarker (1.1.5-x86_64-linux)
|
53
|
-
concurrent-ruby (1.3.4)
|
54
|
-
connection_pool (2.4.1)
|
50
|
+
concurrent-ruby (1.3.5)
|
51
|
+
connection_pool (2.5.0)
|
55
52
|
crack (1.0.0)
|
56
53
|
bigdecimal
|
57
54
|
rexml
|
@@ -60,64 +57,63 @@ GEM
|
|
60
57
|
diff-lcs (1.5.1)
|
61
58
|
docile (1.4.1)
|
62
59
|
drb (2.2.1)
|
63
|
-
dry-core (1.0
|
60
|
+
dry-core (1.1.0)
|
64
61
|
concurrent-ruby (~> 1.0)
|
65
62
|
logger
|
66
63
|
zeitwerk (~> 2.6)
|
67
|
-
dry-inflector (1.
|
68
|
-
dry-logic (1.
|
64
|
+
dry-inflector (1.2.0)
|
65
|
+
dry-logic (1.6.0)
|
66
|
+
bigdecimal
|
69
67
|
concurrent-ruby (~> 1.0)
|
70
|
-
dry-core (~> 1.
|
68
|
+
dry-core (~> 1.1)
|
71
69
|
zeitwerk (~> 2.6)
|
72
|
-
dry-struct (1.
|
73
|
-
dry-core (~> 1.
|
74
|
-
dry-types (
|
70
|
+
dry-struct (1.7.1)
|
71
|
+
dry-core (~> 1.1)
|
72
|
+
dry-types (~> 1.8, >= 1.8.2)
|
75
73
|
ice_nine (~> 0.11)
|
76
74
|
zeitwerk (~> 2.6)
|
77
|
-
dry-types (1.
|
75
|
+
dry-types (1.8.2)
|
78
76
|
bigdecimal (~> 3.0)
|
79
77
|
concurrent-ruby (~> 1.0)
|
80
78
|
dry-core (~> 1.0)
|
81
79
|
dry-inflector (~> 1.0)
|
82
80
|
dry-logic (~> 1.4)
|
83
81
|
zeitwerk (~> 2.6)
|
84
|
-
edtf (3.
|
85
|
-
activesupport (>= 3.0, <
|
82
|
+
edtf (3.2.0)
|
83
|
+
activesupport (>= 3.0, < 9.0)
|
86
84
|
equivalent-xml (0.6.0)
|
87
85
|
nokogiri (>= 1.4.3)
|
88
|
-
faraday (2.12.
|
89
|
-
faraday-net_http (>= 2.0, < 3.
|
86
|
+
faraday (2.12.2)
|
87
|
+
faraday-net_http (>= 2.0, < 3.5)
|
90
88
|
json
|
91
89
|
logger
|
92
|
-
faraday-net_http (3.
|
93
|
-
net-http
|
90
|
+
faraday-net_http (3.4.0)
|
91
|
+
net-http (>= 0.5.0)
|
94
92
|
faraday-retry (2.2.1)
|
95
93
|
faraday (~> 2.0)
|
96
|
-
hashdiff (1.1.
|
97
|
-
i18n (1.14.
|
94
|
+
hashdiff (1.1.2)
|
95
|
+
i18n (1.14.7)
|
98
96
|
concurrent-ruby (~> 1.0)
|
99
97
|
ice_nine (0.11.2)
|
100
|
-
json (2.
|
98
|
+
json (2.9.1)
|
101
99
|
jsonpath (1.1.5)
|
102
100
|
multi_json
|
103
|
-
language_server-protocol (3.17.0.
|
104
|
-
logger (1.6.
|
105
|
-
minitest (5.25.
|
101
|
+
language_server-protocol (3.17.0.4)
|
102
|
+
logger (1.6.5)
|
103
|
+
minitest (5.25.4)
|
106
104
|
multi_json (1.15.0)
|
107
|
-
net-http (0.
|
105
|
+
net-http (0.6.0)
|
108
106
|
uri
|
109
|
-
nokogiri (1.
|
107
|
+
nokogiri (1.18.2-arm64-darwin)
|
110
108
|
racc (~> 1.4)
|
111
|
-
nokogiri (1.
|
109
|
+
nokogiri (1.18.2-x86_64-darwin)
|
112
110
|
racc (~> 1.4)
|
113
|
-
nokogiri (1.
|
111
|
+
nokogiri (1.18.2-x86_64-linux-gnu)
|
114
112
|
racc (~> 1.4)
|
115
|
-
openapi3_parser (0.10.0)
|
116
|
-
commonmarker (>= 1.0)
|
117
113
|
openapi_parser (1.0.0)
|
118
|
-
optimist (3.
|
114
|
+
optimist (3.2.0)
|
119
115
|
parallel (1.26.3)
|
120
|
-
parser (3.3.
|
116
|
+
parser (3.3.7.1)
|
121
117
|
ast (~> 2.4.1)
|
122
118
|
racc
|
123
119
|
patience_diff (1.2.0)
|
@@ -126,13 +122,13 @@ GEM
|
|
126
122
|
racc (1.8.1)
|
127
123
|
rainbow (3.1.1)
|
128
124
|
rake (13.2.1)
|
129
|
-
regexp_parser (2.
|
130
|
-
rexml (3.
|
125
|
+
regexp_parser (2.10.0)
|
126
|
+
rexml (3.4.0)
|
131
127
|
rspec (3.13.0)
|
132
128
|
rspec-core (~> 3.13.0)
|
133
129
|
rspec-expectations (~> 3.13.0)
|
134
130
|
rspec-mocks (~> 3.13.0)
|
135
|
-
rspec-core (3.13.
|
131
|
+
rspec-core (3.13.3)
|
136
132
|
rspec-support (~> 3.13.0)
|
137
133
|
rspec-expectations (3.13.3)
|
138
134
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -140,18 +136,18 @@ GEM
|
|
140
136
|
rspec-mocks (3.13.2)
|
141
137
|
diff-lcs (>= 1.2.0, < 2.0)
|
142
138
|
rspec-support (~> 3.13.0)
|
143
|
-
rspec-support (3.13.
|
144
|
-
rubocop (1.
|
139
|
+
rspec-support (3.13.2)
|
140
|
+
rubocop (1.71.2)
|
145
141
|
json (~> 2.3)
|
146
142
|
language_server-protocol (>= 3.17.0)
|
147
143
|
parallel (~> 1.10)
|
148
144
|
parser (>= 3.3.0.2)
|
149
145
|
rainbow (>= 2.2.2, < 4.0)
|
150
|
-
regexp_parser (>= 2.
|
151
|
-
rubocop-ast (>= 1.
|
146
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
147
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
152
148
|
ruby-progressbar (~> 1.7)
|
153
|
-
unicode-display_width (>= 2.4.0, <
|
154
|
-
rubocop-ast (1.
|
149
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
150
|
+
rubocop-ast (1.38.0)
|
155
151
|
parser (>= 3.3.1.0)
|
156
152
|
rubocop-capybara (2.21.0)
|
157
153
|
rubocop (~> 1.41)
|
@@ -165,23 +161,25 @@ GEM
|
|
165
161
|
rubocop-rspec_rails (2.29.1)
|
166
162
|
rubocop (~> 1.61)
|
167
163
|
ruby-progressbar (1.13.0)
|
168
|
-
securerandom (0.
|
164
|
+
securerandom (0.4.1)
|
169
165
|
simplecov (0.22.0)
|
170
166
|
docile (~> 1.1)
|
171
167
|
simplecov-html (~> 0.11)
|
172
168
|
simplecov_json_formatter (~> 0.1)
|
173
169
|
simplecov-html (0.13.1)
|
174
170
|
simplecov_json_formatter (0.1.4)
|
175
|
-
super_diff (0.
|
171
|
+
super_diff (0.15.0)
|
176
172
|
attr_extras (>= 6.2.4)
|
177
173
|
diff-lcs
|
178
174
|
patience_diff
|
179
175
|
thor (1.3.2)
|
180
176
|
tzinfo (2.0.6)
|
181
177
|
concurrent-ruby (~> 1.0)
|
182
|
-
unicode-display_width (
|
183
|
-
|
184
|
-
|
178
|
+
unicode-display_width (3.1.4)
|
179
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
180
|
+
unicode-emoji (4.0.4)
|
181
|
+
uri (1.0.2)
|
182
|
+
webmock (3.25.0)
|
185
183
|
addressable (>= 2.8.0)
|
186
184
|
crack (>= 0.3.2)
|
187
185
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -189,6 +187,7 @@ GEM
|
|
189
187
|
|
190
188
|
PLATFORMS
|
191
189
|
arm64-darwin-23
|
190
|
+
arm64-darwin-24
|
192
191
|
x86_64-darwin-19
|
193
192
|
x86_64-darwin-20
|
194
193
|
x86_64-darwin-21
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
[](https://badge.fury.io/rb/dor-services-client)
|
2
2
|
[](https://circleci.com/gh/sul-dlss/dor-services-client)
|
3
|
-
[](https://codeclimate.com/github/sul-dlss/dor-services-client/coverage)
|
3
|
+
[](https://codecov.io/github/sul-dlss/dor-services-client)
|
5
4
|
|
6
5
|
# Dor::Services::Client
|
7
6
|
|
@@ -66,6 +65,9 @@ objects_client.register(params: {}, assign_doi: true)
|
|
66
65
|
# Find object by source ID
|
67
66
|
objects_client.find(source_id: 'sul:abc123')
|
68
67
|
|
68
|
+
# Get status for a batch of objects
|
69
|
+
objects_client.statuses(object_ids: ['druid:bc123df4567', 'druid:bc987gh6543'])
|
70
|
+
|
69
71
|
# Interact with virtual objects
|
70
72
|
virtual_objects_client = Dor::Services::Client.virtual_objects
|
71
73
|
|
@@ -101,7 +103,9 @@ object_client.version.inventory
|
|
101
103
|
object_client.version.current
|
102
104
|
# Returns a struct containing the status.
|
103
105
|
# Status includes whether the object is open, assembling, accessioning, or closeable.
|
106
|
+
# See also objects_client.statuses for getting statuses in batch.
|
104
107
|
object_client.version.status
|
108
|
+
|
105
109
|
# see dor-services-app openapi.yml for optional params
|
106
110
|
object_client.version.open(description: 'Changed title')
|
107
111
|
# see dor-services-app openapi.yml for optional params
|
@@ -13,8 +13,10 @@ module Dor
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
VersionStatus = Struct.new(:versionId, :open, :openable, :assembling, :accessioning, :closeable, :discardable,
|
16
|
+
VersionStatus = Struct.new(:versionId, :open, :openable, :assembling, :accessioning, :closeable, :discardable,
|
17
|
+
:versionDescription, keyword_init: true) do
|
17
18
|
alias_method :version, :versionId
|
19
|
+
alias_method :version_description, :versionDescription
|
18
20
|
|
19
21
|
def open?
|
20
22
|
open
|
@@ -41,6 +41,22 @@ module Dor
|
|
41
41
|
build_cocina_from_response(resp, validate: validate)
|
42
42
|
end
|
43
43
|
|
44
|
+
# Retrieves the version statuses for a batch of objects
|
45
|
+
# @param [Array<String>] object_ids the druids to get statuses for
|
46
|
+
# @return [Hash<String,VersionStatus>] Map of druids to statuses
|
47
|
+
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
48
|
+
def statuses(object_ids:)
|
49
|
+
resp = connection.post do |req|
|
50
|
+
req.url "#{objects_path}/versions/status"
|
51
|
+
req.headers['Content-Type'] = 'application/json'
|
52
|
+
req.body = { externalIdentifiers: object_ids }.to_json
|
53
|
+
end
|
54
|
+
|
55
|
+
raise_exception_based_on_response!(resp) unless resp.success?
|
56
|
+
|
57
|
+
JSON.parse(resp.body).transform_values { |status| ObjectVersion::VersionStatus.new(status.symbolize_keys!) }
|
58
|
+
end
|
59
|
+
|
44
60
|
private
|
45
61
|
|
46
62
|
def objects_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.
|
4
|
+
version: 15.4.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:
|
12
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|