dor-services-client 13.0.1 → 13.1.1

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: 74d7e3fd877e278b201d95659d3003b2a80823060553d3b6922914dac87b7c20
4
- data.tar.gz: dceb16866228a3fcd1230d1d3e81be9083fdc1a92d41f6d937a964bd913dd9ff
3
+ metadata.gz: da7e3b9d816ebc43f5f1846e29ead0dd6db4c2796db964da7675cb9a93cb65ce
4
+ data.tar.gz: 77419c5558add7401662095bcdc80fe0c4f5b25ede954c2365983e4ec5c4628e
5
5
  SHA512:
6
- metadata.gz: 49c37f1ab1f9cfabedf44f1f3d94c677c86c91207ed383e33d16679e5f326767f1b36ddd764bfdf928984ee2007abb8cba9d4a41ac557a4bee6e8aba174f00c6
7
- data.tar.gz: 9b4fabacd6a69c13101da1d59378d359e11a297a0ee7e120ae5a1cf38ab54302774706dbc7756100507964641eb5ed34c5cc3f515ee53f44ba577b0c2f6ab994
6
+ metadata.gz: 6c02541dfb4939848673982e7f575eceb9d7d73c9e13d98830cc0b41a1730644c3d69ca58da80e02a769a79f7002080c2fab79ea2acfac2b020dee2cf4660bbd
7
+ data.tar.gz: 7ec0f190b6d1fd94c2995f5801d1833594d509a2d93fb12a2560daef719fdd309f0d77fe9e794805a9278a2551e53681f8db691d66f0e7c2c92447404bbcd2af
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (13.0.1)
4
+ dor-services-client (13.1.1)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.91.0)
7
7
  deprecation
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.1.0)
15
+ activesupport (7.1.1)
16
16
  base64
17
17
  bigdecimal
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -29,7 +29,7 @@ GEM
29
29
  base64 (0.1.1)
30
30
  bigdecimal (3.1.4)
31
31
  byebug (11.1.3)
32
- cocina-models (0.91.2)
32
+ cocina-models (0.91.4)
33
33
  activesupport
34
34
  deprecation
35
35
  dry-struct (~> 1.0)
@@ -90,7 +90,7 @@ GEM
90
90
  concurrent-ruby (~> 1.0)
91
91
  ice_nine (0.11.2)
92
92
  json (2.6.3)
93
- jsonpath (1.1.4)
93
+ jsonpath (1.1.5)
94
94
  multi_json
95
95
  language_server-protocol (3.17.0.3)
96
96
  minitest (5.20.0)
@@ -114,7 +114,7 @@ GEM
114
114
  racc (1.7.1)
115
115
  rainbow (3.1.1)
116
116
  rake (13.0.6)
117
- regexp_parser (2.8.1)
117
+ regexp_parser (2.8.2)
118
118
  rexml (3.2.6)
119
119
  rspec (3.12.0)
120
120
  rspec-core (~> 3.12.0)
@@ -131,12 +131,12 @@ GEM
131
131
  rspec-support (3.12.1)
132
132
  rss (0.3.0)
133
133
  rexml
134
- rubocop (1.56.4)
134
+ rubocop (1.57.1)
135
135
  base64 (~> 0.1.1)
136
136
  json (~> 2.3)
137
137
  language_server-protocol (>= 3.17.0)
138
138
  parallel (~> 1.10)
139
- parser (>= 3.2.2.3)
139
+ parser (>= 3.2.2.4)
140
140
  rainbow (>= 2.2.2, < 4.0)
141
141
  regexp_parser (>= 1.8, < 3.0)
142
142
  rexml (>= 3.2.5, < 4.0)
@@ -165,7 +165,7 @@ GEM
165
165
  attr_extras (>= 6.2.4)
166
166
  diff-lcs
167
167
  patience_diff
168
- thor (1.2.2)
168
+ thor (1.3.0)
169
169
  tzinfo (2.0.6)
170
170
  concurrent-ruby (~> 1.0)
171
171
  unicode-display_width (2.5.0)
@@ -7,8 +7,8 @@ module Dor
7
7
  class ErrorFaradayMiddleware < Faraday::Middleware
8
8
  def call(env)
9
9
  @app.call(env)
10
- rescue Faraday::ConnectionFailed
11
- raise ConnectionFailed, 'unable to reach dor-services-app'
10
+ rescue Faraday::ConnectionFailed => e
11
+ raise ConnectionFailed, "unable to reach dor-services-app: #{e}", e.backtrace
12
12
  end
13
13
  end
14
14
  end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '13.0.1'
6
+ VERSION = '13.1.1'
7
7
  end
8
8
  end
9
9
  end
@@ -30,11 +30,8 @@ module Dor
30
30
  # @param [String] lane_id for prioritization (default or low)
31
31
  # @return [String] the URL of the background job on dor-service-app
32
32
  def cleanup(workflow: nil, lane_id: nil)
33
- query_params = query_params_for(workflow, lane_id)
34
- query_string = query_params.any? ? "?#{query_params.join('&')}" : ''
35
- cleanup_path = "#{workspace_path}#{query_string}"
36
33
  resp = connection.delete do |req|
37
- req.url cleanup_path
34
+ req.url with_query_params(workspace_path, workflow, lane_id)
38
35
  end
39
36
  return resp.headers['Location'] if resp.success?
40
37
 
@@ -43,11 +40,13 @@ module Dor
43
40
 
44
41
  # After an object has been copied to preservation the workspace can be
45
42
  # reset. This is called by the reset-workspace step of the accessionWF
43
+ # @param [String] workflow (nil) which workflow to callback to.
44
+ # @param [String] lane_id for prioritization (default or low)
46
45
  # @raise [UnexpectedResponse] if the request is unsuccessful.
47
46
  # @return nil
48
- def reset
47
+ def reset(workflow: nil, lane_id: nil)
49
48
  resp = connection.post do |req|
50
- req.url "#{workspace_path}/reset"
49
+ req.url with_query_params("#{workspace_path}/reset", workflow, lane_id)
51
50
  end
52
51
  raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
53
52
  end
@@ -65,6 +64,13 @@ module Dor
65
64
  end
66
65
  end
67
66
 
67
+ def with_query_params(url, workflow, lane_id)
68
+ query_params = query_params_for(workflow, lane_id)
69
+ return url unless query_params.any?
70
+
71
+ "#{url}?#{query_params.join('&')}"
72
+ end
73
+
68
74
  attr_reader :object_identifier
69
75
  end
70
76
  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: 13.0.1
4
+ version: 13.1.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-10-09 00:00:00.000000000 Z
12
+ date: 2023-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  - !ruby/object:Gem::Version
279
279
  version: '0'
280
280
  requirements: []
281
- rubygems_version: 3.4.19
281
+ rubygems_version: 3.4.21
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: A client for dor-services-app