sdr-client 2.43.1 → 2.45.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: a93b6ba3f6917c0f2f4a13635efbaa3391187a5a4f73100e15c9759f149bc6ce
4
- data.tar.gz: 7f6a69bb2bed1ab1338a9030634d51774976d73ac21b1c537b79c824bffae9a5
3
+ metadata.gz: daa895538c17c2a5072e9c946345352099013f6ddc9547d85cd9cbfebfbe6cd2
4
+ data.tar.gz: 1782031e875ead56c43837c43a15b656af21e8e53c24b1f1819d59fec1057f87
5
5
  SHA512:
6
- metadata.gz: c440483c7f0e7c82e7d73944ce58c22c58314883d2fe2ee5b5416d17624b6aa3d78cfd60ecb721a7571da503301c5f253154eac5325b322e6be7558c9bcc629e
7
- data.tar.gz: 8e7b45473689a9f1678f7b525eb54ec8b9bb2444983cdcc6ae48ba08f441e645e0b0ce763db1635c6e36e68ab6ad521ef882458fd44574af0c8bf6827354378e
6
+ metadata.gz: c62d5cec6673a800e83bdca56577e2ce35dba54a519ae08269e158c44716cd569522139114a9a75b00ef7da07b3f9ea89d6b703255c2d205a559bf9e9e1c21d1
7
+ data.tar.gz: 2fb1bcb62c8a3ece751ca719e1c927aca5d1c381fb0e292aca9cc5a917189ed58e6e63b3d1192a84a5d43bcf1303a269265f3d3ef517f31dfb2780198e2a4027
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sdr-client (2.43.1)
4
+ sdr-client (2.45.0)
5
5
  activesupport
6
- cocina-models (~> 0.126.0)
6
+ cocina-models (~> 0.128.0)
7
7
  config
8
8
  dry-monads
9
9
  faraday (>= 0.16)
@@ -36,7 +36,7 @@ GEM
36
36
  reline (>= 0.6.0)
37
37
  childprocess (5.1.0)
38
38
  logger (~> 1.5)
39
- cocina-models (0.126.0)
39
+ cocina-models (0.128.0)
40
40
  activesupport
41
41
  cocina_display
42
42
  deprecation
@@ -117,11 +117,11 @@ GEM
117
117
  iso8601 (0.13.0)
118
118
  janeway-jsonpath (1.0.0)
119
119
  json (2.20.0)
120
- jsonschema_rs (0.46.6-arm64-darwin)
120
+ jsonschema_rs (0.46.10-arm64-darwin)
121
121
  bigdecimal (>= 3.1, < 5)
122
- jsonschema_rs (0.46.6-x86_64-linux)
122
+ jsonschema_rs (0.46.10-x86_64-linux)
123
123
  bigdecimal (>= 3.1, < 5)
124
- language_server-protocol (3.17.0.5)
124
+ language_server-protocol (3.17.0.6)
125
125
  launchy (3.1.1)
126
126
  addressable (~> 2.8)
127
127
  childprocess (~> 5.0)
@@ -169,7 +169,7 @@ GEM
169
169
  rspec-support (3.13.7)
170
170
  rspec_junit_formatter (0.6.0)
171
171
  rspec-core (>= 2, < 4, != 2.12.0)
172
- rubocop (1.88.0)
172
+ rubocop (1.88.1)
173
173
  json (~> 2.3)
174
174
  language_server-protocol (~> 3.17.0.2)
175
175
  lint_roller (~> 1.1.0)
@@ -180,7 +180,7 @@ GEM
180
180
  rubocop-ast (>= 1.49.0, < 2.0)
181
181
  ruby-progressbar (~> 1.7)
182
182
  unicode-display_width (>= 2.4.0, < 4.0)
183
- rubocop-ast (1.49.1)
183
+ rubocop-ast (1.50.0)
184
184
  parser (>= 3.3.7.2)
185
185
  prism (~> 1.7)
186
186
  rubocop-rake (0.7.1)
data/README.md CHANGED
@@ -45,7 +45,7 @@ sdr version
45
45
  Register a new object:
46
46
  ```
47
47
  sdr register file1.png file2.png --url https://sdr-api-server:3000 \
48
- --label 'hey there' \
48
+ --title 'hey there' \
49
49
  --admin-policy 'druid:bk123gh4567' \
50
50
  --collection 'druid:gh456kw9876' \
51
51
  --source-id 'googlebooks:stanford_12345'
@@ -54,7 +54,7 @@ sdr register file1.png file2.png --url https://sdr-api-server:3000 \
54
54
  Deposit (register + accession) a new object:
55
55
  ```
56
56
  sdr deposit file1.png file2.png --url https://sdr-api-server:3000 \
57
- --label 'hey there' \
57
+ --title 'hey there' \
58
58
  --admin-policy 'druid:bk123gh4567' \
59
59
  --collection 'druid:gh456kw9876' \
60
60
  --source-id 'googlebooks:stanford_12345'
@@ -63,7 +63,7 @@ sdr deposit file1.png file2.png --url https://sdr-api-server:3000 \
63
63
  Deposit a new object, providing metadata for files:
64
64
  ```
65
65
  sdr deposit image42.jp2 ocr.html --url https://sdr-api-server:3000 \
66
- --label 'hey there' \
66
+ --title 'hey there' \
67
67
  --files-metadata '{"image42.jp2":{"mime_type":"image/jp2"},"ocr.html":{"use":"transcription"}}'
68
68
  --admin-policy 'druid:bk123gh4567' \
69
69
  --collection 'druid:gh456kw9876' \
@@ -73,7 +73,7 @@ sdr deposit image42.jp2 ocr.html --url https://sdr-api-server:3000 \
73
73
  View the object:
74
74
  ```
75
75
  sdr get druid:bw581ng3176 --url https://sdr-api-server:3000
76
- {"type":"https://cocina.sul.stanford.edu/models/document","externalIdentifier":"druid:bw581ng3176","label":"Something something better title","version":1,"access":{"view":"stanford","copyright":"This work is copyrighted by the creator.","download":"stanford","useAndReproductionStatement":"This document is available only to the Stanford faculty, staff and student community."},"administrative":{"hasAdminPolicy":"druid:zx485kb6348"},"description":{"title":[{"value":"Something something better title"}],"contributor":[{"name":[{"value":"Hodge, Amy"}],"type":"person","role":[{"value":"Author"},{"value":"author","uri":"http://id.loc.gov/vocabulary/relators/aut","source":{"code":"marcrelator","uri":"http://id.loc.gov/vocabulary/relators/"}},{"value":"Creator"}]}],"form":[{"structuredValue":[{"value":"Text","type":"type"},{"value":"Report","type":"subtype"}],"type":"resource type","source":{"value":"Stanford self-deposit resource types"}},{"value":"reports","type":"genre","uri":"http://vocab.getty.edu/aat/300027267","source":{"code":"aat"}},{"value":"text","type":"resource type","source":{"value":"MODS resource types"}}],"note":[{"value":";alkdfjlsadkjf;l","type":"summary"},{"value":"amyhodge@stanford.edu","type":"contact","displayLabel":"Contact"}],"subject":[{"value":"lkfj","type":"topic"},{"value":";kfj","type":"topic"},{"value":"fjwelkb","type":"topic"}]},"identification":{"sourceId":"hydrus:20"},"structural":{"contains":[{"type":"https://cocina.sul.stanford.edu/models/resources/file","externalIdentifier":"bw581ng3176_1","label":"Test file","version":1,"structural":{"contains":[{"type":"https://cocina.sul.stanford.edu/models/file","externalIdentifier":"druid:bw581ng3176/test.txt","label":"test.txt","filename":"test.txt","size":11,"version":1,"hasMimeType":"text/plain","hasMessageDigests":[{"type":"sha1","digest":"5d39343e4bb48abd97f759828282f5ebbac56c5e"},{"type":"md5","digest":"63b8812b0c05722a9d6c51cbd2bfb54b"}],"access":{"view":"world","download":"world"},"administrative":{"sdrPreserve":true,"shelve":true}}]}}]}}
76
+ {"type":"https://cocina.sul.stanford.edu/models/document","externalIdentifier":"druid:bw581ng3176","version":1,"access":{"view":"stanford","copyright":"This work is copyrighted by the creator.","download":"stanford","useAndReproductionStatement":"This document is available only to the Stanford faculty, staff and student community."},"administrative":{"hasAdminPolicy":"druid:zx485kb6348"},"description":{"title":[{"value":"Something something better title"}],"contributor":[{"name":[{"value":"Hodge, Amy"}],"type":"person","role":[{"value":"Author"},{"value":"author","uri":"http://id.loc.gov/vocabulary/relators/aut","source":{"code":"marcrelator","uri":"http://id.loc.gov/vocabulary/relators/"}},{"value":"Creator"}]}],"form":[{"structuredValue":[{"value":"Text","type":"type"},{"value":"Report","type":"subtype"}],"type":"resource type","source":{"value":"Stanford self-deposit resource types"}},{"value":"reports","type":"genre","uri":"http://vocab.getty.edu/aat/300027267","source":{"code":"aat"}},{"value":"text","type":"resource type","source":{"value":"MODS resource types"}}],"note":[{"value":";alkdfjlsadkjf;l","type":"summary"},{"value":"amyhodge@stanford.edu","type":"contact","displayLabel":"Contact"}],"subject":[{"value":"lkfj","type":"topic"},{"value":";kfj","type":"topic"},{"value":"fjwelkb","type":"topic"}]},"identification":{"sourceId":"hydrus:20"},"structural":{"contains":[{"type":"https://cocina.sul.stanford.edu/models/resources/file","externalIdentifier":"bw581ng3176_1","label":"Test file","version":1,"structural":{"contains":[{"type":"https://cocina.sul.stanford.edu/models/file","externalIdentifier":"druid:bw581ng3176/test.txt","label":"test.txt","filename":"test.txt","size":11,"version":1,"hasMimeType":"text/plain","hasMessageDigests":[{"type":"sha1","digest":"5d39343e4bb48abd97f759828282f5ebbac56c5e"},{"type":"md5","digest":"63b8812b0c05722a9d6c51cbd2bfb54b"}],"access":{"view":"world","download":"world"},"administrative":{"sdrPreserve":true,"shelve":true}}]}}]}}
77
77
  ```
78
78
 
79
79
  Update an object:
@@ -74,7 +74,7 @@ module SdrClient
74
74
  option :skip_polling, type: :boolean, default: false, aliases: '-s', desc: 'Print out job ID instead of polling for result'
75
75
  option :apo, required: true, desc: 'Druid identifier of the admin policy object', aliases: '--admin-policy'
76
76
  option :source_id, required: true, desc: 'Source ID for this object'
77
- option :label, desc: 'Object label'
77
+ option :title, desc: 'Object title'
78
78
  option :type, enum: %w[image book document map manuscript media three_dimensional object collection admin_policy], desc: 'The object type'
79
79
  option :collection, desc: 'Druid identifier of the collection object'
80
80
  option :catkey, desc: 'Symphony catkey for this item'
@@ -96,7 +96,7 @@ module SdrClient
96
96
  option :skip_polling, type: :boolean, default: false, aliases: '-s', desc: 'Print out job ID instead of polling for result'
97
97
  option :apo, required: true, desc: 'Druid identifier of the admin policy object', aliases: '--admin-policy'
98
98
  option :source_id, required: true, desc: 'Source ID for this object'
99
- option :label, desc: 'Object label'
99
+ option :title, desc: 'Object title'
100
100
  option :type, enum: %w[image book document map manuscript media three_dimensional object collection admin_policy], desc: 'The object type'
101
101
  option :collection, desc: 'Druid identifier of the collection object'
102
102
  option :catkey, desc: 'Symphony catkey for this item'
@@ -4,7 +4,7 @@ module SdrClient
4
4
  module Deposit
5
5
  # This represents the metadata that we send to the server for doing a deposit
6
6
  class Request
7
- # @param [String] label the required object label
7
+ # @param [String] title the required object title
8
8
  # @param [Time|nil] embargo_release_date when the item should be released from embargo or nil if no embargo
9
9
  # @param [String] embargo_access access after embargo has expired if embargoed
10
10
  # @param [String] type (https://cocina.sul.stanford.edu/models/object) the required object type.
@@ -12,7 +12,7 @@ module SdrClient
12
12
  # @param [Hash<String, Hash<String, String>>] files_metadata file name, hash of additional file metadata
13
13
  # Additional metadata includes access, preserve, shelve, publish, md5, sha1
14
14
  # rubocop:disable Metrics/ParameterLists
15
- def initialize(label: nil,
15
+ def initialize(title:,
16
16
  view: 'dark',
17
17
  download: 'none',
18
18
  location: nil,
@@ -30,7 +30,7 @@ module SdrClient
30
30
  viewing_direction: nil,
31
31
  file_sets: [],
32
32
  files_metadata: {})
33
- @label = label
33
+ @title = title
34
34
  @type = type
35
35
  @source_id = source_id
36
36
  @collection = collection
@@ -59,13 +59,13 @@ module SdrClient
59
59
  identification: identification,
60
60
  structural: structural,
61
61
  version: 1,
62
- label: label.nil? ? ':auto' : label
62
+ description: { title: [{ value: title }] }
63
63
  }
64
64
  end
65
65
 
66
66
  # @return [Request] a clone of this request with the file_sets added
67
67
  def with_file_sets(file_sets)
68
- Request.new(label: label,
68
+ Request.new(title: title,
69
69
  view: view,
70
70
  download: download,
71
71
  location: location,
@@ -99,7 +99,7 @@ module SdrClient
99
99
 
100
100
  private
101
101
 
102
- attr_reader :view, :label, :file_sets, :source_id, :catkey, :folio_instance_hrid, :apo, :collection,
102
+ attr_reader :view, :title, :file_sets, :source_id, :catkey, :folio_instance_hrid, :apo, :collection,
103
103
  :files_metadata, :embargo_release_date, :embargo_access, :embargo_download,
104
104
  :viewing_direction, :use_and_reproduction, :copyright, :download, :location
105
105
 
@@ -10,7 +10,7 @@ module SdrClient
10
10
  # params [String] basepath filepath to which filepaths are relative, defaults to current directory
11
11
  # params [Hash<String,Hash>] file_metadata relative filepath, hash of metadata per-file metadata
12
12
  # @return [String] job id for the background job result
13
- def self.run(label: nil,
13
+ def self.run(title:,
14
14
  type: BOOK_TYPE,
15
15
  viewing_direction: nil,
16
16
  view: 'dark',
@@ -37,7 +37,7 @@ module SdrClient
37
37
  logger: Logger.new($stdout))
38
38
  # augmented_metadata is a map of relative filepaths to file metadata
39
39
  augmented_metadata = FileMetadataBuilder.build(files: files, files_metadata: files_metadata, basepath: basepath)
40
- request = Request.new(label: label,
40
+ request = Request.new(title: title,
41
41
  type: type,
42
42
  view: view,
43
43
  download: download,
@@ -92,7 +92,7 @@ module SdrClient
92
92
  desc: 'Print out job ID instead of polling for result'
93
93
  option :apo, required: true, desc: 'Druid identifier of the admin policy object', aliases: '--admin-policy'
94
94
  option :source_id, required: true, desc: 'Source ID for this object'
95
- option :label, desc: 'Object label'
95
+ option :title, required: true, desc: 'Object title'
96
96
  option :type, enum: %w[image book document map manuscript media three_dimensional object collection admin_policy],
97
97
  desc: 'The object type'
98
98
  option :collection, desc: 'Druid identifier of the collection object'
@@ -116,7 +116,7 @@ module SdrClient
116
116
  desc: 'Print out job ID instead of polling for result'
117
117
  option :apo, required: true, desc: 'Druid identifier of the admin policy object', aliases: '--admin-policy'
118
118
  option :source_id, required: true, desc: 'Source ID for this object'
119
- option :label, desc: 'Object label'
119
+ option :title, required: true, desc: 'Object title'
120
120
  option :type, enum: %w[image book document map manuscript media three_dimensional object collection admin_policy],
121
121
  desc: 'The object type'
122
122
  option :collection, desc: 'Druid identifier of the collection object'
@@ -7,7 +7,7 @@ module SdrClient
7
7
  # @param [String] apo the object ID of the administrative policy object
8
8
  # @param [String] source_id the source ID of the object
9
9
  # @param [Hash] options optional parameters
10
- # @option options [String] label the required object label
10
+ # @option options [String] title the required object title
11
11
  # @option options [String] view the access level for viewing the object
12
12
  # @option options [String] download the access level for downloading the object
13
13
  # @option options [String] location the location for location-based access
@@ -38,7 +38,7 @@ module SdrClient
38
38
  identification: identification,
39
39
  structural: structural,
40
40
  version: 1,
41
- label: label.nil? ? ':auto' : label
41
+ description: { title: [{ value: title }] }
42
42
  }
43
43
  end
44
44
 
@@ -125,8 +125,8 @@ module SdrClient
125
125
  options[:location]
126
126
  end
127
127
 
128
- def label
129
- options[:label]
128
+ def title
129
+ options[:title]
130
130
  end
131
131
 
132
132
  def use_and_reproduction
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '2.43.1'
4
+ VERSION = '2.45.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.126.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.128.0'
32
32
  spec.add_dependency 'config'
33
33
  spec.add_dependency 'dry-monads'
34
34
  spec.add_dependency 'faraday', '>= 0.16'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.43.1
4
+ version: 2.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.126.0
32
+ version: 0.128.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.126.0
39
+ version: 0.128.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: config
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
224
  requirements: []
225
- rubygems_version: 3.6.9
225
+ rubygems_version: 4.0.6
226
226
  specification_version: 4
227
227
  summary: The CLI for https://github.com/sul-dlss/sdr-api
228
228
  test_files: []