@reactionary/provider-commercetools 0.2.19 → 0.3.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.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@reactionary/provider-commercetools",
3
- "version": "0.2.19",
3
+ "version": "0.3.0",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.2.19",
7
+ "@reactionary/core": "0.3.0",
8
8
  "debug": "^4.4.3",
9
9
  "zod": "4.1.9",
10
10
  "@commercetools/ts-client": "^4.2.1",
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -440,12 +441,17 @@ class CommercetoolsCheckoutProvider extends CheckoutProvider {
440
441
  return result;
441
442
  }
442
443
  isReadyForFinalization(price, paymentInstructions, billingAddress, shippingAddress, shippingInstruction) {
443
- if (!billingAddress) return false;
444
- if (!shippingInstruction) return false;
445
- if (!shippingAddress && !shippingInstruction.pickupPoint) return false;
446
- if (paymentInstructions.length === 0) return false;
444
+ if (!billingAddress)
445
+ return false;
446
+ if (!shippingInstruction)
447
+ return false;
448
+ if (!shippingAddress && !shippingInstruction.pickupPoint)
449
+ return false;
450
+ if (paymentInstructions.length === 0)
451
+ return false;
447
452
  const authorizedPayments = paymentInstructions.filter((pi) => pi.status === "authorized").map((x) => x.amount.value).reduce((a, b) => a + b, 0);
448
- if (price.grandTotal.value !== authorizedPayments) return false;
453
+ if (price.grandTotal.value !== authorizedPayments)
454
+ return false;
449
455
  return true;
450
456
  }
451
457
  parsePaymentInstruction(remote) {
@@ -502,7 +508,8 @@ class CommercetoolsCheckoutProvider extends CheckoutProvider {
502
508
  };
503
509
  }
504
510
  parseShippingInstruction(remote) {
505
- if (!remote.shippingInfo) return void 0;
511
+ if (!remote.shippingInfo)
512
+ return void 0;
506
513
  const instructions = remote.custom?.fields["shippingInstruction"] || "";
507
514
  const consentForUnattendedDelivery = remote.custom?.fields["consentForUnattendedDelivery"] === "true" || false;
508
515
  const pickupPoint = remote.custom?.fields["pickupPointId"] || "";
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import { InventoryProvider, InventoryQueryBySKUSchema, InventorySchema, Reactionary, success, error } from "@reactionary/core";
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import { OrderProvider, OrderQueryByIdSchema, OrderSchema, Reactionary, success, error } from "@reactionary/core";
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import {
@@ -5,7 +5,8 @@ var __decorateClass = (decorators, target, key, kind) => {
5
5
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
6
  if (decorator = decorators[i])
7
7
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
8
+ if (kind && result)
9
+ __defProp(target, key, result);
9
10
  return result;
10
11
  };
11
12
  import { Reactionary, StoreProvider, StoreQueryByProximitySchema, StoreSchema, success, error } from "@reactionary/core";