{
export const makeActionName = R.curry(
(reducerName: string, actionType: string) =>
- `${packages.name}/${reducerName}/${actionType}`
+ `${packages.name}/${reducerName}/${actionType}`,
);
type ThunkAPI = { dispatch: AppDispatch; getState: () => AppState };
@@ -35,7 +35,7 @@ interface ThunkActionCreatorWithPayload
export function createThunk
(
typePrefix: string,
- payloadCreator: (arg: T, thunkAPI: ThunkAPI) => P
+ payloadCreator: (arg: T, thunkAPI: ThunkAPI) => P,
): ThunkActionCreatorWithPayload
{
const actionCreator = createAction(typePrefix);
@@ -56,7 +56,7 @@ const LINK_ID_SEPARATOR = " / ";
export function makeLinkId(
sourceId: LinkElement["area1"],
- targetId: LinkElement["area2"]
+ targetId: LinkElement["area2"],
): string {
return sourceId + LINK_ID_SEPARATOR + targetId;
}
diff --git a/webapp/src/services/api/auth.ts b/webapp/src/services/api/auth.ts
index 18b09f7d5e..201c1d57c5 100644
--- a/webapp/src/services/api/auth.ts
+++ b/webapp/src/services/api/auth.ts
@@ -33,14 +33,14 @@ export const refresh = async (refreshToken: string): Promise => {
headers: {
Authorization: `Bearer ${refreshToken}`,
},
- }
+ },
);
return res.data;
};
export const login = async (
username: string,
- password: string
+ password: string,
): Promise => {
const res = await rawAxiosInstance.post("/v1/login", { username, password });
return res.data;
diff --git a/webapp/src/services/api/client.ts b/webapp/src/services/api/client.ts
index a3256afda1..5ff02eb13b 100644
--- a/webapp/src/services/api/client.ts
+++ b/webapp/src/services/api/client.ts
@@ -46,7 +46,7 @@ export function initAxiosInterceptors(): void {
if (authUser) {
// eslint-disable-next-line no-param-reassign
config.headers.Authorization = makeHeaderAuthorization(
- authUser.accessToken
+ authUser.accessToken,
);
}
}
diff --git a/webapp/src/services/api/downloads.ts b/webapp/src/services/api/downloads.ts
index 9b60bd3621..2264e29edc 100644
--- a/webapp/src/services/api/downloads.ts
+++ b/webapp/src/services/api/downloads.ts
@@ -29,7 +29,7 @@ export interface FileDownloadTask {
}
export const convertFileDownloadDTO = (
- fileDownload: FileDownloadDTO
+ fileDownload: FileDownloadDTO,
): FileDownload => ({
id: fileDownload.id,
name: fileDownload.name,
diff --git a/webapp/src/services/api/forms/tableMode.ts b/webapp/src/services/api/forms/tableMode.ts
index 5b4f118566..ab146fa1fc 100644
--- a/webapp/src/services/api/forms/tableMode.ts
+++ b/webapp/src/services/api/forms/tableMode.ts
@@ -15,7 +15,7 @@ function makeRequestURL(studyId: StudyMetadata["id"]): string {
export async function getTableData(
studyId: StudyMetadata["id"],
type: T,
- columns: TableTemplateColumnsForType
+ columns: TableTemplateColumnsForType,
): Promise {
const res = await client.get(makeRequestURL(studyId), {
params: {
@@ -29,7 +29,7 @@ export async function getTableData(
export function setTableData(
studyId: StudyMetadata["id"],
type: TableTemplateType,
- data: DeepPartial
+ data: DeepPartial,
): Promise {
return client.put(makeRequestURL(studyId), data, {
params: {
diff --git a/webapp/src/services/api/matrix.ts b/webapp/src/services/api/matrix.ts
index af7edd43b2..7da61528c8 100644
--- a/webapp/src/services/api/matrix.ts
+++ b/webapp/src/services/api/matrix.ts
@@ -13,10 +13,10 @@ import { getConfig } from "../config";
export const getMatrixList = async (
name = "",
- filterOwn = false
+ filterOwn = false,
): Promise> => {
const res = await client.get(
- `/v1/matrixdataset/_search?name=${encodeURI(name)}&filter_own=${filterOwn}`
+ `/v1/matrixdataset/_search?name=${encodeURI(name)}&filter_own=${filterOwn}`,
);
return res.data;
};
@@ -33,7 +33,7 @@ export const getExportMatrixUrl = (matrixId: string): string =>
}/v1/matrix/${matrixId}/download`;
export const exportMatrixDataset = async (
- datasetId: string
+ datasetId: string,
): Promise => {
const res = await client.get(`/v1/matrixdataset/${datasetId}/download`);
return res.data;
@@ -42,13 +42,13 @@ export const exportMatrixDataset = async (
export const createMatrixByImportation = async (
file: File,
json: boolean,
- onProgress?: (progress: number) => void
+ onProgress?: (progress: number) => void,
): Promise> => {
const options: AxiosRequestConfig = {};
if (onProgress) {
options.onUploadProgress = (progressEvent): void => {
const percentCompleted = Math.round(
- (progressEvent.loaded * 100) / (progressEvent.total || 1)
+ (progressEvent.loaded * 100) / (progressEvent.total || 1),
);
onProgress(percentCompleted);
};
@@ -64,14 +64,14 @@ export const createMatrixByImportation = async (
const res = await client.post(
`/v1/matrix/_import?json=${json}`,
formData,
- restconfig
+ restconfig,
);
return res.data;
};
export const createDataSet = async (
metadata: MatrixDataSetUpdateDTO,
- matrices: Array
+ matrices: Array,
): Promise => {
const data = { metadata, matrices };
const res = await client.post("/v1/matrixdataset", data);
@@ -80,7 +80,7 @@ export const createDataSet = async (
export const updateDataSet = async (
id: string,
- metadata: MatrixDataSetUpdateDTO
+ metadata: MatrixDataSetUpdateDTO,
): Promise => {
const res = await client.put(`/v1/matrixdataset/${id}/metadata`, metadata);
return res.data;
@@ -94,18 +94,18 @@ export const deleteDataSet = async (id: string): Promise => {
export const editMatrix = async (
sid: string,
path: string,
- matrixEdit: MatrixEditDTO[]
+ matrixEdit: MatrixEditDTO[],
): Promise => {
const res = await client.put(
`/v1/studies/${sid}/matrix?path=${path}`,
- matrixEdit
+ matrixEdit,
);
return res.data;
};
export const getStudyMatrixIndex = async (
sid: string,
- path?: string
+ path?: string,
): Promise => {
const query = path ? `?path=${encodeURIComponent(path)}` : "";
const res = await client.get(`/v1/studies/${sid}/matrixindex${query}`);
diff --git a/webapp/src/services/api/study.ts b/webapp/src/services/api/study.ts
index 1795f64121..302383dac2 100644
--- a/webapp/src/services/api/study.ts
+++ b/webapp/src/services/api/study.ts
@@ -45,10 +45,10 @@ export const getStudyVersions = async (): Promise> => {
export const getStudyData = async (
sid: string,
path = "",
- depth = 1
+ depth = 1,
): Promise => {
const res = await client.get(
- `/v1/studies/${sid}/raw?path=${encodeURIComponent(path)}&depth=${depth}`
+ `/v1/studies/${sid}/raw?path=${encodeURIComponent(path)}&depth=${depth}`,
);
return res.data;
};
@@ -69,14 +69,14 @@ export const getStudyMetadata = async (sid: string): Promise => {
};
export const getStudyOutputs = async (
- sid: string
+ sid: string,
): Promise> => {
const res = await client.get(`/v1/studies/${sid}/outputs`);
return res.data;
};
export const getStudySynthesis = async (
- sid: string
+ sid: string,
): Promise => {
const res = await client.get(`/v1/studies/${sid}/synthesis`);
return res.data;
@@ -87,7 +87,7 @@ export const downloadOutput = async (
output: string,
data: StudyOutputDownloadDTO,
jsonFormat = false,
- useTask = true
+ useTask = true,
): Promise => {
const restconfig = {
headers: {
@@ -98,7 +98,7 @@ export const downloadOutput = async (
const res = await client.post(
`/v1/studies/${sid}/outputs/${output}/download?use_task=${useTask}`,
data,
- jsonFormat ? {} : restconfig
+ jsonFormat ? {} : restconfig,
);
return res.data;
};
@@ -106,12 +106,14 @@ export const downloadOutput = async (
export const createStudy = async (
name: string,
version: number,
- groups?: Array
+ groups?: Array,
): Promise => {
const groupIds =
groups && groups.length > 0 ? `&groups=${groups.join(",")}` : "";
const res = await client.post(
- `/v1/studies?name=${encodeURIComponent(name)}&version=${version}${groupIds}`
+ `/v1/studies?name=${encodeURIComponent(
+ name,
+ )}&version=${version}${groupIds}`,
);
return res.data;
};
@@ -120,7 +122,7 @@ export const editStudy = async (
data: object | string | boolean | number,
sid: string,
path = "",
- depth = 1
+ depth = 1,
): Promise => {
let formattedData: unknown = data;
if (isBoolean(data)) {
@@ -133,7 +135,7 @@ export const editStudy = async (
headers: {
"content-type": "application/json",
},
- }
+ },
);
return res.data;
};
@@ -141,12 +143,12 @@ export const editStudy = async (
export const copyStudy = async (
sid: string,
name: string,
- withOutputs: boolean
+ withOutputs: boolean,
): Promise => {
const res = await client.post(
`/v1/studies/${sid}/copy?dest=${encodeURIComponent(
- name
- )}&with_outputs=${withOutputs}`
+ name,
+ )}&with_outputs=${withOutputs}`,
);
return res.data;
};
@@ -154,7 +156,7 @@ export const copyStudy = async (
export const moveStudy = async (sid: string, folder: string): Promise => {
const folderWithId = trimCharsStart("/", `${folder.trim()}/${sid}`);
await client.put(
- `/v1/studies/${sid}/move?folder_dest=${encodeURIComponent(folderWithId)}`
+ `/v1/studies/${sid}/move?folder_dest=${encodeURIComponent(folderWithId)}`,
);
};
@@ -168,28 +170,28 @@ export const unarchiveStudy = async (sid: string): Promise => {
export const upgradeStudy = async (
studyId: string,
- targetVersion: string
+ targetVersion: string,
): Promise => {
await client.put(
`/v1/studies/${studyId}/upgrade?target_version=${encodeURIComponent(
- targetVersion
- )}`
+ targetVersion,
+ )}`,
);
};
export const deleteStudy = async (
sid: string,
- deleteAllChildren?: boolean
+ deleteAllChildren?: boolean,
): Promise => {
const res = await client.delete(
- `/v1/studies/${sid}?children=${deleteAllChildren || false}`
+ `/v1/studies/${sid}?children=${deleteAllChildren || false}`,
);
return res.data;
};
export const editComments = async (
sid: string,
- newComments: string
+ newComments: string,
): Promise => {
const data = { comments: newComments };
const res = await client.put(`/v1/studies/${sid}/comments`, data);
@@ -198,10 +200,10 @@ export const editComments = async (
export const exportStudy = async (
sid: string,
- skipOutputs: boolean
+ skipOutputs: boolean,
): Promise => {
const res = await client.get(
- `/v1/studies/${sid}/export?no_output=${skipOutputs}`
+ `/v1/studies/${sid}/export?no_output=${skipOutputs}`,
);
return res.data;
};
@@ -214,7 +216,7 @@ export const getExportUrl = (sid: string, skipOutputs = false): string =>
export const exportOuput = async (
sid: string,
- output: string
+ output: string,
): Promise => {
const res = await client.get(`/v1/studies/${sid}/outputs/${output}/export`);
return res.data;
@@ -222,13 +224,13 @@ export const exportOuput = async (
export const importStudy = async (
file: File,
- onProgress?: (progress: number) => void
+ onProgress?: (progress: number) => void,
): Promise => {
const options: AxiosRequestConfig = {};
if (onProgress) {
options.onUploadProgress = (progressEvent): void => {
const percentCompleted = Math.round(
- (progressEvent.loaded * 100) / (progressEvent.total || 1)
+ (progressEvent.loaded * 100) / (progressEvent.total || 1),
);
onProgress(percentCompleted);
};
@@ -249,13 +251,13 @@ export const importFile = async (
file: File,
study: string,
path: string,
- onProgress?: (progress: number) => void
+ onProgress?: (progress: number) => void,
): Promise => {
const options: AxiosRequestConfig = {};
if (onProgress) {
options.onUploadProgress = (progressEvent): void => {
const percentCompleted = Math.round(
- (progressEvent.loaded * 100) / (progressEvent.total || 1)
+ (progressEvent.loaded * 100) / (progressEvent.total || 1),
);
onProgress(percentCompleted);
};
@@ -271,7 +273,7 @@ export const importFile = async (
const res = await client.put(
`/v1/studies/${study}/raw?path=${encodeURIComponent(path)}`,
formData,
- restconfig
+ restconfig,
);
return res.data;
};
@@ -279,12 +281,12 @@ export const importFile = async (
export const launchStudy = async (
sid: string,
options: LaunchOptions = {},
- version: string | undefined = undefined
+ version: string | undefined = undefined,
): Promise => {
const versionArg = version ? `?version=${version}` : "";
const res = await client.post(
`/v1/launcher/run/${sid}${versionArg}`,
- options
+ options,
);
return res.data;
};
@@ -299,6 +301,11 @@ export const getLauncherVersions = async (): Promise> => {
return res.data;
};
+export const getLauncherCores = async (): Promise> => {
+ const res = await client.get("/v1/launcher/nbcores");
+ return res.data;
+};
+
export const getLauncherLoad = async (): Promise => {
const res = await client.get("/v1/launcher/load");
return res.data;
@@ -322,27 +329,27 @@ export const mapLaunchJobDTO = (j: LaunchJobDTO): LaunchJob => ({
});
export const getStudyJobs = async (
- sid?: string,
+ studyId?: string,
filterOrphans = true,
- latest = false
+ latest = false,
): Promise => {
- let query = sid
- ? `?study=${sid}&filter_orphans=${filterOrphans}`
- : `?filter_orphans=${filterOrphans}`;
- if (latest) {
- query += "&latest=100";
- }
- const res = await client.get(`/v1/launcher/jobs${query}`);
- const data = await res.data;
- return data.map(mapLaunchJobDTO);
+ const queryParams = new URLSearchParams({
+ filter_orphans: filterOrphans.toString(),
+ ...(studyId && { study: studyId }),
+ ...(latest && { latest: "100" }),
+ });
+
+ return client
+ .get(`/v1/launcher/jobs?${queryParams}`)
+ .then(({ data }) => data.map(mapLaunchJobDTO));
};
export const getStudyJobLog = async (
jid: string,
- logType = "STDOUT"
+ logType = "STDOUT",
): Promise => {
const res = await client.get(
- `/v1/launcher/jobs/${jid}/logs?log_type=${logType}`
+ `/v1/launcher/jobs/${jid}/logs?log_type=${logType}`,
);
return res.data;
};
@@ -355,36 +362,36 @@ export const downloadJobOutput = async (jobId: string): Promise => {
export const unarchiveOutput = async (
studyId: string,
- outputId: string
+ outputId: string,
): Promise => {
const res = await client.post(
- `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}/_unarchive`
+ `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}/_unarchive`,
);
return res.data;
};
export const archiveOutput = async (
studyId: string,
- outputId: string
+ outputId: string,
): Promise => {
const res = await client.post(
- `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}/_archive`
+ `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}/_archive`,
);
return res.data;
};
export const deleteOutput = async (
studyId: string,
- outputId: string
+ outputId: string,
): Promise => {
await client.delete(
- `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}`
+ `/v1/studies/${studyId}/outputs/${encodeURIComponent(outputId)}`,
);
};
export const changeStudyOwner = async (
studyId: string,
- newOwner: number
+ newOwner: number,
): Promise => {
const res = await client.put(`/v1/studies/${studyId}/owner/${newOwner}`);
return res.data;
@@ -392,7 +399,7 @@ export const changeStudyOwner = async (
export const deleteStudyGroup = async (
studyId: string,
- groupId: string
+ groupId: string,
): Promise => {
const res = await client.delete(`/v1/studies/${studyId}/groups/${groupId}`);
return res.data;
@@ -400,7 +407,7 @@ export const deleteStudyGroup = async (
export const addStudyGroup = async (
studyId: string,
- groupId: string
+ groupId: string,
): Promise => {
const res = await client.put(`/v1/studies/${studyId}/groups/${groupId}`);
return res.data;
@@ -408,17 +415,17 @@ export const addStudyGroup = async (
export const changePublicMode = async (
studyId: string,
- publicMode: StudyPublicMode
+ publicMode: StudyPublicMode,
): Promise => {
const res = await client.put(
- `/v1/studies/${studyId}/public_mode/${publicMode}`
+ `/v1/studies/${studyId}/public_mode/${publicMode}`,
);
return res.data;
};
export const renameStudy = async (
studyId: string,
- name: string
+ name: string,
): Promise => {
const res = await client.put(`/v1/studies/${studyId}`, {
name,
@@ -428,7 +435,7 @@ export const renameStudy = async (
export const updateStudyMetadata = async (
studyId: string,
- data: StudyMetadataPatchDTO
+ data: StudyMetadataPatchDTO,
): Promise => {
const res = await client.put(`/v1/studies/${studyId}`, data);
return res.data;
@@ -445,10 +452,10 @@ export const getStudyLayers = async (uuid: string): Promise => {
export async function createStudyLayer(
studyId: StudyMetadata["id"],
- layerName: StudyLayer["name"]
+ layerName: StudyLayer["name"],
): Promise {
const res = await client.post(
- `v1/studies/${studyId}/layers?name=${encodeURIComponent(layerName)}`
+ `v1/studies/${studyId}/layers?name=${encodeURIComponent(layerName)}`,
);
return res.data;
}
@@ -457,25 +464,25 @@ export async function updateStudyLayer(
studyId: StudyMetadata["id"],
layerId: StudyLayer["id"],
layerName: StudyLayer["name"],
- areas?: StudyLayer["areas"]
+ areas?: StudyLayer["areas"],
): Promise {
await client.put(
`v1/studies/${studyId}/layers/${layerId}?name=${encodeURIComponent(
- layerName
+ layerName,
)}`,
- areas
+ areas,
);
}
export async function deleteStudyLayer(
studyId: StudyMetadata["id"],
- layerId: StudyLayer["id"]
+ layerId: StudyLayer["id"],
): Promise {
await client.delete(`v1/studies/${studyId}/layers/${layerId}`);
}
export async function getStudyDistricts(
- studyId: StudyMetadata["id"]
+ studyId: StudyMetadata["id"],
): Promise {
return (await client.get(`v1/studies/${studyId}/districts`)).data;
}
@@ -484,7 +491,7 @@ export async function createStudyDistrict(
studyId: StudyMetadata["id"],
districtName: StudyMapDistrict["name"],
output: StudyMapDistrict["output"],
- comments: StudyMapDistrict["comments"]
+ comments: StudyMapDistrict["comments"],
): Promise {
return (
await client.post(`v1/studies/${studyId}/districts`, {
@@ -501,7 +508,7 @@ export async function updateStudyDistrict(
districtId: StudyMapDistrict["id"],
output: StudyMapDistrict["output"],
comments: StudyMapDistrict["comments"],
- areas?: StudyMapDistrict["areas"]
+ areas?: StudyMapDistrict["areas"],
): Promise {
await client.put(`v1/studies/${studyId}/districts/${districtId}`, {
output,
@@ -512,7 +519,7 @@ export async function updateStudyDistrict(
export async function deleteStudyDistrict(
studyId: StudyMetadata["id"],
- districtId: StudyMapDistrict["id"]
+ districtId: StudyMapDistrict["id"],
): Promise {
await client.delete(`v1/studies/${studyId}/districts/${districtId}`);
}
diff --git a/webapp/src/services/api/studydata.ts b/webapp/src/services/api/studydata.ts
index 1883df761c..424f0e972f 100644
--- a/webapp/src/services/api/studydata.ts
+++ b/webapp/src/services/api/studydata.ts
@@ -15,7 +15,7 @@ import client from "./client";
export const createArea = async (
uuid: string,
- name: string
+ name: string,
): Promise => {
const res = await client.post(`/v1/studies/${uuid}/areas?uuid=${uuid}`, {
name,
@@ -26,11 +26,11 @@ export const createArea = async (
export const createLink = async (
uuid: string,
- linkCreationInfo: LinkCreationInfoDTO
+ linkCreationInfo: LinkCreationInfoDTO,
): Promise => {
const res = await client.post(
`/v1/studies/${uuid}/links?uuid=${uuid}`,
- linkCreationInfo
+ linkCreationInfo,
);
return res.data;
};
@@ -39,21 +39,21 @@ export const updateAreaUI = async (
uuid: string,
areaId: string,
layerId: string,
- areaUi: UpdateAreaUi
+ areaUi: UpdateAreaUi,
): Promise => {
const res = await client.put(
`/v1/studies/${uuid}/areas/${areaId}/ui?uuid=${uuid}&area_id=${areaId}&layer=${layerId}`,
- areaUi
+ areaUi,
);
return res.data;
};
export const deleteArea = async (
uuid: string,
- areaId: string
+ areaId: string,
): Promise => {
const res = await client.delete(
- `/v1/studies/${uuid}/areas/${areaId}?uuid=${uuid}&area_id=${areaId}`
+ `/v1/studies/${uuid}/areas/${areaId}?uuid=${uuid}&area_id=${areaId}`,
);
return res.data;
};
@@ -61,10 +61,10 @@ export const deleteArea = async (
export const deleteLink = async (
uuid: string,
areaIdFrom: string,
- areaIdTo: string
+ areaIdTo: string,
): Promise => {
const res = await client.delete(
- `/v1/studies/${uuid}/links/${areaIdFrom}/${areaIdTo}?uuid=${uuid}&area_from=${areaIdFrom}&area_to=${areaIdTo}`
+ `/v1/studies/${uuid}/links/${areaIdFrom}/${areaIdTo}?uuid=${uuid}&area_from=${areaIdFrom}&area_to=${areaIdTo}`,
);
return res.data;
};
@@ -72,13 +72,13 @@ export const deleteLink = async (
export const updateConstraintTerm = async (
uuid: string,
bindingConst: string,
- constraint: Partial
+ constraint: Partial,
): Promise => {
const res = await client.put(
`/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(
- bindingConst
+ bindingConst,
)}/term`,
- constraint
+ constraint,
);
return res.data;
};
@@ -86,13 +86,13 @@ export const updateConstraintTerm = async (
export const addConstraintTerm = async (
uuid: string,
bindingConst: string,
- constraint: ConstraintType
+ constraint: ConstraintType,
): Promise => {
const res = await client.post(
`/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(
- bindingConst
+ bindingConst,
)}/term`,
- constraint
+ constraint,
);
return res.data;
};
@@ -100,28 +100,30 @@ export const addConstraintTerm = async (
export const deleteConstraintTerm = async (
uuid: string,
bindingConst: string,
- termId: ConstraintType["id"]
+ termId: ConstraintType["id"],
): Promise => {
const res = await client.delete(
`/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(
- bindingConst
- )}/term/${encodeURIComponent(termId)}`
+ bindingConst,
+ )}/term/${encodeURIComponent(termId)}`,
);
return res.data;
};
export const getBindingConstraint = async (
uuid: string,
- bindingConst: string
+ bindingConst: string,
): Promise => {
const res = await client.get(
- `/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(bindingConst)}`
+ `/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(
+ bindingConst,
+ )}`,
);
return res.data;
};
export const getBindingConstraintList = async (
- uuid: string
+ uuid: string,
): Promise> => {
const res = await client.get(`/v1/studies/${uuid}/bindingconstraints`);
return res.data;
@@ -130,19 +132,19 @@ export const getBindingConstraintList = async (
export const updateBindingConstraint = async (
uuid: string,
bindingConst: string,
- data: UpdateBindingConstraint
+ data: UpdateBindingConstraint,
): Promise => {
const res = await client.put(
`/v1/studies/${uuid}/bindingconstraints/${encodeURIComponent(
- bindingConst
+ bindingConst,
)}`,
- data
+ data,
);
return res.data;
};
export const getClustersAndLinks = async (
- uuid: string
+ uuid: string,
): Promise => {
const res = await client.get(`/v1/studies/${uuid}/linksandclusters`);
return res.data;
@@ -158,11 +160,11 @@ type LinkTypeFromParams = T["withUi"] extends true
: LinkCreationInfoDTO;
export const getAllLinks = async (
- params: T
+ params: T,
): Promise>> => {
const { uuid, withUi } = params;
const res = await client.get(
- `/v1/studies/${uuid}/links${withUi ? `?with_ui=${withUi}` : ""}`
+ `/v1/studies/${uuid}/links${withUi ? `?with_ui=${withUi}` : ""}`,
);
return res.data;
};
diff --git a/webapp/src/services/api/tasks.ts b/webapp/src/services/api/tasks.ts
index 65d22ee703..d073a8d8ac 100644
--- a/webapp/src/services/api/tasks.ts
+++ b/webapp/src/services/api/tasks.ts
@@ -2,7 +2,7 @@ import { TaskDTO, TaskStatus } from "../../common/types";
import client from "./client";
export const getStudyRunningTasks = async (
- sid: string
+ sid: string,
): Promise> => {
const res = await client.post("/v1/tasks", {
ref_id: sid,
@@ -33,7 +33,7 @@ export const getAllMiscRunningTasks = async (): Promise> => {
export const getTask = async (
id: string,
- withLogs = false
+ withLogs = false,
): Promise => {
const res = await client.get(`/v1/tasks/${id}?with_logs=${withLogs}`);
return res.data;
diff --git a/webapp/src/services/api/user.ts b/webapp/src/services/api/user.ts
index e29e528284..6b14945498 100644
--- a/webapp/src/services/api/user.ts
+++ b/webapp/src/services/api/user.ts
@@ -26,7 +26,7 @@ type UserTypeFromParams = T["details"] extends true
: UserDTO;
export const getUsers = async (
- params?: T
+ params?: T,
): Promise>> => {
const res = await client.get("/v1/users", { params });
return res.data;
@@ -34,7 +34,7 @@ export const getUsers = async (
export const getUser = async (
id: number,
- params?: T
+ params?: T,
): Promise> => {
const res = await client.get(`/v1/users/${id}`, { params });
return res.data;
@@ -42,7 +42,7 @@ export const getUser = async (
export const createUser = async (
name: string,
- password: string
+ password: string,
): Promise => {
const data = { name, password };
const res = await client.post("/v1/users", data);
@@ -67,7 +67,7 @@ type GroupTypeFromParams = T["details"] extends true
: GroupDTO;
export const getGroups = async (
- params?: T
+ params?: T,
): Promise>> => {
const res = await client.get("/v1/groups", { params });
return res.data;
@@ -75,7 +75,7 @@ export const getGroups = async (
export const getGroup = async (
id: string,
- params?: T
+ params?: T,
): Promise>> => {
const res = await client.get(`/v1/groups/${encodeURIComponent(id)}`, {
params,
@@ -91,7 +91,7 @@ export const createGroup = async (name: string): Promise => {
export const updateGroup = async (
id: string,
- name: string
+ name: string,
): Promise => {
const data = { id, name };
const res = await client.post("/v1/groups", data);
@@ -108,7 +108,7 @@ export const deleteGroup = async (id: string): Promise => {
////////////////////////////////////////////////////////////////
export const createRole = async (
- role: RoleCreationDTO
+ role: RoleCreationDTO,
): Promise => {
const data = role;
const res = await client.post("/v1/roles", data);
@@ -117,24 +117,24 @@ export const createRole = async (
export const deleteUserRole = async <
T extends UserDTO["id"],
- U extends GroupDTO["id"]
+ U extends GroupDTO["id"],
>(
userId: T,
- groupId: U
+ groupId: U,
): Promise<[T, U]> => {
const res = await client.delete(`/v1/roles/${groupId}/${userId}`);
return res.data;
};
export const deleteUserRoles = async (
- userId: T
+ userId: T,
): Promise => {
const res = await client.delete(`/v1/users/roles/${userId}`);
return res.data;
};
export const getRolesForGroup = async (
- groupId: string
+ groupId: string,
): Promise => {
const res = await client.get(`/v1/roles/group/${groupId}`);
return res.data;
@@ -159,7 +159,7 @@ type TokenTypeFromParams = T["verbose"] extends 1
// TODO: update return type structure for 'verbose=1' in the API like BotDetailsDTO
export const getBot = async (
id: number,
- params?: T
+ params?: T,
): Promise> => {
const res = await client.get(`/v1/bots/${id}`, { params });
const bot = res.data;
@@ -179,7 +179,7 @@ export const getBot = async (
// TODO: add 'verbose' param in the API
export const getBots = async (
- params?: T
+ params?: T,
): Promise>> => {
const { verbose, ...validParams } = params || {};
const res = await client.get("/v1/bots", { params: validParams });
@@ -189,7 +189,7 @@ export const getBots = async (
return Promise.all(
bots.map(async (bot: BotDTO) => {
return getBot(bot.id, { verbose });
- })
+ }),
);
}
@@ -213,6 +213,6 @@ export const getAdminTokenList = async (): Promise> => {
users.map(async (user) => ({
user,
bots: await getBots({ owner: user.id }),
- }))
+ })),
);
};
diff --git a/webapp/src/services/api/variant.ts b/webapp/src/services/api/variant.ts
index 822758ed3e..95c2fdb0dd 100644
--- a/webapp/src/services/api/variant.ts
+++ b/webapp/src/services/api/variant.ts
@@ -16,16 +16,16 @@ export const getVariantChildren = async (id: string): Promise => {
};
export const getVariantParents = async (
- id: string
+ id: string,
): Promise => {
const res = await client.get(`/v1/studies/${id}/parents`);
return res.data.map((elm: StudyMetadataDTO) =>
- convertStudyDtoToMetadata(elm.id, elm)
+ convertStudyDtoToMetadata(elm.id, elm),
);
};
export const getDirectParent = async (
- id: string
+ id: string,
): Promise => {
const res = await client.get(`/v1/studies/${id}/parents?direct=true`);
if (res.data) {
@@ -36,17 +36,17 @@ export const getDirectParent = async (
export const createVariant = async (
id: string,
- name: string
+ name: string,
): Promise => {
const res = await client.post(
- `/v1/studies/${id}/variants?name=${encodeURIComponent(name)}`
+ `/v1/studies/${id}/variants?name=${encodeURIComponent(name)}`,
);
return res.data;
};
export const appendCommands = async (
studyId: string,
- commands: Array
+ commands: Array,
): Promise => {
const res = await client.post(`/v1/studies/${studyId}/commands`, commands);
return res.data;
@@ -54,7 +54,7 @@ export const appendCommands = async (
export const appendCommand = async (
studyId: string,
- command: CommandDTO
+ command: CommandDTO,
): Promise => {
const res = await client.post(`/v1/studies/${studyId}/command`, command);
return res.data;
@@ -63,12 +63,12 @@ export const appendCommand = async (
export const moveCommand = async (
studyId: string,
commandId: string,
- index: number
+ index: number,
): Promise => {
const res = await client.put(
`/v1/studies/${studyId}/commands/${commandId}/move?index=${encodeURIComponent(
- index
- )}`
+ index,
+ )}`,
);
return res.data;
};
@@ -76,18 +76,18 @@ export const moveCommand = async (
export const updateCommand = async (
studyId: string,
commandId: string,
- command: CommandDTO
+ command: CommandDTO,
): Promise