ultisuite-backend/internal/api/mail/webhook_scope.go
R3D347HR4Y 1d063237b9
Some checks are pending
CI / Go tests (push) Waiting to run
CI / Integration tests (push) Waiting to run
CI / DB migrations (push) Waiting to run
feat(transcription): integrate Faster Whisper for Jitsi transcriptions
- Added support for Faster Whisper transcription via Jigasi and Skynet.
- Updated .env.example to include new environment variables for transcription settings.
- Enhanced Jitsi Docker Compose configuration to include Skynet and Jigasi services.
- Introduced new API endpoints for managing organizational folders in the drive service.
- Updated Nextcloud initialization script to enable external file mounting.
- Improved error handling and response structures in the drive API.
- Added new properties for organization settings related to transcription and agenda management.
2026-06-12 19:10:18 +02:00

63 lines
1.4 KiB
Go

package mail
import (
"encoding/json"
"github.com/ultisuite/ulti-backend/internal/automation"
)
func marshalWebhookEventTypes(types []string) ([]byte, error) {
if types == nil {
types = []string{}
}
return json.Marshal(types)
}
func marshalWebhookMailScope(scope *webhookMailScope) ([]byte, error) {
out := automation.MailScope{AllAccounts: true}
if scope != nil {
out.AllAccounts = scope.AllAccounts
out.AccountIDs = scope.AccountIDs
if out.AccountIDs == nil {
out.AccountIDs = []string{}
}
}
return json.Marshal(out)
}
func marshalWebhookDriveScope(scope *webhookDriveScope) ([]byte, error) {
out := automation.DriveScope{AllFolders: true}
if scope != nil {
out.AllFolders = scope.AllFolders
out.FolderPaths = scope.FolderPaths
if out.FolderPaths == nil {
out.FolderPaths = []string{}
}
}
return json.Marshal(out)
}
func marshalWebhookContactsScope(scope *webhookContactsScope) ([]byte, error) {
out := automation.ContactsScope{AllBooks: true}
if scope != nil {
out.AllBooks = scope.AllBooks
out.BookIDs = scope.BookIDs
if out.BookIDs == nil {
out.BookIDs = []string{}
}
}
return json.Marshal(out)
}
func marshalWebhookAgendaScope(scope *webhookAgendaScope) ([]byte, error) {
out := automation.AgendaScope{AllCalendars: true}
if scope != nil {
out.AllCalendars = scope.AllCalendars
out.CalendarIDs = scope.CalendarIDs
if out.CalendarIDs == nil {
out.CalendarIDs = []string{}
}
}
return json.Marshal(out)
}