dor-services-client 15.23.0 → 15.24.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: ee39ccef3d9ebbaca1274100a313c7529e03c14838ec30b10119471c6f8d6525
4
- data.tar.gz: 69ba413ab69ba15c74938606fba781de8f3299b94e6d3d1cddef8b1394d9bc65
3
+ metadata.gz: 228207afd73ce575a4c1b1f9d5f1cb5fd19fbdafab636c052ad584fb43e2a2c0
4
+ data.tar.gz: 999d251d09f210cac4a1e083cbea0f54509df85680c4577ba823306a9ee72d9d
5
5
  SHA512:
6
- metadata.gz: 3cade125db7720a1a041b45b5c4394d9bc7c073d0e8ec531229be0d0876e2b604cc7d79e41075f60237d962c69030c416e50146de1e8a3e9ea5b6c64eb48e851
7
- data.tar.gz: e8a1f5774e98fc5a782538962896610c746b2f68dd02128db9934039d5e4d21555397e5195ae9c2047002994a67c782cd8d2fb0002d3221ac4ca54a3418c5a0a
6
+ metadata.gz: 96f05b5209d360f3dca985dd2ad49bb9d7e3d5c76061f3e43e75c33c48c4b24204786d66e16ee1bf785ba9dda77b8a17e309f500f6102128ee27de2c6bfb2192
7
+ data.tar.gz: e7014379a5d751d3be8de958fff93b65d02815b62247a8935e47ddf90fb24b0f8707ebc14bdbbd8c7b108b04b48d7df8b815ead4face9cde31ba5ca99838c427
data/.rubocop.yml CHANGED
@@ -346,3 +346,30 @@ Style/RedundantFormat: # new in 1.72
346
346
  Enabled: true
347
347
  Style/SafeNavigationChainLength: # new in 1.68
348
348
  Enabled: true
349
+
350
+ Gemspec/AttributeAssignment: # new in 1.77
351
+ Enabled: true
352
+ Layout/EmptyLinesAfterModuleInclusion: # new in 1.79
353
+ Enabled: true
354
+ Lint/UselessDefaultValueArgument: # new in 1.76
355
+ Enabled: true
356
+ Lint/UselessOr: # new in 1.76
357
+ Enabled: true
358
+ Naming/PredicateMethod: # new in 1.76
359
+ Enabled: false
360
+ Style/ArrayIntersectWithSingleElement: # new in 1.81
361
+ Enabled: true
362
+ Style/CollectionQuerying: # new in 1.77
363
+ Enabled: true
364
+ Style/ComparableBetween: # new in 1.74
365
+ Enabled: true
366
+ Style/EmptyStringInsideInterpolation: # new in 1.76
367
+ Enabled: true
368
+ Style/HashFetchChain: # new in 1.75
369
+ Enabled: true
370
+ Style/ItBlockParameter: # new in 1.75
371
+ Enabled: true
372
+ Style/RedundantArrayFlatten: # new in 1.76
373
+ Enabled: true
374
+ RSpec/IncludeExamples: # new in 3.6
375
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.23.0)
4
+ dor-services-client (15.24.0)
5
5
  activesupport (>= 7.0.0)
6
6
  cocina-models (~> 0.107.0)
7
7
  deprecation
@@ -32,7 +32,7 @@ GEM
32
32
  attr_extras (7.1.0)
33
33
  base64 (0.3.0)
34
34
  benchmark (0.4.1)
35
- bigdecimal (3.2.3)
35
+ bigdecimal (3.3.1)
36
36
  byebug (12.0.0)
37
37
  cocina-models (0.107.0)
38
38
  activesupport
@@ -96,13 +96,13 @@ GEM
96
96
  i18n (1.14.7)
97
97
  concurrent-ruby (~> 1.0)
98
98
  ice_nine (0.11.2)
99
- json (2.15.0)
99
+ json (2.15.1)
100
100
  jsonpath (1.1.5)
101
101
  multi_json
102
102
  language_server-protocol (3.17.0.5)
103
103
  lint_roller (1.1.0)
104
104
  logger (1.7.0)
105
- minitest (5.25.5)
105
+ minitest (5.26.0)
106
106
  multi_json (1.17.0)
107
107
  net-http (0.6.0)
108
108
  uri
@@ -120,7 +120,7 @@ GEM
120
120
  racc
121
121
  patience_diff (1.2.0)
122
122
  optimist (~> 3.0)
123
- prism (1.5.1)
123
+ prism (1.5.2)
124
124
  public_suffix (6.0.2)
125
125
  racc (1.8.1)
126
126
  rainbow (3.1.1)
@@ -175,7 +175,7 @@ GEM
175
175
  unicode-display_width (3.2.0)
176
176
  unicode-emoji (~> 4.1)
177
177
  unicode-emoji (4.1.0)
178
- uri (1.0.3)
178
+ uri (1.0.4)
179
179
  webmock (3.25.1)
180
180
  addressable (>= 2.8.0)
181
181
  crack (>= 0.3.2)
data/README.md CHANGED
@@ -68,6 +68,9 @@ objects_client.find(source_id: 'sul:abc123')
68
68
  # Get status for a batch of objects
69
69
  objects_client.statuses(object_ids: ['druid:bc123df4567', 'druid:bc987gh6543'])
70
70
 
71
+ # Determine if a cocina representation will index to solr
72
+ objects_client.indexable(druid: 'druid:bc123df4567', cocina: cocina_object)
73
+
71
74
  # Interact with virtual objects
72
75
  virtual_objects_client = Dor::Services::Client.virtual_objects
73
76
 
@@ -8,6 +8,7 @@ module Dor
8
8
  # API calls that are about a repository object
9
9
  class Object < VersionedService # rubocop:disable Metrics/ClassLength
10
10
  extend Deprecation
11
+
11
12
  attr_reader :object_identifier
12
13
 
13
14
  # @param object_identifier [String] the pid for the object
@@ -78,6 +78,22 @@ module Dor
78
78
  JSON.parse(resp.body).transform_values { |status| ObjectVersion::VersionStatus.new(status.symbolize_keys!) }
79
79
  end
80
80
 
81
+ # Verify the object can be indexed into Solr
82
+ # @param [String] druid the object's druid
83
+ # @param [Cocina::Models::DROWithoutMetadata] cocina the cocina object to verify
84
+ # @raise [UnprocessableContent] when the response is not successful.
85
+ # @return [string] JSON representation of the descriptive solr document
86
+ def indexable(druid:, cocina:)
87
+ resp = connection.post do |req|
88
+ req.url "#{objects_path}/#{druid}/indexable"
89
+ req.headers['Content-Type'] = 'application/json'
90
+ req.body = cocina.to_json
91
+ end
92
+ return true if resp.success?
93
+
94
+ raise_exception_based_on_response!(resp)
95
+ end
96
+
81
97
  private
82
98
 
83
99
  def objects_path
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.23.0'
6
+ VERSION = '15.24.0'
7
7
  end
8
8
  end
9
9
  end
@@ -10,7 +10,8 @@ module Dor
10
10
  401 => UnauthorizedResponse,
11
11
  404 => NotFoundResponse,
12
12
  409 => ConflictResponse,
13
- 412 => PreconditionFailedResponse
13
+ 412 => PreconditionFailedResponse,
14
+ 422 => UnprocessableContentError
14
15
  }.freeze
15
16
 
16
17
  JSON_API_MIME_TYPE = 'application/vnd.api+json'
@@ -79,6 +79,10 @@ module Dor
79
79
  # Error that is raised when the remote server returns a 400 Bad Request; apps should not retry the request
80
80
  class BadRequestError < UnexpectedResponse; end
81
81
 
82
+ # Error that is raised when the remote server returns a 422 Unprocessable Content
83
+ # This occurs when the request is well-formed but the content is not indexable
84
+ class UnprocessableContentError < UnexpectedResponse; end
85
+
82
86
  module Types
83
87
  include Dry.Types()
84
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.23.0
4
+ version: 15.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  - Michael Giarlo
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.7.0
295
+ rubygems_version: 3.6.2
296
296
  specification_version: 4
297
297
  summary: A client for dor-services-app
298
298
  test_files: []