dor-services-client 12.9.1 → 12.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19929d8822946703d616323856ec7de6f1e49f9e6c654c118476a7af965bf448
4
- data.tar.gz: e66d0f99e968293beb0902c240dc0e8eda6ed50daab520f2222a7ef76b6c2e8a
3
+ metadata.gz: a6a8b96cc8e3c10974deb25a74cfcb78d0ef7a7abdfd9b587da2e1f1cb6773a5
4
+ data.tar.gz: 5800821a52f4b09fcbd34dd997c87327103d8e8ca6081ef17ccd70318e70a8b5
5
5
  SHA512:
6
- metadata.gz: 4142cb26d773ac192adfbe602dcdf2af1e5ba1e6bee2cb098ef4316f42e52530f179fd9b5cdc5dee7e94485d8c721fe01af7df3df9f4cc9580520ddd245caf94
7
- data.tar.gz: 2c819bb26879c3305fa8eecf2a0ab01f215c2450dc5b0582f8aaf9f649116017e4fd0d871383060ddc75cd302d3d5ce55ac4c8a82095f87a300cbe839283f89b
6
+ metadata.gz: f9b6cc1c3486776c79e0df52b0ef47580c7288af6c66a69ac049590469cabdebe25a2df12f3f98831531b8771525ceb324a42e7673c4dbe8c69e29a7445ae126
7
+ data.tar.gz: d6cb1eec07c4f9806c5f9a976cd38bc161a8396aaee014a06d6e2b8001bb46d101234398267e04901b96742994b9faf27129a0397a3a7c7539bb3043ac4f6f69
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (12.9.1)
4
+ dor-services-client (12.10.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.86.0)
7
7
  deprecation
@@ -47,30 +47,34 @@ GEM
47
47
  docile (1.4.0)
48
48
  dry-container (0.11.0)
49
49
  concurrent-ruby (~> 1.0)
50
- dry-core (0.8.1)
50
+ dry-core (0.9.1)
51
51
  concurrent-ruby (~> 1.0)
52
+ zeitwerk (~> 2.6)
52
53
  dry-inflector (0.3.0)
53
- dry-logic (1.2.0)
54
+ dry-logic (1.3.0)
54
55
  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)
56
+ dry-core (~> 0.9, >= 0.9)
57
+ zeitwerk (~> 2.6)
58
+ dry-struct (1.5.2)
59
+ dry-core (~> 0.9, >= 0.9)
60
+ dry-types (~> 1.6)
59
61
  ice_nine (~> 0.11)
60
- dry-types (1.5.1)
62
+ zeitwerk (~> 2.6)
63
+ dry-types (1.6.1)
61
64
  concurrent-ruby (~> 1.0)
62
65
  dry-container (~> 0.3)
63
- dry-core (~> 0.5, >= 0.5)
66
+ dry-core (~> 0.9, >= 0.9)
64
67
  dry-inflector (~> 0.1, >= 0.1.2)
65
- dry-logic (~> 1.0, >= 1.0.2)
68
+ dry-logic (~> 1.3, >= 1.3)
69
+ zeitwerk (~> 2.6)
66
70
  edtf (3.1.0)
67
71
  activesupport (>= 3.0, < 8.0)
68
72
  equivalent-xml (0.6.0)
69
73
  nokogiri (>= 1.4.3)
70
- faraday (2.5.2)
74
+ faraday (2.6.0)
71
75
  faraday-net_http (>= 2.0, < 3.1)
72
76
  ruby2_keywords (>= 0.0.4)
73
- faraday-net_http (3.0.0)
77
+ faraday-net_http (3.0.1)
74
78
  faraday-retry (2.0.0)
75
79
  faraday (~> 2.0)
76
80
  hashdiff (1.0.1)
@@ -82,9 +86,9 @@ GEM
82
86
  multi_json
83
87
  minitest (5.16.3)
84
88
  multi_json (1.15.0)
85
- nokogiri (1.13.8-x86_64-darwin)
89
+ nokogiri (1.13.9-x86_64-darwin)
86
90
  racc (~> 1.4)
87
- nokogiri (1.13.8-x86_64-linux)
91
+ nokogiri (1.13.9-x86_64-linux)
88
92
  racc (~> 1.4)
89
93
  openapi3_parser (0.9.2)
90
94
  commonmarker (~> 0.17)
@@ -101,34 +105,34 @@ GEM
101
105
  rake (13.0.6)
102
106
  regexp_parser (2.6.0)
103
107
  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.1)
108
+ rspec (3.12.0)
109
+ rspec-core (~> 3.12.0)
110
+ rspec-expectations (~> 3.12.0)
111
+ rspec-mocks (~> 3.12.0)
112
+ rspec-core (3.12.0)
113
+ rspec-support (~> 3.12.0)
114
+ rspec-expectations (3.12.0)
111
115
  diff-lcs (>= 1.2.0, < 2.0)
112
- rspec-support (~> 3.11.0)
113
- rspec-mocks (3.11.1)
116
+ rspec-support (~> 3.12.0)
117
+ rspec-mocks (3.12.0)
114
118
  diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.11.0)
116
- rspec-support (3.11.1)
119
+ rspec-support (~> 3.12.0)
120
+ rspec-support (3.12.0)
117
121
  rss (0.2.9)
118
122
  rexml
119
- rubocop (1.36.0)
123
+ rubocop (1.37.1)
120
124
  json (~> 2.3)
121
125
  parallel (~> 1.10)
122
126
  parser (>= 3.1.2.1)
123
127
  rainbow (>= 2.2.2, < 4.0)
124
128
  regexp_parser (>= 1.8, < 3.0)
125
129
  rexml (>= 3.2.5, < 4.0)
126
- rubocop-ast (>= 1.20.1, < 2.0)
130
+ rubocop-ast (>= 1.23.0, < 2.0)
127
131
  ruby-progressbar (~> 1.7)
128
132
  unicode-display_width (>= 1.4.0, < 3.0)
129
- rubocop-ast (1.21.0)
133
+ rubocop-ast (1.23.0)
130
134
  parser (>= 3.1.1.0)
131
- rubocop-rspec (2.13.2)
135
+ rubocop-rspec (2.14.2)
132
136
  rubocop (~> 1.33)
133
137
  ruby-progressbar (1.11.0)
134
138
  ruby2_keywords (0.0.5)
@@ -150,7 +154,7 @@ GEM
150
154
  addressable (>= 2.8.0)
151
155
  crack (>= 0.3.2)
152
156
  hashdiff (>= 0.4.0, < 2.0.0)
153
- zeitwerk (2.6.1)
157
+ zeitwerk (2.6.4)
154
158
 
155
159
  PLATFORMS
156
160
  x86_64-darwin-19
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '12.9.1'
6
+ VERSION = '12.10.0'
7
7
  end
8
8
  end
9
9
  end
@@ -24,13 +24,21 @@ module Dor
24
24
  end
25
25
 
26
26
  # Cleans up a workspace
27
- # @raise [UnexpectedResponse] if the request is unsuccessful.
28
- # @return nil
29
- def cleanup
27
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
28
+ # @raise [UnexpectedResponse] when the response is not successful.
29
+ # @param [String] workflow (nil) which workflow to callback to.
30
+ # @param [String] lane_id for prioritization (default or low)
31
+ # @return [String] the URL of the background job on dor-service-app
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}"
30
36
  resp = connection.delete do |req|
31
- req.url workspace_path
37
+ req.url cleanup_path
32
38
  end
33
- raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
39
+ return resp.headers['Location'] if resp.success?
40
+
41
+ raise_exception_based_on_response!(resp, object_identifier)
34
42
  end
35
43
 
36
44
  # After an object has been copied to preservation the workspace can be
@@ -50,6 +58,13 @@ module Dor
50
58
  "#{api_version}/objects/#{object_identifier}/workspace"
51
59
  end
52
60
 
61
+ def query_params_for(workflow, lane_id)
62
+ [].tap do |params|
63
+ params << "workflow=#{workflow}" if workflow
64
+ params << "lane-id=#{lane_id}" if lane_id
65
+ end
66
+ end
67
+
53
68
  attr_reader :object_identifier
54
69
  end
55
70
  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.9.1
4
+ version: 12.10.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-10-06 00:00:00.000000000 Z
12
+ date: 2022-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  - !ruby/object:Gem::Version
281
281
  version: '0'
282
282
  requirements: []
283
- rubygems_version: 3.2.3
283
+ rubygems_version: 3.3.7
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: A client for dor-services-app