import { createGetDB, type Generated, type Timestamp, type NamespaceDB, type NamespaceInsertable, type NamespaceSelectable, type NamespaceTable, type NamespaceTableName, type NamespaceTransaction, type NamespaceUpdateable, } from "@tailor-platform/sdk/kysely"; export interface Namespace { "main-db": { ChannelRoutingBinding: { id: Generated; targetType: string; targetId: string; channelId: "IN_APP" | "EMAIL" | "SMS" | "PUSH" | "SLACK" | "TEAMS"; externalChannelRef: string; displayLabel: string | null; isActive: boolean; createdAt: Generated; updatedAt: Generated; } DestinationDeliveryLog: { id: Generated; eventType: string; sourceType: string; sourceId: string; targetType: string; targetId: string; channelId: string; externalChannelRef: string; idempotencyKey: string; subject: string; body: string; status: "PENDING" | "SENT" | "FAILED"; providerMessageId: string | null; providerResponse: string | null; failureReason: string | null; retryCount: number; attemptedAt: Timestamp; completedAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } EventCategoryBinding: { id: Generated; eventType: string; categoryId: string; transactional: boolean; defaultChannels: string[]; createdAt: Generated; updatedAt: Generated; } Notification: { id: Generated; recipientUserId: string; channelId: string; eventType: string; sourceType: string; sourceId: string; reason: "SUBSCRIBED" | "ASSIGNED" | "AUTHOR" | "MENTION"; locale: string; payloadVars: string | null; subject: string; body: string; htmlBody: string | null; idempotencyKey: string; deliveryStatus: "QUEUED" | "SENT" | "DELIVERED" | "FAILED" | "BOUNCED"; engagementStatuses: string[]; seenAt: Timestamp | null; readAt: Timestamp | null; archivedAt: Timestamp | null; adapterMessageId: string | null; createdAt: Generated; updatedAt: Generated; } NotificationCategory: { id: Generated; categoryId: string; displayName: string; optOutAllowed: boolean; createdAt: Generated; updatedAt: Generated; } NotificationChannel: { id: Generated; channelId: "IN_APP" | "EMAIL" | "SMS" | "PUSH" | "SLACK" | "TEAMS"; kind: "PERSONAL" | "DESTINATION"; displayName: string; capabilities: { supportsHtmlBody: boolean; supportsAttachments: boolean; supportsRichActions: boolean; }; enabled: boolean; createdAt: Generated; updatedAt: Generated; } NotificationDeliveryAudit: { id: Generated; notificationId: string; eventType: "QUEUED" | "SENT" | "DELIVERED" | "SEEN" | "READ" | "ARCHIVED" | "FAILED" | "BOUNCED" | "OPENED"; occurredAt: Timestamp; occurredBy: string | null; errorClass: string | null; errorDetail: string | null; createdAt: Generated; updatedAt: Generated; } NotificationEvent: { id: Generated; eventType: string; sourceType: string; sourceId: string; actorUserId: string | null; payload: string; payloadHash: string; status: "PENDING" | "DISPATCHED" | "NO_DELIVERY"; dispatchedAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } NotificationPreference: { id: Generated; userId: string; categoryId: string; channelId: string; allowed: boolean; createdAt: Generated; updatedAt: Generated; } NotificationSubscription: { id: Generated; userId: string; sourceType: string; sourceId: string; subscribedAt: Timestamp; createdAt: Generated; updatedAt: Generated; } NotificationTemplate: { id: Generated; eventType: string; channelId: string; locale: string; subject: string; body: string; htmlBody: string | null; variableSchema: string; createdAt: Generated; updatedAt: Generated; } SlackWorkspaceIntegration: { id: Generated; teamId: string; teamName: string | null; botUserId: string | null; status: "REVOKED" | "ACTIVE"; installedAt: Timestamp; lastValidatedAt: Timestamp | null; revokedAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } } } export const getDB = createGetDB(); export type DB = NamespaceDB; export type Transaction = NamespaceTransaction; type TableName = NamespaceTableName; export type Table = NamespaceTable; export type Insertable = NamespaceInsertable; export type Selectable = NamespaceSelectable; export type Updateable = NamespaceUpdateable;