dor-services-client 15.68.0 → 15.70.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b098e13ed4b3ab09cec8aa5feadf5997bb7dbfa18a21a2cd76023cc860f6648
4
- data.tar.gz: 9526c7b43a83c75eea0fba7d50c30f98bae90e11df2379d182f3676d4e2a743f
3
+ metadata.gz: d2d01ad7fc1729cfbadc4a1b5b2295cb506d0c280cf3ccdad25e2d587ba6e6b0
4
+ data.tar.gz: 83ffa45286a613eaff5debb049ac448f972a007c0acf48cafd32cac7fae954e2
5
5
  SHA512:
6
- metadata.gz: 97752c9a761821f0f4054b29ceae2514be935d4c2a0290cb119c134c15fdb4bf8f1cf8a2c8f3e330a6507e159bedcb6252c2a895a311052a075914964bb7c530
7
- data.tar.gz: 33446c0f137d283e8d4c22436bbff8c4456be4a5b5e3a7389d4dfc545dffb50e9a72c3998b64256d288725f0611679e89aa7e5b71c5d4255c96863f8b0417b9e
6
+ metadata.gz: b9f74ef35fac2d94a9e4061bb8197ec91465423e1c027a0f669851d989bad7326ce36234ca8d9d339963131e1ae67ba25b6d3db8eab1d096b7db17a4b4093e44
7
+ data.tar.gz: 48002be6cf8082e8ec5aba236d7d3e96b0df6feb6aebf5a30ab95c0393d54a5f15911e2e95133330ae3dad5b5c5ac0b5710b1a41a7aebc6362bd1d9987e38bc0
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.13.1
3
+ ruby-rails: sul-dlss/ruby-rails@5.0.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/.rubocop.yml CHANGED
@@ -4,9 +4,14 @@ plugins:
4
4
  - rubocop-rspec
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 3.0
7
+ TargetRubyVersion: 4.0
8
8
  SuggestExtensions: false
9
9
 
10
+ # Development uses Ruby 4, but the gem still supports older consumers.
11
+ Gemspec/RequiredRubyVersion:
12
+ Exclude:
13
+ - dor-services-client.gemspec
14
+
10
15
  Metrics/BlockLength:
11
16
  Exclude:
12
17
  - 'dor-services-client.gemspec'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.68.0)
4
+ dor-services-client (15.70.0)
5
5
  activesupport (>= 7.0.0)
6
6
  cocina-models (~> 0.133.0)
7
7
  deprecation
@@ -27,7 +27,7 @@ GEM
27
27
  securerandom (>= 0.3)
28
28
  tzinfo (~> 2.0, >= 2.0.5)
29
29
  uri (>= 0.13.1)
30
- addressable (2.9.0)
30
+ addressable (2.9.2)
31
31
  public_suffix (>= 2.0.2, < 8.0)
32
32
  ast (2.4.3)
33
33
  attr_extras (7.1.0)
@@ -49,7 +49,7 @@ GEM
49
49
  super_diff
50
50
  thor
51
51
  zeitwerk (~> 2.1)
52
- cocina_display (2.13.0)
52
+ cocina_display (2.14.0)
53
53
  activesupport (>= 7)
54
54
  edtf (~> 3.2)
55
55
  geo_coord (~> 0.2)
@@ -92,30 +92,30 @@ GEM
92
92
  activesupport (>= 3.0, < 9.0)
93
93
  equivalent-xml (0.6.0)
94
94
  nokogiri (>= 1.4.3)
95
- faraday (2.14.4)
96
- faraday-net_http (>= 2.0, < 3.5)
95
+ faraday (2.15.1)
96
+ faraday-net_http (>= 2.0, < 3.6)
97
97
  json
98
98
  logger
99
- faraday-net_http (3.4.4)
99
+ faraday-net_http (3.5.0)
100
100
  net-http (~> 0.5)
101
101
  faraday-retry (2.4.0)
102
102
  faraday (~> 2.0)
103
103
  geo_coord (0.2.0)
104
104
  hashdiff (1.2.1)
105
- hashie (5.1.0)
105
+ hashie (5.2.0)
106
106
  logger
107
107
  i18n (1.15.2)
108
108
  concurrent-ruby (~> 1.0)
109
109
  ice_nine (0.11.2)
110
- io-console (0.9.4)
110
+ io-console (0.9.5)
111
111
  iso8601 (0.13.0)
112
- janeway-jsonpath (1.1.0)
113
- json (3.0.2)
114
- jsonschema_rs (0.58.5-arm64-darwin)
112
+ janeway-jsonpath (1.2.0)
113
+ json (3.1.0)
114
+ jsonschema_rs (0.60.2-arm64-darwin)
115
115
  bigdecimal (>= 3.1, < 5)
116
- jsonschema_rs (0.58.5-x86_64-darwin)
116
+ jsonschema_rs (0.60.2-x86_64-darwin)
117
117
  bigdecimal (>= 3.1, < 5)
118
- jsonschema_rs (0.58.5-x86_64-linux)
118
+ jsonschema_rs (0.60.2-x86_64-linux)
119
119
  bigdecimal (>= 3.1, < 5)
120
120
  language_server-protocol (3.17.0.6)
121
121
  lint_roller (1.1.0)
@@ -123,17 +123,20 @@ GEM
123
123
  minitest (6.0.6)
124
124
  drb (~> 2.0)
125
125
  prism (~> 1.5)
126
- net-http (0.9.1)
126
+ net-http (0.10.0)
127
+ net-protocol (>= 0.3.0)
127
128
  uri (>= 0.11.1)
128
- nokogiri (1.19.4-arm64-darwin)
129
+ net-protocol (0.4.0)
130
+ timeout
131
+ nokogiri (1.19.6-arm64-darwin)
129
132
  racc (~> 1.4)
130
- nokogiri (1.19.4-x86_64-darwin)
133
+ nokogiri (1.19.6-x86_64-darwin)
131
134
  racc (~> 1.4)
132
- nokogiri (1.19.4-x86_64-linux-gnu)
135
+ nokogiri (1.19.6-x86_64-linux-gnu)
133
136
  racc (~> 1.4)
134
137
  optimist (3.2.1)
135
138
  parallel (2.3.0)
136
- parser (3.3.12.0)
139
+ parser (3.3.13.0)
137
140
  ast (~> 2.4.1)
138
141
  racc
139
142
  patience_diff (1.2.0)
@@ -160,14 +163,14 @@ GEM
160
163
  diff-lcs (>= 1.2.0, < 2.0)
161
164
  rspec-support (~> 3.13.0)
162
165
  rspec-support (3.13.7)
163
- rubocop (1.91.0)
166
+ rubocop (1.92.2)
164
167
  json (>= 2.3)
165
168
  language_server-protocol (~> 3.17.0.2)
166
169
  lint_roller (~> 1.1.0)
167
170
  parallel (>= 1.10)
168
171
  parser (>= 3.3.0.2)
169
172
  rainbow (>= 2.2.2, < 4.0)
170
- regexp_parser (>= 2.9.3, < 3.0)
173
+ regexp_parser (>= 2.11.3, < 3.0)
171
174
  rubocop-ast (>= 1.49.0, < 2.0)
172
175
  ruby-progressbar (~> 1.7)
173
176
  unicode-display_width (>= 2.4.0, < 4.0)
@@ -186,13 +189,14 @@ GEM
186
189
  diff-lcs (~> 1.5)
187
190
  patience_diff (~> 1.2)
188
191
  thor (1.5.0)
192
+ timeout (0.6.1)
189
193
  tzinfo (2.0.6)
190
194
  concurrent-ruby (~> 1.0)
191
195
  unicode-display_width (3.3.0)
192
196
  unicode-emoji (~> 4.3)
193
197
  unicode-emoji (4.3.0)
194
- uri (1.1.1)
195
- webmock (3.26.4)
198
+ uri (1.1.2)
199
+ webmock (3.34.0)
196
200
  addressable (>= 2.8.0)
197
201
  crack (>= 0.3.2)
198
202
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -220,4 +224,4 @@ DEPENDENCIES
220
224
  webmock
221
225
 
222
226
  BUNDLED WITH
223
- 4.0.22
227
+ 4.0.23
data/README.md CHANGED
@@ -120,6 +120,8 @@ object_client.version.solr(2)
120
120
  object_client.version.open(description: 'Changed title')
121
121
  # see dor-services-app openapi.yml for optional params
122
122
  object_client.version.close
123
+ # Update the description of the currently open version
124
+ object_client.version.update_description(description: 'Changed title and abstract', user_name: 'some_sunetid')
123
125
 
124
126
  # Manage user versions
125
127
  object_client.user_version.inventory
@@ -132,6 +134,10 @@ object_client.user_version.update(user_version: Dor::Services::Client::UserVersi
132
134
  # Return the Cocina metadata
133
135
  object_client.find
134
136
 
137
+ # Return the Cocina metadata without the file sets (structural.contains), e.g., for objects with many files.
138
+ # Don't use the returned object for an update, which would remove its files.
139
+ object_client.find(without_structural_contains: true)
140
+
135
141
  # Returns "lite" Cocina metadata (excluding specified attributes)
136
142
  object_client.find_lite(structural: false, geographic: false)
137
143
 
@@ -167,7 +173,7 @@ object_client.events.list(event_types: ['version_open', 'version_close'])
167
173
  object_client.events.list(from: '2026-10-01', to: Time.now)
168
174
 
169
175
  # Create workspaces
170
- object_client.workspace.create(source: object_path_string)
176
+ object_client.workspace.create(content: true, metadata: true)
171
177
 
172
178
  # Reindex
173
179
  object_client.reindex
@@ -229,6 +235,8 @@ result.errors
229
235
 
230
236
  ## Development
231
237
 
238
+ Use Ruby 4.0.7 for development and testing.
239
+
232
240
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
233
241
 
234
242
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -68,12 +68,15 @@ module Dor
68
68
 
69
69
  # Retrieves the Cocina model
70
70
  # @param [boolean] validate validate the response object
71
+ # @param [boolean] without_structural_contains omit the file sets (structural.contains), e.g., for objects
72
+ # with many files. The returned model must not be used for an update, which would remove its files.
71
73
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
72
74
  # @raise [UnexpectedResponse] when the response is not successful.
73
75
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
74
- def find(validate: false)
76
+ def find(validate: false, without_structural_contains: false)
75
77
  resp = connection.get do |req|
76
78
  req.url object_path
79
+ req.params['without_structural_contains'] = true if without_structural_contains
77
80
  end
78
81
  raise_exception_based_on_response!(resp) unless resp.success?
79
82
 
@@ -123,6 +123,23 @@ module Dor
123
123
  raise_exception_based_on_response!(resp)
124
124
  end
125
125
 
126
+ # Update the description of the currently open version for an object
127
+ # @param description [String] the new description of the version - required
128
+ # @param user_name [String] (optional) - sunetid
129
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
130
+ # @raise [ConflictResponse] when the response is a 409 (no version is open)
131
+ # @raise [UnexpectedResponse] when the response is not successful.
132
+ def update_description(description:, user_name: nil)
133
+ resp = connection.patch do |req|
134
+ req.url "#{base_path}/current"
135
+ req.headers['Content-Type'] = 'application/json'
136
+ req.body = { description: description, user_name: user_name }.compact.to_json
137
+ end
138
+ return if resp.success?
139
+
140
+ raise_exception_based_on_response!(resp)
141
+ end
142
+
126
143
  # @return [Array] a list of the versions
127
144
  # @raise [UnexpectedResponse] on an unsuccessful response from the server
128
145
  def inventory
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.68.0'
6
+ VERSION = '15.70.0'
7
7
  end
8
8
  end
9
9
  end
@@ -12,16 +12,13 @@ module Dor
12
12
  end
13
13
 
14
14
  # Initializes a new workspace
15
- # @param source [String] the path to the object (optional)
16
15
  # @param content [Boolean] determines if the content directory should be created (defaults to false)
17
16
  # @param metadata [Boolean] determines if the metadata directory should be created (defaults to false)
18
17
  # @raise [UnexpectedResponse] if the request is unsuccessful.
19
18
  # @return [String] the path to the directory created
20
- # rubocop:disable Metrics/AbcSize
21
- def create(source: nil, content: false, metadata: false)
19
+ def create(content: false, metadata: false)
22
20
  resp = connection.post do |req|
23
21
  req.url workspace_path
24
- req.params['source'] = source if source
25
22
  req.params['content'] = content
26
23
  req.params['metadata'] = metadata
27
24
  end
@@ -29,7 +26,6 @@ module Dor
29
26
 
30
27
  raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
31
28
  end
32
- # rubocop:enable Metrics/AbcSize
33
29
 
34
30
  private
35
31
 
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.68.0
4
+ version: 15.70.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne