rerobe-js-orm 4.6.9 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -439,15 +439,29 @@ class Order extends Base_1.default {
439
439
  return num.toFixed(2);
440
440
  };
441
441
  const lineItems = (this.lineItems || []).map((item) => {
442
- var _a, _b;
443
- return ({
444
- quantity: Number(item.quantity || 1),
445
- variantId: item.shopifyVariantId ||
446
- ((_a = item.variant) === null || _a === void 0 ? void 0 : _a.shopifyId) ||
447
- item.shopifyProductId ||
448
- ((_b = item.variant) === null || _b === void 0 ? void 0 : _b.id) ||
449
- '',
450
- });
442
+ var _a, _b, _c, _d;
443
+ const shopifyVariantId = item.shopifyVariantId || ((_a = item.variant) === null || _a === void 0 ? void 0 : _a.shopifyId) || item.shopifyProductId || ((_b = item.variant) === null || _b === void 0 ? void 0 : _b.id);
444
+ if (shopifyVariantId)
445
+ return {
446
+ quantity: Number(item.quantity || 1),
447
+ variantId: item.shopifyVariantId ||
448
+ ((_c = item.variant) === null || _c === void 0 ? void 0 : _c.shopifyId) ||
449
+ item.shopifyProductId ||
450
+ ((_d = item.variant) === null || _d === void 0 ? void 0 : _d.id) ||
451
+ '',
452
+ };
453
+ else
454
+ return {
455
+ title: item.title,
456
+ originalUnitPriceWithCurrency: item.originalUnitPrice,
457
+ quantity: item.quantity,
458
+ weight: item.variant
459
+ ? {
460
+ value: item.variant.weight,
461
+ unit: 'GRAMS',
462
+ }
463
+ : undefined,
464
+ };
451
465
  });
452
466
  const tagsArray = Array.isArray(this.tags)
453
467
  ? this.tags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.6.9",
3
+ "version": "4.7.0",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",