dor-services-client 7.9.0 → 7.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +3 -5
- data/README.md +2 -2
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/metadata.rb +14 -0
- data/lib/dor/services/client/mutate.rb +2 -2
- data/lib/dor/services/client/object.rb +7 -1
- data/lib/dor/services/client/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8259e7beb65f6bb70043b122e130ddd7f421eee38c56f179f9ab7e7a22cff65
|
4
|
+
data.tar.gz: 57d53cd3564325c8597c62d4d095a20c67ae3f1bff8f01789e0b80878326377d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd5a6f5b690198a5c8ce8794ab87a94ddeb44bc26b880dc3895d4bfd38022de024d93480bbb43983011f137f2b03fe21af013d0b864f766925fb92c9ae369052
|
7
|
+
data.tar.gz: f481f132d39a36be9e01998da7c1b862038ee04f45c51aaea90aabdc553efdd857ef71dec5f32e4d7b52eb55b6e4b7199c38a77c363dfc36b3867250abd6f4a0
|
@@ -1,12 +1,10 @@
|
|
1
|
-
## Why was this change made?
|
1
|
+
## Why was this change made? 🤔
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
## How was this change tested?
|
5
|
+
## How was this change tested? 🤨
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
## Which documentation and/or configurations were updated?
|
7
|
+
⚡ ⚠ If this change has cross service impact, ***run [integration tests](https://github.com/sul-dlss/infrastructure-integration-test)*** and/or test in [stage|qa] environment, in addition to specs. ⚡
|
10
8
|
|
11
9
|
|
12
10
|
|
data/README.md
CHANGED
@@ -67,7 +67,7 @@ objects_client.register(params: {}, assign_doi: true)
|
|
67
67
|
virtual_objects_client = Dor::Services::Client.virtual_objects
|
68
68
|
|
69
69
|
# Create a batch of virtual objects
|
70
|
-
virtual_objects_client.create(virtual_objects: [{
|
70
|
+
virtual_objects_client.create(virtual_objects: [{ virtual_object_id: '', constituent_ids: [''] }])
|
71
71
|
|
72
72
|
# Retrieve background job results
|
73
73
|
background_jobs_client = Dor::Services::Client.background_job_results
|
@@ -112,7 +112,7 @@ object_client.preserve(lane_id: 'low')
|
|
112
112
|
object_client.update_marc_record
|
113
113
|
|
114
114
|
# Copy metadata from Symphony into descMetadata
|
115
|
-
object_client.
|
115
|
+
object_client.refresh_descriptive_metadata_from_ils
|
116
116
|
|
117
117
|
# Apply defaults from the item's AdminPolicy to the item itself
|
118
118
|
object_client.apply_admin_policy_defaults
|
data/dor-services-client.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 4.2', '< 8'
|
28
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
28
|
+
spec.add_dependency 'cocina-models', '~> 0.66.0' # leave pinned to patch level until cocina-models hits 1.0
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
30
30
|
spec.add_dependency 'faraday', '>= 0.15', '< 2'
|
31
31
|
spec.add_dependency 'zeitwerk', '~> 2.1'
|
@@ -87,6 +87,20 @@ module Dor
|
|
87
87
|
raise_exception_based_on_response!(resp, object_identifier)
|
88
88
|
end
|
89
89
|
|
90
|
+
# Update the MODS XML metadata
|
91
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
92
|
+
# @return [boolean] true on success
|
93
|
+
def update_mods(mods_xml)
|
94
|
+
resp = connection.put do |req|
|
95
|
+
req.url "#{base_path}/mods"
|
96
|
+
req.headers['Content-Type'] = 'application/xml'
|
97
|
+
req.body = mods_xml
|
98
|
+
end
|
99
|
+
return if resp.success?
|
100
|
+
|
101
|
+
raise_exception_based_on_response!(resp, object_identifier)
|
102
|
+
end
|
103
|
+
|
90
104
|
# rubocop:disable Lint/StructNewOverride
|
91
105
|
Datastream = Struct.new(:label, :dsid, :pid, :size, :mimeType, :versionId, keyword_init: true)
|
92
106
|
# rubocop:enable Lint/StructNewOverride
|
@@ -26,7 +26,7 @@ module Dor
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# Updates the object
|
29
|
-
# @param [Cocina::Models::
|
29
|
+
# @param [Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy] params model object
|
30
30
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
31
31
|
# @raise [UnexpectedResponse] when the response is not successful.
|
32
32
|
# @return [Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy] the returned model
|
@@ -48,7 +48,7 @@ module Dor
|
|
48
48
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
49
49
|
# @raise [UnexpectedResponse] when the response is not successful.
|
50
50
|
# @return [boolean] true on success
|
51
|
-
def
|
51
|
+
def refresh_descriptive_metadata_from_ils
|
52
52
|
resp = connection.post do |req|
|
53
53
|
req.url "#{object_path}/refresh_metadata"
|
54
54
|
end
|
@@ -1,10 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'deprecation'
|
4
|
+
|
3
5
|
module Dor
|
4
6
|
module Services
|
5
7
|
class Client
|
6
8
|
# API calls that are about a repository object
|
7
9
|
class Object < VersionedService
|
10
|
+
extend Deprecation
|
8
11
|
attr_reader :object_identifier
|
9
12
|
|
10
13
|
# @param object_identifier [String] the pid for the object
|
@@ -89,7 +92,10 @@ module Dor
|
|
89
92
|
Mutate.new(**parent_params)
|
90
93
|
end
|
91
94
|
|
92
|
-
delegate :
|
95
|
+
delegate :refresh_descriptive_metadata_from_ils, :update, :destroy, :apply_admin_policy_defaults, to: :mutate
|
96
|
+
|
97
|
+
alias refresh_metadata refresh_descriptive_metadata_from_ils
|
98
|
+
deprecation_deprecate refresh_metadata: 'Use refresh_descriptive_metadata_from_ils instead'
|
93
99
|
|
94
100
|
# Update the marc record for the given object
|
95
101
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
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: 7.
|
4
|
+
version: 7.12.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: 2022-
|
12
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.66.0
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.66.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: deprecation
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
- !ruby/object:Gem::Version
|
273
273
|
version: '0'
|
274
274
|
requirements: []
|
275
|
-
rubygems_version: 3.
|
275
|
+
rubygems_version: 3.1.4
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: A client for dor-services-app
|