Module endpoints

Module endpoints 

Source
Available on crate features 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 [DocumentUri]s, or
  • the [URI] components with relevant argument names; e.g. for a [DocumentUri]: ?a=<STRING>[&p=<STRING>]&l=<LANGUAGE>&d=<NAME>.

§Endpoints

PathGET/POSTArgumentsDescription / Return Value
/api/indexPOST(None)
/api/settingsPOST(None)Settings (requires admin login)
/api/reloadPOST(None)(requires admin login)
/api/loginPOSTusername=<STRING>, password=<STRING>log in
/api/login_statePOST(None)[LoginState]
/api/searchPOSTquery=<STRING>&opts=QueryFilter&num_results=<INT>Vec<(<FLOAT>,SearchResult)>
/api/search_symbolsPOSTquery=<STRING>&num_results=<INT>Vec<([SymbolUri]Vec<(<FLOAT>,SearchResult)>)>
/content/gradePOSTTODO
/content/grade_encPOSTTODO
/gitlab_loginPOST
Backend
/api/backend/group_entriesPOST(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_entriesPOSTarchive=<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_statusPOSTarchive=<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/queryquery=<STRING>POSTSTRING - SPARQL query endpoint; returns SPARQL JSON
/api/backend/archive_dependenciesPOSTarchives=Vec<STRING>Vec<[ArchiveId]>
/api/backend/source_filePOST[URI]STRING - Returns the git URL of the source file for the given URL
Build Queue
/api/buildqueue/enqueuePOSTarchive=<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_queuesPOSTVec<(NonZeroU32,String)> - return the list of all (waiting or running) build queues as (id,name) pairs (requires admin login)
/api/buildqueue/runPOSTid=<NonZeroU32>runs the build queue with the given id (requires admin login)
/api/buildqueue/requeuePOSTid=<NonZeroU32>requeues failed tasks in the queue with the given id (requires admin login)
/api/buildqueue/logPOSTarchive=<STRING>, rel_path=<STRING>, target=<STRING>returns the log of the stated build job (requires admin login)
/api/buildqueue/migratePOSTid=<NonZeroU32>
/api/buildqueue/deletePOSTid=<NonZeroU32>
Git
/api/gitlab/get_archivesPOST- returns the list of GitLab projects
/api/gitlab/get_branchesPOSTid=<u64>Vec<Branch> - returns the list of branches for the given GitLab project
/api/gitlab/get_new_commitsPOSTqueue=<u64>&id=ArchiveIdVec<(String,[Commit](flams_git::Commit))>
Web Sockets
/ws/log
/ws/queue
Content
/imgGETkpse=<STRING> or file=<STRING> (LSP only) or a=<ArchiveID>&rp=<STRING>Images
/content/documentGET[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/fragmentGET[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/titleGET[URI](Vec<[CSS]>,String) Returns a pair of CSS rules and the HTML title of the given element
/content/omdocGET[URI][AnySpec] Returns the structural representation of the OMDoc content at the given URI
/content/tocGET[DocumentUri](Vec<[CSS]>,Vec<[TOCElem]>) Returns a pair of CSS rules and the table of contents of the given document, including section titles
/content/losGET[SymbolUri](Vec<([DocumentElementUri],[LOKind])> Returns a list of all Learning Objects for the given symbol
/content/notationsGET[SymbolUri](Vec<([DocumentElementUri],[Notation])> Returns a list of all Notations for the given symbol or variable
/content/solutionGET[DocumentElementUri]Solutions
/content/quizGET[DocumentUri]Quiz
/content/slidesGET[DocumentUri] or [DocumentElementUri](Vec<CSS>,Vec<SlideElement>)
/content/legacy/urisGET