| Server IP : 54.37.205.81 / Your IP : 216.73.216.76 Web Server : nginx/1.22.1 System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64 User : debian ( 1000) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/app.copyrightchain.it/copyrightchain_app/ |
Upload File : |
import { Language, SensitiveEntity } from './types';
import { apiFetch } from './services/apiClient';
// Frontend facade for AI features.
// SECURITY: API keys must never be stored in the browser or localStorage.
// All AI calls are proxied through the WordPress bridge backend.
export const generateMarketingContent = async (
context: string,
channel: string,
tone: string,
lang: Language
): Promise<string> => {
const res = await apiFetch<{ text: string }>(`/ai/marketing/content`, {
method: 'POST',
body: JSON.stringify({ context, channel, tone, lang }),
});
return res.text;
};
export const generateMarketingVisual = async (
context: string,
channel: string,
aspectRatio: string
): Promise<string> => {
const res = await apiFetch<{ dataUrl: string }>(`/ai/marketing/visual`, {
method: 'POST',
body: JSON.stringify({ context, channel, aspectRatio }),
});
return res.dataUrl;
};
export const generateLegalAttestation = async (
fileName: string,
hash: string,
date: string,
author: string,
lang: Language = 'it'
): Promise<string> => {
const res = await apiFetch<{ text: string }>(`/ai/legal/attestation`, {
method: 'POST',
body: JSON.stringify({ fileName, hash, date, author, lang }),
});
return res.text;
};
export const identifySensitiveEntities = async (text: string, lang: Language): Promise<SensitiveEntity[]> => {
const res = await apiFetch<{ entities: SensitiveEntity[] }>(`/ai/pii`, {
method: 'POST',
body: JSON.stringify({ text, lang }),
});
return res.entities || [];
};
export const analyzeWorkUniqueness = async (title: string, author: string, lang: Language): Promise<string> => {
const res = await apiFetch<{ text: string }>(`/ai/uniqueness`, {
method: 'POST',
body: JSON.stringify({ title, author, lang }),
});
return res.text;
};