Skip to content

Commit

Permalink
chore: rename feature elements
Browse files Browse the repository at this point in the history
rename automations > triggers
rename blueprints > automations

chore: add link to documentation
  • Loading branch information
cpvalente committed Jan 20, 2025
1 parent 56cb7de commit f9b9e64
Show file tree
Hide file tree
Showing 30 changed files with 1,066 additions and 1,096 deletions.
40 changes: 20 additions & 20 deletions apps/client/src/common/api/automation.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios from 'axios';
import type {
Automation,
AutomationBlueprint,
AutomationBlueprintDTO,
AutomationDTO,
AutomationOutput,
AutomationSettings,
Trigger,
TriggerDTO,
} from 'ontime-types';

import { apiEntryUrl } from './constants';
Expand All @@ -31,49 +31,49 @@ export async function editAutomationSettings(
}

/**
* HTTP request to create a new automation
* HTTP request to create a new automation trigger
*/
export async function addAutomation(automation: AutomationDTO): Promise<Automation> {
const res = await axios.post(`${automationsPath}/automation`, automation);
export async function addTrigger(trigger: TriggerDTO): Promise<Trigger> {
const res = await axios.post(`${automationsPath}/trigger`, trigger);
return res.data;
}

/**
* HTTP request to update an automation
* HTTP request to update an automation trigger
*/
export async function editAutomation(id: string, automation: Automation): Promise<Automation> {
const res = await axios.put(`${automationsPath}/automation/${id}`, automation);
export async function editTrigger(id: string, trigger: Trigger): Promise<Trigger> {
const res = await axios.put(`${automationsPath}/trigger/${id}`, trigger);
return res.data;
}

/**
* HTTP request to delete an automation
* HTTP request to delete an automation trigger
*/
export function deleteAutomation(id: string): Promise<void> {
return axios.delete(`${automationsPath}/automation/${id}`);
export function deleteTrigger(id: string): Promise<void> {
return axios.delete(`${automationsPath}/trigger/${id}`);
}

/**
* HTTP request to create a new blueprint
* HTTP request to create a new automation
*/
export async function addBlueprint(blueprint: AutomationBlueprintDTO): Promise<AutomationBlueprint> {
const res = await axios.post(`${automationsPath}/blueprint`, blueprint);
export async function addAutomation(automation: AutomationDTO): Promise<Automation> {
const res = await axios.post(`${automationsPath}/automation`, automation);
return res.data;
}

/**
* HTTP request to update a blueprint
* HTTP request to update a automation
*/
export async function editBlueprint(id: string, blueprint: AutomationBlueprint): Promise<AutomationBlueprint> {
const res = await axios.put(`${automationsPath}/blueprint/${id}`, blueprint);
export async function editAutomation(id: string, automation: Automation): Promise<Automation> {
const res = await axios.put(`${automationsPath}/automation/${id}`, automation);
return res.data;
}

/**
* HTTP request to delete a blueprint
* HTTP request to delete a automation
*/
export function deleteBlueprint(id: string): Promise<void> {
return axios.delete(`${automationsPath}/blueprint/${id}`);
export function deleteAutomation(id: string): Promise<void> {
return axios.delete(`${automationsPath}/automation/${id}`);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/common/models/AutomationSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const automationPlaceholderSettings: AutomationSettings = {
enabledAutomations: false,
enabledOscIn: false,
oscPortIn: 8888,
automations: [],
blueprints: {},
triggers: [],
automations: {},
};
Loading

0 comments on commit f9b9e64

Please sign in to comment.