"use client"; import React from "react"; import { Copy, FileCode2, KeyRound } from "lucide-react"; import { useAuth } from "@/features/auth"; import { PublicFooter, PublicHeader } from "@/features/landing"; import { WorkspaceLayout } from "@/features/workspace"; import { SITE_URL } from "@/shared/config/site"; import { Badge, Button, useToast } from "@/shared/ui"; export function DevelopersView() { const { token, user } = useAuth(); const { notify } = useToast(); const bearerPlaceholder = token || ""; const snippets = [ { title: "1. Liệt kê danh sách tệp", method: "GET /api/files", code: `curl -s "${SITE_URL}/api/files" \\\n -H "Authorization: Bearer ${bearerPlaceholder}"`, }, { title: "2. Tải tệp lên (Multipart Streaming tới 10 GiB)", method: "POST /api/upload", code: `curl -X POST "${SITE_URL}/api/upload" \\\n -H "Authorization: Bearer ${bearerPlaceholder}" \\\n -F "path=media/video.mp4" \\\n -F "file=@./video.mp4"`, }, { title: "3. Đổi tên / Di chuyển đường dẫn (Zero-Copy Hash)", method: "PUT /api/files", code: `curl -X PUT "${SITE_URL}/api/files" \\\n -H "Authorization: Bearer ${bearerPlaceholder}" \\\n -H "Content-Type: application/json" \\\n -d '{"old_path":"media/video.mp4","new_path":"archive/video-2026.mp4"}'`, }, { title: "4. Tải xuống hoặc Stream HTTP 206 Range", method: "GET /api/download", code: `curl -L "${SITE_URL}/api/download?path=archive/video-2026.mp4" \\\n -H "Authorization: Bearer ${bearerPlaceholder}" \\\n -o video-2026.mp4`, }, ]; const bodyContent = (
/llms.txt /llms-full.txt /.well-known/openapi.json

Tài liệu Tích hợp REST API & Bearer Token

Sử dụng Session Bearer Token (HMAC-SHA256, hiệu lực 7 ngày sau khi đăng nhập) hoặc{" "} Authorization: Bearer <API_KEY> /{" "} X-API-Key (quyền Admin vĩnh viễn) để tự động hóa lưu trữ qua CLI, CI/CD hoặc AI Agent.

{token && (

{token}

)}
{snippets.map((item) => (

{item.title}

{item.method}
              {item.code}
            
))}
); if (user) { return {bodyContent}; } return (
{bodyContent}
); }