uc3-dmp-id 0.1.83 → 0.1.84

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: 64a144529d16fc7d5c8d6dd8c345676ce291a3c649f527dc7c141a02630f6b47
4
- data.tar.gz: 2052bcf74cfe953632069a446aaaaa846c2c886d3b0f9044d42dc222a73373de
3
+ metadata.gz: 84ab313258ffa4f817fd7fae592fe73c08fc048535ed7b475ea384ac0f27172e
4
+ data.tar.gz: 9af6e617d3ee17eb2b1fd86f2f262922d97f4743af45fa54107c5ef5785e5ff7
5
5
  SHA512:
6
- metadata.gz: 7952c77130521e0cf71af6cafb42b655df70e40e4bd562f42985a3e36a907b968b339d06f9a17945234cf3302e24d6982bb2309bc5eaa5f8f6a7fbeb7b047262
7
- data.tar.gz: 2160a01110b141788b1da9240e2e43e5c4d7ba3456985a50c94338b980c3e563a6a0592be9e36d3536117a3113f4c941c037341398906c3a58d508135cf58ea3
6
+ metadata.gz: c827105e6a001abf89cca3a72a4ff426128855628b37ae695219a0fbbd67f1824abd8fe9166fa1647df07528782bd8f2e1f6a216a27f7c6dc25a9c2e74fe3129
7
+ data.tar.gz: 9122ecb1c1ab63cddec4196cb6dc9d97a3fb5a25fb8f92b89f5b299b7507f31d5ebf6e7898113ce1a80f22ba810542d786d20ba9c44a07d43c4115d9d6db87dc
@@ -53,6 +53,7 @@ module Uc3DmpId
53
53
  annotated['registered'] = annotated['created'] if annotated['registered'].nil?
54
54
 
55
55
  # Create the item
56
+ annotated.delete('dmphub_modifications')
56
57
  resp = client.put_item(json: annotated, logger:)
57
58
  raise CreatorError, Helper::MSG_DMP_NO_DMP_ID if resp.nil?
58
59
 
@@ -52,11 +52,8 @@ module Uc3DmpId
52
52
  # Process the incoming payload
53
53
  payload = _process_modifications(owner:, updater:, version:, payload:, logger:)
54
54
 
55
- # Ensure we've deleted the dmphub_mods!!!!
56
- payload.delete('dmphub_modifications')
57
- payload.delete(:dmphub_modifications)
58
55
  # Save the changes
59
- resp = client.put_item(json: payload, logger:)
56
+ resp = client.put_item(json: _purge_mods(payload:), logger:)
60
57
  raise UpdaterError, Helper::MSG_DMP_UNABLE_TO_VERSION if resp.nil?
61
58
 
62
59
  # Send the updates to EZID
@@ -103,7 +100,7 @@ module Uc3DmpId
103
100
 
104
101
  # Save the changes without creating a new version!
105
102
  logger&.debug(message: "DMP After narrative attachment", details: dmp)
106
- resp = client.put_item(json: dmp, logger:)
103
+ resp = client.put_item(json: _purge_mods(payload: dmp), logger:)
107
104
  raise UpdaterError, Helper::MSG_DMP_UNABLE_TO_VERSION if resp.nil?
108
105
 
109
106
  logger&.debug(message: "Added DMP ID narrative for PK: #{p_key}, Narrative: #{url}")
@@ -113,6 +110,12 @@ module Uc3DmpId
113
110
 
114
111
  private
115
112
 
113
+ def _purge_mods(payload:)
114
+ # Ensure we've deleted the dmphub_mods!!!!
115
+ payload.delete('dmphub_modifications')
116
+ payload.delete(:dmphub_modifications)
117
+ end
118
+
116
119
  # Check to make sure the incoming JSON is valid, the DMP ID requested matches the DMP ID in the JSON
117
120
  # rubocop:disable Metrics/AbcSize
118
121
  def _updateable?(provenance:, p_key:, latest_version: {}, mods: {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.83'
4
+ VERSION = '0.1.84'
5
5
  end
@@ -58,6 +58,7 @@ module Uc3DmpId
58
58
 
59
59
  # Create the prior version record ()
60
60
  client = Uc3DmpDynamo::Client.new if client.nil?
61
+ prior.delete('dmphub_modifications')
61
62
  resp = client.put_item(json: prior, logger:)
62
63
  return nil if resp.nil?
63
64
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.83
4
+ version: 0.1.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley