UNPKG

@veas/protocol

Version:

Universal protocol for knowledge management and project tracking systems - enabling seamless interoperability between platforms and AI assistants

203 lines 5.29 kB
import type { Entity } from '../common/index.js'; export interface Workspace extends Entity { name: string; displayName?: string; description?: string; organizationId: string; settings?: WorkspaceSettings; metadata?: Record<string, unknown>; } export interface WorkspaceSettings { allowPublicChannels?: boolean; allowPrivateChannels?: boolean; allowDirectMessages?: boolean; allowThreads?: boolean; allowReactions?: boolean; maxMessageLength?: number; } export interface CreateWorkspaceData { name: string; displayName?: string; description?: string; organizationId: string; settings?: WorkspaceSettings; metadata?: Record<string, unknown>; } export interface UpdateWorkspaceData { displayName?: string; description?: string; settings?: WorkspaceSettings; metadata?: Record<string, unknown>; } export interface Channel extends Entity { workspaceId: string; name: string; displayName?: string; description?: string; topic?: string; type: ChannelType; isPrivate: boolean; isArchived: boolean; contextType?: ChannelContextType; contextId?: string; memberCount?: number; lastMessageAt?: Date; metadata?: Record<string, unknown>; } export type ChannelType = 'public' | 'private' | 'direct_message' | 'group_direct_message' | 'shared'; export type ChannelContextType = 'project' | 'issue' | 'article' | 'team' | 'general'; export interface CreateChannelData { workspaceId: string; name: string; displayName?: string; description?: string; topic?: string; type?: ChannelType; isPrivate?: boolean; contextType?: ChannelContextType; contextId?: string; initialMembers?: string[]; metadata?: Record<string, unknown>; } export interface UpdateChannelData { displayName?: string; description?: string; topic?: string; isArchived?: boolean; metadata?: Record<string, unknown>; } export interface Message extends Entity { channelId: string; userId: string; text: string; title?: string; type: MessageType; threadTs?: string; replyCount?: number; replyUsers?: string[]; lastReplyAt?: Date; mentions?: string[]; attachments?: MessageAttachment[]; reactions?: MessageReaction[]; isEdited: boolean; editedAt?: Date; deletedAt?: Date; metadata?: Record<string, unknown>; } export type MessageType = 'text' | 'code' | 'bot' | 'app_message' | 'system'; export interface MessageAttachment { id: string; filename: string; mimeType: string; size: number; url: string; thumbnailUrl?: string; } export interface MessageReaction { emoji: string; users: string[]; count: number; } export interface CreateMessageData { channelId: string; text: string; title?: string; type?: MessageType; threadTs?: string; mentions?: string[]; attachments?: CreateAttachmentData[]; metadata?: Record<string, unknown>; } export interface CreateAttachmentData { filename: string; mimeType: string; size: number; url: string; thumbnailUrl?: string; } export interface UpdateMessageData { text?: string; title?: string; mentions?: string[]; metadata?: Record<string, unknown>; } export interface Thread { parentMessageId: string; replyCount: number; participantCount: number; participants: string[]; lastReplyAt: Date; isLocked: boolean; } export interface Reaction { messageId: string; userId: string; emoji: string; createdAt: Date; } export interface AddReactionData { messageId: string; emoji: string; } export interface ChannelMember { channelId: string; userId: string; role: MemberRole; joinedAt: Date; lastReadAt?: Date; notificationPreference?: NotificationPreference; } export interface WorkspaceMember { workspaceId: string; userId: string; role: MemberRole; joinedAt: Date; status: MemberStatus; displayName?: string; title?: string; } export type MemberRole = 'owner' | 'admin' | 'member' | 'guest'; export type MemberStatus = 'active' | 'inactive' | 'suspended'; export type NotificationPreference = 'all' | 'mentions' | 'none'; export interface ChannelFilters { workspaceId?: string; name?: string; type?: ChannelType; isPrivate?: boolean; isArchived?: boolean; contextType?: ChannelContextType; contextId?: string; userIsMember?: boolean; } export interface MessageFilters { channelId?: string; userId?: string; type?: MessageType; threadTs?: string; beforeTs?: string; afterTs?: string; hasReactions?: boolean; hasAttachments?: boolean; search?: string; } export interface WorkspaceFilters { organizationId?: string; name?: string; } export interface MessageSearchResult extends Message { highlights?: string[]; score?: number; } export interface SearchMessagesParams { query: string; workspaceId?: string; channelIds?: string[]; userIds?: string[]; messageTypes?: MessageType[]; beforeDate?: Date; afterDate?: Date; hasAttachments?: boolean; hasReactions?: boolean; inThread?: boolean; } //# sourceMappingURL=types.d.ts.map