@daffodil/cart 0.39.11 → 0.39.12
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.
- package/bundles/daffodil-cart-driver-in-memory.umd.js +4 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-in-memory.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.js +33 -5
- package/bundles/daffodil-cart-driver-magento.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-magento.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.js +4 -1
- package/bundles/daffodil-cart-driver-testing.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.min.js +1 -1
- package/bundles/daffodil-cart-driver-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-driver.umd.js.map +1 -1
- package/bundles/daffodil-cart-driver.umd.min.js.map +1 -1
- package/bundles/daffodil-cart-state.umd.js +147 -25
- package/bundles/daffodil-cart-state.umd.js.map +1 -1
- package/bundles/daffodil-cart-state.umd.min.js +1 -1
- package/bundles/daffodil-cart-state.umd.min.js.map +1 -1
- package/driver/daffodil-cart-driver.metadata.json +1 -1
- package/driver/in-memory/daffodil-cart-driver-in-memory.metadata.json +1 -1
- package/driver/in-memory/drivers/cart/cart.service.d.ts +3 -2
- package/driver/interfaces/cart-service.interface.d.ts +2 -1
- package/driver/magento/cart.service.d.ts +2 -1
- package/driver/magento/daffodil-cart-driver-magento.metadata.json +1 -1
- package/driver/magento/errors/transform.d.ts +13 -1
- package/driver/testing/daffodil-cart-driver-testing.metadata.json +1 -1
- package/driver/testing/drivers/cart/cart.service.d.ts +2 -1
- package/esm2015/driver/in-memory/drivers/cart/cart.service.js +5 -2
- package/esm2015/driver/interfaces/cart-service.interface.js +1 -1
- package/esm2015/driver/magento/cart.service.js +20 -7
- package/esm2015/driver/magento/errors/transform.js +15 -6
- package/esm2015/driver/testing/drivers/cart/cart.service.js +5 -2
- package/esm2015/state/actions/cart-item.actions.js +30 -1
- package/esm2015/state/actions/cart.actions.js +29 -1
- package/esm2015/state/effects/cart-item.effects.js +17 -6
- package/esm2015/state/effects/cart-resolver.effects.js +23 -10
- package/esm2015/state/effects/cart.effects.js +13 -4
- package/esm2015/state/reducers/cart/cart.reducer.js +7 -3
- package/esm2015/state/reducers/cart-item/cart-item.reducer.js +11 -3
- package/esm2015/state/reducers/cart-item-entities/cart-item-entities.reducer.js +4 -1
- package/esm2015/state/reducers/errors/error-state-helpers.js +3 -3
- package/fesm2015/daffodil-cart-driver-in-memory.js +4 -1
- package/fesm2015/daffodil-cart-driver-in-memory.js.map +1 -1
- package/fesm2015/daffodil-cart-driver-magento.js +31 -9
- package/fesm2015/daffodil-cart-driver-magento.js.map +1 -1
- package/fesm2015/daffodil-cart-driver-testing.js +4 -1
- package/fesm2015/daffodil-cart-driver-testing.js.map +1 -1
- package/fesm2015/daffodil-cart-driver.js.map +1 -1
- package/fesm2015/daffodil-cart-state.js +126 -24
- package/fesm2015/daffodil-cart-state.js.map +1 -1
- package/package.json +5 -5
- package/state/actions/cart-item.actions.d.ts +26 -1
- package/state/actions/cart.actions.d.ts +31 -5
- package/state/daffodil-cart-state.metadata.json +1 -1
- package/state/effects/cart-item.effects.d.ts +5 -2
- package/state/effects/cart.effects.d.ts +2 -2
- package/state/reducers/errors/error-state-helpers.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../libs/cart/driver/src/errors/codes.enum.ts","../../../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","../../../node_modules/tslib/tslib.es6.js","../../../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"],"names":["DaffCartDriverErrorCodes","DaffCartDriver","InjectionToken","DaffCartBillingAddressDriver","DaffCartAddressDriver","DaffCartCouponDriver","DaffCartItemDriver","DaffCartPaymentMethodsDriver","DaffCartPaymentDriver","DaffCartShippingAddressDriver","DaffCartShippingInformationDriver","DaffCartShippingMethodsDriver","DaffCartOrderDriver","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","DaffCartNotFoundError","message","_this","_super","code","CART_NOT_FOUND","DaffInheritableError","DaffCartExpiredPaymentTokenError","EXPIRED_PAYMENT_METHOD","DaffCartInvalidAPIResponseError","INVALID_API_RESPONSE","DaffInvalidCountryError","INVALID_COUNTRY","DaffInvalidCouponCodeError","coupon","INVALID_COUPON_CODE","DaffInvalidEmailError","INVALID_EMAIL","DaffInvalidRegionError","INVALID_REGION","DaffCartItemExceedsMaxQtyError","ITEM_EXCEEDS_MAX_QTY","DaffProductNotFoundError","PRODUCT_NOT_FOUND","DaffProductOutOfStockError","PRODUCT_OUT_OF_STOCK","DaffCartDriverErrorMap","_a"],"mappings":"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","sourcesContent":["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 { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCart } from '@daffodil/cart';\n\n/**\n * The interface responsible for managing a customer's cart.\n */\nexport interface DaffCartServiceInterface<T extends DaffCart = DaffCart> {\n\t/**\n\t * Retrieve a cart\n\t */\n get(id: T['id']): Observable<T>;\n\n /**\n * Creates a cart.\n */\n create(): Observable<{id: T['id']}>;\n\n\t/**\n\t * @deprecated\n\t * Prefer DaffCartItemServiceInterface.add\n\t *\n\t * Add an item to the cart.\n\t */\n\taddToCart(productId: string, qty: number): Observable<T>;\n\n\t/**\n\t * Remove all items from a cart.\n\t */\n\tclear(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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Retrieve the billing address of a cart\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the billing address of a cart\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartBillingAddressDriver = new InjectionToken<\n\tDaffCartBillingAddressServiceInterface\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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Update the billing and shipping address of a cart\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartAddressDriver = new InjectionToken<\n\tDaffCartAddressServiceInterface\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\t/**\n\t * Apply a coupon to the cart and return a partial of the cart.\n\t */\n\tapply(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n\t/**\n\t * List coupon codes applied to a cart.\n\t */\n\tlist(cartId: T['id']): Observable<V[]>;\n\n\t/**\n\t * Remove a coupon from the cart and return a partial of the cart.\n\t */\n\tremove(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n\t/**\n\t * Remove all coupons from the cart and return a partial of the cart.\n\t */\n\tremoveAll(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\tT extends DaffCartItem = DaffCartItem,\n\tU extends DaffCartItemInput = DaffCartItemInput,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * List all of the available items of a cart\n\t */\n\tlist(cartId: V['id']): Observable<T[]>;\n\n\t/**\n\t * Get a specific cart item of a cart.\n\t */\n\tget(cartId: V['id'], item_id: DaffCartItem['id']): Observable<T>;\n\n\t/**\n\t * Add something to a cart.\n\t */\n\tadd(id: V['id'], product: U): Observable<Partial<V>>;\n\n\t/**\n\t * Update an existing item in a cart\n\t */\n\tupdate(\n\t\tcartId: V['id'],\n\t\titemId: T['id'],\n\t\tchanges: Partial<T>,\n\t): Observable<Partial<V>>;\n\n\t/**\n\t * Remove an item from a cart.\n\t */\n\tdelete(cartId: V['id'], itemId: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartItemDriver = new InjectionToken<\n\tDaffCartItemServiceInterface\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\t/**\n\t * List the available payment methods of a cart.\n\t */\n\tlist(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartPaymentMethodsDriver = new InjectionToken<\n\tDaffCartPaymentMethodsServiceInterface\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\t/**\n\t * Get the currently applied payment method of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the payment method applied to a cart.\n\t */\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\tupdateWithBilling(cartId: V['id'], payment: Partial<T>, address: Partial<R>): Observable<Partial<V>>;\n\n\t/**\n\t * Remove the payment method applied to a cart.\n\t */\n\tremove(cartId: V['id']): Observable<void>;\n}\n\nexport const DaffCartPaymentDriver = new InjectionToken<\n\tDaffCartPaymentServiceInterface\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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Retrieve the shipping address of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the shipping address of a cart.\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingAddressDriver = new InjectionToken<\n\tDaffCartShippingAddressServiceInterface\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\t/**\n\t * Get the currently selected shipping method of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the currently selected shipping method of a cart.\n\t */\n\tupdate(cartId: V['id'], shippingInfo: Partial<T>): Observable<Partial<V>>;\n\n\t/**\n\t * Remove the currently selected shipping method from a cart.\n\t */\n\tdelete(cartId: V['id'], id?: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingInformationDriver = new InjectionToken<\n\tDaffCartShippingInformationServiceInterface\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\tT extends DaffCartShippingRate = DaffCartShippingRate\n> {\n\t/**\n\t * List the available shipping methods for a cart.\n\t */\n\tlist(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartShippingMethodsDriver = new InjectionToken<\n\tDaffCartShippingMethodsServiceInterface\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\t/**\n\t * Place an order and return the order ID.\n\t */\n placeOrder(id: T['id'], payment?: V): Observable<R>;\n}\n\nexport const DaffCartOrderDriver = new InjectionToken<DaffCartOrderServiceInterface>(\n 'DaffCartOrderDriver',\n);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\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\tpublic readonly code: string = DaffCartDriverErrorCodes.CART_NOT_FOUND;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_COUNTRY;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_COUPON_CODE;\n\n\tconstructor(message?: string, public coupon?: DaffCartCoupon['code']) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_EMAIL;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_REGION;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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"]}
|
|
1
|
+
{"version":3,"sources":["../../../libs/cart/driver/src/errors/codes.enum.ts","../../../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","../../../node_modules/tslib/tslib.es6.js","../../../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"],"names":["DaffCartDriverErrorCodes","DaffCartDriver","InjectionToken","DaffCartBillingAddressDriver","DaffCartAddressDriver","DaffCartCouponDriver","DaffCartItemDriver","DaffCartPaymentMethodsDriver","DaffCartPaymentDriver","DaffCartShippingAddressDriver","DaffCartShippingInformationDriver","DaffCartShippingMethodsDriver","DaffCartOrderDriver","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","DaffCartNotFoundError","message","_this","_super","code","CART_NOT_FOUND","DaffInheritableError","DaffCartExpiredPaymentTokenError","EXPIRED_PAYMENT_METHOD","DaffCartInvalidAPIResponseError","INVALID_API_RESPONSE","DaffInvalidCountryError","INVALID_COUNTRY","DaffInvalidCouponCodeError","coupon","INVALID_COUPON_CODE","DaffInvalidEmailError","INVALID_EMAIL","DaffInvalidRegionError","INVALID_REGION","DaffCartItemExceedsMaxQtyError","ITEM_EXCEEDS_MAX_QTY","DaffProductNotFoundError","PRODUCT_NOT_FOUND","DaffProductOutOfStockError","PRODUCT_OUT_OF_STOCK","DaffCartDriverErrorMap","_a"],"mappings":"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","sourcesContent":["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 { 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\t/**\n\t * Retrieve a cart\n\t */\n get(id: T['id']): Observable<DaffDriverResponse<T>>;\n\n /**\n * Creates a cart.\n */\n create(): Observable<{id: T['id']}>;\n\n\t/**\n\t * @deprecated\n\t * Prefer DaffCartItemServiceInterface.add\n\t *\n\t * Add an item to the cart.\n\t */\n\taddToCart(productId: string, qty: number): Observable<T>;\n\n\t/**\n\t * Remove all items from a cart.\n\t */\n\tclear(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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Retrieve the billing address of a cart\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the billing address of a cart\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartBillingAddressDriver = new InjectionToken<\n\tDaffCartBillingAddressServiceInterface\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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Update the billing and shipping address of a cart\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartAddressDriver = new InjectionToken<\n\tDaffCartAddressServiceInterface\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\t/**\n\t * Apply a coupon to the cart and return a partial of the cart.\n\t */\n\tapply(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n\t/**\n\t * List coupon codes applied to a cart.\n\t */\n\tlist(cartId: T['id']): Observable<V[]>;\n\n\t/**\n\t * Remove a coupon from the cart and return a partial of the cart.\n\t */\n\tremove(cartId: T['id'], coupon: V): Observable<Partial<T>>;\n\n\t/**\n\t * Remove all coupons from the cart and return a partial of the cart.\n\t */\n\tremoveAll(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\tT extends DaffCartItem = DaffCartItem,\n\tU extends DaffCartItemInput = DaffCartItemInput,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * List all of the available items of a cart\n\t */\n\tlist(cartId: V['id']): Observable<T[]>;\n\n\t/**\n\t * Get a specific cart item of a cart.\n\t */\n\tget(cartId: V['id'], item_id: DaffCartItem['id']): Observable<T>;\n\n\t/**\n\t * Add something to a cart.\n\t */\n\tadd(id: V['id'], product: U): Observable<Partial<V>>;\n\n\t/**\n\t * Update an existing item in a cart\n\t */\n\tupdate(\n\t\tcartId: V['id'],\n\t\titemId: T['id'],\n\t\tchanges: Partial<T>,\n\t): Observable<Partial<V>>;\n\n\t/**\n\t * Remove an item from a cart.\n\t */\n\tdelete(cartId: V['id'], itemId: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartItemDriver = new InjectionToken<\n\tDaffCartItemServiceInterface\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\t/**\n\t * List the available payment methods of a cart.\n\t */\n\tlist(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartPaymentMethodsDriver = new InjectionToken<\n\tDaffCartPaymentMethodsServiceInterface\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\t/**\n\t * Get the currently applied payment method of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the payment method applied to a cart.\n\t */\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\tupdateWithBilling(cartId: V['id'], payment: Partial<T>, address: Partial<R>): Observable<Partial<V>>;\n\n\t/**\n\t * Remove the payment method applied to a cart.\n\t */\n\tremove(cartId: V['id']): Observable<void>;\n}\n\nexport const DaffCartPaymentDriver = new InjectionToken<\n\tDaffCartPaymentServiceInterface\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\tT extends DaffCartAddress = DaffCartAddress,\n\tV extends DaffCart = DaffCart\n> {\n\t/**\n\t * Retrieve the shipping address of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the shipping address of a cart.\n\t */\n\tupdate(cartId: V['id'], address: Partial<T>): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingAddressDriver = new InjectionToken<\n\tDaffCartShippingAddressServiceInterface\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\t/**\n\t * Get the currently selected shipping method of a cart.\n\t */\n\tget(cartId: V['id']): Observable<T>;\n\n\t/**\n\t * Update the currently selected shipping method of a cart.\n\t */\n\tupdate(cartId: V['id'], shippingInfo: Partial<T>): Observable<Partial<V>>;\n\n\t/**\n\t * Remove the currently selected shipping method from a cart.\n\t */\n\tdelete(cartId: V['id'], id?: T['id']): Observable<Partial<V>>;\n}\n\nexport const DaffCartShippingInformationDriver = new InjectionToken<\n\tDaffCartShippingInformationServiceInterface\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\tT extends DaffCartShippingRate = DaffCartShippingRate\n> {\n\t/**\n\t * List the available shipping methods for a cart.\n\t */\n\tlist(cartId: DaffCart['id']): Observable<T[]>;\n}\n\nexport const DaffCartShippingMethodsDriver = new InjectionToken<\n\tDaffCartShippingMethodsServiceInterface\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\t/**\n\t * Place an order and return the order ID.\n\t */\n placeOrder(id: T['id'], payment?: V): Observable<R>;\n}\n\nexport const DaffCartOrderDriver = new InjectionToken<DaffCartOrderServiceInterface>(\n 'DaffCartOrderDriver',\n);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\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\tpublic readonly code: string = DaffCartDriverErrorCodes.CART_NOT_FOUND;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_COUNTRY;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_COUPON_CODE;\n\n\tconstructor(message?: string, public coupon?: DaffCartCoupon['code']) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_EMAIL;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.INVALID_REGION;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.ITEM_EXCEEDS_MAX_QTY;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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\tpublic readonly code: string = DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK;\n\n\tconstructor(message?: string) {\n\t super(message);\n\t}\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"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@ngrx/store'), require('@ngrx/entity'), require('@daffodil/core/state'), require('@angular/core'), require('@daffodil/cart'), require('@daffodil/core'), require('@daffodil/geography'), require('@ngrx/effects'), require('rxjs'), require('rxjs/operators')
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@daffodil/cart/state', ['exports', '@ngrx/store', '@ngrx/entity', '@daffodil/core/state', '@angular/core', '@daffodil/cart', '@daffodil/core', '@daffodil/geography', '@ngrx/effects', 'rxjs', 'rxjs/operators'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.cart = global.daffodil.cart || {}, global.daffodil.cart.state = {}), global.i1, global.entity, global.state, global.ng.core, global.daffodil.cart, global.core, global.geography, global.effects, global.rxjs, global.rxjs.operators
|
|
5
|
-
}(this, (function (exports, i1, entity, state, i0, i2, core, geography, effects, rxjs, operators
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@ngrx/store'), require('@ngrx/entity'), require('@daffodil/core/state'), require('@daffodil/cart/driver'), require('@angular/core'), require('@daffodil/cart'), require('@daffodil/core'), require('@daffodil/geography'), require('@ngrx/effects'), require('rxjs'), require('rxjs/operators')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@daffodil/cart/state', ['exports', '@ngrx/store', '@ngrx/entity', '@daffodil/core/state', '@daffodil/cart/driver', '@angular/core', '@daffodil/cart', '@daffodil/core', '@daffodil/geography', '@ngrx/effects', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.cart = global.daffodil.cart || {}, global.daffodil.cart.state = {}), global.i1, global.entity, global.state, global.daffodil.cart.driver, global.ng.core, global.daffodil.cart, global.core, global.geography, global.effects, global.rxjs, global.rxjs.operators));
|
|
5
|
+
}(this, (function (exports, i1, entity, state, driver, i0, i2, core, geography, effects, rxjs, operators) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* An enum for the cart action types.
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
DaffCartActionTypes["CartStorageFailureAction"] = "[DaffCart] Cart Storage Failure Action";
|
|
12
12
|
DaffCartActionTypes["CartLoadAction"] = "[DaffCart] Cart Load Action";
|
|
13
13
|
DaffCartActionTypes["CartLoadSuccessAction"] = "[DaffCart] Cart Load Success Action";
|
|
14
|
+
DaffCartActionTypes["CartLoadPartialSuccessAction"] = "[DaffCart] Cart Load Partial Success Action";
|
|
14
15
|
DaffCartActionTypes["CartLoadFailureAction"] = "[DaffCart] Cart Load Failure Action";
|
|
15
16
|
DaffCartActionTypes["CartCreateAction"] = "[DaffCart] Cart Create Action";
|
|
16
17
|
DaffCartActionTypes["CartCreateSuccessAction"] = "[DaffCart] Cart Create Success Action";
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
DaffCartActionTypes["CartClearFailureAction"] = "[DaffCart] Cart Reset Failure Action";
|
|
24
25
|
DaffCartActionTypes["ResolveCartAction"] = "[DaffCart] Resolve Cart Action";
|
|
25
26
|
DaffCartActionTypes["ResolveCartSuccessAction"] = "[DaffCart] Resolve Cart Success Action";
|
|
27
|
+
DaffCartActionTypes["ResolveCartPartialSuccessAction"] = "[DaffCart] Resolve Cart Partial Success Action";
|
|
26
28
|
DaffCartActionTypes["ResolveCartServerSideAction"] = "[DaffCart] Resolve Cart Server Side Action";
|
|
27
29
|
DaffCartActionTypes["ResolveCartFailureAction"] = "[DaffCart] Resolve Cart Failure Action";
|
|
28
30
|
})(exports.DaffCartActionTypes || (exports.DaffCartActionTypes = {}));
|
|
@@ -55,6 +57,20 @@
|
|
|
55
57
|
}
|
|
56
58
|
return DaffCartLoadSuccess;
|
|
57
59
|
}());
|
|
60
|
+
/**
|
|
61
|
+
* An action that indicates a user's cart is loaded but recoverable errors occurred.
|
|
62
|
+
* There should be enough data to render the cart
|
|
63
|
+
* but the user should probably be shown error messages as well.
|
|
64
|
+
* A common example is some cart items being out of stock.
|
|
65
|
+
*/
|
|
66
|
+
var DaffCartLoadPartialSuccess = /** @class */ (function () {
|
|
67
|
+
function DaffCartLoadPartialSuccess(payload, errors) {
|
|
68
|
+
this.payload = payload;
|
|
69
|
+
this.errors = errors;
|
|
70
|
+
this.type = exports.DaffCartActionTypes.CartLoadPartialSuccessAction;
|
|
71
|
+
}
|
|
72
|
+
return DaffCartLoadPartialSuccess;
|
|
73
|
+
}());
|
|
58
74
|
/**
|
|
59
75
|
* Indicates the failed load of the cart.
|
|
60
76
|
*/
|
|
@@ -167,6 +183,20 @@
|
|
|
167
183
|
}
|
|
168
184
|
return DaffResolveCartSuccess;
|
|
169
185
|
}());
|
|
186
|
+
/**
|
|
187
|
+
* An action that indicates a user's cart is resolved but recoverable errors occurred.
|
|
188
|
+
* There should be enough data to render the cart
|
|
189
|
+
* but the user should probably be shown error messages as well.
|
|
190
|
+
* A common example is some cart items being out of stock.
|
|
191
|
+
*/
|
|
192
|
+
var DaffResolveCartPartialSuccess = /** @class */ (function () {
|
|
193
|
+
function DaffResolveCartPartialSuccess(payload, errors) {
|
|
194
|
+
this.payload = payload;
|
|
195
|
+
this.errors = errors;
|
|
196
|
+
this.type = exports.DaffCartActionTypes.ResolveCartPartialSuccessAction;
|
|
197
|
+
}
|
|
198
|
+
return DaffResolveCartPartialSuccess;
|
|
199
|
+
}());
|
|
170
200
|
/**
|
|
171
201
|
* An action that indicates that a cart failed to resolve.
|
|
172
202
|
*/
|
|
@@ -208,6 +238,9 @@
|
|
|
208
238
|
DaffCartItemActionTypes["CartItemDeleteAction"] = "[DaffCart] Cart Item Remove Action";
|
|
209
239
|
DaffCartItemActionTypes["CartItemDeleteSuccessAction"] = "[DaffCart] Cart Item Remove Success Action";
|
|
210
240
|
DaffCartItemActionTypes["CartItemDeleteFailureAction"] = "[DaffCart] Cart Item Remove Failure Action";
|
|
241
|
+
DaffCartItemActionTypes["CartItemDeleteOutOfStockAction"] = "[DaffCart] Cart Item Delete Out Of Stock Action";
|
|
242
|
+
DaffCartItemActionTypes["CartItemDeleteOutOfStockSuccessAction"] = "[DaffCart] Cart Item Delete Out Of Stock Success Action";
|
|
243
|
+
DaffCartItemActionTypes["CartItemDeleteOutOfStockFailureAction"] = "[DaffCart] Cart Item Delete Out Of Stock Failure Action";
|
|
211
244
|
DaffCartItemActionTypes["CartItemStateResetAction"] = "[DaffCart] Cart Item State Reset Action";
|
|
212
245
|
})(exports.DaffCartItemActionTypes || (exports.DaffCartItemActionTypes = {}));
|
|
213
246
|
/**
|
|
@@ -364,6 +397,35 @@
|
|
|
364
397
|
}
|
|
365
398
|
return DaffCartItemDeleteFailure;
|
|
366
399
|
}());
|
|
400
|
+
/**
|
|
401
|
+
* Triggers the deletion of all out of stock cart items.
|
|
402
|
+
*/
|
|
403
|
+
var DaffCartItemDeleteOutOfStock = /** @class */ (function () {
|
|
404
|
+
function DaffCartItemDeleteOutOfStock() {
|
|
405
|
+
this.type = exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockAction;
|
|
406
|
+
}
|
|
407
|
+
return DaffCartItemDeleteOutOfStock;
|
|
408
|
+
}());
|
|
409
|
+
/**
|
|
410
|
+
* Indicates the successful deletion of all out of stock cart items.
|
|
411
|
+
*/
|
|
412
|
+
var DaffCartItemDeleteOutOfStockSuccess = /** @class */ (function () {
|
|
413
|
+
function DaffCartItemDeleteOutOfStockSuccess(payload) {
|
|
414
|
+
this.payload = payload;
|
|
415
|
+
this.type = exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction;
|
|
416
|
+
}
|
|
417
|
+
return DaffCartItemDeleteOutOfStockSuccess;
|
|
418
|
+
}());
|
|
419
|
+
/**
|
|
420
|
+
* Indicates the failed deletion of all out of stock cart items.
|
|
421
|
+
*/
|
|
422
|
+
var DaffCartItemDeleteOutOfStockFailure = /** @class */ (function () {
|
|
423
|
+
function DaffCartItemDeleteOutOfStockFailure(payload) {
|
|
424
|
+
this.payload = payload;
|
|
425
|
+
this.type = exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockFailureAction;
|
|
426
|
+
}
|
|
427
|
+
return DaffCartItemDeleteOutOfStockFailure;
|
|
428
|
+
}());
|
|
367
429
|
/**
|
|
368
430
|
* Resets cart item "new" or "updated" states to default.
|
|
369
431
|
*/
|
|
@@ -1107,8 +1169,11 @@
|
|
|
1107
1169
|
case exports.DaffCartItemActionTypes.CartItemUpdateFailureAction:
|
|
1108
1170
|
return adapter.upsertOne(Object.assign(Object.assign({}, state.entities[action.itemId]), { daffState: exports.DaffCartItemStateEnum.Error, errors: ((_b = (_a = state.entities[action.itemId]) === null || _a === void 0 ? void 0 : _a.errors) === null || _b === void 0 ? void 0 : _b.concat(action.payload)) || [action.payload] }), state);
|
|
1109
1171
|
case exports.DaffCartItemActionTypes.CartItemDeleteSuccessAction:
|
|
1172
|
+
case exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction:
|
|
1110
1173
|
case exports.DaffCartActionTypes.CartLoadSuccessAction:
|
|
1111
1174
|
case exports.DaffCartActionTypes.ResolveCartSuccessAction:
|
|
1175
|
+
case exports.DaffCartActionTypes.CartLoadPartialSuccessAction:
|
|
1176
|
+
case exports.DaffCartActionTypes.ResolveCartPartialSuccessAction:
|
|
1112
1177
|
case exports.DaffCartActionTypes.CartClearSuccessAction:
|
|
1113
1178
|
return adapter.setAll(action.payload.items.map(function (item) { return (Object.assign(Object.assign({}, item), { daffState: getDaffState(state.entities[item.id]) || exports.DaffCartItemStateEnum.Default })); }), state);
|
|
1114
1179
|
case exports.DaffCartItemActionTypes.CartItemStateResetAction:
|
|
@@ -1551,10 +1616,14 @@
|
|
|
1551
1616
|
resolved: exports.DaffCartResolveState.Default,
|
|
1552
1617
|
});
|
|
1553
1618
|
|
|
1554
|
-
var initializeErrorAdder = function (errorSpace) { return function (errors
|
|
1619
|
+
var initializeErrorAdder = function (errorSpace) { return function (errors) {
|
|
1555
1620
|
var _a;
|
|
1621
|
+
var errorsToAdd = [];
|
|
1622
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1623
|
+
errorsToAdd[_i - 1] = arguments[_i];
|
|
1624
|
+
}
|
|
1556
1625
|
return ({
|
|
1557
|
-
errors: Object.assign(Object.assign({}, errors), (_a = {}, _a[errorSpace] = errors[errorSpace].concat(
|
|
1626
|
+
errors: Object.assign(Object.assign({}, errors), (_a = {}, _a[errorSpace] = errors[errorSpace].concat(errorsToAdd), _a)),
|
|
1558
1627
|
});
|
|
1559
1628
|
}; };
|
|
1560
1629
|
var initializeErrorResetter = function (errorSpace) { return function (errors) {
|
|
@@ -1630,11 +1699,16 @@
|
|
|
1630
1699
|
var resetErrors$2 = initializeErrorResetter(exports.DaffCartOperationType.Item);
|
|
1631
1700
|
var setLoading$2 = initializeLoadingSetter(exports.DaffCartOperationType.Item);
|
|
1632
1701
|
function cartItemReducer(state, action) {
|
|
1702
|
+
var _a;
|
|
1633
1703
|
if (state === void 0) { state = initialState; }
|
|
1634
1704
|
switch (action.type) {
|
|
1635
1705
|
case exports.DaffCartItemActionTypes.CartItemListAction:
|
|
1636
1706
|
case exports.DaffCartItemActionTypes.CartItemLoadAction:
|
|
1637
1707
|
return Object.assign(Object.assign({}, state), setLoading$2(state.loading, "Resolving" /* Resolving */));
|
|
1708
|
+
case exports.DaffCartItemActionTypes.CartItemUpdateAction:
|
|
1709
|
+
case exports.DaffCartItemActionTypes.CartItemDeleteAction:
|
|
1710
|
+
case exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockAction:
|
|
1711
|
+
return Object.assign(Object.assign({}, state), setLoading$2(state.loading, "Mutating" /* Mutating */));
|
|
1638
1712
|
case exports.DaffCartItemActionTypes.CartItemAddAction:
|
|
1639
1713
|
return Object.assign(Object.assign({}, state), setLoading$2(state.loading, "Adding" /* Adding */));
|
|
1640
1714
|
case exports.DaffCartItemActionTypes.CartItemListSuccessAction:
|
|
@@ -1647,14 +1721,20 @@
|
|
|
1647
1721
|
case exports.DaffCartItemActionTypes.CartItemAddSuccessAction:
|
|
1648
1722
|
case exports.DaffCartItemActionTypes.CartItemDeleteSuccessAction:
|
|
1649
1723
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, state), resetErrors$2(state.errors)), { cart: Object.assign(Object.assign({}, state.cart), action.payload) }), setLoading$2(state.loading, "Stable" /* Complete */));
|
|
1724
|
+
case exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockSuccessAction:
|
|
1725
|
+
return Object.assign(Object.assign(Object.assign({}, state), { errors: Object.assign(Object.assign({}, state.errors), (_a = {}, _a[exports.DaffCartOperationType.Item] = [],
|
|
1726
|
+
// out of stock errors can be in the main cart, remove them here
|
|
1727
|
+
_a[exports.DaffCartOperationType.Cart] = state.errors[exports.DaffCartOperationType.Cart].filter(function (_a) {
|
|
1728
|
+
var code = _a.code;
|
|
1729
|
+
return code !== driver.DaffCartDriverErrorCodes.PRODUCT_OUT_OF_STOCK;
|
|
1730
|
+
}), _a)), cart: Object.assign(Object.assign({}, state.cart), action.payload) }), setLoading$2(state.loading, "Stable" /* Complete */));
|
|
1650
1731
|
case exports.DaffCartItemActionTypes.CartItemListFailureAction:
|
|
1651
1732
|
case exports.DaffCartItemActionTypes.CartItemLoadFailureAction:
|
|
1652
1733
|
case exports.DaffCartItemActionTypes.CartItemUpdateFailureAction:
|
|
1653
1734
|
case exports.DaffCartItemActionTypes.CartItemAddFailureAction:
|
|
1654
1735
|
case exports.DaffCartItemActionTypes.CartItemDeleteFailureAction:
|
|
1736
|
+
case exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockFailureAction:
|
|
1655
1737
|
return Object.assign(Object.assign(Object.assign({}, state), addError$2(state.errors, action.payload)), setLoading$2(state.loading, "Stable" /* Complete */));
|
|
1656
|
-
case exports.DaffCartItemActionTypes.CartItemUpdateFailureAction:
|
|
1657
|
-
return Object.assign(Object.assign({}, state), setLoading$2(state.loading, "Stable" /* Complete */));
|
|
1658
1738
|
default:
|
|
1659
1739
|
return state;
|
|
1660
1740
|
}
|
|
@@ -1823,14 +1903,18 @@
|
|
|
1823
1903
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, state), resetErrors$8(state.errors)), { cart: Object.assign(Object.assign({}, state.cart), action.payload) }), setLoading$8(state.loading, "Stable" /* Complete */));
|
|
1824
1904
|
case exports.DaffCartActionTypes.CartCreateSuccessAction:
|
|
1825
1905
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, state), resetErrors$8(state.errors)), { cart: Object.assign(Object.assign({}, initialState.cart), action.payload) }), setLoading$8(state.loading, "Stable" /* Complete */));
|
|
1826
|
-
case exports.DaffCartActionTypes.CartLoadFailureAction:
|
|
1827
1906
|
case exports.DaffCartActionTypes.CartClearFailureAction:
|
|
1828
1907
|
case exports.DaffCartActionTypes.AddToCartFailureAction:
|
|
1829
1908
|
case exports.DaffCartActionTypes.CartCreateFailureAction:
|
|
1830
1909
|
case exports.DaffCartActionTypes.CartStorageFailureAction:
|
|
1831
|
-
case exports.DaffCartActionTypes.ResolveCartFailureAction:
|
|
1832
1910
|
case exports.DaffCartActionTypes.ResolveCartServerSideAction:
|
|
1833
1911
|
return Object.assign(Object.assign(Object.assign({}, state), addError$8(state.errors, action.payload)), setLoading$8(state.loading, "Stable" /* Complete */));
|
|
1912
|
+
case exports.DaffCartActionTypes.CartLoadFailureAction:
|
|
1913
|
+
case exports.DaffCartActionTypes.ResolveCartFailureAction:
|
|
1914
|
+
return Object.assign(Object.assign(Object.assign({}, state), addError$8.apply(void 0, __spread([state.errors], action.payload))), setLoading$8(state.loading, "Stable" /* Stable */));
|
|
1915
|
+
case exports.DaffCartActionTypes.ResolveCartPartialSuccessAction:
|
|
1916
|
+
case exports.DaffCartActionTypes.CartLoadPartialSuccessAction:
|
|
1917
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, state), { cart: Object.assign(Object.assign({}, state.cart), action.payload) }), addError$8.apply(void 0, __spread([state.errors], action.errors))), setLoading$8(state.loading, "Stable" /* Stable */));
|
|
1834
1918
|
default:
|
|
1835
1919
|
return state;
|
|
1836
1920
|
}
|
|
@@ -2371,13 +2455,14 @@
|
|
|
2371
2455
|
], DaffCartCouponEffects.prototype, "removeAll$", void 0);
|
|
2372
2456
|
|
|
2373
2457
|
var DaffCartItemEffects = /** @class */ (function () {
|
|
2374
|
-
function DaffCartItemEffects(actions$, errorMatcher, driver, storage, cartItemStateDebounceTime) {
|
|
2458
|
+
function DaffCartItemEffects(actions$, errorMatcher, driver, storage, cartItemStateDebounceTime, store) {
|
|
2375
2459
|
var _this = this;
|
|
2376
2460
|
this.actions$ = actions$;
|
|
2377
2461
|
this.errorMatcher = errorMatcher;
|
|
2378
2462
|
this.driver = driver;
|
|
2379
2463
|
this.storage = storage;
|
|
2380
2464
|
this.cartItemStateDebounceTime = cartItemStateDebounceTime;
|
|
2465
|
+
this.store = store;
|
|
2381
2466
|
this.list$ = this.actions$.pipe(effects.ofType(exports.DaffCartItemActionTypes.CartItemListAction), operators.switchMap(function (action) { return _this.driver.list(_this.storage.getCartId()).pipe(operators.map(function (resp) { return new DaffCartItemListSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCartItemListFailure(_this.errorMatcher(error))); })); }));
|
|
2382
2467
|
this.get$ = this.actions$.pipe(effects.ofType(exports.DaffCartItemActionTypes.CartItemLoadAction), operators.switchMap(function (action) { return _this.driver.get(_this.storage.getCartId(), action.itemId).pipe(operators.map(function (resp) { return new DaffCartItemLoadSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCartItemLoadFailure(_this.errorMatcher(error), action.itemId)); })); }));
|
|
2383
2468
|
this.add$ = this.actions$.pipe(effects.ofType(exports.DaffCartItemActionTypes.CartItemAddAction), operators.switchMap(function (action) { return _this.driver.add(_this.storage.getCartId(), action.input).pipe(operators.map(function (resp) { return new DaffCartItemAddSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCartItemAddFailure(_this.errorMatcher(error))); })); }));
|
|
@@ -2388,6 +2473,9 @@
|
|
|
2388
2473
|
// these actions will cause the cart item state reset
|
|
2389
2474
|
exports.DaffCartItemActionTypes.CartItemAddSuccessAction, exports.DaffCartItemActionTypes.CartItemUpdateSuccessAction), operators.mapTo(new DaffCartItemStateReset()));
|
|
2390
2475
|
this.delete$ = this.actions$.pipe(effects.ofType(exports.DaffCartItemActionTypes.CartItemDeleteAction), operators.mergeMap(function (action) { return _this.driver.delete(_this.storage.getCartId(), action.itemId).pipe(operators.map(function (resp) { return new DaffCartItemDeleteSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCartItemDeleteFailure(_this.errorMatcher(error), action.itemId)); })); }));
|
|
2476
|
+
this.removeOutOfStock$ = this.actions$.pipe(effects.ofType(exports.DaffCartItemActionTypes.CartItemDeleteOutOfStockAction), operators.switchMap(function (action) { return _this.store.pipe(i1.select(getDaffCartSelectors().selectOutOfStockCartItems), operators.take(1)); }), operators.switchMap(function (items) { return items.length > 0
|
|
2477
|
+
? rxjs.combineLatest(items.map(function (item) { return _this.driver.delete(_this.storage.getCartId(), item.id); })).pipe(operators.map(function (partialCarts) { return Object.assign.apply(Object, __spread([{}], partialCarts)); }))
|
|
2478
|
+
: _this.store.pipe(i1.select(getDaffCartSelectors().selectCartValue), operators.take(1)); }), operators.map(function (cart) { return new DaffCartItemDeleteOutOfStockSuccess(cart); }), operators.catchError(function (error) { return rxjs.of(new DaffCartItemDeleteOutOfStockFailure(_this.errorMatcher(error))); }));
|
|
2391
2479
|
}
|
|
2392
2480
|
return DaffCartItemEffects;
|
|
2393
2481
|
}());
|
|
@@ -2400,7 +2488,8 @@
|
|
|
2400
2488
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [i2.DAFF_CART_ERROR_MATCHER,] }] },
|
|
2401
2489
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [driver.DaffCartItemDriver,] }] },
|
|
2402
2490
|
{ type: i2.DaffCartStorageService },
|
|
2403
|
-
{ type: Number, decorators: [{ type: i0.Inject, args: [DaffCartItemStateDebounceTime,] }] }
|
|
2491
|
+
{ type: Number, decorators: [{ type: i0.Inject, args: [DaffCartItemStateDebounceTime,] }] },
|
|
2492
|
+
{ type: i1.Store }
|
|
2404
2493
|
]; };
|
|
2405
2494
|
__decorate([
|
|
2406
2495
|
effects.Effect(),
|
|
@@ -2426,6 +2515,10 @@
|
|
|
2426
2515
|
effects.Effect(),
|
|
2427
2516
|
__metadata("design:type", Object)
|
|
2428
2517
|
], DaffCartItemEffects.prototype, "delete$", void 0);
|
|
2518
|
+
__decorate([
|
|
2519
|
+
effects.Effect(),
|
|
2520
|
+
__metadata("design:type", Object)
|
|
2521
|
+
], DaffCartItemEffects.prototype, "removeOutOfStock$", void 0);
|
|
2429
2522
|
|
|
2430
2523
|
var DaffCartOrderEffects = /** @class */ (function () {
|
|
2431
2524
|
function DaffCartOrderEffects(actions$, errorMatcher, driver, storage) {
|
|
@@ -2544,22 +2637,36 @@
|
|
|
2544
2637
|
this.onResolveCart = function () { return _this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.ResolveCartAction), operators.switchMap(function () { return rxjs.of(null).pipe(operators.map(function () { return _this.cartStorage.getCartId(); }), operators.switchMap(function (cartId) { return cartId ? rxjs.of({ id: cartId }) : _this.driver.create(); }), operators.switchMap(function (_a) {
|
|
2545
2638
|
var id = _a.id;
|
|
2546
2639
|
return _this.driver.get(id);
|
|
2547
|
-
}), operators.
|
|
2640
|
+
}), operators.switchMap(function (_a) {
|
|
2641
|
+
var response = _a.response, errors = _a.errors;
|
|
2642
|
+
if (errors.length === 0) {
|
|
2643
|
+
return rxjs.of(new DaffResolveCartSuccess(response));
|
|
2644
|
+
}
|
|
2645
|
+
var hasOnlyRecoverableErrors = errors.reduce(function (acc, error) { return acc && error.recoverable; }, true);
|
|
2646
|
+
if (hasOnlyRecoverableErrors) {
|
|
2647
|
+
return rxjs.of(new DaffResolveCartPartialSuccess(response, errors.map(function (error) { return _this.errorMatcher(error); })));
|
|
2648
|
+
}
|
|
2649
|
+
if (errors.filter(function (error) { return error instanceof driver.DaffCartNotFoundError; }).length > 0) {
|
|
2650
|
+
return _this.driver.create().pipe(operators.switchMap(function (_a) {
|
|
2651
|
+
var id = _a.id;
|
|
2652
|
+
return _this.driver.get(id);
|
|
2653
|
+
}), operators.map(function (resp) { return new DaffResolveCartSuccess(resp.response); }), operators.catchError(function (innerError) { return rxjs.of(new DaffResolveCartFailure([_this.errorMatcher(new i2.DaffCartNotFoundOrCreatedResolutionError(innerError.message))])); }));
|
|
2654
|
+
}
|
|
2655
|
+
// there are no special case errors, DaffResolveCartFailure will suffice
|
|
2656
|
+
// just map the errors
|
|
2657
|
+
return rxjs.of(new DaffResolveCartFailure(errors.map(function (error) { return _this.errorMatcher(
|
|
2658
|
+
// I wish there was a better way to check this
|
|
2659
|
+
error instanceof core.DaffInheritableError || !!error.code
|
|
2660
|
+
? error
|
|
2661
|
+
: new i2.DaffCartResolutionError(error.message)); })));
|
|
2662
|
+
}), operators.catchError(function (error) {
|
|
2548
2663
|
switch (true) {
|
|
2549
2664
|
case error instanceof core.DaffServerSideStorageError:
|
|
2550
2665
|
return rxjs.of(new DaffResolveCartServerSide(_this.errorMatcher(new i2.DaffCartServerSideResolutionError(error.message))));
|
|
2551
2666
|
case error instanceof core.DaffStorageServiceError:
|
|
2552
|
-
return rxjs.of(new DaffResolveCartFailure(_this.errorMatcher(new i2.DaffCartStorageResolutionError(error.message))));
|
|
2553
|
-
case error instanceof driver.DaffCartNotFoundError:
|
|
2554
|
-
return _this.driver.create().pipe(operators.switchMap(function (_a) {
|
|
2555
|
-
var id = _a.id;
|
|
2556
|
-
return _this.driver.get(id);
|
|
2557
|
-
}), operators.map(function (resp) { return new DaffResolveCartSuccess(resp); }), operators.catchError(function (innerError) { return rxjs.of(new DaffResolveCartFailure(_this.errorMatcher(new i2.DaffCartNotFoundOrCreatedResolutionError(innerError.message)))); }));
|
|
2558
|
-
// I wish there was a better way to check this
|
|
2559
|
-
case error instanceof core.DaffInheritableError || !!error.code:
|
|
2560
|
-
return rxjs.of(new DaffResolveCartFailure(_this.errorMatcher(error)));
|
|
2667
|
+
return rxjs.of(new DaffResolveCartFailure([_this.errorMatcher(new i2.DaffCartStorageResolutionError(error.message))]));
|
|
2561
2668
|
default:
|
|
2562
|
-
return rxjs.of(new DaffResolveCartFailure(_this.errorMatcher(new i2.DaffCartResolutionError(error.message))));
|
|
2669
|
+
return rxjs.of(new DaffResolveCartFailure([_this.errorMatcher(new i2.DaffCartResolutionError(error.message))]));
|
|
2563
2670
|
}
|
|
2564
2671
|
})); })); };
|
|
2565
2672
|
}
|
|
@@ -2687,9 +2794,19 @@
|
|
|
2687
2794
|
this.storeId$ = this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.CartCreateSuccessAction, exports.DaffCartActionTypes.ResolveCartSuccessAction), operators.switchMap(function (action) { return rxjs.of(null).pipe(operators.tap(function () {
|
|
2688
2795
|
_this.storage.setCartId(action.payload.id);
|
|
2689
2796
|
}), operators.switchMapTo(rxjs.EMPTY), operators.catchError(function (error) { return rxjs.of(new DaffCartStorageFailure(_this.errorMatcher(error))); })); }));
|
|
2690
|
-
this.get$ = this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.CartLoadAction), operators.switchMap(function (action) { return rxjs.of(null).pipe(operators.map(function () { return _this.storage.getCartId(); }), operators.switchMap(function (cartId) { return _this.driver.get(cartId); }), operators.map(function (
|
|
2797
|
+
this.get$ = this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.CartLoadAction), operators.switchMap(function (action) { return rxjs.of(null).pipe(operators.map(function () { return _this.storage.getCartId(); }), operators.switchMap(function (cartId) { return _this.driver.get(cartId); }), operators.map(function (_a) {
|
|
2798
|
+
var response = _a.response, errors = _a.errors;
|
|
2799
|
+
if (errors.length === 0) {
|
|
2800
|
+
return new DaffCartLoadSuccess(response);
|
|
2801
|
+
}
|
|
2802
|
+
var hasOnlyRecoverableErrors = errors.reduce(function (acc, error) { return acc && error.recoverable; }, true);
|
|
2803
|
+
if (hasOnlyRecoverableErrors) {
|
|
2804
|
+
return new DaffCartLoadPartialSuccess(response, errors.map(function (error) { return _this.errorMatcher(error); }));
|
|
2805
|
+
}
|
|
2806
|
+
return new DaffCartLoadFailure(errors.map(function (error) { return _this.errorMatcher(error); }));
|
|
2807
|
+
}), operators.catchError(function (error) { return rxjs.of(error instanceof core.DaffStorageServiceError
|
|
2691
2808
|
? new DaffCartStorageFailure(_this.errorMatcher(error))
|
|
2692
|
-
: new DaffCartLoadFailure(_this.errorMatcher(error))); })); }));
|
|
2809
|
+
: new DaffCartLoadFailure([_this.errorMatcher(error)])); })); }));
|
|
2693
2810
|
this.addToCart$ = this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.AddToCartAction), operators.switchMap(function (action) { return _this.driver.addToCart(action.payload.productId, action.payload.qty).pipe(operators.map(function (resp) { return new DaffAddToCartSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffAddToCartFailure(_this.errorMatcher(error))); })); }));
|
|
2694
2811
|
this.clear$ = this.actions$.pipe(effects.ofType(exports.DaffCartActionTypes.CartClearAction), operators.switchMap(function (action) { return rxjs.of(null).pipe(operators.map(function () { return _this.storage.getCartId(); }), operators.switchMap(function (cartId) { return _this.driver.clear(cartId); }), operators.map(function (resp) { return new DaffCartClearSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(error instanceof core.DaffStorageServiceError
|
|
2695
2812
|
? new DaffCartStorageFailure(_this.errorMatcher(error))
|
|
@@ -2970,6 +3087,9 @@
|
|
|
2970
3087
|
exports.DaffCartItemAddSuccess = DaffCartItemAddSuccess;
|
|
2971
3088
|
exports.DaffCartItemDelete = DaffCartItemDelete;
|
|
2972
3089
|
exports.DaffCartItemDeleteFailure = DaffCartItemDeleteFailure;
|
|
3090
|
+
exports.DaffCartItemDeleteOutOfStock = DaffCartItemDeleteOutOfStock;
|
|
3091
|
+
exports.DaffCartItemDeleteOutOfStockFailure = DaffCartItemDeleteOutOfStockFailure;
|
|
3092
|
+
exports.DaffCartItemDeleteOutOfStockSuccess = DaffCartItemDeleteOutOfStockSuccess;
|
|
2973
3093
|
exports.DaffCartItemDeleteSuccess = DaffCartItemDeleteSuccess;
|
|
2974
3094
|
exports.DaffCartItemList = DaffCartItemList;
|
|
2975
3095
|
exports.DaffCartItemListFailure = DaffCartItemListFailure;
|
|
@@ -2984,6 +3104,7 @@
|
|
|
2984
3104
|
exports.DaffCartItemUpdateSuccess = DaffCartItemUpdateSuccess;
|
|
2985
3105
|
exports.DaffCartLoad = DaffCartLoad;
|
|
2986
3106
|
exports.DaffCartLoadFailure = DaffCartLoadFailure;
|
|
3107
|
+
exports.DaffCartLoadPartialSuccess = DaffCartLoadPartialSuccess;
|
|
2987
3108
|
exports.DaffCartLoadSuccess = DaffCartLoadSuccess;
|
|
2988
3109
|
exports.DaffCartPaymentLoad = DaffCartPaymentLoad;
|
|
2989
3110
|
exports.DaffCartPaymentLoadFailure = DaffCartPaymentLoadFailure;
|
|
@@ -3026,6 +3147,7 @@
|
|
|
3026
3147
|
exports.DaffCartStorageFailure = DaffCartStorageFailure;
|
|
3027
3148
|
exports.DaffResolveCart = DaffResolveCart;
|
|
3028
3149
|
exports.DaffResolveCartFailure = DaffResolveCartFailure;
|
|
3150
|
+
exports.DaffResolveCartPartialSuccess = DaffResolveCartPartialSuccess;
|
|
3029
3151
|
exports.DaffResolveCartServerSide = DaffResolveCartServerSide;
|
|
3030
3152
|
exports.DaffResolveCartSuccess = DaffResolveCartSuccess;
|
|
3031
3153
|
exports.daffCartOrderInitialState = daffCartOrderInitialState;
|