dor-services-client 13.0.0 → 13.1.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: 52d7f1922fb592d9b86bc19bb2613ea2649b294a83e6dc898795514ef75889ab
4
- data.tar.gz: 3f455ceee20044d6b2dda3f9f74f25100349a7f390c9de462df2621b051e29da
3
+ metadata.gz: 07a7f4f3a4799676f9af98bc7a8dbb3b991a2a907a430a103d652258365feff8
4
+ data.tar.gz: 0601c6f446cda0eb0e8cc09286c5e082f26c9dbf54a51fb5e3958f7bec679274
5
5
  SHA512:
6
- metadata.gz: 3a11dbc88113dbb5844d483c4514616ddbea9de1c5cce7afcab3e38b1f466e0f4c1f63cf6fe58953a7b6321b02eb408e2196a240ae8850d25b51d32a1785a48f
7
- data.tar.gz: f322703d6d85a737bebc790701235f4765c4e2fd7fee248704c1c5dc1c027f991b082634765b415cbfb483e4d2f5c664712e500b67af82823fe00c194037639f
6
+ metadata.gz: 7760cdb2c74b39ded300b991c617214ac455c9d3be14a9a477e74404f222b530f9817056329b86b20cab170a13964ac3e9f2eb78bd999d3347692bc890716fe4
7
+ data.tar.gz: ac7d1c9102f10883157ac49c849a6d3984fd020fe314e263df8a8316b3205b1aa3fb5738dacc28671a4957f676fa41a2137906a9e310e10ee0b8ac1dddc2e21b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (13.0.0)
4
+ dor-services-client (13.1.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  cocina-models (~> 0.91.0)
7
7
  deprecation
@@ -12,16 +12,22 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.8)
15
+ activesupport (7.1.1)
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
32
  cocina-models (0.91.2)
27
33
  activesupport
@@ -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)
@@ -81,11 +90,12 @@ GEM
81
90
  concurrent-ruby (~> 1.0)
82
91
  ice_nine (0.11.2)
83
92
  json (2.6.3)
84
- jsonpath (1.1.4)
93
+ jsonpath (1.1.5)
85
94
  multi_json
86
95
  language_server-protocol (3.17.0.3)
87
96
  minitest (5.20.0)
88
97
  multi_json (1.15.0)
98
+ mutex_m (0.1.2)
89
99
  nokogiri (1.15.4-x86_64-darwin)
90
100
  racc (~> 1.4)
91
101
  nokogiri (1.15.4-x86_64-linux)
@@ -95,7 +105,7 @@ GEM
95
105
  openapi_parser (1.0.0)
96
106
  optimist (3.1.0)
97
107
  parallel (1.23.0)
98
- parser (3.2.2.3)
108
+ parser (3.2.2.4)
99
109
  ast (~> 2.4.1)
100
110
  racc
101
111
  patience_diff (1.2.0)
@@ -104,7 +114,7 @@ GEM
104
114
  racc (1.7.1)
105
115
  rainbow (3.1.1)
106
116
  rake (13.0.6)
107
- regexp_parser (2.8.1)
117
+ regexp_parser (2.8.2)
108
118
  rexml (3.2.6)
109
119
  rspec (3.12.0)
110
120
  rspec-core (~> 3.12.0)
@@ -121,12 +131,12 @@ GEM
121
131
  rspec-support (3.12.1)
122
132
  rss (0.3.0)
123
133
  rexml
124
- rubocop (1.56.4)
134
+ rubocop (1.57.1)
125
135
  base64 (~> 0.1.1)
126
136
  json (~> 2.3)
127
137
  language_server-protocol (>= 3.17.0)
128
138
  parallel (~> 1.10)
129
- parser (>= 3.2.2.3)
139
+ parser (>= 3.2.2.4)
130
140
  rainbow (>= 2.2.2, < 4.0)
131
141
  regexp_parser (>= 1.8, < 3.0)
132
142
  rexml (>= 3.2.5, < 4.0)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/json' # required for serializing time as iso8601
4
-
5
3
  module Dor
6
4
  module Services
7
5
  class Client
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/json' # required for serializing time as iso8601
4
-
5
3
  module Dor
6
4
  module Services
7
5
  class Client
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '13.0.0'
6
+ VERSION = '13.1.0'
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
@@ -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'
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.0
4
+ version: 13.1.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-10-04 00:00:00.000000000 Z
12
+ date: 2023-10-20 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.3.7
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: A client for dor-services-app