📝 docs(API): add documentation for postBuildInit function

✨ feat(API): add postBuildInit function to post the build init of a flow
The postBuildInit function has been added to post the build init of a flow. The function takes in a flow object and returns a promise that resolves to an AxiosResponse containing the build status. Documentation has been added to the function to improve code readability and maintainability.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-15 07:43:53 -03:00
commit ef5623e1b3

View file

@ -277,12 +277,27 @@ export async function getVersion() {
*/
export async function getHealth() {
return await axios.get("/health"); // Health is the only endpoint that doesn't require /api/v1
}
/**
* Fetches the build status of a flow.
* @param {string} flowId - The ID of the flow to fetch the build status for.
* @returns {Promise<BuildStatusTypeAPI>} A promise that resolves to an AxiosResponse containing the build status.
*
*/
export async function getBuildStatus(
flowId: string
): Promise<BuildStatusTypeAPI> {
return await axios.get(`/api/v1/build/${flowId}/status`);
}
//docs for postbuildinit
/**
* Posts the build init of a flow.
* @param {string} flowId - The ID of the flow to fetch the build status for.
* @returns {Promise<InitTypeAPI>} A promise that resolves to an AxiosResponse containing the build status.
*
*/
export async function postBuildInit(
flow: FlowType
): Promise<AxiosResponse<InitTypeAPI>> {