dor-services-client 1.12.0 → 2.0.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 +3 -6
- data/dor-services-client.gemspec +0 -1
- data/lib/dor/services/client/object.rb +0 -24
- data/lib/dor/services/client/object_version.rb +0 -13
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +1 -5
- metadata +1 -17
- data/lib/dor/services/client/workflow.rb +0 -35
- data/lib/dor/services/client/workflows.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b796894976f47f34597c9016231df83a46aee0af90e9b7ed3d7ad81c298ff2
|
4
|
+
data.tar.gz: 6dbd6db2e1ae676f325129d375ec00a5f36a845749ccf0459f791d933804a839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b663973452421419199197c6704960d81963ec8be42743740f55f20f9b248fe546fe60dbcfe5d7773fe8a353520cb38ed90dcdc2525ceff10889e21944f88cc
|
7
|
+
data.tar.gz: 7d109c200f4c709fa57c2577f4e117e6f9d98bac29e71437f1dbd32ba61d4175175eee40c727c7662a166af1733a52c5092f03d1d30428b425935b6658de1141
|
data/README.md
CHANGED
@@ -59,6 +59,7 @@ objects_client.register(params: {})
|
|
59
59
|
# For performing operations on a known, registered object
|
60
60
|
object_client = Dor::Services::Client.object(object_identifier)
|
61
61
|
object_client.publish
|
62
|
+
|
62
63
|
# Copy metadata from Symphony into descMetadata
|
63
64
|
object_client.refresh_metadata
|
64
65
|
object_client.notify_goobi
|
@@ -66,8 +67,10 @@ object_client.version.current
|
|
66
67
|
object_client.version.openable?(**params)
|
67
68
|
object_client.version.open(**params)
|
68
69
|
object_client.version.close(**params)
|
70
|
+
|
69
71
|
# Get the Dublin Core XML representation
|
70
72
|
object_client.metadata.dublin_core
|
73
|
+
|
71
74
|
# Get the public descriptive XML representation
|
72
75
|
object_client.metadata.descriptive
|
73
76
|
object_client.files.retrieve(filename: filename_string)
|
@@ -79,15 +82,9 @@ object_client.sdr.current_version
|
|
79
82
|
object_client.sdr.metadata(datastream: dsid)
|
80
83
|
object_client.sdr.signature_catalog
|
81
84
|
|
82
|
-
object_client.workflow.create(wf_name: workflow_name_string)
|
83
|
-
|
84
85
|
# Create and remove workspaces
|
85
86
|
object_client.workspace.create(source: object_path_string)
|
86
87
|
object_client.workspace.cleanup
|
87
|
-
|
88
|
-
# For retrieving a workflow template
|
89
|
-
workflows_client = Dor::Services::Client.workflows
|
90
|
-
workflows_client.initial(name: workflow_name)
|
91
88
|
```
|
92
89
|
|
93
90
|
## Development
|
data/dor-services-client.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
25
|
spec.add_dependency 'activesupport', '>= 4.2', '< 6'
|
26
|
-
spec.add_dependency 'deprecation'
|
27
26
|
spec.add_dependency 'faraday', '~> 0.15'
|
28
27
|
spec.add_dependency 'moab-versioning', '~> 4.0'
|
29
28
|
spec.add_dependency 'nokogiri', '~> 1.8'
|
@@ -1,15 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'deprecation'
|
4
|
-
|
5
3
|
module Dor
|
6
4
|
module Services
|
7
5
|
class Client
|
8
6
|
# API calls that are about a repository object
|
9
7
|
class Object < VersionedService
|
10
|
-
extend Deprecation
|
11
|
-
self.deprecation_horizon = 'dor-services-client version 2.0'
|
12
|
-
|
13
8
|
attr_reader :object_identifier
|
14
9
|
|
15
10
|
# @param object_identifier [String] the pid for the object
|
@@ -32,10 +27,6 @@ module Dor
|
|
32
27
|
@files ||= Files.new(connection: connection, version: api_version, object_identifier: object_identifier)
|
33
28
|
end
|
34
29
|
|
35
|
-
def workflow
|
36
|
-
@workflow ||= Workflow.new(connection: connection, version: api_version, object_identifier: object_identifier)
|
37
|
-
end
|
38
|
-
|
39
30
|
def workspace
|
40
31
|
@workspace ||= Workspace.new(connection: connection, version: api_version, object_identifier: object_identifier)
|
41
32
|
end
|
@@ -100,21 +91,6 @@ module Dor
|
|
100
91
|
raise_exception_based_on_response!(resp)
|
101
92
|
end
|
102
93
|
|
103
|
-
def current_version
|
104
|
-
version.current
|
105
|
-
end
|
106
|
-
deprecation_deprecate current_version: 'use version.current instead'
|
107
|
-
|
108
|
-
def open_new_version(**params)
|
109
|
-
version.open(**params)
|
110
|
-
end
|
111
|
-
deprecation_deprecate open_new_version: 'use version.open instead'
|
112
|
-
|
113
|
-
def close_version(**params)
|
114
|
-
version.close(**params)
|
115
|
-
end
|
116
|
-
deprecation_deprecate close_version: 'use version.close instead'
|
117
|
-
|
118
94
|
private
|
119
95
|
|
120
96
|
def object_path
|
@@ -1,15 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'deprecation'
|
4
|
-
|
5
3
|
module Dor
|
6
4
|
module Services
|
7
5
|
class Client
|
8
6
|
# API calls that are about versions
|
9
7
|
class ObjectVersion < VersionedService
|
10
|
-
extend Deprecation
|
11
|
-
self.deprecation_horizon = 'dor-services-client 2.0.0'
|
12
|
-
|
13
8
|
# @param object_identifier [String] the pid for the object
|
14
9
|
def initialize(connection:, version:, object_identifier:)
|
15
10
|
super(connection: connection, version: version)
|
@@ -29,14 +24,6 @@ module Dor
|
|
29
24
|
raise_exception_based_on_response!(resp)
|
30
25
|
end
|
31
26
|
|
32
|
-
# TODO: remove this deprecation once
|
33
|
-
# https://github.com/sul-dlss/dor-services-app/issues/322 is
|
34
|
-
# merged and all DSC clients have moved to using `#openable?`
|
35
|
-
def openeable?(**params)
|
36
|
-
openable?(**params)
|
37
|
-
end
|
38
|
-
deprecation_deprecate openeable?: 'use version.openable? instead'
|
39
|
-
|
40
27
|
# Determines if a new version can be opened for a DOR object.
|
41
28
|
# @param params [Hash] optional params (see dor-services-app)
|
42
29
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
data/lib/dor/services/client.rb
CHANGED
@@ -64,10 +64,6 @@ module Dor
|
|
64
64
|
@objects ||= Objects.new(connection: connection, version: DEFAULT_VERSION)
|
65
65
|
end
|
66
66
|
|
67
|
-
def workflows
|
68
|
-
@workflows ||= Workflows.new(connection: connection, version: DEFAULT_VERSION)
|
69
|
-
end
|
70
|
-
|
71
67
|
class << self
|
72
68
|
# @param [String] url
|
73
69
|
# @param [String] token a bearer token for HTTP auth
|
@@ -84,7 +80,7 @@ module Dor
|
|
84
80
|
self
|
85
81
|
end
|
86
82
|
|
87
|
-
delegate :objects, :object,
|
83
|
+
delegate :objects, :object, to: :instance
|
88
84
|
end
|
89
85
|
|
90
86
|
attr_writer :url, :token, :token_header, :connection
|
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -31,20 +31,6 @@ dependencies:
|
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '6'
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: deprecation
|
36
|
-
requirement: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
type: :runtime
|
42
|
-
prerelease: false
|
43
|
-
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
34
|
- !ruby/object:Gem::Dependency
|
49
35
|
name: faraday
|
50
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,8 +188,6 @@ files:
|
|
202
188
|
- lib/dor/services/client/sdr.rb
|
203
189
|
- lib/dor/services/client/version.rb
|
204
190
|
- lib/dor/services/client/versioned_service.rb
|
205
|
-
- lib/dor/services/client/workflow.rb
|
206
|
-
- lib/dor/services/client/workflows.rb
|
207
191
|
- lib/dor/services/client/workspace.rb
|
208
192
|
homepage: https://github.com/sul-dlss/dor-services-client
|
209
193
|
licenses: []
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dor
|
4
|
-
module Services
|
5
|
-
class Client
|
6
|
-
# API calls that are about workflow
|
7
|
-
class Workflow < VersionedService
|
8
|
-
extend Deprecation
|
9
|
-
self.deprecation_horizon = 'dor-services-client version 2.0.0'
|
10
|
-
|
11
|
-
# @param object_identifier [String] the pid for the object
|
12
|
-
def initialize(connection:, version:, object_identifier:)
|
13
|
-
super(connection: connection, version: version)
|
14
|
-
@object_identifier = object_identifier
|
15
|
-
end
|
16
|
-
|
17
|
-
# Begin a new workflow
|
18
|
-
# @param wf_name [String] the name of the workflow
|
19
|
-
# @raises [UnexpectedResponse] if the request is unsuccessful.
|
20
|
-
# @return nil
|
21
|
-
def create(wf_name:)
|
22
|
-
resp = connection.post do |req|
|
23
|
-
req.url "#{api_version}/objects/#{object_identifier}/apo_workflows/#{wf_name}"
|
24
|
-
end
|
25
|
-
raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
|
26
|
-
end
|
27
|
-
deprecation_deprecate create: 'Create will be removed. Use dor-workflow-client instead'
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
attr_reader :object_identifier
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dor
|
4
|
-
module Services
|
5
|
-
class Client
|
6
|
-
# API calls that are about workflows
|
7
|
-
class Workflows < VersionedService
|
8
|
-
extend Deprecation
|
9
|
-
self.deprecation_horizon = 'dor-services-client version 2.0.0'
|
10
|
-
|
11
|
-
# Get the initial XML for a workflow
|
12
|
-
# @param name [String] the name of the xml
|
13
|
-
# @return [String] the response
|
14
|
-
def initial(name:)
|
15
|
-
resp = connection.get do |req|
|
16
|
-
req.url "#{api_version}/workflows/#{name}/initial"
|
17
|
-
# asking the service to return XML
|
18
|
-
req.headers['Accept'] = 'application/xml'
|
19
|
-
end
|
20
|
-
return resp.body if resp.success?
|
21
|
-
|
22
|
-
raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})"
|
23
|
-
end
|
24
|
-
deprecation_deprecate initial: 'Initial will be removed. Use dor-workflow-client instead'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|