feat(F-096): completed feature
This commit is contained in:
@@ -21,6 +21,12 @@ const updateSettingsSchema = z.object({
|
||||
footerText: z.string().max(400).optional(),
|
||||
facebookUrl: z.string().url().optional().or(z.literal('')),
|
||||
instagramUrl: z.string().url().optional().or(z.literal('')),
|
||||
aiProvider: z.string().max(80).optional(),
|
||||
aiBaseUrl: z.string().url().optional().or(z.literal('')),
|
||||
aiModel: z.string().max(120).optional(),
|
||||
aiApiKey: z.string().max(500).optional(),
|
||||
aiSeoTitlePrompt: z.string().max(2000).optional(),
|
||||
aiSeoDescriptionPrompt: z.string().max(4000).optional(),
|
||||
});
|
||||
|
||||
const SETTING_KEYS: Record<string, string> = {
|
||||
@@ -32,6 +38,12 @@ const SETTING_KEYS: Record<string, string> = {
|
||||
footerText: 'footer_text',
|
||||
facebookUrl: 'facebook_url',
|
||||
instagramUrl: 'instagram_url',
|
||||
aiProvider: 'ai_provider',
|
||||
aiBaseUrl: 'ai_base_url',
|
||||
aiModel: 'ai_model',
|
||||
aiApiKey: 'ai_api_key',
|
||||
aiSeoTitlePrompt: 'ai_seo_title_prompt',
|
||||
aiSeoDescriptionPrompt: 'ai_seo_description_prompt',
|
||||
};
|
||||
|
||||
export async function registerStoreSettingsRoutes(
|
||||
@@ -63,6 +75,13 @@ export async function registerStoreSettingsRoutes(
|
||||
footerText: map['footer_text'] ?? '',
|
||||
facebookUrl: map['facebook_url'] ?? '',
|
||||
instagramUrl: map['instagram_url'] ?? '',
|
||||
aiProvider: map['ai_provider'] ?? '',
|
||||
aiBaseUrl: map['ai_base_url'] ?? '',
|
||||
aiModel: map['ai_model'] ?? '',
|
||||
aiApiKey: '',
|
||||
aiApiKeyConfigured: Boolean(map['ai_api_key']),
|
||||
aiSeoTitlePrompt: map['ai_seo_title_prompt'] ?? 'Genera un título SEO breve y atractivo para este producto: {{name}}. Devuelve solo el título.',
|
||||
aiSeoDescriptionPrompt: map['ai_seo_description_prompt'] ?? 'Genera una meta descripción SEO en español, clara y persuasiva, para este producto: {{name}}. Devuelve solo la descripción.',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -118,6 +137,13 @@ export async function registerStoreSettingsRoutes(
|
||||
footerText: map['footer_text'] ?? '',
|
||||
facebookUrl: map['facebook_url'] ?? '',
|
||||
instagramUrl: map['instagram_url'] ?? '',
|
||||
aiProvider: map['ai_provider'] ?? '',
|
||||
aiBaseUrl: map['ai_base_url'] ?? '',
|
||||
aiModel: map['ai_model'] ?? '',
|
||||
aiApiKey: '',
|
||||
aiApiKeyConfigured: Boolean(map['ai_api_key']),
|
||||
aiSeoTitlePrompt: map['ai_seo_title_prompt'] ?? 'Genera un título SEO breve y atractivo para este producto: {{name}}. Devuelve solo el título.',
|
||||
aiSeoDescriptionPrompt: map['ai_seo_description_prompt'] ?? 'Genera una meta descripción SEO en español, clara y persuasiva, para este producto: {{name}}. Devuelve solo la descripción.',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user