producteca-sdk
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -15,6 +15,9 @@ (function() { | ||
CouriersApi.prototype.getZplOf = function(arg, arg1) { | ||
var jwttoken, salesOrderId, shipmentId, url; | ||
CouriersApi.prototype.getDownloadLink = function(arg, arg1, type) { | ||
var jwttoken, salesOrderId, shipmentId; | ||
salesOrderId = arg.id; | ||
shipmentId = arg1.id; | ||
if (type == null) { | ||
type = "pdf"; | ||
} | ||
jwttoken = jwt.encode([ | ||
@@ -26,4 +29,7 @@ { | ||
], this.jsonWebTokenSecret); | ||
url = "/couriers/shipments/label?shipments=" + jwttoken + "&type=zpl2&access_token=" + this.productecaToken; | ||
return this.client.getAsync(url, { | ||
return "/couriers/shipments/label?shipments=" + jwttoken + "&type=" + type + "&access_token=" + this.productecaToken; | ||
}; | ||
CouriersApi.prototype.getZplOf = function(order, shipment) { | ||
return this.client.getAsync(getDownloadLink(order, shipment, "zpl2"), { | ||
raw: true | ||
@@ -30,0 +36,0 @@ }); |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"main": "build/sdk.js", | ||
@@ -11,0 +11,0 @@ "dependencies": { |
30607
748