/** * Sephora Data Service * * API layer for storing Sephora shopping data on backend. * Sends extracted basket, orders, loves, and profile to /platform-data/store endpoint. * * MATCHES ChatGPT implementation pattern * - Uses format: { platform, data, metadata } * - Platform: "mobile-sephora" * * @reference PLATFORM_APIS.md for Sephora API response structures * * Data Sources (from sephora.com): * - Basket: /api/shopping-cart/basket * - Loves: /gway/v1/dotcom/users/profiles/{profileId}/lists/skus/all * - Purchases: /api/bi/profiles/{profileId}/purchases * - Profile: /gapi/users/profiles/{profileId}/current/full */ /** * Structure of a basket item - matches PLATFORM_APIS.md spec * Items with SKU ID, product ID, name, brand, price, quantity, size, image */ export interface SephoraBasketItemData { skuId: string; productId?: string; name: string; brand?: string; price?: number; quantity: number; size?: string; imageUrl?: string; id?: string; category?: string; } /** * Structure of the shopping basket */ export interface SephoraBasketData { items: SephoraBasketItemData[]; subtotal: number; biPoints?: number; total?: number; itemCount?: number; } /** * Structure of a purchase order item */ export interface SephoraPurchaseItemData { skuId: string; productId?: string; name: string; brand?: string; price?: number; quantity: number; } /** * Structure of a purchase order - matches PLATFORM_APIS.md spec */ export interface SephoraPurchaseData { orderId: string; orderDate: string; total?: number; channel?: string; items: SephoraPurchaseItemData[]; } /** * Structure of a loved/favorited item - matches PLATFORM_APIS.md spec * Products with ratings, reviews, categories, stock status, sale info */ export interface SephoraLovedItemData { skuId: string; productId?: string; name: string; brand?: string; category?: string; price?: number; salePrice?: number; rating?: number; reviewCount?: number; isInStock?: boolean; isOnSale?: boolean; imageUrl?: string; addedAt?: string; id?: string; type?: 'love'; } /** * Structure of user beauty profile - matches PLATFORM_APIS.md spec */ export interface SephoraProfileData { profileId: string; firstName?: string; lastName?: string; email?: string; vibStatus?: string; beautyInsider?: { points?: number; segment?: string; spending?: number; }; preferences?: { skinConcerns?: string[]; hairConcerns?: string[]; makeupPreferences?: string[]; }; preferredStore?: string; } /** * Token expiry information */ export interface SephoraTokenExpiry { expiry?: string; isExpired?: boolean; } /** * Legacy rating structure for backward compatibility */ export interface SephoraRatingData { productId: string; productName?: string; rating: number; review?: string; date?: string; isRecommended?: boolean; type: 'positive' | 'negative' | 'neutral'; } /** * Combined Sephora data to store - matches WebView export format */ export interface SephoraStorageData { basket: SephoraBasketData; loves: SephoraLovedItemData[]; purchases: SephoraPurchaseData[]; profile?: SephoraProfileData | null; tokenExpiry?: SephoraTokenExpiry; profileId?: string; orders?: SephoraPurchaseData[]; ratings?: SephoraRatingData[]; userId?: string; } /** * Response from backend endpoint */ export interface StoreSephoraDataResponse { success: boolean; message?: string; error?: string; data?: any; } /** * Store Sephora data on backend * * @param userId - Username or identifier * @param data - Sephora shopping data (basket, loves, purchases, profile) * @returns Response indicating success/failure with metadata */ export declare const storeSephoraData: (userId: string, data: SephoraStorageData) => Promise; //# sourceMappingURL=sephoraDataService.d.ts.map