dor-services-client 15.10.0 → 15.11.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/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/dor/services/client/mutate.rb +5 -6
- data/lib/dor/services/client/objects.rb +3 -3
- data/lib/dor/services/client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18ff6ef4f51e40372f52681a6bbe257c347ab020e3512dd8d64b8b760c757a3b
|
4
|
+
data.tar.gz: 76eb8acbc819956390a0b60b20d88ffd62fdf698430d4b9c469daaea0b2160c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5639ed16ce0185cc344ae98459593e91bf2286223500a182242e51820041021f8ac8b2685935a0213d842084e9a955b7bc482c03e639b6568768c3f128dc318
|
7
|
+
data.tar.gz: 14256c492c36a3c03975a00393325541e6a65896ee49ef2e0bfba40f283dd1e3bc56c36cd0f398b6a3851552d875f4e7edf5d5f916389fe6ccbf06c75d1915c1
|
data/Gemfile.lock
CHANGED
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')
|
@@ -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]
|
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,
|
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,
|
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
|
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]
|
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,
|
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,
|
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'
|