-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import axios from 'axios'; | ||
import type { Automation, AutomationOutput, AutomationSettings } from 'ontime-types'; | ||
|
||
import { apiEntryUrl } from './constants'; | ||
|
||
const automationsPath = `${apiEntryUrl}/automations`; | ||
|
||
/** | ||
* HTTP request to retrieve automations | ||
*/ | ||
export async function getAutomations(): Promise<AutomationSettings> { | ||
const res = await axios.get(automationsPath); | ||
return res.data; | ||
} | ||
|
||
/** | ||
* HTTP request to test automation output | ||
* The return is irrelevant as we care for the resolution of the promise | ||
*/ | ||
export async function testOutput(output: AutomationOutput): Promise<any> { | ||
return axios.post(automationsPath, output); | ||
} | ||
|
||
/** | ||
* HTTP request to create a new automation | ||
*/ | ||
export async function postAutomation(automation: Automation) { | ||
return axios.post(`${automationsPath}/automation`, automation); | ||
} | ||
|
||
/** | ||
* HTTP request to update an automation | ||
*/ | ||
export async function putAutomation() {} | ||
|
||
/** | ||
* HTTP request to delete an automation | ||
*/ | ||
export async function deleteAutomation() {} | ||
|
||
/** | ||
* HTTP request to create a new blueprint | ||
*/ | ||
export async function postBlueprint() {} | ||
|
||
/** | ||
* HTTP request to update a blueprint | ||
*/ | ||
export async function putBlueprint() {} | ||
|
||
/** | ||
* HTTP request to delete a blueprint | ||
*/ | ||
export async function deleteBlueprint() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters