import type { BlockSchema } from '@vtj/core';

import instance from './instance';

export type LowCodeFileSchema = {
  active: boolean;
  dsl: BlockSchema;
  file_id?: string;
  file_path?: string;
  project_id: number;
  publish: boolean;
  published_dsl: BlockSchema;
};

export const getFile = async (id: string): Promise<LowCodeFileSchema> => {
  const response = await instance.get(`/api/v1/files/${id}`);
  return response.data;
};
