thecore_backend_commons 3.3.2 → 3.4.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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7db8739006ce3d17f311656e5e475aacd9a216f9bbaca6a1b863c67b6076c25
|
|
4
|
+
data.tar.gz: bacadaf2fc6496435e66e15655b2968368973b2550eed642e993c6be76b6928c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96ca054fe828e25f053dc4d213ccc0856e4fe52fbc7ee8a4b525c3252087b661f69a3baec6b01c96ba9bccf740fed489b0886c65b6db65c5567ef3d667e740a3
|
|
7
|
+
data.tar.gz: 979ce14b47d8eaa36a7cf721f0b1771d74c0f20d5ffbbb9686bd35ed136c077224a240fd796dddc3070d6ac577fb5a3b6fcf604a66104746bc1e7e326a14e1a1
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class PushDispatchJob < ApplicationJob
|
|
2
|
+
queue_as :"#{ENV.fetch('COMPOSE_PROJECT_NAME', 'default')}_default"
|
|
3
|
+
|
|
4
|
+
def perform(push_message_id)
|
|
5
|
+
message = PushMessage.find_by(id: push_message_id)
|
|
6
|
+
return unless message
|
|
7
|
+
|
|
8
|
+
ThecoreBackendCommons::PushNotificationService.dispatch(message.push_subscriber, message)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -36,7 +36,15 @@ module ThecoreBackendCommons
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def payload
|
|
39
|
-
{
|
|
39
|
+
{
|
|
40
|
+
id: @message.id,
|
|
41
|
+
title: @message.title,
|
|
42
|
+
body: @message.body,
|
|
43
|
+
sent_at: @message.created_at.iso8601,
|
|
44
|
+
type: @message.message_type,
|
|
45
|
+
url: @message.url,
|
|
46
|
+
icon: @message.icon
|
|
47
|
+
}.compact
|
|
40
48
|
end
|
|
41
49
|
|
|
42
50
|
def vapid_options
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thecore_backend_commons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
@@ -203,6 +203,7 @@ files:
|
|
|
203
203
|
- Rakefile
|
|
204
204
|
- app/channels/activity_log_channel.rb
|
|
205
205
|
- app/channels/push_notification_channel.rb
|
|
206
|
+
- app/jobs/push_dispatch_job.rb
|
|
206
207
|
- app/mailers/concerns/smtp_deliverable.rb
|
|
207
208
|
- app/models/push_message.rb
|
|
208
209
|
- app/models/push_subscriber.rb
|
|
@@ -223,6 +224,7 @@ files:
|
|
|
223
224
|
- db/migrate/20260616000001_create_push_subscribers.rb
|
|
224
225
|
- db/migrate/20260616000002_create_push_messages.rb
|
|
225
226
|
- db/migrate/20260625000001_add_sender_user_id_to_push_messages.rb
|
|
227
|
+
- db/migrate/20260629000001_add_message_type_to_push_messages.rb
|
|
226
228
|
- db/seeds.rb
|
|
227
229
|
- lib/tasks/thecore_backend_commons_tasks.rake
|
|
228
230
|
- lib/thecore_backend_commons.rb
|