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.
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/PKG-INFO +1 -1
- notifyfork-0.1.2b0/notifyfork/core/infrastructure/admin.py +36 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/whatsapp_provider.py +2 -1
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/pyproject.toml +1 -1
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.env.example +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/auto-tag.yml +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/ci.yml +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.github/workflows/publish.yml +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/.gitignore +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/CHANGELOG.md +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/CONTRIBUTING.md +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/LICENSE +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/README.md +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/README.md +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/custom_provider/register_xpto_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/email/send_order_confirmed.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/email/send_sendgrid_external.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/push/send_flash_sale.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/slack/send_system_error.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/sms/send_otp.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/examples/whatsapp/send_order_shipped.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/urls.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/resend_webhook.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/sendgrid_webhook.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/tasks.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/twilio_webhook.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/api/webhooks/urls.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/client.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/dtos/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/dtos/send_notification_dto.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/notification_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/notification_repository.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/interfaces/template_repository.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/use_cases/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/use_cases/send_notification.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/entities/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/entities/notification.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/events/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/events/notification_events.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/value_objects/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/value_objects/template.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/apps.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/providers.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0001_initial.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0002_seed_templates.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0003_delivery_status.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/models/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/models/notification_model.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/firebase_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/resend_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/sendgrid_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/slack_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/smtp_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/twilio_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/queue/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/queue/tasks.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/notification_repository.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/template_repository.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/exceptions/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/exceptions/provider_exceptions.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/logging/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/logging/setup.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/shared/utils/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/requirements.txt +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/conftest.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/integration/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/api/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/application/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/application/test_send_notification_use_case.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/conftest.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/test_notification_entity.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/domain/test_template_value_object.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_resend_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_sendgrid_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_slack_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/providers/test_whatsapp_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_client.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_container.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/test_custom_provider.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/webhooks/__init__.py +0 -0
- {notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/webhooks/test_delivery_status.py +0 -0
- {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.
|
|
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=
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/dtos/send_notification_dto.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/application/use_cases/send_notification.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/domain/events/notification_events.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/__init__.py
RENAMED
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/container/providers.py
RENAMED
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/models/notification_model.py
RENAMED
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/resend_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/slack_provider.py
RENAMED
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/smtp_provider.py
RENAMED
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/providers/twilio_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/notifyfork/core/infrastructure/repositories/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{notifyfork-0.1.2 → notifyfork-0.1.2b0}/tests/unit/application/test_send_notification_use_case.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|