producteca-sdk
Advanced tools
Comparing version 0.0.41 to 0.0.43
@@ -11,2 +11,3 @@ (function() { | ||
this.toJSON = __bind(this.toJSON, this); | ||
this.hasAllDimensions = __bind(this.hasAllDimensions, this); | ||
this.updatePrice = __bind(this.updatePrice, this); | ||
@@ -44,2 +45,10 @@ this.firstVariation = __bind(this.firstVariation, this); | ||
Product.prototype.hasAllDimensions = function() { | ||
return ["width", "height", "length", "weight"].every((function(_this) { | ||
return function(it) { | ||
return _this.dimensions[it] != null; | ||
}; | ||
})(this)); | ||
}; | ||
Product.prototype.toJSON = function() { | ||
@@ -46,0 +55,0 @@ return _.omit(this, _.isFunction); |
@@ -46,2 +46,3 @@ (function() { | ||
this.updateSalesOrder = __bind(this.updateSalesOrder, this); | ||
this.getSalesOrderAndFullProducts = __bind(this.getSalesOrderAndFullProducts, this); | ||
this.getSalesOrder = __bind(this.getSalesOrder, this); | ||
@@ -117,2 +118,17 @@ this.getSalesOrders = __bind(this.getSalesOrders, this); | ||
ProductecaApi.prototype.getSalesOrderAndFullProducts = function(id) { | ||
return this.getSalesOrder(id).then((function(_this) { | ||
return function(salesOrder) { | ||
var productIds; | ||
productIds = _.map(salesOrder.lines, "product.id").join(","); | ||
return _this.getMultipleProducts(productIds).then(function(products) { | ||
return { | ||
salesOrder: salesOrder, | ||
products: products | ||
}; | ||
}); | ||
}; | ||
})(this)); | ||
}; | ||
ProductecaApi.prototype.updateSalesOrder = function(id, update) { | ||
@@ -119,0 +135,0 @@ return this["return"](this.client.putAsync("/salesorders/" + id, update)); |
@@ -48,3 +48,6 @@ (function() { | ||
} | ||
] | ||
], | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
} | ||
@@ -94,3 +97,6 @@ ] | ||
} | ||
] | ||
], | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
} | ||
@@ -150,3 +156,6 @@ ] | ||
} | ||
] | ||
], | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
} | ||
@@ -240,3 +249,6 @@ ] | ||
], | ||
barcode: "915004085101" | ||
barcode: "915004085101", | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
}, { | ||
@@ -254,3 +266,6 @@ pictures: [ | ||
], | ||
barcode: "915004085102" | ||
barcode: "915004085102", | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
} | ||
@@ -257,0 +272,0 @@ ] |
@@ -305,3 +305,6 @@ (function() { | ||
} | ||
] | ||
], | ||
primaryColor: void 0, | ||
secondaryColor: void 0, | ||
size: void 0 | ||
} | ||
@@ -308,0 +311,0 @@ ] |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.0.41", | ||
"version": "0.0.43", | ||
"main": "build/sdk.js", | ||
@@ -11,0 +11,0 @@ "dependencies": { |
# Producteca SDK |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84929
1502