uc3-dmp-id 0.0.34 → 0.0.36

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: 34abba8c31224a2fd5609c38cf4123adfbb65c0fee23ea2b7c60be624c93e4bc
4
- data.tar.gz: a00f307c3871588552faf3dccc2a7bdb42ab23290454fe5c870f6c6606690516
3
+ metadata.gz: 9d509211398e3615790609d689825fead87db452b1f75ee3e04adf6463efe535
4
+ data.tar.gz: 4212135594b43aa8248d2ec958992be2e75205ab30f3c63cbfc6db3ea2d0e2fc
5
5
  SHA512:
6
- metadata.gz: d4a03380d9d10ef00523cd5969e50ef6aa8e9e97e23fac56d56df7a5016ae815879e19676057a4ab48682ede6f4119a44f675937f11fb92653429bd405123fdc
7
- data.tar.gz: c28117b7464eae273667331d300f82d84d0c820af60821e964b3665925c324f5ab33a53ed11e5f69bf295187d516ce4799d3a859fd24450c8f80059a5b340469
6
+ metadata.gz: ad503c8e9314acae53f8b70709d08d05bb9ff4070551c0cd0aa2309d0fe3c6b429d83f79b171076b96aff1a0aff40e068b48bb03250e0160f23490bf1f899805
7
+ data.tar.gz: f1599bc00705158bda3370e8da32edb8df1212e2224e8d6f0497f6d367eb3275fdc76f863b6248afe1360aecefb70460a7ee7c98c4d488daeb8a8ceea8757a6e
@@ -43,7 +43,7 @@ module Uc3DmpId
43
43
  resp = client.put_item(json: annotated, debug: debug)
44
44
  raise CreatorError, Uc3DmpId::MSG_DMP_NO_DMP_ID if resp.nil?
45
45
 
46
- # _post_process(json: annotated)
46
+ _post_process(json: annotated, debug: debug)
47
47
  annotated
48
48
  end
49
49
 
@@ -75,13 +75,14 @@ module Uc3DmpId
75
75
  # Once the DMP has been created, we need to register it's DMP ID and download any
76
76
  # PDF if applicable
77
77
  # -------------------------------------------------------------------------
78
- def _post_process(json:)
78
+ def _post_process(json:, debug: false)
79
79
  return false unless json.is_a?(Hash)
80
80
 
81
81
  # We are creating, so this is always true
82
82
  json['dmphub_updater_is_provenance'] = true
83
83
  # Publish the change to the EventBridge
84
- # EventPublisher.publish(source: 'DmpCreator', dmp: json, debug: @debug)
84
+ publisher = Uc3DmpEventBridge::Publisher.new
85
+ publisher.publish(source: 'DmpCreator', dmp: json, debug: debug)
85
86
  true
86
87
  end
87
88
  end
@@ -42,7 +42,7 @@ module Uc3DmpId
42
42
  puts resp.inspect
43
43
 
44
44
  # Notify EZID about the removal
45
- _post_process(json: dmp)
45
+ _post_process(json: dmp, debug: debug)
46
46
  dmp
47
47
  rescue Aws::Errors::ServiceError => e
48
48
  Responder.log_error(source: source, message: e.message,
@@ -55,13 +55,14 @@ puts resp.inspect
55
55
 
56
56
  # Once the DMP has been tombstoned, we need to notify EZID
57
57
  # -------------------------------------------------------------------------
58
- def _post_process(json:)
58
+ def _post_process(json:, debug: false)
59
59
  return false unless json.is_a?(Hash)
60
60
 
61
61
  # Indicate whether or not the updater is the provenance system
62
62
  json['dmphub_updater_is_provenance'] = true
63
63
  # Publish the change to the EventBridge
64
- # EventPublisher.publish(source: 'DmpDeleter', dmp: json, debug: @debug)
64
+ publisher = Uc3DmpEventBridge::Publisher.new
65
+ publisher.publish(source: 'DmpDeleter', dmp: json, debug: debug)
65
66
  true
66
67
  end
67
68
  end
@@ -90,7 +90,7 @@ module Uc3DmpId
90
90
  }
91
91
  },
92
92
  filter_expression: 'SK = :version',
93
- expression_attribute_values: { ':version': KeyHelper::DMP_LATEST_VERSION }
93
+ expression_attribute_values: { ':version': Helper::DMP_LATEST_VERSION }
94
94
  }
95
95
  client = client.nil? ? Uc3DmpDynamo::Client.new(debug: debug) : client
96
96
  resp = client.query(**args)
@@ -34,8 +34,7 @@ module Uc3DmpId
34
34
  raise DeleterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
35
35
 
36
36
  # Send the updates to EZID, notify the provenance and download the PDF if applicable
37
- _post_process(json: dmp)
38
-
37
+ _post_process(json: dmp, debug: debug)
39
38
  resp
40
39
  end
41
40
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
@@ -61,13 +60,14 @@ module Uc3DmpId
61
60
 
62
61
  # Once the DMP has been updated, we need to register it's DMP ID and download any PDF if applicable
63
62
  # -------------------------------------------------------------------------
64
- def _post_process(json:)
63
+ def _post_process(json:, debug: debug)
65
64
  return false unless json.is_a?(Hash)
66
65
 
67
66
  # Indicate whether or not the updater is the provenance system
68
67
  json['dmphub_updater_is_provenance'] = @provenance['PK'] == json['dmphub_provenance_id']
69
68
  # Publish the change to the EventBridge
70
- # EventPublisher.publish(source: 'DmpUpdater', dmp: json, debug: @debug)
69
+ publisher = Uc3DmpEventBridge::Publisher.new
70
+ publisher.publish(source: 'DmpUpdater', dmp: json, debug: debug)
71
71
  true
72
72
  end
73
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.34'
4
+ VERSION = '0.0.36'
5
5
  end
data/lib/uc3-dmp-id.rb CHANGED
@@ -4,6 +4,8 @@
4
4
  require 'json'
5
5
  require 'json-schema'
6
6
 
7
+ require 'uc3-dmp-event-bridge'
8
+
7
9
  require 'uc3-dmp-id/creator'
8
10
  require 'uc3-dmp-id/deleter'
9
11
  require 'uc3-dmp-id/finder'
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.0.34
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: uc3-dmp-event-bridge
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: byebug
57
71
  requirement: !ruby/object:Gem::Requirement