Documentation
¶
Index ¶
- Constants
- Variables
- func CreateSESClient(region, accessKey, secretKey string) domain.SESClient
- func EnsureContactSegmentQueueProcessingTask(ctx context.Context, taskRepo domain.TaskRepository, workspaceID string) error
- func EnsureSegmentRecomputeTask(ctx context.Context, taskRepo domain.TaskRepository, workspaceID string) error
- func ExtractTableOfContents(html string) ([]domain.TOCItem, string, error)
- func GenerateSecureKey(byteLength int) (string, error)
- func ValidateSlug(slug string) error
- type ABTestNodeExecutor
- type AddToListNodeExecutor
- type AnalyticsService
- type AttachmentService
- func (s *AttachmentService) GetAttachment(ctx context.Context, workspaceID string, checksum string) (*domain.AttachmentRecord, error)
- func (s *AttachmentService) GetAttachmentsForMessage(ctx context.Context, workspaceID string, metadata []domain.AttachmentMetadata) ([]domain.Attachment, error)
- func (s *AttachmentService) ProcessAttachments(ctx context.Context, workspaceID string, attachments []domain.Attachment) ([]domain.AttachmentMetadata, error)
- func (s *AttachmentService) RetrieveAttachmentContent(ctx context.Context, workspaceID string, metadata []domain.AttachmentMetadata) ([]AttachmentWithContent, error)
- type AttachmentWithContent
- type AuthService
- func (s *AuthService) AuthenticateUserForWorkspace(ctx context.Context, workspaceID string) (context.Context, *domain.User, *domain.UserWorkspace, error)
- func (s *AuthService) AuthenticateUserFromContext(ctx context.Context) (*domain.User, error)
- func (s *AuthService) GenerateAPIAuthToken(user *domain.User) string
- func (s *AuthService) GenerateInvitationToken(invitation *domain.WorkspaceInvitation) string
- func (s *AuthService) GenerateUserAuthToken(user *domain.User, sessionID string, expiresAt time.Time) string
- func (s *AuthService) GetUserByID(ctx context.Context, userID string) (*domain.User, error)
- func (s *AuthService) InvalidateSecretCache()
- func (s *AuthService) ValidateInvitationToken(tokenString string) (invitationID, workspaceID, email string, err error)
- func (s *AuthService) VerifyUserSession(ctx context.Context, userID, sessionID string) (*domain.User, error)
- type AuthServiceConfig
- type AutomationExecutor
- type AutomationScheduler
- type AutomationService
- func (s *AutomationService) Activate(ctx context.Context, workspaceID, automationID string) error
- func (s *AutomationService) Create(ctx context.Context, workspaceID string, automation *domain.Automation) error
- func (s *AutomationService) Delete(ctx context.Context, workspaceID, automationID string) error
- func (s *AutomationService) Get(ctx context.Context, workspaceID, automationID string) (*domain.Automation, error)
- func (s *AutomationService) GetContactNodeExecutions(ctx context.Context, workspaceID, automationID, email string) (*domain.ContactAutomation, []*domain.NodeExecution, error)
- func (s *AutomationService) List(ctx context.Context, workspaceID string, filter domain.AutomationFilter) ([]*domain.Automation, int, error)
- func (s *AutomationService) Pause(ctx context.Context, workspaceID, automationID string) error
- func (s *AutomationService) Update(ctx context.Context, workspaceID string, automation *domain.Automation) error
- type AutomationTriggerGenerator
- type BlogService
- func (s *BlogService) CreateCategory(ctx context.Context, request *domain.CreateBlogCategoryRequest) (*domain.BlogCategory, error)
- func (s *BlogService) CreatePost(ctx context.Context, request *domain.CreateBlogPostRequest) (*domain.BlogPost, error)
- func (s *BlogService) CreateTheme(ctx context.Context, request *domain.CreateBlogThemeRequest) (*domain.BlogTheme, error)
- func (s *BlogService) DeleteCategory(ctx context.Context, request *domain.DeleteBlogCategoryRequest) error
- func (s *BlogService) DeletePost(ctx context.Context, request *domain.DeleteBlogPostRequest) error
- func (s *BlogService) GetCategory(ctx context.Context, id string) (*domain.BlogCategory, error)
- func (s *BlogService) GetCategoryBySlug(ctx context.Context, slug string) (*domain.BlogCategory, error)
- func (s *BlogService) GetPost(ctx context.Context, id string) (*domain.BlogPost, error)
- func (s *BlogService) GetPostByCategoryAndSlug(ctx context.Context, categorySlug, postSlug string) (*domain.BlogPost, error)
- func (s *BlogService) GetPostBySlug(ctx context.Context, slug string) (*domain.BlogPost, error)
- func (s *BlogService) GetPublicCategoryBySlug(ctx context.Context, slug string) (*domain.BlogCategory, error)
- func (s *BlogService) GetPublicPostByCategoryAndSlug(ctx context.Context, categorySlug, postSlug string) (*domain.BlogPost, error)
- func (s *BlogService) GetPublishedTheme(ctx context.Context) (*domain.BlogTheme, error)
- func (s *BlogService) GetTheme(ctx context.Context, version int) (*domain.BlogTheme, error)
- func (s *BlogService) ListCategories(ctx context.Context) (*domain.BlogCategoryListResponse, error)
- func (s *BlogService) ListPosts(ctx context.Context, params *domain.ListBlogPostsRequest) (*domain.BlogPostListResponse, error)
- func (s *BlogService) ListPublicPosts(ctx context.Context, params *domain.ListBlogPostsRequest) (*domain.BlogPostListResponse, error)
- func (s *BlogService) ListThemes(ctx context.Context, params *domain.ListBlogThemesRequest) (*domain.BlogThemeListResponse, error)
- func (s *BlogService) PublishPost(ctx context.Context, request *domain.PublishBlogPostRequest) error
- func (s *BlogService) PublishTheme(ctx context.Context, request *domain.PublishBlogThemeRequest) error
- func (s *BlogService) RenderCategoryPage(ctx context.Context, workspaceID, categorySlug string, page int, ...) (string, error)
- func (s *BlogService) RenderHomePage(ctx context.Context, workspaceID string, page int, themeVersion *int) (string, error)
- func (s *BlogService) RenderPostPage(ctx context.Context, workspaceID, categorySlug, postSlug string, ...) (string, error)
- func (s *BlogService) UnpublishPost(ctx context.Context, request *domain.UnpublishBlogPostRequest) error
- func (s *BlogService) UpdateCategory(ctx context.Context, request *domain.UpdateBlogCategoryRequest) (*domain.BlogCategory, error)
- func (s *BlogService) UpdatePost(ctx context.Context, request *domain.UpdateBlogPostRequest) (*domain.BlogPost, error)
- func (s *BlogService) UpdateTheme(ctx context.Context, request *domain.UpdateBlogThemeRequest) (*domain.BlogTheme, error)
- type BranchNodeExecutor
- type BroadcastService
- func (s *BroadcastService) CancelBroadcast(ctx context.Context, request *domain.CancelBroadcastRequest) error
- func (s *BroadcastService) CreateBroadcast(ctx context.Context, request *domain.CreateBroadcastRequest) (*domain.Broadcast, error)
- func (s *BroadcastService) DeleteBroadcast(ctx context.Context, request *domain.DeleteBroadcastRequest) error
- func (s *BroadcastService) GetBroadcast(ctx context.Context, workspaceID, broadcastID string) (*domain.Broadcast, error)
- func (s *BroadcastService) GetTestResults(ctx context.Context, workspaceID, broadcastID string) (*domain.TestResultsResponse, error)
- func (s *BroadcastService) ListBroadcasts(ctx context.Context, params domain.ListBroadcastsParams) (*domain.BroadcastListResponse, error)
- func (s *BroadcastService) PauseBroadcast(ctx context.Context, request *domain.PauseBroadcastRequest) error
- func (s *BroadcastService) ResumeBroadcast(ctx context.Context, request *domain.ResumeBroadcastRequest) error
- func (s *BroadcastService) ScheduleBroadcast(ctx context.Context, request *domain.ScheduleBroadcastRequest) error
- func (s *BroadcastService) SelectWinner(ctx context.Context, workspaceID, broadcastID, templateID string) error
- func (s *BroadcastService) SendToIndividual(ctx context.Context, request *domain.SendToIndividualRequest) error
- func (s *BroadcastService) SetTaskService(taskService domain.TaskService)
- func (s *BroadcastService) UpdateBroadcast(ctx context.Context, request *domain.UpdateBroadcastRequest) (*domain.Broadcast, error)
- type ConfigurationStatus
- type ContactListService
- func (s *ContactListService) GetContactListByIDs(ctx context.Context, workspaceID string, email, listID string) (*domain.ContactList, error)
- func (s *ContactListService) GetContactsByListID(ctx context.Context, workspaceID string, listID string) ([]*domain.ContactList, error)
- func (s *ContactListService) GetListsByEmail(ctx context.Context, workspaceID string, email string) ([]*domain.ContactList, error)
- func (s *ContactListService) RemoveContactFromList(ctx context.Context, workspaceID string, email, listID string) error
- func (s *ContactListService) UpdateContactListStatus(ctx context.Context, workspaceID string, email, listID string, ...) (*domain.UpdateContactListStatusResult, error)
- type ContactSegmentQueueProcessor
- type ContactSegmentQueueTaskProcessor
- type ContactService
- func (s *ContactService) BatchImportContacts(ctx context.Context, workspaceID string, contacts []*domain.Contact, ...) *domain.BatchImportContactsResponse
- func (s *ContactService) CountContacts(ctx context.Context, workspaceID string) (int, error)
- func (s *ContactService) DeleteContact(ctx context.Context, workspaceID string, email string) error
- func (s *ContactService) GetContactByEmail(ctx context.Context, workspaceID string, email string) (*domain.Contact, error)
- func (s *ContactService) GetContactByExternalID(ctx context.Context, workspaceID string, externalID string) (*domain.Contact, error)
- func (s *ContactService) GetContacts(ctx context.Context, req *domain.GetContactsRequest) (*domain.GetContactsResponse, error)
- func (s *ContactService) UpsertContact(ctx context.Context, workspaceID string, contact *domain.Contact) domain.UpsertContactOperation
- type ContactTimelineService
- type CustomEventService
- func (s *CustomEventService) GetEvent(ctx context.Context, workspaceID, eventName, externalID string) (*domain.CustomEvent, error)
- func (s *CustomEventService) ImportEvents(ctx context.Context, req *domain.ImportCustomEventsRequest) ([]string, error)
- func (s *CustomEventService) ListEvents(ctx context.Context, req *domain.ListCustomEventsRequest) ([]*domain.CustomEvent, error)
- func (s *CustomEventService) UpsertEvent(ctx context.Context, req *domain.UpsertCustomEventRequest) (*domain.CustomEvent, error)
- type DNSVerificationService
- type DelayNodeExecutor
- type DemoService
- type EmailNodeExecutor
- type EmailSender
- type EmailService
- func (s *EmailService) OpenEmail(ctx context.Context, messageID string, workspaceID string) error
- func (s *EmailService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest, isMarketing bool) error
- func (s *EmailService) SendEmailForTemplate(ctx context.Context, request domain.SendEmailRequest) error
- func (s *EmailService) TestEmailProvider(ctx context.Context, workspaceID string, provider domain.EmailProvider, ...) error
- func (s *EmailService) VisitLink(ctx context.Context, messageID string, workspaceID string) error
- type EnvironmentConfig
- type FilterNodeExecutor
- type FirecrawlScrapeOptions
- type FirecrawlScrapeRequest
- type FirecrawlScrapeResponse
- type FirecrawlSearchRequest
- type FirecrawlSearchResponse
- type FirecrawlSearchResult
- type FirecrawlService
- type InboundWebhookEventService
- type InvitationClaims
- type LLMService
- type LLMServiceConfig
- type ListService
- func (s *ListService) CreateList(ctx context.Context, workspaceID string, list *domain.List) error
- func (s *ListService) DeleteList(ctx context.Context, workspaceID string, id string) error
- func (s *ListService) GetListByID(ctx context.Context, workspaceID string, id string) (*domain.List, error)
- func (s *ListService) GetListStats(ctx context.Context, workspaceID string, id string) (*domain.ListStats, error)
- func (s *ListService) GetLists(ctx context.Context, workspaceID string) ([]*domain.List, error)
- func (s *ListService) SubscribeToLists(ctx context.Context, payload *domain.SubscribeToListsRequest, ...) error
- func (s *ListService) UnsubscribeFromLists(ctx context.Context, payload *domain.UnsubscribeFromListsRequest, ...) error
- func (s *ListService) UpdateList(ctx context.Context, workspaceID string, list *domain.List) error
- type ListStatusBranchNodeExecutor
- type MailgunService
- func (s *MailgunService) CreateWebhook(ctx context.Context, config domain.MailgunSettings, ...) (*domain.MailgunWebhook, error)
- func (s *MailgunService) DeleteWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string) error
- func (s *MailgunService) GetWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string) (*domain.MailgunWebhook, error)
- func (s *MailgunService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *MailgunService) ListWebhooks(ctx context.Context, config domain.MailgunSettings) (*domain.MailgunWebhookListResponse, error)
- func (s *MailgunService) RegisterWebhooks(ctx context.Context, workspaceID string, integrationID string, baseURL string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *MailgunService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
- func (s *MailgunService) TestWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string, ...) error
- func (s *MailgunService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string, ...) error
- func (s *MailgunService) UpdateWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string, ...) (*domain.MailgunWebhook, error)
- type MailjetService
- func (s *MailjetService) CreateWebhook(ctx context.Context, config domain.MailjetSettings, ...) (*domain.MailjetWebhook, error)
- func (s *MailjetService) DeleteWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64) error
- func (s *MailjetService) GetWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64) (*domain.MailjetWebhook, error)
- func (s *MailjetService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *MailjetService) ListWebhooks(ctx context.Context, config domain.MailjetSettings) (*domain.MailjetWebhookResponse, error)
- func (s *MailjetService) RegisterWebhooks(ctx context.Context, workspaceID string, integrationID string, baseURL string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *MailjetService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
- func (s *MailjetService) TestWebhook(ctx context.Context, config domain.MailjetSettings, webhookID string, ...) error
- func (s *MailjetService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string, ...) error
- func (s *MailjetService) UpdateWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64, ...) (*domain.MailjetWebhook, error)
- type MessageHistoryService
- func (s *MessageHistoryService) GetBroadcastStats(ctx context.Context, workspaceID string, id string) (*domain.MessageHistoryStatusSum, error)
- func (s *MessageHistoryService) GetBroadcastVariationStats(ctx context.Context, workspaceID, broadcastID, templateID string) (*domain.MessageHistoryStatusSum, error)
- func (s *MessageHistoryService) ListMessages(ctx context.Context, workspaceID string, params domain.MessageListParams) (*domain.MessageListResult, error)
- type NodeExecutionParams
- type NodeExecutionResult
- type NodeExecutor
- type NotificationCenterService
- type PostmarkService
- func (s *PostmarkService) GetWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int) (*domain.PostmarkWebhookResponse, error)
- func (s *PostmarkService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *PostmarkService) ListWebhooks(ctx context.Context, config domain.PostmarkSettings) (*domain.PostmarkListWebhooksResponse, error)
- func (s *PostmarkService) RegisterWebhook(ctx context.Context, config domain.PostmarkSettings, ...) (*domain.PostmarkWebhookResponse, error)
- func (s *PostmarkService) RegisterWebhooks(ctx context.Context, workspaceID string, integrationID string, baseURL string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *PostmarkService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
- func (s *PostmarkService) TestWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int, ...) error
- func (s *PostmarkService) UnregisterWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int) error
- func (s *PostmarkService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string, ...) error
- func (s *PostmarkService) UpdateWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int, ...) (*domain.PostmarkWebhookResponse, error)
- type QueryBuilder
- type RemoveFromListNodeExecutor
- type SESService
- func (s *SESService) CreateConfigurationSet(ctx context.Context, config domain.AmazonSESSettings, name string) error
- func (s *SESService) CreateEventDestination(ctx context.Context, config domain.AmazonSESSettings, ...) error
- func (s *SESService) CreateSNSTopic(ctx context.Context, config domain.AmazonSESSettings, ...) (string, error)
- func (s *SESService) DeleteConfigurationSet(ctx context.Context, config domain.AmazonSESSettings, name string) error
- func (s *SESService) DeleteEventDestination(ctx context.Context, config domain.AmazonSESSettings, ...) error
- func (s *SESService) DeleteSNSTopic(ctx context.Context, config domain.AmazonSESSettings, topicARN string) error
- func (s *SESService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *SESService) ListConfigurationSets(ctx context.Context, config domain.AmazonSESSettings) ([]string, error)
- func (s *SESService) ListEventDestinations(ctx context.Context, config domain.AmazonSESSettings, configSetName string) ([]domain.SESConfigurationSetEventDestination, error)
- func (s *SESService) RegisterWebhooks(ctx context.Context, workspaceID string, integrationID string, baseURL string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *SESService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
- func (s *SESService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string, ...) error
- func (s *SESService) UpdateEventDestination(ctx context.Context, config domain.AmazonSESSettings, ...) error
- type SMTPRelayHandlerService
- type SMTPService
- type SMTPTestConfig
- type ScrapeOptions
- type SearchOptions
- type SegmentBuildProcessor
- type SegmentRecomputeTaskProcessor
- type SegmentService
- func (s *SegmentService) CreateSegment(ctx context.Context, req *domain.CreateSegmentRequest) (*domain.Segment, error)
- func (s *SegmentService) DeleteSegment(ctx context.Context, req *domain.DeleteSegmentRequest) error
- func (s *SegmentService) GetSegment(ctx context.Context, req *domain.GetSegmentRequest) (*domain.Segment, error)
- func (s *SegmentService) GetSegmentContacts(ctx context.Context, workspaceID, segmentID string, limit, offset int) ([]string, error)
- func (s *SegmentService) ListSegments(ctx context.Context, req *domain.GetSegmentsRequest) ([]*domain.Segment, error)
- func (s *SegmentService) PreviewSegment(ctx context.Context, workspaceID string, tree *domain.TreeNode, limit int) (*domain.PreviewSegmentResponse, error)
- func (s *SegmentService) RebuildSegment(ctx context.Context, workspaceID, segmentID string) error
- func (s *SegmentService) UpdateSegment(ctx context.Context, req *domain.UpdateSegmentRequest) (*domain.Segment, error)
- type ServerSideToolRegistry
- type SettingService
- func (s *SettingService) GetSetting(ctx context.Context, key string) (string, error)
- func (s *SettingService) GetSystemConfig(ctx context.Context, secretKey string) (*SystemConfig, error)
- func (s *SettingService) IsInstalled(ctx context.Context) (bool, error)
- func (s *SettingService) SetSetting(ctx context.Context, key, value string) error
- func (s *SettingService) SetSystemConfig(ctx context.Context, config *SystemConfig, secretKey string) error
- type SetupConfig
- type SetupService
- func (s *SetupService) GetConfigurationStatus() *ConfigurationStatus
- func (s *SetupService) Initialize(ctx context.Context, config *SetupConfig) error
- func (s *SetupService) TestSMTPConnection(ctx context.Context, config *SMTPTestConfig) error
- func (s *SetupService) ValidateSetupConfig(config *SetupConfig) error
- type SparkPostService
- func (s *SparkPostService) CreateWebhook(ctx context.Context, config domain.SparkPostSettings, ...) (*domain.SparkPostWebhookResponse, error)
- func (s *SparkPostService) DeleteWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) error
- func (s *SparkPostService) GetWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) (*domain.SparkPostWebhookResponse, error)
- func (s *SparkPostService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *SparkPostService) ListWebhooks(ctx context.Context, config domain.SparkPostSettings) (*domain.SparkPostWebhookListResponse, error)
- func (s *SparkPostService) RegisterWebhooks(ctx context.Context, workspaceID string, integrationID string, baseURL string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *SparkPostService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
- func (s *SparkPostService) TestWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) error
- func (s *SparkPostService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string, ...) error
- func (s *SparkPostService) UpdateWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string, ...) (*domain.SparkPostWebhookResponse, error)
- func (s *SparkPostService) ValidateWebhook(ctx context.Context, config domain.SparkPostSettings, ...) (bool, error)
- type SupabaseService
- func (s *SupabaseService) CreateDefaultSupabaseNotifications(ctx context.Context, workspaceID, integrationID string, ...) error
- func (s *SupabaseService) CreateDefaultSupabaseTemplates(ctx context.Context, workspaceID, integrationID string) (*domain.SupabaseTemplateMappings, error)
- func (s *SupabaseService) DeleteIntegrationResources(ctx context.Context, workspaceID, integrationID string) error
- func (s *SupabaseService) ProcessAuthEmailHook(ctx context.Context, workspaceID, integrationID string, payload []byte, ...) error
- func (s *SupabaseService) ProcessUserCreatedHook(ctx context.Context, workspaceID, integrationID string, payload []byte, ...) error
- type SystemConfig
- type SystemNotificationService
- func (s *SystemNotificationService) HandleBroadcastFailedEvent(ctx context.Context, payload domain.EventPayload)
- func (s *SystemNotificationService) HandleCircuitBreakerEvent(ctx context.Context, payload domain.EventPayload)
- func (s *SystemNotificationService) HandleSystemAlert(ctx context.Context, payload domain.EventPayload)
- func (s *SystemNotificationService) RegisterWithEventBus(eventBus domain.EventBus)
- type TaskExecutor
- type TaskScheduler
- type TaskService
- func (s *TaskService) CreateTask(ctx context.Context, workspace string, task *domain.Task) error
- func (s *TaskService) DeleteTask(ctx context.Context, workspace, id string) error
- func (s *TaskService) ExecutePendingTasks(ctx context.Context, maxTasks int) error
- func (s *TaskService) ExecuteTask(ctx context.Context, workspace, taskID string, timeoutAt time.Time) error
- func (s *TaskService) GetLastCronRun(ctx context.Context) (*time.Time, error)
- func (s *TaskService) GetProcessor(taskType string) (domain.TaskProcessor, error)
- func (s *TaskService) GetTask(ctx context.Context, workspace, id string) (*domain.Task, error)
- func (s *TaskService) IsAutoExecuteEnabled() bool
- func (s *TaskService) ListTasks(ctx context.Context, workspace string, filter domain.TaskFilter) (*domain.TaskListResponse, error)
- func (s *TaskService) RegisterProcessor(processor domain.TaskProcessor)
- func (s *TaskService) SetAutoExecuteImmediate(enabled bool)
- func (s *TaskService) SubscribeToBroadcastEvents(eventBus domain.EventBus)
- func (s *TaskService) WithTransaction(ctx context.Context, fn func(*sql.Tx) error) error
- type TelemetryMetrics
- type TelemetryService
- type TelemetryServiceConfig
- type TemplateBlockService
- func (s *TemplateBlockService) CreateTemplateBlock(ctx context.Context, workspaceID string, block *domain.TemplateBlock) error
- func (s *TemplateBlockService) DeleteTemplateBlock(ctx context.Context, workspaceID string, id string) error
- func (s *TemplateBlockService) GetTemplateBlock(ctx context.Context, workspaceID string, id string) (*domain.TemplateBlock, error)
- func (s *TemplateBlockService) ListTemplateBlocks(ctx context.Context, workspaceID string) ([]*domain.TemplateBlock, error)
- func (s *TemplateBlockService) UpdateTemplateBlock(ctx context.Context, workspaceID string, block *domain.TemplateBlock) error
- type TemplateService
- func (s *TemplateService) CompileTemplate(ctx context.Context, payload domain.CompileTemplateRequest) (*domain.CompileTemplateResponse, error)
- func (s *TemplateService) CreateTemplate(ctx context.Context, workspaceID string, template *domain.Template) error
- func (s *TemplateService) DeleteTemplate(ctx context.Context, workspaceID string, id string) error
- func (s *TemplateService) GetTemplateByID(ctx context.Context, workspaceID string, id string, version int64) (*domain.Template, error)
- func (s *TemplateService) GetTemplates(ctx context.Context, workspaceID string, category string, channel string) ([]*domain.Template, error)
- func (s *TemplateService) UpdateTemplate(ctx context.Context, workspaceID string, template *domain.Template) error
- type TransactionalNotificationService
- func (s *TransactionalNotificationService) CreateNotification(ctx context.Context, workspace string, ...) (*domain.TransactionalNotification, error)
- func (s *TransactionalNotificationService) DeleteNotification(ctx context.Context, workspace, id string) error
- func (s *TransactionalNotificationService) GetNotification(ctx context.Context, workspace, id string) (*domain.TransactionalNotification, error)
- func (s *TransactionalNotificationService) ListNotifications(ctx context.Context, workspace string, filter map[string]interface{}, ...) ([]*domain.TransactionalNotification, int, error)
- func (s *TransactionalNotificationService) SendNotification(ctx context.Context, workspaceID string, ...) (string, error)
- func (s *TransactionalNotificationService) TestTemplate(ctx context.Context, workspaceID string, templateID string, ...) error
- func (s *TransactionalNotificationService) UpdateNotification(ctx context.Context, workspace, id string, ...) (*domain.TransactionalNotification, error)
- type TriggerNodeExecutor
- type TriggerSQL
- type UserClaims
- type UserService
- func (s *UserService) GetUserByEmail(ctx context.Context, email string) (*domain.User, error)
- func (s *UserService) GetUserByID(ctx context.Context, userID string) (*domain.User, error)
- func (s *UserService) Logout(ctx context.Context, userID string) error
- func (s *UserService) RootSignin(ctx context.Context, input domain.RootSigninInput) (*domain.AuthResponse, error)
- func (s *UserService) SignIn(ctx context.Context, input domain.SignInInput) (string, error)
- func (s *UserService) VerifyCode(ctx context.Context, input domain.VerifyCodeInput) (*domain.AuthResponse, error)
- func (s *UserService) VerifyUserSession(ctx context.Context, userID string, sessionID string) (*domain.User, error)
- type UserServiceConfig
- type WebhookDeliveryWorker
- type WebhookNodeExecutor
- type WebhookRegistrationService
- func (s *WebhookRegistrationService) GetWebhookStatus(ctx context.Context, workspaceID string, integrationID string) (*domain.WebhookRegistrationStatus, error)
- func (s *WebhookRegistrationService) RegisterWebhooks(ctx context.Context, workspaceID string, ...) (*domain.WebhookRegistrationStatus, error)
- func (s *WebhookRegistrationService) UnregisterWebhooks(ctx context.Context, workspaceID string, integrationID string) error
- type WebhookSubscriptionService
- func (s *WebhookSubscriptionService) Create(ctx context.Context, workspaceID string, name, webhookURL string, ...) (*domain.WebhookSubscription, error)
- func (s *WebhookSubscriptionService) Delete(ctx context.Context, workspaceID, id string) error
- func (s *WebhookSubscriptionService) GetByID(ctx context.Context, workspaceID, id string) (*domain.WebhookSubscription, error)
- func (s *WebhookSubscriptionService) GetDeliveries(ctx context.Context, workspaceID string, subscriptionID *string, ...) ([]*domain.WebhookDelivery, int, error)
- func (s *WebhookSubscriptionService) GetEventTypes() []string
- func (s *WebhookSubscriptionService) List(ctx context.Context, workspaceID string) ([]*domain.WebhookSubscription, error)
- func (s *WebhookSubscriptionService) RegenerateSecret(ctx context.Context, workspaceID, id string) (*domain.WebhookSubscription, error)
- func (s *WebhookSubscriptionService) Toggle(ctx context.Context, workspaceID, id string, enabled bool) (*domain.WebhookSubscription, error)
- func (s *WebhookSubscriptionService) Update(ctx context.Context, workspaceID string, id, name, webhookURL string, ...) (*domain.WebhookSubscription, error)
- type WorkspaceService
- func (s *WorkspaceService) AcceptInvitation(ctx context.Context, invitationID, workspaceID, email string) (*domain.AuthResponse, error)
- func (s *WorkspaceService) AddUserToWorkspace(ctx context.Context, workspaceID string, userID string, role string, ...) error
- func (s *WorkspaceService) CreateAPIKey(ctx context.Context, workspaceID string, emailPrefix string) (string, string, error)
- func (s *WorkspaceService) CreateIntegration(ctx context.Context, req domain.CreateIntegrationRequest) (string, error)
- func (s *WorkspaceService) CreateWorkspace(ctx context.Context, id string, name string, websiteURL string, logoURL string, ...) (*domain.Workspace, error)
- func (s *WorkspaceService) DeleteIntegration(ctx context.Context, workspaceID, integrationID string) error
- func (s *WorkspaceService) DeleteInvitation(ctx context.Context, invitationID string) error
- func (s *WorkspaceService) DeleteWorkspace(ctx context.Context, id string) error
- func (s *WorkspaceService) GetInvitationByID(ctx context.Context, invitationID string) (*domain.WorkspaceInvitation, error)
- func (s *WorkspaceService) GetWorkspace(ctx context.Context, id string) (*domain.Workspace, error)
- func (s *WorkspaceService) GetWorkspaceMembersWithEmail(ctx context.Context, id string) ([]*domain.UserWorkspaceWithEmail, error)
- func (s *WorkspaceService) InviteMember(ctx context.Context, workspaceID, email string, ...) (*domain.WorkspaceInvitation, string, error)
- func (s *WorkspaceService) ListWorkspaces(ctx context.Context) ([]*domain.Workspace, error)
- func (s *WorkspaceService) RemoveMember(ctx context.Context, workspaceID string, userIDToRemove string) error
- func (s *WorkspaceService) RemoveUserFromWorkspace(ctx context.Context, workspaceID string, userID string) error
- func (s *WorkspaceService) SetUserPermissions(ctx context.Context, workspaceID, userID string, ...) error
- func (s *WorkspaceService) TransferOwnership(ctx context.Context, workspaceID string, newOwnerID string, ...) error
- func (s *WorkspaceService) UpdateIntegration(ctx context.Context, req domain.UpdateIntegrationRequest) error
- func (s *WorkspaceService) UpdateWorkspace(ctx context.Context, id string, name string, settings domain.WorkspaceSettings) (*domain.Workspace, error)
Constants ¶
const ( // ToolScrapeURL is the name of the scrape URL tool ToolScrapeURL = "scrape_url" // ToolSearchWeb is the name of the search web tool ToolSearchWeb = "search_web" // MaxContentSize is the maximum size of content to return (50K chars) MaxContentSize = 50000 )
const (
// TelemetryEndpoint is the hardcoded endpoint for sending telemetry data
TelemetryEndpoint = "https://telemetry.notifuse.com"
)
Variables ¶
var ( ErrSessionExpired = errors.New("session expired") ErrUserNotFound = errors.New("user not found") )
var ( ErrInvalidAWSCredentials = fmt.Errorf("invalid AWS credentials") ErrInvalidSNSDestination = fmt.Errorf("SNS destination and Topic ARN are required") ErrInvalidSESConfig = fmt.Errorf("SES configuration is missing or invalid") )
Custom domain errors for better testability
var AllowedContactFields = map[string]bool{ "external_id": true, "timezone": true, "language": true, "first_name": true, "last_name": true, "phone": true, "photo_url": true, "address_line_1": true, "address_line_2": true, "country": true, "postcode": true, "state": true, "custom_string_1": true, "custom_string_2": true, "custom_string_3": true, "custom_string_4": true, "custom_string_5": true, "custom_number_1": true, "custom_number_2": true, "custom_number_3": true, "custom_number_4": true, "custom_number_5": true, "custom_datetime_1": true, "custom_datetime_2": true, "custom_datetime_3": true, "custom_datetime_4": true, "custom_datetime_5": true, "custom_json_1": true, "custom_json_2": true, "custom_json_3": true, "custom_json_4": true, "custom_json_5": true, }
AllowedContactFields defines valid field names for updated_fields filter (prevents SQL injection)
Functions ¶
func CreateSESClient ¶
CreateSESClient creates a new SES client with the provided credentials
func EnsureContactSegmentQueueProcessingTask ¶
func EnsureContactSegmentQueueProcessingTask(ctx context.Context, taskRepo domain.TaskRepository, workspaceID string) error
EnsureContactSegmentQueueProcessingTask creates or updates the permanent queue processing task for a workspace This should be called when a workspace is created or during migration
func EnsureSegmentRecomputeTask ¶
func EnsureSegmentRecomputeTask(ctx context.Context, taskRepo domain.TaskRepository, workspaceID string) error
EnsureSegmentRecomputeTask creates or updates the permanent recompute checking task for a workspace This should be called when a workspace is created or during migration
func ExtractTableOfContents ¶
ExtractTableOfContents extracts headings from HTML and generates a table of contents It also ensures all headings have ID attributes for anchor linking
func GenerateSecureKey ¶
GenerateSecureKey generates a cryptographically secure random key with the specified byte length and returns it as a hex-encoded string
func ValidateSlug ¶
ValidateSlug checks if slug is valid format (no nanoid - clean slugs)
Types ¶
type ABTestNodeExecutor ¶
type ABTestNodeExecutor struct{}
ABTestNodeExecutor executes A/B test nodes
func NewABTestNodeExecutor ¶
func NewABTestNodeExecutor() *ABTestNodeExecutor
NewABTestNodeExecutor creates a new A/B test node executor
func (*ABTestNodeExecutor) Execute ¶
func (e *ABTestNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes an A/B test node using deterministic variant selection
func (*ABTestNodeExecutor) NodeType ¶
func (e *ABTestNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type AddToListNodeExecutor ¶
type AddToListNodeExecutor struct {
// contains filtered or unexported fields
}
AddToListNodeExecutor executes add-to-list nodes
func NewAddToListNodeExecutor ¶
func NewAddToListNodeExecutor(contactListRepo domain.ContactListRepository) *AddToListNodeExecutor
NewAddToListNodeExecutor creates a new add-to-list node executor
func (*AddToListNodeExecutor) Execute ¶
func (e *AddToListNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes an add-to-list node
func (*AddToListNodeExecutor) NodeType ¶
func (e *AddToListNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type AnalyticsService ¶
type AnalyticsService struct {
// contains filtered or unexported fields
}
AnalyticsService handles analytics operations
func NewAnalyticsService ¶
func NewAnalyticsService( repo domain.AnalyticsRepository, authService domain.AuthService, logger logger.Logger, ) *AnalyticsService
NewAnalyticsService creates a new analytics service
func (*AnalyticsService) GetSchemas ¶
func (s *AnalyticsService) GetSchemas(ctx context.Context, workspaceID string) (map[string]analytics.SchemaDefinition, error)
GetSchemas returns the available analytics schemas for a workspace
type AttachmentService ¶
type AttachmentService struct {
// contains filtered or unexported fields
}
AttachmentService handles attachment storage and retrieval
func NewAttachmentService ¶
func NewAttachmentService(attachmentRepo domain.AttachmentRepository) *AttachmentService
NewAttachmentService creates a new attachment service
func (*AttachmentService) GetAttachment ¶
func (s *AttachmentService) GetAttachment(ctx context.Context, workspaceID string, checksum string) (*domain.AttachmentRecord, error)
GetAttachment retrieves an attachment by checksum
func (*AttachmentService) GetAttachmentsForMessage ¶
func (s *AttachmentService) GetAttachmentsForMessage(ctx context.Context, workspaceID string, metadata []domain.AttachmentMetadata) ([]domain.Attachment, error)
GetAttachmentsForMessage retrieves all attachments for a message
func (*AttachmentService) ProcessAttachments ¶
func (s *AttachmentService) ProcessAttachments(ctx context.Context, workspaceID string, attachments []domain.Attachment) ([]domain.AttachmentMetadata, error)
ProcessAttachments processes and stores attachments, returning metadata
func (*AttachmentService) RetrieveAttachmentContent ¶
func (s *AttachmentService) RetrieveAttachmentContent(ctx context.Context, workspaceID string, metadata []domain.AttachmentMetadata) ([]AttachmentWithContent, error)
RetrieveAttachmentContent retrieves attachment content for sending emails
type AttachmentWithContent ¶
type AttachmentWithContent struct {
Filename string
Content []byte
ContentType string
Disposition string
}
AttachmentWithContent represents an attachment with binary content
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(cfg AuthServiceConfig) *AuthService
func (*AuthService) AuthenticateUserForWorkspace ¶
func (s *AuthService) AuthenticateUserForWorkspace(ctx context.Context, workspaceID string) (context.Context, *domain.User, *domain.UserWorkspace, error)
AuthenticateUserForWorkspace checks if the user exists and the session is valid for a specific workspace
func (*AuthService) AuthenticateUserFromContext ¶
func (*AuthService) GenerateAPIAuthToken ¶
func (s *AuthService) GenerateAPIAuthToken(user *domain.User) string
GenerateAPIAuthToken generates an authentication token for an API key
func (*AuthService) GenerateInvitationToken ¶
func (s *AuthService) GenerateInvitationToken(invitation *domain.WorkspaceInvitation) string
GenerateInvitationToken generates a JWT token for a workspace invitation
func (*AuthService) GenerateUserAuthToken ¶
func (s *AuthService) GenerateUserAuthToken(user *domain.User, sessionID string, expiresAt time.Time) string
GenerateUserAuthToken generates an authentication token for a user
func (*AuthService) GetUserByID ¶
GetUserByID retrieves a user by their ID
func (*AuthService) InvalidateSecretCache ¶
func (s *AuthService) InvalidateSecretCache()
InvalidateSecretCache clears the cached secret, forcing it to be reloaded on next use
func (*AuthService) ValidateInvitationToken ¶
func (s *AuthService) ValidateInvitationToken(tokenString string) (invitationID, workspaceID, email string, err error)
ValidateInvitationToken validates a JWT invitation token and returns the invitation details
func (*AuthService) VerifyUserSession ¶
func (s *AuthService) VerifyUserSession(ctx context.Context, userID, sessionID string) (*domain.User, error)
VerifyUserSession checks if the user exists and the session is valid
type AuthServiceConfig ¶
type AuthServiceConfig struct {
Repository domain.AuthRepository
WorkspaceRepository domain.WorkspaceRepository
GetSecret func() ([]byte, error) // Changed from GetKeys
Logger logger.Logger
}
type AutomationExecutor ¶
type AutomationExecutor struct {
// contains filtered or unexported fields
}
AutomationExecutor processes contacts through automation workflows
func NewAutomationExecutor ¶
func NewAutomationExecutor( automationRepo domain.AutomationRepository, contactRepo domain.ContactRepository, workspaceRepo domain.WorkspaceRepository, contactListRepo domain.ContactListRepository, templateRepo domain.TemplateRepository, emailQueueRepo domain.EmailQueueRepository, messageRepo domain.MessageHistoryRepository, timelineRepo domain.ContactTimelineRepository, log logger.Logger, apiEndpoint string, ) *AutomationExecutor
NewAutomationExecutor creates a new AutomationExecutor
func (*AutomationExecutor) Execute ¶
func (e *AutomationExecutor) Execute(ctx context.Context, workspaceID string, contactAutomation *domain.ContactAutomation) error
Execute processes a contact through their automation nodes until a delay or completion. It loops through multiple nodes in a single tick for efficiency, persisting state after each node.
func (*AutomationExecutor) ProcessBatch ¶
ProcessBatch processes a batch of scheduled contacts
type AutomationScheduler ¶
type AutomationScheduler struct {
// contains filtered or unexported fields
}
AutomationScheduler manages periodic automation execution
func NewAutomationScheduler ¶
func NewAutomationScheduler( executor *AutomationExecutor, log logger.Logger, interval time.Duration, batchSize int, ) *AutomationScheduler
NewAutomationScheduler creates a new automation scheduler
func (*AutomationScheduler) IsRunning ¶
func (s *AutomationScheduler) IsRunning() bool
IsRunning returns whether the scheduler is currently running
func (*AutomationScheduler) Start ¶
func (s *AutomationScheduler) Start(ctx context.Context)
Start begins the automation execution scheduler
func (*AutomationScheduler) Stop ¶
func (s *AutomationScheduler) Stop()
Stop gracefully stops the scheduler
type AutomationService ¶
type AutomationService struct {
// contains filtered or unexported fields
}
AutomationService handles automation business logic
func NewAutomationService ¶
func NewAutomationService( repo domain.AutomationRepository, authService domain.AuthService, logger logger.Logger, ) *AutomationService
NewAutomationService creates a new AutomationService
func (*AutomationService) Activate ¶
func (s *AutomationService) Activate(ctx context.Context, workspaceID, automationID string) error
Activate activates an automation (changes status to live and creates trigger)
func (*AutomationService) Create ¶
func (s *AutomationService) Create(ctx context.Context, workspaceID string, automation *domain.Automation) error
Create creates a new automation
func (*AutomationService) Delete ¶
func (s *AutomationService) Delete(ctx context.Context, workspaceID, automationID string) error
Delete soft-deletes an automation (can delete live automations) The repository handles dropping triggers and exiting active contacts
func (*AutomationService) Get ¶
func (s *AutomationService) Get(ctx context.Context, workspaceID, automationID string) (*domain.Automation, error)
Get retrieves an automation by ID
func (*AutomationService) GetContactNodeExecutions ¶
func (s *AutomationService) GetContactNodeExecutions(ctx context.Context, workspaceID, automationID, email string) (*domain.ContactAutomation, []*domain.NodeExecution, error)
GetContactNodeExecutions retrieves the node executions of a contact through an automation
func (*AutomationService) List ¶
func (s *AutomationService) List(ctx context.Context, workspaceID string, filter domain.AutomationFilter) ([]*domain.Automation, int, error)
List retrieves automations with optional filters
func (*AutomationService) Pause ¶
func (s *AutomationService) Pause(ctx context.Context, workspaceID, automationID string) error
Pause pauses a live automation (changes status to paused and drops trigger)
func (*AutomationService) Update ¶
func (s *AutomationService) Update(ctx context.Context, workspaceID string, automation *domain.Automation) error
Update updates an existing automation
type AutomationTriggerGenerator ¶
type AutomationTriggerGenerator struct {
// contains filtered or unexported fields
}
AutomationTriggerGenerator generates PostgreSQL trigger SQL from automation configuration
func NewAutomationTriggerGenerator ¶
func NewAutomationTriggerGenerator(queryBuilder *QueryBuilder) *AutomationTriggerGenerator
NewAutomationTriggerGenerator creates a new trigger generator
func (*AutomationTriggerGenerator) Generate ¶
func (g *AutomationTriggerGenerator) Generate(automation *domain.Automation) (*TriggerSQL, error)
Generate creates TriggerSQL for the given automation
type BlogService ¶
type BlogService struct {
// contains filtered or unexported fields
}
BlogService handles all blog-related operations
func NewBlogService ¶
func NewBlogService( logger logger.Logger, categoryRepository domain.BlogCategoryRepository, postRepository domain.BlogPostRepository, themeRepository domain.BlogThemeRepository, workspaceRepository domain.WorkspaceRepository, listRepository domain.ListRepository, templateRepository domain.TemplateRepository, authService domain.AuthService, cache cache.Cache, ) *BlogService
NewBlogService creates a new blog service
func (*BlogService) CreateCategory ¶
func (s *BlogService) CreateCategory(ctx context.Context, request *domain.CreateBlogCategoryRequest) (*domain.BlogCategory, error)
CreateCategory creates a new blog category
func (*BlogService) CreatePost ¶
func (s *BlogService) CreatePost(ctx context.Context, request *domain.CreateBlogPostRequest) (*domain.BlogPost, error)
CreatePost creates a new blog post
func (*BlogService) CreateTheme ¶
func (s *BlogService) CreateTheme(ctx context.Context, request *domain.CreateBlogThemeRequest) (*domain.BlogTheme, error)
CreateTheme creates a new blog theme
func (*BlogService) DeleteCategory ¶
func (s *BlogService) DeleteCategory(ctx context.Context, request *domain.DeleteBlogCategoryRequest) error
DeleteCategory deletes a blog category and cascade deletes all posts in that category
func (*BlogService) DeletePost ¶
func (s *BlogService) DeletePost(ctx context.Context, request *domain.DeleteBlogPostRequest) error
DeletePost deletes a blog post
func (*BlogService) GetCategory ¶
func (s *BlogService) GetCategory(ctx context.Context, id string) (*domain.BlogCategory, error)
GetCategory retrieves a blog category by ID
func (*BlogService) GetCategoryBySlug ¶
func (s *BlogService) GetCategoryBySlug(ctx context.Context, slug string) (*domain.BlogCategory, error)
GetCategoryBySlug retrieves a blog category by slug
func (*BlogService) GetPostByCategoryAndSlug ¶
func (s *BlogService) GetPostByCategoryAndSlug(ctx context.Context, categorySlug, postSlug string) (*domain.BlogPost, error)
GetPostByCategoryAndSlug retrieves a blog post by category slug and post slug
func (*BlogService) GetPostBySlug ¶
GetPostBySlug retrieves a blog post by slug
func (*BlogService) GetPublicCategoryBySlug ¶
func (s *BlogService) GetPublicCategoryBySlug(ctx context.Context, slug string) (*domain.BlogCategory, error)
GetPublicCategoryBySlug retrieves a blog category by slug for public blog pages (no authentication required)
func (*BlogService) GetPublicPostByCategoryAndSlug ¶
func (s *BlogService) GetPublicPostByCategoryAndSlug(ctx context.Context, categorySlug, postSlug string) (*domain.BlogPost, error)
GetPublicPostByCategoryAndSlug retrieves a published blog post by category slug and post slug (no auth required)
func (*BlogService) GetPublishedTheme ¶
GetPublishedTheme retrieves the currently published blog theme
func (*BlogService) ListCategories ¶
func (s *BlogService) ListCategories(ctx context.Context) (*domain.BlogCategoryListResponse, error)
ListCategories retrieves all blog categories for a workspace
func (*BlogService) ListPosts ¶
func (s *BlogService) ListPosts(ctx context.Context, params *domain.ListBlogPostsRequest) (*domain.BlogPostListResponse, error)
ListPosts retrieves blog posts with filtering and pagination
func (*BlogService) ListPublicPosts ¶
func (s *BlogService) ListPublicPosts(ctx context.Context, params *domain.ListBlogPostsRequest) (*domain.BlogPostListResponse, error)
ListPublicPosts retrieves published blog posts (no auth required)
func (*BlogService) ListThemes ¶
func (s *BlogService) ListThemes(ctx context.Context, params *domain.ListBlogThemesRequest) (*domain.BlogThemeListResponse, error)
ListThemes retrieves blog themes with pagination
func (*BlogService) PublishPost ¶
func (s *BlogService) PublishPost(ctx context.Context, request *domain.PublishBlogPostRequest) error
PublishPost publishes a draft blog post
func (*BlogService) PublishTheme ¶
func (s *BlogService) PublishTheme(ctx context.Context, request *domain.PublishBlogThemeRequest) error
PublishTheme publishes a blog theme
func (*BlogService) RenderCategoryPage ¶
func (s *BlogService) RenderCategoryPage(ctx context.Context, workspaceID, categorySlug string, page int, themeVersion *int) (string, error)
RenderCategoryPage renders a category page with posts in that category
func (*BlogService) RenderHomePage ¶
func (s *BlogService) RenderHomePage(ctx context.Context, workspaceID string, page int, themeVersion *int) (string, error)
RenderHomePage renders the blog home page with published posts
func (*BlogService) RenderPostPage ¶
func (s *BlogService) RenderPostPage(ctx context.Context, workspaceID, categorySlug, postSlug string, themeVersion *int) (string, error)
RenderPostPage renders a single blog post page
func (*BlogService) UnpublishPost ¶
func (s *BlogService) UnpublishPost(ctx context.Context, request *domain.UnpublishBlogPostRequest) error
UnpublishPost unpublishes a published blog post
func (*BlogService) UpdateCategory ¶
func (s *BlogService) UpdateCategory(ctx context.Context, request *domain.UpdateBlogCategoryRequest) (*domain.BlogCategory, error)
UpdateCategory updates an existing blog category
func (*BlogService) UpdatePost ¶
func (s *BlogService) UpdatePost(ctx context.Context, request *domain.UpdateBlogPostRequest) (*domain.BlogPost, error)
UpdatePost updates an existing blog post
func (*BlogService) UpdateTheme ¶
func (s *BlogService) UpdateTheme(ctx context.Context, request *domain.UpdateBlogThemeRequest) (*domain.BlogTheme, error)
UpdateTheme updates an existing blog theme
type BranchNodeExecutor ¶
type BranchNodeExecutor struct {
// contains filtered or unexported fields
}
BranchNodeExecutor executes branch nodes using database queries
func NewBranchNodeExecutor ¶
func NewBranchNodeExecutor(queryBuilder *QueryBuilder, workspaceRepo domain.WorkspaceRepository) *BranchNodeExecutor
NewBranchNodeExecutor creates a new branch node executor
func (*BranchNodeExecutor) Execute ¶
func (e *BranchNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a branch node
func (*BranchNodeExecutor) NodeType ¶
func (e *BranchNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type BroadcastService ¶
type BroadcastService struct {
// contains filtered or unexported fields
}
BroadcastService handles all broadcast-related operations
func NewBroadcastService ¶
func NewBroadcastService( logger logger.Logger, repository domain.BroadcastRepository, workspaceRepository domain.WorkspaceRepository, emailService domain.EmailServiceInterface, contactRepository domain.ContactRepository, templateService domain.TemplateService, taskService domain.TaskService, taskRepository domain.TaskRepository, authService domain.AuthService, eventBus domain.EventBus, messageHistoryRepository domain.MessageHistoryRepository, listService domain.ListService, apiEndpoint string, ) *BroadcastService
NewBroadcastService creates a new broadcast service
func (*BroadcastService) CancelBroadcast ¶
func (s *BroadcastService) CancelBroadcast(ctx context.Context, request *domain.CancelBroadcastRequest) error
CancelBroadcast cancels a scheduled broadcast
func (*BroadcastService) CreateBroadcast ¶
func (s *BroadcastService) CreateBroadcast(ctx context.Context, request *domain.CreateBroadcastRequest) (*domain.Broadcast, error)
CreateBroadcast creates a new broadcast
func (*BroadcastService) DeleteBroadcast ¶
func (s *BroadcastService) DeleteBroadcast(ctx context.Context, request *domain.DeleteBroadcastRequest) error
DeleteBroadcast deletes a broadcast
func (*BroadcastService) GetBroadcast ¶
func (s *BroadcastService) GetBroadcast(ctx context.Context, workspaceID, broadcastID string) (*domain.Broadcast, error)
GetBroadcast retrieves a broadcast by ID
func (*BroadcastService) GetTestResults ¶
func (s *BroadcastService) GetTestResults(ctx context.Context, workspaceID, broadcastID string) (*domain.TestResultsResponse, error)
GetTestResults retrieves A/B test results for a broadcast
func (*BroadcastService) ListBroadcasts ¶
func (s *BroadcastService) ListBroadcasts(ctx context.Context, params domain.ListBroadcastsParams) (*domain.BroadcastListResponse, error)
ListBroadcasts retrieves a list of broadcasts with pagination
func (*BroadcastService) PauseBroadcast ¶
func (s *BroadcastService) PauseBroadcast(ctx context.Context, request *domain.PauseBroadcastRequest) error
PauseBroadcast pauses a sending broadcast
func (*BroadcastService) ResumeBroadcast ¶
func (s *BroadcastService) ResumeBroadcast(ctx context.Context, request *domain.ResumeBroadcastRequest) error
ResumeBroadcast resumes a paused broadcast
func (*BroadcastService) ScheduleBroadcast ¶
func (s *BroadcastService) ScheduleBroadcast(ctx context.Context, request *domain.ScheduleBroadcastRequest) error
ScheduleBroadcast schedules a broadcast for sending
func (*BroadcastService) SelectWinner ¶
func (s *BroadcastService) SelectWinner(ctx context.Context, workspaceID, broadcastID, templateID string) error
SelectWinner manually selects the winning variation for an A/B test
func (*BroadcastService) SendToIndividual ¶
func (s *BroadcastService) SendToIndividual(ctx context.Context, request *domain.SendToIndividualRequest) error
SendToIndividual sends a broadcast to an individual recipient
func (*BroadcastService) SetTaskService ¶
func (s *BroadcastService) SetTaskService(taskService domain.TaskService)
SetTaskService sets the task service (used to avoid circular dependencies)
func (*BroadcastService) UpdateBroadcast ¶
func (s *BroadcastService) UpdateBroadcast(ctx context.Context, request *domain.UpdateBroadcastRequest) (*domain.Broadcast, error)
UpdateBroadcast updates an existing broadcast
type ConfigurationStatus ¶
type ConfigurationStatus struct {
SMTPConfigured bool
APIEndpointConfigured bool
RootEmailConfigured bool
SMTPRelayConfigured bool
}
ConfigurationStatus represents which configuration groups are set via environment
type ContactListService ¶
type ContactListService struct {
// contains filtered or unexported fields
}
func NewContactListService ¶
func NewContactListService( repo domain.ContactListRepository, _ domain.WorkspaceRepository, authService domain.AuthService, contactRepo domain.ContactRepository, listRepo domain.ListRepository, _ domain.ContactListRepository, logger logger.Logger, ) *ContactListService
func (*ContactListService) GetContactListByIDs ¶
func (s *ContactListService) GetContactListByIDs(ctx context.Context, workspaceID string, email, listID string) (*domain.ContactList, error)
func (*ContactListService) GetContactsByListID ¶
func (s *ContactListService) GetContactsByListID(ctx context.Context, workspaceID string, listID string) ([]*domain.ContactList, error)
func (*ContactListService) GetListsByEmail ¶
func (s *ContactListService) GetListsByEmail(ctx context.Context, workspaceID string, email string) ([]*domain.ContactList, error)
func (*ContactListService) RemoveContactFromList ¶
func (*ContactListService) UpdateContactListStatus ¶
func (s *ContactListService) UpdateContactListStatus(ctx context.Context, workspaceID string, email, listID string, status domain.ContactListStatus) (*domain.UpdateContactListStatusResult, error)
type ContactSegmentQueueProcessor ¶
type ContactSegmentQueueProcessor struct {
// contains filtered or unexported fields
}
ContactSegmentQueueProcessor processes queued contacts for segment recomputation
func NewContactSegmentQueueProcessor ¶
func NewContactSegmentQueueProcessor( queueRepo domain.ContactSegmentQueueRepository, segmentRepo domain.SegmentRepository, contactRepo domain.ContactRepository, workspaceRepo domain.WorkspaceRepository, logger logger.Logger, ) *ContactSegmentQueueProcessor
NewContactSegmentQueueProcessor creates a new contact segment queue processor
func (*ContactSegmentQueueProcessor) GetQueueSize ¶
func (p *ContactSegmentQueueProcessor) GetQueueSize(ctx context.Context, workspaceID string) (int, error)
GetQueueSize returns the number of contacts waiting to be processed
func (*ContactSegmentQueueProcessor) ProcessQueue ¶
func (p *ContactSegmentQueueProcessor) ProcessQueue(ctx context.Context, workspaceID string) (int, error)
ProcessQueue processes pending contacts in the queue for segment recomputation Uses a transaction to ensure row locks are held during processing Returns the number of contacts successfully processed
type ContactSegmentQueueTaskProcessor ¶
type ContactSegmentQueueTaskProcessor struct {
// contains filtered or unexported fields
}
ContactSegmentQueueTaskProcessor handles the execution of contact segment queue processing tasks This is a permanent, recurring task that runs for each workspace
func NewContactSegmentQueueTaskProcessor ¶
func NewContactSegmentQueueTaskProcessor( queueProcessor *ContactSegmentQueueProcessor, taskRepo domain.TaskRepository, logger logger.Logger, ) *ContactSegmentQueueTaskProcessor
NewContactSegmentQueueTaskProcessor creates a new contact segment queue task processor
func (*ContactSegmentQueueTaskProcessor) CanProcess ¶
func (p *ContactSegmentQueueTaskProcessor) CanProcess(taskType string) bool
CanProcess returns whether this processor can handle the given task type
func (*ContactSegmentQueueTaskProcessor) Process ¶
func (p *ContactSegmentQueueTaskProcessor) Process(ctx context.Context, task *domain.Task, timeoutAt time.Time) (bool, error)
Process executes the contact segment queue processing task This task is permanent and recurring - it always reschedules itself for the next run It processes batches continuously until the timeout is reached
type ContactService ¶
type ContactService struct {
// contains filtered or unexported fields
}
func NewContactService ¶
func NewContactService( repo domain.ContactRepository, workspaceRepo domain.WorkspaceRepository, authService domain.AuthService, messageHistoryRepo domain.MessageHistoryRepository, inboundWebhookEventRepo domain.InboundWebhookEventRepository, contactListRepo domain.ContactListRepository, contactTimelineRepo domain.ContactTimelineRepository, logger logger.Logger, ) *ContactService
func (*ContactService) BatchImportContacts ¶
func (s *ContactService) BatchImportContacts(ctx context.Context, workspaceID string, contacts []*domain.Contact, listIDs []string) *domain.BatchImportContactsResponse
func (*ContactService) CountContacts ¶
func (*ContactService) DeleteContact ¶
func (*ContactService) GetContactByEmail ¶
func (*ContactService) GetContactByExternalID ¶
func (*ContactService) GetContacts ¶
func (s *ContactService) GetContacts(ctx context.Context, req *domain.GetContactsRequest) (*domain.GetContactsResponse, error)
func (*ContactService) UpsertContact ¶
func (s *ContactService) UpsertContact(ctx context.Context, workspaceID string, contact *domain.Contact) domain.UpsertContactOperation
type ContactTimelineService ¶
type ContactTimelineService struct {
// contains filtered or unexported fields
}
ContactTimelineService implements domain.ContactTimelineService
func NewContactTimelineService ¶
func NewContactTimelineService(repo domain.ContactTimelineRepository) *ContactTimelineService
NewContactTimelineService creates a new contact timeline service
type CustomEventService ¶
type CustomEventService struct {
// contains filtered or unexported fields
}
func NewCustomEventService ¶
func NewCustomEventService( repo domain.CustomEventRepository, contactRepo domain.ContactRepository, authService domain.AuthService, logger logger.Logger, ) *CustomEventService
func (*CustomEventService) GetEvent ¶
func (s *CustomEventService) GetEvent(ctx context.Context, workspaceID, eventName, externalID string) (*domain.CustomEvent, error)
func (*CustomEventService) ImportEvents ¶
func (s *CustomEventService) ImportEvents(ctx context.Context, req *domain.ImportCustomEventsRequest) ([]string, error)
func (*CustomEventService) ListEvents ¶
func (s *CustomEventService) ListEvents(ctx context.Context, req *domain.ListCustomEventsRequest) ([]*domain.CustomEvent, error)
func (*CustomEventService) UpsertEvent ¶
func (s *CustomEventService) UpsertEvent(ctx context.Context, req *domain.UpsertCustomEventRequest) (*domain.CustomEvent, error)
UpsertEvent creates or updates a custom event with goal tracking and soft-delete support
type DNSVerificationService ¶
type DNSVerificationService struct {
// contains filtered or unexported fields
}
DNSVerificationService handles DNS verification for custom domains
func NewDNSVerificationService ¶
func NewDNSVerificationService(logger logger.Logger, expectedTarget string) *DNSVerificationService
NewDNSVerificationService creates a new DNS verification service
func (*DNSVerificationService) VerifyDomainOwnership ¶
func (s *DNSVerificationService) VerifyDomainOwnership(ctx context.Context, domainURL string) error
VerifyDomainOwnership checks if the domain has correct CNAME or A record pointing to our service
func (*DNSVerificationService) VerifyTXTRecord ¶
func (s *DNSVerificationService) VerifyTXTRecord(ctx context.Context, domainURL, expectedToken string) error
VerifyTXTRecord verifies domain ownership via TXT record (alternative method) This is useful for apex domains that cannot use CNAME
type DelayNodeExecutor ¶
type DelayNodeExecutor struct{}
DelayNodeExecutor executes delay nodes
func NewDelayNodeExecutor ¶
func NewDelayNodeExecutor() *DelayNodeExecutor
NewDelayNodeExecutor creates a new delay node executor
func (*DelayNodeExecutor) Execute ¶
func (e *DelayNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a delay node
func (*DelayNodeExecutor) NodeType ¶
func (e *DelayNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type DemoService ¶
type DemoService struct {
// contains filtered or unexported fields
}
DemoService handles demo workspace operations
func NewDemoService ¶
func NewDemoService( logger logger.Logger, config *config.Config, workspaceService *WorkspaceService, userService *UserService, contactService *ContactService, listService *ListService, contactListService *ContactListService, templateService *TemplateService, emailService *EmailService, broadcastService *BroadcastService, taskService *TaskService, transactionalNotificationService *TransactionalNotificationService, inboundWebhookEventService *InboundWebhookEventService, webhookRegistrationService *WebhookRegistrationService, messageHistoryService *MessageHistoryService, notificationCenterService *NotificationCenterService, segmentService domain.SegmentService, workspaceRepo domain.WorkspaceRepository, taskRepo domain.TaskRepository, messageHistoryRepo domain.MessageHistoryRepository, inboundWebhookEventRepo domain.InboundWebhookEventRepository, broadcastRepo domain.BroadcastRepository, customEventRepo domain.CustomEventRepository, webhookSubscriptionService *WebhookSubscriptionService, ) *DemoService
NewDemoService creates a new demo service instance
func (*DemoService) ResetDemo ¶
func (s *DemoService) ResetDemo(ctx context.Context) error
ResetDemo deletes all existing workspaces and tasks, then creates a new demo workspace
func (*DemoService) VerifyRootEmailHMAC ¶
func (s *DemoService) VerifyRootEmailHMAC(providedHMAC string) bool
VerifyRootEmailHMAC verifies the HMAC of the root email
type EmailNodeExecutor ¶
type EmailNodeExecutor struct {
// contains filtered or unexported fields
}
EmailNodeExecutor executes email nodes
func NewEmailNodeExecutor ¶
func NewEmailNodeExecutor( emailQueueRepo domain.EmailQueueRepository, templateRepo domain.TemplateRepository, workspaceRepo domain.WorkspaceRepository, apiEndpoint string, log logger.Logger, ) *EmailNodeExecutor
NewEmailNodeExecutor creates a new email node executor
func (*EmailNodeExecutor) Execute ¶
func (e *EmailNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes an email node by enqueuing to the email queue
func (*EmailNodeExecutor) NodeType ¶
func (e *EmailNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type EmailSender ¶
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
func NewEmailService ¶
func NewEmailService( logger logger.Logger, authService domain.AuthService, secretKey string, isDemo bool, workspaceRepo domain.WorkspaceRepository, templateRepo domain.TemplateRepository, templateService domain.TemplateService, messageRepo domain.MessageHistoryRepository, httpClient domain.HTTPClient, webhookEndpoint string, apiEndpoint string, ) *EmailService
NewEmailService creates a new EmailService instance
func (*EmailService) SendEmail ¶
func (s *EmailService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest, isMarketing bool) error
SendEmail sends an email using the specified provider
func (*EmailService) SendEmailForTemplate ¶
func (s *EmailService) SendEmailForTemplate(ctx context.Context, request domain.SendEmailRequest) error
SendEmailForTemplate handles sending through the email channel
func (*EmailService) TestEmailProvider ¶
func (s *EmailService) TestEmailProvider(ctx context.Context, workspaceID string, provider domain.EmailProvider, to string) error
TestEmailProvider sends a test email to verify the provider configuration works
type EnvironmentConfig ¶
type EnvironmentConfig struct {
RootEmail string
APIEndpoint string
SMTPHost string
SMTPPort int
SMTPUsername string
SMTPPassword string
SMTPFromEmail string
SMTPFromName string
SMTPUseTLS string // "true", "false", or "" (empty = not set, defaults to true)
SMTPRelayEnabled string // "true", "false", or "" (empty = not set, allows setup wizard to configure)
SMTPRelayDomain string
SMTPRelayPort int
SMTPRelayTLSCertBase64 string
SMTPRelayTLSKeyBase64 string
}
EnvironmentConfig holds configuration from environment variables
type FilterNodeExecutor ¶
type FilterNodeExecutor struct {
// contains filtered or unexported fields
}
FilterNodeExecutor executes filter nodes using database queries
func NewFilterNodeExecutor ¶
func NewFilterNodeExecutor(queryBuilder *QueryBuilder, workspaceRepo domain.WorkspaceRepository) *FilterNodeExecutor
NewFilterNodeExecutor creates a new filter node executor
func (*FilterNodeExecutor) Execute ¶
func (e *FilterNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a filter node
func (*FilterNodeExecutor) NodeType ¶
func (e *FilterNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type FirecrawlScrapeOptions ¶
type FirecrawlScrapeOptions struct {
Formats []string `json:"formats,omitempty"` // Output formats
OnlyMainContent *bool `json:"onlyMainContent,omitempty"` // Extract only main content
}
FirecrawlScrapeOptions contains scrape options for search results
type FirecrawlScrapeRequest ¶
type FirecrawlScrapeRequest struct {
URL string `json:"url"`
Formats []string `json:"formats"` // ["markdown", "html", "links", "screenshot"]
OnlyMainContent *bool `json:"onlyMainContent,omitempty"` // Extract only main content
IncludeTags []string `json:"includeTags,omitempty"` // HTML tags to include
ExcludeTags []string `json:"excludeTags,omitempty"` // HTML tags to exclude
WaitFor *int `json:"waitFor,omitempty"` // Milliseconds to wait before scraping
Timeout *int `json:"timeout,omitempty"` // Request timeout in milliseconds
Mobile *bool `json:"mobile,omitempty"` // Render as mobile device
SkipTLSVerification *bool `json:"skipTlsVerification,omitempty"` // Skip SSL certificate validation
}
FirecrawlScrapeRequest is the request for scraping a URL
type FirecrawlScrapeResponse ¶
type FirecrawlScrapeResponse struct {
Success bool `json:"success"`
Data struct {
Markdown string `json:"markdown,omitempty"`
HTML string `json:"html,omitempty"`
Title string `json:"title,omitempty"`
} `json:"data"`
Error string `json:"error,omitempty"`
}
FirecrawlScrapeResponse is the response from scraping
type FirecrawlSearchRequest ¶
type FirecrawlSearchRequest struct {
Query string `json:"query"`
Limit int `json:"limit,omitempty"` // default 5
Lang string `json:"lang,omitempty"` // Language code (e.g., "en", "de")
Country string `json:"country,omitempty"` // Country code (e.g., "US", "DE")
Location string `json:"location,omitempty"` // Location string (e.g., "San Francisco,California,United States")
TBS string `json:"tbs,omitempty"` // Time-based search filter (qdr:d, qdr:w, qdr:m)
ScrapeOptions *FirecrawlScrapeOptions `json:"scrapeOptions,omitempty"` // Options for scraping search results
}
FirecrawlSearchRequest is the request for web search
type FirecrawlSearchResponse ¶
type FirecrawlSearchResponse struct {
Success bool `json:"success"`
Data []FirecrawlSearchResult `json:"data"`
Error string `json:"error,omitempty"`
}
FirecrawlSearchResponse is the response from search
type FirecrawlSearchResult ¶
type FirecrawlSearchResult struct {
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
}
FirecrawlSearchResult is a single search result
type FirecrawlService ¶
type FirecrawlService struct {
// contains filtered or unexported fields
}
FirecrawlService handles interactions with the Firecrawl API
func NewFirecrawlService ¶
func NewFirecrawlService(log logger.Logger) *FirecrawlService
NewFirecrawlService creates a new Firecrawl service
func (*FirecrawlService) Scrape ¶
func (s *FirecrawlService) Scrape(ctx context.Context, settings *domain.FirecrawlSettings, url string, opts *ScrapeOptions) (*FirecrawlScrapeResponse, error)
Scrape fetches a URL and returns content based on options
func (*FirecrawlService) Search ¶
func (s *FirecrawlService) Search(ctx context.Context, settings *domain.FirecrawlSettings, query string, opts *SearchOptions) (*FirecrawlSearchResponse, error)
Search performs a web search and returns results
type InboundWebhookEventService ¶
type InboundWebhookEventService struct {
// contains filtered or unexported fields
}
InboundWebhookEventService implements the domain.InboundWebhookEventServiceInterface
func NewInboundWebhookEventService ¶
func NewInboundWebhookEventService( repo domain.InboundWebhookEventRepository, authService domain.AuthService, logger logger.Logger, workspaceRepo domain.WorkspaceRepository, messageHistoryRepo domain.MessageHistoryRepository, ) *InboundWebhookEventService
NewInboundWebhookEventService creates a new InboundWebhookEventService
func (*InboundWebhookEventService) ListEvents ¶
func (s *InboundWebhookEventService) ListEvents(ctx context.Context, workspaceID string, params domain.InboundWebhookEventListParams) (*domain.InboundWebhookEventListResult, error)
ListEvents retrieves all webhook events for a workspace
func (*InboundWebhookEventService) ProcessWebhook ¶
func (s *InboundWebhookEventService) ProcessWebhook(ctx context.Context, workspaceID string, integrationID string, rawPayload []byte) error
ProcessWebhook processes a webhook event from an email provider
type InvitationClaims ¶
type InvitationClaims struct {
InvitationID string `json:"invitation_id"`
WorkspaceID string `json:"workspace_id"`
Email string `json:"email"`
jwt.RegisteredClaims
}
InvitationClaims for workspace invitation tokens
type LLMService ¶
type LLMService struct {
// contains filtered or unexported fields
}
LLMService implements the LLM chat functionality
func NewLLMService ¶
func NewLLMService(config LLMServiceConfig) *LLMService
NewLLMService creates a new LLM service
func (*LLMService) StreamChat ¶
func (s *LLMService) StreamChat(ctx context.Context, req *domain.LLMChatRequest, onEvent func(domain.LLMChatEvent) error) error
StreamChat implements streaming chat with Anthropic
type LLMServiceConfig ¶
type LLMServiceConfig struct {
AuthService domain.AuthService
WorkspaceRepo domain.WorkspaceRepository
Logger logger.Logger
ToolRegistry *ServerSideToolRegistry
}
LLMServiceConfig contains configuration for the LLM service
type ListService ¶
type ListService struct {
// contains filtered or unexported fields
}
func NewListService ¶
func NewListService(repo domain.ListRepository, workspaceRepo domain.WorkspaceRepository, contactListRepo domain.ContactListRepository, contactRepo domain.ContactRepository, messageHistoryRepo domain.MessageHistoryRepository, authService domain.AuthService, emailService domain.EmailServiceInterface, logger logger.Logger, apiEndpoint string, blogCache cache.Cache) *ListService
func (*ListService) CreateList ¶
func (*ListService) DeleteList ¶
func (*ListService) GetListByID ¶
func (*ListService) GetListStats ¶
func (*ListService) SubscribeToLists ¶
func (s *ListService) SubscribeToLists(ctx context.Context, payload *domain.SubscribeToListsRequest, hasBearerToken bool) error
this method is used to subscribe a contact to a list request can come from 3 different sources: 1. API 2. Frontend (authenticated with email and email_hmac) 3. Frontend (unauthenticated with email)
func (*ListService) UnsubscribeFromLists ¶
func (s *ListService) UnsubscribeFromLists(ctx context.Context, payload *domain.UnsubscribeFromListsRequest, hasBearerToken bool) error
this method is used to unsubscribe a contact from a list request can come from 2 different sources: 1. API 2. Frontend (authenticated with email and email_hmac)
func (*ListService) UpdateList ¶
type ListStatusBranchNodeExecutor ¶
type ListStatusBranchNodeExecutor struct {
// contains filtered or unexported fields
}
ListStatusBranchNodeExecutor executes list status branch nodes
func NewListStatusBranchNodeExecutor ¶
func NewListStatusBranchNodeExecutor(contactListRepo domain.ContactListRepository) *ListStatusBranchNodeExecutor
NewListStatusBranchNodeExecutor creates a new list status branch node executor
func (*ListStatusBranchNodeExecutor) Execute ¶
func (e *ListStatusBranchNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a list status branch node
func (*ListStatusBranchNodeExecutor) NodeType ¶
func (e *ListStatusBranchNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type MailgunService ¶
type MailgunService struct {
// contains filtered or unexported fields
}
MailgunService implements the domain.MailgunServiceInterface
func NewMailgunService ¶
func NewMailgunService(httpClient domain.HTTPClient, authService domain.AuthService, logger logger.Logger, webhookEndpoint string) *MailgunService
NewMailgunService creates a new instance of MailgunService
func (*MailgunService) CreateWebhook ¶
func (s *MailgunService) CreateWebhook(ctx context.Context, config domain.MailgunSettings, webhook domain.MailgunWebhook) (*domain.MailgunWebhook, error)
CreateWebhook creates a new webhook
func (*MailgunService) DeleteWebhook ¶
func (s *MailgunService) DeleteWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string) error
DeleteWebhook deletes a webhook by ID
func (*MailgunService) GetWebhook ¶
func (s *MailgunService) GetWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string) (*domain.MailgunWebhook, error)
GetWebhook retrieves a webhook by ID
func (*MailgunService) GetWebhookStatus ¶
func (s *MailgunService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus implements the domain.WebhookProvider interface for Mailgun
func (*MailgunService) ListWebhooks ¶
func (s *MailgunService) ListWebhooks(ctx context.Context, config domain.MailgunSettings) (*domain.MailgunWebhookListResponse, error)
ListWebhooks retrieves all registered webhooks for a domain
func (*MailgunService) RegisterWebhooks ¶
func (s *MailgunService) RegisterWebhooks( ctx context.Context, workspaceID string, integrationID string, baseURL string, eventTypes []domain.EmailEventType, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks implements the domain.WebhookProvider interface for Mailgun
func (*MailgunService) SendEmail ¶
func (s *MailgunService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using Mailgun
func (*MailgunService) TestWebhook ¶
func (s *MailgunService) TestWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string, eventType string) error
TestWebhook sends a test event to a webhook
func (*MailgunService) UnregisterWebhooks ¶
func (s *MailgunService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) error
UnregisterWebhooks implements the domain.WebhookProvider interface for Mailgun
func (*MailgunService) UpdateWebhook ¶
func (s *MailgunService) UpdateWebhook(ctx context.Context, config domain.MailgunSettings, webhookID string, webhook domain.MailgunWebhook) (*domain.MailgunWebhook, error)
UpdateWebhook updates an existing webhook
type MailjetService ¶
type MailjetService struct {
// contains filtered or unexported fields
}
MailjetService implements the domain.MailjetServiceInterface
func NewMailjetService ¶
func NewMailjetService(httpClient domain.HTTPClient, authService domain.AuthService, logger logger.Logger) *MailjetService
NewMailjetService creates a new instance of MailjetService
func (*MailjetService) CreateWebhook ¶
func (s *MailjetService) CreateWebhook(ctx context.Context, config domain.MailjetSettings, webhook domain.MailjetWebhook) (*domain.MailjetWebhook, error)
CreateWebhook creates a new webhook
func (*MailjetService) DeleteWebhook ¶
func (s *MailjetService) DeleteWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64) error
DeleteWebhook deletes a webhook by ID
func (*MailjetService) GetWebhook ¶
func (s *MailjetService) GetWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64) (*domain.MailjetWebhook, error)
GetWebhook retrieves a webhook by ID
func (*MailjetService) GetWebhookStatus ¶
func (s *MailjetService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus implements the domain.WebhookProvider interface for Mailjet
func (*MailjetService) ListWebhooks ¶
func (s *MailjetService) ListWebhooks(ctx context.Context, config domain.MailjetSettings) (*domain.MailjetWebhookResponse, error)
ListWebhooks retrieves all registered webhooks
func (*MailjetService) RegisterWebhooks ¶
func (s *MailjetService) RegisterWebhooks( ctx context.Context, workspaceID string, integrationID string, baseURL string, eventTypes []domain.EmailEventType, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks implements the domain.WebhookProvider interface for Mailjet
func (*MailjetService) SendEmail ¶
func (s *MailjetService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using Mailjet
func (*MailjetService) TestWebhook ¶
func (s *MailjetService) TestWebhook(ctx context.Context, config domain.MailjetSettings, webhookID string, eventType string) error
TestWebhook implements the domain.WebhookProvider interface for Mailjet Mailjet doesn't support testing webhooks directly
func (*MailjetService) UnregisterWebhooks ¶
func (s *MailjetService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) error
UnregisterWebhooks implements the domain.WebhookProvider interface for Mailjet
func (*MailjetService) UpdateWebhook ¶
func (s *MailjetService) UpdateWebhook(ctx context.Context, config domain.MailjetSettings, webhookID int64, webhook domain.MailjetWebhook) (*domain.MailjetWebhook, error)
UpdateWebhook updates an existing webhook
type MessageHistoryService ¶
type MessageHistoryService struct {
// contains filtered or unexported fields
}
MessageHistoryService implements domain.MessageHistoryService interface
func NewMessageHistoryService ¶
func NewMessageHistoryService(repo domain.MessageHistoryRepository, workspaceRepo domain.WorkspaceRepository, logger logger.Logger, authService domain.AuthService) *MessageHistoryService
NewMessageHistoryService creates a new message history service
func (*MessageHistoryService) GetBroadcastStats ¶
func (s *MessageHistoryService) GetBroadcastStats(ctx context.Context, workspaceID string, id string) (*domain.MessageHistoryStatusSum, error)
func (*MessageHistoryService) GetBroadcastVariationStats ¶
func (s *MessageHistoryService) GetBroadcastVariationStats(ctx context.Context, workspaceID, broadcastID, templateID string) (*domain.MessageHistoryStatusSum, error)
GetBroadcastVariationStats retrieves statistics for a specific variation of a broadcast
func (*MessageHistoryService) ListMessages ¶
func (s *MessageHistoryService) ListMessages(ctx context.Context, workspaceID string, params domain.MessageListParams) (*domain.MessageListResult, error)
ListMessages retrieves messages for a workspace with cursor-based pagination and filters
type NodeExecutionParams ¶
type NodeExecutionParams struct {
WorkspaceID string
Contact *domain.ContactAutomation
Node *domain.AutomationNode
Automation *domain.Automation
ContactData *domain.Contact // Full contact data for template rendering
ExecutionContext map[string]interface{} // Reconstructed context from previous node executions
}
NodeExecutionParams contains all data needed to execute a node
type NodeExecutionResult ¶
type NodeExecutionResult struct {
NextNodeID *string // Which node to go to next (nil = completed)
ScheduledAt *time.Time // When to process next (nil = now)
Status domain.ContactAutomationStatus // New status (active, completed, exited)
Context map[string]interface{} // Updated context
Output map[string]interface{} // Output for node execution log
Error error // Error if failed
}
NodeExecutionResult contains the outcome of executing a node
type NodeExecutor ¶
type NodeExecutor interface {
Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
NodeType() domain.NodeType
}
NodeExecutor executes a specific node type
type NotificationCenterService ¶
type NotificationCenterService struct {
// contains filtered or unexported fields
}
func NewNotificationCenterService ¶
func NewNotificationCenterService( contactRepo domain.ContactRepository, workspaceRepo domain.WorkspaceRepository, listRepo domain.ListRepository, logger logger.Logger, ) *NotificationCenterService
func (*NotificationCenterService) GetContactPreferences ¶
func (s *NotificationCenterService) GetContactPreferences(ctx context.Context, workspaceID string, email string, emailHMAC string) (*domain.ContactPreferencesResponse, error)
GetContactPreferences returns the notification center data for a contact It returns public lists and public transactional notifications
type PostmarkService ¶
type PostmarkService struct {
// contains filtered or unexported fields
}
PostmarkService implements the domain.PostmarkServiceInterface
func NewPostmarkService ¶
func NewPostmarkService(httpClient domain.HTTPClient, authService domain.AuthService, logger logger.Logger) *PostmarkService
NewPostmarkService creates a new instance of PostmarkService
func (*PostmarkService) GetWebhook ¶
func (s *PostmarkService) GetWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int) (*domain.PostmarkWebhookResponse, error)
GetWebhook retrieves a specific webhook by ID
func (*PostmarkService) GetWebhookStatus ¶
func (s *PostmarkService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus implements the domain.WebhookProvider interface for Postmark
func (*PostmarkService) ListWebhooks ¶
func (s *PostmarkService) ListWebhooks(ctx context.Context, config domain.PostmarkSettings) (*domain.PostmarkListWebhooksResponse, error)
ListWebhooks retrieves all registered webhooks
func (*PostmarkService) RegisterWebhook ¶
func (s *PostmarkService) RegisterWebhook(ctx context.Context, config domain.PostmarkSettings, webhook domain.PostmarkWebhookConfig) (*domain.PostmarkWebhookResponse, error)
RegisterWebhook registers a new webhook
func (*PostmarkService) RegisterWebhooks ¶
func (s *PostmarkService) RegisterWebhooks( ctx context.Context, workspaceID string, integrationID string, baseURL string, eventTypes []domain.EmailEventType, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks implements the domain.WebhookProvider interface for Postmark
func (*PostmarkService) SendEmail ¶
func (s *PostmarkService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using Postmark
func (*PostmarkService) TestWebhook ¶
func (s *PostmarkService) TestWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int, eventType domain.EmailEventType) error
TestWebhook sends a test event to the webhook
func (*PostmarkService) UnregisterWebhook ¶
func (s *PostmarkService) UnregisterWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int) error
UnregisterWebhook removes a webhook by ID
func (*PostmarkService) UnregisterWebhooks ¶
func (s *PostmarkService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) error
UnregisterWebhooks implements the domain.WebhookProvider interface for Postmark
func (*PostmarkService) UpdateWebhook ¶
func (s *PostmarkService) UpdateWebhook(ctx context.Context, config domain.PostmarkSettings, webhookID int, webhook domain.PostmarkWebhookConfig) (*domain.PostmarkWebhookResponse, error)
UpdateWebhook updates an existing webhook
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder converts segment tree structures into safe, parameterized SQL queries
func NewQueryBuilder ¶
func NewQueryBuilder() *QueryBuilder
NewQueryBuilder creates a new query builder with field and operator whitelists
func (*QueryBuilder) BuildSQL ¶
func (qb *QueryBuilder) BuildSQL(tree *domain.TreeNode) (string, []interface{}, error)
BuildSQL converts a segment tree into parameterized SQL Returns: sql string, args []interface{}, error
func (*QueryBuilder) BuildTriggerCondition ¶
func (qb *QueryBuilder) BuildTriggerCondition(tree *domain.TreeNode, emailRef string) (string, []interface{}, error)
BuildTriggerCondition generates SQL for use in PostgreSQL trigger WHEN clauses. Unlike BuildSQL which returns "SELECT email FROM contacts WHERE ...", this returns an EXISTS subquery format with the email reference substituted.
Parameters:
- tree: The TreeNode conditions to translate
- emailRef: The email reference in trigger context (e.g., "NEW.email")
Returns SQL condition string and args (args will be embedded by caller using embedArgs)
type RemoveFromListNodeExecutor ¶
type RemoveFromListNodeExecutor struct {
// contains filtered or unexported fields
}
RemoveFromListNodeExecutor executes remove-from-list nodes
func NewRemoveFromListNodeExecutor ¶
func NewRemoveFromListNodeExecutor(contactListRepo domain.ContactListRepository) *RemoveFromListNodeExecutor
NewRemoveFromListNodeExecutor creates a new remove-from-list node executor
func (*RemoveFromListNodeExecutor) Execute ¶
func (e *RemoveFromListNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a remove-from-list node
func (*RemoveFromListNodeExecutor) NodeType ¶
func (e *RemoveFromListNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type SESService ¶
type SESService struct {
// contains filtered or unexported fields
}
SESService implements the domain.SESServiceInterface
func NewSESService ¶
func NewSESService(authService domain.AuthService, logger logger.Logger) *SESService
NewSESService creates a new instance of SESService with default factories
func NewSESServiceWithClients ¶
func NewSESServiceWithClients( authService domain.AuthService, logger logger.Logger, sessionFactory func(config domain.AmazonSESSettings) (*session.Session, error), sesClientFactory func(sess *session.Session) domain.SESWebhookClient, snsClientFactory func(sess *session.Session) domain.SNSWebhookClient, sesEmailClientFactory func(sess *session.Session) domain.SESClient, ) *SESService
NewSESServiceWithClients creates a new instance of SESService with custom factories for testing
func (*SESService) CreateConfigurationSet ¶
func (s *SESService) CreateConfigurationSet(ctx context.Context, config domain.AmazonSESSettings, name string) error
CreateConfigurationSet creates a new configuration set
func (*SESService) CreateEventDestination ¶
func (s *SESService) CreateEventDestination(ctx context.Context, config domain.AmazonSESSettings, destination domain.SESConfigurationSetEventDestination) error
CreateEventDestination creates an event destination in a configuration set
func (*SESService) CreateSNSTopic ¶
func (s *SESService) CreateSNSTopic(ctx context.Context, config domain.AmazonSESSettings, topicConfig domain.SESTopicConfig) (string, error)
CreateSNSTopic creates a new SNS topic for notifications
func (*SESService) DeleteConfigurationSet ¶
func (s *SESService) DeleteConfigurationSet(ctx context.Context, config domain.AmazonSESSettings, name string) error
DeleteConfigurationSet deletes a configuration set
func (*SESService) DeleteEventDestination ¶
func (s *SESService) DeleteEventDestination(ctx context.Context, config domain.AmazonSESSettings, configSetName, destinationName string) error
DeleteEventDestination deletes an event destination
func (*SESService) DeleteSNSTopic ¶
func (s *SESService) DeleteSNSTopic(ctx context.Context, config domain.AmazonSESSettings, topicARN string) error
DeleteSNSTopic deletes an SNS topic
func (*SESService) GetWebhookStatus ¶
func (s *SESService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus implements the domain.WebhookProvider interface for SES
func (*SESService) ListConfigurationSets ¶
func (s *SESService) ListConfigurationSets(ctx context.Context, config domain.AmazonSESSettings) ([]string, error)
ListConfigurationSets lists all configuration sets
func (*SESService) ListEventDestinations ¶
func (s *SESService) ListEventDestinations(ctx context.Context, config domain.AmazonSESSettings, configSetName string) ([]domain.SESConfigurationSetEventDestination, error)
ListEventDestinations lists all event destinations for a configuration set
func (*SESService) RegisterWebhooks ¶
func (s *SESService) RegisterWebhooks( ctx context.Context, workspaceID string, integrationID string, baseURL string, eventTypes []domain.EmailEventType, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks implements the domain.WebhookProvider interface for SES
func (*SESService) SendEmail ¶
func (s *SESService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using AWS SES
func (*SESService) UnregisterWebhooks ¶
func (s *SESService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) error
UnregisterWebhooks implements the domain.WebhookProvider interface for SES
func (*SESService) UpdateEventDestination ¶
func (s *SESService) UpdateEventDestination(ctx context.Context, config domain.AmazonSESSettings, destination domain.SESConfigurationSetEventDestination) error
UpdateEventDestination updates an event destination
type SMTPRelayHandlerService ¶
type SMTPRelayHandlerService struct {
// contains filtered or unexported fields
}
SMTPRelayHandlerService handles incoming SMTP relay messages and converts them to transactional notifications
func NewSMTPRelayHandlerService ¶
func NewSMTPRelayHandlerService( authService *AuthService, transactionalNotificationService domain.TransactionalNotificationService, workspaceRepo domain.WorkspaceRepository, logger logger.Logger, jwtSecret []byte, rateLimiter *ratelimiter.RateLimiter, ) *SMTPRelayHandlerService
NewSMTPRelayHandlerService creates a new SMTP relay handler service
func (*SMTPRelayHandlerService) Authenticate ¶
func (s *SMTPRelayHandlerService) Authenticate(username, password string) (string, error)
Authenticate validates the SMTP credentials (api_email and api_key) Returns the user_id if authentication succeeds Note: workspace_id will be extracted from the JSON payload in the email body
func (*SMTPRelayHandlerService) HandleMessage ¶
func (s *SMTPRelayHandlerService) HandleMessage(userID string, from string, to []string, data []byte) error
HandleMessage processes an incoming SMTP message and triggers a transactional notification The userID parameter is the authenticated API key user's ID
type SMTPService ¶
type SMTPService struct {
// contains filtered or unexported fields
}
SMTPService implements the domain.EmailProviderService interface for SMTP
func NewSMTPService ¶
func NewSMTPService(logger logger.Logger) *SMTPService
NewSMTPService creates a new instance of SMTPService
func (*SMTPService) SendEmail ¶
func (s *SMTPService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using SMTP
type SMTPTestConfig ¶
SMTPTestConfig represents SMTP configuration for testing
type ScrapeOptions ¶
type ScrapeOptions struct {
OnlyMainContent bool // Extract only main content (default true)
Formats []string // Output formats: "markdown", "html" (default ["markdown"])
IncludeTags []string // HTML tags to include (e.g., ["article", "main"])
ExcludeTags []string // HTML tags to exclude (e.g., ["nav", "footer"])
WaitFor int // Milliseconds to wait before scraping (default 0)
Timeout int // Request timeout in milliseconds (default 30000)
Mobile bool // Render as mobile device (default false)
SkipTLSVerification bool // Skip SSL certificate validation (default false)
}
ScrapeOptions contains options for scraping
type SearchOptions ¶
type SearchOptions struct {
Limit int // Maximum number of results (default 5)
Lang string // Language code (e.g., "en", "de")
Country string // Country code (e.g., "US", "DE")
Location string // Location string (e.g., "San Francisco,California,United States")
TBS string // Time-based search filter (qdr:d, qdr:w, qdr:m, qdr:y)
ScrapeFormats []string // Output formats for scraped results
ScrapeOnlyMainContent bool // Extract only main content from results
}
SearchOptions contains options for web search
type SegmentBuildProcessor ¶
type SegmentBuildProcessor struct {
// contains filtered or unexported fields
}
SegmentBuildProcessor handles the execution of segment building tasks
func NewSegmentBuildProcessor ¶
func NewSegmentBuildProcessor( segmentRepo domain.SegmentRepository, contactRepo domain.ContactRepository, taskRepo domain.TaskRepository, workspaceRepo domain.WorkspaceRepository, logger logger.Logger, ) *SegmentBuildProcessor
NewSegmentBuildProcessor creates a new segment build processor
func (*SegmentBuildProcessor) CanProcess ¶
func (p *SegmentBuildProcessor) CanProcess(taskType string) bool
CanProcess returns whether this processor can handle the given task type
type SegmentRecomputeTaskProcessor ¶
type SegmentRecomputeTaskProcessor struct {
// contains filtered or unexported fields
}
SegmentRecomputeTaskProcessor handles the execution of segment recompute checking tasks This is a permanent, recurring task that runs for each workspace
func NewSegmentRecomputeTaskProcessor ¶
func NewSegmentRecomputeTaskProcessor( segmentRepo domain.SegmentRepository, taskRepo domain.TaskRepository, taskService domain.TaskService, logger logger.Logger, ) *SegmentRecomputeTaskProcessor
NewSegmentRecomputeTaskProcessor creates a new segment recompute task processor
func (*SegmentRecomputeTaskProcessor) CanProcess ¶
func (p *SegmentRecomputeTaskProcessor) CanProcess(taskType string) bool
CanProcess returns whether this processor can handle the given task type
func (*SegmentRecomputeTaskProcessor) Process ¶
func (p *SegmentRecomputeTaskProcessor) Process(ctx context.Context, task *domain.Task, timeoutAt time.Time) (bool, error)
Process executes the segment recompute checking task This task is permanent and recurring - it always reschedules itself for the next run It checks for segments due for recomputation and creates build tasks for them
type SegmentService ¶
type SegmentService struct {
// contains filtered or unexported fields
}
SegmentService handles segment operations
func NewSegmentService ¶
func NewSegmentService( segmentRepo domain.SegmentRepository, workspaceRepo domain.WorkspaceRepository, taskService domain.TaskService, logger logger.Logger, ) *SegmentService
NewSegmentService creates a new segment service
func (*SegmentService) CreateSegment ¶
func (s *SegmentService) CreateSegment(ctx context.Context, req *domain.CreateSegmentRequest) (*domain.Segment, error)
CreateSegment creates a new segment
func (*SegmentService) DeleteSegment ¶
func (s *SegmentService) DeleteSegment(ctx context.Context, req *domain.DeleteSegmentRequest) error
DeleteSegment deletes a segment
func (*SegmentService) GetSegment ¶
func (s *SegmentService) GetSegment(ctx context.Context, req *domain.GetSegmentRequest) (*domain.Segment, error)
GetSegment retrieves a segment by ID
func (*SegmentService) GetSegmentContacts ¶
func (s *SegmentService) GetSegmentContacts(ctx context.Context, workspaceID, segmentID string, limit, offset int) ([]string, error)
GetSegmentContacts retrieves contacts that belong to a segment
func (*SegmentService) ListSegments ¶
func (s *SegmentService) ListSegments(ctx context.Context, req *domain.GetSegmentsRequest) ([]*domain.Segment, error)
ListSegments retrieves all segments for a workspace
func (*SegmentService) PreviewSegment ¶
func (s *SegmentService) PreviewSegment(ctx context.Context, workspaceID string, tree *domain.TreeNode, limit int) (*domain.PreviewSegmentResponse, error)
PreviewSegment executes the segment query and returns a preview of matching contacts This does NOT save the results to the database
func (*SegmentService) RebuildSegment ¶
func (s *SegmentService) RebuildSegment(ctx context.Context, workspaceID, segmentID string) error
RebuildSegment triggers a rebuild of segment membership
func (*SegmentService) UpdateSegment ¶
func (s *SegmentService) UpdateSegment(ctx context.Context, req *domain.UpdateSegmentRequest) (*domain.Segment, error)
UpdateSegment updates an existing segment
type ServerSideToolRegistry ¶
type ServerSideToolRegistry struct {
// contains filtered or unexported fields
}
ServerSideToolRegistry manages server-side tool definitions and execution
func NewServerSideToolRegistry ¶
func NewServerSideToolRegistry(firecrawlService *FirecrawlService, log logger.Logger) *ServerSideToolRegistry
NewServerSideToolRegistry creates a new server-side tool registry
func (*ServerSideToolRegistry) ExecuteTool ¶
func (r *ServerSideToolRegistry) ExecuteTool(ctx context.Context, settings *domain.FirecrawlSettings, toolName string, input map[string]interface{}) (string, error)
ExecuteTool executes a server-side tool and returns the result as string
func (*ServerSideToolRegistry) GetAvailableTools ¶
func (r *ServerSideToolRegistry) GetAvailableTools() []domain.LLMTool
GetAvailableTools returns tools to inject when Firecrawl is configured
func (*ServerSideToolRegistry) IsServerSideTool ¶
func (r *ServerSideToolRegistry) IsServerSideTool(toolName string) bool
IsServerSideTool checks if a tool should be executed server-side
type SettingService ¶
type SettingService struct {
// contains filtered or unexported fields
}
SettingService provides methods for managing system settings
func NewSettingService ¶
func NewSettingService(repo domain.SettingRepository) *SettingService
NewSettingService creates a new SettingService
func (*SettingService) GetSetting ¶
GetSetting retrieves a single setting by key
func (*SettingService) GetSystemConfig ¶
func (s *SettingService) GetSystemConfig(ctx context.Context, secretKey string) (*SystemConfig, error)
GetSystemConfig loads all system settings from the database
func (*SettingService) IsInstalled ¶
func (s *SettingService) IsInstalled(ctx context.Context) (bool, error)
IsInstalled checks if the system has been installed
func (*SettingService) SetSetting ¶
func (s *SettingService) SetSetting(ctx context.Context, key, value string) error
SetSetting sets a single setting
func (*SettingService) SetSystemConfig ¶
func (s *SettingService) SetSystemConfig(ctx context.Context, config *SystemConfig, secretKey string) error
SetSystemConfig stores all system settings in the database
type SetupConfig ¶
type SetupConfig struct {
RootEmail string
APIEndpoint string
SMTPHost string
SMTPPort int
SMTPUsername string
SMTPPassword string
SMTPFromEmail string
SMTPFromName string
SMTPUseTLS bool
TelemetryEnabled bool
CheckForUpdates bool
SMTPRelayEnabled bool
SMTPRelayDomain string
SMTPRelayPort int
SMTPRelayTLSCertBase64 string
SMTPRelayTLSKeyBase64 string
}
SetupConfig represents the setup initialization configuration
type SetupService ¶
type SetupService struct {
// contains filtered or unexported fields
}
SetupService handles setup wizard operations
func NewSetupService ¶
func NewSetupService( settingService *SettingService, userService *UserService, userRepo domain.UserRepository, logger logger.Logger, secretKey string, onSetupCompleted func() error, envConfig *EnvironmentConfig, ) *SetupService
NewSetupService creates a new setup service
func (*SetupService) GetConfigurationStatus ¶
func (s *SetupService) GetConfigurationStatus() *ConfigurationStatus
GetConfigurationStatus checks which configuration groups are set via environment
func (*SetupService) Initialize ¶
func (s *SetupService) Initialize(ctx context.Context, config *SetupConfig) error
Initialize completes the setup wizard
func (*SetupService) TestSMTPConnection ¶
func (s *SetupService) TestSMTPConnection(ctx context.Context, config *SMTPTestConfig) error
TestSMTPConnection tests the SMTP connection with the provided configuration
func (*SetupService) ValidateSetupConfig ¶
func (s *SetupService) ValidateSetupConfig(config *SetupConfig) error
ValidateSetupConfig validates the setup configuration, only checking user-provided fields
type SparkPostService ¶
type SparkPostService struct {
// contains filtered or unexported fields
}
SparkPostService implements the domain.SparkPostServiceInterface
func NewSparkPostService ¶
func NewSparkPostService(httpClient domain.HTTPClient, authService domain.AuthService, logger logger.Logger) *SparkPostService
NewSparkPostService creates a new instance of SparkPostService
func (*SparkPostService) CreateWebhook ¶
func (s *SparkPostService) CreateWebhook(ctx context.Context, config domain.SparkPostSettings, webhook domain.SparkPostWebhook) (*domain.SparkPostWebhookResponse, error)
CreateWebhook creates a new webhook
func (*SparkPostService) DeleteWebhook ¶
func (s *SparkPostService) DeleteWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) error
DeleteWebhook deletes a webhook by ID
func (*SparkPostService) GetWebhook ¶
func (s *SparkPostService) GetWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) (*domain.SparkPostWebhookResponse, error)
GetWebhook retrieves a webhook by ID
func (*SparkPostService) GetWebhookStatus ¶
func (s *SparkPostService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus implements the domain.WebhookProvider interface for SparkPost
func (*SparkPostService) ListWebhooks ¶
func (s *SparkPostService) ListWebhooks(ctx context.Context, config domain.SparkPostSettings) (*domain.SparkPostWebhookListResponse, error)
ListWebhooks retrieves all registered webhooks
func (*SparkPostService) RegisterWebhooks ¶
func (s *SparkPostService) RegisterWebhooks( ctx context.Context, workspaceID string, integrationID string, baseURL string, eventTypes []domain.EmailEventType, providerConfig *domain.EmailProvider, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks implements the domain.WebhookProvider interface for SparkPost
func (*SparkPostService) SendEmail ¶
func (s *SparkPostService) SendEmail(ctx context.Context, request domain.SendEmailProviderRequest) error
SendEmail sends an email using SparkPost
func (*SparkPostService) TestWebhook ¶
func (s *SparkPostService) TestWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string) error
TestWebhook sends a test event to a webhook
func (*SparkPostService) UnregisterWebhooks ¶
func (s *SparkPostService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, providerConfig *domain.EmailProvider, ) error
UnregisterWebhooks implements the domain.WebhookProvider interface for SparkPost
func (*SparkPostService) UpdateWebhook ¶
func (s *SparkPostService) UpdateWebhook(ctx context.Context, config domain.SparkPostSettings, webhookID string, webhook domain.SparkPostWebhook) (*domain.SparkPostWebhookResponse, error)
UpdateWebhook updates an existing webhook
func (*SparkPostService) ValidateWebhook ¶
func (s *SparkPostService) ValidateWebhook(ctx context.Context, config domain.SparkPostSettings, webhook domain.SparkPostWebhook) (bool, error)
ValidateWebhook validates a webhook's configuration
type SupabaseService ¶
type SupabaseService struct {
// contains filtered or unexported fields
}
SupabaseService handles Supabase webhook processing
func NewSupabaseService ¶
func NewSupabaseService( workspaceRepo domain.WorkspaceRepository, emailService domain.EmailServiceInterface, contactService domain.ContactService, listRepo domain.ListRepository, contactListRepo domain.ContactListRepository, templateRepo domain.TemplateRepository, templateService domain.TemplateService, transactionalRepo domain.TransactionalNotificationRepository, transactionalService domain.TransactionalNotificationService, inboundWebhookEventRepo domain.InboundWebhookEventRepository, logger logger.Logger, ) *SupabaseService
NewSupabaseService creates a new Supabase service
func (*SupabaseService) CreateDefaultSupabaseNotifications ¶
func (s *SupabaseService) CreateDefaultSupabaseNotifications(ctx context.Context, workspaceID, integrationID string, mappings *domain.SupabaseTemplateMappings) error
CreateDefaultSupabaseNotifications creates the default Supabase auth email transactional notifications
func (*SupabaseService) CreateDefaultSupabaseTemplates ¶
func (s *SupabaseService) CreateDefaultSupabaseTemplates(ctx context.Context, workspaceID, integrationID string) (*domain.SupabaseTemplateMappings, error)
CreateDefaultSupabaseTemplates creates the default Supabase auth email templates
func (*SupabaseService) DeleteIntegrationResources ¶
func (s *SupabaseService) DeleteIntegrationResources(ctx context.Context, workspaceID, integrationID string) error
DeleteIntegrationResources deletes all templates and transactional notifications associated with a Supabase integration This is called when the integration is being deleted from the workspace
func (*SupabaseService) ProcessAuthEmailHook ¶
func (s *SupabaseService) ProcessAuthEmailHook(ctx context.Context, workspaceID, integrationID string, payload []byte, webhookID, webhookTimestamp, webhookSignature string) error
ProcessAuthEmailHook processes a Supabase Send Email Hook webhook
func (*SupabaseService) ProcessUserCreatedHook ¶
func (s *SupabaseService) ProcessUserCreatedHook(ctx context.Context, workspaceID, integrationID string, payload []byte, webhookID, webhookTimestamp, webhookSignature string) error
ProcessUserCreatedHook processes a Supabase Before User Created Hook webhook
type SystemConfig ¶
type SystemConfig struct {
IsInstalled bool
RootEmail string
APIEndpoint string
SMTPHost string
SMTPPort int
SMTPUsername string
SMTPPassword string
SMTPFromEmail string
SMTPFromName string
SMTPUseTLS bool
TelemetryEnabled bool
CheckForUpdates bool
SMTPRelayEnabled bool
SMTPRelayDomain string
SMTPRelayPort int
SMTPRelayTLSCertBase64 string
SMTPRelayTLSKeyBase64 string
}
SystemConfig holds all system-level configuration
type SystemNotificationService ¶
type SystemNotificationService struct {
// contains filtered or unexported fields
}
SystemNotificationService handles system-wide notifications and alerts
func NewSystemNotificationService ¶
func NewSystemNotificationService( workspaceRepo domain.WorkspaceRepository, broadcastRepo domain.BroadcastRepository, mailerInstance mailer.Mailer, logger logger.Logger, ) *SystemNotificationService
NewSystemNotificationService creates a new system notification service
func (*SystemNotificationService) HandleBroadcastFailedEvent ¶
func (s *SystemNotificationService) HandleBroadcastFailedEvent(ctx context.Context, payload domain.EventPayload)
HandleBroadcastFailedEvent processes broadcast failure events (placeholder for future use)
func (*SystemNotificationService) HandleCircuitBreakerEvent ¶
func (s *SystemNotificationService) HandleCircuitBreakerEvent(ctx context.Context, payload domain.EventPayload)
HandleCircuitBreakerEvent processes circuit breaker events and sends email notifications
func (*SystemNotificationService) HandleSystemAlert ¶
func (s *SystemNotificationService) HandleSystemAlert(ctx context.Context, payload domain.EventPayload)
HandleSystemAlert processes generic system alerts (placeholder for future use)
func (*SystemNotificationService) RegisterWithEventBus ¶
func (s *SystemNotificationService) RegisterWithEventBus(eventBus domain.EventBus)
RegisterWithEventBus registers the service to listen for various system events
type TaskExecutor ¶
TaskScheduler manages periodic task execution TaskExecutor defines the interface for executing tasks
type TaskScheduler ¶
type TaskScheduler struct {
// contains filtered or unexported fields
}
func NewTaskScheduler ¶
func NewTaskScheduler( taskExecutor TaskExecutor, logger logger.Logger, interval time.Duration, maxTasks int, ) *TaskScheduler
NewTaskScheduler creates a new task scheduler
func (*TaskScheduler) IsRunning ¶
func (s *TaskScheduler) IsRunning() bool
IsRunning returns whether the scheduler is currently running
func (*TaskScheduler) Start ¶
func (s *TaskScheduler) Start(ctx context.Context)
Start begins the task execution scheduler
type TaskService ¶
type TaskService struct {
// contains filtered or unexported fields
}
TaskService manages task execution and state
func NewTaskService ¶
func NewTaskService(repository domain.TaskRepository, settingRepo domain.SettingRepository, logger logger.Logger, authService *AuthService, apiEndpoint string) *TaskService
NewTaskService creates a new task service instance
func (*TaskService) CreateTask ¶
CreateTask creates a new task
func (*TaskService) DeleteTask ¶
func (s *TaskService) DeleteTask(ctx context.Context, workspace, id string) error
DeleteTask removes a task
func (*TaskService) ExecutePendingTasks ¶
func (s *TaskService) ExecutePendingTasks(ctx context.Context, maxTasks int) error
ExecutePendingTasks processes a batch of pending tasks
func (*TaskService) ExecuteTask ¶
func (s *TaskService) ExecuteTask(ctx context.Context, workspace, taskID string, timeoutAt time.Time) error
ExecuteTask executes a specific task
func (*TaskService) GetLastCronRun ¶
GetLastCronRun retrieves the last cron execution timestamp
func (*TaskService) GetProcessor ¶
func (s *TaskService) GetProcessor(taskType string) (domain.TaskProcessor, error)
GetProcessor returns the processor for a given task type
func (*TaskService) IsAutoExecuteEnabled ¶
func (s *TaskService) IsAutoExecuteEnabled() bool
IsAutoExecuteEnabled returns whether automatic task execution is enabled
func (*TaskService) ListTasks ¶
func (s *TaskService) ListTasks(ctx context.Context, workspace string, filter domain.TaskFilter) (*domain.TaskListResponse, error)
ListTasks lists tasks based on filter criteria
func (*TaskService) RegisterProcessor ¶
func (s *TaskService) RegisterProcessor(processor domain.TaskProcessor)
RegisterProcessor registers a task processor for a specific task type
func (*TaskService) SetAutoExecuteImmediate ¶
func (s *TaskService) SetAutoExecuteImmediate(enabled bool)
SetAutoExecuteImmediate sets whether tasks should be automatically executed immediately This is mainly used for testing to disable auto-execution
func (*TaskService) SubscribeToBroadcastEvents ¶
func (s *TaskService) SubscribeToBroadcastEvents(eventBus domain.EventBus)
SubscribeToBroadcastEvents registers handlers for broadcast-related events
func (*TaskService) WithTransaction ¶
WithTransaction executes a function within a transaction
type TelemetryMetrics ¶
type TelemetryMetrics struct {
WorkspaceIDSHA1 string `json:"workspace_id_sha1"`
WorkspaceCreatedAt string `json:"workspace_created_at"`
WorkspaceUpdatedAt string `json:"workspace_updated_at"`
LastMessageAt string `json:"last_message_at"`
ContactsCount int `json:"contacts_count"`
BroadcastsCount int `json:"broadcasts_count"`
TransactionalCount int `json:"transactional_count"`
MessagesCount int `json:"messages_count"`
ListsCount int `json:"lists_count"`
SegmentsCount int `json:"segments_count"`
UsersCount int `json:"users_count"`
BlogPostsCount int `json:"blog_posts_count"`
APIEndpoint string `json:"api_endpoint"`
// Integration flags - boolean for each email provider
Mailgun bool `json:"mailgun"`
AmazonSES bool `json:"amazonses"`
Mailjet bool `json:"mailjet"`
SparkPost bool `json:"sparkpost"`
Postmark bool `json:"postmark"`
SMTP bool `json:"smtp"`
S3 bool `json:"s3"`
}
TelemetryMetrics represents the metrics data sent to the telemetry endpoint
type TelemetryService ¶
type TelemetryService struct {
// contains filtered or unexported fields
}
TelemetryService handles sending telemetry metrics
func NewTelemetryService ¶
func NewTelemetryService(config TelemetryServiceConfig) *TelemetryService
NewTelemetryService creates a new telemetry service
func (*TelemetryService) SendMetricsForAllWorkspaces ¶
func (t *TelemetryService) SendMetricsForAllWorkspaces(ctx context.Context) error
SendMetricsForAllWorkspaces collects and sends telemetry metrics for all workspaces
func (*TelemetryService) StartDailyScheduler ¶
func (t *TelemetryService) StartDailyScheduler(ctx context.Context)
StartDailyScheduler starts a goroutine that sends telemetry metrics daily
type TelemetryServiceConfig ¶
type TelemetryServiceConfig struct {
Enabled bool
APIEndpoint string
WorkspaceRepo domain.WorkspaceRepository
TelemetryRepo domain.TelemetryRepository
Logger logger.Logger
HTTPClient *http.Client
}
TelemetryServiceConfig contains configuration for the telemetry service
type TemplateBlockService ¶
type TemplateBlockService struct {
// contains filtered or unexported fields
}
func NewTemplateBlockService ¶
func NewTemplateBlockService( repo domain.WorkspaceRepository, authService domain.AuthService, logger logger.Logger, ) *TemplateBlockService
func (*TemplateBlockService) CreateTemplateBlock ¶
func (s *TemplateBlockService) CreateTemplateBlock(ctx context.Context, workspaceID string, block *domain.TemplateBlock) error
func (*TemplateBlockService) DeleteTemplateBlock ¶
func (*TemplateBlockService) GetTemplateBlock ¶
func (s *TemplateBlockService) GetTemplateBlock(ctx context.Context, workspaceID string, id string) (*domain.TemplateBlock, error)
func (*TemplateBlockService) ListTemplateBlocks ¶
func (s *TemplateBlockService) ListTemplateBlocks(ctx context.Context, workspaceID string) ([]*domain.TemplateBlock, error)
func (*TemplateBlockService) UpdateTemplateBlock ¶
func (s *TemplateBlockService) UpdateTemplateBlock(ctx context.Context, workspaceID string, block *domain.TemplateBlock) error
type TemplateService ¶
type TemplateService struct {
// contains filtered or unexported fields
}
func NewTemplateService ¶
func NewTemplateService(repo domain.TemplateRepository, authService domain.AuthService, logger logger.Logger, apiEndpoint string) *TemplateService
func (*TemplateService) CompileTemplate ¶
func (s *TemplateService) CompileTemplate(ctx context.Context, payload domain.CompileTemplateRequest) (*domain.CompileTemplateResponse, error)
func (*TemplateService) CreateTemplate ¶
func (*TemplateService) DeleteTemplate ¶
func (*TemplateService) GetTemplateByID ¶
func (*TemplateService) GetTemplates ¶
func (*TemplateService) UpdateTemplate ¶
type TransactionalNotificationService ¶
type TransactionalNotificationService struct {
// contains filtered or unexported fields
}
TransactionalNotificationService provides operations for managing and sending transactional notifications
func NewTransactionalNotificationService ¶
func NewTransactionalNotificationService( transactionalRepo domain.TransactionalNotificationRepository, messageHistoryRepo domain.MessageHistoryRepository, templateService domain.TemplateService, contactService domain.ContactService, emailService domain.EmailServiceInterface, authService domain.AuthService, logger logger.Logger, workspaceRepo domain.WorkspaceRepository, apiEndpoint string, ) *TransactionalNotificationService
NewTransactionalNotificationService creates a new instance of the transactional notification service
func (*TransactionalNotificationService) CreateNotification ¶
func (s *TransactionalNotificationService) CreateNotification( ctx context.Context, workspace string, params domain.TransactionalNotificationCreateParams, ) (*domain.TransactionalNotification, error)
CreateNotification creates a new transactional notification
func (*TransactionalNotificationService) DeleteNotification ¶
func (s *TransactionalNotificationService) DeleteNotification( ctx context.Context, workspace, id string, ) error
DeleteNotification soft-deletes a transactional notification
func (*TransactionalNotificationService) GetNotification ¶
func (s *TransactionalNotificationService) GetNotification( ctx context.Context, workspace, id string, ) (*domain.TransactionalNotification, error)
GetNotification retrieves a transactional notification by ID
func (*TransactionalNotificationService) ListNotifications ¶
func (s *TransactionalNotificationService) ListNotifications( ctx context.Context, workspace string, filter map[string]interface{}, limit, offset int, ) ([]*domain.TransactionalNotification, int, error)
ListNotifications retrieves all transactional notifications with optional filtering
func (*TransactionalNotificationService) SendNotification ¶
func (s *TransactionalNotificationService) SendNotification( ctx context.Context, workspaceID string, params domain.TransactionalNotificationSendParams, ) (string, error)
SendNotification sends a transactional notification to a contact
func (*TransactionalNotificationService) TestTemplate ¶
func (s *TransactionalNotificationService) TestTemplate(ctx context.Context, workspaceID string, templateID string, integrationID string, senderID string, recipientEmail string, emailOptions domain.EmailOptions) error
TestTemplate sends a test email with a template to verify it works
func (*TransactionalNotificationService) UpdateNotification ¶
func (s *TransactionalNotificationService) UpdateNotification( ctx context.Context, workspace, id string, params domain.TransactionalNotificationUpdateParams, ) (*domain.TransactionalNotification, error)
UpdateNotification updates an existing transactional notification
type TriggerNodeExecutor ¶
type TriggerNodeExecutor struct{}
TriggerNodeExecutor handles trigger nodes (pass-through to next node) Trigger nodes are entry points - the actual trigger logic is handled by the database trigger during enrollment. This executor just advances to the next node.
func NewTriggerNodeExecutor ¶
func NewTriggerNodeExecutor() *TriggerNodeExecutor
NewTriggerNodeExecutor creates a new trigger node executor
func (*TriggerNodeExecutor) Execute ¶
func (e *TriggerNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute passes through to the next node
func (*TriggerNodeExecutor) NodeType ¶
func (e *TriggerNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type TriggerSQL ¶
type TriggerSQL struct {
FunctionName string // automation_trigger_{id}
FunctionBody string // CREATE OR REPLACE FUNCTION ...
TriggerName string // automation_trigger_{id}
TriggerDDL string // CREATE TRIGGER ... WHEN (...) EXECUTE FUNCTION ...
DropTrigger string // DROP TRIGGER IF EXISTS ... ON contact_timeline
DropFunction string // DROP FUNCTION IF EXISTS ...
WHENClause string // The WHEN clause alone (for storage/debugging) - values embedded
}
TriggerSQL contains the generated SQL statements for an automation trigger
type UserClaims ¶
type UserClaims struct {
UserID string `json:"user_id"`
Type string `json:"type"`
SessionID string `json:"session_id,omitempty"`
Email string `json:"email,omitempty"`
jwt.RegisteredClaims
}
UserClaims for user session tokens
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(cfg UserServiceConfig) (*UserService, error)
func (*UserService) GetUserByEmail ¶
GetUserByEmail retrieves a user by their email address
func (*UserService) GetUserByID ¶
GetUserByID retrieves a user by their ID
func (*UserService) Logout ¶
func (s *UserService) Logout(ctx context.Context, userID string) error
Logout logs out a user by deleting all their sessions
func (*UserService) RootSignin ¶
func (s *UserService) RootSignin(ctx context.Context, input domain.RootSigninInput) (*domain.AuthResponse, error)
RootSignin authenticates the root user using HMAC signature. This allows programmatic authentication without magic link for automation scenarios.
func (*UserService) SignIn ¶
func (s *UserService) SignIn(ctx context.Context, input domain.SignInInput) (string, error)
func (*UserService) VerifyCode ¶
func (s *UserService) VerifyCode(ctx context.Context, input domain.VerifyCodeInput) (*domain.AuthResponse, error)
func (*UserService) VerifyUserSession ¶
func (s *UserService) VerifyUserSession(ctx context.Context, userID string, sessionID string) (*domain.User, error)
VerifyUserSession verifies a user session and returns the associated user
type UserServiceConfig ¶
type UserServiceConfig struct {
Repository domain.UserRepository
AuthService domain.AuthService
EmailSender EmailSender
SessionExpiry time.Duration
Logger logger.Logger
IsProduction bool
Tracer tracing.Tracer
RateLimiter *ratelimiter.RateLimiter // Global rate limiter
SecretKey string
RootEmail string
}
type WebhookDeliveryWorker ¶
type WebhookDeliveryWorker struct {
// contains filtered or unexported fields
}
WebhookDeliveryWorker processes pending webhook deliveries
func NewWebhookDeliveryWorker ¶
func NewWebhookDeliveryWorker( subscriptionRepo domain.WebhookSubscriptionRepository, deliveryRepo domain.WebhookDeliveryRepository, workspaceRepo domain.WorkspaceRepository, logger logger.Logger, httpClient *http.Client, ) *WebhookDeliveryWorker
NewWebhookDeliveryWorker creates a new webhook delivery worker
func (*WebhookDeliveryWorker) SendTestWebhook ¶
func (w *WebhookDeliveryWorker) SendTestWebhook(ctx context.Context, workspaceID string, sub *domain.WebhookSubscription, eventType string) (int, string, error)
SendTestWebhook sends a test webhook to verify the endpoint
func (*WebhookDeliveryWorker) Start ¶
func (w *WebhookDeliveryWorker) Start(ctx context.Context)
Start starts the webhook delivery worker
type WebhookNodeExecutor ¶
type WebhookNodeExecutor struct {
// contains filtered or unexported fields
}
WebhookNodeExecutor executes webhook nodes
func NewWebhookNodeExecutor ¶
func NewWebhookNodeExecutor(log logger.Logger) *WebhookNodeExecutor
NewWebhookNodeExecutor creates a new webhook node executor
func (*WebhookNodeExecutor) Execute ¶
func (e *WebhookNodeExecutor) Execute(ctx context.Context, params NodeExecutionParams) (*NodeExecutionResult, error)
Execute processes a webhook node
func (*WebhookNodeExecutor) NodeType ¶
func (e *WebhookNodeExecutor) NodeType() domain.NodeType
NodeType returns the node type this executor handles
type WebhookRegistrationService ¶
type WebhookRegistrationService struct {
// contains filtered or unexported fields
}
WebhookRegistrationService implements the domain.WebhookRegistrationService interface
func NewWebhookRegistrationService ¶
func NewWebhookRegistrationService( workspaceRepo domain.WorkspaceRepository, authService domain.AuthService, postmarkService domain.PostmarkServiceInterface, mailgunService domain.MailgunServiceInterface, mailjetService domain.MailjetServiceInterface, sparkPostService domain.SparkPostServiceInterface, sesService domain.SESServiceInterface, logger logger.Logger, apiEndpoint string, ) *WebhookRegistrationService
NewWebhookRegistrationService creates a new webhook registration service
func (*WebhookRegistrationService) GetWebhookStatus ¶
func (s *WebhookRegistrationService) GetWebhookStatus( ctx context.Context, workspaceID string, integrationID string, ) (*domain.WebhookRegistrationStatus, error)
GetWebhookStatus gets the status of webhooks for an email provider
func (*WebhookRegistrationService) RegisterWebhooks ¶
func (s *WebhookRegistrationService) RegisterWebhooks( ctx context.Context, workspaceID string, config *domain.WebhookRegistrationConfig, ) (*domain.WebhookRegistrationStatus, error)
RegisterWebhooks registers webhook URLs with the email provider
func (*WebhookRegistrationService) UnregisterWebhooks ¶
func (s *WebhookRegistrationService) UnregisterWebhooks( ctx context.Context, workspaceID string, integrationID string, ) error
UnregisterWebhooks removes all webhook URLs associated with the integration
type WebhookSubscriptionService ¶
type WebhookSubscriptionService struct {
// contains filtered or unexported fields
}
WebhookSubscriptionService handles webhook subscription business logic
func NewWebhookSubscriptionService ¶
func NewWebhookSubscriptionService( repo domain.WebhookSubscriptionRepository, deliveryRepo domain.WebhookDeliveryRepository, authService *AuthService, logger logger.Logger, ) *WebhookSubscriptionService
NewWebhookSubscriptionService creates a new webhook subscription service
func (*WebhookSubscriptionService) Create ¶
func (s *WebhookSubscriptionService) Create(ctx context.Context, workspaceID string, name, webhookURL string, eventTypes []string, customEventFilters *domain.CustomEventFilters) (*domain.WebhookSubscription, error)
Create creates a new webhook subscription
func (*WebhookSubscriptionService) Delete ¶
func (s *WebhookSubscriptionService) Delete(ctx context.Context, workspaceID, id string) error
Delete deletes a webhook subscription
func (*WebhookSubscriptionService) GetByID ¶
func (s *WebhookSubscriptionService) GetByID(ctx context.Context, workspaceID, id string) (*domain.WebhookSubscription, error)
GetByID retrieves a webhook subscription by ID
func (*WebhookSubscriptionService) GetDeliveries ¶
func (s *WebhookSubscriptionService) GetDeliveries(ctx context.Context, workspaceID string, subscriptionID *string, limit, offset int) ([]*domain.WebhookDelivery, int, error)
GetDeliveries retrieves delivery history, optionally filtered by subscription
func (*WebhookSubscriptionService) GetEventTypes ¶
func (s *WebhookSubscriptionService) GetEventTypes() []string
GetEventTypes returns the list of available event types
func (*WebhookSubscriptionService) List ¶
func (s *WebhookSubscriptionService) List(ctx context.Context, workspaceID string) ([]*domain.WebhookSubscription, error)
List retrieves all webhook subscriptions for a workspace
func (*WebhookSubscriptionService) RegenerateSecret ¶
func (s *WebhookSubscriptionService) RegenerateSecret(ctx context.Context, workspaceID, id string) (*domain.WebhookSubscription, error)
RegenerateSecret generates a new secret for a webhook subscription
func (*WebhookSubscriptionService) Toggle ¶
func (s *WebhookSubscriptionService) Toggle(ctx context.Context, workspaceID, id string, enabled bool) (*domain.WebhookSubscription, error)
Toggle enables or disables a webhook subscription
func (*WebhookSubscriptionService) Update ¶
func (s *WebhookSubscriptionService) Update(ctx context.Context, workspaceID string, id, name, webhookURL string, eventTypes []string, customEventFilters *domain.CustomEventFilters, enabled bool) (*domain.WebhookSubscription, error)
Update updates an existing webhook subscription
type WorkspaceService ¶
type WorkspaceService struct {
// contains filtered or unexported fields
}
func NewWorkspaceService ¶
func NewWorkspaceService( repo domain.WorkspaceRepository, userRepo domain.UserRepository, taskRepo domain.TaskRepository, logger logger.Logger, userService domain.UserServiceInterface, authService domain.AuthService, mailerInstance mailer.Mailer, config *config.Config, contactService domain.ContactService, listService domain.ListService, contactListService domain.ContactListService, templateService domain.TemplateService, webhookRegService domain.WebhookRegistrationService, secretKey string, supabaseService *SupabaseService, dnsVerificationService *DNSVerificationService, blogService *BlogService, ) *WorkspaceService
func (*WorkspaceService) AcceptInvitation ¶
func (s *WorkspaceService) AcceptInvitation(ctx context.Context, invitationID, workspaceID, email string) (*domain.AuthResponse, error)
AcceptInvitation processes an invitation acceptance by creating a user if needed and adding them to the workspace
func (*WorkspaceService) AddUserToWorkspace ¶
func (s *WorkspaceService) AddUserToWorkspace(ctx context.Context, workspaceID string, userID string, role string, permissions domain.UserPermissions) error
AddUserToWorkspace adds a user to a workspace if the requester is an owner
func (*WorkspaceService) CreateAPIKey ¶
func (s *WorkspaceService) CreateAPIKey(ctx context.Context, workspaceID string, emailPrefix string) (string, string, error)
CreateAPIKey creates an API key for a workspace
func (*WorkspaceService) CreateIntegration ¶
func (s *WorkspaceService) CreateIntegration(ctx context.Context, req domain.CreateIntegrationRequest) (string, error)
CreateIntegration creates a new integration for a workspace
func (*WorkspaceService) CreateWorkspace ¶
func (s *WorkspaceService) CreateWorkspace(ctx context.Context, id string, name string, websiteURL string, logoURL string, coverURL string, timezone string, fileManager domain.FileManagerSettings) (*domain.Workspace, error)
CreateWorkspace creates a new workspace and adds the creator as owner
func (*WorkspaceService) DeleteIntegration ¶
func (s *WorkspaceService) DeleteIntegration(ctx context.Context, workspaceID, integrationID string) error
DeleteIntegration deletes an integration from a workspace
func (*WorkspaceService) DeleteInvitation ¶
func (s *WorkspaceService) DeleteInvitation(ctx context.Context, invitationID string) error
DeleteInvitation deletes a workspace invitation by its ID
func (*WorkspaceService) DeleteWorkspace ¶
func (s *WorkspaceService) DeleteWorkspace(ctx context.Context, id string) error
DeleteWorkspace deletes a workspace if the user is an owner
func (*WorkspaceService) GetInvitationByID ¶
func (s *WorkspaceService) GetInvitationByID(ctx context.Context, invitationID string) (*domain.WorkspaceInvitation, error)
GetInvitationByID retrieves a workspace invitation by its ID
func (*WorkspaceService) GetWorkspace ¶
GetWorkspace returns a workspace by ID if the user has access
func (*WorkspaceService) GetWorkspaceMembersWithEmail ¶
func (s *WorkspaceService) GetWorkspaceMembersWithEmail(ctx context.Context, id string) ([]*domain.UserWorkspaceWithEmail, error)
GetWorkspaceMembersWithEmail returns all users with emails for a workspace, verifying the requester has access
func (*WorkspaceService) InviteMember ¶
func (s *WorkspaceService) InviteMember(ctx context.Context, workspaceID, email string, permissions domain.UserPermissions) (*domain.WorkspaceInvitation, string, error)
InviteMember creates an invitation for a user to join a workspace
func (*WorkspaceService) ListWorkspaces ¶
ListWorkspaces returns all workspaces for a user
func (*WorkspaceService) RemoveMember ¶
func (s *WorkspaceService) RemoveMember(ctx context.Context, workspaceID string, userIDToRemove string) error
RemoveMember removes a member from a workspace and deletes the user if it's an API key
func (*WorkspaceService) RemoveUserFromWorkspace ¶
func (s *WorkspaceService) RemoveUserFromWorkspace(ctx context.Context, workspaceID string, userID string) error
RemoveUserFromWorkspace removes a user from a workspace if the requester is an owner
func (*WorkspaceService) SetUserPermissions ¶
func (s *WorkspaceService) SetUserPermissions(ctx context.Context, workspaceID, userID string, permissions domain.UserPermissions) error
SetUserPermissions sets the permissions for a user in a workspace
func (*WorkspaceService) TransferOwnership ¶
func (s *WorkspaceService) TransferOwnership(ctx context.Context, workspaceID string, newOwnerID string, currentOwnerID string) error
TransferOwnership transfers the ownership of a workspace from the current owner to a member
func (*WorkspaceService) UpdateIntegration ¶
func (s *WorkspaceService) UpdateIntegration(ctx context.Context, req domain.UpdateIntegrationRequest) error
UpdateIntegration updates an existing integration in a workspace
func (*WorkspaceService) UpdateWorkspace ¶
func (s *WorkspaceService) UpdateWorkspace(ctx context.Context, id string, name string, settings domain.WorkspaceSettings) (*domain.Workspace, error)
UpdateWorkspace updates a workspace if the user is an owner
Source Files
¶
- analytics_service.go
- attachment_service.go
- auth_service.go
- automation_executor.go
- automation_node_executor.go
- automation_scheduler.go
- automation_service.go
- automation_trigger_generator.go
- blog_service.go
- blog_toc.go
- broadcast_service.go
- contact_list_service.go
- contact_segment_queue_processor.go
- contact_segment_queue_task_processor.go
- contact_service.go
- contact_timeline_service.go
- custom_event_service.go
- demo_service.go
- dns_verification_service.go
- email_service.go
- firecrawl_service.go
- inbound_webhook_event_service.go
- list_service.go
- llm_service.go
- llm_tool_executor.go
- mailgun_service.go
- mailjet_service.go
- message_history_service.go
- notification_center_service.go
- postmark_service.go
- query_builder.go
- segment_build_processor.go
- segment_recompute_task_processor.go
- segment_service.go
- ses_service.go
- setting_service.go
- setup_service.go
- smtp_relay_handler.go
- smtp_service.go
- sparkpost_service.go
- supabase_notifications.go
- supabase_service.go
- supabase_templates.go
- system_notification_service.go
- task_scheduler.go
- task_service.go
- telemetry_service.go
- template_block_service.go
- template_service.go
- transactional_service.go
- user_service.go
- webhook_delivery_worker.go
- webhook_registration_service.go
- webhook_subscription_service.go
- workspace_service.go