dor-services-client 15.23.0 → 15.25.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 +4 -4
- data/.rubocop.yml +27 -0
- data/Gemfile.lock +18 -19
- data/README.md +3 -0
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/object.rb +1 -0
- data/lib/dor/services/client/objects.rb +16 -0
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/versioned_service.rb +2 -1
- data/lib/dor/services/client.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 739ccdbddf9ca107fea26b7188c6be70d01ad4c85100a9261c8c6430fa409afe
|
|
4
|
+
data.tar.gz: 839771682653bdc43b40073390af665c87b20d9b624ba006e1623b090144b35e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3867caade7cbf123c47e4f196d74c52433fcd1876e9ae4b33a9f0ba33d072f1bf3eabc3f26d0ceed99c03697f8d8746a1f1ff424141bc47db471474e1188cd1
|
|
7
|
+
data.tar.gz: f55887665882f769f8b4fa7a8049812b8ebeea013621bd0dd341df1ccdb7bd3352a71e8c3052a39c1ca427bcfcc94ff1a629d3458c884b46d982d0ed0c558ce1
|
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,9 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dor-services-client (15.
|
|
4
|
+
dor-services-client (15.25.0)
|
|
5
5
|
activesupport (>= 7.0.0)
|
|
6
|
-
cocina-models (~> 0.
|
|
6
|
+
cocina-models (~> 0.108.0)
|
|
7
7
|
deprecation
|
|
8
8
|
faraday (~> 2.0)
|
|
9
9
|
faraday-retry
|
|
@@ -13,14 +13,14 @@ PATH
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
-
activesupport (8.0
|
|
16
|
+
activesupport (8.1.0)
|
|
17
17
|
base64
|
|
18
|
-
benchmark (>= 0.3)
|
|
19
18
|
bigdecimal
|
|
20
19
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
21
20
|
connection_pool (>= 2.2.5)
|
|
22
21
|
drb
|
|
23
22
|
i18n (>= 1.6, < 2)
|
|
23
|
+
json
|
|
24
24
|
logger (>= 1.4.2)
|
|
25
25
|
minitest (>= 5.1)
|
|
26
26
|
securerandom (>= 0.3)
|
|
@@ -31,10 +31,9 @@ GEM
|
|
|
31
31
|
ast (2.4.3)
|
|
32
32
|
attr_extras (7.1.0)
|
|
33
33
|
base64 (0.3.0)
|
|
34
|
-
|
|
35
|
-
bigdecimal (3.2.3)
|
|
34
|
+
bigdecimal (3.3.1)
|
|
36
35
|
byebug (12.0.0)
|
|
37
|
-
cocina-models (0.
|
|
36
|
+
cocina-models (0.108.0)
|
|
38
37
|
activesupport
|
|
39
38
|
deprecation
|
|
40
39
|
dry-struct (~> 1.0)
|
|
@@ -50,7 +49,7 @@ GEM
|
|
|
50
49
|
zeitwerk (~> 2.1)
|
|
51
50
|
concurrent-ruby (1.3.5)
|
|
52
51
|
connection_pool (2.5.4)
|
|
53
|
-
crack (1.0.
|
|
52
|
+
crack (1.0.1)
|
|
54
53
|
bigdecimal
|
|
55
54
|
rexml
|
|
56
55
|
deprecation (1.1.0)
|
|
@@ -96,13 +95,13 @@ GEM
|
|
|
96
95
|
i18n (1.14.7)
|
|
97
96
|
concurrent-ruby (~> 1.0)
|
|
98
97
|
ice_nine (0.11.2)
|
|
99
|
-
json (2.15.
|
|
98
|
+
json (2.15.2)
|
|
100
99
|
jsonpath (1.1.5)
|
|
101
100
|
multi_json
|
|
102
101
|
language_server-protocol (3.17.0.5)
|
|
103
102
|
lint_roller (1.1.0)
|
|
104
103
|
logger (1.7.0)
|
|
105
|
-
minitest (5.
|
|
104
|
+
minitest (5.26.0)
|
|
106
105
|
multi_json (1.17.0)
|
|
107
106
|
net-http (0.6.0)
|
|
108
107
|
uri
|
|
@@ -115,32 +114,32 @@ GEM
|
|
|
115
114
|
openapi_parser (1.0.0)
|
|
116
115
|
optimist (3.2.1)
|
|
117
116
|
parallel (1.27.0)
|
|
118
|
-
parser (3.3.
|
|
117
|
+
parser (3.3.10.0)
|
|
119
118
|
ast (~> 2.4.1)
|
|
120
119
|
racc
|
|
121
120
|
patience_diff (1.2.0)
|
|
122
121
|
optimist (~> 3.0)
|
|
123
|
-
prism (1.
|
|
122
|
+
prism (1.6.0)
|
|
124
123
|
public_suffix (6.0.2)
|
|
125
124
|
racc (1.8.1)
|
|
126
125
|
rainbow (3.1.1)
|
|
127
126
|
rake (13.3.0)
|
|
128
127
|
regexp_parser (2.11.3)
|
|
129
128
|
rexml (3.4.4)
|
|
130
|
-
rspec (3.13.
|
|
129
|
+
rspec (3.13.2)
|
|
131
130
|
rspec-core (~> 3.13.0)
|
|
132
131
|
rspec-expectations (~> 3.13.0)
|
|
133
132
|
rspec-mocks (~> 3.13.0)
|
|
134
|
-
rspec-core (3.13.
|
|
133
|
+
rspec-core (3.13.6)
|
|
135
134
|
rspec-support (~> 3.13.0)
|
|
136
135
|
rspec-expectations (3.13.5)
|
|
137
136
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
138
137
|
rspec-support (~> 3.13.0)
|
|
139
|
-
rspec-mocks (3.13.
|
|
138
|
+
rspec-mocks (3.13.6)
|
|
140
139
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
141
140
|
rspec-support (~> 3.13.0)
|
|
142
141
|
rspec-support (3.13.6)
|
|
143
|
-
rubocop (1.81.
|
|
142
|
+
rubocop (1.81.6)
|
|
144
143
|
json (~> 2.3)
|
|
145
144
|
language_server-protocol (~> 3.17.0.2)
|
|
146
145
|
lint_roller (~> 1.1.0)
|
|
@@ -165,7 +164,7 @@ GEM
|
|
|
165
164
|
simplecov_json_formatter (~> 0.1)
|
|
166
165
|
simplecov-html (0.13.2)
|
|
167
166
|
simplecov_json_formatter (0.1.4)
|
|
168
|
-
super_diff (0.
|
|
167
|
+
super_diff (0.17.0)
|
|
169
168
|
attr_extras (>= 6.2.4)
|
|
170
169
|
diff-lcs
|
|
171
170
|
patience_diff
|
|
@@ -175,8 +174,8 @@ GEM
|
|
|
175
174
|
unicode-display_width (3.2.0)
|
|
176
175
|
unicode-emoji (~> 4.1)
|
|
177
176
|
unicode-emoji (4.1.0)
|
|
178
|
-
uri (1.0.
|
|
179
|
-
webmock (3.
|
|
177
|
+
uri (1.0.4)
|
|
178
|
+
webmock (3.26.0)
|
|
180
179
|
addressable (>= 2.8.0)
|
|
181
180
|
crack (>= 0.3.2)
|
|
182
181
|
hashdiff (>= 0.4.0, < 2.0.0)
|
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
|
|
data/dor-services-client.gemspec
CHANGED
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.required_ruby_version = '>= 3.0', '< 4'
|
|
26
26
|
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 7.0.0'
|
|
28
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
|
28
|
+
spec.add_dependency 'cocina-models', '~> 0.108.0'
|
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
|
30
30
|
spec.add_dependency 'faraday', '~> 2.0'
|
|
31
31
|
spec.add_dependency 'faraday-retry'
|
|
@@ -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
|
|
@@ -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'
|
data/lib/dor/services/client.rb
CHANGED
|
@@ -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,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.25.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.
|
|
33
|
+
version: 0.108.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.
|
|
40
|
+
version: 0.108.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: deprecation
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|