dor-services-client 12.18.0 → 13.0.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/Gemfile.lock +11 -10
- data/README.md +0 -12
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +1 -7
- metadata +3 -4
- data/lib/dor/services/client/marcxml.rb +0 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52d7f1922fb592d9b86bc19bb2613ea2649b294a83e6dc898795514ef75889ab
|
|
4
|
+
data.tar.gz: 3f455ceee20044d6b2dda3f9f74f25100349a7f390c9de462df2621b051e29da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a11dbc88113dbb5844d483c4514616ddbea9de1c5cce7afcab3e38b1f466e0f4c1f63cf6fe58953a7b6321b02eb408e2196a240ae8850d25b51d32a1785a48f
|
|
7
|
+
data.tar.gz: f322703d6d85a737bebc790701235f4765c4e2fd7fee248704c1c5dc1c027f991b082634765b415cbfb483e4d2f5c664712e500b67af82823fe00c194037639f
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dor-services-client (
|
|
4
|
+
dor-services-client (13.0.0)
|
|
5
5
|
activesupport (>= 4.2, < 8)
|
|
6
6
|
cocina-models (~> 0.91.0)
|
|
7
7
|
deprecation
|
|
@@ -23,7 +23,7 @@ GEM
|
|
|
23
23
|
attr_extras (7.1.0)
|
|
24
24
|
base64 (0.1.1)
|
|
25
25
|
byebug (11.1.3)
|
|
26
|
-
cocina-models (0.91.
|
|
26
|
+
cocina-models (0.91.2)
|
|
27
27
|
activesupport
|
|
28
28
|
deprecation
|
|
29
29
|
dry-struct (~> 1.0)
|
|
@@ -69,7 +69,8 @@ GEM
|
|
|
69
69
|
activesupport (>= 3.0, < 8.0)
|
|
70
70
|
equivalent-xml (0.6.0)
|
|
71
71
|
nokogiri (>= 1.4.3)
|
|
72
|
-
faraday (2.7.
|
|
72
|
+
faraday (2.7.11)
|
|
73
|
+
base64
|
|
73
74
|
faraday-net_http (>= 2.0, < 3.1)
|
|
74
75
|
ruby2_keywords (>= 0.0.4)
|
|
75
76
|
faraday-net_http (3.0.2)
|
|
@@ -80,7 +81,7 @@ GEM
|
|
|
80
81
|
concurrent-ruby (~> 1.0)
|
|
81
82
|
ice_nine (0.11.2)
|
|
82
83
|
json (2.6.3)
|
|
83
|
-
jsonpath (1.1.
|
|
84
|
+
jsonpath (1.1.4)
|
|
84
85
|
multi_json
|
|
85
86
|
language_server-protocol (3.17.0.3)
|
|
86
87
|
minitest (5.20.0)
|
|
@@ -120,7 +121,7 @@ GEM
|
|
|
120
121
|
rspec-support (3.12.1)
|
|
121
122
|
rss (0.3.0)
|
|
122
123
|
rexml
|
|
123
|
-
rubocop (1.56.
|
|
124
|
+
rubocop (1.56.4)
|
|
124
125
|
base64 (~> 0.1.1)
|
|
125
126
|
json (~> 2.3)
|
|
126
127
|
language_server-protocol (>= 3.17.0)
|
|
@@ -134,11 +135,11 @@ GEM
|
|
|
134
135
|
unicode-display_width (>= 2.4.0, < 3.0)
|
|
135
136
|
rubocop-ast (1.29.0)
|
|
136
137
|
parser (>= 3.2.1.0)
|
|
137
|
-
rubocop-capybara (2.
|
|
138
|
+
rubocop-capybara (2.19.0)
|
|
138
139
|
rubocop (~> 1.41)
|
|
139
|
-
rubocop-factory_bot (2.
|
|
140
|
+
rubocop-factory_bot (2.24.0)
|
|
140
141
|
rubocop (~> 1.33)
|
|
141
|
-
rubocop-rspec (2.24.
|
|
142
|
+
rubocop-rspec (2.24.1)
|
|
142
143
|
rubocop (~> 1.33)
|
|
143
144
|
rubocop-capybara (~> 2.17)
|
|
144
145
|
rubocop-factory_bot (~> 2.22)
|
|
@@ -157,12 +158,12 @@ GEM
|
|
|
157
158
|
thor (1.2.2)
|
|
158
159
|
tzinfo (2.0.6)
|
|
159
160
|
concurrent-ruby (~> 1.0)
|
|
160
|
-
unicode-display_width (2.
|
|
161
|
+
unicode-display_width (2.5.0)
|
|
161
162
|
webmock (3.19.1)
|
|
162
163
|
addressable (>= 2.8.0)
|
|
163
164
|
crack (>= 0.3.2)
|
|
164
165
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
165
|
-
zeitwerk (2.6.
|
|
166
|
+
zeitwerk (2.6.12)
|
|
166
167
|
|
|
167
168
|
PLATFORMS
|
|
168
169
|
x86_64-darwin-19
|
data/README.md
CHANGED
|
@@ -78,18 +78,6 @@ background_jobs_client = Dor::Services::Client.background_job_results
|
|
|
78
78
|
# Show results of background job
|
|
79
79
|
background_jobs_client.show(job_id: 123)
|
|
80
80
|
|
|
81
|
-
# Perform MARCXML operations
|
|
82
|
-
marcxml_client = Dor::Services::Client.marcxml
|
|
83
|
-
|
|
84
|
-
# Retrieve MARCXML for a given barcode
|
|
85
|
-
marcxml_client.marcxml(barcode: '123456789')
|
|
86
|
-
|
|
87
|
-
# Retrieve MARCXML for a given catkey
|
|
88
|
-
marcxml_client.marcxml(catkey: '987654321')
|
|
89
|
-
|
|
90
|
-
# Retrieve MARCXML for a given FOLIO instance HRID
|
|
91
|
-
marcxml_client.marcxml(folio_instance_hrid: 'in000123')
|
|
92
|
-
|
|
93
81
|
# For performing operations on a known, registered object
|
|
94
82
|
object_client = Dor::Services::Client.object(object_identifier)
|
|
95
83
|
|
data/lib/dor/services/client.rb
CHANGED
|
@@ -111,11 +111,6 @@ module Dor
|
|
|
111
111
|
@background_job_results ||= BackgroundJobResults.new(connection: connection, version: DEFAULT_VERSION)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
# @return [Dor::Services::Client::Marcxml] an instance of the `Client::Marcxml` class
|
|
115
|
-
def marcxml
|
|
116
|
-
@marcxml ||= Marcxml.new(connection: connection, version: DEFAULT_VERSION)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
114
|
class << self
|
|
120
115
|
# @param [String] url the base url of the endpoint the client should connect to (required)
|
|
121
116
|
# @param [String] token a bearer token for HTTP authentication (required)
|
|
@@ -131,8 +126,7 @@ module Dor
|
|
|
131
126
|
self
|
|
132
127
|
end
|
|
133
128
|
|
|
134
|
-
delegate :background_job_results, :
|
|
135
|
-
:virtual_objects, :administrative_tags, to: :instance
|
|
129
|
+
delegate :background_job_results, :objects, :object, :virtual_objects, :administrative_tags, to: :instance
|
|
136
130
|
end
|
|
137
131
|
|
|
138
132
|
attr_writer :url, :token, :connection, :enable_get_retries
|
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:
|
|
4
|
+
version: 13.0.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: 2023-
|
|
12
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -245,7 +245,6 @@ files:
|
|
|
245
245
|
- lib/dor/services/client/connection_wrapper.rb
|
|
246
246
|
- lib/dor/services/client/error_faraday_middleware.rb
|
|
247
247
|
- lib/dor/services/client/events.rb
|
|
248
|
-
- lib/dor/services/client/marcxml.rb
|
|
249
248
|
- lib/dor/services/client/members.rb
|
|
250
249
|
- lib/dor/services/client/mutate.rb
|
|
251
250
|
- lib/dor/services/client/object.rb
|
|
@@ -279,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
279
278
|
- !ruby/object:Gem::Version
|
|
280
279
|
version: '0'
|
|
281
280
|
requirements: []
|
|
282
|
-
rubygems_version: 3.
|
|
281
|
+
rubygems_version: 3.4.19
|
|
283
282
|
signing_key:
|
|
284
283
|
specification_version: 4
|
|
285
284
|
summary: A client for dor-services-app
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Dor
|
|
4
|
-
module Services
|
|
5
|
-
class Client
|
|
6
|
-
# API calls around MARCXML-based operations from dor-services-app
|
|
7
|
-
class Marcxml < VersionedService
|
|
8
|
-
# Gets MARCXML corresponding to a barcode or catkey
|
|
9
|
-
# @param barcode [String] string representing a barcode
|
|
10
|
-
# @param catkey [String] string representing a catkey
|
|
11
|
-
# @param folio_instance_hrid [String] string representing a Folio instance HRID
|
|
12
|
-
# @raise [NotFoundResponse] when the response is a 500 with "Record not found in Symphony"
|
|
13
|
-
# @raise [UnexpectedResponse] on an unsuccessful response from the server
|
|
14
|
-
# @return [String] MARCXML
|
|
15
|
-
def marcxml(barcode: nil, catkey: nil, folio_instance_hrid: nil)
|
|
16
|
-
check_args(barcode, catkey, folio_instance_hrid)
|
|
17
|
-
|
|
18
|
-
resp = connection.get do |req|
|
|
19
|
-
req.url "#{api_version}/catalog/marcxml"
|
|
20
|
-
req.params['barcode'] = barcode unless barcode.nil?
|
|
21
|
-
req.params['catkey'] = catkey unless catkey.nil?
|
|
22
|
-
req.params['folio_instance_hrid'] = folio_instance_hrid unless folio_instance_hrid.nil?
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# This method needs its own exception handling logic due to how the endpoint service (Symphony) operates
|
|
26
|
-
|
|
27
|
-
# DOR Services App does not respond with a 404 when no match in Symphony or Folio.
|
|
28
|
-
# Rather, it responds with a 500 containing "Record not found in catalog" in the body.
|
|
29
|
-
# raise a NotFoundResponse because the resource being requested was not found in the ILS (via dor-services-app)
|
|
30
|
-
raise NotFoundResponse.new(response: resp) if !resp.success? && resp.body.match?(/Record not found in catalog/)
|
|
31
|
-
|
|
32
|
-
raise UnexpectedResponse.new(response: resp) unless resp.success?
|
|
33
|
-
|
|
34
|
-
resp.body
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
private
|
|
38
|
-
|
|
39
|
-
# rubocop:disable Layout/LineLength
|
|
40
|
-
def check_args(barcode, catkey, folio_instance_hrid)
|
|
41
|
-
raise ArgumentError, 'Barcode, catkey, or folio_instance_hrid must be provided' if barcode.nil? && catkey.nil? && folio_instance_hrid.nil?
|
|
42
|
-
raise ArgumentError, 'Both barcode and a catalog id (catkey or folio_instance_hrid) may not be provided' if !barcode.nil? && (!catkey.nil? || !folio_instance_hrid.nil?)
|
|
43
|
-
end
|
|
44
|
-
# rubocop:enable Layout/LineLength
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|