@ai- matrx/ 文件
关于存储的 AI Mattrx 文件的所有信息:上传(简单或可更新,有进展),列表, 预览并下载 URL,字节,共享链接,重命名/移动/复制,删除并恢复—— 组织里的每一通电话 无框架核心,可选反应钩.
import { createFiles } from "@ai-matrx/files";
const files = createFiles({
credentials: () => ({ kind: "user", accessToken: session.access_token }),
organizationId: activeOrganizationId, // a value or a getter
});
const { fileId } = await files.upload(file, { folderPath: "Reports", onProgress });
const rows = await files.list({ folderPath: "Reports" });
const { inline, download } = files.urls(fileId); // durable, never expire
const blob = await files.download(fileId);
const link = await files.createShareLink(fileId); // link.url opens publicly
await files.delete(fileId); // archive
await files.restore(fileId);
| 条目 | 什麽 |
|---|---|
@ai-matrx/files | createFiles + 下方所有项目,但 /tus 内部和 /react |
@ai-matrx/files/client | 单是耐用引擎: resolve,blobs, cookie 会话,治愈 |
@ai-matrx/files/tus | (tus-js-客户载荷在第一次发送) |
@ai-matrx/files/react | FilesProvider, (中文(简体) ), useFiles, (中文(简体) ), useFileUpload, (中文(简体) ), useFileList |
身份 : credentials 使用任意 @ai-matrx/api 证书设置(证书、证书)
或一个端口). @ai-matrx/auth里面的会话端口插件不变.
观众和玩家居住在 @ai-matrx/media; 通用数据库门 @ai-matrx/data。 。 。 .