pg_eventstore 1.1.3 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +4 -3
  4. data/docs/subscriptions.md +25 -2
  5. data/lib/pg_eventstore/abstract_command.rb +2 -0
  6. data/lib/pg_eventstore/callbacks.rb +3 -0
  7. data/lib/pg_eventstore/client.rb +6 -1
  8. data/lib/pg_eventstore/config.rb +1 -1
  9. data/lib/pg_eventstore/connection.rb +9 -1
  10. data/lib/pg_eventstore/errors.rb +45 -26
  11. data/lib/pg_eventstore/event.rb +2 -1
  12. data/lib/pg_eventstore/event_class_resolver.rb +1 -1
  13. data/lib/pg_eventstore/event_deserializer.rb +8 -2
  14. data/lib/pg_eventstore/event_serializer.rb +2 -0
  15. data/lib/pg_eventstore/extensions/callbacks_extension.rb +1 -0
  16. data/lib/pg_eventstore/extensions/options_extension.rb +3 -1
  17. data/lib/pg_eventstore/queries/event_queries.rb +12 -4
  18. data/lib/pg_eventstore/queries/links_resolver.rb +3 -0
  19. data/lib/pg_eventstore/queries/partition_queries.rb +6 -0
  20. data/lib/pg_eventstore/queries/transaction_queries.rb +4 -0
  21. data/lib/pg_eventstore/queries.rb +1 -1
  22. data/lib/pg_eventstore/query_builders/{events_filtering_query.rb → events_filtering.rb} +3 -0
  23. data/lib/pg_eventstore/sql_builder.rb +18 -10
  24. data/lib/pg_eventstore/stream.rb +13 -2
  25. data/lib/pg_eventstore/subscriptions/basic_runner.rb +2 -0
  26. data/lib/pg_eventstore/subscriptions/commands_handler.rb +5 -3
  27. data/lib/pg_eventstore/subscriptions/queries/subscription_command_queries.rb +6 -4
  28. data/lib/pg_eventstore/subscriptions/queries/subscription_queries.rb +4 -2
  29. data/lib/pg_eventstore/subscriptions/queries/subscriptions_set_command_queries.rb +6 -4
  30. data/lib/pg_eventstore/subscriptions/queries/subscriptions_set_queries.rb +3 -0
  31. data/lib/pg_eventstore/subscriptions/runner_state.rb +1 -0
  32. data/lib/pg_eventstore/subscriptions/subscription.rb +19 -17
  33. data/lib/pg_eventstore/subscriptions/subscription_feeder.rb +8 -0
  34. data/lib/pg_eventstore/subscriptions/subscription_feeder_commands/base.rb +4 -4
  35. data/lib/pg_eventstore/subscriptions/subscription_handler_performance.rb +2 -1
  36. data/lib/pg_eventstore/subscriptions/subscription_runner.rb +5 -0
  37. data/lib/pg_eventstore/subscriptions/subscription_runner_commands/base.rb +4 -4
  38. data/lib/pg_eventstore/subscriptions/subscriptions_manager.rb +15 -5
  39. data/lib/pg_eventstore/subscriptions/subscriptions_set.rb +10 -10
  40. data/lib/pg_eventstore/version.rb +2 -1
  41. data/lib/pg_eventstore/web/application.rb +6 -6
  42. data/lib/pg_eventstore/web/paginator/base_collection.rb +15 -1
  43. data/lib/pg_eventstore/web/paginator/event_types_collection.rb +2 -1
  44. data/lib/pg_eventstore/web/paginator/events_collection.rb +7 -4
  45. data/lib/pg_eventstore/web/paginator/helpers.rb +3 -3
  46. data/lib/pg_eventstore/web/paginator/stream_contexts_collection.rb +2 -1
  47. data/lib/pg_eventstore/web/paginator/stream_ids_collection.rb +2 -1
  48. data/lib/pg_eventstore/web/paginator/stream_names_collection.rb +2 -1
  49. data/lib/pg_eventstore/web/subscriptions/set_collection.rb +2 -0
  50. data/lib/pg_eventstore/web/subscriptions/subscriptions.rb +2 -0
  51. data/lib/pg_eventstore/web/subscriptions/subscriptions_set.rb +2 -0
  52. data/lib/pg_eventstore/web/subscriptions/subscriptions_to_set_association.rb +6 -1
  53. data/lib/pg_eventstore.rb +6 -1
  54. data/rbs_collection.lock.yaml +16 -0
  55. data/rbs_collection.yaml +23 -0
  56. data/sig/interfaces/callback.rbs +3 -0
  57. data/sig/interfaces/event_class_resolver.rbs +3 -0
  58. data/sig/interfaces/event_modifier.rbs +3 -0
  59. data/sig/interfaces/restart_terminator.rbs +3 -0
  60. data/sig/interfaces/subscription_handler.rbs +3 -0
  61. data/sig/pg/basic_type_registry.rbs +21 -0
  62. data/sig/pg/connection.rbs +407 -0
  63. data/sig/pg/constants.rbs +153 -0
  64. data/sig/pg_eventstore/abstract_command.rbs +11 -0
  65. data/sig/pg_eventstore/callbacks.rbs +21 -0
  66. data/sig/pg_eventstore/client.rbs +67 -0
  67. data/sig/pg_eventstore/commands/append.rbs +33 -0
  68. data/sig/pg_eventstore/commands/event_modifiers/prepare_link_event.rbs +24 -0
  69. data/sig/pg_eventstore/commands/event_modifiers/prepare_regular_event.rbs +12 -0
  70. data/sig/pg_eventstore/commands/link_to.rbs +17 -0
  71. data/sig/pg_eventstore/commands/multiple.rbs +7 -0
  72. data/sig/pg_eventstore/commands/read.rbs +10 -0
  73. data/sig/pg_eventstore/commands/regular_stream_read_paginated.rbs +32 -0
  74. data/sig/pg_eventstore/commands/system_stream_read_paginated.rbs +30 -0
  75. data/sig/pg_eventstore/config.rbs +51 -0
  76. data/sig/pg_eventstore/connection.rbs +30 -0
  77. data/sig/pg_eventstore/errors.rbs +116 -0
  78. data/sig/pg_eventstore/event.rbs +46 -0
  79. data/sig/pg_eventstore/event_class_resolver.rbs +6 -0
  80. data/sig/pg_eventstore/event_deserializer.rbs +20 -0
  81. data/sig/pg_eventstore/event_serializer.rbs +13 -0
  82. data/sig/pg_eventstore/extensions/callbacks_extension.rbs +23 -0
  83. data/sig/pg_eventstore/extensions/options_extension.rbs +37 -0
  84. data/sig/pg_eventstore/extensions/using_connection_extension.rbs +14 -0
  85. data/sig/pg_eventstore/middleware.rbs +9 -0
  86. data/sig/pg_eventstore/pg_connection.rbs +13 -0
  87. data/sig/pg_eventstore/queries/event_queries.rbs +50 -0
  88. data/sig/pg_eventstore/queries/links_resolver.rbs +19 -0
  89. data/sig/pg_eventstore/queries/partition_queries.rbs +74 -0
  90. data/sig/pg_eventstore/queries/transaction_queries.rbs +21 -0
  91. data/sig/pg_eventstore/queries.rbs +23 -0
  92. data/sig/pg_eventstore/query_builders/events_filtering_query.rbs +62 -0
  93. data/sig/pg_eventstore/sql_builder.rbs +74 -0
  94. data/sig/pg_eventstore/stream.rbs +40 -0
  95. data/sig/pg_eventstore/subscriptions/basic_runner.rbs +37 -0
  96. data/sig/pg_eventstore/subscriptions/command_handlers/subscription_feeder_commands.rbs +16 -0
  97. data/sig/pg_eventstore/subscriptions/command_handlers/subscription_runners_commands.rbs +18 -0
  98. data/sig/pg_eventstore/subscriptions/commands_handler.rbs +25 -0
  99. data/sig/pg_eventstore/subscriptions/events_processor.rbs +34 -0
  100. data/sig/pg_eventstore/subscriptions/extensions/base_command_extension.rbs +20 -0
  101. data/sig/pg_eventstore/subscriptions/extensions/command_class_lookup_extension.rbs +8 -0
  102. data/sig/pg_eventstore/subscriptions/queries/subscription_command_queries.rbs +56 -0
  103. data/sig/pg_eventstore/subscriptions/queries/subscription_queries.rbs +73 -0
  104. data/sig/pg_eventstore/subscriptions/queries/subscriptions_set_command_queries.rbs +39 -0
  105. data/sig/pg_eventstore/subscriptions/queries/subscriptions_set_queries.rbs +36 -0
  106. data/sig/pg_eventstore/subscriptions/runner_state.rbs +16 -0
  107. data/sig/pg_eventstore/subscriptions/subscription.rbs +96 -0
  108. data/sig/pg_eventstore/subscriptions/subscription_feeder.rbs +64 -0
  109. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands/base.rbs +45 -0
  110. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands/restore.rbs +8 -0
  111. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands/start_all.rbs +8 -0
  112. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands/stop.rbs +8 -0
  113. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands/stop_all.rbs +8 -0
  114. data/sig/pg_eventstore/subscriptions/subscription_feeder_commands.rbs +8 -0
  115. data/sig/pg_eventstore/subscriptions/subscription_handler_performance.rbs +12 -0
  116. data/sig/pg_eventstore/subscriptions/subscription_runner.rbs +55 -0
  117. data/sig/pg_eventstore/subscriptions/subscription_runner_commands/base.rbs +47 -0
  118. data/sig/pg_eventstore/subscriptions/subscription_runner_commands/reset_position.rbs +11 -0
  119. data/sig/pg_eventstore/subscriptions/subscription_runner_commands/restore.rbs +8 -0
  120. data/sig/pg_eventstore/subscriptions/subscription_runner_commands/start.rbs +8 -0
  121. data/sig/pg_eventstore/subscriptions/subscription_runner_commands/stop.rbs +8 -0
  122. data/sig/pg_eventstore/subscriptions/subscription_runner_commands.rbs +8 -0
  123. data/sig/pg_eventstore/subscriptions/subscription_runners_feeder.rbs +13 -0
  124. data/sig/pg_eventstore/subscriptions/subscriptions_manager.rbs +62 -0
  125. data/sig/pg_eventstore/subscriptions/subscriptions_set.rbs +72 -0
  126. data/sig/pg_eventstore/utils.rbs +20 -0
  127. data/sig/pg_eventstore/version.rbs +3 -0
  128. data/sig/pg_eventstore/web/paginator/base_collection.rbs +51 -0
  129. data/sig/pg_eventstore/web/paginator/event_types_collection.rbs +15 -0
  130. data/sig/pg_eventstore/web/paginator/events_collection.rbs +31 -0
  131. data/sig/pg_eventstore/web/paginator/helpers.rbs +38 -0
  132. data/sig/pg_eventstore/web/paginator/stream_contexts_collection.rbs +15 -0
  133. data/sig/pg_eventstore/web/paginator/stream_ids_collection.rbs +15 -0
  134. data/sig/pg_eventstore/web/paginator/stream_names_collection.rbs +15 -0
  135. data/sig/pg_eventstore/web/subscriptions/helpers.rbs +48 -0
  136. data/sig/pg_eventstore/web/subscriptions/set_collection.rbs +18 -0
  137. data/sig/pg_eventstore/web/subscriptions/subscriptions.rbs +18 -0
  138. data/sig/pg_eventstore/web/subscriptions/subscriptions_set.rbs +18 -0
  139. data/sig/pg_eventstore/web/subscriptions/subscriptions_to_set_association.rbs +18 -0
  140. data/sig/pg_eventstore.rbs +42 -0
  141. metadata +90 -3
@@ -0,0 +1,62 @@
1
+ module PgEventstore
2
+ class SubscriptionsManager
3
+ extend Forwardable
4
+
5
+ # _@param_ `config`
6
+ #
7
+ # _@param_ `set_name`
8
+ #
9
+ # _@param_ `max_retries` — max number of retries of failed SubscriptionsSet
10
+ #
11
+ # _@param_ `retries_interval` — a delay between retries of failed SubscriptionsSet
12
+ def initialize: (
13
+ config: PgEventstore::Config,
14
+ set_name: String,
15
+ ?max_retries: Integer?,
16
+ ?retries_interval: Integer?
17
+ ) -> void
18
+
19
+ # _@param_ `subscription_name` — subscription's name
20
+ #
21
+ # _@param_ `handler` — subscription's handler
22
+ #
23
+ # _@param_ `options` — request options
24
+ #
25
+ # _@param_ `middlewares` — provide a list of middleware names to override a config's middlewares
26
+ #
27
+ # _@param_ `pull_interval` — an interval in seconds to determine how often to query new events of the given subscription.
28
+ #
29
+ # _@param_ `max_retries` — max number of retries of failed Subscription
30
+ #
31
+ # _@param_ `retries_interval` — a delay between retries of failed Subscription
32
+ #
33
+ # _@param_ `restart_terminator` — a callable object which, when called - accepts PgEventstore::Subscription object to determine whether restarts should be stopped(true - stops restarts, false - continues restarts)
34
+ def subscribe: (
35
+ String subscription_name,
36
+ handler: _SubscriptionHandler,
37
+ ?options: ::Hash[untyped, untyped],
38
+ ?middlewares: ::Array[Symbol]?,
39
+ ?pull_interval: Integer | Float,
40
+ ?max_retries: Integer,
41
+ ?retries_interval: Integer | Float,
42
+ ?restart_terminator: _RestartTerminator?
43
+ ) -> void
44
+
45
+ def subscriptions: () -> ::Array[PgEventstore::Subscription]
46
+
47
+ def subscriptions_set: () -> PgEventstore::SubscriptionsSet?
48
+
49
+ # _@param_ `middlewares`
50
+ #
51
+ # _@param_ `handler`
52
+ def create_event_handler: (::Array[Symbol]? middlewares, untyped handler) -> Proc
53
+
54
+ # _@param_ `middlewares`
55
+ def select_middlewares: (?::Array[Symbol]? middlewares) -> ::Array[PgEventstore::Middleware]
56
+
57
+ def start: () -> PgEventstore::BasicRunner?
58
+
59
+ # Returns the value of attribute config.
60
+ attr_accessor config: PgEventstore::Config
61
+ end
62
+ end
@@ -0,0 +1,72 @@
1
+ module PgEventstore
2
+ class SubscriptionsSet
3
+ include PgEventstore::Extensions::UsingConnectionExtension
4
+ include PgEventstore::Extensions::OptionsExtension
5
+
6
+ # _@param_ `attrs`
7
+ def self.create: (::Hash[untyped, untyped] attrs) -> PgEventstore::SubscriptionsSet
8
+
9
+ def self.subscriptions_set_queries: () -> PgEventstore::SubscriptionsSetQueries
10
+
11
+ # _@param_ `attrs`
12
+ def assign_attributes: (::Hash[untyped, untyped] attrs) -> ::Hash[untyped, untyped]
13
+
14
+ # _@param_ `attrs`
15
+ def update: (::Hash[untyped, untyped] attrs) -> ::Hash[untyped, untyped]
16
+
17
+ def delete: () -> void
18
+
19
+ # Dup the current object without assigned connection
20
+ def dup: () -> PgEventstore::SubscriptionsSet
21
+
22
+ def reload: () -> PgEventstore::SubscriptionsSet
23
+
24
+ def hash: () -> Integer
25
+
26
+ # _@param_ `another`
27
+ def eql?: (untyped another) -> bool
28
+
29
+ # _@param_ `another`
30
+ def ==: (untyped another) -> bool
31
+
32
+ def subscriptions_set_queries: () -> PgEventstore::SubscriptionsSetQueries
33
+
34
+ def initialize: (**untyped options) -> void
35
+
36
+ def options_hash: () -> ::Hash[untyped, untyped]
37
+
38
+ # _@param_ `opt_name`
39
+ def readonly!: (Symbol opt_name) -> bool
40
+
41
+ # _@param_ `opt_name`
42
+ def readonly?: (Symbol opt_name) -> bool
43
+
44
+ # _@param_ `opt_name`
45
+ def readonly_error: (Symbol opt_name) -> void
46
+
47
+ # _@param_ `options`
48
+ def init_default_values: (::Hash[untyped, untyped] options) -> void
49
+
50
+ attr_accessor id: Integer?
51
+
52
+ attr_accessor name: String?
53
+
54
+ attr_accessor state: String?
55
+
56
+ attr_accessor restart_count: Integer?
57
+
58
+ attr_accessor max_restarts_number: Integer?
59
+
60
+ attr_accessor time_between_restarts: Integer?
61
+
62
+ attr_accessor last_restarted_at: Time?
63
+
64
+ attr_accessor last_error: { 'class' => String, 'message' => String, 'backtrace' => Array[String] }?
65
+
66
+ attr_accessor last_error_occurred_at: Time?
67
+
68
+ attr_accessor created_at: Time?
69
+
70
+ attr_accessor updated_at: Time?
71
+ end
72
+ end
@@ -0,0 +1,20 @@
1
+ module PgEventstore
2
+ class Utils
3
+ # _@param_ `object`
4
+ def self.deep_transform_keys: (untyped object) { (untyped key) -> untyped } -> Object
5
+
6
+ # _@param_ `object`
7
+ def self.deep_dup: (untyped object) -> Object
8
+
9
+ # _@param_ `array`
10
+ #
11
+ # _@return_ — positional variables, based on array size. Example: "$1, $2, $3"
12
+ def self.positional_vars: (::Array[untyped] array) -> String
13
+
14
+ # _@param_ `error`
15
+ def self.error_info: (StandardError error) -> ::Hash[untyped, untyped]
16
+
17
+ # _@param_ `str`
18
+ def self.underscore_str: (String str) -> String
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module PgEventstore
2
+ VERSION: String
3
+ end
@@ -0,0 +1,51 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class BaseCollection
5
+ # _@param_ `config_name`
6
+ #
7
+ # _@param_ `starting_id`
8
+ #
9
+ # _@param_ `per_page`
10
+ #
11
+ # _@param_ `order` — :asc or :desc
12
+ #
13
+ # _@param_ `options` — additional options to filter the collection
14
+ def initialize: (
15
+ Symbol config_name,
16
+ starting_id: (String | Integer)?,
17
+ per_page: Integer,
18
+ order: Symbol,
19
+ ?options: ::Hash[untyped, untyped]
20
+ ) -> void
21
+
22
+ def collection: () -> ::Array[untyped]
23
+
24
+ def count: () -> Integer
25
+
26
+ def next_page_starting_id: () -> (String | Integer)?
27
+
28
+ def prev_page_starting_id: () -> (String | Integer)?
29
+
30
+ def total_count: () -> Integer
31
+
32
+ def connection: () -> PgEventstore::Connection
33
+
34
+ # Returns the value of attribute config_name.
35
+ attr_accessor config_name: Symbol
36
+
37
+ # Returns the value of attribute starting_id.
38
+ attr_accessor starting_id: (String | Integer)?
39
+
40
+ # Returns the value of attribute per_page.
41
+ attr_accessor per_page: Integer
42
+
43
+ # Returns the value of attribute order.
44
+ attr_accessor order: Symbol
45
+
46
+ # Returns the value of attribute options.
47
+ attr_accessor options: ::Hash[untyped, untyped]
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,15 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class EventTypesCollection < PgEventstore::Web::Paginator::BaseCollection
5
+ PER_PAGE: Integer
6
+
7
+ def collection: () -> ::Array[::Hash[String, String]]
8
+
9
+ def next_page_starting_id: () -> String?
10
+
11
+ def direction_operator: () -> String
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,31 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class EventsCollection < PgEventstore::Web::Paginator::BaseCollection
5
+ SQL_DIRECTIONS: ::Hash[String, Symbol]
6
+ PER_PAGE: ::Hash[String, Integer]
7
+ MAX_NUMBER_TO_COUNT: Integer
8
+
9
+ def collection: () -> ::Array[PgEventstore::Event]
10
+
11
+ def next_page_starting_id: () -> Integer?
12
+
13
+ def prev_page_starting_id: () -> Integer?
14
+
15
+ def total_count: () -> Integer
16
+
17
+ # _@param_ `event`
18
+ def event_global_position: (PgEventstore::Event event) -> Integer?
19
+
20
+ # _@param_ `sql_builder`
21
+ def estimate_count: (PgEventstore::SQLBuilder sql_builder) -> Integer
22
+
23
+ # _@param_ `sql_builder`
24
+ def regular_count: (PgEventstore::SQLBuilder sql_builder) -> Integer
25
+
26
+ # _@param_ `sql_builder`
27
+ def global_position: (PgEventstore::SQLBuilder sql_builder) -> Integer?
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,38 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ module Helpers
5
+ # _@param_ `collection`
6
+ def previous_page_link: (PgEventstore::Web::Paginator::BaseCollection collection) -> String
7
+
8
+ # _@param_ `collection`
9
+ def next_page_link: (PgEventstore::Web::Paginator::BaseCollection collection) -> String
10
+
11
+ def first_page_link: () -> String
12
+
13
+ # _@param_ `per_page` — string representation of items per page. E.g. "10", "20", etc.
14
+ def per_page_url: (String per_page) -> String
15
+
16
+ # _@param_ `order` — "asc"/"desc"
17
+ def sort_url: (String order) -> String
18
+
19
+ # _@param_ `number` — total number of events by the current filter
20
+ def total_count: (Integer number) -> String
21
+
22
+ # _@param_ `number`
23
+ #
24
+ # _@param_ `delimiter`
25
+ def number_with_delimiter: (Integer number, ?delimiter: String) -> String
26
+
27
+ # _@param_ `event`
28
+ def stream_path: (PgEventstore::Event event) -> String
29
+
30
+ # _@param_ `starting_id`
31
+ def build_starting_id_link: ((String | Integer)? starting_id) -> String
32
+
33
+ # _@param_ `params`
34
+ def build_path: ((::Hash[untyped, untyped] | ::Array[untyped]) params) -> String
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,15 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class StreamContextsCollection < PgEventstore::Web::Paginator::BaseCollection
5
+ PER_PAGE: Integer
6
+
7
+ def collection: () -> ::Array[::Hash[String, String]]
8
+
9
+ def next_page_starting_id: () -> String?
10
+
11
+ def direction_operator: () -> String
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class StreamIdsCollection < PgEventstore::Web::Paginator::BaseCollection
5
+ PER_PAGE: Integer
6
+
7
+ def collection: () -> ::Array[::Hash[String, String]]
8
+
9
+ def next_page_starting_id: () -> String?
10
+
11
+ def direction_operator: () -> String
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Paginator
4
+ class StreamNamesCollection < PgEventstore::Web::Paginator::BaseCollection
5
+ PER_PAGE: Integer
6
+
7
+ def collection: () -> ::Array[::Hash[String, String]]
8
+
9
+ def next_page_starting_id: () -> String?
10
+
11
+ def direction_operator: () -> String
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,48 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Subscriptions
4
+ module Helpers
5
+ # _@param_ `set_name`
6
+ def subscriptions_url: (?set_name: String?) -> String
7
+
8
+ # _@param_ `set_id`
9
+ #
10
+ # _@param_ `id`
11
+ #
12
+ # _@param_ `cmd`
13
+ def subscription_cmd_url: (Integer set_id, Integer id, String cmd) -> String
14
+
15
+ # _@param_ `id`
16
+ #
17
+ # _@param_ `cmd`
18
+ def subscriptions_set_cmd_url: (Integer id, String cmd) -> String
19
+
20
+ # _@param_ `cmd_name` — command name
21
+ #
22
+ # _@return_ — command name
23
+ def subscriptions_set_cmd: (String cmd_name) -> String
24
+
25
+ # _@param_ `cmd_name`
26
+ def validate_subscriptions_set_cmd: (String cmd_name) -> void
27
+
28
+ # _@param_ `cmd_name` — command name
29
+ #
30
+ # _@return_ — command name
31
+ def subscription_cmd: (String cmd_name) -> String
32
+
33
+ # _@param_ `cmd_name`
34
+ def validate_subscription_cmd: (String cmd_name) -> void
35
+
36
+ # _@param_ `state`
37
+ #
38
+ # _@param_ `updated_at`
39
+ #
40
+ # _@return_ — html status
41
+ def colored_state: (String state, Time updated_at) -> String
42
+
43
+ # _@param_ `ids`
44
+ def delete_all_subscriptions_url: (::Array[Integer] ids) -> String
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,18 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Subscriptions
4
+ class SetCollection
5
+ # _@param_ `connection`
6
+ def initialize: (PgEventstore::Connection connection) -> void
7
+
8
+ def names: () -> ::Array[String]
9
+
10
+ def subscription_queries: () -> PgEventstore::SubscriptionQueries
11
+
12
+ def subscriptions_set_queries: () -> PgEventstore::SubscriptionsSetQueries
13
+
14
+ attr_accessor connection: PgEventstore::Connection
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Subscriptions
4
+ class Subscriptions
5
+ # _@param_ `connection`
6
+ #
7
+ # _@param_ `current_set`
8
+ def initialize: (PgEventstore::Connection connection, String current_set) -> void
9
+
10
+ def subscriptions: () -> ::Array[PgEventstore::Subscription]
11
+
12
+ def subscription_queries: () -> PgEventstore::SubscriptionQueries
13
+
14
+ attr_accessor connection: PgEventstore::Connection
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Subscriptions
4
+ class SubscriptionsSet
5
+ # _@param_ `connection`
6
+ #
7
+ # _@param_ `current_set`
8
+ def initialize: (PgEventstore::Connection connection, String? current_set) -> void
9
+
10
+ def subscriptions_set: () -> ::Array[PgEventstore::SubscriptionsSet]
11
+
12
+ def subscriptions_set_queries: () -> PgEventstore::SubscriptionsSetQueries
13
+
14
+ attr_accessor connection: PgEventstore::Connection
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module PgEventstore
2
+ module Web
3
+ module Subscriptions
4
+ class SubscriptionsToSetAssociation
5
+ # _@param_ `subscriptions_set`
6
+ #
7
+ # _@param_ `subscriptions`
8
+ def initialize: (subscriptions_set: ::Array[PgEventstore::SubscriptionsSet], subscriptions: ::Array[PgEventstore::Subscription]) -> void
9
+
10
+ def association: () -> ::Hash[PgEventstore::SubscriptionsSet, ::Array[PgEventstore::Subscription]]
11
+
12
+ attr_accessor subscriptions_set: ::Array[PgEventstore::SubscriptionsSet]
13
+
14
+ attr_accessor subscriptions: ::Array[PgEventstore::Subscription]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,42 @@
1
+ module PgEventstore
2
+ # _@param_ `name` — a name to assign to a config
3
+ #
4
+ # _@return_ — a result of the given block
5
+ def self.configure: (?name: Symbol) { (PgEventstore::Config) -> untyped } -> Object
6
+
7
+ def self.available_configs: () -> ::Array[Symbol]
8
+
9
+ # _@param_ `name`
10
+ def self.config: (?Symbol name) -> PgEventstore::Config
11
+
12
+ # _@param_ `name`
13
+ def self.connection: (?Symbol name) -> PgEventstore::Connection
14
+
15
+ # _@param_ `config_name`
16
+ #
17
+ # _@param_ `subscription_set`
18
+ #
19
+ # _@param_ `max_retries` — max number of retries of failed SubscriptionsSet
20
+ #
21
+ # _@param_ `retries_interval` — a delay between retries of failed SubscriptionsSet
22
+ def self.subscriptions_manager: (
23
+ ?Symbol config_name,
24
+ subscription_set: String,
25
+ ?max_retries: Integer?,
26
+ ?retries_interval: Integer?
27
+ ) -> PgEventstore::SubscriptionsManager
28
+
29
+ # _@param_ `name`
30
+ def self.client: (?Symbol name) -> PgEventstore::Client
31
+
32
+ def self.logger: () -> Logger?
33
+
34
+ # _@param_ `logger`
35
+ def self.logger=: (Logger? logger) -> Logger?
36
+
37
+ def self.init_variables: () -> void
38
+
39
+ def self.mutex: () -> Thread::Mutex
40
+
41
+ def self.mutex=: (Thread::Mutex value) -> Thread::Mutex
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_eventstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Dzyzenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -110,7 +110,7 @@ files:
110
110
  - lib/pg_eventstore/queries/links_resolver.rb
111
111
  - lib/pg_eventstore/queries/partition_queries.rb
112
112
  - lib/pg_eventstore/queries/transaction_queries.rb
113
- - lib/pg_eventstore/query_builders/events_filtering_query.rb
113
+ - lib/pg_eventstore/query_builders/events_filtering.rb
114
114
  - lib/pg_eventstore/rspec/has_option_matcher.rb
115
115
  - lib/pg_eventstore/rspec/test_helpers.rb
116
116
  - lib/pg_eventstore/sql_builder.rb
@@ -190,6 +190,93 @@ files:
190
190
  - lib/pg_eventstore/web/views/layouts/application.erb
191
191
  - lib/pg_eventstore/web/views/subscriptions/index.erb
192
192
  - pg_eventstore.gemspec
193
+ - rbs_collection.lock.yaml
194
+ - rbs_collection.yaml
195
+ - sig/interfaces/callback.rbs
196
+ - sig/interfaces/event_class_resolver.rbs
197
+ - sig/interfaces/event_modifier.rbs
198
+ - sig/interfaces/restart_terminator.rbs
199
+ - sig/interfaces/subscription_handler.rbs
200
+ - sig/pg/basic_type_registry.rbs
201
+ - sig/pg/connection.rbs
202
+ - sig/pg/constants.rbs
203
+ - sig/pg_eventstore.rbs
204
+ - sig/pg_eventstore/abstract_command.rbs
205
+ - sig/pg_eventstore/callbacks.rbs
206
+ - sig/pg_eventstore/client.rbs
207
+ - sig/pg_eventstore/commands/append.rbs
208
+ - sig/pg_eventstore/commands/event_modifiers/prepare_link_event.rbs
209
+ - sig/pg_eventstore/commands/event_modifiers/prepare_regular_event.rbs
210
+ - sig/pg_eventstore/commands/link_to.rbs
211
+ - sig/pg_eventstore/commands/multiple.rbs
212
+ - sig/pg_eventstore/commands/read.rbs
213
+ - sig/pg_eventstore/commands/regular_stream_read_paginated.rbs
214
+ - sig/pg_eventstore/commands/system_stream_read_paginated.rbs
215
+ - sig/pg_eventstore/config.rbs
216
+ - sig/pg_eventstore/connection.rbs
217
+ - sig/pg_eventstore/errors.rbs
218
+ - sig/pg_eventstore/event.rbs
219
+ - sig/pg_eventstore/event_class_resolver.rbs
220
+ - sig/pg_eventstore/event_deserializer.rbs
221
+ - sig/pg_eventstore/event_serializer.rbs
222
+ - sig/pg_eventstore/extensions/callbacks_extension.rbs
223
+ - sig/pg_eventstore/extensions/options_extension.rbs
224
+ - sig/pg_eventstore/extensions/using_connection_extension.rbs
225
+ - sig/pg_eventstore/middleware.rbs
226
+ - sig/pg_eventstore/pg_connection.rbs
227
+ - sig/pg_eventstore/queries.rbs
228
+ - sig/pg_eventstore/queries/event_queries.rbs
229
+ - sig/pg_eventstore/queries/links_resolver.rbs
230
+ - sig/pg_eventstore/queries/partition_queries.rbs
231
+ - sig/pg_eventstore/queries/transaction_queries.rbs
232
+ - sig/pg_eventstore/query_builders/events_filtering_query.rbs
233
+ - sig/pg_eventstore/sql_builder.rbs
234
+ - sig/pg_eventstore/stream.rbs
235
+ - sig/pg_eventstore/subscriptions/basic_runner.rbs
236
+ - sig/pg_eventstore/subscriptions/command_handlers/subscription_feeder_commands.rbs
237
+ - sig/pg_eventstore/subscriptions/command_handlers/subscription_runners_commands.rbs
238
+ - sig/pg_eventstore/subscriptions/commands_handler.rbs
239
+ - sig/pg_eventstore/subscriptions/events_processor.rbs
240
+ - sig/pg_eventstore/subscriptions/extensions/base_command_extension.rbs
241
+ - sig/pg_eventstore/subscriptions/extensions/command_class_lookup_extension.rbs
242
+ - sig/pg_eventstore/subscriptions/queries/subscription_command_queries.rbs
243
+ - sig/pg_eventstore/subscriptions/queries/subscription_queries.rbs
244
+ - sig/pg_eventstore/subscriptions/queries/subscriptions_set_command_queries.rbs
245
+ - sig/pg_eventstore/subscriptions/queries/subscriptions_set_queries.rbs
246
+ - sig/pg_eventstore/subscriptions/runner_state.rbs
247
+ - sig/pg_eventstore/subscriptions/subscription.rbs
248
+ - sig/pg_eventstore/subscriptions/subscription_feeder.rbs
249
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands.rbs
250
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands/base.rbs
251
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands/restore.rbs
252
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands/start_all.rbs
253
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands/stop.rbs
254
+ - sig/pg_eventstore/subscriptions/subscription_feeder_commands/stop_all.rbs
255
+ - sig/pg_eventstore/subscriptions/subscription_handler_performance.rbs
256
+ - sig/pg_eventstore/subscriptions/subscription_runner.rbs
257
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands.rbs
258
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands/base.rbs
259
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands/reset_position.rbs
260
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands/restore.rbs
261
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands/start.rbs
262
+ - sig/pg_eventstore/subscriptions/subscription_runner_commands/stop.rbs
263
+ - sig/pg_eventstore/subscriptions/subscription_runners_feeder.rbs
264
+ - sig/pg_eventstore/subscriptions/subscriptions_manager.rbs
265
+ - sig/pg_eventstore/subscriptions/subscriptions_set.rbs
266
+ - sig/pg_eventstore/utils.rbs
267
+ - sig/pg_eventstore/version.rbs
268
+ - sig/pg_eventstore/web/paginator/base_collection.rbs
269
+ - sig/pg_eventstore/web/paginator/event_types_collection.rbs
270
+ - sig/pg_eventstore/web/paginator/events_collection.rbs
271
+ - sig/pg_eventstore/web/paginator/helpers.rbs
272
+ - sig/pg_eventstore/web/paginator/stream_contexts_collection.rbs
273
+ - sig/pg_eventstore/web/paginator/stream_ids_collection.rbs
274
+ - sig/pg_eventstore/web/paginator/stream_names_collection.rbs
275
+ - sig/pg_eventstore/web/subscriptions/helpers.rbs
276
+ - sig/pg_eventstore/web/subscriptions/set_collection.rbs
277
+ - sig/pg_eventstore/web/subscriptions/subscriptions.rbs
278
+ - sig/pg_eventstore/web/subscriptions/subscriptions_set.rbs
279
+ - sig/pg_eventstore/web/subscriptions/subscriptions_to_set_association.rbs
193
280
  homepage: https://github.com/yousty/pg_eventstore
194
281
  licenses:
195
282
  - MIT