@labdigital/commercetools-mock 2.22.1 → 2.23.1
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 +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -3
- 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/custom-object.ts +5 -1
- package/src/repositories/customer/index.ts +5 -2
- package/src/services/custom-object.test.ts +19 -0
package/dist/index.js
CHANGED
|
@@ -1202,6 +1202,9 @@ var generateMatchFunc = (predicate) => {
|
|
|
1202
1202
|
} else {
|
|
1203
1203
|
const value = resolveValue(obj, left);
|
|
1204
1204
|
if (value) {
|
|
1205
|
+
if (Array.isArray(value)) {
|
|
1206
|
+
return value.some((item) => expr(item, vars));
|
|
1207
|
+
}
|
|
1205
1208
|
return expr(value, vars);
|
|
1206
1209
|
}
|
|
1207
1210
|
return false;
|
|
@@ -3225,7 +3228,11 @@ var CustomObjectRepository = class extends AbstractResourceRepository {
|
|
|
3225
3228
|
...params,
|
|
3226
3229
|
where: whereClause
|
|
3227
3230
|
});
|
|
3228
|
-
result.results = result.results.map(
|
|
3231
|
+
result.results = result.results.map(
|
|
3232
|
+
(r) => this.postProcessResource(context, r, {
|
|
3233
|
+
expand: params.expand
|
|
3234
|
+
})
|
|
3235
|
+
);
|
|
3229
3236
|
return result;
|
|
3230
3237
|
}
|
|
3231
3238
|
};
|
|
@@ -3394,10 +3401,12 @@ var CustomerRepository = class extends AbstractResourceRepository {
|
|
|
3394
3401
|
}
|
|
3395
3402
|
const expiresAt = new Date(Date.now() + 30 * 60);
|
|
3396
3403
|
const customer = results.results[0];
|
|
3397
|
-
const
|
|
3404
|
+
const rest = getBaseResourceProperties();
|
|
3398
3405
|
const token = createPasswordResetToken(customer);
|
|
3399
3406
|
return {
|
|
3400
|
-
|
|
3407
|
+
id: rest.id,
|
|
3408
|
+
createdAt: rest.createdAt,
|
|
3409
|
+
lastModifiedAt: rest.lastModifiedAt,
|
|
3401
3410
|
customerId: customer.id,
|
|
3402
3411
|
expiresAt: expiresAt.toISOString(),
|
|
3403
3412
|
value: token
|