dor-services-client 10.1.0 → 10.2.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: 7d5e8a1919cb3cf3e1ad0ae59f1d29a0a30d181d330146ddb0cc8a580f5e37a8
4
- data.tar.gz: abc969bfa3b1aae80c666d5ab244ca8ca3ebf2bbfe73fde20dabeffa8dfdefea
3
+ metadata.gz: 06256135ae4d1e556af51bd67aa764f3bdf4095503b5e7c41daf9fa32093be49
4
+ data.tar.gz: 9007c044ff70251c24b9216b447b4190c4162b4f97b8ce2d8c488223d75d0d92
5
5
  SHA512:
6
- metadata.gz: 969b9fde995a8598ef1fa33c6aefb18e0fae6aa42fb38ff30ed1c8e6e939622e45921d5c26dbcf19668eb52930a81fd18e44e005345ee51a98da80dcde5f2fe9
7
- data.tar.gz: edfe4f38b84cde8a1da06b527d16d1b8a46ccba945db6944809bc1d9748f56d328e449d3921668018e1bc966812a123a70a3508858331e9ac6892992e02f0391
6
+ metadata.gz: 5ec452bfeb53407eed48aa5342a339e4137c95542547fcf098c7b9d91ba9cb0930e1afb3d42a2ce5c6e6bc0a779e6bd4555250cdb4fb37d566eb1d034b450f4f
7
+ data.tar.gz: eda0ad02dec02532b6430a46d997d9df4d5aeb963274efd9f08fedbb645d41721b81791d6a7641b7bd0e9834e9a02bafc8ae9e1ce4ece19e747a61b253351837
data/.rubocop.yml CHANGED
@@ -134,3 +134,22 @@ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
134
134
  Enabled: true
135
135
  RSpec/Rails/AvoidSetupHook: # new in 2.4
136
136
  Enabled: true
137
+
138
+ Lint/RefinementImportMethods: # new in 1.27
139
+ Enabled: true
140
+ Security/CompoundHash: # new in 1.28
141
+ Enabled: true
142
+ Style/FetchEnvVar: # new in 1.28
143
+ Enabled: true
144
+ Style/NestedFileDirname: # new in 1.26
145
+ Enabled: true
146
+ Style/ObjectThen: # new in 1.28
147
+ Enabled: true
148
+ Style/RedundantInitialize: # new in 1.27
149
+ Enabled: true
150
+ RSpec/BeEq: # new in 2.9.0
151
+ Enabled: true
152
+ RSpec/BeNil: # new in 2.9.0
153
+ Enabled: true
154
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
155
+ Enabled: true
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
- gem 'activesupport', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
7
+ gem 'activesupport', ENV.fetch('RAILS_VERSION', nil) if ENV['RAILS_VERSION']
8
8
 
9
9
  # Specify your gem's dependencies in dor-services-client.gemspec
10
10
  gemspec
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
- spec.add_dependency 'cocina-models', '~> 0.76.0' # leave pinned to patch level until cocina-models hits 1.0
28
+ spec.add_dependency 'cocina-models', '~> 0.77.0' # leave pinned to patch level until cocina-models hits 1.0
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '~> 2.0'
31
31
  spec.add_dependency 'faraday-retry'
@@ -55,27 +55,6 @@ module Dor
55
55
  build_cocina_from_response(resp)
56
56
  end
57
57
 
58
- # Retrieves the Cocina model and response metadata
59
- # @raise [NotFoundResponse] when the response is a 404 (object not found)
60
- # @raise [UnexpectedResponse] when the response is not successful.
61
- # @return [Array<Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy,ObjectMetadata>] a tuple where
62
- # the first is the model and the second is a ObjectMetadata object
63
- def find_with_metadata
64
- resp = connection.get do |req|
65
- req.url object_path
66
- end
67
- raise_exception_based_on_response!(resp) unless resp.success?
68
-
69
- model = Cocina::Models.build(JSON.parse(resp.body))
70
-
71
- # Don't use #slice here as Faraday will downcase the keys.
72
- metadata = ObjectMetadata.new(updated_at: resp.headers['Last-Modified'],
73
- created_at: resp.headers['X-Created-At'],
74
- etag: resp.headers['ETag'])
75
- [model, metadata]
76
- end
77
- deprecation_deprecate find_with_metadata: 'Use find instead with provides models with metadata.'
78
-
79
58
  # Get a list of the collections. (Similar to Valkyrie's find_inverse_references_by)
80
59
  # @raise [UnexpectedResponse] if the request is unsuccessful.
81
60
  # @return [Array<Cocina::Models::DRO>]
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '10.1.0'
6
+ VERSION = '10.2.0'
7
7
  end
8
8
  end
9
9
  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: 10.1.0
4
+ version: 10.2.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-04-28 00:00:00.000000000 Z
12
+ date: 2022-05-02 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.76.0
40
+ version: 0.77.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.76.0
47
+ version: 0.77.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -249,7 +249,6 @@ files:
249
249
  - lib/dor/services/client/metadata.rb
250
250
  - lib/dor/services/client/mutate.rb
251
251
  - lib/dor/services/client/object.rb
252
- - lib/dor/services/client/object_metadata.rb
253
252
  - lib/dor/services/client/object_version.rb
254
253
  - lib/dor/services/client/objects.rb
255
254
  - lib/dor/services/client/response_error_formatter.rb
@@ -280,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
279
  - !ruby/object:Gem::Version
281
280
  version: '0'
282
281
  requirements: []
283
- rubygems_version: 3.1.4
282
+ rubygems_version: 3.2.32
284
283
  signing_key:
285
284
  specification_version: 4
286
285
  summary: A client for dor-services-app
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'deprecation'
4
-
5
- module Dor
6
- module Services
7
- class Client
8
- # An object representing metadata about the cocina object returned by the object show method
9
- class ObjectMetadata
10
- extend Deprecation
11
-
12
- attr_reader :created_at, :updated_at, :etag
13
-
14
- def initialize(created_at:, updated_at:, etag: nil)
15
- @created_at = created_at
16
- @updated_at = updated_at
17
- @etag = etag
18
- end
19
-
20
- def [](key)
21
- case key
22
- when 'Last-Modified'
23
- updated_at
24
- when 'X-Created-At'
25
- created_at
26
- else
27
- raise KeyError, 'Unknown key'
28
- end
29
- end
30
- deprecation_deprecate(:[] => 'Hash accessor is no longer used, use object accessor instead')
31
- end
32
- end
33
- end
34
- end