dor-services-client 7.3.0 → 7.6.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 +4 -4
- data/.circleci/config.yml +8 -33
- data/.rubocop.yml +52 -1
- data/.rubocop_todo.yml +71 -7
- data/README.md +3 -0
- data/dor-services-client.gemspec +5 -4
- data/lib/dor/services/client/marcxml.rb +0 -2
- data/lib/dor/services/client/object.rb +1 -1
- data/lib/dor/services/client/transfer.rb +15 -2
- data/lib/dor/services/client/version.rb +1 -1
- metadata +29 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e2d9e5cd1569dfa3cb099d27fb999c5fda7434db1fa07de5db64ff728bc00ec
|
|
4
|
+
data.tar.gz: 221f79c403afb4daba61e4d21f8d9d8f2c59ac2ee192bd0c9739922cb9060d47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1689a1120fd0c7454b1905d9b64b4abee90f7cf61b7c03df4b13227ea93eb1ed30a8c07bab9202b07f7f4fc0bd1e73e280e096e8e42b7246e2973cd73b7c07f3
|
|
7
|
+
data.tar.gz: aba6793400aad63490bdee7a1e25d238ddcf5d4b4ae7c2e652f3f62abe05c78e9c28760a4daae3e88e0bdde782dbb5d9a90828c478231875763882ee7bfe77c3
|
data/.circleci/config.yml
CHANGED
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
version: 2.1
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
orbs:
|
|
3
|
+
ruby-rails: sul-dlss/ruby-rails@2.0.0
|
|
4
|
+
workflows:
|
|
4
5
|
build:
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
steps:
|
|
11
|
-
- checkout
|
|
12
|
-
- run:
|
|
13
|
-
name: Install Bundler
|
|
14
|
-
command: gem install bundler
|
|
15
|
-
- run:
|
|
16
|
-
name: Which bundler?
|
|
17
|
-
command: bundle -v
|
|
18
|
-
- run:
|
|
19
|
-
name: Bundle Install
|
|
20
|
-
command: bundle check || bundle install
|
|
21
|
-
- run:
|
|
22
|
-
name: Lint using rubocop
|
|
23
|
-
command: bundle exec rubocop
|
|
24
|
-
- run:
|
|
25
|
-
name: Setup Code Climate test-reporter
|
|
26
|
-
command: |
|
|
27
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
28
|
-
chmod +x ./cc-test-reporter
|
|
29
|
-
./cc-test-reporter before-build
|
|
30
|
-
- run:
|
|
31
|
-
name: rspec
|
|
32
|
-
command: bundle exec rspec
|
|
33
|
-
- run:
|
|
34
|
-
name: upload test coverage report to Code Climate
|
|
35
|
-
command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
|
6
|
+
jobs:
|
|
7
|
+
- ruby-rails/lint:
|
|
8
|
+
name: lint
|
|
9
|
+
- ruby-rails/test-gem:
|
|
10
|
+
name: test
|
data/.rubocop.yml
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
|
2
2
|
|
|
3
|
+
require:
|
|
4
|
+
- rubocop-rspec
|
|
5
|
+
|
|
3
6
|
AllCops:
|
|
4
|
-
TargetRubyVersion: 2.
|
|
7
|
+
TargetRubyVersion: 2.7 # dor-services-app can't be 3 due to fedora3
|
|
5
8
|
SuggestExtensions: false
|
|
6
9
|
|
|
7
10
|
Metrics/BlockLength:
|
|
@@ -77,3 +80,51 @@ Style/StringChars: # (new in 1.12)
|
|
|
77
80
|
Enabled: true
|
|
78
81
|
Style/SwapValues: # (new in 1.1)
|
|
79
82
|
Enabled: true
|
|
83
|
+
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
|
|
84
|
+
Enabled: true
|
|
85
|
+
Naming/InclusiveLanguage: # (new in 1.18)
|
|
86
|
+
Enabled: true
|
|
87
|
+
|
|
88
|
+
Gemspec/RequireMFA: # new in 1.23
|
|
89
|
+
Enabled: true
|
|
90
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
|
91
|
+
Enabled: true
|
|
92
|
+
Lint/AmbiguousRange: # new in 1.19
|
|
93
|
+
Enabled: true
|
|
94
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
|
95
|
+
Enabled: true
|
|
96
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
|
97
|
+
Enabled: true
|
|
98
|
+
Lint/UselessRuby2Keywords: # new in 1.23
|
|
99
|
+
Enabled: true
|
|
100
|
+
Naming/BlockForwarding: # new in 1.24
|
|
101
|
+
Enabled: true
|
|
102
|
+
Security/IoMethods: # new in 1.22
|
|
103
|
+
Enabled: true
|
|
104
|
+
Style/FileRead: # new in 1.24
|
|
105
|
+
Enabled: true
|
|
106
|
+
Style/FileWrite: # new in 1.24
|
|
107
|
+
Enabled: true
|
|
108
|
+
Style/MapToHash: # new in 1.24
|
|
109
|
+
Enabled: true
|
|
110
|
+
Style/NumberedParameters: # new in 1.22
|
|
111
|
+
Enabled: true
|
|
112
|
+
Style/NumberedParametersLimit: # new in 1.22
|
|
113
|
+
Enabled: true
|
|
114
|
+
Style/OpenStructUse: # new in 1.23
|
|
115
|
+
Enabled: true
|
|
116
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
|
117
|
+
Enabled: true
|
|
118
|
+
Style/SelectByRegexp: # new in 1.22
|
|
119
|
+
Enabled: true
|
|
120
|
+
|
|
121
|
+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
|
122
|
+
Enabled: true
|
|
123
|
+
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
|
124
|
+
Enabled: true
|
|
125
|
+
RSpec/SubjectDeclaration: # new in 2.5
|
|
126
|
+
Enabled: true
|
|
127
|
+
RSpec/FactoryBot/SyntaxMethods: # new in 2.7
|
|
128
|
+
Enabled: true
|
|
129
|
+
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
|
130
|
+
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,22 +1,86 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
|
3
|
+
# on 2022-01-14 01:12:44 UTC using RuboCop version 1.24.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
9
|
# Offense count: 2
|
|
10
|
-
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
|
10
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
|
|
11
11
|
Metrics/AbcSize:
|
|
12
|
-
|
|
12
|
+
Exclude:
|
|
13
|
+
- 'lib/dor/services/client/marcxml.rb'
|
|
13
14
|
|
|
14
15
|
# Offense count: 1
|
|
15
|
-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
16
|
+
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
16
17
|
Metrics/MethodLength:
|
|
17
|
-
|
|
18
|
+
Exclude:
|
|
19
|
+
- 'lib/dor/services/client/transfer.rb'
|
|
20
|
+
|
|
21
|
+
# Offense count: 4
|
|
22
|
+
RSpec/AnyInstance:
|
|
23
|
+
Exclude:
|
|
24
|
+
- 'spec/dor/services/client/async_result_spec.rb'
|
|
25
|
+
- 'spec/dor/services/client/metadata_spec.rb'
|
|
26
|
+
- 'spec/dor/services/client/object_version_spec.rb'
|
|
27
|
+
|
|
28
|
+
# Offense count: 1
|
|
29
|
+
# Configuration parameters: Max, CountAsOne.
|
|
30
|
+
RSpec/ExampleLength:
|
|
31
|
+
Exclude:
|
|
32
|
+
- 'spec/dor/services/client/metadata_spec.rb'
|
|
33
|
+
|
|
34
|
+
# Offense count: 6
|
|
35
|
+
RSpec/IdenticalEqualityAssertion:
|
|
36
|
+
Exclude:
|
|
37
|
+
- 'spec/dor/services/client_spec.rb'
|
|
38
|
+
|
|
39
|
+
# Offense count: 8
|
|
40
|
+
# Configuration parameters: Max.
|
|
41
|
+
RSpec/MultipleExpectations:
|
|
42
|
+
Exclude:
|
|
43
|
+
- 'spec/dor/services/client/async_result_spec.rb'
|
|
44
|
+
- 'spec/dor/services/client/background_job_results_spec.rb'
|
|
45
|
+
- 'spec/dor/services/client/events_spec.rb'
|
|
46
|
+
- 'spec/dor/services/client/object_spec.rb'
|
|
47
|
+
- 'spec/dor/services/client/response_error_formatter_spec.rb'
|
|
48
|
+
|
|
49
|
+
# Offense count: 7
|
|
50
|
+
# Configuration parameters: AllowSubject, Max.
|
|
51
|
+
RSpec/MultipleMemoizedHelpers:
|
|
52
|
+
Exclude:
|
|
53
|
+
- 'spec/dor/services/client/objects_spec.rb'
|
|
54
|
+
|
|
55
|
+
# Offense count: 1
|
|
56
|
+
# Cop supports --auto-correct.
|
|
57
|
+
RSpec/MultipleSubjects:
|
|
58
|
+
Exclude:
|
|
59
|
+
- 'spec/dor/services/client/object_spec.rb'
|
|
60
|
+
|
|
61
|
+
# Offense count: 13
|
|
62
|
+
# Configuration parameters: Max.
|
|
63
|
+
RSpec/NestedGroups:
|
|
64
|
+
Exclude:
|
|
65
|
+
- 'spec/dor/services/client/accession_spec.rb'
|
|
66
|
+
- 'spec/dor/services/client/background_job_results_spec.rb'
|
|
67
|
+
- 'spec/dor/services/client/metadata_spec.rb'
|
|
68
|
+
- 'spec/dor/services/client/objects_spec.rb'
|
|
69
|
+
- 'spec/dor/services/client_spec.rb'
|
|
70
|
+
|
|
71
|
+
# Offense count: 4
|
|
72
|
+
RSpec/RepeatedDescription:
|
|
73
|
+
Exclude:
|
|
74
|
+
- 'spec/dor/services/client/object_spec.rb'
|
|
75
|
+
|
|
76
|
+
# Offense count: 3
|
|
77
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
|
78
|
+
RSpec/VerifiedDoubles:
|
|
79
|
+
Exclude:
|
|
80
|
+
- 'spec/dor/services/client/response_error_formatter_spec.rb'
|
|
18
81
|
|
|
19
82
|
# Offense count: 1
|
|
83
|
+
# Configuration parameters: AllowedConstants.
|
|
20
84
|
Style/Documentation:
|
|
21
85
|
Exclude:
|
|
22
86
|
- 'spec/**/*'
|
|
@@ -25,7 +89,7 @@ Style/Documentation:
|
|
|
25
89
|
|
|
26
90
|
# Offense count: 77
|
|
27
91
|
# Cop supports --auto-correct.
|
|
28
|
-
# Configuration parameters:
|
|
92
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
29
93
|
# URISchemes: http, https
|
|
30
94
|
Layout/LineLength:
|
|
31
95
|
Max: 164
|
data/README.md
CHANGED
|
@@ -96,6 +96,9 @@ object_client.update(params: dro)
|
|
|
96
96
|
# Publish an object (push to PURL)
|
|
97
97
|
object_client.publish(workflow: 'releaseWF', lane_id: 'low')
|
|
98
98
|
|
|
99
|
+
# Unpublish an object (yank from PURL)
|
|
100
|
+
object_client.unpublish()
|
|
101
|
+
|
|
99
102
|
# Shelve an object (push to Stacks)
|
|
100
103
|
object_client.shelve(lane_id: 'low')
|
|
101
104
|
|
data/dor-services-client.gemspec
CHANGED
|
@@ -22,13 +22,12 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.required_ruby_version = '
|
|
25
|
+
spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
|
|
26
26
|
|
|
27
|
-
spec.add_dependency 'activesupport', '>= 4.2', '<
|
|
27
|
+
spec.add_dependency 'activesupport', '>= 4.2', '< 8'
|
|
28
28
|
spec.add_dependency 'cocina-models', '~> 0.62.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', '>= 0.15', '< 2'
|
|
31
|
-
spec.add_dependency 'moab-versioning', '~> 4.0'
|
|
32
31
|
spec.add_dependency 'zeitwerk', '~> 2.1'
|
|
33
32
|
|
|
34
33
|
spec.add_development_dependency 'bundler'
|
|
@@ -36,6 +35,8 @@ Gem::Specification.new do |spec|
|
|
|
36
35
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
37
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
38
37
|
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
39
|
-
spec.add_development_dependency '
|
|
38
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
|
|
39
|
+
spec.add_development_dependency 'simplecov'
|
|
40
40
|
spec.add_development_dependency 'webmock'
|
|
41
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
41
42
|
end
|
|
@@ -14,9 +14,9 @@ module Dor
|
|
|
14
14
|
# Publish an object (send to PURL)
|
|
15
15
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
16
16
|
# @raise [UnexpectedResponse] when the response is not successful.
|
|
17
|
-
# @param [String] workflow (
|
|
17
|
+
# @param [String] workflow (nil) which workflow to callback to.
|
|
18
18
|
# @param [String] lane_id for prioritization (default or low)
|
|
19
|
-
# @return [
|
|
19
|
+
# @return [String] the URL of the background job on dor-service-app
|
|
20
20
|
def publish(workflow: nil, lane_id: nil)
|
|
21
21
|
query_params = [].tap do |params|
|
|
22
22
|
params << "workflow=#{workflow}" if workflow
|
|
@@ -32,6 +32,19 @@ module Dor
|
|
|
32
32
|
raise_exception_based_on_response!(resp)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# Unpublish an object (yank from to PURL)
|
|
36
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
37
|
+
# @raise [UnexpectedResponse] when the response is not successful.
|
|
38
|
+
# @return [String] the URL of the background job on dor-service-app
|
|
39
|
+
def unpublish
|
|
40
|
+
resp = connection.post do |req|
|
|
41
|
+
req.url "#{object_path}/unpublish"
|
|
42
|
+
end
|
|
43
|
+
return resp.headers['Location'] if resp.success?
|
|
44
|
+
|
|
45
|
+
raise_exception_based_on_response!(resp)
|
|
46
|
+
end
|
|
47
|
+
|
|
35
48
|
# Preserve an object (send to SDR)
|
|
36
49
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
|
37
50
|
# @raise [UnexpectedResponse] when the response is not successful.
|
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: 7.
|
|
4
|
+
version: 7.6.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:
|
|
12
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -20,7 +20,7 @@ dependencies:
|
|
|
20
20
|
version: '4.2'
|
|
21
21
|
- - "<"
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: '
|
|
23
|
+
version: '8'
|
|
24
24
|
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -30,7 +30,7 @@ dependencies:
|
|
|
30
30
|
version: '4.2'
|
|
31
31
|
- - "<"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '8'
|
|
34
34
|
- !ruby/object:Gem::Dependency
|
|
35
35
|
name: cocina-models
|
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -79,20 +79,6 @@ dependencies:
|
|
|
79
79
|
- - "<"
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '2'
|
|
82
|
-
- !ruby/object:Gem::Dependency
|
|
83
|
-
name: moab-versioning
|
|
84
|
-
requirement: !ruby/object:Gem::Requirement
|
|
85
|
-
requirements:
|
|
86
|
-
- - "~>"
|
|
87
|
-
- !ruby/object:Gem::Version
|
|
88
|
-
version: '4.0'
|
|
89
|
-
type: :runtime
|
|
90
|
-
prerelease: false
|
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
-
requirements:
|
|
93
|
-
- - "~>"
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: '4.0'
|
|
96
82
|
- !ruby/object:Gem::Dependency
|
|
97
83
|
name: zeitwerk
|
|
98
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -178,19 +164,33 @@ dependencies:
|
|
|
178
164
|
- !ruby/object:Gem::Version
|
|
179
165
|
version: '1.0'
|
|
180
166
|
- !ruby/object:Gem::Dependency
|
|
181
|
-
name:
|
|
167
|
+
name: rubocop-rspec
|
|
182
168
|
requirement: !ruby/object:Gem::Requirement
|
|
183
169
|
requirements:
|
|
184
170
|
- - "~>"
|
|
185
171
|
- !ruby/object:Gem::Version
|
|
186
|
-
version:
|
|
172
|
+
version: '2.1'
|
|
187
173
|
type: :development
|
|
188
174
|
prerelease: false
|
|
189
175
|
version_requirements: !ruby/object:Gem::Requirement
|
|
190
176
|
requirements:
|
|
191
177
|
- - "~>"
|
|
192
178
|
- !ruby/object:Gem::Version
|
|
193
|
-
version:
|
|
179
|
+
version: '2.1'
|
|
180
|
+
- !ruby/object:Gem::Dependency
|
|
181
|
+
name: simplecov
|
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
|
183
|
+
requirements:
|
|
184
|
+
- - ">="
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '0'
|
|
187
|
+
type: :development
|
|
188
|
+
prerelease: false
|
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
190
|
+
requirements:
|
|
191
|
+
- - ">="
|
|
192
|
+
- !ruby/object:Gem::Version
|
|
193
|
+
version: '0'
|
|
194
194
|
- !ruby/object:Gem::Dependency
|
|
195
195
|
name: webmock
|
|
196
196
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -251,23 +251,27 @@ files:
|
|
|
251
251
|
- lib/dor/services/client/workspace.rb
|
|
252
252
|
homepage: https://github.com/sul-dlss/dor-services-client
|
|
253
253
|
licenses: []
|
|
254
|
-
metadata:
|
|
254
|
+
metadata:
|
|
255
|
+
rubygems_mfa_required: 'true'
|
|
255
256
|
post_install_message:
|
|
256
257
|
rdoc_options: []
|
|
257
258
|
require_paths:
|
|
258
259
|
- lib
|
|
259
260
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
261
|
requirements:
|
|
261
|
-
- - "
|
|
262
|
+
- - ">="
|
|
263
|
+
- !ruby/object:Gem::Version
|
|
264
|
+
version: '2.7'
|
|
265
|
+
- - "<"
|
|
262
266
|
- !ruby/object:Gem::Version
|
|
263
|
-
version: '
|
|
267
|
+
version: '4'
|
|
264
268
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
269
|
requirements:
|
|
266
270
|
- - ">="
|
|
267
271
|
- !ruby/object:Gem::Version
|
|
268
272
|
version: '0'
|
|
269
273
|
requirements: []
|
|
270
|
-
rubygems_version: 3.
|
|
274
|
+
rubygems_version: 3.2.32
|
|
271
275
|
signing_key:
|
|
272
276
|
specification_version: 4
|
|
273
277
|
summary: A client for dor-services-app
|