dor-services-client 12.18.0 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -12
- data/README.md +0 -12
- data/lib/dor/services/client/administrative_tag_search.rb +0 -2
- data/lib/dor/services/client/events.rb +0 -2
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +3 -8
- 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: 74d7e3fd877e278b201d95659d3003b2a80823060553d3b6922914dac87b7c20
|
4
|
+
data.tar.gz: dceb16866228a3fcd1230d1d3e81be9083fdc1a92d41f6d937a964bd913dd9ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49c37f1ab1f9cfabedf44f1f3d94c677c86c91207ed383e33d16679e5f326767f1b36ddd764bfdf928984ee2007abb8cba9d4a41ac557a4bee6e8aba174f00c6
|
7
|
+
data.tar.gz: 9b4fabacd6a69c13101da1d59378d359e11a297a0ee7e120ae5a1cf38ab54302774706dbc7756100507964641eb5ed34c5cc3f515ee53f44ba577b0c2f6ab994
|
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.1)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
cocina-models (~> 0.91.0)
|
7
7
|
deprecation
|
@@ -12,18 +12,24 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (7.0
|
15
|
+
activesupport (7.1.0)
|
16
|
+
base64
|
17
|
+
bigdecimal
|
16
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
+
connection_pool (>= 2.2.5)
|
20
|
+
drb
|
17
21
|
i18n (>= 1.6, < 2)
|
18
22
|
minitest (>= 5.1)
|
23
|
+
mutex_m
|
19
24
|
tzinfo (~> 2.0)
|
20
25
|
addressable (2.8.5)
|
21
26
|
public_suffix (>= 2.0.2, < 6.0)
|
22
27
|
ast (2.4.2)
|
23
28
|
attr_extras (7.1.0)
|
24
29
|
base64 (0.1.1)
|
30
|
+
bigdecimal (3.1.4)
|
25
31
|
byebug (11.1.3)
|
26
|
-
cocina-models (0.91.
|
32
|
+
cocina-models (0.91.2)
|
27
33
|
activesupport
|
28
34
|
deprecation
|
29
35
|
dry-struct (~> 1.0)
|
@@ -40,12 +46,15 @@ GEM
|
|
40
46
|
zeitwerk (~> 2.1)
|
41
47
|
commonmarker (0.23.10)
|
42
48
|
concurrent-ruby (1.2.2)
|
49
|
+
connection_pool (2.4.1)
|
43
50
|
crack (0.4.5)
|
44
51
|
rexml
|
45
52
|
deprecation (1.1.0)
|
46
53
|
activesupport
|
47
54
|
diff-lcs (1.5.0)
|
48
55
|
docile (1.4.0)
|
56
|
+
drb (2.1.1)
|
57
|
+
ruby2_keywords
|
49
58
|
dry-core (1.0.1)
|
50
59
|
concurrent-ruby (~> 1.0)
|
51
60
|
zeitwerk (~> 2.6)
|
@@ -69,7 +78,8 @@ GEM
|
|
69
78
|
activesupport (>= 3.0, < 8.0)
|
70
79
|
equivalent-xml (0.6.0)
|
71
80
|
nokogiri (>= 1.4.3)
|
72
|
-
faraday (2.7.
|
81
|
+
faraday (2.7.11)
|
82
|
+
base64
|
73
83
|
faraday-net_http (>= 2.0, < 3.1)
|
74
84
|
ruby2_keywords (>= 0.0.4)
|
75
85
|
faraday-net_http (3.0.2)
|
@@ -80,11 +90,12 @@ GEM
|
|
80
90
|
concurrent-ruby (~> 1.0)
|
81
91
|
ice_nine (0.11.2)
|
82
92
|
json (2.6.3)
|
83
|
-
jsonpath (1.1.
|
93
|
+
jsonpath (1.1.4)
|
84
94
|
multi_json
|
85
95
|
language_server-protocol (3.17.0.3)
|
86
96
|
minitest (5.20.0)
|
87
97
|
multi_json (1.15.0)
|
98
|
+
mutex_m (0.1.2)
|
88
99
|
nokogiri (1.15.4-x86_64-darwin)
|
89
100
|
racc (~> 1.4)
|
90
101
|
nokogiri (1.15.4-x86_64-linux)
|
@@ -94,7 +105,7 @@ GEM
|
|
94
105
|
openapi_parser (1.0.0)
|
95
106
|
optimist (3.1.0)
|
96
107
|
parallel (1.23.0)
|
97
|
-
parser (3.2.2.
|
108
|
+
parser (3.2.2.4)
|
98
109
|
ast (~> 2.4.1)
|
99
110
|
racc
|
100
111
|
patience_diff (1.2.0)
|
@@ -120,7 +131,7 @@ GEM
|
|
120
131
|
rspec-support (3.12.1)
|
121
132
|
rss (0.3.0)
|
122
133
|
rexml
|
123
|
-
rubocop (1.56.
|
134
|
+
rubocop (1.56.4)
|
124
135
|
base64 (~> 0.1.1)
|
125
136
|
json (~> 2.3)
|
126
137
|
language_server-protocol (>= 3.17.0)
|
@@ -134,11 +145,11 @@ GEM
|
|
134
145
|
unicode-display_width (>= 2.4.0, < 3.0)
|
135
146
|
rubocop-ast (1.29.0)
|
136
147
|
parser (>= 3.2.1.0)
|
137
|
-
rubocop-capybara (2.
|
148
|
+
rubocop-capybara (2.19.0)
|
138
149
|
rubocop (~> 1.41)
|
139
|
-
rubocop-factory_bot (2.
|
150
|
+
rubocop-factory_bot (2.24.0)
|
140
151
|
rubocop (~> 1.33)
|
141
|
-
rubocop-rspec (2.24.
|
152
|
+
rubocop-rspec (2.24.1)
|
142
153
|
rubocop (~> 1.33)
|
143
154
|
rubocop-capybara (~> 2.17)
|
144
155
|
rubocop-factory_bot (~> 2.22)
|
@@ -157,12 +168,12 @@ GEM
|
|
157
168
|
thor (1.2.2)
|
158
169
|
tzinfo (2.0.6)
|
159
170
|
concurrent-ruby (~> 1.0)
|
160
|
-
unicode-display_width (2.
|
171
|
+
unicode-display_width (2.5.0)
|
161
172
|
webmock (3.19.1)
|
162
173
|
addressable (>= 2.8.0)
|
163
174
|
crack (>= 0.3.2)
|
164
175
|
hashdiff (>= 0.4.0, < 2.0.0)
|
165
|
-
zeitwerk (2.6.
|
176
|
+
zeitwerk (2.6.12)
|
166
177
|
|
167
178
|
PLATFORMS
|
168
179
|
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
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support'
|
3
4
|
require 'active_support/core_ext/hash/indifferent_access'
|
4
5
|
require 'active_support/core_ext/module/delegation'
|
5
6
|
require 'active_support/core_ext/object/blank'
|
6
|
-
require 'active_support/json'
|
7
7
|
require 'active_support/core_ext/object/json'
|
8
8
|
require 'active_support/core_ext/object/to_query'
|
9
|
+
require 'active_support/json'
|
9
10
|
require 'cocina/models'
|
10
11
|
require 'faraday'
|
11
12
|
require 'faraday/retry'
|
@@ -111,11 +112,6 @@ module Dor
|
|
111
112
|
@background_job_results ||= BackgroundJobResults.new(connection: connection, version: DEFAULT_VERSION)
|
112
113
|
end
|
113
114
|
|
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
115
|
class << self
|
120
116
|
# @param [String] url the base url of the endpoint the client should connect to (required)
|
121
117
|
# @param [String] token a bearer token for HTTP authentication (required)
|
@@ -131,8 +127,7 @@ module Dor
|
|
131
127
|
self
|
132
128
|
end
|
133
129
|
|
134
|
-
delegate :background_job_results, :
|
135
|
-
:virtual_objects, :administrative_tags, to: :instance
|
130
|
+
delegate :background_job_results, :objects, :object, :virtual_objects, :administrative_tags, to: :instance
|
136
131
|
end
|
137
132
|
|
138
133
|
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.1
|
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-09
|
12
|
+
date: 2023-10-09 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
|