event_store_client 1.4.0 → 1.4.4

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: 308f1684d09b0b00ca5639074c5f1b79d4e689d5d42d44e4a33412db43a2b3c4
4
- data.tar.gz: 67c2d8dd1bbf6070f9c6938c88577a5aa57bda35399586e75af30476c50488e3
3
+ metadata.gz: 0531544b07e44ff51ac207903dda9992f46a588bd3d2bf89832cede9bd5d50fc
4
+ data.tar.gz: 0ae335e9a43a121edb0d6f779c8dd9f905a73163daa83ae549dd455579473494
5
5
  SHA512:
6
- metadata.gz: 87eea741c382403a0ccd8904a689dfae713180c8a03198c4bbedf82dfc22d4a3e463cfd518d0f9fca678fffb54b521fa100d928b515a048ec13daffb1d9077dd
7
- data.tar.gz: b380b64c37b959821178d7cdfcb887f6ed2f6fdb7b72f5a36b39ba81ac14660c0453c9f4fd03b422e284a36f1edd346ae9b4375c81531ac6e3284aee072dfd74
6
+ metadata.gz: 287116caffeccdcd4e5c8f45302dbbec7d81f0424fa61ba1f66abdf310a78f2c1d5965881022f59d9635bd03df53a0a4a2a311ea1e22e7a36955e675cb33ede2
7
+ data.tar.gz: d644e1de740e6990432af66284375542f79b86589aa8b32f1adef3b1ab63f91d08430f8c5d651ebf2ba2b5196e467ec738037b7a5da7528dc8b3a0be84c4a2fe
@@ -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,9 +46,11 @@ 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
- retun unless validation.errors.any?
53
+ return unless validation.errors.any?
52
54
 
53
55
  raise(InvalidDataError.new(message: "#{schema.class.name} #{validation.errors.to_h}"))
54
56
  end
@@ -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.0'
4
+ VERSION = '1.4.4'
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.0
4
+ version: 1.4.4
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