import { CartDTO, CartTypes, Context, DAL, FindConfig, ICartModuleService, InferEntityType, InternalModuleDeclaration, ModulesSdkTypes } from "@medusajs/framework/types"; import { ModulesSdkUtils } from "@medusajs/framework/utils"; import { Address, Cart, LineItem, LineItemAdjustment, LineItemTaxLine, ShippingMethod, ShippingMethodAdjustment, ShippingMethodTaxLine } from "../models"; import { CreateLineItemDTO } from "../types"; type InjectedDependencies = { baseRepository: DAL.RepositoryService; cartService: ModulesSdkTypes.IMedusaInternalService; addressService: ModulesSdkTypes.IMedusaInternalService; lineItemService: ModulesSdkTypes.IMedusaInternalService; shippingMethodAdjustmentService: ModulesSdkTypes.IMedusaInternalService; shippingMethodService: ModulesSdkTypes.IMedusaInternalService; lineItemAdjustmentService: ModulesSdkTypes.IMedusaInternalService; lineItemTaxLineService: ModulesSdkTypes.IMedusaInternalService; shippingMethodTaxLineService: ModulesSdkTypes.IMedusaInternalService; }; declare const CartModuleService_base: ModulesSdkUtils.MedusaServiceReturnType<{ Cart: { dto: CartTypes.CartDTO; }; CreditLine: { dto: CartTypes.CartCreditLineDTO; }; Address: { dto: CartTypes.CartAddressDTO; }; LineItem: { dto: CartTypes.CartLineItemDTO; }; LineItemAdjustment: { dto: CartTypes.LineItemAdjustmentDTO; }; LineItemTaxLine: { dto: CartTypes.LineItemTaxLineDTO; }; ShippingMethod: { dto: CartTypes.CartShippingMethodDTO; }; ShippingMethodAdjustment: { dto: CartTypes.ShippingMethodAdjustmentDTO; }; ShippingMethodTaxLine: { dto: CartTypes.ShippingMethodTaxLineDTO; }; }>; export default class CartModuleService extends CartModuleService_base implements ICartModuleService { protected readonly moduleDeclaration: InternalModuleDeclaration; protected baseRepository_: DAL.RepositoryService; protected cartService_: ModulesSdkTypes.IMedusaInternalService>; protected addressService_: ModulesSdkTypes.IMedusaInternalService>; protected lineItemService_: ModulesSdkTypes.IMedusaInternalService>; protected shippingMethodAdjustmentService_: ModulesSdkTypes.IMedusaInternalService>; protected shippingMethodService_: ModulesSdkTypes.IMedusaInternalService>; protected lineItemAdjustmentService_: ModulesSdkTypes.IMedusaInternalService>; protected lineItemTaxLineService_: ModulesSdkTypes.IMedusaInternalService>; protected shippingMethodTaxLineService_: ModulesSdkTypes.IMedusaInternalService>; constructor({ baseRepository, cartService, addressService, lineItemService, shippingMethodAdjustmentService, shippingMethodService, lineItemAdjustmentService, shippingMethodTaxLineService, lineItemTaxLineService, }: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration); private shouldIncludeTotals; private addRelationsToCalculateTotals; retrieveCart(id: string, config?: FindConfig | undefined, sharedContext?: Context | undefined): Promise; listCarts(filters?: any, config?: FindConfig | undefined, sharedContext?: Context | undefined): Promise; listAndCountCarts(filters?: any, config?: FindConfig | undefined, sharedContext?: Context | undefined): Promise<[CartDTO[], number]>; createCarts(data: CartTypes.CreateCartDTO[], sharedContext?: Context): Promise; createCarts(data: CartTypes.CreateCartDTO, sharedContext?: Context): Promise; protected createCarts_(data: CartTypes.CreateCartDTO[], sharedContext?: Context): Promise[]>; updateCarts(data: CartTypes.UpdateCartDTO[]): Promise; updateCarts(cartId: string, data: CartTypes.UpdateCartDataDTO, sharedContext?: Context): Promise; updateCarts(selector: Partial, data: CartTypes.UpdateCartDataDTO, sharedContext?: Context): Promise; protected updateCarts_(dataOrIdOrSelector: CartTypes.UpdateCartDTO[] | string | Partial, data?: CartTypes.UpdateCartDataDTO, sharedContext?: Context): Promise<{ id: string; region_id: string | null; customer_id: string | null; sales_channel_id: string | null; email: string | null; currency_code: string; locale: string | null; metadata: NoInfer> | null; completed_at: Date | null; shipping_address: { id: string; customer_id: string | null; company: string | null; first_name: string | null; last_name: string | null; address_1: string | null; address_2: string | null; city: string | null; country_code: string | null; province: string | null; postal_code: string | null; phone: string | null; metadata: NoInfer> | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }; billing_address: { id: string; customer_id: string | null; company: string | null; first_name: string | null; last_name: string | null; address_1: string | null; address_2: string | null; city: string | null; country_code: string | null; province: string | null; postal_code: string | null; phone: string | null; metadata: NoInfer> | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }; items: { id: string; title: string; subtitle: string | null; thumbnail: string | null; quantity: number; variant_id: string | null; product_id: string | null; product_title: string | null; product_description: string | null; product_subtitle: string | null; product_type: string | null; product_type_id: string | null; product_collection: string | null; product_handle: string | null; variant_sku: string | null; variant_barcode: string | null; variant_title: string | null; variant_option_values: NoInfer> | null; requires_shipping: boolean; is_discountable: boolean; is_giftcard: boolean; is_tax_inclusive: boolean; is_custom_price: boolean; compare_at_unit_price: number | null; unit_price: number; metadata: NoInfer> | null; original_total: number | null; original_subtotal: number | null; original_tax_total: number | null; item_total: number | null; item_subtotal: number | null; item_tax_total: number | null; total: number | null; subtotal: number | null; tax_total: number | null; discount_total: number | null; discount_tax_total: number | null; adjustments: { id: string; description: string | null; code: string | null; amount: number; is_tax_inclusive: boolean; provider_id: string | null; promotion_id: string | null; metadata: NoInfer> | null; item: /*elided*/ any; raw_amount: Record; created_at: Date; updated_at: Date; deleted_at: Date | null; item_id: string; }[]; tax_lines: { id: string; description: string | null; code: string; rate: number; provider_id: string | null; metadata: NoInfer> | null; data: NoInfer> | null; tax_rate_id: string | null; item: /*elided*/ any; created_at: Date; updated_at: Date; deleted_at: Date | null; item_id: string; }[]; cart: /*elided*/ any; raw_compare_at_unit_price: Record | null; raw_unit_price: Record; created_at: Date; updated_at: Date; deleted_at: Date | null; cart_id: string; }[]; credit_lines: { id: string; cart: /*elided*/ any; reference: string | null; reference_id: string | null; amount: number; raw_amount: NoInfer> & Record; metadata: NoInfer> | null; created_at: Date; updated_at: Date; deleted_at: Date | null; cart_id: string; }[]; shipping_methods: { id: string; name: string; description: NoInfer> | null; amount: number; is_tax_inclusive: boolean; shipping_option_id: string | null; data: NoInfer> | null; metadata: NoInfer> | null; original_total: number | null; original_subtotal: number | null; original_tax_total: number | null; total: number | null; subtotal: number | null; tax_total: number | null; discount_total: number | null; discount_tax_total: number | null; cart: /*elided*/ any; tax_lines: { id: string; description: string | null; code: string; rate: number; provider_id: string | null; tax_rate_id: string | null; metadata: NoInfer> | null; data: NoInfer> | null; shipping_method: /*elided*/ any; created_at: Date; updated_at: Date; deleted_at: Date | null; shipping_method_id: string; }[]; adjustments: { id: string; description: string | null; code: string | null; amount: number; provider_id: string | null; metadata: NoInfer> | null; promotion_id: string | null; shipping_method: /*elided*/ any; raw_amount: Record; created_at: Date; updated_at: Date; deleted_at: Date | null; shipping_method_id: string; }[]; raw_amount: Record; created_at: Date; updated_at: Date; deleted_at: Date | null; cart_id: string; }[]; original_item_total: number | null; original_item_subtotal: number | null; original_item_tax_total: number | null; item_total: number | null; item_subtotal: number | null; item_tax_total: number | null; original_total: number | null; original_subtotal: number | null; original_tax_total: number | null; total: number | null; subtotal: number | null; tax_total: number | null; discount_total: number | null; discount_tax_total: number | null; gift_card_total: number | null; gift_card_tax_total: number | null; shipping_total: number | null; shipping_subtotal: number | null; shipping_tax_total: number | null; original_shipping_total: number | null; original_shipping_subtotal: number | null; original_shipping_tax_total: number | null; created_at: Date; updated_at: Date; deleted_at: Date | null; shipping_address_id: string | null; billing_address_id: string | null; }[]>; updateShippingMethods(data: CartTypes.UpdateShippingMethodDTO[], sharedContext?: Context): Promise; addLineItems(data: CartTypes.CreateLineItemForCartDTO): Promise; addLineItems(data: CartTypes.CreateLineItemForCartDTO[]): Promise; addLineItems(cartId: string, items: CartTypes.CreateLineItemDTO[], sharedContext?: Context): Promise; protected addLineItems_(cartId: string, items: CartTypes.CreateLineItemDTO[], sharedContext?: Context): Promise[]>; protected addLineItemsBulk_(data: CreateLineItemDTO[], sharedContext?: Context): Promise[]>; updateLineItems(data: CartTypes.UpdateLineItemWithSelectorDTO[]): Promise; updateLineItems(data: (Partial & { id: string; })[]): Promise; updateLineItems(selector: Partial, data: CartTypes.UpdateLineItemDTO, sharedContext?: Context): Promise; updateLineItems(lineItemId: string, data: Partial, sharedContext?: Context): Promise; protected updateLineItem_(lineItemId: string, data: Partial, sharedContext?: Context): Promise>; protected updateLineItemsWithSelector_(updates: CartTypes.UpdateLineItemWithSelectorDTO[], sharedContext?: Context): Promise[]>; createAddresses(data: CartTypes.CreateAddressDTO, sharedContext?: Context): Promise; createAddresses(data: CartTypes.CreateAddressDTO[], sharedContext?: Context): Promise; protected createAddresses_(data: CartTypes.CreateAddressDTO[], sharedContext?: Context): Promise<{ id: string; customer_id: string | null; company: string | null; first_name: string | null; last_name: string | null; address_1: string | null; address_2: string | null; city: string | null; country_code: string | null; province: string | null; postal_code: string | null; phone: string | null; metadata: NoInfer> | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }[]>; updateAddresses(data: CartTypes.UpdateAddressDTO, sharedContext?: Context): Promise; updateAddresses(data: CartTypes.UpdateAddressDTO[], sharedContext?: Context): Promise; protected updateAddresses_(data: CartTypes.UpdateAddressDTO[], sharedContext?: Context): Promise<{ id: string; customer_id: string | null; company: string | null; first_name: string | null; last_name: string | null; address_1: string | null; address_2: string | null; city: string | null; country_code: string | null; province: string | null; postal_code: string | null; phone: string | null; metadata: NoInfer> | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }[]>; addShippingMethods(data: CartTypes.CreateShippingMethodDTO): Promise; addShippingMethods(data: CartTypes.CreateShippingMethodDTO[]): Promise; addShippingMethods(cartId: string, methods: CartTypes.CreateShippingMethodForSingleCartDTO[], sharedContext?: Context): Promise; protected addShippingMethods_(cartId: string, data: CartTypes.CreateShippingMethodForSingleCartDTO[], sharedContext?: Context): Promise[]>; protected addShippingMethodsBulk_(data: CartTypes.CreateShippingMethodDTO[], sharedContext?: Context): Promise[]>; addLineItemAdjustments(adjustments: CartTypes.CreateLineItemAdjustmentDTO[]): Promise; addLineItemAdjustments(adjustment: CartTypes.CreateLineItemAdjustmentDTO): Promise; addLineItemAdjustments(cartId: string, adjustments: CartTypes.CreateLineItemAdjustmentDTO[], sharedContext?: Context): Promise; protected addLineItemAdjustments_(cartIdOrData: string | CartTypes.CreateLineItemAdjustmentDTO[] | CartTypes.CreateLineItemAdjustmentDTO, adjustments?: CartTypes.CreateLineItemAdjustmentDTO[], sharedContext?: Context): Promise[]>; upsertLineItemTaxLines(taxLines: (CartTypes.CreateLineItemTaxLineDTO | CartTypes.UpdateLineItemTaxLineDTO)[], sharedContext?: Context): Promise; protected upsertLineItemTaxLines_(taxLines: (CartTypes.CreateLineItemTaxLineDTO | CartTypes.UpdateLineItemTaxLineDTO)[], sharedContext?: Context): Promise[]>; upsertLineItemAdjustments(adjustments: (CartTypes.CreateLineItemAdjustmentDTO | CartTypes.UpdateLineItemAdjustmentDTO)[], sharedContext?: Context): Promise; protected upsertLineItemAdjustments_(adjustments: (CartTypes.CreateLineItemAdjustmentDTO | CartTypes.UpdateLineItemAdjustmentDTO)[], sharedContext?: Context): Promise[]>; upsertShippingMethodTaxLines(taxLines: (CartTypes.CreateShippingMethodTaxLineDTO | CartTypes.UpdateShippingMethodTaxLineDTO)[], sharedContext?: Context): Promise; protected upsertShippingMethodTaxLines_(taxLines: (CartTypes.CreateShippingMethodTaxLineDTO | CartTypes.UpdateShippingMethodTaxLineDTO)[], sharedContext?: Context): Promise[]>; upsertShippingMethodAdjustments(adjustments: (CartTypes.CreateShippingMethodAdjustmentDTO | CartTypes.UpdateShippingMethodAdjustmentDTO)[], sharedContext?: Context): Promise; protected upsertShippingMethodAdjustments_(adjustments: (CartTypes.CreateShippingMethodAdjustmentDTO | CartTypes.UpdateShippingMethodAdjustmentDTO)[], sharedContext?: Context): Promise[]>; setLineItemAdjustments(cartId: string, adjustments: (CartTypes.CreateLineItemAdjustmentDTO | CartTypes.UpdateLineItemAdjustmentDTO)[], sharedContext?: Context): Promise; protected setLineItemAdjustments_(cartId: string, adjustments: (CartTypes.CreateLineItemAdjustmentDTO | CartTypes.UpdateLineItemAdjustmentDTO)[], sharedContext?: Context): Promise[]>; setShippingMethodAdjustments(cartId: string, adjustments: (CartTypes.CreateShippingMethodAdjustmentDTO | CartTypes.UpdateShippingMethodAdjustmentDTO)[], sharedContext?: Context): Promise; protected setShippingMethodAdjustments_(cartId: string, adjustments: (CartTypes.CreateShippingMethodAdjustmentDTO | CartTypes.UpdateShippingMethodAdjustmentDTO)[], sharedContext?: Context): Promise[]>; addShippingMethodAdjustments(adjustments: CartTypes.CreateShippingMethodAdjustmentDTO[]): Promise; addShippingMethodAdjustments(adjustment: CartTypes.CreateShippingMethodAdjustmentDTO): Promise; addShippingMethodAdjustments(cartId: string, adjustments: CartTypes.CreateShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise; protected addShippingMethodAdjustments_(cartIdOrData: string | CartTypes.CreateShippingMethodAdjustmentDTO[] | CartTypes.CreateShippingMethodAdjustmentDTO, adjustments?: CartTypes.CreateShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise[] | InferEntityType>; addLineItemTaxLines(taxLines: CartTypes.CreateLineItemTaxLineDTO[]): Promise; addLineItemTaxLines(taxLine: CartTypes.CreateLineItemTaxLineDTO): Promise; addLineItemTaxLines(cartId: string, taxLines: CartTypes.CreateLineItemTaxLineDTO[] | CartTypes.CreateShippingMethodTaxLineDTO, sharedContext?: Context): Promise; protected addLineItemTaxLines_(cartIdOrData: string | CartTypes.CreateLineItemTaxLineDTO[] | CartTypes.CreateLineItemTaxLineDTO, taxLines?: CartTypes.CreateLineItemTaxLineDTO[] | CartTypes.CreateLineItemTaxLineDTO, sharedContext?: Context): Promise[] | InferEntityType>; setLineItemTaxLines(cartId: string, taxLines: (CartTypes.CreateLineItemTaxLineDTO | CartTypes.UpdateLineItemTaxLineDTO)[], sharedContext?: Context): Promise; protected setLineItemTaxLines_(cartId: string, taxLines: (CartTypes.CreateLineItemTaxLineDTO | CartTypes.UpdateLineItemTaxLineDTO)[], sharedContext?: Context): Promise[]>; addShippingMethodTaxLines(taxLines: CartTypes.CreateShippingMethodTaxLineDTO[]): Promise; addShippingMethodTaxLines(taxLine: CartTypes.CreateShippingMethodTaxLineDTO): Promise; addShippingMethodTaxLines(cartId: string, taxLines: CartTypes.CreateShippingMethodTaxLineDTO[] | CartTypes.CreateShippingMethodTaxLineDTO, sharedContext?: Context): Promise; protected addShippingMethodTaxLines_(cartIdOrData: string | CartTypes.CreateShippingMethodTaxLineDTO[] | CartTypes.CreateShippingMethodTaxLineDTO, taxLines?: CartTypes.CreateShippingMethodTaxLineDTO[] | CartTypes.CreateShippingMethodTaxLineDTO, sharedContext?: Context): Promise[] | InferEntityType>; setShippingMethodTaxLines(cartId: string, taxLines: (CartTypes.CreateShippingMethodTaxLineDTO | CartTypes.UpdateShippingMethodTaxLineDTO)[], sharedContext?: Context): Promise; protected setShippingMethodTaxLines_(cartId: string, taxLines: (CartTypes.CreateShippingMethodTaxLineDTO | CartTypes.UpdateShippingMethodTaxLineDTO)[], sharedContext?: Context): Promise[]>; } export {}; //# sourceMappingURL=cart-module.d.ts.map