Coverage for src/lexigram/notification/constants.py: 91%

23 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-26 02:26 +0800

1"""lexigram-notification constants.""" 

2 

3from __future__ import annotations 

4 

5import importlib.metadata 

6 

7try: 

8 __version__: str = importlib.metadata.version("lexigram-notification") 

9except ImportError: 

10 __version__ = "0.0.0" 

11 

12 

13# --------------------------------------------------------------------------- 

14# Environment Variable Prefixes 

15# --------------------------------------------------------------------------- 

16 

17ENV_PREFIX: str = "LEX_NOTIFICATION__" 

18ENV_NESTED_DELIMITER: str = "__" 

19 

20TWILIO_API_BASE: str = "https://api.twilio.com/2010-04-01" 

21FCM_SEND_URL: str = "https://fcm.googleapis.com/fcm/send" 

22DEFAULT_FCM_TIMEOUT: int = 30 

23DEFAULT_TWILIO_TIMEOUT: int = 30 

24 

25# --------------------------------------------------------------------------- 

26# APNs (Apple Push Notification service) 

27# --------------------------------------------------------------------------- 

28 

29APNS_BASE_URL: str = "https://api.push.apple.com" 

30APNS_SANDBOX_URL: str = "https://api.development.push.apple.com" 

31DEFAULT_APNS_TIMEOUT: int = 30 

32 

33# === Mailer Constants (merged from mail/constants.py) === 

34DEFAULT_FROM_EMAIL: str = "noreply@example.com" 

35DEFAULT_SMTP_PORT: int = 587 

36DEFAULT_SMTP_TIMEOUT: int = 30 

37DEFAULT_SENDGRID_TIMEOUT: int = 30 

38SENDGRID_API_URL: str = "https://api.sendgrid.com/v3/mail/send" 

39 

40# === Inbox Constants (merged from inbox/constants.py) === 

41MAX_INBOX_PAGE_SIZE: int = 100 

42DEFAULT_RETENTION_DAYS: int = 90 

43 

44__all__ = [ 

45 "APNS_BASE_URL", 

46 "APNS_SANDBOX_URL", 

47 "DEFAULT_APNS_TIMEOUT", 

48 "DEFAULT_FCM_TIMEOUT", 

49 "DEFAULT_FROM_EMAIL", 

50 "DEFAULT_RETENTION_DAYS", 

51 "DEFAULT_SENDGRID_TIMEOUT", 

52 "DEFAULT_SMTP_PORT", 

53 "DEFAULT_SMTP_TIMEOUT", 

54 "DEFAULT_TWILIO_TIMEOUT", 

55 "ENV_NESTED_DELIMITER", 

56 "ENV_PREFIX", 

57 "FCM_SEND_URL", 

58 "MAX_INBOX_PAGE_SIZE", 

59 "SENDGRID_API_URL", 

60 "TWILIO_API_BASE", 

61]