@daffodil/order 0.39.12 → 0.39.13
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/daffodil-order-driver-magento-2.4.1.umd.js +2 -2
- package/bundles/daffodil-order-driver-magento-2.4.1.umd.js.map +1 -1
- package/bundles/daffodil-order-driver-magento-2.4.1.umd.min.js +1 -1
- package/bundles/daffodil-order-driver-magento-2.4.1.umd.min.js.map +1 -1
- package/driver/magento/2.4.1/models/responses/order-address.d.ts +1 -1
- package/esm2015/driver/magento/2.4.1/models/responses/order-address.js +1 -1
- package/esm2015/driver/magento/2.4.1/queries/fragments/order-address.js +2 -2
- package/esm2015/driver/magento/2.4.1/transforms/responses/order.js +2 -2
- package/fesm2015/daffodil-order-driver-magento-2.4.1.js +2 -2
- package/fesm2015/daffodil-order-driver-magento-2.4.1.js.map +1 -1
- package/package.json +5 -5
@@ -109,7 +109,7 @@
|
|
109
109
|
street: address.street[0],
|
110
110
|
street2: address.street[1],
|
111
111
|
city: address.city,
|
112
|
-
region: address.
|
112
|
+
region: address.region_code,
|
113
113
|
country: address.country_code,
|
114
114
|
postcode: address.postcode,
|
115
115
|
};
|
@@ -546,7 +546,7 @@
|
|
546
546
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
547
547
|
}
|
548
548
|
|
549
|
-
var orderAddressFragment = i1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n
|
549
|
+
var orderAddressFragment = i1.gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n"], ["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n"])));
|
550
550
|
var templateObject_1;
|
551
551
|
|
552
552
|
var orderBundleItemSelectedOptionFragment = i1.gql(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"], ["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"])));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-order-driver-magento-2.4.1.umd.js","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../node_modules/tslib/tslib.es6.js","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_id,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\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 { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["MagentoOrderItemType","DaffOrderTotalTypeEnum","daffAdd","DaffOrderItemType","order","daffSubtract","gql","daffBuildFragmentNameSpread","daffBuildFragmentDefinition","InjectionToken","DaffCartNotFoundError","daffTransformMagentoError","DaffOrderInvalidAPIResponseError","map","catchError","throwError","DaffOrderNotFoundError","Injectable","Apollo","Inject","DaffOrderDriver","NgModule","CommonModule"],"mappings":";;;;;;IAIA,WAAY,oBAAoB;QAC9B,yCAAiB,CAAA;QACjB,qDAA6B,CAAA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IG,+BAAsB,CAAC,qCAAmC,OAAS,CAAC,CAAC;aAChF,CAAC,CACH,CAAC;SACH;;;;;gBAnCFC,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAlCQC,SAAM;4CAsCVC,SAAM,SAAC,8BAA8B;;;;QC3B1C;;QACS,oCAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,4BAA4B;gBACtC,SAAS,EAAE;oBACT;wBACE,OAAO,EAAEC,wBAAe;wBACxB,WAAW,EAAE,uBAAuB;qBACrC;iBACF;aACF,CAAC;SACH;;;;gBAhBFC,WAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;qBACb;iBACF;;;ICdD;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-order-driver-magento-2.4.1.umd.js","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../node_modules/tslib/tslib.es6.js","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_code,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\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 { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["MagentoOrderItemType","DaffOrderTotalTypeEnum","daffAdd","DaffOrderItemType","order","daffSubtract","gql","daffBuildFragmentNameSpread","daffBuildFragmentDefinition","InjectionToken","DaffCartNotFoundError","daffTransformMagentoError","DaffOrderInvalidAPIResponseError","map","catchError","throwError","DaffOrderNotFoundError","Injectable","Apollo","Inject","DaffOrderDriver","NgModule","CommonModule"],"mappings":";;;;;;IAIA,WAAY,oBAAoB;QAC9B,yCAAiB,CAAA;QACjB,qDAA6B,CAAA;QAC7B,yCAAiB,CAAA;IACnB,CAAC,EAJWA,4BAAoB,KAApBA,4BAAoB,QAI/B;IAAA,CAAC;IAYD,CAAC;IAyBD,CAAC;IAOD,CAAC;IAID;;ICbD,SAAS,eAAe,CAAC,MAAyB;QAChD,OAAO;YACL;gBACE,KAAK,EAAE,aAAa;gBACpB,IAAI,EAAEC,4BAAsB,CAAC,UAAU;gBACvC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;gBAC/B,UAAU,EAAE,CAAC;aACd;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAEA,4BAAsB,CAAC,QAAQ;gBACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK;gBAC5B,UAAU,EAAE,CAAC;aACd;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAEA,4BAAsB,CAAC,QAAQ;gBACrC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK;gBAClC,UAAU,EAAE,CAAC;aACd;YACD;gBACE,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAEA,4BAAsB,CAAC,GAAG;gBAChC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK;gBAC7B,UAAU,EAAE,CAAC;aACd;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAEA,4BAAsB,CAAC,QAAQ;gBACrC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,QAAQ,IAAK,OAAAC,YAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC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AC3BF,aAAG,CAAC,UAAA,MAAM;;;oBACR,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE;wBAAvB,IAAM,KAAK,mBAAA;wBACd,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,EAAE;4BACxB,OAAO,KAAK,CAAC;yBACd;qBACF;;;;;;;;;;gBAGD,MAAM,IAAIG,+BAAsB,CAAC,qCAAmC,OAAS,CAAC,CAAC;aAChF,CAAC,CACH,CAAC;SACH;;;;;gBAnCFC,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAlCQC,SAAM;4CAsCVC,SAAM,SAAC,8BAA8B;;;;QC3B1C;;QACS,oCAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,4BAA4B;gBACtC,SAAS,EAAE;oBACT;wBACE,OAAO,EAAEC,wBAAe;wBACxB,WAAW,EAAE,uBAAuB;qBACrC;iBACF;aACF,CAAC;SACH;;;;gBAhBFC,WAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;qBACb;iBACF;;;ICdD;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@daffodil/core"),require("@daffodil/order"),require("apollo-angular"),require("@daffodil/core/graphql"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@daffodil/order/driver"),require("@daffodil/driver/magento"),require("@daffodil/cart/driver"),require("@angular/common")):"function"==typeof define&&define.amd?define("@daffodil/order/driver/magento/2.4.1",["exports","@daffodil/core","@daffodil/order","apollo-angular","@daffodil/core/graphql","@angular/core","rxjs","rxjs/operators","@daffodil/order/driver","@daffodil/driver/magento","@daffodil/cart/driver","@angular/common"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).daffodil=n.daffodil||{},n.daffodil.order=n.daffodil.order||{},n.daffodil.order.driver=n.daffodil.order.driver||{},n.daffodil.order.driver.magento=n.daffodil.order.driver.magento||{},n.daffodil.order.driver.magento[2]=n.daffodil.order.driver.magento[2]||{},n.daffodil.order.driver.magento[2][4]=n.daffodil.order.driver.magento[2][4]||{},n.daffodil.order.driver.magento[2][4][1]={}),n.core,n.daffodil.order,n.i1,n.graphql,n.ng.core,n.rxjs,n.rxjs.operators,n.daffodil.order.driver,n.magento,n.driver,n.ng.common)}(this,(function(n,e,r,t,o,a,d,i,l,u,s,m){"use strict";var c;function f(n){return[{label:"Grand Total",type:r.DaffOrderTotalTypeEnum.GrandTotal,value:n.grand_total.value,sort_order:1},{label:"Subtotal",type:r.DaffOrderTotalTypeEnum.Subtotal,value:n.subtotal.value,sort_order:0},{label:"Shipping",type:r.DaffOrderTotalTypeEnum.Shipping,value:n.total_shipping.value,sort_order:2},{label:"Tax",type:r.DaffOrderTotalTypeEnum.Tax,value:n.total_tax.value,sort_order:3},{label:"Discount",type:r.DaffOrderTotalTypeEnum.Discount,value:n.discounts.reduce((function(n,r){return e.daffAdd(n,r.amount.value)}),0),sort_order:4}]}function p(n){return{code:n.label}}function _(n){return{attribute_label:n.label,value_label:n.value}}function g(n){return{option_label:n.label,value_label:n.values&&n.values[0]&&n.values[0].product_name}}function v(t,o,a){var d=t.discounts.reduce((function(n,r){return e.daffAdd(n,r.amount.value)}),0),i=a*t.product_sale_price.value,l=a*e.daffSubtract(t.product_sale_price.value,d);return Object.assign({type:r.DaffOrderItemType.Simple,id:null,item_id:null,qty_ordered:t.quantity_ordered,qty_canceled:t.quantity_canceled,qty_fulfilled:t.quantity_shipped,qty:a,image:{url:t.product_url_key,id:null,label:null},order_id:o.id,created_at:null,updated_at:null,product_id:null,parent_item_id:null,sku:t.product_sku,name:t.product_name,weight:null,price:t.product_sale_price.value,discount_percent:Math.floor(d/t.product_sale_price.value*100),discount_amount:d,tax_percent:null,tax_amount:null,row_total:i,row_total_with_discount:l,row_weight:null,tax_before_discount:null},function(e){switch(e.product_type){case n.MagentoOrderItemType.Bundle:return{type:r.DaffOrderItemType.Composite,options:e.bundle_options.map(g)};case n.MagentoOrderItemType.Configurable:return{type:r.DaffOrderItemType.Configurable,attributes:e.selected_options.map(_)};case n.MagentoOrderItemType.Simple:return{type:r.DaffOrderItemType.Simple};default:return{}}}(t))}function y(n,e){return{order_id:e.id,prefix:n.prefix,suffix:n.suffix,firstname:n.firstname,middlename:n.middlename,lastname:n.lastname,telephone:n.telephone,email:null,street:n.street[0],street2:n.street[1],city:n.city,region:n.region_id,country:n.country_code,postcode:n.postcode}}function h(n){return{tracking_number:n.number,tracking_url:null,carrier:n.carrier,title:n.title,carrier_logo:null}}function I(n,e){return{carrier:e.carrier,carrier_title:null,code:null,method:e.shipping_method,method_description:null,tracking:n.tracking.map(h),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_shipped),qty:n.quantity_shipped}}(n,e)}))}}function b(n,e){var r=function(e){var r=n.additional_data.findIndex((function(n){return n.name===e}));return r>-1?n.additional_data[r].value:null};return{id:null,payment_id:null,order_id:e.id,created_at:null,updated_at:null,method:n.type,cc_type:r("cc_type"),cc_last4:r("cc_last4"),cc_owner:r("cc_owner"),cc_exp_month:r("cc_exp_month"),cc_exp_year:r("cc_exp_year")}}function q(n,e,r){return{totals:f(n.total),billing_address:y(e.billing_address,e),shipping_address:y(e.shipping_address,e),payment:b(r,e),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_invoiced),qty:n.quantity_invoiced}}(n,e)})),shipping_method:null}}function O(n,e){return{totals:f(n.total),billing_address:y(e.billing_address,e),shipping_address:y(e.shipping_address,e),payment:b(e.payment_methods[0],e),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_refunded),qty:n.quantity_refunded}}(n,e)})),shipping_method:null}}function T(n){return{extra_attributes:n,id:n.number,customer_id:null,updated_at:null,created_at:n.order_date,status:n.status,totals:f(n.total),applied_codes:n.total.discounts.map(p),items:n.items.map((function(e){return v(e,n,e.quantity_ordered)})),billing_addresses:[y(n.billing_address,n)],shipping_addresses:[y(n.shipping_address,n)],shipments:n.shipments.map((function(e){return I(e,n)})),payment:b(n.payment_methods[0],n),invoices:n.invoices.map((function(e,r){return q(e,n,n.payment_methods[r])})),credits:n.credit_memos.map((function(e){return O(e,n)}))}}(c=n.MagentoOrderItemType||(n.MagentoOrderItemType={})).Simple="simple",c.Configurable="configurable",c.Bundle="bundle";Object.create;function x(n){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&n[e],t=0;if(r)return r.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&t>=n.length&&(n=void 0),{value:n&&n[t++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n,e){var r="function"==typeof Symbol&&n[Symbol.iterator];if(!r)return n;var t,o,a=r.call(n),d=[];try{for(;(void 0===e||e-- >0)&&!(t=a.next()).done;)d.push(t.value)}catch(n){o={error:n}}finally{try{t&&!t.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return d}function C(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(S(arguments[e]));return n}function M(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}Object.create;var D,w,k,j,A,F,G,E,P,B,N,R,$,U,z,H,J,K,L=t.gql(D||(D=M(["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n }\n"],["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n }\n"]))),Q=t.gql(w||(w=M(["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"],["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"]))),V=t.gql(k||(k=M(["\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ","\n"],["\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ","\n"])),Q),W=t.gql(j||(j=M(["\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),X=t.gql(A||(A=M(["\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),Y=t.gql(F||(F=M(["\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ","\n ","\n"],["\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ","\n ","\n"])),W,X),Z=t.gql(G||(G=M(["\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),nn=t.gql(E||(E=M(["\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),en=t.gql(P||(P=M(["\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ","\n ","\n"],["\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ","\n ","\n"])),Z,nn),rn=t.gql(B||(B=M(["\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n"],["\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n"]))),tn=t.gql(N||(N=M(["\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),on=t.gql(R||(R=M(["\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n"],["\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n"]))),an=t.gql($||($=M(["\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ","\n ","\n"],["\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ","\n ","\n"])),tn,on),dn=t.gql(U||(U=M(["\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),ln=t.gql(z||(z=M(["\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"],["\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"])),V,an,rn,en,Y,L,dn),un=function(n){return void 0===n&&(n=[]),t.gql(H||(H=M(["\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ","\n }\n }\n }\n ","\n ","\n"],["\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ","\n }\n }\n }\n ","\n ","\n"])),o.daffBuildFragmentNameSpread.apply(void 0,C(n)),ln,o.daffBuildFragmentDefinition.apply(void 0,C(n)))},sn=new a.InjectionToken("DaffMagentoExtraOrderFragments",{factory:function(){return[]}});!function(n){n.CART_NOT_FOUND="graphql-no-such-entity"}(J||(J={}));var mn=((K={})[J.CART_NOT_FOUND]=s.DaffCartNotFoundError,K);var cn=function(n){var e,r;if(null===(r=null===(e=n.data)||void 0===e?void 0:e.graycoreGuestOrders)||void 0===r?void 0:r.items){if(n.data.graycoreGuestOrders.items.reduce((function(n,e){return n&&!!(e.billing_address&&e.shipping_address&&e.payment_methods)}),!0))return n;throw new l.DaffOrderInvalidAPIResponseError("One of the orders does not contain required fields.")}throw new l.DaffOrderInvalidAPIResponseError("Get orders response does not contain a valid list of orders.")},fn=function(){function n(n,e){this.apollo=n,this.extraOrderFragments=e}return n.prototype.list=function(n){return this.apollo.query({query:un(this.extraOrderFragments),variables:{cartId:n}}).pipe(i.map(cn),i.map((function(n){return n.data.graycoreGuestOrders.items.map(T)})),i.catchError((function(n){return d.throwError((e=n,u.daffTransformMagentoError(e,mn)));var e})))},n.prototype.get=function(n,e){return this.list(e).pipe(i.map((function(e){var r,t;try{for(var o=x(e),a=o.next();!a.done;a=o.next()){var d=a.value;if(d.id===n)return d}}catch(n){r={error:n}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}throw new l.DaffOrderNotFoundError("Could not find an order with ID "+n)})))},n}();fn.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new fn(a.ɵɵinject(t.Apollo),a.ɵɵinject(sn))},token:fn,providedIn:"root"}),fn.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],fn.ctorParameters=function(){return[{type:t.Apollo},{type:Array,decorators:[{type:a.Inject,args:[sn]}]}]};var pn=function(){function n(){}return n.forRoot=function(){return{ngModule:n,providers:[{provide:l.DaffOrderDriver,useExisting:fn}]}},n}();pn.decorators=[{type:a.NgModule,args:[{imports:[m.CommonModule]}]}],n.DaffMagentoExtraOrderFragments=sn,n.DaffOrderMagentoDriverModule=pn,n.DaffOrderMagentoService=fn,n.daffMagentoTransformOrder=T,n.getGuestOrders=un,n.orderAddressFragment=L,n.orderFragment=ln,n.orderInvoiceFragment=en,n.orderItemFragment=V,n.orderPaymentFragment=rn,n.orderShipmentFragment=an,n.orderShipmentItemFragment=tn,n.orderShipmentTrackingFragment=on,Object.defineProperty(n,"__esModule",{value:!0})}));
|
1
|
+
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@daffodil/core"),require("@daffodil/order"),require("apollo-angular"),require("@daffodil/core/graphql"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@daffodil/order/driver"),require("@daffodil/driver/magento"),require("@daffodil/cart/driver"),require("@angular/common")):"function"==typeof define&&define.amd?define("@daffodil/order/driver/magento/2.4.1",["exports","@daffodil/core","@daffodil/order","apollo-angular","@daffodil/core/graphql","@angular/core","rxjs","rxjs/operators","@daffodil/order/driver","@daffodil/driver/magento","@daffodil/cart/driver","@angular/common"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).daffodil=n.daffodil||{},n.daffodil.order=n.daffodil.order||{},n.daffodil.order.driver=n.daffodil.order.driver||{},n.daffodil.order.driver.magento=n.daffodil.order.driver.magento||{},n.daffodil.order.driver.magento[2]=n.daffodil.order.driver.magento[2]||{},n.daffodil.order.driver.magento[2][4]=n.daffodil.order.driver.magento[2][4]||{},n.daffodil.order.driver.magento[2][4][1]={}),n.core,n.daffodil.order,n.i1,n.graphql,n.ng.core,n.rxjs,n.rxjs.operators,n.daffodil.order.driver,n.magento,n.driver,n.ng.common)}(this,(function(n,e,r,t,o,a,d,i,l,u,s,m){"use strict";var c;function f(n){return[{label:"Grand Total",type:r.DaffOrderTotalTypeEnum.GrandTotal,value:n.grand_total.value,sort_order:1},{label:"Subtotal",type:r.DaffOrderTotalTypeEnum.Subtotal,value:n.subtotal.value,sort_order:0},{label:"Shipping",type:r.DaffOrderTotalTypeEnum.Shipping,value:n.total_shipping.value,sort_order:2},{label:"Tax",type:r.DaffOrderTotalTypeEnum.Tax,value:n.total_tax.value,sort_order:3},{label:"Discount",type:r.DaffOrderTotalTypeEnum.Discount,value:n.discounts.reduce((function(n,r){return e.daffAdd(n,r.amount.value)}),0),sort_order:4}]}function p(n){return{code:n.label}}function _(n){return{attribute_label:n.label,value_label:n.value}}function g(n){return{option_label:n.label,value_label:n.values&&n.values[0]&&n.values[0].product_name}}function v(t,o,a){var d=t.discounts.reduce((function(n,r){return e.daffAdd(n,r.amount.value)}),0),i=a*t.product_sale_price.value,l=a*e.daffSubtract(t.product_sale_price.value,d);return Object.assign({type:r.DaffOrderItemType.Simple,id:null,item_id:null,qty_ordered:t.quantity_ordered,qty_canceled:t.quantity_canceled,qty_fulfilled:t.quantity_shipped,qty:a,image:{url:t.product_url_key,id:null,label:null},order_id:o.id,created_at:null,updated_at:null,product_id:null,parent_item_id:null,sku:t.product_sku,name:t.product_name,weight:null,price:t.product_sale_price.value,discount_percent:Math.floor(d/t.product_sale_price.value*100),discount_amount:d,tax_percent:null,tax_amount:null,row_total:i,row_total_with_discount:l,row_weight:null,tax_before_discount:null},function(e){switch(e.product_type){case n.MagentoOrderItemType.Bundle:return{type:r.DaffOrderItemType.Composite,options:e.bundle_options.map(g)};case n.MagentoOrderItemType.Configurable:return{type:r.DaffOrderItemType.Configurable,attributes:e.selected_options.map(_)};case n.MagentoOrderItemType.Simple:return{type:r.DaffOrderItemType.Simple};default:return{}}}(t))}function y(n,e){return{order_id:e.id,prefix:n.prefix,suffix:n.suffix,firstname:n.firstname,middlename:n.middlename,lastname:n.lastname,telephone:n.telephone,email:null,street:n.street[0],street2:n.street[1],city:n.city,region:n.region_code,country:n.country_code,postcode:n.postcode}}function h(n){return{tracking_number:n.number,tracking_url:null,carrier:n.carrier,title:n.title,carrier_logo:null}}function I(n,e){return{carrier:e.carrier,carrier_title:null,code:null,method:e.shipping_method,method_description:null,tracking:n.tracking.map(h),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_shipped),qty:n.quantity_shipped}}(n,e)}))}}function b(n,e){var r=function(e){var r=n.additional_data.findIndex((function(n){return n.name===e}));return r>-1?n.additional_data[r].value:null};return{id:null,payment_id:null,order_id:e.id,created_at:null,updated_at:null,method:n.type,cc_type:r("cc_type"),cc_last4:r("cc_last4"),cc_owner:r("cc_owner"),cc_exp_month:r("cc_exp_month"),cc_exp_year:r("cc_exp_year")}}function q(n,e,r){return{totals:f(n.total),billing_address:y(e.billing_address,e),shipping_address:y(e.shipping_address,e),payment:b(r,e),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_invoiced),qty:n.quantity_invoiced}}(n,e)})),shipping_method:null}}function O(n,e){return{totals:f(n.total),billing_address:y(e.billing_address,e),shipping_address:y(e.shipping_address,e),payment:b(e.payment_methods[0],e),items:n.items.map((function(n){return function(n,e){return{item:v(n.order_item,e,n.quantity_refunded),qty:n.quantity_refunded}}(n,e)})),shipping_method:null}}function T(n){return{extra_attributes:n,id:n.number,customer_id:null,updated_at:null,created_at:n.order_date,status:n.status,totals:f(n.total),applied_codes:n.total.discounts.map(p),items:n.items.map((function(e){return v(e,n,e.quantity_ordered)})),billing_addresses:[y(n.billing_address,n)],shipping_addresses:[y(n.shipping_address,n)],shipments:n.shipments.map((function(e){return I(e,n)})),payment:b(n.payment_methods[0],n),invoices:n.invoices.map((function(e,r){return q(e,n,n.payment_methods[r])})),credits:n.credit_memos.map((function(e){return O(e,n)}))}}(c=n.MagentoOrderItemType||(n.MagentoOrderItemType={})).Simple="simple",c.Configurable="configurable",c.Bundle="bundle";Object.create;function x(n){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&n[e],t=0;if(r)return r.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&t>=n.length&&(n=void 0),{value:n&&n[t++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n,e){var r="function"==typeof Symbol&&n[Symbol.iterator];if(!r)return n;var t,o,a=r.call(n),d=[];try{for(;(void 0===e||e-- >0)&&!(t=a.next()).done;)d.push(t.value)}catch(n){o={error:n}}finally{try{t&&!t.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return d}function C(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(S(arguments[e]));return n}function M(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}Object.create;var D,w,k,j,A,F,G,E,P,B,N,R,$,U,z,H,J,K,L=t.gql(D||(D=M(["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n"],["\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n"]))),Q=t.gql(w||(w=M(["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"],["\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n"]))),V=t.gql(k||(k=M(["\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ","\n"],["\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ","\n"])),Q),W=t.gql(j||(j=M(["\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),X=t.gql(A||(A=M(["\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),Y=t.gql(F||(F=M(["\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ","\n ","\n"],["\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ","\n ","\n"])),W,X),Z=t.gql(G||(G=M(["\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),nn=t.gql(E||(E=M(["\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),en=t.gql(P||(P=M(["\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ","\n ","\n"],["\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ","\n ","\n"])),Z,nn),rn=t.gql(B||(B=M(["\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n"],["\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n"]))),tn=t.gql(N||(N=M(["\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ","\n"],["\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ","\n"])),V),on=t.gql(R||(R=M(["\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n"],["\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n"]))),an=t.gql($||($=M(["\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ","\n ","\n"],["\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ","\n ","\n"])),tn,on),dn=t.gql(U||(U=M(["\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"],["\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n"]))),ln=t.gql(z||(z=M(["\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"],["\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"])),V,an,rn,en,Y,L,dn),un=function(n){return void 0===n&&(n=[]),t.gql(H||(H=M(["\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ","\n }\n }\n }\n ","\n ","\n"],["\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ","\n }\n }\n }\n ","\n ","\n"])),o.daffBuildFragmentNameSpread.apply(void 0,C(n)),ln,o.daffBuildFragmentDefinition.apply(void 0,C(n)))},sn=new a.InjectionToken("DaffMagentoExtraOrderFragments",{factory:function(){return[]}});!function(n){n.CART_NOT_FOUND="graphql-no-such-entity"}(J||(J={}));var mn=((K={})[J.CART_NOT_FOUND]=s.DaffCartNotFoundError,K);var cn=function(n){var e,r;if(null===(r=null===(e=n.data)||void 0===e?void 0:e.graycoreGuestOrders)||void 0===r?void 0:r.items){if(n.data.graycoreGuestOrders.items.reduce((function(n,e){return n&&!!(e.billing_address&&e.shipping_address&&e.payment_methods)}),!0))return n;throw new l.DaffOrderInvalidAPIResponseError("One of the orders does not contain required fields.")}throw new l.DaffOrderInvalidAPIResponseError("Get orders response does not contain a valid list of orders.")},fn=function(){function n(n,e){this.apollo=n,this.extraOrderFragments=e}return n.prototype.list=function(n){return this.apollo.query({query:un(this.extraOrderFragments),variables:{cartId:n}}).pipe(i.map(cn),i.map((function(n){return n.data.graycoreGuestOrders.items.map(T)})),i.catchError((function(n){return d.throwError((e=n,u.daffTransformMagentoError(e,mn)));var e})))},n.prototype.get=function(n,e){return this.list(e).pipe(i.map((function(e){var r,t;try{for(var o=x(e),a=o.next();!a.done;a=o.next()){var d=a.value;if(d.id===n)return d}}catch(n){r={error:n}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}throw new l.DaffOrderNotFoundError("Could not find an order with ID "+n)})))},n}();fn.ɵprov=a.ɵɵdefineInjectable({factory:function(){return new fn(a.ɵɵinject(t.Apollo),a.ɵɵinject(sn))},token:fn,providedIn:"root"}),fn.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],fn.ctorParameters=function(){return[{type:t.Apollo},{type:Array,decorators:[{type:a.Inject,args:[sn]}]}]};var pn=function(){function n(){}return n.forRoot=function(){return{ngModule:n,providers:[{provide:l.DaffOrderDriver,useExisting:fn}]}},n}();pn.decorators=[{type:a.NgModule,args:[{imports:[m.CommonModule]}]}],n.DaffMagentoExtraOrderFragments=sn,n.DaffOrderMagentoDriverModule=pn,n.DaffOrderMagentoService=fn,n.daffMagentoTransformOrder=T,n.getGuestOrders=un,n.orderAddressFragment=L,n.orderFragment=ln,n.orderInvoiceFragment=en,n.orderItemFragment=V,n.orderPaymentFragment=rn,n.orderShipmentFragment=an,n.orderShipmentItemFragment=tn,n.orderShipmentTrackingFragment=on,Object.defineProperty(n,"__esModule",{value:!0})}));
|
2
2
|
//# sourceMappingURL=daffodil-order-driver-magento-2.4.1.umd.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../node_modules/tslib/tslib.es6.js","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts"],"names":["MagentoOrderItemType","transformTotals","totals","label","type","DaffOrderTotalTypeEnum","GrandTotal","value","grand_total","sort_order","Subtotal","subtotal","Shipping","total_shipping","Tax","total_tax","Discount","discounts","reduce","acc","discount","daffAdd","amount","transformCouponDiscount","code","transformConfigurableOption","option","attribute_label","value_label","transformBundleOption","option_label","values","product_name","transformItem","item","order","qty","d","rowTotal","product_sale_price","rowTotalWithDiscount","daffSubtract","Object","assign","DaffOrderItemType","Simple","id","item_id","qty_ordered","quantity_ordered","qty_canceled","quantity_canceled","qty_fulfilled","quantity_shipped","image","url","product_url_key","order_id","created_at","updated_at","product_id","parent_item_id","sku","product_sku","name","weight","price","discount_percent","Math","floor","discount_amount","tax_percent","tax_amount","row_total","row_total_with_discount","row_weight","tax_before_discount","product_type","Bundle","Composite","options","bundle_options","map","Configurable","attributes","selected_options","transformAdditionalItemFields","transformAddress","address","prefix","suffix","firstname","middlename","lastname","telephone","email","street","street2","city","region","region_id","country","country_code","postcode","transformShipmentTracking","tracking","tracking_number","number","tracking_url","carrier","title","carrier_logo","transformShipment","shipment","carrier_title","method","shipping_method","method_description","items","shipmentItem","order_item","transformShipmentItem","transformPayment","payment","findAdditionalData","key","index","additional_data","findIndex","_a","payment_id","cc_type","cc_last4","cc_owner","cc_exp_month","cc_exp_year","transformInvoice","invoice","total","billing_address","shipping_address","invoiceItem","quantity_invoiced","transformInvoiceItem","transformCredit","credit","payment_methods","creditItem","quantity_refunded","transformCreditItem","daffMagentoTransformOrder","extra_attributes","customer_id","order_date","status","applied_codes","billing_addresses","shipping_addresses","shipments","invoices","credits","credit_memos","create","__values","o","s","Symbol","iterator","m","i","call","length","next","done","TypeError","__read","n","r","e","ar","push","error","__spread","arguments","concat","__makeTemplateObject","cooked","raw","defineProperty","MagentoOrderGraphQlErrorCode","orderAddressFragment","gql","templateObject_1","orderBundleItemSelectedOptionFragment","templateObject_1$1","orderItemFragment","templateObject_2","orderCreditItemFragment","templateObject_1$2","orderCreditTotalFragment","templateObject_1$3","orderCreditFragment","templateObject_1$4","orderInvoiceItemFragment","templateObject_1$5","orderInvoiceTotalFragment","templateObject_1$6","orderInvoiceFragment","templateObject_1$7","orderPaymentFragment","templateObject_1$8","orderShipmentItemFragment","templateObject_1$9","orderShipmentTrackingFragment","templateObject_1$a","orderShipmentFragment","templateObject_1$b","orderTotalFragment","templateObject_1$c","orderFragment","templateObject_1$d","getGuestOrders","extraOrderFragments","templateObject_1$e","daffBuildFragmentNameSpread","apply","daffBuildFragmentDefinition","DaffMagentoExtraOrderFragments","InjectionToken","factory","DaffOrderMagentoErrorMap","CART_NOT_FOUND","DaffCartNotFoundError","validateGetOrdersResponse","response","_b","data","graycoreGuestOrders","DaffOrderInvalidAPIResponseError","DaffOrderMagentoService","apollo","this","prototype","list","cartId","query","variables","pipe","result","catchError","err","throwError","daffTransformMagentoError","get","orderId","orders","orders_1","orders_1_1","DaffOrderNotFoundError","Injectable","args","providedIn","Apollo","Inject","DaffOrderMagentoDriverModule","forRoot","ngModule","providers","provide","DaffOrderDriver","useExisting","NgModule","imports","CommonModule"],"mappings":"wyCAIA,IAAYA,ECuCZ,SAASC,EAAgBC,GACvB,MAAO,CACL,CACEC,MAAO,cACPC,KAAMC,EAAAA,uBAAuBC,WAC7BC,MA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AAAA,EAAOZ,KAAKC,oBAAoBvH,MAAMpC,IAAIoE,MACxDmG,EAAAA,YAAW,SAAAC,GAAO,OAAAC,EAAAA,YClDmBtE,EDkDmBqE,ECjDrDE,EAAAA,0BAA0BvE,EAAOiD,UADCjD,ODsDzC0D,EAAAG,UAAAW,IAAA,SAAIC,EAA0BV,GAC5B,OAAOH,KAAKE,KAAKC,GAAQG,KACvBrK,EAAAA,KAAI,SAAA6K,eACF,IAAoB,IAAAC,EAAA7F,EAAA4F,GAAME,EAAAD,EAAApF,QAAAqF,EAAApF,KAAAoF,EAAAD,EAAApF,OAAE,CAAvB,IAAMzI,EAAK8N,EAAA1P,MACd,GAAI4B,EAAMW,KAAOgN,EACf,OAAO3N,oGAKX,MAAM,IAAI+N,EAAAA,uBAAuB,mCAAmCJ,qKAhC3EK,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,qDAjCLC,EAAAA,sCAsCJC,EAAAA,OAAMH,KAAA,CAACjC,2BE3BZ,SAAAqC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CACT,CACEC,QAASC,EAAAA,gBACTC,YAAa/B,iCAZtBgC,EAAAA,SAAQX,KAAA,CAAC,CACRY,QAAS,CACPC,EAAAA","sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_id,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\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","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../node_modules/tslib/tslib.es6.js","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts"],"names":["MagentoOrderItemType","transformTotals","totals","label","type","DaffOrderTotalTypeEnum","GrandTotal","value","grand_total","sort_order","Subtotal","subtotal","Shipping","total_shipping","Tax","total_tax","Discount","discounts","reduce","acc","discount","daffAdd","amount","transformCouponDiscount","code","transformConfigurableOption","option","attribute_label","value_label","transformBundleOption","option_label","values","product_name","transformItem","item","order","qty","d","rowTotal","product_sale_price","rowTotalWithDiscount","daffSubtract","Object","assign","DaffOrderItemType","Simple","id","item_id","qty_ordered","quantity_ordered","qty_canceled","quantity_canceled","qty_fulfilled","quantity_shipped","image","url","product_url_key","order_id","created_at","updated_at","product_id","parent_item_id","sku","product_sku","name","weight","price","discount_percent","Math","floor","discount_amount","tax_percent","tax_amount","row_total","row_total_with_discount","row_weight","tax_before_discount","product_type","Bundle","Composite","options","bundle_options","map","Configurable","attributes","selected_options","transformAdditionalItemFields","transformAddress","address","prefix","suffix","firstname","middlename","lastname","telephone","email","street","street2","city","region","region_code","country","country_code","postcode","transformShipmentTracking","tracking","tracking_number","number","tracking_url","carrier","title","carrier_logo","transformShipment","shipment","carrier_title","method","shipping_method","method_description","items","shipmentItem","order_item","transformShipmentItem","transformPayment","payment","findAdditionalData","key","index","additional_data","findIndex","_a","payment_id","cc_type","cc_last4","cc_owner","cc_exp_month","cc_exp_year","transformInvoice","invoice","total","billing_address","shipping_address","invoiceItem","quantity_invoiced","transformInvoiceItem","transformCredit","credit","payment_methods","creditItem","quantity_refunded","transformCreditItem","daffMagentoTransformOrder","extra_attributes","customer_id","order_date","status","applied_codes","billing_addresses","shipping_addresses","shipments","invoices","credits","credit_memos","create","__values","o","s","Symbol","iterator","m","i","call","length","next","done","TypeError","__read","n","r","e","ar","push","error","__spread","arguments","concat","__makeTemplateObject","cooked","raw","defineProperty","MagentoOrderGraphQlErrorCode","orderAddressFragment","gql","templateObject_1","orderBundleItemSelectedOptionFragment","templateObject_1$1","orderItemFragment","templateObject_2","orderCreditItemFragment","templateObject_1$2","orderCreditTotalFragment","templateObject_1$3","orderCreditFragment","templateObject_1$4","orderInvoiceItemFragment","templateObject_1$5","orderInvoiceTotalFragment","templateObject_1$6","orderInvoiceFragment","templateObject_1$7","orderPaymentFragment","templateObject_1$8","orderShipmentItemFragment","templateObject_1$9","orderShipmentTrackingFragment","templateObject_1$a","orderShipmentFragment","templateObject_1$b","orderTotalFragment","templateObject_1$c","orderFragment","templateObject_1$d","getGuestOrders","extraOrderFragments","templateObject_1$e","daffBuildFragmentNameSpread","apply","daffBuildFragmentDefinition","DaffMagentoExtraOrderFragments","InjectionToken","factory","DaffOrderMagentoErrorMap","CART_NOT_FOUND","DaffCartNotFoundError","validateGetOrdersResponse","response","_b","data","graycoreGuestOrders","DaffOrderInvalidAPIResponseError","DaffOrderMagentoService","apollo","this","prototype","list","cartId","query","variables","pipe","result","catchError","err","throwError","daffTransformMagentoError","get","orderId","orders","orders_1","orders_1_1","DaffOrderNotFoundError","Injectable","args","providedIn","Apollo","Inject","DaffOrderMagentoDriverModule","forRoot","ngModule","providers","provide","DaffOrderDriver","useExisting","NgModule","imports","Comm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AOxB,GAAeoB,KAAKnB,qBAC3BwB,UAAW,CACTF,OAAMA,KAEPG,KACDrK,EAAAA,IAAIuJ,IACJvJ,EAAAA,KAAI,SAAAsK,GAAU,OAAAA,EAAOZ,KAAKC,oBAAoBvH,MAAMpC,IAAIoE,MACxDmG,EAAAA,YAAW,SAAAC,GAAO,OAAAC,EAAAA,YClDmBtE,EDkDmBqE,ECjDrDE,EAAAA,0BAA0BvE,EAAOiD,UADCjD,ODsDzC0D,EAAAG,UAAAW,IAAA,SAAIC,EAA0BV,GAC5B,OAAOH,KAAKE,KAAKC,GAAQG,KACvBrK,EAAAA,KAAI,SAAA6K,eACF,IAAoB,IAAAC,EAAA7F,EAAA4F,GAAME,EAAAD,EAAApF,QAAAqF,EAAApF,KAAAoF,EAAAD,EAAApF,OAAE,CAAvB,IAAMzI,EAAK8N,EAAA1P,MACd,GAAI4B,EAAMW,KAAOgN,EACf,OAAO3N,oGAKX,MAAM,IAAI+N,EAAAA,uBAAuB,mCAAmCJ,qKAhC3EK,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,qDAjCLC,EAAAA,sCAsCJC,EAAAA,OAAMH,KAAA,CAACjC,2BE3BZ,SAAAqC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CACT,CACEC,QAASC,EAAAA,gBACTC,YAAa/B,iCAZtBgC,EAAAA,SAAQX,KAAA,CAAC,CACRY,QAAS,CACPC,EAAAA","sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_code,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\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","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
;
|
2
2
|
export {};
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXItYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvb3JkZXIvZHJpdmVyL21hZ2VudG8vMi40LjEvc3JjL21vZGVscy9yZXNwb25zZXMvb3JkZXItYWRkcmVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQkMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgTWFnZW50b09yZGVyQWRkcmVzcyB7XG4gIF9fdHlwZW5hbWU/
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXItYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvb3JkZXIvZHJpdmVyL21hZ2VudG8vMi40LjEvc3JjL21vZGVscy9yZXNwb25zZXMvb3JkZXItYWRkcmVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQkMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgTWFnZW50b09yZGVyQWRkcmVzcyB7XG4gIF9fdHlwZW5hbWU/OiAnT3JkZXJBZGRyZXNzJztcbiAgY2l0eTogc3RyaW5nO1xuICBjb21wYW55OiBzdHJpbmc7XG4gIGNvdW50cnlfY29kZTogc3RyaW5nO1xuICBmYXg6IHN0cmluZztcbiAgZmlyc3RuYW1lOiBzdHJpbmc7XG4gIG1pZGRsZW5hbWU6IHN0cmluZztcbiAgbGFzdG5hbWU6IHN0cmluZztcbiAgcG9zdGNvZGU6IHN0cmluZztcbiAgcHJlZml4OiBzdHJpbmc7XG4gIHJlZ2lvbjogc3RyaW5nO1xuICByZWdpb25fY29kZTogc3RyaW5nO1xuICBzdHJlZXQ6IHN0cmluZ1tdO1xuICBzdWZmaXg6IHN0cmluZztcbiAgdGVsZXBob25lOiBzdHJpbmc7XG59O1xuIl19
|
@@ -11,10 +11,10 @@ export const orderAddressFragment = gql `
|
|
11
11
|
postcode
|
12
12
|
prefix
|
13
13
|
region
|
14
|
-
|
14
|
+
region_code
|
15
15
|
street
|
16
16
|
suffix
|
17
17
|
telephone
|
18
18
|
}
|
19
19
|
`;
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXItYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvb3JkZXIvZHJpdmVyL21hZ2VudG8vMi40LjEvc3JjL3F1ZXJpZXMvZnJhZ21lbnRzL29yZGVyLWFkZHJlc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBR3JDLE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFHLEdBQUcsQ0FBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FpQnRDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBncWwgfSBmcm9tICdhcG9sbG8tYW5ndWxhcic7XG5cblxuZXhwb3J0IGNvbnN0IG9yZGVyQWRkcmVzc0ZyYWdtZW50ID0gZ3FsYFxuICBmcmFnbWVudCBvcmRlckFkZHJlc3Mgb24gT3JkZXJBZGRyZXNzIHtcbiAgICBjaXR5XG4gICAgY29tcGFueVxuICAgIGNvdW50cnlfY29kZVxuICAgIGZheFxuICAgIGZpcnN0bmFtZVxuICAgIG1pZGRsZW5hbWVcbiAgICBsYXN0bmFtZVxuICAgIHBvc3Rjb2RlXG4gICAgcHJlZml4XG4gICAgcmVnaW9uXG4gICAgcmVnaW9uX2NvZGVcbiAgICBzdHJlZXRcbiAgICBzdWZmaXhcbiAgICB0ZWxlcGhvbmVcbiAgfVxuYDtcbiJdfQ==
|
@@ -95,7 +95,7 @@ function transformAddress(address, order) {
|
|
95
95
|
street: address.street[0],
|
96
96
|
street2: address.street[1],
|
97
97
|
city: address.city,
|
98
|
-
region: address.
|
98
|
+
region: address.region_code,
|
99
99
|
country: address.country_code,
|
100
100
|
postcode: address.postcode,
|
101
101
|
};
|
@@ -204,4 +204,4 @@ export function daffMagentoTransformOrder(order) {
|
|
204
204
|
credits: order.credit_memos.map(credit => transformCredit(credit, order)),
|
205
205
|
};
|
206
206
|
}
|
207
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL29yZGVyL2RyaXZlci9tYWdlbnRvLzIuNC4xL3NyYy90cmFuc2Zvcm1zL3Jlc3BvbnNlcy9vcmRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsT0FBTyxFQUNQLFlBQVksR0FDYixNQUFNLGdCQUFnQixDQUFDO0FBQ3hCLE9BQU8sRUFVTCxzQkFBc0IsRUFFdEIsaUJBQWlCLEdBR2xCLE1BQU0saUJBQWlCLENBQUM7QUFNekIsT0FBTyxFQUlMLG9CQUFvQixHQUNyQixNQUFNLG1DQUFtQyxDQUFDO0FBYTNDLFNBQVMsZUFBZSxDQUFDLE1BQXlCO0lBQ2hELE9BQU87UUFDTDtZQUNFLEtBQUssRUFBRSxhQUFhO1lBQ3BCLElBQUksRUFBRSxzQkFBc0IsQ0FBQyxVQUFVO1lBQ3ZDLEtBQUssRUFBRSxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUs7WUFDL0IsVUFBVSxFQUFFLENBQUM7U0FDZDtRQUNEO1lBQ0UsS0FBSyxFQUFFLFVBQVU7WUFDakIsSUFBSSxFQUFFLHNCQUFzQixDQUFDLFFBQVE7WUFDckMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxRQUFRLENBQUMsS0FBSztZQUM1QixVQUFVLEVBQUUsQ0FBQztTQUNkO1FBQ0Q7WUFDRSxLQUFLLEVBQUUsVUFBVTtZQUNqQixJQUFJLEVBQUUsc0JBQXNCLENBQUMsUUFBUTtZQUNyQyxL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mluZCBvdXQgaWYgdGhlIGluZGV4IGlzIHRoZSBjb3JyZWN0IHBheW1lbnQgZm9yIGludm9pY2VcbiAgICBpbnZvaWNlczogb3JkZXIuaW52b2ljZXMubWFwKChpbnZvaWNlLCBpbmRleCkgPT4gdHJhbnNmb3JtSW52b2ljZShpbnZvaWNlLCBvcmRlciwgb3JkZXIucGF5bWVudF9tZXRob2RzW2luZGV4XSkpLFxuICAgIGNyZWRpdHM6IG9yZGVyLmNyZWRpdF9tZW1vcy5tYXAoY3JlZGl0ID0+IHRyYW5zZm9ybUNyZWRpdChjcmVkaXQsIG9yZGVyKSksXG4gIH07XG59XG4iXX0=
|
@@ -116,7 +116,7 @@ function transformAddress(address, order) {
|
|
116
116
|
street: address.street[0],
|
117
117
|
street2: address.street[1],
|
118
118
|
city: address.city,
|
119
|
-
region: address.
|
119
|
+
region: address.region_code,
|
120
120
|
country: address.country_code,
|
121
121
|
postcode: address.postcode,
|
122
122
|
};
|
@@ -244,7 +244,7 @@ const orderAddressFragment = gql `
|
|
244
244
|
postcode
|
245
245
|
prefix
|
246
246
|
region
|
247
|
-
|
247
|
+
region_code
|
248
248
|
street
|
249
249
|
suffix
|
250
250
|
telephone
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-order-driver-magento-2.4.1.js","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_id,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;IAIY;AAAZ,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qDAA6B,CAAA;IAC7B,yCAAiB,CAAA;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAAA,CAAC;AAYD,CAAC;AAyBD,CAAC;AAOD,CAAC;AAID;;ACbD,SAAS,eAAe,CAAC,MAAyB;IAChD,OAAO;QACL;YACE,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UAAU;YACvC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;YAC/B,UAAU,EAAE,CAAC;SACd;QACD;YACE,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;YACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC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AQ,EAAE,4BAA4B;YACtC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,eAAe;oBACxB,WAAW,EAAE,uBAAuB;iBACrC;aACF;SACF,CAAC;KACH;;;YAhBF,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;iBACb;aACF;;;ACdD;;;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-order-driver-magento-2.4.1.js","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_code,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n\tCART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;IAIY;AAAZ,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qDAA6B,CAAA;IAC7B,yCAAiB,CAAA;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAAA,CAAC;AAYD,CAAC;AAyBD,CAAC;AAOD,CAAC;AAID;;ACbD,SAAS,eAAe,CAAC,MAAyB;IAChD,OAAO;QACL;YACE,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UAAU;YACvC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;YAC/B,UAAU,EAAE,CAAC;SACd;QACD;YACE,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;YACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK;YAC5B,UAAU,EAAE,CAAC;SACd;QACD;YACE,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;YACrC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK;YAClC,UAAU,EAAE,CAAC;SACd;QACD;YACE,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,sBAAsB,CAAC,GAAG;YAChC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK;YAC7B,UAAU,EAAE,CAAC;SACd;QACD;YACE,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;YACrC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC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CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,EACnF,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,CAC/D,CAAC;KACH;IAED,GAAG,CAAC,OAAwB,EAAE,MAAuB;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAC3B,GAAG,CAAC,MAAM;YACR,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBAC1B,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,EAAE;oBACxB,OAAO,KAAK,CAAC;iBACd;aACF;;YAGD,MAAM,IAAI,sBAAsB,CAAC,mCAAmC,OAAO,EAAE,CAAC,CAAC;SAChF,CAAC,CACH,CAAC;KACH;;;;YAnCF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAlCQ,MAAM;wCAsCV,MAAM,SAAC,8BAA8B;;;MC3B7B,4BAA4B;IACvC,OAAO,OAAO;QACZ,OAAO;YACL,QAAQ,EAAE,4BAA4B;YACtC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,eAAe;oBACxB,WAAW,EAAE,uBAAuB;iBACrC;aACF;SACF,CAAC;KACH;;;YAhBF,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;iBACb;aACF;;;ACdD;;;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@daffodil/order",
|
3
|
-
"version": "0.39.
|
3
|
+
"version": "0.39.13",
|
4
4
|
"description": "A client-side Angular package for managing ecommerce orders agnostic to the ecommerce platform.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -15,10 +15,10 @@
|
|
15
15
|
"peerDependencies": {
|
16
16
|
"@angular/core": "^11.0.0",
|
17
17
|
"@angular/common": "^11.0.0",
|
18
|
-
"@daffodil/cart": "0.39.
|
19
|
-
"@daffodil/core": "0.39.
|
20
|
-
"@daffodil/geography": "0.39.
|
21
|
-
"@daffodil/product": "0.39.
|
18
|
+
"@daffodil/cart": "0.39.13",
|
19
|
+
"@daffodil/core": "0.39.13",
|
20
|
+
"@daffodil/geography": "0.39.13",
|
21
|
+
"@daffodil/product": "0.39.13"
|
22
22
|
},
|
23
23
|
"main": "bundles/daffodil-order.umd.js",
|
24
24
|
"module": "fesm2015/daffodil-order.js",
|