rails_event_store 2.8.1 → 2.9.1

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: de4a43cd1f055f1f752a5afed0d4110b0a7f9b5e08283beb9d4beb39abf82fc0
4
- data.tar.gz: 74de922f6ad0878e99a7086132cf0a4626ae80f95e195ac57a78d93c0b89dc6a
3
+ metadata.gz: f547a33f75be9a69d32ffc99ea19b680fb35744d5c20b478effcba828439ac2e
4
+ data.tar.gz: d6103a7a68b1ee7230f254445be460983b160c8d6e7383c300e658261a6702e2
5
5
  SHA512:
6
- metadata.gz: ccd89784fc6bbec24999a2e13ed75b6fd5335bb073ad4bf74b382032e3b97be11f984b4edefb16a9f07e9416a7c818efa4f228159283094429b178b6fc1d3e98
7
- data.tar.gz: de46755abd4bdece86312b4a1e9d0943527682e907d3ead4e0876e340212fcc0ae15b194eb6824db85716fc4a2c74cb3067c09ba55cadd0b856e5bf439abfb29
6
+ metadata.gz: 772a73bc208254277062b9cde2d811c29414cea5a698b2abeb36dfe32892155cf634223f32707fbb344df24205c36d793f55e6e23091d0a693950db803cce2c3
7
+ data.tar.gz: a1b8e4dd54fba0594cdefec218561b7abcfd8ca16f58f78c3e746e2b70de59ebacf8da4e188c0c5ed9e845aaed6dd700d7acb5c3df4b2b7bd35b0eeac02555f0
@@ -10,7 +10,6 @@ require_relative "json_client"
10
10
  require_relative "version"
11
11
  require_relative "railtie"
12
12
  require_relative "browser"
13
- require_relative "default_client_profile"
14
13
 
15
14
  module RailsEventStore
16
15
  Event = RubyEventStore::Event
@@ -2,32 +2,54 @@
2
2
 
3
3
  module RailsEventStore
4
4
  class JSONClient < Client
5
- def initialize(repository: RubyEventStore::ActiveRecord::EventRepository.new(serializer: RubyEventStore::NULL))
5
+ def initialize(
6
+ mapper: RubyEventStore::Mappers::Default.new,
7
+ repository: RubyEventStore::ActiveRecord::EventRepository.new(serializer: RubyEventStore::NULL),
8
+ subscriptions: RubyEventStore::Subscriptions.new,
9
+ dispatcher: RubyEventStore::ComposedDispatcher.new(
10
+ RailsEventStore::AfterCommitAsyncDispatcher.new(
11
+ scheduler: ActiveJobScheduler.new(serializer: RubyEventStore::Serializers::YAML)
12
+ ),
13
+ RubyEventStore::Dispatcher.new
14
+ ),
15
+ clock: default_clock,
16
+ correlation_id_generator: default_correlation_id_generator,
17
+ request_metadata: default_request_metadata
18
+ )
6
19
  super(
7
20
  mapper:
8
- RubyEventStore::Mappers::PipelineMapper.new(
9
- RubyEventStore::Mappers::Pipeline.new(
10
- RubyEventStore::Mappers::Transformation::PreserveTypes
11
- .new
12
- .register(Symbol, serializer: ->(v) { v.to_s }, deserializer: ->(v) { v.to_sym })
13
- .register(
14
- Time,
15
- serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
16
- deserializer: ->(v) { Time.iso8601(v) }
17
- )
18
- .register(
19
- ActiveSupport::TimeWithZone,
20
- serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
21
- deserializer: ->(v) { Time.iso8601(v).in_time_zone },
22
- stored_type: ->(*) { "ActiveSupport::TimeWithZone" }
23
- )
24
- .register(Date, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { Date.iso8601(v) })
25
- .register(DateTime, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { DateTime.iso8601(v) }),
26
- RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new
27
- )
21
+ RubyEventStore::Mappers::InstrumentedMapper.new(
22
+ RubyEventStore::Mappers::PipelineMapper.new(
23
+ RubyEventStore::Mappers::Pipeline.new(
24
+ RubyEventStore::Mappers::Transformation::PreserveTypes
25
+ .new
26
+ .register(Symbol, serializer: ->(v) { v.to_s }, deserializer: ->(v) { v.to_sym })
27
+ .register(
28
+ Time,
29
+ serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
30
+ deserializer: ->(v) { Time.iso8601(v) }
31
+ )
32
+ .register(
33
+ ActiveSupport::TimeWithZone,
34
+ serializer: ->(v) { v.iso8601(RubyEventStore::TIMESTAMP_PRECISION) },
35
+ deserializer: ->(v) { Time.iso8601(v).in_time_zone },
36
+ stored_type: ->(*) { "ActiveSupport::TimeWithZone" }
37
+ )
38
+ .register(Date, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { Date.iso8601(v) })
39
+ .register(DateTime, serializer: ->(v) { v.iso8601 }, deserializer: ->(v) { DateTime.iso8601(v) })
40
+ .register(BigDecimal, serializer: ->(v) { v.to_s }, deserializer: ->(v) { BigDecimal(v) }),
41
+ RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new
42
+ )
43
+ ),
44
+ ActiveSupport::Notifications
28
45
  ),
29
- repository: repository
46
+ repository: RubyEventStore::InstrumentedRepository.new(repository, ActiveSupport::Notifications),
47
+ subscriptions: RubyEventStore::InstrumentedSubscriptions.new(subscriptions, ActiveSupport::Notifications),
48
+ clock: clock,
49
+ correlation_id_generator: correlation_id_generator,
50
+ dispatcher: RubyEventStore::InstrumentedDispatcher.new(dispatcher, ActiveSupport::Notifications)
30
51
  )
52
+ @request_metadata = request_metadata
31
53
  end
32
54
  end
33
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsEventStore
4
- VERSION = "2.8.1"
4
+ VERSION = "2.9.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-16 00:00:00.000000000 Z
11
+ date: 2023-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_event_store
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.1
19
+ version: 2.9.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.8.1
26
+ version: 2.9.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby_event_store-browser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.1
33
+ version: 2.9.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.8.1
40
+ version: 2.9.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rails_event_store_active_record
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.8.1
47
+ version: 2.9.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.8.1
54
+ version: 2.9.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: aggregate_root
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.8.1
61
+ version: 2.9.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.8.1
68
+ version: 2.9.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -149,7 +149,6 @@ files:
149
149
  - lib/rails_event_store/async_handler_helpers.rb
150
150
  - lib/rails_event_store/browser.rb
151
151
  - lib/rails_event_store/client.rb
152
- - lib/rails_event_store/default_client_profile.rb
153
152
  - lib/rails_event_store/json_client.rb
154
153
  - lib/rails_event_store/link_by_metadata.rb
155
154
  - lib/rails_event_store/middleware.rb
@@ -179,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
180
  requirements: []
182
- rubygems_version: 3.3.26
181
+ rubygems_version: 3.3.7
183
182
  signing_key:
184
183
  specification_version: 4
185
184
  summary: Rails wrapper for RubyEventStore with batteries included
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RailsEventStore
4
- class DefaultClientProfile
5
- def call(adapter)
6
- adapter.downcase.eql?("postgresql") ? "RailsEventStore::JSONClient.new" : "RailsEventStore::Client.new"
7
- end
8
- end
9
- end