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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 661568d64c661ca584cb921bfe37c2cf950cc5956c5b6bdc1b67554d6d4ae061
4
- data.tar.gz: 1429d0cd63ef3228ba008771616ef56b62e572523ef4594163d83319aa7ca9a4
3
+ metadata.gz: bb2bf83dfdca6f4fe2e7a62d41c20466e5553712fd94ab826213e506372c21fd
4
+ data.tar.gz: 5d65b8dfddad7d3f16fab5da4439e45521ea21352530e0c15878b941fe9c7add
5
5
  SHA512:
6
- metadata.gz: f377574849861fc81578ee2f4cca5c569fd11c7d3ac7cb215d2b64d05776ee31f1b5498da89724951a4ac01039180f5b61a7f5d2fd5d79fe47ccaa9b008680b8
7
- data.tar.gz: f09300b0375116cc05ac7be12d35e59a7577201edfb64f3e05ddee1d4e8c9d311a259cbc8fcbd1d7ff0e24d43a44d25841319f33406d20c876c98b562d08eff4
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.
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '2.1.0'
6
+ VERSION = '2.2.0'
7
7
  end
8
8
  end
9
9
  end
@@ -94,15 +94,16 @@ module Dor
94
94
  end
95
95
 
96
96
  def connection
97
- @connection ||= Faraday.new(url) do |conn|
98
- conn.use ErrorFaradayMiddleware
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
- conn.adapter Faraday.default_adapter
104
- conn.headers[:user_agent] = user_agent
105
- conn.headers[token_header] = "Bearer #{token}" if token
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.1.0
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-15 00:00:00.000000000 Z
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.8
211
+ rubygems_version: 2.7.6
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: A client for dor-services-app