import { ApiCollection } from "@/utils/type"; export const API_COLLECTIONS: Array = [{ key: 'search', endpoints: [ { method: 'GET', path: '/api/models', parameters: { search: "", author: "", filter: "", sort: "", direction: "", limit: 5, full: true, config: true } }, { method: 'GET', path: '/api/models/{repo_id}' }, { method: 'GET', path: '/api/models-tags-by-type' }, { method: 'GET', path: '/api/datasets', parameters: { search: "", author: "", filter: "", sort: "", direction: "", limit: 5, full: true, } }, { method: 'GET', path: '/api/datasets/{repo_id}', parameters: { full: true, } }, { method: 'GET', path: '/api/datasets/{repo_id}/parquet' }, { method: 'GET', path: '/api/datasets/{repo_id}/parquet/{config}/{split}/{n}.parquet' }, { method: 'GET', path: '/api/datasets-tags-by-type' }, { method: 'GET', path: '/api/spaces', parameters: { search: "", author: "", filter: "", sort: "", direction: "", limit: 5, full: true, config: true } }, { method: 'GET', path: '/api/spaces/{repo_id}' }, { method: 'GET', path: '/api/metrics' }], }, { key: 'repo', endpoints: [{ method: 'POST', path: '/api/repos/create', body: [ { label: "Type of repo (dataset or space; model by default)", key: "type", required: true, }, { label: "Name of repo", key: "name", required: true, }, { label: "Name of organization (optional)", required: true, key: "organization", }, { label: "SDK (if type is space)", key: "sdk", }, { label: "Whether the repo is private", required: true, key: "private", defaultValue: false, }, ] }, { method: 'DELETE', path: '/api/repos/delete', body: [{ label: "Type of repo (dataset or space; model by default)", key: "type", required: true, }, { label: "Name of repo", key: "name", required: true, }, { label: "Name of organization (optional)", required: true, key: "organization", }] }, { method: 'POST', path: '/api/repos/move', body: [{ label: "From which repo", key: "fromRepo", required: true, }, { label: "To which repo", key: "toRepo", required: true, }] }], }, { key: 'user', endpoints: [{ method: 'GET', path: '/api/whoami-v2', }], }, { key: 'collection', endpoints: [{ method: 'POST', path: '/api/collections', body: [{ label: "Title of collection", key: "title", required: true, }, { label: "Namespace", key: "namespace", required: true, }, { label: "Description of collection", key: "description", required: true, }, { label: "Type", key: "item.type", required: true, }, { label: "RepoId/PaperId", key: "item.id", required: true, }, { label: "Whether the repo is private", required: true, key: "private", defaultValue: false, }] }, { method: 'GET', path: '/api/collections/{namespace}/{slug-id}', }, { method: 'PATCH', path: '/api/collections/{namespace}/{slug-id}', body: [{ label: "Title of collection", key: "title", required: true, }, { label: "Namespace", key: "namespace", required: true, }, { label: "Position", required: true, key: "position", defaultValue: 0, }, { label: "Theme", required: true, key: "theme", }, { label: "Whether the repo is private", required: true, key: "private", defaultValue: false, }] }, { method: 'DELETE', path: '/api/collections/{namespace}/{slug-id}', }, { method: 'POST', path: '/api/collections/{namespace}/{slug-id}/item', body: [{ label: "Type", key: "item.type", required: true, }, { label: "RepoId/PaperId", key: "item.id", required: true, }, { label: "Note", key: "note", required: true, }] }, { method: 'PATCH', path: '/api/collections/{namespace}/{slug-id}/item/{itemId}', body: [{ label: "Position", key: "position", defaultValue: 0, required: true, }, { label: "Note", key: "note", required: true, }] }, { method: 'DELETE', path: '/api/collections/{namespace}/{slug-id}/item/{itemId}', }] } ]