- Implemented a bash script to test n8n API and retrieve credential schemas. - Added types for API responses, Google Calendar, and WhatsApp instances. - Configured Vitest for testing with React and added setup for testing-library.
53 lines
984 B
TypeScript
53 lines
984 B
TypeScript
// Tipos relacionados a WhatsApp/EvolutionAPI
|
|
|
|
/**
|
|
* Instância WhatsApp - usado na UI
|
|
*/
|
|
export interface WhatsAppInstance {
|
|
name: string;
|
|
status: "connected" | "disconnected" | "error";
|
|
error?: string;
|
|
}
|
|
|
|
/**
|
|
* Status de uma instância - resposta da EvolutionAPI connectionState
|
|
*/
|
|
export interface InstanceStatus {
|
|
instance: string;
|
|
status: "connected" | "disconnected" | "error";
|
|
error?: string;
|
|
}
|
|
|
|
/**
|
|
* Resposta de conexão com QR code - resposta da EvolutionAPI connect
|
|
*/
|
|
export interface QRCodeResponse {
|
|
pairingCode: string;
|
|
code: string;
|
|
count: number;
|
|
base64?: string;
|
|
qrcode?: string;
|
|
instance: string;
|
|
}
|
|
|
|
/**
|
|
* Resposta de logout - resposta da EvolutionAPI logout
|
|
*/
|
|
export interface LogoutResponse {
|
|
status: string;
|
|
error: boolean;
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Resposta de connectionState da API
|
|
*/
|
|
export interface ConnectionStateAPIResponse {
|
|
instance: {
|
|
instanceName: string;
|
|
state: string;
|
|
};
|
|
}
|