dor-services-client 3.1.1 → 3.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: d9f6133621d9f6fa4fe27dff918c99d375ac77229e5eda67b61e3d80e6ba7002
4
- data.tar.gz: 1f4ed1a368590418755e6e208342cce5d7616f4509588fa23e50088220689436
3
+ metadata.gz: '05129b08c176476bd2e3ced8d6f3dfff99ddc118988170c11c6df428897fd5bd'
4
+ data.tar.gz: 4da1003e323c07a7ba9e530a2ebe46c58c5e4f200aa879dd78942fb91a9f1d0a
5
5
  SHA512:
6
- metadata.gz: efd9ef1aa9e06a623dea5a3d922da027adc52389240bb6209ecd2ef8cdad38b967f9e86ceb7bd0d204de80eafc5be65bc4eba36c0a3afc6ccfff4431d5891b5d
7
- data.tar.gz: 56fb94a307efb61cbf013d2bd43c6dfc577c7cf13dd979e2bde15a153478dc01a11074b31d591f5a39a575bc8d9525fb2853110f3eea8c2953454ae5a2c64d74
6
+ metadata.gz: 2e90d10bcee7498339bcb684e67da2612f6d4ad9fbef24b2de270c0d3ea1c508f63bae430b14d6bebc602f60286c712eb2c59eb54a33405cf5caf82928f1a657
7
+ data.tar.gz: fa54d821c6e50fc56ca824f54d89d74c0a9455c41809176c5f1f41068ca8a3f5171e27dae950477c3df7f662aab00e2b0264c8f60250723a828cb8a0661a1cb7
data/README.md CHANGED
@@ -72,9 +72,12 @@ background_jobs_client.show(job_id: 123)
72
72
  # For performing operations on a known, registered object
73
73
  object_client = Dor::Services::Client.object(object_identifier)
74
74
 
75
- # Publish an object
75
+ # Publish an object (push to PURL)
76
76
  object_client.publish
77
77
 
78
+ # Shelve an object (push to Stacks)
79
+ object_client.shelve
80
+
78
81
  # Update the MARC record
79
82
  object_client.update_marc_record
80
83
 
@@ -110,9 +113,11 @@ object_client.sdr.content_diff(current_content: existing_content)
110
113
  object_client.sdr.metadata(datastream: dsid)
111
114
  object_client.sdr.signature_catalog
112
115
 
113
- # Create and remove workspaces
116
+ # Create, remove, and reset workspaces
114
117
  object_client.workspace.create(source: object_path_string)
115
118
  object_client.workspace.cleanup
119
+ object_client.workspace.reset
120
+
116
121
 
117
122
  # Update embargo
118
123
  object_client.embargo.update(embargo_date: date_string, requesting_user: username_string)
@@ -64,7 +64,7 @@ module Dor
64
64
  Collections.new(parent_params).collections
65
65
  end
66
66
 
67
- # Publish a new object
67
+ # Publish an object (send to PURL)
68
68
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
69
69
  # @raise [UnexpectedResponse] when the response is not successful.
70
70
  # @return [boolean] true on success
@@ -77,6 +77,19 @@ module Dor
77
77
  raise_exception_based_on_response!(resp)
78
78
  end
79
79
 
80
+ # Shelve an object (send to Stacks)
81
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
82
+ # @raise [UnexpectedResponse] when the response is not successful.
83
+ # @return [boolean] true on success
84
+ def shelve
85
+ resp = connection.post do |req|
86
+ req.url "#{object_path}/shelve"
87
+ end
88
+ return true if resp.success?
89
+
90
+ raise_exception_based_on_response!(resp)
91
+ end
92
+
80
93
  # Update the marc record for the given object
81
94
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
82
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 = '3.1.1'
6
+ VERSION = '3.2.0'
7
7
  end
8
8
  end
9
9
  end
@@ -33,6 +33,17 @@ module Dor
33
33
  raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success?
34
34
  end
35
35
 
36
+ # After an object has been copied to preservation the workspace can be
37
+ # reset. This is called by the reset-workspace step of the accessionWF
38
+ # @raise [UnexpectedResponse] if the request is unsuccessful.
39
+ # @return nil
40
+ def reset
41
+ resp = connection.post do |req|
42
+ req.url "#{workspace_path}/reset"
43
+ end
44
+ raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success?
45
+ end
46
+
36
47
  private
37
48
 
38
49
  def workspace_path
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: 3.1.1
4
+ version: 3.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-10-01 00:00:00.000000000 Z
12
+ date: 2019-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -255,8 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  - !ruby/object:Gem::Version
256
256
  version: '0'
257
257
  requirements: []
258
- rubyforge_project:
259
- rubygems_version: 2.7.8
258
+ rubygems_version: 3.0.3
260
259
  signing_key:
261
260
  specification_version: 4
262
261
  summary: A client for dor-services-app