dor-services-client 15.9.0 → 15.10.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: '0871dd95e3361050b2d3169851071fc136a0b407c90c1efaeb1f37069521f909'
4
- data.tar.gz: cf37ad51860c4f972ba9286f8cec0f15e835a01ad71f79721fc0699c9834f80f
3
+ metadata.gz: 8467ba23bd9a15f5d6c692298e3525452007fbf4e505f776d57075f5d753e419
4
+ data.tar.gz: 333641b7ec8b66168f1debebf1cd78a50d7805b6400397ad1d93171094b1f326
5
5
  SHA512:
6
- metadata.gz: 9a88faf6248beec20bb619926632dbbba797c87e462e79f3a51d821d277b22aa2db8446f87ed058761e5f3c252b66220f60b43bc49020e45d84ac2902a743c0e
7
- data.tar.gz: 360fe1eb1986c6ae0180f4d7382294d052d030cf8b6ed13b0299abf3acb8b85d5e980fd5f231a367b23e467ed35a9552e5ccac3ad86e5364959663b71b3427bb
6
+ metadata.gz: 5e1c13af8621423fa025523ed9981ab6932ec61f9e3f76af60fba0e32c967df4a5c4112aeff9718d3033c9df140b9fa3c30c986b80cf0b1c194da0254d39473c
7
+ data.tar.gz: f9867cced6f822a9cf8da1b3c86ae03952d4dd523015af67bd1b1ad45ab17d2e8a014b8c2fbe3e560e1fc81ce9a663075ed91c4aa6305e3e6956e207d161930a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-services-client (15.9.0)
4
+ dor-services-client (15.10.0)
5
5
  activesupport (>= 7.0.0)
6
6
  cocina-models (~> 0.103.2)
7
7
  deprecation
@@ -25,7 +25,8 @@ module Dor
25
25
  def start(params = {})
26
26
  body = params[:context] ? { 'context' => params[:context] }.to_json : ''
27
27
  resp = connection.post do |req|
28
- req.url with_querystring(url: path, params: params.except(:context))
28
+ req.url path
29
+ req.params = params.except(:context)
29
30
  req.headers['Content-Type'] = 'application/json'
30
31
  req.body = body
31
32
  end
@@ -35,7 +35,7 @@ module Dor
35
35
  # @raise [UnexpectedResponse] on an unsuccessful response from the server
36
36
  def list(event_types: nil)
37
37
  resp = connection.get("#{api_version}/objects/#{object_identifier}/events",
38
- { 'event_types[]': event_types }.compact)
38
+ { event_types: event_types }.compact)
39
39
  return response_to_models(resp) if resp.success?
40
40
  return if resp.status == 404
41
41
 
@@ -29,14 +29,15 @@ 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 [Hash] event_data additional event data to be added to the update object event
32
+ # @param [string] who the sunetid of the user performing the update
33
+ # @param [string] description a description of the update
33
34
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
34
35
  # @raise [UnexpectedResponse] when the response is not successful.
35
36
  # @raise [BadRequestError] when ETag not provided.
36
37
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
37
38
  # rubocop:disable Metrics/AbcSize
38
39
  # rubocop:disable Metrics/MethodLength
39
- def update(params:, skip_lock: false, validate: false, event_data: {})
40
+ def update(params:, skip_lock: false, validate: false, who: nil, description: nil)
40
41
  raise ArgumentError, 'Cocina object not provided.' unless params.respond_to?(:externalIdentifier)
41
42
 
42
43
  # Raised if Cocina::Models::*WithMetadata not provided.
@@ -44,7 +45,7 @@ module Dor
44
45
 
45
46
  resp = connection.patch do |req|
46
47
  req.url object_path
47
- req.params = { event_data: event_data.to_json }
48
+ req.params = { event_description: description, event_who: who }.compact
48
49
  req.headers['Content-Type'] = 'application/json'
49
50
  # asking the service to return JSON (else it'll be plain text)
50
51
  req.headers['Accept'] = 'application/json'
@@ -86,7 +86,8 @@ module Dor
86
86
  # @return [Cocina::Models::DROWithMetadata|CollectionWithMetadata|AdminPolicyWithMetadata] cocina model with updated version
87
87
  def open(**params)
88
88
  resp = connection.post do |req|
89
- req.url with_querystring(url: open_new_version_path, params: params)
89
+ req.url open_new_version_path
90
+ req.params = params
90
91
  req.headers['Content-Type'] = 'application/json'
91
92
  end
92
93
 
@@ -105,7 +106,8 @@ module Dor
105
106
  # @return [String] a message confirming successful closing
106
107
  def close(**params)
107
108
  resp = connection.post do |req|
108
- req.url with_querystring(url: close_version_path, params: params)
109
+ req.url close_version_path
110
+ req.params = params
109
111
  req.headers['Content-Type'] = 'application/json'
110
112
  end
111
113
  return resp.body if resp.success?
@@ -9,12 +9,14 @@ module Dor
9
9
  class Objects < VersionedService
10
10
  # Creates a new object in DOR
11
11
  # @param params [Cocina::Models::RequestDRO,Cocina::Models::RequestCollection,Cocina::Models::RequestAdminPolicy]
12
- # @param assign_doi [Boolean]
12
+ # @param [boolean] assign a doi to the object
13
+ # @param [string] who the sunetid of the user registering the object
13
14
  # @param [boolean] validate validate the response object
14
15
  # @return [Cocina::Models::DROWithMetadata,Cocina::Models::CollectionWithMetadata,Cocina::Models::AdminPolicyWithMetadata] the returned model
15
- def register(params:, assign_doi: false, validate: false)
16
+ def register(params:, assign_doi: false, validate: false, who: nil)
16
17
  resp = connection.post do |req|
17
- req.url with_querystring(url: objects_path, params: { assign_doi: assign_doi })
18
+ req.url objects_path
19
+ req.params = { assign_doi: assign_doi, event_who: who }.compact
18
20
  req.headers['Content-Type'] = 'application/json'
19
21
  # asking the service to return JSON (else it'll be plain text)
20
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.9.0'
6
+ VERSION = '15.10.0'
7
7
  end
8
8
  end
9
9
  end
@@ -25,12 +25,6 @@ module Dor
25
25
  AsyncResult.new(url: url)
26
26
  end
27
27
 
28
- def with_querystring(url:, params:)
29
- return url if params.blank?
30
-
31
- "#{url}?#{params.to_query}"
32
- end
33
-
34
28
  private
35
29
 
36
30
  attr_reader :connection, :api_version
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.9.0
4
+ version: 15.10.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-03 00:00:00.000000000 Z
11
+ date: 2025-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport