@reactionary/commercetools 0.10.1 → 0.10.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Solteq
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -39,6 +38,7 @@ class CheckoutNotReadyForFinalizationError extends Error {
39
38
  this.checkoutIdentifier = checkoutIdentifier;
40
39
  this.name = "CheckoutNotReadyForFinalizationError";
41
40
  }
41
+ checkoutIdentifier;
42
42
  }
43
43
  class CommercetoolsCheckoutCapability extends CheckoutCapability {
44
44
  config;
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import * as crypto from "crypto";
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import { InventoryCapability, InventoryQueryBySKUSchema, InventorySchema, Reactionary, success, error } from "@reactionary/core";
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import { OrderCapability, OrderQueryByIdSchema, OrderSchema, Reactionary, success, error } from "@reactionary/core";
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -27,6 +26,9 @@ class CommercetoolsProductCapability extends ProductCapability {
27
26
  this.commercetools = commercetools;
28
27
  this.factory = factory;
29
28
  }
29
+ config;
30
+ commercetools;
31
+ factory;
30
32
  async getClient() {
31
33
  const client = await this.commercetools.getClient();
32
34
  return client.withProjectKey({ projectKey: this.config.projectKey }).productProjections();
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import {
@@ -5,8 +5,7 @@ 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)
9
- __defProp(target, key, result);
8
+ if (kind && result) __defProp(target, key, result);
10
9
  return result;
11
10
  };
12
11
  import { Reactionary, StoreCapability, StoreQueryByProximitySchema, StoreSchema, success, error } from "@reactionary/core";
@@ -4,6 +4,8 @@ class RequestContextTokenCache {
4
4
  this.context = context;
5
5
  this.sessionProviderKey = sessionProviderKey;
6
6
  }
7
+ context;
8
+ sessionProviderKey;
7
9
  async get(tokenCacheOptions) {
8
10
  const session = CommercetoolsSessionSchema.parse(
9
11
  this.context.session[this.sessionProviderKey] || {}
@@ -155,17 +155,12 @@ class CommercetoolsCheckoutFactory {
155
155
  return CheckoutItemSchema.parse(item);
156
156
  }
157
157
  isReadyForFinalization(price, paymentInstructions, billingAddress, shippingAddress, shippingInstruction) {
158
- if (!billingAddress)
159
- return false;
160
- if (!shippingInstruction)
161
- return false;
162
- if (!shippingAddress && !shippingInstruction.pickupPoint)
163
- return false;
164
- if (paymentInstructions.length === 0)
165
- return false;
158
+ if (!billingAddress) return false;
159
+ if (!shippingInstruction) return false;
160
+ if (!shippingAddress && !shippingInstruction.pickupPoint) return false;
161
+ if (paymentInstructions.length === 0) return false;
166
162
  const authorizedPayments = paymentInstructions.filter((paymentInstruction) => paymentInstruction.status === "authorized").map((paymentInstruction) => paymentInstruction.amount.value).reduce((sum, value) => sum + value, 0);
167
- if (price.grandTotal.value !== authorizedPayments)
168
- return false;
163
+ if (price.grandTotal.value !== authorizedPayments) return false;
169
164
  return true;
170
165
  }
171
166
  parsePaymentInstruction(context, data) {
@@ -221,8 +216,7 @@ class CommercetoolsCheckoutFactory {
221
216
  };
222
217
  }
223
218
  parseShippingInstruction(data) {
224
- if (!data.shippingInfo)
225
- return void 0;
219
+ if (!data.shippingInfo) return void 0;
226
220
  const instructions = data.custom?.fields["shippingInstruction"] || "";
227
221
  const consentForUnattendedDelivery = data.custom?.fields["consentForUnattendedDelivery"] === "true";
228
222
  const pickupPoint = data.custom?.fields["pickupPointId"] || "";
@@ -10,6 +10,8 @@ class CommercetoolsEmployeeInvitationFactory {
10
10
  employeeIssuedInvitationSchema = EmployeeIssuedInvitationSchema;
11
11
  employeeInvitationPaginatedListSchema = EmployeeInvitationPaginatedListSchema;
12
12
  parseEmployeeInvitation(context, data, payload) {
13
+ void context;
14
+ void payload;
13
15
  const result = {
14
16
  identifier: {
15
17
  key: data.key
@@ -1,6 +1,8 @@
1
1
  const assertType = (_value) => {
2
+ void _value;
2
3
  };
3
4
  const assertNotAny = (_value) => {
5
+ void _value;
4
6
  };
5
7
  export {
6
8
  assertNotAny,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/commercetools",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -9,14 +9,13 @@
9
9
  "url": "git+https://github.com/Solteq/reactionary.git"
10
10
  },
11
11
  "dependencies": {
12
- "@reactionary/core": "0.10.1",
12
+ "@reactionary/core": "0.10.3",
13
13
  "zod": "4.1.9",
14
14
  "@commercetools/ts-client": "^4.9.1",
15
15
  "@commercetools/platform-sdk": "^8.25.0",
16
16
  "debug": "^4.4.3"
17
17
  },
18
18
  "devDependencies": {
19
- "@nx/vite": "22.4.5",
20
19
  "vitest": "^4.0.9"
21
20
  },
22
21
  "sideEffects": false
@@ -92,3 +92,4 @@ function createMergedClientExample() {
92
92
  });
93
93
  return client;
94
94
  }
95
+ void createMergedClientExample;