working ! testing !
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m20s

This commit is contained in:
2025-11-25 00:20:59 -08:00
parent f8c8467eb3
commit c1fc7dc6ee

View File

@@ -15,7 +15,7 @@ export const isImageAFlyer = async (imageFile: File): Promise<boolean> => {
// Use apiFetchWithAuth for FormData to let the browser set the correct Content-Type. // Use apiFetchWithAuth for FormData to let the browser set the correct Content-Type.
// The URL must be relative, as the helper constructs the full path. // The URL must be relative, as the helper constructs the full path.
const response = await apiFetchWithAuth('/ai/check-flyer', { const response = await apiFetchWithAuth('/api/ai/check-flyer', {
method: 'POST', method: 'POST',
body: formData, body: formData,
}); });
@@ -27,7 +27,7 @@ export const extractAddressFromImage = async (imageFile: File): Promise<string |
const formData = new FormData(); const formData = new FormData();
formData.append('image', imageFile); formData.append('image', imageFile);
const response = await apiFetchWithAuth('/ai/extract-address', { const response = await apiFetchWithAuth('/api/ai/extract-address', {
method: 'POST', method: 'POST',
body: formData, body: formData,
}); });
@@ -49,7 +49,7 @@ export const extractCoreDataFromImage = async (imageFiles: File[], masterItems:
// --- END DEBUG LOGGING --- // --- END DEBUG LOGGING ---
// This now calls the real backend endpoint. // This now calls the real backend endpoint.
const response = await apiFetchWithAuth('/ai/process-flyer', { const response = await apiFetchWithAuth('/api/ai/process-flyer', {
method: 'POST', method: 'POST',
body: formData, body: formData,
}); });
@@ -74,7 +74,7 @@ export const extractLogoFromImage = async (imageFiles: File[]): Promise<Extracte
formData.append('images', file); formData.append('images', file);
}); });
const response = await apiFetchWithAuth('/ai/extract-logo', { const response = await apiFetchWithAuth('/api/ai/extract-logo', {
method: 'POST', method: 'POST',
body: formData, body: formData,
}); });
@@ -82,7 +82,7 @@ export const extractLogoFromImage = async (imageFiles: File[]): Promise<Extracte
}; };
export const getQuickInsights = async (items: FlyerItem[]): Promise<string> => { export const getQuickInsights = async (items: FlyerItem[]): Promise<string> => {
const response = await apiFetchWithAuth('/ai/quick-insights', { const response = await apiFetchWithAuth('/api/ai/quick-insights', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ items }), body: JSON.stringify({ items }),
@@ -92,7 +92,7 @@ export const getQuickInsights = async (items: FlyerItem[]): Promise<string> => {
}; };
export const getDeepDiveAnalysis = async (items: FlyerItem[]): Promise<string> => { export const getDeepDiveAnalysis = async (items: FlyerItem[]): Promise<string> => {
const response = await apiFetchWithAuth('/ai/deep-dive', { const response = await apiFetchWithAuth('/api/ai/deep-dive', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ items }), body: JSON.stringify({ items }),
@@ -102,7 +102,7 @@ export const getDeepDiveAnalysis = async (items: FlyerItem[]): Promise<string> =
}; };
export const searchWeb = async (items: FlyerItem[]): Promise<{text: string; sources: GroundingChunk[]}> => { export const searchWeb = async (items: FlyerItem[]): Promise<{text: string; sources: GroundingChunk[]}> => {
const response = await apiFetchWithAuth('/ai/search-web', { const response = await apiFetchWithAuth('/api/ai/search-web', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ items }), body: JSON.stringify({ items }),
@@ -123,7 +123,7 @@ export const searchWeb = async (items: FlyerItem[]): Promise<{text: string; sour
*/ */
export const planTripWithMaps = async (items: FlyerItem[], store: Store | undefined, userLocation: GeolocationCoordinates): Promise<{text: string; sources: { uri: string; title: string; }[]}> => { export const planTripWithMaps = async (items: FlyerItem[], store: Store | undefined, userLocation: GeolocationCoordinates): Promise<{text: string; sources: { uri: string; title: string; }[]}> => {
logger.debug("Stub: planTripWithMaps called with location:", { userLocation }); logger.debug("Stub: planTripWithMaps called with location:", { userLocation });
const response = await apiFetchWithAuth('/ai/plan-trip', { const response = await apiFetchWithAuth('/api/ai/plan-trip', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ items, store, userLocation }), body: JSON.stringify({ items, store, userLocation }),
@@ -138,7 +138,7 @@ export const planTripWithMaps = async (items: FlyerItem[], store: Store | undefi
*/ */
export const generateImageFromText = async (prompt: string): Promise<string> => { export const generateImageFromText = async (prompt: string): Promise<string> => {
logger.debug("Stub: generateImageFromText called with prompt:", { prompt }); logger.debug("Stub: generateImageFromText called with prompt:", { prompt });
const response = await apiFetchWithAuth('/ai/generate-image', { const response = await apiFetchWithAuth('/api/ai/generate-image', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ prompt }), body: JSON.stringify({ prompt }),
@@ -154,7 +154,7 @@ export const generateImageFromText = async (prompt: string): Promise<string> =>
*/ */
export const generateSpeechFromText = async (text: string): Promise<string> => { export const generateSpeechFromText = async (text: string): Promise<string> => {
logger.debug("Stub: generateSpeechFromText called with text:", { text }); logger.debug("Stub: generateSpeechFromText called with text:", { text });
const response = await apiFetchWithAuth('/ai/generate-speech', { const response = await apiFetchWithAuth('/api/ai/generate-speech', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text }), body: JSON.stringify({ text }),