@bernierllc/email 1.0.1 → 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.
- package/README.md +76 -217
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/simple-email-service.d.ts +58 -0
- package/dist/simple-email-service.d.ts.map +1 -0
- package/dist/simple-email-service.js +416 -0
- package/dist/simple-email-service.js.map +1 -0
- package/dist/types.d.ts +311 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +33 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -22
- package/.eslintrc.json +0 -112
- package/.flake8 +0 -18
- package/.github/workflows/ci.yml +0 -300
- package/EXTRACTION_SUMMARY.md +0 -265
- package/IMPLEMENTATION_STATUS.md +0 -159
- package/OPEN_SOURCE_SETUP.md +0 -420
- package/PACKAGE_USAGE.md +0 -471
- package/examples/fastapi-example/main.py +0 -257
- package/examples/nextjs-example/next-env.d.ts +0 -13
- package/examples/nextjs-example/package.json +0 -26
- package/examples/nextjs-example/pages/admin/templates.tsx +0 -157
- package/examples/nextjs-example/tsconfig.json +0 -28
- package/packages/core/package.json +0 -70
- package/packages/core/rollup.config.js +0 -37
- package/packages/core/specification.md +0 -416
- package/packages/core/src/adapters/supabase.ts +0 -291
- package/packages/core/src/core/scheduler.ts +0 -356
- package/packages/core/src/core/template-manager.ts +0 -388
- package/packages/core/src/index.ts +0 -30
- package/packages/core/src/providers/base.ts +0 -104
- package/packages/core/src/providers/sendgrid.ts +0 -368
- package/packages/core/src/types/provider.ts +0 -91
- package/packages/core/src/types/scheduled.ts +0 -78
- package/packages/core/src/types/template.ts +0 -97
- package/packages/core/tsconfig.json +0 -23
- package/packages/python/README.md +0 -106
- package/packages/python/email_template_manager/__init__.py +0 -66
- package/packages/python/email_template_manager/config.py +0 -98
- package/packages/python/email_template_manager/core/magic_links.py +0 -245
- package/packages/python/email_template_manager/core/manager.py +0 -344
- package/packages/python/email_template_manager/core/scheduler.py +0 -473
- package/packages/python/email_template_manager/exceptions.py +0 -67
- package/packages/python/email_template_manager/models/magic_link.py +0 -59
- package/packages/python/email_template_manager/models/scheduled.py +0 -78
- package/packages/python/email_template_manager/models/template.py +0 -90
- package/packages/python/email_template_manager/providers/aws_ses.py +0 -44
- package/packages/python/email_template_manager/providers/base.py +0 -94
- package/packages/python/email_template_manager/providers/sendgrid.py +0 -325
- package/packages/python/email_template_manager/providers/smtp.py +0 -44
- package/packages/python/pyproject.toml +0 -133
- package/packages/python/setup.py +0 -93
- package/packages/python/specification.md +0 -930
- package/packages/react/README.md +0 -13
- package/packages/react/package.json +0 -105
- package/packages/react/rollup.config.js +0 -37
- package/packages/react/specification.md +0 -569
- package/packages/react/src/index.ts +0 -20
- package/packages/react/tsconfig.json +0 -24
- package/plans/email-template-manager_app-admin.md +0 -590
- package/src/index.js +0 -1
- package/test_package.py +0 -125
package/test_package.py
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
#!/usr/bin/env python3
|
|
10
|
-
"""
|
|
11
|
-
Test script to verify the email template manager package structure
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
import sys
|
|
15
|
-
import os
|
|
16
|
-
|
|
17
|
-
# Add the packages/python directory to the path for testing
|
|
18
|
-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'packages', 'python'))
|
|
19
|
-
|
|
20
|
-
def test_imports():
|
|
21
|
-
"""Test that core imports work"""
|
|
22
|
-
try:
|
|
23
|
-
# Test core imports
|
|
24
|
-
from email_template_manager.exceptions import EmailTemplateManagerError
|
|
25
|
-
from email_template_manager.models.template import EmailTemplate, TemplateVariable
|
|
26
|
-
from email_template_manager.models.scheduled import ScheduledEmail
|
|
27
|
-
from email_template_manager.providers.base import EmailProvider, EmailMessage
|
|
28
|
-
from email_template_manager.config import EmailManagerConfig
|
|
29
|
-
|
|
30
|
-
print("✅ Core imports successful!")
|
|
31
|
-
|
|
32
|
-
# Test creating a template
|
|
33
|
-
template = EmailTemplate(
|
|
34
|
-
name="Test Template",
|
|
35
|
-
subject="Hello {{name}}!",
|
|
36
|
-
html_body="<h1>Hello {{name}}!</h1>",
|
|
37
|
-
text_body="Hello {{name}}!",
|
|
38
|
-
variables=[
|
|
39
|
-
TemplateVariable(name="name", type="text", required=True)
|
|
40
|
-
],
|
|
41
|
-
tags=["test"],
|
|
42
|
-
is_active=True,
|
|
43
|
-
version=1
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
print(f"✅ Template created: {template.name}")
|
|
47
|
-
|
|
48
|
-
# Test creating a scheduled email
|
|
49
|
-
scheduled_email = ScheduledEmail(
|
|
50
|
-
template_id="test-template",
|
|
51
|
-
recipient_email="test@example.com",
|
|
52
|
-
variables={"name": "Test User"},
|
|
53
|
-
trigger_type="immediate",
|
|
54
|
-
status="pending",
|
|
55
|
-
retry_count=0,
|
|
56
|
-
max_retries=3,
|
|
57
|
-
metadata={}
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
print(f"✅ Scheduled email created for: {scheduled_email.recipient_email}")
|
|
61
|
-
|
|
62
|
-
return True
|
|
63
|
-
|
|
64
|
-
except ImportError as e:
|
|
65
|
-
print(f"❌ Import error: {e}")
|
|
66
|
-
return False
|
|
67
|
-
except Exception as e:
|
|
68
|
-
print(f"❌ Error: {e}")
|
|
69
|
-
return False
|
|
70
|
-
|
|
71
|
-
def test_sendgrid_provider():
|
|
72
|
-
"""Test SendGrid provider (without actual API call)"""
|
|
73
|
-
try:
|
|
74
|
-
from email_template_manager.providers.sendgrid import SendGridProvider
|
|
75
|
-
|
|
76
|
-
# Test provider creation (will fail without API key, but that's expected)
|
|
77
|
-
try:
|
|
78
|
-
provider = SendGridProvider({
|
|
79
|
-
'api_key': 'test-key',
|
|
80
|
-
'from_email': 'test@example.com'
|
|
81
|
-
})
|
|
82
|
-
print("✅ SendGrid provider created successfully")
|
|
83
|
-
return True
|
|
84
|
-
except Exception as e:
|
|
85
|
-
if "SendGrid API key is required" in str(e):
|
|
86
|
-
print("✅ SendGrid provider validation working (expected error)")
|
|
87
|
-
return True
|
|
88
|
-
else:
|
|
89
|
-
print(f"❌ Unexpected SendGrid error: {e}")
|
|
90
|
-
return False
|
|
91
|
-
|
|
92
|
-
except ImportError as e:
|
|
93
|
-
print(f"❌ SendGrid import error: {e}")
|
|
94
|
-
return False
|
|
95
|
-
|
|
96
|
-
def main():
|
|
97
|
-
"""Run all tests"""
|
|
98
|
-
print("🚀 Testing Email Template Manager Package Structure\n")
|
|
99
|
-
|
|
100
|
-
tests = [
|
|
101
|
-
("Core Imports", test_imports),
|
|
102
|
-
("SendGrid Provider", test_sendgrid_provider),
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
passed = 0
|
|
106
|
-
total = len(tests)
|
|
107
|
-
|
|
108
|
-
for test_name, test_func in tests:
|
|
109
|
-
print(f"\n📋 Testing {test_name}...")
|
|
110
|
-
if test_func():
|
|
111
|
-
passed += 1
|
|
112
|
-
else:
|
|
113
|
-
print(f"❌ {test_name} failed")
|
|
114
|
-
|
|
115
|
-
print(f"\n🎯 Results: {passed}/{total} tests passed")
|
|
116
|
-
|
|
117
|
-
if passed == total:
|
|
118
|
-
print("🎉 All tests passed! Package structure is working correctly.")
|
|
119
|
-
return 0
|
|
120
|
-
else:
|
|
121
|
-
print("⚠️ Some tests failed. Check the implementation.")
|
|
122
|
-
return 1
|
|
123
|
-
|
|
124
|
-
if __name__ == "__main__":
|
|
125
|
-
sys.exit(main())
|