dor-services-client 12.4.0 → 12.5.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: 599e5f53366748f32e90708efeedb89eb7cc63bc2f1ec70d206198151ab15b14
4
- data.tar.gz: c70cba19abc8e2f0a21ba1b304f4fd922aa18963ffb735ca871b9261747379f9
3
+ metadata.gz: 2a3dacbfbd6f662d1f23b9e357e66fa2181585fe18635613cc82104da95b5f38
4
+ data.tar.gz: 4dea5db10c3bc6f797771cd6de89169b31274d83571984cb9a1424a20e610bc9
5
5
  SHA512:
6
- metadata.gz: 12091d4e8cc26f752a9e3d924d089c5085ca1966b633a34073b4dd9966cab6739eff220f4088ea35404802c274370e605ae402edbf0184b205d11bc16160eb02
7
- data.tar.gz: a44b06d991444fe5b7d44a17aed714e150f0b793b6155c24acc531c64afdd0fdfdeff087ea99e4be29d62101ae020993bbd8f32b3c640e4c18a5fb0de3a5c76d
6
+ metadata.gz: 68bef1c78899b2deeea972b0bbf658e263f48b2a412640918600c9eafa08a6053afaf9ae188f71eaa08a02bdc29e9ead90cd6c5fb1cef99f1c899d7cdd0cc597
7
+ data.tar.gz: 935bceadcf14090b6cb34fea2daab43f754efb3b0e822ccd333159de11d7a442db713a605a6dd271da919d23f5bd49fc6bbfd4ecadc05dbdfb6678e23e39b6b6
data/.gitignore CHANGED
@@ -9,5 +9,3 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
-
13
- Gemfile.lock
data/.rubocop.yml CHANGED
@@ -12,13 +12,16 @@ Metrics/BlockLength:
12
12
  - 'dor-services-client.gemspec'
13
13
  - 'spec/**/*'
14
14
 
15
+ RSpec/MultipleExpectations:
16
+ Enabled: false
17
+
15
18
  RSpec/MultipleMemoizedHelpers:
16
19
  Enabled: false
17
20
 
18
21
  RSpec/ExampleLength:
19
22
  Max: 10
20
23
 
21
- Gemspec/DateAssignment: # (new in 1.10)
24
+ Gemspec/DeprecatedAttributeAssignment: # (new in 1.10)
22
25
  Enabled: true
23
26
  Layout/SpaceBeforeBrackets: # (new in 1.7)
24
27
  Enabled: true
@@ -152,4 +155,4 @@ RSpec/BeEq: # new in 2.9.0
152
155
  RSpec/BeNil: # new in 2.9.0
153
156
  Enabled: true
154
157
  RSpec/VerifiedDoubleReference: # new in 2.10.0
155
- Enabled: true
158
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -30,16 +30,6 @@ RSpec/IdenticalEqualityAssertion:
30
30
  Exclude:
31
31
  - 'spec/dor/services/client_spec.rb'
32
32
 
33
- # Offense count: 8
34
- # Configuration parameters: Max.
35
- RSpec/MultipleExpectations:
36
- Exclude:
37
- - 'spec/dor/services/client/async_result_spec.rb'
38
- - 'spec/dor/services/client/background_job_results_spec.rb'
39
- - 'spec/dor/services/client/events_spec.rb'
40
- - 'spec/dor/services/client/object_spec.rb'
41
- - 'spec/dor/services/client/response_error_formatter_spec.rb'
42
-
43
33
  # Offense count: 1
44
34
  # Cop supports --auto-correct.
45
35
  RSpec/MultipleSubjects:
data/Gemfile.lock ADDED
@@ -0,0 +1,172 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dor-services-client (12.5.0)
5
+ activesupport (>= 4.2, < 8)
6
+ cocina-models (~> 0.82.0)
7
+ deprecation
8
+ faraday (~> 2.0)
9
+ faraday-retry
10
+ zeitwerk (~> 2.1)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activesupport (7.0.3)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ addressable (2.8.0)
21
+ public_suffix (>= 2.0.2, < 5.0)
22
+ ast (2.4.2)
23
+ attr_extras (6.2.5)
24
+ byebug (11.1.3)
25
+ cocina-models (0.82.0)
26
+ activesupport
27
+ deprecation
28
+ dry-struct (~> 1.0)
29
+ dry-types (~> 1.1)
30
+ edtf
31
+ equivalent-xml
32
+ jsonpath
33
+ nokogiri
34
+ openapi3_parser
35
+ openapi_parser (>= 0.11.1, < 1.0)
36
+ rss
37
+ super_diff
38
+ thor
39
+ zeitwerk (~> 2.1)
40
+ commonmarker (0.23.5)
41
+ concurrent-ruby (1.1.10)
42
+ crack (0.4.5)
43
+ rexml
44
+ deprecation (1.1.0)
45
+ activesupport
46
+ diff-lcs (1.5.0)
47
+ docile (1.4.0)
48
+ dry-configurable (0.15.0)
49
+ concurrent-ruby (~> 1.0)
50
+ dry-core (~> 0.6)
51
+ dry-container (0.9.0)
52
+ concurrent-ruby (~> 1.0)
53
+ dry-configurable (~> 0.13, >= 0.13.0)
54
+ dry-core (0.7.1)
55
+ concurrent-ruby (~> 1.0)
56
+ dry-inflector (0.2.1)
57
+ dry-logic (1.2.0)
58
+ concurrent-ruby (~> 1.0)
59
+ dry-core (~> 0.5, >= 0.5)
60
+ dry-struct (1.4.0)
61
+ dry-core (~> 0.5, >= 0.5)
62
+ dry-types (~> 1.5)
63
+ ice_nine (~> 0.11)
64
+ dry-types (1.5.1)
65
+ concurrent-ruby (~> 1.0)
66
+ dry-container (~> 0.3)
67
+ dry-core (~> 0.5, >= 0.5)
68
+ dry-inflector (~> 0.1, >= 0.1.2)
69
+ dry-logic (~> 1.0, >= 1.0.2)
70
+ edtf (3.0.8)
71
+ activesupport (>= 3.0, < 8.0)
72
+ equivalent-xml (0.6.0)
73
+ nokogiri (>= 1.4.3)
74
+ faraday (2.3.0)
75
+ faraday-net_http (~> 2.0)
76
+ ruby2_keywords (>= 0.0.4)
77
+ faraday-net_http (2.0.3)
78
+ faraday-retry (2.0.0)
79
+ faraday (~> 2.0)
80
+ hashdiff (1.0.1)
81
+ i18n (1.10.0)
82
+ concurrent-ruby (~> 1.0)
83
+ ice_nine (0.11.2)
84
+ jsonpath (1.1.2)
85
+ multi_json
86
+ minitest (5.16.1)
87
+ multi_json (1.15.0)
88
+ nokogiri (1.13.6-x86_64-darwin)
89
+ racc (~> 1.4)
90
+ openapi3_parser (0.9.2)
91
+ commonmarker (~> 0.17)
92
+ openapi_parser (0.15.0)
93
+ optimist (3.0.1)
94
+ parallel (1.22.1)
95
+ parser (3.1.2.0)
96
+ ast (~> 2.4.1)
97
+ patience_diff (1.2.0)
98
+ optimist (~> 3.0)
99
+ public_suffix (4.0.7)
100
+ racc (1.6.0)
101
+ rainbow (3.1.1)
102
+ rake (13.0.6)
103
+ regexp_parser (2.5.0)
104
+ rexml (3.2.5)
105
+ rspec (3.11.0)
106
+ rspec-core (~> 3.11.0)
107
+ rspec-expectations (~> 3.11.0)
108
+ rspec-mocks (~> 3.11.0)
109
+ rspec-core (3.11.0)
110
+ rspec-support (~> 3.11.0)
111
+ rspec-expectations (3.11.0)
112
+ diff-lcs (>= 1.2.0, < 2.0)
113
+ rspec-support (~> 3.11.0)
114
+ rspec-mocks (3.11.1)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.11.0)
117
+ rspec-support (3.11.0)
118
+ rss (0.2.9)
119
+ rexml
120
+ rubocop (1.31.0)
121
+ parallel (~> 1.10)
122
+ parser (>= 3.1.0.0)
123
+ rainbow (>= 2.2.2, < 4.0)
124
+ regexp_parser (>= 1.8, < 3.0)
125
+ rexml (>= 3.2.5, < 4.0)
126
+ rubocop-ast (>= 1.18.0, < 2.0)
127
+ ruby-progressbar (~> 1.7)
128
+ unicode-display_width (>= 1.4.0, < 3.0)
129
+ rubocop-ast (1.18.0)
130
+ parser (>= 3.1.1.0)
131
+ rubocop-rspec (2.11.1)
132
+ rubocop (~> 1.19)
133
+ ruby-progressbar (1.11.0)
134
+ ruby2_keywords (0.0.5)
135
+ simplecov (0.21.2)
136
+ docile (~> 1.1)
137
+ simplecov-html (~> 0.11)
138
+ simplecov_json_formatter (~> 0.1)
139
+ simplecov-html (0.12.3)
140
+ simplecov_json_formatter (0.1.4)
141
+ super_diff (0.9.0)
142
+ attr_extras (>= 6.2.4)
143
+ diff-lcs
144
+ patience_diff
145
+ thor (1.2.1)
146
+ tzinfo (2.0.4)
147
+ concurrent-ruby (~> 1.0)
148
+ unicode-display_width (2.2.0)
149
+ webmock (3.14.0)
150
+ addressable (>= 2.8.0)
151
+ crack (>= 0.3.2)
152
+ hashdiff (>= 0.4.0, < 2.0.0)
153
+ zeitwerk (2.6.0)
154
+
155
+ PLATFORMS
156
+ x86_64-darwin-19
157
+ x86_64-darwin-20
158
+ x86_64-darwin-21
159
+
160
+ DEPENDENCIES
161
+ bundler
162
+ byebug
163
+ dor-services-client!
164
+ rake (>= 12.3.3)
165
+ rspec (~> 3.0)
166
+ rubocop (~> 1.0)
167
+ rubocop-rspec (~> 2.1)
168
+ simplecov
169
+ webmock
170
+
171
+ BUNDLED WITH
172
+ 2.3.4
data/README.md CHANGED
@@ -63,6 +63,9 @@ objects_client = Dor::Services::Client.objects
63
63
  objects_client.register(params: {})
64
64
  objects_client.register(params: {}, assign_doi: true)
65
65
 
66
+ # Find object by source ID
67
+ objects_client.find(source_id: 'sul:abc123')
68
+
66
69
  # Interact with virtual objects
67
70
  virtual_objects_client = Dor::Services::Client.virtual_objects
68
71
 
@@ -14,7 +14,7 @@ module Dor
14
14
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
15
15
  def register(params:, assign_doi: false, validate: false)
16
16
  resp = connection.post do |req|
17
- req.url "#{api_version}/objects"
17
+ req.url objects_path
18
18
  req.headers['Content-Type'] = 'application/json'
19
19
  # asking the service to return JSON (else it'll be plain text)
20
20
  req.headers['Accept'] = 'application/json'
@@ -26,6 +26,27 @@ module Dor
26
26
 
27
27
  build_cocina_from_response(resp, validate: validate)
28
28
  end
29
+
30
+ # Find an object by source ID
31
+ # @param [boolean] validate validate the response object
32
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
33
+ # @raise [UnexpectedResponse] when the response is not successful.
34
+ # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata] the returned object
35
+ def find(source_id:, validate: false)
36
+ resp = connection.get do |req|
37
+ req.url "#{objects_path}/find"
38
+ req.params['sourceId'] = source_id
39
+ end
40
+ raise_exception_based_on_response!(resp) unless resp.success?
41
+
42
+ build_cocina_from_response(resp, validate: validate)
43
+ end
44
+
45
+ private
46
+
47
+ def objects_path
48
+ "#{api_version}/objects"
49
+ end
29
50
  end
30
51
  end
31
52
  end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '12.4.0'
6
+ VERSION = '12.5.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: 12.4.0
4
+ version: 12.5.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: 2022-06-17 00:00:00.000000000 Z
12
+ date: 2022-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -228,6 +228,7 @@ files:
228
228
  - ".rubocop.yml"
229
229
  - ".rubocop_todo.yml"
230
230
  - Gemfile
231
+ - Gemfile.lock
231
232
  - LICENSE
232
233
  - README.md
233
234
  - Rakefile
@@ -279,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
280
  - !ruby/object:Gem::Version
280
281
  version: '0'
281
282
  requirements: []
282
- rubygems_version: 3.3.7
283
+ rubygems_version: 3.3.9
283
284
  signing_key:
284
285
  specification_version: 4
285
286
  summary: A client for dor-services-app