event_store_client 1.4.1 → 1.4.5

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: d1fd97d12d7212eed5e7fef538bd4896ab2183ba223350d36f1cbc44fc2c75fc
4
- data.tar.gz: aa7b1f637b4d9b36b532c9e7bfb22ceaa9c144acc28868bfa05658141e22d07d
3
+ metadata.gz: d6c7df9b736f9bc907f2ff5d19e80c7de3a61b9f05b19c5a82233620e840fddc
4
+ data.tar.gz: 85acf76ceb83e2f024270cac73be4aa34b88c9b882d7a85aae2680952ec2b7b0
5
5
  SHA512:
6
- metadata.gz: b807db30af1cc618c3bcfb8f51e91fbe0a538ac99322b9e6736ab0dbc2f1b0b816d28a69a7f2996591bb481f7396dab03cc1ae6d5e1c9c9681b1342a551d880c
7
- data.tar.gz: 6165caf9a71bdb547c45d872a216223f7f765802770ef00a978785f1882b82f1404cd8e194120c06efdd07af7255a89ffa3cd20545fc75fbc8e2d1551a3d7229
6
+ metadata.gz: 373cbae1f6f33695822c4b6ce18d6645cc07e77dc2cef84a562226286e5d1b7e040aea6c6ba99c824aee88ac0a151ddb540e9083f7bc4f021f4657e340e0a355
7
+ data.tar.gz: 7b1141509133888f1956420d7f94f872c918036c71887ccd2803370a32b0e926d4cfe882c11ad1183ab0686b077d40af7e29b0264d7fbfac3d8b4d1f32c22468
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'dry-configurable'
4
4
  require 'event_store_client/error_handler'
5
+ require 'event_store_client/deserialized_event'
5
6
 
6
7
  module EventStoreClient
7
8
  extend Dry::Configurable
@@ -28,6 +29,8 @@ module EventStoreClient
28
29
 
29
30
  setting :mapper, default: Mapper::Default.new
30
31
 
32
+ setting :default_event_class, default: DeserializedEvent
33
+
31
34
  setting :subscriptions_repo
32
35
 
33
36
  setting :logger
@@ -46,6 +46,8 @@ module EventStoreClient
46
46
  private
47
47
 
48
48
  def validate(data)
49
+ return unless schema
50
+
49
51
  validation = schema.call(data || {})
50
52
 
51
53
  return unless validation.errors.any?
@@ -20,7 +20,7 @@ module EventStoreClient
20
20
  begin
21
21
  Object.const_get(event.type)
22
22
  rescue NameError
23
- EventStoreClient::DeserializedEvent
23
+ EventStoreClient.config.default_event_class
24
24
  end
25
25
  event_class.new(
26
26
  skip_validation: true,
@@ -68,7 +68,7 @@ module EventStoreClient
68
68
  begin
69
69
  Object.const_get(event.type)
70
70
  rescue NameError
71
- EventStoreClient::DeserializedEvent
71
+ EventStoreClient.config.default_event_class
72
72
  end
73
73
 
74
74
  event_class.new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.4.1'
4
+ VERSION = '1.4.5'
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.4.1
4
+ version: 1.4.5
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-12-03 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable