34 lines
767 B
TypeScript
34 lines
767 B
TypeScript
import { getApiTemplateGenerations } from '@repo/loomart-sdk';
|
|
import { loomartClient } from './loomart-client';
|
|
|
|
export interface GetTemplateGenerationsParams {
|
|
page?: string;
|
|
limit?: string;
|
|
type?: 'VIDEO' | 'IMAGE' | 'TEXT';
|
|
}
|
|
|
|
export interface TemplateGeneration {
|
|
id: string;
|
|
userId: string;
|
|
templateId: string;
|
|
type: 'TEXT' | 'IMAGE' | 'VIDEO';
|
|
status: string;
|
|
resultUrl: string[];
|
|
originalUrl?: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
template?: {
|
|
id: string;
|
|
title: string;
|
|
titleEn: string;
|
|
};
|
|
}
|
|
|
|
export const getTemplateGenerations = async (params: GetTemplateGenerationsParams = {}) => {
|
|
const { data } = await getApiTemplateGenerations({
|
|
client: loomartClient,
|
|
query: params,
|
|
});
|
|
return data;
|
|
};
|