dor-services-client 14.10.0 → 14.12.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 +1 -1
- data/Gemfile.lock +15 -13
- data/lib/dor/services/client/release_tag.rb +25 -0
- data/lib/dor/services/client/release_tags.rb +3 -3
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/workspace.rb +12 -4
- data/lib/dor/services/client.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0c0ec136ed9ea12e5a6c0efc2c2663a5657f49bc2b956ff057586da83c360a5
|
4
|
+
data.tar.gz: bb9c3b96fc62eb5456f85cea0e08de070e3831df74230fff530575d4df2b791e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1094a15841a375b9f3542064a4f64b30b1d701e91a2db1b923e056383bdc0ecf35ec1067f9eefcb426e7f3cc7e2acd90d64854e6b59c7458e8f20158c35c7e
|
7
|
+
data.tar.gz: 908f23a64f6c4028f2a6eddb1956ccb0b9823195a6b4a667029ce2dabe6103604fc3f489cdf68e4aa8d4eb982eb1c9c2319330803716ec56385326f504a0acd2
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (14.
|
4
|
+
dor-services-client (14.11.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
cocina-models (~> 0.97.0)
|
7
7
|
deprecation
|
@@ -44,8 +44,10 @@ GEM
|
|
44
44
|
super_diff
|
45
45
|
thor
|
46
46
|
zeitwerk (~> 2.1)
|
47
|
-
commonmarker (
|
48
|
-
|
47
|
+
commonmarker (1.1.3-arm64-darwin)
|
48
|
+
commonmarker (1.1.3-x86_64-darwin)
|
49
|
+
commonmarker (1.1.3-x86_64-linux)
|
50
|
+
concurrent-ruby (1.3.1)
|
49
51
|
connection_pool (2.4.1)
|
50
52
|
crack (1.0.0)
|
51
53
|
bigdecimal
|
@@ -93,7 +95,7 @@ GEM
|
|
93
95
|
jsonpath (1.1.5)
|
94
96
|
multi_json
|
95
97
|
language_server-protocol (3.17.0.3)
|
96
|
-
minitest (5.23.
|
98
|
+
minitest (5.23.1)
|
97
99
|
multi_json (1.15.0)
|
98
100
|
mutex_m (0.2.0)
|
99
101
|
net-http (0.4.1)
|
@@ -104,21 +106,21 @@ GEM
|
|
104
106
|
racc (~> 1.4)
|
105
107
|
nokogiri (1.16.5-x86_64-linux)
|
106
108
|
racc (~> 1.4)
|
107
|
-
openapi3_parser (0.
|
108
|
-
commonmarker (
|
109
|
+
openapi3_parser (0.10.0)
|
110
|
+
commonmarker (>= 1.0)
|
109
111
|
openapi_parser (1.0.0)
|
110
112
|
optimist (3.1.0)
|
111
113
|
parallel (1.24.0)
|
112
|
-
parser (3.3.
|
114
|
+
parser (3.3.2.0)
|
113
115
|
ast (~> 2.4.1)
|
114
116
|
racc
|
115
117
|
patience_diff (1.2.0)
|
116
118
|
optimist (~> 3.0)
|
117
119
|
public_suffix (5.0.5)
|
118
|
-
racc (1.
|
120
|
+
racc (1.8.0)
|
119
121
|
rainbow (3.1.1)
|
120
122
|
rake (13.2.1)
|
121
|
-
regexp_parser (2.9.
|
123
|
+
regexp_parser (2.9.2)
|
122
124
|
rexml (3.2.8)
|
123
125
|
strscan (>= 3.0.9)
|
124
126
|
rspec (3.13.0)
|
@@ -134,7 +136,7 @@ GEM
|
|
134
136
|
diff-lcs (>= 1.2.0, < 2.0)
|
135
137
|
rspec-support (~> 3.13.0)
|
136
138
|
rspec-support (3.13.1)
|
137
|
-
rubocop (1.
|
139
|
+
rubocop (1.64.1)
|
138
140
|
json (~> 2.3)
|
139
141
|
language_server-protocol (>= 3.17.0)
|
140
142
|
parallel (~> 1.10)
|
@@ -151,7 +153,7 @@ GEM
|
|
151
153
|
rubocop (~> 1.41)
|
152
154
|
rubocop-factory_bot (2.25.1)
|
153
155
|
rubocop (~> 1.41)
|
154
|
-
rubocop-rspec (2.
|
156
|
+
rubocop-rspec (2.30.0)
|
155
157
|
rubocop (~> 1.40)
|
156
158
|
rubocop-capybara (~> 2.17)
|
157
159
|
rubocop-factory_bot (~> 2.22)
|
@@ -175,11 +177,11 @@ GEM
|
|
175
177
|
concurrent-ruby (~> 1.0)
|
176
178
|
unicode-display_width (2.5.0)
|
177
179
|
uri (0.13.0)
|
178
|
-
webmock (3.23.
|
180
|
+
webmock (3.23.1)
|
179
181
|
addressable (>= 2.8.0)
|
180
182
|
crack (>= 0.3.2)
|
181
183
|
hashdiff (>= 0.4.0, < 2.0.0)
|
182
|
-
zeitwerk (2.6.
|
184
|
+
zeitwerk (2.6.15)
|
183
185
|
|
184
186
|
PLATFORMS
|
185
187
|
arm64-darwin-23
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dor
|
4
|
+
module Services
|
5
|
+
class Client
|
6
|
+
# A tag that indicates the item or collection should be released.
|
7
|
+
class ReleaseTag < Dry::Struct
|
8
|
+
transform_keys(&:to_sym)
|
9
|
+
schema schema.strict
|
10
|
+
# Who did this release
|
11
|
+
# example: petucket
|
12
|
+
attribute? :who, Types::Strict::String
|
13
|
+
# What is being released. This item or the whole collection.
|
14
|
+
# example: self
|
15
|
+
attribute :what, Types::Strict::String.enum('self', 'collection')
|
16
|
+
# When did this action happen
|
17
|
+
attribute? :date, Types::Params::DateTime
|
18
|
+
# What platform is it released to
|
19
|
+
# example: Searchworks
|
20
|
+
attribute? :to, Types::Strict::String
|
21
|
+
attribute :release, Types::Strict::Bool.default(false)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -13,7 +13,7 @@ module Dor
|
|
13
13
|
|
14
14
|
# Create a release tag for an object
|
15
15
|
#
|
16
|
-
# @param tag [
|
16
|
+
# @param tag [ReleaseTag]
|
17
17
|
# @return [Boolean] true if successful
|
18
18
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
19
19
|
# @raise [UnexpectedResponse] if the request is unsuccessful.
|
@@ -32,7 +32,7 @@ module Dor
|
|
32
32
|
#
|
33
33
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
34
34
|
# @raise [UnexpectedResponse] if the request is unsuccessful.
|
35
|
-
# @return [Array<
|
35
|
+
# @return [Array<ReleaseTag>]
|
36
36
|
def list
|
37
37
|
resp = connection.get do |req|
|
38
38
|
req.url "#{api_version}/objects/#{object_identifier}/release_tags"
|
@@ -40,7 +40,7 @@ module Dor
|
|
40
40
|
|
41
41
|
raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
|
42
42
|
|
43
|
-
JSON.parse(resp.body).map { |tag_data|
|
43
|
+
JSON.parse(resp.body).map { |tag_data| ReleaseTag.new(tag_data) }
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
@@ -12,16 +12,24 @@ module Dor
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Initializes a new workspace
|
15
|
-
# @param source [String] the path to the object
|
15
|
+
# @param source [String] the path to the object (optional)
|
16
|
+
# @param content [Boolean] determines if the content directory should be created (defaults to false)
|
17
|
+
# @param metadata [Boolean] determines if the metadata directory should be created (defaults to false)
|
16
18
|
# @raise [UnexpectedResponse] if the request is unsuccessful.
|
17
|
-
# @return
|
18
|
-
|
19
|
+
# @return [String] the path to the directory created
|
20
|
+
# rubocop:disable Metrics/AbcSize
|
21
|
+
def create(source: nil, content: false, metadata: false)
|
19
22
|
resp = connection.post do |req|
|
20
23
|
req.url workspace_path
|
21
|
-
req.params['source'] = source
|
24
|
+
req.params['source'] = source if source
|
25
|
+
req.params['content'] = content
|
26
|
+
req.params['metadata'] = metadata
|
22
27
|
end
|
28
|
+
return JSON.parse(resp.body)['path'] if resp.success?
|
29
|
+
|
23
30
|
raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
|
24
31
|
end
|
32
|
+
# rubocop:enable Metrics/AbcSize
|
25
33
|
|
26
34
|
# Cleans up a workspace
|
27
35
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
data/lib/dor/services/client.rb
CHANGED
@@ -78,6 +78,10 @@ module Dor
|
|
78
78
|
# Error that is raised when the remote server returns a 400 Bad Request; apps should not retry the request
|
79
79
|
class BadRequestError < UnexpectedResponse; end
|
80
80
|
|
81
|
+
module Types
|
82
|
+
include Dry.Types()
|
83
|
+
end
|
84
|
+
|
81
85
|
# @param object_identifier [String] the pid for the object
|
82
86
|
# @raise [ArgumentError] when `object_identifier` is `nil`
|
83
87
|
# @return [Dor::Services::Client::Object] an instance of the `Client::Object` class
|
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: 14.
|
4
|
+
version: 14.12.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: 2024-05
|
12
|
+
date: 2024-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- lib/dor/services/client/object.rb
|
250
250
|
- lib/dor/services/client/object_version.rb
|
251
251
|
- lib/dor/services/client/objects.rb
|
252
|
+
- lib/dor/services/client/release_tag.rb
|
252
253
|
- lib/dor/services/client/release_tags.rb
|
253
254
|
- lib/dor/services/client/response_error_formatter.rb
|
254
255
|
- lib/dor/services/client/transfer.rb
|