dor-services-client 12.4.0 → 12.7.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: ae2cb5ccabed30eec8dab1c13663e8c49ee2a76012b420488c6b417c85b81871
4
+ data.tar.gz: '083fba1a2831dc2aaa7b204bc0107aeaf0df668f7c5c95430a4eb6b74f47a64d'
5
5
  SHA512:
6
- metadata.gz: 12091d4e8cc26f752a9e3d924d089c5085ca1966b633a34073b4dd9966cab6739eff220f4088ea35404802c274370e605ae402edbf0184b205d11bc16160eb02
7
- data.tar.gz: a44b06d991444fe5b7d44a17aed714e150f0b793b6155c24acc531c64afdd0fdfdeff087ea99e4be29d62101ae020993bbd8f32b3c640e4c18a5fb0de3a5c76d
6
+ metadata.gz: 63f0196784aa70f49c9c25a24e5b494477cffb8ccd01790953fae2e750cf3240d1b4e2a2ee22140b8d08f829f0e06e723b73e5748e42814fafd948c0cf969c0d
7
+ data.tar.gz: cc62db4785bdefeb76ddfe59db7630a294189e7ed73d6bbae0723ca97fa47b44fdc36d268c75dec42ff0caf806dc0a6c90ead5e729143b7c0fce9024463fdae5
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@2.0.0
3
+ ruby-rails: sul-dlss/ruby-rails@3.1.2
4
4
  workflows:
5
5
  build:
6
6
  jobs:
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,29 @@ 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
159
+
160
+ Layout/LineContinuationLeadingSpace: # new in 1.31
161
+ Enabled: true
162
+ Layout/LineContinuationSpacing: # new in 1.31
163
+ Enabled: true
164
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
165
+ Enabled: true
166
+ Lint/NonAtomicFileOperation: # new in 1.31
167
+ Enabled: true
168
+ Lint/RequireRangeParentheses: # new in 1.32
169
+ Enabled: true
170
+ Style/EmptyHeredoc: # new in 1.32
171
+ Enabled: true
172
+ Style/EnvHome: # new in 1.29
173
+ Enabled: true
174
+ Style/MagicCommentFormat: # new in 1.35
175
+ Enabled: true
176
+ Style/MapCompactWithConditionalBlock: # new in 1.30
177
+ Enabled: true
178
+ RSpec/ChangeByZero: # new in 2.11.0
179
+ Enabled: true
180
+ RSpec/Capybara/SpecificMatcher: # new in 2.12
181
+ Enabled: false
182
+ RSpec/Rails/HaveHttpStatus: # new in 2.12
183
+ Enabled: false
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.6.0)
5
+ activesupport (>= 4.2, < 8)
6
+ cocina-models (~> 0.84.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.1)
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.1)
21
+ public_suffix (>= 2.0.2, < 6.0)
22
+ ast (2.4.2)
23
+ attr_extras (6.2.5)
24
+ byebug (11.1.3)
25
+ cocina-models (0.84.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-container (0.10.1)
49
+ concurrent-ruby (~> 1.0)
50
+ dry-core (0.8.1)
51
+ concurrent-ruby (~> 1.0)
52
+ dry-inflector (0.3.0)
53
+ dry-logic (1.2.0)
54
+ concurrent-ruby (~> 1.0)
55
+ dry-core (~> 0.5, >= 0.5)
56
+ dry-struct (1.4.0)
57
+ dry-core (~> 0.5, >= 0.5)
58
+ dry-types (~> 1.5)
59
+ ice_nine (~> 0.11)
60
+ dry-types (1.5.1)
61
+ concurrent-ruby (~> 1.0)
62
+ dry-container (~> 0.3)
63
+ dry-core (~> 0.5, >= 0.5)
64
+ dry-inflector (~> 0.1, >= 0.1.2)
65
+ dry-logic (~> 1.0, >= 1.0.2)
66
+ edtf (3.1.0)
67
+ activesupport (>= 3.0, < 8.0)
68
+ equivalent-xml (0.6.0)
69
+ nokogiri (>= 1.4.3)
70
+ faraday (2.5.2)
71
+ faraday-net_http (>= 2.0, < 3.1)
72
+ ruby2_keywords (>= 0.0.4)
73
+ faraday-net_http (3.0.0)
74
+ faraday-retry (2.0.0)
75
+ faraday (~> 2.0)
76
+ hashdiff (1.0.1)
77
+ i18n (1.12.0)
78
+ concurrent-ruby (~> 1.0)
79
+ ice_nine (0.11.2)
80
+ json (2.6.2)
81
+ jsonpath (1.1.2)
82
+ multi_json
83
+ minitest (5.16.3)
84
+ multi_json (1.15.0)
85
+ nokogiri (1.13.8-x86_64-darwin)
86
+ racc (~> 1.4)
87
+ nokogiri (1.13.8-x86_64-linux)
88
+ racc (~> 1.4)
89
+ openapi3_parser (0.9.2)
90
+ commonmarker (~> 0.17)
91
+ openapi_parser (0.15.0)
92
+ optimist (3.0.1)
93
+ parallel (1.22.1)
94
+ parser (3.1.2.1)
95
+ ast (~> 2.4.1)
96
+ patience_diff (1.2.0)
97
+ optimist (~> 3.0)
98
+ public_suffix (5.0.0)
99
+ racc (1.6.0)
100
+ rainbow (3.1.1)
101
+ rake (13.0.6)
102
+ regexp_parser (2.5.0)
103
+ rexml (3.2.5)
104
+ rspec (3.11.0)
105
+ rspec-core (~> 3.11.0)
106
+ rspec-expectations (~> 3.11.0)
107
+ rspec-mocks (~> 3.11.0)
108
+ rspec-core (3.11.0)
109
+ rspec-support (~> 3.11.0)
110
+ rspec-expectations (3.11.0)
111
+ diff-lcs (>= 1.2.0, < 2.0)
112
+ rspec-support (~> 3.11.0)
113
+ rspec-mocks (3.11.1)
114
+ diff-lcs (>= 1.2.0, < 2.0)
115
+ rspec-support (~> 3.11.0)
116
+ rspec-support (3.11.0)
117
+ rss (0.2.9)
118
+ rexml
119
+ rubocop (1.35.1)
120
+ json (~> 2.3)
121
+ parallel (~> 1.10)
122
+ parser (>= 3.1.2.1)
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.20.1, < 2.0)
127
+ ruby-progressbar (~> 1.7)
128
+ unicode-display_width (>= 1.4.0, < 3.0)
129
+ rubocop-ast (1.21.0)
130
+ parser (>= 3.1.1.0)
131
+ rubocop-rspec (2.12.1)
132
+ rubocop (~> 1.31)
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.5)
147
+ concurrent-ruby (~> 1.0)
148
+ unicode-display_width (2.2.0)
149
+ webmock (3.18.1)
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-21
158
+ x86_64-linux
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.17
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
 
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
- spec.add_dependency 'cocina-models', '~> 0.82.0' # leave pinned to patch level until cocina-models hits 1.0
28
+ spec.add_dependency 'cocina-models', '~> 0.84.0'
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '~> 2.0'
31
31
  spec.add_dependency 'faraday-retry'
@@ -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.7.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.7.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-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.82.0
40
+ version: 0.84.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.82.0
47
+ version: 0.84.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -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.2.32
283
284
  signing_key:
284
285
  specification_version: 4
285
286
  summary: A client for dor-services-app