diff --git a/apps/server/src/database/types/db.d.ts b/apps/server/src/database/types/db.d.ts index fc586928f..745bddbf1 100644 --- a/apps/server/src/database/types/db.d.ts +++ b/apps/server/src/database/types/db.d.ts @@ -3,18 +3,13 @@ * Please do not edit it manually. */ -import type { ColumnType } from 'kysely'; +import type { ColumnType } from "kysely"; -export type Generated = - T extends ColumnType - ? ColumnType - : ColumnType; +export type Generated = T extends ColumnType + ? ColumnType + : ColumnType; -export type Int8 = ColumnType< - string, - bigint | number | string, - bigint | number | string ->; +export type Int8 = ColumnType; export type Json = JsonValue; @@ -30,15 +25,40 @@ export type JsonValue = JsonArray | JsonObject | JsonPrimitive; export type Timestamp = ColumnType; +export interface AiChatMessages { + chatId: string; + content: string | null; + createdAt: Generated; + deletedAt: Timestamp | null; + id: Generated; + metadata: Json | null; + role: string; + toolCalls: Json | null; + tsv: string | null; + updatedAt: Generated; + userId: string | null; + workspaceId: string; +} + +export interface AiChats { + createdAt: Generated; + creatorId: string; + deletedAt: Timestamp | null; + id: Generated; + title: string | null; + updatedAt: Generated; + workspaceId: string; +} + export interface ApiKeys { createdAt: Generated; + creatorId: string; deletedAt: Timestamp | null; expiresAt: Timestamp | null; id: Generated; lastUsedAt: Timestamp | null; name: string | null; updatedAt: Generated; - creatorId: string; workspaceId: string; } @@ -93,25 +113,25 @@ export interface AuthProviders { createdAt: Generated; creatorId: string | null; deletedAt: Timestamp | null; + groupSync: Generated; id: Generated; isEnabled: Generated; - groupSync: Generated; ldapBaseDn: string | null; ldapBindDn: string | null; ldapBindPassword: string | null; + ldapConfig: Json | null; ldapTlsCaCert: string | null; ldapTlsEnabled: Generated; ldapUrl: string | null; ldapUserAttributes: Json | null; ldapUserSearchFilter: string | null; - ldapConfig: Json | null; - settings: Json | null; name: string; oidcClientId: string | null; oidcClientSecret: string | null; oidcIssuer: string | null; samlCertificate: string | null; samlUrl: string | null; + settings: Json | null; type: string; updatedAt: Generated; workspaceId: string; @@ -126,6 +146,51 @@ export interface Backlinks { workspaceId: string; } +export interface BaseProperties { + createdAt: Generated; + deletedAt: Timestamp | null; + id: Generated; + isPrimary: Generated; + name: string; + pageId: string; + pendingType: string | null; + pendingTypeOptions: Json | null; + position: string; + schemaVersion: Generated; + type: string; + typeOptions: Json | null; + updatedAt: Generated; + workspaceId: string; +} + +export interface BaseRows { + cells: Generated; + createdAt: Generated; + creatorId: string | null; + deletedAt: Timestamp | null; + id: Generated; + lastUpdatedById: string | null; + pageId: string; + position: string; + searchText: string | null; + searchTsv: string | null; + updatedAt: Generated; + workspaceId: string; +} + +export interface BaseViews { + config: Generated; + createdAt: Generated; + creatorId: string | null; + id: Generated; + name: string; + pageId: string; + position: string; + type: Generated; + updatedAt: Generated; + workspaceId: string; +} + export interface Billing { amount: Int8 | null; billingScheme: string | null; @@ -176,14 +241,14 @@ export interface Comments { } export interface Favorites { + createdAt: Generated; id: Generated; - userId: string; pageId: string | null; spaceId: string | null; templateId: string | null; type: string; + userId: string; workspaceId: string; - createdAt: Generated; } export interface FileTasks { @@ -226,6 +291,67 @@ export interface GroupUsers { userId: string; } +export interface Labels { + createdAt: Generated; + id: Generated; + name: string; + type: Generated; + updatedAt: Generated; + workspaceId: string; +} + +export interface Notifications { + actorId: string | null; + archivedAt: Timestamp | null; + commentId: string | null; + createdAt: Generated; + data: Json | null; + emailedAt: Timestamp | null; + id: Generated; + pageId: string | null; + pageVerificationId: string | null; + readAt: Timestamp | null; + spaceId: string | null; + type: string; + userId: string; + workspaceId: string; +} + +export interface PageAccess { + accessLevel: string; + createdAt: Generated; + creatorId: string | null; + id: Generated; + pageId: string; + spaceId: string; + updatedAt: Generated; + workspaceId: string; +} + +export interface PageEmbeddings { + chunkIndex: Int8 | null; + chunkLength: Int8 | null; + chunkStart: Int8 | null; + chunkText: string | null; + createdAt: Generated; + deletedAt: Timestamp | null; + embedding: string; + id: Generated; + metadata: Generated; + modelDimensions: Int8 | null; + modelName: string | null; + pageId: string; + spaceId: string; + updatedAt: Generated; + workspaceId: string; +} + +export interface PageHierarchy { + ancestorId: string; + depth: Generated; + descendantId: string; +} + export interface PageHistory { content: Json | null; contributorIds: Generated; @@ -244,7 +370,26 @@ export interface PageHistory { workspaceId: string; } +export interface PageLabels { + createdAt: Generated; + id: Generated; + labelId: string; + pageId: string; +} + +export interface PagePermissions { + addedById: string | null; + createdAt: Generated; + groupId: string | null; + id: Generated; + pageAccessId: string; + role: string; + updatedAt: Generated; + userId: string | null; +} + export interface Pages { + baseSchemaVersion: Generated; content: Json | null; contributorIds: Generated; coverPhoto: string | null; @@ -254,6 +399,7 @@ export interface Pages { deletedById: string | null; icon: string | null; id: Generated; + isBase: Generated; isLocked: Generated; lastUpdatedById: string | null; parentPageId: string | null; @@ -268,6 +414,39 @@ export interface Pages { ydoc: Buffer | null; } +export interface PageVerifications { + createdAt: Generated; + creatorId: string | null; + data: Json | null; + expiresAt: Timestamp | null; + id: Generated; + mode: string | null; + pageId: string; + periodAmount: number | null; + periodUnit: string | null; + rejectedAt: Timestamp | null; + rejectedById: string | null; + rejectionComment: string | null; + requestedAt: Timestamp | null; + requestedById: string | null; + spaceId: string; + status: string | null; + type: Generated; + updatedAt: Generated; + verifiedAt: Timestamp | null; + verifiedById: string | null; + workspaceId: string; +} + +export interface PageVerifiers { + addedById: string | null; + createdAt: Generated; + id: Generated; + isPrimary: Generated; + pageVerificationId: string; + userId: string; +} + export interface Shares { createdAt: Generated; creatorId: string | null; @@ -310,6 +489,25 @@ export interface Spaces { workspaceId: string; } +export interface Templates { + collaboratorIds: string[] | null; + content: Json | null; + createdAt: Generated; + creatorId: string | null; + deletedAt: Timestamp | null; + description: string | null; + icon: string | null; + id: Generated; + lastUpdatedById: string | null; + spaceId: string | null; + textContent: string | null; + title: string | null; + tsv: string | null; + updatedAt: Generated; + workspaceId: string; + ydoc: Buffer | null; +} + export interface UserMfa { backupCodes: string[] | null; createdAt: Generated; @@ -329,12 +527,12 @@ export interface Users { deletedAt: Timestamp | null; email: string; emailVerifiedAt: Timestamp | null; + hasGeneratedPassword: Generated; id: Generated; invitedById: string | null; lastActiveAt: Timestamp | null; lastLoginAt: Timestamp | null; locale: string | null; - hasGeneratedPassword: Generated; name: string | null; password: string | null; role: string | null; @@ -344,6 +542,21 @@ export interface Users { workspaceId: string | null; } +export interface UserSessions { + createdAt: Generated; + deviceName: string | null; + expiresAt: Timestamp; + geoLocation: string | null; + id: Generated; + ipAddress: string | null; + lastActiveAt: Generated; + metadata: Json | null; + revokedAt: Timestamp | null; + userAgent: string | null; + userId: string; + workspaceId: string; +} + export interface UserTokens { createdAt: Generated; expiresAt: Timestamp | null; @@ -355,6 +568,18 @@ export interface UserTokens { workspaceId: string | null; } +export interface Watchers { + addedById: string | null; + createdAt: Generated; + id: Generated; + mutedAt: Timestamp | null; + pageId: string | null; + spaceId: string; + type: string; + userId: string; + workspaceId: string; +} + export interface WorkspaceInvitations { createdAt: Generated; email: string | null; @@ -368,8 +593,7 @@ export interface WorkspaceInvitations { } export interface Workspaces { - auditRetentionDays: Generated; - trashRetentionDays: Generated; + auditRetentionDays: Int8 | null; billingEmail: string | null; createdAt: Generated; customDomain: string | null; @@ -389,239 +613,40 @@ export interface Workspaces { settings: Json | null; status: string | null; stripeCustomerId: string | null; + trashRetentionDays: Int8 | null; trialEndAt: Timestamp | null; updatedAt: Generated; } -export interface Notifications { - id: Generated; - userId: string; - workspaceId: string; - type: string; - actorId: string | null; - pageId: string | null; - spaceId: string | null; - commentId: string | null; - pageVerificationId: string | null; - data: Json | null; - readAt: Timestamp | null; - emailedAt: Timestamp | null; - archivedAt: Timestamp | null; - createdAt: Generated; -} - -export interface Watchers { - id: Generated; - userId: string; - pageId: string | null; - spaceId: string; - workspaceId: string; - type: string; - addedById: string | null; - mutedAt: Timestamp | null; - createdAt: Generated; -} - -export interface Bases { - id: Generated; - name: string; - description: string | null; - icon: string | null; - pageId: string | null; - spaceId: string; - workspaceId: string; - creatorId: string | null; - createdAt: Generated; - updatedAt: Generated; - deletedAt: Timestamp | null; - schemaVersion: Generated; -} - -export interface BaseProperties { - id: Generated; - baseId: string; - name: string; - type: string; - position: string; - typeOptions: Json | null; - pendingType: string | null; - pendingTypeOptions: Json | null; - isPrimary: Generated; - workspaceId: string; - createdAt: Generated; - updatedAt: Generated; - schemaVersion: Generated; - deletedAt: Timestamp | null; -} - -export interface BaseRows { - id: Generated; - baseId: string; - cells: Generated; - position: string; - creatorId: string | null; - lastUpdatedById: string | null; - workspaceId: string; - createdAt: Generated; - updatedAt: Generated; - deletedAt: Timestamp | null; - searchText: string | null; - searchTsv: string | null; -} - -export interface BaseViews { - id: Generated; - baseId: string; - name: string; - type: Generated; - position: string; - config: Generated; - workspaceId: string; - creatorId: string | null; - createdAt: Generated; - updatedAt: Generated; -} - -export interface PageAccess { - id: Generated; - pageId: string; - workspaceId: string; - spaceId: string; - accessLevel: string; - creatorId: string | null; - createdAt: Generated; - updatedAt: Generated; -} - -export interface PagePermissions { - id: Generated; - pageAccessId: string; - userId: string | null; - groupId: string | null; - role: string; - addedById: string | null; - createdAt: Generated; - updatedAt: Generated; -} - -export interface PageVerifications { - id: Generated; - pageId: string; - workspaceId: string; - spaceId: string; - type: Generated; - status: string | null; - mode: string | null; - periodAmount: number | null; - periodUnit: string | null; - verifiedAt: Timestamp | null; - verifiedById: string | null; - expiresAt: Timestamp | null; - requestedAt: Timestamp | null; - requestedById: string | null; - rejectedAt: Timestamp | null; - rejectedById: string | null; - rejectionComment: string | null; - data: Json | null; - creatorId: string | null; - createdAt: Generated; - updatedAt: Generated; -} - -export interface PageVerifiers { - id: Generated; - pageVerificationId: string; - userId: string; - isPrimary: Generated; - addedById: string | null; - createdAt: Generated; -} - -export interface Templates { - id: Generated; - title: string | null; - description: string | null; - content: Json | null; - ydoc: Buffer | null; - icon: string | null; - spaceId: string | null; - workspaceId: string; - creatorId: string | null; - lastUpdatedById: string | null; - collaboratorIds: string[] | null; - textContent: string | null; - tsv: string | null; - createdAt: Generated; - updatedAt: Generated; - deletedAt: Timestamp | null; -} - -export interface AiChats { - id: Generated; - workspaceId: string; - creatorId: string; - title: string | null; - createdAt: Generated; - updatedAt: Generated; - deletedAt: Timestamp | null; -} - -export interface AiChatMessages { - id: Generated; - chatId: string; - workspaceId: string; - userId: string | null; - role: string; - content: string | null; - toolCalls: Json | null; - metadata: Json | null; - tsv: string | null; - createdAt: Generated; - updatedAt: Generated; - deletedAt: Timestamp | null; -} - -export interface UserSessions { - id: Generated; - userId: string; - workspaceId: string; - deviceName: string | null; - userAgent: string | null; - ipAddress: string | null; - geoLocation: string | null; - metadata: Json | null; - lastActiveAt: Generated; - expiresAt: Timestamp; - revokedAt: Timestamp | null; - createdAt: Generated; -} - export interface DB { - aiChats: AiChats; aiChatMessages: AiChatMessages; + aiChats: AiChats; apiKeys: ApiKeys; attachments: Attachments; audit: Audit; - baseProperties: BaseProperties; - baseRows: BaseRows; - baseViews: BaseViews; - bases: Bases; authAccounts: AuthAccounts; authProviders: AuthProviders; backlinks: Backlinks; + baseProperties: BaseProperties; + baseRows: BaseRows; + baseViews: BaseViews; billing: Billing; comments: Comments; favorites: Favorites; fileTasks: FileTasks; groups: Groups; groupUsers: GroupUsers; + labels: Labels; notifications: Notifications; pageAccess: PageAccess; - pagePermissions: PagePermissions; + pageEmbeddings: PageEmbeddings; + pageHierarchy: PageHierarchy; pageHistory: PageHistory; + pageLabels: PageLabels; + pagePermissions: PagePermissions; + pages: Pages; pageVerifications: PageVerifications; pageVerifiers: PageVerifiers; - pages: Pages; shares: Shares; spaceMembers: SpaceMembers; spaces: Spaces;