dor-services-client 15.15.1 → 15.16.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: d5d9a556b75e428095790837c00911af7b048931b9bec6fe9464a76bcffdcc8e
4
- data.tar.gz: 07e11749b4376ccefd986e71198ec7cfb3faa22cc942a633493a41a55596b097
3
+ metadata.gz: ab50c5a851df383096d632a859cbac9a0afcdbbb54f95910ab31a266b044e6f4
4
+ data.tar.gz: 233523b1995ef21dadb3aba64708bc1b8512650c18b33a1500602340a73a0638
5
5
  SHA512:
6
- metadata.gz: 6a1d37557291d550355aebc22e3de0774d6dbf03da8bce455e0df4f6f040a171b2fb06f9f70dab5731f05015420a4651739fe0fad7c861019ac9ca6e259a66d5
7
- data.tar.gz: e0125d4dd139be07ce31ea1f8d0edf77bb516371ae96212517b4467f9e00f318be3e7dfdda8011a0fbb697ab6beb941205dd90c6698b02a86b08329954b91dda
6
+ metadata.gz: 81ebf90e472f4a6548df3a8282a9a95de3c4177508cab234b31cbf8c66eed9c9af9d2ccc889e6e12a743f8bb92a14d3f4ddf68d43cee24645b65e08fb46b7494
7
+ data.tar.gz: e5e4a931b65ecd85a4421f9df55b96a2511ba620088642462c455dcae872d9ba427d4e03f9016ad10d52936aad1efce7c32ac73187b4ed8594c02c0d064bb079
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.15.1)
4
+ dor-services-client (15.16.0)
5
5
  activesupport (>= 7.0.0)
6
6
  cocina-models (~> 0.104.1)
7
7
  deprecation
@@ -84,7 +84,7 @@ GEM
84
84
  activesupport (>= 3.0, < 9.0)
85
85
  equivalent-xml (0.6.0)
86
86
  nokogiri (>= 1.4.3)
87
- faraday (2.13.1)
87
+ faraday (2.13.2)
88
88
  faraday-net_http (>= 2.0, < 3.5)
89
89
  json
90
90
  logger
data/README.md CHANGED
@@ -178,6 +178,8 @@ Dor::Services::Client.administrative_tags.search(q: 'Project')
178
178
 
179
179
  # Get a list of workflow templates
180
180
  Dor::Services::Client.workflows.templates
181
+ # Show a workflow template (e.g., to view its list of steps)
182
+ Dor::Services::Client.workflows.template('accessionWF')
181
183
  ```
182
184
 
183
185
  ## Asynchronous results
@@ -55,7 +55,14 @@ module Dor
55
55
  end
56
56
 
57
57
  def workflow(workflow_name)
58
- @workflow ||= ObjectWorkflow.new(**parent_params.merge({ workflow_name: workflow_name }))
58
+ raise ArgumentError, '`workflow_name` argument cannot be blank in call to `#workflow(workflow_name)' if workflow_name.blank?
59
+
60
+ # Return memoized object instance if workflow_name value is the same
61
+ #
62
+ # This allows the client to interact with multiple workflows for a given object
63
+ return @workflow if @workflow&.workflow_name == workflow_name
64
+
65
+ @workflow = ObjectWorkflow.new(**parent_params.merge({ workflow_name: workflow_name }))
59
66
  end
60
67
 
61
68
  # Retrieves the Cocina model
@@ -5,6 +5,8 @@ module Dor
5
5
  class Client
6
6
  # API calls around workflow for an object.
7
7
  class ObjectWorkflow < VersionedService
8
+ attr_reader :workflow_name
9
+
8
10
  # @param object_identifier [String] the druid for the object
9
11
  # @param [String] workflow_name The name of the workflow
10
12
  def initialize(connection:, version:, object_identifier:, workflow_name:)
@@ -61,7 +63,7 @@ module Dor
61
63
 
62
64
  private
63
65
 
64
- attr_reader :object_identifier, :workflow_name
66
+ attr_reader :object_identifier
65
67
  end
66
68
  end
67
69
  end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.15.1'
6
+ VERSION = '15.16.0'
7
7
  end
8
8
  end
9
9
  end
@@ -8,9 +8,20 @@ module Dor
8
8
  # Retrieves a list of workflow template name
9
9
  # @return [Array<String>] the list of templates
10
10
  def templates
11
- resp = connection.post do |req|
11
+ resp = connection.get do |req|
12
12
  req.url "#{api_version}/workflow_templates"
13
- req.headers['Content-Type'] = 'application/json'
13
+ req.headers['Accept'] = 'application/json'
14
+ end
15
+ raise_exception_based_on_response!(resp) unless resp.success?
16
+
17
+ JSON.parse(resp.body)
18
+ end
19
+
20
+ # Retrieves a workflow template given a workflow name
21
+ # @return [Hash] the set of processes within a template
22
+ def template(workflow_name)
23
+ resp = connection.get do |req|
24
+ req.url "#{api_version}/workflow_templates/#{workflow_name}"
14
25
  req.headers['Accept'] = 'application/json'
15
26
  end
16
27
  raise_exception_based_on_response!(resp) unless resp.success?
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.15.1
4
+ version: 15.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  - Michael Giarlo
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2025-07-01 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
@@ -221,7 +220,6 @@ dependencies:
221
220
  - - ">="
222
221
  - !ruby/object:Gem::Version
223
222
  version: '0'
224
- description:
225
223
  email:
226
224
  - jcoyne@justincoyne.com
227
225
  - leftwing@alumni.rutgers.edu
@@ -277,7 +275,6 @@ homepage: https://github.com/sul-dlss/dor-services-client
277
275
  licenses: []
278
276
  metadata:
279
277
  rubygems_mfa_required: 'true'
280
- post_install_message:
281
278
  rdoc_options: []
282
279
  require_paths:
283
280
  - lib
@@ -295,8 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
292
  - !ruby/object:Gem::Version
296
293
  version: '0'
297
294
  requirements: []
298
- rubygems_version: 3.5.11
299
- signing_key:
295
+ rubygems_version: 3.6.9
300
296
  specification_version: 4
301
297
  summary: A client for dor-services-app
302
298
  test_files: []