Files
TeleUploader/src/application/dto/file.ts
T
Claude 5e29589f1a feat: create application DTOs
Add data-transfer-object interfaces for the application layer:
upload, file, bucket, S3, and auth domains.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 17:56:49 +07:00

69 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Public file information response returned by the file-info endpoint.
* Mirrors the JSON shape of GET /file/:publicId/info.
*/
export interface FileInfoResponse {
/** Public, shareable identifier (nanoid) */
public_id: string;
/** Stored file name */
file_name: string;
/** MIME type of the stored file */
mime_type: string;
/** File size in bytes */
size_bytes: number;
/** High-level file category (e.g. "document", "photo") */
file_type: string;
/** ISO-8601 timestamp of when the file record was created */
created_at: string;
}
/**
* Summary-level file metadata used internally for constructing
* upload responses and object listing entries.
*/
export interface FileMetadata {
/** Public, shareable identifier (nanoid) */
publicId: string;
/** Telegram file identifier used to retrieve the file from Telegram CDN */
telegramFileId: string;
/** Telegram unique file identifier (persists across reuploads) */
telegramFileUniqueId: string;
/** Chat ID where the file or archive was stored */
storageChatId: number;
/** Message ID of the stored file or archive */
storageMessageId: number;
/** Stored file name */
fileName: string;
/** MIME type of the stored file */
mimeType: string;
/** File size in bytes */
sizeBytes: number;
/** High-level file category */
fileType: string;
/** Telegram user ID of the uploader; 0 when unknown or system */
uploaderId: number;
/** Timestamp of file record creation */
createdAt: Date | string | number;
}
/**
* Upload response shape returned to API callers.
* Mirrors the JSON output of the /api/upload endpoint.
*/
export interface UploadResponse {
/** Public, shareable identifier */
public_id: string;
/** Stored file name */
file_name: string;
/** MIME type */
mime_type: string;
/** File size in bytes */
size_bytes: number;
/** High-level file category */
file_type: string;
/** ISO-8601 creation timestamp */
created_at: string;
/** Public download URL */
download_url: string;
}