mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
33 lines
787 B
TypeScript
33 lines
787 B
TypeScript
import type { IRestApiContext } from '@/Interface';
|
|
import { get } from '@/utils/apiUtils';
|
|
import type {
|
|
WorkflowHistory,
|
|
WorkflowVersion,
|
|
WorkflowHistoryRequestParams,
|
|
} from '@/types/workflowHistory';
|
|
|
|
export const getWorkflowHistory = async (
|
|
context: IRestApiContext,
|
|
workflowId: string,
|
|
queryParams: WorkflowHistoryRequestParams,
|
|
): Promise<WorkflowHistory[]> => {
|
|
const { data } = await get(
|
|
context.baseUrl,
|
|
`/workflow-history/workflow/${workflowId}`,
|
|
queryParams,
|
|
);
|
|
return data;
|
|
};
|
|
|
|
export const getWorkflowVersion = async (
|
|
context: IRestApiContext,
|
|
workflowId: string,
|
|
versionId: string,
|
|
): Promise<WorkflowVersion> => {
|
|
const { data } = await get(
|
|
context.baseUrl,
|
|
`/workflow-history/workflow/${workflowId}/version/${versionId}`,
|
|
);
|
|
return data;
|
|
};
|