uc3-dmp-id 0.0.108 → 0.0.110

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: 6b951a79fba1e0ca52529329628da1616600cc7a6f37c25d357c35652caf7ba7
4
+ data.tar.gz: 362d3e8d02de8e407553ff2e71a680b4ec9eaf7e272998a4e6dc1de3923fd81f
5
5
  SHA512:
6
- metadata.gz: 1c60ca807292bcc01defd4a9f46b10e3719e2000f942b536eb3609a2c76f17bd6ea4149e1346f7a5067941a203fcb9355bb9506511de5713c73bb0521a5f0c1a
7
- data.tar.gz: f5c3eae81c888a1389115898ec6cc654902545c51883cc66dca5f514c023024b1045c1d365b6335a509b4373c3e11b8844f423b17968271817ae8f96ca37cb76
6
+ metadata.gz: 0b0c3ca513b975699cdf5c42943d98c38d43f5ac374d320dececcad9b9a9eb44b8549361f7ce13fbd3be72fe10fcc0a048bfec0d08340f9bffa2cb9691ab0094
7
+ data.tar.gz: c8c50c7345444d2209f75cc26f3531e4ca28b1bc73bb3679dc09a6f6b6f5d3fa2b895901dd75a9f4338e6deefcfd50dd175bea75ad06c2ad9a409bec9b3610c1
@@ -129,7 +129,7 @@ module Uc3DmpId
129
129
  "http://orcid.org/#{owner_id.to_s.downcase}",
130
130
  "https://orcid.org/#{owner_id.to_s.downcase}"
131
131
  ],
132
- comparison_operator: 'EQ'
132
+ comparison_operator: 'IN'
133
133
  }
134
134
  },
135
135
  filter_expression: 'SK = :version',
@@ -153,7 +153,7 @@ module Uc3DmpId
153
153
  "http://ror.org/#{owner_org.to_s.downcase}",
154
154
  "https://ror.org/#{owner_org.to_s.downcase}"
155
155
  ],
156
- comparison_operator: 'EQ'
156
+ comparison_operator: 'IN'
157
157
  }
158
158
  },
159
159
  filter_expression: 'SK = :version',
@@ -174,7 +174,7 @@ module Uc3DmpId
174
174
  key_conditions: {
175
175
  dmphub_modification_day: {
176
176
  attribute_value_list: [day.to_s],
177
- comparison_operator: 'EQ'
177
+ comparison_operator: 'IN'
178
178
  }
179
179
  },
180
180
  filter_expression: 'SK = :version',
@@ -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.110'
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.110
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