dor-services-client 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8647a5b059a14045feb35bb4fe72147cc44854dfb88e19c7af98132a719ba8aa
4
- data.tar.gz: 715989551938b54347651a53e3221a46d68d7e7d455ac6ac65e7e0bb766f38d2
3
+ metadata.gz: 01e63e0697be9a93b1ce18ecf0e45d55204cba3f2e3f33668a72afd08d6544c0
4
+ data.tar.gz: bb1ad3f33448e54d2c7576b15148949c203d9d6ee3c9b849ef012d19872abf65
5
5
  SHA512:
6
- metadata.gz: 9ce7568f2fbd9b2672eb5879a68bc07fc7b29f092f8ec2fa4c00c9683a199f6801a3c3386a8f81ff60d4de10ad861a07e7722c32146ab9d9c5e6d9091195366e
7
- data.tar.gz: f1b77e539cde7590cc63270eb577dfa95131f9a4b893c5ff4efc87c53c3705557034516cf0b3ea7dd3ee07a58a6c1d4503c29d401de283fe8226c8c27a8f2305
6
+ metadata.gz: 5cb0c3601f50770306b7d2f0c9b71ecce3829a7ab90a808a447429c5f266d2ea2892dfcb96a2c3861ead567958685f999c3d13bd49be0396b2bf703d03a34f05
7
+ data.tar.gz: b678d32c3bdb047ab58c82d8e326787992fef16bb34583b236feca6f28b3e6ffad0fc279bf02315416eb93bb89b8617b1e9e8e585e24eadd24d232376a27c54c
data/README.md CHANGED
@@ -70,6 +70,10 @@ object_client.release_tags.create(release: release, what: what, to: to, who: who
70
70
  object_client.sdr.current_version
71
71
  object_client.workflow.create(wf_name: workflow_name_string)
72
72
  object_client.workspace.create(source: object_path_string)
73
+
74
+ # For retrieving a workflow template
75
+ workflows_client = Dor::Services::Client.workflows
76
+ workflows_client.initial(name: workflow_name)
73
77
  ```
74
78
 
75
79
  ## Development
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '1.1.1'
6
+ VERSION = '1.2.0'
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,24 @@
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
+ # Get the initial XML for a workflow
9
+ # @param name [String] the name of the xml
10
+ # @return [String] the response
11
+ def initial(name:)
12
+ resp = connection.get do |req|
13
+ req.url "#{api_version}/workflows/#{name}/initial"
14
+ # asking the service to return XML
15
+ req.headers['Accept'] = 'application/xml'
16
+ end
17
+ return resp.body if resp.success?
18
+
19
+ raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -8,6 +8,7 @@ require 'active_support/core_ext/module/delegation'
8
8
  require 'dor/services/client/versioned_service'
9
9
  require 'dor/services/client/object'
10
10
  require 'dor/services/client/objects'
11
+ require 'dor/services/client/workflows'
11
12
 
12
13
  module Dor
13
14
  module Services
@@ -47,6 +48,10 @@ module Dor
47
48
  @objects ||= Objects.new(connection: connection, version: DEFAULT_VERSION)
48
49
  end
49
50
 
51
+ def workflows
52
+ @workflows ||= Workflows.new(connection: connection, version: DEFAULT_VERSION)
53
+ end
54
+
50
55
  class << self
51
56
  def configure(url:, username: nil, password: nil)
52
57
  instance.url = url
@@ -58,7 +63,7 @@ module Dor
58
63
  self
59
64
  end
60
65
 
61
- delegate :objects, :object, to: :instance
66
+ delegate :objects, :object, :workflows, to: :instance
62
67
  end
63
68
 
64
69
  attr_writer :url, :username, :password, :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: 1.1.1
4
+ version: 1.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-01-16 00:00:00.000000000 Z
12
+ date: 2019-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -172,6 +172,7 @@ files:
172
172
  - lib/dor/services/client/version.rb
173
173
  - lib/dor/services/client/versioned_service.rb
174
174
  - lib/dor/services/client/workflow.rb
175
+ - lib/dor/services/client/workflows.rb
175
176
  - lib/dor/services/client/workspace.rb
176
177
  homepage: https://github.com/sul-dlss/dor-services-client
177
178
  licenses: []