mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-31 07:40:36 +02:00
* ✨ Create rule `no-unneeded-backticks` * 👕 Enable rule * ⚡ Run rule on `cli` * ⚡ Run rule on `core` * ⚡ Run rule on `workflow` * ⚡ Rule rule on `design-system` * ⚡ Run rule on `node-dev` * ⚡ Run rule on `editor-ui` * ⚡ Run rule on `nodes-base`
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
import { IRestApiContext } from '@/Interface';
|
|
import { IDataObject } from 'n8n-workflow';
|
|
import { makeRestApiRequest } from '@/utils';
|
|
|
|
export async function getNewWorkflow(context: IRestApiContext, name?: string) {
|
|
const response = await makeRestApiRequest(context, 'GET', '/workflows/new', name ? { name } : {});
|
|
return {
|
|
name: response.name,
|
|
onboardingFlowEnabled: response.onboardingFlowEnabled === true,
|
|
};
|
|
}
|
|
|
|
export async function getWorkflows(context: IRestApiContext, filter?: object) {
|
|
const sendData = filter ? { filter } : undefined;
|
|
|
|
return await makeRestApiRequest(context, 'GET', '/workflows', sendData);
|
|
}
|
|
|
|
export async function getActiveWorkflows(context: IRestApiContext) {
|
|
return await makeRestApiRequest(context, 'GET', '/active');
|
|
}
|
|
|
|
export async function getCurrentExecutions(context: IRestApiContext, filter: IDataObject) {
|
|
return await makeRestApiRequest(context, 'GET', '/executions-current', { filter });
|
|
}
|
|
|
|
export async function getFinishedExecutions(context: IRestApiContext, filter: IDataObject) {
|
|
return await makeRestApiRequest(context, 'GET', '/executions', { filter });
|
|
}
|
|
|
|
export async function getExecutionData(context: IRestApiContext, executionId: string) {
|
|
return await makeRestApiRequest(context, 'GET', `/executions/${executionId}`);
|
|
}
|