import { stripHtml } from '../../../utils/strip-html.utils'; export const apiUrls = { BASE_URL: (origin: string) => typeof window !== 'undefined' ? '/homedepotcacommercewebservices/v2/homedepotca' : `${origin}/homedepotcacommercewebservices/v2/homedepotca`, GET_CURRENT_CART: (user: string, cartId: string, localizedPOS?: string) => `/users/${user}/carts/${cartId}?fields=FULL_SPA&${localizedPOS ? ('&localizedPOS=' + localizedPOS) : ''}`, POST_ADD_TO_CART: (user = 'anonymous', cartId: string, localizedPOS: string) => `/users/${user}/carts/${cartId}/entries?fields=FULL&localizedPOS=${localizedPOS}&catalogVersion=Online`, POST_ADD_APPLIANCE_TO_CART: (user = 'anonymous', cartId: string, postalCode: string, localizedPOS?: string) => `/users/${user}/carts/${cartId}/addAppliance/${postalCode}${localizedPOS ? ('?localizedPOS=' + localizedPOS) : ''}`, CREATE_CART_SESSION: () => `/users/anonymous/carts/?catalogVersion=Online`, CREATE_ACCOUNT_CART_SESSION: (email: string) => `/users/${email}/carts/?catalogVersion=Online`, GET_CONFIGURATIONS: () => `/tools/configurations`, GET_PARTS_AND_SERVICES: (productCode: string, postalCode: string, localizedPOS?: string) => `/products/${stripHtml(productCode)}/getRelatedParts?postalCode=${postalCode}${localizedPOS ? ('&localizedPOS=' + localizedPOS) : ''}`, GET_PAYPAL_TOKEN: (customerId: string, cartId: string, catalogVersion = 'Online') => `/users/${customerId}/carts/${cartId}/opc/getpaypaltoken?catalogVersion=${catalogVersion}`, GET_RECOMMENDATIONS: (productId: string, scheme: string, relationship: string, trackingId: string, localizedPOS: string, fields: string, catalogVersion: string) => `/products/${stripHtml(productId)}/recommendations/?scheme=${scheme}&relationship=${relationship}&trackingId=${trackingId}&localizedPOS=${localizedPOS}&fields=${fields}&catalogVersion=${catalogVersion}` };