import { Cart, Order, LineItem, Customer, CustomerAddress, Category, Product, ProductSearchParams, ProductSearchResponse, Wishlist, ContactInfo, OrderAddress, OrderSearchParams, SfccIntegrationContext } from '../../types'; import { Checkout } from 'commerce-sdk'; export interface CustomersApi { guestSignIn(): Promise; refreshToken(): Promise; signIn(username: string, password: string): Promise<{ customer: Customer; token: string; }>; getCustomer(): Promise; getAddresses(): Promise; createAddress(address: CustomerAddress): Promise; updateAddress(address: CustomerAddress): Promise; deleteAddress(address: CustomerAddress): Promise; createCustomer(email: string, password: string, firstName: string, lastName: string): Promise; updateCustomer(email: string, firstName: string, lastName: string): Promise; updateCustomerPassword(currentPassword: string, newPassword: string): Promise; getCarts(context: SfccIntegrationContext): Promise; getOrders(context: SfccIntegrationContext, params: OrderSearchParams): Promise; } export interface CategoriesApi { getCategory(id: string, levels?: number, locale?: string): Promise; } export interface ProductSearchApi { searchProducts(params: ProductSearchParams, locale?: string): Promise; } export interface ProductsApi { getProduct(id: string, viewType?: string, locale?: string): Promise; getProducts(ids: string[], viewType?: string, locale?: string): Promise; } export interface WishlistsApi { getWishlist(): Promise; createWishlist(): Promise; addToWishlist(listId: string, productId: string): Promise; removeFromWishlist(listId: string, itemId: string): Promise; } export interface CartsApi { createCart(context: SfccIntegrationContext): Promise; addItemToCart(context: SfccIntegrationContext, cartId: string, product: Product, quantitiy?: number): Promise; removeItemFromCart(context: SfccIntegrationContext, cartId: string, itemId: string): Promise; updateCartItemQuantity(context: SfccIntegrationContext, cartId: string, item: LineItem, quantity: number): Promise; addCouponToCart(context: SfccIntegrationContext, cartId: string, couponCode: string): Promise; removeCouponFromCart(context: SfccIntegrationContext, cartId: string, couponItemId: string): Promise; resetCart(context: SfccIntegrationContext, cartId: string): Promise; getShippingMethods(cartId: string, shipmentId: string): Promise; getPaymentMethods(cartId: string): Promise; updateCartContactInfo(context: SfccIntegrationContext, cartId: string, contactInfo: ContactInfo): Promise; setShippingAddress(context: SfccIntegrationContext, cartId: string, shipmentId: string, address: OrderAddress): Promise; setBillingAddress(context: SfccIntegrationContext, cartId: string, address: OrderAddress): Promise; selectShippingMethod(context: SfccIntegrationContext, cartId: string, shipmentId: string, shippingMethodId: string): Promise; addPayment(context: SfccIntegrationContext, cartId: string, paymentMethodId: string, amount: number, body: any): Promise; } export interface OrdersApi { createOrder(context: SfccIntegrationContext, cartId: string): Promise; authorizePayments(context: SfccIntegrationContext, order: Order): Promise; }