mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-16 01:10:42 +00:00
Implement corpora endpoint/socket.io namespace
This commit is contained in:
app
__init__.py
blueprints
corpora
namespaces
static
js
templates
@@ -5,50 +5,6 @@ nopaque.requests.corpora = {};
|
||||
|
||||
nopaque.requests.corpora.entity = {};
|
||||
|
||||
nopaque.requests.corpora.entity.delete = (corpusId) => {
|
||||
let input = `/corpora/${corpusId}`;
|
||||
let init = {
|
||||
method: 'DELETE'
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.corpora.entity.build = (corpusId) => {
|
||||
let input = `/corpora/${corpusId}/build`;
|
||||
let init = {
|
||||
method: 'POST',
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.corpora.entity.generateShareLink = (corpusId, role, expiration) => {
|
||||
let input = `/corpora/${corpusId}/generate-share-link`;
|
||||
let init = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({role: role, expiration: expiration})
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.corpora.entity.getStopwords = () => {
|
||||
let input = `/corpora/stopwords`;
|
||||
let init = {
|
||||
method: 'GET'
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.corpora.entity.isPublic = {};
|
||||
|
||||
nopaque.requests.corpora.entity.isPublic.update = (corpusId, isPublic) => {
|
||||
let input = `/corpora/${corpusId}/is_public`;
|
||||
let init = {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(isPublic)
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Requests for /corpora/<entity>/files routes *
|
||||
|
@@ -1,30 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Requests for /jobs routes *
|
||||
*****************************************************************************/
|
||||
nopaque.requests.jobs = {};
|
||||
|
||||
nopaque.requests.jobs.entity = {};
|
||||
|
||||
nopaque.requests.jobs.entity.delete = (jobId) => {
|
||||
let input = `/jobs/${jobId}`;
|
||||
let init = {
|
||||
method: 'DELETE'
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.jobs.entity.log = (jobId) => {
|
||||
let input = `/jobs/${jobId}/log`;
|
||||
let init = {
|
||||
method: 'GET'
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
||||
|
||||
nopaque.requests.jobs.entity.restart = (jobId) => {
|
||||
let input = `/jobs/${jobId}/restart`;
|
||||
let init = {
|
||||
method: 'POST'
|
||||
};
|
||||
return nopaque.requests.JSONfetch(input, init);
|
||||
};
|
Reference in New Issue
Block a user