@labdigital/commercetools-mock 2.22.0 → 2.23.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/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/predicateParser.test.ts +40 -0
- package/src/lib/predicateParser.ts +4 -0
- package/src/repositories/cart/actions.ts +9 -0
- package/src/repositories/customer/index.ts +5 -2
- package/src/services/cart.test.ts +20 -0
package/dist/index.cjs
CHANGED
|
@@ -1239,6 +1239,9 @@ var generateMatchFunc = (predicate) => {
|
|
|
1239
1239
|
} else {
|
|
1240
1240
|
const value = resolveValue(obj, left);
|
|
1241
1241
|
if (value) {
|
|
1242
|
+
if (Array.isArray(value)) {
|
|
1243
|
+
return value.some((item) => expr(item, vars));
|
|
1244
|
+
}
|
|
1242
1245
|
return expr(value, vars);
|
|
1243
1246
|
}
|
|
1244
1247
|
return false;
|
|
@@ -2515,6 +2518,9 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
|
|
|
2515
2518
|
}
|
|
2516
2519
|
resource.totalPrice.centAmount = calculateCartTotalPrice(resource);
|
|
2517
2520
|
}
|
|
2521
|
+
changeTaxRoundingMode(_context, resource, { taxRoundingMode }) {
|
|
2522
|
+
resource.taxRoundingMode = taxRoundingMode;
|
|
2523
|
+
}
|
|
2518
2524
|
recalculate() {
|
|
2519
2525
|
}
|
|
2520
2526
|
removeDiscountCode(context, resource, { discountCode }) {
|
|
@@ -3428,10 +3434,12 @@ var CustomerRepository = class extends AbstractResourceRepository {
|
|
|
3428
3434
|
}
|
|
3429
3435
|
const expiresAt = new Date(Date.now() + 30 * 60);
|
|
3430
3436
|
const customer = results.results[0];
|
|
3431
|
-
const
|
|
3437
|
+
const rest = getBaseResourceProperties();
|
|
3432
3438
|
const token = createPasswordResetToken(customer);
|
|
3433
3439
|
return {
|
|
3434
|
-
|
|
3440
|
+
id: rest.id,
|
|
3441
|
+
createdAt: rest.createdAt,
|
|
3442
|
+
lastModifiedAt: rest.lastModifiedAt,
|
|
3435
3443
|
customerId: customer.id,
|
|
3436
3444
|
expiresAt: expiresAt.toISOString(),
|
|
3437
3445
|
value: token
|