dor-services-client 15.10.0 → 15.12.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: 8467ba23bd9a15f5d6c692298e3525452007fbf4e505f776d57075f5d753e419
4
- data.tar.gz: 333641b7ec8b66168f1debebf1cd78a50d7805b6400397ad1d93171094b1f326
3
+ metadata.gz: 0d25cb073f436c9dd92ecc738e8279216a84088e61d9452a4f7c81c9889e3138
4
+ data.tar.gz: 2d7db7153e6227ac47e93952ae44600fc0d7f1187127f96521bc4cdcbcd7b7a2
5
5
  SHA512:
6
- metadata.gz: 5e1c13af8621423fa025523ed9981ab6932ec61f9e3f76af60fba0e32c967df4a5c4112aeff9718d3033c9df140b9fa3c30c986b80cf0b1c194da0254d39473c
7
- data.tar.gz: f9867cced6f822a9cf8da1b3c86ae03952d4dd523015af67bd1b1ad45ab17d2e8a014b8c2fbe3e560e1fc81ce9a663075ed91c4aa6305e3e6956e207d161930a
6
+ metadata.gz: 59aee4af11f92713f68e2a114af9db4be1cb684fd2d06660463a57c3bf9762dccfffad527c441abfe4cf8ac6a607f010676765b1d01b2792c955216a62b23f12
7
+ data.tar.gz: 903bc3b83d1c664cd9b198e0a1985ad0e9727bb8fb50502e74faa265c7dbce3dd103e3fbc35e92a4af4617437dbcd2c70abf4dc8a6ff1248606e73a5388e70e9
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.10.0)
4
+ dor-services-client (15.12.0)
5
5
  activesupport (>= 7.0.0)
6
- cocina-models (~> 0.103.2)
6
+ cocina-models (~> 0.104.0)
7
7
  deprecation
8
8
  faraday (~> 2.0)
9
9
  faraday-retry
@@ -31,9 +31,9 @@ GEM
31
31
  attr_extras (7.1.0)
32
32
  base64 (0.3.0)
33
33
  benchmark (0.4.1)
34
- bigdecimal (3.2.1)
34
+ bigdecimal (3.2.2)
35
35
  byebug (12.0.0)
36
- cocina-models (0.103.2)
36
+ cocina-models (0.104.0)
37
37
  activesupport
38
38
  deprecation
39
39
  dry-struct (~> 1.0)
@@ -72,7 +72,7 @@ GEM
72
72
  dry-types (~> 1.8, >= 1.8.2)
73
73
  ice_nine (~> 0.11)
74
74
  zeitwerk (~> 2.6)
75
- dry-types (1.8.2)
75
+ dry-types (1.8.3)
76
76
  bigdecimal (~> 3.0)
77
77
  concurrent-ruby (~> 1.0)
78
78
  dry-core (~> 1.0)
@@ -87,9 +87,9 @@ GEM
87
87
  faraday-net_http (>= 2.0, < 3.5)
88
88
  json
89
89
  logger
90
- faraday-net_http (3.4.0)
90
+ faraday-net_http (3.4.1)
91
91
  net-http (>= 0.5.0)
92
- faraday-retry (2.3.1)
92
+ faraday-retry (2.3.2)
93
93
  faraday (~> 2.0)
94
94
  hashdiff (1.2.0)
95
95
  i18n (1.14.7)
@@ -139,7 +139,7 @@ GEM
139
139
  diff-lcs (>= 1.2.0, < 2.0)
140
140
  rspec-support (~> 3.13.0)
141
141
  rspec-support (3.13.4)
142
- rubocop (1.75.8)
142
+ rubocop (1.77.0)
143
143
  json (~> 2.3)
144
144
  language_server-protocol (~> 3.17.0.2)
145
145
  lint_roller (~> 1.1.0)
@@ -147,10 +147,10 @@ GEM
147
147
  parser (>= 3.3.0.2)
148
148
  rainbow (>= 2.2.2, < 4.0)
149
149
  regexp_parser (>= 2.9.3, < 3.0)
150
- rubocop-ast (>= 1.44.0, < 2.0)
150
+ rubocop-ast (>= 1.45.1, < 2.0)
151
151
  ruby-progressbar (~> 1.7)
152
152
  unicode-display_width (>= 2.4.0, < 4.0)
153
- rubocop-ast (1.44.1)
153
+ rubocop-ast (1.45.1)
154
154
  parser (>= 3.3.7.2)
155
155
  prism (~> 1.4)
156
156
  rubocop-rspec (3.6.0)
@@ -164,7 +164,7 @@ GEM
164
164
  simplecov_json_formatter (~> 0.1)
165
165
  simplecov-html (0.13.1)
166
166
  simplecov_json_formatter (0.1.4)
167
- super_diff (0.15.0)
167
+ super_diff (0.16.0)
168
168
  attr_extras (>= 6.2.4)
169
169
  diff-lcs
170
170
  patience_diff
data/README.md CHANGED
@@ -60,7 +60,7 @@ objects_client = Dor::Services::Client.objects
60
60
 
61
61
  # Register a non-existent object
62
62
  objects_client.register(params: {})
63
- objects_client.register(params: {}, assign_doi: true)
63
+ objects_client.register(params: {}, assign_doi: true, user_name: 'dude')
64
64
 
65
65
  # Find object by source ID
66
66
  objects_client.find(source_id: 'sul:abc123')
@@ -84,7 +84,7 @@ background_jobs_client.show(job_id: 123)
84
84
  object_client = Dor::Services::Client.object(object_identifier)
85
85
 
86
86
  # Update an object
87
- object_client.update(params: dro)
87
+ object_client.update(params: dro, user_name: 'dude', description: 'things change sometimes')
88
88
 
89
89
  # Publish an object (push to PURL)
90
90
  object_client.publish(workflow: 'releaseWF', lane_id: 'low')
@@ -154,6 +154,9 @@ object_client.reindex
154
154
 
155
155
  # Search for administrative tags:
156
156
  Dor::Services::Client.administrative_tags.search(q: 'Project')
157
+
158
+ # Get a list of workflow templates
159
+ Dor::Services::Client.workflows.templates
157
160
  ```
158
161
 
159
162
  ## Asynchronous results
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 3.0', '< 4'
26
26
 
27
27
  spec.add_dependency 'activesupport', '>= 7.0.0'
28
- spec.add_dependency 'cocina-models', '~> 0.103.2'
28
+ spec.add_dependency 'cocina-models', '~> 0.104.0'
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '~> 2.0'
31
31
  spec.add_dependency 'faraday-retry'
@@ -29,7 +29,7 @@ module Dor
29
29
  # @param [Cocina::Models::DROWithMetadata|CollectionWithMetadata|AdminPolicyWithMetadata|DRO|Collection|AdminPolicy] params model object
30
30
  # @param [boolean] skip_lock do not provide ETag
31
31
  # @param [boolean] validate validate the response object
32
- # @param [string] who the sunetid of the user performing the update
32
+ # @param [string] user_name the sunetid of the user performing the update
33
33
  # @param [string] description a description of the update
34
34
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
35
35
  # @raise [UnexpectedResponse] when the response is not successful.
@@ -37,7 +37,7 @@ module Dor
37
37
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
38
38
  # rubocop:disable Metrics/AbcSize
39
39
  # rubocop:disable Metrics/MethodLength
40
- def update(params:, skip_lock: false, validate: false, who: nil, description: nil)
40
+ def update(params:, skip_lock: false, validate: false, user_name: nil, description: nil)
41
41
  raise ArgumentError, 'Cocina object not provided.' unless params.respond_to?(:externalIdentifier)
42
42
 
43
43
  # Raised if Cocina::Models::*WithMetadata not provided.
@@ -45,7 +45,7 @@ module Dor
45
45
 
46
46
  resp = connection.patch do |req|
47
47
  req.url object_path
48
- req.params = { event_description: description, event_who: who }.compact
48
+ req.params = { event_description: description, user_name: user_name }.compact
49
49
  req.headers['Content-Type'] = 'application/json'
50
50
  # asking the service to return JSON (else it'll be plain text)
51
51
  req.headers['Accept'] = 'application/json'
@@ -80,10 +80,9 @@ module Dor
80
80
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
81
81
  # @raise [UnexpectedResponse] if the request is unsuccessful.
82
82
  def destroy(user_name: nil)
83
- path = object_path
84
- path += "?user_name=#{user_name}" if user_name
85
83
  resp = connection.delete do |req|
86
- req.url path
84
+ req.url object_path
85
+ req.params = { user_name: user_name }.compact
87
86
  end
88
87
  raise_exception_based_on_response!(resp, object_identifier) unless resp.success?
89
88
 
@@ -10,13 +10,13 @@ module Dor
10
10
  # Creates a new object in DOR
11
11
  # @param params [Cocina::Models::RequestDRO,Cocina::Models::RequestCollection,Cocina::Models::RequestAdminPolicy]
12
12
  # @param [boolean] assign a doi to the object
13
- # @param [string] who the sunetid of the user registering the object
13
+ # @param [string] user_name the sunetid of the user registering the object
14
14
  # @param [boolean] validate validate the response object
15
15
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
16
- def register(params:, assign_doi: false, validate: false, who: nil)
16
+ def register(params:, assign_doi: false, validate: false, user_name: nil)
17
17
  resp = connection.post do |req|
18
18
  req.url objects_path
19
- req.params = { assign_doi: assign_doi, event_who: who }.compact
19
+ req.params = { assign_doi: assign_doi, user_name: user_name }.compact
20
20
  req.headers['Content-Type'] = 'application/json'
21
21
  # asking the service to return JSON (else it'll be plain text)
22
22
  req.headers['Accept'] = 'application/json'
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '15.10.0'
6
+ VERSION = '15.12.0'
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dor
4
+ module Services
5
+ class Client
6
+ # API calls around workflows in DOR
7
+ class Workflows < VersionedService
8
+ # Retrieves a list of workflow template name
9
+ # @return [Array<String>] the list of templates
10
+ def templates
11
+ resp = connection.post do |req|
12
+ req.url "#{api_version}/workflow_templates"
13
+ req.headers['Content-Type'] = 'application/json'
14
+ req.headers['Accept'] = 'application/json'
15
+ end
16
+ raise_exception_based_on_response!(resp) unless resp.success?
17
+
18
+ JSON.parse(resp.body)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -116,6 +116,11 @@ module Dor
116
116
  @background_job_results ||= BackgroundJobResults.new(connection: connection, version: DEFAULT_VERSION)
117
117
  end
118
118
 
119
+ # @return [Dor::Services::Client::Workflows] an instance of the `Client::Workflows` class
120
+ def workflows
121
+ @workflows ||= Workflows.new(connection: connection, version: DEFAULT_VERSION)
122
+ end
123
+
119
124
  class << self
120
125
  # @param [String] url the base url of the endpoint the client should connect to (required)
121
126
  # @param [String] token a bearer token for HTTP authentication (required)
@@ -133,7 +138,7 @@ module Dor
133
138
  self
134
139
  end
135
140
 
136
- delegate :background_job_results, :objects, :object, :virtual_objects, :administrative_tags, to: :instance
141
+ delegate :background_job_results, :objects, :object, :virtual_objects, :administrative_tags, :workflows, to: :instance
137
142
  end
138
143
 
139
144
  attr_writer :url, :token, :connection, :enable_get_retries, :logger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.10.0
4
+ version: 15.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  - Michael Giarlo
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-05 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.103.2
33
+ version: 0.104.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.103.2
40
+ version: 0.104.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: deprecation
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +248,7 @@ files:
248
248
  - lib/dor/services/client/version.rb
249
249
  - lib/dor/services/client/versioned_service.rb
250
250
  - lib/dor/services/client/virtual_objects.rb
251
+ - lib/dor/services/client/workflows.rb
251
252
  - lib/dor/services/client/workspace.rb
252
253
  homepage: https://github.com/sul-dlss/dor-services-client
253
254
  licenses: []
@@ -270,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
271
  - !ruby/object:Gem::Version
271
272
  version: '0'
272
273
  requirements: []
273
- rubygems_version: 3.6.3
274
+ rubygems_version: 3.6.2
274
275
  specification_version: 4
275
276
  summary: A client for dor-services-app
276
277
  test_files: []