Available on crate feature
docs
only.Expand description
§Public API Endpoints
§Encoding
POST requests have their arguments application/x-www-form-urlencoded
-encoded, unless otherwise
specified.
GET requests have their arguments url-encoded. Endpoints that take a (particular kind of) URI have those represented via the following encoding:
- Either
uri=<STRING>
( a full URI), or a=<STRING>&rp=<STRING>
(an ArchiveId and a relative path to a source file in the archive including file extension) can be used for DocumentURIs, or- the URI components with relevant argument names; e.g. for a DocumentURI:
?a=<STRING>[&p=<STRING>]&l=<LANGUAGE>&d=<NAME>
.
§Endpoints
Path | GET/POST | Arguments | Description / Return Value |
---|---|---|---|
/api/index | POST | (None) | |
/api/settings | POST | (None) | Settings (requires admin login) |
/api/reload | POST | (None) | (requires admin login) |
/api/login | POST | username=<STRING> , password=<STRING> | log in |
/api/login_state | POST | (None) | LoginState |
/api/search | POST | query=<STRING>&opts= QueryFilter &num_results=<INT> | Vec<(<FLOAT>, SearchResult )> |
/api/search_symbols | POST | query=<STRING>&num_results=<INT> | Vec<( SymbolURI Vec<(<FLOAT>, SearchResult )>)> |
/content/grade | POST | TODO | |
/content/grade_enc | POST | TODO | |
/gitlab_login | POST | ||
Backend | |||
/api/backend/group_entries | POST | (optional) in=<STRING> | (Vec< ArchiveGroupData>,Vec< ArchiveData>) - the archives and archive groups in the provided archive group (if given) or on the top-level (if None) |
/api/backend/archive_entries | POST | archive=<STRING> , (optional) path=<STRING> | (Vec< DirectoryData>,Vec< FileData>) - the source directories and files in the provided archive, or (if given) the relative path within the provided archive |
/api/backend/build_status | POST | archive=<STRING> , (optional) path=<STRING> | FileStates - the build status of the provided archive, or (if given) the relative path within the provided archive (requires admin login) |
/api/backend/query | query=<STRING> | POST | STRING - SPARQL query endpoint; returns SPARQL JSON |
/api/backend/archive_dependencies | POST | archives=Vec<STRING> | Vec< ArchiveId > |
/api/backend/source_file | POST | URI | STRING - Returns the git URL of the source file for the given URL |
Build Queue | |||
/api/buildqueue/enqueue | POST | archive=<STRING> , target=< FormatOrTarget> , (optional) path=STRING , (optional) stale_only=<BOOL> (default:true) | usize - enqueue a new build job. Returns number of jobs queued (requires admin login) |
/api/buildqueue/get_queues | POST | Vec<(NonZeroU32,String)> - return the list of all (waiting or running) build queues as (id,name) pairs (requires admin login) | |
/api/buildqueue/run | POST | id=<NonZeroU32> | runs the build queue with the given id (requires admin login) |
/api/buildqueue/requeue | POST | id=<NonZeroU32> | requeues failed tasks in the queue with the given id (requires admin login) |
/api/buildqueue/log | POST | archive=<STRING> , rel_path=<STRING> , target=<STRING> | returns the log of the stated build job (requires admin login) |
/api/buildqueue/migrate | POST | id=<NonZeroU32> | |
/api/buildqueue/delete | POST | id=<NonZeroU32> | |
Git | |||
/api/gitlab/get_archives | POST | - returns the list of GitLab projects | |
/api/gitlab/get_branches | POST | id=<u64> | Vec< Branch > - returns the list of branches for the given GitLab project |
/api/gitlab/get_new_commits | POST | queue=<u64>&id=ArchiveId | Vec< (String,[ Commit](flams_git::Commit) )> |
Web Sockets | |||
/ws/log | |||
/ws/queue | |||
Content | |||
/img | GET | kpse=<STRING> or file=<STRING> (LSP only) or a=<ArchiveID>&rp=<STRING> | Images |
/content/document | GET | DocumentURI | ( DocumentURI,Vec< CSS>,String) Returns a pair of CSS rules and the full body of the HTML for the given document (with the <body> node replaced by a <div> , but preserving all attributes/classes) |
/content/fragment | GET | URI[&context= URI] | ( URI,Vec< CSS>,String) Returns a pair of CSS rules and the HTML fragment representing the given element; i.e. the inner HTML of a document (for inputrefs), the HTML of a semantic paragraph, etc. |
/content/title | GET | URI | (Vec< CSS>,String) Returns a pair of CSS rules and the HTML title of the given element |
/content/omdoc | GET | URI | [AnySpec ] Returns the structural representation of the OMDoc content at the given URI |
/content/toc | GET | DocumentURI | (Vec< CSS>,Vec< [TOCElem]>) Returns a pair of CSS rules and the table of contents of the given document, including section titles |
/content/los | GET | SymbolURI | (Vec<( DocumentElementURI, LOKind)> Returns a list of all Learning Objects for the given symbol |
/content/notations | GET | SymbolURI | (Vec<( DocumentElementURI, Notation)> Returns a list of all Notations for the given symbol or variable |
/content/solution | GET | DocumentElementURI | Solutions |
/content/quiz | GET | DocumentURI | Quiz |
/content/slides | GET | DocumentURI or DocumentElementURI | (Vec<CSS>,Vec<SlideElement>) |
/content/legacy/uris | GET |