uc3-dmp-id 0.0.108 → 0.0.109

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: 5ac1d8aa8c945ab970a842b101c6abf86fb0c758877e138c3b8d8078e1e34b0f
4
- data.tar.gz: 6a3bcb2ba5577ce20ec437344fbcf4ec85c03dccc3309a2e9e1e0de505e8e5da
3
+ metadata.gz: 2904670927e7a3f94ab9396ea89145c6526a9df02a6ac75beb5231920c4a16ff
4
+ data.tar.gz: 05ff04ea8ec68d06b8f0854269d511422019ced71f1d2347aef4232a0175c564
5
5
  SHA512:
6
- metadata.gz: 1c60ca807292bcc01defd4a9f46b10e3719e2000f942b536eb3609a2c76f17bd6ea4149e1346f7a5067941a203fcb9355bb9506511de5713c73bb0521a5f0c1a
7
- data.tar.gz: f5c3eae81c888a1389115898ec6cc654902545c51883cc66dca5f514c023024b1045c1d365b6335a509b4373c3e11b8844f423b17968271817ae8f96ca37cb76
6
+ metadata.gz: e16cb5b1ad93195b0244645faa04144c6f88aec037340529d5190b7b7cff1b5308e5273cec5a654ecad0b4624468464500ca9e5ce08034261a793d44ba3c056f
7
+ data.tar.gz: 259be986f9f8e4d4d91f7d39558e6dda44290ed3ea4dbf727bd8c7e92f74da8419e962cf9f7d511c6ae4dd620b18b29acdb2bd409a8430c98bdfae34bf55e361
@@ -32,26 +32,16 @@ module Uc3DmpId
32
32
  raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: latest_version, dmp_b: mods)
33
33
 
34
34
  # Version the DMP ID record (if applicable).
35
-
36
- puts "DMPHub PROV: #{latest_version['dmphub_provenance_id']}, DMP BURIED: #{latest_version.fetch('dmp', {})['dmphub_provenance_id']}"
37
-
38
35
  owner = latest_version['dmphub_provenance_id']
39
36
  updater = provenance['PK']
40
37
  version = Versioner.generate_version(client: client, latest_version: latest_version, owner: owner, updater: updater,
41
38
  logger: logger)
42
39
  raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if version.nil?
43
40
 
44
- puts "OWNER AFTER VERSION: #{owner}"
45
- puts version
46
-
47
-
48
41
  # Splice the assertions
49
42
  version = _process_modifications(owner: owner, updater: updater, version: version, mods: mods, note: note,
50
43
  logger: logger)
51
44
 
52
- puts "AFTER PROCESING MODS:"
53
- puts version
54
-
55
45
  # Save the changes
56
46
  resp = client.put_item(json: version, logger: logger)
57
47
  raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
@@ -73,11 +63,10 @@ puts version
73
63
 
74
64
  # fetch the existing latest version of the DMP ID
75
65
  client = Uc3DmpDynamo::Client.new(logger: logger)
76
- dmp = Finder.by_pk(p_key: p_key, client: client, logger: logger)
66
+ dmp = Finder.by_pk(p_key: p_key, client: client, logger: logger, cleanse: false)
77
67
  logger.info(message: "Existing latest record", details: dmp) if logger.respond_to?(:debug)
78
-
79
- errs = _updateable?(provenance: provenance, p_key: p_key, json: dmp['dmp'])
80
- raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
68
+ raise UpdaterError, MSG_DMP_FORBIDDEN unless provenance.is_a?(Hash) && !provenance['PK'].nil? &&
69
+ provenance['Pk'] == dmp['dmphub_provenance_id']
81
70
 
82
71
  # Add the download URl for the PDF as a related identifier on the DMP ID record
83
72
  annotated = Helper.annotate_dmp_json(provenance: provenance, p_key: p_key, json: dmp['dmp'])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.108'
4
+ VERSION = '0.0.109'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.108
4
+ version: 0.0.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json