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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17084d47db10602abff0c9d6bc50840dfac58ac14e2efa96a2a2f38f0dd8b779
4
- data.tar.gz: 9fa643be94ed39a305199becf67b996759084fbf2ebecbd139cfc2e03b50c6ae
3
+ metadata.gz: af025cd4df3276cc4c2e5793794861a55332ba2d9e8d9c69e9168df4901038c1
4
+ data.tar.gz: e7e7d2778580bf7641010cadf17c37faf85f6067c5606b52b9f39e25e0860ba5
5
5
  SHA512:
6
- metadata.gz: fedc3d9668ecc6be0e9139b983ce5ee4469572250c3e354b7152047f27f88c52d2c90f2147aadf72de3b63402a0e23db4b8555f60f8693380e37a72301e01686
7
- data.tar.gz: 47af1f97d1969b053b64ad9b7a634192e0efaf103e5add43d949cc6c1c7a4f45a41caf9f72ad09d207c5ac193f918acd28a0375153d249050d1c8e0d4b8028b0
6
+ metadata.gz: 92b865de43d42a4d2fab0bfb5749d477f90514f6cf6a2ef7b3678ae7c339ba620f3de2ef4f3fdc9f95cb2abb4edfc4bf0be1023a70066bfa86a0d0980fed76f0
7
+ data.tar.gz: bcedec265771008b92a3f59d34e11820871dad15419924d9fce4a2d1786f9e826bc262a5a6fb13ff3c88332a0c03d2241102efd81b226186d0add9c61a1c6bde
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.5.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
@@ -8,3 +8,5 @@ workflows:
8
8
  name: lint
9
9
  - ruby-rails/test-gem:
10
10
  name: test
11
+ context: dlss
12
+ use-codecov: true
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.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 (7.2.2)
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.8)
34
+ bigdecimal (3.1.9)
34
35
  byebug (11.1.3)
35
- cocina-models (0.99.0)
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
- commonmarker (1.1.5-arm64-darwin)
51
- commonmarker (1.1.5-x86_64-darwin)
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.2)
60
+ dry-core (1.1.0)
64
61
  concurrent-ruby (~> 1.0)
65
62
  logger
66
63
  zeitwerk (~> 2.6)
67
- dry-inflector (1.1.0)
68
- dry-logic (1.5.0)
64
+ dry-inflector (1.2.0)
65
+ dry-logic (1.6.0)
66
+ bigdecimal
69
67
  concurrent-ruby (~> 1.0)
70
- dry-core (~> 1.0, < 2)
68
+ dry-core (~> 1.1)
71
69
  zeitwerk (~> 2.6)
72
- dry-struct (1.6.0)
73
- dry-core (~> 1.0, < 2)
74
- dry-types (>= 1.7, < 2)
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.7.2)
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.1.1)
85
- activesupport (>= 3.0, < 8.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.0)
89
- faraday-net_http (>= 2.0, < 3.4)
86
+ faraday (2.12.2)
87
+ faraday-net_http (>= 2.0, < 3.5)
90
88
  json
91
89
  logger
92
- faraday-net_http (3.3.0)
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.1)
97
- i18n (1.14.6)
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.8.1)
98
+ json (2.9.1)
101
99
  jsonpath (1.1.5)
102
100
  multi_json
103
- language_server-protocol (3.17.0.3)
104
- logger (1.6.1)
105
- minitest (5.25.1)
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.5.0)
105
+ net-http (0.6.0)
108
106
  uri
109
- nokogiri (1.16.7-arm64-darwin)
107
+ nokogiri (1.18.2-arm64-darwin)
110
108
  racc (~> 1.4)
111
- nokogiri (1.16.7-x86_64-darwin)
109
+ nokogiri (1.18.2-x86_64-darwin)
112
110
  racc (~> 1.4)
113
- nokogiri (1.16.7-x86_64-linux)
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.1.0)
114
+ optimist (3.2.0)
119
115
  parallel (1.26.3)
120
- parser (3.3.6.0)
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.9.2)
130
- rexml (3.3.9)
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.2)
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.1)
144
- rubocop (1.68.0)
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.4, < 3.0)
151
- rubocop-ast (>= 1.32.2, < 2.0)
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, < 3.0)
154
- rubocop-ast (1.34.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.3.2)
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.13.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 (2.6.0)
183
- uri (1.0.1)
184
- webmock (3.24.0)
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
  [![Gem Version](https://badge.fury.io/rb/dor-services-client.svg)](https://badge.fury.io/rb/dor-services-client)
2
2
  [![CircleCI](https://circleci.com/gh/sul-dlss/dor-services-client.svg?style=svg)](https://circleci.com/gh/sul-dlss/dor-services-client)
3
- [![Code Climate](https://codeclimate.com/github/sul-dlss/dor-services-client/badges/gpa.svg)](https://codeclimate.com/github/sul-dlss/dor-services-client)
4
- [![Code Climate Test Coverage](https://codeclimate.com/github/sul-dlss/dor-services-client/badges/coverage.svg)](https://codeclimate.com/github/sul-dlss/dor-services-client/coverage)
3
+ [![codecov](https://codecov.io/github/sul-dlss/dor-services-client/graph/badge.svg?token=dOdPMq8iIu)](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, keyword_init: true) do
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
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.2.1'
6
+ VERSION = '15.4.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.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: 2024-11-11 00:00:00.000000000 Z
12
+ date: 2025-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport