sdr-client 0.89.0 → 0.90.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/sdr_client/deposit/create_resource.rb +4 -9
- data/lib/sdr_client/deposit/model_process.rb +5 -0
- data/lib/sdr_client/deposit.rb +4 -2
- data/lib/sdr_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0741b6265694775c1c47bd6ac98cc77d3ffcd9459e2aabfe8c81063f101190a2
|
4
|
+
data.tar.gz: 4a31a083ebbad99596e02829bbb5429f427dfa28a5f765273d638691352325c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02a6c2b9b9147104c3dcf9d15bbc06839435fc206a38220f3035610ac229ed29c9e0b3742ec4b99539ea8ae7bc452cf011b38ad480c62cee83f825ada80836e1
|
7
|
+
data.tar.gz: 64de4cbed6b59d12c188d1e8795a31f6c226ea5ff8199701fe53a0976fa7dc43ccc72a393a7768c9e685675859677588b7051a1ec6b144bbb6b3a6efc4c54bf9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sdr-client (0.
|
4
|
+
sdr-client (0.90.0)
|
5
5
|
activesupport
|
6
6
|
cocina-models (~> 0.83.0)
|
7
7
|
dry-monads
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
docile (1.4.0)
|
46
46
|
dry-container (0.10.0)
|
47
47
|
concurrent-ruby (~> 1.0)
|
48
|
-
dry-core (0.
|
48
|
+
dry-core (0.8.0)
|
49
49
|
concurrent-ruby (~> 1.0)
|
50
50
|
dry-inflector (0.3.0)
|
51
51
|
dry-logic (1.2.0)
|
@@ -73,7 +73,7 @@ GEM
|
|
73
73
|
ruby2_keywords (>= 0.0.4)
|
74
74
|
faraday-net_http (2.0.3)
|
75
75
|
hashdiff (1.0.1)
|
76
|
-
i18n (1.
|
76
|
+
i18n (1.12.0)
|
77
77
|
concurrent-ruby (~> 1.0)
|
78
78
|
ice_nine (0.11.2)
|
79
79
|
json (2.6.2)
|
@@ -5,14 +5,8 @@ module SdrClient
|
|
5
5
|
# Creates a resource (metadata) in SDR
|
6
6
|
class CreateResource
|
7
7
|
DRO_PATH = '/v1/resources'
|
8
|
-
|
9
|
-
|
10
|
-
new(accession: accession,
|
11
|
-
priority: priority,
|
12
|
-
assign_doi: assign_doi,
|
13
|
-
metadata: metadata,
|
14
|
-
logger: logger,
|
15
|
-
connection: connection).run
|
8
|
+
def self.run(**args)
|
9
|
+
new(**args).run
|
16
10
|
end
|
17
11
|
|
18
12
|
# @param [Boolean] accession should the accessionWF be started
|
@@ -21,7 +15,8 @@ module SdrClient
|
|
21
15
|
# @param [Hash<Symbol,String>] the result of the metadata call
|
22
16
|
# @param [String] priority what processing priority should be used
|
23
17
|
# either 'low' or 'default'
|
24
|
-
|
18
|
+
# rubocop:disable Metrics/ParameterLists
|
19
|
+
def initialize(accession:, metadata:, logger:, connection:, assign_doi: false, priority: nil)
|
25
20
|
@accession = accession
|
26
21
|
@priority = priority
|
27
22
|
@assign_doi = assign_doi
|
@@ -9,12 +9,15 @@ module SdrClient
|
|
9
9
|
# @param [Cocina::Model::RequestDRO] request_dro for depositing
|
10
10
|
# @param [Connection] connection the connection to use
|
11
11
|
# @param [Boolean] accession should the accessionWF be started
|
12
|
+
# @param [String] priority (nil) what processing priority should be used
|
13
|
+
# either 'low' or 'default'
|
12
14
|
# @param [Array<String>] files a list of file names to upload
|
13
15
|
# @param [Boolean] assign_doi should a DOI be assigned to this item
|
14
16
|
# @param [Logger] logger the logger to use
|
15
17
|
def initialize(request_dro:, # rubocop:disable Metrics/ParameterLists
|
16
18
|
connection:,
|
17
19
|
accession:,
|
20
|
+
priority: nil,
|
18
21
|
files: [],
|
19
22
|
assign_doi: false,
|
20
23
|
logger: Logger.new($stdout))
|
@@ -23,6 +26,7 @@ module SdrClient
|
|
23
26
|
@request_dro = request_dro
|
24
27
|
@logger = logger
|
25
28
|
@accession = accession
|
29
|
+
@priority = priority
|
26
30
|
@assign_doi = assign_doi
|
27
31
|
end
|
28
32
|
|
@@ -36,6 +40,7 @@ module SdrClient
|
|
36
40
|
connection: connection)
|
37
41
|
new_request_dro = UpdateDroWithFileIdentifiers.update(request_dro: request_dro, upload_responses: upload_responses)
|
38
42
|
CreateResource.run(accession: @accession,
|
43
|
+
priority: @priority,
|
39
44
|
assign_doi: @assign_doi,
|
40
45
|
metadata: new_request_dro,
|
41
46
|
logger: logger,
|
data/lib/sdr_client/deposit.rb
CHANGED
@@ -56,21 +56,23 @@ module SdrClient
|
|
56
56
|
logger: logger).run
|
57
57
|
end
|
58
58
|
# rubocop:enable Metrics/MethodLength
|
59
|
-
# rubocop:enable Metrics/ParameterLists
|
60
59
|
|
61
60
|
# @param [Array<String>] files absolute paths to files
|
62
61
|
def self.model_run(request_dro:,
|
63
62
|
files: [],
|
64
63
|
url:,
|
65
64
|
accession:,
|
65
|
+
priority: nil,
|
66
66
|
logger: Logger.new($stdout))
|
67
67
|
connection = Connection.new(url: url)
|
68
68
|
ModelProcess.new(request_dro: request_dro,
|
69
69
|
connection: connection,
|
70
70
|
files: files,
|
71
71
|
logger: logger,
|
72
|
-
accession: accession
|
72
|
+
accession: accession,
|
73
|
+
priority: priority).run
|
73
74
|
end
|
75
|
+
# rubocop:enable Metrics/ParameterLists
|
74
76
|
end
|
75
77
|
end
|
76
78
|
require 'json'
|
data/lib/sdr_client/version.rb
CHANGED
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.
|
4
|
+
version: 0.90.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-07-
|
11
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|