Overview
The File node represents an uploaded file attachment. Files can be attached to various parent nodes (pages, messages, folders, etc.) and support different subtypes for images, videos, audio, PDFs, and other file types.Attributes Schema
Must be
'file'The file subtype based on content
ID of the parent node (page, message, folder, etc.)
Fractional index for ordering files among siblings
The display name of the file (may be renamed)
The original filename when uploaded
MIME type of the file (e.g.,
'image/png', 'application/pdf')File extension (e.g.,
'png', 'pdf')File size in bytes
Version identifier for the file (used for cache busting)
Upload status:
0: Pending upload1: Ready/uploaded successfully2: Error during upload
Alignment for image display (only applicable for image subtype)
Display width in pixels for images (only applicable for image subtype)
File Status Enum
/home/daytona/workspace/source/packages/core/src/types/files.ts:13-17
Permissions
canCreate
Rules: Permissions vary based on parent node type:- Tree must not be empty
- If parent is a
'message':- User needs at least
'viewer'role in the channel
- User needs at least
- For other parent types:
- User needs at least
'member'role
- User needs at least
/home/daytona/workspace/source/packages/core/src/registry/nodes/file.ts:29-49
canUpdateAttributes
Rules: Permissions vary based on parent node type:- Tree must not be empty
- If parent is a
'message':- User must be the message creator OR have
'admin'role in the channel
- User must be the message creator OR have
- For other parent types:
- User needs at least
'member'role
- User needs at least
/home/daytona/workspace/source/packages/core/src/registry/nodes/file.ts:50-70
canUpdateDocument
Rules:- Always returns
false(files do not have documents)
canDelete
Rules: Permissions vary based on parent node type:- Tree must not be empty
- If parent is a
'message':- User must be the message creator OR have
'admin'role in the channel
- User must be the message creator OR have
- For other parent types:
- User needs at least
'member'role
- User needs at least
/home/daytona/workspace/source/packages/core/src/registry/nodes/file.ts:74-94
canReact
Rules:- Always returns
false(files cannot be reacted to)
Document Schema
Files do not support documents.Text Extraction
Mentions
Files do not support mentions. Always returns[].
File Upload
Files are uploaded in parts with a part size of 20MB:/home/daytona/workspace/source/packages/core/src/types/files.ts:19