aggregate_streams 1.0.0.0.rc1 → 1.0.0.0.rc2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9d29a5d06b557c2747c009860d6c114950aedcd5e3c719b4f1e73ecb5887b69
|
4
|
+
data.tar.gz: b326c3d2afd41810903bb4cd9eaae22716e63ac0916f1da840d2a4a3b85a98c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71dcd270d20bdc11790075afcea94e361c3f46d8e620368f333601f4622a3add3763ac06ec85f82a0ca65d0018dc51a11e7e4f3b485742aa1898ddf2e3a5999d
|
7
|
+
data.tar.gz: e1e0cacd565a9e8ae113dc21dac85d248ad7df25e91086c11b65e6111eb03c1a470d3ac2d86ab1df590736ea48550acf3564229fd208582928f370ddb92ba9c0
|
@@ -2,7 +2,7 @@ module AggregateStreams
|
|
2
2
|
module Controls
|
3
3
|
module MessageData
|
4
4
|
module Metadata
|
5
|
-
def self.example(category: nil, stream_id: nil, stream_name: nil, position: nil, global_position: nil, causation_message_stream_name: nil, causation_message_position: nil, causation_message_global_position: nil, correlation_stream_name: nil, reply_stream_name: nil, schema_version: nil)
|
5
|
+
def self.example(category: nil, stream_id: nil, stream_name: nil, position: nil, global_position: nil, causation_message_stream_name: nil, causation_message_position: nil, causation_message_global_position: nil, correlation_stream_name: nil, reply_stream_name: nil, properties: nil, local_properties: nil, schema_version: nil)
|
6
6
|
if stream_name == :none
|
7
7
|
stream_name = nil
|
8
8
|
else
|
@@ -51,6 +51,18 @@ module AggregateStreams
|
|
51
51
|
reply_stream_name ||= Metadata.reply_stream_name
|
52
52
|
end
|
53
53
|
|
54
|
+
if properties == :none
|
55
|
+
properties = nil
|
56
|
+
else
|
57
|
+
properties ||= self.properties
|
58
|
+
end
|
59
|
+
|
60
|
+
if local_properties == :none
|
61
|
+
local_properties = nil
|
62
|
+
else
|
63
|
+
local_properties ||= self.local_properties
|
64
|
+
end
|
65
|
+
|
54
66
|
if schema_version == :none
|
55
67
|
schema_version = nil
|
56
68
|
else
|
@@ -68,6 +80,10 @@ module AggregateStreams
|
|
68
80
|
|
69
81
|
:correlation_stream_name => correlation_stream_name,
|
70
82
|
:reply_stream_name => reply_stream_name,
|
83
|
+
|
84
|
+
:properties => properties,
|
85
|
+
:local_properties => local_properties,
|
86
|
+
|
71
87
|
:schema_version => schema_version
|
72
88
|
}
|
73
89
|
|
@@ -108,6 +124,14 @@ module AggregateStreams
|
|
108
124
|
Messaging::Controls::Metadata.reply_stream_name
|
109
125
|
end
|
110
126
|
|
127
|
+
def self.properties
|
128
|
+
Messaging::Controls::Properties.example
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.local_properties
|
132
|
+
Messaging::Controls::LocalProperties.example
|
133
|
+
end
|
134
|
+
|
111
135
|
def self.schema_version
|
112
136
|
Messaging::Controls::Metadata.schema_version
|
113
137
|
end
|
@@ -39,12 +39,7 @@ module AggregateStreams
|
|
39
39
|
raw_input_data = Messaging::Message::Transform::MessageData.read(message_data)
|
40
40
|
input_metadata = Messaging::Message::Metadata.build(raw_input_data[:metadata])
|
41
41
|
|
42
|
-
output_metadata =
|
43
|
-
|
44
|
-
output_metadata.follow(input_metadata)
|
45
|
-
|
46
|
-
output_metadata = output_metadata.to_h
|
47
|
-
output_metadata.delete_if { |_, v| v.nil? }
|
42
|
+
output_metadata = raw_metadata(input_metadata)
|
48
43
|
|
49
44
|
write_message_data = MessageStore::MessageData::Write.new
|
50
45
|
|
@@ -77,6 +72,24 @@ module AggregateStreams
|
|
77
72
|
end
|
78
73
|
end
|
79
74
|
|
75
|
+
def raw_metadata(metadata)
|
76
|
+
output_metadata = Messaging::Message::Metadata.build
|
77
|
+
|
78
|
+
output_metadata.follow(metadata)
|
79
|
+
|
80
|
+
output_metadata = output_metadata.to_h
|
81
|
+
|
82
|
+
output_metadata.delete(:local_properties)
|
83
|
+
|
84
|
+
if output_metadata[:properties].empty?
|
85
|
+
output_metadata.delete(:properties)
|
86
|
+
end
|
87
|
+
|
88
|
+
output_metadata.delete_if { |_, v| v.nil? }
|
89
|
+
|
90
|
+
output_metadata
|
91
|
+
end
|
92
|
+
|
80
93
|
def transform(write_message_data, stream_name)
|
81
94
|
if transform_action.nil?
|
82
95
|
write_message_data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aggregate_streams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.0.
|
4
|
+
version: 1.0.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Ladd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-consumer-postgres
|