Merge branch 'master' of https://github.com/medusajs/medusa
This commit is contained in:
commit
3cba8c51ea
25 files changed
+136
-94
No files matched your search
+1
-1
@@ -4,5 +4,5 @@
|
|||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"registry": "https://registry.npmjs.org/",
|
"registry": "https://registry.npmjs.org/",
|
||||||
"version": "1.0.0-alpha.26"
|
"version": "1.0.0-alpha.29"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-core-utils",
|
"name": "medusa-core-utils",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Core utils for Medusa",
|
"description": "Core utils for Medusa",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-file-spaces",
|
"name": "medusa-file-spaces",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Digital Ocean Spaces file connector for Medusa",
|
"description": "Digital Ocean Spaces file connector for Medusa",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
"aws-sdk": "^2.710.0",
|
"aws-sdk": "^2.710.0",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"stripe": "^8.50.0"
|
"stripe": "^8.50.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-fulfillment-manual",
|
"name": "medusa-fulfillment-manual",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "A manual fulfillment provider for Medusa",
|
"description": "A manual fulfillment provider for Medusa",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"@babel/plugin-transform-instanceof": "^7.8.3",
|
"@babel/plugin-transform-instanceof": "^7.8.3",
|
||||||
"@babel/runtime": "^7.7.6",
|
"@babel/runtime": "^7.7.6",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24"
|
"medusa-core-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-interfaces",
|
"name": "medusa-interfaces",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Core interfaces for Medusa",
|
"description": "Core interfaces for Medusa",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"mongoose": "5.x"
|
"mongoose": "5.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24"
|
"medusa-core-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-payment-adyen",
|
"name": "medusa-payment-adyen",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Adyen Payment provider for Medusa Commerce",
|
"description": "Adyen Payment provider for Medusa Commerce",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24"
|
"medusa-core-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-payment-klarna",
|
"name": "medusa-payment-klarna",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Klarna Payment provider for Medusa Commerce",
|
"description": "Klarna Payment provider for Medusa Commerce",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24"
|
"medusa-test-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-payment-stripe",
|
"name": "medusa-payment-stripe",
|
||||||
"version": "1.0.0-alpha.25",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Stripe Payment provider for Meduas Commerce",
|
"description": "Stripe Payment provider for Meduas Commerce",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"@babel/plugin-transform-classes": "^7.9.5",
|
"@babel/plugin-transform-classes": "^7.9.5",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"stripe": "^8.50.0"
|
"stripe": "^8.50.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -18,38 +18,39 @@ var inventorySync = /*#__PURE__*/function () {
|
|||||||
case 0:
|
case 0:
|
||||||
brightpearlService = container.resolve("brightpearlService");
|
brightpearlService = container.resolve("brightpearlService");
|
||||||
eventBus = container.resolve("eventBusService");
|
eventBus = container.resolve("eventBusService");
|
||||||
_context.prev = 2;
|
console.log("hi inventory");
|
||||||
_context.next = 5;
|
_context.prev = 3;
|
||||||
|
_context.next = 6;
|
||||||
return brightpearlService.getClient();
|
return brightpearlService.getClient();
|
||||||
|
|
||||||
case 5:
|
case 6:
|
||||||
client = _context.sent;
|
client = _context.sent;
|
||||||
pattern = "43 4,10,14,20 * * *"; // nice for tests "*/10 * * * * *"
|
pattern = "43 4,10,14,20 * * *"; // nice for tests "*/10 * * * * *"
|
||||||
|
|
||||||
eventBus.createCronJob("inventory-sync", {}, pattern, brightpearlService.syncInventory());
|
eventBus.createCronJob("inventory-sync", {}, pattern, brightpearlService.syncInventory());
|
||||||
_context.next = 15;
|
_context.next = 16;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 11:
|
||||||
_context.prev = 10;
|
_context.prev = 11;
|
||||||
_context.t0 = _context["catch"](2);
|
_context.t0 = _context["catch"](3);
|
||||||
|
|
||||||
if (!(_context.t0.name === "not_allowed")) {
|
if (!(_context.t0.name === "not_allowed")) {
|
||||||
_context.next = 14;
|
_context.next = 15;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _context.abrupt("return");
|
return _context.abrupt("return");
|
||||||
|
|
||||||
case 14:
|
case 15:
|
||||||
throw _context.t0;
|
throw _context.t0;
|
||||||
|
|
||||||
case 15:
|
case 16:
|
||||||
case "end":
|
case "end":
|
||||||
return _context.stop();
|
return _context.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, _callee, null, [[2, 10]]);
|
}, _callee, null, [[3, 11]]);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return function inventorySync(_x) {
|
return function inventorySync(_x) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-brightpearl",
|
"name": "medusa-plugin-brightpearl",
|
||||||
"version": "1.0.0-alpha.25",
|
"version": "1.0.0-alpha.29",
|
||||||
"description": "Brightpearl plugin for Medusa Commerce",
|
"description": "Brightpearl plugin for Medusa Commerce",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"cross-env": "^5.2.1",
|
"cross-env": "^5.2.1",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"jest": "^25.5.2",
|
"jest": "^25.5.2",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"prettier": "^2.0.5"
|
"prettier": "^2.0.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"axios-rate-limit": "^1.2.1",
|
"axios-rate-limit": "^1.2.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"randomatic": "^3.1.1"
|
"randomatic": "^3.1.1"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -125,27 +125,51 @@ class BrightpearlService extends BaseService {
|
|||||||
async syncInventory() {
|
async syncInventory() {
|
||||||
const client = await this.getClient()
|
const client = await this.getClient()
|
||||||
const variants = await this.productVariantService_.list()
|
const variants = await this.productVariantService_.list()
|
||||||
return Promise.all(
|
|
||||||
variants.map(async (v) => {
|
|
||||||
const brightpearlProduct = await this.retrieveProductBySKU(v.sku)
|
|
||||||
if (!brightpearlProduct) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const { productId } = brightpearlProduct
|
let search = true
|
||||||
const availability = await client.products.retrieveAvailability(
|
let bpProducts = []
|
||||||
productId
|
while (search) {
|
||||||
)
|
const { products, metadata } = await client.products.search(search)
|
||||||
const onHand = availability[productId].total.onHand
|
bpProducts = [...bpProducts, ...products]
|
||||||
|
if (metadata.morePagesAvailable) {
|
||||||
|
search = `firstResult=${metadata.lastResult + 1}`
|
||||||
|
} else {
|
||||||
|
search = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Only update if the inventory levels have changed
|
if (bpProducts.length) {
|
||||||
if (parseInt(v.inventory_quantity) !== parseInt(onHand)) {
|
const productRange = `${bpProducts[0].productId}-${
|
||||||
return this.productVariantService_.update(v._id, {
|
bpProducts[bpProducts.length - 1].productId
|
||||||
inventory_quantity: onHand,
|
}`
|
||||||
})
|
|
||||||
}
|
const availabilities = await client.products.retrieveAvailability(
|
||||||
})
|
productRange
|
||||||
)
|
)
|
||||||
|
return Promise.all(
|
||||||
|
variants.map(async (v) => {
|
||||||
|
const brightpearlProduct = bpProducts.find(
|
||||||
|
(prod) => prod.SKU === v.sku
|
||||||
|
)
|
||||||
|
if (!brightpearlProduct) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const { productId } = brightpearlProduct
|
||||||
|
const availability = availabilities[productId]
|
||||||
|
if (availability) {
|
||||||
|
const onHand = availability.total.onHand
|
||||||
|
|
||||||
|
// Only update if the inventory levels have changed
|
||||||
|
if (parseInt(v.inventory_quantity) !== parseInt(onHand)) {
|
||||||
|
return this.productVariantService_.update(v._id, {
|
||||||
|
inventory_quantity: onHand,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateInventory(productId) {
|
async updateInventory(productId) {
|
||||||
@@ -393,6 +417,7 @@ class BrightpearlService extends BaseService {
|
|||||||
externalRef: fromOrder._id,
|
externalRef: fromOrder._id,
|
||||||
channelId: this.options.channel_id || `1`,
|
channelId: this.options.channel_id || `1`,
|
||||||
installedIntegrationInstanceId: authData.installation_instance_id,
|
installedIntegrationInstanceId: authData.installation_instance_id,
|
||||||
|
statusId: this.options.default_status_id || `3`,
|
||||||
customer: {
|
customer: {
|
||||||
id: customer.contactId,
|
id: customer.contactId,
|
||||||
address: {
|
address: {
|
||||||
|
|||||||
@@ -289,6 +289,18 @@ class BrightpearlClient {
|
|||||||
})
|
})
|
||||||
.then(({ data }) => data.response && data.response[0])
|
.then(({ data }) => data.response && data.response[0])
|
||||||
},
|
},
|
||||||
|
search: (search) => {
|
||||||
|
return this.client_
|
||||||
|
.request({
|
||||||
|
url: `/product-service/product-search?${search}`,
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
return {
|
||||||
|
products: this.buildSearchResults_(data.response),
|
||||||
|
metadata: data.response.metaData,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
retrieveBySKU: (sku) => {
|
retrieveBySKU: (sku) => {
|
||||||
return this.client_
|
return this.client_
|
||||||
.request({
|
.request({
|
||||||
|
|||||||
@@ -254,11 +254,22 @@ var BrightpearlClient = /*#__PURE__*/function () {
|
|||||||
return data.response && data.response[0];
|
return data.response && data.response[0];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
search: function search(_search) {
|
||||||
|
return _this.client_.request({
|
||||||
|
url: "/product-service/product-search?".concat(_search)
|
||||||
|
}).then(function (_ref15) {
|
||||||
|
var data = _ref15.data;
|
||||||
|
return {
|
||||||
|
products: _this.buildSearchResults_(data.response),
|
||||||
|
metadata: data.response.metaData
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
retrieveBySKU: function retrieveBySKU(sku) {
|
retrieveBySKU: function retrieveBySKU(sku) {
|
||||||
return _this.client_.request({
|
return _this.client_.request({
|
||||||
url: "/product-service/product-search?SKU=".concat(sku)
|
url: "/product-service/product-search?SKU=".concat(sku)
|
||||||
}).then(function (_ref15) {
|
}).then(function (_ref16) {
|
||||||
var data = _ref15.data;
|
var data = _ref16.data;
|
||||||
return _this.buildSearchResults_(data.response);
|
return _this.buildSearchResults_(data.response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -270,8 +281,8 @@ var BrightpearlClient = /*#__PURE__*/function () {
|
|||||||
retrieveByEmail: function retrieveByEmail(email) {
|
retrieveByEmail: function retrieveByEmail(email) {
|
||||||
return _this.client_.request({
|
return _this.client_.request({
|
||||||
url: "/contact-service/contact-search?primaryEmail=".concat(email)
|
url: "/contact-service/contact-search?primaryEmail=".concat(email)
|
||||||
}).then(function (_ref16) {
|
}).then(function (_ref17) {
|
||||||
var data = _ref16.data;
|
var data = _ref17.data;
|
||||||
return _this.buildSearchResults_(data.response);
|
return _this.buildSearchResults_(data.response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -280,8 +291,8 @@ var BrightpearlClient = /*#__PURE__*/function () {
|
|||||||
url: "/contact-service/contact",
|
url: "/contact-service/contact",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: customerData
|
data: customerData
|
||||||
}).then(function (_ref17) {
|
}).then(function (_ref18) {
|
||||||
var data = _ref17.data;
|
var data = _ref18.data;
|
||||||
return data.response;
|
return data.response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -337,7 +348,7 @@ var BrightpearlClient = /*#__PURE__*/function () {
|
|||||||
return request;
|
return request;
|
||||||
});
|
});
|
||||||
this.client_.interceptors.response.use(undefined, /*#__PURE__*/function () {
|
this.client_.interceptors.response.use(undefined, /*#__PURE__*/function () {
|
||||||
var _ref18 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(error) {
|
var _ref19 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(error) {
|
||||||
var response;
|
var response;
|
||||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -388,7 +399,7 @@ var BrightpearlClient = /*#__PURE__*/function () {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return function (_x) {
|
return function (_x) {
|
||||||
return _ref18.apply(this, arguments);
|
return _ref19.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-contentful",
|
"name": "medusa-plugin-contentful",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Contentful plugin for Medusa Commerce",
|
"description": "Contentful plugin for Medusa Commerce",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"contentful-management": "^5.27.1",
|
"contentful-management": "^5.27.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"redis": "^3.0.2"
|
"redis": "^3.0.2"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-economic",
|
"name": "medusa-plugin-economic",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-economic",
|
"name": "medusa-plugin-economic",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "E-conomic financial reporting",
|
"description": "E-conomic financial reporting",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"moment": "^2.27.0"
|
"moment": "^2.27.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-permissions",
|
"name": "medusa-plugin-permissions",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Role permission for Medusa core",
|
"description": "Role permission for Medusa core",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
"medusa-interfaces": "1.x"
|
"medusa-interfaces": "1.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"mongoose": "^5.8.0"
|
"mongoose": "^5.8.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-segment",
|
"name": "medusa-plugin-segment",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Segment Analytics",
|
"description": "Segment Analytics",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24"
|
"medusa-test-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-sendgrid",
|
"name": "medusa-plugin-sendgrid",
|
||||||
"version": "1.0.0-alpha.25",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "SendGrid transactional emails",
|
"description": "SendGrid transactional emails",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"@sendgrid/mail": "^7.1.1",
|
"@sendgrid/mail": "^7.1.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24"
|
"medusa-test-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-economic",
|
"name": "medusa-plugin-economic",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-slack-notification",
|
"name": "medusa-plugin-slack-notification",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Slack notifications",
|
"description": "Slack notifications",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"moment": "^2.27.0"
|
"moment": "^2.27.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-plugin-wishlist",
|
"name": "medusa-plugin-wishlist",
|
||||||
"version": "1.0.0-alpha.26",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Provides /customers/:id/wishlist to add items to a customr's wishlist",
|
"description": "Provides /customers/:id/wishlist to add items to a customr's wishlist",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24"
|
"medusa-test-utils": "^1.0.0-alpha.27"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "medusa-test-utils",
|
"name": "medusa-test-utils",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "Test utils for Medusa",
|
"description": "Test utils for Medusa",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-transform-classes": "^7.9.5",
|
"@babel/plugin-transform-classes": "^7.9.5",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"mongoose": "^5.8.0"
|
"mongoose": "^5.8.0"
|
||||||
},
|
},
|
||||||
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
"gitHead": "3cc7cbe5124cbcbb75f6e1435db4dcfaa2a60408"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@medusajs/medusa",
|
"name": "@medusajs/medusa",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.27",
|
||||||
"description": "E-commerce for JAMstack",
|
"description": "E-commerce for JAMstack",
|
||||||
"main": "dist/app.js",
|
"main": "dist/app.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -61,8 +61,8 @@
|
|||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"joi-objectid": "^3.0.1",
|
"joi-objectid": "^3.0.1",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"medusa-core-utils": "^1.0.0-alpha.24",
|
"medusa-core-utils": "^1.0.0-alpha.27",
|
||||||
"medusa-test-utils": "^1.0.0-alpha.24",
|
"medusa-test-utils": "^1.0.0-alpha.27",
|
||||||
"morgan": "^1.9.1",
|
"morgan": "^1.9.1",
|
||||||
"multer": "^1.4.2",
|
"multer": "^1.4.2",
|
||||||
"passport": "^0.4.0",
|
"passport": "^0.4.0",
|
||||||
@@ -75,4 +75,4 @@
|
|||||||
"winston": "^3.2.1"
|
"winston": "^3.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "27d4e07c5251e43ba6be2d5fa35f1d5287b11043"
|
"gitHead": "27d4e07c5251e43ba6be2d5fa35f1d5287b11043"
|
||||||
}
|
}
|
||||||
@@ -651,13 +651,6 @@ class OrderService extends BaseService {
|
|||||||
})
|
})
|
||||||
.filter(i => !!i)
|
.filter(i => !!i)
|
||||||
|
|
||||||
if (order.fulfillment_status !== "not_fulfilled") {
|
|
||||||
throw new MedusaError(
|
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
|
||||||
"Order is already fulfilled"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const { shipping_methods } = order
|
const { shipping_methods } = order
|
||||||
|
|
||||||
// prepare update object
|
// prepare update object
|
||||||
|
|||||||
Reference in new issue
Block a user