notifyfork 0.1.2__tar.gz → 0.1.2b0__tar.gz

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 (99) hide show
  1. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/PKG-INFO +1 -1
  2. notifyfork-0.1.2b0/notifyfork/core/infrastructure/admin.py +36 -0
  3. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/whatsapp_provider.py +2 -1
  4. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/pyproject.toml +1 -1
  5. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.env.example +0 -0
  6. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/auto-tag.yml +0 -0
  7. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/ci.yml +0 -0
  8. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/publish.yml +0 -0
  9. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.gitignore +0 -0
  10. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/CHANGELOG.md +0 -0
  11. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/CONTRIBUTING.md +0 -0
  12. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/LICENSE +0 -0
  13. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/README.md +0 -0
  14. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/README.md +0 -0
  15. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/custom_provider/register_xpto_provider.py +0 -0
  16. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/email/send_order_confirmed.py +0 -0
  17. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/email/send_sendgrid_external.py +0 -0
  18. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/push/send_flash_sale.py +0 -0
  19. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/slack/send_system_error.py +0 -0
  20. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/sms/send_otp.py +0 -0
  21. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/whatsapp/send_order_shipped.py +0 -0
  22. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/__init__.py +0 -0
  23. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/__init__.py +0 -0
  24. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/urls.py +0 -0
  25. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/__init__.py +0 -0
  26. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/resend_webhook.py +0 -0
  27. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/sendgrid_webhook.py +0 -0
  28. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/tasks.py +0 -0
  29. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/twilio_webhook.py +0 -0
  30. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/urls.py +0 -0
  31. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/client.py +0 -0
  32. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/__init__.py +0 -0
  33. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/__init__.py +0 -0
  34. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/dtos/__init__.py +0 -0
  35. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/dtos/send_notification_dto.py +0 -0
  36. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/__init__.py +0 -0
  37. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/notification_provider.py +0 -0
  38. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/notification_repository.py +0 -0
  39. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/template_repository.py +0 -0
  40. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/use_cases/__init__.py +0 -0
  41. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/use_cases/send_notification.py +0 -0
  42. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/__init__.py +0 -0
  43. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/entities/__init__.py +0 -0
  44. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/entities/notification.py +0 -0
  45. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/events/__init__.py +0 -0
  46. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/events/notification_events.py +0 -0
  47. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/value_objects/__init__.py +0 -0
  48. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/value_objects/template.py +0 -0
  49. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/__init__.py +0 -0
  50. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/apps.py +0 -0
  51. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/__init__.py +0 -0
  52. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/providers.py +0 -0
  53. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0001_initial.py +0 -0
  54. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0002_seed_templates.py +0 -0
  55. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0003_delivery_status.py +0 -0
  56. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/__init__.py +0 -0
  57. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/models/__init__.py +0 -0
  58. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/models/notification_model.py +0 -0
  59. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/__init__.py +0 -0
  60. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/firebase_provider.py +0 -0
  61. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/resend_provider.py +0 -0
  62. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/sendgrid_provider.py +0 -0
  63. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/slack_provider.py +0 -0
  64. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/smtp_provider.py +0 -0
  65. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/twilio_provider.py +0 -0
  66. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/queue/__init__.py +0 -0
  67. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/queue/tasks.py +0 -0
  68. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/__init__.py +0 -0
  69. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/notification_repository.py +0 -0
  70. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/template_repository.py +0 -0
  71. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/__init__.py +0 -0
  72. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/exceptions/__init__.py +0 -0
  73. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/exceptions/provider_exceptions.py +0 -0
  74. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/logging/__init__.py +0 -0
  75. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/logging/setup.py +0 -0
  76. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/utils/__init__.py +0 -0
  77. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/requirements.txt +0 -0
  78. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/__init__.py +0 -0
  79. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/conftest.py +0 -0
  80. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/integration/__init__.py +0 -0
  81. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/__init__.py +0 -0
  82. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/api/__init__.py +0 -0
  83. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/application/__init__.py +0 -0
  84. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/application/test_send_notification_use_case.py +0 -0
  85. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/conftest.py +0 -0
  86. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/__init__.py +0 -0
  87. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/test_notification_entity.py +0 -0
  88. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/test_template_value_object.py +0 -0
  89. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/__init__.py +0 -0
  90. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_resend_provider.py +0 -0
  91. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_sendgrid_provider.py +0 -0
  92. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_slack_provider.py +0 -0
  93. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_whatsapp_provider.py +0 -0
  94. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_client.py +0 -0
  95. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_container.py +0 -0
  96. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_custom_provider.py +0 -0
  97. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/webhooks/__init__.py +0 -0
  98. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/webhooks/test_delivery_status.py +0 -0
  99. {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notifyfork
3
- Version: 0.1.2
3
+ Version: 0.1.2b0
4
4
  Summary: Provider-agnostic notification gateway for Django. Send to SMS, Email, WhatsApp, Push, and Slack via a single API.
5
5
  Project-URL: Homepage, https://github.com/marioasaraujo/notifyfork
6
6
  Project-URL: Documentation, https://github.com/marioasaraujo/notifyfork#readme
@@ -0,0 +1,36 @@
1
+ from django.contrib import admin
2
+
3
+ from notifyfork.core.infrastructure.models import NotificationTemplateModel
4
+
5
+
6
+ @admin.register(NotificationTemplateModel)
7
+ class NotificationTemplateAdmin(admin.ModelAdmin):
8
+ list_display = ("id", "mode", "body_kind", "is_active", "updated_at")
9
+ list_filter = ("mode", "is_active")
10
+ search_fields = ("id",)
11
+ readonly_fields = ("created_at", "updated_at")
12
+
13
+ fieldsets = (
14
+ (None, {"fields": ("id", "mode", "is_active")}),
15
+ (
16
+ "Conteúdo",
17
+ {
18
+ "fields": ("body", "subject"),
19
+ "description": (
20
+ "Modo LOCAL: \"body\" é o texto/HTML enviado, com $variaveis "
21
+ "(ex: \"Seu código é: $code\"). "
22
+ "Modo EXTERNAL: \"body\" NÃO é texto de mensagem — é o ID do "
23
+ "template no provider. Para WhatsApp (Twilio) é o Content SID "
24
+ "(HXxxx); para SendGrid é o Dynamic Template ID (d-xxxx)."
25
+ ),
26
+ },
27
+ ),
28
+ ("Mapeamento de variáveis", {"fields": ("variable_mapping",)}),
29
+ ("Timestamps", {"fields": ("created_at", "updated_at")}),
30
+ )
31
+
32
+ @admin.display(description="body é...")
33
+ def body_kind(self, obj: NotificationTemplateModel) -> str:
34
+ if obj.mode == NotificationTemplateModel.ModeChoices.EXTERNAL:
35
+ return f"ID externo: {obj.body[:24]}"
36
+ return f"conteúdo local: {obj.body[:40]}"
@@ -1,3 +1,4 @@
1
+ import json
1
2
  import logging
2
3
  from typing import Any
3
4
 
@@ -99,7 +100,7 @@ class TwilioWhatsAppProvider(NotificationProvider):
99
100
  try:
100
101
  message = self._client.messages.create(
101
102
  content_sid=template.external_template_id,
102
- content_variables=str(translated), # Twilio expects JSON string
103
+ content_variables=json.dumps(translated), # Twilio expects JSON string
103
104
  from_=self._from_number,
104
105
  to=to,
105
106
  )
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "notifyfork"
7
- version = "0.1.2"
7
+ version = "0.1.2b"
8
8
  description = "Provider-agnostic notification gateway for Django. Send to SMS, Email, WhatsApp, Push, and Slack via a single API."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes