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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07df0c2ce071a596c4825052e94a429cda7666fcd1d68e0c12c1476f27843123
4
- data.tar.gz: 627aa21d6fe0c5b9599682f4bd182f92a3d56266e488c48a1d23f4f140aaac75
3
+ metadata.gz: f8259e7beb65f6bb70043b122e130ddd7f421eee38c56f179f9ab7e7a22cff65
4
+ data.tar.gz: 57d53cd3564325c8597c62d4d095a20c67ae3f1bff8f01789e0b80878326377d
5
5
  SHA512:
6
- metadata.gz: a18c81fce2987d56bb558d5ee0ddb74c561ea873e305aa5ce0982b91575c190b5cbb04aaf1dd1f1a2af9f7ff63878040ad7d8e5f535fde5610bbd3ba8b9d02b1
7
- data.tar.gz: 252fc0275a91bf1c254936a1b09ca9b49b10d3c1120b3d7d1b2771efd8398aec4ede5fa3d71de6f2c2c384ba3cd21e7b3fffd696e561de34eb37e4c153d6e690
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: [{ parent_id: '', child_ids: [''] }])
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.refresh_metadata
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
@@ -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.64.0' # leave pinned to patch level until cocina-models hits 1.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::RequestDRO,Cocina::Models::RequestCollection,Cocina::Models::RequestAPO] params model object
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 refresh_metadata
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 :refresh_metadata, :update, :destroy, :apply_admin_policy_defaults, to: :mutate
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)
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '7.9.0'
6
+ VERSION = '7.12.0'
7
7
  end
8
8
  end
9
9
  end
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.9.0
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-01-31 00:00:00.000000000 Z
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.64.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.64.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.2.32
275
+ rubygems_version: 3.1.4
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: A client for dor-services-app