/** * Notification Configuration Constants * * Default configuration values for the notifications system. * These can be overridden at runtime through configuration objects. * * @module src/notifications/constants */ /** * Default notification category * Safest default for compliance - transactional emails must always be sent */ export declare const DEFAULT_NOTIFICATION_CATEGORY: "transactional"; /** * Retry Configuration */ export declare const RETRY_CONFIG: { /** * Default maximum number of retry attempts * Used when no specific retry count is provided */ readonly DEFAULT_MAX_ATTEMPTS: 3; /** * Default initial delay between retries (milliseconds) * Used for exponential backoff calculation */ readonly DEFAULT_INITIAL_DELAY_MS: 1000; /** * Maximum delay between retries (milliseconds) * Prevents exponential backoff from growing too large */ readonly MAX_DELAY_MS: 30000; /** * Backoff multiplier for exponential backoff * Each retry delay = previous delay * multiplier */ readonly BACKOFF_MULTIPLIER: 2; }; /** * Attachment Configuration */ export declare const ATTACHMENT_CONFIG: { /** * Default maximum number of attachments per notification */ readonly DEFAULT_MAX_ATTACHMENTS: 10; /** * Default maximum size per attachment (bytes) * 25MB - Common limit across providers */ readonly DEFAULT_MAX_SIZE_PER_ATTACHMENT: number; /** * Default maximum total size of all attachments (bytes) * 25MB - Ensures we don't exceed provider limits */ readonly DEFAULT_MAX_TOTAL_SIZE: number; /** * Maximum attachment size for SendGrid (bytes) * 30MB per SendGrid documentation */ readonly SENDGRID_MAX_SIZE: number; /** * Maximum total attachment size for SendGrid (bytes) * 30MB per SendGrid documentation */ readonly SENDGRID_MAX_TOTAL_SIZE: number; /** * Maximum attachment size for Infobip (bytes) * 30MB - matching SendGrid for consistency */ readonly INFOBIP_MAX_SIZE: number; /** * Maximum total attachment size for Infobip (bytes) * 30MB - matching SendGrid for consistency */ readonly INFOBIP_MAX_TOTAL_SIZE: number; /** * Default timeout for URL attachment fetching (milliseconds) */ readonly URL_FETCH_TIMEOUT_MS: 30000; /** * Maximum number of retry attempts for failed URL fetches */ readonly URL_FETCH_MAX_RETRIES: 3; }; /** * Circuit Breaker Configuration */ export declare const CIRCUIT_BREAKER_CONFIG: { /** * Default failure threshold before opening circuit * Circuit opens after this many consecutive failures */ readonly DEFAULT_FAILURE_THRESHOLD: 5; /** * Default timeout before attempting half-open state (milliseconds) * How long to wait before testing if provider has recovered */ readonly DEFAULT_TIMEOUT_MS: 60000; /** * Default success threshold in half-open state * Number of successful requests needed to close circuit */ readonly DEFAULT_SUCCESS_THRESHOLD: 2; }; /** * Queue Configuration */ export declare const QUEUE_CONFIG: { /** * Default maximum queue size */ readonly DEFAULT_MAX_SIZE: 10000; /** * Default number of concurrent workers */ readonly DEFAULT_CONCURRENCY: 5; /** * Default queue processing interval (milliseconds) */ readonly DEFAULT_PROCESSING_INTERVAL_MS: 100; }; /** * Rate Limiting Configuration */ export declare const RATE_LIMIT_CONFIG: { /** * Default requests per second per provider */ readonly DEFAULT_REQUESTS_PER_SECOND: 10; /** * Default burst allowance * Number of requests that can be sent in a burst */ readonly DEFAULT_BURST_ALLOWANCE: 20; /** * Default window size for rate limiting (milliseconds) */ readonly DEFAULT_WINDOW_MS: 1000; }; /** * Template Configuration */ export declare const TEMPLATE_CONFIG: { /** * Default locale for templates */ readonly DEFAULT_LOCALE: "en"; /** * Fallback locale when requested locale not found */ readonly FALLBACK_LOCALE: "en"; /** * Template cache TTL (milliseconds) * How long to cache compiled templates */ readonly CACHE_TTL_MS: 300000; /** * Maximum template size (bytes) */ readonly MAX_TEMPLATE_SIZE: 1048576; }; /** * SMS Character Limits and Encoding * Based on GSM-7 and UCS-2 encoding standards */ export declare const SMS_CONFIG: { /** * Single SMS message limit for GSM-7 encoding (standard characters) * Includes: A-Z, a-z, 0-9, and basic punctuation */ readonly GSM7_SINGLE_MESSAGE_LIMIT: 160; /** * Multi-part SMS message segment limit for GSM-7 encoding * Each segment in a concatenated message is limited to 153 characters (7 chars for UDH) */ readonly GSM7_MULTI_PART_SEGMENT_LIMIT: 153; /** * Single SMS message limit for UCS-2 encoding (unicode characters) * Used when message contains emoji, non-Latin characters, etc. */ readonly UCS2_SINGLE_MESSAGE_LIMIT: 70; /** * Multi-part SMS message segment limit for UCS-2 encoding * Each segment in a concatenated message is limited to 67 characters */ readonly UCS2_MULTI_PART_SEGMENT_LIMIT: 67; /** * Maximum number of SMS segments to allow * Prevents accidentally sending very expensive multi-part messages */ readonly DEFAULT_MAX_SEGMENTS: 10; /** * Warning threshold (percentage of limit) * Emit warning when message reaches this percentage of the limit */ readonly WARNING_THRESHOLD_PERCENTAGE: 90; }; /** * Notification Configuration */ export declare const NOTIFICATION_CONFIG: { /** * Default notification priority */ readonly DEFAULT_PRIORITY: "normal"; /** * Maximum subject line length */ readonly MAX_SUBJECT_LENGTH: 255; /** * Maximum push notification title length */ readonly MAX_PUSH_TITLE_LENGTH: 100; /** * Maximum push notification body length */ readonly MAX_PUSH_BODY_LENGTH: 500; }; /** * Logging Configuration */ export declare const LOGGING_CONFIG: { /** * Default log level */ readonly DEFAULT_LEVEL: "info"; /** * Maximum log message size (bytes) * Prevents excessive log sizes */ readonly MAX_LOG_SIZE: 10000; }; /** * Health Check Configuration */ export declare const HEALTH_CHECK_CONFIG: { /** * Default health check interval (milliseconds) */ readonly DEFAULT_INTERVAL_MS: 30000; /** * Default health check timeout (milliseconds) */ readonly DEFAULT_TIMEOUT_MS: 5000; /** * Maximum acceptable latency (milliseconds) * Health check fails if latency exceeds this */ readonly MAX_ACCEPTABLE_LATENCY_MS: 2000; }; /** * Export all configuration as a single object for convenience */ export declare const NOTIFICATION_PACKAGE_CONFIG: { readonly RETRY: { /** * Default maximum number of retry attempts * Used when no specific retry count is provided */ readonly DEFAULT_MAX_ATTEMPTS: 3; /** * Default initial delay between retries (milliseconds) * Used for exponential backoff calculation */ readonly DEFAULT_INITIAL_DELAY_MS: 1000; /** * Maximum delay between retries (milliseconds) * Prevents exponential backoff from growing too large */ readonly MAX_DELAY_MS: 30000; /** * Backoff multiplier for exponential backoff * Each retry delay = previous delay * multiplier */ readonly BACKOFF_MULTIPLIER: 2; }; readonly ATTACHMENT: { /** * Default maximum number of attachments per notification */ readonly DEFAULT_MAX_ATTACHMENTS: 10; /** * Default maximum size per attachment (bytes) * 25MB - Common limit across providers */ readonly DEFAULT_MAX_SIZE_PER_ATTACHMENT: number; /** * Default maximum total size of all attachments (bytes) * 25MB - Ensures we don't exceed provider limits */ readonly DEFAULT_MAX_TOTAL_SIZE: number; /** * Maximum attachment size for SendGrid (bytes) * 30MB per SendGrid documentation */ readonly SENDGRID_MAX_SIZE: number; /** * Maximum total attachment size for SendGrid (bytes) * 30MB per SendGrid documentation */ readonly SENDGRID_MAX_TOTAL_SIZE: number; /** * Maximum attachment size for Infobip (bytes) * 30MB - matching SendGrid for consistency */ readonly INFOBIP_MAX_SIZE: number; /** * Maximum total attachment size for Infobip (bytes) * 30MB - matching SendGrid for consistency */ readonly INFOBIP_MAX_TOTAL_SIZE: number; /** * Default timeout for URL attachment fetching (milliseconds) */ readonly URL_FETCH_TIMEOUT_MS: 30000; /** * Maximum number of retry attempts for failed URL fetches */ readonly URL_FETCH_MAX_RETRIES: 3; }; readonly CIRCUIT_BREAKER: { /** * Default failure threshold before opening circuit * Circuit opens after this many consecutive failures */ readonly DEFAULT_FAILURE_THRESHOLD: 5; /** * Default timeout before attempting half-open state (milliseconds) * How long to wait before testing if provider has recovered */ readonly DEFAULT_TIMEOUT_MS: 60000; /** * Default success threshold in half-open state * Number of successful requests needed to close circuit */ readonly DEFAULT_SUCCESS_THRESHOLD: 2; }; readonly QUEUE: { /** * Default maximum queue size */ readonly DEFAULT_MAX_SIZE: 10000; /** * Default number of concurrent workers */ readonly DEFAULT_CONCURRENCY: 5; /** * Default queue processing interval (milliseconds) */ readonly DEFAULT_PROCESSING_INTERVAL_MS: 100; }; readonly RATE_LIMIT: { /** * Default requests per second per provider */ readonly DEFAULT_REQUESTS_PER_SECOND: 10; /** * Default burst allowance * Number of requests that can be sent in a burst */ readonly DEFAULT_BURST_ALLOWANCE: 20; /** * Default window size for rate limiting (milliseconds) */ readonly DEFAULT_WINDOW_MS: 1000; }; readonly TEMPLATE: { /** * Default locale for templates */ readonly DEFAULT_LOCALE: "en"; /** * Fallback locale when requested locale not found */ readonly FALLBACK_LOCALE: "en"; /** * Template cache TTL (milliseconds) * How long to cache compiled templates */ readonly CACHE_TTL_MS: 300000; /** * Maximum template size (bytes) */ readonly MAX_TEMPLATE_SIZE: 1048576; }; readonly SMS: { /** * Single SMS message limit for GSM-7 encoding (standard characters) * Includes: A-Z, a-z, 0-9, and basic punctuation */ readonly GSM7_SINGLE_MESSAGE_LIMIT: 160; /** * Multi-part SMS message segment limit for GSM-7 encoding * Each segment in a concatenated message is limited to 153 characters (7 chars for UDH) */ readonly GSM7_MULTI_PART_SEGMENT_LIMIT: 153; /** * Single SMS message limit for UCS-2 encoding (unicode characters) * Used when message contains emoji, non-Latin characters, etc. */ readonly UCS2_SINGLE_MESSAGE_LIMIT: 70; /** * Multi-part SMS message segment limit for UCS-2 encoding * Each segment in a concatenated message is limited to 67 characters */ readonly UCS2_MULTI_PART_SEGMENT_LIMIT: 67; /** * Maximum number of SMS segments to allow * Prevents accidentally sending very expensive multi-part messages */ readonly DEFAULT_MAX_SEGMENTS: 10; /** * Warning threshold (percentage of limit) * Emit warning when message reaches this percentage of the limit */ readonly WARNING_THRESHOLD_PERCENTAGE: 90; }; readonly NOTIFICATION: { /** * Default notification priority */ readonly DEFAULT_PRIORITY: "normal"; /** * Maximum subject line length */ readonly MAX_SUBJECT_LENGTH: 255; /** * Maximum push notification title length */ readonly MAX_PUSH_TITLE_LENGTH: 100; /** * Maximum push notification body length */ readonly MAX_PUSH_BODY_LENGTH: 500; }; readonly LOGGING: { /** * Default log level */ readonly DEFAULT_LEVEL: "info"; /** * Maximum log message size (bytes) * Prevents excessive log sizes */ readonly MAX_LOG_SIZE: 10000; }; readonly HEALTH_CHECK: { /** * Default health check interval (milliseconds) */ readonly DEFAULT_INTERVAL_MS: 30000; /** * Default health check timeout (milliseconds) */ readonly DEFAULT_TIMEOUT_MS: 5000; /** * Maximum acceptable latency (milliseconds) * Health check fails if latency exceeds this */ readonly MAX_ACCEPTABLE_LATENCY_MS: 2000; }; }; //# sourceMappingURL=constants.d.ts.map