uc3-dmp-id 0.0.35 → 0.0.36

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: b6deb6c2410fcd18ed4bb3cd248012a3c76cc5a7bf7eefb85c42e35de9d85469
4
- data.tar.gz: b8bef46b7faf3a75d7f064cc7b9137e185fd786c0922ab94bbea05518d95bade
3
+ metadata.gz: 9d509211398e3615790609d689825fead87db452b1f75ee3e04adf6463efe535
4
+ data.tar.gz: 4212135594b43aa8248d2ec958992be2e75205ab30f3c63cbfc6db3ea2d0e2fc
5
5
  SHA512:
6
- metadata.gz: e6e2c933a4ebcaa35b5cbef3b2265d20f8e7dd9398fc313632a826fe7f1280ad9f6753d9780d6ee2b321d6be0459ceb4765cf5e551c2a0cc93b4b687d7c038b4
7
- data.tar.gz: 55f633c30625d5d8285f8d0e4ab8c7f03d33a632c61995c0df0c79ea416069118ef32da27986ec92845c9f9a34bff666cb480984cb122fdc801c1818f6fe8358
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
@@ -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.35'
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.35
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