dor-services-client 15.2.1 → 15.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17084d47db10602abff0c9d6bc50840dfac58ac14e2efa96a2a2f38f0dd8b779
4
- data.tar.gz: 9fa643be94ed39a305199becf67b996759084fbf2ebecbd139cfc2e03b50c6ae
3
+ metadata.gz: 7e74ca0ad7c415b3106f4877959eb84fd330a1d6165fde35061b9b8cf329ed2f
4
+ data.tar.gz: 467ca654ab6c53959a8cfa59f8379357129de3f531a236091712c798ec6d24eb
5
5
  SHA512:
6
- metadata.gz: fedc3d9668ecc6be0e9139b983ce5ee4469572250c3e354b7152047f27f88c52d2c90f2147aadf72de3b63402a0e23db4b8555f60f8693380e37a72301e01686
7
- data.tar.gz: 47af1f97d1969b053b64ad9b7a634192e0efaf103e5add43d949cc6c1c7a4f45a41caf9f72ad09d207c5ac193f918acd28a0375153d249050d1c8e0d4b8028b0
6
+ metadata.gz: bbbd6072449d6d5204e446c314ea3e5b334ab7678ad3e99e6c04332a1020f97c8c2d6db5621f68958d19aa899f0790b47d78ca0bda2bf43107c6f54113cb7724
7
+ data.tar.gz: 57c5d87ca0045680736832ba487417add78b9a0a85a7f78192a470dd311d189d27f0f13f6e4219cedc24c962b8abe2f19ff93a2c772111289d8aa32d8ab58728
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@4.2.2
3
+ ruby-rails: sul-dlss/ruby-rails@4.2.3
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.2.1)
4
+ dor-services-client (15.3.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 (7.2.2)
15
+ activesupport (8.0.1)
16
16
  base64
17
17
  benchmark (>= 0.3)
18
18
  bigdecimal
@@ -24,16 +24,18 @@ 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.8)
34
+ bigdecimal (3.1.9)
34
35
  byebug (11.1.3)
35
- cocina-models (0.99.0)
36
+ cocina-models (0.99.2)
36
37
  activesupport
38
+ commonmarker (= 2.0.1)
37
39
  deprecation
38
40
  dry-struct (~> 1.0)
39
41
  dry-types (~> 1.1)
@@ -47,9 +49,9 @@ GEM
47
49
  super_diff
48
50
  thor
49
51
  zeitwerk (~> 2.1)
50
- commonmarker (1.1.5-arm64-darwin)
51
- commonmarker (1.1.5-x86_64-darwin)
52
- commonmarker (1.1.5-x86_64-linux)
52
+ commonmarker (2.0.1-arm64-darwin)
53
+ commonmarker (2.0.1-x86_64-darwin)
54
+ commonmarker (2.0.1-x86_64-linux)
53
55
  concurrent-ruby (1.3.4)
54
56
  connection_pool (2.4.1)
55
57
  crack (1.0.0)
@@ -60,14 +62,15 @@ GEM
60
62
  diff-lcs (1.5.1)
61
63
  docile (1.4.1)
62
64
  drb (2.2.1)
63
- dry-core (1.0.2)
65
+ dry-core (1.1.0)
64
66
  concurrent-ruby (~> 1.0)
65
67
  logger
66
68
  zeitwerk (~> 2.6)
67
- dry-inflector (1.1.0)
68
- dry-logic (1.5.0)
69
+ dry-inflector (1.2.0)
70
+ dry-logic (1.6.0)
71
+ bigdecimal
69
72
  concurrent-ruby (~> 1.0)
70
- dry-core (~> 1.0, < 2)
73
+ dry-core (~> 1.1)
71
74
  zeitwerk (~> 2.6)
72
75
  dry-struct (1.6.0)
73
76
  dry-core (~> 1.0, < 2)
@@ -81,41 +84,41 @@ GEM
81
84
  dry-inflector (~> 1.0)
82
85
  dry-logic (~> 1.4)
83
86
  zeitwerk (~> 2.6)
84
- edtf (3.1.1)
85
- activesupport (>= 3.0, < 8.0)
87
+ edtf (3.2.0)
88
+ activesupport (>= 3.0, < 9.0)
86
89
  equivalent-xml (0.6.0)
87
90
  nokogiri (>= 1.4.3)
88
- faraday (2.12.0)
89
- faraday-net_http (>= 2.0, < 3.4)
91
+ faraday (2.12.2)
92
+ faraday-net_http (>= 2.0, < 3.5)
90
93
  json
91
94
  logger
92
- faraday-net_http (3.3.0)
93
- net-http
95
+ faraday-net_http (3.4.0)
96
+ net-http (>= 0.5.0)
94
97
  faraday-retry (2.2.1)
95
98
  faraday (~> 2.0)
96
- hashdiff (1.1.1)
99
+ hashdiff (1.1.2)
97
100
  i18n (1.14.6)
98
101
  concurrent-ruby (~> 1.0)
99
102
  ice_nine (0.11.2)
100
- json (2.8.1)
103
+ json (2.9.1)
101
104
  jsonpath (1.1.5)
102
105
  multi_json
103
106
  language_server-protocol (3.17.0.3)
104
- logger (1.6.1)
105
- minitest (5.25.1)
107
+ logger (1.6.4)
108
+ minitest (5.25.4)
106
109
  multi_json (1.15.0)
107
- net-http (0.5.0)
110
+ net-http (0.6.0)
108
111
  uri
109
- nokogiri (1.16.7-arm64-darwin)
112
+ nokogiri (1.18.1-arm64-darwin)
110
113
  racc (~> 1.4)
111
- nokogiri (1.16.7-x86_64-darwin)
114
+ nokogiri (1.18.1-x86_64-darwin)
112
115
  racc (~> 1.4)
113
- nokogiri (1.16.7-x86_64-linux)
116
+ nokogiri (1.18.1-x86_64-linux-gnu)
114
117
  racc (~> 1.4)
115
118
  openapi3_parser (0.10.0)
116
119
  commonmarker (>= 1.0)
117
120
  openapi_parser (1.0.0)
118
- optimist (3.1.0)
121
+ optimist (3.2.0)
119
122
  parallel (1.26.3)
120
123
  parser (3.3.6.0)
121
124
  ast (~> 2.4.1)
@@ -126,8 +129,8 @@ GEM
126
129
  racc (1.8.1)
127
130
  rainbow (3.1.1)
128
131
  rake (13.2.1)
129
- regexp_parser (2.9.2)
130
- rexml (3.3.9)
132
+ regexp_parser (2.10.0)
133
+ rexml (3.4.0)
131
134
  rspec (3.13.0)
132
135
  rspec-core (~> 3.13.0)
133
136
  rspec-expectations (~> 3.13.0)
@@ -140,18 +143,18 @@ GEM
140
143
  rspec-mocks (3.13.2)
141
144
  diff-lcs (>= 1.2.0, < 2.0)
142
145
  rspec-support (~> 3.13.0)
143
- rspec-support (3.13.1)
144
- rubocop (1.68.0)
146
+ rspec-support (3.13.2)
147
+ rubocop (1.69.2)
145
148
  json (~> 2.3)
146
149
  language_server-protocol (>= 3.17.0)
147
150
  parallel (~> 1.10)
148
151
  parser (>= 3.3.0.2)
149
152
  rainbow (>= 2.2.2, < 4.0)
150
- regexp_parser (>= 2.4, < 3.0)
151
- rubocop-ast (>= 1.32.2, < 2.0)
153
+ regexp_parser (>= 2.9.3, < 3.0)
154
+ rubocop-ast (>= 1.36.2, < 2.0)
152
155
  ruby-progressbar (~> 1.7)
153
- unicode-display_width (>= 2.4.0, < 3.0)
154
- rubocop-ast (1.34.1)
156
+ unicode-display_width (>= 2.4.0, < 4.0)
157
+ rubocop-ast (1.37.0)
155
158
  parser (>= 3.3.1.0)
156
159
  rubocop-capybara (2.21.0)
157
160
  rubocop (~> 1.41)
@@ -165,22 +168,24 @@ GEM
165
168
  rubocop-rspec_rails (2.29.1)
166
169
  rubocop (~> 1.61)
167
170
  ruby-progressbar (1.13.0)
168
- securerandom (0.3.2)
171
+ securerandom (0.4.1)
169
172
  simplecov (0.22.0)
170
173
  docile (~> 1.1)
171
174
  simplecov-html (~> 0.11)
172
175
  simplecov_json_formatter (~> 0.1)
173
176
  simplecov-html (0.13.1)
174
177
  simplecov_json_formatter (0.1.4)
175
- super_diff (0.13.0)
178
+ super_diff (0.14.0)
176
179
  attr_extras (>= 6.2.4)
177
180
  diff-lcs
178
181
  patience_diff
179
182
  thor (1.3.2)
180
183
  tzinfo (2.0.6)
181
184
  concurrent-ruby (~> 1.0)
182
- unicode-display_width (2.6.0)
183
- uri (1.0.1)
185
+ unicode-display_width (3.1.3)
186
+ unicode-emoji (~> 4.0, >= 4.0.4)
187
+ unicode-emoji (4.0.4)
188
+ uri (1.0.2)
184
189
  webmock (3.24.0)
185
190
  addressable (>= 2.8.0)
186
191
  crack (>= 0.3.2)
@@ -189,6 +194,7 @@ GEM
189
194
 
190
195
  PLATFORMS
191
196
  arm64-darwin-23
197
+ arm64-darwin-24
192
198
  x86_64-darwin-19
193
199
  x86_64-darwin-20
194
200
  x86_64-darwin-21
data/README.md CHANGED
@@ -66,6 +66,9 @@ objects_client.register(params: {}, assign_doi: true)
66
66
  # Find object by source ID
67
67
  objects_client.find(source_id: 'sul:abc123')
68
68
 
69
+ # Get status for a batch of objects
70
+ objects_client.statuses(object_ids: ['druid:bc123df4567', 'druid:bc987gh6543'])
71
+
69
72
  # Interact with virtual objects
70
73
  virtual_objects_client = Dor::Services::Client.virtual_objects
71
74
 
@@ -101,7 +104,9 @@ object_client.version.inventory
101
104
  object_client.version.current
102
105
  # Returns a struct containing the status.
103
106
  # Status includes whether the object is open, assembling, accessioning, or closeable.
107
+ # See also objects_client.statuses for getting statuses in batch.
104
108
  object_client.version.status
109
+
105
110
  # see dor-services-app openapi.yml for optional params
106
111
  object_client.version.open(description: 'Changed title')
107
112
  # see dor-services-app openapi.yml for optional params
@@ -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
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.2.1'
6
+ VERSION = '15.3.0'
7
7
  end
8
8
  end
9
9
  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.2.1
4
+ version: 15.3.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-11-11 00:00:00.000000000 Z
12
+ date: 2025-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport