medusa-core-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1-next.57
@@ -29,3 +29,36 @@ "use strict"; | ||
_joi["default"].dateFilter = function () { | ||
return _joi["default"].object({ | ||
lt: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
gt: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
gte: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
lte: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()) | ||
}); | ||
}; | ||
_joi["default"].orderFilter = function () { | ||
return _joi["default"].object().keys({ | ||
id: _joi["default"].string(), | ||
q: _joi["default"].string(), | ||
status: _joi["default"].array().items(_joi["default"].string().valid("pending", "completed", "archived", "canceled", "requires_action")).single(), | ||
fulfillment_status: _joi["default"].array().items(_joi["default"].string().valid("not_fulfilled", "fulfilled", "partially_fulfilled", "shipped", "partially_shipped", "canceled", "returned", "partially_returned", "requires_action")).single(), | ||
payment_status: _joi["default"].array().items(_joi["default"].string().valid("captured", "awaiting", "not_paid", "refunded", "partially_refunded", "canceled", "requires_action")).single(), | ||
display_id: _joi["default"].string(), | ||
cart_id: _joi["default"].string(), | ||
offset: _joi["default"].string(), | ||
limit: _joi["default"].string(), | ||
expand: _joi["default"].string(), | ||
fields: _joi["default"].string(), | ||
customer_id: _joi["default"].string(), | ||
email: _joi["default"].string(), | ||
region_id: _joi["default"].string(), | ||
currency_code: _joi["default"].string(), | ||
tax_rate: _joi["default"].string(), | ||
canceled_at: _joi["default"].dateFilter(), | ||
created_at: _joi["default"].dateFilter(), | ||
updated_at: _joi["default"].dateFilter() | ||
}); | ||
}; | ||
var _default = _joi["default"]; | ||
exports["default"] = _default; |
{ | ||
"name": "medusa-core-utils", | ||
"version": "1.1.0", | ||
"version": "1.1.1-next.57+60f16491", | ||
"description": "Core utils for Medusa", | ||
@@ -36,3 +36,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "ff49d2332252e7f0e03312e8c9123ed756217807" | ||
"gitHead": "60f164913d022132c8f6a00fc3c4b66c590b2d6e" | ||
} |
@@ -20,2 +20,71 @@ import Joi from "joi" | ||
Joi.dateFilter = () => { | ||
return Joi.object({ | ||
lt: Joi.alternatives(Joi.date().timestamp("unix"), Joi.date()), | ||
gt: Joi.alternatives(Joi.date().timestamp("unix"), Joi.date()), | ||
gte: Joi.alternatives(Joi.date().timestamp("unix"), Joi.date()), | ||
lte: Joi.alternatives(Joi.date().timestamp("unix"), Joi.date()), | ||
}) | ||
} | ||
Joi.orderFilter = () => { | ||
return Joi.object().keys({ | ||
id: Joi.string(), | ||
q: Joi.string(), | ||
status: Joi.array() | ||
.items( | ||
Joi.string().valid( | ||
"pending", | ||
"completed", | ||
"archived", | ||
"canceled", | ||
"requires_action" | ||
) | ||
) | ||
.single(), | ||
fulfillment_status: Joi.array() | ||
.items( | ||
Joi.string().valid( | ||
"not_fulfilled", | ||
"fulfilled", | ||
"partially_fulfilled", | ||
"shipped", | ||
"partially_shipped", | ||
"canceled", | ||
"returned", | ||
"partially_returned", | ||
"requires_action" | ||
) | ||
) | ||
.single(), | ||
payment_status: Joi.array() | ||
.items( | ||
Joi.string().valid( | ||
"captured", | ||
"awaiting", | ||
"not_paid", | ||
"refunded", | ||
"partially_refunded", | ||
"canceled", | ||
"requires_action" | ||
) | ||
) | ||
.single(), | ||
display_id: Joi.string(), | ||
cart_id: Joi.string(), | ||
offset: Joi.string(), | ||
limit: Joi.string(), | ||
expand: Joi.string(), | ||
fields: Joi.string(), | ||
customer_id: Joi.string(), | ||
email: Joi.string(), | ||
region_id: Joi.string(), | ||
currency_code: Joi.string(), | ||
tax_rate: Joi.string(), | ||
canceled_at: Joi.dateFilter(), | ||
created_at: Joi.dateFilter(), | ||
updated_at: Joi.dateFilter(), | ||
}) | ||
} | ||
export default Joi |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63372
2156
8
22
2
1