Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download utils/datas/api_collections.ts from enzostvs/hub-api-playground: direct link, hf CLI and curl.
- Browser
- Download file 3.49 kB
-
https://huggingface.co/spaces/enzostvs/hub-api-playground/resolve/ecaee451983f85e8a45f037cfc40eba1e234a5c7/utils/datas/api_collections.ts
- Command line
-
hf download hf://spaces/enzostvs/hub-api-playground@ecaee451983f85e8a45f037cfc40eba1e234a5c7/utils/datas/api_collections.ts
-
curl -L -o api_collections.ts https://huggingface.co/spaces/enzostvs/hub-api-playground/resolve/ecaee451983f85e8a45f037cfc40eba1e234a5c7/utils/datas/api_collections.ts
3.49 kB
| import { ApiCollection } from "@/utils/type"; | |
| export const API_COLLECTIONS: Array<ApiCollection> = [{ | |
| 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)", | |
| defaultValue: "model", | |
| 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)", | |
| defaultValue: "model", | |
| 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', | |
| // }, { | |
| // method: 'GET', | |
| // path: '/api/collections/{namespace}/{slug}-{id}' | |
| // }, { | |
| // method: 'PATCH', | |
| // path: '/api/collections/{namespace}/{slug}-{id}' | |
| // }, { | |
| // method: 'DELETE', | |
| // path: '/api/collections/{namespace}/{slug}-{id}' | |
| // }, { | |
| // method: 'POST', | |
| // path: '/api/collections/{namespace}/{slug}-{id}/item' | |
| // }, { | |
| // method: 'PATCH', | |
| // path: '/api/collections/{namespace}/{slug}-{id}/items/{item_id}' | |
| // }, { | |
| // method: 'DELETE', | |
| // path: '/api/collections/{namespace}/{slug}-{id}/items/{item_id}' | |
| // }], | |
| // } | |
| ] |