event_store_client 1.0.8 → 1.0.13

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: c504b09fe2a34702beeaa40749a5f21d10152202fdbbb9c41dfc00a93d294fba
4
- data.tar.gz: f339b9d7cc63c3b9f57b2f1636d69d15b7917baadbf7d2c3a640fec3ae4922f5
3
+ metadata.gz: 57143fadf4edbe242994d58b20ee1906472888433d59a61b22119f748d4fd94f
4
+ data.tar.gz: 43761489120aa019bb542f090a32926594c37229e46d7d5add8ac8db64819604
5
5
  SHA512:
6
- metadata.gz: 9a78d386719369ecb30e0e76f8331e18eb8eb914462f32152dae52cb9c1325677c1ac78d61d1e063a3c780dc3d2709649558f2da237fd7217610e4a1dc514369
7
- data.tar.gz: e1ec5744ca7b5af95aa1da813b6812ed5a227078a7fb525f85f91286ac7fbf1745aaa035967eb81875df0a972c29c043da5fae4668f418f06b635f4cf2caecdd
6
+ metadata.gz: 84672b1909682062f70885ada88894ec259e554fad518be53b17460ac118a748f02f30f3ea9c5c4dab36969cd2309f009b3f367b480dcb800852af5f58c4aeec
7
+ data.tar.gz: c6f2bc12b9aa55a84d4788c50c76f470ec1504ccef4a1721a5862f4978ffd0c0820df05a3fbe878d6abb1c5085153a7c01b5fb4eddbfafde3d0c823485904c16
@@ -4,13 +4,14 @@ module EventStoreClient
4
4
  end
5
5
 
6
6
  require 'event_store_client/types'
7
- require 'event_store_client/event'
8
- require 'event_store_client/deserialized_event'
7
+
9
8
  require 'event_store_client/serializer/json'
10
9
 
11
10
  require 'event_store_client/mapper'
12
11
 
13
12
  require 'event_store_client/configuration'
13
+ require 'event_store_client/event'
14
+ require 'event_store_client/deserialized_event'
14
15
 
15
16
  require 'event_store_client/subscription'
16
17
  require 'event_store_client/subscriptions'
@@ -44,8 +44,8 @@ module EventStoreClient
44
44
  id: {
45
45
  string: SecureRandom.uuid
46
46
  },
47
- data: event.data,
48
- custom_metadata: JSON.generate(custom_metadata),
47
+ data: event.data.b,
48
+ custom_metadata: JSON.generate(custom_metadata),
49
49
  metadata: event_metadata
50
50
  }
51
51
  )
@@ -4,8 +4,6 @@ require 'dry/schema'
4
4
 
5
5
  module EventStoreClient
6
6
  class DeserializedEvent
7
- InvalidDataError = Class.new(StandardError)
8
-
9
7
  attr_reader :id
10
8
  attr_reader :type
11
9
  attr_reader :title
@@ -19,13 +17,12 @@ module EventStoreClient
19
17
 
20
18
  def initialize(**args)
21
19
  validation = schema.call(args[:data] || {})
22
- raise InvalidDataError.new(message: validation.errors.to_h) if validation.errors.any?
23
-
24
20
  @data = args.fetch(:data) { {} }
25
21
  @metadata = args.fetch(:metadata) { {} }.merge(
26
22
  'type' => self.class.name,
27
23
  'content-type' => content_type
28
24
  )
25
+ @metadata.merge!('validation-errors' => validation.errors.to_h) if validation.errors.any?
29
26
  @type = args[:type] || self.class.name
30
27
  @title = args[:title]
31
28
  @id = args[:id]
@@ -13,7 +13,8 @@ module EventStoreClient
13
13
  else
14
14
  subscriber.class.name
15
15
  end
16
- @name = "#{service}-#{subscriber_class}"
16
+ @name = subscriber_class.to_s
17
+ @name = "#{service}-" + @name if service != ''
17
18
  @subscriber = subscriber
18
19
  @stream = name
19
20
  @observed_streams = event_types.reduce([]) { |r, type| r << "$et-#{type}" }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.0.8'
4
+ VERSION = '1.0.13'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_store_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.1.4
247
+ rubygems_version: 3.0.6
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Ruby integration for https://eventstore.org