dor-services-client 2.1.0 → 2.2.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/README.md +7 -0
- data/lib/dor/services/client/object.rb +12 -0
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +6 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb2bf83dfdca6f4fe2e7a62d41c20466e5553712fd94ab826213e506372c21fd
|
4
|
+
data.tar.gz: 5d65b8dfddad7d3f16fab5da4439e45521ea21352530e0c15878b941fe9c7add
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 477506e220109b739c509ec3c2486868bfd09cc705627f6a45baa93f0eb60b5eb50f07a2753530c1931871411a6ba4aa6133e2bb067684886a1955e02bb41d39
|
7
|
+
data.tar.gz: 9791121e18bc3eabac0cdea12a2ebc1625fe6e984eef1ec2441432c60daf2f47510116dfc2c3e34681bde05b3330202b8ad2ecb811374429d89e3530873cc613
|
data/README.md
CHANGED
@@ -62,7 +62,14 @@ object_client.publish
|
|
62
62
|
|
63
63
|
# Copy metadata from Symphony into descMetadata
|
64
64
|
object_client.refresh_metadata
|
65
|
+
|
66
|
+
# Add constituents to an object (virtual-merge)
|
67
|
+
object_client.add_constituents(child_druids:)
|
68
|
+
|
69
|
+
# Send a notification to goobi
|
65
70
|
object_client.notify_goobi
|
71
|
+
|
72
|
+
# Manage versions
|
66
73
|
object_client.version.current
|
67
74
|
object_client.version.openable?(**params)
|
68
75
|
object_client.version.open(**params)
|
@@ -78,6 +78,18 @@ module Dor
|
|
78
78
|
raise_exception_based_on_response!(resp)
|
79
79
|
end
|
80
80
|
|
81
|
+
# Does a virtual-merge of the children into the parent
|
82
|
+
# @param [Array<String>] child_druids the identifier of the children
|
83
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
84
|
+
# @raise [UnexpectedResponse] when the response is not successful.
|
85
|
+
# @return [boolean] true on success
|
86
|
+
def add_constituents(child_druids:)
|
87
|
+
resp = connection.put object_path, constituent_ids: child_druids
|
88
|
+
return true if resp.success?
|
89
|
+
|
90
|
+
raise_exception_based_on_response!(resp)
|
91
|
+
end
|
92
|
+
|
81
93
|
# Notify the external Goobi system for a new object that was registered in DOR
|
82
94
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
83
95
|
# @raise [UnexpectedResponse] when the response is not successful.
|
data/lib/dor/services/client.rb
CHANGED
@@ -94,15 +94,16 @@ module Dor
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def connection
|
97
|
-
@connection ||= Faraday.new(url) do |
|
98
|
-
|
97
|
+
@connection ||= Faraday.new(url) do |builder|
|
98
|
+
builder.use ErrorFaradayMiddleware
|
99
|
+
builder.use Faraday::Request::UrlEncoded
|
99
100
|
|
100
101
|
# @note when token & token_header are nil, this line is required else
|
101
102
|
# the Faraday instance will be passed an empty block, which
|
102
103
|
# causes the adapter not to be set. Thus, everything breaks.
|
103
|
-
|
104
|
-
|
105
|
-
|
104
|
+
builder.adapter Faraday.default_adapter
|
105
|
+
builder.headers[:user_agent] = user_agent
|
106
|
+
builder.headers[token_header] = "Bearer #{token}" if token
|
106
107
|
end
|
107
108
|
end
|
108
109
|
|
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: 2.
|
4
|
+
version: 2.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: 2019-08-
|
12
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.7.
|
211
|
+
rubygems_version: 2.7.6
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: A client for dor-services-app
|