nats_wave 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.idea/.gitignore +8 -0
  3. data/.idea/misc.xml +4 -0
  4. data/.idea/modules.xml +8 -0
  5. data/.idea/nats_wave.iml +169 -0
  6. data/.idea/vcs.xml +6 -0
  7. data/.rspec +3 -0
  8. data/.rubocop.yml +16 -0
  9. data/CHANGELOG.md +5 -0
  10. data/CODE_OF_CONDUCT.md +136 -0
  11. data/Gemfile +15 -0
  12. data/Gemfile.lock +332 -0
  13. data/LICENSE.txt +21 -0
  14. data/README.md +985 -0
  15. data/Rakefile +12 -0
  16. data/config/nats_wave.yml +65 -0
  17. data/examples/catalog_model.rb +36 -0
  18. data/examples/configuration_examples.rb +68 -0
  19. data/examples/user_model.rb +58 -0
  20. data/lib/generators/nats_wave/install_generator.rb +40 -0
  21. data/lib/generators/nats_wave/templates/README +31 -0
  22. data/lib/generators/nats_wave/templates/create_nats_wave_failed_messages.rb +20 -0
  23. data/lib/generators/nats_wave/templates/create_nats_wave_failed_subscriptions.rb +20 -0
  24. data/lib/generators/nats_wave/templates/initializer.rb +64 -0
  25. data/lib/generators/nats_wave/templates/nats_wave.yml +65 -0
  26. data/lib/nats_wave/adapters/active_record.rb +206 -0
  27. data/lib/nats_wave/adapters/datadog_metrics.rb +93 -0
  28. data/lib/nats_wave/auto_registration.rb +109 -0
  29. data/lib/nats_wave/client.rb +142 -0
  30. data/lib/nats_wave/concerns/mappable.rb +172 -0
  31. data/lib/nats_wave/concerns/publishable.rb +216 -0
  32. data/lib/nats_wave/configuration.rb +105 -0
  33. data/lib/nats_wave/database_connector.rb +50 -0
  34. data/lib/nats_wave/dead_letter_queue.rb +146 -0
  35. data/lib/nats_wave/errors.rb +27 -0
  36. data/lib/nats_wave/message_transformer.rb +95 -0
  37. data/lib/nats_wave/metrics.rb +220 -0
  38. data/lib/nats_wave/middleware/authentication.rb +65 -0
  39. data/lib/nats_wave/middleware/base.rb +19 -0
  40. data/lib/nats_wave/middleware/logging.rb +58 -0
  41. data/lib/nats_wave/middleware/validation.rb +74 -0
  42. data/lib/nats_wave/model_mapper.rb +125 -0
  43. data/lib/nats_wave/model_registry.rb +150 -0
  44. data/lib/nats_wave/publisher.rb +151 -0
  45. data/lib/nats_wave/railtie.rb +111 -0
  46. data/lib/nats_wave/schema_registry.rb +77 -0
  47. data/lib/nats_wave/subscriber.rb +161 -0
  48. data/lib/nats_wave/version.rb +5 -0
  49. data/lib/nats_wave.rb +97 -0
  50. data/lib/tasks/nats_wave.rake +360 -0
  51. data/sig/nats_wave.rbs +5 -0
  52. metadata +385 -0
data/Gemfile.lock ADDED
@@ -0,0 +1,332 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ nats_wave (1.1.0)
5
+ activerecord (>= 6.1, < 8.0)
6
+ activesupport (>= 6.1, < 8.0)
7
+ concurrent-ruby (~> 1.1)
8
+ connection_pool (~> 2.3)
9
+ dogstatsd-ruby (~> 5.0)
10
+ json-schema (~> 4.0)
11
+ jwt (~> 2.7)
12
+ nats-pure (~> 2.0)
13
+ rails (>= 6.1, < 8.0)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ actioncable (7.2.2.1)
19
+ actionpack (= 7.2.2.1)
20
+ activesupport (= 7.2.2.1)
21
+ nio4r (~> 2.0)
22
+ websocket-driver (>= 0.6.1)
23
+ zeitwerk (~> 2.6)
24
+ actionmailbox (7.2.2.1)
25
+ actionpack (= 7.2.2.1)
26
+ activejob (= 7.2.2.1)
27
+ activerecord (= 7.2.2.1)
28
+ activestorage (= 7.2.2.1)
29
+ activesupport (= 7.2.2.1)
30
+ mail (>= 2.8.0)
31
+ actionmailer (7.2.2.1)
32
+ actionpack (= 7.2.2.1)
33
+ actionview (= 7.2.2.1)
34
+ activejob (= 7.2.2.1)
35
+ activesupport (= 7.2.2.1)
36
+ mail (>= 2.8.0)
37
+ rails-dom-testing (~> 2.2)
38
+ actionpack (7.2.2.1)
39
+ actionview (= 7.2.2.1)
40
+ activesupport (= 7.2.2.1)
41
+ nokogiri (>= 1.8.5)
42
+ racc
43
+ rack (>= 2.2.4, < 3.2)
44
+ rack-session (>= 1.0.1)
45
+ rack-test (>= 0.6.3)
46
+ rails-dom-testing (~> 2.2)
47
+ rails-html-sanitizer (~> 1.6)
48
+ useragent (~> 0.16)
49
+ actiontext (7.2.2.1)
50
+ actionpack (= 7.2.2.1)
51
+ activerecord (= 7.2.2.1)
52
+ activestorage (= 7.2.2.1)
53
+ activesupport (= 7.2.2.1)
54
+ globalid (>= 0.6.0)
55
+ nokogiri (>= 1.8.5)
56
+ actionview (7.2.2.1)
57
+ activesupport (= 7.2.2.1)
58
+ builder (~> 3.1)
59
+ erubi (~> 1.11)
60
+ rails-dom-testing (~> 2.2)
61
+ rails-html-sanitizer (~> 1.6)
62
+ activejob (7.2.2.1)
63
+ activesupport (= 7.2.2.1)
64
+ globalid (>= 0.3.6)
65
+ activemodel (7.2.2.1)
66
+ activesupport (= 7.2.2.1)
67
+ activerecord (7.2.2.1)
68
+ activemodel (= 7.2.2.1)
69
+ activesupport (= 7.2.2.1)
70
+ timeout (>= 0.4.0)
71
+ activestorage (7.2.2.1)
72
+ actionpack (= 7.2.2.1)
73
+ activejob (= 7.2.2.1)
74
+ activerecord (= 7.2.2.1)
75
+ activesupport (= 7.2.2.1)
76
+ marcel (~> 1.0)
77
+ activesupport (7.2.2.1)
78
+ base64
79
+ benchmark (>= 0.3)
80
+ bigdecimal
81
+ concurrent-ruby (~> 1.0, >= 1.3.1)
82
+ connection_pool (>= 2.2.5)
83
+ drb
84
+ i18n (>= 1.6, < 2)
85
+ logger (>= 1.4.2)
86
+ minitest (>= 5.1)
87
+ securerandom (>= 0.3)
88
+ tzinfo (~> 2.0, >= 2.0.5)
89
+ addressable (2.8.7)
90
+ public_suffix (>= 2.0.2, < 7.0)
91
+ ast (2.4.3)
92
+ base64 (0.3.0)
93
+ benchmark (0.4.1)
94
+ bigdecimal (3.2.2)
95
+ builder (3.3.0)
96
+ coderay (1.1.3)
97
+ concurrent-ruby (1.3.5)
98
+ connection_pool (2.5.3)
99
+ crack (1.0.0)
100
+ bigdecimal
101
+ rexml
102
+ crass (1.0.6)
103
+ database_cleaner (2.1.0)
104
+ database_cleaner-active_record (>= 2, < 3)
105
+ database_cleaner-active_record (2.2.1)
106
+ activerecord (>= 5.a)
107
+ database_cleaner-core (~> 2.0.0)
108
+ database_cleaner-core (2.0.1)
109
+ date (3.4.1)
110
+ diff-lcs (1.6.2)
111
+ docile (1.4.1)
112
+ dogstatsd-ruby (5.6.6)
113
+ drb (2.2.3)
114
+ erb (5.0.1)
115
+ erubi (1.13.1)
116
+ factory_bot (6.5.4)
117
+ activesupport (>= 6.1.0)
118
+ globalid (1.2.1)
119
+ activesupport (>= 6.1)
120
+ hashdiff (1.2.0)
121
+ i18n (1.14.7)
122
+ concurrent-ruby (~> 1.0)
123
+ io-console (0.8.0)
124
+ irb (1.15.2)
125
+ pp (>= 0.6.0)
126
+ rdoc (>= 4.0.0)
127
+ reline (>= 0.4.2)
128
+ json (2.12.2)
129
+ json-schema (4.3.1)
130
+ addressable (>= 2.8)
131
+ jwt (2.10.2)
132
+ base64
133
+ language_server-protocol (3.17.0.5)
134
+ lint_roller (1.1.0)
135
+ logger (1.7.0)
136
+ loofah (2.24.1)
137
+ crass (~> 1.0.2)
138
+ nokogiri (>= 1.12.0)
139
+ mail (2.8.1)
140
+ mini_mime (>= 0.1.1)
141
+ net-imap
142
+ net-pop
143
+ net-smtp
144
+ marcel (1.0.4)
145
+ method_source (1.1.0)
146
+ mini_mime (1.1.5)
147
+ mini_portile2 (2.8.9)
148
+ minitest (5.25.5)
149
+ nats-pure (2.5.0)
150
+ base64
151
+ concurrent-ruby (~> 1.0)
152
+ json
153
+ securerandom
154
+ uri
155
+ net-imap (0.5.9)
156
+ date
157
+ net-protocol
158
+ net-pop (0.1.2)
159
+ net-protocol
160
+ net-protocol (0.2.2)
161
+ timeout
162
+ net-smtp (0.5.1)
163
+ net-protocol
164
+ nio4r (2.7.4)
165
+ nokogiri (1.18.8)
166
+ mini_portile2 (~> 2.8.2)
167
+ racc (~> 1.4)
168
+ nokogiri (1.18.8-arm64-darwin)
169
+ racc (~> 1.4)
170
+ parallel (1.27.0)
171
+ parser (3.3.8.0)
172
+ ast (~> 2.4.1)
173
+ racc
174
+ pg (1.5.9)
175
+ pp (0.6.2)
176
+ prettyprint
177
+ prettyprint (0.2.0)
178
+ prism (1.4.0)
179
+ pry (0.15.2)
180
+ coderay (~> 1.1)
181
+ method_source (~> 1.0)
182
+ psych (5.2.6)
183
+ date
184
+ stringio
185
+ public_suffix (6.0.2)
186
+ racc (1.8.1)
187
+ rack (3.1.16)
188
+ rack-session (2.1.1)
189
+ base64 (>= 0.1.0)
190
+ rack (>= 3.0.0)
191
+ rack-test (2.2.0)
192
+ rack (>= 1.3)
193
+ rackup (2.2.1)
194
+ rack (>= 3)
195
+ rails (7.2.2.1)
196
+ actioncable (= 7.2.2.1)
197
+ actionmailbox (= 7.2.2.1)
198
+ actionmailer (= 7.2.2.1)
199
+ actionpack (= 7.2.2.1)
200
+ actiontext (= 7.2.2.1)
201
+ actionview (= 7.2.2.1)
202
+ activejob (= 7.2.2.1)
203
+ activemodel (= 7.2.2.1)
204
+ activerecord (= 7.2.2.1)
205
+ activestorage (= 7.2.2.1)
206
+ activesupport (= 7.2.2.1)
207
+ bundler (>= 1.15.0)
208
+ railties (= 7.2.2.1)
209
+ rails-dom-testing (2.3.0)
210
+ activesupport (>= 5.0.0)
211
+ minitest
212
+ nokogiri (>= 1.6)
213
+ rails-html-sanitizer (1.6.2)
214
+ loofah (~> 2.21)
215
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
216
+ railties (7.2.2.1)
217
+ actionpack (= 7.2.2.1)
218
+ activesupport (= 7.2.2.1)
219
+ irb (~> 1.13)
220
+ rackup (>= 1.0.0)
221
+ rake (>= 12.2)
222
+ thor (~> 1.0, >= 1.2.2)
223
+ zeitwerk (~> 2.6)
224
+ rainbow (3.1.1)
225
+ rake (13.3.0)
226
+ rdoc (6.14.2)
227
+ erb
228
+ psych (>= 4.0.0)
229
+ regexp_parser (2.10.0)
230
+ reline (0.6.1)
231
+ io-console (~> 0.5)
232
+ rexml (3.4.1)
233
+ rspec (3.13.1)
234
+ rspec-core (~> 3.13.0)
235
+ rspec-expectations (~> 3.13.0)
236
+ rspec-mocks (~> 3.13.0)
237
+ rspec-core (3.13.5)
238
+ rspec-support (~> 3.13.0)
239
+ rspec-expectations (3.13.5)
240
+ diff-lcs (>= 1.2.0, < 2.0)
241
+ rspec-support (~> 3.13.0)
242
+ rspec-mocks (3.13.5)
243
+ diff-lcs (>= 1.2.0, < 2.0)
244
+ rspec-support (~> 3.13.0)
245
+ rspec-rails (6.1.5)
246
+ actionpack (>= 6.1)
247
+ activesupport (>= 6.1)
248
+ railties (>= 6.1)
249
+ rspec-core (~> 3.13)
250
+ rspec-expectations (~> 3.13)
251
+ rspec-mocks (~> 3.13)
252
+ rspec-support (~> 3.13)
253
+ rspec-support (3.13.4)
254
+ rubocop (1.77.0)
255
+ json (~> 2.3)
256
+ language_server-protocol (~> 3.17.0.2)
257
+ lint_roller (~> 1.1.0)
258
+ parallel (~> 1.10)
259
+ parser (>= 3.3.0.2)
260
+ rainbow (>= 2.2.2, < 4.0)
261
+ regexp_parser (>= 2.9.3, < 3.0)
262
+ rubocop-ast (>= 1.45.1, < 2.0)
263
+ ruby-progressbar (~> 1.7)
264
+ unicode-display_width (>= 2.4.0, < 4.0)
265
+ rubocop-ast (1.45.1)
266
+ parser (>= 3.3.7.2)
267
+ prism (~> 1.4)
268
+ rubocop-capybara (2.22.1)
269
+ lint_roller (~> 1.1)
270
+ rubocop (~> 1.72, >= 1.72.1)
271
+ rubocop-factory_bot (2.27.1)
272
+ lint_roller (~> 1.1)
273
+ rubocop (~> 1.72, >= 1.72.1)
274
+ rubocop-rspec (2.31.0)
275
+ rubocop (~> 1.40)
276
+ rubocop-capybara (~> 2.17)
277
+ rubocop-factory_bot (~> 2.22)
278
+ rubocop-rspec_rails (~> 2.28)
279
+ rubocop-rspec_rails (2.29.1)
280
+ rubocop (~> 1.61)
281
+ ruby-progressbar (1.13.0)
282
+ securerandom (0.4.1)
283
+ simplecov (0.22.0)
284
+ docile (~> 1.1)
285
+ simplecov-html (~> 0.11)
286
+ simplecov_json_formatter (~> 0.1)
287
+ simplecov-html (0.13.1)
288
+ simplecov_json_formatter (0.1.4)
289
+ sqlite3 (1.7.3)
290
+ mini_portile2 (~> 2.8.0)
291
+ stringio (3.1.7)
292
+ thor (1.3.2)
293
+ timeout (0.4.3)
294
+ tzinfo (2.0.6)
295
+ concurrent-ruby (~> 1.0)
296
+ unicode-display_width (3.1.4)
297
+ unicode-emoji (~> 4.0, >= 4.0.4)
298
+ unicode-emoji (4.0.4)
299
+ uri (1.0.3)
300
+ useragent (0.16.11)
301
+ webmock (3.25.1)
302
+ addressable (>= 2.8.0)
303
+ crack (>= 0.3.2)
304
+ hashdiff (>= 0.4.0, < 2.0.0)
305
+ websocket-driver (0.8.0)
306
+ base64
307
+ websocket-extensions (>= 0.1.0)
308
+ websocket-extensions (0.1.5)
309
+ zeitwerk (2.7.3)
310
+
311
+ PLATFORMS
312
+ arm64-darwin-24
313
+ ruby
314
+
315
+ DEPENDENCIES
316
+ database_cleaner (~> 2.0)
317
+ factory_bot (~> 6.2)
318
+ nats_wave!
319
+ pg
320
+ pry (~> 0.14)
321
+ rails (~> 7.0)
322
+ rake (~> 13.0)
323
+ rspec (~> 3.0)
324
+ rspec-rails (~> 6.0)
325
+ rubocop (~> 1.50)
326
+ rubocop-rspec (~> 2.20)
327
+ simplecov (~> 0.22)
328
+ sqlite3 (~> 1.4)
329
+ webmock (~> 3.0)
330
+
331
+ BUNDLED WITH
332
+ 2.6.9
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Jeffrey Dabo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.