@daffodil/cart 0.42.2 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,6 +133,8 @@ class DaffCartItemExceedsMaxQtyError extends DaffInheritableError {
133
133
  /**
134
134
  * An error thrown when an add to cart request is sent
135
135
  * for a product that cannot be found.
136
+ *
137
+ * @deprecated Use the `DaffProductNotFoundError` from `@daffodil/product/driver` instead.
136
138
  */
137
139
  class DaffProductNotFoundError extends DaffInheritableError {
138
140
  constructor(message) {
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-cart-driver.mjs","sources":["../../../libs/cart/driver/src/interfaces/cart-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-billing-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-coupon-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-item-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-payment-methods-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-payment-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-information-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-methods-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-order-service.interface.ts","../../../libs/cart/driver/src/interfaces/public_api.ts","../../../libs/cart/driver/src/errors/codes.enum.ts","../../../libs/cart/driver/src/errors/cart-not-found.ts","../../../libs/cart/driver/src/errors/expired-payment-token.ts","../../../libs/cart/driver/src/errors/invalid-api-response.ts","../../../libs/cart/driver/src/errors/invalid-country.ts","../../../libs/cart/driver/src/errors/invalid-coupon-code.ts","../../../libs/cart/driver/src/errors/invalid-email.ts","../../../libs/cart/driver/src/errors/invalid-region.ts","../../../libs/cart/driver/src/errors/item-exceeds-max-qty.ts","../../../libs/cart/driver/src/errors/product-not-found.ts","../../../libs/cart/driver/src/errors/product-out-of-stock.ts","../../../libs/cart/driver/src/errors/map.ts","../../../libs/cart/driver/src/daffodil-cart-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffDriverResponse } from '@daffodil/driver';\n\n/**\n * The interface responsible for managing a customer's cart.\n */\nexport interface DaffCartServiceInterface<T extends DaffCart = DaffCart> {\n /**\n * Retrieve a cart\n */\n get(id: T['id']): Observable<DaffDriverResponse<T>>;\n\n /**\n * Creates a cart.\n */\n create(): Observable<{id: T['id']}>;\n\n /**\n * @deprecated\n * Prefer DaffCartItemServiceInterface.add\n *\n * Add an item to the cart.\n */\n addToCart(productId: string, qty: number): Observable<T>;\n\n /**\n * Remove all items from a cart.\n */\n clear(id: T['id']): Observable<Partial<T>>;\n}\n\nexport const DaffCartDriver = new InjectionToken<DaffCartServiceInterface>(\n 'DaffCartDriver',\n);\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the billing address of a cart.\n */\nexport interface DaffCartBillingAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Retrieve the billing address of a cart\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the billing address of a cart\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartBillingAddressDriver = new InjectionToken<\nDaffCartBillingAddressServiceInterface\n>('DaffCartBillingAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the address of a cart.\n */\nexport interface DaffCartAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Update the billing and shipping address of a cart\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartAddressDriver = new InjectionToken<\nDaffCartAddressServiceInterface\n>('DaffCartAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCart,\n DaffCartCoupon,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for applying a coupon to a cart.\n */\nexport interface DaffCartCouponServiceInterface<T extends DaffCart = DaffCart, V extends DaffCartCoupon = DaffCartCoupon> {\n /**\n * Apply a coupon to the cart and return a partial of the cart.\n */\n apply(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n /**\n * List coupon codes applied to a cart.\n */\n list(cartId: T['id']): Observable<V[]>;\n\n /**\n * Remove a coupon from the cart and return a partial of the cart.\n */\n remove(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n /**\n * Remove all coupons from the cart and return a partial of the cart.\n */\n removeAll(cartId: T['id']): Observable<Partial<T>>;\n}\n\nexport const DaffCartCouponDriver = new InjectionToken<DaffCartCouponServiceInterface>(\n 'DaffCartCouponDriver',\n);\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartItem,\n DaffCartItemInput,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the items of a cart.\n */\nexport interface DaffCartItemServiceInterface<\n T extends DaffCartItem = DaffCartItem,\n U extends DaffCartItemInput = DaffCartItemInput,\n V extends DaffCart = DaffCart\n> {\n /**\n * List all of the available items of a cart\n */\n list(cartId: V['id']): Observable<T[]>;\n\n /**\n * Get a specific cart item of a cart.\n */\n get(cartId: V['id'], item_id: DaffCartItem['id']): Observable<T>;\n\n /**\n * Add something to a cart.\n */\n add(id: V['id'], product: U): Observable<Partial<V>>;\n\n /**\n * Update an existing item in a cart\n */\n update(\n cartId: V['id'],\n itemId: T['id'],\n changes: Partial<T>,\n ): Observable<Partial<V>>;\n\n /**\n * Remove an item from a cart.\n */\n delete(cartId: V['id'], itemId: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartItemDriver = new InjectionToken<\nDaffCartItemServiceInterface\n>('DaffCartItemDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartPaymentMethod,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for retrieving the available payment methods of a cart.\n */\nexport interface DaffCartPaymentMethodsServiceInterface<T extends DaffCartPaymentMethod = DaffCartPaymentMethod> {\n /**\n * List the available payment methods of a cart.\n */\n list(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartPaymentMethodsDriver = new InjectionToken<\nDaffCartPaymentMethodsServiceInterface\n>('DaffCartPaymentMethodsDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartPaymentMethod,\n DaffCart,\n DaffCartAddress,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the selected payment method of a cart.\n */\nexport interface DaffCartPaymentServiceInterface<\n T extends DaffCartPaymentMethod = DaffCartPaymentMethod,\n V extends DaffCart = DaffCart,\n R extends DaffCartAddress = DaffCartAddress\n> {\n /**\n * Get the currently applied payment method of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the payment method applied to a cart.\n */\n update(cartId: V['id'], payment: Partial<T>): Observable<Partial<V>>;\n\n /**\n * Update the billing address and payment method applied to a cart.\n */\n updateWithBilling(cartId: V['id'], payment: Partial<T>, address: Partial<R>): Observable<Partial<V>>;\n\n /**\n * Remove the payment method applied to a cart.\n */\n remove(cartId: V['id']): Observable<void>;\n}\n\nexport const DaffCartPaymentDriver = new InjectionToken<\nDaffCartPaymentServiceInterface\n>('DaffCartPaymentDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the shipping address of a cart.\n */\nexport interface DaffCartShippingAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Retrieve the shipping address of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the shipping address of a cart.\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingAddressDriver = new InjectionToken<\nDaffCartShippingAddressServiceInterface\n>('DaffCartShippingAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartShippingRate,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for mediating the interaction of the shipping\n * information of a cart with a given platform.\n */\nexport interface DaffCartShippingInformationServiceInterface<\n T extends DaffCartShippingRate = DaffCartShippingRate,\n V extends DaffCart = DaffCart\n>{\n /**\n * Get the currently selected shipping method of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the currently selected shipping method of a cart.\n */\n update(cartId: V['id'], shippingInfo: Partial<T>): Observable<Partial<V>>;\n\n /**\n * Remove the currently selected shipping method from a cart.\n */\n delete(cartId: V['id'], id?: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingInformationDriver = new InjectionToken<\nDaffCartShippingInformationServiceInterface\n>('DaffCartShippingInformationDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartShippingRate,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for retrieving the available shipping methods of a cart.\n */\nexport interface DaffCartShippingMethodsServiceInterface<\n T extends DaffCartShippingRate = DaffCartShippingRate\n> {\n /**\n * List the available shipping methods for a cart.\n */\n list(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartShippingMethodsDriver = new InjectionToken<\nDaffCartShippingMethodsServiceInterface\n>('DaffCartShippingMethodsDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCart,\n DaffCartPaymentMethod,\n DaffCartOrderResult,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for placing an order for the customer's cart.\n */\nexport interface DaffCartOrderServiceInterface<\n T extends DaffCart = DaffCart,\n V extends DaffCartPaymentMethod = DaffCartPaymentMethod,\n R extends DaffCartOrderResult = DaffCartOrderResult\n> {\n /**\n * Place an order and return the order ID.\n */\n placeOrder(id: T['id'], payment?: V): Observable<R>;\n}\n\nexport const DaffCartOrderDriver = new InjectionToken<DaffCartOrderServiceInterface>(\n 'DaffCartOrderDriver',\n);\n","// Drivers\nexport {\n DaffCartServiceInterface,\n DaffCartDriver,\n} from './cart-service.interface';\nexport {\n DaffCartBillingAddressServiceInterface,\n DaffCartBillingAddressDriver,\n} from './cart-billing-address-service.interface';\nexport {\n DaffCartAddressServiceInterface,\n DaffCartAddressDriver,\n} from './cart-address-service.interface';\nexport {\n DaffCartCouponServiceInterface,\n DaffCartCouponDriver,\n} from './cart-coupon-service.interface';\nexport {\n DaffCartItemServiceInterface,\n DaffCartItemDriver,\n} from './cart-item-service.interface';\nexport {\n DaffCartPaymentMethodsServiceInterface,\n DaffCartPaymentMethodsDriver,\n} from './cart-payment-methods-service.interface';\nexport {\n DaffCartPaymentServiceInterface,\n DaffCartPaymentDriver,\n} from './cart-payment-service.interface';\nexport {\n DaffCartShippingAddressServiceInterface,\n DaffCartShippingAddressDriver,\n} from './cart-shipping-address-service.interface';\nexport {\n DaffCartShippingInformationServiceInterface,\n DaffCartShippingInformationDriver,\n} from './cart-shipping-information-service.interface';\nexport {\n DaffCartShippingMethodsServiceInterface,\n DaffCartShippingMethodsDriver,\n} from './cart-shipping-methods-service.interface';\nexport {\n DaffCartOrderServiceInterface,\n DaffCartOrderDriver,\n} from './cart-order-service.interface';\n","export enum DaffCartDriverErrorCodes {\n CART_NOT_FOUND = 'DAFF_CART_NOT_FOUND',\n PRODUCT_NOT_FOUND = 'DAFF_PRODUCT_NOT_FOUND',\n PRODUCT_OUT_OF_STOCK = 'DAFF_PRODUCT_OUT_OF_STOCK',\n INVALID_COUPON_CODE = 'DAFF_INVALID_COUPON_CODE',\n INVALID_COUNTRY = 'DAFF_INVALID_COUNTRY',\n INVALID_EMAIL = 'DAFF_INVALID_EMAIL',\n INVALID_REGION = 'DAFF_INVALID_REGION',\n INVALID_API_RESPONSE = 'DAFF_INVALID_API_RESPONSE',\n EXPIRED_PAYMENT_METHOD = 'DAFF_EXPIRED_PAYMENT_METHOD',\n ITEM_EXCEEDS_MAX_QTY = 'ITEM_EXCEEDS_MAX_QTY'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart driver call is sent with a cart identifier\n * that cannot be found by the platform.\n */\nexport class DaffCartNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.CART_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the payment token used for the payment method update has expired.\n * This happens when the a place order request happens too long after payment update.\n * The payment must be updated again before an order can be placed.\n */\nexport class DaffCartExpiredPaymentTokenError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.EXPIRED_PAYMENT_METHOD;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the platform's API response is missing required information\n * or malformed in an unrecoverable way.\n */\nexport class DaffCartInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_API_RESPONSE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified country is invalid for the specified address\n * or missing where it is required.\n */\nexport class DaffInvalidCountryError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_COUNTRY;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { DaffCartCoupon } from '@daffodil/cart';\nimport {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified coupon code cannot be applied to the cart.\n * Either the coupon code does not exist or the required conditions are not met.\n */\nexport class DaffInvalidCouponCodeError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_COUPON_CODE;\n\n constructor(message?: string, public coupon?: DaffCartCoupon['code']) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the email is not in the correct format.\n */\nexport class DaffInvalidEmailError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_EMAIL;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified region is invalid for the specified address\n * or missing where it is required.\n */\nexport class DaffInvalidRegionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_REGION;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart item's requested quantity\n * exceeds the maximum allowed by the platform.\n */\nexport class DaffCartItemExceedsMaxQtyError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an add to cart request is sent\n * for a product that cannot be found.\n */\nexport class DaffProductNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart item's requested quantity\n * exceeds the amount currently in stock.\n */\nexport class DaffProductOutOfStockError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { DaffCartNotFoundError } from './cart-not-found';\nimport { DaffCartDriverErrorCodes } from './codes.enum';\nimport { DaffCartExpiredPaymentTokenError } from './expired-payment-token';\nimport { DaffCartInvalidAPIResponseError } from './invalid-api-response';\nimport { DaffInvalidCountryError } from './invalid-country';\nimport { DaffInvalidCouponCodeError } from './invalid-coupon-code';\nimport { DaffInvalidEmailError } from './invalid-email';\nimport { DaffInvalidRegionError } from './invalid-region';\nimport { DaffCartItemExceedsMaxQtyError } from './item-exceeds-max-qty';\nimport { DaffProductNotFoundError } from './product-not-found';\nimport { DaffProductOutOfStockError } from './product-out-of-stock';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCartDriverErrorMap = {\n [DaffCartDriverErrorCodes.CART_NOT_FOUND]: DaffCartNotFoundError,\n [DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND]: DaffProductNotFoundError,\n [DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK]: DaffProductOutOfStockError,\n [DaffCartDriverErrorCodes.INVALID_COUPON_CODE]: DaffInvalidCouponCodeError,\n [DaffCartDriverErrorCodes.INVALID_COUNTRY]: DaffInvalidCountryError,\n [DaffCartDriverErrorCodes.INVALID_EMAIL]: DaffInvalidEmailError,\n [DaffCartDriverErrorCodes.INVALID_REGION]: DaffInvalidRegionError,\n [DaffCartDriverErrorCodes.INVALID_API_RESPONSE]: DaffCartInvalidAPIResponseError,\n [DaffCartDriverErrorCodes.EXPIRED_PAYMENT_METHOD]: DaffCartExpiredPaymentTokenError,\n [DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY]: DaffCartItemExceedsMaxQtyError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkCa,cAAc,GAAG,IAAI,cAAc,CAC9C,gBAAgB;;MCTL,4BAA4B,GAAG,IAAI,cAAc,CAE5D,8BAA8B;;MCPnB,qBAAqB,GAAG,IAAI,cAAc,CAErD,uBAAuB;;MCUZ,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCaX,kBAAkB,GAAG,IAAI,cAAc,CAElD,oBAAoB;;MC/BT,4BAA4B,GAAG,IAAI,cAAc,CAE5D,8BAA8B;;MCkBnB,qBAAqB,GAAG,IAAI,cAAc,CAErD,uBAAuB;;MCdZ,6BAA6B,GAAG,IAAI,cAAc,CAE7D,+BAA+B;;MCIpB,iCAAiC,GAAG,IAAI,cAAc,CAEjE,mCAAmC;;MCdxB,6BAA6B,GAAG,IAAI,cAAc,CAE7D,+BAA+B;;MCCpB,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;;ACxBvB;;ACAY,IAAA,yBAWX;AAXD,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,gBAAA,CAAA,GAAA,qBAAsC,CAAA;AACtC,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,wBAA4C,CAAA;AAC5C,IAAA,wBAAA,CAAA,sBAAA,CAAA,GAAA,2BAAkD,CAAA;AAClD,IAAA,wBAAA,CAAA,qBAAA,CAAA,GAAA,0BAAgD,CAAA;AAChD,IAAA,wBAAA,CAAA,iBAAA,CAAA,GAA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lE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;AAHA,QAAA,IAAA,CAAA,IAAI,GAAW,wBAAwB,CAAC,oBAAoB,CAAC;KAI5E;AACF;;ACLD;;AAEG;AACU,MAAA,sBAAsB,GAAG;AACpC,IAAA,CAAC,wBAAwB,CAAC,cAAc,GAAG,qBAAqB;AAChE,IAAA,CAAC,wBAAwB,CAAC,iBAAiB,GAAG,wBAAwB;AACtE,IAAA,CAAC,wBAAwB,CAAC,oBAAoB,GAAG,0BAA0B;AAC3E,IAAA,CAAC,wBAAwB,CAAC,mBAAmB,GAAG,0BAA0B;AAC1E,IAAA,CAAC,wBAAwB,CAAC,eAAe,GAAG,uBAAuB;AACnE,IAAA,CAAC,wBAAwB,CAAC,aAAa,GAAG,qBAAqB;AAC/D,IAAA,CAAC,wBAAwB,CAAC,cAAc,GAAG,sBAAsB;AACjE,IAAA,CAAC,wBAAwB,CAAC,oBAAoB,GAAG,+BAA+B;AAChF,IAAA,CAAC,wBAAwB,CAAC,sBAAsB,GAAG,gCAAgC;AACnF,IAAA,CAAC,wBAAwB,CAAC,oBAAoB,GAAG,8BAA8B;;;ACzBjF;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-cart-driver.mjs","sources":["../../../libs/cart/driver/src/interfaces/cart-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-billing-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-coupon-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-item-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-payment-methods-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-payment-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-address-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-information-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-shipping-methods-service.interface.ts","../../../libs/cart/driver/src/interfaces/cart-order-service.interface.ts","../../../libs/cart/driver/src/interfaces/public_api.ts","../../../libs/cart/driver/src/errors/codes.enum.ts","../../../libs/cart/driver/src/errors/cart-not-found.ts","../../../libs/cart/driver/src/errors/expired-payment-token.ts","../../../libs/cart/driver/src/errors/invalid-api-response.ts","../../../libs/cart/driver/src/errors/invalid-country.ts","../../../libs/cart/driver/src/errors/invalid-coupon-code.ts","../../../libs/cart/driver/src/errors/invalid-email.ts","../../../libs/cart/driver/src/errors/invalid-region.ts","../../../libs/cart/driver/src/errors/item-exceeds-max-qty.ts","../../../libs/cart/driver/src/errors/product-not-found.ts","../../../libs/cart/driver/src/errors/product-out-of-stock.ts","../../../libs/cart/driver/src/errors/map.ts","../../../libs/cart/driver/src/daffodil-cart-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffDriverResponse } from '@daffodil/driver';\n\n/**\n * The interface responsible for managing a customer's cart.\n */\nexport interface DaffCartServiceInterface<T extends DaffCart = DaffCart> {\n /**\n * Retrieve a cart\n */\n get(id: T['id']): Observable<DaffDriverResponse<T>>;\n\n /**\n * Creates a cart.\n */\n create(): Observable<{id: T['id']}>;\n\n /**\n * @deprecated\n * Prefer DaffCartItemServiceInterface.add\n *\n * Add an item to the cart.\n */\n addToCart(productId: string, qty: number): Observable<T>;\n\n /**\n * Remove all items from a cart.\n */\n clear(id: T['id']): Observable<Partial<T>>;\n}\n\nexport const DaffCartDriver = new InjectionToken<DaffCartServiceInterface>(\n 'DaffCartDriver',\n);\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the billing address of a cart.\n */\nexport interface DaffCartBillingAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Retrieve the billing address of a cart\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the billing address of a cart\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartBillingAddressDriver = new InjectionToken<\nDaffCartBillingAddressServiceInterface\n>('DaffCartBillingAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the address of a cart.\n */\nexport interface DaffCartAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Update the billing and shipping address of a cart\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartAddressDriver = new InjectionToken<\nDaffCartAddressServiceInterface\n>('DaffCartAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCart,\n DaffCartCoupon,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for applying a coupon to a cart.\n */\nexport interface DaffCartCouponServiceInterface<T extends DaffCart = DaffCart, V extends DaffCartCoupon = DaffCartCoupon> {\n /**\n * Apply a coupon to the cart and return a partial of the cart.\n */\n apply(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n /**\n * List coupon codes applied to a cart.\n */\n list(cartId: T['id']): Observable<V[]>;\n\n /**\n * Remove a coupon from the cart and return a partial of the cart.\n */\n remove(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n /**\n * Remove all coupons from the cart and return a partial of the cart.\n */\n removeAll(cartId: T['id']): Observable<Partial<T>>;\n}\n\nexport const DaffCartCouponDriver = new InjectionToken<DaffCartCouponServiceInterface>(\n 'DaffCartCouponDriver',\n);\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartItem,\n DaffCartItemInput,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the items of a cart.\n */\nexport interface DaffCartItemServiceInterface<\n T extends DaffCartItem = DaffCartItem,\n U extends DaffCartItemInput = DaffCartItemInput,\n V extends DaffCart = DaffCart\n> {\n /**\n * List all of the available items of a cart\n */\n list(cartId: V['id']): Observable<T[]>;\n\n /**\n * Get a specific cart item of a cart.\n */\n get(cartId: V['id'], item_id: DaffCartItem['id']): Observable<T>;\n\n /**\n * Add something to a cart.\n */\n add(id: V['id'], product: U): Observable<Partial<V>>;\n\n /**\n * Update an existing item in a cart\n */\n update(\n cartId: V['id'],\n itemId: T['id'],\n changes: Partial<T>,\n ): Observable<Partial<V>>;\n\n /**\n * Remove an item from a cart.\n */\n delete(cartId: V['id'], itemId: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartItemDriver = new InjectionToken<\nDaffCartItemServiceInterface\n>('DaffCartItemDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartPaymentMethod,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for retrieving the available payment methods of a cart.\n */\nexport interface DaffCartPaymentMethodsServiceInterface<T extends DaffCartPaymentMethod = DaffCartPaymentMethod> {\n /**\n * List the available payment methods of a cart.\n */\n list(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartPaymentMethodsDriver = new InjectionToken<\nDaffCartPaymentMethodsServiceInterface\n>('DaffCartPaymentMethodsDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartPaymentMethod,\n DaffCart,\n DaffCartAddress,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the selected payment method of a cart.\n */\nexport interface DaffCartPaymentServiceInterface<\n T extends DaffCartPaymentMethod = DaffCartPaymentMethod,\n V extends DaffCart = DaffCart,\n R extends DaffCartAddress = DaffCartAddress\n> {\n /**\n * Get the currently applied payment method of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the payment method applied to a cart.\n */\n update(cartId: V['id'], payment: Partial<T>): Observable<Partial<V>>;\n\n /**\n * Update the billing address and payment method applied to a cart.\n */\n updateWithBilling(cartId: V['id'], payment: Partial<T>, address: Partial<R>): Observable<Partial<V>>;\n\n /**\n * Remove the payment method applied to a cart.\n */\n remove(cartId: V['id']): Observable<void>;\n}\n\nexport const DaffCartPaymentDriver = new InjectionToken<\nDaffCartPaymentServiceInterface\n>('DaffCartPaymentDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartAddress,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for managing the shipping address of a cart.\n */\nexport interface DaffCartShippingAddressServiceInterface<\n T extends DaffCartAddress = DaffCartAddress,\n V extends DaffCart = DaffCart\n> {\n /**\n * Retrieve the shipping address of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the shipping address of a cart.\n */\n update(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingAddressDriver = new InjectionToken<\nDaffCartShippingAddressServiceInterface\n>('DaffCartShippingAddressDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartShippingRate,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for mediating the interaction of the shipping\n * information of a cart with a given platform.\n */\nexport interface DaffCartShippingInformationServiceInterface<\n T extends DaffCartShippingRate = DaffCartShippingRate,\n V extends DaffCart = DaffCart\n>{\n /**\n * Get the currently selected shipping method of a cart.\n */\n get(cartId: V['id']): Observable<T>;\n\n /**\n * Update the currently selected shipping method of a cart.\n */\n update(cartId: V['id'], shippingInfo: Partial<T>): Observable<Partial<V>>;\n\n /**\n * Remove the currently selected shipping method from a cart.\n */\n delete(cartId: V['id'], id?: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingInformationDriver = new InjectionToken<\nDaffCartShippingInformationServiceInterface\n>('DaffCartShippingInformationDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCartShippingRate,\n DaffCart,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for retrieving the available shipping methods of a cart.\n */\nexport interface DaffCartShippingMethodsServiceInterface<\n T extends DaffCartShippingRate = DaffCartShippingRate\n> {\n /**\n * List the available shipping methods for a cart.\n */\n list(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartShippingMethodsDriver = new InjectionToken<\nDaffCartShippingMethodsServiceInterface\n>('DaffCartShippingMethodsDriver');\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCart,\n DaffCartPaymentMethod,\n DaffCartOrderResult,\n} from '@daffodil/cart';\n\n/**\n * The interface responsible for placing an order for the customer's cart.\n */\nexport interface DaffCartOrderServiceInterface<\n T extends DaffCart = DaffCart,\n V extends DaffCartPaymentMethod = DaffCartPaymentMethod,\n R extends DaffCartOrderResult = DaffCartOrderResult\n> {\n /**\n * Place an order and return the order ID.\n */\n placeOrder(id: T['id'], payment?: V): Observable<R>;\n}\n\nexport const DaffCartOrderDriver = new InjectionToken<DaffCartOrderServiceInterface>(\n 'DaffCartOrderDriver',\n);\n","// Drivers\nexport {\n DaffCartServiceInterface,\n DaffCartDriver,\n} from './cart-service.interface';\nexport {\n DaffCartBillingAddressServiceInterface,\n DaffCartBillingAddressDriver,\n} from './cart-billing-address-service.interface';\nexport {\n DaffCartAddressServiceInterface,\n DaffCartAddressDriver,\n} from './cart-address-service.interface';\nexport {\n DaffCartCouponServiceInterface,\n DaffCartCouponDriver,\n} from './cart-coupon-service.interface';\nexport {\n DaffCartItemServiceInterface,\n DaffCartItemDriver,\n} from './cart-item-service.interface';\nexport {\n DaffCartPaymentMethodsServiceInterface,\n DaffCartPaymentMethodsDriver,\n} from './cart-payment-methods-service.interface';\nexport {\n DaffCartPaymentServiceInterface,\n DaffCartPaymentDriver,\n} from './cart-payment-service.interface';\nexport {\n DaffCartShippingAddressServiceInterface,\n DaffCartShippingAddressDriver,\n} from './cart-shipping-address-service.interface';\nexport {\n DaffCartShippingInformationServiceInterface,\n DaffCartShippingInformationDriver,\n} from './cart-shipping-information-service.interface';\nexport {\n DaffCartShippingMethodsServiceInterface,\n DaffCartShippingMethodsDriver,\n} from './cart-shipping-methods-service.interface';\nexport {\n DaffCartOrderServiceInterface,\n DaffCartOrderDriver,\n} from './cart-order-service.interface';\n","export enum DaffCartDriverErrorCodes {\n CART_NOT_FOUND = 'DAFF_CART_NOT_FOUND',\n PRODUCT_NOT_FOUND = 'DAFF_PRODUCT_NOT_FOUND',\n PRODUCT_OUT_OF_STOCK = 'DAFF_PRODUCT_OUT_OF_STOCK',\n INVALID_COUPON_CODE = 'DAFF_INVALID_COUPON_CODE',\n INVALID_COUNTRY = 'DAFF_INVALID_COUNTRY',\n INVALID_EMAIL = 'DAFF_INVALID_EMAIL',\n INVALID_REGION = 'DAFF_INVALID_REGION',\n INVALID_API_RESPONSE = 'DAFF_INVALID_API_RESPONSE',\n EXPIRED_PAYMENT_METHOD = 'DAFF_EXPIRED_PAYMENT_METHOD',\n ITEM_EXCEEDS_MAX_QTY = 'ITEM_EXCEEDS_MAX_QTY'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart driver call is sent with a cart identifier\n * that cannot be found by the platform.\n */\nexport class DaffCartNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.CART_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the payment token used for the payment method update has expired.\n * This happens when the a place order request happens too long after payment update.\n * The payment must be updated again before an order can be placed.\n */\nexport class DaffCartExpiredPaymentTokenError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.EXPIRED_PAYMENT_METHOD;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the platform's API response is missing required information\n * or malformed in an unrecoverable way.\n */\nexport class DaffCartInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_API_RESPONSE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified country is invalid for the specified address\n * or missing where it is required.\n */\nexport class DaffInvalidCountryError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_COUNTRY;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { DaffCartCoupon } from '@daffodil/cart';\nimport {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified coupon code cannot be applied to the cart.\n * Either the coupon code does not exist or the required conditions are not met.\n */\nexport class DaffInvalidCouponCodeError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_COUPON_CODE;\n\n constructor(message?: string, public coupon?: DaffCartCoupon['code']) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the email is not in the correct format.\n */\nexport class DaffInvalidEmailError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_EMAIL;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the specified region is invalid for the specified address\n * or missing where it is required.\n */\nexport class DaffInvalidRegionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.INVALID_REGION;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart item's requested quantity\n * exceeds the maximum allowed by the platform.\n */\nexport class DaffCartItemExceedsMaxQtyError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an add to cart request is sent\n * for a product that cannot be found.\n *\n * @deprecated Use the `DaffProductNotFoundError` from `@daffodil/product/driver` instead.\n */\nexport class DaffProductNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffCartDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when a cart item's requested quantity\n * exceeds the amount currently in stock.\n */\nexport class DaffProductOutOfStockError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { DaffCartNotFoundError } from './cart-not-found';\nimport { DaffCartDriverErrorCodes } from './codes.enum';\nimport { DaffCartExpiredPaymentTokenError } from './expired-payment-token';\nimport { DaffCartInvalidAPIResponseError } from './invalid-api-response';\nimport { DaffInvalidCountryError } from './invalid-country';\nimport { DaffInvalidCouponCodeError } from './invalid-coupon-code';\nimport { DaffInvalidEmailError } from './invalid-email';\nimport { DaffInvalidRegionError } from './invalid-region';\nimport { DaffCartItemExceedsMaxQtyError } from './item-exceeds-max-qty';\nimport { DaffProductNotFoundError } from './product-not-found';\nimport { DaffProductOutOfStockError } from './product-out-of-stock';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCartDriverErrorMap = {\n [DaffCartDriverErrorCodes.CART_NOT_FOUND]: DaffCartNotFoundError,\n [DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND]: DaffProductNotFoundError,\n [DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK]: DaffProductOutOfStockError,\n [DaffCartDriverErrorCodes.INVALID_COUPON_CODE]: DaffInvalidCouponCodeError,\n [DaffCartDriverErrorCodes.INVALID_COUNTRY]: DaffInvalidCountryError,\n [DaffCartDriverErrorCodes.INVALID_EMAIL]: DaffInvalidEmailError,\n [DaffCartDriverErrorCodes.INVALID_REGION]: DaffInvalidRegionError,\n [DaffCartDriverErrorCodes.INVALID_API_RESPONSE]: DaffCartInvalidAPIResponseError,\n [DaffCartDriverErrorCodes.EXPIRED_PAYMENT_METHOD]: DaffCartExpiredPaymentTokenError,\n [DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY]: DaffCartItemExceedsMaxQtyError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkCa,cAAc,GAAG,IAAI,cAAc,CAC9C,gBAAgB;;MCTL,4BAA4B,GAAG,IAAI,cAAc,CAE5D,8BAA8B;;MCPnB,qBAAqB,GAAG,IAAI,cAAc,CAErD,uBAAuB;;MCUZ,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCaX,kBAAkB,GAAG,IAAI,cAAc,CAElD,oBAAoB;;MC/BT,4BAA4B,GAAG,IAAI,cAAc,CAE5D,8BAA8B;;MCkBnB,qBAAqB,GAAG,IAAI,cAAc,CAErD,uBAAuB;;MCdZ,6BAA6B,GAAG,IAAI,cAAc,CAE7D,+BAA+B;;MCIpB,iCAAiC,GAAG,IAAI,cAAc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+508,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
508
508
 
509
509
  class DaffMagentoCartAddressInputTransformer {
510
510
  transform(cartAddress) {
511
+ const street = [cartAddress.street];
512
+ if (cartAddress.street2) {
513
+ street.push(cartAddress.street2);
514
+ }
511
515
  return {
512
516
  city: cartAddress.city,
513
517
  country_code: cartAddress.country,
@@ -516,7 +520,7 @@ class DaffMagentoCartAddressInputTransformer {
516
520
  postcode: cartAddress.postcode,
517
521
  region: cartAddress.region,
518
522
  save_in_address_book: false,
519
- street: [cartAddress.street],
523
+ street,
520
524
  telephone: cartAddress.telephone,
521
525
  };
522
526
  }
@@ -1440,6 +1444,7 @@ class DaffMagentoCartService {
1440
1444
  }
1441
1445
  get(cartId) {
1442
1446
  return this.apollo.query({
1447
+ fetchPolicy: 'network-only',
1443
1448
  query: getCart(this.extraCartFragments),
1444
1449
  variables: { cartId },
1445
1450
  errorPolicy: 'all',
@@ -1520,6 +1525,7 @@ class DaffMagentoCartItemService {
1520
1525
  return this.apollo.query({
1521
1526
  query: listCartItems(this.extraCartFragments),
1522
1527
  variables: { cartId },
1528
+ fetchPolicy: 'network-only',
1523
1529
  }).pipe(map(result => result.data.cart.items.filter(item => !!item)), map(items => items.map(item => transformMagentoCartItem(daffTransformMagentoCartItem(item), item, this.cartItemTransforms))));
1524
1530
  }
1525
1531
  get(cartId, itemId) {
@@ -1545,6 +1551,7 @@ class DaffMagentoCartItemService {
1545
1551
  id: itemId,
1546
1552
  }),
1547
1553
  },
1554
+ fetchPolicy: 'network-only',
1548
1555
  }).pipe(map(result => this.cartTransformer.transform(result.data.updateCartItems.cart)), catchError(err => throwError(() => transformCartMagentoError(err))));
1549
1556
  }
1550
1557
  delete(cartId, itemId) {
@@ -1554,6 +1561,7 @@ class DaffMagentoCartItemService {
1554
1561
  cartId,
1555
1562
  itemId,
1556
1563
  },
1564
+ fetchPolicy: 'network-only',
1557
1565
  }).pipe(map(result => this.cartTransformer.transform(result.data.removeItemFromCart.cart)));
1558
1566
  }
1559
1567
  addBundledProduct(cartId, cartItemInput) {
@@ -1572,6 +1580,7 @@ class DaffMagentoCartItemService {
1572
1580
  cartId,
1573
1581
  input,
1574
1582
  },
1583
+ fetchPolicy: 'network-only',
1575
1584
  }).pipe(map(result => this.cartTransformer.transform(result.data.addProductsToCart.cart)));
1576
1585
  }
1577
1586
  }
@@ -1612,6 +1621,7 @@ class DaffMagentoCartPaymentService {
1612
1621
  return this.apollo.query({
1613
1622
  query: getSelectedPaymentMethod(this.extraCartFragments),
1614
1623
  variables: { cartId },
1624
+ fetchPolicy: 'network-only',
1615
1625
  }).pipe(map(result => this.paymentTransformer.transform(result.data.cart.selected_payment_method)));
1616
1626
  }
1617
1627
  update(cartId, payment) {
@@ -1621,6 +1631,7 @@ class DaffMagentoCartPaymentService {
1621
1631
  cartId,
1622
1632
  payment: this.paymentInputTransformer.transform(payment),
1623
1633
  },
1634
+ fetchPolicy: 'network-only',
1624
1635
  }).pipe(map(result => this.cartTransformer.transform(result.data.setPaymentMethodOnCart.cart)));
1625
1636
  }
1626
1637
  updateWithBilling(cartId, payment, address) {
@@ -1635,6 +1646,7 @@ class DaffMagentoCartPaymentService {
1635
1646
  cartId,
1636
1647
  payment: { code: '' },
1637
1648
  },
1649
+ fetchPolicy: 'network-only',
1638
1650
  }).pipe(mapTo(undefined));
1639
1651
  }
1640
1652
  updateWithBillingAddress(cartId, payment, address) {
@@ -1645,6 +1657,7 @@ class DaffMagentoCartPaymentService {
1645
1657
  payment: this.paymentInputTransformer.transform(payment),
1646
1658
  address: this.cartAddressInputTransformer.transform(address),
1647
1659
  },
1660
+ fetchPolicy: 'network-only',
1648
1661
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setPaymentMethodOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1649
1662
  }
1650
1663
  updateWithBillingAddressAndEmail(cartId, payment, address) {
@@ -1656,6 +1669,7 @@ class DaffMagentoCartPaymentService {
1656
1669
  payment: this.paymentInputTransformer.transform(payment),
1657
1670
  address: this.cartAddressInputTransformer.transform(address),
1658
1671
  },
1672
+ fetchPolicy: 'network-only',
1659
1673
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1660
1674
  }
1661
1675
  }
@@ -1689,6 +1703,7 @@ class DaffMagentoCartPaymentMethodsService {
1689
1703
  return this.apollo.query({
1690
1704
  query: listPaymentMethods(this.extraCartFragments),
1691
1705
  variables: { cartId },
1706
+ fetchPolicy: 'network-only',
1692
1707
  }).pipe(map(result => result.data.cart.available_payment_methods.map(item => this.paymentTransformer.transform(item))));
1693
1708
  }
1694
1709
  }
@@ -1722,6 +1737,7 @@ class DaffMagentoCartBillingAddressService {
1722
1737
  return this.apollo.query({
1723
1738
  query: getBillingAddress(this.extraCartFragments),
1724
1739
  variables: { cartId },
1740
+ fetchPolicy: 'network-only',
1725
1741
  }).pipe(map(result => result.data.cart.billing_address
1726
1742
  ? this.billingAddressTransformer.transform({
1727
1743
  ...result.data.cart.billing_address,
@@ -1739,6 +1755,7 @@ class DaffMagentoCartBillingAddressService {
1739
1755
  cartId,
1740
1756
  address: this.billingAddressInputTransformer.transform(address),
1741
1757
  },
1758
+ fetchPolicy: 'network-only',
1742
1759
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setBillingAddressOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1743
1760
  }
1744
1761
  updateAddressWithEmail(cartId, address) {
@@ -1749,6 +1766,7 @@ class DaffMagentoCartBillingAddressService {
1749
1766
  email: address.email,
1750
1767
  address: this.billingAddressInputTransformer.transform(address),
1751
1768
  },
1769
+ fetchPolicy: 'network-only',
1752
1770
  }).pipe(map(resp => this.cartTransformer.transform({
1753
1771
  ...resp.data.setBillingAddressOnCart.cart,
1754
1772
  email: resp.data.setGuestEmailOnCart.cart.email,
@@ -1788,6 +1806,7 @@ class DaffMagentoCartShippingAddressService {
1788
1806
  return this.apollo.query({
1789
1807
  query: getShippingAddress(this.extraCartFragments),
1790
1808
  variables: { cartId },
1809
+ fetchPolicy: 'network-only',
1791
1810
  }).pipe(map(result => result.data.cart.shipping_addresses[0]
1792
1811
  ? this.shippingAddressTransformer.transform({
1793
1812
  ...result.data.cart.shipping_addresses[0],
@@ -1805,6 +1824,7 @@ class DaffMagentoCartShippingAddressService {
1805
1824
  cartId,
1806
1825
  address: this.shippingAddressInputTransformer.transform(address),
1807
1826
  },
1827
+ fetchPolicy: 'network-only',
1808
1828
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1809
1829
  }
1810
1830
  updateAddressWithEmail(cartId, address) {
@@ -1815,6 +1835,7 @@ class DaffMagentoCartShippingAddressService {
1815
1835
  email: address.email,
1816
1836
  address: this.shippingAddressInputTransformer.transform(address),
1817
1837
  },
1838
+ fetchPolicy: 'network-only',
1818
1839
  }).pipe(map(resp => this.cartTransformer.transform({
1819
1840
  ...resp.data.setShippingAddressesOnCart.cart,
1820
1841
  email: resp.data.setGuestEmailOnCart.cart.email,
@@ -1851,6 +1872,7 @@ class DaffMagentoCartShippingMethodsService {
1851
1872
  return this.apollo.query({
1852
1873
  query: listShippingMethods(this.extraCartFragments),
1853
1874
  variables: { cartId },
1875
+ fetchPolicy: 'network-only',
1854
1876
  }).pipe(map(result => result.data.cart.shipping_addresses[0].available_shipping_methods.map(item => this.shippingRateTransformer.transform(item))));
1855
1877
  }
1856
1878
  }
@@ -1884,6 +1906,7 @@ class DaffMagentoCartShippingInformationService {
1884
1906
  return this.apollo.query({
1885
1907
  query: getSelectedShippingMethod(this.extraCartFragments),
1886
1908
  variables: { cartId },
1909
+ fetchPolicy: 'network-only',
1887
1910
  }).pipe(map(result => result.data.cart.shipping_addresses[0]
1888
1911
  ? this.shippingRateTransformer.transform(result.data.cart.shipping_addresses[0].selected_shipping_method)
1889
1912
  : null));
@@ -1895,6 +1918,7 @@ class DaffMagentoCartShippingInformationService {
1895
1918
  cartId,
1896
1919
  method: this.shippingMethodInputTransformer.transform(shippingInfo),
1897
1920
  },
1921
+ fetchPolicy: 'network-only',
1898
1922
  }).pipe(switchMap(result =>
1899
1923
  // because Magento only returns the selected shipping method for the mutation
1900
1924
  // we have to manually refetch the available shipping methods
@@ -1958,6 +1982,7 @@ class DaffMagentoCartAddressService {
1958
1982
  cartId,
1959
1983
  address: this.cartAddressInputTransformer.transform(address),
1960
1984
  },
1985
+ fetchPolicy: 'network-only',
1961
1986
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setShippingAddressesOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1962
1987
  }
1963
1988
  updateAddressWithEmail(cartId, address) {
@@ -1968,6 +1993,7 @@ class DaffMagentoCartAddressService {
1968
1993
  email: address.email,
1969
1994
  address: this.cartAddressInputTransformer.transform(address),
1970
1995
  },
1996
+ fetchPolicy: 'network-only',
1971
1997
  }).pipe(map(resp => this.cartTransformer.transform(resp.data.setGuestEmailOnCart.cart)), catchError(error => throwError(() => transformCartMagentoError(error))));
1972
1998
  }
1973
1999
  }
@@ -2057,6 +2083,7 @@ class DaffMagentoCartCouponService {
2057
2083
  cartId,
2058
2084
  couponCode: coupon.code,
2059
2085
  },
2086
+ fetchPolicy: 'network-only',
2060
2087
  }).pipe(map(result => this.cartTransformer.transform(result.data.applyCouponToCart.cart)), catchError(err => throwError(() => transformCartMagentoError(err, coupon))));
2061
2088
  }
2062
2089
  list(cartId) {
@@ -2065,6 +2092,7 @@ class DaffMagentoCartCouponService {
2065
2092
  variables: {
2066
2093
  cartId,
2067
2094
  },
2095
+ fetchPolicy: 'network-only',
2068
2096
  }).pipe(map(result => result.data.cart.applied_coupons.map(daffMagentoCouponTransform)), catchError(err => throwError(() => transformCartMagentoError(err))));
2069
2097
  }
2070
2098
  remove(cartId, coupon) {
@@ -2076,6 +2104,7 @@ class DaffMagentoCartCouponService {
2076
2104
  variables: {
2077
2105
  cartId,
2078
2106
  },
2107
+ fetchPolicy: 'network-only',
2079
2108
  }).pipe(map(result => this.cartTransformer.transform(result.data.removeCouponFromCart.cart)), catchError(err => throwError(() => transformCartMagentoError(err))));
2080
2109
  }
2081
2110
  }
@@ -2109,6 +2138,7 @@ class DaffMagentoCartOrderService {
2109
2138
  variables: {
2110
2139
  cartId,
2111
2140
  },
2141
+ fetchPolicy: 'network-only',
2112
2142
  }).pipe(map(result => ({
2113
2143
  id: result.data.placeOrder.order.order_number,
2114
2144
  orderId: result.data.placeOrder.order.order_number,