dor-services-client 12.15.0 → 12.17.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: 4fe87932d48e8a6840dff66151357c8fc8e9c86c0e0265a55bd023f941d070ac
4
- data.tar.gz: e9a45ea67d9e74b2078330905fdb880af3520284a45745a71580a312a49d576b
3
+ metadata.gz: 28239d64f9889da5c2eb01d1f7c1a724454a3f9d6e5dc04454e6d537d8b1530c
4
+ data.tar.gz: abffc94573aa3106b599477bff35c786c4ce4d6ba6bc41e9dea37dc43e8b220a
5
5
  SHA512:
6
- metadata.gz: bcda85a815b2f7934b925c9e6e90f5afc41f0d14e9c8186112cc2543d67c6505f616d361d05e91ac4639e2e2ce5437e79c09a5677ebaa94376caa08d750ad1a3
7
- data.tar.gz: b771139f84a28dfe35094f9ad4105ec2048243d8369eb60935083d6618a31c1f05d76df93dd7f0748f56bba2323a202e092f7dfe7b4ae60e76b0cadbd51b03ae
6
+ metadata.gz: 70a705670a2f0ac259b7af85806f909311d2222eb0af263d1bcbd2d96bffb0cf34185e2a9a38f4ba8cd5e1da1f3f9d1c01d4d0c490ddf29873a421d40402212e
7
+ data.tar.gz: 5ff867b49a8d5a552a6d0d5ffada7298fec9d8e19df029f8b79de2899ed1ab65b4058ddf4c0986ae99f1e6c63749bea999e3f165e3bb369416986f19e7e488ad
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@4.0.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.1.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/.rubocop.yml CHANGED
@@ -277,3 +277,20 @@ RSpec/Rails/MinitestAssertions: # new in 2.17
277
277
  Enabled: true
278
278
  RSpec/Rails/TravelAround: # new in 2.19
279
279
  Enabled: true
280
+
281
+ Lint/MixedCaseRange: # new in 1.53
282
+ Enabled: true
283
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
284
+ Enabled: true
285
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
286
+ Enabled: true
287
+ Style/RedundantRegexpArgument: # new in 1.53
288
+ Enabled: true
289
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
290
+ Enabled: true
291
+ Style/YAMLFileRead: # new in 1.53
292
+ Enabled: true
293
+ RSpec/ReceiveMessages: # new in 2.23
294
+ Enabled: true
295
+ RSpec/Rails/NegationBeValid: # new in 2.23
296
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (12.15.0)
4
+ dor-services-client (12.17.0)
5
5
  activesupport (>= 4.2, < 8)
6
- cocina-models (~> 0.90.0)
6
+ cocina-models (~> 0.91.0)
7
7
  deprecation
8
8
  faraday (~> 2.0)
9
9
  faraday-retry
@@ -12,17 +12,18 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.6)
15
+ activesupport (7.0.8)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
- addressable (2.8.4)
20
+ addressable (2.8.5)
21
21
  public_suffix (>= 2.0.2, < 6.0)
22
22
  ast (2.4.2)
23
23
  attr_extras (7.1.0)
24
+ base64 (0.1.1)
24
25
  byebug (11.1.3)
25
- cocina-models (0.90.0)
26
+ cocina-models (0.91.0)
26
27
  activesupport
27
28
  deprecation
28
29
  dry-struct (~> 1.0)
@@ -32,12 +33,12 @@ GEM
32
33
  jsonpath
33
34
  nokogiri
34
35
  openapi3_parser
35
- openapi_parser (>= 0.11.1, < 1.0)
36
+ openapi_parser (~> 1.0)
36
37
  rss
37
38
  super_diff
38
39
  thor
39
40
  zeitwerk (~> 2.1)
40
- commonmarker (0.23.9)
41
+ commonmarker (0.23.10)
41
42
  concurrent-ruby (1.2.2)
42
43
  crack (0.4.5)
43
44
  rexml
@@ -45,7 +46,7 @@ GEM
45
46
  activesupport
46
47
  diff-lcs (1.5.0)
47
48
  docile (1.4.0)
48
- dry-core (1.0.0)
49
+ dry-core (1.0.1)
49
50
  concurrent-ruby (~> 1.0)
50
51
  zeitwerk (~> 2.6)
51
52
  dry-inflector (1.0.0)
@@ -82,28 +83,28 @@ GEM
82
83
  jsonpath (1.1.3)
83
84
  multi_json
84
85
  language_server-protocol (3.17.0.3)
85
- minitest (5.18.1)
86
+ minitest (5.20.0)
86
87
  multi_json (1.15.0)
87
- nokogiri (1.15.3-x86_64-darwin)
88
+ nokogiri (1.15.4-x86_64-darwin)
88
89
  racc (~> 1.4)
89
- nokogiri (1.15.3-x86_64-linux)
90
+ nokogiri (1.15.4-x86_64-linux)
90
91
  racc (~> 1.4)
91
92
  openapi3_parser (0.9.2)
92
93
  commonmarker (~> 0.17)
93
- openapi_parser (0.15.0)
94
- optimist (3.0.1)
94
+ openapi_parser (1.0.0)
95
+ optimist (3.1.0)
95
96
  parallel (1.23.0)
96
97
  parser (3.2.2.3)
97
98
  ast (~> 2.4.1)
98
99
  racc
99
100
  patience_diff (1.2.0)
100
101
  optimist (~> 3.0)
101
- public_suffix (5.0.1)
102
+ public_suffix (5.0.3)
102
103
  racc (1.7.1)
103
104
  rainbow (3.1.1)
104
105
  rake (13.0.6)
105
106
  regexp_parser (2.8.1)
106
- rexml (3.2.5)
107
+ rexml (3.2.6)
107
108
  rspec (3.12.0)
108
109
  rspec-core (~> 3.12.0)
109
110
  rspec-expectations (~> 3.12.0)
@@ -113,13 +114,14 @@ GEM
113
114
  rspec-expectations (3.12.3)
114
115
  diff-lcs (>= 1.2.0, < 2.0)
115
116
  rspec-support (~> 3.12.0)
116
- rspec-mocks (3.12.5)
117
+ rspec-mocks (3.12.6)
117
118
  diff-lcs (>= 1.2.0, < 2.0)
118
119
  rspec-support (~> 3.12.0)
119
120
  rspec-support (3.12.1)
120
- rss (0.2.9)
121
+ rss (0.3.0)
121
122
  rexml
122
- rubocop (1.54.1)
123
+ rubocop (1.56.3)
124
+ base64 (~> 0.1.1)
123
125
  json (~> 2.3)
124
126
  language_server-protocol (>= 3.17.0)
125
127
  parallel (~> 1.10)
@@ -127,7 +129,7 @@ GEM
127
129
  rainbow (>= 2.2.2, < 4.0)
128
130
  regexp_parser (>= 1.8, < 3.0)
129
131
  rexml (>= 3.2.5, < 4.0)
130
- rubocop-ast (>= 1.28.0, < 2.0)
132
+ rubocop-ast (>= 1.28.1, < 2.0)
131
133
  ruby-progressbar (~> 1.7)
132
134
  unicode-display_width (>= 2.4.0, < 3.0)
133
135
  rubocop-ast (1.29.0)
@@ -136,7 +138,7 @@ GEM
136
138
  rubocop (~> 1.41)
137
139
  rubocop-factory_bot (2.23.1)
138
140
  rubocop (~> 1.33)
139
- rubocop-rspec (2.22.0)
141
+ rubocop-rspec (2.24.0)
140
142
  rubocop (~> 1.33)
141
143
  rubocop-capybara (~> 2.17)
142
144
  rubocop-factory_bot (~> 2.22)
@@ -156,11 +158,11 @@ GEM
156
158
  tzinfo (2.0.6)
157
159
  concurrent-ruby (~> 1.0)
158
160
  unicode-display_width (2.4.2)
159
- webmock (3.18.1)
161
+ webmock (3.19.1)
160
162
  addressable (>= 2.8.0)
161
163
  crack (>= 0.3.2)
162
164
  hashdiff (>= 0.4.0, < 2.0.0)
163
- zeitwerk (2.6.8)
165
+ zeitwerk (2.6.11)
164
166
 
165
167
  PLATFORMS
166
168
  x86_64-darwin-19
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 3.0', '< 4'
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
- spec.add_dependency 'cocina-models', '~> 0.90.0'
28
+ spec.add_dependency 'cocina-models', '~> 0.91.0'
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '~> 2.0'
31
31
  spec.add_dependency 'faraday-retry'
@@ -24,8 +24,7 @@ module Dor
24
24
  # @raise [UnexpectedResponse] when the response is not successful.
25
25
  def start(params = {})
26
26
  resp = connection.post do |req|
27
- req.url path
28
- req.params = params
27
+ req.url with_querystring(url: path, params: params)
29
28
  end
30
29
  return true if resp.success?
31
30
 
@@ -59,9 +59,8 @@ module Dor
59
59
  # @return [Cocina::Models::DROWithMetadata|CollectionWithMetadata|AdminPolicyWithMetadata] cocina model with updated version
60
60
  def open(**params)
61
61
  resp = connection.post do |req|
62
- req.url open_new_version_path
62
+ req.url with_querystring(url: open_new_version_path, params: params)
63
63
  req.headers['Content-Type'] = 'application/json'
64
- req.body = params.to_json if params.any?
65
64
  end
66
65
 
67
66
  raise_exception_based_on_response!(resp) unless resp.success?
@@ -79,9 +78,8 @@ module Dor
79
78
  # @return [String] a message confirming successful closing
80
79
  def close(**params)
81
80
  resp = connection.post do |req|
82
- req.url close_version_path
81
+ req.url with_querystring(url: close_version_path, params: params)
83
82
  req.headers['Content-Type'] = 'application/json'
84
- req.body = params.to_json if params.any?
85
83
  end
86
84
  return resp.body if resp.success?
87
85
 
@@ -14,11 +14,10 @@ module Dor
14
14
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
15
15
  def register(params:, assign_doi: false, validate: false)
16
16
  resp = connection.post do |req|
17
- req.url objects_path
17
+ req.url with_querystring(url: objects_path, params: { assign_doi: assign_doi })
18
18
  req.headers['Content-Type'] = 'application/json'
19
19
  # asking the service to return JSON (else it'll be plain text)
20
20
  req.headers['Accept'] = 'application/json'
21
- req.params[:assign_doi] = true if assign_doi
22
21
  req.body = params.to_json
23
22
  end
24
23
 
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '12.15.0'
6
+ VERSION = '12.17.0'
7
7
  end
8
8
  end
9
9
  end
@@ -25,6 +25,12 @@ module Dor
25
25
  AsyncResult.new(url: url)
26
26
  end
27
27
 
28
+ def with_querystring(url:, params:)
29
+ return url if params.blank?
30
+
31
+ "#{url}?#{params.to_query}"
32
+ end
33
+
28
34
  private
29
35
 
30
36
  attr_reader :connection, :api_version
@@ -5,6 +5,7 @@ require 'active_support/core_ext/module/delegation'
5
5
  require 'active_support/core_ext/object/blank'
6
6
  require 'active_support/json'
7
7
  require 'active_support/core_ext/object/json'
8
+ require 'active_support/core_ext/object/to_query'
8
9
  require 'cocina/models'
9
10
  require 'faraday'
10
11
  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: 12.15.0
4
+ version: 12.17.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-07-17 00:00:00.000000000 Z
12
+ date: 2023-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.90.0
40
+ version: 0.91.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.90.0
47
+ version: 0.91.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement