sdr-client 0.67.0 → 0.69.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: a6f0cbe88719cea674e5568bc60da33b77819904cc062995161c5eb6443a4f07
4
- data.tar.gz: d4dc7e51ac117cc54e0c9d988f0d482c836d090bad2c5c46c4941150eb845478
3
+ metadata.gz: 7612a41d64ee04bd9fca5cb7c354f5e80aefa7e31b823482f74159c66147ed09
4
+ data.tar.gz: e2658b4e3c02989b6256e26bd5c2d80036ac653b2bf2ad7cb203f370205351bb
5
5
  SHA512:
6
- metadata.gz: cb349532c8a777f077e2f8bf22430b0777938447f60862a273e10b5cb09430ef6dabaa17b2c5f46a792ac8ea5a3671ec0d977c3c4e8dab0820181d9b9f3245d6
7
- data.tar.gz: e846f06d0202c1272e4d82e2622bd02d8fee61f2df40d7c5d5477bd0f373e92fc2828053bede2b391b558bb00b1941cb5ebd55cfdbaa18256facb130d099a4c2
6
+ metadata.gz: 6c317cb59a717ec584859be96d02c15398938cc15c54b7b6484adf30c8209954a0e8dd72201e1d53eacab9504f46df6f1b843eac4c076d7392da0944017b917a
7
+ data.tar.gz: 8affcce27dfc1105d4c89852d5cec2a4c1326d5453d4f83b8a52fe2e94257608a3e520e0ec4df7479d83eeb40e5bb2e75b8369294038fd6af49f1fa5786aa93d
@@ -1,12 +1,9 @@
1
- ## Why was this change made?
1
+ ## Why was this change made? 🤔
2
2
 
3
3
 
4
4
 
5
- ## How was this change tested?
6
-
7
-
8
-
9
- ## Which documentation and/or configurations were updated?
5
+ ## How was this change tested? 🤨
10
6
 
7
+ ⚡ ⚠ If this change has cross service impact, ***run [integration tests](https://github.com/sul-dlss/infrastructure-integration-test) that use sdr-api*** (e.g.create_object_h2_spec.rb) and/or test in [stage|qa] environment, in addition to specs. ⚡
11
8
 
12
9
 
@@ -10,6 +10,7 @@ module SdrClient
10
10
  # @param [Class] grouping_strategy class whose run method groups an array of uploads
11
11
  # Additional metadata includes access, preserve, shelve, publish, md5, sha1
12
12
  # @param [Logger] logger the logger to use
13
+ # @param [Class] file_set_type_strategy class whose run method determines file_set type
13
14
  def initialize(metadata:, grouping_strategy:, logger:, file_set_type_strategy: FileTypeFileSetStrategy)
14
15
  @metadata = metadata
15
16
  @logger = logger
@@ -10,6 +10,7 @@ module SdrClient
10
10
  # @param [String] connection the server connection to use
11
11
  # @param [Boolean] accession should the accessionWF be started
12
12
  # @param [Class] grouping_strategy class whose run method groups an array of uploads
13
+ # @param [Class] file_set_type_strategy class whose run method determines file_set type
13
14
  # @param [Array<String>] files a list of file names to upload
14
15
  # @param [Boolean] assign_doi should a DOI be assigned to this item
15
16
  # @param [Logger] logger the logger to use
@@ -19,6 +20,7 @@ module SdrClient
19
20
  connection:,
20
21
  accession:,
21
22
  grouping_strategy: SingleFileGroupingStrategy,
23
+ file_set_type_strategy: FileTypeFileSetStrategy,
22
24
  files: [],
23
25
  assign_doi: false,
24
26
  logger: Logger.new($stdout))
@@ -27,6 +29,7 @@ module SdrClient
27
29
  @metadata = metadata
28
30
  @logger = logger
29
31
  @grouping_strategy = grouping_strategy
32
+ @file_set_type_strategy = file_set_type_strategy
30
33
  @accession = accession
31
34
  @assign_doi = assign_doi
32
35
  end
@@ -43,6 +46,7 @@ module SdrClient
43
46
  connection: connection)
44
47
  metadata_builder = MetadataBuilder.new(metadata: metadata,
45
48
  grouping_strategy: grouping_strategy,
49
+ file_set_type_strategy: file_set_type_strategy,
46
50
  logger: logger)
47
51
  request = metadata_builder.with_uploads(upload_responses)
48
52
  model = Cocina::Models.build_request(request.as_json.with_indifferent_access)
@@ -56,7 +60,7 @@ module SdrClient
56
60
 
57
61
  private
58
62
 
59
- attr_reader :metadata, :files, :connection, :logger, :grouping_strategy
63
+ attr_reader :metadata, :files, :connection, :logger, :grouping_strategy, :file_set_type_strategy
60
64
 
61
65
  def check_files_exist
62
66
  logger.info('checking to see if files exist')
@@ -28,6 +28,7 @@ module SdrClient
28
28
  files_metadata: {},
29
29
  accession: false,
30
30
  grouping_strategy: SingleFileGroupingStrategy,
31
+ file_set_type_strategy: FileTypeFileSetStrategy,
31
32
  logger: Logger.new($stdout))
32
33
  augmented_metadata = FileMetadataBuilder.build(files: files, files_metadata: files_metadata)
33
34
  metadata = Request.new(label: label,
@@ -48,6 +49,7 @@ module SdrClient
48
49
  connection = Connection.new(url: url)
49
50
  Process.new(metadata: metadata, connection: connection, files: files,
50
51
  grouping_strategy: grouping_strategy,
52
+ file_set_type_strategy: file_set_type_strategy,
51
53
  accession: accession,
52
54
  logger: logger).run
53
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '0.67.0'
4
+ VERSION = '0.69.0'
5
5
  end
data/sdr-client.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'activesupport'
31
- spec.add_dependency 'cocina-models', '~> 0.65.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.67.0'
32
32
  spec.add_dependency 'dry-monads'
33
33
  spec.add_dependency 'faraday', '>= 0.16'
34
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.67.0
4
+ version: 0.69.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-03-03 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.65.0
33
+ version: 0.67.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.65.0
40
+ version: 0.67.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-monads
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.3.4
259
+ rubygems_version: 3.2.32
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: The CLI for https://github.com/sul-dlss/sdr-api