@reactionary/feeds 0.12.2 → 0.12.3

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.
Files changed (2) hide show
  1. package/cli.cjs +13 -4
  2. package/package.json +9 -9
package/cli.cjs CHANGED
@@ -160944,6 +160944,9 @@ var init_category_capability5 = __esm({
160944
160944
  });
160945
160945
 
160946
160946
  // packages/medusa/src/capabilities/checkout.capability.ts
160947
+ function isCartAlreadyCompleted(error5) {
160948
+ return error5 instanceof Error && /is already completed/i.test(error5.message);
160949
+ }
160947
160950
  var import_debug24, debug24, CheckoutNotReadyForFinalizationError3, MedusaCheckoutCapability;
160948
160951
  var init_checkout_capability5 = __esm({
160949
160952
  "packages/medusa/src/capabilities/checkout.capability.ts"() {
@@ -161299,11 +161302,17 @@ var init_checkout_capability5 = __esm({
161299
161302
  if (!checkout.value.resultingOrder) {
161300
161303
  const client = await this.medusaApi.getClient();
161301
161304
  const medusaId = payload.checkout;
161302
- await client.store.cart.update(medusaId.key, {
161303
- metadata: {
161304
- cart_id: medusaId.key
161305
+ try {
161306
+ await client.store.cart.update(medusaId.key, {
161307
+ metadata: {
161308
+ cart_id: medusaId.key
161309
+ }
161310
+ });
161311
+ } catch (error5) {
161312
+ if (!isCartAlreadyCompleted(error5)) {
161313
+ throw error5;
161305
161314
  }
161306
- });
161315
+ }
161307
161316
  const response = await client.store.cart.complete(medusaId.key);
161308
161317
  if (response.type === "order") {
161309
161318
  const resultingOrder = this.parseCompletedOrderIdentifier(response.order);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/feeds",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -12,14 +12,14 @@
12
12
  "url": "git+https://github.com/Solteq/reactionary.git"
13
13
  },
14
14
  "dependencies": {
15
- "@reactionary/algolia": "0.12.2",
16
- "@reactionary/commercetools": "0.12.2",
17
- "@reactionary/core": "0.12.2",
18
- "@reactionary/fake": "0.12.2",
19
- "@reactionary/magento": "0.12.2",
20
- "@reactionary/medusa": "0.12.2",
21
- "@reactionary/meilisearch": "0.12.2",
22
- "@reactionary/unomi": "0.12.2",
15
+ "@reactionary/algolia": "0.12.3",
16
+ "@reactionary/commercetools": "0.12.3",
17
+ "@reactionary/core": "0.12.3",
18
+ "@reactionary/fake": "0.12.3",
19
+ "@reactionary/magento": "0.12.3",
20
+ "@reactionary/medusa": "0.12.3",
21
+ "@reactionary/meilisearch": "0.12.3",
22
+ "@reactionary/unomi": "0.12.3",
23
23
  "commander": "^15.0.0",
24
24
  "dotenv": "^17.2.2",
25
25
  "sitemap": "^9.0.1",