Spaces:
Sleeping
Sleeping
| /** | |
| * Generated by orval v8.5.3 🍺 | |
| * Do not edit manually. | |
| * Api | |
| * RAQIM — Document to Markdown conversion platform API | |
| * OpenAPI spec version: 0.1.0 | |
| */ | |
| import * as zod from "zod"; | |
| /** | |
| * @summary Health check | |
| */ | |
| export const HealthCheckResponse = zod.object({ | |
| status: zod.string(), | |
| }); | |
| /** | |
| * @summary Submit a join request (creates pending account) | |
| */ | |
| export const RegisterUserBody = zod.object({ | |
| email: zod.string().email(), | |
| password: zod.string(), | |
| displayName: zod.string().optional(), | |
| }); | |
| /** | |
| * @summary Login with email and password | |
| */ | |
| export const LoginUserBody = zod.object({ | |
| email: zod.string().email(), | |
| password: zod.string(), | |
| }); | |
| export const LoginUserResponse = zod.object({ | |
| accessToken: zod.string(), | |
| user: zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| role: zod.enum(["user", "admin"]), | |
| status: zod.enum(["pending", "active", "suspended"]), | |
| createdAt: zod.coerce.date(), | |
| }), | |
| }); | |
| /** | |
| * @summary Logout and invalidate refresh token | |
| */ | |
| export const LogoutUserResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Refresh access token | |
| */ | |
| export const RefreshTokenResponse = zod.object({ | |
| accessToken: zod.string(), | |
| user: zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| role: zod.enum(["user", "admin"]), | |
| status: zod.enum(["pending", "active", "suspended"]), | |
| createdAt: zod.coerce.date(), | |
| }), | |
| }); | |
| /** | |
| * @summary Get current authenticated user | |
| */ | |
| export const GetCurrentUserResponse = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| role: zod.enum(["user", "admin"]), | |
| status: zod.enum(["pending", "active", "suspended"]), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Request password reset email | |
| */ | |
| export const ForgotPasswordBody = zod.object({ | |
| email: zod.string().email(), | |
| }); | |
| export const ForgotPasswordResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Reset password using token | |
| */ | |
| export const ResetPasswordBody = zod.object({ | |
| token: zod.string(), | |
| password: zod.string(), | |
| }); | |
| export const ResetPasswordResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary List folders for current user | |
| */ | |
| export const ListFoldersQueryParams = zod.object({ | |
| parentId: zod.coerce | |
| .string() | |
| .optional() | |
| .describe("Parent folder ID (null for root)"), | |
| }); | |
| export const ListFoldersResponseItem = zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| parentId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| fileCount: zod.number(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| export const ListFoldersResponse = zod.array(ListFoldersResponseItem); | |
| /** | |
| * @summary Create a new folder | |
| */ | |
| export const CreateFolderBody = zod.object({ | |
| name: zod.string(), | |
| parentId: zod.string().nullish(), | |
| }); | |
| /** | |
| * @summary Rename or move a folder | |
| */ | |
| export const UpdateFolderParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const UpdateFolderBody = zod.object({ | |
| name: zod.string().optional(), | |
| parentId: zod.string().nullish(), | |
| }); | |
| export const UpdateFolderResponse = zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| parentId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| fileCount: zod.number(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Move folder to trash | |
| */ | |
| export const DeleteFolderParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const DeleteFolderResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary List files for current user | |
| */ | |
| export const ListFilesQueryParams = zod.object({ | |
| folderId: zod.coerce | |
| .string() | |
| .optional() | |
| .describe("Folder ID (null for root)"), | |
| search: zod.coerce.string().optional().describe("Search by name"), | |
| trashed: zod.coerce.boolean().optional().describe("Show trashed files"), | |
| shared: zod.coerce.boolean().optional().describe("Show files shared with me"), | |
| }); | |
| export const ListFilesResponseItem = zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| originalName: zod.string(), | |
| originalType: zod.string(), | |
| sizeBytes: zod.number(), | |
| status: zod.enum([ | |
| "uploading", | |
| "queued", | |
| "processing", | |
| "done", | |
| "failed", | |
| "trashed", | |
| ]), | |
| qualityScore: zod.number().nullish(), | |
| wordCount: zod.number().nullish(), | |
| language: zod.string().nullish(), | |
| isShared: zod.boolean(), | |
| sharedWith: zod | |
| .array( | |
| zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }), | |
| ) | |
| .optional(), | |
| permission: zod.enum(["owner", "read", "edit", "full"]).nullish(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| export const ListFilesResponse = zod.array(ListFilesResponseItem); | |
| /** | |
| * @summary Get file metadata | |
| */ | |
| export const GetFileParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const GetFileResponse = zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| originalName: zod.string(), | |
| originalType: zod.string(), | |
| sizeBytes: zod.number(), | |
| status: zod.enum([ | |
| "uploading", | |
| "queued", | |
| "processing", | |
| "done", | |
| "failed", | |
| "trashed", | |
| ]), | |
| qualityScore: zod.number().nullish(), | |
| wordCount: zod.number().nullish(), | |
| language: zod.string().nullish(), | |
| isShared: zod.boolean(), | |
| sharedWith: zod | |
| .array( | |
| zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }), | |
| ) | |
| .optional(), | |
| permission: zod.enum(["owner", "read", "edit", "full"]).nullish(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Rename or move a file | |
| */ | |
| export const UpdateFileParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const UpdateFileBody = zod.object({ | |
| name: zod.string().optional(), | |
| folderId: zod.string().nullish(), | |
| }); | |
| export const UpdateFileResponse = zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| originalName: zod.string(), | |
| originalType: zod.string(), | |
| sizeBytes: zod.number(), | |
| status: zod.enum([ | |
| "uploading", | |
| "queued", | |
| "processing", | |
| "done", | |
| "failed", | |
| "trashed", | |
| ]), | |
| qualityScore: zod.number().nullish(), | |
| wordCount: zod.number().nullish(), | |
| language: zod.string().nullish(), | |
| isShared: zod.boolean(), | |
| sharedWith: zod | |
| .array( | |
| zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }), | |
| ) | |
| .optional(), | |
| permission: zod.enum(["owner", "read", "edit", "full"]).nullish(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Move file to trash | |
| */ | |
| export const DeleteFileParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const DeleteFileResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Get file markdown content | |
| */ | |
| export const GetFileContentParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const GetFileContentResponse = zod.object({ | |
| id: zod.string(), | |
| markdownContent: zod.string(), | |
| originalMarkdown: zod.string(), | |
| updatedAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Update file markdown content (auto-save) | |
| */ | |
| export const UpdateFileContentParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const UpdateFileContentBody = zod.object({ | |
| markdownContent: zod.string(), | |
| }); | |
| export const UpdateFileContentResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Restore file from trash | |
| */ | |
| export const RestoreFileParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const RestoreFileResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Export file as DOCX or PDF | |
| */ | |
| export const ExportFileParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const ExportFileBody = zod.object({ | |
| format: zod.enum(["md", "docx", "pdf", "print"]), | |
| fileName: zod.string().optional(), | |
| }); | |
| export const ExportFileResponse = zod.object({ | |
| downloadUrl: zod.string(), | |
| fileName: zod.string(), | |
| format: zod.string(), | |
| }); | |
| /** | |
| * @summary Start document conversion job | |
| */ | |
| export const StartConversionBody = zod.object({ | |
| fileId: zod.string(), | |
| pageStart: zod.number().nullish(), | |
| pageEnd: zod.number().nullish(), | |
| }); | |
| /** | |
| * @summary Get conversion job status and progress | |
| */ | |
| export const GetConversionStatusParams = zod.object({ | |
| jobId: zod.coerce.string(), | |
| }); | |
| export const GetConversionStatusResponse = zod.object({ | |
| jobId: zod.string(), | |
| fileId: zod.string(), | |
| status: zod.enum([ | |
| "queued", | |
| "analyzing", | |
| "routing", | |
| "ocr", | |
| "layout", | |
| "scoring", | |
| "merging", | |
| "cleanup", | |
| "done", | |
| "failed", | |
| ]), | |
| progress: zod.number().describe("0-100"), | |
| steps: zod.array( | |
| zod.object({ | |
| name: zod.string(), | |
| status: zod.enum(["pending", "running", "done", "failed"]), | |
| label: zod.string(), | |
| }), | |
| ), | |
| queuePosition: zod.number().nullish(), | |
| elapsedSeconds: zod.number().nullish(), | |
| estimatedSeconds: zod.number().nullish(), | |
| errorMessage: zod.string().nullish(), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary List shares for current user (owned + shared with me) | |
| */ | |
| export const ListSharesResponseItem = zod.object({ | |
| id: zod.string(), | |
| fileId: zod.string().nullish(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| sharedWithId: zod.string(), | |
| permission: zod.enum(["read", "edit", "full"]), | |
| fileName: zod.string().nullish(), | |
| folderName: zod.string().nullish(), | |
| ownerEmail: zod.string(), | |
| sharedWithEmail: zod.string(), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| export const ListSharesResponse = zod.array(ListSharesResponseItem); | |
| /** | |
| * @summary Share a file or folder with a user | |
| */ | |
| export const CreateShareBody = zod.object({ | |
| fileId: zod.string().nullish(), | |
| folderId: zod.string().nullish(), | |
| sharedWithId: zod.string(), | |
| permission: zod.enum(["read", "edit", "full"]), | |
| }); | |
| /** | |
| * @summary Update share permission | |
| */ | |
| export const UpdateShareParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const UpdateShareBody = zod.object({ | |
| permission: zod.enum(["read", "edit", "full"]), | |
| }); | |
| export const UpdateShareResponse = zod.object({ | |
| id: zod.string(), | |
| fileId: zod.string().nullish(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| sharedWithId: zod.string(), | |
| permission: zod.enum(["read", "edit", "full"]), | |
| fileName: zod.string().nullish(), | |
| folderName: zod.string().nullish(), | |
| ownerEmail: zod.string(), | |
| sharedWithEmail: zod.string(), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Remove a share | |
| */ | |
| export const DeleteShareParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const DeleteShareResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Search users by email or username for sharing | |
| */ | |
| export const SearchUsersForSharingQueryParams = zod.object({ | |
| q: zod.coerce.string(), | |
| }); | |
| export const SearchUsersForSharingResponseItem = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }); | |
| export const SearchUsersForSharingResponse = zod.array( | |
| SearchUsersForSharingResponseItem, | |
| ); | |
| /** | |
| * @summary List all users | |
| */ | |
| export const AdminListUsersQueryParams = zod.object({ | |
| status: zod.enum(["active", "suspended", "pending"]).optional(), | |
| role: zod.enum(["user", "admin"]).optional(), | |
| search: zod.coerce.string().optional(), | |
| }); | |
| export const AdminListUsersResponseItem = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().nullish(), | |
| role: zod.enum(["user", "admin"]), | |
| status: zod.enum(["pending", "active", "suspended"]), | |
| fileCount: zod.number(), | |
| lastLoginAt: zod.coerce.date().nullish(), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| export const AdminListUsersResponse = zod.array(AdminListUsersResponseItem); | |
| /** | |
| * @summary Admin creates user directly (active status) | |
| */ | |
| export const AdminCreateUserBody = zod.object({ | |
| email: zod.string().email(), | |
| password: zod.string(), | |
| displayName: zod.string().optional(), | |
| role: zod.enum(["user", "admin"]).optional(), | |
| }); | |
| /** | |
| * @summary Update user role or status | |
| */ | |
| export const AdminUpdateUserParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const AdminUpdateUserBody = zod.object({ | |
| role: zod.enum(["user", "admin"]).optional(), | |
| status: zod.enum(["active", "suspended"]).optional(), | |
| }); | |
| export const AdminUpdateUserResponse = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().nullish(), | |
| role: zod.enum(["user", "admin"]), | |
| status: zod.enum(["pending", "active", "suspended"]), | |
| fileCount: zod.number(), | |
| lastLoginAt: zod.coerce.date().nullish(), | |
| createdAt: zod.coerce.date(), | |
| }); | |
| /** | |
| * @summary Permanently delete a user | |
| */ | |
| export const AdminDeleteUserParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const AdminDeleteUserResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary List pending join requests | |
| */ | |
| export const ListJoinRequestsResponseItem = zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().nullish(), | |
| requestedAt: zod.coerce.date(), | |
| }); | |
| export const ListJoinRequestsResponse = zod.array(ListJoinRequestsResponseItem); | |
| /** | |
| * @summary Approve or reject a join request | |
| */ | |
| export const ProcessJoinRequestParams = zod.object({ | |
| id: zod.coerce.string(), | |
| }); | |
| export const ProcessJoinRequestBody = zod.object({ | |
| action: zod.enum(["approve", "reject"]), | |
| reason: zod.string().nullish(), | |
| }); | |
| export const ProcessJoinRequestResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary Get platform statistics | |
| */ | |
| export const GetAdminStatsResponse = zod.object({ | |
| totalUsers: zod.number(), | |
| activeUsers: zod.number(), | |
| pendingRequests: zod.number(), | |
| totalFiles: zod.number(), | |
| filesConvertedToday: zod.number(), | |
| filesConvertedThisWeek: zod.number(), | |
| successRate: zod.number(), | |
| averageQualityScore: zod.number(), | |
| averageProcessingSeconds: zod.number(), | |
| topFileType: zod.string().optional(), | |
| conversionsByType: zod.record(zod.string(), zod.number()).optional(), | |
| }); | |
| /** | |
| * @summary List trashed files and folders for current user | |
| */ | |
| export const ListUserTrashResponse = zod.object({ | |
| files: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| originalName: zod.string(), | |
| originalType: zod.string(), | |
| sizeBytes: zod.number(), | |
| status: zod.enum([ | |
| "uploading", | |
| "queued", | |
| "processing", | |
| "done", | |
| "failed", | |
| "trashed", | |
| ]), | |
| qualityScore: zod.number().nullish(), | |
| wordCount: zod.number().nullish(), | |
| language: zod.string().nullish(), | |
| isShared: zod.boolean(), | |
| sharedWith: zod | |
| .array( | |
| zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }), | |
| ) | |
| .optional(), | |
| permission: zod.enum(["owner", "read", "edit", "full"]).nullish(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }), | |
| ), | |
| folders: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| parentId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| fileCount: zod.number(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }), | |
| ), | |
| }); | |
| /** | |
| * @summary Permanently delete all current user's trashed items | |
| */ | |
| export const EmptyUserTrashResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |
| /** | |
| * @summary List ALL users' trashed files/folders (admin only) | |
| */ | |
| export const AdminListTrashResponse = zod.object({ | |
| files: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| folderId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| originalName: zod.string(), | |
| originalType: zod.string(), | |
| sizeBytes: zod.number(), | |
| status: zod.enum([ | |
| "uploading", | |
| "queued", | |
| "processing", | |
| "done", | |
| "failed", | |
| "trashed", | |
| ]), | |
| qualityScore: zod.number().nullish(), | |
| wordCount: zod.number().nullish(), | |
| language: zod.string().nullish(), | |
| isShared: zod.boolean(), | |
| sharedWith: zod | |
| .array( | |
| zod.object({ | |
| id: zod.string(), | |
| email: zod.string(), | |
| displayName: zod.string().optional(), | |
| }), | |
| ) | |
| .optional(), | |
| permission: zod.enum(["owner", "read", "edit", "full"]).nullish(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }), | |
| ), | |
| folders: zod.array( | |
| zod.object({ | |
| id: zod.string(), | |
| name: zod.string(), | |
| parentId: zod.string().nullish(), | |
| ownerId: zod.string(), | |
| fileCount: zod.number(), | |
| createdAt: zod.coerce.date(), | |
| updatedAt: zod.coerce.date(), | |
| }), | |
| ), | |
| }); | |
| /** | |
| * @summary Permanently delete all trashed items for current admin user | |
| */ | |
| export const AdminEmptyTrashResponse = zod.object({ | |
| message: zod.string(), | |
| }); | |